mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 13:50:53 +00:00
49ae9573b8
made a load of functions static (just code style stuff). downloads menu now deselects any autoselected items, to avoid confusion. csqc traces can now hit networked ents. I probably need to make some more tweaks to this. arg completion for flocate+dir+modelviewer commands. fix autosave not cycling saves when using the vanilla save format. fix patch collisions with q3bsp submodels. md3 now supports framegroups too. added some more buttons to make xonotic happy. gl_polyblend 2 shows the screen flashes at the edge of the screen instead of the middle. colormod no longer applies to fullbrights (matching DP). this fixes an issue with xonotic. fix uninitialised local that was causing issues with bones used as tags. rewrote qc search_* to use a dynamic array instead of a linked list. this should make it faster to read when there's many handles open at a time. fte's saved games can now save buffers properly. fix issue with raster freetype fonts (read: coloured emoji). initial support for struct-based classes (instead of entity-based classes). still has issues. execing configs in untrusted packages will no longer run out of sync (fixing a number of afterquake issues). fix stupid bug with the te_gunshot/etc builtins. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5317 fc73d0e0-1445-4013-8a0c-d673dee63da5
162 lines
5.5 KiB
C
162 lines
5.5 KiB
C
//ezquake likes this
|
|
#include <assert.h>
|
|
#include <ctype.h>
|
|
|
|
//ezquake sucks. I'd fix these, but that'd make diffs more messy.
|
|
#pragma GCC diagnostic ignored "-Wold-style-definition"
|
|
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
|
|
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
|
|
|
//ezquake types.
|
|
#define byte qbyte
|
|
#define qbool qboolean
|
|
#define Com_Printf Con_Printf
|
|
#define Com_DPrintf Con_DPrintf
|
|
#define Cvar_Find(n) pCvar_GetNVFDG(n,NULL,0,NULL,NULL)
|
|
#define Cvar_SetValue(var,val) pCvar_SetFloat(var->name,val)
|
|
#define Cvar_Set(var,val) pCvar_SetString(var->name,val)
|
|
#define Cmd_Argc pCmd_Argc
|
|
#define Cbuf_AddText(x) pCmd_AddText(x,false)
|
|
#define Sys_Error(x) pSys_Error(x)
|
|
#define Q_calloc calloc
|
|
#define Q_malloc malloc
|
|
#define Q_strdup strdup
|
|
#define Q_free free
|
|
#define Q_rint(x) ((int)(x+0.5))
|
|
#define Q_atoi atoi
|
|
#define strlcpy Q_strlcpy
|
|
#define strlcat Q_strlcat
|
|
#undef snprintf
|
|
#define snprintf Q_snprintf
|
|
|
|
#undef mpic_t
|
|
#define mpic_t void
|
|
|
|
|
|
#define MV_VIEWS 4
|
|
|
|
|
|
extern float cursor_x;
|
|
extern float cursor_y;
|
|
extern int host_screenupdatecount;
|
|
extern cvar_t *scr_newHud;
|
|
extern cvar_t *cl_multiview;
|
|
|
|
#define Cam_TrackNum() cl.tracknum
|
|
#define spec_track cl.tracknum
|
|
#define autocam ((spec_track==-1)?CAM_NONE:CAM_TRACK)
|
|
#define CAM_TRACK true
|
|
#define CAM_NONE false
|
|
//#define HAXX
|
|
|
|
#define vid plugvid
|
|
#define cls plugcls
|
|
#define cl plugcl
|
|
#define player_info_t plugclientinfo_t
|
|
|
|
struct {
|
|
int intermission;
|
|
int teamplay;
|
|
int deathmatch;
|
|
int stats[MAX_CL_STATS];
|
|
int item_gettime[32];
|
|
char serverinfo[4096];
|
|
player_info_t players[MAX_CLIENTS];
|
|
int playernum;
|
|
int tracknum;
|
|
vec3_t simvel;
|
|
float time;
|
|
float matchstart;
|
|
float faceanimtime;
|
|
qboolean spectator;
|
|
qboolean standby;
|
|
qboolean countdown;
|
|
|
|
int splitscreenview;
|
|
} cl;
|
|
struct {
|
|
int state;
|
|
float min_fps;
|
|
float fps;
|
|
float realtime;
|
|
float frametime;
|
|
qbool mvdplayback;
|
|
int demoplayback;
|
|
} cls;
|
|
struct {
|
|
int width;
|
|
int height;
|
|
// float displayFrequency;
|
|
} vid;
|
|
|
|
|
|
//reimplementations of ezquake functions
|
|
void Draw_SetOverallAlpha(float a);
|
|
void Draw_AlphaFillRGB(float x, float y, float w, float h, qbyte r, qbyte g, qbyte b, qbyte a);
|
|
void Draw_Fill(float x, float y, float w, float h, qbyte pal);
|
|
const char *ColorNameToRGBString (const char *newval);
|
|
byte *StringToRGB(const char *str);
|
|
|
|
#define Draw_String pDraw_String
|
|
|
|
void Draw_EZString(float x, float y, char *str, float scale, qboolean red);
|
|
#define Draw_Alt_String(x,y,s) Draw_EZString(x,y,s,8,true)
|
|
#define Draw_ColoredString(x,y,str,alt) Draw_EZString(x,y,str,8,alt)
|
|
#define Draw_SString(x,y,str,sc) Draw_EZString(x,y,str,8*sc,false)
|
|
#define Draw_SAlt_String(x,y,str,sc) Draw_EZString(x,y,str,8*sc,true)
|
|
|
|
void Draw_SPic(float x, float y, mpic_t *pic, float scale);
|
|
void Draw_SSubPic(float x, float y, mpic_t *pic, float s1, float t1, float s2, float t2, float scale);
|
|
#define Draw_STransPic Draw_SPic
|
|
void Draw_Character(float x, float y, unsigned int ch);
|
|
void Draw_SCharacter(float x, float y, unsigned int ch, float scale);
|
|
|
|
void SCR_DrawWadString(float x, float y, float scale, char *str);
|
|
|
|
void Draw_SAlphaSubPic2(float x, float y, mpic_t *pic, float s1, float t1, float s2, float t2, float w, float h, float alpha);
|
|
|
|
void Draw_AlphaFill(float x, float y, float w, float h, unsigned int pal, float alpha);
|
|
void Draw_AlphaPic(float x, float y, mpic_t *pic, float alpha);
|
|
void Draw_AlphaSubPic(float x, float y, mpic_t *pic, float s1, float t1, float s2, float t2, float alpha);
|
|
void SCR_HUD_DrawBar(int direction, int value, float max_value, float *rgba, int x, int y, int width, int height);
|
|
|
|
mpic_t *Draw_CachePicSafe(const char *name, qbool crash, qbool ignorewad);
|
|
mpic_t *Draw_CacheWadPic(const char *name);
|
|
|
|
int Sbar_TopColor(player_info_t *pi);
|
|
int Sbar_BottomColor(player_info_t *pi);
|
|
char *TP_ParseFunChars(char*, qbool chat);
|
|
char *TP_ItemName(unsigned int itbit);
|
|
|
|
#define Util_SkipChars(src,strip,dst,dstlen) strlcpy(dst,src,dstlen)
|
|
#define Util_SkipEZColors(src,dst,dstlen) strlcpy(dst,src,dstlen)
|
|
|
|
void Replace_In_String(char *string, size_t strsize, char leadchar, int patterns, ...);
|
|
//static qbool Utils_RegExpMatch(char *regexp, char *term) {return true;}
|
|
#define Utils_RegExpMatch(regexp,term) (true)
|
|
|
|
#define clamp(v,min,max) v=bound(min,v,max)
|
|
#define strlen_color(line) (pDraw_StringWidth(8, 0, line)/8.0)
|
|
|
|
#define TIMETYPE_CLOCK 0
|
|
#define TIMETYPE_GAMECLOCK 1
|
|
#define TIMETYPE_GAMECLOCKINV 2
|
|
#define TIMETYPE_DEMOCLOCK 3
|
|
int SCR_GetClockStringWidth(const char *s, qbool big, float scale);
|
|
int SCR_GetClockStringHeight(qbool big, float scale);
|
|
const char* SCR_GetTimeString(int timetype, const char *format);
|
|
void SCR_DrawBigClock(int x, int y, int style, int blink, float scale, const char *t);
|
|
void SCR_DrawSmallClock(int x, int y, int style, int blink, float scale, const char *t);
|
|
|
|
typedef struct
|
|
{
|
|
qbyte c[4];
|
|
} clrinfo_t;
|
|
void Draw_ColoredString3(float x, float y, const char *str, clrinfo_t *clr, int huh, int wut);
|
|
void UI_PrintTextBlock();
|
|
void Draw_AlphaRectangleRGB(int x, int y, int w, int h, int foo, int bar, byte r, byte g, byte b, byte a);
|
|
void Draw_AlphaLineRGB(float x1, float y1, float x2, float y2, float width, byte r, byte g, byte b, byte a);
|
|
void Draw_Polygon(int x, int y, vec3_t *vertices, int num_vertices, qbool fill, byte r, byte g, byte b, byte a);
|
|
|
|
//glue
|
|
EBUILTIN(cvar_t*, Cvar_GetNVFDG, (const char *name, const char *defaultval, unsigned int flags, const char *description, const char *groupname));
|