-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrender.h
86 lines (65 loc) · 2.07 KB
/
render.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include "stdafx.h"
#include "gl/gl.h"
#include "gl/glu.h"
#include "keys.h"
#include <memory>
#pragma push(pack, 1)
typedef struct image_s {
char imgName[MAX_QPATH];
char mid[24];
unsigned int texnum;
char rest[40];
//at 88 is texnum
} image_t; //size 128
#pragma pop(1)
#define tr_numImages (*(UINT32*)0x16C983C)
static image_t **tr_images = (image_t**)0x16C9840;
typedef struct shader_s {
char name[MAX_QPATH];
} shader_t;
#define LIGHTMAP_2D -4
#define SMALLCHAR_WIDTH 7
#define SMALLCHAR_HEIGHT 17
#define SMALLCHAR_SCALE 0.3
//taken from 0.3 fontscale
static float vColorBlack[4] = { 0,0,0,1 };
static float vColorWhite[4] = { 1, 1, 1, 1 };
static float vColorSelected[4] = { 1, 1, 0, 1 };
extern int *whiteShader;
static int CG_DrawStrlen(const char *str) {
const char *s = str;
int count = 0;
while (*s) {
if (Q_IsColorString(s)) {
s += 2;
}
else {
count++;
s++;
}
}
return count;
}
int R_RegisterShaderNoMip(const char* name);
typedef shader_t* (*R_FindShader_t)(const char*, int, int);
extern R_FindShader_t R_FindShader;
typedef int(*RE_RegisterShaderNoMip_t)(const char*);
typedef int(*RE_RegisterShader_t)(const char*);
extern RE_RegisterShaderNoMip_t RE_RegisterShaderNoMip;
extern RE_RegisterShader_t RE_RegisterShader;
typedef void(__cdecl *SCR_DrawPic_t)(float x, float y, float width, float height, int hShader);
extern SCR_DrawPic_t SCR_DrawPic;
typedef void(*RE_SetColor_t)(const float *rgba);
extern RE_SetColor_t RE_SetColor;
typedef void(*SCR_AdjustFrom640_t)(float *x, float *y, float *w, float *h);
extern SCR_AdjustFrom640_t SCR_AdjustFrom640;
/*
typedef void (*SCR_DrawSmallStringExt_t)(const char*, float*, int y, int x);
extern SCR_DrawSmallStringExt_t SCR_DrawSmallStringExt;
typedef void (*SCR_DrawSmallChar_t)(char,int,int,int);
extern SCR_DrawSmallChar_t SCR_DrawSmallChar;
*/
typedef void (QDECL *SCR_DrawString_t)(float x, float y, int font, float scale, float* color, const char* text, float spacing, int limit, int flags);
extern SCR_DrawString_t SCR_DrawString;
typedef void(*RB_SetGL2D_t)(void);
extern RB_SetGL2D_t RB_SetGL2D;