This commit is contained in:
Literally A Penguin
2024-09-25 15:39:25 -05:00
committed by GitHub
parent e8bd66b89c
commit 0bf99969fd
86 changed files with 51093 additions and 0 deletions

31
null/cd_null.c Normal file
View File

@ -0,0 +1,31 @@
#include "../client/client.h"
void CDAudio_Play(int track, qboolean looping)
{
}
void CDAudio_Stop(void)
{
}
void CDAudio_Resume(void)
{
}
void CDAudio_Update(void)
{
}
int CDAudio_Init(void)
{
return 0;
}
void CDAudio_Shutdown(void)
{
}

55
null/cl_null.c Normal file
View File

@ -0,0 +1,55 @@
// cl_null.c -- this file can stub out the entire client system
// for pure dedicated servers
#include "../qcommon/qcommon.h"
void Key_Bind_Null_f(void)
{
}
void CL_Init (void)
{
}
void CL_Drop (void)
{
}
void CL_Shutdown (void)
{
}
void CL_Frame (int msec)
{
}
void Con_Print (char *text)
{
}
void Cmd_ForwardToServer (void)
{
char *cmd;
cmd = Cmd_Argv(0);
Com_Printf ("Unknown command \"%s\"\n", cmd);
}
void SCR_DebugGraph (float value, int color)
{
}
void SCR_BeginLoadingPlaque (void)
{
}
void SCR_EndLoadingPlaque (void)
{
}
void Key_Init (void)
{
Cmd_AddCommand ("bind", Key_Bind_Null_f);
}

34
null/glimp_null.c Normal file
View File

@ -0,0 +1,34 @@
#include "../ref_gl/gl_local.h"
void GLimp_BeginFrame( float camera_separation )
{
}
void GLimp_EndFrame( void )
{
}
int GLimp_Init( void *hinstance, void *hWnd )
{
}
void GLimp_Shutdown( void )
{
}
int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen )
{
}
void GLimp_AppActivate( qboolean active )
{
}
void GLimp_EnableLogging( qboolean enable )
{
}
void GLimp_LogNewFrame( void )
{
}

36
null/in_null.c Normal file
View File

@ -0,0 +1,36 @@
// in_null.c -- for systems without a mouse
#include "../client/client.h"
void IN_Init (void)
{
}
void IN_Shutdown (void)
{
}
void IN_Commands (void)
{
}
void IN_Frame (void)
{
}
void IN_Move (usercmd_t *cmd)
{
}
void IN_Activate (qboolean active)
{
}
void IN_ActivateMouse (void)
{
}
void IN_DeactivateMouse (void)
{
}

28
null/snddma_null.c Normal file
View File

@ -0,0 +1,28 @@
// snddma_null.c
// all other sound mixing is portable
#include "../client/client.h"
#include "../client/snd_loc.h"
qboolean SNDDMA_Init(void)
{
return false;
}
int SNDDMA_GetDMAPos(void)
{
return 0;
}
void SNDDMA_Shutdown(void)
{
}
void SNDDMA_BeginPainting (void)
{
}
void SNDDMA_Submit(void)
{
}

30
null/swimp_null.c Normal file
View File

@ -0,0 +1,30 @@
#include "../ref_soft/r_local.h"
void SWimp_BeginFrame( float camera_separation )
{
}
void SWimp_EndFrame (void)
{
}
int SWimp_Init( void *hInstance, void *wndProc )
{
}
void SWimp_SetPalette( const unsigned char *palette)
{
}
void SWimp_Shutdown( void )
{
}
rserr_t SWimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen )
{
}
void SWimp_AppActivate( qboolean active )
{
}

127
null/sys_null.c Normal file
View File

@ -0,0 +1,127 @@
// sys_null.h -- null system driver to aid porting efforts
#include "../qcommon/qcommon.h"
#include "errno.h"
int curtime;
unsigned sys_frame_time;
void Sys_mkdir (char *path)
{
}
void Sys_Error (char *error, ...)
{
va_list argptr;
printf ("Sys_Error: ");
va_start (argptr,error);
vprintf (error,argptr);
va_end (argptr);
printf ("\n");
exit (1);
}
void Sys_Quit (void)
{
exit (0);
}
void Sys_UnloadGame (void)
{
}
void *Sys_GetGameAPI (void *parms)
{
return NULL;
}
char *Sys_ConsoleInput (void)
{
return NULL;
}
void Sys_ConsoleOutput (char *string)
{
}
void Sys_SendKeyEvents (void)
{
}
void Sys_AppActivate (void)
{
}
void Sys_CopyProtect (void)
{
}
char *Sys_GetClipboardData( void )
{
return NULL;
}
void *Hunk_Begin (int maxsize)
{
return NULL;
}
void *Hunk_Alloc (int size)
{
return NULL;
}
void Hunk_Free (void *buf)
{
}
int Hunk_End (void)
{
return 0;
}
int Sys_Milliseconds (void)
{
return 0;
}
void Sys_Mkdir (char *path)
{
}
char *Sys_FindFirst (char *path, unsigned musthave, unsigned canthave)
{
return NULL;
}
char *Sys_FindNext (unsigned musthave, unsigned canthave)
{
return NULL;
}
void Sys_FindClose (void)
{
}
void Sys_Init (void)
{
}
//=============================================================================
void main (int argc, char **argv)
{
Qcommon_Init (argc, argv);
while (1)
{
Qcommon_Frame (0.1);
}
}

145
null/vid_null.c Normal file
View File

@ -0,0 +1,145 @@
// vid_null.c -- null video driver to aid porting efforts
// this assumes that one of the refs is statically linked to the executable
#include "../client/client.h"
viddef_t viddef; // global video state
refexport_t re;
refexport_t GetRefAPI (refimport_t rimp);
/*
==========================================================================
DIRECT LINK GLUE
==========================================================================
*/
#define MAXPRINTMSG 4096
void VID_Printf (int print_level, char *fmt, ...)
{
va_list argptr;
char msg[MAXPRINTMSG];
va_start (argptr,fmt);
vsprintf (msg,fmt,argptr);
va_end (argptr);
if (print_level == PRINT_ALL)
Com_Printf ("%s", msg);
else
Com_DPrintf ("%s", msg);
}
void VID_Error (int err_level, char *fmt, ...)
{
va_list argptr;
char msg[MAXPRINTMSG];
va_start (argptr,fmt);
vsprintf (msg,fmt,argptr);
va_end (argptr);
Com_Error (err_level, "%s", msg);
}
void VID_NewWindow (int width, int height)
{
viddef.width = width;
viddef.height = height;
}
/*
** VID_GetModeInfo
*/
typedef struct vidmode_s
{
const char *description;
int width, height;
int mode;
} vidmode_t;
vidmode_t vid_modes[] =
{
{ "Mode 0: 320x240", 320, 240, 0 },
{ "Mode 1: 400x300", 400, 300, 1 },
{ "Mode 2: 512x384", 512, 384, 2 },
{ "Mode 3: 640x480", 640, 480, 3 },
{ "Mode 4: 800x600", 800, 600, 4 },
{ "Mode 5: 960x720", 960, 720, 5 },
{ "Mode 6: 1024x768", 1024, 768, 6 },
{ "Mode 7: 1152x864", 1152, 864, 7 },
{ "Mode 8: 1280x960", 1280, 960, 8 },
{ "Mode 9: 1600x1200", 1600, 1200, 9 }
};
#define VID_NUM_MODES ( sizeof( vid_modes ) / sizeof( vid_modes[0] ) )
qboolean VID_GetModeInfo( int *width, int *height, int mode )
{
if ( mode < 0 || mode >= VID_NUM_MODES )
return false;
*width = vid_modes[mode].width;
*height = vid_modes[mode].height;
return true;
}
void VID_Init (void)
{
refimport_t ri;
viddef.width = 320;
viddef.height = 240;
ri.Cmd_AddCommand = Cmd_AddCommand;
ri.Cmd_RemoveCommand = Cmd_RemoveCommand;
ri.Cmd_Argc = Cmd_Argc;
ri.Cmd_Argv = Cmd_Argv;
ri.Cmd_ExecuteText = Cbuf_ExecuteText;
ri.Con_Printf = VID_Printf;
ri.Sys_Error = VID_Error;
ri.FS_LoadFile = FS_LoadFile;
ri.FS_FreeFile = FS_FreeFile;
ri.FS_Gamedir = FS_Gamedir;
ri.Vid_NewWindow = VID_NewWindow;
ri.Cvar_Get = Cvar_Get;
ri.Cvar_Set = Cvar_Set;
ri.Cvar_SetValue = Cvar_SetValue;
ri.Vid_GetModeInfo = VID_GetModeInfo;
re = GetRefAPI(ri);
if (re.api_version != API_VERSION)
Com_Error (ERR_FATAL, "Re has incompatible api_version");
// call the init function
if (re.Init (NULL, NULL) == -1)
Com_Error (ERR_FATAL, "Couldn't start refresh");
}
void VID_Shutdown (void)
{
if (re.Shutdown)
re.Shutdown ();
}
void VID_CheckChanges (void)
{
}
void VID_MenuInit (void)
{
}
void VID_MenuDraw (void)
{
}
const char *VID_MenuKey( int k)
{
return NULL;
}