diff --git a/README.txt b/README.txt index 8f54862..d4f824d 100644 --- a/README.txt +++ b/README.txt @@ -1,18 +1,27 @@ Jedi Academy 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.01 to work, the data in the steam version is already patched. - How to build: + How to build single player: mkdir build-sp && cd build-sp cmake ../code/ make -copy jasp and jagame*.so to your game data directory +copy jasp and jagame*.so to the directory containing base or demo + + How to build multiplayer: + +mkdir build-mp && cd build-mp +cmake ../codemp/ +make + +copy jamp and jampded to the directory containing base +copy *.so to your base directory Known issues: @@ -21,3 +30,5 @@ When running windowed the mouse does not work in the menus. Save games do not yet work on amd64. The demo has various issues and does not work properly. + +multiplayer has to be run with "+set sv_pure 0" for now diff --git a/codemp/CMakeLists.txt b/codemp/CMakeLists.txt new file mode 100644 index 0000000..aa308e4 --- /dev/null +++ b/codemp/CMakeLists.txt @@ -0,0 +1,605 @@ +cmake_minimum_required(VERSION 2.6) + +project(jamp) + +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_rmg + RMG/RM_Area.cpp + RMG/RM_Instance.cpp + RMG/RM_InstanceFile.cpp + RMG/RM_Instance_BSP.cpp + RMG/RM_Instance_Group.cpp + RMG/RM_Instance_Random.cpp + RMG/RM_Instance_Void.cpp + RMG/RM_Manager.cpp + RMG/RM_Mission.cpp + RMG/RM_Objective.cpp + RMG/RM_Path.cpp + RMG/RM_Terrain.cpp +) + +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_ambient.cpp + client/snd_dma.cpp + client/snd_mem.cpp + client/snd_mix.cpp + client/snd_mp3.cpp + client/snd_music.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_icarus + icarus/BlockStream.cpp + icarus/GameInterface.cpp + icarus/Instance.cpp + icarus/Interface.cpp + icarus/Memory.cpp + icarus/Q3_Interface.cpp + icarus/Q3_Registers.cpp + icarus/Sequence.cpp + icarus/Sequencer.cpp + icarus/TaskManager.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_qcommon_common + qcommon/CNetProfile.cpp + qcommon/GenericParser2.cpp + qcommon/RoffSystem.cpp + qcommon/cm_draw.cpp + qcommon/cm_load.cpp + qcommon/cm_patch.cpp + qcommon/cm_polylib.cpp + qcommon/cm_randomterrain.cpp + qcommon/cm_shader.cpp + qcommon/cm_terrain.cpp + qcommon/cm_test.cpp + qcommon/cm_trace.cpp + qcommon/cmd_common.cpp + qcommon/cmd_pc.cpp + qcommon/common.cpp + qcommon/cvar.cpp + qcommon/exe_headers.cpp + qcommon/files_common.cpp + qcommon/files_pc.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/stringed_ingame.cpp + qcommon/stringed_interface.cpp + qcommon/unzip.cpp + qcommon/vm.cpp + qcommon/vm_interpreted.cpp + qcommon/vm_x86.cpp + qcommon/z_memman_pc.cpp +) + +set(src_main_qcommon + ${src_qcommon_common} + qcommon/cm_terrainmap.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_arioche.cpp + renderer/tr_bsp.cpp + renderer/tr_cmds.cpp + renderer/tr_curve.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_terrain.cpp + renderer/tr_world.cpp +) + +set(src_main_server + server/NPCNav/gameCallbacks.cpp + server/NPCNav/navigator.cpp + 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 + zlib32/deflate.cpp + zlib32/inflate.cpp + zlib32/zipcommon.cpp +) + +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_rmg} + ${src_main_client} + ${src_main_ghoul2} + ${src_main_icarus} + ${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(jamp + ${src_jk2mp} +) + +set_target_properties(jamp PROPERTIES COMPILE_DEFINITIONS "_JK2EXE;_FF_DISABLE;BOTLIB") + +target_link_libraries(jamp + m pthread + X11 Xxf86vm Xxf86dga + openal +) + +if (CMAKE_SYSTEM_NAME MATCHES "Linux") + target_link_libraries(jamp 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_rmg} + ${src_main_ghoul2} + ${src_main_icarus} + ${src_qcommon_common} + ${src_renderer_common} + ${src_main_server} + ${src_main_zlib} + ${src_botlib} + ${src_unix_common} + ${src_ded_null} +) + +add_executable(jampded + ${src_jk2mp_ded} +) + +set_target_properties(jampded PROPERTIES COMPILE_DEFINITIONS "_JK2EXE;_FF_DISABLE;BOTLIB;DEDICATED") + +target_link_libraries(jampded + m pthread +) + +if (CMAKE_SYSTEM_NAME MATCHES "Linux") + target_link_libraries(jampded dl) +endif() + +set(src_ui_game + game/bg_lib.c + game/bg_misc.c + game/bg_saga.c + game/bg_vehicleLoad.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_saber.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_strap.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/AnimalNPC.c + game/bg_g2_utils.c + game/bg_lib.c + game/bg_misc.c + game/bg_panimate.c + game/bg_pmove.c + game/bg_saber.c + game/bg_saberLoad.c + game/bg_saga.c + game/bg_slidemove.c + game/bg_vehicleLoad.c + game/bg_weapons.c + game/FighterNPC.c + game/q_math.c + game/q_shared.c + game/SpeederNPC.c + game/WalkerNPC.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/AnimalNPC.c + game/FighterNPC.c + game/NPC.c + game/NPC_AI_Atst.c + game/NPC_AI_Default.c + game/NPC_AI_Droid.c + game/NPC_AI_GalakMech.c + game/NPC_AI_Grenadier.c + game/NPC_AI_Howler.c + game/NPC_AI_ImperialProbe.c + game/NPC_AI_Interrogator.c + game/NPC_AI_Jedi.c + game/NPC_AI_Mark1.c + game/NPC_AI_Mark2.c + game/NPC_AI_MineMonster.c + game/NPC_AI_Rancor.c + game/NPC_AI_Remote.c + game/NPC_AI_Seeker.c + game/NPC_AI_Sentry.c + game/NPC_AI_Sniper.c + game/NPC_AI_Stormtrooper.c + game/NPC_AI_Utils.c + game/NPC_AI_Wampa.c + game/NPC_behavior.c + game/NPC_combat.c + game/NPC_goal.c + game/NPC_misc.c + game/NPC_move.c + game/NPC_reactions.c + game/NPC_senses.c + game/NPC_sounds.c + game/NPC_spawn.c + game/NPC_stats.c + game/NPC_utils.c + game/SpeederNPC.c + game/WalkerNPC.c + game/ai_main.c + game/ai_util.c + game/ai_wpnav.c + game/bg_g2_utils.c + game/bg_lib.c + game/bg_misc.c + game/bg_panimate.c + game/bg_pmove.c + game/bg_saber.c + game/bg_saberLoad.c + game/bg_saga.c + game/bg_slidemove.c + game/bg_vehicleLoad.c + game/bg_weapons.c + game/g_ICARUScb.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_exphysics.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_nav.c + game/g_navnew.c + game/g_object.c + game/g_saga.c + game/g_session.c + game/g_spawn.c + game/g_strap.c + game/g_svcmds.c + game/g_syscalls.c + game/g_target.c + game/g_team.c + game/g_timer.c + game/g_trigger.c + game/g_turret.c + game/g_turret_G2.c + game/g_utils.c + game/g_vehicleTurret.c + game/g_vehicles.c + game/g_weapon.c + game/q_math.c + game/q_shared.c + game/tri_coll_test.c + game/w_force.c + game/w_saber.c +) + +add_library(jampgame${cpu} SHARED + ${src_game_game} +) + +set_target_properties(jampgame${cpu} PROPERTIES PREFIX "") +set_target_properties(jampgame${cpu} PROPERTIES COMPILE_DEFINITIONS "QAGAME;MISSIONPACK") diff --git a/codemp/RMG/RM_InstanceFile.cpp b/codemp/RMG/RM_InstanceFile.cpp index c8b2364..3e51a7a 100644 --- a/codemp/RMG/RM_InstanceFile.cpp +++ b/codemp/RMG/RM_InstanceFile.cpp @@ -149,30 +149,30 @@ CRMInstance* CRMInstanceFile::CreateInstance ( const char* name ) for ( group = mInstances; group; group = group->GetNext ( ) ) { // Skip it if the name doesnt match - if ( stricmp ( name, group->FindPairValue ( "name", "" ) ) ) + if ( Q_stricmp ( name, group->FindPairValue ( "name", "" ) ) ) { continue; } // Handle the various forms of instance types - if ( !stricmp ( group->GetName ( ), "bsp" ) ) + if ( !Q_stricmp ( group->GetName ( ), "bsp" ) ) { instance = new CRMBSPInstance ( group, *this ); } - else if ( !stricmp ( group->GetName ( ), "npc" ) ) + else if ( !Q_stricmp ( group->GetName ( ), "npc" ) ) { // instance = new CRMNPCInstance ( group, *this ); continue; } - else if ( !stricmp ( group->GetName ( ), "group" ) ) + else if ( !Q_stricmp ( group->GetName ( ), "group" ) ) { instance = new CRMGroupInstance ( group, *this ); } - else if ( !stricmp ( group->GetName ( ), "random" ) ) + else if ( !Q_stricmp ( group->GetName ( ), "random" ) ) { instance = new CRMRandomInstance ( group, *this ); } - else if ( !stricmp ( group->GetName ( ), "void" ) ) + else if ( !Q_stricmp ( group->GetName ( ), "void" ) ) { instance = new CRMVoidInstance ( group, *this ); } diff --git a/codemp/RMG/RM_Instance_Group.cpp b/codemp/RMG/RM_Instance_Group.cpp index c45bdd0..767c86f 100644 --- a/codemp/RMG/RM_Instance_Group.cpp +++ b/codemp/RMG/RM_Instance_Group.cpp @@ -61,7 +61,7 @@ CRMGroupInstance::CRMGroupInstance ( CGPGroup *instGroup, CRMInstanceFile& instF float maxrange; // Make sure only instances are specified as sub groups - assert ( 0 == stricmp ( instGroup->GetName ( ), "instance" ) ); + assert ( 0 == Q_stricmp ( instGroup->GetName ( ), "instance" ) ); // Grab the name name = instGroup->FindPairValue ( "name", "" ); diff --git a/codemp/RMG/RM_Instance_Random.cpp b/codemp/RMG/RM_Instance_Random.cpp index 0075f76..41e8b5b 100644 --- a/codemp/RMG/RM_Instance_Random.cpp +++ b/codemp/RMG/RM_Instance_Random.cpp @@ -39,7 +39,7 @@ CRMRandomInstance::CRMRandomInstance ( CGPGroup *instGroup, CRMInstanceFile& ins group = group->GetNext ( ) ) { // If this isnt an instance group then skip it - if ( stricmp ( group->GetName ( ), "instance" ) ) + if ( Q_stricmp ( group->GetName ( ), "instance" ) ) { continue; } diff --git a/codemp/RMG/RM_Manager.cpp b/codemp/RMG/RM_Manager.cpp index e124c93..f5e74f8 100644 --- a/codemp/RMG/RM_Manager.cpp +++ b/codemp/RMG/RM_Manager.cpp @@ -152,7 +152,7 @@ bool CRMManager::LoadMission ( qboolean IsServer ) if(Com_ParseTextFile(va("ext_data/rmg/%s.teams", temp), parser)) { root = parser.GetBaseParseGroup()->GetSubGroups(); - if (0 == stricmp(root->GetName(), "teams")) + if (0 == Q_stricmp(root->GetName(), "teams")) { /* SV_SetConfigstring( CS_GAMETYPE_REDTEAM, root->FindPairValue ( "red", "marine" )); @@ -280,7 +280,7 @@ void CRMManager::UpdateStatisticCvars ( void ) // show difficulty char difficulty[MAX_QPATH]; gi.Cvar_VariableStringBuffer("g_skill", difficulty, MAX_QPATH); - strupr(difficulty); + Q_strupr(difficulty); gi.Cvar_Set ( "ar_diff", va("&GENERIC_%s&",difficulty) ); // compute rank diff --git a/codemp/RMG/RM_Mission.cpp b/codemp/RMG/RM_Mission.cpp index 0efe806..9115906 100644 --- a/codemp/RMG/RM_Mission.cpp +++ b/codemp/RMG/RM_Mission.cpp @@ -132,7 +132,7 @@ CRMObjective* CRMMission::FindObjective ( const char* name ) for (it = mObjectives.begin(); it != mObjectives.end(); it++) { // Does it match? - if (!stricmp ((*it)->GetName(), name )) + if (!Q_stricmp ((*it)->GetName(), name )) { return (*it); } @@ -741,8 +741,8 @@ bool CRMMission::ParseInstancesOnPath ( CGPGroup* group ) for ( defenseGroup = group->GetSubGroups(); defenseGroup; defenseGroup=defenseGroup->GetNext() ) - if (stricmp ( defenseGroup->GetName ( ), "defenses" )==0 || - stricmp ( defenseGroup->GetName(), "instanceonpath")==0) + if (Q_stricmp ( defenseGroup->GetName ( ), "defenses" )==0 || + Q_stricmp ( defenseGroup->GetName(), "instanceonpath")==0) { const char* defName = defenseGroup->FindPairValue ( "instance", "" ); if ( *defName ) @@ -1200,7 +1200,7 @@ CGPGroup* CRMMission::ParseRandom ( CGPGroup* randomGroup ) group; group = group->GetNext ( ) ) { - if ( stricmp ( group->GetName ( ), "random_choice" ) ) + if ( Q_stricmp ( group->GetName ( ), "random_choice" ) ) { continue; } @@ -1377,7 +1377,7 @@ bool CRMMission::Load ( const char* mission, const char* instances, const char* // Grab the root parser groop and make sure its mission, otherwise this // isnt a valid mission file root = parser.GetBaseParseGroup()->GetSubGroups(); - if(stricmp(root->GetName(), "mission")) + if(Q_stricmp(root->GetName(), "mission")) { Com_Printf("ERROR: '%s' is not a valid mission file\n", mission ); parser.Clean(); diff --git a/codemp/RMG/RM_Objective.cpp b/codemp/RMG/RM_Objective.cpp index 88c9a20..078b984 100644 --- a/codemp/RMG/RM_Objective.cpp +++ b/codemp/RMG/RM_Objective.cpp @@ -87,7 +87,7 @@ CRMObjective::CRMObjective ( CGPGroup* group ) } // If the objective names dont match then ignore this trigger - if ( stricmp ( trigger->GetObjectiveName ( ), GetTrigger() ) ) + if ( Q_stricmp ( trigger->GetObjectiveName ( ), GetTrigger() ) ) { continue; } diff --git a/codemp/RMG/RM_Path.cpp b/codemp/RMG/RM_Path.cpp index db1ed16..9fdfa49 100644 --- a/codemp/RMG/RM_Path.cpp +++ b/codemp/RMG/RM_Path.cpp @@ -97,7 +97,7 @@ void CRMPathManager::CreateLocation ( const char* name, const int min_depth, int } for (i = mLocations.size()-1; i>=0; --i) - if ( !stricmp ( name, mLocations[i]->GetName ( ) ) ) + if ( !Q_stricmp ( name, mLocations[i]->GetName ( ) ) ) { mLocations[i]->SetMinDepth(min_depth); mLocations[i]->SetMaxDepth(max_depth); @@ -451,7 +451,7 @@ CRMNode* CRMPathManager::FindNodeByName ( const char* name ) for ( j = mNodes.size() - 1; j >=0; j-- ) { - if ( !stricmp ( name, mNodes[j]->GetName ( ) ) ) + if ( !Q_stricmp ( name, mNodes[j]->GetName ( ) ) ) return mNodes[j]; } return NULL; diff --git a/codemp/RMG/RM_Path.h b/codemp/RMG/RM_Path.h index a08fcf0..ab29391 100644 --- a/codemp/RMG/RM_Path.h +++ b/codemp/RMG/RM_Path.h @@ -18,6 +18,8 @@ #include "../qcommon/cm_randomterrain.h" #endif +#include + class CRMPathManager; // directions you can proceed from cells @@ -220,4 +222,4 @@ public: void GenerateRivers ( ); }; -#endif \ No newline at end of file +#endif diff --git a/codemp/RMG/RM_Terrain.cpp b/codemp/RMG/RM_Terrain.cpp index acef41c..fe532b9 100644 --- a/codemp/RMG/RM_Terrain.cpp +++ b/codemp/RMG/RM_Terrain.cpp @@ -85,7 +85,7 @@ void CRMLandScape::LoadMiscentDef(const char *td) items = classes->GetSubGroups(); while(items) { - if(!stricmp(items->GetName(), "miscent")) + if(!Q_stricmp(items->GetName(), "miscent")) { int height, maxheight; @@ -96,7 +96,7 @@ void CRMLandScape::LoadMiscentDef(const char *td) model = items->GetSubGroups(); while(model) { - if(!stricmp(model->GetName(), "model")) + if(!Q_stricmp(model->GetName(), "model")) { CRandomModel hd; @@ -109,19 +109,19 @@ void CRMLandScape::LoadMiscentDef(const char *td) pair = model->GetPairs(); while(pair) { - if(!stricmp(pair->GetName(), "name")) + if(!Q_stricmp(pair->GetName(), "name")) { hd.SetModel(pair->GetTopValue()); } - else if(!stricmp(pair->GetName(), "frequency")) + else if(!Q_stricmp(pair->GetName(), "frequency")) { hd.SetFrequency((float)atof(pair->GetTopValue())); } - else if(!stricmp(pair->GetName(), "minscale")) + else if(!Q_stricmp(pair->GetName(), "minscale")) { hd.SetMinScale((float)atof(pair->GetTopValue())); } - else if(!stricmp(pair->GetName(), "maxscale")) + else if(!Q_stricmp(pair->GetName(), "maxscale")) { hd.SetMaxScale((float)atof(pair->GetTopValue())); } @@ -345,7 +345,7 @@ void CRMLandScape::Sprinkle(CCMPatch *patch, CCGHeightDetails *hd, int level) // Get a number -5.3f to 5.3f density = (mDensityMap[px + (common->GetBlockWidth() * py)] - 128) / 24.0f; // ..and multiply that into the count - count = Round(common->GetPatchScalarSize() * hd->GetAverageFrequency() * powf(2.0f, density) * 0.001); + count = Round(common->GetPatchScalarSize() * hd->GetAverageFrequency() * Q_powf(2.0f, density) * 0.001); for(i = 0; i < count; i++) { diff --git a/codemp/Ratl/bits_vs.h b/codemp/Ratl/bits_vs.h index d0bde48..aea5d63 100644 --- a/codemp/Ratl/bits_vs.h +++ b/codemp/Ratl/bits_vs.h @@ -41,9 +41,9 @@ class bits_vs : public bits_base //////////////////////////////////////////////////////////////////////////////////// void clear_trailing_bits() { - for (int i=SIZE; iARRAY_SIZE*this->BITS_INT_SIZE; i++) { - mV[i>>BITS_SHIFT] &= ~(1<<(i&BITS_AND)); + this->mV[i>>this->BITS_SHIFT] &= ~(1<<(i&this->BITS_AND)); } } @@ -68,7 +68,7 @@ public: //////////////////////////////////////////////////////////////////////////////////// bits_vs(const bits_vs &B) { - mem::cpy(mV, B.mV,BYTE_SIZE); + mem::cpy(this->mV, B.mV,this->BYTE_SIZE); } //////////////////////////////////////////////////////////////////////////////////// @@ -76,7 +76,7 @@ public: //////////////////////////////////////////////////////////////////////////////////// bits_vs(const char* Str) { - clear(); + this->clear(); for (int b=0; bset_bit(b); // Found A True Bit } } } @@ -96,9 +96,9 @@ public: //////////////////////////////////////////////////////////////////////////////////////// bool empty() const { - for (int i=0; iARRAY_SIZE; i++) { - if (mV[i]) + if (this->mV[i]) { return false; } @@ -119,9 +119,9 @@ public: //////////////////////////////////////////////////////////////////////////////////////// void invert() { - for (int i=0; iARRAY_SIZE; i++) { - mV[i] = ~mV[i]; + this->mV[i] = ~this->mV[i]; } clear_trailing_bits(); } @@ -144,7 +144,7 @@ public: // of bits this object can hold. //-------------------------------------------- assert(i>=0 && i < SIZE); - return ( (mV[i>>BITS_SHIFT] & (1<<(i&BITS_AND)))!=0 ); + return ( (this->mV[i>>this->BITS_SHIFT] & (1<<(i&this->BITS_AND)))!=0 ); } //////////////////////////////////////////////////////////////////////////////////////// @@ -160,7 +160,7 @@ public: //////////////////////////////////////////////////////////////////////////////////////// bool operator==(const bits_vs &B) const { - return (mem::eql(mV, B.mV,BYTE_SIZE)); + return (mem::eql(this->mV, B.mV,this->BYTE_SIZE)); } //////////////////////////////////////////////////////////////////////////////////////// @@ -176,9 +176,9 @@ public: //////////////////////////////////////////////////////////////////////////////////////// void operator|=(const bits_vs &B) { - for (int i=0; iARRAY_SIZE; i++) { - mV[i] |= B.mV[i]; + this->mV[i] |= B.mV[i]; } } @@ -187,9 +187,9 @@ public: //////////////////////////////////////////////////////////////////////////////////////// void operator&=(const bits_vs &B) { - for (int i=0; iARRAY_SIZE; i++) { - mV[i] &= B.mV[i]; + this->mV[i] &= B.mV[i]; } } @@ -198,9 +198,9 @@ public: //////////////////////////////////////////////////////////////////////////////////////// void operator^=(const bits_vs &B) { - for (int i=0; iARRAY_SIZE; i++) { - mV[i] ^= B.mV[i]; + this->mV[i] ^= B.mV[i]; } } @@ -209,7 +209,7 @@ public: //////////////////////////////////////////////////////////////////////////////////////// void operator=(const bits_vs &B) { - mem::cpy(mV, B.mV,BYTE_SIZE); + mem::cpy(this->mV, B.mV,this->BYTE_SIZE); } }; diff --git a/codemp/Ratl/ratl_common.h b/codemp/Ratl/ratl_common.h index 33de96e..e3515e0 100644 --- a/codemp/Ratl/ratl_common.h +++ b/codemp/Ratl/ratl_common.h @@ -225,19 +225,19 @@ namespace str } inline int icmp(const char *s1,const char *s2) { - return stricmp(s1,s2); + return Q_stricmp(s1,s2); } inline int cmpi(const char *s1,const char *s2) { - return stricmp(s1,s2); + return Q_stricmp(s1,s2); } inline bool ieql(const char *s1,const char *s2) { - return !stricmp(s1,s2); + return !Q_stricmp(s1,s2); } inline bool eqli(const char *s1,const char *s2) { - return !stricmp(s1,s2); + return !Q_stricmp(s1,s2); } inline char *tok(char *s,const char *gap) @@ -1030,7 +1030,7 @@ public: //////////////////////////////////////////////////////////////////////////////////// // Data //////////////////////////////////////////////////////////////////////////////////// - typedef typename T TStorageTraits; + typedef T TStorageTraits; typedef typename T::TArray TTArray; typedef typename T::TValue TTValue; typedef typename T::TConstructed TTConstructed; @@ -1177,4 +1177,4 @@ public: }; } -#endif \ No newline at end of file +#endif diff --git a/codemp/Ratl/vector_vs.h b/codemp/Ratl/vector_vs.h index 5c33175..a9d18d3 100644 --- a/codemp/Ratl/vector_vs.h +++ b/codemp/Ratl/vector_vs.h @@ -38,7 +38,7 @@ template class vector_base : public ratl_base { public: - typedef typename T TStorageTraits; + typedef T TStorageTraits; typedef typename T::TValue TTValue; //////////////////////////////////////////////////////////////////////////////////// // Capacity Enum @@ -69,7 +69,7 @@ public: { mArray[i] = B.mArray[i]; } - mSize = val.mSize; + mSize = B.mSize; } //////////////////////////////////////////////////////////////////////////////////// diff --git a/codemp/Ravl/CVec.h b/codemp/Ravl/CVec.h index 2e35a9d..fcde227 100644 --- a/codemp/Ravl/CVec.h +++ b/codemp/Ravl/CVec.h @@ -592,7 +592,6 @@ public: float& pitch() {return v[0];} float& yaw() {return v[1];} float& roll() {return v[2];} - float& radius() {return v[3];} //////////////////////////////////////////////////////////////////////////////////// // Equality / Inequality Operators @@ -999,4 +998,4 @@ public: //}; -#endif \ No newline at end of file +#endif diff --git a/codemp/botlib/l_precomp.cpp b/codemp/botlib/l_precomp.cpp index b942d08..a5b5c04 100644 --- a/codemp/botlib/l_precomp.cpp +++ b/codemp/botlib/l_precomp.cpp @@ -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 { diff --git a/codemp/botlib/l_script.cpp b/codemp/botlib/l_script.cpp index 9b2d1f6..ea787d1 100644 --- a/codemp/botlib/l_script.cpp +++ b/codemp/botlib/l_script.cpp @@ -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] == '\'') { diff --git a/codemp/cgame/cg_consolecmds.c b/codemp/cgame/cg_consolecmds.c index d852383..a40c33c 100644 --- a/codemp/cgame/cg_consolecmds.c +++ b/codemp/cgame/cg_consolecmds.c @@ -5,7 +5,7 @@ #include "cg_local.h" #include "../ui/ui_shared.h" -#include "bg_saga.h" +#include "../game/bg_saga.h" extern menuDef_t *menuScoreboard; diff --git a/codemp/cgame/cg_draw.c b/codemp/cgame/cg_draw.c index 91aecd0..e950b40 100644 --- a/codemp/cgame/cg_draw.c +++ b/codemp/cgame/cg_draw.c @@ -5,7 +5,7 @@ #include "cg_local.h" -#include "bg_saga.h" +#include "../game/bg_saga.h" #include "../ui/ui_shared.h" #include "../ui/ui_public.h" @@ -6588,35 +6588,35 @@ static void CG_DrawVote(void) { else if (strncmp(cgs.voteString, "g_gametype", 10)==0) { trap_SP_GetStringTextString("MENUS_GAME_TYPE", sCmd, sizeof(sCmd) ); - if ( stricmp("Free For All", cgs.voteString+11)==0 ) + if ( Q_stricmp("Free For All", cgs.voteString+11)==0 ) { sParm = CG_GetStringEdString("MENUS", "FREE_FOR_ALL"); } - else if ( stricmp("Duel", cgs.voteString+11)==0 ) + else if ( Q_stricmp("Duel", cgs.voteString+11)==0 ) { sParm = CG_GetStringEdString("MENUS", "DUEL"); } - else if ( stricmp("Holocron FFA", cgs.voteString+11)==0 ) + else if ( Q_stricmp("Holocron FFA", cgs.voteString+11)==0 ) { sParm = CG_GetStringEdString("MENUS", "HOLOCRON_FFA"); } - else if ( stricmp("Power Duel", cgs.voteString+11)==0 ) + else if ( Q_stricmp("Power Duel", cgs.voteString+11)==0 ) { sParm = CG_GetStringEdString("MENUS", "POWERDUEL"); } - else if ( stricmp("Team FFA", cgs.voteString+11)==0 ) + else if ( Q_stricmp("Team FFA", cgs.voteString+11)==0 ) { sParm = CG_GetStringEdString("MENUS", "TEAM_FFA"); } - else if ( stricmp("Siege", cgs.voteString+11)==0 ) + else if ( Q_stricmp("Siege", cgs.voteString+11)==0 ) { sParm = CG_GetStringEdString("MENUS", "SIEGE"); } - else if ( stricmp("Capture the Flag", cgs.voteString+11)==0 ) + else if ( Q_stricmp("Capture the Flag", cgs.voteString+11)==0 ) { sParm = CG_GetStringEdString("MENUS", "CAPTURE_THE_FLAG"); } - else if ( stricmp("Capture the Ysalamiri", cgs.voteString+11)==0 ) + else if ( Q_stricmp("Capture the Ysalamiri", cgs.voteString+11)==0 ) { sParm = CG_GetStringEdString("MENUS", "CAPTURE_THE_YSALIMARI"); } diff --git a/codemp/cgame/cg_ents.c b/codemp/cgame/cg_ents.c index ba61750..4b8262c 100644 --- a/codemp/cgame/cg_ents.c +++ b/codemp/cgame/cg_ents.c @@ -7,7 +7,7 @@ Ghoul2 Insert Start */ #include "../game/q_shared.h" -#include "../ghoul2/g2.h" +#include "../ghoul2/G2.h" /* Ghoul2 Insert end */ diff --git a/codemp/cgame/cg_players.c b/codemp/cgame/cg_players.c index b8e3c73..39e32c5 100644 --- a/codemp/cgame/cg_players.c +++ b/codemp/cgame/cg_players.c @@ -2,8 +2,10 @@ // // cg_players.c -- handle the media and animation for player entities #include "cg_local.h" -#include "../ghoul2/g2.h" -#include "bg_saga.h" +#include "../ghoul2/G2.h" +#include "../game/bg_saga.h" + +#define max(x,y) ((x)>(y)?(x):(y)) extern vmCvar_t cg_thirdPersonAlpha; diff --git a/codemp/cgame/cg_saga.c b/codemp/cgame/cg_saga.c index 12aeca4..8e89045 100644 --- a/codemp/cgame/cg_saga.c +++ b/codemp/cgame/cg_saga.c @@ -10,7 +10,7 @@ * *****************************************************************************/ #include "cg_local.h" -#include "bg_saga.h" +#include "../game/bg_saga.h" int cgSiegeRoundState = 0; int cgSiegeRoundTime = 0; diff --git a/codemp/cgame/cg_servercmds.c b/codemp/cgame/cg_servercmds.c index b30e9f4..eac7d37 100644 --- a/codemp/cgame/cg_servercmds.c +++ b/codemp/cgame/cg_servercmds.c @@ -9,7 +9,7 @@ #if !defined(CL_LIGHT_H_INC) #include "cg_lights.h" #endif -#include "../ghoul2/g2.h" +#include "../ghoul2/G2.h" #include "../ui/ui_public.h" /* diff --git a/codemp/cgame/cg_turret.c b/codemp/cgame/cg_turret.c index 076ffad..ab2b0b2 100644 --- a/codemp/cgame/cg_turret.c +++ b/codemp/cgame/cg_turret.c @@ -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. diff --git a/codemp/cgame/cg_view.c b/codemp/cgame/cg_view.c index 0986a1f..342a096 100644 --- a/codemp/cgame/cg_view.c +++ b/codemp/cgame/cg_view.c @@ -4,7 +4,7 @@ // for a 3D rendering #include "cg_local.h" -#include "bg_saga.h" +#include "../game/bg_saga.h" #if !defined(CL_LIGHT_H_INC) #include "cg_lights.h" @@ -441,7 +441,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); @@ -528,7 +528,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); diff --git a/codemp/cgame/tr_types.h b/codemp/cgame/tr_types.h index 4c63979..170d4b2 100644 --- a/codemp/cgame/tr_types.h +++ b/codemp/cgame/tr_types.h @@ -327,7 +327,11 @@ typedef struct { #if !defined _WIN32 +#ifdef __linux__ +#define OPENGL_DRIVER_NAME "libGL.so.1" +#else #define OPENGL_DRIVER_NAME "libGL.so" +#endif #else diff --git a/codemp/client/FXExport.cpp b/codemp/client/FXExport.cpp index 79252d7..0e59039 100644 --- a/codemp/client/FXExport.cpp +++ b/codemp/client/FXExport.cpp @@ -2,7 +2,7 @@ #include "../qcommon/exe_headers.h" #include "client.h" -#include "FXScheduler.h" +#include "FxScheduler.h" //#define __FXCHECKER diff --git a/codemp/client/FxPrimitives.cpp b/codemp/client/FxPrimitives.cpp index a111f57..73659d1 100644 --- a/codemp/client/FxPrimitives.cpp +++ b/codemp/client/FxPrimitives.cpp @@ -424,6 +424,7 @@ inline int VectorToInt(vec3_t vec) { int tmp, retval; +#ifdef _MSVC_VER _asm { push edx @@ -447,6 +448,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); } diff --git a/codemp/client/FxPrimitives.h b/codemp/client/FxPrimitives.h index d2dac53..a380bf6 100644 --- a/codemp/client/FxPrimitives.h +++ b/codemp/client/FxPrimitives.h @@ -307,12 +307,12 @@ public: mGhoul2 = iGhoul2; mEntNum = entNum; mModelNum = modelNum; mBoltNum = boltNum; } - inline CParticle::CParticle(void) + inline CParticle(void) { mRefEnt.reType = RT_SPRITE; mEntNum = -1; mModelNum = -1; mBoltNum = -1; } - virtual CParticle::~CParticle(void) + virtual ~CParticle(void) { mGhoul2.kill(); //remove my model ref without actually deleting } @@ -608,4 +608,4 @@ public: }; -#endif //FX_PRIMITIVES_H_INC \ No newline at end of file +#endif //FX_PRIMITIVES_H_INC diff --git a/codemp/client/FxScheduler.cpp b/codemp/client/FxScheduler.cpp index 1bb9589..019b5f4 100644 --- a/codemp/client/FxScheduler.cpp +++ b/codemp/client/FxScheduler.cpp @@ -262,7 +262,7 @@ int CFxScheduler::RegisterEffect( const char *file, bool bHasCorrectPath /*= fal char sfile[MAX_QPATH]; COM_StripExtension( file, sfile ); - strlwr(sfile); + Q_strlwr(sfile); Com_DPrintf("Registering effect : %s\n", sfile); @@ -386,7 +386,7 @@ int CFxScheduler::ParseEffect( const char *file, CGPGroup *base ) if ((pair = base->GetPairs())!=0) { grpName = pair->GetName(); - if ( !stricmp( grpName, "repeatDelay" )) + if ( !Q_stricmp( grpName, "repeatDelay" )) { effect->mRepeatDelay = atoi(pair->GetTopValue()); } @@ -403,55 +403,55 @@ 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; } - else if ( !stricmp( grpName, "flash" )) + else if ( !Q_stricmp( grpName, "flash" )) { type = ScreenFlash; } @@ -645,7 +645,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]; @@ -904,7 +904,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 diff --git a/codemp/client/FxScheduler.h b/codemp/client/FxScheduler.h index 0f8dfe2..9b1a35f 100644 --- a/codemp/client/FxScheduler.h +++ b/codemp/client/FxScheduler.h @@ -354,7 +354,7 @@ struct SEffectTemplate bool operator == (const char * name) const { - return !stricmp( mEffectName, name ); + return !Q_stricmp( mEffectName, name ); } void operator=(const SEffectTemplate &that); }; diff --git a/codemp/client/FxSystem.h b/codemp/client/FxSystem.h index cfd1cb5..a072d86 100644 --- a/codemp/client/FxSystem.h +++ b/codemp/client/FxSystem.h @@ -215,7 +215,7 @@ public: } void CameraShake( vec3_t origin, float intensity, int radius, int time ); - qboolean SFxHelper::GetOriginAxisFromBolt(CGhoul2Info_v *pGhoul2, int mEntNum, int modelNum, int boltNum, vec3_t /*out*/origin, vec3_t /*out*/axis[3]); + qboolean GetOriginAxisFromBolt(CGhoul2Info_v *pGhoul2, int mEntNum, int modelNum, int boltNum, vec3_t /*out*/origin, vec3_t /*out*/axis[3]); }; extern SFxHelper theFxHelper; diff --git a/codemp/client/FxTemplate.cpp b/codemp/client/FxTemplate.cpp index 7ee3a25..99e5b62 100644 --- a/codemp/client/FxTemplate.cpp +++ b/codemp/client/FxTemplate.cpp @@ -276,23 +276,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; } @@ -719,73 +719,73 @@ 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; } //rww - begin g2 stuff - else if ( !stricmp( flag[i], "ghoul2Collision" )) + else if ( !Q_stricmp( flag[i], "ghoul2Collision" )) { mFlags |= (FX_GHOUL2_TRACE|FX_APPLY_PHYSICS|FX_EXPENSIVE_PHYSICS); } - else if ( !stricmp( flag[i], "ghoul2Decals" )) + else if ( !Q_stricmp( flag[i], "ghoul2Decals" )) { mFlags |= FX_GHOUL2_DECALS; } //rww - end - 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; } - else if ( !stricmp( flag[i], "paperPhysics" )) + else if ( !Q_stricmp( flag[i], "paperPhysics" )) { mFlags |= FX_PAPER_PHYSICS; //warning! shared flag. You use this with a cylinder and you can expect evilness to ensue } - else if ( !stricmp( flag[i], "localizedFlash" )) + else if ( !Q_stricmp( flag[i], "localizedFlash" )) { mFlags |= FX_LOCALIZED_FLASH; //warning! shared flag. You use this with a cylinder and you can expect evilness to ensue } - else if ( !stricmp( flag[i], "playerView" )) + else if ( !Q_stricmp( flag[i], "playerView" )) { mFlags |= FX_PLAYER_VIEW; //warning! shared flag. You use this with a cylinder and you can expect evilness to ensue } @@ -824,59 +824,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" )) // sphere/ellipsoid + else if ( !Q_stricmp( flag[i], "orgOnSphere" )) // sphere/ellipsoid { mSpawnFlags |= FX_ORG_ON_SPHERE; } - else if ( !stricmp( flag[i], "orgOnCylinder" )) // cylinder/disk + else if ( !Q_stricmp( flag[i], "orgOnCylinder" )) // cylinder/disk { 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; } @@ -893,7 +893,7 @@ bool CPrimitiveTemplate::ParseSpawnFlags( const char *val ) bool CPrimitiveTemplate::ParseMaterialImpact(const char *val) { - if (!stricmp(val, "shellsound")) + if (!Q_stricmp(val, "shellsound")) { mMatImpactFX = MATIMPACTFX_SHELLSOUND; } @@ -1942,19 +1942,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 ); } @@ -1996,19 +1996,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 ); } @@ -2050,19 +2050,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 ); } @@ -2104,19 +2104,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 ); } @@ -2158,19 +2158,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 ); } @@ -2206,128 +2206,128 @@ 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, "delay" )) + else if ( !Q_stricmp( key, "delay" )) { ParseDelay( val ); } - else if ( !stricmp( key, "cullrange" )) + else if ( !Q_stricmp( key, "cullrange" )) { // mCullRange = atoi( val ); // mCullRange *= mCullRange; // square it now so we don't have to square every time we compare } - 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" )) // part of ellipse/cylinder calcs. + else if ( !Q_stricmp( key, "radius" )) // part of ellipse/cylinder calcs. { ParseRadius( val ); } - else if ( !stricmp( key, "height" )) // part of ellipse/cylinder calcs. + else if ( !Q_stricmp( key, "height" )) // part of ellipse/cylinder calcs. { 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 ); } - else if ( !stricmp( key, "rotationDelta" )) + else if ( !Q_stricmp( key, "rotationDelta" )) { 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 ) { @@ -2335,7 +2335,7 @@ bool CPrimitiveTemplate::ParsePrimitive( CGPGroup *grp ) strcpy( mName, val ); } } - else if (!stricmp(key, "materialImpact")) + else if (!Q_stricmp(key, "materialImpact")) { ParseMaterialImpact(val); } @@ -2354,23 +2354,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 ); } diff --git a/codemp/client/cl_cgame.cpp b/codemp/client/cl_cgame.cpp index 6180af9..f869bcd 100644 --- a/codemp/client/cl_cgame.cpp +++ b/codemp/client/cl_cgame.cpp @@ -14,17 +14,17 @@ #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_ #include "../qcommon/INetProfile.h" #endif -#include "../renderer/tr_worldeffects.h" +#include "../renderer/tr_WorldEffects.h" #ifdef VV_LIGHTING #include "../renderer/tr_lightmanager.h" diff --git a/codemp/client/cl_cin.cpp b/codemp/client/cl_cin.cpp index 2777166..fe951d8 100644 --- a/codemp/client/cl_cin.cpp +++ b/codemp/client/cl_cin.cpp @@ -1194,7 +1194,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); diff --git a/codemp/client/cl_input.cpp b/codemp/client/cl_input.cpp index 6fc32b2..e420efb 100644 --- a/codemp/client/cl_input.cpp +++ b/codemp/client/cl_input.cpp @@ -1471,10 +1471,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 ); } } diff --git a/codemp/client/cl_keys.cpp b/codemp/client/cl_keys.cpp index 562ed66..4bb04df 100644 --- a/codemp/client/cl_keys.cpp +++ b/codemp/client/cl_keys.cpp @@ -1039,7 +1039,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; } diff --git a/codemp/client/cl_main.cpp b/codemp/client/cl_main.cpp index fd7d621..1dac58c 100644 --- a/codemp/client/cl_main.cpp +++ b/codemp/client/cl_main.cpp @@ -23,7 +23,7 @@ #endif #if !defined (MINIHEAP_H_INC) -#include "../qcommon/miniheap.h" +#include "../qcommon/MiniHeap.h" #endif #ifdef _DONETPROFILE_ diff --git a/codemp/client/cl_parse.cpp b/codemp/client/cl_parse.cpp index 52dee66..c3e883e 100644 --- a/codemp/client/cl_parse.cpp +++ b/codemp/client/cl_parse.cpp @@ -5,7 +5,7 @@ #include "client.h" #include "../qcommon/stringed_ingame.h" -#include "../ghoul2/g2_local.h" +#include "../ghoul2/G2_local.h" #ifdef _DONETPROFILE_ #include "../qcommon/INetProfile.h" #endif diff --git a/codemp/client/snd_ambient.cpp b/codemp/client/snd_ambient.cpp index 8bd59a0..cb84461 100644 --- a/codemp/client/snd_ambient.cpp +++ b/codemp/client/snd_ambient.cpp @@ -202,7 +202,7 @@ static int AS_GetSetNameIDForString( const char *name ) for ( int i = 0; i < NUM_AS_SETS; i++ ) { - if ( stricmp( name, setNames[i] ) == 0 ) + if ( Q_stricmp( name, setNames[i] ) == 0 ) return i; } @@ -223,7 +223,7 @@ static int AS_GetKeywordIDForString( const char *name ) for ( int i = 0; i < NUM_AS_KEYWORDS; i++ ) { - if ( stricmp( name, keywordNames[i] ) == 0 ) + if ( Q_stricmp( name, keywordNames[i] ) == 0 ) return i; } @@ -679,7 +679,7 @@ static void AS_ParseHeader( void ) case SET_KEYWORD_TYPE: sscanf( parseBuffer+parsePos, "%s %s", &tempBuffer, &typeBuffer ); - if ( !stricmp( (const char *) typeBuffer, "ambientSet" ) ) + if ( !Q_stricmp( (const char *) typeBuffer, "ambientSet" ) ) { return; } @@ -771,7 +771,7 @@ AS_AddPrecacheEntry void AS_AddPrecacheEntry( const char *name ) { - if (!stricmp(name,"#clear")) + if (!Q_stricmp(name,"#clear")) { pMap->clear(); } diff --git a/codemp/client/snd_dma.cpp b/codemp/client/snd_dma.cpp index 47e1850..ed9c7f5 100644 --- a/codemp/client/snd_dma.cpp +++ b/codemp/client/snd_dma.cpp @@ -12,6 +12,7 @@ #include "snd_mp3.h" #include "snd_music.h" #include "client.h" +#include "../qcommon/platform.h" qboolean s_shutUp = qfalse; @@ -210,7 +211,7 @@ int s_entityWavVol_back[MAX_GENTITIES]; #define DEFAULT_REF_DISTANCE 300.0f // Default reference distance #define DEFAULT_VOICE_REF_DISTANCE 1500.0f // Default voice reference distance -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 @@ -226,6 +227,7 @@ void S_SetLipSyncs(); // EAX Related +#ifdef HAVE_EAX typedef struct { ALuint ulNumApertures; @@ -307,6 +309,8 @@ const GUID EAX_PrimaryFXSlotID = { 0xf317866d, 0x924c, 0x450c, { 0x86, 0x1b, 0xe const GUID EAX_REVERB_EFFECT = { 0xcf95c8f, 0xa3cc, 0x4849, { 0xb0, 0xb6, 0x83, 0x2e, 0xcc, 0x18, 0x22, 0xdf} }; +#endif // HAVE_EAX + /**************************************************************************************************\ * * End of Open AL Specific @@ -369,10 +373,12 @@ void S_SoundInfo_f(void) { if (s_UseOpenAL) { +#ifdef HAVE_EAX Com_Printf("EAX 4.0 %s supported\n",s_bEAX?"is":"not"); Com_Printf("Eal file %s loaded\n",s_bEALFileLoaded?"is":"not"); Com_Printf("s_EnvironmentID = %d\n",s_EnvironmentID); Com_Printf("s_bInWater = %s\n",s_bInWater?"true":"false"); +#endif } else { @@ -453,7 +459,7 @@ void S_Init( void ) { s_CPUType = Cvar_Get("sys_cpuid","",0); -#if !(defined __linux__ && defined __i386__) +#ifdef _MSC_VER #if !id386 #else extern unsigned int uiMMXAvailable; @@ -477,13 +483,9 @@ void S_Init( void ) { Cmd_AddCommand("mp3_calcvols", S_MP3_CalcVols_f); Cmd_AddCommand("s_dynamic", S_SetDynamicMusic_f); - 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; @@ -512,7 +514,9 @@ void S_Init( void ) { alListenerfv(AL_VELOCITY,listenerVel); alListenerfv(AL_ORIENTATION,listenerOri); +#ifdef HAVE_EAX InitEAXManager(); +#endif memset(s_channels, 0, sizeof(s_channels)); @@ -536,6 +540,7 @@ void S_Init( void ) { // Sources / Channels are not sending to any Slots (other than the Listener / Primary FX Slot) s_channels[i].lSlotID = -1; +#ifdef HAVE_EAX if (s_bEAX) { // Remove the RoomAuto flag from each Source (to remove Reverb Engine Statistical @@ -548,6 +553,7 @@ void S_Init( void ) { s_eaxSet(&EAXPROPERTYID_EAX40_Source, EAXSOURCE_FLAGS, s_channels[i].alSource, &ulFlags, sizeof(ulFlags)); } +#endif s_numChannels++; } @@ -595,7 +601,9 @@ void S_Init( void ) { // for this level mapname = Cvar_VariableString( "mapname" ); +#ifdef HAVE_EAX EALFileInit(mapname); +#endif } else @@ -695,7 +703,9 @@ void S_Shutdown( void ) // Close device alcCloseDevice(ALCDevice); +#ifdef HAVE_EAX ReleaseEAXManager(); +#endif s_numChannels = 0; @@ -850,7 +860,7 @@ sfx_t *S_FindName( const char *name ) { sfx = &s_knownSfx[i]; memset (sfx, 0, sizeof(*sfx)); Q_strncpyz(sfx->sSoundName, sSoundNameNoExt, sizeof(sfx->sSoundName)); - strlwr(sfx->sSoundName);//force it down low + Q_strlwr(sfx->sSoundName);//force it down low sfx->next = sfxHash[hash]; sfxHash[hash] = sfx; @@ -904,6 +914,7 @@ void S_BeginRegistration( void ) s_soundMuted = qfalse; // we can play again +#ifdef HAVE_EAX // Find name of level so we can load in the appropriate EAL file if (s_UseOpenAL) { @@ -915,6 +926,7 @@ void S_BeginRegistration( void ) s_FXSlotInfo[i].lEnvID = -1; } } +#endif if (s_numSfx == 0) { SND_setup(); @@ -933,6 +945,7 @@ void S_BeginRegistration( void ) } +#ifdef HAVE_EAX void EALFileInit(char *level) { long lRoom; @@ -963,7 +976,7 @@ void EALFileInit(char *level) if (s_bEALFileLoaded) { - s_lLastEnvUpdate = timeGetTime(); + s_lLastEnvUpdate = Com_Milliseconds(); } else { @@ -979,6 +992,7 @@ void EALFileInit(char *level) } } } +#endif // HAVE_EAX @@ -2309,7 +2323,9 @@ void S_UpdateEntityPosition( int entityNum, const vec3_t origin ) pos[2] = -origin[1]; alSourcefv(s_channels[i].alSource, AL_POSITION, pos); +#ifdef HAVE_EAX UpdateEAXBuffer(ch); +#endif } /* pos[0] = origin[0]; @@ -2317,10 +2333,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) && !( ch->entchannel == CHAN_VOICE || ch->entchannel == CHAN_VOICE_ATTEN || ch->entchannel == CHAN_VOICE_GLOBAL ) ) { UpdateEAXBuffer(ch); } +#endif */ } } @@ -2463,8 +2481,10 @@ 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; EAXACTIVEFXSLOTS eaxActiveSlots; +#endif unsigned int ulEnvironment; int i; channel_t *ch; @@ -2488,7 +2508,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) { @@ -2560,6 +2580,7 @@ void S_Respatialize( int entityNum, const vec3_t head, vec3_t axis[3], int inwat } } } +#endif // HAVE_EAX } else { @@ -2897,8 +2918,10 @@ void S_Update_(void) { } } +#ifdef HAVE_EAX if (s_bEALFileLoaded) UpdateEAXBuffer(ch); +#endif int nBytesDecoded = 0; int nTotalBytesDecoded = 0; @@ -2981,7 +3004,7 @@ void S_Update_(void) { if (ch->thesfx->lipSyncData) { // Record start time for Lip-syncing - s_channels[source].iStartTime = timeGetTime(); + s_channels[source].iStartTime = Com_Milliseconds(); // Prepare lipsync value(s) s_entityWavVol[ ch->entnum ] = ch->thesfx->lipSyncData[0]; @@ -3015,7 +3038,7 @@ void S_Update_(void) { if (ch->thesfx->lipSyncData) { // Record start time for Lip-syncing - s_channels[source].iStartTime = timeGetTime(); + s_channels[source].iStartTime = Com_Milliseconds(); // Prepare lipsync value(s) s_entityWavVol[ ch->entnum ] = ch->thesfx->lipSyncData[0]; @@ -3338,8 +3361,10 @@ void UpdateLoopingSounds() ch->master_vol = loop->volume; alSourcef(s_channels[i].alSource, AL_GAIN, ((float)(ch->master_vol) * s_volume->value) / 255.f); +#ifdef HAVE_EAX if (s_bEALFileLoaded) UpdateEAXBuffer(ch); +#endif ch->bProcessed = true; loop->bProcessed = true; @@ -3412,8 +3437,10 @@ void UpdateLoopingSounds() alSourcef(s_channels[source].alSource, AL_GAIN, ((float)(ch->master_vol) * s_volume->value) / 255.0f); alSourcei(s_channels[source].alSource, AL_SOURCE_RELATIVE, ch->fixed_origin ? AL_TRUE : AL_FALSE); +#ifdef HAVE_EAX if (s_bEALFileLoaded) UpdateEAXBuffer(ch); +#endif alGetError(); alSourcePlay(s_channels[source].alSource); @@ -3464,7 +3491,9 @@ void AL_UpdateRawSamples() size = (s_rawend - s_paintedtime)<<2; if (size > (MAX_RAW_SAMPLES<<2)) { +#ifdef _DEBUG OutputDebugString("UpdateRawSamples :- Raw Sample buffer has overflowed !!!\n"); +#endif size = MAX_RAW_SAMPLES<<2; s_paintedtime = s_rawend - MAX_RAW_SAMPLES; } @@ -3587,7 +3616,7 @@ void S_SetLipSyncs() char szString[256]; #endif - currentTime = timeGetTime(); + currentTime = Com_Milliseconds(); memset(s_entityWavVol, 0, sizeof(s_entityWavVol)); @@ -3789,28 +3818,28 @@ void S_SoundList_f( void ) { if ( Cmd_Argc() == 2 ) { - if (!stricmp(Cmd_Argv(1), "shouldbeMP3")) + if (!Q_stricmp(Cmd_Argv(1), "shouldbeMP3")) { bShouldBeMP3 = qtrue; } else - if (!stricmp(Cmd_Argv(1), "wavonly")) + if (!Q_stricmp(Cmd_Argv(1), "wavonly")) { bWavOnly = qtrue; } else { - if (!stricmp(Cmd_Argv(1), "1")) + if (!Q_stricmp(Cmd_Argv(1), "1")) { iVariantCap = 1; } else - if (!stricmp(Cmd_Argv(1), "2")) + if (!Q_stricmp(Cmd_Argv(1), "2")) { iVariantCap = 2; } else - if (!stricmp(Cmd_Argv(1), "3")) + if (!Q_stricmp(Cmd_Argv(1), "3")) { iVariantCap = 3; } @@ -3861,7 +3890,7 @@ void S_SoundList_f( void ) { sfx_t *sfx2; for (sfx2 = s_knownSfx, i2=0 ; i2sSoundName)) + if (!Q_stricmp(sFindName,sfx2->sSoundName)) { bDumpThisOne = qfalse; // found a %1-variant of this, so use variant capping and ignore this sfx_t break; @@ -4549,7 +4578,8 @@ void S_StartBackgroundTrack( const char *intro, const char *loop, int bCalledByC { extern const char *Music_GetLevelSetName(void); Q_strncpyz(sInfoOnly_CurrentDynamicMusicSet, Music_GetLevelSetName(), sizeof(sInfoOnly_CurrentDynamicMusicSet)); - for (int i = eBGRNDTRACK_DATABEGIN; i != eBGRNDTRACK_DATAEND; i++) + int i; + for (i = eBGRNDTRACK_DATABEGIN; i != eBGRNDTRACK_DATAEND; i++) { sboolean bOk = qfalse; LPCSTR psMusicName = Music_GetFileNameForState( (MusicState_e) i); @@ -4994,7 +5024,7 @@ static void S_UpdateBackgroundTrack( void ) // standard / non-dynamic one-track music... // LPCSTR psCommand = S_Music_GetRequestedState(); // special check just for "silence" case... - sboolean bShouldBeSilent = (psCommand && !stricmp(psCommand,"silence")); + sboolean bShouldBeSilent = (psCommand && !Q_stricmp(psCommand,"silence")); float fDesiredVolume = bShouldBeSilent ? 0.0f : s_musicVolume->value; // // internal to this code is a volume-smoother... @@ -5184,7 +5214,8 @@ int SND_FreeOldestSound(sfx_t *pButNotThisOne /* = NULL */) { // new bit, we can't throw away any sfx_t struct in use by a channel, else the paint code will crash... // - for (int iChannel=0; iChannel +#include +#endif // Added for Open AL to know when to mute all sounds (e.g when app. loses focus) void S_AL_MuteAllSounds(sboolean bMute); diff --git a/codemp/client/snd_mem.cpp b/codemp/client/snd_mem.cpp index 2736d5c..0b3a511 100644 --- a/codemp/client/snd_mem.cpp +++ b/codemp/client/snd_mem.cpp @@ -7,6 +7,8 @@ #include "snd_mp3.h" #include "snd_ambient.h" +#include + // Open AL void S_PreProcessLipSync(sfx_t *sfx); extern int s_UseOpenAL; @@ -616,15 +618,15 @@ static sboolean 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" } @@ -700,7 +702,7 @@ static sboolean S_LoadSound_DirIsAllowedToKeepMP3s(const char *psFilename) int i; for (i=0; i< (sizeof(psAllowedDirs) / sizeof(psAllowedDirs[0])); i++) { - if (strnicmp(psFilename, psAllowedDirs[i], strlen(psAllowedDirs[i]))==0) + if (Q_strnicmp(psFilename, psAllowedDirs[i], strlen(psAllowedDirs[i]))==0) return qtrue; // found a dir that's allowed to keep MP3s } @@ -742,7 +744,7 @@ static sboolean S_LoadSound_Actual( sfx_t *sfx ) // make up a local filename to try wav/mp3 substitutes... // Q_strncpyz(sLoadName, sfx->sSoundName, sizeof(sLoadName)); - strlwr( sLoadName ); + Q_strlwr( sLoadName ); // // Ensure name has an extension (which it must have, but you never know), and get ptr to it... // @@ -763,7 +765,7 @@ static sboolean S_LoadSound_Actual( sfx_t *sfx ) SND_TouchSFX(sfx); //========= - if (strnicmp(psExt,".mp3",4)==0) + if (Q_strnicmp(psExt,".mp3",4)==0) { // load MP3 file instead... // diff --git a/codemp/client/snd_mix.cpp b/codemp/client/snd_mix.cpp index aebfdc1..80e1533 100644 --- a/codemp/client/snd_mix.cpp +++ b/codemp/client/snd_mix.cpp @@ -14,8 +14,7 @@ short *snd_out; -#if !(defined __linux__ && defined __i386__) -#if !id386 +#if !(defined(_MSC_VER) && defined(__i386__)) void S_WriteLinearBlastStereo16 (void) @@ -131,7 +130,6 @@ LExit: } #endif -#endif void S_TransferStereo16 (unsigned long *pbuf, int endtime) diff --git a/codemp/client/snd_music.cpp b/codemp/client/snd_music.cpp index 90e9b86..d3d1da0 100644 --- a/codemp/client/snd_music.cpp +++ b/codemp/client/snd_music.cpp @@ -8,6 +8,7 @@ #include "../game/q_shared.h" #include "../qcommon/sstring.h" +#include "../qcommon/platform.h" #pragma warning ( disable : 4663 ) //spcialize class #pragma warning( push, 3 ) @@ -22,6 +23,8 @@ //#include "snd_mp3.h" #endif +#include + // #include "snd_music.h" #include "snd_ambient.h" @@ -71,7 +74,7 @@ struct MusicExitTime_t // need to declare this way for operator < below // I'm defining this '<' operator so STL's sort algorithm will work // - bool operator < (const MusicExitTime_t& _X) const {return (fTime < _X.fTime);} + bool operator < (const MusicExitTime_t& _x) const {return (fTime < _x.fTime);} }; // it's possible for all 3 of these to be empty if it's boss or death music @@ -656,7 +659,7 @@ static sboolean Music_ParseLeveldata(const char *psLevelName) // kludge up an enum, only interested in boss or not at the moment, so... // - MusicState_e eMusicState = !stricmp(psMusicStateType,"boss") ? eBGRNDTRACK_BOSS : !stricmp(psMusicStateType,"death") ? eBGRNDTRACK_DEATH : eBGRNDTRACK_EXPLORE; + MusicState_e eMusicState = !Q_stricmp(psMusicStateType,"boss") ? eBGRNDTRACK_BOSS : !Q_stricmp(psMusicStateType,"death") ? eBGRNDTRACK_DEATH : eBGRNDTRACK_EXPLORE; if (!MusicFile.MusicExitTimes.empty()) { @@ -796,7 +799,7 @@ sboolean Music_DynamicDataAvailable(const char *psDynamicMusicLabel) { char sLevelName[MAX_QPATH]; Q_strncpyz(sLevelName,COM_SkipPath( const_cast( (psDynamicMusicLabel&&psDynamicMusicLabel[0])?psDynamicMusicLabel:gsLevelNameFromServer.c_str() ) ),sizeof(sLevelName)); - strlwr(sLevelName); + Q_strlwr(sLevelName); if (strlen(sLevelName)) // avoid error messages when there's no music waiting to be played and we try and restart it... { diff --git a/codemp/game/bg_panimate.c b/codemp/game/bg_panimate.c index d9aea11..223598c 100644 --- a/codemp/game/bg_panimate.c +++ b/codemp/game/bg_panimate.c @@ -1900,27 +1900,27 @@ void ParseAnimationEvtBlock(const char *aeb_filename, animevent_t *animEvents, a { break; } - if ( stricmp( token, "CHAN_VOICE_ATTEN" ) == 0 ) + if ( Q_stricmp( token, "CHAN_VOICE_ATTEN" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_VOICE_ATTEN; } - else if ( stricmp( token, "CHAN_VOICE_GLOBAL" ) == 0 ) + else if ( Q_stricmp( token, "CHAN_VOICE_GLOBAL" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_VOICE_GLOBAL; } - else if ( stricmp( token, "CHAN_ANNOUNCER" ) == 0 ) + else if ( Q_stricmp( token, "CHAN_ANNOUNCER" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_ANNOUNCER; } - else if ( stricmp( token, "CHAN_BODY" ) == 0 ) + else if ( Q_stricmp( token, "CHAN_BODY" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_BODY; } - else if ( stricmp( token, "CHAN_WEAPON" ) == 0 ) + else if ( Q_stricmp( token, "CHAN_WEAPON" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_WEAPON; } - else if ( stricmp( token, "CHAN_VOICE" ) == 0 ) + else if ( Q_stricmp( token, "CHAN_VOICE" ) == 0 ) { animEvents[curAnimEvent].eventData[AED_SOUNDCHANNEL] = CHAN_VOICE; } diff --git a/codemp/game/bg_pmove.c b/codemp/game/bg_pmove.c index 369d4d6..9a347ca 100644 --- a/codemp/game/bg_pmove.c +++ b/codemp/game/bg_pmove.c @@ -709,7 +709,6 @@ void BG_VehicleTurnRateForSpeed( Vehicle_t *pVeh, float speed, float *mPitchOver // Following couple things don't belong in the DLL namespace! #ifdef QAGAME -typedef struct gentity_s gentity_t; gentity_t *G_PlayEffectID(const int fxID, vec3_t org, vec3_t ang); #endif diff --git a/codemp/game/bg_public.h b/codemp/game/bg_public.h index aeb4cbc..111a066 100644 --- a/codemp/game/bg_public.h +++ b/codemp/game/bg_public.h @@ -420,7 +420,7 @@ extern int bgForcePowerCost[NUM_FORCE_POWERS][NUM_FORCE_POWER_LEVELS]; #define MAXTOUCH 32 -typedef struct bgEntity_s +struct bgEntity_s { entityState_t s; playerState_t *playerState; @@ -430,7 +430,7 @@ typedef struct bgEntity_s vec3_t modelScale; //needed for g2 collision //Data type(s) must directly correspond to the head of the gentity and centity structures -} bgEntity_t; +}; typedef struct { // state (in / out) diff --git a/codemp/game/bg_vehicles.h b/codemp/game/bg_vehicles.h index a386762..e4073de 100644 --- a/codemp/game/bg_vehicles.h +++ b/codemp/game/bg_vehicles.h @@ -474,7 +474,7 @@ typedef struct } vehTurretStatus_t; // This is the implementation of the vehicle interface and any of the other variables needed. This // is what actually represents a vehicle. -AReis. -typedef struct Vehicle_s +struct Vehicle_s { // The entity who pilots/drives this vehicle. // NOTE: This is redundant (since m_pParentEntity->owner _should_ be the pilot). This makes things clearer though. @@ -620,7 +620,7 @@ typedef struct Vehicle_s //the guy who was previously the pilot bgEntity_t * m_pOldPilot; -} Vehicle_t; +}; #include "../namespace_begin.h" extern int BG_VehicleGetIndex( const char *vehicleName ); diff --git a/codemp/game/g_ICARUScb.c b/codemp/game/g_ICARUScb.c index f46c4a1..6792df0 100644 --- a/codemp/game/g_ICARUScb.c +++ b/codemp/game/g_ICARUScb.c @@ -27,7 +27,6 @@ extern stringID_table_t BSTable[]; // so that we only get the C version of the includes (no full Icarus) in that // scenario, but I think we'll just try to leave this out instead. #ifndef _XBOX -#ifndef __linux__ enum { TK_EOF = -1, @@ -43,7 +42,6 @@ enum TK_USERDEF, }; #endif -#endif #include "../icarus/interpreter.h" diff --git a/codemp/game/g_items.c b/codemp/game/g_items.c index 2a314ad..eadcc52 100644 --- a/codemp/game/g_items.c +++ b/codemp/game/g_items.c @@ -2904,7 +2904,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; diff --git a/codemp/game/g_main.c b/codemp/game/g_main.c index afd6ac6..14ad529 100644 --- a/codemp/game/g_main.c +++ b/codemp/game/g_main.c @@ -509,9 +509,6 @@ This must be the very first function compiled into the .q3vm file ================ */ #include "../namespace_begin.h" -#ifdef __linux__ -extern "C" { -#endif int vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11 ) { switch ( command ) { case GAME_INIT: @@ -694,9 +691,6 @@ int vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int a return -1; } -#ifdef __linux__ -} -#endif #include "../namespace_end.h" @@ -4117,4 +4111,4 @@ const char *G_GetStringEdString(char *refSection, char *refName) static char text[1024]={0}; Com_sprintf(text, sizeof(text), "@@@%s", refName); return text; -} \ No newline at end of file +} diff --git a/codemp/game/g_public.h b/codemp/game/g_public.h index 6cb8686..203274d 100644 --- a/codemp/game/g_public.h +++ b/codemp/game/g_public.h @@ -6,6 +6,8 @@ #define G_PUBLIC_H +#include "../game/bg_vehicles.h" + #define Q3_INFINITE 16777216 #define GAME_API_VERSION 8 @@ -672,8 +674,6 @@ typedef struct #define MAX_FAILED_NODES 8 -typedef struct Vehicle_s Vehicle_t; - // the server looks at a sharedEntity, which is the start of the game's gentity_t structure //mod authors should not touch this struct typedef struct { diff --git a/codemp/game/g_syscalls.c b/codemp/game/g_syscalls.c index 5ab1dfe..9267f71 100644 --- a/codemp/game/g_syscalls.c +++ b/codemp/game/g_syscalls.c @@ -8,15 +8,9 @@ static int (QDECL *syscall)( int arg, ... ) = (int (QDECL *)( int, ...))-1; #include "../namespace_begin.h" -#ifdef __linux__ -extern "C" { -#endif void dllEntry( int (QDECL *syscallptr)( int arg,... ) ) { syscall = syscallptr; } -#ifdef __linux__ -} -#endif int PASSFLOAT( float x ) { float floatTemp; diff --git a/codemp/game/q_math.c b/codemp/game/q_math.c index 3e1ce48..d67f5bf 100644 --- a/codemp/game/q_math.c +++ b/codemp/game/q_math.c @@ -802,9 +802,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) { @@ -1103,7 +1101,6 @@ Lerror: } #pragma warning( default: 4035 ) -#endif #endif /* @@ -1473,7 +1470,7 @@ int Q_irand(int value1, int value2) return irand(value1, value2); } -float powf ( float x, int y ) +float Q_powf ( float x, int y ) { float r = x; for ( y--; y>0; y-- ) diff --git a/codemp/game/q_shared.h b/codemp/game/q_shared.h index f9bf59d..328d0dc 100644 --- a/codemp/game/q_shared.h +++ b/codemp/game/q_shared.h @@ -186,7 +186,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__ @@ -262,9 +261,6 @@ 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 @@ -304,11 +300,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 @@ -1239,7 +1280,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 ); @@ -1400,7 +1441,7 @@ typedef struct { #define VectorSet5(v,x,y,z,a,b) ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z), (v)[3]=(a), (v)[4]=(b)) //rwwRMG - added #define Vector4Copy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3]) -#ifdef __linux__ +#ifdef __GNUC__ #define SnapVector(v) {v[0]=((int)(v[0]));v[1]=((int)(v[1]));v[2]=((int)(v[2]));} #else #ifndef __LCC__ @@ -1710,6 +1751,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 ); diff --git a/codemp/ghoul2/G2_bolts.cpp b/codemp/ghoul2/G2_bolts.cpp index f682e1b..d498524 100644 --- a/codemp/ghoul2/G2_bolts.cpp +++ b/codemp/ghoul2/G2_bolts.cpp @@ -179,7 +179,7 @@ int G2_Add_Bolt(CGhoul2Info *ghlInfo, 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; } diff --git a/codemp/ghoul2/G2_bones.cpp b/codemp/ghoul2/G2_bones.cpp index a2cfce5..f8ce3db 100644 --- a/codemp/ghoul2/G2_bones.cpp +++ b/codemp/ghoul2/G2_bones.cpp @@ -58,7 +58,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; } @@ -87,7 +87,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; } @@ -116,7 +116,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; } @@ -1303,7 +1303,7 @@ int G2_Find_Bone_Rag(CGhoul2Info *ghlInfo, boneInfo_v &blist, const char *boneNa //skel = (mdxaSkel_t *)((byte *)aHeader + 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; } @@ -1653,11 +1653,11 @@ void G2_SetRagDoll(CGhoul2Info_v &ghoul2V,CRagDollParams *parms) #ifndef DEDICATED switch (parms->RagPhase) { - case CRagDollParams::ERagPhase::RP_START_DEATH_ANIM: + case CRagDollParams::RP_START_DEATH_ANIM: ghoul2.mFlags|=GHOUL2_RAG_PENDING; return; /// not doing anything with this yet break; - case CRagDollParams::ERagPhase::RP_END_DEATH_ANIM: + case CRagDollParams::RP_END_DEATH_ANIM: ghoul2.mFlags|=GHOUL2_RAG_PENDING|GHOUL2_RAG_DONE; if (broadsword_waitforshot && broadsword_waitforshot->integer) @@ -1676,7 +1676,7 @@ void G2_SetRagDoll(CGhoul2Info_v &ghoul2V,CRagDollParams *parms) } } break; - case CRagDollParams::ERagPhase::RP_DEATH_COLLISION: + case CRagDollParams::RP_DEATH_COLLISION: if (parms->collisionType) { ghoul2.mFlags|=GHOUL2_RAG_COLLISION_SLIDE; @@ -1695,7 +1695,7 @@ void G2_SetRagDoll(CGhoul2Info_v &ghoul2V,CRagDollParams *parms) } } break; - case CRagDollParams::ERagPhase::RP_CORPSE_SHOT: + case CRagDollParams::RP_CORPSE_SHOT: if (broadsword_kickorigin && broadsword_kickorigin->integer) { @@ -1730,14 +1730,14 @@ void G2_SetRagDoll(CGhoul2Info_v &ghoul2V,CRagDollParams *parms) } } break; - case CRagDollParams::ERagPhase::RP_GET_PELVIS_OFFSET: - if (parms->RagPhase==CRagDollParams::ERagPhase::RP_GET_PELVIS_OFFSET) + case CRagDollParams::RP_GET_PELVIS_OFFSET: + if (parms->RagPhase==CRagDollParams::RP_GET_PELVIS_OFFSET) { VectorClear(parms->pelvisAnglesOffset); VectorClear(parms->pelvisPositionOffset); } // intentional lack of a break - case CRagDollParams::ERagPhase::RP_SET_PELVIS_OFFSET: + case CRagDollParams::RP_SET_PELVIS_OFFSET: if (index>=0&&indexRagPhase==CRagDollParams::ERagPhase::RP_GET_PELVIS_OFFSET) + if (parms->RagPhase==CRagDollParams::RP_GET_PELVIS_OFFSET) { VectorCopy(bone.anglesOffset,parms->pelvisAnglesOffset); VectorCopy(bone.positionOffset,parms->pelvisPositionOffset); @@ -1760,7 +1760,7 @@ void G2_SetRagDoll(CGhoul2Info_v &ghoul2V,CRagDollParams *parms) } return; break; - case CRagDollParams::ERagPhase::RP_DISABLE_EFFECTORS: + case CRagDollParams::RP_DISABLE_EFFECTORS: // not doing anything with this yet return; break; @@ -4905,4 +4905,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)); -} \ No newline at end of file +} diff --git a/codemp/ghoul2/G2_misc.cpp b/codemp/ghoul2/G2_misc.cpp index cffebf5..223e92e 100644 --- a/codemp/ghoul2/G2_misc.cpp +++ b/codemp/ghoul2/G2_misc.cpp @@ -1825,7 +1825,7 @@ int G2_FindConfigStringSpace(char *name, int start, int max) { break; } - if ( !stricmp( s, name ) ) + if ( !Q_stricmp( s, name ) ) { return i; } diff --git a/codemp/ghoul2/G2_surfaces.cpp b/codemp/ghoul2/G2_surfaces.cpp index 1c12e93..b4ca129 100644 --- a/codemp/ghoul2/G2_surfaces.cpp +++ b/codemp/ghoul2/G2_surfaces.cpp @@ -71,7 +71,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; @@ -125,7 +125,7 @@ mdxmSurface_t *G2_FindSurface(CGhoul2Info *ghlInfo, 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) @@ -251,7 +251,7 @@ int G2_IsSurfaceOff (CGhoul2Info *ghlInfo, 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; } diff --git a/codemp/icarus/Instance.cpp b/codemp/icarus/Instance.cpp index 0f7a6e3..0ce707b 100644 --- a/codemp/icarus/Instance.cpp +++ b/codemp/icarus/Instance.cpp @@ -57,7 +57,7 @@ ICARUS_Instance *ICARUS_Instance::Create( interface_export_t *ie ) { ICARUS_Instance *instance = new ICARUS_Instance; instance->m_interface = ie; -#ifndef __linux__ +#ifdef _DEBUG OutputDebugString( "ICARUS Instance successfully created\n" ); #endif return instance; diff --git a/codemp/icarus/Interpreter.cpp b/codemp/icarus/Interpreter.cpp index 5fcb30b..cb89601 100644 --- a/codemp/icarus/Interpreter.cpp +++ b/codemp/icarus/Interpreter.cpp @@ -480,7 +480,7 @@ int CInterpreter::FindSymbol( const char *name, keywordArray_t *table) for (ids = table; (strcmp(ids->m_keyword, "")); ids++) { - if (!stricmp(name, ids->m_keyword)) + if (!Q_stricmp(name, ids->m_keyword)) return ids->m_tokenvalue; } diff --git a/codemp/icarus/Q3_Interface.cpp b/codemp/icarus/Q3_Interface.cpp index 5c08c44..4fb0310 100644 --- a/codemp/icarus/Q3_Interface.cpp +++ b/codemp/icarus/Q3_Interface.cpp @@ -492,7 +492,7 @@ static int Q3_Evaluate( int p1Type, const char *p1, int p2Type, const char *p2, case TK_STRING: case TK_IDENTIFIER: - return (int) !stricmp( c1, c2 ); //NOTENOTE: The script uses proper string comparison logic (ex. ( a == a ) == true ) + return (int) !Q_stricmp( c1, c2 ); //NOTENOTE: The script uses proper string comparison logic (ex. ( a == a ) == true ) break; default: @@ -592,7 +592,7 @@ static int Q3_Evaluate( int p1Type, const char *p1, int p2Type, const char *p2, case TK_STRING: case TK_IDENTIFIER: - return (int) stricmp( c1, c2 ); + return (int) Q_stricmp( c1, c2 ); break; default: diff --git a/codemp/icarus/Sequencer.cpp b/codemp/icarus/Sequencer.cpp index 239f13c..851ab80 100644 --- a/codemp/icarus/Sequencer.cpp +++ b/codemp/icarus/Sequencer.cpp @@ -2278,7 +2278,7 @@ int CSequencer::DestroySequence( CSequence *sequence ) { if((*tsi).second == sequence) { - tsi = m_taskSequences.erase(tsi); + m_taskSequences.erase(tsi++); } else { diff --git a/codemp/icarus/Tokenizer.cpp b/codemp/icarus/Tokenizer.cpp index 297a724..e1c9573 100644 --- a/codemp/icarus/Tokenizer.cpp +++ b/codemp/icarus/Tokenizer.cpp @@ -2071,7 +2071,7 @@ CToken* CTokenizer::TokenFromName(LPCTSTR name) { while (m_keywords[i].m_tokenvalue != TK_EOF) { - if (stricmp(m_keywords[i].m_keyword, name) == 0) + if (Q_stricmp(m_keywords[i].m_keyword, name) == 0) { return CUserToken::Create(m_keywords[i].m_tokenvalue, name); } @@ -2834,4 +2834,4 @@ CSymbolLookup* CSymbolLookup::GetChild() CSymbolLookup* CSymbolLookup::GetParent() { return m_parent; -} \ No newline at end of file +} diff --git a/codemp/icarus/icarus.h b/codemp/icarus/icarus.h index 845534b..26686ad 100644 --- a/codemp/icarus/icarus.h +++ b/codemp/icarus/icarus.h @@ -5,6 +5,9 @@ #ifndef __ICARUS__ #define __ICARUS__ +extern void *ICARUS_Malloc(int iSize); +extern void ICARUS_Free(void *pMem); + #include "../game/g_public.h" #pragma warning( disable : 4786 ) // identifier was truncated @@ -25,8 +28,4 @@ #pragma warning( pop ) //restore - -extern void *ICARUS_Malloc(int iSize); -extern void ICARUS_Free(void *pMem); - #endif //__ICARUS__ diff --git a/codemp/icarus/taskmanager.h b/codemp/icarus/taskmanager.h index 17d0a8b..9594c43 100644 --- a/codemp/icarus/taskmanager.h +++ b/codemp/icarus/taskmanager.h @@ -4,6 +4,7 @@ #define __TASK_MANAGER__ #include +#include #include "sequencer.h" class CSequencer; diff --git a/codemp/jpeg-6/jinclude.h b/codemp/jpeg-6/jinclude.h index eadcd19..f0a859b 100644 --- a/codemp/jpeg-6/jinclude.h +++ b/codemp/jpeg-6/jinclude.h @@ -70,6 +70,11 @@ #include +#ifndef WIN32 +#include +typedef int32_t INT32; +#endif + /* * We need memory copying and zeroing functions, plus strncpy(). * ANSI and System V implementations declare these in . diff --git a/codemp/mp3code/l3.h b/codemp/mp3code/L3.h similarity index 100% rename from codemp/mp3code/l3.h rename to codemp/mp3code/L3.h diff --git a/codemp/mp3code/csbtl3.c b/codemp/mp3code/csbtL3.c similarity index 100% rename from codemp/mp3code/csbtl3.c rename to codemp/mp3code/csbtL3.c diff --git a/codemp/mp3code/cupl1.c b/codemp/mp3code/cupL1.c similarity index 100% rename from codemp/mp3code/cupl1.c rename to codemp/mp3code/cupL1.c diff --git a/codemp/mp3code/mp3struct.h b/codemp/mp3code/mp3struct.h index 6431442..4494d50 100644 --- a/codemp/mp3code/mp3struct.h +++ b/codemp/mp3code/mp3struct.h @@ -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); diff --git a/codemp/mp3code/towave.c b/codemp/mp3code/towave.c index 1c7e8f5..8558561 100644 --- a/codemp/mp3code/towave.c +++ b/codemp/mp3code/towave.c @@ -151,13 +151,6 @@ decode (standard decoder) reduction_code: #include "mp3struct.h" #include - -#ifndef byte -typedef unsigned char byte; -#endif - - - typedef struct id3v1_1 { char id[3]; char title[30]; // diff --git a/codemp/null/null_glimp.cpp b/codemp/null/null_glimp.cpp index 64c1ee8..5162f90 100644 --- a/codemp/null/null_glimp.cpp +++ b/codemp/null/null_glimp.cpp @@ -1,6 +1,6 @@ #include "../game/q_shared.h" #include "../renderer/tr_local.h" -#ifdef __linux__ +#ifndef _WIN32 typedef unsigned int GLenum; #endif diff --git a/codemp/null/null_snddma.cpp b/codemp/null/null_snddma.cpp index 4542f2b..4193144 100644 --- a/codemp/null/null_snddma.cpp +++ b/codemp/null/null_snddma.cpp @@ -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; -} \ No newline at end of file +} +#endif diff --git a/codemp/qcommon/GenericParser2.cpp b/codemp/qcommon/GenericParser2.cpp index f5e00a9..e6b65ff 100644 --- a/codemp/qcommon/GenericParser2.cpp +++ b/codemp/qcommon/GenericParser2.cpp @@ -667,7 +667,7 @@ CGPGroup *CGPGroup::FindSubGroup(const char *name) group = mSubGroups; while(group) { - if(!stricmp(name, group->GetName())) + if(!Q_stricmp(name, group->GetName())) { return(group); } diff --git a/codemp/qcommon/RoffSystem.cpp b/codemp/qcommon/RoffSystem.cpp index b8e62be..d44f0aa 100644 --- a/codemp/qcommon/RoffSystem.cpp +++ b/codemp/qcommon/RoffSystem.cpp @@ -414,15 +414,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" ); diff --git a/codemp/qcommon/cm_draw.cpp b/codemp/qcommon/cm_draw.cpp index cd18238..961358c 100644 --- a/codemp/qcommon/cm_draw.cpp +++ b/codemp/qcommon/cm_draw.cpp @@ -550,7 +550,7 @@ void CDraw32::DrawLineAANC(long x0, long y0, long x1, long y1, CPixel32 color) // Y-major line; calculate 16-bit fixed-point fractional part of a // pixel that X advances each time Y advances 1 pixel, truncating the // result so that we won't overrun the endpoint along the X axis - unsigned short ErrorAdj = unsigned short + unsigned short ErrorAdj = (unsigned short) (((unsigned long) DeltaX << 16) / (unsigned long) DeltaY); // Draw all pixels other than the first and last @@ -582,7 +582,7 @@ void CDraw32::DrawLineAANC(long x0, long y0, long x1, long y1, CPixel32 color) // It's an X-major line; calculate 16-bit fixed-point fractional part of a // pixel that Y advances each time X advances 1 pixel, truncating the // result to avoid overrunning the endpoint along the X axis - unsigned short ErrorAdj = unsigned short + unsigned short ErrorAdj = (unsigned short) (((unsigned long) DeltaY << 16) / (unsigned long) DeltaX); // Draw all pixels other than the first and last while (--DeltaX) diff --git a/codemp/qcommon/cm_draw.h b/codemp/qcommon/cm_draw.h index 647bc5b..67bf860 100644 --- a/codemp/qcommon/cm_draw.h +++ b/codemp/qcommon/cm_draw.h @@ -36,6 +36,13 @@ #define CEILING(a) \ ((a)==(int)(a) ? (a) : (a)>0 ? 1+(int)(a) : -(1+(int)(-a))) +#ifndef WIN32 +typedef struct { + int x; + int y; +} POINT; +#endif + #include #endif diff --git a/codemp/qcommon/cm_load.cpp b/codemp/qcommon/cm_load.cpp index 85d8333..121a30a 100644 --- a/codemp/qcommon/cm_load.cpp +++ b/codemp/qcommon/cm_load.cpp @@ -1089,7 +1089,7 @@ int CM_LoadSubBSP(const char *name, qboolean clientload) count = cmg.numSubModels; for(i = 0; i < NumSubBSP; i++) { - if (!stricmp(name, SubBSP[i].name)) + if (!Q_stricmp(name, SubBSP[i].name)) { return count; } diff --git a/codemp/qcommon/cm_load_xbox.cpp b/codemp/qcommon/cm_load_xbox.cpp index 070d9de..9739157 100644 --- a/codemp/qcommon/cm_load_xbox.cpp +++ b/codemp/qcommon/cm_load_xbox.cpp @@ -1027,7 +1027,7 @@ int CM_LoadSubBSP(const char *name, qboolean clientload) count = cmg.numSubModels; for(i = 0; i < NumSubBSP; i++) { - if (!stricmp(name, SubBSP[i].name)) + if (!Q_stricmp(name, SubBSP[i].name)) { return count; } diff --git a/codemp/qcommon/cm_terrain.cpp b/codemp/qcommon/cm_terrain.cpp index 79e0123..75781c9 100644 --- a/codemp/qcommon/cm_terrain.cpp +++ b/codemp/qcommon/cm_terrain.cpp @@ -64,7 +64,7 @@ void CCMLandScape::LoadTerrainDef(const char *td) items = classes->GetSubGroups(); while(items) { - if(!stricmp(items->GetName(), "altitudetexture")) + if(!Q_stricmp(items->GetName(), "altitudetexture")) { int height; const char *shaderName; @@ -84,7 +84,7 @@ void CCMLandScape::LoadTerrainDef(const char *td) } } } - else if(!stricmp(items->GetName(), "water")) + else if(!Q_stricmp(items->GetName(), "water")) { const char *shaderName; CCMShader *shader; diff --git a/codemp/qcommon/common.cpp b/codemp/qcommon/common.cpp index 5411b8a..23fc2ab 100644 --- a/codemp/qcommon/common.cpp +++ b/codemp/qcommon/common.cpp @@ -231,10 +231,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 } @@ -1809,8 +1807,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) { @@ -2121,7 +2118,6 @@ skipClamp: } } -#endif #endif // bk001208 - memset/memcpy assembly, Q_acos needed (RC4) //------------------------------------------------------------------------ diff --git a/codemp/qcommon/files.cpp b/codemp/qcommon/files.cpp index 68493de..8ac91be 100644 --- a/codemp/qcommon/files.cpp +++ b/codemp/qcommon/files.cpp @@ -1038,7 +1038,7 @@ static bool Sys_FileOutOfDate( LPCSTR psFinalFileName /* dest */, LPCSTR psDataF static bool FS_FileCacheable(const char* const filename) { - return( strchr(filename, '/') && strnicmp(filename, "ext_data/", 9) ); + return( strchr(filename, '/') && Q_strnicmp(filename, "ext_data/", 9) ); } /* diff --git a/codemp/qcommon/files_console.cpp b/codemp/qcommon/files_console.cpp index 941db4a..8487965 100644 --- a/codemp/qcommon/files_console.cpp +++ b/codemp/qcommon/files_console.cpp @@ -787,7 +787,7 @@ static int FS_AddFileToList( char *name, char *list[MAX_FOUND_FILES], int nfiles return nfiles; } for ( i = 0 ; i < nfiles ; i++ ) { - if ( !stricmp( name, list[i] ) ) { + if ( !Q_stricmp( name, list[i] ) ) { return nfiles; // allready in list } } @@ -898,7 +898,7 @@ static int FS_AddFileToListBuf( char *name, char *listbuf, int bufsize, int nfil p = listbuf; while ( *p ) { - if ( !stricmp( name, p ) ) { + if ( !Q_stricmp( name, p ) ) { return nfiles; // already in list } p += strlen( p ) + 1; diff --git a/codemp/qcommon/files_pc.cpp b/codemp/qcommon/files_pc.cpp index bf2ac2c..0c9c099 100644 --- a/codemp/qcommon/files_pc.cpp +++ b/codemp/qcommon/files_pc.cpp @@ -563,7 +563,7 @@ fileHandle_t FS_FOpenFileAppend( const char *filename ) { return f; } -#ifndef __linux__ +#ifdef _WIN32 bool Sys_GetFileTime(LPCSTR psFileName, FILETIME &ft) { @@ -629,7 +629,7 @@ bool Sys_FileOutOfDate( LPCSTR psFinalFileName /* dest */, LPCSTR psDataFileName return false; } -#endif // !__linux__ +#endif // _WIN32 bool FS_FileCacheable(const char* const filename) { @@ -894,7 +894,7 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueF && Q_stricmp( filename + l - 4, ".dat" ) ) { // for journal files fs_fakeChkSum = random(); } -#ifndef __linux__ +#ifdef _WIN32 // if running with fs_copyfiles 2, and search path == local, then we need to fail to open // if the time/date stamp != the network version (so it'll loop round again and use the network path, // which comes later in the search order) @@ -917,7 +917,7 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueF dir->path, dir->gamedir ); } -#ifndef __linux__ +#ifdef _WIN32 // if we are getting it from the cdpath, optionally copy it // to the basepath if ( fs_copyfiles->integer && !Q_stricmp( dir->path, fs_cdpath->string ) ) { diff --git a/codemp/qcommon/platform.h b/codemp/qcommon/platform.h index 1517b28..7705a69 100644 --- a/codemp/qcommon/platform.h +++ b/codemp/qcommon/platform.h @@ -8,9 +8,7 @@ #if defined(_WINDOWS) #include -#endif - -#if defined (__linux__) +#else typedef const char *LPCTSTR; typedef const char *LPCSTR; typedef unsigned long DWORD; diff --git a/codemp/qcommon/qcommon.h b/codemp/qcommon/qcommon.h index 8a83e82..8618f64 100644 --- a/codemp/qcommon/qcommon.h +++ b/codemp/qcommon/qcommon.h @@ -977,7 +977,7 @@ void Sys_Log( const char *file, const void *buffer, int size, bool flush ); // any game related timing information should come from event timestamps int Sys_Milliseconds (bool baseTime = false); -#if __linux__ +#ifndef _MSVC_VER extern "C" void Sys_SnapVector( float *v ); #else diff --git a/codemp/qcommon/stringed_ingame.cpp b/codemp/qcommon/stringed_ingame.cpp index 488c0a0..88b761a 100644 --- a/codemp/qcommon/stringed_ingame.cpp +++ b/codemp/qcommon/stringed_ingame.cpp @@ -242,7 +242,7 @@ void CStringEdPackage::SetupNewFileParse( LPCSTR psFileName, SE_BOOL bLoadDebug m_strCurrentFileRef_ParseOnly = sString; // eg "OBJECTIVES" m_strLoadingLanguage_ParseOnly = ExtractLanguageFromPath( psFileName ); - m_bLoadingEnglish_ParseOnly = (!stricmp( m_strLoadingLanguage_ParseOnly.c_str(), "english" )) ? SE_TRUE : SE_FALSE; + m_bLoadingEnglish_ParseOnly = (!Q_stricmp( m_strLoadingLanguage_ParseOnly.c_str(), "english" )) ? SE_TRUE : SE_FALSE; m_bLoadDebug = bLoadDebug; } @@ -493,13 +493,13 @@ static char *CopeWithDumbStringData( LPCSTR psSentence, LPCSTR psThisLanguage ) // Ok, bollocks to it, this will have to do. Any other languages that come later and have bugs in their text can // get fixed by them typing it in properly in the first place... // - if (!stricmp(psThisLanguage,"ENGLISH") || - !stricmp(psThisLanguage,"FRENCH") || - !stricmp(psThisLanguage,"GERMAN") || - !stricmp(psThisLanguage,"ITALIAN") || - !stricmp(psThisLanguage,"SPANISH") || - !stricmp(psThisLanguage,"POLISH") || - !stricmp(psThisLanguage,"RUSSIAN") + if (!Q_stricmp(psThisLanguage,"ENGLISH") || + !Q_stricmp(psThisLanguage,"FRENCH") || + !Q_stricmp(psThisLanguage,"GERMAN") || + !Q_stricmp(psThisLanguage,"ITALIAN") || + !Q_stricmp(psThisLanguage,"SPANISH") || + !Q_stricmp(psThisLanguage,"POLISH") || + !Q_stricmp(psThisLanguage,"RUSSIAN") ) { char *p; @@ -690,7 +690,7 @@ LPCSTR CStringEdPackage::ParseLine( LPCSTR psLine ) { // if loading a foreign language... // - SE_BOOL bSentenceIsEnglish = (!stricmp(sThisLanguage,"english")) ? SE_TRUE: SE_FALSE; // see whether this is the english master or not + SE_BOOL bSentenceIsEnglish = (!Q_stricmp(sThisLanguage,"english")) ? SE_TRUE: SE_FALSE; // see whether this is the english master or not // this check can be omitted, I'm just being extra careful here... // @@ -698,7 +698,7 @@ LPCSTR CStringEdPackage::ParseLine( LPCSTR psLine ) { // basically this is just checking that an .STE file override is the same language as the .STR... // - if (stricmp( m_strLoadingLanguage_ParseOnly.c_str(), sThisLanguage )) + if (Q_stricmp( m_strLoadingLanguage_ParseOnly.c_str(), sThisLanguage )) { psErrorMessage = va("Language \"%s\" found when expecting \"%s\"!\n", sThisLanguage, m_strLoadingLanguage_ParseOnly.c_str()); } @@ -797,7 +797,7 @@ void CStringEdPackage::SetString( LPCSTR psLocalReference, LPCSTR psNewString, S { // then this is foreign text (so check for "#same" resolving)... // - if (!stricmp(psNewString, sSE_EXPORT_SAME)) + if (!Q_stricmp(psNewString, sSE_EXPORT_SAME)) { Entry.m_strString = m_strCurrentEntryEnglish_ParseOnly; // foreign "#same" is now english if (m_bLoadDebug) @@ -896,7 +896,7 @@ static LPCSTR SE_GetFoundFile( string &strResult ) strResult.erase(); } -// strlwr(sTemp); // just for consistancy and set<> -> set<> erasure checking etc +// Q_strlwr(sTemp); // just for consistancy and set<> -> set<> erasure checking etc return sTemp; } @@ -1100,7 +1100,7 @@ int SE_GetNumLanguages(void) // if english is available, it should always be first... ( I suppose ) // - if (!stricmp(psLanguage,"english")) + if (!Q_stricmp(psLanguage,"english")) { gvLanguagesAvailable.insert( gvLanguagesAvailable.begin(), psLanguage ); } @@ -1228,7 +1228,7 @@ LPCSTR SE_LoadLanguage( LPCSTR psLanguage, SE_BOOL bLoadDebug /* = SE_TRUE */ ) { LPCSTR psThisLang = TheStringPackage.ExtractLanguageFromPath( p ); - if ( !stricmp( psLanguage, psThisLang ) ) + if ( !Q_stricmp( psLanguage, psThisLang ) ) { psErrorMessage = SE_Load( p, bLoadDebug ); } diff --git a/codemp/qcommon/timing.h b/codemp/qcommon/timing.h index ddee390..09b2f1f 100644 --- a/codemp/qcommon/timing.h +++ b/codemp/qcommon/timing.h @@ -2,8 +2,8 @@ class timing_c { private: - __int64 start; - __int64 end; + int64_t start; + int64_t end; int reset; public: @@ -12,7 +12,8 @@ public: } void Start() { - const __int64 *s = &start; +#ifdef _MSVC_VER + const int64_t *s = &start; __asm { push eax @@ -28,12 +29,15 @@ public: pop ebx pop eax } +#else + asm("rdtsc" : "=A"(start)); +#endif } int End() { - const __int64 *e = &end; - __int64 time; -#ifndef __linux__ + int64_t time; +#ifdef _MSVC_VER + const int64_t *e = &end; __asm { push eax @@ -49,6 +53,8 @@ public: pop ebx pop eax } +#else + asm("rdtsc" : "=A"(time)); #endif time = end - start; if (time < 0) @@ -58,4 +64,4 @@ public: return((int)time); } }; -// end \ No newline at end of file +// end diff --git a/codemp/qcommon/vm_x86.cpp b/codemp/qcommon/vm_x86.cpp index 41e497c..a1f500b 100644 --- a/codemp/qcommon/vm_x86.cpp +++ b/codemp/qcommon/vm_x86.cpp @@ -67,7 +67,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; diff --git a/codemp/renderer/mdx_format.h b/codemp/renderer/mdx_format.h index 95df8e2..d0f6294 100644 --- a/codemp/renderer/mdx_format.h +++ b/codemp/renderer/mdx_format.h @@ -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 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 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 diff --git a/codemp/renderer/qgl.h b/codemp/renderer/qgl.h index 979c868..0482734 100644 --- a/codemp/renderer/qgl.h +++ b/codemp/renderer/qgl.h @@ -24,7 +24,7 @@ #include "macosx_glimp.h" -#elif defined( __linux__ ) +#else #include #include @@ -33,18 +33,6 @@ #include #endif -#elif defined( __FreeBSD__ ) // rb010123 - -#include -#include -#if defined(__FX__) -#include -#endif - -#else - -#include - #endif #ifndef APIENTRY @@ -182,7 +170,7 @@ extern PFNGLGETCOMBINEROUTPUTPARAMETERIVNV qglGetCombinerOutputParameterivNV; extern PFNGLGETFINALCOMBINERINPUTPARAMETERFVNV qglGetFinalCombinerInputParameterfvNV; extern PFNGLGETFINALCOMBINERINPUTPARAMETERIVNV qglGetFinalCombinerInputParameterivNV; - +#ifdef _WIN32 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Pixel Format extension definitions. - AReis /***********************************************************************************************************/ @@ -251,6 +239,7 @@ typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, con extern PFNWGLBINDTEXIMAGEARBPROC qwglBindTexImageARB; extern PFNWGLRELEASETEXIMAGEARBPROC qwglReleaseTexImageARB; extern PFNWGLSETPBUFFERATTRIBARBPROC qwglSetPbufferAttribARB; +#endif // _WIN32 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -350,12 +339,7 @@ extern void ( APIENTRY * qglTexSubImage3DEXT) (GLenum, GLint, GLint, GLint, GLin //=========================================================================== -// 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" @@ -727,9 +711,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) @@ -754,4 +736,4 @@ extern void (*qglXSwapBuffers)( Display *dpy, GLXDrawable drawable ); #endif // _WIN32 && __linux__ -#endif \ No newline at end of file +#endif diff --git a/codemp/renderer/tr_WorldEffects.cpp b/codemp/renderer/tr_WorldEffects.cpp index 61cd75d..10a763a 100644 --- a/codemp/renderer/tr_WorldEffects.cpp +++ b/codemp/renderer/tr_WorldEffects.cpp @@ -1608,7 +1608,7 @@ void R_WorldEffectCommand(const char *command) //Die - clean up the whole weather system -rww - if (strcmpi(token, "die") == 0) + if (Q_strcmpi(token, "die") == 0) { R_ShutdownWorldEffects(); return; @@ -1616,7 +1616,7 @@ void R_WorldEffectCommand(const char *command) // Clear - Removes All Particle Clouds And Wind Zones //---------------------------------------------------- - else if (strcmpi(token, "clear") == 0) + else if (Q_strcmpi(token, "clear") == 0) { for (int p=0; pparms.color[0] = 1.0f; out->parms.color[1] = 0.0f; out->parms.color[2] = 0.0f; - out->parms.color[3] = 0.0f; out->parms.depthForOpaque = 250.0f; } else diff --git a/codemp/renderer/tr_font.cpp b/codemp/renderer/tr_font.cpp index 236a68b..f596129 100644 --- a/codemp/renderer/tr_font.cpp +++ b/codemp/renderer/tr_font.cpp @@ -590,7 +590,8 @@ static int Thai_ValidTISCode( const byte *psString, int &iThaiBytes ) // thai codes can be up to 3 bytes long, so see how high we can get... // - for (int i=0; i<3; i++) + int i; + for (i=0; i<3; i++) { CodeToTry.sChars[i] = psString[i]; @@ -1669,9 +1670,11 @@ void R_ReloadFonts_f(void) // vector vstrFonts; - for (int iFontToFind = 1; iFontToFind < g_iCurrentFontIndex; iFontToFind++) + int iFontToFind; + for (iFontToFind = 1; iFontToFind < g_iCurrentFontIndex; iFontToFind++) { - for (FontIndexMap_t::iterator it = g_mapFontIndexes.begin(); it != g_mapFontIndexes.end(); ++it) + FontIndexMap_t::iterator it; + for (it = g_mapFontIndexes.begin(); it != g_mapFontIndexes.end(); ++it) { if (iFontToFind == (*it).second) { diff --git a/codemp/renderer/tr_ghoul2.cpp b/codemp/renderer/tr_ghoul2.cpp index b1684bc..4082729 100644 --- a/codemp/renderer/tr_ghoul2.cpp +++ b/codemp/renderer/tr_ghoul2.cpp @@ -7,7 +7,7 @@ #include "../client/client.h" //FIXME!! EVIL - just include the definitions needed #ifdef _XBOX -#include "../qcommon/miniheap.h" +#include "../qcommon/MiniHeap.h" #endif #if !defined(TR_LOCAL_H) diff --git a/codemp/renderer/tr_image.cpp b/codemp/renderer/tr_image.cpp index 6b96f6b..ddb1b22 100644 --- a/codemp/renderer/tr_image.cpp +++ b/codemp/renderer/tr_image.cpp @@ -7,6 +7,8 @@ #include "glext.h" #endif +#include "../qcommon/platform.h" + #pragma warning (push, 3) //go back down to 3 for the stl include #include #pragma warning (pop) @@ -588,7 +590,7 @@ static void Upload32( unsigned *data, qboolean isLightmap, qboolean allowTC, int *pformat, - USHORT *pUploadWidth, USHORT *pUploadHeight, bool bRectangle = false ) + unsigned short *pUploadWidth, unsigned short *pUploadHeight, bool bRectangle = false ) { GLuint uiTarget = GL_TEXTURE_2D; if ( bRectangle ) @@ -794,7 +796,7 @@ static void Upload32_3D( unsigned *data, qboolean isLightmap, qboolean allowTC, int *pformat, - USHORT *pUploadWidth, USHORT *pUploadHeight ) + unsigned short *pUploadWidth, unsigned short *pUploadHeight ) { int samples; int i, c; @@ -1015,15 +1017,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 } } @@ -1119,14 +1114,8 @@ qboolean RE_RegisterImages_LevelLoadEnd(void) Com_DPrintf (S_COLOR_RED "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 } } } @@ -2953,9 +2942,6 @@ SKINS ============================================================================ */ -static char *CommaParse( char **data_p ); -//can't be dec'd here since we need it for non-dedicated builds now as well. - /* =============== RE_RegisterSkin @@ -2966,9 +2952,10 @@ RE_RegisterSkin #endif // !DEDICATED bool gServerSkinHack = false; +static char *CommaParse( char **data_p ); +//can't be dec'd here since we need it for non-dedicated builds now as well. shader_t *R_FindServerShader( const char *name, const int *lightmapIndex, const byte *styles, qboolean mipRawImage ); -char *CommaParse( char **data_p ); /* =============== RE_SplitSkins diff --git a/codemp/renderer/tr_init.cpp b/codemp/renderer/tr_init.cpp index 3e07a05..63fae51 100644 --- a/codemp/renderer/tr_init.cpp +++ b/codemp/renderer/tr_init.cpp @@ -251,6 +251,7 @@ PFNGLGETCOMBINEROUTPUTPARAMETERIVNV qglGetCombinerOutputParameterivNV = NULL; PFNGLGETFINALCOMBINERINPUTPARAMETERFVNV qglGetFinalCombinerInputParameterfvNV = NULL; PFNGLGETFINALCOMBINERINPUTPARAMETERIVNV qglGetFinalCombinerInputParameterivNV = NULL; +#ifdef _WIN32 // Declare Pixel Format function pointers. PFNWGLGETPIXELFORMATATTRIBIVARBPROC qwglGetPixelFormatAttribivARB = NULL; PFNWGLGETPIXELFORMATATTRIBFVARBPROC qwglGetPixelFormatAttribfvARB = NULL; @@ -267,6 +268,7 @@ PFNWGLQUERYPBUFFERARBPROC qwglQueryPbufferARB = NULL; PFNWGLBINDTEXIMAGEARBPROC qwglBindTexImageARB = NULL; PFNWGLRELEASETEXIMAGEARBPROC qwglReleaseTexImageARB = NULL; PFNWGLSETPBUFFERATTRIBARBPROC qwglSetPbufferAttribARB = NULL; +#endif // _WIN32 // Declare Vertex and Fragment Program function pointers. PFNGLPROGRAMSTRINGARBPROC qglProgramStringARB = NULL; @@ -327,7 +329,7 @@ void R_Splash() #ifndef _XBOX image_t *pImage; /* const char* s = Cvar_VariableString("se_language"); - if (stricmp(s,"english")) + if (Q_stricmp(s,"english")) { pImage = R_FindImageFile( "menu/splash_eur", qfalse, qfalse, qfalse, GL_CLAMP); } @@ -864,6 +866,27 @@ void GL_SetDefaultState( void ) #endif } +/* +================ +R_PrintLongString + +Workaround for VID_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) ); + Com_Printf( "%s", buffer ); + p += 4095; + size -= 4095; + } +} /* ================ @@ -896,7 +919,9 @@ void GfxInfo_f( void ) Com_Printf ("\nGL_VENDOR: %s\n", glConfig.vendor_string ); Com_Printf ("GL_RENDERER: %s\n", glConfig.renderer_string ); Com_Printf ("GL_VERSION: %s\n", glConfig.version_string ); - Com_Printf ("GL_EXTENSIONS: %s\n", glConfig.extensions_string ); + Com_Printf ("GL_EXTENSIONS: " ); + R_PrintLongString( glConfig.extensions_string ); + Com_Printf ("\n"); Com_Printf ("GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize ); Com_Printf ("GL_MAX_ACTIVE_TEXTURES_ARB: %d\n", glConfig.maxActiveTextures ); Com_Printf ("\nPIXELFORMAT: color(%d-bits) Z(%d-bit) stencil(%d-bits)\n", glConfig.colorBits, glConfig.depthBits, glConfig.stencilBits ); diff --git a/codemp/renderer/tr_local.h b/codemp/renderer/tr_local.h index 53d0112..9a26184 100644 --- a/codemp/renderer/tr_local.h +++ b/codemp/renderer/tr_local.h @@ -28,7 +28,7 @@ typedef unsigned int glIndex_t; #endif // fast float to int conversion -#if id386 && !( (defined __linux__ || defined __FreeBSD__ ) && (defined __i386__ ) ) // rb010123 +#if (defined(_MSVC_VER) && defined(id386)) inline long myftol( float f ); #else #define myftol(x) ((int)(x)) @@ -117,7 +117,7 @@ typedef struct { #ifdef _XBOX typedef struct image_s { int imgCode; - USHORT width, height; // source image + unsigned short width, height; // source image GLuint texnum; // gl texture binding int internalFormat; @@ -135,7 +135,7 @@ typedef struct image_s { typedef struct image_s { char imgName[MAX_QPATH]; // game path, including extension - USHORT width, height; // after power of two and picmip but not including clamp to MAX_TEXTURE_SIZE + unsigned short width, height; // after power of two and picmip but not including clamp to MAX_TEXTURE_SIZE GLuint texnum; // gl texture binding int frameUsed; // for texture usage in frame statistics @@ -1156,6 +1156,7 @@ void R_Modellist_f (void); class CPBUFFER { private: +#ifdef _WIN32 // Pixel Buffer Rendering and Device Contexts. HGLRC m_hRC; HDC m_hDC; @@ -1166,6 +1167,7 @@ private: // Buffer handle. HPBUFFERARB m_hBuffer; +#endif // Buffer Dimensions. int m_iWidth, m_iHeight; @@ -1882,7 +1884,11 @@ struct shaderCommands_s bool fading; }; #ifndef DEDICATED +#ifdef _MSC_VER typedef __declspec(align(16)) shaderCommands_s shaderCommands_t; +#else +typedef __attribute__((aligned(16))) shaderCommands_s shaderCommands_t; +#endif extern shaderCommands_t tess; #endif extern color4ub_t styleColors[MAX_LIGHT_STYLES]; diff --git a/codemp/renderer/tr_main.cpp b/codemp/renderer/tr_main.cpp index c6a0cab..1a898c5 100644 --- a/codemp/renderer/tr_main.cpp +++ b/codemp/renderer/tr_main.cpp @@ -7,7 +7,7 @@ // Yeah, this might be kind of bad, but no linux version is planned so far :-) - AReis // Gee- thanks guys - jdrews, the linux porter... #ifndef _XBOX -#ifndef __linux__ +#ifdef _WIN32 #include "../win32/glw_win.h" #endif #endif diff --git a/codemp/renderer/tr_model.cpp b/codemp/renderer/tr_model.cpp index 2bfcf6f..0b25507 100644 --- a/codemp/renderer/tr_model.cpp +++ b/codemp/renderer/tr_model.cpp @@ -7,6 +7,7 @@ #include "../qcommon/disablewarnings.h" +#include "../qcommon/platform.h" #pragma warning (push, 3) //go back down to 3 for the stl include #include "../qcommon/sstring.h" // #include @@ -385,18 +386,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(); } @@ -435,7 +426,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... // @@ -445,18 +436,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 } } } @@ -499,7 +480,6 @@ static void RE_RegisterModels_DeleteAll(void) return; //argh! } -#ifndef __linux__ for (CachedModels_t::iterator itModel = CachedModels->begin(); itModel != CachedModels->end(); ) { CachedEndianedModelBinary_t &CachedModel = (*itModel).second; @@ -508,11 +488,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 } diff --git a/codemp/renderer/tr_quicksprite.cpp b/codemp/renderer/tr_quicksprite.cpp index 1ab7d41..9fe9517 100644 --- a/codemp/renderer/tr_quicksprite.cpp +++ b/codemp/renderer/tr_quicksprite.cpp @@ -7,7 +7,7 @@ //#include "../server/exe_headers.h" #include "tr_local.h" -#include "tr_QuickSprite.h" +#include "tr_quicksprite.h" void R_BindAnimatedImage( textureBundle_t *bundle ); diff --git a/codemp/renderer/tr_scene.cpp b/codemp/renderer/tr_scene.cpp index e1cd86e..e8718d5 100644 --- a/codemp/renderer/tr_scene.cpp +++ b/codemp/renderer/tr_scene.cpp @@ -7,7 +7,7 @@ #include "../ghoul2/G2.h" #endif #include "../ghoul2/G2_local.h" -#include "MatComp.h" +#include "matcomp.h" #ifdef VV_LIGHTING #include "tr_lightmanager.h" diff --git a/codemp/renderer/tr_shade.cpp b/codemp/renderer/tr_shade.cpp index c0bd714..f100646 100644 --- a/codemp/renderer/tr_shade.cpp +++ b/codemp/renderer/tr_shade.cpp @@ -11,7 +11,7 @@ #include "../win32/win_lighteffects.h" #endif -#include "tr_QuickSprite.h" +#include "tr_quicksprite.h" /* diff --git a/codemp/renderer/tr_shade_calc.cpp b/codemp/renderer/tr_shade_calc.cpp index b2977eb..a10f6bd 100644 --- a/codemp/renderer/tr_shade_calc.cpp +++ b/codemp/renderer/tr_shade_calc.cpp @@ -692,7 +692,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 ) @@ -1206,7 +1206,7 @@ void RB_CalcRotateTexCoords( float degsPerSecond, float *st ) -#if id386 && !( (defined __linux__ || defined __FreeBSD__ ) && (defined __i386__ ) ) // rb010123 +#if (defined(_MSVC_VER) && defined(id386)) #pragma warning (disable: 4035)//no return value inline long myftol( float f ) { static int tmp; diff --git a/codemp/renderer/tr_surfacesprites.cpp b/codemp/renderer/tr_surfacesprites.cpp index 24b5d64..0b5fad7 100644 --- a/codemp/renderer/tr_surfacesprites.cpp +++ b/codemp/renderer/tr_surfacesprites.cpp @@ -5,7 +5,7 @@ #include "tr_local.h" -#include "tr_QuickSprite.h" +#include "tr_quicksprite.h" #include "tr_WorldEffects.h" diff --git a/codemp/renderer/tr_terrain.cpp b/codemp/renderer/tr_terrain.cpp index bb79092..6f2c19a 100644 --- a/codemp/renderer/tr_terrain.cpp +++ b/codemp/renderer/tr_terrain.cpp @@ -445,7 +445,7 @@ void CTRLandScape::CalculateLighting(void) // Both normalised, so -1.0 < dp < 1.0 dp = Com_Clampi(0.0f, 1.0f, DotProduct(direction, total)); - dp = powf(dp, 3); + dp = Q_powf(dp, 3); VectorScale(ambient, (1.0 - dp) * 0.5, ambient); VectorMA(ambient, dp, directed, tint); @@ -539,7 +539,7 @@ void CTRLandScape::LoadTerrainDef(const char *td) { const char* type = items->GetName ( ); - if(!stricmp( type, "altitudetexture")) + if(!Q_stricmp( type, "altitudetexture")) { int height; const char *shaderName; @@ -559,11 +559,11 @@ void CTRLandScape::LoadTerrainDef(const char *td) } } } - else if(!stricmp(type, "water")) + else if(!Q_stricmp(type, "water")) { mWaterShader = R_GetShaderByHandle(RE_RegisterShader(items->FindPairValue("shader", ""))); } - else if(!stricmp(type, "flattexture")) + else if(!Q_stricmp(type, "flattexture")) { mFlatShader = RE_RegisterShader ( items->FindPairValue("shader", "") ); } @@ -798,7 +798,7 @@ void CTRLandScape::CalculateShaders(void) // Cleanup our temporary array delete[] shaders; - qsort(mSortedPatches, mSortedCount, sizeof(*mSortedPatches), (int (__cdecl *)(const void *,const void *))ComparePatchInfo); + qsort(mSortedPatches, mSortedCount, sizeof(*mSortedPatches), (int (QDECL *)(const void *,const void *))ComparePatchInfo); #endif // PRE_RELEASE_DEMO } diff --git a/codemp/ui/ui_main.c b/codemp/ui/ui_main.c index 19c6e45..ba5f06f 100644 --- a/codemp/ui/ui_main.c +++ b/codemp/ui/ui_main.c @@ -21,6 +21,10 @@ USER INTERFACE MAIN #include "../cgame/holocronicons.h" +#ifndef min +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif + extern void UI_SaberAttachToChar( itemDef_t *item ); char *forcepowerDesc[NUM_FORCE_POWERS] = @@ -5650,7 +5654,7 @@ static void UI_GetCharacterCvars ( void ) for (i = 0; i < uiInfo.playerSpeciesCount; i++) { - if ( !stricmp(model, uiInfo.playerSpecies[i].Name) ) + if ( !Q_stricmp(model, uiInfo.playerSpecies[i].Name) ) { uiInfo.playerSpeciesIndex = i; break; @@ -5662,7 +5666,7 @@ static void UI_GetCharacterCvars ( void ) model = UI_Cvar_VariableString ( "ui_char_model" ); for (i = 0; i < uiInfo.playerSpeciesCount; i++) { - if ( !stricmp(model, uiInfo.playerSpecies[i].Name) ) + if ( !Q_stricmp(model, uiInfo.playerSpecies[i].Name) ) { uiInfo.playerSpeciesIndex = i; return; //FOUND IT, don't fall through @@ -8634,7 +8638,7 @@ static int UI_FeederCount(float feederID) for (i=0;i< WP_NUM_WEAPONS;i++) { trap_Cvar_VariableStringBuffer( va("ui_class_weapon%i", i), info, sizeof(info) ); - if (stricmp(info,"gfx/2d/select")!=0) + if (Q_stricmp(info,"gfx/2d/select")!=0) { count++; } @@ -8649,8 +8653,8 @@ static int UI_FeederCount(float feederID) { trap_Cvar_VariableStringBuffer( va("ui_class_item%i", i), info, sizeof(info) ); // A hack so health and ammo dispenser icons don't show up. - if ((stricmp(info,"gfx/2d/select")!=0) && (stricmp(info,"gfx/hud/i_icon_healthdisp")!=0) && - (stricmp(info,"gfx/hud/i_icon_ammodisp")!=0)) + if ((Q_stricmp(info,"gfx/2d/select")!=0) && (Q_stricmp(info,"gfx/hud/i_icon_healthdisp")!=0) && + (Q_stricmp(info,"gfx/hud/i_icon_ammodisp")!=0)) { count++; } @@ -8663,7 +8667,7 @@ static int UI_FeederCount(float feederID) for (i=0;i< NUM_FORCE_POWERS;i++) { trap_Cvar_VariableStringBuffer( va("ui_class_power%i", i), info, sizeof(info) ); - if (stricmp(info,"gfx/2d/select")!=0) + if (Q_stricmp(info,"gfx/2d/select")!=0) { count++; } @@ -9358,7 +9362,7 @@ static qhandle_t UI_FeederItemImage(float feederID, int index) { for (i=0;i< WP_NUM_WEAPONS;i++) { trap_Cvar_VariableStringBuffer( va("ui_class_weapon%i", i), info, sizeof(info) ); - if (stricmp(info,"gfx/2d/select")!=0) + if (Q_stricmp(info,"gfx/2d/select")!=0) { if (validCnt == index) { @@ -9376,8 +9380,8 @@ static qhandle_t UI_FeederItemImage(float feederID, int index) { { trap_Cvar_VariableStringBuffer( va("ui_class_item%i", i), info, sizeof(info) ); // A hack so health and ammo dispenser icons don't show up. - if ((stricmp(info,"gfx/2d/select")!=0) && (stricmp(info,"gfx/hud/i_icon_healthdisp")!=0) && - (stricmp(info,"gfx/hud/i_icon_ammodisp")!=0)) + if ((Q_stricmp(info,"gfx/2d/select")!=0) && (Q_stricmp(info,"gfx/hud/i_icon_healthdisp")!=0) && + (Q_stricmp(info,"gfx/hud/i_icon_ammodisp")!=0)) { if (validCnt == index) { @@ -9416,7 +9420,7 @@ static qhandle_t UI_FeederItemImage(float feederID, int index) { for (i=0;i< NUM_FORCE_POWERS;i++) { trap_Cvar_VariableStringBuffer( va("ui_class_power%i", i), info, sizeof(info) ); - if (stricmp(info,"gfx/2d/select")!=0) + if (Q_stricmp(info,"gfx/2d/select")!=0) { if (validCnt == index) { @@ -10589,7 +10593,7 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad ) if (bIsImageFile(dirptr, skinname)) { //if it exists - if (strnicmp(skinname,"head_",5) == 0) + if (Q_strnicmp(skinname,"head_",5) == 0) { if (uiInfo.playerSpecies[uiInfo.playerSpeciesCount].SkinHeadCount < MAX_PLAYERMODELS) { @@ -10601,7 +10605,7 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad ) iSkinParts |= 1<<0; } } else - if (strnicmp(skinname,"torso_",6) == 0) + if (Q_strnicmp(skinname,"torso_",6) == 0) { if (uiInfo.playerSpecies[uiInfo.playerSpeciesCount].SkinTorsoCount < MAX_PLAYERMODELS) { @@ -10612,7 +10616,7 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad ) iSkinParts |= 1<<1; } } else - if (strnicmp(skinname,"lower_",6) == 0) + if (Q_strnicmp(skinname,"lower_",6) == 0) { if (uiInfo.playerSpecies[uiInfo.playerSpeciesCount].SkinLegCount < MAX_PLAYERMODELS) { diff --git a/codemp/ui/ui_shared.c b/codemp/ui/ui_shared.c index e8b0748..3fc1718 100644 --- a/codemp/ui/ui_shared.c +++ b/codemp/ui/ui_shared.c @@ -7671,7 +7671,7 @@ qboolean ItemParse_asset_model( itemDef_t *item, int handle ) { temp = token.string; #ifndef CGAME - if (!stricmp(token.string,"ui_char_model") ) + if (!Q_stricmp(token.string,"ui_char_model") ) { char modelPath[MAX_QPATH]; char ui_char_model[MAX_QPATH]; @@ -8623,7 +8623,7 @@ qboolean ItemParse_cvarStrList( itemDef_t *item, int handle ) { #ifndef CGAME for (; multiPtr->count < uiInfo.playerSpeciesCount; multiPtr->count++) { - multiPtr->cvarList[multiPtr->count] = String_Alloc(strupr(va("@MENUS_%s",uiInfo.playerSpecies[multiPtr->count].Name ))); //look up translation + multiPtr->cvarList[multiPtr->count] = String_Alloc(Q_strupr(va("@MENUS_%s",uiInfo.playerSpecies[multiPtr->count].Name ))); //look up translation multiPtr->cvarStr[multiPtr->count] = uiInfo.playerSpecies[multiPtr->count].Name; //value } #endif @@ -8666,7 +8666,7 @@ qboolean ItemParse_cvarStrList( itemDef_t *item, int handle ) { } //a normal StringAlloc ptr - if ((int)psString > 0) + if (psString) { if (*psString == '}') { return qtrue; @@ -8729,7 +8729,7 @@ qboolean ItemParse_cvarFloatList( itemDef_t *item, int handle ) } //a normal StringAlloc ptr - if ((int)string > 0) + if (string) { if (*string == '}') { diff --git a/codemp/unix/linux_common.c b/codemp/unix/linux_common.c index e40d6bd..05150cb 100644 --- a/codemp/unix/linux_common.c +++ b/codemp/unix/linux_common.c @@ -12,6 +12,8 @@ #include // AH - for size_t #include +#include "../game/q_shared.h" + // bk001207 - we need something under Linux, too. Mac? #if 1 // defined(C_ONLY) // bk010102 - dedicated? void Com_Memcpy (void* dest, const void* src, const size_t count) { diff --git a/codemp/unix/linux_glimp.c b/codemp/unix/linux_glimp.cpp similarity index 74% rename from codemp/unix/linux_glimp.c rename to codemp/unix/linux_glimp.cpp index a2449b8..476f551 100644 --- a/codemp/unix/linux_glimp.c +++ b/codemp/unix/linux_glimp.cpp @@ -33,6 +33,7 @@ #include #include +#include "../game/q_shared.h" #include "../renderer/tr_local.h" #include "../client/client.h" #include "linux_local.h" // bk001130 @@ -44,10 +45,10 @@ #include #include -#include +#include #include -#define WINDOW_CLASS_NAME "Quake 3: Arena" +#define WINDOW_CLASS_NAME "Jedi Academy" typedef enum { RSERR_OK, @@ -107,6 +108,8 @@ static int mouse_accel_numerator; static int mouse_accel_denominator; static int mouse_threshold; +bool g_bTextureRectangleHack = false; + /* * Find the first occurrence of find in s. */ @@ -158,100 +161,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; @@ -333,8 +338,8 @@ static void install_grabs(void) if (!XF86DGAQueryVersion(dpy, &MajorVersion, &MinorVersion)) { // unable to query, probalby not supported - ri.Printf( PRINT_ALL, "Failed to detect XF86DGA Mouse\n" ); - ri.Cvar_Set( "in_dgamouse", "0" ); + Com_Printf( "Failed to detect XF86DGA Mouse\n" ); + Cvar_Set( "in_dgamouse", "0" ); } else { dgamouse = qtrue; XF86DGADirectVideo(dpy, DefaultScreen(dpy), XF86DGADirectMouse); @@ -411,7 +416,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; } } @@ -504,13 +512,13 @@ static void HandleEvents(void) } else { -// ri.Printf( PRINT_ALL, "MotionNotify: %d,%d: ", event.xmotion.x, event.xmotion.y ); +// Com_Printf( "MotionNotify: %d,%d: ", event.xmotion.x, event.xmotion.y ); // If it's a center motion, we've just returned from our warp if (event.xmotion.x == glConfig.vidWidth/2 && event.xmotion.y == glConfig.vidHeight/2) { mwx = glConfig.vidWidth/2; mwy = glConfig.vidHeight/2; -// ri.Printf( PRINT_ALL, "SE_MOUSE (%d,%d)\n", mx, my ); +// Com_Printf( "SE_MOUSE (%d,%d)\n", mx, my ); t = Sys_Milliseconds(); if (t - mouseResetTime > MOUSE_RESET_DELAY ) { Sys_QueEvent( t, SE_MOUSE, mx, my, 0, NULL ); @@ -530,7 +538,7 @@ static void HandleEvents(void) else my += dy; -// ri.Printf( PRINT_ALL, "mx=%d,my=%d [%d - %d,%d - %d]\n", mx, my, event.xmotion.x, mwx, event.xmotion.y, mwy ); +// Com_Printf( "mx=%d,my=%d [%d - %d,%d - %d]\n", mx, my, event.xmotion.x, mwx, event.xmotion.y, mwy ); mwx = event.xmotion.x; mwy = event.xmotion.y; dowarp = qtrue; @@ -540,9 +548,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 +561,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 +579,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; @@ -724,21 +732,21 @@ static qboolean GLW_StartDriverAndSetMode( const char *drivername, // don't ever bother going into fullscreen with a voodoo card #if 1 // JDC: I reenabled this if ( Q_stristr( drivername, "Voodoo" ) ) { - ri.Cvar_Set( "r_fullscreen", "0" ); + Cvar_Set( "r_fullscreen", "0" ); r_fullscreen->modified = qfalse; fullscreen = qfalse; } #endif - err = GLW_SetMode( drivername, mode, fullscreen ); + err = (rserr_t) GLW_SetMode( drivername, mode, fullscreen ); switch ( err ) { case RSERR_INVALID_FULLSCREEN: - ri.Printf( PRINT_ALL, "...WARNING: fullscreen unavailable in this mode\n" ); + Com_Printf( "...WARNING: fullscreen unavailable in this mode\n" ); return qfalse; case RSERR_INVALID_MODE: - ri.Printf( PRINT_ALL, "...WARNING: could not set the given mode (%d)\n", mode ); + Com_Printf( "...WARNING: could not set the given mode (%d)\n", mode ); return qfalse; default: break; @@ -778,16 +786,16 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen ) int i; const char* glstring; // bk001130 - from cvs1.17 (mkv) - ri.Printf( PRINT_ALL, "Initializing OpenGL display\n"); + Com_Printf( "Initializing OpenGL display\n"); - ri.Printf (PRINT_ALL, "...setting mode %d:", mode ); + Com_Printf ("...setting mode %d:", mode ); - if ( !R_GetModeInfo( &glConfig.vidWidth, &glConfig.vidHeight, &glConfig.windowAspect, mode ) ) + if ( !R_GetModeInfo( &glConfig.vidWidth, &glConfig.vidHeight, mode ) ) { - ri.Printf( PRINT_ALL, " invalid mode\n" ); + Com_Printf( " invalid mode\n" ); return RSERR_INVALID_MODE; } - ri.Printf( PRINT_ALL, " %d %d\n", glConfig.vidWidth, glConfig.vidHeight); + Com_Printf( " %d %d\n", glConfig.vidWidth, glConfig.vidHeight); if (!(dpy = XOpenDisplay(NULL))) { fprintf(stderr, "Error couldn't open the X display\n"); @@ -805,7 +813,7 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen ) if (!XF86VidModeQueryVersion(dpy, &MajorVersion, &MinorVersion)) { vidmode_ext = qfalse; } else { - ri.Printf(PRINT_ALL, "Using XFree86-VidModeExtension Version %d.%d\n", + Com_Printf("Using XFree86-VidModeExtension Version %d.%d\n", MajorVersion, MinorVersion); vidmode_ext = qtrue; } @@ -814,10 +822,10 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen ) if (in_dgamouse->value) { if (!XF86DGAQueryVersion(dpy, &MajorVersion, &MinorVersion)) { // unable to query, probalby not supported - ri.Printf( PRINT_ALL, "Failed to detect XF86DGA Mouse\n" ); - ri.Cvar_Set( "in_dgamouse", "0" ); + Com_Printf( "Failed to detect XF86DGA Mouse\n" ); + Cvar_Set( "in_dgamouse", "0" ); } else { - ri.Printf( PRINT_ALL, "XF86DGA Mouse (Version %d.%d) initialized\n", + Com_Printf( "XF86DGA Mouse (Version %d.%d) initialized\n", MajorVersion, MinorVersion); } } @@ -857,15 +865,15 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen ) // Move the viewport to top left XF86VidModeSetViewPort(dpy, scrnum, 0, 0); - ri.Printf(PRINT_ALL, "XFree86-VidModeExtension Activated at %dx%d\n", + Com_Printf("XFree86-VidModeExtension Activated at %dx%d\n", actualWidth, actualHeight); } else { - fullscreen = 0; - ri.Printf(PRINT_ALL, "XFree86-VidModeExtension: No acceptable modes found\n"); + fullscreen = qfalse; + Com_Printf("XFree86-VidModeExtension: No acceptable modes found\n"); } } else { - ri.Printf(PRINT_ALL, "XFree86-VidModeExtension: Ignored on non-fullscreen/Voodoo\n"); + Com_Printf("XFree86-VidModeExtension: Ignored on non-fullscreen/Voodoo\n"); } } @@ -875,9 +883,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 @@ -953,7 +958,7 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen ) continue; } - ri.Printf( PRINT_ALL, "Using %d/%d/%d Color bits, %d depth, %d stencil display.\n", + Com_Printf( "Using %d/%d/%d Color bits, %d depth, %d stencil display.\n", attrib[ATTR_RED_IDX], attrib[ATTR_GREEN_IDX], attrib[ATTR_BLUE_IDX], attrib[ATTR_DEPTH_IDX], attrib[ATTR_STENCIL_IDX]); @@ -964,7 +969,7 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen ) } if (!visinfo) { - ri.Printf( PRINT_ALL, "Couldn't get a visual\n" ); + Com_Printf( "Couldn't get a visual\n" ); return RSERR_INVALID_MODE; } @@ -1002,25 +1007,25 @@ int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen ) qglXMakeCurrent(dpy, win, ctx); // bk001130 - from cvs1.17 (mkv) - glstring = qglGetString (GL_RENDERER); - ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glstring ); + glstring = (const char *) qglGetString (GL_RENDERER); + Com_Printf( "GL_RENDERER: %s\n", glstring ); // bk010122 - new software token (Indirect) if ( !Q_stricmp( glstring, "Mesa X11") || !Q_stricmp( glstring, "Mesa GLX Indirect") ) { if ( !r_allowSoftwareGL->integer ) { - ri.Printf( PRINT_ALL, "\n\n***********************************************************\n" ); - ri.Printf( PRINT_ALL, " You are using software Mesa (no hardware acceleration)! \n" ); - ri.Printf( PRINT_ALL, " Driver DLL used: %s\n", drivername ); - ri.Printf( PRINT_ALL, " If this is intentional, add\n" ); - ri.Printf( PRINT_ALL, " \"+set r_allowSoftwareGL 1\"\n" ); - ri.Printf( PRINT_ALL, " to the command line when starting the game.\n" ); - ri.Printf( PRINT_ALL, "***********************************************************\n"); + Com_Printf( "\n\n***********************************************************\n" ); + Com_Printf( " You are using software Mesa (no hardware acceleration)! \n" ); + Com_Printf( " Driver DLL used: %s\n", drivername ); + Com_Printf( " If this is intentional, add\n" ); + Com_Printf( " \"+set r_allowSoftwareGL 1\"\n" ); + Com_Printf( " to the command line when starting the game.\n" ); + Com_Printf( "***********************************************************\n"); GLimp_Shutdown( ); return RSERR_INVALID_MODE; } else { - ri.Printf( PRINT_ALL, "...using software Mesa (r_allowSoftwareGL==1).\n" ); + Com_Printf( "...using software Mesa (r_allowSoftwareGL==1).\n" ); } } @@ -1034,11 +1039,11 @@ static void GLW_InitExtensions( void ) { if ( !r_allowExtensions->integer ) { - ri.Printf( PRINT_ALL, "*** IGNORING OPENGL EXTENSIONS ***\n" ); + Com_Printf( "*** IGNORING OPENGL EXTENSIONS ***\n" ); return; } - ri.Printf( PRINT_ALL, "Initializing OpenGL extensions\n" ); + Com_Printf( "Initializing OpenGL extensions\n" ); // GL_S3_s3tc if ( Q_stristr( glConfig.extensions_string, "GL_S3_s3tc" ) ) @@ -1046,18 +1051,18 @@ static void GLW_InitExtensions( void ) if ( r_ext_compressed_textures->value ) { glConfig.textureCompression = TC_S3TC; - ri.Printf( PRINT_ALL, "...using GL_S3_s3tc\n" ); + Com_Printf( "...using GL_S3_s3tc\n" ); } else { glConfig.textureCompression = TC_NONE; - ri.Printf( PRINT_ALL, "...ignoring GL_S3_s3tc\n" ); + Com_Printf( "...ignoring GL_S3_s3tc\n" ); } } else { glConfig.textureCompression = TC_NONE; - ri.Printf( PRINT_ALL, "...GL_S3_s3tc not found\n" ); + Com_Printf( "...GL_S3_s3tc not found\n" ); } // GL_EXT_texture_env_add @@ -1067,17 +1072,17 @@ static void GLW_InitExtensions( void ) if ( r_ext_texture_env_add->integer ) { glConfig.textureEnvAddAvailable = qtrue; - ri.Printf( PRINT_ALL, "...using GL_EXT_texture_env_add\n" ); + Com_Printf( "...using GL_EXT_texture_env_add\n" ); } else { glConfig.textureEnvAddAvailable = qfalse; - ri.Printf( PRINT_ALL, "...ignoring GL_EXT_texture_env_add\n" ); + Com_Printf( "...ignoring GL_EXT_texture_env_add\n" ); } } else { - ri.Printf( PRINT_ALL, "...GL_EXT_texture_env_add not found\n" ); + Com_Printf( "...GL_EXT_texture_env_add not found\n" ); } // GL_ARB_multitexture @@ -1098,25 +1103,25 @@ static void GLW_InitExtensions( void ) if ( glConfig.maxActiveTextures > 1 ) { - ri.Printf( PRINT_ALL, "...using GL_ARB_multitexture\n" ); + Com_Printf( "...using GL_ARB_multitexture\n" ); } else { qglMultiTexCoord2fARB = NULL; qglActiveTextureARB = NULL; qglClientActiveTextureARB = NULL; - ri.Printf( PRINT_ALL, "...not using GL_ARB_multitexture, < 2 texture units\n" ); + Com_Printf( "...not using GL_ARB_multitexture, < 2 texture units\n" ); } } } else { - ri.Printf( PRINT_ALL, "...ignoring GL_ARB_multitexture\n" ); + Com_Printf( "...ignoring GL_ARB_multitexture\n" ); } } else { - ri.Printf( PRINT_ALL, "...GL_ARB_multitexture not found\n" ); + Com_Printf( "...GL_ARB_multitexture not found\n" ); } // GL_EXT_compiled_vertex_array @@ -1124,21 +1129,21 @@ static void GLW_InitExtensions( void ) { if ( r_ext_compiled_vertex_array->value ) { - ri.Printf( PRINT_ALL, "...using GL_EXT_compiled_vertex_array\n" ); + Com_Printf( "...using GL_EXT_compiled_vertex_array\n" ); qglLockArraysEXT = ( void ( APIENTRY * )( int, int ) ) dlsym( glw_state.OpenGLLib, "glLockArraysEXT" ); qglUnlockArraysEXT = ( void ( APIENTRY * )( void ) ) dlsym( glw_state.OpenGLLib, "glUnlockArraysEXT" ); if (!qglLockArraysEXT || !qglUnlockArraysEXT) { - ri.Error (ERR_FATAL, "bad getprocaddress"); + Com_Error (ERR_FATAL, "bad getprocaddress"); } } else { - ri.Printf( PRINT_ALL, "...ignoring GL_EXT_compiled_vertex_array\n" ); + Com_Printf( "...ignoring GL_EXT_compiled_vertex_array\n" ); } } else { - ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" ); + Com_Printf( "...GL_EXT_compiled_vertex_array not found\n" ); } } @@ -1149,11 +1154,14 @@ 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; - ri.Printf( PRINT_ALL, "...loading %s: ", name ); + strcpy( name, OPENGL_DRIVER_NAME ); + + Com_Printf( "...loading %s: ", name ); // disable the 3Dfx splash screen and set gamma // we do this all the time, but it shouldn't hurt anything @@ -1166,7 +1174,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 ) ) @@ -1183,7 +1191,7 @@ static qboolean GLW_LoadOpenGL( const char *name ) } else { - ri.Printf( PRINT_ALL, "failed\n" ); + Com_Printf( "failed\n" ); } fail: @@ -1192,6 +1200,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 ** @@ -1204,86 +1223,35 @@ void GLimp_Init( void ) qboolean attempted3Dfx = qfalse; qboolean success = qfalse; char buf[1024]; - cvar_t *lastValidRenderer = ri.Cvar_Get( "r_lastValidRenderer", "(uninitialized)", CVAR_ARCHIVE ); + cvar_t *lastValidRenderer = Cvar_Get( "r_lastValidRenderer", "(uninitialized)", CVAR_ARCHIVE ); // cvar_t *cv; // bk001204 - unused - r_allowSoftwareGL = ri.Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH ); + r_allowSoftwareGL = Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH ); - r_previousglDriver = ri.Cvar_Get( "r_previousglDriver", "", CVAR_ROM ); + r_previousglDriver = Cvar_Get( "r_previousglDriver", "", CVAR_ROM ); glConfig.deviceSupportsGamma = qfalse; 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 ) ); + glConfig.vendor_string = (const char *) qglGetString (GL_VENDOR); + glConfig.renderer_string = (const char *) qglGetString (GL_RENDERER); + glConfig.version_string = (const char *) qglGetString (GL_VERSION); + glConfig.extensions_string = (const char *) qglGetString (GL_EXTENSIONS); + + qglGetIntegerv( GL_MAX_TEXTURE_SIZE, &glConfig.maxTextureSize ); // // 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,57 +1260,11 @@ 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 " ) ) - { + Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST" ); + Cvar_Set( "r_picmip", "1" ); } - ri.Cvar_Set( "r_lastValidRenderer", glConfig.renderer_string ); + Cvar_Set( "r_lastValidRenderer", glConfig.renderer_string ); // initialize extensions GLW_InitExtensions(); @@ -1363,7 +1285,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 ( stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) { qglXSwapBuffers(dpy, win); } @@ -1500,8 +1422,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 +1458,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 diff --git a/codemp/unix/linux_local.h b/codemp/unix/linux_local.h index 776d27f..90d7140 100644 --- a/codemp/unix/linux_local.h +++ b/codemp/unix/linux_local.h @@ -25,5 +25,3 @@ void QGL_Shutdown( void ); // bk001130 - win32 // void IN_JoystickCommands (void); - -char *strlwr (char *s); diff --git a/codemp/unix/linux_qgl.c b/codemp/unix/linux_qgl.cpp similarity index 77% rename from codemp/unix/linux_qgl.c rename to codemp/unix/linux_qgl.cpp index e6c8ece..9b3cae7 100644 --- a/codemp/unix/linux_qgl.c +++ b/codemp/unix/linux_qgl.cpp @@ -8,34 +8,21 @@ ** QGL_Init() - loads libraries, assigns function pointers, etc. ** QGL_Shutdown() - unloads libraries, NULLs function pointers */ - -// bk001204 -#include -#include - - #include +#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 -//#endif -//#include // bk010216 - FIXME: all of the above redundant? renderer/qgl.h +#include #include +#include +#include -// 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; diff --git a/codemp/unix/linux_snd.c b/codemp/unix/linux_snd.cpp similarity index 100% rename from codemp/unix/linux_snd.c rename to codemp/unix/linux_snd.cpp diff --git a/codemp/unix/unix_glw.h b/codemp/unix/unix_glw.h new file mode 100644 index 0000000..f078509 --- /dev/null +++ b/codemp/unix/unix_glw.h @@ -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 diff --git a/codemp/unix/unix_main.c b/codemp/unix/unix_main.cpp similarity index 94% rename from codemp/unix/unix_main.c rename to codemp/unix/unix_main.cpp index 23634af..6a29600 100644 --- a/codemp/unix/unix_main.c +++ b/codemp/unix/unix_main.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #ifdef __linux__ // rb010123 #include #endif @@ -35,7 +36,9 @@ cvar_t *nostdout; // Structure containing functions exported from refresh DLL +#if 0 refexport_t re; +#endif unsigned sys_frame_time; @@ -114,11 +117,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 +167,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 +192,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 +352,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__ @@ -453,7 +466,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__ @@ -556,7 +571,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__ @@ -623,7 +640,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__ @@ -682,13 +701,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__ @@ -724,6 +746,7 @@ void *Sys_GetBotLibAPI (void *parms ) // bk001129 - this is a signature mismatch return GetBotLibAPI (parms); } +#endif void *Sys_GetBotAIAPI (void *parms ) { return NULL; @@ -1103,9 +1126,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 Academy Dedicated Server [%s %s]\n", date, time ); #else - fprintf( stdout, "Linux Quake3 Full Executable [%s %s]\n", date, time ); + fprintf( stdout, "Jedi Academy Full Executable [%s %s]\n", date, time ); #endif fprintf( stdout, " local install: %s\n", name ); fprintf( stdout, "%s\n\n", sep ); diff --git a/codemp/unix/unix_net.c b/codemp/unix/unix_net.cpp similarity index 100% rename from codemp/unix/unix_net.c rename to codemp/unix/unix_net.cpp diff --git a/codemp/unix/unix_shared.cpp b/codemp/unix/unix_shared.cpp index f992276..0c75485 100644 --- a/codemp/unix/unix_shared.cpp +++ b/codemp/unix/unix_shared.cpp @@ -86,18 +86,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 diff --git a/codemp/win32/win_filecode.cpp b/codemp/win32/win_filecode.cpp index a1ba9a8..ebd308b 100644 --- a/codemp/win32/win_filecode.cpp +++ b/codemp/win32/win_filecode.cpp @@ -70,7 +70,7 @@ int _buildFileList(const char* path, bool insert, bool buildList) if(insert || buildList) { // Regular file -- add it to the table - strlwr(full); + Q_strlwr(full); unsigned int code = crc32(0, (const byte *)full, strlen(full)); FileInfo info; @@ -286,7 +286,7 @@ int Sys_GetFileCode(const char* name) char* osname = FS_BuildOSPath(name); // Generate hash for file name - strlwr(osname); + Q_strlwr(osname); unsigned int code = crc32(0, (const byte *)osname, strlen(osname)); // Check if the file exists diff --git a/codemp/win32/win_glimp.cpp b/codemp/win32/win_glimp.cpp index 614a144..65f9b7f 100644 --- a/codemp/win32/win_glimp.cpp +++ b/codemp/win32/win_glimp.cpp @@ -1361,8 +1361,8 @@ static void GLW_InitExtensions( void ) // Figure out which texture rectangle extension to use. bool bTexRectSupported = false; - if ( strnicmp( glConfig.vendor_string, "ATI Technologies",16 )==0 - && strnicmp( glConfig.version_string, "1.3.3",5 )==0 + if ( Q_strnicmp( glConfig.vendor_string, "ATI Technologies",16 )==0 + && Q_strnicmp( glConfig.version_string, "1.3.3",5 )==0 && glConfig.version_string[5] < '9' ) //1.3.34 and 1.3.37 and 1.3.38 are broken for sure, 1.3.39 is not { g_bTextureRectangleHack = true; @@ -1598,7 +1598,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 ); } diff --git a/codemp/win32/win_glimp_console.cpp b/codemp/win32/win_glimp_console.cpp index 8f23a55..fd6f81a 100644 --- a/codemp/win32/win_glimp_console.cpp +++ b/codemp/win32/win_glimp_console.cpp @@ -169,7 +169,7 @@ static qboolean GLW_LoadOpenGL() 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 ) { } } diff --git a/codemp/win32/win_main.cpp b/codemp/win32/win_main.cpp index 78155e1..d2fd85a 100644 --- a/codemp/win32/win_main.cpp +++ b/codemp/win32/win_main.cpp @@ -666,7 +666,7 @@ static qboolean Sys_ScanForCD( void ) { Result = GetVolumeInformation(drive,VolumeName,sizeof(VolumeName),&VolumeSerialNumber, &MaximumComponentLength,&FileSystemFlags,FileSystemName,sizeof(FileSystemName)); - if (Result && (strnicmp(VolumeName,CD_VOLUME,8) == 0 ) ) + if (Result && (Q_strnicmp(VolumeName,CD_VOLUME,8) == 0 ) ) { sprintf (test, "%s%s\\%s",drive, CD_BASEDIR, CD_EXE); f = fopen( test, "r" ); diff --git a/codemp/win32/win_main_console.cpp b/codemp/win32/win_main_console.cpp index 934421b..987ee5a 100644 --- a/codemp/win32/win_main_console.cpp +++ b/codemp/win32/win_main_console.cpp @@ -225,7 +225,7 @@ void Sys_Log( const char *file, const void *buffer, int size, bool flush ) { FileInfo* cur = NULL; for (int f = 0; f < num_files; ++f) { - if (!stricmp(file, files[f].name)) + if (!Q_stricmp(file, files[f].name)) { cur = &files[f]; break; diff --git a/codemp/zlib32/deflate.cpp b/codemp/zlib32/deflate.cpp index 7f46519..ede0056 100644 --- a/codemp/zlib32/deflate.cpp +++ b/codemp/zlib32/deflate.cpp @@ -1210,6 +1210,7 @@ static void lm_init(deflate_state *s) inline byte *qcmp(byte *scan, byte *match, ulong count) { byte *retval; +#ifdef _MSC_VER _asm { push esi @@ -1226,6 +1227,12 @@ inline byte *qcmp(byte *scan, byte *match, ulong count) mov [retval], esi pop esi } +#else + asm("repe cmpsb;" + : "=S"(retval) + : "S"(scan), "D"(match), "c"(count) + ); +#endif return(--retval); } @@ -2075,4 +2082,4 @@ bool DeflateFile(byte *src, ulong uncompressedSize, byte *dst, ulong maxCompress return(true); } -// end \ No newline at end of file +// end diff --git a/codemp/zlib32/inflate.cpp b/codemp/zlib32/inflate.cpp index e40e96c..30bbfb8 100644 --- a/codemp/zlib32/inflate.cpp +++ b/codemp/zlib32/inflate.cpp @@ -499,6 +499,7 @@ static ulong needout(z_stream *z, inflate_blocks_state_t *s, ulong bytesToEnd) inline byte *qcopy(byte *dst, byte *src, int count) { byte *retval; +#ifdef _MSC_VER _asm { push ecx @@ -515,6 +516,12 @@ inline byte *qcopy(byte *dst, byte *src, int count) pop esi pop ecx } +#else + asm("repe movsb;" + : "=D"(retval) + : "D"(dst), "S"(src), "c"(count) + ); +#endif return(retval); }