14 Nov 2007

This commit is contained in:
g-cont 2007-11-14 00:00:00 +03:00 committed by Alibek Omarov
parent 02ad53214b
commit f40fce2cb6
25 changed files with 1137 additions and 1379 deletions

View File

@ -15,15 +15,6 @@ SV_Move SV_Trace
SV_ClipMoveToEntity CM_BoxTrace
SV_ClipToLinks SV_ClipMoveToEntities
избавить от параметров командной строки в launch.dll (common.dll может брать их самостоятельно)
loading bar
1. textures
2. models
3. pictures
4. clients
studioframeadvance
studiorewindframe
@ -33,47 +24,25 @@ widthInChars = visible_length
maxchars = length
scroll = visible_offset
Имплементация собственной stdlib
1. Перенести менеджер памяти в launch.dll OK
2. Перенести файловую и виртуальную файловую систему в launch.dll OK
3. Перенести ParseLib в launch.dll OK
4. Перенести threads system в launch.dll OK
5. Перенести таймер в launch.dll OK
6. Перенести определение типа процессора в launch.dll OK
Полная имплементация и подгонка уже существующих систем:
1. Исправить работу cmd для командной строки OK
2. Исправить работу кнопок для меню OK
3. удалить поддержку джойстика OK
4. переписать Field_Key для поддержки новых возможностей OK
5. дописать проигрывание roq файлов OK
6. добавить фонофую картинку за меню (splash.jpg) OK
7. включить управление для игрока OK
8. переписать вecь код рисования 2d (re->DrawPic)
9. Добавить автоматическую систему levelshots OK
10. новая система парсинга худ-программы
11. консолька не всегда готова к приему комманд OK
12. Перенести наконец картинки в отдельную папку OK
13. научить системную консоль убивать color prefixes OK
14. переписать код загрузки уровня OK
15. убить версии библиотек (api_size вполне достаточно) OK
16. Разобраться, наконец, почему небо не грузится OK
17. пофиксить дедикатед консольку OK
18. пофиксить загрузку OK
19. пофиксить вылет движка в release OK
20. убрать мусор из консоли OK
21. заменить все strcpy, strcat на strncpy, strncat
22. исправить парсинг для studiomdl
23. какие-то глюки отсечения визлифов (новый протокол глючит?)
24. иконка не грузится для окошек OK
25. Окончательно сформировать stdlib_api_t OK
1. переписать вecь код рисования 2d (re->DrawPic)
2. новая система парсинга худ-программы OK
3. заменить все strcpy, strcat на strncpy, strncat
4. исправить парсинг для studiomdl
5. какие-то глюки отсечения визлифов (новый протокол глючит?)
6. Окончательно избавиться от SCR_LoadingPlaque
7. Переписать парсинг if для hudprogram OK
8. Документация для hudprogram OK
9. Привести все квары в порядок (описание, место рег-ции)
//==================================================
// то, что уже готово
//==================================================
+исправлен баг в spritegen
+исправлен баг с загрузкой моделей
+добавлен fps counter
+добавлен loading bar
+исправлен баг с лаунчерами
+пофикшена проверка на размер картинки
+консоль теперь показывается только для dev или debug режимов

View File

@ -330,6 +330,7 @@ void ResetSpriteInfo( void )
plump = lumpbuffer;
sprite.version = SPRITE_VERSION_HALF;//normal sprite
sprite.type = SPR_VP_PARALLEL;
sprite.rgbacolor = 0xffffffff;
}
/*

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,16 @@
#include "client.h"
/*
================
SCR_Loading_f
================
*/
void SCR_Loading_f (void)
{
SCR_BeginLoadingPlaque();
}
/*
==================
CL_ScreenshotGetName
@ -78,4 +88,79 @@ void CL_LevelShot_f( void )
sprintf( checkname, "graphics/background/%s.tga", cl.configstrings[CS_NAME] );
if(!FS_FileExists( checkname )) re->ScrShot( checkname, true );
}
/*
=================
CL_SetSky_f
Set a specific sky and rotation speed
=================
*/
void CL_SetSky_f( void )
{
float rotate;
vec3_t axis;
if(Cmd_Argc() < 2)
{
Msg("Usage: sky <basename> <rotate> <axis x y z>\n");
return;
}
if(Cmd_Argc() > 2) rotate = atof(Cmd_Argv(2));
else rotate = 0;
if(Cmd_Argc() == 6)
{
VectorSet(axis, atof(Cmd_Argv(3)), atof(Cmd_Argv(4)), atof(Cmd_Argv(5)));
}
else
{
VectorSet(axis, 0, 0, 1 );
}
re->SetSky(Cmd_Argv(1), rotate, axis);
}
/*
================
SCR_TimeRefresh_f
================
*/
void SCR_TimeRefresh_f (void)
{
int i;
float start, stop;
float time;
if ( cls.state != ca_active )
return;
start = Sys_DoubleTime();
if (Cmd_Argc() == 2)
{
// run without page flipping
re->BeginFrame();
for (i = 0; i < 128; i++)
{
cl.refdef.viewangles[1] = i/128.0*360.0;
re->RenderFrame (&cl.refdef);
}
re->EndFrame();
}
else
{
for (i = 0; i < 128; i++)
{
cl.refdef.viewangles[1] = i/128.0*360.0;
re->BeginFrame();
re->RenderFrame(&cl.refdef);
re->EndFrame();
}
}
stop = Sys_DoubleTime();
time = stop - start;
Msg ("%f seconds (%f fps)\n", time, 128/time);
}

View File

@ -448,7 +448,7 @@ void Con_DrawSolidConsole (float frac)
int lines;
int currentColor;
vec4_t color;
char version[MAX_QPATH];
char curtime[MAX_QPATH];
lines = viddef.height * frac;
if (lines <= 0) return;
@ -465,12 +465,13 @@ void Con_DrawSolidConsole (float frac)
Vector4Set( color, 1, 0, 0, 1 );
SCR_FillRect( 0, y, SCREEN_WIDTH, 2, color );
// draw the version number
re->SetColor(g_color_table[ColorIndex(COLOR_RED)]);
sprintf( version, "Xash %g", XASH_VERSION );
i = strlen( version );
// draw current time
re->SetColor(g_color_table[ColorIndex(COLOR_YELLOW)]);
std.snprintf( curtime, MAX_QPATH, "%s ", timestamp( TIME_TIME_ONLY));
i = strlen( curtime );
for (x = 0; x < i; x++)
SCR_DrawSmallChar( viddef.width - ( i - x ) * SMALLCHAR_WIDTH, (lines - (SMALLCHAR_HEIGHT+SMALLCHAR_HEIGHT/2)), version[x]);
SCR_DrawSmallChar( viddef.width - ( i - x ) * SMALLCHAR_WIDTH, (lines - (SMALLCHAR_HEIGHT+SMALLCHAR_HEIGHT/2)), curtime[x]);
re->SetColor(NULL);
// draw the text
con.vislines = lines;
@ -545,7 +546,6 @@ void Con_DrawConsole( void )
{
// show console in devmode
Con_DrawSolidConsole( 0.5 );
SCR_FillRect( 0, SCREEN_HEIGHT/2, SCREEN_WIDTH, SCREEN_HEIGHT, g_color_table[0] );
}
break;
case ca_disconnected:

View File

@ -495,8 +495,6 @@ void CL_ParseFrame (void)
cl.force_refdef = true;
VectorCopy( cl.frame.playerstate.pmove.origin, cl.predicted_origin );
VectorCopy( cl.frame.playerstate.viewangles, cl.predicted_angles );
if (cls.disable_servercount != cl.servercount && cl.refresh_prepped)
SCR_EndLoadingPlaque (); // get rid of loading plaque
}
cl.sound_prepped = true; // can start mixing ambient sounds

View File

@ -1,138 +0,0 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cl_inv.c -- client inventory screen
#include "client.h"
/*
================
CL_ParseInventory
================
*/
void CL_ParseInventory (void)
{
int i;
for (i = 0; i < MAX_ITEMS; i++)
cl.inventory[i] = MSG_ReadShort (&net_message);
}
/*
================
Inv_DrawString
================
*/
void Inv_DrawString (int x, int y, char *string)
{
while (*string)
{
re->DrawChar (x, y, *string);
x+=8;
string++;
}
}
void SetStringHighBit (char *s)
{
while (*s) *s++ |= 128;
}
/*
================
CL_DrawInventory
================
*/
#define DISPLAY_ITEMS 17
void CL_DrawInventory (void)
{
int i, j;
int num, selected_num, item;
int index[MAX_ITEMS];
char string[1024];
int x, y;
char binding[1024];
char *bind;
int selected;
int top;
selected = cl.frame.playerstate.stats[STAT_SELECTED_ITEM];
num = 0;
selected_num = 0;
for ( i = 0; i < MAX_ITEMS; i++)
{
if (i == selected) selected_num = num;
if (cl.inventory[i])
{
index[num] = i;
num++;
}
}
// determine scroll point
top = selected_num - DISPLAY_ITEMS/2;
if (num - top < DISPLAY_ITEMS) top = num - DISPLAY_ITEMS;
if (top < 0) top = 0;
x = (viddef.width-256)/2;
y = (viddef.height-240)/2;
re->DrawPic (x, y+8, "inventory");
y += 24;
x += 24;
Inv_DrawString (x, y, "hotkey ### item");
Inv_DrawString (x, y+8, "------ --- ----");
y += 16;
for (i = top; i < num && i < top + DISPLAY_ITEMS; i++)
{
item = index[i];
// search for a binding
sprintf (binding, "use %s", cl.configstrings[CS_ITEMS+item]);
bind = "";
for (j = 0; j < 256; j++)
{
if(Key_IsBind(j) && !strcasecmp(Key_IsBind(j), binding))
{
bind = Key_KeynumToString(j);
break;
}
}
sprintf (string, "%6s %3i %s", bind, cl.inventory[item], cl.configstrings[CS_ITEMS+item] );
if (item != selected)
{
SetStringHighBit (string);
}
else // draw a blinky cursor by the selected item
{
if((int)(cls.realtime * 5.0f) & 1)
re->DrawChar (x-8, y, 15);
}
Inv_DrawString (x, y, string);
y += 8;
}
}

View File

@ -391,16 +391,10 @@ Called after an Host_Error was thrown
*/
void CL_Drop (void)
{
if (cls.state == ca_uninitialized)
return;
if (cls.state == ca_disconnected)
return;
if (cls.state == ca_uninitialized) return;
if (cls.state == ca_disconnected) return;
CL_Disconnect ();
// drop loading plaque unless this is the initial game start
if (cls.disable_servercount != -1)
SCR_EndLoadingPlaque (); // get rid of loading plaque
CL_Disconnect();
}

View File

@ -709,12 +709,12 @@ void CL_ParseServerMessage (void)
break;
case svc_inventory:
CL_ParseInventory ();
CG_ParseInventory();
break;
case svc_layout:
s = MSG_ReadString (&net_message);
strncpy (cl.layout, s, sizeof(cl.layout)-1);
strncpy(cl.layout, s, sizeof(cl.layout)-1);
break;
case svc_playerinfo:

View File

@ -13,6 +13,7 @@ cvar_t *scr_centertime;
cvar_t *scr_showpause;
cvar_t *scr_printspeed;
cvar_t *scr_loading;
cvar_t *cl_levelshot_name;
void SCR_TimeRefresh_f( void );
void SCR_Loading_f( void );
@ -63,9 +64,17 @@ Coordinates are 640*480 virtual values
*/
void SCR_DrawPic( float x, float y, float width, float height, char *picname )
{
int w, h;
// to avoid drawing r_notexture image
if(!picname || !*picname ) return;
// get original size
if(width == -1 || height == -1)
{
re->DrawGetPicSize( &w, &h, picname );
width = w, height = h;
}
SCR_AdjustSize( &x, &y, &width, &height );
re->DrawStretchPic (x, y, width, height, 0, 0, 1, 1, picname );
}
@ -245,6 +254,57 @@ void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor,
re->SetColor( NULL );
}
/*
==============
SCR_DrawNet
==============
*/
void SCR_DrawNet( void )
{
if (cls.netchan.outgoing_sequence - cls.netchan.incoming_acknowledged < CMD_BACKUP-1)
return;
SCR_DrawPic( scr_vrect.x+64, scr_vrect.y, 48, 48, "hud/net" );
}
void SCR_DrawFPS( void )
{
float calc;
static double nexttime = 0, lasttime = 0;
static double framerate = 0;
static int framecount = 0;
double newtime;
bool red = false; // fps too low
char fpsstring[32];
float *color;
if(cls.state != ca_active) return;
newtime = Sys_DoubleTime();
if (newtime >= nexttime)
{
framerate = framecount / (newtime - lasttime);
lasttime = newtime;
nexttime = max(nexttime + 1, lasttime - 1);
framecount = 0;
}
framecount++;
calc = framerate;
if ((red = (calc < 1.0f)))
{
std.snprintf(fpsstring, sizeof(fpsstring), "%4i spf", (int)(1.0f / calc + 0.5));
color = g_color_table[1];
}
else
{
std.snprintf(fpsstring, sizeof(fpsstring), "%4i fps", (int)(calc + 0.5));
color = g_color_table[3];
}
SCR_DrawBigStringColor(SCREEN_WIDTH - 146, SCREEN_HEIGHT - 32, fpsstring, color );
}
/*
==================
SCR_UpdateScreen
@ -275,7 +335,7 @@ void SCR_UpdateScreen( void )
V_RenderHUD();
break;
default:
Host_Error("SCR_DrawScreenField: bad cls.state" );
Host_Error("SCR_UpdateScreen: bad cls.state" );
break;
}
@ -289,14 +349,15 @@ SCR_Init
*/
void SCR_Init (void)
{
scr_showpause = Cvar_Get ("scr_showpause", "1", 0);
scr_centertime = Cvar_Get ("scr_centertime", "2.5", 0);
scr_printspeed = Cvar_Get ("scr_printspeed", "8", 0);
scr_showpause = Cvar_Get("scr_showpause", "1", 0);
scr_centertime = Cvar_Get("scr_centertime", "2.5", 0);
scr_printspeed = Cvar_Get("scr_printspeed", "8", 0);
cl_levelshot_name = Cvar_Get("cl_levelshot_name", "common/black", 0 );
// register our commands
Cmd_AddCommand ("timerefresh", SCR_TimeRefresh_f);
Cmd_AddCommand ("loading", SCR_Loading_f);
Cmd_AddCommand ("skyname", CG_SetSky_f );
Cmd_AddCommand ("skyname", CL_SetSky_f );
scr_initialized = true;

View File

@ -54,6 +54,19 @@ lightstyle_t r_lightstyles[MAX_LIGHTSTYLES];
char cl_weaponmodels[MAX_CLIENTWEAPONMODELS][MAX_QPATH];
int num_cl_weaponmodels;
int entitycmpfnc( const entity_t *a, const entity_t *b )
{
// all other models are sorted by model then skin
if ( a->model == b->model )
{
return ((int)a->image - (int)b->image);
}
else
{
return ((int)a->model - (int)b->model);
}
}
/*
====================
V_ClearScene
@ -274,10 +287,10 @@ void CL_PrepRefresh( void )
return; // no map loaded
// get splash name
sprintf( cl.levelshot_name, "background/%s.tga", cl.configstrings[CS_NAME] );
if(!FS_FileExists(va("graphics/%s", cl.levelshot_name)))
Cvar_Set( "cl_levelshot_name", va("background/%s.tga", cl.configstrings[CS_NAME]));
if(!FS_FileExists(va("graphics/%s", Cvar_VariableString("cl_levelshot_name"))))
{
strcpy( cl.levelshot_name, "common/black" );
Cvar_Set("cl_levelshot_name", "common/black");
cl.make_levelshot = true; // make levelshot
}
Con_Close();
@ -338,7 +351,6 @@ void CL_PrepRefresh( void )
else cl.model_clip[i] = NULL;
}
Cvar_SetValue("scr_loading", scr_loading->value + 50.0f/mdlcount );
Msg("loading models %g\n", scr_loading->value + 50.0f/mdlcount );
SCR_UpdateScreen();
}
@ -367,7 +379,7 @@ void CL_PrepRefresh( void )
// set sky textures and speed
SCR_UpdateScreen();
rotate = atof(cl.configstrings[CS_SKYROTATE]);
CG_StringToVector( axis, cl.configstrings[CS_SKYAXIS] );
std.atov( axis, cl.configstrings[CS_SKYAXIS], 3 );
Msg("Sky Vector %g %g %g\n", axis[0], axis[1], axis[2] );
re->SetSky( cl.configstrings[CS_SKY], rotate, axis);
Cvar_SetValue("scr_loading", 100.0f ); // all done
@ -440,8 +452,6 @@ V_RenderView
*/
void V_RenderView( void )
{
extern int entitycmpfnc( const entity_t *, const entity_t * );
if (cls.state != ca_active) return;
if (!cl.refresh_prepped) return; // still loading
@ -538,17 +548,9 @@ bool V_PreRender( void )
re->BeginFrame();
// wide aspect ratio screens need to have the sides cleared
// unless they are displaying game renderings
if ( cls.state != ca_active )
{
if( viddef.width * 480 > viddef.height * 640 )
{
re->SetColor( g_color_table[0] );
re->DrawStretchPic( 0, 0, viddef.width, viddef.height, 0, 0, 1, 1, "common/black" );
re->SetColor( NULL );
}
}
// clear screen
SCR_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, g_color_table[0] );
return true;
}
@ -560,6 +562,8 @@ V_PostRender
*/
void V_PostRender( void )
{
SCR_DrawNet();
SCR_DrawFPS();
Con_DrawConsole();
M_Draw();
re->EndFrame();

View File

@ -56,12 +56,41 @@ typedef struct field_s
int maxchars; // menu stuff
} field_t;
typedef struct cg_alias_s
typedef struct cg_stats_s
{
char name[MAX_QPATH];
uint value;
} cg_alias_t;
} cg_stats_t;
typedef struct cg_cvars_s
{
char name[MAX_QPATH];
char cvar[MAX_QPATH];
} cg_cvars_t;
typedef struct cg_def_s
{
int val[2];
int op;
} cg_def_t;
// cg expression types
enum
{
OP_UNKNOWN = 0,
OP_LOGIC_OR,
OP_LOGIC_AND,
OP_EQUAL,
OP_NOTEQUAL,
OP_MORE,
OP_MORE_OR_EQUAL,
OP_SMALLER,
OP_SMALLER_OR_EQUAL,
OP_WITH,
};
typedef struct
{
@ -150,7 +179,6 @@ typedef struct
char centerPrint[1024];
int centerPrintLines;
char levelshot_name[MAX_QPATH];
bool make_levelshot;
//
@ -254,12 +282,17 @@ typedef struct
uint hud_program_size;
// hudprogram stack
char cg_progname[MAX_QPATH];
int cg_program_depth;
char cg_function[MAX_QPATH];
char cg_builtin[MAX_QPATH];
char cg_tempstring[MAX_QPATH];
int cg_depth;
int cg_depth2; // used for bounds chekiing
char cg_argv[MAX_PARMS][MAX_QPATH];
uint cg_argc;
cg_alias_t cg_alias[MAX_STATS];
uint cg_numaliases;
cg_stats_t cg_stats[MAX_STATS];
uint cg_numstats;
cg_cvars_t cg_cvars[128];
uint cg_numcvars;
vec4_t cg_color;
} client_static_t;
@ -311,6 +344,7 @@ extern cvar_t *cl_lightlevel; // FIXME HACK
extern cvar_t *cl_paused;
extern cvar_t *cl_timedemo;
extern cvar_t *cl_levelshot_name;
extern cvar_t *cl_vwep;
@ -339,9 +373,7 @@ extern entity_state_t cl_parse_entities[MAX_PARSE_ENTITIES];
extern netadr_t net_from;
extern sizebuf_t net_message;
void DrawString (int x, int y, char *s);
void DrawAltString (int x, int y, char *s); // toggle high bit
bool CL_CheckOrDownloadFile (char *filename);
bool CL_CheckOrDownloadFile (char *filename);
void CL_AddNetgraph (void);
@ -444,6 +476,7 @@ void CL_RegisterSounds (void);
void CL_Quit_f (void);
void CL_ScreenShot_f( void );
void CL_LevelShot_f( void );
void CL_SetSky_f( void );
void IN_Accumulate (void);
void CL_ParseLayout (void);
@ -572,14 +605,6 @@ void M_Menu_Main_f (void);
void M_ForceMenuOff (void);
void M_AddToServerList (netadr_t adr, char *info);
//
// cl_inv.c
//
void CL_ParseInventory (void);
void CL_KeyInventory (int key);
void CL_DrawInventory (void);
//
// cl_pred.c
//

View File

@ -70,7 +70,6 @@ void SCR_SizeUp (void);
void SCR_SizeDown (void);
void SCR_CenterPrint (char *str);
void SCR_BeginLoadingPlaque (void);
void SCR_EndLoadingPlaque (void);
extern cvar_t *crosshair;
@ -85,21 +84,23 @@ void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor,
void SCR_DrawStringExt( int x, int y, float size, const char *string, float *setColor, bool forceColor );
void SCR_DrawBigString( int x, int y, const char *s, float alpha );
void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color );
void SCR_DrawFPS( void );
void SCR_DrawNet( void );
//
// cl_user.c
//
void CG_SetSky_f( void );
void CG_DrawCenterString( void );
void CG_CenterPrint( const char *str, int y, int charWidth );
float *CG_FadeColor( float starttime, float endtime );
void CG_DrawCenterPic( int w, int h, char *picname );
void CG_StringToVector( float *vec, const char *string );
void CG_ExecuteProgram( char *section );
bool CG_ExecBuiltins( void );
void CG_MakeLevelShot( void );
void CG_DrawLoading( void );
void CG_DrawNet( void );
void CG_DrawPause( void );
void CG_Init( void );
void CG_ParseInventory( void );
void CG_DrawInventory( void );
void CG_DrawLayout( void );
#endif//SCREEN_H

View File

@ -513,7 +513,7 @@ Loads in the map and all submodels
*/
cmodel_t *CM_LoadMap (char *name, bool clientload, unsigned *checksum)
{
unsigned *buf;
uint *buf;
int i;
dheader_t header;
int length;
@ -521,7 +521,7 @@ cmodel_t *CM_LoadMap (char *name, bool clientload, unsigned *checksum)
map_noareas = Cvar_Get ("map_noareas", "0", 0);
if(!strcmp (map_name, name) && (clientload || !Cvar_VariableValue ("flushmap")) )
if(!strcmp(map_name, name) && (clientload || !Cvar_VariableValue ("flushmap")) )
{
*checksum = last_checksum;
if (!clientload)
@ -584,11 +584,12 @@ cmodel_t *CM_LoadMap (char *name, bool clientload, unsigned *checksum)
CMod_LoadEntityString (&header.lumps[LUMP_ENTITIES]);
Phys->LoadBSP( buf ); // create physics collision
Mem_Free( buf ); // release map buffer
CM_InitBoxHull ();
memset (portalopen, 0, sizeof(portalopen));
memset(portalopen, 0, sizeof(portalopen));
CM_FloodAreaConnections ();
strcpy (map_name, name);
return &map_cmodels[0];
@ -1743,7 +1744,7 @@ cmodel_t *CM_StudioModel (char *name, byte *buffer)
}
out = &map_cmodels[numcmodels + numsmodels];
out->extradata = buffer;
out->extradata = NULL;//buffer;
out->numframes = 0;//reset sprite info
strncpy(out->name, name, sizeof(out->name));
@ -1784,24 +1785,27 @@ cmodel_t *CM_SpriteModel (char *name, byte *buffer)
out->maxs[0] = out->maxs[1] = phdr->width / 2;
out->mins[2] = -phdr->height / 2;
out->maxs[2] = phdr->height / 2;
numsmodels++;
return out;
}
cmodel_t *CM_LoadModel ( int modelindex )
cmodel_t *CM_LoadModel( int modelindex )
{
char name[MAX_QPATH];
byte *buffer;
cmodel_t *mod = NULL;
int i = numcmodels;
int max_models = numcmodels + numsmodels;
int i, max_models = numcmodels + numsmodels;
// check for preloading
strncpy(name, sv.configstrings[CS_MODELS + modelindex], MAX_QPATH );
if(name[0] == '*') return CM_InlineModel( name ); //skip bmodels
if(name[0] == '*')
{
MsgDev(D_NOTE, "CM_LoadModel: load %s\n", name );
return CM_InlineModel( name ); // skip bmodels
}
for(i = 0; i < max_models; i++ )
for(i = numcmodels; i < max_models; i++ )
{
mod = map_cmodels + i;
if(!stricmp(name, mod->name))
@ -1819,6 +1823,7 @@ cmodel_t *CM_LoadModel ( int modelindex )
MsgWarn("CM_LoadModel: %s not found\n", name );
return NULL;
}
MsgDev(D_NOTE, "CM_LoadModel: load %s\n", name );
buffer = FS_LoadFile (name, NULL );
// call the apropriate loader
@ -1831,6 +1836,7 @@ cmodel_t *CM_LoadModel ( int modelindex )
mod = CM_SpriteModel( name, buffer );
break;
}
Mem_Free( buffer );
return mod;
}

View File

@ -26,7 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static int m_main_cursor;
#define NUM_CURSOR_FRAMES 15
#define NUM_CURSOR_FRAMES 15
#define CHAR_STEP 20
static char *menu_in_sound = "misc/menu1.wav";
static char *menu_move_sound = "misc/menu2.wav";
@ -77,7 +78,7 @@ static void M_Banner( char *name )
int w, h;
re->DrawGetPicSize (&w, &h, name );
re->DrawPic( viddef.width / 2 - w / 2, viddef.height / 2 - 110, name );
SCR_DrawPic( SCREEN_WIDTH / 2 - w / 2, SCREEN_HEIGHT / 2 - 110, w, h, name );
}
void M_PushMenu ( void (*draw) (void), const char *(*key) (int k) )
@ -236,32 +237,22 @@ higher res screens.
*/
void M_DrawCharacter (int cx, int cy, int num)
{
re->DrawChar ( cx + ((viddef.width - 320)>>1), cy + ((viddef.height - 240)>>1), num);
SCR_DrawSmallChar( cx + ((SCREEN_WIDTH - SMALLCHAR_WIDTH)>>1), cy + ((SCREEN_HEIGHT - SMALLCHAR_HEIGHT)>>1), num);
}
void M_Print (int cx, int cy, char *str)
{
while (*str)
{
M_DrawCharacter (cx, cy, (*str)+128);
str++;
cx += 8;
}
SCR_DrawSmallStringExt( cx, cy, str, g_color_table[3], true );
}
void M_PrintWhite (int cx, int cy, char *str)
{
while (*str)
{
M_DrawCharacter (cx, cy, *str);
str++;
cx += 8;
}
SCR_DrawSmallStringExt( cx, cy, str, g_color_table[7], true );
}
void M_DrawPic (int x, int y, char *pic)
{
re->DrawPic (x + ((viddef.width - 320)>>1), y + ((viddef.height - 240)>>1), pic);
SCR_DrawPic(x + ((SCREEN_WIDTH - 320)>>1), y + ((SCREEN_HEIGHT - 240)>>1), -1, -1, pic);
}
@ -292,7 +283,7 @@ void M_DrawCursor( int x, int y, int f )
}
sprintf( cursorname, "menu/m_cursor%d", f );
re->DrawPic( x, y, cursorname );
SCR_DrawPic( x, y, -1, -1, cursorname );
}
void M_DrawTextBox (int x, int y, int width, int lines)
@ -372,29 +363,27 @@ void M_Main_Draw (void)
{
re->DrawGetPicSize( &w, &h, names[i] );
if ( w > widest )
widest = w;
if ( w > widest ) widest = w;
totalheight += ( h + 12 );
}
ystart = ( viddef.height / 2 - 110 );
xoffset = ( viddef.width - widest + 70 ) / 2;
ystart = ( SCREEN_HEIGHT / 2 - 110 );
xoffset = ( SCREEN_WIDTH - widest + 70 ) / 2;
for ( i = 0; names[i] != 0; i++ )
{
if ( i != m_main_cursor )
re->DrawPic( xoffset, ystart + i * 40 + 13, names[i] );
SCR_DrawPic( xoffset, ystart + i * 40 + 13, -1, -1, names[i] );
}
strcpy( litname, names[m_main_cursor] );
strncat( litname, "_sel", 80 );
re->DrawPic( xoffset, ystart + m_main_cursor * 40 + 13, litname );
SCR_DrawPic( xoffset, ystart + m_main_cursor * 40 + 13, -1, -1, litname );
M_DrawCursor( xoffset - 25, ystart + m_main_cursor * 40 + 11, (int)(cls.realtime * 8.0f) % NUM_CURSOR_FRAMES );
re->DrawGetPicSize( &w, &h, "menu/m_main_plaque" );
re->DrawPic( xoffset - 30 - w, ystart, "menu/m_main_plaque" );
re->DrawPic( xoffset - 30 - w, ystart + h + 5, "menu/m_main_logo" );
SCR_DrawPic( xoffset - 30 - w, ystart, w, h, "menu/m_main_plaque" );
SCR_DrawPic( xoffset - 30 - w, ystart + h + 5, -1, -1, "menu/m_main_logo" );
}
@ -494,7 +483,7 @@ static void StartNetworkServerFunc( void *unused )
void Multiplayer_MenuInit( void )
{
s_multiplayer_menu.x = viddef.width * 0.50 - 64;
s_multiplayer_menu.x = SCREEN_WIDTH * 0.50 - 64;
s_multiplayer_menu.nitems = 0;
s_join_network_server_action.generic.type = MTYPE_ACTION;
@ -647,10 +636,8 @@ static void M_FindKeysForCommand (char *command, int *twokeys)
static void KeyCursorDrawFunc( menuframework_s *menu )
{
if ( bind_grab )
re->DrawChar( menu->x, menu->y + menu->cursor * 9, '=' );
else
re->DrawChar( menu->x, menu->y + menu->cursor * 9, 12 + (( int ) (cls.realtime * 5.0f) & 1 ));
if ( bind_grab ) SCR_DrawSmallChar( menu->x, menu->y + menu->cursor * 9, '=' );
else SCR_DrawSmallChar( menu->x, menu->y + menu->cursor * 9, 12 + (( int ) (cls.realtime * 5.0f) & 1 ));
}
static void DrawKeyBindingFunc( void *self )
@ -703,7 +690,7 @@ static void Keys_MenuInit( void )
int y = 0;
int i = 0;
s_keys_menu.x = viddef.width * 0.50;
s_keys_menu.x = SCREEN_WIDTH * 0.50;
s_keys_menu.nitems = 0;
s_keys_menu.cursordraw = KeyCursorDrawFunc;
@ -1140,8 +1127,8 @@ void Options_MenuInit( void )
/*
** configure controls menu and menu items
*/
s_options_menu.x = viddef.width / 2;
s_options_menu.y = viddef.height / 2 - 58;
s_options_menu.x = SCREEN_WIDTH / 2;
s_options_menu.y = SCREEN_HEIGHT / 2 - 58;
s_options_menu.nitems = 0;
s_options_sfxvolume_slider.generic.type = MTYPE_SLIDER;
@ -1399,7 +1386,7 @@ void M_Credits_MenuDraw( void )
int i, x, y;
float *color;
y = viddef.height - (( cls.realtime - credits_start_time ) * 40.0f );
y = SCREEN_HEIGHT - (( cls.realtime - credits_start_time ) * 40.0f );
// draw the credits
for ( i = 0; i < credit_numlines && credits[i]; i++, y += 20 )
@ -1408,11 +1395,11 @@ void M_Credits_MenuDraw( void )
if( y <= -16 && i != credit_numlines - 1) continue;
x = ( SCREEN_WIDTH - BIGCHAR_WIDTH * ColorStrlen( credits[i] ))/2;
if((y < (viddef.height - BIGCHAR_HEIGHT) / 2) && i == credit_numlines - 1)
if((y < (SCREEN_HEIGHT - BIGCHAR_HEIGHT) / 2) && i == credit_numlines - 1)
{
if(!credits_fade_time) credits_fade_time = cls.realtime;
color = CG_FadeColor( credits_fade_time, credits_show_time );
if(color) SCR_DrawBigStringColor( x, (viddef.height-BIGCHAR_HEIGHT)/2, credits[i], color);
if(color) SCR_DrawBigStringColor( x, (SCREEN_HEIGHT-BIGCHAR_HEIGHT)/2, credits[i], color);
}
else SCR_DrawBigString( x, y, credits[i], 1.0f );
}
@ -1559,7 +1546,7 @@ void Game_MenuInit( void )
0
};
s_game_menu.x = viddef.width * 0.50;
s_game_menu.x = SCREEN_WIDTH * 0.50;
s_game_menu.nitems = 0;
s_easy_game_action.generic.type = MTYPE_ACTION;
@ -1572,14 +1559,14 @@ void Game_MenuInit( void )
s_medium_game_action.generic.type = MTYPE_ACTION;
s_medium_game_action.generic.flags = QMF_LEFT_JUSTIFY;
s_medium_game_action.generic.x = 0;
s_medium_game_action.generic.y = 10;
s_medium_game_action.generic.y = 16;
s_medium_game_action.generic.name = "medium";
s_medium_game_action.generic.callback = MediumGameFunc;
s_hard_game_action.generic.type = MTYPE_ACTION;
s_hard_game_action.generic.flags = QMF_LEFT_JUSTIFY;
s_hard_game_action.generic.x = 0;
s_hard_game_action.generic.y = 20;
s_hard_game_action.generic.y = 32;
s_hard_game_action.generic.name = "hard";
s_hard_game_action.generic.callback = HardGameFunc;
@ -1588,21 +1575,21 @@ void Game_MenuInit( void )
s_load_game_action.generic.type = MTYPE_ACTION;
s_load_game_action.generic.flags = QMF_LEFT_JUSTIFY;
s_load_game_action.generic.x = 0;
s_load_game_action.generic.y = 40;
s_load_game_action.generic.y = 80;
s_load_game_action.generic.name = "load game";
s_load_game_action.generic.callback = LoadGameFunc;
s_save_game_action.generic.type = MTYPE_ACTION;
s_save_game_action.generic.flags = QMF_LEFT_JUSTIFY;
s_save_game_action.generic.x = 0;
s_save_game_action.generic.y = 50;
s_save_game_action.generic.y = 100;
s_save_game_action.generic.name = "save game";
s_save_game_action.generic.callback = SaveGameFunc;
s_credits_action.generic.type = MTYPE_ACTION;
s_credits_action.generic.flags = QMF_LEFT_JUSTIFY;
s_credits_action.generic.x = 0;
s_credits_action.generic.y = 60;
s_credits_action.generic.y = 120;
s_credits_action.generic.name = "credits";
s_credits_action.generic.callback = CreditsFunc;
@ -1679,8 +1666,8 @@ void LoadGame_MenuInit( void )
{
int i;
s_loadgame_menu.x = viddef.width / 2 - 120;
s_loadgame_menu.y = viddef.height / 2 - 58;
s_loadgame_menu.x = SCREEN_WIDTH / 2 - 120;
s_loadgame_menu.y = SCREEN_HEIGHT / 2 - 58;
s_loadgame_menu.nitems = 0;
Create_Savestrings();
@ -1756,8 +1743,8 @@ void SaveGame_MenuInit( void )
{
int i;
s_savegame_menu.x = viddef.width / 2 - 120;
s_savegame_menu.y = viddef.height / 2 - 58;
s_savegame_menu.x = SCREEN_WIDTH / 2 - 120;
s_savegame_menu.y = SCREEN_HEIGHT / 2 - 58;
s_savegame_menu.nitems = 0;
Create_Savestrings();
@ -1899,7 +1886,7 @@ void JoinServer_MenuInit( void )
{
int i;
s_joinserver_menu.x = viddef.width * 0.50 - 120;
s_joinserver_menu.x = SCREEN_WIDTH * 0.50 - 120;
s_joinserver_menu.nitems = 0;
s_joinserver_address_book_action.generic.type = MTYPE_ACTION;
@ -2224,7 +2211,7 @@ void StartServer_MenuInit( void )
/*
** initialize the menu stuff
*/
s_startserver_menu.x = viddef.width * 0.50;
s_startserver_menu.x = SCREEN_WIDTH * 0.50;
s_startserver_menu.nitems = 0;
s_startmap_list.generic.type = MTYPE_SPINCONTROL;
@ -2514,7 +2501,7 @@ void DMOptions_MenuInit( void )
int dmflags = Cvar_VariableValue( "dmflags" );
int y = 0;
s_dmoptions_menu.x = viddef.width * 0.50;
s_dmoptions_menu.x = SCREEN_WIDTH * 0.50;
s_dmoptions_menu.nitems = 0;
s_falls_box.generic.type = MTYPE_SPINCONTROL;
@ -2729,7 +2716,7 @@ void DownloadOptions_MenuInit( void )
};
int y = 0;
s_downloadoptions_menu.x = viddef.width * 0.50;
s_downloadoptions_menu.x = SCREEN_WIDTH * 0.50;
s_downloadoptions_menu.nitems = 0;
s_download_title.generic.type = MTYPE_SEPARATOR;
@ -2822,8 +2809,8 @@ void AddressBook_MenuInit( void )
{
int i;
s_addressbook_menu.x = viddef.width / 2 - 142;
s_addressbook_menu.y = viddef.height / 2 - 58;
s_addressbook_menu.x = SCREEN_WIDTH / 2 - 142;
s_addressbook_menu.y = SCREEN_HEIGHT / 2 - 58;
s_addressbook_menu.nitems = 0;
for ( i = 0; i < NUM_ADDRESSBOOK_ENTRIES; i++ )
@ -3061,8 +3048,8 @@ bool PlayerConfig_MenuInit( void )
}
}
s_player_config_menu.x = viddef.width / 2 - 95;
s_player_config_menu.y = viddef.height / 2 - 97;
s_player_config_menu.x = SCREEN_WIDTH / 2 - 95;
s_player_config_menu.y = SCREEN_HEIGHT / 2 - 97;
s_player_config_menu.nitems = 0;
s_player_name_field.generic.type = MTYPE_FIELD;
@ -3148,8 +3135,8 @@ void PlayerConfig_MenuDraw( void )
memset( &refdef, 0, sizeof( refdef ) );
refdef.x = viddef.width / 2;
refdef.y = viddef.height / 2 - 72;
refdef.x = SCREEN_WIDTH / 2;
refdef.y = SCREEN_HEIGHT / 2 - 72;
refdef.width = 144;
refdef.height = 168;
refdef.fov_x = 50;
@ -3189,13 +3176,13 @@ void PlayerConfig_MenuDraw( void )
Menu_Draw( &s_player_config_menu );
M_DrawTextBox( ( refdef.x ) * ( 320.0F / viddef.width ) - 8, ( viddef.height / 2 ) * ( 240.0F / viddef.height) - 77, refdef.width / 8, refdef.height / 8 );
M_DrawTextBox( ( refdef.x ) * ( 320.0F / SCREEN_WIDTH ) - 8, ( SCREEN_HEIGHT / 2 ) * ( 240.0F / SCREEN_HEIGHT) - 77, refdef.width / 8, refdef.height / 8 );
refdef.height += 4;
re->RenderFrame( &refdef );
strcpy( scratch, "hud/i_fixme" );
re->DrawPic( s_player_config_menu.x - 40, refdef.y, scratch );
SCR_DrawPic( s_player_config_menu.x - 40, refdef.y, -1, -1, scratch );
}
}

View File

@ -23,17 +23,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "client.h"
#include "qmenu.h"
static void Action_DoEnter( menuaction_s *a );
static void Action_Draw( menuaction_s *a );
static void Menu_DrawStatusBar( const char *string );
static void Menulist_DoEnter( menulist_s *l );
static void MenuList_Draw( menulist_s *l );
static void Separator_Draw( menuseparator_s *s );
static void Slider_DoSlide( menuslider_s *s, int dir );
static void Slider_Draw( menuslider_s *s );
static void SpinControl_DoEnter( menulist_s *s );
static void SpinControl_Draw( menulist_s *s );
static void SpinControl_DoSlide( menulist_s *s, int dir );
static void Action_DoEnter( menuaction_s *a );
static void Action_Draw( menuaction_s *a );
static void Menu_DrawStatusBar( const char *string );
static void Menulist_DoEnter( menulist_s *l );
static void MenuList_Draw( menulist_s *l );
static void Separator_Draw( menuseparator_s *s );
static void Slider_DoSlide( menuslider_s *s, int dir );
static void Slider_Draw( menuslider_s *s );
static void SpinControl_DoEnter( menulist_s *s );
static void SpinControl_Draw( menulist_s *s );
static void SpinControl_DoSlide( menulist_s *s, int dir );
#define RCOLUMN_OFFSET 16
#define LCOLUMN_OFFSET -16
@ -41,12 +41,6 @@ static void SpinControl_DoSlide( menulist_s *s, int dir );
extern render_exp_t *re;
extern viddef_t viddef;
#define VID_WIDTH viddef.width
#define VID_HEIGHT viddef.height
#define Draw_Char re->DrawChar
#define Draw_Fill re->DrawFill
void Action_DoEnter( menuaction_s *a )
{
if ( a->generic.callback )
@ -93,16 +87,16 @@ void QField_Draw( menufield_s *f )
strncpy( tempbuffer, f->field.buffer + f->field.scroll, f->field.widthInChars );
Draw_Char( f->generic.x + f->generic.parent->x + 16, f->generic.y + f->generic.parent->y - 4, 18 );
Draw_Char( f->generic.x + f->generic.parent->x + 16, f->generic.y + f->generic.parent->y + 4, 24 );
SCR_DrawSmallChar( f->generic.x + f->generic.parent->x + 16, f->generic.y + f->generic.parent->y - 4, 18 );
SCR_DrawSmallChar( f->generic.x + f->generic.parent->x + 16, f->generic.y + f->generic.parent->y + 4, 24 );
Draw_Char( f->generic.x + f->generic.parent->x + 24 + f->field.widthInChars * 8, f->generic.y + f->generic.parent->y - 4, 20 );
Draw_Char( f->generic.x + f->generic.parent->x + 24 + f->field.widthInChars * 8, f->generic.y + f->generic.parent->y + 4, 26 );
SCR_DrawSmallChar( f->generic.x + f->generic.parent->x + 24 + f->field.widthInChars * 8, f->generic.y + f->generic.parent->y - 4, 20 );
SCR_DrawSmallChar( f->generic.x + f->generic.parent->x + 24 + f->field.widthInChars * 8, f->generic.y + f->generic.parent->y + 4, 26 );
for ( i = 0; i < f->field.widthInChars; i++ )
{
Draw_Char( f->generic.x + f->generic.parent->x + 24 + i * 8, f->generic.y + f->generic.parent->y - 4, 19 );
Draw_Char( f->generic.x + f->generic.parent->x + 24 + i * 8, f->generic.y + f->generic.parent->y + 4, 25 );
SCR_DrawSmallChar( f->generic.x + f->generic.parent->x + 24 + i * 8, f->generic.y + f->generic.parent->y - 4, 19 );
SCR_DrawSmallChar( f->generic.x + f->generic.parent->x + 24 + i * 8, f->generic.y + f->generic.parent->y + 4, 25 );
}
Menu_DrawString( f->generic.x + f->generic.parent->x + 24, f->generic.y + f->generic.parent->y, tempbuffer );
@ -118,13 +112,13 @@ void QField_Draw( menufield_s *f )
if ( ( ( int ) ( cls.realtime * 4.0f ) ) & 1 )
{
Draw_Char( f->generic.x + f->generic.parent->x + ( offset + 2 ) * 8 + 8,
SCR_DrawSmallChar( f->generic.x + f->generic.parent->x + ( offset + 2 ) * 8 + 8,
f->generic.y + f->generic.parent->y,
11 );
}
else
{
Draw_Char( f->generic.x + f->generic.parent->x + ( offset + 2 ) * 8 + 8,
SCR_DrawSmallChar( f->generic.x + f->generic.parent->x + ( offset + 2 ) * 8 + 8,
f->generic.y + f->generic.parent->y,
' ' );
}
@ -236,7 +230,7 @@ void Menu_Center( menuframework_s *menu )
height = ( ( menucommon_s * ) menu->items[menu->nitems-1])->y;
height += 10;
menu->y = ( VID_HEIGHT - height ) / 2;
menu->y = ( SCREEN_HEIGHT - height ) / 2;
}
void Menu_Draw( menuframework_s *menu )
@ -286,11 +280,11 @@ void Menu_Draw( menuframework_s *menu )
{
if ( item->flags & QMF_LEFT_JUSTIFY )
{
Draw_Char( menu->x + item->x - 24 + item->cursor_offset, menu->y + item->y, 12 + ( ( int ) ( cls.realtime * 5.0f ) & 1 ) );
SCR_DrawSmallChar( menu->x + item->x - 24 + item->cursor_offset, menu->y + item->y, 12 + ( ( int ) ( cls.realtime * 5.0f ) & 1 ) );
}
else
{
Draw_Char( menu->x + item->cursor_offset, menu->y + item->y, 12 + ( ( int ) ( cls.realtime * 5.0f ) & 1 ) );
SCR_DrawSmallChar( menu->x + item->cursor_offset, menu->y + item->y, 12 + ( ( int ) ( cls.realtime * 5.0f ) & 1 ) );
}
}
@ -315,12 +309,12 @@ void Menu_DrawStatusBar( const char *string )
if ( string )
{
int l = strlen( string );
int maxrow = VID_HEIGHT / 8;
int maxcol = VID_WIDTH / 8;
int maxrow = SCREEN_HEIGHT / 8;
int maxcol = SCREEN_WIDTH / 8;
int col = maxcol / 2 - l / 2;
SCR_FillRect( 0, SCREEN_HEIGHT - 8, SCREEN_WIDTH, 8, COLOR_4 );
Menu_DrawString( col*8, VID_HEIGHT - 8, string );
Menu_DrawString( col*8, SCREEN_HEIGHT - 8, string );
}
else
{
@ -334,7 +328,7 @@ void Menu_DrawString( int x, int y, const char *string )
for ( i = 0; i < strlen( string ); i++ )
{
Draw_Char( ( x + i*8 ), y, string[i] );
SCR_DrawSmallChar( ( x + i*8 ), y, string[i] );
}
}
@ -344,7 +338,7 @@ void Menu_DrawStringDark( int x, int y, const char *string )
for ( i = 0; i < strlen( string ); i++ )
{
Draw_Char( ( x + i*8 ), y, string[i] + 128 );
SCR_DrawSmallChar( ( x + i*8 ), y, string[i] + 128 );
}
}
@ -354,7 +348,7 @@ void Menu_DrawStringR2L( int x, int y, const char *string )
for ( i = 0; i < strlen( string ); i++ )
{
Draw_Char( ( x - i*8 ), y, string[strlen(string)-i-1] );
SCR_DrawSmallChar( ( x - i*8 ), y, string[strlen(string)-i-1] );
}
}
@ -364,7 +358,7 @@ void Menu_DrawStringR2LDark( int x, int y, const char *string )
for ( i = 0; i < strlen( string ); i++ )
{
Draw_Char( ( x - i*8 ), y, string[strlen(string)-i-1]+128 );
SCR_DrawSmallChar( ( x - i*8 ), y, string[strlen(string)-i-1]+128 );
}
}
@ -515,11 +509,11 @@ void Slider_Draw( menuslider_s *s )
s->range = 0;
if ( s->range > 1)
s->range = 1;
Draw_Char( s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, 128);
SCR_DrawSmallChar( s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, 128);
for ( i = 0; i < SLIDER_RANGE; i++ )
Draw_Char( RCOLUMN_OFFSET + s->generic.x + i*8 + s->generic.parent->x + 8, s->generic.y + s->generic.parent->y, 129);
Draw_Char( RCOLUMN_OFFSET + s->generic.x + i*8 + s->generic.parent->x + 8, s->generic.y + s->generic.parent->y, 130);
Draw_Char( ( int ) ( 8 + RCOLUMN_OFFSET + s->generic.parent->x + s->generic.x + (SLIDER_RANGE-1)*8 * s->range ), s->generic.y + s->generic.parent->y, 131);
SCR_DrawSmallChar( RCOLUMN_OFFSET + s->generic.x + i*8 + s->generic.parent->x + 8, s->generic.y + s->generic.parent->y, 129);
SCR_DrawSmallChar( RCOLUMN_OFFSET + s->generic.x + i*8 + s->generic.parent->x + 8, s->generic.y + s->generic.parent->y, 130);
SCR_DrawSmallChar( ( int ) ( 8 + RCOLUMN_OFFSET + s->generic.parent->x + s->generic.x + (SLIDER_RANGE-1)*8 * s->range ), s->generic.y + s->generic.parent->y, 131);
}
void SpinControl_DoEnter( menulist_s *s )

View File

@ -2177,60 +2177,6 @@ void VM_precache_pic(void)
re->RegisterPic((char *)s); //may return empty frame
}
/*
=========
VM_freepic
freepic(string s)
=========
*/
void VM_freepic(void)
{
const char *s;
VM_SAFEPARMCOUNT(1,VM_freepic);
s = PRVM_G_STRING(OFS_PARM0);
if(!s)
PRVM_ERROR ("VM_freepic: %s: NULL");
VM_CheckEmptyString (s);
// this does nothing
}
/*
=========
VM_drawcharacter
float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag)
=========
*/
void VM_drawcharacter(void)
{
float *pos, *scale, *rgb;
char character;
int flag;
VM_SAFEPARMCOUNT(6,VM_drawcharacter);
character = (char) PRVM_G_FLOAT(OFS_PARM1);
if(character == 0)
{
PRVM_G_FLOAT(OFS_RETURN) = -1;
VM_Warning("VM_drawcharacter: %s passed null character !\n",PRVM_NAME);
return;
}
pos = PRVM_G_VECTOR(OFS_PARM0);
scale = PRVM_G_VECTOR(OFS_PARM2);
rgb = PRVM_G_VECTOR(OFS_PARM3);
flag = (int)PRVM_G_FLOAT(OFS_PARM5);
re->DrawChar( pos[0], pos[1], character );
PRVM_G_FLOAT(OFS_RETURN) = 1;
}
/*
=========
VM_drawstring
@ -2240,7 +2186,7 @@ float drawstring(vector position, string text, vector scale, vector rgb, float a
*/
void VM_drawstring(void)
{
float *pos,*scale,*rgb;
float *pos, *scale, *rgb, alpha;
const char *string;
int flag;
VM_SAFEPARMCOUNT(6,VM_drawstring);
@ -2256,9 +2202,10 @@ void VM_drawstring(void)
pos = PRVM_G_VECTOR(OFS_PARM0);
scale = PRVM_G_VECTOR(OFS_PARM2);
rgb = PRVM_G_VECTOR(OFS_PARM3);
alpha = PRVM_G_FLOAT(OFS_PARM4);
flag = (int)PRVM_G_FLOAT(OFS_PARM5);
re->DrawString( pos[0], pos[1], (char *)string );
SCR_DrawBigString( pos[0], pos[1], string, alpha );
PRVM_G_FLOAT(OFS_RETURN) = 1;
}
/*
@ -2292,7 +2239,7 @@ void VM_drawpic(void)
rgb = PRVM_G_VECTOR(OFS_PARM3);
flag = (int) PRVM_G_FLOAT(OFS_PARM5);
re->DrawPic( pos[0], pos[1], (char *)picname );
SCR_DrawPic( pos[0], pos[1], size[0], size[1], (char *)picname );
PRVM_G_FLOAT(OFS_RETURN) = 1;
}

View File

@ -297,8 +297,6 @@ void VM_search_getfilename(void);
void VM_chr(void);
void VM_iscachedpic(void);
void VM_precache_pic(void);
void VM_freepic(void);
void VM_drawcharacter(void);
void VM_drawstring(void);
void VM_drawpic(void);
void VM_drawfill(void);

View File

@ -142,10 +142,6 @@ SOURCE=.\client\cl_input.c
# End Source File
# Begin Source File
SOURCE=.\client\cl_inv.c
# End Source File
# Begin Source File
SOURCE=.\client\cl_keys.c
# End Source File
# Begin Source File

View File

@ -18,7 +18,6 @@ bool Minimized;
char *buildstring = __TIME__ " " __DATE__;
void Key_Init (void);
void SCR_EndLoadingPlaque (void);
HINSTANCE global_hInstance;
dll_info_t physic_dll = { "physic.dll", NULL, "CreateAPI", NULL, NULL, true, sizeof(physic_exp_t) };
@ -154,8 +153,6 @@ void Host_Init (uint funcname, int argc, char **argv)
// if stuffcmds wasn't run, then init.rc is probably missing, use default
if(!host.stuffcmdsrun) Cbuf_ExecuteText( EXEC_NOW, "stuffcmds\n" );
SCR_EndLoadingPlaque ();
Sys_DoubleTime(); // initialize timer
}

View File

@ -412,8 +412,8 @@ const char* com_timestamp( int format )
strftime(timestring, sizeof (timestring), "%b%d %Y", crt_tm);
break;
case TIME_TIME_ONLY:
// Build the time stamp only (ex: "[23:31.55]");
strftime(timestring, sizeof (timestring), "[%H:%M.%S]", crt_tm);
// Build the time stamp only (ex: "23:31.55");
strftime(timestring, sizeof (timestring), "%H:%M.%S", crt_tm);
break;
case TIME_NO_SECONDS:
// Build the full timestamp (ex: "Apr03 2007 [23:31]");

View File

@ -238,12 +238,10 @@ void Draw_Fill(float x, float y, float w, float h)
qglColor4fv(gl_state.draw_color);
qglBegin (GL_QUADS);
qglVertex2f(x, y);
qglVertex2f(x + w, y);
qglVertex2f(x + w, y + h);
qglVertex2f(x, y + h);
qglVertex2f(x, y);
qglVertex2f(x + w, y);
qglVertex2f(x + w, y + h);
qglVertex2f(x, y + h);
qglEnd();
qglEnable (GL_TEXTURE_2D);
}

View File

@ -458,7 +458,6 @@ void Mod_LoadTexinfo (lump_t *l)
if(out->image)
{
ri.Cvar_SetValue("scr_loading", r_loading->value + 45.0f/count );
Msg("loading textures %g\n", r_loading->value + 45.0f/count );
}
else
{

View File

@ -16,6 +16,7 @@ void() PutClientInServer; //From Client.QC
//END DEFS;
.float showhelp;
.float showinventory;
/*
+=========+
@ -297,6 +298,24 @@ void() PutClientInServer =
GetLevelParms();
};
void ShowInventory( void )
{
string help;
float layout;
if(pev->showinventory == TRUE) pev->showinventory = FALSE;
else pev->showinventory = TRUE;
if(pev->showinventory == TRUE) layout |= 2;
else layout = 0;
setstats( pev, STAT_LAYOUTS, ftoa(layout));
MsgBegin( SVC_LAYOUT );
WriteString( "" ); // build-in inventory
MsgEnd(MSG_ONE, '0 0 0', pev );
}
void HelpComputer( void )
{
string help;
@ -305,18 +324,13 @@ void HelpComputer( void )
if(pev->showhelp == TRUE) pev->showhelp = FALSE;
else pev->showhelp = TRUE;
if(pev->showhelp == TRUE)
{
layout |= 1;
help = "xv 32 yv 8 picn help ";
}
else help = "";
if(pev->health > 0) layout |= 2;
if(pev->showhelp == TRUE) layout |= 1;
else layout = 0;
setstats( pev, STAT_LAYOUTS, ftoa(layout));
MsgBegin( SVC_LAYOUT );
WriteString( help );
WriteString( "Hud_HelpComputer" );
MsgEnd(MSG_ONE, '0 0 0', pev );
}
@ -330,6 +344,10 @@ void ClientCommand( void )
{
HelpComputer();
}
if(cmd == "inven")
{
ShowInventory();
}
if(cmd == "say")
{
Msg("say me now ", argv(1), "\n");

View File

@ -11,7 +11,7 @@ Counts the number of times it gets fired.. then fires its targets..
void() trigger_counter_use =
{
pev->count = pev->count - 1; //subtract my count by one; 'ive been triggered'
pev->count = pev->count - 1; // subtract my count by one; 'ive been triggered'
if(pev->count != 0)
{
@ -25,9 +25,9 @@ void() trigger_counter_use =
{
IEM_usetarget();
if(pev->spawnflags & TRIGGER_ONCE) //if im a trigger_once, remove me;
if(pev->spawnflags & TRIGGER_ONCE) // if im a trigger_once, remove me;
remove(pev);
else pev->count = pev->twait[0]; //restore old count
else pev->count = pev->twait[0]; // restore old count
}
};