Merge pull request #3 from jonathangray/mp_port

adapt multiplayer code to gcc/unix
This commit is contained in:
Zachary J. Slater 2013-04-28 12:03:01 -07:00
commit d2d11a239b
79 changed files with 1459 additions and 966 deletions

506
CODE-mp/CMakeLists.txt Normal file
View File

@ -0,0 +1,506 @@
cmake_minimum_required(VERSION 2.6)
project(jk2mp)
set(cpu ${CMAKE_SYSTEM_PROCESSOR})
if (cpu MATCHES "i.86")
set(cpu "x86")
elseif(cpu STREQUAL "x86_64")
set(cpu "amd64")
endif()
# until amd64 works...
if (cpu MATCHES "amd64")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
set(cpu, "x86")
endif()
if(CMAKE_COMPILER_IS_GNUC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -O2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas -Wno-write-strings -Wno-missing-braces")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -O2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wno-write-strings -Wno-missing-braces")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas -fpermissive")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-parentheses-equality")
endif()
# avoid -rdynamic or loaded libraries will stomp over cvars
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
add_definitions( -D_M_IX86=1 ) # tested to mean little endian...
add_definitions( -D_IMMERSION_DISABLE )
add_definitions( -DNDEBUG )
add_definitions( -DFINAL_BUILD )
add_definitions( -D_JK2 )
add_definitions( -D_JK2MP )
include_directories(/usr/X11R6/include/)
link_directories(/usr/X11R6/lib)
include_directories(/usr/local/include/)
link_directories(/usr/local/lib)
set(src_main_client
client/FXExport.cpp
client/FxPrimitives.cpp
client/FxScheduler.cpp
client/FxSystem.cpp
client/FxTemplate.cpp
client/FxUtil.cpp
client/cl_cgame.cpp
client/cl_cin.cpp
client/cl_console.cpp
client/cl_input.cpp
client/cl_keys.cpp
client/cl_main.cpp
client/cl_net_chan.cpp
client/cl_parse.cpp
client/cl_scrn.cpp
client/cl_ui.cpp
client/snd_dma.cpp
client/snd_mem.cpp
client/snd_mix.cpp
client/snd_mp3.cpp
)
set(src_main_encryption
encryption/buffer.cpp
encryption/cpp_interface.cpp
encryption/sockets.cpp
)
set(src_main_ghoul2
ghoul2/G2_API.cpp
ghoul2/G2_bolts.cpp
ghoul2/G2_bones.cpp
ghoul2/G2_misc.cpp
ghoul2/G2_surfaces.cpp
)
set(src_main_jpeg
jpeg-6/jcapimin.cpp
jpeg-6/jccoefct.cpp
jpeg-6/jccolor.cpp
jpeg-6/jcdctmgr.cpp
jpeg-6/jchuff.cpp
jpeg-6/jcinit.cpp
jpeg-6/jcmainct.cpp
jpeg-6/jcmarker.cpp
jpeg-6/jcmaster.cpp
jpeg-6/jcomapi.cpp
jpeg-6/jcparam.cpp
jpeg-6/jcphuff.cpp
jpeg-6/jcprepct.cpp
jpeg-6/jcsample.cpp
jpeg-6/jctrans.cpp
jpeg-6/jdapimin.cpp
jpeg-6/jdapistd.cpp
jpeg-6/jdatadst.cpp
jpeg-6/jdatasrc.cpp
jpeg-6/jdcoefct.cpp
jpeg-6/jdcolor.cpp
jpeg-6/jddctmgr.cpp
jpeg-6/jdhuff.cpp
jpeg-6/jdinput.cpp
jpeg-6/jdmainct.cpp
jpeg-6/jdmarker.cpp
jpeg-6/jdmaster.cpp
jpeg-6/jdpostct.cpp
jpeg-6/jdsample.cpp
jpeg-6/jdtrans.cpp
jpeg-6/jerror.cpp
jpeg-6/jfdctflt.cpp
jpeg-6/jidctflt.cpp
jpeg-6/jmemmgr.cpp
jpeg-6/jmemnobs.cpp
jpeg-6/jutils.cpp
)
set(src_main_mp3code
mp3code/cdct.c
mp3code/csbt.c
mp3code/csbtb.c
mp3code/csbtL3.c
mp3code/cup.c
mp3code/cupini.c
mp3code/cupL1.c
mp3code/cupl3.c
mp3code/cwin.c
mp3code/cwinb.c
mp3code/cwinm.c
mp3code/hwin.c
mp3code/l3dq.c
mp3code/l3init.c
mp3code/mdct.c
mp3code/mhead.c
mp3code/msis.c
mp3code/towave.c
mp3code/uph.c
mp3code/upsf.c
mp3code/wavep.c
)
set(src_main_png
png/png.cpp
)
set(src_main_qcommon
qcommon/CNetProfile.cpp
qcommon/GenericParser2.cpp
qcommon/RoffSystem.cpp
qcommon/cm_load.cpp
qcommon/cm_patch.cpp
qcommon/cm_polylib.cpp
qcommon/cm_test.cpp
qcommon/cm_trace.cpp
qcommon/cmd.cpp
qcommon/common.cpp
qcommon/cvar.cpp
qcommon/files.cpp
qcommon/hstring.cpp
qcommon/huffman.cpp
qcommon/md4.cpp
qcommon/msg.cpp
qcommon/net_chan.cpp
qcommon/q_math.cpp
qcommon/q_shared.cpp
qcommon/strip.cpp
qcommon/unzip.cpp
qcommon/vm.cpp
qcommon/vm_interpreted.cpp
qcommon/vm_x86.cpp
)
set(src_renderer_common
renderer/matcomp.c
renderer/tr_backend.cpp
renderer/tr_ghoul2.cpp
renderer/tr_image.cpp
renderer/tr_init.cpp
renderer/tr_main.cpp
renderer/tr_mesh.cpp
renderer/tr_model.cpp
renderer/tr_shader.cpp
)
set(src_main_renderer
${src_renderer_common}
renderer/tr_WorldEffects.cpp
renderer/tr_animation.cpp
renderer/tr_bsp.cpp
renderer/tr_cmds.cpp
renderer/tr_curve.cpp
renderer/tr_flares.cpp
renderer/tr_font.cpp
renderer/tr_light.cpp
renderer/tr_marks.cpp
renderer/tr_noise.cpp
renderer/tr_quicksprite.cpp
renderer/tr_scene.cpp
renderer/tr_shade.cpp
renderer/tr_shade_calc.cpp
renderer/tr_shadows.cpp
renderer/tr_sky.cpp
renderer/tr_surface.cpp
renderer/tr_surfacesprites.cpp
renderer/tr_world.cpp
)
set(src_main_server
server/sv_bot.cpp
server/sv_ccmds.cpp
server/sv_client.cpp
server/sv_game.cpp
server/sv_init.cpp
server/sv_main.cpp
server/sv_net_chan.cpp
server/sv_snapshot.cpp
server/sv_world.cpp
)
set(src_main_win32
win32/win_gamma.cpp
win32/win_glimp.cpp
win32/win_input.cpp
win32/win_main.cpp
win32/win_net.cpp
win32/win_qgl.cpp
win32/win_shared.cpp
win32/win_snd.cpp
win32/win_syscon.cpp
win32/win_wndproc.cpp
)
set(src_main_zlib
zlib/adler32.c
zlib/crc32.cpp
zlib/deflate.c
zlib/infblock.c
zlib/infcodes.c
zlib/inffast.c
zlib/inflate.c
zlib/inftrees.c
zlib/infutil.c
zlib/trees.c
zlib/zutil.c
)
ENABLE_LANGUAGE(ASM_NASM)
set(src_unix_common
unix/linux_common.c
unix/unix_main.cpp
unix/unix_net.cpp
unix/unix_shared.cpp
unix/ftol.nasm
unix/snapvector.nasm
)
set(src_main_unix
${src_unix_common}
unix/linux_glimp.cpp
unix/linux_qgl.cpp
null/null_snddma.cpp
)
set(src_botlib
botlib/be_aas_bspq3.cpp
botlib/be_aas_cluster.cpp
botlib/be_aas_debug.cpp
botlib/be_aas_entity.cpp
botlib/be_aas_file.cpp
botlib/be_aas_main.cpp
botlib/be_aas_move.cpp
botlib/be_aas_optimize.cpp
botlib/be_aas_reach.cpp
botlib/be_aas_route.cpp
botlib/be_aas_routealt.cpp
botlib/be_aas_sample.cpp
botlib/be_ai_char.cpp
botlib/be_ai_chat.cpp
botlib/be_ai_gen.cpp
botlib/be_ai_goal.cpp
botlib/be_ai_move.cpp
botlib/be_ai_weap.cpp
botlib/be_ai_weight.cpp
botlib/be_ea.cpp
botlib/be_interface.cpp
botlib/l_crc.cpp
botlib/l_libvar.cpp
botlib/l_log.cpp
botlib/l_memory.cpp
botlib/l_precomp.cpp
botlib/l_script.cpp
botlib/l_struct.cpp
)
set(src_jk2mp
${src_main_client}
${src_main_encryption}
${src_main_ghoul2}
${src_main_jpeg}
${src_main_mp3code}
${src_main_png}
${src_main_qcommon}
${src_main_renderer}
${src_main_server}
${src_main_zlib}
${src_botlib}
${src_main_unix}
)
add_executable(jk2mp
${src_jk2mp}
)
set_target_properties(jk2mp PROPERTIES COMPILE_DEFINITIONS "_JK2EXE;_FF_DISABLE;BOTLIB")
target_link_libraries(jk2mp
m pthread
X11 Xxf86vm Xxf86dga
openal
)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(jk2mp dl)
endif()
set(src_ded_null
null/null_client.cpp
null/null_glimp.cpp
null/null_input.cpp
null/null_renderer.cpp
null/null_snddma.cpp
)
set(src_jk2mp_ded
${src_main_ghoul2}
${src_main_qcommon}
${src_renderer_common}
${src_main_server}
${src_main_zlib}
${src_botlib}
${src_unix_common}
${src_ded_null}
)
add_executable(jk2mpded
${src_jk2mp_ded}
)
set_target_properties(jk2mpded PROPERTIES COMPILE_DEFINITIONS "_JK2EXE;_FF_DISABLE;BOTLIB;DEDICATED")
target_link_libraries(jk2mpded
m pthread
)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(jk2mpded dl)
endif()
set(src_ui_game
game/bg_lib.c
game/bg_misc.c
game/bg_weapons.c
game/q_math.c
game/q_shared.c
)
set(src_ui_ui
ui/ui_atoms.c
ui/ui_force.c
ui/ui_gameinfo.c
ui/ui_main.c
ui/ui_shared.c
ui/ui_syscalls.c
)
add_library(ui${cpu} SHARED
${src_ui_game}
${src_ui_ui}
)
set_target_properties(ui${cpu} PROPERTIES PREFIX "")
set_target_properties(ui${cpu} PROPERTIES COMPILE_DEFINITIONS "_USRDL;UI_EXPORTS;MISSIONPACK")
set(src_cgame_cgame
cgame/cg_consolecmds.c
cgame/cg_draw.c
cgame/cg_drawtools.c
cgame/cg_effects.c
cgame/cg_ents.c
cgame/cg_event.c
cgame/cg_info.c
cgame/cg_light.c
cgame/cg_localents.c
cgame/cg_main.c
cgame/cg_marks.c
cgame/cg_newDraw.c
cgame/cg_players.c
cgame/cg_playerstate.c
cgame/cg_predict.c
cgame/cg_saga.c
cgame/cg_scoreboard.c
cgame/cg_servercmds.c
cgame/cg_snapshot.c
cgame/cg_syscalls.c
cgame/cg_turret.c
cgame/cg_view.c
cgame/cg_weaponinit.c
cgame/cg_weapons.c
cgame/fx_blaster.c
cgame/fx_bowcaster.c
cgame/fx_bryarpistol.c
cgame/fx_demp2.c
cgame/fx_disruptor.c
cgame/fx_flechette.c
cgame/fx_force.c
cgame/fx_heavyrepeater.c
cgame/fx_rocketlauncher.c
)
set(src_cgame_game
game/bg_lib.c
game/bg_misc.c
game/bg_panimate.c
game/bg_pmove.c
game/bg_saber.c
game/bg_slidemove.c
game/bg_weapons.c
game/q_math.c
game/q_shared.c
)
set(src_cgame_ui
ui/ui_shared.c
)
add_library(cgame${cpu} SHARED
${src_cgame_cgame}
${src_cgame_game}
${src_cgame_ui}
)
set_target_properties(cgame${cpu} PROPERTIES PREFIX "")
set_target_properties(cgame${cpu} PROPERTIES COMPILE_DEFINITIONS "CGAME;MISSIONPACK")
set(src_game_game
game/ai_main.c
game/ai_util.c
game/ai_wpnav.c
game/bg_lib.c
game/bg_misc.c
game/bg_panimate.c
game/bg_pmove.c
game/bg_saber.c
game/bg_slidemove.c
game/bg_weapons.c
game/g_active.c
game/g_arenas.c
game/g_bot.c
game/g_client.c
game/g_cmds.c
game/g_combat.c
game/g_items.c
game/g_log.c
game/g_main.c
game/g_mem.c
game/g_misc.c
game/g_missile.c
game/g_mover.c
game/g_object.c
game/g_saga.c
game/g_session.c
game/g_spawn.c
game/g_svcmds.c
game/g_syscalls.c
game/g_target.c
game/g_team.c
game/g_trigger.c
game/g_utils.c
game/g_weapon.c
game/q_math.c
game/q_shared.c
game/w_force.c
game/w_saber.c
)
add_library(jk2mpgame${cpu} SHARED
${src_game_game}
)
set_target_properties(jk2mpgame${cpu} PROPERTIES PREFIX "")
set_target_properties(jk2mpgame${cpu} PROPERTIES COMPILE_DEFINITIONS "QAGAME;MISSIONPACK")

View File

@ -706,7 +706,7 @@ int PC_ExpandBuiltinDefine(source_t *source, token_t *deftoken, define_t *define
token_t **firsttoken, token_t **lasttoken)
{
token_t *token;
unsigned long t; // time_t t; //to prevent LCC warning
time_t t;
char *curtime;
token = PC_CopyToken(deftoken);
@ -737,7 +737,7 @@ int PC_ExpandBuiltinDefine(source_t *source, token_t *deftoken, define_t *define
case BUILTIN_DATE:
{
t = time(NULL);
curtime = ctime((const long *)&t);
curtime = ctime(&t);
strcpy(token->string, "\"");
strncat(token->string, curtime+4, 7);
strncat(token->string+7, curtime+20, 4);
@ -752,7 +752,7 @@ int PC_ExpandBuiltinDefine(source_t *source, token_t *deftoken, define_t *define
case BUILTIN_TIME:
{
t = time(NULL);
curtime = ctime((const long *)&t);
curtime = ctime(&t);
strcpy(token->string, "\"");
strncat(token->string, curtime+11, 8);
strcat(token->string, "\"");
@ -947,7 +947,7 @@ void PC_ConvertPath(char *path)
if ((*ptr == '\\' || *ptr == '/') &&
(*(ptr+1) == '\\' || *(ptr+1) == '/'))
{
strcpy(ptr, ptr+1);
memmove(ptr, ptr+1, strlen(ptr));
} //end if
else
{

View File

@ -1103,7 +1103,7 @@ void StripDoubleQuotes(char *string)
{
if (*string == '\"')
{
strcpy(string, string+1);
memmove(string, string+1, strlen(string));
} //end if
if (string[strlen(string)-1] == '\"')
{
@ -1120,7 +1120,7 @@ void StripSingleQuotes(char *string)
{
if (*string == '\'')
{
strcpy(string, string+1);
memmove(string, string+1, strlen(string));
} //end if
if (string[strlen(string)-1] == '\'')
{

View File

@ -7,7 +7,7 @@
Ghoul2 Insert Start
*/
#include "../game/q_shared.h"
#include "../ghoul2/g2.h"
#include "../ghoul2/G2.h"
/*
Ghoul2 Insert end
*/

View File

@ -4,7 +4,7 @@
#include "cg_local.h"
#include "fx_local.h"
#include "../ghoul2/g2.h"
#include "../ghoul2/G2.h"
#include "../ui/ui_shared.h"
// for the voice chats

View File

@ -2,7 +2,7 @@
//
// cg_players.c -- handle the media and animation for player entities
#include "cg_local.h"
#include "../ghoul2/g2.h"
#include "../ghoul2/G2.h"
extern stringID_table_t animTable [MAX_ANIMATIONS+1];

View File

@ -1,5 +1,5 @@
#include "cg_local.h"
#include "bg_saga.h"
#include "../game/bg_saga.h"
#define DEFAULT_WIN_OBJECTIVE "sound/chars/kyle/prototype/personal.mp3"
#define DEFAULT_LOSE_OBJECTIVE "sound/chars/kyle/prototype/isntworking.mp3"

View File

@ -1,6 +1,6 @@
#include "cg_local.h"
#include "../game/q_shared.h"
#include "../ghoul2/g2.h"
#include "../ghoul2/G2.h"
//rww - The turret is heavily dependant on bone angles. We can't happily set that on the server, so it is done client-only.

View File

@ -377,7 +377,7 @@ static void CG_UpdateThirdPersonTargetDamp(void)
// Note that since there are a finite number of "practical" delta millisecond values possible,
// the ratio should be initialized into a chart ultimately.
ratio = powf(dampfactor, dtime);
ratio = Q_powf(dampfactor, dtime);
// This value is how much distance is "left" from the ideal.
VectorMA(cameraIdealTarget, -ratio, targetdiff, cameraCurTarget);
@ -448,7 +448,7 @@ static void CG_UpdateThirdPersonCameraDamp(void)
// Note that since there are a finite number of "practical" delta millisecond values possible,
// the ratio should be initialized into a chart ultimately.
ratio = powf(dampfactor, dtime);
ratio = Q_powf(dampfactor, dtime);
// This value is how much distance is "left" from the ideal.
VectorMA(cameraIdealLoc, -ratio, locdiff, cameraCurLoc);

View File

@ -306,7 +306,11 @@ typedef struct {
#if !defined _WIN32
#ifdef __linux__
#define OPENGL_DRIVER_NAME "libGL.so.1"
#else
#define OPENGL_DRIVER_NAME "libGL.so"
#endif
#else

View File

@ -128,7 +128,7 @@ MEM_BOOL MEM_CALLBACK MyMemReporter2(MEM_ERROR_INFO *info)
{
if (StackCache[i]<0||StackCache[i]>=nStack)
continue;
if (!strcmpi(start,StackNames[StackCache[i]]))
if (!Q_strcmpi(start,StackNames[StackCache[i]]))
break;
}
if (i<48)
@ -140,7 +140,7 @@ MEM_BOOL MEM_CALLBACK MyMemReporter2(MEM_ERROR_INFO *info)
{
for (i=0;i<nStack;i++)
{
if (!strcmpi(start,StackNames[i]))
if (!Q_strcmpi(start,StackNames[i]))
break;
}
if (i<nStack)

View File

@ -1,5 +1,5 @@
#include "client.h"
#include "FXScheduler.h"
#include "FxScheduler.h"
int FX_RegisterEffect(const char *file)

View File

@ -1,7 +1,7 @@
#include "client.h"
#if !defined(G2_H_INC)
#include "../ghoul2/g2_local.h"
#include "../ghoul2/G2_local.h"
#endif
#if !defined(FX_SCHEDULER_H_INC)

View File

@ -205,7 +205,7 @@ int CFxScheduler::RegisterEffect( const char *file, bool bHasCorrectPath /*= fal
*/
{
COM_StripExtension( file, sfile );
strlwr(sfile);
Q_strlwr(sfile);
}
// see if the specified file is already registered. If it is, just return the id of that file
@ -659,58 +659,58 @@ int CFxScheduler::ParseEffect( const char *file, CGPGroup *base )
grpName = primitiveGroup->GetName();
// Huge stricmp lists suxor
if ( !stricmp( grpName, "particle" ))
if ( !Q_stricmp( grpName, "particle" ))
{
type = Particle;
}
else if ( !stricmp( grpName, "line" ))
else if ( !Q_stricmp( grpName, "line" ))
{
type = Line;
}
else if ( !stricmp( grpName, "tail" ))
else if ( !Q_stricmp( grpName, "tail" ))
{
type = Tail;
}
else if ( !stricmp( grpName, "sound" ))
else if ( !Q_stricmp( grpName, "sound" ))
{
type = Sound;
}
else if ( !stricmp( grpName, "cylinder" ))
else if ( !Q_stricmp( grpName, "cylinder" ))
{
type = Cylinder;
}
else if ( !stricmp( grpName, "electricity" ))
else if ( !Q_stricmp( grpName, "electricity" ))
{
type = Electricity;
}
else if ( !stricmp( grpName, "emitter" ))
else if ( !Q_stricmp( grpName, "emitter" ))
{
type = Emitter;
}
else if ( !stricmp( grpName, "decal" ))
else if ( !Q_stricmp( grpName, "decal" ))
{
type = Decal;
}
else if ( !stricmp( grpName, "orientedparticle" ))
else if ( !Q_stricmp( grpName, "orientedparticle" ))
{
type = OrientedParticle;
}
else if ( !stricmp( grpName, "fxrunner" ))
else if ( !Q_stricmp( grpName, "fxrunner" ))
{
type = FxRunner;
}
else if ( !stricmp( grpName, "light" ))
else if ( !Q_stricmp( grpName, "light" ))
{
type = Light;
}
else if ( !stricmp( grpName, "cameraShake" ))
else if ( !Q_stricmp( grpName, "cameraShake" ))
{
type = CameraShake;
}
/*
// NOTE: Pat requested that flashes be disabled in MP. Since fx files are shared with SP, this is the easiest way to accomplish that....
// code will fall through and become type NONE....and therefore not parsed and added to the effect definition.
else if ( !stricmp( grpName, "flash" ))
else if ( !Q_stricmp( grpName, "flash" ))
{
type = ScreenFlash;
}
@ -887,7 +887,7 @@ CPrimitiveTemplate *CFxScheduler::GetPrimitiveCopy( SEffectTemplate *effectCopy,
for ( int i = 0; i < effectCopy->mPrimitiveCount; i++ )
{
if ( !stricmp( effectCopy->mPrimitives[i]->mName, componentName ))
if ( !Q_stricmp( effectCopy->mPrimitives[i]->mName, componentName ))
{
// we found a match, so return it
return effectCopy->mPrimitives[i];
@ -1134,7 +1134,7 @@ void CFxScheduler::PlayEffect( int id, CFxBoltInterface *obj )
if ( prim->mSpawnFlags & FX_EVEN_DISTRIBUTION )
{
factor = abs(prim->mSpawnDelay.GetMax() - prim->mSpawnDelay.GetMin()) / (float)count;
factor = abs((long)(prim->mSpawnDelay.GetMax() - prim->mSpawnDelay.GetMin())) / (float)count;
}
// Schedule the random number of bits
@ -1642,7 +1642,7 @@ void CFxScheduler::PlayEffect( int id, vec3_t origin, vec3_t axis[3], const int
if ( prim->mSpawnFlags & FX_EVEN_DISTRIBUTION )
{
factor = abs(prim->mSpawnDelay.GetMax() - prim->mSpawnDelay.GetMin()) / (float)count;
factor = abs((long)(prim->mSpawnDelay.GetMax() - prim->mSpawnDelay.GetMin())) / (float)count;
}
// Schedule the random number of bits

View File

@ -385,7 +385,7 @@ struct SEffectTemplate
bool operator == (const char * name) const
{
return !stricmp( mEffectName, name );
return !Q_stricmp( mEffectName, name );
}
void operator=(const SEffectTemplate &that);
};

View File

@ -273,23 +273,23 @@ bool CPrimitiveTemplate::ParseGroupFlags( const char *val, int *flags )
return true;
}
if ( !stricmp( flag[i], "linear" ))
if ( !Q_stricmp( flag[i], "linear" ))
{
*flags |= FX_LINEAR;
}
else if ( !stricmp( flag[i], "nonlinear" ))
else if ( !Q_stricmp( flag[i], "nonlinear" ))
{
*flags |= FX_NONLINEAR;
}
else if ( !stricmp( flag[i], "wave" ))
else if ( !Q_stricmp( flag[i], "wave" ))
{
*flags |= FX_WAVE;
}
else if ( !stricmp( flag[i], "random" ))
else if ( !Q_stricmp( flag[i], "random" ))
{
*flags |= FX_RAND;
}
else if ( !stricmp( flag[i], "clamp" ))
else if ( !Q_stricmp( flag[i], "clamp" ))
{
*flags |= FX_CLAMP;
}
@ -716,51 +716,51 @@ bool CPrimitiveTemplate::ParseFlags( const char *val )
return true;
}
if ( !stricmp( flag[i], "useModel" ))
if ( !Q_stricmp( flag[i], "useModel" ))
{
mFlags |= FX_ATTACHED_MODEL;
}
else if ( !stricmp( flag[i], "useBBox" ))
else if ( !Q_stricmp( flag[i], "useBBox" ))
{
mFlags |= FX_USE_BBOX;
}
else if ( !stricmp( flag[i], "usePhysics" ))
else if ( !Q_stricmp( flag[i], "usePhysics" ))
{
mFlags |= FX_APPLY_PHYSICS;
}
else if ( !stricmp( flag[i], "expensivePhysics" ))
else if ( !Q_stricmp( flag[i], "expensivePhysics" ))
{
mFlags |= FX_EXPENSIVE_PHYSICS;
}
else if ( !stricmp( flag[i], "impactKills" ))
else if ( !Q_stricmp( flag[i], "impactKills" ))
{
mFlags |= FX_KILL_ON_IMPACT;
}
else if ( !stricmp( flag[i], "impactFx" ))
else if ( !Q_stricmp( flag[i], "impactFx" ))
{
mFlags |= FX_IMPACT_RUNS_FX;
}
else if ( !stricmp( flag[i], "deathFx" ))
else if ( !Q_stricmp( flag[i], "deathFx" ))
{
mFlags |= FX_DEATH_RUNS_FX;
}
else if ( !stricmp( flag[i], "useAlpha" ))
else if ( !Q_stricmp( flag[i], "useAlpha" ))
{
mFlags |= FX_USE_ALPHA;
}
else if ( !stricmp( flag[i], "emitFx" ))
else if ( !Q_stricmp( flag[i], "emitFx" ))
{
mFlags |= FX_EMIT_FX;
}
else if ( !stricmp( flag[i], "depthHack" ))
else if ( !Q_stricmp( flag[i], "depthHack" ))
{
mFlags |= FX_DEPTH_HACK;
}
else if ( !stricmp( flag[i], "relative" ))
else if ( !Q_stricmp( flag[i], "relative" ))
{
mFlags |= FX_RELATIVE;
}
else if ( !stricmp( flag[i], "setShaderTime" ))
else if ( !Q_stricmp( flag[i], "setShaderTime" ))
{
mFlags |= FX_SET_SHADER_TIME;
}
@ -799,59 +799,59 @@ bool CPrimitiveTemplate::ParseSpawnFlags( const char *val )
return true;
}
if ( !stricmp( flag[i], "org2fromTrace" ))
if ( !Q_stricmp( flag[i], "org2fromTrace" ))
{
mSpawnFlags |= FX_ORG2_FROM_TRACE;
}
else if ( !stricmp( flag[i], "traceImpactFx" ))
else if ( !Q_stricmp( flag[i], "traceImpactFx" ))
{
mSpawnFlags |= FX_TRACE_IMPACT_FX;
}
else if ( !stricmp( flag[i], "org2isOffset" ))
else if ( !Q_stricmp( flag[i], "org2isOffset" ))
{
mSpawnFlags |= FX_ORG2_IS_OFFSET;
}
else if ( !stricmp( flag[i], "cheapOrgCalc" ))
else if ( !Q_stricmp( flag[i], "cheapOrgCalc" ))
{
mSpawnFlags |= FX_CHEAP_ORG_CALC;
}
else if ( !stricmp( flag[i], "cheapOrg2Calc" ))
else if ( !Q_stricmp( flag[i], "cheapOrg2Calc" ))
{
mSpawnFlags |= FX_CHEAP_ORG2_CALC;
}
else if ( !stricmp( flag[i], "absoluteVel" ))
else if ( !Q_stricmp( flag[i], "absoluteVel" ))
{
mSpawnFlags |= FX_VEL_IS_ABSOLUTE;
}
else if ( !stricmp( flag[i], "absoluteAccel" ))
else if ( !Q_stricmp( flag[i], "absoluteAccel" ))
{
mSpawnFlags |= FX_ACCEL_IS_ABSOLUTE;
}
else if ( !stricmp( flag[i], "orgOnSphere" ))
else if ( !Q_stricmp( flag[i], "orgOnSphere" ))
{
mSpawnFlags |= FX_ORG_ON_SPHERE;
}
else if ( !stricmp( flag[i], "orgOnCylinder" ))
else if ( !Q_stricmp( flag[i], "orgOnCylinder" ))
{
mSpawnFlags |= FX_ORG_ON_CYLINDER;
}
else if ( !stricmp( flag[i], "axisFromSphere" ))
else if ( !Q_stricmp( flag[i], "axisFromSphere" ))
{
mSpawnFlags |= FX_AXIS_FROM_SPHERE;
}
else if ( !stricmp( flag[i], "randrotaroundfwd" ))
else if ( !Q_stricmp( flag[i], "randrotaroundfwd" ))
{
mSpawnFlags |= FX_RAND_ROT_AROUND_FWD;
}
else if ( !stricmp( flag[i], "evenDistribution" ))
else if ( !Q_stricmp( flag[i], "evenDistribution" ))
{
mSpawnFlags |= FX_EVEN_DISTRIBUTION;
}
else if ( !stricmp( flag[i], "rgbComponentInterpolation" ))
else if ( !Q_stricmp( flag[i], "rgbComponentInterpolation" ))
{
mSpawnFlags |= FX_RGB_COMPONENT_INTERP;
}
else if ( !stricmp( flag[i], "affectedByWind" ))
else if ( !Q_stricmp( flag[i], "affectedByWind" ))
{
mSpawnFlags |= FX_AFFECTED_BY_WIND;
}
@ -1899,19 +1899,19 @@ bool CPrimitiveTemplate::ParseRGB( CGPGroup *grp )
val = pairs->GetTopValue();
// Huge stricmp lists suxor
if ( !stricmp( key, "start" ))
if ( !Q_stricmp( key, "start" ))
{
ParseRGBStart( val );
}
else if ( !stricmp( key, "end" ))
else if ( !Q_stricmp( key, "end" ))
{
ParseRGBEnd( val );
}
else if ( !stricmp( key, "parm" ) || !stricmp( key, "parms" ))
else if ( !Q_stricmp( key, "parm" ) || !Q_stricmp( key, "parms" ))
{
ParseRGBParm( val );
}
else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" ))
else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" ))
{
ParseRGBFlags( val );
}
@ -1953,19 +1953,19 @@ bool CPrimitiveTemplate::ParseAlpha( CGPGroup *grp )
val = pairs->GetTopValue();
// Huge stricmp lists suxor
if ( !stricmp( key, "start" ))
if ( !Q_stricmp( key, "start" ))
{
ParseAlphaStart( val );
}
else if ( !stricmp( key, "end" ))
else if ( !Q_stricmp( key, "end" ))
{
ParseAlphaEnd( val );
}
else if ( !stricmp( key, "parm" ) || !stricmp( key, "parms" ))
else if ( !Q_stricmp( key, "parm" ) || !Q_stricmp( key, "parms" ))
{
ParseAlphaParm( val );
}
else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" ))
else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" ))
{
ParseAlphaFlags( val );
}
@ -2007,19 +2007,19 @@ bool CPrimitiveTemplate::ParseSize( CGPGroup *grp )
val = pairs->GetTopValue();
// Huge stricmp lists suxor
if ( !stricmp( key, "start" ))
if ( !Q_stricmp( key, "start" ))
{
ParseSizeStart( val );
}
else if ( !stricmp( key, "end" ))
else if ( !Q_stricmp( key, "end" ))
{
ParseSizeEnd( val );
}
else if ( !stricmp( key, "parm" ) || !stricmp( key, "parms" ))
else if ( !Q_stricmp( key, "parm" ) || !Q_stricmp( key, "parms" ))
{
ParseSizeParm( val );
}
else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" ))
else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" ))
{
ParseSizeFlags( val );
}
@ -2061,19 +2061,19 @@ bool CPrimitiveTemplate::ParseSize2( CGPGroup *grp )
val = pairs->GetTopValue();
// Huge stricmp lists suxor
if ( !stricmp( key, "start" ))
if ( !Q_stricmp( key, "start" ))
{
ParseSize2Start( val );
}
else if ( !stricmp( key, "end" ))
else if ( !Q_stricmp( key, "end" ))
{
ParseSize2End( val );
}
else if ( !stricmp( key, "parm" ) || !stricmp( key, "parms" ))
else if ( !Q_stricmp( key, "parm" ) || !Q_stricmp( key, "parms" ))
{
ParseSize2Parm( val );
}
else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" ))
else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" ))
{
ParseSize2Flags( val );
}
@ -2115,19 +2115,19 @@ bool CPrimitiveTemplate::ParseLength( CGPGroup *grp )
val = pairs->GetTopValue();
// Huge stricmp lists suxor
if ( !stricmp( key, "start" ))
if ( !Q_stricmp( key, "start" ))
{
ParseLengthStart( val );
}
else if ( !stricmp( key, "end" ))
else if ( !Q_stricmp( key, "end" ))
{
ParseLengthEnd( val );
}
else if ( !stricmp( key, "parm" ) || !stricmp( key, "parms" ))
else if ( !Q_stricmp( key, "parm" ) || !Q_stricmp( key, "parms" ))
{
ParseLengthParm( val );
}
else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" ))
else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" ))
{
ParseLengthFlags( val );
}
@ -2163,112 +2163,112 @@ bool CPrimitiveTemplate::ParsePrimitive( CGPGroup *grp )
val = pairs->GetTopValue();
// Huge stricmp lists suxor
if ( !stricmp( key, "count" ))
if ( !Q_stricmp( key, "count" ))
{
ParseCount( val );
}
else if ( !stricmp( key, "shaders" ) || !stricmp( key, "shader" ))
else if ( !Q_stricmp( key, "shaders" ) || !Q_stricmp( key, "shader" ))
{
ParseShaders( pairs );
}
else if ( !stricmp( key, "models" ) || !stricmp( key, "model" ))
else if ( !Q_stricmp( key, "models" ) || !Q_stricmp( key, "model" ))
{
ParseModels( pairs );
}
else if ( !stricmp( key, "sounds" ) || !stricmp( key, "sound" ))
else if ( !Q_stricmp( key, "sounds" ) || !Q_stricmp( key, "sound" ))
{
ParseSounds( pairs );
}
else if ( !stricmp( key, "impactfx" ))
else if ( !Q_stricmp( key, "impactfx" ))
{
ParseImpactFxStrings( pairs );
}
else if ( !stricmp( key, "deathfx" ))
else if ( !Q_stricmp( key, "deathfx" ))
{
ParseDeathFxStrings( pairs );
}
else if ( !stricmp( key, "emitfx" ))
else if ( !Q_stricmp( key, "emitfx" ))
{
ParseEmitterFxStrings( pairs );
}
else if ( !stricmp( key, "playfx" ))
else if ( !Q_stricmp( key, "playfx" ))
{
ParsePlayFxStrings( pairs );
}
else if ( !stricmp( key, "life" ))
else if ( !Q_stricmp( key, "life" ))
{
ParseLife( val );
}
else if ( !stricmp( key, "cullrange" ))
else if ( !Q_stricmp( key, "cullrange" ))
{
mCullRange = atoi( val );
mCullRange *= mCullRange; // Square
}
else if ( !stricmp( key, "delay" ))
else if ( !Q_stricmp( key, "delay" ))
{
ParseDelay( val );
}
else if ( !stricmp( key, "bounce" ) || !stricmp( key, "intensity" )) // me==bad for reusing this...but it shouldn't hurt anything)
else if ( !Q_stricmp( key, "bounce" ) || !Q_stricmp( key, "intensity" )) // me==bad for reusing this...but it shouldn't hurt anything)
{
ParseElasticity( val );
}
else if ( !stricmp( key, "min" ))
else if ( !Q_stricmp( key, "min" ))
{
ParseMin( val );
}
else if ( !stricmp( key, "max" ))
else if ( !Q_stricmp( key, "max" ))
{
ParseMax( val );
}
else if ( !stricmp( key, "angle" ) || !stricmp( key, "angles" ))
else if ( !Q_stricmp( key, "angle" ) || !Q_stricmp( key, "angles" ))
{
ParseAngle( val );
}
else if ( !stricmp( key, "angleDelta" ))
else if ( !Q_stricmp( key, "angleDelta" ))
{
ParseAngleDelta( val );
}
else if ( !stricmp( key, "velocity" ) || !stricmp( key, "vel" ))
else if ( !Q_stricmp( key, "velocity" ) || !Q_stricmp( key, "vel" ))
{
ParseVelocity( val );
}
else if ( !stricmp( key, "acceleration" ) || !stricmp( key, "accel" ))
else if ( !Q_stricmp( key, "acceleration" ) || !Q_stricmp( key, "accel" ))
{
ParseAcceleration( val );
}
else if ( !stricmp( key, "gravity" ))
else if ( !Q_stricmp( key, "gravity" ))
{
ParseGravity( val );
}
else if ( !stricmp( key, "density" ))
else if ( !Q_stricmp( key, "density" ))
{
ParseDensity( val );
}
else if ( !stricmp( key, "variance" ))
else if ( !Q_stricmp( key, "variance" ))
{
ParseVariance( val );
}
else if ( !stricmp( key, "origin" ))
else if ( !Q_stricmp( key, "origin" ))
{
ParseOrigin1( val );
}
else if ( !stricmp( key, "origin2" ))
else if ( !Q_stricmp( key, "origin2" ))
{
ParseOrigin2( val );
}
else if ( !stricmp( key, "radius" ))
else if ( !Q_stricmp( key, "radius" ))
{
ParseRadius( val );
}
else if ( !stricmp( key, "height" ))
else if ( !Q_stricmp( key, "height" ))
{
ParseHeight( val );
}
else if ( !stricmp( key, "wind" ))
else if ( !Q_stricmp( key, "wind" ))
{
ParseWindModifier( val );
}
else if ( !stricmp( key, "rotation" ))
else if ( !Q_stricmp( key, "rotation" ))
{
ParseRotation( val );
}
@ -2276,15 +2276,15 @@ bool CPrimitiveTemplate::ParsePrimitive( CGPGroup *grp )
{
ParseRotationDelta( val );
}
else if ( !stricmp( key, "flags" ) || !stricmp( key, "flag" ))
else if ( !Q_stricmp( key, "flags" ) || !Q_stricmp( key, "flag" ))
{ // these need to get passed on to the primitive
ParseFlags( val );
}
else if ( !stricmp( key, "spawnFlags" ) || !stricmp( key, "spawnFlag" ))
else if ( !Q_stricmp( key, "spawnFlags" ) || !Q_stricmp( key, "spawnFlag" ))
{ // these are used to spawn things in cool ways, but don't ever get passed on to prims.
ParseSpawnFlags( val );
}
else if ( !stricmp( key, "name" ))
else if ( !Q_stricmp( key, "name" ))
{
if ( val )
{
@ -2307,23 +2307,23 @@ bool CPrimitiveTemplate::ParsePrimitive( CGPGroup *grp )
{
key = subGrp->GetName();
if ( !stricmp( key, "rgb" ))
if ( !Q_stricmp( key, "rgb" ))
{
ParseRGB( subGrp );
}
else if ( !stricmp( key, "alpha" ))
else if ( !Q_stricmp( key, "alpha" ))
{
ParseAlpha( subGrp );
}
else if ( !stricmp( key, "size" ) || !stricmp( key, "width" ))
else if ( !Q_stricmp( key, "size" ) || !Q_stricmp( key, "width" ))
{
ParseSize( subGrp );
}
else if ( !stricmp( key, "size2" ) || !stricmp( key, "width2" ))
else if ( !Q_stricmp( key, "size2" ) || !Q_stricmp( key, "width2" ))
{
ParseSize2( subGrp );
}
else if ( !stricmp( key, "length" ) || !stricmp( key, "height" ))
else if ( !Q_stricmp( key, "length" ) || !Q_stricmp( key, "height" ))
{
ParseLength( subGrp );
}
@ -2336,4 +2336,4 @@ bool CPrimitiveTemplate::ParsePrimitive( CGPGroup *grp )
}
return true;
}
}

View File

@ -8,10 +8,10 @@
#include "FXExport.h"
#endif
#include "FXutil.h"
#include "FxUtil.h"
#if !defined(CROFFSYSTEM_H_INC)
#include "../qcommon/ROFFSystem.h"
#include "../qcommon/RoffSystem.h"
#endif
#ifdef _DONETPROFILE_

View File

@ -1189,7 +1189,7 @@ e_status CIN_RunCinematic (int handle)
}
thisTime = Sys_Milliseconds()*com_timescale->value;
if (cinTable[currentHandle].shader && (abs(thisTime - cinTable[currentHandle].lastTime))>100) {
if (cinTable[currentHandle].shader && (abs((long)(thisTime - cinTable[currentHandle].lastTime)))>100) {
cinTable[currentHandle].startTime += thisTime - cinTable[currentHandle].lastTime;
}
cinTable[currentHandle].tfps = ((((Sys_Milliseconds()*com_timescale->value) - cinTable[currentHandle].startTime)*cinTable[currentHandle].roqFPS)/1000);

View File

@ -741,10 +741,10 @@ usercmd_t CL_CreateCmd( void ) {
// draw debug graphs of turning for mouse testing
if ( cl_debugMove->integer ) {
if ( cl_debugMove->integer == 1 ) {
SCR_DebugGraph( abs(cl.viewangles[YAW] - oldAngles[YAW]), 0 );
SCR_DebugGraph( abs((long)(cl.viewangles[YAW] - oldAngles[YAW])), 0 );
}
if ( cl_debugMove->integer == 2 ) {
SCR_DebugGraph( abs(cl.viewangles[PITCH] - oldAngles[PITCH]), 0 );
SCR_DebugGraph( abs((long)(cl.viewangles[PITCH] - oldAngles[PITCH])), 0 );
}
}

View File

@ -1013,7 +1013,7 @@ int Key_StringToKeynum( char *str ) {
// scan for a text match
for ( i = 0 ; i < MAX_KEYS ; i++ )
{
if ( keynames[i].name && !stricmp( str, keynames[i].name ) )
if ( keynames[i].name && !Q_stricmp( str, keynames[i].name ) )
{
return keynames[i].keynum;
}

View File

@ -11,7 +11,7 @@
#ifdef G2_COLLISION_ENABLED
#if !defined (MINIHEAP_H_INC)
#include "../qcommon/miniheap.h"
#include "../qcommon/MiniHeap.h"
#endif
#endif

View File

@ -2,7 +2,7 @@
#include "client.h"
#include "../qcommon/strip.h"
#include "../ghoul2/g2_local.h"
#include "../ghoul2/G2_local.h"
#ifdef _DONETPROFILE_
#include "../qcommon/INetProfile.h"
#endif

View File

@ -155,7 +155,7 @@ portable_samplepair_t s_rawsamples[MAX_RAW_SAMPLES];
*
\**************************************************************************************************/
int s_UseOpenAL = false; // Determines if using Open AL or the default software mixer
int s_UseOpenAL = true; // Determines if using Open AL or the default software mixer
ALfloat listener_pos[3]; // Listener Position
ALfloat listener_ori[6]; // Listener Orientation
int s_numChannels; // Number of AL Sources == Num of Channels
@ -167,6 +167,7 @@ void UpdateLoopingSounds();
void UpdateRawSamples();
// EAX Related
#ifdef HAVE_EAX
ALboolean s_bEAX; // Is EAX 3.0 support is available
bool s_bEALFileLoaded; // Has an .eal file been loaded for the current level
bool s_bInWater; // Underwater effect currently active
@ -204,6 +205,8 @@ const GUID DSPROPSETID_EAX30_ListenerProperties
const GUID DSPROPSETID_EAX30_BufferProperties
= { 0xa8fa6881, 0xb476, 0x11d3, { 0xbd, 0xb9, 0x0, 0xc0, 0xf0, 0x2d, 0xdf, 0x87} };
#endif // HAVE_EAX
/**************************************************************************************************\
*
* End of Open AL Specific
@ -304,7 +307,7 @@ void S_Init( void )
// dontcha just love ID's defines sometimes?...
//
#if !( (defined __linux__ || __FreeBSD__ ) && (defined __i386__) )
#ifdef _MSVC_VER
#if !id386
#else
extern unsigned int uiMMXAvailable;
@ -327,12 +330,9 @@ void S_Init( void )
Cmd_AddCommand("soundstop", S_StopAllSounds);
cv = Cvar_Get("s_UseOpenAL" , "0",CVAR_ARCHIVE|CVAR_LATCH);
s_UseOpenAL = !!(cv->integer);
if (s_UseOpenAL)
{
ALCDevice = alcOpenDevice((ALubyte*)"DirectSound3D");
ALCDevice = alcOpenDevice(NULL);
if (!ALCDevice)
return;
@ -357,14 +357,18 @@ void S_Init( void )
S_SoundInfo_f();
// Set default level name
#ifdef HAVE_EAX
memset(s_LevelName, 0, sizeof(s_LevelName));
#endif
// Set Listener attributes
alListenerfv(AL_POSITION,listenerPos);
alListenerfv(AL_VELOCITY,listenerVel);
alListenerfv(AL_ORIENTATION,listenerOri);
#ifdef HAVE_EAX
InitEAXManager();
#endif
memset(s_channels, 0, sizeof(s_channels));
@ -562,7 +566,9 @@ void S_Shutdown( void )
// Close device
alcCloseDevice(ALCDevice);
#ifdef HAVE_EAX
ReleaseEAXManager();
#endif
s_numChannels = 0;
}
@ -751,6 +757,7 @@ void S_BeginRegistration( void )
}
}
#ifdef HAVE_EAX
void EALFileInit(char *level)
{
long lRoom;
@ -797,6 +804,7 @@ void EALFileInit(char *level)
}
}
}
#endif // HAVE_EAX
/*
==================
@ -1281,7 +1289,7 @@ void S_StartSound(vec3_t origin, int entityNum, int entchannel, sfxHandle_t sfxH
ch = s_channels + 1;
for (i = 1; i < s_numChannels; i++, ch++)
{
if ((ch->entnum == entityNum) && (ch->entchannel == CHAN_WEAPON) && (ch->thesfx) && (strstr(strlwr(ch->thesfx->sSoundName), "altcharge") != NULL))
if ((ch->entnum == entityNum) && (ch->entchannel == CHAN_WEAPON) && (ch->thesfx) && (strstr(Q_strlwr(ch->thesfx->sSoundName), "altcharge") != NULL))
{
// Stop this sound
alSourceStop(ch->alSource);
@ -1297,7 +1305,7 @@ void S_StartSound(vec3_t origin, int entityNum, int entchannel, sfxHandle_t sfxH
ch = s_channels + 1;
for (i = 1; i < s_numChannels; i++, ch++)
{
if ((ch->entnum == entityNum) && (ch->thesfx) && (strstr(strlwr(ch->thesfx->sSoundName), "falling") != NULL))
if ((ch->entnum == entityNum) && (ch->thesfx) && (strstr(Q_strlwr(ch->thesfx->sSoundName), "falling") != NULL))
{
// Stop this sound
alSourceStop(ch->alSource);
@ -1946,10 +1954,12 @@ void S_UpdateEntityPosition( int entityNum, const vec3_t origin )
pos[2] = -origin[1];
alSourcefv(s_channels[i].alSource, AL_POSITION, pos);
#ifdef HAVE_EAX
if (s_bEALFileLoaded)
{
UpdateEAXBuffer(ch);
}
#endif
}
}
}
@ -1967,7 +1977,9 @@ Change the volumes of all the playing sounds for changes in their positions
*/
void S_Respatialize( int entityNum, const vec3_t head, vec3_t axis[3], int inwater )
{
#ifdef HAVE_EAX
EAXOCCLUSIONPROPERTIES eaxOCProp;
#endif
unsigned int ulEnvironment;
int i;
channel_t *ch;
@ -1982,11 +1994,13 @@ void S_Respatialize( int entityNum, const vec3_t head, vec3_t axis[3], int inwat
{
// Check if a new level has been loaded - if so, try and load the appropriate EAL file
mapname = cl.mapname;
#ifdef HAVE_EAX
if ((mapname) && (strcmp(mapname, s_LevelName) != 0))
{
EALFileInit(mapname);
strcpy(s_LevelName, mapname);
}
#endif
listener_number = entityNum;
@ -2002,7 +2016,7 @@ void S_Respatialize( int entityNum, const vec3_t head, vec3_t axis[3], int inwat
listener_ori[4] = axis[2][2];
listener_ori[5] = -axis[2][1];
alListenerfv(AL_ORIENTATION, listener_ori);
#ifdef HAVE_EAX
// Update EAX effects here
if (s_bEALFileLoaded)
{
@ -2055,6 +2069,7 @@ void S_Respatialize( int entityNum, const vec3_t head, vec3_t axis[3], int inwat
}
}
}
#endif // HAVE_EAX
}
else
{
@ -2296,8 +2311,10 @@ void S_Update_(void) {
alSourcei(s_channels[source].alSource, AL_LOOPING, AL_FALSE);
alSourcef(s_channels[source].alSource, AL_GAIN, ((float)(ch->master_vol) * s_volume->value) / 255.0f);
#ifdef HAVE_EAX
if (s_bEALFileLoaded)
UpdateEAXBuffer(ch);
#endif
int nBytesDecoded = 0;
int nTotalBytesDecoded = 0;
@ -2387,7 +2404,9 @@ void S_Update_(void) {
UpdateRawSamples();
#ifdef HAVE_EAX
EAXMorph();
#endif
}
else
{
@ -2667,8 +2686,10 @@ void UpdateLoopingSounds()
alSourcei(s_channels[source].alSource, AL_LOOPING, AL_TRUE);
alSourcef(s_channels[source].alSource, AL_GAIN, (float)(ch->master_vol) * s_volume->value * fVolume);
#ifdef HAVE_EAX
if (s_bEALFileLoaded)
UpdateEAXBuffer(ch);
#endif
alGetError();
alSourcePlay(s_channels[source].alSource);
@ -2721,7 +2742,9 @@ void UpdateRawSamples()
size = (s_rawend - s_paintedtime)<<2;
if (size > (MAX_RAW_SAMPLES<<2))
{
#ifdef _DEBUG
OutputDebugString("UpdateRawSamples :- Raw Sample buffer has overflowed !!!\n");
#endif
// s_rawend = s_paintedtime + MAX_RAW_SAMPLES;
// size = MAX_RAW_SAMPLES<<2;
size = MAX_RAW_SAMPLES<<2;
@ -3649,6 +3672,7 @@ qboolean SND_RegisterAudio_LevelLoadEnd(qboolean bDeleteEverythingNotUsedThisLev
return bAtLeastOneSoundDropped;
}
#ifdef HAVE_EAX
/****************************************************************************************************\
*
* EAX Related
@ -4284,4 +4308,5 @@ void Clamp(EAXVECTOR *eaxVector)
eaxVector->x *= flInvMagnitude;
eaxVector->y *= flInvMagnitude;
eaxVector->z *= flInvMagnitude;
}
}
#endif // HAVE_EAX

View File

@ -9,11 +9,18 @@
#include "../mp3code/mp3struct.h"
// Open AL Specific
#ifdef _WIN32
#include "openal/al.h"
#include "openal/alc.h"
#include <objbase.h>
#ifdef HAVE_EAX
#include "eax/eax.h"
#include "eax/eaxman.h"
#endif
#else
#include <AL/al.h>
#include <AL/alc.h>
#endif
// Added for Open AL to know when to mute all sounds (e.g when app. loses focus)
void S_MuteAllSounds(bool bMute);

View File

@ -281,15 +281,15 @@ static qboolean S_LoadSound_FileLoadAndNameAdjuster(char *psFilename, byte **pDa
// account for foreign voices...
//
extern cvar_t* s_language;
if (s_language && stricmp("DEUTSCH",s_language->string)==0)
if (s_language && Q_stricmp("DEUTSCH",s_language->string)==0)
{
strncpy(psVoice,"chr_d",5); // same number of letters as "chars"
}
else if (s_language && stricmp("FRANCAIS",s_language->string)==0)
else if (s_language && Q_stricmp("FRANCAIS",s_language->string)==0)
{
strncpy(psVoice,"chr_f",5); // same number of letters as "chars"
}
else if (s_language && stricmp("ESPANOL",s_language->string)==0)
else if (s_language && Q_stricmp("ESPANOL",s_language->string)==0)
{
strncpy(psVoice,"chr_e",5); // same number of letters as "chars"
}
@ -391,7 +391,7 @@ static qboolean S_LoadSound_Actual( sfx_t *sfx )
sfx->iLastTimeUsed = Com_Milliseconds()+1; // why +1? Hmmm, leave it for now I guess
//=========
if (strnicmp(psExt,".mp3",4)==0)
if (Q_strnicmp(psExt,".mp3",4)==0)
{
// load MP3 file instead...
//

View File

@ -13,8 +13,7 @@ int* snd_p;
int snd_linear_count;
short* snd_out;
#if !( (defined __linux__ || __FreeBSD__ ) && (defined __i386__) ) // rb010123
#if !id386
#if !(defined(_MSVC_VER) && defined(__i386__))
void S_WriteLinearBlastStereo16 (void)
@ -129,9 +128,6 @@ LExit:
}
}
#endif
#else
void S_WriteLinearBlastStereo16 (void);
#endif
void S_TransferStereo16 (unsigned long *pbuf, int endtime)

View File

@ -1,7 +1,7 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
#include "g_local.h"
#include "../ghoul2/g2.h"
#include "../ghoul2/G2.h"
// g_client.c -- client functions that don't happen every frame

View File

@ -1839,7 +1839,7 @@ void FinishSpawningItem( gentity_t *ent ) {
// create a Ghoul2 model if the world model is a glm
/* item = &bg_itemlist[ ent->s.modelindex ];
if (!stricmp(&item->world_model[0][strlen(item->world_model[0]) - 4], ".glm"))
if (!Q_stricmp(&item->world_model[0][strlen(item->world_model[0]) - 4], ".glm"))
{
trap_G2API_InitGhoul2Model(&ent->s, item->world_model[0], G_ModelIndex(item->world_model[0] ), 0, 0, 0, 0);
ent->s.radius = 60;

View File

@ -721,9 +721,7 @@ int BoxOnPlaneSide2 (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
==================
*/
#if !( (defined __linux__ || __FreeBSD__) && (defined __i386__) && (!defined C_ONLY)) // rb010123
#if defined __LCC__ || defined C_ONLY || !id386
#ifndef _MSC_VER
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
{
@ -1022,7 +1020,6 @@ Lerror:
}
#pragma warning( default: 4035 )
#endif
#endif
/*
@ -1331,7 +1328,7 @@ int irand(int min, int max)
return(result);
}
float powf ( float x, int y )
float Q_powf ( float x, int y )
{
float r = x;
for ( y--; y>0; y-- )

View File

@ -32,9 +32,6 @@
#define assert(exp) ((void)0)
#define min(x,y) ((x)<(y)?(x):(y))
#define max(x,y) ((x)>(y)?(x):(y))
#else
#include <assert.h>
@ -49,6 +46,13 @@
#endif
#if defined(Q3_VM) || defined(CGAME) || defined(QAGAME) || defined(UI_EXPORTS)
#define min(x,y) ((x)<(y)?(x):(y))
#define max(x,y) ((x)>(y)?(x):(y))
#endif
#ifdef _WIN32
//#pragma intrinsic( memset, memcpy )
@ -120,7 +124,6 @@ static ID_INLINE float BigFloat(const float *l) { FloatSwap(l); }
#define MAC_STATIC
#define __cdecl
#define __declspec(x)
#define stricmp strcasecmp
#define ID_INLINE inline
#ifdef __ppc__
@ -196,14 +199,13 @@ static inline float LittleFloat (const float l) { return FloatSwap(&l); }
// just waste space and make big arrays static...
#ifdef __linux__
// bk001205 - from Makefile
#define stricmp strcasecmp
#define MAC_STATIC // bk: FIXME
#define ID_INLINE inline
#ifdef __i386__
#define CPUSTRING "linux-i386"
#elif defined(__amd64__) || defined(__x86_64__)
#define CPUSTRING "linux-amd64"
#elif defined __axp__
#define CPUSTRING "linux-alpha"
#else
@ -238,11 +240,56 @@ inline static float LittleFloat (const float *l) { return FloatSwap(l); }
#endif
//======================= OPENBSD DEFINES =================================
// the mac compiler can't handle >32k of locals, so we
// just waste space and make big arrays static...
#ifdef __OpenBSD__
#define MAC_STATIC // bk: FIXME
#define ID_INLINE inline
#ifdef __i386__
#define CPUSTRING "openbsd-i386"
#elif (defined(__amd64__) || defined(__x86_64__)
#define CPUSTRING "openbsd-amd64"
#elif defined __axp__
#define CPUSTRING "openbsd-alpha"
#else
#define CPUSTRING "openbsd-other"
#endif
#define PATH_SEP '/'
// bk001205 - try
#ifdef Q3_STATIC
#define GAME_HARD_LINKED
#define CGAME_HARD_LINKED
#define UI_HARD_LINKED
#define BOTLIB_HARD_LINKED
#endif
#if !idppc
inline static short BigShort( short l) { return ShortSwap(l); }
#define LittleShort
inline static int BigLong(int l) { return LongSwap(l); }
#define LittleLong
inline static float BigFloat(const float *l) { return FloatSwap(l); }
#define LittleFloat
#else
#define BigShort
inline static short LittleShort(short l) { return ShortSwap(l); }
#define BigLong
inline static int LittleLong (int l) { return LongSwap(l); }
#define BigFloat
inline static float LittleFloat (const float *l) { return FloatSwap(l); }
#endif
#endif
//======================= FreeBSD DEFINES =====================
#ifdef __FreeBSD__ // rb010123
#define stricmp strcasecmp
#define MAC_STATIC
#define ID_INLINE inline
@ -284,6 +331,8 @@ typedef unsigned char byte;
typedef unsigned short word;
typedef unsigned long ulong;
typedef const char *LPCSTR;
typedef enum {qfalse, qtrue} qboolean;
typedef int qhandle_t;
@ -745,7 +794,7 @@ float Q_rsqrt( float f ); // reciprocal square root
signed char ClampChar( int i );
signed short ClampShort( int i );
float powf ( float x, int y );
float Q_powf ( float x, int y );
// this isn't a real cheap function to call!
int DirToByte( vec3_t dir );
@ -1012,6 +1061,15 @@ char *Q_strlwr( char *s1 );
char *Q_strupr( char *s1 );
char *Q_strrchr( const char* string, int c );
// NON-portable (but faster) versions
#ifdef WIN32
static inline int Q_strnicmp (const char *s1, const char *s2, int n) { return strnicmp(s1, s2, n); }
static inline int Q_strcmpi (const char *s1, const char *s2) { return strcmpi(s1, s2); }
#else
static inline int Q_strnicmp (const char *s1, const char *s2, int n) { return strncasecmp(s1, s2, n); }
static inline int Q_strcmpi (const char *s1, const char *s2) { return strcasecmp(s1, s2); }
#endif
// buffer size safe library replacements
void Q_strncpyz( char *dest, const char *src, int destsize );
void Q_strcat( char *dest, int size, const char *src );

View File

@ -1,7 +1,7 @@
#include "g_local.h"
#include "w_saber.h"
#include "ai_main.h"
#include "../ghoul2/g2.h"
#include "../ghoul2/G2.h"
#define METROID_JUMP 1

View File

@ -2,7 +2,7 @@
#include "bg_local.h" //Only because we use PM_SetAnim here once.
#include "w_saber.h"
#include "ai_main.h"
#include "../ghoul2/g2.h"
#include "../ghoul2/G2.h"
#define SABER_BOX_SIZE 16.0f

View File

@ -16,7 +16,7 @@
#include "G2_local.h"
#ifdef G2_COLLISION_ENABLED
#include "../qcommon/miniheap.h"
#include "../qcommon/MiniHeap.h"
#endif
#include <set>
@ -1370,4 +1370,4 @@ void G2API_AddSkinGore(CGhoul2Info_v &ghoul2,SSkinGoreData &gore)
G2_TraceModels(ghoul2, transHitLocation, transRayDirection, 0, gore.entNum, 0, lod);
}
}
#endif _SOF2
#endif _SOF2

View File

@ -179,7 +179,7 @@ int G2_Add_Bolt(const char *fileName, boltInfo_v &bltlist, surfaceInfo_v &slist,
{
skel = (mdxaSkel_t *)((byte *)mod_a->mdxa + sizeof(mdxaHeader_t) + offsets->offsets[x]);
// if name is the same, we found it
if (!stricmp(skel->name, boneName))
if (!Q_stricmp(skel->name, boneName))
{
break;
}

View File

@ -14,7 +14,7 @@
#include "../qcommon/qcommon.h"
#endif
#include "../renderer/MatComp.h"
#include "../renderer/matcomp.h"
#if !defined(G2_H_INC)
#include "G2.h"
@ -47,7 +47,7 @@ int G2_Find_Bone(const model_t *mod, boneInfo_v &blist, const char *boneName)
skel = (mdxaSkel_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t) + offsets->offsets[blist[i].boneNumber]);
// if name is the same, we found it
if (!stricmp(skel->name, boneName))
if (!Q_stricmp(skel->name, boneName))
{
return i;
}
@ -72,7 +72,7 @@ int G2_Add_Bone (const model_t *mod, boneInfo_v &blist, const char *boneName)
{
skel = (mdxaSkel_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t) + offsets->offsets[x]);
// if name is the same, we found it
if (!stricmp(skel->name, boneName))
if (!Q_stricmp(skel->name, boneName))
{
break;
}
@ -94,7 +94,7 @@ int G2_Add_Bone (const model_t *mod, boneInfo_v &blist, const char *boneName)
{
skel = (mdxaSkel_t *)((byte *)mod->mdxa + sizeof(mdxaHeader_t) + offsets->offsets[blist[i].boneNumber]);
// if name is the same, we found it
if (!stricmp(skel->name, boneName))
if (!Q_stricmp(skel->name, boneName))
{
return i;
}
@ -1238,4 +1238,4 @@ int G2_Get_Bone_Index(CGhoul2Info *ghoul2, const char *boneName)
model_t *mod_a = R_GetModelByHandle(mod_m->mdxm->animIndex);
return (G2_Find_Bone(mod_a, ghoul2->mBlist, boneName));
}
}

View File

@ -11,14 +11,14 @@
#include "../renderer/tr_local.h"
#endif
#include "../renderer/MatComp.h"
#include "../renderer/matcomp.h"
#if !defined(G2_H_INC)
#include "G2.h"
#endif
#if !defined (MINIHEAP_H_INC)
#include "../qcommon/miniheap.h"
#include "../qcommon/MiniHeap.h"
#endif
#include "../server/server.h"
@ -1650,7 +1650,7 @@ int G2_FindConfigStringSpace(char *name, int start, int max)
{
break;
}
if ( !stricmp( s, name ) )
if ( !Q_stricmp( s, name ) )
{
return i;
}

View File

@ -72,7 +72,7 @@ int G2_IsSurfaceLegal(void *mod, const char *surfaceName, int *flags)
for ( int i = 0 ; i < mod_m->mdxm->numSurfaces ; i++)
{
if (!stricmp(surfaceName, surf->name))
if (!Q_stricmp(surfaceName, surf->name))
{
*flags = surf->flags;
return i;
@ -126,7 +126,7 @@ mdxmSurface_t *G2_FindSurface(const char *fileName, surfaceInfo_v &slist, const
surfInfo = (mdxmSurfHierarchy_t *)((byte *)surfIndexes + surfIndexes->offsets[surf->thisSurfaceIndex]);
// are these the droids we're looking for?
if (!stricmp (surfInfo->name, surfaceName))
if (!Q_stricmp (surfInfo->name, surfaceName))
{
// yup
if (surfIndex)
@ -218,7 +218,7 @@ int G2_IsSurfaceOff (const char *fileName, surfaceInfo_v &slist, const char *sur
for ( int i = 0 ; i < mod->mdxm->numSurfaces ; i++)
{
if (!stricmp(surfaceName, surface->name))
if (!Q_stricmp(surfaceName, surface->name))
{
return surface->flags;
}

View File

@ -70,6 +70,11 @@
#include <stdio.h>
#ifndef WIN32
#include <stdint.h>
typedef int32_t INT32;
#endif
/*
* We need memory copying and zeroing functions, plus strncpy().
* ANSI and System V implementations declare these in <string.h>.

View File

@ -10,6 +10,10 @@
#include "small_header.h" // for SAMPLE and IN_OUT
#ifndef byte
typedef unsigned char byte;
#endif
typedef void (*SBT_FUNCTION) (float *sample, short *pcm, int n);
typedef void (*XFORM_FUNCTION) (void *pcm, int igr);
typedef IN_OUT(*DECODE_FUNCTION) (unsigned char *bs, unsigned char *pcm);

View File

@ -151,13 +151,6 @@ decode (standard decoder) reduction_code:
#include "mp3struct.h"
#include <assert.h>
#ifndef byte
typedef unsigned char byte;
#endif
typedef struct id3v1_1 {
char id[3];
char title[30]; // <file basename>

View File

@ -4,8 +4,6 @@
#include "../client/client.h"
qboolean gbInsideLoadSound = qfalse; // important to default to this!!!
qboolean SNDDMA_Init(void)
{
return qfalse;
@ -28,6 +26,9 @@ void SNDDMA_Submit(void)
{
}
#ifdef DEDICATED
qboolean gbInsideLoadSound = qfalse; // important to default to this!!!
sfxHandle_t S_RegisterSound( const char *name ) {
return 0;
}
@ -46,4 +47,5 @@ qboolean SND_RegisterAudio_LevelLoadEnd(qboolean something)
int SND_FreeOldestSound(void)
{
return 0;
}
}
#endif

View File

@ -639,7 +639,7 @@ static qboolean Sys_ScanForCD( void ) {
Result = GetVolumeInformation(drive,VolumeName,sizeof(VolumeName),&VolumeSerialNumber,
&MaximumComponentLength,&FileSystemFlags,FileSystemName,sizeof(FileSystemName));
if (Result && (strcmpi(VolumeName,"JEDIOUTCAST") == 0 ) )
if (Result && (Q_strcmpi(VolumeName,"JEDIOUTCAST") == 0 ) )
{
sprintf (test, "%s%s\\%s",drive, CD_BASEDIR, CD_EXE);
f = fopen( test, "r" );

View File

@ -315,7 +315,7 @@ void CGPValue::Parse(char **dataPtr, CTextPool **textPool)
{ // end of data - error!
break;
}
else if (strcmpi(token, "]") == 0)
else if (Q_strcmpi(token, "]") == 0)
{ // ending brace for this list
break;
}
@ -453,7 +453,7 @@ void CGPGroup::SortObject(CGPObject *object, CGPObject **unsortedList, CGPObject
last = 0;
while(test)
{
if (strcmpi(object->GetName(), test->GetName()) < 0)
if (Q_strcmpi(object->GetName(), test->GetName()) < 0)
{
break;
}
@ -512,7 +512,7 @@ CGPGroup *CGPGroup::FindSubGroup(const char *name)
group = mSubGroups;
while(group)
{
if(!stricmp(name, group->GetName()))
if(!Q_stricmp(name, group->GetName()))
{
return(group);
}
@ -537,7 +537,7 @@ void CGPGroup::Parse(char **dataPtr, CTextPool **textPool)
{ // end of data - error!
break;
}
else if (strcmpi(token, "}") == 0)
else if (Q_strcmpi(token, "}") == 0)
{ // ending brace for this group
break;
}
@ -546,14 +546,14 @@ void CGPGroup::Parse(char **dataPtr, CTextPool **textPool)
// read ahead to see what we are doing
token = GetToken(dataPtr, true, true);
if (strcmpi(token, "{") == 0)
if (Q_strcmpi(token, "{") == 0)
{ // new sub group
name = (*textPool)->AllocText(lastToken, true, textPool);
newSubGroup = AddGroup(name);
newSubGroup->SetWriteable(mWriteable);
newSubGroup->Parse(dataPtr, textPool);
}
else if (strcmpi(token, "[") == 0)
else if (Q_strcmpi(token, "[") == 0)
{ // new pair list
name = (*textPool)->AllocText(lastToken, true, textPool);
newPair = AddPair(name, 0);
@ -620,7 +620,7 @@ const char *CGPGroup::FindPairValue(const char *key, const char *defaultVal)
while(mPair)
{
if (strcmpi(mPair->GetName(), key) == 0)
if (Q_strcmpi(mPair->GetName(), key) == 0)
{
return mPair->GetTopValue();
}

View File

@ -1,4 +1,4 @@
#include "ROFFSystem.h"
#include "RoffSystem.h"
#include "qcommon.h"
#include "../client/client.h"
@ -406,15 +406,7 @@ qboolean CROFFSystem::Unload( int id )
{ // requested item found in the list, free mem, then remove from list
delete ((CROFF *)(*itr).second);
#ifndef __linux__
itr = mROFFList.erase( itr );
#else
// darn stl differences
TROFFList::iterator titr;
titr = itr;
itr++;
mROFFList.erase(titr);
#endif
mROFFList.erase( itr++ );
#ifdef _DEBUG
Com_Printf( S_COLOR_GREEN"roff unloaded\n" );

View File

@ -4,7 +4,7 @@
#include "qcommon.h"
#include "strip.h"
#include "../qcommon/game_version.h"
#ifndef __linux__
#ifdef _WIN32
#include <windows.h>
#endif
@ -217,10 +217,8 @@ void QDECL Com_OPrintf( const char *fmt, ...)
va_start (argptr,fmt);
vsprintf (msg,fmt,argptr);
va_end (argptr);
#ifndef __linux__
#ifdef _DEBUG
OutputDebugString(msg);
#else
printf(msg);
#endif
}
@ -2981,8 +2979,7 @@ void Com_Shutdown (void)
*/
}
#if !( defined __linux__ || defined __FreeBSD__ ) // r010123 - include FreeBSD
#if ((!id386) && (!defined __i386__)) // rcg010212 - for PPC
#if !(defined(_MSVC_VER) && defined(id386))
void Com_Memcpy (void* dest, const void* src, const size_t count)
{
@ -3293,7 +3290,6 @@ skipClamp:
}
}
#endif
#endif // bk001208 - memset/memcpy assembly, Q_acos needed (RC4)
//------------------------------------------------------------------------

View File

@ -924,7 +924,7 @@ void Sys_Print( const char *msg );
// any game related timing information should come from event timestamps
int Sys_Milliseconds (void);
#if __linux__
#ifndef _MSVC_VER
extern "C" void Sys_SnapVector( float *v );
#else

View File

@ -2479,8 +2479,12 @@ struct inflate_blocks_state {
/* load static pointers */
#define LOAD {LOADIN LOADOUT}
/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
extern uInt inflate_mask[17];
/* And'ing with mask[n] masks the lower n bits */
static uInt inflate_mask[17] = {
0x0000,
0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
};
/* copy as much as possible from the sliding window to the output area */
extern int inflate_flush OF((
@ -2854,15 +2858,6 @@ int inflate_blocks_sync_point(inflate_blocks_statef *s)
return s->mode == LENS;
}
/* And'ing with mask[n] masks the lower n bits */
uInt inflate_mask[17] = {
0x0000,
0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
};
/* copy as much as possible from the sliding window to the output area */
int inflate_flush(inflate_blocks_statef *s, z_streamp z, int r)
{

View File

@ -65,7 +65,7 @@ static int asmCallPtr = (int)doAsmCall;
#endif // !_WIN32
static int callMask = 0; // bk001213 - init
int callMask = 0; // bk001213 - init
static int instruction, pass, lastConst;
static int oc0, oc1, pop0, pop1;

View File

@ -1,4 +1,4 @@
#include "MatComp.h"
#include "matcomp.h"
#include <assert.h>
#include <math.h>
#include <stdio.h>

View File

@ -87,7 +87,7 @@ typedef struct
// (note that I've defined it using '>' internally, so it sorts with higher weights being "less", for distance weight-culling
//
#ifdef __cplusplus
bool operator < (const mdxmWeight_t& _X) const {return (boneWeight>_X.boneWeight);}
bool operator < (const mdxmWeight_t& _x) const {return (boneWeight>_x.boneWeight);}
#endif
}
#ifndef __cplusplus
@ -107,7 +107,7 @@ typedef struct
// I'm defining this '<' operator so this struct can be used as an STL <map> key...
//
#ifdef __cplusplus
bool operator < (const mdxaCompBone_t& _X) const {return (memcmp(Comp,_X.Comp,sizeof(Comp))<0);}
bool operator < (const mdxaCompBone_t& _x) const {return (memcmp(Comp,_x.Comp,sizeof(Comp))<0);}
#endif
}
#ifndef __cplusplus
@ -126,7 +126,7 @@ typedef struct
// I'm defining this '<' operator so this struct can be used as an STL <map> key...
//
#ifdef __cplusplus
bool operator < (const mdxaCompQuatBone_t& _X) const {return (memcmp(Comp,_X.Comp,sizeof(Comp))<0);}
bool operator < (const mdxaCompQuatBone_t& _x) const {return (memcmp(Comp,_x.Comp,sizeof(Comp))<0);}
#endif
}
#ifndef __cplusplus

View File

@ -24,7 +24,7 @@
#include "macosx_glimp.h"
#elif defined( __linux__ )
#else
#include <GL/gl.h>
#include <GL/glx.h>
@ -33,18 +33,6 @@
#include <GL/fxmesa.h>
#endif
#elif defined( __FreeBSD__ ) // rb010123
#include <GL/gl.h>
#include <GL/glx.h>
#if defined(__FX__)
#include <GL/fxmesa.h>
#endif
#else
#include <gl.h>
#endif
#ifndef APIENTRY
@ -133,12 +121,7 @@ extern void ( APIENTRY * qglPointParameterfvEXT)( GLenum, GLfloat *);
//===========================================================================
// non-windows systems will just redefine qgl* to gl*
#if !defined( _WIN32 ) && !defined(MACOS_X) && !defined( __linux__ ) && !defined( __FreeBSD__ ) // rb010123
#include "qgl_linked.h"
#elif defined(MACOS_X)
#if defined(MACOS_X)
// This includes #ifdefs for optional logging and GL error checking after every GL call as well as #defines to prevent incorrect usage of the non-'qgl' versions of the GL API.
#include "macosx_qgl.h"
@ -510,9 +493,7 @@ extern BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT);
extern BOOL ( WINAPI * qwglSwapIntervalEXT)( int interval );
#endif // _WIN32
#if ( (defined __linux__ ) || (defined __FreeBSD__ ) ) // rb010123
#elif !defined(MACOS_X)
//FX Mesa Functions
// bk001129 - from cvs1.17 (mkv)

View File

@ -10,7 +10,7 @@
#include "tr_local.h"
#endif
#include "MatComp.h"
#include "matcomp.h"
#if !defined(_QCOMMON_H_)
#include "../qcommon/qcommon.h"
#endif
@ -18,7 +18,7 @@
#include "../ghoul2/G2.h"
#endif
#include "../ghoul2/G2_local.h"
#include "MatComp.h"
#include "matcomp.h"
#pragma warning (disable: 4512) //default assignment operator could not be gened
#include "../qcommon/disablewarnings.h"

View File

@ -795,15 +795,8 @@ void R_Images_DeleteLightMaps(void)
if (pImage->imgName[0] == '*' && strstr(pImage->imgName,"lightmap")) // loose check, but should be ok
{
R_Images_DeleteImageContents(pImage);
#ifndef __linux__
itImage = AllocatedImages.erase(itImage);
AllocatedImages.erase(itImage++);
bEraseOccured = qtrue;
#else
// MS & Dinkimware got the map::erase return wrong (it's null)
AllocatedImages_t::iterator itTemp = itImage;
itImage++;
AllocatedImages.erase(itTemp);
#endif
}
}
@ -899,14 +892,8 @@ qboolean RE_RegisterImages_LevelLoadEnd(void)
ri.Printf( PRINT_DEVELOPER, "Dumping image \"%s\"\n",pImage->imgName);
R_Images_DeleteImageContents(pImage);
#ifndef __linux__
itImage = AllocatedImages.erase(itImage);
AllocatedImages.erase(itImage++);
bEraseOccured = qtrue;
#else
AllocatedImages_t::iterator itTemp = itImage;
itImage++;
AllocatedImages.erase(itTemp);
#endif
}
}
}

View File

@ -12,7 +12,7 @@
#ifdef G2_COLLISION_ENABLED
#if !defined (MINIHEAP_H_INC)
#include "../qcommon/miniheap.h"
#include "../qcommon/MiniHeap.h"
#endif
#include "../ghoul2/G2_local.h"
@ -707,6 +707,27 @@ void GL_SetDefaultState( void )
qglDisable( GL_BLEND );
}
/*
================
R_PrintLongString
Workaround for ri.Printf's 4096 characters buffer limit.
================
*/
void R_PrintLongString(const char *string) {
char buffer[4096];
const char *p;
int size = strlen(string);
p = string;
while(size > 0)
{
Q_strncpyz(buffer, p, sizeof (buffer) );
ri.Printf( PRINT_ALL, "%s", buffer );
p += 4095;
size -= 4095;
}
}
/*
================
@ -737,7 +758,9 @@ void GfxInfo_f( void )
ri.Printf( PRINT_ALL, "\nGL_VENDOR: %s\n", glConfig.vendor_string );
ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
ri.Printf( PRINT_ALL, "GL_EXTENSIONS: %s\n", glConfig.extensions_string );
ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " );
R_PrintLongString( glConfig.extensions_string );
ri.Printf( PRINT_ALL, "\n" );
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
ri.Printf( PRINT_ALL, "GL_MAX_ACTIVE_TEXTURES_ARB: %d\n", glConfig.maxActiveTextures );
ri.Printf( PRINT_ALL, "\nPIXELFORMAT: color(%d-bits) Z(%d-bit) stencil(%d-bits)\n", glConfig.colorBits, glConfig.depthBits, glConfig.stencilBits );

View File

@ -3,10 +3,6 @@
#ifndef TR_LOCAL_H
#define TR_LOCAL_H
#ifdef __linux__
typedef const char * LPCSTR;
#endif
#include "../game/q_shared.h"
#include "../qcommon/qfiles.h"
#include "../qcommon/qcommon.h"
@ -17,7 +13,7 @@ typedef const char * LPCSTR;
typedef unsigned int glIndex_t;
// fast float to int conversion
#if id386 && !( (defined __linux__ || defined __FreeBSD__ ) && (defined __i386__ ) ) // rb010123
#if (defined(_MSC_VER) && defined(__i386__))
long myftol( float f );
#else
#define myftol(x) ((int)(x))
@ -1474,10 +1470,12 @@ struct shaderCommands_s
qboolean SSInitializedWind;
};
#ifndef DEDICATED
#ifdef _MSVC_VER
typedef __declspec(align(16)) shaderCommands_s shaderCommands_t;
extern shaderCommands_t tess;
#else
typedef __attribute__((aligned(16))) shaderCommands_s shaderCommands_t;
#endif
extern shaderCommands_t tess;
extern color4ub_t styleColors[MAX_LIGHT_STYLES];
void RB_BeginSurface(shader_t *shader, int fogNum );

View File

@ -361,18 +361,8 @@ qboolean RE_RegisterModels_LevelLoadEnd(qboolean bDeleteEverythingNotUsedThisLev
//CachedModel.pModelDiskImage = NULL; // REM for reference, erase() call below negates the need for it.
bAtLeastoneModelFreed = qtrue;
}
#ifndef __linux__
itModel = CachedModels.erase(itModel);
CachedModels.erase(itModel++);
bEraseOccured = qtrue;
#else
// Both MS and Dinkumware got the map::erase wrong
// The STL has the return type as a void
CachedModels_t::iterator itTemp;
itTemp = itModel;
itModel++;
CachedModels.erase(itTemp);
#endif
iLoadedModelBytes = GetModelDataAllocSize();
}
@ -408,7 +398,7 @@ static void RE_RegisterModels_DumpNonPure(void)
if (iInPak == -1 || iCheckSum != CachedModel.iPAKFileCheckSum)
{
if (stricmp(sDEFAULT_GLA_NAME ".gla" , psModelName)) // don't dump "*default.gla", that's program internal anyway
if (Q_stricmp(sDEFAULT_GLA_NAME ".gla" , psModelName)) // don't dump "*default.gla", that's program internal anyway
{
// either this is not from a PAK, or it's from a non-pure one, so ditch it...
//
@ -418,18 +408,8 @@ static void RE_RegisterModels_DumpNonPure(void)
Z_Free(CachedModel.pModelDiskImage);
//CachedModel.pModelDiskImage = NULL; // REM for reference, erase() call below negates the need for it.
}
#ifndef __linux__
itModel = CachedModels.erase(itModel);
CachedModels.erase(itModel++);
bEraseOccured = qtrue;
#else
// Both MS and Dinkumware got the map::erase wrong
// The STL has the return type as a void
CachedModels_t::iterator itTemp;
itTemp = itModel;
itModel++;
CachedModels.erase(itTemp);
#endif
}
}
}
@ -462,7 +442,6 @@ void RE_RegisterModels_Info_f( void )
//
static void RE_RegisterModels_DeleteAll(void)
{
#ifndef __linux__
for (CachedModels_t::iterator itModel = CachedModels.begin(); itModel != CachedModels.end(); )
{
CachedEndianedModelBinary_t &CachedModel = (*itModel).second;
@ -471,11 +450,8 @@ static void RE_RegisterModels_DeleteAll(void)
Z_Free(CachedModel.pModelDiskImage);
}
itModel = CachedModels.erase(itModel);
CachedModels.erase(itModel++);
}
#else
CachedModels.erase(CachedModels.begin(),CachedModels.end());
#endif
}

View File

@ -4,7 +4,7 @@
//#include "../server/exe_headers.h"
#include "tr_local.h"
#include "tr_QuickSprite.h"
#include "tr_quicksprite.h"
void R_BindAnimatedImage( textureBundle_t *bundle );

View File

@ -5,7 +5,7 @@
#include "../ghoul2/G2.h"
#endif
#include "../ghoul2/G2_local.h"
#include "MatComp.h"
#include "matcomp.h"
#pragma warning (disable: 4512) //default assignment operator could not be gened
#include "../qcommon/disablewarnings.h"
@ -206,7 +206,7 @@ void RE_AddRefEntityToScene( const refEntity_t *ent ) {
{
CGhoul2Info_v &ghoul2 = *((CGhoul2Info_v *)ent->ghoul2);
#ifndef __linux__
#ifdef _WIN32
if (!ghoul2[0].mModel)
{
DebugBreak();

View File

@ -2,7 +2,7 @@
#include "tr_local.h"
#include "tr_QuickSprite.h"
#include "tr_quicksprite.h"
/*
@ -398,6 +398,7 @@ inline int VectorToInt(vec3_t vec)
{
int tmp, retval;
#ifdef _MSVC_VER
_asm
{
push edx
@ -421,6 +422,21 @@ inline int VectorToInt(vec3_t vec)
mov [retval], eax
pop edx
}
#else
asm("flds %1;\n\t"
"flds %2;\n\t"
"flds %3;\n\t"
"fistp %4;\n\t"
"movb %4, %%al;\n\t"
"shl $16, %0;\n\t"
"fistp %4;\n\t"
"movb %4, %%ah;\n\t"
"fistp %4;\n\t"
"movb %4, %%al;\n\t"
: "=a"(retval)
: "m"(vec[0]), "m"(vec[1]), "m"(vec[2]), "m"(tmp), "a"(0xff00)
);
#endif
return(retval);
}

View File

@ -646,7 +646,7 @@ void RB_CalcColorFromOneMinusEntity( unsigned char *dstColors )
{
int i;
int *pColors = ( int * ) dstColors;
unsigned char invModulate[3];
unsigned char invModulate[4];
int c;
if ( !backEnd.currentEntity )
@ -1049,7 +1049,7 @@ void RB_CalcRotateTexCoords( float degsPerSecond, float *st )
#if id386 && !( (defined __linux__ || defined __FreeBSD__ ) && (defined __i386__ ) ) // rb010123
#if (defined(_MSVC_VER) && (defined __i386__))
#pragma warning (disable: 4035)//no return value
long myftol( float f ) {
static int tmp;

View File

@ -71,7 +71,7 @@ int R_FindHitMat(const char *fname)
// simple linear search, this should only be called during precache anyway
for (i=1; i<hitMatCount; i++)
{
if (!stricmp(hitMatReg[i].name, fname))
if (!Q_stricmp(hitMatReg[i].name, fname))
{
return i;
}

View File

@ -2,7 +2,7 @@
#include "tr_local.h"
#include "tr_QuickSprite.h"
#include "tr_quicksprite.h"
#include "tr_WorldEffects.h"

View File

@ -6,7 +6,7 @@
#include "../qcommon/strip.h"
#if !defined(CROFFSYSTEM_H_INC)
#include "../qcommon/ROFFSystem.h"
#include "../qcommon/RoffSystem.h"
#endif
#if !defined(G2_H_INC)

View File

@ -11,7 +11,7 @@ Ghoul2 Insert Start
#ifdef G2_COLLISION_ENABLED
#if !defined (MINIHEAP_H_INC)
#include "../qcommon/miniheap.h"
#include "../qcommon/MiniHeap.h"
#endif
#endif

View File

@ -6127,7 +6127,7 @@ qboolean ItemParse_cvarStrList( itemDef_t *item, int handle ) {
}
//a normal StringAlloc ptr
if ((int)psString > 0)
if (psString)
{
if (*psString == '}') {
return qtrue;
@ -6190,7 +6190,7 @@ qboolean ItemParse_cvarFloatList( itemDef_t *item, int handle )
}
//a normal StringAlloc ptr
if ((int)string > 0)
if (string)
{
if (*string == '}')
{

View File

@ -44,10 +44,10 @@
#include <X11/keysym.h>
#include <X11/cursorfont.h>
#include <X11/extensions/xf86dga.h>
#include <X11/extensions/Xxf86dga.h>
#include <X11/extensions/xf86vmode.h>
#define WINDOW_CLASS_NAME "Quake 3: Arena"
#define WINDOW_CLASS_NAME "Jedi Outcast"
typedef enum {
RSERR_OK,
@ -158,100 +158,102 @@ static char *XLateKey(XKeyEvent *ev, int *key)
switch(keysym)
{
case XK_KP_Page_Up:
case XK_KP_9: *key = K_KP_PGUP; break;
case XK_Page_Up: *key = K_PGUP; break;
case XK_KP_9: *key = A_KP_9; break;
case XK_Page_Up: *key = A_PAGE_UP; break;
case XK_KP_Page_Down:
case XK_KP_3: *key = K_KP_PGDN; break;
case XK_Page_Down: *key = K_PGDN; break;
case XK_KP_3: *key = A_KP_3; break;
case XK_Page_Down: *key = A_PAGE_DOWN; break;
case XK_KP_Home: *key = K_KP_HOME; break;
case XK_KP_7: *key = K_KP_HOME; break;
case XK_Home: *key = K_HOME; break;
case XK_KP_Home:
case XK_KP_7: *key = A_KP_7; break;
case XK_Home: *key = A_HOME; break;
case XK_KP_End:
case XK_KP_1: *key = K_KP_END; break;
case XK_End: *key = K_END; break;
case XK_KP_1: *key = A_KP_1; break;
case XK_End: *key = A_END; break;
case XK_KP_Left: *key = K_KP_LEFTARROW; break;
case XK_KP_4: *key = K_KP_LEFTARROW; break;
case XK_Left: *key = K_LEFTARROW; break;
case XK_KP_Left:
case XK_KP_4: *key = A_KP_4; break;
case XK_Left: *key = A_CURSOR_LEFT; break;
case XK_KP_Right: *key = K_KP_RIGHTARROW; break;
case XK_KP_6: *key = K_KP_RIGHTARROW; break;
case XK_Right: *key = K_RIGHTARROW; break;
case XK_KP_Right:
case XK_KP_6: *key = A_KP_6; break;
case XK_Right: *key = A_CURSOR_RIGHT; break;
case XK_KP_Down:
case XK_KP_2: *key = K_KP_DOWNARROW; break;
case XK_Down: *key = K_DOWNARROW; break;
case XK_KP_2: *key = A_KP_2; break;
case XK_Down: *key = A_CURSOR_DOWN; break;
case XK_KP_Up:
case XK_KP_8: *key = K_KP_UPARROW; break;
case XK_Up: *key = K_UPARROW; break;
case XK_KP_8: *key = A_KP_8; break;
case XK_Up: *key = A_CURSOR_UP; break;
case XK_Escape: *key = K_ESCAPE; break;
case XK_Escape: *key = A_ESCAPE; break;
case XK_KP_Enter: *key = K_KP_ENTER; break;
case XK_Return: *key = K_ENTER; break;
case XK_KP_Enter: *key = A_KP_ENTER; break;
case XK_Return: *key = A_ENTER; break;
case XK_Tab: *key = K_TAB; break;
case XK_Tab: *key = A_TAB; break;
case XK_F1: *key = K_F1; break;
case XK_F1: *key = A_F1; break;
case XK_F2: *key = K_F2; break;
case XK_F2: *key = A_F2; break;
case XK_F3: *key = K_F3; break;
case XK_F3: *key = A_F3; break;
case XK_F4: *key = K_F4; break;
case XK_F4: *key = A_F4; break;
case XK_F5: *key = K_F5; break;
case XK_F5: *key = A_F5; break;
case XK_F6: *key = K_F6; break;
case XK_F6: *key = A_F6; break;
case XK_F7: *key = K_F7; break;
case XK_F7: *key = A_F7; break;
case XK_F8: *key = K_F8; break;
case XK_F8: *key = A_F8; break;
case XK_F9: *key = K_F9; break;
case XK_F9: *key = A_F9; break;
case XK_F10: *key = K_F10; break;
case XK_F10: *key = A_F10; break;
case XK_F11: *key = K_F11; break;
case XK_F11: *key = A_F11; break;
case XK_F12: *key = K_F12; break;
case XK_F12: *key = A_F12; break;
// bk001206 - from Ryan's Fakk2
//case XK_BackSpace: *key = 8; break; // ctrl-h
case XK_BackSpace: *key = K_BACKSPACE; break; // ctrl-h
case XK_BackSpace: *key = A_BACKSPACE; break; // ctrl-h
case XK_KP_Delete:
case XK_KP_Decimal: *key = K_KP_DEL; break;
case XK_Delete: *key = K_DEL; break;
case XK_KP_Decimal: *key = A_KP_PERIOD; break;
case XK_Delete: *key = A_DELETE; break;
case XK_Pause: *key = K_PAUSE; break;
case XK_Pause: *key = A_PAUSE; break;
case XK_Shift_L:
case XK_Shift_R: *key = K_SHIFT; break;
case XK_Shift_R: *key = A_SHIFT; break;
case XK_Execute:
case XK_Control_L:
case XK_Control_R: *key = K_CTRL; break;
case XK_Control_R: *key = A_CTRL; break;
case XK_Alt_L:
case XK_Meta_L:
case XK_Alt_R:
case XK_Meta_R: *key = K_ALT; break;
case XK_Meta_R: *key = A_ALT; break;
case XK_KP_Begin: *key = K_KP_5; break;
case XK_KP_Begin: *key = A_KP_5; break;
case XK_Insert: *key = K_INS; break;
case XK_Insert: *key = A_INSERT; break;
case XK_KP_Insert:
case XK_KP_0: *key = K_KP_INS; break;
case XK_KP_0: *key = A_KP_0; break;
case XK_KP_Multiply: *key = '*'; break;
case XK_KP_Add: *key = K_KP_PLUS; break;
case XK_KP_Subtract: *key = K_KP_MINUS; break;
case XK_KP_Divide: *key = K_KP_SLASH; break;
case XK_KP_Add: *key = A_KP_PLUS; break;
case XK_KP_Subtract: *key = A_KP_MINUS; break;
#if 0
case XK_KP_Divide: *key = A_KP_SLASH; break;
#endif
// bk001130 - from cvs1.17 (mkv)
case XK_exclam: *key = '1'; break;
@ -411,7 +413,10 @@ static qboolean X11_PendingInput(void) {
FD_ZERO(&fdset);
FD_SET(x11_fd, &fdset);
if ( select(x11_fd+1, &fdset, NULL, NULL, &zero_time) == 1 ) {
return(XPending(dpy));
if (XPending(dpy))
return qtrue;
else
return qfalse;
}
}
@ -540,9 +545,9 @@ static void HandleEvents(void)
case ButtonPress:
if (event.xbutton.button == 4) {
Sys_QueEvent( 0, SE_KEY, K_MWHEELUP, qtrue, 0, NULL );
Sys_QueEvent( 0, SE_KEY, A_MWHEELUP, qtrue, 0, NULL );
} else if (event.xbutton.button == 5) {
Sys_QueEvent( 0, SE_KEY, K_MWHEELDOWN, qtrue, 0, NULL );
Sys_QueEvent( 0, SE_KEY, A_MWHEELDOWN, qtrue, 0, NULL );
} else {
b=-1;
if (event.xbutton.button == 1) {
@ -553,15 +558,15 @@ static void HandleEvents(void)
b = 1;
}
Sys_QueEvent( 0, SE_KEY, K_MOUSE1 + b, qtrue, 0, NULL );
Sys_QueEvent( 0, SE_KEY, A_MOUSE1 + b, qtrue, 0, NULL );
}
break;
case ButtonRelease:
if (event.xbutton.button == 4) {
Sys_QueEvent( 0, SE_KEY, K_MWHEELUP, qfalse, 0, NULL );
Sys_QueEvent( 0, SE_KEY, A_MWHEELUP, qfalse, 0, NULL );
} else if (event.xbutton.button == 5) {
Sys_QueEvent( 0, SE_KEY, K_MWHEELDOWN, qfalse, 0, NULL );
Sys_QueEvent( 0, SE_KEY, A_MWHEELDOWN, qfalse, 0, NULL );
} else {
b=-1;
if (event.xbutton.button == 1) {
@ -571,7 +576,7 @@ static void HandleEvents(void)
} else if (event.xbutton.button == 3) {
b = 1;
}
Sys_QueEvent( 0, SE_KEY, K_MOUSE1 + b, qfalse, 0, NULL );
Sys_QueEvent( 0, SE_KEY, A_MOUSE1 + b, qfalse, 0, NULL );
}
break;
@ -730,7 +735,7 @@ static qboolean GLW_StartDriverAndSetMode( const char *drivername,
}
#endif
err = GLW_SetMode( drivername, mode, fullscreen );
err = (rserr_t) GLW_SetMode( drivername, mode, fullscreen );
switch ( err )
{
@ -861,7 +866,7 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
actualWidth, actualHeight);
} else {
fullscreen = 0;
fullscreen = qfalse;
ri.Printf(PRINT_ALL, "XFree86-VidModeExtension: No acceptable modes found\n");
}
} else {
@ -875,9 +880,6 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
else
colorbits = r_colorbits->value;
if ( !Q_stricmp( r_glDriver->string, _3DFX_DRIVER_NAME ) )
colorbits = 16;
if (!r_depthbits->value)
depthbits = 24;
else
@ -1002,7 +1004,7 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
qglXMakeCurrent(dpy, win, ctx);
// bk001130 - from cvs1.17 (mkv)
glstring = qglGetString (GL_RENDERER);
glstring = (const char *) qglGetString (GL_RENDERER);
ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glstring );
// bk010122 - new software token (Indirect)
@ -1149,10 +1151,13 @@ static void GLW_InitExtensions( void )
** GLimp_win.c internal function that that attempts to load and use
** a specific OpenGL DLL.
*/
static qboolean GLW_LoadOpenGL( const char *name )
static qboolean GLW_LoadOpenGL()
{
char name[1024];
qboolean fullscreen;
strcpy( name, OPENGL_DRIVER_NAME );
ri.Printf( PRINT_ALL, "...loading %s: ", name );
// disable the 3Dfx splash screen and set gamma
@ -1166,7 +1171,7 @@ static qboolean GLW_LoadOpenGL( const char *name )
// load the QGL layer
if ( QGL_Init( name ) )
{
fullscreen = r_fullscreen->integer;
fullscreen = (r_fullscreen->integer) ? qtrue : qfalse;
// create the window and set up the context
if ( !GLW_StartDriverAndSetMode( name, r_mode->integer, fullscreen ) )
@ -1192,6 +1197,17 @@ fail:
return qfalse;
}
static void GLW_StartOpenGL( void )
{
//
// load and initialize the specific OpenGL driver
//
if ( !GLW_LoadOpenGL() )
{
Com_Error( ERR_FATAL, "GLW_StartOpenGL() - could not load OpenGL subsystem\n" );
}
}
/*
** GLimp_Init
**
@ -1215,75 +1231,47 @@ void GLimp_Init( void )
InitSig();
// Hack here so that if the UI
if ( *r_previousglDriver->string ) {
// The UI changed it on us, hack it back
// This means the renderer can't be changed on the fly
ri.Cvar_Set( "r_glDriver", r_previousglDriver->string );
}
//
// load and initialize the specific OpenGL driver
//
if ( !GLW_LoadOpenGL( r_glDriver->string ) )
{
if ( !Q_stricmp( r_glDriver->string, OPENGL_DRIVER_NAME ) )
{
attemptedlibGL = qtrue;
}
else if ( !Q_stricmp( r_glDriver->string, _3DFX_DRIVER_NAME ) )
{
attempted3Dfx = qtrue;
}
if ( !attempted3Dfx && !success )
{
attempted3Dfx = qtrue;
if ( GLW_LoadOpenGL( _3DFX_DRIVER_NAME ) )
{
ri.Cvar_Set( "r_glDriver", _3DFX_DRIVER_NAME );
r_glDriver->modified = qfalse;
success = qtrue;
}
}
// try ICD before trying 3Dfx standalone driver
if ( !attemptedlibGL && !success )
{
attemptedlibGL = qtrue;
if ( GLW_LoadOpenGL( OPENGL_DRIVER_NAME ) )
{
ri.Cvar_Set( "r_glDriver", OPENGL_DRIVER_NAME );
r_glDriver->modified = qfalse;
success = qtrue;
}
}
if (!success)
ri.Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem\n" );
}
// Save it in case the UI stomps it
ri.Cvar_Set( "r_previousglDriver", r_glDriver->string );
// This values force the UI to disable driver selection
glConfig.driverType = GLDRV_ICD;
glConfig.hardwareType = GLHW_GENERIC;
GLW_StartOpenGL();
// get our config strings
Q_strncpyz( glConfig.vendor_string, qglGetString (GL_VENDOR), sizeof( glConfig.vendor_string ) );
Q_strncpyz( glConfig.renderer_string, qglGetString (GL_RENDERER), sizeof( glConfig.renderer_string ) );
if (*glConfig.renderer_string && glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] == '\n')
glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] = 0;
Q_strncpyz( glConfig.version_string, qglGetString (GL_VERSION), sizeof( glConfig.version_string ) );
Q_strncpyz( glConfig.extensions_string, qglGetString (GL_EXTENSIONS), sizeof( glConfig.extensions_string ) );
const char* glstring;
glstring = (const char *)qglGetString (GL_VENDOR);
if (!glstring) {
glstring = "invalid driver";
}
Q_strncpyz( glConfig.vendor_string, glstring, sizeof( glConfig.vendor_string ) );
glstring = (const char *)qglGetString (GL_RENDERER);
if (!glstring) {
glstring = "invalid driver";
}
Q_strncpyz( glConfig.renderer_string, glstring, sizeof( glConfig.renderer_string ) );
glstring = (const char *)qglGetString (GL_VERSION);
if (!glstring) {
glstring = "invalid driver";
}
Q_strncpyz( glConfig.version_string, glstring, sizeof( glConfig.version_string ) );
glstring = (const char *)qglGetString (GL_EXTENSIONS);
if (!glstring) {
glstring = "invalid driver";
}
Q_strncpyz( glConfig.extensions_string, glstring, sizeof( glConfig.extensions_string ) );
// OpenGL driver constants
qglGetIntegerv( GL_MAX_TEXTURE_SIZE, &glConfig.maxTextureSize );
// stubbed or broken drivers may have reported 0...
if ( glConfig.maxTextureSize <= 0 )
{
glConfig.maxTextureSize = 0;
}
//
// chipset specific configuration
//
strcpy( buf, glConfig.renderer_string );
strlwr( buf );
Q_strlwr( buf );
//
// NOTE: if changing cvars, do it within this block. This allows them
@ -1292,54 +1280,8 @@ void GLimp_Init( void )
//
if ( Q_stricmp( lastValidRenderer->string, glConfig.renderer_string ) )
{
glConfig.hardwareType = GLHW_GENERIC;
ri.Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST" );
// VOODOO GRAPHICS w/ 2MB
if ( Q_stristr( buf, "voodoo graphics/1 tmu/2 mb" ) )
{
ri.Cvar_Set( "r_picmip", "2" );
ri.Cvar_Get( "r_picmip", "1", CVAR_ARCHIVE | CVAR_LATCH );
}
else
{
ri.Cvar_Set( "r_picmip", "1" );
if ( Q_stristr( buf, "rage 128" ) || Q_stristr( buf, "rage128" ) )
{
ri.Cvar_Set( "r_finish", "0" );
}
// Savage3D and Savage4 should always have trilinear enabled
else if ( Q_stristr( buf, "savage3d" ) || Q_stristr( buf, "s3 savage4" ) )
{
ri.Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_LINEAR" );
}
}
}
//
// this is where hardware specific workarounds that should be
// detected/initialized every startup should go.
//
if ( Q_stristr( buf, "banshee" ) || Q_stristr( buf, "Voodoo_Graphics" ) )
{
glConfig.hardwareType = GLHW_3DFX_2D3D;
}
else if ( Q_stristr( buf, "rage pro" ) || Q_stristr( buf, "RagePro" ) )
{
glConfig.hardwareType = GLHW_RAGEPRO;
}
else if ( Q_stristr( buf, "permedia2" ) )
{
glConfig.hardwareType = GLHW_PERMEDIA2;
}
else if ( Q_stristr( buf, "riva 128" ) )
{
glConfig.hardwareType = GLHW_RIVA128;
}
else if ( Q_stristr( buf, "riva tnt " ) )
{
ri.Cvar_Set( "r_picmip", "1" );
}
ri.Cvar_Set( "r_lastValidRenderer", glConfig.renderer_string );
@ -1363,7 +1305,7 @@ void GLimp_Init( void )
void GLimp_EndFrame (void)
{
// don't flip if drawing to front buffer
if ( stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 )
if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 )
{
qglXSwapBuffers(dpy, win);
}
@ -1500,8 +1442,7 @@ void IN_Frame (void) {
// temporarily deactivate if not in the game and
// running on the desktop
// voodoo always counts as full screen
if (Cvar_VariableValue ("r_fullscreen") == 0
&& strcmp( Cvar_VariableString("r_glDriver"), _3DFX_DRIVER_NAME ) ) {
if (Cvar_VariableValue ("r_fullscreen") == 0) {
IN_DeactivateMouse ();
return;
}
@ -1537,7 +1478,7 @@ void Sys_SendKeyEvents (void) {
// bk010216 - added stubs for non-Linux UNIXes here
// FIXME - use NO_JOYSTICK or something else generic
#if defined( __FreeBSD__ ) // rb010123
#if 1
void IN_StartupJoystick( void ) {}
void IN_JoyMove( void ) {}
#endif

View File

@ -25,5 +25,3 @@ void QGL_Shutdown( void );
// bk001130 - win32
// void IN_JoystickCommands (void);
char *strlwr (char *s);

View File

@ -8,34 +8,21 @@
** QGL_Init() - loads libraries, assigns function pointers, etc.
** QGL_Shutdown() - unloads libraries, NULLs function pointers
*/
// bk001204
#include <unistd.h>
#include <sys/types.h>
#include <float.h>
#include "../game/q_shared.h"
#include "../renderer/tr_local.h"
#include "unix_glw.h"
#include "../client/client.h"
// bk001129 - from cvs1.17 (mkv)
//#if defined(__FX__)
//#include <GL/fxmesa.h>
//#endif
//#include <GL/glx.h> // bk010216 - FIXME: all of the above redundant? renderer/qgl.h
#include <GL/glx.h>
#include <dlfcn.h>
#include <sys/types.h>
#include <unistd.h>
// bk001129 - from cvs1.17 (mkv)
#if defined(__FX__)
//FX Mesa Functions
fxMesaContext (*qfxMesaCreateContext)(GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]);
fxMesaContext (*qfxMesaCreateBestContext)(GLuint win, GLint width, GLint height, const GLint attribList[]);
void (*qfxMesaDestroyContext)(fxMesaContext ctx);
void (*qfxMesaMakeCurrent)(fxMesaContext ctx);
fxMesaContext (*qfxMesaGetCurrentContext)(void);
void (*qfxMesaSwapBuffers)(void);
#ifndef __stdcall
#define __stdcall
#endif
//GLX Functions
@ -383,15 +370,6 @@ void ( APIENTRY * qglVertex4sv )(const GLshort *v);
void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t );
void ( APIENTRY * qglActiveTextureARB )( GLenum texture );
void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture );
void ( APIENTRY * qglLockArraysEXT)( int, int);
void ( APIENTRY * qglUnlockArraysEXT) ( void );
void ( APIENTRY * qglPointParameterfEXT)( GLenum param, GLfloat value );
void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value );
void ( APIENTRY * qglColorTableEXT)( int, int, int, int, int, const void * );
void ( APIENTRY * qgl3DfxSetPaletteEXT)( GLuint * );
void ( APIENTRY * qglSelectTextureSGIS)( GLenum );
@ -2973,16 +2951,6 @@ void QGL_Shutdown( void )
qglVertexPointer = NULL;
qglViewport = NULL;
// bk001129 - from cvs1.17 (mkv)
#if defined(__FX__)
qfxMesaCreateContext = NULL;
qfxMesaCreateBestContext = NULL;
qfxMesaDestroyContext = NULL;
qfxMesaMakeCurrent = NULL;
qfxMesaGetCurrentContext = NULL;
qfxMesaSwapBuffers = NULL;
#endif
qglXChooseVisual = NULL;
qglXCreateContext = NULL;
qglXDestroyContext = NULL;
@ -3013,12 +2981,28 @@ void *qwglGetProcAddress(char *symbol)
qboolean QGL_Init( const char *dllname )
{
if ( ( glw_state.OpenGLLib = dlopen( dllname, RTLD_LAZY|RTLD_GLOBAL ) ) == 0 )
#if 0 //FIXME
// update 3Dfx gamma irrespective of underlying DLL
{
char envbuffer[1024];
float g;
g = 2.00 * ( 0.8 - ( vid_gamma->value - 0.5 ) ) + 1.0F;
Com_sprintf( envbuffer, sizeof(envbuffer), "SSTV2_GAMMA=%f", g );
putenv( envbuffer );
Com_sprintf( envbuffer, sizeof(envbuffer), "SST_GAMMA=%f", g );
putenv( envbuffer );
}
#endif
if ( ( glw_state.OpenGLLib = dlopen( dllname, RTLD_LAZY ) ) == 0 )
{
char fn[1024];
// FILE *fp; // bk001204 - unused
FILE *fp;
extern uid_t saved_euid; // unix_main.c
//fprintf(stdout, "uid=%d,euid=%d\n", getuid(), geteuid()); fflush(stdout);
// if we are not setuid, try current directory
if (getuid() == saved_euid) {
getcwd(fn, sizeof(fn));
@ -3026,366 +3010,359 @@ qboolean QGL_Init( const char *dllname )
Q_strcat(fn, sizeof(fn), dllname);
if ( ( glw_state.OpenGLLib = dlopen( fn, RTLD_LAZY ) ) == 0 ) {
ri.Printf(PRINT_ALL, "QGL_Init: Can't load %s from /etc/ld.so.conf or current dir: %s\n", dllname, dlerror());
Com_Printf("QGL_Init: Can't load %s from /etc/ld.so.conf or current dir: %s\n", dllname, dlerror());
return qfalse;
}
} else {
ri.Printf(PRINT_ALL, "QGL_Init: Can't load %s from /etc/ld.so.conf: %s\n", dllname, dlerror());
Com_Printf("QGL_Init: Can't load %s from /etc/ld.so.conf: %s\n", dllname, dlerror());
return qfalse;
}
}
qglAccum = dllAccum = GPA( "glAccum" );
qglAlphaFunc = dllAlphaFunc = GPA( "glAlphaFunc" );
qglAreTexturesResident = dllAreTexturesResident = GPA( "glAreTexturesResident" );
qglArrayElement = dllArrayElement = GPA( "glArrayElement" );
qglBegin = dllBegin = GPA( "glBegin" );
qglBindTexture = dllBindTexture = GPA( "glBindTexture" );
qglBitmap = dllBitmap = GPA( "glBitmap" );
qglBlendFunc = dllBlendFunc = GPA( "glBlendFunc" );
qglCallList = dllCallList = GPA( "glCallList" );
qglCallLists = dllCallLists = GPA( "glCallLists" );
qglClear = dllClear = GPA( "glClear" );
qglClearAccum = dllClearAccum = GPA( "glClearAccum" );
qglClearColor = dllClearColor = GPA( "glClearColor" );
qglClearDepth = dllClearDepth = GPA( "glClearDepth" );
qglClearIndex = dllClearIndex = GPA( "glClearIndex" );
qglClearStencil = dllClearStencil = GPA( "glClearStencil" );
qglClipPlane = dllClipPlane = GPA( "glClipPlane" );
qglColor3b = dllColor3b = GPA( "glColor3b" );
qglColor3bv = dllColor3bv = GPA( "glColor3bv" );
qglColor3d = dllColor3d = GPA( "glColor3d" );
qglColor3dv = dllColor3dv = GPA( "glColor3dv" );
qglColor3f = dllColor3f = GPA( "glColor3f" );
qglColor3fv = dllColor3fv = GPA( "glColor3fv" );
qglColor3i = dllColor3i = GPA( "glColor3i" );
qglColor3iv = dllColor3iv = GPA( "glColor3iv" );
qglColor3s = dllColor3s = GPA( "glColor3s" );
qglColor3sv = dllColor3sv = GPA( "glColor3sv" );
qglColor3ub = dllColor3ub = GPA( "glColor3ub" );
qglColor3ubv = dllColor3ubv = GPA( "glColor3ubv" );
qglColor3ui = dllColor3ui = GPA( "glColor3ui" );
qglColor3uiv = dllColor3uiv = GPA( "glColor3uiv" );
qglColor3us = dllColor3us = GPA( "glColor3us" );
qglColor3usv = dllColor3usv = GPA( "glColor3usv" );
qglColor4b = dllColor4b = GPA( "glColor4b" );
qglColor4bv = dllColor4bv = GPA( "glColor4bv" );
qglColor4d = dllColor4d = GPA( "glColor4d" );
qglColor4dv = dllColor4dv = GPA( "glColor4dv" );
qglColor4f = dllColor4f = GPA( "glColor4f" );
qglColor4fv = dllColor4fv = GPA( "glColor4fv" );
qglColor4i = dllColor4i = GPA( "glColor4i" );
qglColor4iv = dllColor4iv = GPA( "glColor4iv" );
qglColor4s = dllColor4s = GPA( "glColor4s" );
qglColor4sv = dllColor4sv = GPA( "glColor4sv" );
qglColor4ub = dllColor4ub = GPA( "glColor4ub" );
qglColor4ubv = dllColor4ubv = GPA( "glColor4ubv" );
qglColor4ui = dllColor4ui = GPA( "glColor4ui" );
qglColor4uiv = dllColor4uiv = GPA( "glColor4uiv" );
qglColor4us = dllColor4us = GPA( "glColor4us" );
qglColor4usv = dllColor4usv = GPA( "glColor4usv" );
qglColorMask = dllColorMask = GPA( "glColorMask" );
qglColorMaterial = dllColorMaterial = GPA( "glColorMaterial" );
qglColorPointer = dllColorPointer = GPA( "glColorPointer" );
qglCopyPixels = dllCopyPixels = GPA( "glCopyPixels" );
qglCopyTexImage1D = dllCopyTexImage1D = GPA( "glCopyTexImage1D" );
qglCopyTexImage2D = dllCopyTexImage2D = GPA( "glCopyTexImage2D" );
qglCopyTexSubImage1D = dllCopyTexSubImage1D = GPA( "glCopyTexSubImage1D" );
qglCopyTexSubImage2D = dllCopyTexSubImage2D = GPA( "glCopyTexSubImage2D" );
qglCullFace = dllCullFace = GPA( "glCullFace" );
qglDeleteLists = dllDeleteLists = GPA( "glDeleteLists" );
qglDeleteTextures = dllDeleteTextures = GPA( "glDeleteTextures" );
qglDepthFunc = dllDepthFunc = GPA( "glDepthFunc" );
qglDepthMask = dllDepthMask = GPA( "glDepthMask" );
qglDepthRange = dllDepthRange = GPA( "glDepthRange" );
qglDisable = dllDisable = GPA( "glDisable" );
qglDisableClientState = dllDisableClientState = GPA( "glDisableClientState" );
qglDrawArrays = dllDrawArrays = GPA( "glDrawArrays" );
qglDrawBuffer = dllDrawBuffer = GPA( "glDrawBuffer" );
qglDrawElements = dllDrawElements = GPA( "glDrawElements" );
qglDrawPixels = dllDrawPixels = GPA( "glDrawPixels" );
qglEdgeFlag = dllEdgeFlag = GPA( "glEdgeFlag" );
qglEdgeFlagPointer = dllEdgeFlagPointer = GPA( "glEdgeFlagPointer" );
qglEdgeFlagv = dllEdgeFlagv = GPA( "glEdgeFlagv" );
qglEnable = dllEnable = GPA( "glEnable" );
qglEnableClientState = dllEnableClientState = GPA( "glEnableClientState" );
qglEnd = dllEnd = GPA( "glEnd" );
qglEndList = dllEndList = GPA( "glEndList" );
qglEvalCoord1d = dllEvalCoord1d = GPA( "glEvalCoord1d" );
qglEvalCoord1dv = dllEvalCoord1dv = GPA( "glEvalCoord1dv" );
qglEvalCoord1f = dllEvalCoord1f = GPA( "glEvalCoord1f" );
qglEvalCoord1fv = dllEvalCoord1fv = GPA( "glEvalCoord1fv" );
qglEvalCoord2d = dllEvalCoord2d = GPA( "glEvalCoord2d" );
qglEvalCoord2dv = dllEvalCoord2dv = GPA( "glEvalCoord2dv" );
qglEvalCoord2f = dllEvalCoord2f = GPA( "glEvalCoord2f" );
qglEvalCoord2fv = dllEvalCoord2fv = GPA( "glEvalCoord2fv" );
qglEvalMesh1 = dllEvalMesh1 = GPA( "glEvalMesh1" );
qglEvalMesh2 = dllEvalMesh2 = GPA( "glEvalMesh2" );
qglEvalPoint1 = dllEvalPoint1 = GPA( "glEvalPoint1" );
qglEvalPoint2 = dllEvalPoint2 = GPA( "glEvalPoint2" );
qglFeedbackBuffer = dllFeedbackBuffer = GPA( "glFeedbackBuffer" );
qglFinish = dllFinish = GPA( "glFinish" );
qglFlush = dllFlush = GPA( "glFlush" );
qglFogf = dllFogf = GPA( "glFogf" );
qglFogfv = dllFogfv = GPA( "glFogfv" );
qglFogi = dllFogi = GPA( "glFogi" );
qglFogiv = dllFogiv = GPA( "glFogiv" );
qglFrontFace = dllFrontFace = GPA( "glFrontFace" );
qglFrustum = dllFrustum = GPA( "glFrustum" );
qglGenLists = dllGenLists = GPA( "glGenLists" );
qglGenTextures = dllGenTextures = GPA( "glGenTextures" );
qglGetBooleanv = dllGetBooleanv = GPA( "glGetBooleanv" );
qglGetClipPlane = dllGetClipPlane = GPA( "glGetClipPlane" );
qglGetDoublev = dllGetDoublev = GPA( "glGetDoublev" );
qglGetError = dllGetError = GPA( "glGetError" );
qglGetFloatv = dllGetFloatv = GPA( "glGetFloatv" );
qglGetIntegerv = dllGetIntegerv = GPA( "glGetIntegerv" );
qglGetLightfv = dllGetLightfv = GPA( "glGetLightfv" );
qglGetLightiv = dllGetLightiv = GPA( "glGetLightiv" );
qglGetMapdv = dllGetMapdv = GPA( "glGetMapdv" );
qglGetMapfv = dllGetMapfv = GPA( "glGetMapfv" );
qglGetMapiv = dllGetMapiv = GPA( "glGetMapiv" );
qglGetMaterialfv = dllGetMaterialfv = GPA( "glGetMaterialfv" );
qglGetMaterialiv = dllGetMaterialiv = GPA( "glGetMaterialiv" );
qglGetPixelMapfv = dllGetPixelMapfv = GPA( "glGetPixelMapfv" );
qglGetPixelMapuiv = dllGetPixelMapuiv = GPA( "glGetPixelMapuiv" );
qglGetPixelMapusv = dllGetPixelMapusv = GPA( "glGetPixelMapusv" );
qglGetPointerv = dllGetPointerv = GPA( "glGetPointerv" );
qglGetPolygonStipple = dllGetPolygonStipple = GPA( "glGetPolygonStipple" );
qglGetString = dllGetString = GPA( "glGetString" );
qglGetTexEnvfv = dllGetTexEnvfv = GPA( "glGetTexEnvfv" );
qglGetTexEnviv = dllGetTexEnviv = GPA( "glGetTexEnviv" );
qglGetTexGendv = dllGetTexGendv = GPA( "glGetTexGendv" );
qglGetTexGenfv = dllGetTexGenfv = GPA( "glGetTexGenfv" );
qglGetTexGeniv = dllGetTexGeniv = GPA( "glGetTexGeniv" );
qglGetTexImage = dllGetTexImage = GPA( "glGetTexImage" );
qglGetTexParameterfv = dllGetTexParameterfv = GPA( "glGetTexParameterfv" );
qglGetTexParameteriv = dllGetTexParameteriv = GPA( "glGetTexParameteriv" );
qglHint = dllHint = GPA( "glHint" );
qglIndexMask = dllIndexMask = GPA( "glIndexMask" );
qglIndexPointer = dllIndexPointer = GPA( "glIndexPointer" );
qglIndexd = dllIndexd = GPA( "glIndexd" );
qglIndexdv = dllIndexdv = GPA( "glIndexdv" );
qglIndexf = dllIndexf = GPA( "glIndexf" );
qglIndexfv = dllIndexfv = GPA( "glIndexfv" );
qglIndexi = dllIndexi = GPA( "glIndexi" );
qglIndexiv = dllIndexiv = GPA( "glIndexiv" );
qglIndexs = dllIndexs = GPA( "glIndexs" );
qglIndexsv = dllIndexsv = GPA( "glIndexsv" );
qglIndexub = dllIndexub = GPA( "glIndexub" );
qglIndexubv = dllIndexubv = GPA( "glIndexubv" );
qglInitNames = dllInitNames = GPA( "glInitNames" );
qglInterleavedArrays = dllInterleavedArrays = GPA( "glInterleavedArrays" );
qglIsEnabled = dllIsEnabled = GPA( "glIsEnabled" );
qglIsList = dllIsList = GPA( "glIsList" );
qglIsTexture = dllIsTexture = GPA( "glIsTexture" );
qglLightModelf = dllLightModelf = GPA( "glLightModelf" );
qglLightModelfv = dllLightModelfv = GPA( "glLightModelfv" );
qglLightModeli = dllLightModeli = GPA( "glLightModeli" );
qglLightModeliv = dllLightModeliv = GPA( "glLightModeliv" );
qglLightf = dllLightf = GPA( "glLightf" );
qglLightfv = dllLightfv = GPA( "glLightfv" );
qglLighti = dllLighti = GPA( "glLighti" );
qglLightiv = dllLightiv = GPA( "glLightiv" );
qglLineStipple = dllLineStipple = GPA( "glLineStipple" );
qglLineWidth = dllLineWidth = GPA( "glLineWidth" );
qglListBase = dllListBase = GPA( "glListBase" );
qglLoadIdentity = dllLoadIdentity = GPA( "glLoadIdentity" );
qglLoadMatrixd = dllLoadMatrixd = GPA( "glLoadMatrixd" );
qglLoadMatrixf = dllLoadMatrixf = GPA( "glLoadMatrixf" );
qglLoadName = dllLoadName = GPA( "glLoadName" );
qglLogicOp = dllLogicOp = GPA( "glLogicOp" );
qglMap1d = dllMap1d = GPA( "glMap1d" );
qglMap1f = dllMap1f = GPA( "glMap1f" );
qglMap2d = dllMap2d = GPA( "glMap2d" );
qglMap2f = dllMap2f = GPA( "glMap2f" );
qglMapGrid1d = dllMapGrid1d = GPA( "glMapGrid1d" );
qglMapGrid1f = dllMapGrid1f = GPA( "glMapGrid1f" );
qglMapGrid2d = dllMapGrid2d = GPA( "glMapGrid2d" );
qglMapGrid2f = dllMapGrid2f = GPA( "glMapGrid2f" );
qglMaterialf = dllMaterialf = GPA( "glMaterialf" );
qglMaterialfv = dllMaterialfv = GPA( "glMaterialfv" );
qglMateriali = dllMateriali = GPA( "glMateriali" );
qglMaterialiv = dllMaterialiv = GPA( "glMaterialiv" );
qglMatrixMode = dllMatrixMode = GPA( "glMatrixMode" );
qglMultMatrixd = dllMultMatrixd = GPA( "glMultMatrixd" );
qglMultMatrixf = dllMultMatrixf = GPA( "glMultMatrixf" );
qglNewList = dllNewList = GPA( "glNewList" );
qglNormal3b = dllNormal3b = GPA( "glNormal3b" );
qglNormal3bv = dllNormal3bv = GPA( "glNormal3bv" );
qglNormal3d = dllNormal3d = GPA( "glNormal3d" );
qglNormal3dv = dllNormal3dv = GPA( "glNormal3dv" );
qglNormal3f = dllNormal3f = GPA( "glNormal3f" );
qglNormal3fv = dllNormal3fv = GPA( "glNormal3fv" );
qglNormal3i = dllNormal3i = GPA( "glNormal3i" );
qglNormal3iv = dllNormal3iv = GPA( "glNormal3iv" );
qglNormal3s = dllNormal3s = GPA( "glNormal3s" );
qglNormal3sv = dllNormal3sv = GPA( "glNormal3sv" );
qglNormalPointer = dllNormalPointer = GPA( "glNormalPointer" );
qglOrtho = dllOrtho = GPA( "glOrtho" );
qglPassThrough = dllPassThrough = GPA( "glPassThrough" );
qglPixelMapfv = dllPixelMapfv = GPA( "glPixelMapfv" );
qglPixelMapuiv = dllPixelMapuiv = GPA( "glPixelMapuiv" );
qglPixelMapusv = dllPixelMapusv = GPA( "glPixelMapusv" );
qglPixelStoref = dllPixelStoref = GPA( "glPixelStoref" );
qglPixelStorei = dllPixelStorei = GPA( "glPixelStorei" );
qglPixelTransferf = dllPixelTransferf = GPA( "glPixelTransferf" );
qglPixelTransferi = dllPixelTransferi = GPA( "glPixelTransferi" );
qglPixelZoom = dllPixelZoom = GPA( "glPixelZoom" );
qglPointSize = dllPointSize = GPA( "glPointSize" );
qglPolygonMode = dllPolygonMode = GPA( "glPolygonMode" );
qglPolygonOffset = dllPolygonOffset = GPA( "glPolygonOffset" );
qglPolygonStipple = dllPolygonStipple = GPA( "glPolygonStipple" );
qglPopAttrib = dllPopAttrib = GPA( "glPopAttrib" );
qglPopClientAttrib = dllPopClientAttrib = GPA( "glPopClientAttrib" );
qglPopMatrix = dllPopMatrix = GPA( "glPopMatrix" );
qglPopName = dllPopName = GPA( "glPopName" );
qglPrioritizeTextures = dllPrioritizeTextures = GPA( "glPrioritizeTextures" );
qglPushAttrib = dllPushAttrib = GPA( "glPushAttrib" );
qglPushClientAttrib = dllPushClientAttrib = GPA( "glPushClientAttrib" );
qglPushMatrix = dllPushMatrix = GPA( "glPushMatrix" );
qglPushName = dllPushName = GPA( "glPushName" );
qglRasterPos2d = dllRasterPos2d = GPA( "glRasterPos2d" );
qglRasterPos2dv = dllRasterPos2dv = GPA( "glRasterPos2dv" );
qglRasterPos2f = dllRasterPos2f = GPA( "glRasterPos2f" );
qglRasterPos2fv = dllRasterPos2fv = GPA( "glRasterPos2fv" );
qglRasterPos2i = dllRasterPos2i = GPA( "glRasterPos2i" );
qglRasterPos2iv = dllRasterPos2iv = GPA( "glRasterPos2iv" );
qglRasterPos2s = dllRasterPos2s = GPA( "glRasterPos2s" );
qglRasterPos2sv = dllRasterPos2sv = GPA( "glRasterPos2sv" );
qglRasterPos3d = dllRasterPos3d = GPA( "glRasterPos3d" );
qglRasterPos3dv = dllRasterPos3dv = GPA( "glRasterPos3dv" );
qglRasterPos3f = dllRasterPos3f = GPA( "glRasterPos3f" );
qglRasterPos3fv = dllRasterPos3fv = GPA( "glRasterPos3fv" );
qglRasterPos3i = dllRasterPos3i = GPA( "glRasterPos3i" );
qglRasterPos3iv = dllRasterPos3iv = GPA( "glRasterPos3iv" );
qglRasterPos3s = dllRasterPos3s = GPA( "glRasterPos3s" );
qglRasterPos3sv = dllRasterPos3sv = GPA( "glRasterPos3sv" );
qglRasterPos4d = dllRasterPos4d = GPA( "glRasterPos4d" );
qglRasterPos4dv = dllRasterPos4dv = GPA( "glRasterPos4dv" );
qglRasterPos4f = dllRasterPos4f = GPA( "glRasterPos4f" );
qglRasterPos4fv = dllRasterPos4fv = GPA( "glRasterPos4fv" );
qglRasterPos4i = dllRasterPos4i = GPA( "glRasterPos4i" );
qglRasterPos4iv = dllRasterPos4iv = GPA( "glRasterPos4iv" );
qglRasterPos4s = dllRasterPos4s = GPA( "glRasterPos4s" );
qglRasterPos4sv = dllRasterPos4sv = GPA( "glRasterPos4sv" );
qglReadBuffer = dllReadBuffer = GPA( "glReadBuffer" );
qglReadPixels = dllReadPixels = GPA( "glReadPixels" );
qglRectd = dllRectd = GPA( "glRectd" );
qglRectdv = dllRectdv = GPA( "glRectdv" );
qglRectf = dllRectf = GPA( "glRectf" );
qglRectfv = dllRectfv = GPA( "glRectfv" );
qglRecti = dllRecti = GPA( "glRecti" );
qglRectiv = dllRectiv = GPA( "glRectiv" );
qglRects = dllRects = GPA( "glRects" );
qglRectsv = dllRectsv = GPA( "glRectsv" );
qglRenderMode = dllRenderMode = GPA( "glRenderMode" );
qglRotated = dllRotated = GPA( "glRotated" );
qglRotatef = dllRotatef = GPA( "glRotatef" );
qglScaled = dllScaled = GPA( "glScaled" );
qglScalef = dllScalef = GPA( "glScalef" );
qglScissor = dllScissor = GPA( "glScissor" );
qglSelectBuffer = dllSelectBuffer = GPA( "glSelectBuffer" );
qglShadeModel = dllShadeModel = GPA( "glShadeModel" );
qglStencilFunc = dllStencilFunc = GPA( "glStencilFunc" );
qglStencilMask = dllStencilMask = GPA( "glStencilMask" );
qglStencilOp = dllStencilOp = GPA( "glStencilOp" );
qglTexCoord1d = dllTexCoord1d = GPA( "glTexCoord1d" );
qglTexCoord1dv = dllTexCoord1dv = GPA( "glTexCoord1dv" );
qglTexCoord1f = dllTexCoord1f = GPA( "glTexCoord1f" );
qglTexCoord1fv = dllTexCoord1fv = GPA( "glTexCoord1fv" );
qglTexCoord1i = dllTexCoord1i = GPA( "glTexCoord1i" );
qglTexCoord1iv = dllTexCoord1iv = GPA( "glTexCoord1iv" );
qglTexCoord1s = dllTexCoord1s = GPA( "glTexCoord1s" );
qglTexCoord1sv = dllTexCoord1sv = GPA( "glTexCoord1sv" );
qglTexCoord2d = dllTexCoord2d = GPA( "glTexCoord2d" );
qglTexCoord2dv = dllTexCoord2dv = GPA( "glTexCoord2dv" );
qglTexCoord2f = dllTexCoord2f = GPA( "glTexCoord2f" );
qglTexCoord2fv = dllTexCoord2fv = GPA( "glTexCoord2fv" );
qglTexCoord2i = dllTexCoord2i = GPA( "glTexCoord2i" );
qglTexCoord2iv = dllTexCoord2iv = GPA( "glTexCoord2iv" );
qglTexCoord2s = dllTexCoord2s = GPA( "glTexCoord2s" );
qglTexCoord2sv = dllTexCoord2sv = GPA( "glTexCoord2sv" );
qglTexCoord3d = dllTexCoord3d = GPA( "glTexCoord3d" );
qglTexCoord3dv = dllTexCoord3dv = GPA( "glTexCoord3dv" );
qglTexCoord3f = dllTexCoord3f = GPA( "glTexCoord3f" );
qglTexCoord3fv = dllTexCoord3fv = GPA( "glTexCoord3fv" );
qglTexCoord3i = dllTexCoord3i = GPA( "glTexCoord3i" );
qglTexCoord3iv = dllTexCoord3iv = GPA( "glTexCoord3iv" );
qglTexCoord3s = dllTexCoord3s = GPA( "glTexCoord3s" );
qglTexCoord3sv = dllTexCoord3sv = GPA( "glTexCoord3sv" );
qglTexCoord4d = dllTexCoord4d = GPA( "glTexCoord4d" );
qglTexCoord4dv = dllTexCoord4dv = GPA( "glTexCoord4dv" );
qglTexCoord4f = dllTexCoord4f = GPA( "glTexCoord4f" );
qglTexCoord4fv = dllTexCoord4fv = GPA( "glTexCoord4fv" );
qglTexCoord4i = dllTexCoord4i = GPA( "glTexCoord4i" );
qglTexCoord4iv = dllTexCoord4iv = GPA( "glTexCoord4iv" );
qglTexCoord4s = dllTexCoord4s = GPA( "glTexCoord4s" );
qglTexCoord4sv = dllTexCoord4sv = GPA( "glTexCoord4sv" );
qglTexCoordPointer = dllTexCoordPointer = GPA( "glTexCoordPointer" );
qglTexEnvf = dllTexEnvf = GPA( "glTexEnvf" );
qglTexEnvfv = dllTexEnvfv = GPA( "glTexEnvfv" );
qglTexEnvi = dllTexEnvi = GPA( "glTexEnvi" );
qglTexEnviv = dllTexEnviv = GPA( "glTexEnviv" );
qglTexGend = dllTexGend = GPA( "glTexGend" );
qglTexGendv = dllTexGendv = GPA( "glTexGendv" );
qglTexGenf = dllTexGenf = GPA( "glTexGenf" );
qglTexGenfv = dllTexGenfv = GPA( "glTexGenfv" );
qglTexGeni = dllTexGeni = GPA( "glTexGeni" );
qglTexGeniv = dllTexGeniv = GPA( "glTexGeniv" );
qglTexImage1D = dllTexImage1D = GPA( "glTexImage1D" );
qglTexImage2D = dllTexImage2D = GPA( "glTexImage2D" );
qglTexParameterf = dllTexParameterf = GPA( "glTexParameterf" );
qglTexParameterfv = dllTexParameterfv = GPA( "glTexParameterfv" );
qglTexParameteri = dllTexParameteri = GPA( "glTexParameteri" );
qglTexParameteriv = dllTexParameteriv = GPA( "glTexParameteriv" );
qglTexSubImage1D = dllTexSubImage1D = GPA( "glTexSubImage1D" );
qglTexSubImage2D = dllTexSubImage2D = GPA( "glTexSubImage2D" );
qglTranslated = dllTranslated = GPA( "glTranslated" );
qglTranslatef = dllTranslatef = GPA( "glTranslatef" );
qglVertex2d = dllVertex2d = GPA( "glVertex2d" );
qglVertex2dv = dllVertex2dv = GPA( "glVertex2dv" );
qglVertex2f = dllVertex2f = GPA( "glVertex2f" );
qglVertex2fv = dllVertex2fv = GPA( "glVertex2fv" );
qglVertex2i = dllVertex2i = GPA( "glVertex2i" );
qglVertex2iv = dllVertex2iv = GPA( "glVertex2iv" );
qglVertex2s = dllVertex2s = GPA( "glVertex2s" );
qglVertex2sv = dllVertex2sv = GPA( "glVertex2sv" );
qglVertex3d = dllVertex3d = GPA( "glVertex3d" );
qglVertex3dv = dllVertex3dv = GPA( "glVertex3dv" );
qglVertex3f = dllVertex3f = GPA( "glVertex3f" );
qglVertex3fv = dllVertex3fv = GPA( "glVertex3fv" );
qglVertex3i = dllVertex3i = GPA( "glVertex3i" );
qglVertex3iv = dllVertex3iv = GPA( "glVertex3iv" );
qglVertex3s = dllVertex3s = GPA( "glVertex3s" );
qglVertex3sv = dllVertex3sv = GPA( "glVertex3sv" );
qglVertex4d = dllVertex4d = GPA( "glVertex4d" );
qglVertex4dv = dllVertex4dv = GPA( "glVertex4dv" );
qglVertex4f = dllVertex4f = GPA( "glVertex4f" );
qglVertex4fv = dllVertex4fv = GPA( "glVertex4fv" );
qglVertex4i = dllVertex4i = GPA( "glVertex4i" );
qglVertex4iv = dllVertex4iv = GPA( "glVertex4iv" );
qglVertex4s = dllVertex4s = GPA( "glVertex4s" );
qglVertex4sv = dllVertex4sv = GPA( "glVertex4sv" );
qglVertexPointer = dllVertexPointer = GPA( "glVertexPointer" );
qglViewport = dllViewport = GPA( "glViewport" );
qglAccum = dllAccum = (void (__stdcall *)(unsigned int,float))GPA( "glAccum" );
qglAlphaFunc = dllAlphaFunc = (void (__stdcall *)(unsigned int,float))GPA( "glAlphaFunc" );
qglAreTexturesResident = dllAreTexturesResident = (unsigned char (__stdcall *)(int,const unsigned int *,unsigned char *))GPA( "glAreTexturesResident" );
qglArrayElement = dllArrayElement = (void (__stdcall *)(int))GPA( "glArrayElement" );
qglBegin = dllBegin = (void (__stdcall *)(unsigned int))GPA( "glBegin" );
qglBindTexture = dllBindTexture = (void (__stdcall *)(unsigned int,unsigned int))GPA( "glBindTexture" );
qglBitmap = dllBitmap = (void (__stdcall *)(int,int,float,float,float,float,const unsigned char *))GPA( "glBitmap" );
qglBlendFunc = dllBlendFunc = (void (__stdcall *)(unsigned int,unsigned int))GPA( "glBlendFunc" );
qglCallList = dllCallList = (void (__stdcall *)(unsigned int))GPA( "glCallList" );
qglCallLists = dllCallLists = (void (__stdcall *)(int,unsigned int,const void *))GPA( "glCallLists" );
qglClear = dllClear = (void (__stdcall *)(unsigned int))GPA( "glClear" );
qglClearAccum = dllClearAccum = (void (__stdcall *)(float,float,float,float))GPA( "glClearAccum" );
qglClearColor = dllClearColor = (void (__stdcall *)(float,float,float,float))GPA( "glClearColor" );
qglClearDepth = dllClearDepth = (void (__stdcall *)(double))GPA( "glClearDepth" );
qglClearIndex = dllClearIndex = (void (__stdcall *)(float))GPA( "glClearIndex" );
qglClearStencil = dllClearStencil = (void (__stdcall *)(int))GPA( "glClearStencil" );
qglClipPlane = dllClipPlane = (void (__stdcall *)(unsigned int,const double *))GPA( "glClipPlane" );
qglColor3b = dllColor3b = (void (__stdcall *)(signed char,signed char,signed char))GPA( "glColor3b" );
qglColor3bv = dllColor3bv = (void (__stdcall *)(const signed char *))GPA( "glColor3bv" );
qglColor3d = dllColor3d = (void (__stdcall *)(double,double,double))GPA( "glColor3d" );
qglColor3dv = dllColor3dv = (void (__stdcall *)(const double *))GPA( "glColor3dv" );
qglColor3f = dllColor3f = (void (__stdcall *)(float,float,float))GPA( "glColor3f" );
qglColor3fv = dllColor3fv = (void (__stdcall *)(const float *))GPA( "glColor3fv" );
qglColor3i = dllColor3i = (void (__stdcall *)(int,int,int))GPA( "glColor3i" );
qglColor3iv = dllColor3iv = (void (__stdcall *)(const int *))GPA( "glColor3iv" );
qglColor3s = dllColor3s =(void (__stdcall *)(short,short,short))GPA( "glColor3s" );
qglColor3sv = dllColor3sv =(void (__stdcall *)(const short *))GPA( "glColor3sv" );
qglColor3ub = dllColor3ub =(void (__stdcall *)(unsigned char,unsigned char,unsigned char))GPA( "glColor3ub" );
qglColor3ubv = dllColor3ubv =(void (__stdcall *)(const unsigned char *))GPA( "glColor3ubv" );
qglColor3ui = dllColor3ui =(void (__stdcall *)(unsigned int,unsigned int,unsigned int))GPA( "glColor3ui" );
qglColor3uiv = dllColor3uiv =(void (__stdcall *)(const unsigned int *))GPA( "glColor3uiv" );
qglColor3us = dllColor3us =(void (__stdcall *)(unsigned short,unsigned short,unsigned short))GPA( "glColor3us" );
qglColor3usv = dllColor3usv =(void (__stdcall *)(const unsigned short *))GPA( "glColor3usv" );
qglColor4b = dllColor4b =(void (__stdcall *)(signed char,signed char,signed char,signed char))GPA( "glColor4b" );
qglColor4bv = dllColor4bv =(void (__stdcall *)(const signed char *))GPA( "glColor4bv" );
qglColor4d = dllColor4d =(void (__stdcall *)(double,double,double,double))GPA( "glColor4d" );
qglColor4dv = dllColor4dv =(void (__stdcall *)(const double *))GPA( "glColor4dv" );
qglColor4f = dllColor4f =(void (__stdcall *)(float,float,float,float))GPA( "glColor4f" );
qglColor4fv = dllColor4fv =(void (__stdcall *)(const float *))GPA( "glColor4fv" );
qglColor4i = dllColor4i =(void (__stdcall *)(int,int,int,int))GPA( "glColor4i" );
qglColor4iv = dllColor4iv =(void (__stdcall *)(const int *))GPA( "glColor4iv" );
qglColor4s = dllColor4s =(void (__stdcall *)(short,short,short,short))GPA( "glColor4s" );
qglColor4sv = dllColor4sv =(void (__stdcall *)(const short *))GPA( "glColor4sv" );
qglColor4ub = dllColor4ub =(void (__stdcall *)(unsigned char,unsigned char,unsigned char,unsigned char))GPA( "glColor4ub" );
qglColor4ubv = dllColor4ubv =(void (__stdcall *)(const unsigned char *))GPA( "glColor4ubv" );
qglColor4ui = dllColor4ui =(void (__stdcall *)(unsigned int,unsigned int,unsigned int,unsigned int))GPA( "glColor4ui" );
qglColor4uiv = dllColor4uiv =(void (__stdcall *)(const unsigned int *))GPA( "glColor4uiv" );
qglColor4us = dllColor4us =(void (__stdcall *)(unsigned short,unsigned short,unsigned short,unsigned short))GPA( "glColor4us" );
qglColor4usv = dllColor4usv =(void (__stdcall *)(const unsigned short *))GPA( "glColor4usv" );
qglColorMask = dllColorMask =(void (__stdcall *)(unsigned char,unsigned char,unsigned char,unsigned char))GPA( "glColorMask" );
qglColorMaterial = dllColorMaterial =(void (__stdcall *)(unsigned int,unsigned int))GPA( "glColorMaterial" );
qglColorPointer = dllColorPointer =(void (__stdcall *)(int,unsigned int,int,const void *))GPA( "glColorPointer" );
qglCopyPixels = dllCopyPixels =(void (__stdcall *)(int,int,int,int,unsigned int))GPA( "glCopyPixels" );
qglCopyTexImage1D = dllCopyTexImage1D =(void (__stdcall *)(unsigned int,int,unsigned int,int,int,int,int))GPA( "glCopyTexImage1D" );
qglCopyTexImage2D = dllCopyTexImage2D =(void (__stdcall *)(unsigned int,int,unsigned int,int,int,int,int,int))GPA( "glCopyTexImage2D" );
qglCopyTexSubImage1D = dllCopyTexSubImage1D =(void (__stdcall *)(unsigned int,int,int,int,int,int))GPA( "glCopyTexSubImage1D" );
qglCopyTexSubImage2D = dllCopyTexSubImage2D =(void (__stdcall *)(unsigned int,int,int,int,int,int,int,int))GPA( "glCopyTexSubImage2D" );
qglCullFace = dllCullFace =(void (__stdcall *)(unsigned int))GPA( "glCullFace" );
qglDeleteLists = dllDeleteLists =(void (__stdcall *)(unsigned int,int))GPA( "glDeleteLists" );
qglDeleteTextures = dllDeleteTextures =(void (__stdcall *)(int,const unsigned int *))GPA( "glDeleteTextures" );
qglDepthFunc = dllDepthFunc =(void (__stdcall *)(unsigned int))GPA( "glDepthFunc" );
qglDepthMask = dllDepthMask =(void (__stdcall *)(unsigned char))GPA( "glDepthMask" );
qglDepthRange = dllDepthRange =(void (__stdcall *)(double,double))GPA( "glDepthRange" );
qglDisable = dllDisable =(void (__stdcall *)(unsigned int))GPA( "glDisable" );
qglDisableClientState = dllDisableClientState =(void (__stdcall *)(unsigned int))GPA( "glDisableClientState" );
qglDrawArrays = dllDrawArrays =(void (__stdcall *)(unsigned int,int,int))GPA( "glDrawArrays" );
qglDrawBuffer = dllDrawBuffer =(void (__stdcall *)(unsigned int))GPA( "glDrawBuffer" );
qglDrawElements = dllDrawElements =(void (__stdcall *)(unsigned int,int,unsigned int,const void *))GPA( "glDrawElements" );
qglDrawPixels = dllDrawPixels =(void (__stdcall *)(int,int,unsigned int,unsigned int,const void *))GPA( "glDrawPixels" );
qglEdgeFlag = dllEdgeFlag =(void (__stdcall *)(unsigned char))GPA( "glEdgeFlag" );
qglEdgeFlagPointer = dllEdgeFlagPointer =(void (__stdcall *)(int,const void *))GPA( "glEdgeFlagPointer" );
qglEdgeFlagv = dllEdgeFlagv =(void (__stdcall *)(const unsigned char *))GPA( "glEdgeFlagv" );
qglEnable = dllEnable =(void (__stdcall *)(unsigned int))GPA( "glEnable" );
qglEnableClientState = dllEnableClientState =(void (__stdcall *)(unsigned int))GPA( "glEnableClientState" );
qglEnd = dllEnd =(void (__stdcall *)(void))GPA( "glEnd" );
qglEndList = dllEndList =(void (__stdcall *)(void))GPA( "glEndList" );
qglEvalCoord1d = dllEvalCoord1d =(void (__stdcall *)(double))GPA( "glEvalCoord1d" );
qglEvalCoord1dv = dllEvalCoord1dv =(void (__stdcall *)(const double *))GPA( "glEvalCoord1dv" );
qglEvalCoord1f = dllEvalCoord1f =(void (__stdcall *)(float))GPA( "glEvalCoord1f" );
qglEvalCoord1fv = dllEvalCoord1fv =(void (__stdcall *)(const float *))GPA( "glEvalCoord1fv" );
qglEvalCoord2d = dllEvalCoord2d =(void (__stdcall *)(double,double))GPA( "glEvalCoord2d" );
qglEvalCoord2dv = dllEvalCoord2dv =(void (__stdcall *)(const double *))GPA( "glEvalCoord2dv" );
qglEvalCoord2f = dllEvalCoord2f =(void (__stdcall *)(float,float))GPA( "glEvalCoord2f" );
qglEvalCoord2fv = dllEvalCoord2fv =(void (__stdcall *)(const float *))GPA( "glEvalCoord2fv" );
qglEvalMesh1 = dllEvalMesh1 =(void (__stdcall *)(unsigned int,int,int))GPA( "glEvalMesh1" );
qglEvalMesh2 = dllEvalMesh2 =(void (__stdcall *)(unsigned int,int,int,int,int))GPA( "glEvalMesh2" );
qglEvalPoint1 = dllEvalPoint1 =(void (__stdcall *)(int))GPA( "glEvalPoint1" );
qglEvalPoint2 = dllEvalPoint2 =(void (__stdcall *)(int,int))GPA( "glEvalPoint2" );
qglFeedbackBuffer = dllFeedbackBuffer =(void (__stdcall *)(int,unsigned int,float *))GPA( "glFeedbackBuffer" );
qglFinish = dllFinish =(void (__stdcall *)(void))GPA( "glFinish" );
qglFlush = dllFlush =(void (__stdcall *)(void))GPA( "glFlush" );
qglFogf = dllFogf =(void (__stdcall *)(unsigned int,float))GPA( "glFogf" );
qglFogfv = dllFogfv =(void (__stdcall *)(unsigned int,const float *))GPA( "glFogfv" );
qglFogi = dllFogi =(void (__stdcall *)(unsigned int,int))GPA( "glFogi" );
qglFogiv = dllFogiv =(void (__stdcall *)(unsigned int,const int *))GPA( "glFogiv" );
qglFrontFace = dllFrontFace =(void (__stdcall *)(unsigned int))GPA( "glFrontFace" );
qglFrustum = dllFrustum =(void (__stdcall *)(double,double,double,double,double,double))GPA( "glFrustum" );
qglGenLists = dllGenLists =(unsigned int (__stdcall *)(int))GPA( "glGenLists" );
qglGenTextures = dllGenTextures =(void (__stdcall *)(int,unsigned int *))GPA( "glGenTextures" );
qglGetBooleanv = dllGetBooleanv =(void (__stdcall *)(unsigned int,unsigned char *))GPA( "glGetBooleanv" );
qglGetClipPlane = dllGetClipPlane =(void (__stdcall *)(unsigned int,double *))GPA( "glGetClipPlane" );
qglGetDoublev = dllGetDoublev =(void (__stdcall *)(unsigned int,double *))GPA( "glGetDoublev" );
qglGetError = dllGetError =(unsigned int (__stdcall *)(void))GPA( "glGetError" );
qglGetFloatv = dllGetFloatv =(void (__stdcall *)(unsigned int,float *))GPA( "glGetFloatv" );
qglGetIntegerv = dllGetIntegerv =(void (__stdcall *)(unsigned int,int *))GPA( "glGetIntegerv" );
qglGetLightfv = dllGetLightfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetLightfv" );
qglGetLightiv = dllGetLightiv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetLightiv" );
qglGetMapdv = dllGetMapdv =(void (__stdcall *)(unsigned int,unsigned int,double *))GPA( "glGetMapdv" );
qglGetMapfv = dllGetMapfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetMapfv" );
qglGetMapiv = dllGetMapiv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetMapiv" );
qglGetMaterialfv = dllGetMaterialfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetMaterialfv" );
qglGetMaterialiv = dllGetMaterialiv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetMaterialiv" );
qglGetPixelMapfv = dllGetPixelMapfv =(void (__stdcall *)(unsigned int,float *))GPA( "glGetPixelMapfv" );
qglGetPixelMapuiv = dllGetPixelMapuiv =(void (__stdcall *)(unsigned int,unsigned int *))GPA( "glGetPixelMapuiv" );
qglGetPixelMapusv = dllGetPixelMapusv =(void (__stdcall *)(unsigned int,unsigned short *))GPA( "glGetPixelMapusv" );
qglGetPointerv = dllGetPointerv =(void (__stdcall *)(unsigned int,void ** ))GPA( "glGetPointerv" );
qglGetPolygonStipple = dllGetPolygonStipple =(void (__stdcall *)(unsigned char *))GPA( "glGetPolygonStipple" );
qglGetString = dllGetString =(const unsigned char *(__stdcall *)(unsigned int))GPA( "glGetString" );
qglGetTexEnvfv = dllGetTexEnvfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetTexEnvfv" );
qglGetTexEnviv = dllGetTexEnviv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetTexEnviv" );
qglGetTexGendv = dllGetTexGendv =(void (__stdcall *)(unsigned int,unsigned int,double *))GPA( "glGetTexGendv" );
qglGetTexGenfv = dllGetTexGenfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetTexGenfv" );
qglGetTexGeniv = dllGetTexGeniv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetTexGeniv" );
qglGetTexImage = dllGetTexImage =(void (__stdcall *)(unsigned int,int,unsigned int,unsigned int,void *))GPA( "glGetTexImage" );
// qglGetTexLevelParameterfv = dllGetTexLevelParameterfv =(void (__stdcall *)(unsigned int,int,unsigned int,float *))GPA( "glGetTexLevelParameterfv" );
// qglGetTexLevelParameteriv = dllGetTexLevelParameteriv =(void (__stdcall *)(unsigned int,int,unsigned int,int *))GPA( "glGetTexLevelParameteriv" );
qglGetTexParameterfv = dllGetTexParameterfv =(void (__stdcall *)(unsigned int,unsigned int,float *))GPA( "glGetTexParameterfv" );
qglGetTexParameteriv = dllGetTexParameteriv =(void (__stdcall *)(unsigned int,unsigned int,int *))GPA( "glGetTexParameteriv" );
qglHint = dllHint =(void (__stdcall *)(unsigned int,unsigned int))GPA( "glHint" );
qglIndexMask = dllIndexMask =(void (__stdcall *)(unsigned int))GPA( "glIndexMask" );
qglIndexPointer = dllIndexPointer =(void (__stdcall *)(unsigned int,int,const void *))GPA( "glIndexPointer" );
qglIndexd = dllIndexd =(void (__stdcall *)(double))GPA( "glIndexd" );
qglIndexdv = dllIndexdv =(void (__stdcall *)(const double *))GPA( "glIndexdv" );
qglIndexf = dllIndexf =(void (__stdcall *)(float))GPA( "glIndexf" );
qglIndexfv = dllIndexfv =(void (__stdcall *)(const float *))GPA( "glIndexfv" );
qglIndexi = dllIndexi =(void (__stdcall *)(int))GPA( "glIndexi" );
qglIndexiv = dllIndexiv =(void (__stdcall *)(const int *))GPA( "glIndexiv" );
qglIndexs = dllIndexs =(void (__stdcall *)(short))GPA( "glIndexs" );
qglIndexsv = dllIndexsv =(void (__stdcall *)(const short *))GPA( "glIndexsv" );
qglIndexub = dllIndexub =(void (__stdcall *)(unsigned char))GPA( "glIndexub" );
qglIndexubv = dllIndexubv =(void (__stdcall *)(const unsigned char *))GPA( "glIndexubv" );
qglInitNames = dllInitNames =(void (__stdcall *)(void))GPA( "glInitNames" );
qglInterleavedArrays = dllInterleavedArrays =(void (__stdcall *)(unsigned int,int,const void *))GPA( "glInterleavedArrays" );
qglIsEnabled = dllIsEnabled =(unsigned char (__stdcall *)(unsigned int))GPA( "glIsEnabled" );
qglIsList = dllIsList =(unsigned char (__stdcall *)(unsigned int))GPA( "glIsList" );
qglIsTexture = dllIsTexture =(unsigned char (__stdcall *)(unsigned int))GPA( "glIsTexture" );
qglLightModelf = dllLightModelf =(void (__stdcall *)(unsigned int,float))GPA( "glLightModelf" );
qglLightModelfv = dllLightModelfv =(void (__stdcall *)(unsigned int,const float *))GPA( "glLightModelfv" );
qglLightModeli = dllLightModeli =(void (__stdcall *)(unsigned int,int))GPA( "glLightModeli" );
qglLightModeliv = dllLightModeliv =(void (__stdcall *)(unsigned int,const int *))GPA( "glLightModeliv" );
qglLightf = dllLightf =(void (__stdcall *)(unsigned int,unsigned int,float))GPA( "glLightf" );
qglLightfv = dllLightfv =(void (__stdcall *)(unsigned int,unsigned int,const float *))GPA( "glLightfv" );
qglLighti = dllLighti =(void (__stdcall *)(unsigned int,unsigned int,int))GPA( "glLighti" );
qglLightiv = dllLightiv =(void (__stdcall *)(unsigned int,unsigned int,const int *))GPA( "glLightiv" );
qglLineStipple = dllLineStipple =(void (__stdcall *)(int,unsigned short))GPA( "glLineStipple" );
qglLineWidth = dllLineWidth =(void (__stdcall *)(float))GPA( "glLineWidth" );
qglListBase = dllListBase =(void (__stdcall *)(unsigned int))GPA( "glListBase" );
qglLoadIdentity = dllLoadIdentity =(void (__stdcall *)(void))GPA( "glLoadIdentity" );
qglLoadMatrixd = dllLoadMatrixd =(void (__stdcall *)(const double *))GPA( "glLoadMatrixd" );
qglLoadMatrixf = dllLoadMatrixf =(void (__stdcall *)(const float *))GPA( "glLoadMatrixf" );
qglLoadName = dllLoadName =(void (__stdcall *)(unsigned int))GPA( "glLoadName" );
qglLogicOp = dllLogicOp =(void (__stdcall *)(unsigned int))GPA( "glLogicOp" );
qglMap1d = dllMap1d =(void (__stdcall *)(unsigned int,double,double,int,int,const double *))GPA( "glMap1d" );
qglMap1f = dllMap1f =(void (__stdcall *)(unsigned int,float,float,int,int,const float *))GPA( "glMap1f" );
qglMap2d = dllMap2d =(void (__stdcall *)(unsigned int,double,double,int,int,double,double,int,int,const double *))GPA( "glMap2d" );
qglMap2f = dllMap2f =(void (__stdcall *)(unsigned int,float,float,int,int,float,float,int,int,const float *))GPA( "glMap2f" );
qglMapGrid1d = dllMapGrid1d =(void (__stdcall *)(int,double,double))GPA( "glMapGrid1d" );
qglMapGrid1f = dllMapGrid1f =(void (__stdcall *)(int,float,float))GPA( "glMapGrid1f" );
qglMapGrid2d = dllMapGrid2d =(void (__stdcall *)(int,double,double,int,double,double))GPA( "glMapGrid2d" );
qglMapGrid2f = dllMapGrid2f =(void (__stdcall *)(int,float,float,int,float,float))GPA( "glMapGrid2f" );
qglMaterialf = dllMaterialf =(void (__stdcall *)(unsigned int,unsigned int,float))GPA( "glMaterialf" );
qglMaterialfv = dllMaterialfv =(void (__stdcall *)(unsigned int,unsigned int,const float *))GPA( "glMaterialfv" );
qglMateriali = dllMateriali =(void (__stdcall *)(unsigned int,unsigned int,int))GPA( "glMateriali" );
qglMaterialiv = dllMaterialiv =(void (__stdcall *)(unsigned int,unsigned int,const int *))GPA( "glMaterialiv" );
qglMatrixMode = dllMatrixMode =(void (__stdcall *)(unsigned int))GPA( "glMatrixMode" );
qglMultMatrixd = dllMultMatrixd =(void (__stdcall *)(const double *))GPA( "glMultMatrixd" );
qglMultMatrixf = dllMultMatrixf =(void (__stdcall *)(const float *))GPA( "glMultMatrixf" );
qglNewList = dllNewList =(void (__stdcall *)(unsigned int,unsigned int))GPA( "glNewList" );
qglNormal3b = dllNormal3b =(void (__stdcall *)(signed char,signed char,signed char))GPA( "glNormal3b" );
qglNormal3bv = dllNormal3bv =(void (__stdcall *)(const signed char *))GPA( "glNormal3bv" );
qglNormal3d = dllNormal3d =(void (__stdcall *)(double,double,double))GPA( "glNormal3d" );
qglNormal3dv = dllNormal3dv =(void (__stdcall *)(const double *))GPA( "glNormal3dv" );
qglNormal3f = dllNormal3f =(void (__stdcall *)(float,float,float))GPA( "glNormal3f" );
qglNormal3fv = dllNormal3fv =(void (__stdcall *)(const float *))GPA( "glNormal3fv" );
qglNormal3i = dllNormal3i =(void (__stdcall *)(int,int,int))GPA( "glNormal3i" );
qglNormal3iv = dllNormal3iv =(void (__stdcall *)(const int *))GPA( "glNormal3iv" );
qglNormal3s = dllNormal3s =(void (__stdcall *)(short,short,short))GPA( "glNormal3s" );
qglNormal3sv = dllNormal3sv =(void (__stdcall *)(const short *))GPA( "glNormal3sv" );
qglNormalPointer = dllNormalPointer =(void (__stdcall *)(unsigned int,int,const void *))GPA( "glNormalPointer" );
qglOrtho = dllOrtho =(void (__stdcall *)(double,double,double,double,double,double))GPA( "glOrtho" );
qglPassThrough = dllPassThrough =(void (__stdcall *)(float))GPA( "glPassThrough" );
qglPixelMapfv = dllPixelMapfv =(void (__stdcall *)(unsigned int,int,const float *))GPA( "glPixelMapfv" );
qglPixelMapuiv = dllPixelMapuiv =(void (__stdcall *)(unsigned int,int,const unsigned int *))GPA( "glPixelMapuiv" );
qglPixelMapusv = dllPixelMapusv =(void (__stdcall *)(unsigned int,int,const unsigned short *))GPA( "glPixelMapusv" );
qglPixelStoref = dllPixelStoref =(void (__stdcall *)(unsigned int,float))GPA( "glPixelStoref" );
qglPixelStorei = dllPixelStorei =(void (__stdcall *)(unsigned int,int))GPA( "glPixelStorei" );
qglPixelTransferf = dllPixelTransferf =(void (__stdcall *)(unsigned int,float))GPA( "glPixelTransferf" );
qglPixelTransferi = dllPixelTransferi =(void (__stdcall *)(unsigned int,int))GPA( "glPixelTransferi" );
qglPixelZoom = dllPixelZoom =(void (__stdcall *)(float,float))GPA( "glPixelZoom" );
qglPointSize = dllPointSize =(void (__stdcall *)(float))GPA( "glPointSize" );
qglPolygonMode = dllPolygonMode =(void (__stdcall *)(unsigned int,unsigned int))GPA( "glPolygonMode" );
qglPolygonOffset = dllPolygonOffset =(void (__stdcall *)(float,float))GPA( "glPolygonOffset" );
qglPolygonStipple = dllPolygonStipple =(void (__stdcall *)(const unsigned char *))GPA( "glPolygonStipple" );
qglPopAttrib = dllPopAttrib =(void (__stdcall *)(void))GPA( "glPopAttrib" );
qglPopClientAttrib = dllPopClientAttrib =(void (__stdcall *)(void))GPA( "glPopClientAttrib" );
qglPopMatrix = dllPopMatrix =(void (__stdcall *)(void))GPA( "glPopMatrix" );
qglPopName = dllPopName =(void (__stdcall *)(void))GPA( "glPopName" );
qglPrioritizeTextures = dllPrioritizeTextures =(void (__stdcall *)(int,const unsigned int *,const float *))GPA( "glPrioritizeTextures" );
qglPushAttrib = dllPushAttrib =(void (__stdcall *)(unsigned int))GPA( "glPushAttrib" );
qglPushClientAttrib = dllPushClientAttrib =(void (__stdcall *)(unsigned int))GPA( "glPushClientAttrib" );
qglPushMatrix = dllPushMatrix =(void (__stdcall *)(void))GPA( "glPushMatrix" );
qglPushName = dllPushName =(void (__stdcall *)(unsigned int))GPA( "glPushName" );
qglRasterPos2d = dllRasterPos2d =(void (__stdcall *)(double,double))GPA( "glRasterPos2d" );
qglRasterPos2dv = dllRasterPos2dv =(void (__stdcall *)(const double *))GPA( "glRasterPos2dv" );
qglRasterPos2f = dllRasterPos2f =(void (__stdcall *)(float,float))GPA( "glRasterPos2f" );
qglRasterPos2fv = dllRasterPos2fv =(void (__stdcall *)(const float *))GPA( "glRasterPos2fv" );
qglRasterPos2i = dllRasterPos2i =(void (__stdcall *)(int,int))GPA( "glRasterPos2i" );
qglRasterPos2iv = dllRasterPos2iv =(void (__stdcall *)(const int *))GPA( "glRasterPos2iv" );
qglRasterPos2s = dllRasterPos2s =(void (__stdcall *)(short,short))GPA( "glRasterPos2s" );
qglRasterPos2sv = dllRasterPos2sv =(void (__stdcall *)(const short *))GPA( "glRasterPos2sv" );
qglRasterPos3d = dllRasterPos3d =(void (__stdcall *)(double,double,double))GPA( "glRasterPos3d" );
qglRasterPos3dv = dllRasterPos3dv =(void (__stdcall *)(const double *))GPA( "glRasterPos3dv" );
qglRasterPos3f = dllRasterPos3f =(void (__stdcall *)(float,float,float))GPA( "glRasterPos3f" );
qglRasterPos3fv = dllRasterPos3fv =(void (__stdcall *)(const float *))GPA( "glRasterPos3fv" );
qglRasterPos3i = dllRasterPos3i =(void (__stdcall *)(int,int,int))GPA( "glRasterPos3i" );
qglRasterPos3iv = dllRasterPos3iv =(void (__stdcall *)(const int *))GPA( "glRasterPos3iv" );
qglRasterPos3s = dllRasterPos3s =(void (__stdcall *)(short,short,short))GPA( "glRasterPos3s" );
qglRasterPos3sv = dllRasterPos3sv =(void (__stdcall *)(const short *))GPA( "glRasterPos3sv" );
qglRasterPos4d = dllRasterPos4d =(void (__stdcall *)(double,double,double,double))GPA( "glRasterPos4d" );
qglRasterPos4dv = dllRasterPos4dv =(void (__stdcall *)(const double *))GPA( "glRasterPos4dv" );
qglRasterPos4f = dllRasterPos4f =(void (__stdcall *)(float,float,float,float))GPA( "glRasterPos4f" );
qglRasterPos4fv = dllRasterPos4fv =(void (__stdcall *)(const float *))GPA( "glRasterPos4fv" );
qglRasterPos4i = dllRasterPos4i =(void (__stdcall *)(int,int,int,int))GPA( "glRasterPos4i" );
qglRasterPos4iv = dllRasterPos4iv =(void (__stdcall *)(const int *))GPA( "glRasterPos4iv" );
qglRasterPos4s = dllRasterPos4s =(void (__stdcall *)(short,short,short,short))GPA( "glRasterPos4s" );
qglRasterPos4sv = dllRasterPos4sv =(void (__stdcall *)(const short *))GPA( "glRasterPos4sv" );
qglReadBuffer = dllReadBuffer =(void (__stdcall *)(unsigned int))GPA( "glReadBuffer" );
qglReadPixels = dllReadPixels =(void (__stdcall *)(int,int,int,int,unsigned int,unsigned int,void *))GPA( "glReadPixels" );
qglRectd = dllRectd =(void (__stdcall *)(double,double,double,double))GPA( "glRectd" );
qglRectdv = dllRectdv =(void (__stdcall *)(const double *,const double *))GPA( "glRectdv" );
qglRectf = dllRectf =(void (__stdcall *)(float,float,float,float))GPA( "glRectf" );
qglRectfv = dllRectfv =(void (__stdcall *)(const float *,const float *))GPA( "glRectfv" );
qglRecti = dllRecti =(void (__stdcall *)(int,int,int,int))GPA( "glRecti" );
qglRectiv = dllRectiv =(void (__stdcall *)(const int *,const int *))GPA( "glRectiv" );
qglRects = dllRects =(void (__stdcall *)(short,short,short,short))GPA( "glRects" );
qglRectsv = dllRectsv =(void (__stdcall *)(const short *,const short *))GPA( "glRectsv" );
qglRenderMode = dllRenderMode =(int (__stdcall *)(unsigned int))GPA( "glRenderMode" );
qglRotated = dllRotated =(void (__stdcall *)(double,double,double,double))GPA( "glRotated" );
qglRotatef = dllRotatef =(void (__stdcall *)(float,float,float,float))GPA( "glRotatef" );
qglScaled = dllScaled =(void (__stdcall *)(double,double,double))GPA( "glScaled" );
qglScalef = dllScalef =(void (__stdcall *)(float,float,float))GPA( "glScalef" );
qglScissor = dllScissor =(void (__stdcall *)(int,int,int,int))GPA( "glScissor" );
qglSelectBuffer = dllSelectBuffer =(void (__stdcall *)(int,unsigned int *))GPA( "glSelectBuffer" );
qglShadeModel = dllShadeModel =(void (__stdcall *)(unsigned int))GPA( "glShadeModel" );
qglStencilFunc = dllStencilFunc =(void (__stdcall *)(unsigned int,int,unsigned int))GPA( "glStencilFunc" );
qglStencilMask = dllStencilMask =(void (__stdcall *)(unsigned int))GPA( "glStencilMask" );
qglStencilOp = dllStencilOp =(void (__stdcall *)(unsigned int,unsigned int,unsigned int))GPA( "glStencilOp" );
qglTexCoord1d = dllTexCoord1d =(void (__stdcall *)(double))GPA( "glTexCoord1d" );
qglTexCoord1dv = dllTexCoord1dv =(void (__stdcall *)(const double *))GPA( "glTexCoord1dv" );
qglTexCoord1f = dllTexCoord1f =(void (__stdcall *)(float))GPA( "glTexCoord1f" );
qglTexCoord1fv = dllTexCoord1fv =(void (__stdcall *)(const float *))GPA( "glTexCoord1fv" );
qglTexCoord1i = dllTexCoord1i =(void (__stdcall *)(int))GPA( "glTexCoord1i" );
qglTexCoord1iv = dllTexCoord1iv =(void (__stdcall *)(const int *))GPA( "glTexCoord1iv" );
qglTexCoord1s = dllTexCoord1s =(void (__stdcall *)(short))GPA( "glTexCoord1s" );
qglTexCoord1sv = dllTexCoord1sv =(void (__stdcall *)(const short *))GPA( "glTexCoord1sv" );
qglTexCoord2d = dllTexCoord2d =(void (__stdcall *)(double,double))GPA( "glTexCoord2d" );
qglTexCoord2dv = dllTexCoord2dv =(void (__stdcall *)(const double *))GPA( "glTexCoord2dv" );
qglTexCoord2f = dllTexCoord2f =(void (__stdcall *)(float,float))GPA( "glTexCoord2f" );
qglTexCoord2fv = dllTexCoord2fv =(void (__stdcall *)(const float *))GPA( "glTexCoord2fv" );
qglTexCoord2i = dllTexCoord2i =(void (__stdcall *)(int,int))GPA( "glTexCoord2i" );
qglTexCoord2iv = dllTexCoord2iv =(void (__stdcall *)(const int *))GPA( "glTexCoord2iv" );
qglTexCoord2s = dllTexCoord2s =(void (__stdcall *)(short,short))GPA( "glTexCoord2s" );
qglTexCoord2sv = dllTexCoord2sv =(void (__stdcall *)(const short *))GPA( "glTexCoord2sv" );
qglTexCoord3d = dllTexCoord3d =(void (__stdcall *)(double,double,double))GPA( "glTexCoord3d" );
qglTexCoord3dv = dllTexCoord3dv =(void (__stdcall *)(const double *))GPA( "glTexCoord3dv" );
qglTexCoord3f = dllTexCoord3f =(void (__stdcall *)(float,float,float))GPA( "glTexCoord3f" );
qglTexCoord3fv = dllTexCoord3fv =(void (__stdcall *)(const float *))GPA( "glTexCoord3fv" );
qglTexCoord3i = dllTexCoord3i =(void (__stdcall *)(int,int,int))GPA( "glTexCoord3i" );
qglTexCoord3iv = dllTexCoord3iv =(void (__stdcall *)(const int *))GPA( "glTexCoord3iv" );
qglTexCoord3s = dllTexCoord3s =(void (__stdcall *)(short,short,short))GPA( "glTexCoord3s" );
qglTexCoord3sv = dllTexCoord3sv =(void (__stdcall *)(const short *))GPA( "glTexCoord3sv" );
qglTexCoord4d = dllTexCoord4d =(void (__stdcall *)(double,double,double,double))GPA( "glTexCoord4d" );
qglTexCoord4dv = dllTexCoord4dv =(void (__stdcall *)(const double *))GPA( "glTexCoord4dv" );
qglTexCoord4f = dllTexCoord4f =(void (__stdcall *)(float,float,float,float))GPA( "glTexCoord4f" );
qglTexCoord4fv = dllTexCoord4fv =(void (__stdcall *)(const float *))GPA( "glTexCoord4fv" );
qglTexCoord4i = dllTexCoord4i =(void (__stdcall *)(int,int,int,int))GPA( "glTexCoord4i" );
qglTexCoord4iv = dllTexCoord4iv =(void (__stdcall *)(const int *))GPA( "glTexCoord4iv" );
qglTexCoord4s = dllTexCoord4s =(void (__stdcall *)(short,short,short,short))GPA( "glTexCoord4s" );
qglTexCoord4sv = dllTexCoord4sv =(void (__stdcall *)(const short *))GPA( "glTexCoord4sv" );
qglTexCoordPointer = dllTexCoordPointer =(void (__stdcall *)(int,unsigned int,int,const void *))GPA( "glTexCoordPointer" );
qglTexEnvf = dllTexEnvf =(void (__stdcall *)(unsigned int,unsigned int,float))GPA( "glTexEnvf" );
qglTexEnvfv = dllTexEnvfv =(void (__stdcall *)(unsigned int,unsigned int,const float *))GPA( "glTexEnvfv" );
qglTexEnvi = dllTexEnvi =(void (__stdcall *)(unsigned int,unsigned int,int))GPA( "glTexEnvi" );
qglTexEnviv = dllTexEnviv =(void (__stdcall *)(unsigned int,unsigned int,const int *))GPA( "glTexEnviv" );
qglTexGend = dllTexGend =(void (__stdcall *)(unsigned int,unsigned int,double))GPA( "glTexGend" );
qglTexGendv = dllTexGendv =(void (__stdcall *)(unsigned int,unsigned int,const double *))GPA( "glTexGendv" );
qglTexGenf = dllTexGenf =(void (__stdcall *)(unsigned int,unsigned int,float))GPA( "glTexGenf" );
qglTexGenfv = dllTexGenfv =(void (__stdcall *)(unsigned int,unsigned int,const float *))GPA( "glTexGenfv" );
qglTexGeni = dllTexGeni =(void (__stdcall *)(unsigned int,unsigned int,int))GPA( "glTexGeni" );
qglTexGeniv = dllTexGeniv =(void (__stdcall *)(unsigned int,unsigned int,const int *))GPA( "glTexGeniv" );
qglTexImage1D = dllTexImage1D =(void (__stdcall *)(unsigned int,int,int,int,int,unsigned int,unsigned int,const void *))GPA( "glTexImage1D" );
qglTexImage2D = dllTexImage2D =(void (__stdcall *)(unsigned int,int,int,int,int,int,unsigned int,unsigned int,const void *))GPA( "glTexImage2D" );
qglTexParameterf = dllTexParameterf =(void (__stdcall *)(unsigned int,unsigned int,float))GPA( "glTexParameterf" );
qglTexParameterfv = dllTexParameterfv =(void (__stdcall *)(unsigned int,unsigned int,const float *))GPA( "glTexParameterfv" );
qglTexParameteri = dllTexParameteri =(void (__stdcall *)(unsigned int,unsigned int,int))GPA( "glTexParameteri" );
qglTexParameteriv = dllTexParameteriv =(void (__stdcall *)(unsigned int,unsigned int,const int *))GPA( "glTexParameteriv" );
qglTexSubImage1D = dllTexSubImage1D =(void (__stdcall *)(unsigned int,int,int,int,unsigned int,unsigned int,const void *))GPA( "glTexSubImage1D" );
qglTexSubImage2D = dllTexSubImage2D =(void (__stdcall *)(unsigned int,int,int,int,int,int,unsigned int,unsigned int,const void *))GPA( "glTexSubImage2D" );
qglTranslated = dllTranslated =(void (__stdcall *)(double,double,double))GPA( "glTranslated" );
qglTranslatef = dllTranslatef =(void (__stdcall *)(float,float,float))GPA( "glTranslatef" );
qglVertex2d = dllVertex2d =(void (__stdcall *)(double,double))GPA( "glVertex2d" );
qglVertex2dv = dllVertex2dv =(void (__stdcall *)(const double *))GPA( "glVertex2dv" );
qglVertex2f = dllVertex2f =(void (__stdcall *)(float,float))GPA( "glVertex2f" );
qglVertex2fv = dllVertex2fv =(void (__stdcall *)(const float *))GPA( "glVertex2fv" );
qglVertex2i = dllVertex2i =(void (__stdcall *)(int,int))GPA( "glVertex2i" );
qglVertex2iv = dllVertex2iv =(void (__stdcall *)(const int *))GPA( "glVertex2iv" );
qglVertex2s = dllVertex2s =(void (__stdcall *)(short,short))GPA( "glVertex2s" );
qglVertex2sv = dllVertex2sv =(void (__stdcall *)(const short *))GPA( "glVertex2sv" );
qglVertex3d = dllVertex3d =(void (__stdcall *)(double,double,double))GPA( "glVertex3d" );
qglVertex3dv = dllVertex3dv =(void (__stdcall *)(const double *))GPA( "glVertex3dv" );
qglVertex3f = dllVertex3f =(void (__stdcall *)(float,float,float))GPA( "glVertex3f" );
qglVertex3fv = dllVertex3fv =(void (__stdcall *)(const float *))GPA( "glVertex3fv" );
qglVertex3i = dllVertex3i =(void (__stdcall *)(int,int,int))GPA( "glVertex3i" );
qglVertex3iv = dllVertex3iv =(void (__stdcall *)(const int *))GPA( "glVertex3iv" );
qglVertex3s = dllVertex3s =(void (__stdcall *)(short,short,short))GPA( "glVertex3s" );
qglVertex3sv = dllVertex3sv =(void (__stdcall *)(const short *))GPA( "glVertex3sv" );
qglVertex4d = dllVertex4d =(void (__stdcall *)(double,double,double,double))GPA( "glVertex4d" );
qglVertex4dv = dllVertex4dv =(void (__stdcall *)(const double *))GPA( "glVertex4dv" );
qglVertex4f = dllVertex4f =(void (__stdcall *)(float,float,float,float))GPA( "glVertex4f" );
qglVertex4fv = dllVertex4fv =(void (__stdcall *)(const float *))GPA( "glVertex4fv" );
qglVertex4i = dllVertex4i =(void (__stdcall *)(int,int,int,int))GPA( "glVertex4i" );
qglVertex4iv = dllVertex4iv =(void (__stdcall *)(const int *))GPA( "glVertex4iv" );
qglVertex4s = dllVertex4s =(void (__stdcall *)(short,short,short,short))GPA( "glVertex4s" );
qglVertex4sv = dllVertex4sv =(void (__stdcall *)(const short *))GPA( "glVertex4sv" );
qglVertexPointer = dllVertexPointer =(void (__stdcall *)(int,unsigned int,int,const void *))GPA( "glVertexPointer" );
qglViewport = dllViewport =(void (__stdcall *)(int,int,int,int))GPA( "glViewport" );
// bk001129 - from cvs1.17 (mkv)
#if defined(__FX__)
qfxMesaCreateContext = GPA("fxMesaCreateContext");
qfxMesaCreateBestContext = GPA("fxMesaCreateBestContext");
qfxMesaDestroyContext = GPA("fxMesaDestroyContext");
qfxMesaMakeCurrent = GPA("fxMesaMakeCurrent");
qfxMesaGetCurrentContext = GPA("fxMesaGetCurrentContext");
qfxMesaSwapBuffers = GPA("fxMesaSwapBuffers");
#endif
qglXChooseVisual = GPA("glXChooseVisual");
qglXCreateContext = GPA("glXCreateContext");
qglXDestroyContext = GPA("glXDestroyContext");
qglXMakeCurrent = GPA("glXMakeCurrent");
qglXCopyContext = GPA("glXCopyContext");
qglXSwapBuffers = GPA("glXSwapBuffers");
qglXChooseVisual = (XVisualInfo *(__stdcall *)(Display *,int, int *))GPA("glXChooseVisual");
qglXCreateContext = (__GLXcontextRec *(__stdcall *)(Display *, XVisualInfo *,GLXContext, Bool))GPA("glXCreateContext");
qglXDestroyContext = (void (__stdcall *)(Display *, GLXContext))GPA("glXDestroyContext");
qglXMakeCurrent = (int (__stdcall *)(Display *, GLXDrawable, GLXContext))GPA("glXMakeCurrent");
qglXCopyContext = (void (__stdcall *)(Display *, GLXContext, GLXContext,GLuint))GPA("glXCopyContext");
qglXSwapBuffers = (void (__stdcall *)(Display *, GLXDrawable))GPA("glXSwapBuffers");
qglLockArraysEXT = 0;
qglUnlockArraysEXT = 0;
@ -3402,52 +3379,32 @@ qboolean QGL_Init( const char *dllname )
return qtrue;
}
void QGL_EnableLogging( qboolean enable ) {
// bk001205 - fixed for new countdown
static qboolean isEnabled = qfalse; // init
// return if we're already active
if ( isEnabled && enable ) {
// decrement log counter and stop if it has reached 0
ri.Cvar_Set( "r_logFile", va("%d", r_logFile->integer - 1 ) );
if ( r_logFile->integer ) {
return;
}
enable = qfalse;
}
void QGL_EnableLogging( qboolean enable )
{
if ( enable )
{
if ( !glw_state.log_fp )
{
struct tm *newtime;
time_t aclock;
char buffer[1024];
cvar_t *basedir;
// return if we're already disabled
if ( !enable && !isEnabled )
return;
time( &aclock );
newtime = localtime( &aclock );
isEnabled = enable;
asctime( newtime );
// bk001205 - old code starts here
if ( enable ) {
if ( !glw_state.log_fp ) {
struct tm *newtime;
time_t aclock;
char buffer[1024];
cvar_t *basedir;
time( &aclock );
newtime = localtime( &aclock );
asctime( newtime );
basedir = ri.Cvar_Get( "fs_basepath", "", 0 ); // FIXME: userdir?
assert(basedir);
Com_sprintf( buffer, sizeof(buffer), "%s/gl.log", basedir->string );
glw_state.log_fp = fopen( buffer, "wt" );
assert(glw_state.log_fp);
ri.Printf(PRINT_ALL, "QGL_EnableLogging(%d): writing %s\n", r_logFile->integer, buffer );
basedir = Cvar_Get( "basedir", "", 0 );
Com_sprintf( buffer, sizeof(buffer), "%s/gl.log", basedir->string );
glw_state.log_fp = fopen( buffer, "wt" );
fprintf( glw_state.log_fp, "%s\n", asctime( newtime ) );
}
fprintf( glw_state.log_fp, "%s\n", asctime( newtime ) );
}
qglAccum = logAccum;
qglAlphaFunc = logAlphaFunc;
qglAreTexturesResident = logAreTexturesResident;
qglAccum = logAccum;
qglAlphaFunc = logAlphaFunc;
qglAreTexturesResident = logAreTexturesResident;
qglArrayElement = logArrayElement;
qglBegin = logBegin;
qglBindTexture = logBindTexture;

13
CODE-mp/unix/unix_glw.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef __GLW_LINUX_H__
#define __GLW_LINUX_H__
typedef struct
{
void *OpenGLLib; // instance of OpenGL library
FILE *log_fp;
} glwstate_t;
extern glwstate_t glw_state;
#endif

View File

@ -35,7 +35,9 @@
cvar_t *nostdout;
// Structure containing functions exported from refresh DLL
#if 0
refexport_t re;
#endif
unsigned sys_frame_time;
@ -114,11 +116,11 @@ void Sys_ConsoleOutput (char *string)
void Sys_Printf (char *fmt, ...)
{
va_list argptr;
char text[1024];
char text[4096];
unsigned char *p;
va_start (argptr,fmt);
vsprintf (text,fmt,argptr);
vsnprintf (text,sizeof(text),fmt,argptr);
va_end (argptr);
if (strlen(text) > sizeof(text))
@ -164,12 +166,24 @@ void Sys_Init(void)
#if defined __linux__
#if defined __i386__
Cvar_Set( "arch", "linux i386" );
#elif defined(__amd64__) || defined(__x86_64__)
Cvar_Set( "arch", "linux amd64" );
#elif defined __alpha__
Cvar_Set( "arch", "linux alpha" );
#elif defined __sparc__
Cvar_Set( "arch", "linux sparc" );
#else
Cvar_Set( "arch", "linux unknown" );
#endif
#elif defined __OpenBSD__
#if defined __i386__
Cvar_Set( "arch", "openbsd i386" );
#elif defined(__amd64__) || defined(__x86_64__)
Cvar_Set( "arch", "openbsd amd64" );
#else
Cvar_Set( "arch", "openbsd unknown" );
#endif
#elif defined __FreeBSD__
#if defined __i386__ // FreeBSD
Cvar_Set( "arch", "freebsd i386" );
#elif defined __alpha__
@ -177,10 +191,6 @@ void Sys_Init(void)
#else
Cvar_Set( "arch", "freebsd unknown" );
#endif // FreeBSD
#else
Cvar_Set( "arch", "linux unknown" );
#endif
#elif defined __sun__
#if defined __i386__
Cvar_Set( "arch", "solaris x86" );
@ -341,10 +351,12 @@ void *Sys_LoadDll( const char *name,
getcwd(curpath, sizeof(curpath));
#if defined __i386__
#ifndef NDEBUG
snprintf (fname, sizeof(fname), "%si386-debug.so", name); // bk010205 - different DLL name
snprintf (fname, sizeof(fname), "%sx86-debug.so", name); // bk010205 - different DLL name
#else
snprintf (fname, sizeof(fname), "%si386.so", name);
snprintf (fname, sizeof(fname), "%sx86.so", name);
#endif
#elif defined(__amd64__) || defined(__x86_64__)
snprintf (fname, sizeof(fname), "%samd64.so", name);
#elif defined __powerpc__ //rcg010207 - PPC support.
snprintf (fname, sizeof(fname), "%sppc.so", name);
#elif defined __axp__
@ -442,7 +454,9 @@ void *Sys_LoadDll( const char *name,
static void *game_library;
#ifdef __i386__
const char *gamename = "qagamei386.so";
const char *gamename = "qagamex86.so";
#elif defined(__amd64__) || defined(__x86_64__)
const char *gamename = "qagameamd64.so";
#elif defined __alpha__
const char *gamename = "qagameaxp.so";
#elif defined __mips__
@ -545,7 +559,9 @@ void *Sys_GetCGameAPI (void)
char name[MAX_OSPATH];
char curpath[MAX_OSPATH];
#ifdef __i386__
const char *cgamename = "cgamei386.so";
const char *cgamename = "cgamex86.so";
#elif defined(__amd64__) || defined(__x86_64__)
const char *cgamename = "cgameamd64.so";
#elif defined __alpha__
const char *cgamename = "cgameaxp.so";
#elif defined __mips__
@ -612,7 +628,9 @@ void *Sys_GetUIAPI (void)
char name[MAX_OSPATH];
char curpath[MAX_OSPATH];
#ifdef __i386__
const char *uiname = "uii386.so";
const char *uiname = "uix86.so";
#elif defined(__amd64__) || defined(__x86_64__)
const char *uiname = "uiamd64.so";
#elif defined __alpha__
const char *uiname = "uiaxp.so";
#elif defined __mips__
@ -671,13 +689,16 @@ Sys_GetGameAPI
Loads the game dll
=================
*/
#if 0
void *Sys_GetBotLibAPI (void *parms )
{
void *(*GetBotLibAPI) (void *);
char name[MAX_OSPATH];
char curpath[MAX_OSPATH];
#ifdef __i386__
const char *botlibname = "qaboti386.so";
const char *botlibname = "qabotx86.so";
#elif defined(__amd64__) || defined(__x86_64__)
const char *botlibname = "qabotamd64.so";
#elif defined __alpha__
const char *botlibname = "qabotaxp.so";
#elif defined __mips__
@ -713,6 +734,7 @@ void *Sys_GetBotLibAPI (void *parms )
// bk001129 - this is a signature mismatch
return GetBotLibAPI (parms);
}
#endif
void *Sys_GetBotAIAPI (void *parms ) {
return NULL;
@ -1092,9 +1114,9 @@ void Sys_PrintBinVersion( const char* name ) {
char* sep = "==============================================================";
fprintf( stdout, "\n\n%s\n", sep );
#ifdef DEDICATED
fprintf( stdout, "Linux Quake3 Dedicated Server [%s %s]\n", date, time );
fprintf( stdout, "Jedi Outcast Dedicated Server [%s %s]\n", date, time );
#else
fprintf( stdout, "Linux Quake3 Full Executable [%s %s]\n", date, time );
fprintf( stdout, "Jedi Outcast Full Executable [%s %s]\n", date, time );
#endif
fprintf( stdout, " local install: %s\n", name );
fprintf( stdout, "%s\n\n", sep );

View File

@ -72,18 +72,6 @@ void Sys_Mkdir( const char *path )
mkdir (path, 0777);
}
char *strlwr (char *s) {
if ( s==NULL ) { // bk001204 - paranoia
assert(0);
return s;
}
while (*s) {
*s = tolower(*s);
s++;
}
return s; // bk001204 - duh
}
//============================================
#define MAX_FOUND_FILES 0x1000
@ -334,3 +322,7 @@ char *Sys_GetCurrentUser( void )
}
return p->pw_name;
}
void QuickMemTest( void )
{
}

View File

@ -1271,7 +1271,7 @@ static qboolean GLW_LoadOpenGL( )
char buffer[1024];
qboolean cdsFullscreen;
strlwr( strcpy( buffer, OPENGL_DRIVER_NAME ) );
Q_strlwr( strcpy( buffer, OPENGL_DRIVER_NAME ) );
//
// load the driver and bind our function pointers to it
@ -1324,7 +1324,7 @@ void GLimp_EndFrame (void)
// don't flip if drawing to front buffer
if ( stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 )
if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 )
{
SwapBuffers( glw_state.hDC );
}
@ -1418,7 +1418,7 @@ void GLimp_Init( void )
// chipset specific configuration
//
Q_strncpyz( buf, glConfig.renderer_string, sizeof(buf) );
strlwr( buf );
Q_strlwr( buf );
//
// NOTE: if changing cvars, do it within this block. This allows them

View File

@ -718,7 +718,7 @@ static qboolean Sys_ScanForCD( void ) {
Result = GetVolumeInformation(drive,VolumeName,sizeof(VolumeName),&VolumeSerialNumber,
&MaximumComponentLength,&FileSystemFlags,FileSystemName,sizeof(FileSystemName));
if (Result && (strcmpi(VolumeName,"JEDIOUTCAST") == 0 ) )
if (Result && (Q_strcmpi(VolumeName,"JEDIOUTCAST") == 0 ) )
{
sprintf (test, "%s%s\\%s",drive, CD_BASEDIR, CD_EXE);
f = fopen( test, "r" );

View File

@ -1,7 +1,7 @@
Jedi Outcast with various changes to make it build/run on
more platforms including amd64/x86_64.
Currently only the single player code is built.
Currently only the single player code runs on amd64.
The game needs to be patched to 1.04 to work, the data in the
steam version is already patched.
@ -9,13 +9,22 @@ steam version is already patched.
The single player demo data also seems to be compatible
and runs seemingly fine.
How to build:
How to build single player:
mkdir build-sp && cd build-sp
cmake ../code/
make
copy jk2sp and jk2game*.so to your game data directory
copy jk2sp and jk2game*.so to the directory containing base or demo
How to build multiplayer:
mkdir build-mp && cd build-mp
cmake ../CODE-mp/
make
copy jk2mp and jk2mpded to the directory containing base
copy *.so to your base directory
Known issues: