Someone took FitzQuake 0.85 and FitzQuake 0.80 SDL and made a "FitzQuake 0.85 SDL" in 6 hours after reading FitzQuake 0.85 might not happen until 2010. Yeah, I'm not uber leet like some of the guys here but I kick ass at grunt work. Anyways ...
http://quakespasm.sourceforge.net/
I like looking through engine changes to see what kind of things people think are important.
Here is a list of changes I found in Quakespasm that interested me ...
1. Looks like "buffer-safeness" in va(...) Might be straight from DarkPlaces.
Code: Select all
/*
============
va
does a varargs printf into a temp buffer. cycles between
4 different static buffers. the number of buffers cycled
is defined in VA_NUM_BUFFS.
FIXME: make this buffer size safe someday
============
*/
#define VA_NUM_BUFFS 4
#define VA_BUFFERLEN 1024
static char *get_va_buffer(void)
{
static char va_buffers[VA_NUM_BUFFS][VA_BUFFERLEN];
static int buffer_idx = 0;
buffer_idx = (buffer_idx + 1) & (VA_NUM_BUFFS - 1);
return va_buffers[buffer_idx];
}
char *va (const char *format, ...)
{
va_list argptr;
char *va_buf;
va_buf = get_va_buffer ();
va_start (argptr, format);
vsprintf (va_buf, format, argptr);
va_end (argptr);
return va_buf;
}
Code: Select all
void COM_Init (char *basedir)
{
int i = 0x12345678;
/* U N I X */
/*
BE_ORDER: 12 34 56 78
U N I X
LE_ORDER: 78 56 34 12
X I N U
PDP_ORDER: 34 12 78 56
N U X I
*/
if ( *(char *)&i == 0x12 )
bigendien = true;
else if ( *(char *)&i == 0x78 )
bigendien = false;
else /* if ( *(char *)&i == 0x34 ) */
Sys_Error ("Unsupported endianism.");
COM_LoadFile
Code: Select all
// Draw_BeginDisc causes core dumps when called excessively in big mods S.A.
vid.h
Code: Select all
// moved here for global use -- kristian
typedef enum { NO_MODE=-1, MODE_WINDOWED, MODE_FULLSCREEN_DEFAULT } modestate_t;
Code: Select all
void VID_HandlePause (qboolean pause);
// called only on Win32, when pause happens, so the mouse can be released
Hmmm ... sound system restart capability? Or maybe SDL needs that on video mode change?
Code: Select all
void S_Init (void)
{
if (snd_initialized)
{
Con_Printf("Sound is already initialized\n");
return;
}
Code: Select all
void Host_Map_f (void)
{
int i;
char name[MAX_QPATH];
if (Cmd_Argc() < 2) //no map name given
{
if (cls.state == ca_dedicated)
{
if (sv.active)
Con_Printf ("Current map: %s\n", sv.name);
else
Con_Printf ("Server not active\n");
}
else if (cls.state == ca_connected)
{
Con_Printf ("Current map: %s ( %s )\n", cl.levelname, cl.mapname);
}
else
{
Con_Printf ("map <levelname>: start a new server\n");
}
return;
}
Was ...
Code: Select all
if (sv.paused)
{
SV_BroadcastPrintf ("%s paused the game\n", pr_strings + sv_player->v.netname);
}
else
{
SV_BroadcastPrintf ("%s unpaused the game\n",pr_strings + sv_player->v.netname);
}
Code: Select all
if (sv.paused)
{
SV_BroadcastPrintf ("%s paused the game\n", PR_GetString(sv_player->v.netname));
}
else
{
SV_BroadcastPrintf ("%s unpaused the game\n",PR_GetString(sv_player->v.netname));
}
Host_Changelevel_f
Code: Select all
IN_Activate(); // -- S.A.
key_dest = key_game; // remove console or menu
10. All instances of index variables are renamed to "idx" in net_sdlnet.c. Maybe a compiler thinks "index" is a reserved word or something special or maybe it was annoying for some other reason.
11. Ah! So that's how FitzQuake reloads textures from models and maps if a bpp change happens .... it stores the offset of the texture in the texture manager.
Code: Select all
offset = (src_offset_t)(mt+1) - (src_offset_t)mod_base;
if (Mod_CheckFullbrights ((byte *)(tx+1), pixels))
{
tx->gltexture = TexMgr_LoadImage (loadmodel, texturename, tx->width, tx->height,
SRC_INDEXED, (byte *)(tx+1), loadmodel->name, offset, TEXPREF_MIPMAP | TEXPREF_NOBRIGHT);
sprintf (texturename, "%s:%s_glow", loadmodel->name, tx->name);
tx->fullbright = TexMgr_LoadImage (loadmodel, texturename, tx->width, tx->height,
SRC_INDEXED, (byte *)(tx+1), loadmodel->name, offset, TEXPREF_MIPMAP | TEXPREF_FULLBRIGHT);
}