Okay, as promised I have implemented real-time simple item support for ezQuake. Same functionality as cg_simpleitems for Quake3.
Command: r_simpleitems 0 | 1 {default 0}
Description: Set to 1 and all ammo boxes, armor, health packs, weapons, and powerups are drawn as sprites.
Here's a recompiled (unofficial) ezQuake 1.90 with this feature implemented for you to test.
http://www.quakeone.com/qrack/ezquake-gl.exe
Here is the required pak file containing all the media.
http://www.quakeone.com/qrack/simpleitems.pak
Make sure you put the simpleitems.pak in your ezquake folder RENAME IT CORRECTLY.
And here's the code for the ezQuake dev team (or anyone else with a C compiler)
In cl_ents.c, find void CL_InitEnts(void) ,
Above that function add this...
Now, within the CL_InitEnts function find
then right after that add...
Now load up client.h and add this to the bottom..
Now in GL_Rmain.c find..
just below
that portion, add this to look like this...
and finally in that same function near the bottom we need to draw the sprites correctly for their 24bit replacement textures so...
find 'case mod_sprite' and replace with this
Compile, we're done.
Make sure you put the simpleitems.pak in your ezquake folder RENAME IT CORRECTLY. (Future Release: I'd suggest putting all the files actually in the pak0 of ezquake)
THAT'S IT!
Command: r_simpleitems 0 | 1 {default 0}
Description: Set to 1 and all ammo boxes, armor, health packs, weapons, and powerups are drawn as sprites.
Here's a recompiled (unofficial) ezQuake 1.90 with this feature implemented for you to test.
http://www.quakeone.com/qrack/ezquake-gl.exe
Here is the required pak file containing all the media.
http://www.quakeone.com/qrack/simpleitems.pak
Make sure you put the simpleitems.pak in your ezquake folder RENAME IT CORRECTLY.
And here's the code for the ezQuake dev team (or anyone else with a C compiler)
In cl_ents.c, find void CL_InitEnts(void) ,
Above that function add this...
model_t *mod_2dshells;
model_t *mod_2dcells;
model_t *mod_2drockets;
model_t *mod_2dnails;
model_t *mod_2dmega;
model_t *mod_2dpent;
model_t *mod_2dquad;
model_t *mod_2dring;
model_t *mod_2dsuit;
model_t *mod_2darmor1;
model_t *mod_2darmor2;
model_t *mod_2darmor3;
model_t *mod_2dbackpack;
model_t *mod_2dhealth10;
model_t *mod_2dhealth25;
model_t *mod_2drl;
model_t *mod_2dgl;
model_t *mod_2dlg;
model_t *mod_2dng;
model_t *mod_2dsng;
model_t *mod_2dssg;
model_t *mod_2dcells;
model_t *mod_2drockets;
model_t *mod_2dnails;
model_t *mod_2dmega;
model_t *mod_2dpent;
model_t *mod_2dquad;
model_t *mod_2dring;
model_t *mod_2dsuit;
model_t *mod_2darmor1;
model_t *mod_2darmor2;
model_t *mod_2darmor3;
model_t *mod_2dbackpack;
model_t *mod_2dhealth10;
model_t *mod_2dhealth25;
model_t *mod_2drl;
model_t *mod_2dgl;
model_t *mod_2dlg;
model_t *mod_2dng;
model_t *mod_2dsng;
model_t *mod_2dssg;
Now, within the CL_InitEnts function find
for (i = 0; i < cl_num_modelindices; i++)
{
if (!cl_modelnames[i])
Sys_Error("cl_modelnames[%d] not initialized", i);
}
{
if (!cl_modelnames[i])
Sys_Error("cl_modelnames[%d] not initialized", i);
}
then right after that add...
//R00k load replacement sprites for models
mod_2dshells = Mod_ForName ("sprites/s_shells.spr", false);
mod_2dcells = Mod_ForName ("sprites/s_cells.spr", false);
mod_2drockets = Mod_ForName ("sprites/s_rockets.spr", false);
mod_2dnails = Mod_ForName ("sprites/s_nails.spr", false);
mod_2dmega = Mod_ForName ("sprites/s_mega.spr", false);
mod_2dpent = Mod_ForName ("sprites/s_invuln.spr", false);
mod_2dquad = Mod_ForName ("sprites/s_quad.spr", false);
mod_2dring = Mod_ForName ("sprites/s_invis.spr", false);
mod_2dsuit = Mod_ForName ("sprites/s_suit.spr", false);
mod_2darmor1 = Mod_ForName ("sprites/s_armor1.spr", false);
mod_2darmor2 = Mod_ForName ("sprites/s_armor2.spr", false);
mod_2darmor3 = Mod_ForName ("sprites/s_armor3.spr", false);
mod_2dbackpack = Mod_ForName ("sprites/s_backpack.spr", false);
mod_2dhealth10 = Mod_ForName ("sprites/s_health10.spr", false);
mod_2dhealth25 = Mod_ForName ("sprites/s_health25.spr", false);
mod_2dssg = Mod_ForName ("sprites/s_g_shot.spr", false);
mod_2dng = Mod_ForName ("sprites/s_g_nail.spr", false);
mod_2dsng = Mod_ForName ("sprites/s_g_nail2.spr", false);
mod_2dgl = Mod_ForName ("sprites/s_g_rock.spr", false);
mod_2drl = Mod_ForName ("sprites/s_g_rock2.spr", false);
mod_2dlg = Mod_ForName ("sprites/s_g_light.spr", false);
mod_2dshells = Mod_ForName ("sprites/s_shells.spr", false);
mod_2dcells = Mod_ForName ("sprites/s_cells.spr", false);
mod_2drockets = Mod_ForName ("sprites/s_rockets.spr", false);
mod_2dnails = Mod_ForName ("sprites/s_nails.spr", false);
mod_2dmega = Mod_ForName ("sprites/s_mega.spr", false);
mod_2dpent = Mod_ForName ("sprites/s_invuln.spr", false);
mod_2dquad = Mod_ForName ("sprites/s_quad.spr", false);
mod_2dring = Mod_ForName ("sprites/s_invis.spr", false);
mod_2dsuit = Mod_ForName ("sprites/s_suit.spr", false);
mod_2darmor1 = Mod_ForName ("sprites/s_armor1.spr", false);
mod_2darmor2 = Mod_ForName ("sprites/s_armor2.spr", false);
mod_2darmor3 = Mod_ForName ("sprites/s_armor3.spr", false);
mod_2dbackpack = Mod_ForName ("sprites/s_backpack.spr", false);
mod_2dhealth10 = Mod_ForName ("sprites/s_health10.spr", false);
mod_2dhealth25 = Mod_ForName ("sprites/s_health25.spr", false);
mod_2dssg = Mod_ForName ("sprites/s_g_shot.spr", false);
mod_2dng = Mod_ForName ("sprites/s_g_nail.spr", false);
mod_2dsng = Mod_ForName ("sprites/s_g_nail2.spr", false);
mod_2dgl = Mod_ForName ("sprites/s_g_rock.spr", false);
mod_2drl = Mod_ForName ("sprites/s_g_rock2.spr", false);
mod_2dlg = Mod_ForName ("sprites/s_g_light.spr", false);
Now load up client.h and add this to the bottom..
//R00k for simple items...
extern struct model_s *mod_2dshells;
extern struct model_s *mod_2dcells;
extern struct model_s *mod_2drockets;
extern struct model_s *mod_2dnails;
extern struct model_s *mod_2dmega;
extern struct model_s *mod_2dpent;
extern struct model_s *mod_2dquad;
extern struct model_s *mod_2dring;
extern struct model_s *mod_2dsuit;
extern struct model_s *mod_2darmor1;
extern struct model_s *mod_2darmor2;
extern struct model_s *mod_2darmor3;
extern struct model_s *mod_2dbackpack;
extern struct model_s *mod_2dhealth10;
extern struct model_s *mod_2dhealth25;
extern struct model_s *mod_2dssg;
extern struct model_s *mod_2dng;
extern struct model_s *mod_2dsng;
extern struct model_s *mod_2dgl;
extern struct model_s *mod_2drl;
extern struct model_s *mod_2dlg;
extern struct model_s *mod_2dshells;
extern struct model_s *mod_2dcells;
extern struct model_s *mod_2drockets;
extern struct model_s *mod_2dnails;
extern struct model_s *mod_2dmega;
extern struct model_s *mod_2dpent;
extern struct model_s *mod_2dquad;
extern struct model_s *mod_2dring;
extern struct model_s *mod_2dsuit;
extern struct model_s *mod_2darmor1;
extern struct model_s *mod_2darmor2;
extern struct model_s *mod_2darmor3;
extern struct model_s *mod_2dbackpack;
extern struct model_s *mod_2dhealth10;
extern struct model_s *mod_2dhealth25;
extern struct model_s *mod_2dssg;
extern struct model_s *mod_2dng;
extern struct model_s *mod_2dsng;
extern struct model_s *mod_2dgl;
extern struct model_s *mod_2drl;
extern struct model_s *mod_2dlg;
Now in GL_Rmain.c find..
void R_DrawEntitiesOnList (visentlist_t *vislist)
just below
// draw sprites separately, because of alpha_test
for (i = 0; i < vislist->count; i++)
{
currententity = &vislist->list[i];
for (i = 0; i < vislist->count; i++)
{
currententity = &vislist->list[i];
that portion, add this to look like this...
for (i = 0; i < vislist->count; i++)
{
currententity = &vislist->list[i];
//R00k-----------------------------------------------------------------------------------------------------------------start
if (r_simpleitems.value)
{
if ((!strcmp(currententity->model->name, "maps/b_shell0.bsp") || (!strcmp(currententity->model->name, "maps/b_shell1.bsp"))
{
currententity->model = mod_2dshells;
}
else
if ((!strcmp(currententity->model->name, "maps/b_batt0.bsp") || (!strcmp(currententity->model->name, "maps/b_batt1.bsp"))
{
currententity->model = mod_2dcells;
}
else
if ((!strcmp(currententity->model->name, "maps/b_rock0.bsp") || (!strcmp(currententity->model->name, "maps/b_rock1.bsp"))
{
currententity->model = mod_2drockets;
}
else
if ((!strcmp(currententity->model->name, "maps/b_nail0.bsp") || (!strcmp(currententity->model->name, "maps/b_nail1.bsp"))
{
currententity->model = mod_2dnails;
}
else
if (!strcmp(currententity->model->name, "maps/b_bh100.bsp")
{
currententity->model = mod_2dmega;
}
else
if (!strcmp(currententity->model->name, "maps/b_bh10.bsp")
{
currententity->model = mod_2dhealth10;
}
else
if (!strcmp(currententity->model->name, "maps/b_bh25.bsp")
{
currententity->model = mod_2dhealth25;
}
else
if (!strcmp(currententity->model->name, "progs/invulner.mdl")
{
currententity->model = mod_2dpent;
}
else
if (!strcmp(currententity->model->name, "progs/quaddama.mdl")
{
currententity->model = mod_2dquad;
}
else
if (!strcmp(currententity->model->name, "progs/invisibl.mdl")
{
currententity->model = mod_2dring;
}
else
if (!strcmp(currententity->model->name, "progs/suit.mdl")
{
currententity->model = mod_2dsuit;
}
else
if (!strcmp(currententity->model->name, "progs/armor.mdl")
{
if (currententity->skinnum == 0)
currententity->model = mod_2darmor1;
else
if (currententity->skinnum == 1)
currententity->model = mod_2darmor2;
else
if (currententity->skinnum == 2)
currententity->model = mod_2darmor3;
}
else
if(!strcmp(currententity->model->name, "progs/backpack.mdl")
{
currententity->model = mod_2dbackpack;
}
else
if(!strcmp(currententity->model->name, "progs/g_rock2.mdl")
{
currententity->model = mod_2drl;
}
else
if(!strcmp(currententity->model->name, "progs/g_rock.mdl")
{
currententity->model = mod_2dgl;
}
else
if(!strcmp(currententity->model->name, "progs/g_light.mdl")
{
currententity->model = mod_2dlg;
}
else
if(!strcmp(currententity->model->name, "progs/g_nail.mdl")
{
currententity->model = mod_2dng;
}
else
if(!strcmp(currententity->model->name, "progs/g_nail2.mdl")
{
currententity->model = mod_2dsng;
}
else
if(!strcmp(currententity->model->name, "progs/g_shot.mdl")
{
currententity->model = mod_2dssg;
}
}
//R00k-----------------------------------------------------------------------------------------------------------------end
switch (currententity->model->type)
{
{
currententity = &vislist->list[i];
//R00k-----------------------------------------------------------------------------------------------------------------start
if (r_simpleitems.value)
{
if ((!strcmp(currententity->model->name, "maps/b_shell0.bsp") || (!strcmp(currententity->model->name, "maps/b_shell1.bsp"))
{
currententity->model = mod_2dshells;
}
else
if ((!strcmp(currententity->model->name, "maps/b_batt0.bsp") || (!strcmp(currententity->model->name, "maps/b_batt1.bsp"))
{
currententity->model = mod_2dcells;
}
else
if ((!strcmp(currententity->model->name, "maps/b_rock0.bsp") || (!strcmp(currententity->model->name, "maps/b_rock1.bsp"))
{
currententity->model = mod_2drockets;
}
else
if ((!strcmp(currententity->model->name, "maps/b_nail0.bsp") || (!strcmp(currententity->model->name, "maps/b_nail1.bsp"))
{
currententity->model = mod_2dnails;
}
else
if (!strcmp(currententity->model->name, "maps/b_bh100.bsp")
{
currententity->model = mod_2dmega;
}
else
if (!strcmp(currententity->model->name, "maps/b_bh10.bsp")
{
currententity->model = mod_2dhealth10;
}
else
if (!strcmp(currententity->model->name, "maps/b_bh25.bsp")
{
currententity->model = mod_2dhealth25;
}
else
if (!strcmp(currententity->model->name, "progs/invulner.mdl")
{
currententity->model = mod_2dpent;
}
else
if (!strcmp(currententity->model->name, "progs/quaddama.mdl")
{
currententity->model = mod_2dquad;
}
else
if (!strcmp(currententity->model->name, "progs/invisibl.mdl")
{
currententity->model = mod_2dring;
}
else
if (!strcmp(currententity->model->name, "progs/suit.mdl")
{
currententity->model = mod_2dsuit;
}
else
if (!strcmp(currententity->model->name, "progs/armor.mdl")
{
if (currententity->skinnum == 0)
currententity->model = mod_2darmor1;
else
if (currententity->skinnum == 1)
currententity->model = mod_2darmor2;
else
if (currententity->skinnum == 2)
currententity->model = mod_2darmor3;
}
else
if(!strcmp(currententity->model->name, "progs/backpack.mdl")
{
currententity->model = mod_2dbackpack;
}
else
if(!strcmp(currententity->model->name, "progs/g_rock2.mdl")
{
currententity->model = mod_2drl;
}
else
if(!strcmp(currententity->model->name, "progs/g_rock.mdl")
{
currententity->model = mod_2dgl;
}
else
if(!strcmp(currententity->model->name, "progs/g_light.mdl")
{
currententity->model = mod_2dlg;
}
else
if(!strcmp(currententity->model->name, "progs/g_nail.mdl")
{
currententity->model = mod_2dng;
}
else
if(!strcmp(currententity->model->name, "progs/g_nail2.mdl")
{
currententity->model = mod_2dsng;
}
else
if(!strcmp(currententity->model->name, "progs/g_shot.mdl")
{
currententity->model = mod_2dssg;
}
}
//R00k-----------------------------------------------------------------------------------------------------------------end
switch (currententity->model->type)
{
and finally in that same function near the bottom we need to draw the sprites correctly for their 24bit replacement textures so...
find 'case mod_sprite' and replace with this
case mod_sprite:
GL_DisableMultitexture ();
glEnable (GL_ALPHA_TEST);
R_DrawSpriteModel (currententity);
glDisable (GL_ALPHA_TEST);
break;
GL_DisableMultitexture ();
glEnable (GL_ALPHA_TEST);
R_DrawSpriteModel (currententity);
glDisable (GL_ALPHA_TEST);
break;
Compile, we're done.
Make sure you put the simpleitems.pak in your ezquake folder RENAME IT CORRECTLY. (Future Release: I'd suggest putting all the files actually in the pak0 of ezquake)
THAT'S IT!