SDL: Deconstructing Sleepwalker's FitzQuake_SDL

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

SDL: Deconstructing Sleepwalker's FitzQuake_SDL

Post by Baker »

Here is a quick deconstruction of the changes to FitzQuake 0.80 for the Fitz_SDL version that Sleepwalker did.

SDL is kind of nice in the sense that it really eases the ability of multiple operating system ports using a single code base. I noticed last year most games utilizing tend to have Mac OS X ports, in addition to the expected Windows and Linux versions.

I wasn't aware SDL had been around for such a long time, looks like a prototype SDL Quake 1.0.9 was made way back in 2000.

Changes in FitzQuake SDL

Ignoring comments, things to get rid of compiling warnings (unused variables, extern, void, etc., general cleaning) ...
sound.h
+ extern cvar_t sndspeed;

console.c
+ Con_Show (void);
+ Con_Hide (void);

input.h
++++++++++++++++++++++++++++++++++++++++++
// mouse moved by dx and dy pixels
void IN_MouseMove(int dx, int dy);

// called when the app becomes active
void IN_Activate ();

// called when the app becomes inactive
void IN_Deactivate (qboolean free_cursor);
++++++++++++++++++++++++++++++++++++++++++

cl_parse.c
- VID_HandlePause (true)/(falses)

world.c
- #if !id386 around SV_HullPointContents

vid.h
+ // moved here for global use -- kristian
typedef enum { NO_MODE=-1, MODE_WINDOWED, MODE_FULLSCREEN_DEFAULT } modestate_t;
+ Added int type; to viddef_t

quakedef.h
- VID_LockBuffer / VID_UnlockBuffer
+++++++++++++++++++++++++++++++++++++++++
#include "platform.h"

#include "SDL/SDL.h"
#include "SDL/SDL_opengl.h"
+++++++++++++++++++++++++++++++++++++++++
#include "image.h" //johnfitz
#include "gl_texmgr.h" //johnfitz
+++++++++++++++++++++++++++++++++++++++++

mathlib.c
- #if !id386 around BoxPlaneSide

console.c
+ IN_ACTIVATE (x2)
+ IN_Deactivate ... (x2)

host.c

- Sys_SendKeyEvents (); - "not needed for SDL"
- IN_Init() (x2)
~ Moved IN_Shutdown (I guess technically this isn't an SDL change)

glquake.h

- Removed some windows/opengl stuff
+ Some OpenGL stuff

keys.c

+ BuildKeyMaps for SDL

gl_rmisc.c
~ TRUE --> 1 (arbitrary?)

snd_dma.c
- include Winquake.h
+ sndspeed cvar
+ checking sndspeed command line param
- Removal of some Windows-specific #idef'd code

snd_mix.c
- #ifdef !386
- Removal of some Windows-specific #ifdef'd coded

host_cmd.c
+ #include <dirent.h>
- killing of some _stricmp and substituting them with Q_strcasecmp
~ Modlist_Init, a FitzQuake specific feature -- is rewritten entirely
New Files

cd.sdl.c - Virtually empty, FitzSDL looks like it doesn't support CD music
gl_vidsdl.c - Sort of the equivalent gl_vidnt.c except it has vastly less code in it
in_sdl.c - equivalent of in_win.c but very small file
main.c - Looks like the equivalent of the single MainWndProc in glvid_nt (main program loop)
net_sdl.c/.h - Short files related to what looks like SDL's operating system neutral net functions
net_udp.c - Slimmer version of net_udp.c
pl_win.c - Sets the Windows icon, error dialog
pl_linux.c - Just about empty
pl_osx.m - Error dialog
snd_sdl.c - Short
sys_sdl.c - Short

There are a couple of operating system specific folders, which generally don't have that much in them.
Post Reply