quick and dirty fixes to get linux i386 compiling
This commit is contained in:
parent
9420dc7b9c
commit
4ce54b24e1
|
@ -30,7 +30,6 @@ short *snd_out;
|
|||
|
||||
void S_WriteLinearBlastStereo16 (void);
|
||||
|
||||
#if !(defined __linux__ && defined __i386__)
|
||||
#if !id386
|
||||
|
||||
void S_WriteLinearBlastStereo16 (void)
|
||||
|
@ -57,7 +56,7 @@ void S_WriteLinearBlastStereo16 (void)
|
|||
snd_out[i+1] = val;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#elif !(defined __linux__ && defined __i386__)
|
||||
__declspec( naked ) void S_WriteLinearBlastStereo16 (void)
|
||||
{
|
||||
__asm {
|
||||
|
@ -102,7 +101,6 @@ LClampDone2:
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void S_TransferStereo16 (unsigned long *pbuf, int endtime)
|
||||
|
@ -362,7 +360,6 @@ void S_InitScaletable (void)
|
|||
}
|
||||
|
||||
|
||||
#if !(defined __linux__ && defined __i386__)
|
||||
#if !id386
|
||||
|
||||
void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset)
|
||||
|
@ -396,7 +393,7 @@ void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset)
|
|||
ch->pos += count;
|
||||
}
|
||||
|
||||
#else
|
||||
#elif !(defined __linux__ && defined __i386__)
|
||||
|
||||
__declspec( naked ) void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset)
|
||||
{
|
||||
|
@ -468,7 +465,6 @@ LDone:
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void S_PaintChannelFrom16 (channel_t *ch, sfxcache_t *sc, int count, int offset)
|
||||
|
|
|
@ -588,7 +588,7 @@ static void InitSig(void)
|
|||
/*
|
||||
** GLimp_SetMode
|
||||
*/
|
||||
int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen )
|
||||
rserr_t GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen )
|
||||
{
|
||||
int width, height;
|
||||
int attrib[] = {
|
||||
|
@ -778,7 +778,7 @@ void GLimp_Shutdown( void )
|
|||
** This routine is responsible for initializing the OS specific portions
|
||||
** of OpenGL.
|
||||
*/
|
||||
int GLimp_Init( void *hinstance, void *wndproc )
|
||||
qboolean GLimp_Init( void *hinstance, void *wndproc )
|
||||
{
|
||||
InitSig();
|
||||
|
||||
|
|
|
@ -24,24 +24,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
cvar_t *in_mouse;
|
||||
cvar_t *in_joystick;
|
||||
|
||||
// This is fake, it's acutally done by the Refresh load
|
||||
void IN_Init (void)
|
||||
{
|
||||
in_mouse = Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE);
|
||||
in_joystick = Cvar_Get ("in_joystick", "0", CVAR_ARCHIVE);
|
||||
}
|
||||
|
||||
void IN_Shutdown (void)
|
||||
{
|
||||
}
|
||||
|
||||
void IN_Commands (void)
|
||||
{
|
||||
}
|
||||
|
||||
void IN_Move (usercmd_t *cmd)
|
||||
{
|
||||
}
|
||||
|
||||
void IN_Activate (qboolean active)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -219,13 +219,8 @@ void *Sys_GetGameAPI (void *parms)
|
|||
char name[MAX_OSPATH];
|
||||
char curpath[MAX_OSPATH];
|
||||
char *path;
|
||||
#ifdef __i386__
|
||||
const char *gamename = "gamei386.so";
|
||||
#elif defined __alpha__
|
||||
const char *gamename = "gameaxp.so";
|
||||
#else
|
||||
#error Unknown arch
|
||||
#endif
|
||||
const char *gamenames[] = {"game.wrapper.so", "game.server.so", "game.so", NULL};
|
||||
int i;
|
||||
|
||||
setreuid(getuid(), getuid());
|
||||
setegid(getgid());
|
||||
|
@ -235,7 +230,7 @@ void *Sys_GetGameAPI (void *parms)
|
|||
|
||||
getcwd(curpath, sizeof(curpath));
|
||||
|
||||
Com_Printf("------- Loading %s -------\n", gamename);
|
||||
Com_Printf("------- Loading %s -------\n", gamenames[1]);
|
||||
|
||||
// now run through the search paths
|
||||
path = NULL;
|
||||
|
@ -244,13 +239,18 @@ void *Sys_GetGameAPI (void *parms)
|
|||
path = FS_NextPath (path);
|
||||
if (!path)
|
||||
return NULL; // couldn't find one anywhere
|
||||
sprintf (name, "%s/%s/%s", curpath, path, gamename);
|
||||
game_library = dlopen (name, RTLD_LAZY );
|
||||
if (game_library)
|
||||
|
||||
for(i = 0; gamenames[i] != NULL; ++i)
|
||||
{
|
||||
Com_Printf ("LoadLibrary (%s)\n",name);
|
||||
break;
|
||||
sprintf (name, "%s/%s/%s", curpath, path, gamenames[i]);
|
||||
game_library = dlopen (name, RTLD_LAZY );
|
||||
if (game_library)
|
||||
{
|
||||
Com_Printf ("LoadLibrary (%s)\n",name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(game_library) break;
|
||||
}
|
||||
|
||||
GetGameAPI = (void *)dlsym (game_library, "GetGameAPI");
|
||||
|
|
|
@ -87,7 +87,7 @@ void VID_Printf (int print_level, char *fmt, ...)
|
|||
static qboolean inupdate;
|
||||
|
||||
va_start (argptr,fmt);
|
||||
vsprintf (msg,fmt,argptr);
|
||||
vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
if (print_level == PRINT_ALL)
|
||||
|
@ -392,7 +392,10 @@ Com_Printf("Trying mode 0\n");
|
|||
Com_Error (ERR_FATAL, "Couldn't fall back to software refresh!");
|
||||
}
|
||||
|
||||
Cvar_Set( "vid_ref", "soft" );
|
||||
if (getenv("DISPLAY"))
|
||||
Cvar_Set( "vid_ref", "softx" );
|
||||
else
|
||||
Cvar_Set( "vid_ref", "soft" );
|
||||
|
||||
/*
|
||||
** drop the console if we fail to load a refresh
|
||||
|
@ -417,9 +420,9 @@ void VID_Init (void)
|
|||
/* Create the video variables so we know how to start the graphics drivers */
|
||||
// if DISPLAY is defined, try X
|
||||
if (getenv("DISPLAY"))
|
||||
vid_ref = Cvar_Get ("vid_ref", "softx", CVAR_ARCHIVE);
|
||||
vid_ref = Cvar_Get ("vid_ref", "glx", CVAR_ARCHIVE);
|
||||
else
|
||||
vid_ref = Cvar_Get ("vid_ref", "soft", CVAR_ARCHIVE);
|
||||
vid_ref = Cvar_Get ("vid_ref", "gl", CVAR_ARCHIVE);
|
||||
vid_xpos = Cvar_Get ("vid_xpos", "3", CVAR_ARCHIVE);
|
||||
vid_ypos = Cvar_Get ("vid_ypos", "22", CVAR_ARCHIVE);
|
||||
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE);
|
||||
|
@ -460,14 +463,6 @@ void VID_Shutdown (void)
|
|||
/* INPUT */
|
||||
/*****************************************************************************/
|
||||
|
||||
cvar_t *in_joystick;
|
||||
|
||||
// This is fake, it's acutally done by the Refresh load
|
||||
void IN_Init (void)
|
||||
{
|
||||
in_joystick = Cvar_Get ("in_joystick", "0", CVAR_ARCHIVE);
|
||||
}
|
||||
|
||||
void Real_IN_Init (void)
|
||||
{
|
||||
if (RW_IN_Init_fp)
|
||||
|
@ -506,10 +501,6 @@ void IN_Frame (void)
|
|||
RW_IN_Frame_fp();
|
||||
}
|
||||
|
||||
void IN_Activate (qboolean active)
|
||||
{
|
||||
}
|
||||
|
||||
void Do_Key_Event(int key, qboolean down)
|
||||
{
|
||||
Key_Event(key, down, Sys_Milliseconds());
|
||||
|
|
|
@ -481,6 +481,13 @@ void Fake_glColorTableEXT( GLenum target, GLenum internalformat,
|
|||
#define GL_TEXTURE0_ARB 0x84C0
|
||||
#define GL_TEXTURE1_ARB 0x84C1
|
||||
|
||||
#ifdef GL_TEXTURE0
|
||||
#undef GL_TEXTURE0
|
||||
#endif
|
||||
#ifdef GL_TEXTURE1
|
||||
#undef GL_TEXTURE1
|
||||
#endif
|
||||
|
||||
extern int GL_TEXTURE0, GL_TEXTURE1;
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue