From 96abbd7a032fae96ab5c10b6a1f5da0263319c15 Mon Sep 17 00:00:00 2001 From: Artem Kharytoniuk Date: Fri, 9 May 2014 22:49:41 +0300 Subject: [PATCH] Removed support for ancient graphics hardware and drivers. Removed Unix/Mac OS X platforms support. Updated Visual Studio project files. --- .gitignore | 3 + code/Construct | 431 - code/Makefile | 3 - code/botlib/botlib.vcproj | 1559 -- code/botlib/lcc.mak | 55 - code/botlib/linux-i386.mak | 92 - code/bspc/Conscript | 75 - code/bspc/Makefile | 114 - code/bspc/lcc.mak | 61 - code/bspc/linux-i386.mak | 109 - code/cgame.lnt | 25 - code/cgame/Conscript | 138 - code/cgame/cg_consolecmds.c | 1 - code/cgame/cg_effects.c | 19 +- code/cgame/cg_marks.c | 6 - code/cgame/cg_newdraw.c | 1852 --- code/cgame/cg_view.c | 5 - code/cgame/cg_weapons.c | 15 +- code/cgame/cgame.bat | 3 + code/cgame/cgame.plg | 124 - code/cgame/cgame.sh | 36 - code/cgame/cgame.vcproj | 1221 -- code/cgame/cgame_ta.bat | 65 - code/cgame/cgame_ta.q3asm | 28 - code/cgame/cgame_ta.sh | 38 - code/cgame/tr_types.h | 54 +- code/clean.bat | 61 - code/client/cl_cin.c | 17 - code/client/client.h | 2 +- code/client/keys.h | 2 +- code/game.lnt | 35 - code/game/Conscript | 140 - code/game/game.bat | 3 + code/game/game.sh | 48 - code/game/game.vcproj | 2132 --- code/game/game_ta.bat | 86 - code/game/game_ta.q3asm | 35 - code/game/game_ta.sh | 48 - code/game/q_shared.h | 5 + code/macosx/BuildRelease | 17 - code/macosx/CGMouseDeltaFix.h | 27 - code/macosx/CGMouseDeltaFix.m | 131 - code/macosx/CGPrivateAPI.h | 185 - code/macosx/GenerateQGL.pl | 146 - code/macosx/Performance.rtf | 114 - code/macosx/Q3Controller.h | 40 - code/macosx/Q3Controller.m | 435 - code/macosx/Quake3.icns | Bin 35224 -> 0 bytes code/macosx/Quake3.nib/classes.nib | 18 - code/macosx/Quake3.nib/info.nib | 19 - code/macosx/Quake3.nib/objects.nib | Bin 765 -> 0 bytes code/macosx/Quake3.pbproj/apple.pbxuser | 563 - code/macosx/Quake3.pbproj/project.pbxproj | 11802 ---------------- code/macosx/RecordDemo.zsh | 9 - code/macosx/banner.jpg | Bin 55841 -> 0 bytes code/macosx/botlib.log | 196 - code/macosx/macosx_display.h | 38 - code/macosx/macosx_display.m | 373 - code/macosx/macosx_glimp.h | 37 - code/macosx/macosx_glimp.m | 1114 -- code/macosx/macosx_glsmp_mutex.m | 176 - code/macosx/macosx_glsmp_null.m | 46 - code/macosx/macosx_glsmp_ports.m | 425 - code/macosx/macosx_input.m | 916 -- code/macosx/macosx_local.h | 129 - code/macosx/macosx_qgl.h | 5095 ------- code/macosx/macosx_sndcore.m | 325 - code/macosx/macosx_snddma.m | 205 - code/macosx/macosx_sys.m | 537 - code/macosx/macosx_timers.h | 56 - code/macosx/macosx_timers.m | 75 - code/macosx/timedemo.zsh | 26 - code/opts.lnt | 26 - code/q3_ui/Conscript | 93 - code/q3_ui/compile.bat | 2 - code/q3_ui/q3_ui.bat | 3 + code/q3_ui/q3_ui.q3asm | 2 +- code/q3_ui/q3_ui.sh | 55 - code/q3_ui/q3_ui.vcproj | 2008 --- code/q3_ui/ui.q3asm | 45 - code/q3_ui/ui_loadconfig.c | 274 - code/q3_ui/ui_local.h | 2 +- code/{ui => q3_ui}/ui_public.h | 0 code/q3_ui/ui_qmenu.c | 7 +- code/q3_ui/ui_saveconfig.c | 212 - code/{ui => q3_ui}/ui_syscalls.asm | 0 code/{ui => q3_ui}/ui_syscalls.c | 0 code/q3_ui/ui_video.c | 9 +- code/qcommon/cmd.c.save | 636 - code/qcommon/vm_ppc.c | 1479 -- code/qcommon/vm_ppc_new.c | 2119 --- code/qcommon/vm_x86.c | 15 + code/quake3.sln | 145 - code/quake3.vcproj | 3463 ----- code/renderer.lnt | 27 - code/renderer/qgl.h | 3 - code/renderer/ref_trin.def | 2 - code/renderer/renderer.vcproj | 6112 -------- code/renderer/tr_bsp.c | 4 +- code/renderer/tr_image.c | 8 - code/renderer/tr_init.c | 20 +- code/renderer/tr_scene.c | 14 +- code/renderer/tr_shade.c | 2 +- code/renderer/tr_shader.c | 10 +- code/server/sv_rankings.c | 1537 -- code/splines/Splines.vcproj | 296 - code/splines/math_angles.cpp | 150 - code/splines/math_angles.h | 195 - code/splines/math_matrix.cpp | 134 - code/splines/math_matrix.h | 223 - code/splines/math_quaternion.cpp | 78 - code/splines/math_quaternion.h | 190 - code/splines/math_vector.cpp | 144 - code/splines/math_vector.h | 574 - code/splines/q_parse.cpp | 535 - code/splines/q_shared.cpp | 976 -- code/splines/q_shared.h | 810 -- code/splines/q_shared.hpp | 810 -- code/splines/splines.cpp | 1250 -- code/splines/splines.h | 1075 -- code/splines/util_list.h | 346 - code/splines/util_str.cpp | 620 - code/splines/util_str.h | 817 -- code/ui/Conscript | 62 - code/ui/compile.bat | 2 - code/ui/keycodes.h | 163 - code/ui/ui.bat | 33 - code/ui/ui.def | 3 - code/ui/ui.q3asm | 12 - code/ui/ui.vcproj | 1008 -- code/ui/ui_atoms.c | 520 - code/ui/ui_gameinfo.c | 324 - code/ui/ui_local.h | 1136 -- code/ui/ui_main.c | 5997 -------- code/ui/ui_players.c | 1378 -- code/ui/ui_shared.c | 5785 -------- code/ui/ui_shared.h | 450 - code/ui/ui_util.c | 29 - code/unix/ChangeLog | 2981 ---- code/unix/Cons_gcc.pm | 47 - code/unix/Conscript-client | 265 - code/unix/Conscript-dedicated | 115 - code/unix/Conscript-pk3 | 135 - code/unix/Conscript-sdk | 122 - code/unix/Conscript-setup | 33 - code/unix/LinuxSupport/CHANGES-1.32.txt | 150 - code/unix/LinuxSupport/INSTALL | 52 - code/unix/LinuxSupport/index.html | 283 - code/unix/LinuxSupport/udp_wide_README.txt | 20 - .../LinuxSupport/udp_wide_broadcast.patch | 57 - code/unix/Makefile | 2119 --- code/unix/Makefile.Game | 285 - code/unix/Quake3.kdelnk | 12 - code/unix/README.EULA | 184 - code/unix/README.Linux | 352 - code/unix/README.Q3Test | 306 - code/unix/build_setup.sh | 125 - code/unix/cons | 6828 --------- code/unix/extract_ver.pl | 9 - code/unix/ftol.nasm | 151 - code/unix/linux_common.c | 344 - code/unix/linux_glimp.c | 1780 --- code/unix/linux_joystick.c | 207 - code/unix/linux_local.h | 49 - code/unix/linux_qgl.c | 4153 ------ code/unix/linux_signals.c | 61 - code/unix/linux_snd.c | 293 - code/unix/matha.s | 425 - code/unix/pcons-2.3.1 | 7911 ----------- code/unix/q3test.spec.sh | 52 - code/unix/qasm.h | 480 - code/unix/quake3.gif | Bin 1378 -> 0 bytes code/unix/quake3.xpm | 161 - code/unix/run-target.sh | 12 - code/unix/snapvector.nasm | 95 - code/unix/snd_mixa.s | 217 - code/unix/sys_dosa.s | 115 - code/unix/unix_glw.h | 38 - code/unix/unix_main.c | 1273 -- code/unix/unix_net.c | 616 - code/unix/unix_shared.c | 435 - code/unix/vm_x86.c | 29 - code/unix/vm_x86a.s | 462 - code/{cgame => win32}/cgame.def | 0 code/{game => win32}/game.def | 0 code/{q3_ui => win32}/ui.def | 0 code/win32/vs/botlib.vcxproj | 338 + code/win32/vs/botlib.vcxproj.filters | 200 + code/win32/vs/cgame.vcxproj | 288 + code/win32/vs/cgame.vcxproj.filters | 104 + code/win32/vs/game.vcxproj | 364 + code/win32/vs/game.vcxproj.filters | 197 + code/win32/vs/q3_ui.vcxproj | 430 + code/win32/vs/q3_ui.vcxproj.filters | 155 + code/win32/vs/quake3.sln | 56 + code/win32/vs/quake3.vcxproj | 490 + code/win32/vs/quake3.vcxproj.filters | 277 + code/win32/vs/renderer.vcxproj | 555 + code/win32/vs/renderer.vcxproj.filters | 278 + code/win32/win_gamma.c | 108 +- code/win32/win_glimp.c | 341 +- code/win32/win_input.c | 3 +- code/win32/win_qgl.c | 54 - 203 files changed, 3892 insertions(+), 110665 deletions(-) create mode 100644 .gitignore delete mode 100644 code/Construct delete mode 100644 code/Makefile delete mode 100644 code/botlib/botlib.vcproj delete mode 100644 code/botlib/lcc.mak delete mode 100644 code/botlib/linux-i386.mak delete mode 100644 code/bspc/Conscript delete mode 100644 code/bspc/Makefile delete mode 100644 code/bspc/lcc.mak delete mode 100644 code/bspc/linux-i386.mak delete mode 100644 code/cgame.lnt delete mode 100644 code/cgame/Conscript delete mode 100644 code/cgame/cg_newdraw.c delete mode 100644 code/cgame/cgame.plg delete mode 100644 code/cgame/cgame.sh delete mode 100644 code/cgame/cgame.vcproj delete mode 100644 code/cgame/cgame_ta.bat delete mode 100644 code/cgame/cgame_ta.q3asm delete mode 100644 code/cgame/cgame_ta.sh delete mode 100644 code/clean.bat delete mode 100644 code/game.lnt delete mode 100644 code/game/Conscript delete mode 100644 code/game/game.sh delete mode 100644 code/game/game.vcproj delete mode 100644 code/game/game_ta.bat delete mode 100644 code/game/game_ta.q3asm delete mode 100644 code/game/game_ta.sh delete mode 100644 code/macosx/BuildRelease delete mode 100644 code/macosx/CGMouseDeltaFix.h delete mode 100644 code/macosx/CGMouseDeltaFix.m delete mode 100644 code/macosx/CGPrivateAPI.h delete mode 100644 code/macosx/GenerateQGL.pl delete mode 100644 code/macosx/Performance.rtf delete mode 100644 code/macosx/Q3Controller.h delete mode 100644 code/macosx/Q3Controller.m delete mode 100644 code/macosx/Quake3.icns delete mode 100644 code/macosx/Quake3.nib/classes.nib delete mode 100644 code/macosx/Quake3.nib/info.nib delete mode 100644 code/macosx/Quake3.nib/objects.nib delete mode 100644 code/macosx/Quake3.pbproj/apple.pbxuser delete mode 100644 code/macosx/Quake3.pbproj/project.pbxproj delete mode 100644 code/macosx/RecordDemo.zsh delete mode 100644 code/macosx/banner.jpg delete mode 100644 code/macosx/botlib.log delete mode 100644 code/macosx/macosx_display.h delete mode 100644 code/macosx/macosx_display.m delete mode 100644 code/macosx/macosx_glimp.h delete mode 100644 code/macosx/macosx_glimp.m delete mode 100644 code/macosx/macosx_glsmp_mutex.m delete mode 100644 code/macosx/macosx_glsmp_null.m delete mode 100644 code/macosx/macosx_glsmp_ports.m delete mode 100644 code/macosx/macosx_input.m delete mode 100644 code/macosx/macosx_local.h delete mode 100644 code/macosx/macosx_qgl.h delete mode 100644 code/macosx/macosx_sndcore.m delete mode 100644 code/macosx/macosx_snddma.m delete mode 100644 code/macosx/macosx_sys.m delete mode 100644 code/macosx/macosx_timers.h delete mode 100644 code/macosx/macosx_timers.m delete mode 100644 code/macosx/timedemo.zsh delete mode 100644 code/opts.lnt delete mode 100644 code/q3_ui/Conscript delete mode 100644 code/q3_ui/compile.bat delete mode 100644 code/q3_ui/q3_ui.sh delete mode 100644 code/q3_ui/q3_ui.vcproj delete mode 100644 code/q3_ui/ui.q3asm delete mode 100644 code/q3_ui/ui_loadconfig.c rename code/{ui => q3_ui}/ui_public.h (100%) delete mode 100644 code/q3_ui/ui_saveconfig.c rename code/{ui => q3_ui}/ui_syscalls.asm (100%) rename code/{ui => q3_ui}/ui_syscalls.c (100%) delete mode 100644 code/qcommon/cmd.c.save delete mode 100644 code/qcommon/vm_ppc.c delete mode 100644 code/qcommon/vm_ppc_new.c delete mode 100644 code/quake3.sln delete mode 100644 code/quake3.vcproj delete mode 100644 code/renderer.lnt delete mode 100644 code/renderer/ref_trin.def delete mode 100644 code/renderer/renderer.vcproj delete mode 100644 code/server/sv_rankings.c delete mode 100644 code/splines/Splines.vcproj delete mode 100644 code/splines/math_angles.cpp delete mode 100644 code/splines/math_angles.h delete mode 100644 code/splines/math_matrix.cpp delete mode 100644 code/splines/math_matrix.h delete mode 100644 code/splines/math_quaternion.cpp delete mode 100644 code/splines/math_quaternion.h delete mode 100644 code/splines/math_vector.cpp delete mode 100644 code/splines/math_vector.h delete mode 100644 code/splines/q_parse.cpp delete mode 100644 code/splines/q_shared.cpp delete mode 100644 code/splines/q_shared.h delete mode 100644 code/splines/q_shared.hpp delete mode 100644 code/splines/splines.cpp delete mode 100644 code/splines/splines.h delete mode 100644 code/splines/util_list.h delete mode 100644 code/splines/util_str.cpp delete mode 100644 code/splines/util_str.h delete mode 100644 code/ui/Conscript delete mode 100644 code/ui/compile.bat delete mode 100644 code/ui/keycodes.h delete mode 100644 code/ui/ui.bat delete mode 100644 code/ui/ui.def delete mode 100644 code/ui/ui.q3asm delete mode 100644 code/ui/ui.vcproj delete mode 100644 code/ui/ui_atoms.c delete mode 100644 code/ui/ui_gameinfo.c delete mode 100644 code/ui/ui_local.h delete mode 100644 code/ui/ui_main.c delete mode 100644 code/ui/ui_players.c delete mode 100644 code/ui/ui_shared.c delete mode 100644 code/ui/ui_shared.h delete mode 100644 code/ui/ui_util.c delete mode 100644 code/unix/ChangeLog delete mode 100644 code/unix/Cons_gcc.pm delete mode 100644 code/unix/Conscript-client delete mode 100644 code/unix/Conscript-dedicated delete mode 100644 code/unix/Conscript-pk3 delete mode 100644 code/unix/Conscript-sdk delete mode 100644 code/unix/Conscript-setup delete mode 100644 code/unix/LinuxSupport/CHANGES-1.32.txt delete mode 100644 code/unix/LinuxSupport/INSTALL delete mode 100644 code/unix/LinuxSupport/index.html delete mode 100644 code/unix/LinuxSupport/udp_wide_README.txt delete mode 100644 code/unix/LinuxSupport/udp_wide_broadcast.patch delete mode 100644 code/unix/Makefile delete mode 100644 code/unix/Makefile.Game delete mode 100644 code/unix/Quake3.kdelnk delete mode 100644 code/unix/README.EULA delete mode 100644 code/unix/README.Linux delete mode 100644 code/unix/README.Q3Test delete mode 100644 code/unix/build_setup.sh delete mode 100644 code/unix/cons delete mode 100644 code/unix/extract_ver.pl delete mode 100644 code/unix/ftol.nasm delete mode 100644 code/unix/linux_common.c delete mode 100644 code/unix/linux_glimp.c delete mode 100644 code/unix/linux_joystick.c delete mode 100644 code/unix/linux_local.h delete mode 100644 code/unix/linux_qgl.c delete mode 100644 code/unix/linux_signals.c delete mode 100644 code/unix/linux_snd.c delete mode 100644 code/unix/matha.s delete mode 100644 code/unix/pcons-2.3.1 delete mode 100644 code/unix/q3test.spec.sh delete mode 100644 code/unix/qasm.h delete mode 100644 code/unix/quake3.gif delete mode 100644 code/unix/quake3.xpm delete mode 100644 code/unix/run-target.sh delete mode 100644 code/unix/snapvector.nasm delete mode 100644 code/unix/snd_mixa.s delete mode 100644 code/unix/sys_dosa.s delete mode 100644 code/unix/unix_glw.h delete mode 100644 code/unix/unix_main.c delete mode 100644 code/unix/unix_net.c delete mode 100644 code/unix/unix_shared.c delete mode 100644 code/unix/vm_x86.c delete mode 100644 code/unix/vm_x86a.s rename code/{cgame => win32}/cgame.def (100%) rename code/{game => win32}/game.def (100%) rename code/{q3_ui => win32}/ui.def (100%) create mode 100644 code/win32/vs/botlib.vcxproj create mode 100644 code/win32/vs/botlib.vcxproj.filters create mode 100644 code/win32/vs/cgame.vcxproj create mode 100644 code/win32/vs/cgame.vcxproj.filters create mode 100644 code/win32/vs/game.vcxproj create mode 100644 code/win32/vs/game.vcxproj.filters create mode 100644 code/win32/vs/q3_ui.vcxproj create mode 100644 code/win32/vs/q3_ui.vcxproj.filters create mode 100644 code/win32/vs/quake3.sln create mode 100644 code/win32/vs/quake3.vcxproj create mode 100644 code/win32/vs/quake3.vcxproj.filters create mode 100644 code/win32/vs/renderer.vcxproj create mode 100644 code/win32/vs/renderer.vcxproj.filters diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..15288c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +quake3.opensdf +quake3.sdf +code/build \ No newline at end of file diff --git a/code/Construct b/code/Construct deleted file mode 100644 index 82e6e0d..0000000 --- a/code/Construct +++ /dev/null @@ -1,431 +0,0 @@ -# -*- mode: perl -*- -# cons script for cgame game q3_ui ui .so and .qvm builds -# -# Oct. 2001 TTimo -# - -# the top directory is -# --- -# where: -# is "debug" or "release" -# is "x86" or "ppc" -# is "Linux" "BSD" "IRIX" etc. -# is major.minor of libc config - -# source the compiler version utility -BEGIN { - push @INC, './unix'; -} -use Cons_gcc; - -# defaults -$config = 'debug'; -$do_smp = 1; -$do_masterserver = 0; -$do_authserver = 0; -$do_authport = 0; -$do_setup = 0; -$do_bspc = 0; -$do_sdk = 0; -$do_pk3 = 0; -# those are exported -$DO_WIN32 = 0; -$NO_VM = 0; -$NO_SO = 0; -$CC='gcc'; -$CXX='g++'; - -# detect an sdk build (don't attempt client build and other things) -if ( -r 'unix/Conscript-client' ) -{ - $no_core = 0; -} -else -{ - $no_core = 1; -} - -# detection of CPU type -$cpu = `uname -m`; -chop ($cpu); -if ($cpu +~ /i?86/) -{ - $cpu = 'x86'; -} -# OS -$OS = `uname`; -chop ($OS); -# hacky win32 detection and win32 specifics code -if ($OS =~ CYGWIN) -{ - $DO_WIN32 = 1; -} -else -{ - # libc .. do the little magic! - $libc_cmd = '/lib/libc.so.6 |grep "GNU C "|grep version|awk -F "version " \'{ print $2 }\'|cut -b -3'; - $libc = `$libc_cmd`; - chop ($libc); -} - -if ($DO_WIN32 eq 1) -{ - print("Win32 build\n"); - - $config = $ARGV[0]; - - # TODO: option to override $Q3BASE from command line - $Q3BASE = $ENV{Q3BASE}; # FIXME: this doesn't play nice with cygwin path syntax - print("\$Q3BASE: $Q3BASE\n"); - - if($config eq 'debug') - { - $DIR = 'Debug'; - system("cp -v $DIR/quake3.exe \$Q3BASE"); - system("cp -v $DIR/cgamex86.dll $DIR/qagamex86.dll $DIR/uix86.dll \$Q3BASE/baseq3"); - } - elsif ($config eq 'debug-TA') - { - $DIR = 'Debug_TA'; - system("cp -v $DIR/quake3.exe \$Q3BASE"); - system("cp -v $DIR/cgamex86.dll $DIR/qagamex86.dll $DIR/uix86.dll \$Q3BASE/missionpack"); - } - elsif($config eq 'release-TA') - { - $DIR = 'Release_TA'; - # spank! - system("./spank.sh"); - system("cp -v $DIR/quake3.exe \$Q3BASE"); - } - else - { - printf("ERROR: no config option (debug debug-TA release-TA)"); - exit; - } - - # copy selected stuff to shared media - $DESTDIR='/cygdrive/e/incoming/Id/q3-1.32'; - system("cp -v $DIR/quake3.exe $DESTDIR"); - system("cp -v /cygdrive/e/Q3SetupMedia/quake3/CHANGES-1.32.txt $DESTDIR"); - - exit; -} - -if(@ARGV gt 0) -{ - foreach $cmdopt (@ARGV) - { - if(lc($cmdopt) eq 'release') - { - $config = 'release'; - next; - } - elsif(lc($cmdopt) eq 'debug') - { - $config = 'debug'; - next; - } - elsif(lc($cmdopt) eq 'novm') - { - $NO_VM = 1; - next; - } - elsif(lc($cmdopt) eq 'noso') - { - $NO_SO = 1; - next; - } - elsif(lc($cmdopt) eq 'nosmp') - { - $do_smp = 0; - next; - } - elsif(lc($cmdopt) =~ 'master_server=.*') - { - $do_masterserver = 1; - $master_server = lc($cmdopt); - $master_server =~ s/master_server=(.*)/\1/; - next; - } - elsif(lc($cmdopt) =~ 'auth_server=.*') - { - $do_authserver = 1; - $auth_server = lc($cmdopt); - $auth_server =~ s/auth_server=(.*)/\1/; - next; - } - elsif(lc($cmdopt) =~ 'auth_port=.*') - { - $do_authport = 1; - $auth_port = lc($cmdopt); - $auth_port =~ s/auth_port=(.*)/\1/; - next; - } - elsif(lc($cmdopt) =~ 'setup') - { - $do_setup = 1; - next; - } - elsif(lc($cmdopt) =~ 'bspc') - { - $do_bspc = 1; - next; - } - elsif(lc($cmdopt) =~ 'sdk') - { - $do_sdk = 1; - next; - } - elsif(lc($cmdopt) =~ 'pk3') - { - $do_pk3 = 1; - next; - } - elsif(lc($cmdopt) =~ 'gcc=.*') - { - $CC=lc($cmdopt); - $CC =~ s/gcc=(.*)/\1/; - next; - } - elsif(lc($cmdopt) =~ 'g\+\+=.*') - { - $CXX=lc($cmdopt); - $CXX=~s/g\+\+=(.*)/\1/; - next; - } - else - { - # output an error & exit - print("Error\n $0: Unknown command line option: [ $cmdopt ]\n"); - system("cons -h"); - exit; - } - } -} - -if (($do_setup eq 1) && ($config ne 'release')) -{ - print("Error\n $0: 'setup' requires 'release'\n"); - exit; -} - -# sdk -if ($do_sdk eq 1) -{ - # extract the Q3 version from q_shared.h - $line = `cat game/q_shared.h | grep Q3_VERSION`; - chomp $line; - $line =~ s/.*Q3\ (.*)\"/$1/; - $Q3_VER = $line; - $SDK_NAME = "linuxq3a-sdk-$Q3_VER.x86.run"; - Default "unix/$SDK_NAME"; - Export qw( SDK_NAME Q3_VER ); - Build 'unix/Conscript-sdk'; - return; -} - -# build the config directory -$CONFIG_DIR = $config . '-' . $cpu . '-' . $OS . '-' . $libc; - -$COMMON_CFLAGS = '-pipe -fsigned-char '; - -if ($config eq 'debug') -{ - # use -Werror for better QA - $BASE_CFLAGS = $COMMON_CFLAGS . '-g -Wall -Werror -O '; - $BSPC_BASE_CFLAGS = $COMMON_CFLAGS . '-g -O -DLINUX -DBSPC -Dstricmp=strcasecmp '; -} -else -{ - $BASE_CFLAGS = $COMMON_CFLAGS . '-DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -fomit-frame-pointer -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce '; - $BSPC_BASE_CFLAGS = $BASE_CFLAGS . '-DLINUX -DBSPC -Dstricmp=strcasecmp '; -} - -if ($do_masterserver eq 1) -{ - $BASE_CFLAGS .= "-DMASTER_SERVER_NAME=\\\"$master_server\\\" "; -} - -if ($do_authserver eq 1) -{ - $BASE_CFLAGS .= "-DAUTHORIZE_SERVER_NAME=\\\"$auth_server\\\" "; -} - -if ($do_authport eq 1) -{ - $BASE_CFLAGS .= "-DPORT_AUTHORIZE=$auth_port "; -} - -my @gcc_version = Cons_gcc::get_gcc_version($CC); -print("GCC version: $gcc_version[1] - $gcc_version[2]\n"); -# with 2.95 you can link with gcc, this avoids nasty useless libstdc++ dependency -if ($gcc_version[0] eq '2') -{ - $LINK = $CC; -} else { - $LINK = $CXX; -} - -my @ccache = Cons_gcc::get_ccache(); -if ($ccache[0] eq '1') -{ - $CC = $ccache[1] . " " . $CC; - $CXX = $ccache[1] . " " . $CXX; -} - -print 'cpu : ' . $cpu . "\nOS : " . $OS . "\n"; -print "libc: " . $libc . "\n"; -print "configured for " . $config . " build\n"; -print 'CFLAGS: ' . $BASE_CFLAGS . "\n"; - -# install config -$INSTALL_BASEDIR='#install'; - -Default $INSTALL_BASEDIR; - -sub build_tools { - system("mkdir qvmtools 2>/dev/null"); - if (@_[0] eq 'q3lcc') - { - system("cd ../lcc ; make all ; cp /tmp/lcc ../code/qvmtools/q3lcc ; cp /tmp/rcc ../code/qvmtools/q3rcc ; cp /tmp/cpp ../code/qvmtools/q3cpp"); - } - elsif (@_[0] eq 'q3asm') - { - system("cd ../q3asm ; make ; cp q3asm ../code/qvmtools"); - } - else - { - printf("build_tools: @_[0] unrecognized command\n"); - die; - } - return 1; -} - -# build tools -$env_tools = new cons(); -Command $env_tools 'qvmtools/q3lcc', '[perl] &build_tools(\'q3lcc\')'; -Command $env_tools 'qvmtools/q3asm', '[perl] &build_tools(\'q3asm\')'; - -if ($do_bspc eq 1) -{ - # build bspc - $BUILD_DIR = $CONFIG_DIR . '/bspc'; - Link $BUILD_DIR => '.'; - $INSTALL_DIR = $INSTALL_BASEDIR . '/utils'; - Export qw( BSPC_BASE_CFLAGS BUILD_DIR INSTALL_DIR CC CXX LINK ); - Build $BUILD_DIR . '/bspc/Conscript'; -} - -# build vanilla Q3 -$TARGET_DIR='Q3'; - -$INSTALL_DIR = $INSTALL_BASEDIR . '/baseq3'; - -$BUILD_DIR = $CONFIG_DIR . '/' . $TARGET_DIR . '/cgame'; -Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); -Build $BUILD_DIR . '/cgame/Conscript'; - -$BUILD_DIR = $CONFIG_DIR . '/' . $TARGET_DIR . '/game'; -Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); -Build $BUILD_DIR . '/game/Conscript'; - -$BUILD_DIR = $CONFIG_DIR . '/' . $TARGET_DIR . '/q3_ui'; -Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); -Build $BUILD_DIR . '/q3_ui/Conscript'; - -# build TA -$TARGET_DIR='TA'; - -$INSTALL_DIR = $INSTALL_BASEDIR . '/missionpack'; - -$BUILD_DIR = $CONFIG_DIR . "/" . $TARGET_DIR . '/cgame'; -Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); -Build $BUILD_DIR . '/cgame/Conscript'; - -$BUILD_DIR = $CONFIG_DIR . "/" . $TARGET_DIR . '/game'; -Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); -Build $BUILD_DIR . '/game/Conscript'; - -$BUILD_DIR = $CONFIG_DIR . '/' . $TARGET_DIR . '/ui'; -Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); -Build $BUILD_DIR . '/ui/Conscript'; - -# core -if ($no_core eq 1) -{ - return; -} - -$INSTALL_DIR = $INSTALL_BASEDIR; -$BUILD_DIR = $CONFIG_DIR . '/core/dedicated'; -Link $BUILD_DIR => '.'; -$hack = $BASE_CFLAGS; # hit me! -$BASE_CFLAGS .= '-DDEDICATED '; -Export qw( BASE_CFLAGS BUILD_DIR INSTALL_DIR CC CXX LINK ); -Build $BUILD_DIR . '/unix/Conscript-dedicated'; -$BASE_CFLAGS = $hack; - - - -$TARGETNAME = 'linuxquake3'; -$BUILD_DIR = $CONFIG_DIR . '/core/client'; -$BASE_LDFLAGS = ''; - -Link $BUILD_DIR => '.'; -Export qw( BASE_CFLAGS BASE_LDFLAGS BUILD_DIR INSTALL_DIR TARGETNAME CC CXX LINK ); -Build $BUILD_DIR . '/unix/Conscript-client'; - -if ($do_smp eq 1) -{ - $TARGETNAME = 'linuxquake3-smp'; - $BUILD_DIR = $CONFIG_DIR . '/core/client-smp'; - $BASE_CFLAGS .= '-DSMP '; - $BASE_LDFLAGS = '-lpthread '; - - Link $BUILD_DIR => '.'; - Export qw( BASE_CFLAGS BASE_LDFLAGS BUILD_DIR INSTALL_DIR TARGETNAME CC CXX LINK ); - Build $BUILD_DIR . '/unix/Conscript-client'; -} - -if ($NO_VM eq 0 && $do_pk3 eq 1) -{ - # build the PK3s - $INSTALL_DIR = $INSTALL_BASEDIR; - $BUILD_DIR = $CONFIG_DIR . '/pk3-builder'; - Link $BUILD_DIR => 'unix'; - Export qw( INSTALL_DIR BUILD_DIR CONFIG_DIR CC CXX LINK ); - Build $BUILD_DIR . '/Conscript-pk3'; -} - -if ($do_setup eq 1) -{ - Link $CONFIG_DIR => '.'; - Export qw( INSTALL_BASEDIR ); - Build $CONFIG_DIR . '/unix/Conscript-setup'; -} - -Help -" -Usage: cons [-h] [ -- [release|debug] [novm] [noso] [nosmp] [master_server=] [auth_server=] [auth_port=] [pk3] [bspc] [setup] [sdk]] -Default build type is Debug, specifying '-- release' on the -command line builds a Release version (NOTE that this option -only affects the native libraries). - -novm: will not build the VMs -noso: will not build the so - -below are for core builds only: - -nosmp : do not build the SMP-enabled version of the renderer -pk3 : generate the pk3s on the fly (defined in unix/Conscript-pk3) -bspc : build bspc -setup : build setup -sdk : build the mod sdk -" -; diff --git a/code/Makefile b/code/Makefile deleted file mode 100644 index 5e403ae..0000000 --- a/code/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -# nasty ugly to get build system working from Anjuta -all: - if [ `hostname` == sparkle ] ; then ./unix/pcons-2.3.1 -j4 -- novm noso ; else ./unix/cons ; fi diff --git a/code/botlib/botlib.vcproj b/code/botlib/botlib.vcproj deleted file mode 100644 index 498c788..0000000 --- a/code/botlib/botlib.vcproj +++ /dev/null @@ -1,1559 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/botlib/lcc.mak b/code/botlib/lcc.mak deleted file mode 100644 index f5567c3..0000000 --- a/code/botlib/lcc.mak +++ /dev/null @@ -1,55 +0,0 @@ -# -# Makefile for Gladiator Bot library: gladiator.dll -# Intended for LCC-Win32 -# - -CC=lcc -CFLAGS=-DC_ONLY -o -OBJS= be_aas_bspq2.obj \ - be_aas_bsphl.obj \ - be_aas_cluster.obj \ - be_aas_debug.obj \ - be_aas_entity.obj \ - be_aas_file.obj \ - be_aas_light.obj \ - be_aas_main.obj \ - be_aas_move.obj \ - be_aas_optimize.obj \ - be_aas_reach.obj \ - be_aas_route.obj \ - be_aas_routealt.obj \ - be_aas_sample.obj \ - be_aas_sound.obj \ - be_ai2_dm.obj \ - be_ai2_dmnet.obj \ - be_ai2_main.obj \ - be_ai_char.obj \ - be_ai_chat.obj \ - be_ai_goal.obj \ - be_ai_load.obj \ - be_ai_move.obj \ - be_ai_weap.obj \ - be_ai_weight.obj \ - be_ea.obj \ - be_interface.obj \ - l_crc.obj \ - l_libvar.obj \ - l_log.obj \ - l_memory.obj \ - l_precomp.obj \ - l_script.obj \ - l_struct.obj \ - l_utils.obj \ - q_shared.obj - -all: gladiator.dll - -gladiator.dll: $(OBJS) - lcclnk -dll -entry GetBotAPI *.obj botlib.def -o gladiator.dll - -clean: - del *.obj gladiator.dll - -%.obj: %.c - $(CC) $(CFLAGS) $< - diff --git a/code/botlib/linux-i386.mak b/code/botlib/linux-i386.mak deleted file mode 100644 index c9607a7..0000000 --- a/code/botlib/linux-i386.mak +++ /dev/null @@ -1,92 +0,0 @@ -# -# Makefile for Gladiator Bot library: gladiator.so -# Intended for gcc/Linux -# - -ARCH=i386 -CC=gcc -BASE_CFLAGS=-Dstricmp=strcasecmp - -#use these cflags to optimize it -CFLAGS=$(BASE_CFLAGS) -m486 -O6 -ffast-math -funroll-loops \ - -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ - -malign-jumps=2 -malign-functions=2 -#use these when debugging -#CFLAGS=$(BASE_CFLAGS) -g - -LDFLAGS=-ldl -lm -SHLIBEXT=so -SHLIBCFLAGS=-fPIC -SHLIBLDFLAGS=-shared - -DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< - -############################################################################# -# SETUP AND BUILD -# GLADIATOR BOT -############################################################################# - -.c.o: - $(DO_CC) - -GAME_OBJS = \ - be_aas_bsphl.o\ - be_aas_bspq2.o\ - be_aas_cluster.o\ - be_aas_debug.o\ - be_aas_entity.o\ - be_aas_file.o\ - be_aas_light.o\ - be_aas_main.o\ - be_aas_move.o\ - be_aas_optimize.o\ - be_aas_reach.o\ - be_aas_route.o\ - be_aas_routealt.o\ - be_aas_sample.o\ - be_aas_sound.o\ - be_ai2_dmq2.o\ - be_ai2_dmhl.o\ - be_ai2_dmnet.o\ - be_ai2_main.o\ - be_ai_char.o\ - be_ai_chat.o\ - be_ai_goal.o\ - be_ai_load.o\ - be_ai_move.o\ - be_ai_weap.o\ - be_ai_weight.o\ - be_ea.o\ - be_interface.o\ - l_crc.o\ - l_libvar.o\ - l_log.o\ - l_memory.o\ - l_precomp.o\ - l_script.o\ - l_struct.o\ - l_utils.o\ - q_shared.o - -glad$(ARCH).$(SHLIBEXT) : $(GAME_OBJS) - $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(GAME_OBJS) - - -############################################################################# -# MISC -############################################################################# - -clean: - -rm -f $(GAME_OBJS) - -depend: - gcc -MM $(GAME_OBJS:.o=.c) - - -install: - cp gladiator.so .. - -# -# From "make depend" -# - diff --git a/code/bspc/Conscript b/code/bspc/Conscript deleted file mode 100644 index 264e7c7..0000000 --- a/code/bspc/Conscript +++ /dev/null @@ -1,75 +0,0 @@ -# bspc compile - -Import qw( BSPC_BASE_CFLAGS BUILD_DIR INSTALL_DIR CC CXX LINK ); - -@BSPC_FILES = qw( - aas_areamerging.c - aas_cfg.c - aas_create.c - aas_edgemelting.c - aas_facemerging.c - aas_file.c - aas_gsubdiv.c - aas_map.c - aas_prunenodes.c - aas_store.c - be_aas_bspc.c - ../botlib/be_aas_bspq3.c - ../botlib/be_aas_cluster.c - ../botlib/be_aas_move.c - ../botlib/be_aas_optimize.c - ../botlib/be_aas_reach.c - ../botlib/be_aas_sample.c - brushbsp.c - bspc.c - ../qcommon/cm_load.c - ../qcommon/cm_patch.c - ../qcommon/cm_test.c - ../qcommon/cm_trace.c - csg.c - glfile.c - l_bsp_ent.c - l_bsp_hl.c - l_bsp_q1.c - l_bsp_q2.c - l_bsp_q3.c - l_bsp_sin.c - l_cmd.c - ../botlib/l_libvar.c - l_log.c - l_math.c - l_mem.c - l_poly.c - ../botlib/l_precomp.c - l_qfiles.c - ../botlib/l_script.c - ../botlib/l_struct.c - l_threads.c - l_utils.c - leakfile.c - map.c - map_hl.c - map_q1.c - map_q2.c - map_q3.c - map_sin.c - ../qcommon/md4.c - nodraw.c - portals.c - textures.c - tree.c - ../qcommon/unzip.c - ); -$BSPC_REF = \@BSPC_FILES; - -$env = new cons( - CC => $CC, - CXX => $CXX, - LINK => $LINK, - CFLAGS => $BSPC_BASE_CFLAGS, - LIBS => '-ldl -lm -lpthread' -); - -Program $env 'bspc', @$BSPC_REF; -# this should install to Q3 or something? -Install $env $INSTALL_DIR, 'bspc'; diff --git a/code/bspc/Makefile b/code/bspc/Makefile deleted file mode 100644 index b6d3b94..0000000 --- a/code/bspc/Makefile +++ /dev/null @@ -1,114 +0,0 @@ -# -# Makefile for the BSPC tool for the Gladiator Bot -# Intended for gcc/Linux -# -# TTimo 5/15/2001 -# some cleanup .. only used on i386 for GtkRadiant setups AFAIK .. removing the i386 tag -# TODO: the intermediate object files should go into their own directory -# specially for ../botlib and ../qcommon, the compilation flags on those might not be what you expect - -#ARCH=i386 -CC=gcc -BASE_CFLAGS=-Dstricmp=strcasecmp - -#use these cflags to optimize it -CFLAGS=$(BASE_CFLAGS) -m486 -O6 -ffast-math -funroll-loops \ - -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ - -malign-jumps=2 -malign-functions=2 -DLINUX -DBSPC -#use these when debugging -#CFLAGS=$(BASE_CFLAGS) -g - -LDFLAGS=-ldl -lm -lpthread - -DO_CC=$(CC) $(CFLAGS) -o $@ -c $< - -############################################################################# -# SETUP AND BUILD BSPC -############################################################################# - -.c.o: - $(DO_CC) - -GAME_OBJS = \ - _files.o\ - aas_areamerging.o\ - aas_cfg.o\ - aas_create.o\ - aas_edgemelting.o\ - aas_facemerging.o\ - aas_file.o\ - aas_gsubdiv.o\ - aas_map.o\ - aas_prunenodes.o\ - aas_store.o\ - be_aas_bspc.o\ - ../botlib/be_aas_bspq3.o\ - ../botlib/be_aas_cluster.o\ - ../botlib/be_aas_move.o\ - ../botlib/be_aas_optimize.o\ - ../botlib/be_aas_reach.o\ - ../botlib/be_aas_sample.o\ - brushbsp.o\ - bspc.o\ - ../qcommon/cm_load.o\ - ../qcommon/cm_patch.o\ - ../qcommon/cm_test.o\ - ../qcommon/cm_trace.o\ - csg.o\ - glfile.o\ - l_bsp_ent.o\ - l_bsp_hl.o\ - l_bsp_q1.o\ - l_bsp_q2.o\ - l_bsp_q3.o\ - l_bsp_sin.o\ - l_cmd.o\ - ../botlib/l_libvar.o\ - l_log.o\ - l_math.o\ - l_mem.o\ - l_poly.o\ - ../botlib/l_precomp.o\ - l_qfiles.o\ - ../botlib/l_script.o\ - ../botlib/l_struct.o\ - l_threads.o\ - l_utils.o\ - leakfile.o\ - map.o\ - map_hl.o\ - map_q1.o\ - map_q2.o\ - map_q3.o\ - map_sin.o\ - ../qcommon/md4.o\ - nodraw.o\ - portals.o\ - textures.o\ - tree.o\ - ../qcommon/unzip.o - - #tetrahedron.o - -bspc : $(GAME_OBJS) - $(CC) $(CFLAGS) -o $@ $(GAME_OBJS) $(LDFLAGS) - strip $@ - - -############################################################################# -# MISC -############################################################################# - -clean: - -rm -f $(GAME_OBJS) - -depend: - gcc -MM $(GAME_OBJS:.o=.c) - -#install: -# cp bspci386 .. - -# -# From "make depend" -# - diff --git a/code/bspc/lcc.mak b/code/bspc/lcc.mak deleted file mode 100644 index 1b99864..0000000 --- a/code/bspc/lcc.mak +++ /dev/null @@ -1,61 +0,0 @@ -# -# Makefile for the BSPC tool for the Gladiator Bot -# Intended for LCC-Win32 -# - -CC=lcc -CFLAGS=-DC_ONLY -o -OBJS= _files.obj\ - aas_areamerging.obj\ - aas_cfg.obj\ - aas_create.obj\ - aas_edgemelting.obj\ - aas_facemerging.obj\ - aas_file.obj\ - aas_gsubdiv.obj\ - aas_map.obj\ - aas_prunenodes.obj\ - aas_store.obj\ - brushbsp.obj\ - bspc.obj\ - csg.obj\ - faces.obj\ - glfile.obj\ - l_bsp_hl.obj\ - l_bsp_q1.obj\ - l_bsp_q2.obj\ - l_bsp_sin.obj\ - l_cmd.obj\ - l_log.obj\ - l_math.obj\ - l_mem.obj\ - l_poly.obj\ - l_qfiles.obj\ - l_script.obj\ - l_threads.obj\ - l_utils.obj\ - leakfile.obj\ - map.obj\ - map_hl.obj\ - map_q1.obj\ - map_q2.obj\ - map_q2_new.obj\ - map_sin.obj\ - nodraw.obj\ - portals.obj\ - prtfile.obj\ - textures.obj\ - tree.obj\ - writebsp.obj - -all: bspc.exe - -bspc.exe: $(OBJS) - lcclnk - -clean: - del *.obj bspc.exe - -%.obj: %.c - $(CC) $(CFLAGS) $< - diff --git a/code/bspc/linux-i386.mak b/code/bspc/linux-i386.mak deleted file mode 100644 index dd9566d..0000000 --- a/code/bspc/linux-i386.mak +++ /dev/null @@ -1,109 +0,0 @@ -# -# Makefile for the BSPC tool for the Gladiator Bot -# Intended for gcc/Linux -# - -ARCH=i386 -CC=gcc -BASE_CFLAGS=-Dstricmp=strcasecmp - -#use these cflags to optimize it -CFLAGS=$(BASE_CFLAGS) -m486 -O6 -ffast-math -funroll-loops \ - -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ - -malign-jumps=2 -malign-functions=2 -DLINUX -DBSPC -#use these when debugging -#CFLAGS=$(BASE_CFLAGS) -g - -LDFLAGS=-ldl -lm -lpthread - -DO_CC=$(CC) $(CFLAGS) -o $@ -c $< - -############################################################################# -# SETUP AND BUILD BSPC -############################################################################# - -.c.o: - $(DO_CC) - -GAME_OBJS = \ - _files.o\ - aas_areamerging.o\ - aas_cfg.o\ - aas_create.o\ - aas_edgemelting.o\ - aas_facemerging.o\ - aas_file.o\ - aas_gsubdiv.o\ - aas_map.o\ - aas_prunenodes.o\ - aas_store.o\ - be_aas_bspc.o\ - ../botlib/be_aas_bspq3.o\ - ../botlib/be_aas_cluster.o\ - ../botlib/be_aas_move.o\ - ../botlib/be_aas_optimize.o\ - ../botlib/be_aas_reach.o\ - ../botlib/be_aas_sample.o\ - brushbsp.o\ - bspc.o\ - ../qcommon/cm_load.o\ - ../qcommon/cm_patch.o\ - ../qcommon/cm_test.o\ - ../qcommon/cm_trace.o\ - csg.o\ - glfile.o\ - l_bsp_ent.o\ - l_bsp_hl.o\ - l_bsp_q1.o\ - l_bsp_q2.o\ - l_bsp_q3.o\ - l_bsp_sin.o\ - l_cmd.o\ - ../botlib/l_libvar.o\ - l_log.o\ - l_math.o\ - l_mem.o\ - l_poly.o\ - ../botlib/l_precomp.o\ - l_qfiles.o\ - ../botlib/l_script.o\ - ../botlib/l_struct.o\ - l_threads.o\ - l_utils.o\ - leakfile.o\ - map.o\ - map_hl.o\ - map_q1.o\ - map_q2.o\ - map_q3.o\ - map_sin.o\ - ../qcommon/md4.o\ - nodraw.o\ - portals.o\ - tetrahedron.o\ - textures.o\ - tree.o\ - ../qcommon/unzip.o - -bspc$(ARCH) : $(GAME_OBJS) - $(CC) $(CFLAGS) -o $@ $(GAME_OBJS) $(LDFLAGS) - - -############################################################################# -# MISC -############################################################################# - -clean: - -rm -f $(GAME_OBJS) - -depend: - gcc -MM $(GAME_OBJS:.o=.c) - - -install: - cp bspci386 .. - -# -# From "make depend" -# - diff --git a/code/cgame.lnt b/code/cgame.lnt deleted file mode 100644 index 713f962..0000000 --- a/code/cgame.lnt +++ /dev/null @@ -1,25 +0,0 @@ -opts.lnt - -game\bg_misc.c -game\bg_pmove.c -game\q_math.c -game\q_shared.c -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_localents.c -cgame\cg_main.c -cgame\cg_marks.c -cgame\cg_players.c -cgame\cg_playerstate.c -cgame\cg_predict.c -cgame\cg_scoreboard.c -cgame\cg_servercmds.c -cgame\cg_snapshot.c -cgame\cg_syscalls.c -cgame\cg_view.c -cgame\cg_weapons.c diff --git a/code/cgame/Conscript b/code/cgame/Conscript deleted file mode 100644 index 0cac8ff..0000000 --- a/code/cgame/Conscript +++ /dev/null @@ -1,138 +0,0 @@ -# cgame building -# builds the cgame for vanilla Q3 and TA - -# there are slight differences between Q3 and TA build: -# -DMISSIONPACK -# TA has cg_newdraw.c and ../ui/ui_shared.c -# the config is passed in the imported variable TARGET_DIR - -# qvm building against native: -# only native has cg_syscalls.c -# only qvm has ../game/bg_lib.c -# qvm uses a custom cg_syscalls.asm with equ stubs - -Import qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); - -$env = new cons( - # the code has the very bad habit of doing things like #include "../ui/ui_shared.h" - # this seems to confuse the dependency analysis, explicit toplevel includes seem to fix - CPPPATH => '#cgame:#game:#q3_ui', - CC => $CC, - CXX => $CXX, - LINK => $LINK, - ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }, - CFLAGS => $BASE_CFLAGS . '-fPIC', - LDFLAGS => '-shared -ldl -lm' -); - -# for TA, use -DMISSIONPACK -%ta_env_hash = $env->copy( - CPPPATH => '#cgame:#game:#ui' - ); -$ta_env_hash{CFLAGS} = '-DMISSIONPACK ' . $ta_env_hash{CFLAGS}; -$ta_env = new cons(%ta_env_hash); - -# qvm building -# we heavily customize the cons environment -$vm_env = new cons( - # the code has the very bad habit of doing things like #include "../ui/ui_shared.h" - # this seems to confuse the dependency analysis, explicit toplevel includes seem to fix - CPPPATH => '#cgame:#game:#q3_ui', - CC => 'q3lcc', - CCCOM => '%CC %CFLAGS %_IFLAGS -c %< -o %>', - SUFOBJ => '.asm', - LINK => 'q3asm', - CFLAGS => '-DQ3_VM -DCGAME -S -Wf-target=bytecode -Wf-g', - # need to know where to find the compiler tools - ENV => { PATH => $ENV{PATH} . ":./qvmtools", }, -); - -# TA qvm building -%vm_ta_env_hash = $vm_env->copy( - CPPPATH => '#cgame:#game:#ui' - ); -$vm_ta_env_hash{CFLAGS} = '-DMISSIONPACK ' . $vm_ta_env_hash{CFLAGS}; -$vm_ta_env = new cons(%vm_ta_env_hash); - -# the file with vmMain function MUST be the first one of the list -@FILES = qw( - cg_main.c - ../game/bg_misc.c - ../game/bg_pmove.c - ../game/bg_slidemove.c - ../game/q_math.c - ../game/q_shared.c - cg_consolecmds.c - cg_draw.c - cg_drawtools.c - cg_effects.c - cg_ents.c - cg_event.c - cg_info.c - cg_localents.c - cg_marks.c - cg_players.c - cg_playerstate.c - cg_predict.c - cg_scoreboard.c - cg_servercmds.c - cg_snapshot.c - cg_view.c - cg_weapons.c - ); -$FILESREF = \@FILES; - -# only in .so -# (VM uses a custom .asm with equ stubs) -@SO_FILES = qw( - cg_syscalls.c - ); -$SO_FILESREF = \@SO_FILES; - -# only for VM -@VM_FILES = qw( - ../game/bg_lib.c - cg_syscalls.asm - ); -$VM_FILESREF = \@VM_FILES; - -# common additionals for TA -@TA_FILES = qw( - cg_newdraw.c - ../ui/ui_shared.c - ); -$TA_FILESREF = \@TA_FILES; - -# FIXME CPU string -if ($TARGET_DIR eq 'Q3') -{ - if ($NO_SO eq 0) - { - Program $env 'cgamei386.so', @$FILESREF, @$SO_FILESREF; - Install $env $INSTALL_DIR, 'cgamei386.so'; - } - if ($NO_VM eq 0) - { - Depends $vm_env 'cgame.qvm', '#qvmtools/q3lcc'; - Depends $vm_env 'cgame.qvm', '#qvmtools/q3asm'; - Program $vm_env 'cgame.qvm', @$FILESREF, @$VM_FILESREF; - Install $vm_env $INSTALL_DIR . '/vm', 'cgame.qvm'; - } -} -else -{ - if ($NO_SO eq 0) - { - Program $ta_env 'cgamei386.so', - @$FILESREF, @$SO_FILESREF, @$TA_FILESREF; - Install $ta_env $INSTALL_DIR, 'cgamei386.so'; - } - if ($NO_VM eq 0) - { - Depends $vm_env 'cgame.qvm', '#qvmtools/q3lcc'; - Depends $vm_env 'cgame.qvm', '#qvmtools/q3asm'; - Program $vm_ta_env 'cgame.qvm', - @$FILESREF, @$VM_FILESREF, @$TA_FILESREF; - Install $vm_ta_env $INSTALL_DIR . '/vm', 'cgame.qvm'; - } -} diff --git a/code/cgame/cg_consolecmds.c b/code/cgame/cg_consolecmds.c index 584ebd4..34cb6c8 100644 --- a/code/cgame/cg_consolecmds.c +++ b/code/cgame/cg_consolecmds.c @@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // executed by a key binding #include "cg_local.h" -#include "../ui/ui_shared.h" #ifdef MISSIONPACK extern menuDef_t *menuScoreboard; #endif diff --git a/code/cgame/cg_effects.c b/code/cgame/cg_effects.c index a29b856..8065433 100644 --- a/code/cgame/cg_effects.c +++ b/code/cgame/cg_effects.c @@ -142,19 +142,12 @@ localEntity_t *CG_SmokePuff( const vec3_t p, const vec3_t vel, VectorCopy( p, re->origin ); re->customShader = hShader; - // rage pro can't alpha fade, so use a different shader - if ( cgs.glconfig.hardwareType == GLHW_RAGEPRO ) { - re->customShader = cgs.media.smokePuffRageProShader; - re->shaderRGBA[0] = 0xff; - re->shaderRGBA[1] = 0xff; - re->shaderRGBA[2] = 0xff; - re->shaderRGBA[3] = 0xff; - } else { - re->shaderRGBA[0] = le->color[0] * 0xff; - re->shaderRGBA[1] = le->color[1] * 0xff; - re->shaderRGBA[2] = le->color[2] * 0xff; - re->shaderRGBA[3] = 0xff; - } + + re->shaderRGBA[0] = le->color[0] * 0xff; + re->shaderRGBA[1] = le->color[1] * 0xff; + re->shaderRGBA[2] = le->color[2] * 0xff; + re->shaderRGBA[3] = 0xff; + re->reType = RT_SPRITE; re->radius = le->radius; diff --git a/code/cgame/cg_marks.c b/code/cgame/cg_marks.c index d0fecaa..7717308 100644 --- a/code/cgame/cg_marks.c +++ b/code/cgame/cg_marks.c @@ -703,9 +703,6 @@ void CG_AddParticleToScene (cparticle_t *p, vec3_t org, float alpha) else invratio = 1 * p->alpha; - if ( cgs.glconfig.hardwareType == GLHW_RAGEPRO ) - invratio = 1; - if (invratio > 1) invratio = 1; @@ -808,9 +805,6 @@ void CG_AddParticleToScene (cparticle_t *p, vec3_t org, float alpha) alpha = p->alpha; - if ( cgs.glconfig.hardwareType == GLHW_RAGEPRO ) - alpha = 1; - if (p->roll) { vectoangles( cg.refdef.viewaxis[0], rotate_ang ); diff --git a/code/cgame/cg_newdraw.c b/code/cgame/cg_newdraw.c deleted file mode 100644 index c78fff9..0000000 --- a/code/cgame/cg_newdraw.c +++ /dev/null @@ -1,1852 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ - -#ifndef MISSIONPACK // bk001204 -#error This file not be used for classic Q3A. -#endif - -#include "cg_local.h" -#include "../ui/ui_shared.h" - -extern displayContextDef_t cgDC; - - -// set in CG_ParseTeamInfo - -//static int sortedTeamPlayers[TEAM_MAXOVERLAY]; -//static int numSortedTeamPlayers; -int drawTeamOverlayModificationCount = -1; - -//static char systemChat[256]; -//static char teamChat1[256]; -//static char teamChat2[256]; - -void CG_InitTeamChat() { - memset(teamChat1, 0, sizeof(teamChat1)); - memset(teamChat2, 0, sizeof(teamChat2)); - memset(systemChat, 0, sizeof(systemChat)); -} - -void CG_SetPrintString(int type, const char *p) { - if (type == SYSTEM_PRINT) { - strcpy(systemChat, p); - } else { - strcpy(teamChat2, teamChat1); - strcpy(teamChat1, p); - } -} - -void CG_CheckOrderPending() { - if (cgs.gametype < GT_CTF) { - return; - } - if (cgs.orderPending) { - //clientInfo_t *ci = cgs.clientinfo + sortedTeamPlayers[cg_currentSelectedPlayer.integer]; - const char *p1, *p2, *b; - p1 = p2 = b = NULL; - switch (cgs.currentOrder) { - case TEAMTASK_OFFENSE: - p1 = VOICECHAT_ONOFFENSE; - p2 = VOICECHAT_OFFENSE; - b = "+button7; wait; -button7"; - break; - case TEAMTASK_DEFENSE: - p1 = VOICECHAT_ONDEFENSE; - p2 = VOICECHAT_DEFEND; - b = "+button8; wait; -button8"; - break; - case TEAMTASK_PATROL: - p1 = VOICECHAT_ONPATROL; - p2 = VOICECHAT_PATROL; - b = "+button9; wait; -button9"; - break; - case TEAMTASK_FOLLOW: - p1 = VOICECHAT_ONFOLLOW; - p2 = VOICECHAT_FOLLOWME; - b = "+button10; wait; -button10"; - break; - case TEAMTASK_CAMP: - p1 = VOICECHAT_ONCAMPING; - p2 = VOICECHAT_CAMP; - break; - case TEAMTASK_RETRIEVE: - p1 = VOICECHAT_ONGETFLAG; - p2 = VOICECHAT_RETURNFLAG; - break; - case TEAMTASK_ESCORT: - p1 = VOICECHAT_ONFOLLOWCARRIER; - p2 = VOICECHAT_FOLLOWFLAGCARRIER; - break; - } - - if (cg_currentSelectedPlayer.integer == numSortedTeamPlayers) { - // to everyone - trap_SendConsoleCommand(va("cmd vsay_team %s\n", p2)); - } else { - // for the player self - if (sortedTeamPlayers[cg_currentSelectedPlayer.integer] == cg.snap->ps.clientNum && p1) { - trap_SendConsoleCommand(va("teamtask %i\n", cgs.currentOrder)); - //trap_SendConsoleCommand(va("cmd say_team %s\n", p2)); - trap_SendConsoleCommand(va("cmd vsay_team %s\n", p1)); - } else if (p2) { - //trap_SendConsoleCommand(va("cmd say_team %s, %s\n", ci->name,p)); - trap_SendConsoleCommand(va("cmd vtell %d %s\n", sortedTeamPlayers[cg_currentSelectedPlayer.integer], p2)); - } - } - if (b) { - trap_SendConsoleCommand(b); - } - cgs.orderPending = qfalse; - } -} - -static void CG_SetSelectedPlayerName() { - if (cg_currentSelectedPlayer.integer >= 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) { - clientInfo_t *ci = cgs.clientinfo + sortedTeamPlayers[cg_currentSelectedPlayer.integer]; - if (ci) { - trap_Cvar_Set("cg_selectedPlayerName", ci->name); - trap_Cvar_Set("cg_selectedPlayer", va("%d", sortedTeamPlayers[cg_currentSelectedPlayer.integer])); - cgs.currentOrder = ci->teamTask; - } - } else { - trap_Cvar_Set("cg_selectedPlayerName", "Everyone"); - } -} -int CG_GetSelectedPlayer() { - if (cg_currentSelectedPlayer.integer < 0 || cg_currentSelectedPlayer.integer >= numSortedTeamPlayers) { - cg_currentSelectedPlayer.integer = 0; - } - return cg_currentSelectedPlayer.integer; -} - -void CG_SelectNextPlayer() { - CG_CheckOrderPending(); - if (cg_currentSelectedPlayer.integer >= 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) { - cg_currentSelectedPlayer.integer++; - } else { - cg_currentSelectedPlayer.integer = 0; - } - CG_SetSelectedPlayerName(); -} - -void CG_SelectPrevPlayer() { - CG_CheckOrderPending(); - if (cg_currentSelectedPlayer.integer > 0 && cg_currentSelectedPlayer.integer < numSortedTeamPlayers) { - cg_currentSelectedPlayer.integer--; - } else { - cg_currentSelectedPlayer.integer = numSortedTeamPlayers; - } - CG_SetSelectedPlayerName(); -} - - -static void CG_DrawPlayerArmorIcon( rectDef_t *rect, qboolean draw2D ) { - centity_t *cent; - playerState_t *ps; - vec3_t angles; - vec3_t origin; - - if ( cg_drawStatus.integer == 0 ) { - return; - } - - cent = &cg_entities[cg.snap->ps.clientNum]; - ps = &cg.snap->ps; - - if ( draw2D || ( !cg_draw3dIcons.integer && cg_drawIcons.integer) ) { // bk001206 - parentheses - CG_DrawPic( rect->x, rect->y + rect->h/2 + 1, rect->w, rect->h, cgs.media.armorIcon ); - } else if (cg_draw3dIcons.integer) { - VectorClear( angles ); - origin[0] = 90; - origin[1] = 0; - origin[2] = -10; - angles[YAW] = ( cg.time & 2047 ) * 360 / 2048.0; - - CG_Draw3DModel( rect->x, rect->y, rect->w, rect->h, cgs.media.armorModel, 0, origin, angles ); - } - -} - -static void CG_DrawPlayerArmorValue(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle) { - char num[16]; - int value; - centity_t *cent; - playerState_t *ps; - - cent = &cg_entities[cg.snap->ps.clientNum]; - ps = &cg.snap->ps; - - value = ps->stats[STAT_ARMOR]; - - - if (shader) { - trap_R_SetColor( color ); - CG_DrawPic(rect->x, rect->y, rect->w, rect->h, shader); - trap_R_SetColor( NULL ); - } else { - Com_sprintf (num, sizeof(num), "%i", value); - value = CG_Text_Width(num, scale, 0); - CG_Text_Paint(rect->x + (rect->w - value) / 2, rect->y + rect->h, scale, color, num, 0, 0, textStyle); - } -} - -#ifndef MISSIONPACK // bk001206 -static float healthColors[4][4] = { -// { 0.2, 1.0, 0.2, 1.0 } , { 1.0, 0.2, 0.2, 1.0 }, {0.5, 0.5, 0.5, 1} }; - // bk0101016 - float const - { 1.0f, 0.69f, 0.0f, 1.0f } , // normal - { 1.0f, 0.2f, 0.2f, 1.0f }, // low health - { 0.5f, 0.5f, 0.5f, 1.0f}, // weapon firing - { 1.0f, 1.0f, 1.0f, 1.0f } }; // health > 100 -#endif - -static void CG_DrawPlayerAmmoIcon( rectDef_t *rect, qboolean draw2D ) { - centity_t *cent; - playerState_t *ps; - vec3_t angles; - vec3_t origin; - - cent = &cg_entities[cg.snap->ps.clientNum]; - ps = &cg.snap->ps; - - if ( draw2D || (!cg_draw3dIcons.integer && cg_drawIcons.integer) ) { // bk001206 - parentheses - qhandle_t icon; - icon = cg_weapons[ cg.predictedPlayerState.weapon ].ammoIcon; - if ( icon ) { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, icon ); - } - } else if (cg_draw3dIcons.integer) { - if ( cent->currentState.weapon && cg_weapons[ cent->currentState.weapon ].ammoModel ) { - VectorClear( angles ); - origin[0] = 70; - origin[1] = 0; - origin[2] = 0; - angles[YAW] = 90 + 20 * sin( cg.time / 1000.0 ); - CG_Draw3DModel( rect->x, rect->y, rect->w, rect->h, cg_weapons[ cent->currentState.weapon ].ammoModel, 0, origin, angles ); - } - } -} - -static void CG_DrawPlayerAmmoValue(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle) { - char num[16]; - int value; - centity_t *cent; - playerState_t *ps; - - cent = &cg_entities[cg.snap->ps.clientNum]; - ps = &cg.snap->ps; - - if ( cent->currentState.weapon ) { - value = ps->ammo[cent->currentState.weapon]; - if ( value > -1 ) { - if (shader) { - trap_R_SetColor( color ); - CG_DrawPic(rect->x, rect->y, rect->w, rect->h, shader); - trap_R_SetColor( NULL ); - } else { - Com_sprintf (num, sizeof(num), "%i", value); - value = CG_Text_Width(num, scale, 0); - CG_Text_Paint(rect->x + (rect->w - value) / 2, rect->y + rect->h, scale, color, num, 0, 0, textStyle); - } - } - } - -} - - - -static void CG_DrawPlayerHead(rectDef_t *rect, qboolean draw2D) { - vec3_t angles; - float size, stretch; - float frac; - float x = rect->x; - - VectorClear( angles ); - - if ( cg.damageTime && cg.time - cg.damageTime < DAMAGE_TIME ) { - frac = (float)(cg.time - cg.damageTime ) / DAMAGE_TIME; - size = rect->w * 1.25 * ( 1.5 - frac * 0.5 ); - - stretch = size - rect->w * 1.25; - // kick in the direction of damage - x -= stretch * 0.5 + cg.damageX * stretch * 0.5; - - cg.headStartYaw = 180 + cg.damageX * 45; - - cg.headEndYaw = 180 + 20 * cos( crandom()*M_PI ); - cg.headEndPitch = 5 * cos( crandom()*M_PI ); - - cg.headStartTime = cg.time; - cg.headEndTime = cg.time + 100 + random() * 2000; - } else { - if ( cg.time >= cg.headEndTime ) { - // select a new head angle - cg.headStartYaw = cg.headEndYaw; - cg.headStartPitch = cg.headEndPitch; - cg.headStartTime = cg.headEndTime; - cg.headEndTime = cg.time + 100 + random() * 2000; - - cg.headEndYaw = 180 + 20 * cos( crandom()*M_PI ); - cg.headEndPitch = 5 * cos( crandom()*M_PI ); - } - - size = rect->w * 1.25; - } - - // if the server was frozen for a while we may have a bad head start time - if ( cg.headStartTime > cg.time ) { - cg.headStartTime = cg.time; - } - - frac = ( cg.time - cg.headStartTime ) / (float)( cg.headEndTime - cg.headStartTime ); - frac = frac * frac * ( 3 - 2 * frac ); - angles[YAW] = cg.headStartYaw + ( cg.headEndYaw - cg.headStartYaw ) * frac; - angles[PITCH] = cg.headStartPitch + ( cg.headEndPitch - cg.headStartPitch ) * frac; - - CG_DrawHead( x, rect->y, rect->w, rect->h, cg.snap->ps.clientNum, angles ); -} - -static void CG_DrawSelectedPlayerHealth( rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle ) { - clientInfo_t *ci; - int value; - char num[16]; - - ci = cgs.clientinfo + sortedTeamPlayers[CG_GetSelectedPlayer()]; - if (ci) { - if (shader) { - trap_R_SetColor( color ); - CG_DrawPic(rect->x, rect->y, rect->w, rect->h, shader); - trap_R_SetColor( NULL ); - } else { - Com_sprintf (num, sizeof(num), "%i", ci->health); - value = CG_Text_Width(num, scale, 0); - CG_Text_Paint(rect->x + (rect->w - value) / 2, rect->y + rect->h, scale, color, num, 0, 0, textStyle); - } - } -} - -static void CG_DrawSelectedPlayerArmor( rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle ) { - clientInfo_t *ci; - int value; - char num[16]; - ci = cgs.clientinfo + sortedTeamPlayers[CG_GetSelectedPlayer()]; - if (ci) { - if (ci->armor > 0) { - if (shader) { - trap_R_SetColor( color ); - CG_DrawPic(rect->x, rect->y, rect->w, rect->h, shader); - trap_R_SetColor( NULL ); - } else { - Com_sprintf (num, sizeof(num), "%i", ci->armor); - value = CG_Text_Width(num, scale, 0); - CG_Text_Paint(rect->x + (rect->w - value) / 2, rect->y + rect->h, scale, color, num, 0, 0, textStyle); - } - } - } -} - -qhandle_t CG_StatusHandle(int task) { - qhandle_t h = cgs.media.assaultShader; - switch (task) { - case TEAMTASK_OFFENSE : - h = cgs.media.assaultShader; - break; - case TEAMTASK_DEFENSE : - h = cgs.media.defendShader; - break; - case TEAMTASK_PATROL : - h = cgs.media.patrolShader; - break; - case TEAMTASK_FOLLOW : - h = cgs.media.followShader; - break; - case TEAMTASK_CAMP : - h = cgs.media.campShader; - break; - case TEAMTASK_RETRIEVE : - h = cgs.media.retrieveShader; - break; - case TEAMTASK_ESCORT : - h = cgs.media.escortShader; - break; - default : - h = cgs.media.assaultShader; - break; - } - return h; -} - -static void CG_DrawSelectedPlayerStatus( rectDef_t *rect ) { - clientInfo_t *ci = cgs.clientinfo + sortedTeamPlayers[CG_GetSelectedPlayer()]; - if (ci) { - qhandle_t h; - if (cgs.orderPending) { - // blink the icon - if ( cg.time > cgs.orderTime - 2500 && (cg.time >> 9 ) & 1 ) { - return; - } - h = CG_StatusHandle(cgs.currentOrder); - } else { - h = CG_StatusHandle(ci->teamTask); - } - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, h ); - } -} - - -static void CG_DrawPlayerStatus( rectDef_t *rect ) { - clientInfo_t *ci = &cgs.clientinfo[cg.snap->ps.clientNum]; - if (ci) { - qhandle_t h = CG_StatusHandle(ci->teamTask); - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, h); - } -} - - -static void CG_DrawSelectedPlayerName( rectDef_t *rect, float scale, vec4_t color, qboolean voice, int textStyle) { - clientInfo_t *ci; - ci = cgs.clientinfo + ((voice) ? cgs.currentVoiceClient : sortedTeamPlayers[CG_GetSelectedPlayer()]); - if (ci) { - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, ci->name, 0, 0, textStyle); - } -} - -static void CG_DrawSelectedPlayerLocation( rectDef_t *rect, float scale, vec4_t color, int textStyle ) { - clientInfo_t *ci; - ci = cgs.clientinfo + sortedTeamPlayers[CG_GetSelectedPlayer()]; - if (ci) { - const char *p = CG_ConfigString(CS_LOCATIONS + ci->location); - if (!p || !*p) { - p = "unknown"; - } - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, p, 0, 0, textStyle); - } -} - -static void CG_DrawPlayerLocation( rectDef_t *rect, float scale, vec4_t color, int textStyle ) { - clientInfo_t *ci = &cgs.clientinfo[cg.snap->ps.clientNum]; - if (ci) { - const char *p = CG_ConfigString(CS_LOCATIONS + ci->location); - if (!p || !*p) { - p = "unknown"; - } - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, p, 0, 0, textStyle); - } -} - - - -static void CG_DrawSelectedPlayerWeapon( rectDef_t *rect ) { - clientInfo_t *ci; - - ci = cgs.clientinfo + sortedTeamPlayers[CG_GetSelectedPlayer()]; - if (ci) { - if ( cg_weapons[ci->curWeapon].weaponIcon ) { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cg_weapons[ci->curWeapon].weaponIcon ); - } else { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.deferShader); - } - } -} - -static void CG_DrawPlayerScore( rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle ) { - char num[16]; - int value = cg.snap->ps.persistant[PERS_SCORE]; - - if (shader) { - trap_R_SetColor( color ); - CG_DrawPic(rect->x, rect->y, rect->w, rect->h, shader); - trap_R_SetColor( NULL ); - } else { - Com_sprintf (num, sizeof(num), "%i", value); - value = CG_Text_Width(num, scale, 0); - CG_Text_Paint(rect->x + (rect->w - value) / 2, rect->y + rect->h, scale, color, num, 0, 0, textStyle); - } -} - -static void CG_DrawPlayerItem( rectDef_t *rect, float scale, qboolean draw2D) { - int value; - vec3_t origin, angles; - - value = cg.snap->ps.stats[STAT_HOLDABLE_ITEM]; - if ( value ) { - CG_RegisterItemVisuals( value ); - - if (qtrue) { - CG_RegisterItemVisuals( value ); - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cg_items[ value ].icon ); - } else { - VectorClear( angles ); - origin[0] = 90; - origin[1] = 0; - origin[2] = -10; - angles[YAW] = ( cg.time & 2047 ) * 360 / 2048.0; - CG_Draw3DModel(rect->x, rect->y, rect->w, rect->h, cg_items[ value ].models[0], 0, origin, angles ); - } - } - -} - - -static void CG_DrawSelectedPlayerPowerup( rectDef_t *rect, qboolean draw2D ) { - clientInfo_t *ci; - int j; - float x, y; - - ci = cgs.clientinfo + sortedTeamPlayers[CG_GetSelectedPlayer()]; - if (ci) { - x = rect->x; - y = rect->y; - - for (j = 0; j < PW_NUM_POWERUPS; j++) { - if (ci->powerups & (1 << j)) { - gitem_t *item; - item = BG_FindItemForPowerup( j ); - if (item) { - CG_DrawPic( x, y, rect->w, rect->h, trap_R_RegisterShader( item->icon ) ); - x += 3; - y += 3; - return; - } - } - } - - } -} - - -static void CG_DrawSelectedPlayerHead( rectDef_t *rect, qboolean draw2D, qboolean voice ) { - clipHandle_t cm; - clientInfo_t *ci; - float len; - vec3_t origin; - vec3_t mins, maxs, angles; - - - ci = cgs.clientinfo + ((voice) ? cgs.currentVoiceClient : sortedTeamPlayers[CG_GetSelectedPlayer()]); - - if (ci) { - if ( cg_draw3dIcons.integer ) { - cm = ci->headModel; - if ( !cm ) { - return; - } - - // offset the origin y and z to center the head - trap_R_ModelBounds( cm, mins, maxs ); - - origin[2] = -0.5 * ( mins[2] + maxs[2] ); - origin[1] = 0.5 * ( mins[1] + maxs[1] ); - - // calculate distance so the head nearly fills the box - // assume heads are taller than wide - len = 0.7 * ( maxs[2] - mins[2] ); - origin[0] = len / 0.268; // len / tan( fov/2 ) - - // allow per-model tweaking - VectorAdd( origin, ci->headOffset, origin ); - - angles[PITCH] = 0; - angles[YAW] = 180; - angles[ROLL] = 0; - - CG_Draw3DModel( rect->x, rect->y, rect->w, rect->h, ci->headModel, ci->headSkin, origin, angles ); - } else if ( cg_drawIcons.integer ) { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, ci->modelIcon ); - } - - // if they are deferred, draw a cross out - if ( ci->deferred ) { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.deferShader ); - } - } - -} - - -static void CG_DrawPlayerHealth(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle ) { - playerState_t *ps; - int value; - char num[16]; - - ps = &cg.snap->ps; - - value = ps->stats[STAT_HEALTH]; - - if (shader) { - trap_R_SetColor( color ); - CG_DrawPic(rect->x, rect->y, rect->w, rect->h, shader); - trap_R_SetColor( NULL ); - } else { - Com_sprintf (num, sizeof(num), "%i", value); - value = CG_Text_Width(num, scale, 0); - CG_Text_Paint(rect->x + (rect->w - value) / 2, rect->y + rect->h, scale, color, num, 0, 0, textStyle); - } -} - - -static void CG_DrawRedScore(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle ) { - int value; - char num[16]; - if ( cgs.scores1 == SCORE_NOT_PRESENT ) { - Com_sprintf (num, sizeof(num), "-"); - } - else { - Com_sprintf (num, sizeof(num), "%i", cgs.scores1); - } - value = CG_Text_Width(num, scale, 0); - CG_Text_Paint(rect->x + rect->w - value, rect->y + rect->h, scale, color, num, 0, 0, textStyle); -} - -static void CG_DrawBlueScore(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle ) { - int value; - char num[16]; - - if ( cgs.scores2 == SCORE_NOT_PRESENT ) { - Com_sprintf (num, sizeof(num), "-"); - } - else { - Com_sprintf (num, sizeof(num), "%i", cgs.scores2); - } - value = CG_Text_Width(num, scale, 0); - CG_Text_Paint(rect->x + rect->w - value, rect->y + rect->h, scale, color, num, 0, 0, textStyle); -} - -// FIXME: team name support -static void CG_DrawRedName(rectDef_t *rect, float scale, vec4_t color, int textStyle ) { - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, cg_redTeamName.string , 0, 0, textStyle); -} - -static void CG_DrawBlueName(rectDef_t *rect, float scale, vec4_t color, int textStyle ) { - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, cg_blueTeamName.string, 0, 0, textStyle); -} - -static void CG_DrawBlueFlagName(rectDef_t *rect, float scale, vec4_t color, int textStyle ) { - int i; - for ( i = 0 ; i < cgs.maxclients ; i++ ) { - if ( cgs.clientinfo[i].infoValid && cgs.clientinfo[i].team == TEAM_RED && cgs.clientinfo[i].powerups & ( 1<< PW_BLUEFLAG )) { - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, cgs.clientinfo[i].name, 0, 0, textStyle); - return; - } - } -} - -static void CG_DrawBlueFlagStatus(rectDef_t *rect, qhandle_t shader) { - if (cgs.gametype != GT_CTF && cgs.gametype != GT_1FCTF) { - if (cgs.gametype == GT_HARVESTER) { - vec4_t color = {0, 0, 1, 1}; - trap_R_SetColor(color); - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.blueCubeIcon ); - trap_R_SetColor(NULL); - } - return; - } - if (shader) { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader ); - } else { - gitem_t *item = BG_FindItemForPowerup( PW_BLUEFLAG ); - if (item) { - vec4_t color = {0, 0, 1, 1}; - trap_R_SetColor(color); - if( cgs.blueflag >= 0 && cgs.blueflag <= 2 ) { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.flagShaders[cgs.blueflag] ); - } else { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.flagShaders[0] ); - } - trap_R_SetColor(NULL); - } - } -} - -static void CG_DrawBlueFlagHead(rectDef_t *rect) { - int i; - for ( i = 0 ; i < cgs.maxclients ; i++ ) { - if ( cgs.clientinfo[i].infoValid && cgs.clientinfo[i].team == TEAM_RED && cgs.clientinfo[i].powerups & ( 1<< PW_BLUEFLAG )) { - vec3_t angles; - VectorClear( angles ); - angles[YAW] = 180 + 20 * sin( cg.time / 650.0 );; - CG_DrawHead( rect->x, rect->y, rect->w, rect->h, 0,angles ); - return; - } - } -} - -static void CG_DrawRedFlagName(rectDef_t *rect, float scale, vec4_t color, int textStyle ) { - int i; - for ( i = 0 ; i < cgs.maxclients ; i++ ) { - if ( cgs.clientinfo[i].infoValid && cgs.clientinfo[i].team == TEAM_BLUE && cgs.clientinfo[i].powerups & ( 1<< PW_REDFLAG )) { - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, cgs.clientinfo[i].name, 0, 0, textStyle); - return; - } - } -} - -static void CG_DrawRedFlagStatus(rectDef_t *rect, qhandle_t shader) { - if (cgs.gametype != GT_CTF && cgs.gametype != GT_1FCTF) { - if (cgs.gametype == GT_HARVESTER) { - vec4_t color = {1, 0, 0, 1}; - trap_R_SetColor(color); - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.redCubeIcon ); - trap_R_SetColor(NULL); - } - return; - } - if (shader) { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader ); - } else { - gitem_t *item = BG_FindItemForPowerup( PW_REDFLAG ); - if (item) { - vec4_t color = {1, 0, 0, 1}; - trap_R_SetColor(color); - if( cgs.redflag >= 0 && cgs.redflag <= 2) { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.flagShaders[cgs.redflag] ); - } else { - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.flagShaders[0] ); - } - trap_R_SetColor(NULL); - } - } -} - -static void CG_DrawRedFlagHead(rectDef_t *rect) { - int i; - for ( i = 0 ; i < cgs.maxclients ; i++ ) { - if ( cgs.clientinfo[i].infoValid && cgs.clientinfo[i].team == TEAM_BLUE && cgs.clientinfo[i].powerups & ( 1<< PW_REDFLAG )) { - vec3_t angles; - VectorClear( angles ); - angles[YAW] = 180 + 20 * sin( cg.time / 650.0 );; - CG_DrawHead( rect->x, rect->y, rect->w, rect->h, 0,angles ); - return; - } - } -} - -static void CG_HarvesterSkulls(rectDef_t *rect, float scale, vec4_t color, qboolean force2D, int textStyle ) { - char num[16]; - vec3_t origin, angles; - qhandle_t handle; - int value = cg.snap->ps.generic1; - - if (cgs.gametype != GT_HARVESTER) { - return; - } - - if( value > 99 ) { - value = 99; - } - - Com_sprintf (num, sizeof(num), "%i", value); - value = CG_Text_Width(num, scale, 0); - CG_Text_Paint(rect->x + (rect->w - value), rect->y + rect->h, scale, color, num, 0, 0, textStyle); - - if (cg_drawIcons.integer) { - if (!force2D && cg_draw3dIcons.integer) { - VectorClear(angles); - origin[0] = 90; - origin[1] = 0; - origin[2] = -10; - angles[YAW] = ( cg.time & 2047 ) * 360 / 2048.0; - if( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE ) { - handle = cgs.media.redCubeModel; - } else { - handle = cgs.media.blueCubeModel; - } - CG_Draw3DModel( rect->x, rect->y, 35, 35, handle, 0, origin, angles ); - } else { - if( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE ) { - handle = cgs.media.redCubeIcon; - } else { - handle = cgs.media.blueCubeIcon; - } - CG_DrawPic( rect->x + 3, rect->y + 16, 20, 20, handle ); - } - } -} - -static void CG_OneFlagStatus(rectDef_t *rect) { - if (cgs.gametype != GT_1FCTF) { - return; - } else { - gitem_t *item = BG_FindItemForPowerup( PW_NEUTRALFLAG ); - if (item) { - if( cgs.flagStatus >= 0 && cgs.flagStatus <= 4 ) { - vec4_t color = {1, 1, 1, 1}; - int index = 0; - if (cgs.flagStatus == FLAG_TAKEN_RED) { - color[1] = color[2] = 0; - index = 1; - } else if (cgs.flagStatus == FLAG_TAKEN_BLUE) { - color[0] = color[1] = 0; - index = 1; - } else if (cgs.flagStatus == FLAG_DROPPED) { - index = 2; - } - trap_R_SetColor(color); - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.flagShaders[index] ); - } - } - } -} - - -static void CG_DrawCTFPowerUp(rectDef_t *rect) { - int value; - - if (cgs.gametype < GT_CTF) { - return; - } - value = cg.snap->ps.stats[STAT_PERSISTANT_POWERUP]; - if ( value ) { - CG_RegisterItemVisuals( value ); - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cg_items[ value ].icon ); - } -} - - - -static void CG_DrawTeamColor(rectDef_t *rect, vec4_t color) { - CG_DrawTeamBackground(rect->x, rect->y, rect->w, rect->h, color[3], cg.snap->ps.persistant[PERS_TEAM]); -} - -static void CG_DrawAreaPowerUp(rectDef_t *rect, int align, float special, float scale, vec4_t color) { - char num[16]; - int sorted[MAX_POWERUPS]; - int sortedTime[MAX_POWERUPS]; - int i, j, k; - int active; - playerState_t *ps; - int t; - gitem_t *item; - float f; - rectDef_t r2; - float *inc; - r2.x = rect->x; - r2.y = rect->y; - r2.w = rect->w; - r2.h = rect->h; - - inc = (align == HUD_VERTICAL) ? &r2.y : &r2.x; - - ps = &cg.snap->ps; - - if ( ps->stats[STAT_HEALTH] <= 0 ) { - return; - } - - // sort the list by time remaining - active = 0; - for ( i = 0 ; i < MAX_POWERUPS ; i++ ) { - if ( !ps->powerups[ i ] ) { - continue; - } - t = ps->powerups[ i ] - cg.time; - // ZOID--don't draw if the power up has unlimited time (999 seconds) - // This is true of the CTF flags - if ( t <= 0 || t >= 999000) { - continue; - } - - // insert into the list - for ( j = 0 ; j < active ; j++ ) { - if ( sortedTime[j] >= t ) { - for ( k = active - 1 ; k >= j ; k-- ) { - sorted[k+1] = sorted[k]; - sortedTime[k+1] = sortedTime[k]; - } - break; - } - } - sorted[j] = i; - sortedTime[j] = t; - active++; - } - - // draw the icons and timers - for ( i = 0 ; i < active ; i++ ) { - item = BG_FindItemForPowerup( sorted[i] ); - - if (item) { - t = ps->powerups[ sorted[i] ]; - if ( t - cg.time >= POWERUP_BLINKS * POWERUP_BLINK_TIME ) { - trap_R_SetColor( NULL ); - } else { - vec4_t modulate; - - f = (float)( t - cg.time ) / POWERUP_BLINK_TIME; - f -= (int)f; - modulate[0] = modulate[1] = modulate[2] = modulate[3] = f; - trap_R_SetColor( modulate ); - } - - CG_DrawPic( r2.x, r2.y, r2.w * .75, r2.h, trap_R_RegisterShader( item->icon ) ); - - Com_sprintf (num, sizeof(num), "%i", sortedTime[i] / 1000); - CG_Text_Paint(r2.x + (r2.w * .75) + 3 , r2.y + r2.h, scale, color, num, 0, 0, 0); - *inc += r2.w + special; - } - - } - trap_R_SetColor( NULL ); - -} - -float CG_GetValue(int ownerDraw) { - centity_t *cent; - clientInfo_t *ci; - playerState_t *ps; - - cent = &cg_entities[cg.snap->ps.clientNum]; - ps = &cg.snap->ps; - - switch (ownerDraw) { - case CG_SELECTEDPLAYER_ARMOR: - ci = cgs.clientinfo + sortedTeamPlayers[CG_GetSelectedPlayer()]; - return ci->armor; - break; - case CG_SELECTEDPLAYER_HEALTH: - ci = cgs.clientinfo + sortedTeamPlayers[CG_GetSelectedPlayer()]; - return ci->health; - break; - case CG_PLAYER_ARMOR_VALUE: - return ps->stats[STAT_ARMOR]; - break; - case CG_PLAYER_AMMO_VALUE: - if ( cent->currentState.weapon ) { - return ps->ammo[cent->currentState.weapon]; - } - break; - case CG_PLAYER_SCORE: - return cg.snap->ps.persistant[PERS_SCORE]; - break; - case CG_PLAYER_HEALTH: - return ps->stats[STAT_HEALTH]; - break; - case CG_RED_SCORE: - return cgs.scores1; - break; - case CG_BLUE_SCORE: - return cgs.scores2; - break; - default: - break; - } - return -1; -} - -qboolean CG_OtherTeamHasFlag() { - if (cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF) { - int team = cg.snap->ps.persistant[PERS_TEAM]; - if (cgs.gametype == GT_1FCTF) { - if (team == TEAM_RED && cgs.flagStatus == FLAG_TAKEN_BLUE) { - return qtrue; - } else if (team == TEAM_BLUE && cgs.flagStatus == FLAG_TAKEN_RED) { - return qtrue; - } else { - return qfalse; - } - } else { - if (team == TEAM_RED && cgs.redflag == FLAG_TAKEN) { - return qtrue; - } else if (team == TEAM_BLUE && cgs.blueflag == FLAG_TAKEN) { - return qtrue; - } else { - return qfalse; - } - } - } - return qfalse; -} - -qboolean CG_YourTeamHasFlag() { - if (cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF) { - int team = cg.snap->ps.persistant[PERS_TEAM]; - if (cgs.gametype == GT_1FCTF) { - if (team == TEAM_RED && cgs.flagStatus == FLAG_TAKEN_RED) { - return qtrue; - } else if (team == TEAM_BLUE && cgs.flagStatus == FLAG_TAKEN_BLUE) { - return qtrue; - } else { - return qfalse; - } - } else { - if (team == TEAM_RED && cgs.blueflag == FLAG_TAKEN) { - return qtrue; - } else if (team == TEAM_BLUE && cgs.redflag == FLAG_TAKEN) { - return qtrue; - } else { - return qfalse; - } - } - } - return qfalse; -} - -// THINKABOUTME: should these be exclusive or inclusive.. -// -qboolean CG_OwnerDrawVisible(int flags) { - - if (flags & CG_SHOW_TEAMINFO) { - return (cg_currentSelectedPlayer.integer == numSortedTeamPlayers); - } - - if (flags & CG_SHOW_NOTEAMINFO) { - return !(cg_currentSelectedPlayer.integer == numSortedTeamPlayers); - } - - if (flags & CG_SHOW_OTHERTEAMHASFLAG) { - return CG_OtherTeamHasFlag(); - } - - if (flags & CG_SHOW_YOURTEAMHASENEMYFLAG) { - return CG_YourTeamHasFlag(); - } - - if (flags & (CG_SHOW_BLUE_TEAM_HAS_REDFLAG | CG_SHOW_RED_TEAM_HAS_BLUEFLAG)) { - if (flags & CG_SHOW_BLUE_TEAM_HAS_REDFLAG && (cgs.redflag == FLAG_TAKEN || cgs.flagStatus == FLAG_TAKEN_RED)) { - return qtrue; - } else if (flags & CG_SHOW_RED_TEAM_HAS_BLUEFLAG && (cgs.blueflag == FLAG_TAKEN || cgs.flagStatus == FLAG_TAKEN_BLUE)) { - return qtrue; - } - return qfalse; - } - - if (flags & CG_SHOW_ANYTEAMGAME) { - if( cgs.gametype >= GT_TEAM) { - return qtrue; - } - } - - if (flags & CG_SHOW_ANYNONTEAMGAME) { - if( cgs.gametype < GT_TEAM) { - return qtrue; - } - } - - if (flags & CG_SHOW_HARVESTER) { - if( cgs.gametype == GT_HARVESTER ) { - return qtrue; - } else { - return qfalse; - } - } - - if (flags & CG_SHOW_ONEFLAG) { - if( cgs.gametype == GT_1FCTF ) { - return qtrue; - } else { - return qfalse; - } - } - - if (flags & CG_SHOW_CTF) { - if( cgs.gametype == GT_CTF ) { - return qtrue; - } - } - - if (flags & CG_SHOW_OBELISK) { - if( cgs.gametype == GT_OBELISK ) { - return qtrue; - } else { - return qfalse; - } - } - - if (flags & CG_SHOW_HEALTHCRITICAL) { - if (cg.snap->ps.stats[STAT_HEALTH] < 25) { - return qtrue; - } - } - - if (flags & CG_SHOW_HEALTHOK) { - if (cg.snap->ps.stats[STAT_HEALTH] >= 25) { - return qtrue; - } - } - - if (flags & CG_SHOW_SINGLEPLAYER) { - if( cgs.gametype == GT_SINGLE_PLAYER ) { - return qtrue; - } - } - - if (flags & CG_SHOW_TOURNAMENT) { - if( cgs.gametype == GT_TOURNAMENT ) { - return qtrue; - } - } - - if (flags & CG_SHOW_DURINGINCOMINGVOICE) { - } - - if (flags & CG_SHOW_IF_PLAYER_HAS_FLAG) { - if (cg.snap->ps.powerups[PW_REDFLAG] || cg.snap->ps.powerups[PW_BLUEFLAG] || cg.snap->ps.powerups[PW_NEUTRALFLAG]) { - return qtrue; - } - } - return qfalse; -} - - - -static void CG_DrawPlayerHasFlag(rectDef_t *rect, qboolean force2D) { - int adj = (force2D) ? 0 : 2; - if( cg.predictedPlayerState.powerups[PW_REDFLAG] ) { - CG_DrawFlagModel( rect->x + adj, rect->y + adj, rect->w - adj, rect->h - adj, TEAM_RED, force2D); - } else if( cg.predictedPlayerState.powerups[PW_BLUEFLAG] ) { - CG_DrawFlagModel( rect->x + adj, rect->y + adj, rect->w - adj, rect->h - adj, TEAM_BLUE, force2D); - } else if( cg.predictedPlayerState.powerups[PW_NEUTRALFLAG] ) { - CG_DrawFlagModel( rect->x + adj, rect->y + adj, rect->w - adj, rect->h - adj, TEAM_FREE, force2D); - } -} - -static void CG_DrawAreaSystemChat(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader) { - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, systemChat, 0, 0, 0); -} - -static void CG_DrawAreaTeamChat(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader) { - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color,teamChat1, 0, 0, 0); -} - -static void CG_DrawAreaChat(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader) { - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, teamChat2, 0, 0, 0); -} - -const char *CG_GetKillerText() { - const char *s = ""; - if ( cg.killerName[0] ) { - s = va("Fragged by %s", cg.killerName ); - } - return s; -} - - -static void CG_DrawKiller(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle ) { - // fragged by ... line - if ( cg.killerName[0] ) { - int x = rect->x + rect->w / 2; - CG_Text_Paint(x - CG_Text_Width(CG_GetKillerText(), scale, 0) / 2, rect->y + rect->h, scale, color, CG_GetKillerText(), 0, 0, textStyle); - } - -} - - -static void CG_DrawCapFragLimit(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle) { - int limit = (cgs.gametype >= GT_CTF) ? cgs.capturelimit : cgs.fraglimit; - CG_Text_Paint(rect->x, rect->y, scale, color, va("%2i", limit),0, 0, textStyle); -} - -static void CG_Draw1stPlace(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle) { - if (cgs.scores1 != SCORE_NOT_PRESENT) { - CG_Text_Paint(rect->x, rect->y, scale, color, va("%2i", cgs.scores1),0, 0, textStyle); - } -} - -static void CG_Draw2ndPlace(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle) { - if (cgs.scores2 != SCORE_NOT_PRESENT) { - CG_Text_Paint(rect->x, rect->y, scale, color, va("%2i", cgs.scores2),0, 0, textStyle); - } -} - -const char *CG_GetGameStatusText() { - const char *s = ""; - if ( cgs.gametype < GT_TEAM) { - if (cg.snap->ps.persistant[PERS_TEAM] != TEAM_SPECTATOR ) { - s = va("%s place with %i",CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ),cg.snap->ps.persistant[PERS_SCORE] ); - } - } else { - if ( cg.teamScores[0] == cg.teamScores[1] ) { - s = va("Teams are tied at %i", cg.teamScores[0] ); - } else if ( cg.teamScores[0] >= cg.teamScores[1] ) { - s = va("Red leads Blue, %i to %i", cg.teamScores[0], cg.teamScores[1] ); - } else { - s = va("Blue leads Red, %i to %i", cg.teamScores[1], cg.teamScores[0] ); - } - } - return s; -} - -static void CG_DrawGameStatus(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle ) { - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, CG_GetGameStatusText(), 0, 0, textStyle); -} - -const char *CG_GameTypeString() { - if ( cgs.gametype == GT_FFA ) { - return "Free For All"; - } else if ( cgs.gametype == GT_TEAM ) { - return "Team Deathmatch"; - } else if ( cgs.gametype == GT_CTF ) { - return "Capture the Flag"; - } else if ( cgs.gametype == GT_1FCTF ) { - return "One Flag CTF"; - } else if ( cgs.gametype == GT_OBELISK ) { - return "Overload"; - } else if ( cgs.gametype == GT_HARVESTER ) { - return "Harvester"; - } - return ""; -} -static void CG_DrawGameType(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle ) { - CG_Text_Paint(rect->x, rect->y + rect->h, scale, color, CG_GameTypeString(), 0, 0, textStyle); -} - -static void CG_Text_Paint_Limit(float *maxX, float x, float y, float scale, vec4_t color, const char* text, float adjust, int limit) { - int len, count; - vec4_t newColor; - glyphInfo_t *glyph; - if (text) { -// TTimo: FIXME -// const unsigned char *s = text; // bk001206 - unsigned - const char *s = text; - float max = *maxX; - float useScale; - fontInfo_t *font = &cgDC.Assets.textFont; - if (scale <= cg_smallFont.value) { - font = &cgDC.Assets.smallFont; - } else if (scale > cg_bigFont.value) { - font = &cgDC.Assets.bigFont; - } - useScale = scale * font->glyphScale; - trap_R_SetColor( color ); - len = strlen(text); - if (limit > 0 && len > limit) { - len = limit; - } - count = 0; - while (s && *s && count < len) { - glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build - if ( Q_IsColorString( s ) ) { - memcpy( newColor, g_color_table[ColorIndex(*(s+1))], sizeof( newColor ) ); - newColor[3] = color[3]; - trap_R_SetColor( newColor ); - s += 2; - continue; - } else { - float yadj = useScale * glyph->top; - if (CG_Text_Width(s, useScale, 1) + x > max) { - *maxX = 0; - break; - } - CG_Text_PaintChar(x, y - yadj, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph); - x += (glyph->xSkip * useScale) + adjust; - *maxX = x; - count++; - s++; - } - } - trap_R_SetColor( NULL ); - } - -} - - - -#define PIC_WIDTH 12 - -void CG_DrawNewTeamInfo(rectDef_t *rect, float text_x, float text_y, float scale, vec4_t color, qhandle_t shader) { - int xx; - float y; - int i, j, len, count; - const char *p; - vec4_t hcolor; - float pwidth, lwidth, maxx, leftOver; - clientInfo_t *ci; - gitem_t *item; - qhandle_t h; - - // max player name width - pwidth = 0; - count = (numSortedTeamPlayers > 8) ? 8 : numSortedTeamPlayers; - for (i = 0; i < count; i++) { - ci = cgs.clientinfo + sortedTeamPlayers[i]; - if ( ci->infoValid && ci->team == cg.snap->ps.persistant[PERS_TEAM]) { - len = CG_Text_Width( ci->name, scale, 0); - if (len > pwidth) - pwidth = len; - } - } - - // max location name width - lwidth = 0; - for (i = 1; i < MAX_LOCATIONS; i++) { - p = CG_ConfigString(CS_LOCATIONS + i); - if (p && *p) { - len = CG_Text_Width(p, scale, 0); - if (len > lwidth) - lwidth = len; - } - } - - y = rect->y; - - for (i = 0; i < count; i++) { - ci = cgs.clientinfo + sortedTeamPlayers[i]; - if ( ci->infoValid && ci->team == cg.snap->ps.persistant[PERS_TEAM]) { - - xx = rect->x + 1; - for (j = 0; j <= PW_NUM_POWERUPS; j++) { - if (ci->powerups & (1 << j)) { - - item = BG_FindItemForPowerup( j ); - - if (item) { - CG_DrawPic( xx, y, PIC_WIDTH, PIC_WIDTH, trap_R_RegisterShader( item->icon ) ); - xx += PIC_WIDTH; - } - } - } - - // FIXME: max of 3 powerups shown properly - xx = rect->x + (PIC_WIDTH * 3) + 2; - - CG_GetColorForHealth( ci->health, ci->armor, hcolor ); - trap_R_SetColor(hcolor); - CG_DrawPic( xx, y + 1, PIC_WIDTH - 2, PIC_WIDTH - 2, cgs.media.heartShader ); - - //Com_sprintf (st, sizeof(st), "%3i %3i", ci->health, ci->armor); - //CG_Text_Paint(xx, y + text_y, scale, hcolor, st, 0, 0); - - // draw weapon icon - xx += PIC_WIDTH + 1; - -// weapon used is not that useful, use the space for task -#if 0 - if ( cg_weapons[ci->curWeapon].weaponIcon ) { - CG_DrawPic( xx, y, PIC_WIDTH, PIC_WIDTH, cg_weapons[ci->curWeapon].weaponIcon ); - } else { - CG_DrawPic( xx, y, PIC_WIDTH, PIC_WIDTH, cgs.media.deferShader ); - } -#endif - - trap_R_SetColor(NULL); - if (cgs.orderPending) { - // blink the icon - if ( cg.time > cgs.orderTime - 2500 && (cg.time >> 9 ) & 1 ) { - h = 0; - } else { - h = CG_StatusHandle(cgs.currentOrder); - } - } else { - h = CG_StatusHandle(ci->teamTask); - } - - if (h) { - CG_DrawPic( xx, y, PIC_WIDTH, PIC_WIDTH, h); - } - - xx += PIC_WIDTH + 1; - - leftOver = rect->w - xx; - maxx = xx + leftOver / 3; - - - - CG_Text_Paint_Limit(&maxx, xx, y + text_y, scale, color, ci->name, 0, 0); - - p = CG_ConfigString(CS_LOCATIONS + ci->location); - if (!p || !*p) { - p = "unknown"; - } - - xx += leftOver / 3 + 2; - maxx = rect->w - 4; - - CG_Text_Paint_Limit(&maxx, xx, y + text_y, scale, color, p, 0, 0); - y += text_y + 2; - if ( y + text_y + 2 > rect->y + rect->h ) { - break; - } - - } - } -} - - -void CG_DrawTeamSpectators(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader) { - if (cg.spectatorLen) { - float maxX; - - if (cg.spectatorWidth == -1) { - cg.spectatorWidth = 0; - cg.spectatorPaintX = rect->x + 1; - cg.spectatorPaintX2 = -1; - } - - if (cg.spectatorOffset > cg.spectatorLen) { - cg.spectatorOffset = 0; - cg.spectatorPaintX = rect->x + 1; - cg.spectatorPaintX2 = -1; - } - - if (cg.time > cg.spectatorTime) { - cg.spectatorTime = cg.time + 10; - if (cg.spectatorPaintX <= rect->x + 2) { - if (cg.spectatorOffset < cg.spectatorLen) { - cg.spectatorPaintX += CG_Text_Width(&cg.spectatorList[cg.spectatorOffset], scale, 1) - 1; - cg.spectatorOffset++; - } else { - cg.spectatorOffset = 0; - if (cg.spectatorPaintX2 >= 0) { - cg.spectatorPaintX = cg.spectatorPaintX2; - } else { - cg.spectatorPaintX = rect->x + rect->w - 2; - } - cg.spectatorPaintX2 = -1; - } - } else { - cg.spectatorPaintX--; - if (cg.spectatorPaintX2 >= 0) { - cg.spectatorPaintX2--; - } - } - } - - maxX = rect->x + rect->w - 2; - CG_Text_Paint_Limit(&maxX, cg.spectatorPaintX, rect->y + rect->h - 3, scale, color, &cg.spectatorList[cg.spectatorOffset], 0, 0); - if (cg.spectatorPaintX2 >= 0) { - float maxX2 = rect->x + rect->w - 2; - CG_Text_Paint_Limit(&maxX2, cg.spectatorPaintX2, rect->y + rect->h - 3, scale, color, cg.spectatorList, 0, cg.spectatorOffset); - } - if (cg.spectatorOffset && maxX > 0) { - // if we have an offset ( we are skipping the first part of the string ) and we fit the string - if (cg.spectatorPaintX2 == -1) { - cg.spectatorPaintX2 = rect->x + rect->w - 2; - } - } else { - cg.spectatorPaintX2 = -1; - } - - } -} - - - -void CG_DrawMedal(int ownerDraw, rectDef_t *rect, float scale, vec4_t color, qhandle_t shader) { - score_t *score = &cg.scores[cg.selectedScore]; - float value = 0; - char *text = NULL; - color[3] = 0.25; - - switch (ownerDraw) { - case CG_ACCURACY: - value = score->accuracy; - break; - case CG_ASSISTS: - value = score->assistCount; - break; - case CG_DEFEND: - value = score->defendCount; - break; - case CG_EXCELLENT: - value = score->excellentCount; - break; - case CG_IMPRESSIVE: - value = score->impressiveCount; - break; - case CG_PERFECT: - value = score->perfect; - break; - case CG_GAUNTLET: - value = score->guantletCount; - break; - case CG_CAPTURES: - value = score->captures; - break; - } - - if (value > 0) { - if (ownerDraw != CG_PERFECT) { - if (ownerDraw == CG_ACCURACY) { - text = va("%i%%", (int)value); - if (value > 50) { - color[3] = 1.0; - } - } else { - text = va("%i", (int)value); - color[3] = 1.0; - } - } else { - if (value) { - color[3] = 1.0; - } - text = "Wow"; - } - } - - trap_R_SetColor(color); - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader ); - - if (text) { - color[3] = 1.0; - value = CG_Text_Width(text, scale, 0); - CG_Text_Paint(rect->x + (rect->w - value) / 2, rect->y + rect->h + 10 , scale, color, text, 0, 0, 0); - } - trap_R_SetColor(NULL); - -} - - -// -void CG_OwnerDraw(float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, int ownerDrawFlags, int align, float special, float scale, vec4_t color, qhandle_t shader, int textStyle) { - rectDef_t rect; - - if ( cg_drawStatus.integer == 0 ) { - return; - } - - //if (ownerDrawFlags != 0 && !CG_OwnerDrawVisible(ownerDrawFlags)) { - // return; - //} - - rect.x = x; - rect.y = y; - rect.w = w; - rect.h = h; - - switch (ownerDraw) { - case CG_PLAYER_ARMOR_ICON: - CG_DrawPlayerArmorIcon(&rect, ownerDrawFlags & CG_SHOW_2DONLY); - break; - case CG_PLAYER_ARMOR_ICON2D: - CG_DrawPlayerArmorIcon(&rect, qtrue); - break; - case CG_PLAYER_ARMOR_VALUE: - CG_DrawPlayerArmorValue(&rect, scale, color, shader, textStyle); - break; - case CG_PLAYER_AMMO_ICON: - CG_DrawPlayerAmmoIcon(&rect, ownerDrawFlags & CG_SHOW_2DONLY); - break; - case CG_PLAYER_AMMO_ICON2D: - CG_DrawPlayerAmmoIcon(&rect, qtrue); - break; - case CG_PLAYER_AMMO_VALUE: - CG_DrawPlayerAmmoValue(&rect, scale, color, shader, textStyle); - break; - case CG_SELECTEDPLAYER_HEAD: - CG_DrawSelectedPlayerHead(&rect, ownerDrawFlags & CG_SHOW_2DONLY, qfalse); - break; - case CG_VOICE_HEAD: - CG_DrawSelectedPlayerHead(&rect, ownerDrawFlags & CG_SHOW_2DONLY, qtrue); - break; - case CG_VOICE_NAME: - CG_DrawSelectedPlayerName(&rect, scale, color, qtrue, textStyle); - break; - case CG_SELECTEDPLAYER_STATUS: - CG_DrawSelectedPlayerStatus(&rect); - break; - case CG_SELECTEDPLAYER_ARMOR: - CG_DrawSelectedPlayerArmor(&rect, scale, color, shader, textStyle); - break; - case CG_SELECTEDPLAYER_HEALTH: - CG_DrawSelectedPlayerHealth(&rect, scale, color, shader, textStyle); - break; - case CG_SELECTEDPLAYER_NAME: - CG_DrawSelectedPlayerName(&rect, scale, color, qfalse, textStyle); - break; - case CG_SELECTEDPLAYER_LOCATION: - CG_DrawSelectedPlayerLocation(&rect, scale, color, textStyle); - break; - case CG_SELECTEDPLAYER_WEAPON: - CG_DrawSelectedPlayerWeapon(&rect); - break; - case CG_SELECTEDPLAYER_POWERUP: - CG_DrawSelectedPlayerPowerup(&rect, ownerDrawFlags & CG_SHOW_2DONLY); - break; - case CG_PLAYER_HEAD: - CG_DrawPlayerHead(&rect, ownerDrawFlags & CG_SHOW_2DONLY); - break; - case CG_PLAYER_ITEM: - CG_DrawPlayerItem(&rect, scale, ownerDrawFlags & CG_SHOW_2DONLY); - break; - case CG_PLAYER_SCORE: - CG_DrawPlayerScore(&rect, scale, color, shader, textStyle); - break; - case CG_PLAYER_HEALTH: - CG_DrawPlayerHealth(&rect, scale, color, shader, textStyle); - break; - case CG_RED_SCORE: - CG_DrawRedScore(&rect, scale, color, shader, textStyle); - break; - case CG_BLUE_SCORE: - CG_DrawBlueScore(&rect, scale, color, shader, textStyle); - break; - case CG_RED_NAME: - CG_DrawRedName(&rect, scale, color, textStyle); - break; - case CG_BLUE_NAME: - CG_DrawBlueName(&rect, scale, color, textStyle); - break; - case CG_BLUE_FLAGHEAD: - CG_DrawBlueFlagHead(&rect); - break; - case CG_BLUE_FLAGSTATUS: - CG_DrawBlueFlagStatus(&rect, shader); - break; - case CG_BLUE_FLAGNAME: - CG_DrawBlueFlagName(&rect, scale, color, textStyle); - break; - case CG_RED_FLAGHEAD: - CG_DrawRedFlagHead(&rect); - break; - case CG_RED_FLAGSTATUS: - CG_DrawRedFlagStatus(&rect, shader); - break; - case CG_RED_FLAGNAME: - CG_DrawRedFlagName(&rect, scale, color, textStyle); - break; - case CG_HARVESTER_SKULLS: - CG_HarvesterSkulls(&rect, scale, color, qfalse, textStyle); - break; - case CG_HARVESTER_SKULLS2D: - CG_HarvesterSkulls(&rect, scale, color, qtrue, textStyle); - break; - case CG_ONEFLAG_STATUS: - CG_OneFlagStatus(&rect); - break; - case CG_PLAYER_LOCATION: - CG_DrawPlayerLocation(&rect, scale, color, textStyle); - break; - case CG_TEAM_COLOR: - CG_DrawTeamColor(&rect, color); - break; - case CG_CTF_POWERUP: - CG_DrawCTFPowerUp(&rect); - break; - case CG_AREA_POWERUP: - CG_DrawAreaPowerUp(&rect, align, special, scale, color); - break; - case CG_PLAYER_STATUS: - CG_DrawPlayerStatus(&rect); - break; - case CG_PLAYER_HASFLAG: - CG_DrawPlayerHasFlag(&rect, qfalse); - break; - case CG_PLAYER_HASFLAG2D: - CG_DrawPlayerHasFlag(&rect, qtrue); - break; - case CG_AREA_SYSTEMCHAT: - CG_DrawAreaSystemChat(&rect, scale, color, shader); - break; - case CG_AREA_TEAMCHAT: - CG_DrawAreaTeamChat(&rect, scale, color, shader); - break; - case CG_AREA_CHAT: - CG_DrawAreaChat(&rect, scale, color, shader); - break; - case CG_GAME_TYPE: - CG_DrawGameType(&rect, scale, color, shader, textStyle); - break; - case CG_GAME_STATUS: - CG_DrawGameStatus(&rect, scale, color, shader, textStyle); - break; - case CG_KILLER: - CG_DrawKiller(&rect, scale, color, shader, textStyle); - break; - case CG_ACCURACY: - case CG_ASSISTS: - case CG_DEFEND: - case CG_EXCELLENT: - case CG_IMPRESSIVE: - case CG_PERFECT: - case CG_GAUNTLET: - case CG_CAPTURES: - CG_DrawMedal(ownerDraw, &rect, scale, color, shader); - break; - case CG_SPECTATORS: - CG_DrawTeamSpectators(&rect, scale, color, shader); - break; - case CG_TEAMINFO: - if (cg_currentSelectedPlayer.integer == numSortedTeamPlayers) { - CG_DrawNewTeamInfo(&rect, text_x, text_y, scale, color, shader); - } - break; - case CG_CAPFRAGLIMIT: - CG_DrawCapFragLimit(&rect, scale, color, shader, textStyle); - break; - case CG_1STPLACE: - CG_Draw1stPlace(&rect, scale, color, shader, textStyle); - break; - case CG_2NDPLACE: - CG_Draw2ndPlace(&rect, scale, color, shader, textStyle); - break; - default: - break; - } -} - -void CG_MouseEvent(int x, int y) { - int n; - - if ( (cg.predictedPlayerState.pm_type == PM_NORMAL || cg.predictedPlayerState.pm_type == PM_SPECTATOR) && cg.showScores == qfalse) { - trap_Key_SetCatcher(0); - return; - } - - cgs.cursorX+= x; - if (cgs.cursorX < 0) - cgs.cursorX = 0; - else if (cgs.cursorX > 640) - cgs.cursorX = 640; - - cgs.cursorY += y; - if (cgs.cursorY < 0) - cgs.cursorY = 0; - else if (cgs.cursorY > 480) - cgs.cursorY = 480; - - n = Display_CursorType(cgs.cursorX, cgs.cursorY); - cgs.activeCursor = 0; - if (n == CURSOR_ARROW) { - cgs.activeCursor = cgs.media.selectCursor; - } else if (n == CURSOR_SIZER) { - cgs.activeCursor = cgs.media.sizeCursor; - } - - if (cgs.capturedItem) { - Display_MouseMove(cgs.capturedItem, x, y); - } else { - Display_MouseMove(NULL, cgs.cursorX, cgs.cursorY); - } - -} - -/* -================== -CG_HideTeamMenus -================== - -*/ -void CG_HideTeamMenu() { - Menus_CloseByName("teamMenu"); - Menus_CloseByName("getMenu"); -} - -/* -================== -CG_ShowTeamMenus -================== - -*/ -void CG_ShowTeamMenu() { - Menus_OpenByName("teamMenu"); -} - - - - -/* -================== -CG_EventHandling -================== - type 0 - no event handling - 1 - team menu - 2 - hud editor - -*/ -void CG_EventHandling(int type) { - cgs.eventHandling = type; - if (type == CGAME_EVENT_NONE) { - CG_HideTeamMenu(); - } else if (type == CGAME_EVENT_TEAMMENU) { - //CG_ShowTeamMenu(); - } else if (type == CGAME_EVENT_SCOREBOARD) { - } - -} - - - -void CG_KeyEvent(int key, qboolean down) { - - if (!down) { - return; - } - - if ( cg.predictedPlayerState.pm_type == PM_NORMAL || (cg.predictedPlayerState.pm_type == PM_SPECTATOR && cg.showScores == qfalse)) { - CG_EventHandling(CGAME_EVENT_NONE); - trap_Key_SetCatcher(0); - return; - } - - //if (key == trap_Key_GetKey("teamMenu") || !Display_CaptureItem(cgs.cursorX, cgs.cursorY)) { - // if we see this then we should always be visible - // CG_EventHandling(CGAME_EVENT_NONE); - // trap_Key_SetCatcher(0); - //} - - - - Display_HandleKey(key, down, cgs.cursorX, cgs.cursorY); - - if (cgs.capturedItem) { - cgs.capturedItem = NULL; - } else { - if (key == K_MOUSE2 && down) { - cgs.capturedItem = Display_CaptureItem(cgs.cursorX, cgs.cursorY); - } - } -} - -int CG_ClientNumFromName(const char *p) { - int i; - for (i = 0; i < cgs.maxclients; i++) { - if (cgs.clientinfo[i].infoValid && Q_stricmp(cgs.clientinfo[i].name, p) == 0) { - return i; - } - } - return -1; -} - -void CG_ShowResponseHead() { - Menus_OpenByName("voiceMenu"); - trap_Cvar_Set("cl_conXOffset", "72"); - cg.voiceTime = cg.time; -} - -void CG_RunMenuScript(char **args) { -} - - -void CG_GetTeamColor(vec4_t *color) { - if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED) { - (*color)[0] = 1.0f; - (*color)[3] = 0.25f; - (*color)[1] = (*color)[2] = 0.0f; - } else if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE) { - (*color)[0] = (*color)[1] = 0.0f; - (*color)[2] = 1.0f; - (*color)[3] = 0.25f; - } else { - (*color)[0] = (*color)[2] = 0.0f; - (*color)[1] = 0.17f; - (*color)[3] = 0.25f; - } -} - diff --git a/code/cgame/cg_view.c b/code/cgame/cg_view.c index 49c9ddd..58f2e19 100644 --- a/code/cgame/cg_view.c +++ b/code/cgame/cg_view.c @@ -573,11 +573,6 @@ static void CG_DamageBlendBlob( void ) { // return; //} - // ragePro systems can't fade blends, so don't obscure the screen - if ( cgs.glconfig.hardwareType == GLHW_RAGEPRO ) { - return; - } - maxTime = DAMAGE_TIME; t = cg.time - cg.damageTime; if ( t <= 0 || t >= maxTime ) { diff --git a/code/cgame/cg_weapons.c b/code/cgame/cg_weapons.c index c4a1753..93ea2a5 100644 --- a/code/cgame/cg_weapons.c +++ b/code/cgame/cg_weapons.c @@ -2079,21 +2079,18 @@ CG_ShotgunFire */ void CG_ShotgunFire( entityState_t *es ) { vec3_t v; + vec3_t up; int contents; VectorSubtract( es->origin2, es->pos.trBase, v ); VectorNormalize( v ); VectorScale( v, 32, v ); VectorAdd( es->pos.trBase, v, v ); - if ( cgs.glconfig.hardwareType != GLHW_RAGEPRO ) { - // ragepro can't alpha fade, so don't even bother with smoke - vec3_t up; - - contents = trap_CM_PointContents( es->pos.trBase, 0 ); - if ( !( contents & CONTENTS_WATER ) ) { - VectorSet( up, 0, 0, 8 ); - CG_SmokePuff( v, up, 32, 1, 1, 1, 0.33f, 900, cg.time, 0, LEF_PUFF_DONT_SCALE, cgs.media.shotgunSmokePuffShader ); - } + + contents = trap_CM_PointContents( es->pos.trBase, 0 ); + if ( !( contents & CONTENTS_WATER ) ) { + VectorSet( up, 0, 0, 8 ); + CG_SmokePuff( v, up, 32, 1, 1, 1, 0.33f, 900, cg.time, 0, LEF_PUFF_DONT_SCALE, cgs.media.shotgunSmokePuffShader ); } CG_ShotgunPattern( es->pos.trBase, es->origin2, es->eventParm, es->otherEntityNum ); } diff --git a/code/cgame/cgame.bat b/code/cgame/cgame.bat index a59381e..c69ac02 100644 --- a/code/cgame/cgame.bat +++ b/code/cgame/cgame.bat @@ -6,6 +6,9 @@ mkdir vm cd vm set cc=lcc -DQ3_VM -DCGAME -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1 +rem update PATH variable to point to the quake3 sdk tools +set PATH=.\..\..\win32\mod-sdk-setup\bin;%PATH% + %cc% ../../game/bg_misc.c @if errorlevel 1 goto quit %cc% ../../game/bg_pmove.c diff --git a/code/cgame/cgame.plg b/code/cgame/cgame.plg deleted file mode 100644 index 781b1eb..0000000 --- a/code/cgame/cgame.plg +++ /dev/null @@ -1,124 +0,0 @@ - - -
-

Build Log

-

---------------------Configuration: cgame - Win32 Release-------------------- -

-

Command Lines

-Creating temporary file "C:\WINNT\Profiles\ADMINI~1\LOCALS~1\Temp\RSP4BE.tmp" with contents -[ -/nologo /G6 /ML /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fp"Release/cgame.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c -"D:\quake3\MissionPack\code\game\bg_misc.c" -"D:\quake3\MissionPack\code\game\bg_pmove.c" -"D:\quake3\MissionPack\code\game\bg_slidemove.c" -"D:\quake3\MissionPack\code\cgame\cg_consolecmds.c" -"D:\quake3\MissionPack\code\cgame\cg_draw.c" -"D:\quake3\MissionPack\code\cgame\cg_drawtools.c" -"D:\quake3\MissionPack\code\cgame\cg_effects.c" -"D:\quake3\MissionPack\code\cgame\cg_ents.c" -"D:\quake3\MissionPack\code\cgame\cg_event.c" -"D:\quake3\MissionPack\code\cgame\cg_info.c" -"D:\quake3\MissionPack\code\cgame\cg_localents.c" -"D:\quake3\MissionPack\code\cgame\cg_main.c" -"D:\quake3\MissionPack\code\cgame\cg_marks.c" -"D:\quake3\MissionPack\code\cgame\cg_players.c" -"D:\quake3\MissionPack\code\cgame\cg_playerstate.c" -"D:\quake3\MissionPack\code\cgame\cg_predict.c" -"D:\quake3\MissionPack\code\cgame\cg_rankings.c" -"D:\quake3\MissionPack\code\cgame\cg_scoreboard.c" -"D:\quake3\MissionPack\code\cgame\cg_servercmds.c" -"D:\quake3\MissionPack\code\cgame\cg_snapshot.c" -"D:\quake3\MissionPack\code\cgame\cg_syscalls.c" -"D:\quake3\MissionPack\code\cgame\cg_view.c" -"D:\quake3\MissionPack\code\cgame\cg_weapons.c" -"D:\quake3\MissionPack\code\game\q_math.c" -"D:\quake3\MissionPack\code\game\q_shared.c" -"D:\quake3\MissionPack\code\ui\ui_shared.c" -] -Creating command line "cl.exe @C:\WINNT\Profiles\ADMINI~1\LOCALS~1\Temp\RSP4BE.tmp" -Creating temporary file "C:\WINNT\Profiles\ADMINI~1\LOCALS~1\Temp\RSP4BF.tmp" with contents -[ -/nologo /base:"0x30000000" /subsystem:windows /dll /incremental:no /pdb:"Release/cgamex86.pdb" /map:"Release/cgamex86.map" /machine:I386 /def:".\cgame.def" /out:"../Release/cgamex86.dll" /implib:"Release/cgamex86.lib" -.\Release\bg_misc.obj -.\Release\bg_pmove.obj -.\Release\bg_slidemove.obj -.\Release\cg_consolecmds.obj -.\Release\cg_draw.obj -.\Release\cg_drawtools.obj -.\Release\cg_effects.obj -.\Release\cg_ents.obj -.\Release\cg_event.obj -.\Release\cg_info.obj -.\Release\cg_localents.obj -.\Release\cg_main.obj -.\Release\cg_marks.obj -.\Release\cg_players.obj -.\Release\cg_playerstate.obj -.\Release\cg_predict.obj -.\Release\cg_rankings.obj -.\Release\cg_scoreboard.obj -.\Release\cg_servercmds.obj -.\Release\cg_snapshot.obj -.\Release\cg_syscalls.obj -.\Release\cg_view.obj -.\Release\cg_weapons.obj -.\Release\q_math.obj -.\Release\q_shared.obj -.\Release\ui_shared.obj -] -Creating command line "link.exe @C:\WINNT\Profiles\ADMINI~1\LOCALS~1\Temp\RSP4BF.tmp" -

Output Window

-Compiling... -bg_misc.c -bg_pmove.c -D:\quake3\MissionPack\code\game\bg_pmove.c(987) : warning C4189: 'shit' : local variable is initialized but not referenced -D:\quake3\MissionPack\code\game\bg_pmove.c(2001) : warning C4505: 'PM_InvulnerabilityMove' : unreferenced local function has been removed - D:\quake3\MissionPack\code\game\bg_pmove.c(519) : see declaration of 'PM_InvulnerabilityMove' -bg_slidemove.c -cg_consolecmds.c -cg_draw.c -cg_drawtools.c -cg_effects.c -cg_ents.c -cg_event.c -cg_info.c -cg_localents.c -cg_main.c -D:\quake3\MissionPack\code\cgame\cg_main.c(1819) : warning C4505: 'CG_Cvar_Get' : unreferenced local function has been removed - D:\quake3\MissionPack\code\cgame\cg_main.c(1513) : see declaration of 'CG_Cvar_Get' -cg_marks.c -cg_players.c -D:\quake3\MissionPack\code\cgame\cg_players.c(2209) : warning C4505: 'CG_PlayerTokens' : unreferenced local function has been removed - D:\quake3\MissionPack\code\cgame\cg_players.c(1371) : see declaration of 'CG_PlayerTokens' -cg_playerstate.c -cg_predict.c -cg_rankings.c -cg_scoreboard.c -cg_servercmds.c -cg_snapshot.c -cg_syscalls.c -cg_view.c -cg_weapons.c -q_math.c -q_shared.c -ui_shared.c -D:\quake3\MissionPack\code\ui\ui_shared.c(2223) : warning C4189: 'parent' : local variable is initialized but not referenced -D:\quake3\MissionPack\code\ui\ui_shared.c(3501) : warning C4189: 'collision' : local variable is initialized but not referenced -D:\quake3\MissionPack\code\ui\ui_shared.c(4622) : warning C4505: 'Controls_SetDefaults' : unreferenced local function has been removed - D:\quake3\MissionPack\code\ui\ui_shared.c(2595) : see declaration of 'Controls_SetDefaults' -D:\quake3\MissionPack\code\ui\ui_shared.c(1540) : warning C4701: local variable 'value' may be used without having been initialized -D:\quake3\MissionPack\code\ui\ui_shared.c(1566) : warning C4701: local variable 'value' may be used without having been initialized -D:\quake3\MissionPack\code\ui\ui_shared.c(1912) : warning C4702: unreachable code -D:\quake3\MissionPack\code\ui\ui_shared.c(4013) : warning C4702: unreachable code -D:\quake3\MissionPack\code\ui\ui_shared.c(4056) : warning C4702: unreachable code -Linking... - Creating library Release/cgamex86.lib and object Release/cgamex86.exp - - - -

Results

-cgamex86.dll - 0 error(s), 12 warning(s) -
- - diff --git a/code/cgame/cgame.sh b/code/cgame/cgame.sh deleted file mode 100644 index cdba268..0000000 --- a/code/cgame/cgame.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -mkdir -p vm -cd vm - -CC="q3lcc -DQ3_VM -DCGAME -S -Wf-target=bytecode -Wf-g -I../../cgame -I../../game -I../../q3_ui" - -$CC ../cg_syscalls.c -$CC ../../game/bg_misc.c -$CC ../../game/bg_pmove.c -$CC ../../game/bg_slidemove.c -$CC ../../game/bg_lib.c -$CC ../../game/q_math.c -$CC ../../game/q_shared.c -$CC ../cg_consolecmds.c -$CC ../cg_draw.c -$CC ../cg_drawtools.c -$CC ../cg_effects.c -$CC ../cg_ents.c -$CC ../cg_event.c -$CC ../cg_info.c -$CC ../cg_localents.c -$CC ../cg_main.c -$CC ../cg_marks.c -$CC ../cg_players.c -$CC ../cg_playerstate.c -$CC ../cg_predict.c -$CC ../cg_scoreboard.c -$CC ../cg_servercmds.c -$CC ../cg_snapshot.c -$CC ../cg_view.c -$CC ../cg_weapons.c - -q3asm -f ../cgame - -cd .. diff --git a/code/cgame/cgame.vcproj b/code/cgame/cgame.vcproj deleted file mode 100644 index fe2a212..0000000 --- a/code/cgame/cgame.vcproj +++ /dev/null @@ -1,1221 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/cgame/cgame_ta.bat b/code/cgame/cgame_ta.bat deleted file mode 100644 index 098be0e..0000000 --- a/code/cgame/cgame_ta.bat +++ /dev/null @@ -1,65 +0,0 @@ -rem make sure we have a safe environement -set LIBRARY= -set INCLUDE= - -mkdir vm -cd vm -set cc=lcc -DQ3_VM -DMISSIONPACK -DCGAME -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1 - -%cc% ../../game/bg_misc.c -@if errorlevel 1 goto quit -%cc% ../../game/bg_pmove.c -@if errorlevel 1 goto quit -%cc% ../../game/bg_slidemove.c -@if errorlevel 1 goto quit -%cc% ../../game/bg_lib.c -@if errorlevel 1 goto quit -%cc% ../../game/q_math.c -@if errorlevel 1 goto quit -%cc% ../../game/q_shared.c -@if errorlevel 1 goto quit -%cc% ../cg_consolecmds.c -@if errorlevel 1 goto quit -%cc% ../cg_draw.c -@if errorlevel 1 goto quit -%cc% ../cg_drawtools.c -@if errorlevel 1 goto quit -%cc% ../cg_effects.c -@if errorlevel 1 goto quit -%cc% ../cg_ents.c -@if errorlevel 1 goto quit -%cc% ../cg_event.c -@if errorlevel 1 goto quit -%cc% ../cg_info.c -@if errorlevel 1 goto quit -%cc% ../cg_localents.c -@if errorlevel 1 goto quit -%cc% ../cg_main.c -@if errorlevel 1 goto quit -%cc% ../cg_marks.c -@if errorlevel 1 goto quit -%cc% ../cg_players.c -@if errorlevel 1 goto quit -%cc% ../cg_playerstate.c -@if errorlevel 1 goto quit -%cc% ../cg_predict.c -@if errorlevel 1 goto quit -%cc% ../cg_scoreboard.c -@if errorlevel 1 goto quit -%cc% ../cg_servercmds.c -@if errorlevel 1 goto quit -%cc% ../cg_snapshot.c -@if errorlevel 1 goto quit -%cc% ../cg_view.c -@if errorlevel 1 goto quit -%cc% ../cg_weapons.c -@if errorlevel 1 goto quit -%cc% ../../ui/ui_shared.c -@if errorlevel 1 goto quit -%cc% ../cg_newdraw.c -@if errorlevel 1 goto quit - - -q3asm -f ../cgame_ta -:quit -cd .. diff --git a/code/cgame/cgame_ta.q3asm b/code/cgame/cgame_ta.q3asm deleted file mode 100644 index 629a778..0000000 --- a/code/cgame/cgame_ta.q3asm +++ /dev/null @@ -1,28 +0,0 @@ --o "\quake3\missionpack\vm\cgame" -cg_main -..\cg_syscalls -cg_consolecmds -cg_draw -cg_drawtools -cg_effects -cg_ents -cg_event -cg_info -cg_localents -cg_marks -cg_players -cg_playerstate -cg_predict -cg_scoreboard -cg_servercmds -cg_snapshot -cg_view -cg_weapons -bg_slidemove -bg_pmove -bg_lib -bg_misc -q_math -q_shared -ui_shared -cg_newdraw diff --git a/code/cgame/cgame_ta.sh b/code/cgame/cgame_ta.sh deleted file mode 100644 index ce22b30..0000000 --- a/code/cgame/cgame_ta.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -mkdir -p vm -cd vm - -CC="q3lcc -DQ3_VM -DCGAME -DMISSIONPACK -S -Wf-target=bytecode -Wf-g -I../../cgame -I../../game -I../../ui" - -$CC ../cg_syscalls.c -$CC ../../game/bg_misc.c -$CC ../../game/bg_pmove.c -$CC ../../game/bg_slidemove.c -$CC ../../game/bg_lib.c -$CC ../../game/q_math.c -$CC ../../game/q_shared.c -$CC ../cg_consolecmds.c -$CC ../cg_draw.c -$CC ../cg_drawtools.c -$CC ../cg_effects.c -$CC ../cg_ents.c -$CC ../cg_event.c -$CC ../cg_info.c -$CC ../cg_localents.c -$CC ../cg_main.c -$CC ../cg_marks.c -$CC ../cg_players.c -$CC ../cg_playerstate.c -$CC ../cg_predict.c -$CC ../cg_scoreboard.c -$CC ../cg_servercmds.c -$CC ../cg_snapshot.c -$CC ../cg_view.c -$CC ../cg_weapons.c -$CC ../../ui/ui_shared.c -$CC ../cg_newdraw.c - -q3asm -f ../cgame_ta - -cd .. diff --git a/code/cgame/tr_types.h b/code/cgame/tr_types.h index d68a174..67856a2 100644 --- a/code/cgame/tr_types.h +++ b/code/cgame/tr_types.h @@ -148,25 +148,22 @@ typedef enum { TC_S3TC } textureCompression_t; + +// +// glDriverType_t is not used by the engine and quake3 game anymore. +// Single value (GLDRV_ICD) is left only for compatibility with other mods. typedef enum { - GLDRV_ICD, // driver is integrated with window system - // WARNING: there are tests that check for - // > GLDRV_ICD for minidriverness, so this - // should always be the lowest value in this - // enum set - GLDRV_STANDALONE, // driver is a non-3Dfx standalone driver - GLDRV_VOODOO // driver is a 3Dfx standalone driver + GLDRV_ICD // driver is integrated with window system } glDriverType_t; +// +// +// glHardwareType_t is not used by the engine and quake3 game anymore. +// Single value (GLHW_GENERIC) is left only for compatibility with other mods. typedef enum { - GLHW_GENERIC, // where everthing works the way it should - GLHW_3DFX_2D3D, // Voodoo Banshee or Voodoo3, relevant since if this is - // the hardware type then there can NOT exist a secondary - // display adapter - GLHW_RIVA128, // where you can't interpolate alpha - GLHW_RAGEPRO, // where you can't modulate alpha on alpha textures - GLHW_PERMEDIA2 // where you don't have src*dst + GLHW_GENERIC // where everthing works the way it should } glHardwareType_t; +// typedef struct { char renderer_string[MAX_STRING_CHARS]; @@ -179,8 +176,15 @@ typedef struct { int colorBits, depthBits, stencilBits; + // + // Obsolete. Should be here for compatibility with other mods. glDriverType_t driverType; + // + + // + // Obsolete. Should be here for compatibility with other mods. glHardwareType_t hardwareType; + // qboolean deviceSupportsGamma; textureCompression_t textureCompression; @@ -192,8 +196,6 @@ typedef struct { // normal screens should be 4/3, but wide aspect monitors may be 16/9 float windowAspect; - int displayFrequency; - // synonymous with "does rendering consume the entire screen?", therefore // a Voodoo or Voodoo2 will have this set to TRUE, as will a Win32 ICD that // used CDS. @@ -202,28 +204,8 @@ typedef struct { qboolean smpActive; // dual processor } glconfig_t; -// FIXME: VM should be OS agnostic .. in theory - -/* -#ifdef Q3_VM - -#define _3DFX_DRIVER_NAME "Voodoo" -#define OPENGL_DRIVER_NAME "Default" - -#elif defined(_WIN32) -*/ - #if defined(Q3_VM) || defined(_WIN32) - -#define _3DFX_DRIVER_NAME "3dfxvgl" #define OPENGL_DRIVER_NAME "opengl32" - -#else - -#define _3DFX_DRIVER_NAME "libMesaVoodooGL.so" -// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=524 -#define OPENGL_DRIVER_NAME "libGL.so.1" - #endif // !defined _WIN32 #endif // __TR_TYPES_H diff --git a/code/clean.bat b/code/clean.bat deleted file mode 100644 index c756cf7..0000000 --- a/code/clean.bat +++ /dev/null @@ -1,61 +0,0 @@ -rmdir debug /s /q -rmdir release /s /q -del quake3.ncb -del quake3.opt -del quake3.plg -del quake3.stt -rmdir cgame\debug /s /q -rmdir cgame\release /s /q -del cgame\cgame.ncb -del cgame\cgame.opt -del cgame\cgame.plg -del cgame\cgame.stt -rmdir game\debug /s /q -rmdir game\release /s /q -del game\game.ncb -del game\game.opt -del game\game.plg -del game\game.stt -rmdir ui\debug /s /q -rmdir ui\release /s /q -del ui\ui.ncb -del ui\ui.opt -del ui\ui.plg -del ui\ui.stt -rmdir renderer\debug /s /q -rmdir renderer\release /s /q -del renderer\renderer.ncb -del renderer\renderer.opt -del renderer\renderer.plg -del renderer\renderer.stt -rmdir botlib\debug /s /q -rmdir botlib\release /s /q -del botlib\botlib.ncb -del botlib\botlib.opt -del botlib\botlib.plg -del botlib\botlib.stt -rmdir botlai\debug /s /q -rmdir botlai\release /s /q -del botai\botai.dsp -del botai\botai.plg -rmdir bspc\debug /s /q -rmdir bspc\release /s /q -del bspc\bspc.exe -del bspc\bspc.log -del bspc\bspc.ncb -del bspc\bspc.opt -del bspc\bspc.pdb -del bspc\bspc.plg -rmdir unix\debugi386-glibc /s /q -rmdir unix\releasei386-glibc /s /q -rmdir "mac\MacQuake3 Data" /s /q -rmdir macosx\Client\Q3Test.app /s /q -rmdir macosx\Client\Q3Test.build /s /q -del *.o /s -del *.obj /s -del *.lib /s -del *.dll /s -del *.ncb /s -del *.plg /s -del *.map /s -del *.opt /s diff --git a/code/client/cl_cin.c b/code/client/cl_cin.c index f042d23..c18a144 100644 --- a/code/client/cl_cin.c +++ b/code/client/cl_cin.c @@ -1055,23 +1055,6 @@ static void readQuadInfo( byte *qData ) cinTable[currentHandle].drawX = cinTable[currentHandle].CIN_WIDTH; cinTable[currentHandle].drawY = cinTable[currentHandle].CIN_HEIGHT; - - // rage pro is very slow at 512 wide textures, voodoo can't do it at all - if ( glConfig.hardwareType == GLHW_RAGEPRO || glConfig.maxTextureSize <= 256) { - if (cinTable[currentHandle].drawX>256) { - cinTable[currentHandle].drawX = 256; - } - if (cinTable[currentHandle].drawY>256) { - cinTable[currentHandle].drawY = 256; - } - if (cinTable[currentHandle].CIN_WIDTH != 256 || cinTable[currentHandle].CIN_HEIGHT != 256) { - Com_Printf("HACK: approxmimating cinematic for Rage Pro or Voodoo\n"); - } - } -#if defined(MACOS_X) - cinTable[currentHandle].drawX = 256; - cinTable[currentHandle].drawX = 256; -#endif } /****************************************************************************** diff --git a/code/client/client.h b/code/client/client.h index f188f4b..b8ac6b4 100644 --- a/code/client/client.h +++ b/code/client/client.h @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "../game/q_shared.h" #include "../qcommon/qcommon.h" #include "../renderer/tr_public.h" -#include "../ui/ui_public.h" +#include "../q3_ui/ui_public.h" #include "keys.h" #include "snd_public.h" #include "../cgame/cg_public.h" diff --git a/code/client/keys.h b/code/client/keys.h index c852f5a..d716907 100644 --- a/code/client/keys.h +++ b/code/client/keys.h @@ -19,7 +19,7 @@ along with Foobar; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA =========================================================================== */ -#include "../ui/keycodes.h" +#include "../q3_ui/keycodes.h" #define MAX_KEYS 256 diff --git a/code/game.lnt b/code/game.lnt deleted file mode 100644 index a0d50df..0000000 --- a/code/game.lnt +++ /dev/null @@ -1,35 +0,0 @@ -opts.lnt - -game\bg_misc.c -game\bg_pmove.c -game\bg_slidemove.c -game\q_math.c -game\q_shared.c - -botai\ai_chat.c -botai\ai_cmd.c -botai\ai_dmnet.c -botai\ai_dmq3.c -botai\ai_main.c -botai\ai_team.c - -game\g_active.c -game\g_arenas.c -game\g_bot.c -game\g_client.c -game\g_cmds.c -game\g_combat.c -game\g_items.c -game\g_main.c -game\g_mem.c -game\g_misc.c -game\g_missile.c -game\g_mover.c -game\g_session.c -game\g_spawn.c -game\g_svcmds.c -game\g_target.c -game\g_team.c -game\g_trigger.c -game\g_utils.c -game\g_weapon.c diff --git a/code/game/Conscript b/code/game/Conscript deleted file mode 100644 index 5fdf815..0000000 --- a/code/game/Conscript +++ /dev/null @@ -1,140 +0,0 @@ -# game building -# builds the game for vanilla Q3 and TA - -# there are slight differences between Q3 and TA build: -# -DMISSIONPACK -# the config is passed in the imported variable TARGET_DIR - -# qvm building against native: -# only native has g_syscalls.c -# only qvm has ../game/bg_lib.c -# qvm uses a custom g_syscalls.asm with equ stubs - -Import qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); - -$env = new cons( - # the code has the very bad habit of doing things like #include "../ui/ui_shared.h" - # this seems to confuse the dependency analysis, explicit toplevel includes seem to fix - CPPPATH => '#cgame:#game:#q3_ui', - CC => $CC, - CXX => $CXX, - LINK => $LINK, - ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }, - CFLAGS => $BASE_CFLAGS . '-fPIC', - LDFLAGS => '-shared -ldl -lm' -); - -# for TA, use -DMISSIONPACK -%ta_env_hash = $env->copy( - CPPPATH => '#cgame:#game:#ui' - ); -$ta_env_hash{CFLAGS} = '-DMISSIONPACK ' . $ta_env_hash{CFLAGS}; -$ta_env = new cons(%ta_env_hash); - -# qvm building -# we heavily customize the cons environment -$vm_env = new cons( - # the code has the very bad habit of doing things like #include "../ui/ui_shared.h" - # this seems to confuse the dependency analysis, explicit toplevel includes seem to fix - CPPPATH => '#cgame:#game:#q3_ui', - CC => 'q3lcc', - CCCOM => '%CC %CFLAGS %_IFLAGS -c %< -o %>', - SUFOBJ => '.asm', - LINK => 'q3asm', - CFLAGS => '-DQ3_VM -S -Wf-target=bytecode -Wf-g', - # need to know where to find the compiler tools - ENV => { PATH => $ENV{PATH} . ":./qvmtools", }, -); - -# TA qvm building -%vm_ta_env_hash = $vm_env->copy( - CPPPATH => '#cgame:#game:#ui' - ); -$vm_ta_env_hash{CFLAGS} = '-DMISSIONPACK ' . $vm_ta_env_hash{CFLAGS}; -$vm_ta_env = new cons(%vm_ta_env_hash); - -# the file with vmMain function MUST be the first one of the list -@FILES = qw( - g_main.c - ai_chat.c - ai_cmd.c - ai_dmnet.c - ai_dmq3.c - ai_main.c - ai_team.c - ai_vcmd.c - bg_misc.c - bg_pmove.c - bg_slidemove.c - g_active.c - g_arenas.c - g_bot.c - g_client.c - g_cmds.c - g_combat.c - g_items.c - g_mem.c - g_misc.c - g_missile.c - g_mover.c - g_session.c - g_spawn.c - g_svcmds.c - g_target.c - g_team.c - g_trigger.c - g_utils.c - g_weapon.c - q_math.c - q_shared.c - ); -$FILESREF = \@FILES; - -# only in .so -# (VM uses a custom .asm with equ stubs) -@SO_FILES = qw( - g_syscalls.c - ); -$SO_FILESREF = \@SO_FILES; - -# only for VM -@VM_FILES = qw( - bg_lib.c - g_syscalls.asm - ); -$VM_FILESREF = \@VM_FILES; - -# FIXME CPU string? -# NOTE: $env $ta_env and $vm_env $vm_ta_env may not be necessary -# we could alter the $env and $ta_env based on $TARGET_DIR -# doing it this way to ensure homogeneity with cgame building -if ($TARGET_DIR eq 'Q3') -{ - if ($NO_SO eq 0) - { - Program $env 'qagamei386.so', @$FILESREF, @$SO_FILESREF; - Install $env $INSTALL_DIR, 'qagamei386.so'; - } - if ($NO_VM eq 0) - { - Depends $vm_env 'qagame.qvm', '#qvmtools/q3lcc'; - Depends $vm_env 'qagame.qvm', '#qvmtools/q3asm'; - Program $vm_env 'qagame.qvm', @$FILESREF, @$VM_FILESREF; - Install $vm_env $INSTALL_DIR . '/vm', 'qagame.qvm'; - } -} -else -{ - if ($NO_SO eq 0) - { - Program $ta_env 'qagamei386.so', @$FILESREF, @$SO_FILESREF; - Install $ta_env $INSTALL_DIR, 'qagamei386.so'; - } - if ($NO_VM eq 0) - { - Depends $vm_env 'qagame.qvm', '#qvmtools/q3lcc'; - Depends $vm_env 'qagame.qvm', '#qvmtools/q3asm'; - Program $vm_ta_env 'qagame.qvm', @$FILESREF, @$VM_FILESREF; - Install $vm_ta_env $INSTALL_DIR . '/vm', 'qagame.qvm'; - } -} diff --git a/code/game/game.bat b/code/game/game.bat index 928d806..85764f4 100644 --- a/code/game/game.bat +++ b/code/game/game.bat @@ -6,6 +6,9 @@ mkdir vm cd vm set cc=lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1 +rem update PATH variable to point to the quake3 sdk tools +set PATH=.\..\..\win32\mod-sdk-setup\bin;%PATH% + %cc% ../g_main.c @if errorlevel 1 goto quit diff --git a/code/game/game.sh b/code/game/game.sh deleted file mode 100644 index 6e81266..0000000 --- a/code/game/game.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -mkdir -p vm -cd vm - -CC="q3lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I../../cgame -I../../game -I../../q3_ui" - -$CC ../g_main.c -$CC ../g_syscalls.c - -$CC ../bg_misc.c -$CC ../bg_lib.c -$CC ../bg_pmove.c -$CC ../bg_slidemove.c -$CC ../q_math.c -$CC ../q_shared.c - -$CC ../ai_vcmd.c -$CC ../ai_dmnet.c -$CC ../ai_dmq3.c -$CC ../ai_main.c -$CC ../ai_chat.c -$CC ../ai_cmd.c -$CC ../ai_team.c - -$CC ../g_active.c -$CC ../g_arenas.c -$CC ../g_bot.c -$CC ../g_client.c -$CC ../g_cmds.c -$CC ../g_combat.c -$CC ../g_items.c -$CC ../g_mem.c -$CC ../g_misc.c -$CC ../g_missile.c -$CC ../g_mover.c -$CC ../g_session.c -$CC ../g_spawn.c -$CC ../g_svcmds.c -$CC ../g_target.c -$CC ../g_team.c -$CC ../g_trigger.c -$CC ../g_utils.c -$CC ../g_weapon.c - -q3asm -f ../game - -cd .. diff --git a/code/game/game.vcproj b/code/game/game.vcproj deleted file mode 100644 index 1b41528..0000000 --- a/code/game/game.vcproj +++ /dev/null @@ -1,2132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/game/game_ta.bat b/code/game/game_ta.bat deleted file mode 100644 index 3257475..0000000 --- a/code/game/game_ta.bat +++ /dev/null @@ -1,86 +0,0 @@ -rem make sure we have a safe environement -set LIBRARY= -set INCLUDE= - -mkdir vm -cd vm -set cc=lcc -DQ3_VM -DMISSIONPACK -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1 - -%cc% ../g_main.c -@if errorlevel 1 goto quit - -%cc% ../g_syscalls.c -@if errorlevel 1 goto quit - -%cc% ../bg_misc.c -@if errorlevel 1 goto quit -%cc% ../bg_lib.c -@if errorlevel 1 goto quit -%cc% ../bg_pmove.c -@if errorlevel 1 goto quit -%cc% ../bg_slidemove.c -@if errorlevel 1 goto quit -%cc% ../q_math.c -@if errorlevel 1 goto quit -%cc% ../q_shared.c -@if errorlevel 1 goto quit - -%cc% ../ai_dmnet.c -@if errorlevel 1 goto quit -%cc% ../ai_dmq3.c -@if errorlevel 1 goto quit -%cc% ../ai_main.c -@if errorlevel 1 goto quit -%cc% ../ai_chat.c -@if errorlevel 1 goto quit -%cc% ../ai_cmd.c -@if errorlevel 1 goto quit -%cc% ../ai_team.c -@if errorlevel 1 goto quit - -%cc% ../g_active.c -@if errorlevel 1 goto quit -%cc% ../g_arenas.c -@if errorlevel 1 goto quit -%cc% ../g_bot.c -@if errorlevel 1 goto quit -%cc% ../g_client.c -@if errorlevel 1 goto quit -%cc% ../g_cmds.c -@if errorlevel 1 goto quit -%cc% ../g_combat.c -@if errorlevel 1 goto quit -%cc% ../g_items.c -@if errorlevel 1 goto quit -%cc% ../g_mem.c -@if errorlevel 1 goto quit -%cc% ../g_misc.c -@if errorlevel 1 goto quit -%cc% ../g_missile.c -@if errorlevel 1 goto quit -%cc% ../g_mover.c -@if errorlevel 1 goto quit -%cc% ../g_session.c -@if errorlevel 1 goto quit -%cc% ../g_spawn.c -@if errorlevel 1 goto quit -%cc% ../g_svcmds.c -@if errorlevel 1 goto quit -%cc% ../g_target.c -@if errorlevel 1 goto quit -%cc% ../g_team.c -@if errorlevel 1 goto quit -%cc% ../g_trigger.c -@if errorlevel 1 goto quit -%cc% ../g_utils.c -@if errorlevel 1 goto quit -%cc% ../g_weapon.c -@if errorlevel 1 goto quit -%cc% ../ai_vcmd.c -@if errorlevel 1 goto quit - - - -q3asm -f ../game_ta -:quit -cd .. diff --git a/code/game/game_ta.q3asm b/code/game/game_ta.q3asm deleted file mode 100644 index d699440..0000000 --- a/code/game/game_ta.q3asm +++ /dev/null @@ -1,35 +0,0 @@ --o "\quake3\missionpack\vm\qagame" -g_main -..\g_syscalls -bg_misc -bg_lib -bg_pmove -bg_slidemove -q_math -q_shared -ai_dmnet -ai_dmq3 -ai_team -ai_main -ai_chat -ai_cmd -g_active -g_arenas -g_bot -g_client -g_cmds -g_combat -g_items -g_mem -g_misc -g_missile -g_mover -g_session -g_spawn -g_svcmds -g_target -g_team -g_trigger -g_utils -g_weapon -ai_vcmd diff --git a/code/game/game_ta.sh b/code/game/game_ta.sh deleted file mode 100644 index e17c631..0000000 --- a/code/game/game_ta.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -mkdir -p vm -cd vm - -CC="q3lcc -DQ3_VM -DMISSIONPACK -S -Wf-target=bytecode -Wf-g -I../../cgame -I../../game -I../../ui" - -$CC ../g_main.c -$CC ../g_syscalls.c - -$CC ../bg_misc.c -$CC ../bg_lib.c -$CC ../bg_pmove.c -$CC ../bg_slidemove.c -$CC ../q_math.c -$CC ../q_shared.c - -$CC ../ai_vcmd.c -$CC ../ai_dmnet.c -$CC ../ai_dmq3.c -$CC ../ai_main.c -$CC ../ai_chat.c -$CC ../ai_cmd.c -$CC ../ai_team.c - -$CC ../g_active.c -$CC ../g_arenas.c -$CC ../g_bot.c -$CC ../g_client.c -$CC ../g_cmds.c -$CC ../g_combat.c -$CC ../g_items.c -$CC ../g_mem.c -$CC ../g_misc.c -$CC ../g_missile.c -$CC ../g_mover.c -$CC ../g_session.c -$CC ../g_spawn.c -$CC ../g_svcmds.c -$CC ../g_target.c -$CC ../g_team.c -$CC ../g_trigger.c -$CC ../g_utils.c -$CC ../g_weapon.c - -q3asm -f ../game_ta - -cd .. diff --git a/code/game/q_shared.h b/code/game/q_shared.h index 1cae4b2..210ebc9 100644 --- a/code/game/q_shared.h +++ b/code/game/q_shared.h @@ -54,6 +54,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #pragma warning(disable : 4702) // unreachable code #pragma warning(disable : 4711) // selected for automatic inline expansion #pragma warning(disable : 4220) // varargs matches remaining parameters + +// +#pragma warning(disable : 4996) // the function or variable may be unsafe +// + #endif /********************************************************************** diff --git a/code/macosx/BuildRelease b/code/macosx/BuildRelease deleted file mode 100644 index b38e82d..0000000 --- a/code/macosx/BuildRelease +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/zsh - -APPNAME="Quake3" -PACKAGENAME= Quake3 - -(cd $OMNI_SOURCE_ROOT; ./Build Quake3 install) - -rm -rf "/tmp/$APPNAME" -mkdir "/tmp/$APPNAME" -cp "Read Me.rtf" "/tmp/$APPNAME" - -cd /Users/Shared/$USER/InstalledProducts -gnutar cf - FAKK2.app | (cd "/tmp/$APPNAME"; gnutar xf -) - -cd "/tmp/$APPNAME" -sudo ~bungi/Unix/bin/files2image $PACKAGENAME ./* - diff --git a/code/macosx/CGMouseDeltaFix.h b/code/macosx/CGMouseDeltaFix.h deleted file mode 100644 index d08a0e8..0000000 --- a/code/macosx/CGMouseDeltaFix.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#import - -extern void CGFix_Initialize(); - -extern void CGFix_GetLastMouseDelta(CGMouseDelta *dx, CGMouseDelta *dy); - diff --git a/code/macosx/CGMouseDeltaFix.m b/code/macosx/CGMouseDeltaFix.m deleted file mode 100644 index 15ce740..0000000 --- a/code/macosx/CGMouseDeltaFix.m +++ /dev/null @@ -1,131 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#import "CGMouseDeltaFix.h" -#import "CGPrivateAPI.h" - -#import -#import - - -// We will try to automatically fall back to using the original CGGetLastMouseDelta when we are on a system new enough to have the fix. Any version of CoreGraphics past 1.93.0 will have the fixed version. - - -static BOOL originalVersionShouldWork = YES; -static CGMouseDelta CGFix_Mouse_DeltaX, CGFix_Mouse_DeltaY; - -static void CGFix_NotificationCallback(CGSNotificationType note, CGSNotificationData data, CGSByteCount dataLength, CGSNotificationArg arg); - -static CGSRegisterNotifyProcType registerNotifyProc = NULL; - -void CGFix_Initialize() -{ - NSAutoreleasePool *pool; - NSBundle *cgBundle; - NSString *version; - NSArray *components; - - if (registerNotifyProc) - // We've already been called once and have registered our callbacks. If the original version works, this will be NULL, but we'll end up doing nothing (again, possibly). - return; - - //NSLog(@"CGFix_Initialize\n"); - - pool = [[NSAutoreleasePool alloc] init]; - cgBundle = [NSBundle bundleWithPath: @"/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework"]; - if (!cgBundle) { - // If it's moved, it must be newer than what we know about and should work - //NSLog(@"No /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework\n"); - goto done; - } - - version = [[cgBundle infoDictionary] objectForKey: @"CFBundleShortVersionString"]; - components = [version componentsSeparatedByString: @"."]; - //NSLog(@"version = %@\n", version); - //NSLog(@"components = %@\n", components); - - - if ([components count] < 2) - // We don't understand this versioning scheme. Must have changed. - goto done; - - if (![[components objectAtIndex: 0] isEqualToString: @"1"] || [[components objectAtIndex: 1] intValue] > 93) - // This version should be new enough to work - goto done; - - // Look up the function pointer we need to register our callback. - if (!NSIsSymbolNameDefined("_CGSRegisterNotifyProc")) { - //NSLog(@"No _CGSRegisterNotifyProc\n"); - goto done; - } - - registerNotifyProc = NSAddressOfSymbol(NSLookupAndBindSymbol("_CGSRegisterNotifyProc")); - //NSLog(@"registerNotifyProc = 0x%08x", registerNotifyProc); - - // Must not work if we got here - originalVersionShouldWork = NO; - - // We want to catch all the events that could possible indicate mouse movement and sum them up - registerNotifyProc( CGFix_NotificationCallback, kCGSEventNotificationMouseMoved, NULL); - registerNotifyProc( CGFix_NotificationCallback, kCGSEventNotificationLeftMouseDragged, NULL); - registerNotifyProc( CGFix_NotificationCallback, kCGSEventNotificationRightMouseDragged, NULL); - registerNotifyProc( CGFix_NotificationCallback, kCGSEventNotificationNotificationOtherMouseDragged, NULL); - -done: - [pool release]; -} - -void CGFix_GetLastMouseDelta(CGMouseDelta *dx, CGMouseDelta *dy) -{ - if (originalVersionShouldWork) { - CGGetLastMouseDelta(dx, dy); - return; - } - - *dx = CGFix_Mouse_DeltaX; - *dy = CGFix_Mouse_DeltaY; - - CGFix_Mouse_DeltaX = CGFix_Mouse_DeltaY = 0; -} - -static void CGFix_NotificationCallback(CGSNotificationType note, CGSNotificationData data, CGSByteCount dataLength, CGSNotificationArg arg) -{ - CGSEventRecordPtr event; - - //fprintf(stderr, "CGFix_NotificationCallback(note=%d, date=0x%08x, dataLength=%d, arg=0x%08x)\n", note, data, dataLength, arg); - -#ifdef DEBUG - if ((note != kCGSEventNotificationMouseMoved && - note != kCGSEventNotificationLeftMouseDragged && - note != kCGSEventNotificationRightMouseDragged && - note != kCGSEventNotificationNotificationOtherMouseDragged) || - dataLength != sizeof (CGSEventRecord)) - fprintf(stderr, "Unexpected arguments to callback function CGFix_NotificationCallback(note=%d, date=0x%08x, dataLength=%d, arg=0x%08x)\n", note, data, dataLength, arg); - abort(); - } -#endif - - event = (CGSEventRecordPtr)data; - - CGFix_Mouse_DeltaX += event->data.move.deltaX; - CGFix_Mouse_DeltaY += event->data.move.deltaY; - //fprintf(stderr, " dx += %d, dy += %d\n", event->data.move.deltaX, event->data.move.deltaY); -} diff --git a/code/macosx/CGPrivateAPI.h b/code/macosx/CGPrivateAPI.h deleted file mode 100644 index dd52237..0000000 --- a/code/macosx/CGPrivateAPI.h +++ /dev/null @@ -1,185 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ - - -typedef unsigned long CGSNotificationType; -typedef void * CGSNotificationData; -typedef void * CGSNotificationArg; -typedef void * CGSWindowID; -typedef void * CGSConnectionID; - -typedef unsigned long long CGSUInt64; -typedef long long CGSInt64; -typedef unsigned long CGSUInt32; -typedef long CGSInt32; -typedef unsigned short CGSUInt16; -typedef short CGSInt16; -typedef unsigned char CGSUInt8; -typedef char CGSInt8; -typedef float CGSFloat32; - -typedef CGSUInt32 CGSByteCount; -typedef CGSUInt16 CGSEventRecordVersion; -typedef unsigned long CGSEventType; -typedef CGSUInt64 CGSEventRecordTime; /* nanosecond timer */ -typedef unsigned long CGSEventFlag; -typedef CGSUInt32 CGSError; - - -typedef union { - struct { /* For mouse events */ - CGSUInt8 subx; /* sub-pixel position for x */ - CGSUInt8 suby; /* sub-pixel position for y */ - CGSInt16 eventNum; /* unique identifier for this button */ - CGSInt32 click; /* click state of this event */ - CGSUInt8 pressure; /* pressure value: 0=none, 255=full */ - CGSInt8 _reserved1; - CGSInt16 _reserved2; - CGSInt16 deltaX; - CGSInt16 deltaY; - CGSInt32 _padding[8]; - } mouse; - struct { /* For pointer movement events */ - CGSInt16 _obsolete_deltaX; /* Revert to subX, subY, eventNum */ - CGSInt16 _obsolete_deltaY; /* for Gonzo 1H */ - CGSInt32 click; /* click state of this event */ - CGSUInt8 pressure; /* pressure value: 0=none, 255=full */ - CGSInt8 _reserved1; - CGSInt16 _reserved2; - CGSInt16 deltaX; - CGSInt16 deltaY; - CGSInt32 _padding[8]; - } move; - struct { /* For key-down and key-up events */ - CGSInt16 reserved; - CGSInt16 repeat; /* for key-down: nonzero if really a repeat */ - CGSUInt16 charSet; /* character set code */ - CGSUInt16 charCode; /* character code in that set */ - CGSUInt16 keyCode; /* device-dependent virtual key code */ - CGSInt16 keyData; /* device-dependent info */ - CGSInt16 specialKey; /* CPSSpecialKeyID if kCGSFlagsMaskSpecialKey is set */ - CGSInt16 _pad; - CGSInt32 _padding[8]; - } key; - struct { /* For mouse-entered and mouse-exited events */ - CGSInt16 reserved; - CGSInt16 eventNum; /* unique identifier from mouse down event */ - CGSInt32 trackingNum; /* unique identifier from settrackingrect */ - CGSInt32 userData; /* unCGSInt32erpreted CGSInt32eger from settrackingrect */ - CGSInt32 _padding[9]; - } tracking; - struct { /* For process-related events */ - CGSUInt16 notifyCode; /* CPSNotificationCodes in CPSProcesses.h */ - CGSUInt16 flags; /* CPSEventFlags in CPSProcesses.h */ - CGSUInt32 targetHiPSN; /* hiword of PSN */ - CGSUInt32 targetLoPSN; /* loword of PSN */ - CGSInt32 status; /* operation result */ - CGSInt32 _padding[8]; - } process; - struct { /* For scroll wheel events */ - CGSInt16 deltaAxis1; - CGSInt16 deltaAxis2; - CGSInt16 deltaAxis3; - CGSInt16 reserved1; - CGSInt32 reserved2; - CGSInt32 _padding[9]; - } scrollWheel; - struct { - CGSInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */ - CGSInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */ - CGSInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */ - CGSUInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */ - CGSUInt16 pressure; /* scaled pressure value; MAXPRESSURE=(2^16)-1, MINPRESSURE=0 */ - struct { - CGSInt16 x; /* scaled tilt x value; range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */ - CGSInt16 y; /* scaled tilt y value; range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */ - } tilt; - CGSUInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */ - CGSInt16 tangentialPressure; /* tangential pressure on the device; range same as tilt */ - CGSUInt16 deviceID; /* system-assigned unique device ID - matches to deviceID field in proximity event */ - CGSInt16 vendor1; /* vendor-defined signed 16-bit integer */ - CGSInt16 vendor2; /* vendor-defined signed 16-bit integer */ - CGSInt16 vendor3; /* vendor-defined signed 16-bit integer */ - CGSInt32 _padding[4]; - } tablet; - struct { - CGSUInt16 vendorID; /* vendor-defined ID - typically will be USB vendor ID */ - CGSUInt16 tabletID; /* vendor-defined tablet ID - typically will be USB product ID for the tablet */ - CGSUInt16 pointerID; /* vendor-defined ID of the specific pointing device */ - CGSUInt16 deviceID; /* system-assigned unique device ID - matches to deviceID field in tablet event */ - CGSUInt16 systemTabletID; /* system-assigned unique tablet ID */ - CGSUInt16 vendorPointerType; /* vendor-defined pointer type */ - CGSUInt32 pointerSerialNumber; /* vendor-defined serial number of the specific pointing device */ - CGSUInt64 uniqueID; /* vendor-defined unique ID for this pointer */ - CGSUInt32 capabilityMask; /* mask representing the capabilities of the device */ - CGSUInt8 pointerType; /* type of pointing device - enum to be defined */ - CGSUInt8 enterProximity; /* non-zero = entering; zero = leaving */ - CGSInt16 reserved1; - CGSInt32 _padding[4]; - } proximity; - struct { /* For AppKit-defined, sys-defined, and app-defined events */ - CGSInt16 reserved; - CGSInt16 subtype; /* event subtype for compound events */ - union { - CGSFloat32 F[11]; /* for use in compound events */ - CGSInt32 L[11]; /* for use in compound events */ - CGSInt16 S[22]; /* for use in compound events */ - CGSInt8 C[44]; /* for use in compound events */ - } misc; - } compound; -} CGSEventRecordData; - - -struct _CGSEventRecord { - CGSEventRecordVersion major; - CGSEventRecordVersion minor; - CGSByteCount length; /* Length of complete event record */ - CGSEventType type; /* An event type from above */ - CGPoint location; /* Base coordinates (global), from upper-left */ - CGPoint windowLocation; /* Coordinates relative to window */ - CGSEventRecordTime time; /* nanoseconds since startup */ - CGSEventFlag flags; /* key state flags */ - CGSWindowID window; /* window number of assigned window */ - CGSConnectionID connection; /* connection the event came from */ - CGSEventRecordData data; /* type-dependent data: 40 bytes */ -}; -typedef struct _CGSEventRecord CGSEventRecord; -typedef CGSEventRecord *CGSEventRecordPtr; - - -typedef void (*CGSNotifyProcPtr)(CGSNotificationType type, - CGSNotificationData data, - CGSByteCount dataLength, - CGSNotificationArg arg); - -// Define a type for the 'CGSRegisterNotifyProc' call. Don't reference it explicitly since we don't want link errors if Apple removes this private function. -typedef CGSError (*CGSRegisterNotifyProcType)(CGSNotifyProcPtr proc, - CGSNotificationType type, - CGSNotificationArg arg); - - -#define kCGSEventNotificationMouseMoved (710 + 5) -#define kCGSEventNotificationLeftMouseDragged (710 + 6) -#define kCGSEventNotificationRightMouseDragged (710 + 7) -#define kCGSEventNotificationNotificationOtherMouseDragged (710 + 27) - - diff --git a/code/macosx/GenerateQGL.pl b/code/macosx/GenerateQGL.pl deleted file mode 100644 index 5fc8f96..0000000 --- a/code/macosx/GenerateQGL.pl +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/perl - -open(INPUT_FILE, ">/tmp/input-$$.h") || die "$!"; -print INPUT_FILE "#import \n"; -close INPUT_FILE; -open(CPP, "cpp /tmp/input-$$.h|") || die "$!"; - -print "/**** This file is autogenerated. Run GenerateQGL.pl to update it ****/\n\n"; - -print "#ifdef QGL_LOG_GL_CALLS\n"; -print "extern unsigned int QGLLogGLCalls;\n"; -print "extern FILE *QGLDebugFile(void);\n"; -print "#endif\n\n"; - -print "extern void QGLCheckError(const char *message);\n"; -print "extern unsigned int QGLBeginStarted;\n\n"; -print "// This has to be done to avoid infinite recursion between our glGetError wrapper and QGLCheckError()\n"; -print "static inline GLenum _glGetError(void) {\n"; -print " return glGetError();\n"; -print "}\n\n"; - -@functionNames = (); - -while () { - chop; - /^extern/ || next; - s/extern //; - print "// $_\n"; - - # This approach is necessary to deal with glGetString whos type isn't a single word - ($type, $rest) = m/(.+)\s+(gl.*)/; -# print "type='$type'\n"; -# print "rest='$rest'\n"; - - ($name, $argString) = ($rest =~ m/(\w+).*\s*\((.*)\)/); - $isVoid = ($type =~ m/void/); - push(@functionNames, $name); - -# print "name=$name\n"; -# print "argString=$argString\n"; -# print "argCount=$#args\n"; - - # Parse the argument list into two arrays, one of types and one of argument names - if ($argString =~ m/^void$/) { - @args = (); - } else { - @args = split(",", $argString); - } - @argTypes = (); - @argNames = (); - for $arg (@args) { - ($argType, $argName) = ($arg =~ m/(.*[ \*])([_a-zA-Z0-9]+)/); - $argType =~ s/^ *//; - $argType =~ s/ *$//; - - push(@argTypes, $argType); - push(@argNames, $argName); -# print "argType='$argType'\n"; -# print "argName='$argName'\n"; - } - - - print "static inline $type q$name($argString)\n"; - print "{\n"; - - if (! $isVoid) { - print " $type returnValue;\n"; - } - - print "#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS)\n"; - print " if (QGLLogGLCalls)\n"; - print " fprintf(QGLDebugFile(), \"$name("; - - if ($#argTypes >= 0) { - for ($i = 0; $i <= $#argTypes; $i++) { - $argType = $argTypes[$i]; - $argName = $argNames[$i]; - $_ = $argType; - if (/^GLenum$/ || /^GLuint$/ || /^GLbitfield$/) { - print "$argName=%lu"; - } elsif (/^GLsizei$/ || /^GLint$/) { - print "$argName=%ld"; - } elsif (/^GLfloat$/ || /^GLdouble$/ || /^GLclampf$/ || /^GLclampd$/) { - print "$argName=%f"; - } elsif (/^GLbyte$/) { - print "$argName=%d"; - } elsif (/^GLubyte$/) { - print "$argName=%u"; - } elsif (/^GLshort$/) { - print "$argName=%d"; - } elsif (/^GLushort$/) { - print "$argName=%u"; - } elsif (/^GLboolean$/) { - print "$argName=%u"; - } elsif (/\*$/) { - # TJW -- Later we should look at the count specified in the function name, look at the basic type and print out an array. Or we could just special case them... - print "$argName=%p"; - } else { - print STDERR "Unknown type '$argType'\n"; - exit(1); - } - - print ", " if ($i != $#argTypes); - } - } else { - print "void"; - } - - print ")\\n\""; - print ", " if $#argTypes >= 0; - print join(", ", @argNames); - print ");\n"; - print "#endif\n"; - - if (! $isVoid) { - print " returnValue = "; - } else { - print " "; - } - print "$name(" . join(", ", @argNames) . ");\n"; - - print "#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS)\n"; - if ($name eq "glBegin") { - print " QGLBeginStarted++;\n"; - } - if ($name eq "glEnd") { - print " QGLBeginStarted--;\n"; - } - print " if (!QGLBeginStarted)\n"; - print " QGLCheckError(\"$name\");\n"; - print "#endif\n"; - - if (! $isVoid) { - print " return returnValue;\n"; - } - - print "}\n\n"; -} - - -print "// Prevent calls to the 'normal' GL functions\n"; -for $name (@functionNames) { - print "#define $name CALL_THE_QGL_VERSION_OF_$name\n"; -} - - diff --git a/code/macosx/Performance.rtf b/code/macosx/Performance.rtf deleted file mode 100644 index 4ba0bfe..0000000 --- a/code/macosx/Performance.rtf +++ /dev/null @@ -1,114 +0,0 @@ -{\rtf1\mac\ansicpg10000{\fonttbl\f0\fswiss\fcharset77 Helvetica;} -{\colortbl;\red255\green255\blue255;\red255\green0\blue16;\red255\green0\blue16;} -\paperw14240\paperh14700 -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f0\fs24 \cf0 \ - -\b +set timedemo 1 +demo die.dm3 +set s_initsound 0 +set r_enablerender 0 +set vm_cgame 0 +set vm_game 0\ -4865 frames, 154.3 seconds: 31.5 fps\ -\ -\ -+set timedemo 1 +demo die.dm3 +set s_initsound 0 +set r_enablerender 0 +set vm_cgame 2 +set vm_game 2\ -4865 frames, 199.8 seconds: 24.4 fps\ -\ -\ -+set timedemo 1 +demo demo001.dm3 +set s_initsound 0 +set r_enablerender 0 +set vm_cgame 0 +set vm_game 0\ -1346 frames, 10.1 seconds: 133.0 fps\ -\ -\ -+set timedemo 1 +demo demo001.dm3 +set s_initsound 0 +set r_enablerender 0 +set vm_cgame 2 +set vm_game 2\ -1346 frames, 12.8 seconds: 105.4 fps\ -\ -\ -\ -Starting point\ - -\b0 4865 frames, 154.5 seconds: 31.5 fps\ -[seconds spent locally, % of parent, % of total, # of samples]\ -[133.623469 -- 60130560955, 100.00%, 100.00%, 4866] Root\ - [126.853849 -- 57084231997, 94.93%, 94.93%, 4866] CL_Frame\ - [125.895845 -- 56653130083, 99.24%, 94.22%, 4918] SCR_UpdateScreen\ - [50.532841 -- 22739778533, 40.14%, 37.82%, 524036] RB_SurfaceMesh\ - [46.583051 -- 20962372767, 92.18%, 34.86%, 524036] LerpMeshVertexes\ - [8.465527 -- 3809487228, 18.17%, 6.34%, 455917] LerpMeshVertexes 1\ - -\b \cf2 [37.967433 -- 17085344910, 81.50%, 28.41%, 68119] LerpMeshVertexes 2\ - -\b0 \cf0 [0.32% spent locally]\ - [7.82% spent locally]\ - [59.86% spent locally]\ - [0.76% spent locally]\ -[5.07% spent locally]\ -\ - -\b Minor cleanup of local variables\ - -\b0 [seconds spent locally, % of parent, % of total, # of samples]\ -[133.121489 -- 59904670191, 100.00%, 100.00%, 4866] Root\ - [126.329343 -- 56848204176, 94.90%, 94.90%, 4866] CL_Frame\ - [125.402239 -- 56431007399, 99.27%, 94.20%, 4918] SCR_UpdateScreen\ - [50.013076 -- 22505884288, 39.88%, 37.57%, 524036] RB_SurfaceMesh\ - [46.085775 -- 20738598809, 92.15%, 34.62%, 524036] LerpMeshVertexes\ - [8.427565 -- 3792404277, 18.29%, 6.33%, 455917] LerpMeshVertexes 1\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\b \cf3 [37.517092 -- 16882691281, 81.41%, 28.18%, 68119] LerpMeshVertexes 2\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\b0 \cf0 [0.31% spent locally]\ - [7.85% spent locally]\ - [60.12% spent locally]\ - [0.73% spent locally]\ -[5.10% spent locally]\ -\ -\ - -\b Split out normalization of LERPed normals (i.e., all the sqrt calls)\ - -\b0 [seconds spent locally, % of parent, % of total, # of samples]\ -[133.110463 -- 59899708244, 100.00%, 100.00%, 4866] Root\ - [126.357393 -- 56860826689, 94.93%, 94.93%, 4866] CL_Frame\ - [125.364641 -- 56414088645, 99.21%, 94.18%, 4918] SCR_UpdateScreen\ - [49.854816 -- 22434667309, 39.77%, 37.45%, 524036] RB_SurfaceMesh\ - [45.981802 -- 20691810706, 92.23%, 34.54%, 524036] LerpMeshVertexes\ - [8.407983 -- 3783592133, 18.29%, 6.32%, 455917] LerpMeshVertexes 1\ - [37.432159 -- 16844471717, 81.41%, 28.12%, 68119] LerpMeshVertexes 2\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\b \cf3 [30.288000 -- 13629599780, 80.91%, 22.75%, 68119] VectorArrayNormalize\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\b0 \cf0 [19.09% spent locally]\ - [0.31% spent locally]\ - [7.77% spent locally]\ - [60.23% spent locally]\ - [0.79% spent locally]\ -[5.07% spent locally]\ -\ - -\b Rewrote VectorArrayNormalize to use PPC frsqrt instruction (with Newton-Rhapson refinement)\ - -\b0 4865 frames, 128.7 seconds: 37.8 fps\ -[seconds spent locally, % of parent, % of total, # of samples]\ -[103.972710 -- 46787719721, 100.00%, 100.00%, 4866] Root\ - [97.153160 -- 43718922078, 93.44%, 93.44%, 4866] CL_Frame\ - [96.219348 -- 43298706398, 99.04%, 92.54%, 4918] SCR_UpdateScreen\ - [20.873944 -- 9393274747, 21.69%, 20.08%, 524036] RB_SurfaceMesh\ - [17.053245 -- 7673960266, 81.70%, 16.40%, 524036] LerpMeshVertexes\ - [8.356579 -- 3760460537, 49.00%, 8.04%, 455917] LerpMeshVertexes 1\ - [8.560159 -- 3852071404, 50.20%, 8.23%, 68119] LerpMeshVertexes 2\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\b \cf3 [1.429376 -- 643219234, 16.70%, 1.37%, 68119] VectorArrayNormalize\ -\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\b0 \cf0 [83.30% spent locally]\ - [0.80% spent locally]\ - [18.30% spent locally]\ - [78.31% spent locally]\ - [0.96% spent locally]\ -[6.56% spent locally]\ -\ -\ -} diff --git a/code/macosx/Q3Controller.h b/code/macosx/Q3Controller.h deleted file mode 100644 index 1e32e95..0000000 --- a/code/macosx/Q3Controller.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ - -#import - -@interface Q3Controller : NSObject -{ - IBOutlet NSPanel *bannerPanel; -} - -#ifndef DEDICATED -- (IBAction)paste:(id)sender; -- (IBAction)requestTerminate:(id)sender; - -- (void) showBanner; -#endif - -- (void)quakeMain; - -@end - diff --git a/code/macosx/Q3Controller.m b/code/macosx/Q3Controller.m deleted file mode 100644 index 6ddf9d5..0000000 --- a/code/macosx/Q3Controller.m +++ /dev/null @@ -1,435 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ - -#import "Q3Controller.h" - -#import -#import - -#include "client.h" -#include "macosx_local.h" -//#include "GameRanger SDK/gameranger.h" -#ifdef OMNI_TIMER -#import "macosx_timers.h" -#endif - -#define MAX_ARGC 1024 - -static qboolean Sys_IsProcessingTerminationRequest = qfalse; -static void Sys_CreatePathToFile(NSString *path, NSDictionary *attributes); - -@interface Q3Controller (Private) -- (void)quakeMain; -@end - -@implementation Q3Controller - -#ifndef DEDICATED - -- (void)applicationDidFinishLaunching:(NSNotification *)notification; -{ - NS_DURING { - [self quakeMain]; - } NS_HANDLER { - Sys_Error("%@", [localException reason]); - } NS_ENDHANDLER; - Sys_Quit(); -} - -- (void)applicationDidUnhide:(NSNotification *)notification; -{ - // Don't reactivate the game if we are asking whether to quit - if (Sys_IsProcessingTerminationRequest) - return; - - if (!Sys_Unhide()) - // Didn't work -- hide again so we should get another chance to unhide later - [NSApp hide: nil]; -} - -- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; -{ - int choice; - - if (!Sys_IsHidden) { - // We're terminating via -terminate: - return NSTerminateNow; - } - - // Avoid reactivating GL when we unhide due to this panel - Sys_IsProcessingTerminationRequest = qtrue; - choice = NSRunAlertPanel(nil, @"Quit without saving?", @"Don't Quit", @"Quit", nil); - Sys_IsProcessingTerminationRequest = qfalse; - - if (choice == NSAlertAlternateReturn) - return NSTerminateNow; - - // Make sure we get re-hidden - [NSApp hide:nil]; - - return NSTerminateCancel; -} - -// Actions - -- (IBAction)paste:(id)sender; -{ - int shiftWasDown, insertWasDown; - unsigned int currentTime; - - currentTime = Sys_Milliseconds(); - // Save the original keyboard state - shiftWasDown = keys[K_SHIFT].down; - insertWasDown = keys[K_INS].down; - // Fake a Shift-Insert keyboard event - keys[K_SHIFT].down = qtrue; - Sys_QueEvent(currentTime, SE_KEY, K_INS, qtrue, 0, NULL); - Sys_QueEvent(currentTime, SE_KEY, K_INS, qfalse, 0, NULL); - // Restore the original keyboard state - keys[K_SHIFT].down = shiftWasDown; - keys[K_INS].down = insertWasDown; -} - -extern void CL_Quit_f(void); - - -- (IBAction)requestTerminate:(id)sender; -{ - Com_Quit_f(); - // UI_QuitMenu(); -} - -- (void)showBanner; -{ - static BOOL hasShownBanner = NO; - - if (!hasShownBanner) { - cvar_t *showBanner; - - hasShownBanner = YES; - showBanner = Cvar_Get("cl_showBanner", "1", 0); - if (showBanner->integer != 0) { - NSPanel *splashPanel; - NSImage *bannerImage; - NSRect bannerRect; - NSImageView *bannerImageView; - - bannerImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"banner.jpg"]]; - bannerRect = NSMakeRect(0.0, 0.0, [bannerImage size].width, [bannerImage size].height); - - splashPanel = [[NSPanel alloc] initWithContentRect:bannerRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; - - bannerImageView = [[NSImageView alloc] initWithFrame:bannerRect]; - [bannerImageView setImage:bannerImage]; - [splashPanel setContentView:bannerImageView]; - [bannerImageView release]; - - [splashPanel center]; - [splashPanel setHasShadow:YES]; - [splashPanel orderFront: nil]; - [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:2.5]]; - [splashPanel close]; - - [bannerImage release]; - } - } -} - -// Services - -- (void)connectToServer:(NSPasteboard *)pasteboard userData:(NSString *)data error:(NSString **)error; -{ - NSArray *pasteboardTypes; - - pasteboardTypes = [pasteboard types]; - if ([pasteboardTypes containsObject:NSStringPboardType]) { - NSString *requestedServer; - - requestedServer = [pasteboard stringForType:NSStringPboardType]; - if (requestedServer) { - Cbuf_AddText(va("connect %s\n", [requestedServer cString])); - return; - } - } - *error = @"Unable to connect to server: could not find string on pasteboard"; -} - -- (void)performCommand:(NSPasteboard *)pasteboard userData:(NSString *)data error:(NSString **)error; -{ - NSArray *pasteboardTypes; - - pasteboardTypes = [pasteboard types]; - if ([pasteboardTypes containsObject:NSStringPboardType]) { - NSString *requestedCommand; - - requestedCommand = [pasteboard stringForType:NSStringPboardType]; - if (requestedCommand) { - Cbuf_AddText(va("%s\n", [requestedCommand cString])); - return; - } - } - *error = @"Unable to perform command: could not find string on pasteboard"; -} - -#endif - -- (void)quakeMain; -{ - NSAutoreleasePool *pool; - int argc = 0; - const char *argv[MAX_ARGC]; - NSProcessInfo *processInfo; - NSArray *arguments; - unsigned int argumentIndex, argumentCount; - NSFileManager *defaultManager; - unsigned int commandLineLength; - NSString *installationPathKey, *installationPath; - char *cmdline; - BOOL foundDirectory; - NSString *appName, *demoAppName, *selectButton; - int count = 0; - pool = [[NSAutoreleasePool alloc] init]; - - [NSApp setServicesProvider:self]; - - processInfo = [NSProcessInfo processInfo]; - arguments = [processInfo arguments]; - argumentCount = [arguments count]; - for (argumentIndex = 0; argumentIndex < argumentCount; argumentIndex++) { - NSString *arg; - - arg = [arguments objectAtIndex:argumentIndex]; - // Don't pass the Process Serial Number command line arg that the Window Server/Finder invokes us with - if ([arg hasPrefix: @"-psn_"]) - continue; - - argv[argc++] = strdup([arg cString]); - } - - // Figure out where the level data is stored. - installationPathKey = @"RetailInstallationPath"; - - installationPath = [[NSUserDefaults standardUserDefaults] objectForKey:installationPathKey]; - if (!installationPath) { - // Default to the directory containing the executable (which is where most users will want to put it - installationPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; - } - -#if !defined(DEDICATED) - appName = [[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleName"]; -#else - // We are hard coding the app name here since the dedicated server is a tool, not a app bundle and does not have access to the Info.plist that the client app does. Suck. - appName = @"Quake3"; -#endif - demoAppName = appName; - - while (YES) { - NSString *dataPath; - NSOpenPanel *openPanel; - int result; - - foundDirectory = NO; - defaultManager = [NSFileManager defaultManager]; - //NSLog(@"Candidate installation path = %@", installationPath); - dataPath = [installationPath stringByAppendingPathComponent: @"baseq3"]; - - if ([defaultManager fileExistsAtPath: dataPath]) { - // Check that the data directory contains at least one .pk3 file. We don't know what it will be named, so don't hard code a name (for example it might be named 'french.pk3' for a French release - NSArray *files; - unsigned int fileIndex; - - files = [defaultManager directoryContentsAtPath: dataPath]; - fileIndex = [files count]; - while (fileIndex--) { - if ([[files objectAtIndex: fileIndex] hasSuffix: @"pk3"]) { - //NSLog(@"Found %@.", [files objectAtIndex: fileIndex]); - foundDirectory = YES; - break; - } - } - } - - if (foundDirectory) - break; - -#ifdef DEDICATED - break; -#warning TJW: We are hard coding the app name and default domain here since the dedicated server is a tool, not a app bundle and does not have access to the Info.plist that the client app does. Suck. - NSLog(@"Unable to determine installation directory. Please move the executable into the '%@' installation directory or add a '%@' key in the 'Q3DedicatedServer' defaults domain.", appName, installationPathKey, [[NSBundle mainBundle] bundleIdentifier]); - Sys_Quit(); - exit(1); -#else - selectButton = @"Select Retail Installation..."; - - result = NSRunAlertPanel(demoAppName, @"You need to select the installation directory for %@ (not any directory inside of it -- the installation directory itself).", selectButton, @"Quit", nil, appName); - switch (result) { - case NSAlertDefaultReturn: - break; - default: - Sys_Quit(); - break; - } - - openPanel = [NSOpenPanel openPanel]; - [openPanel setAllowsMultipleSelection:NO]; - [openPanel setCanChooseDirectories:YES]; - [openPanel setCanChooseFiles:NO]; - result = [openPanel runModalForDirectory:nil file:nil]; - if (result == NSOKButton) { - NSArray *filenames; - - filenames = [openPanel filenames]; - if ([filenames count] == 1) { - installationPath = [filenames objectAtIndex:0]; - [[NSUserDefaults standardUserDefaults] setObject:installationPath forKey:installationPathKey]; - [[NSUserDefaults standardUserDefaults] synchronize]; - } - } -#endif - } - - // Create the application support directory if it doesn't exist already - do { - NSArray *results; - NSString *libraryPath, *homePath, *filePath; - NSDictionary *attributes; - - results = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); - if (![results count]) - break; - - libraryPath = [results objectAtIndex: 0]; - homePath = [libraryPath stringByAppendingPathComponent: @"Application Support"]; - homePath = [homePath stringByAppendingPathComponent: appName]; - filePath = [homePath stringByAppendingPathComponent: @"foo"]; - - attributes = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithUnsignedInt: 0750], NSFilePosixPermissions, nil]; - NS_DURING { - Sys_CreatePathToFile(filePath, attributes); - Sys_SetDefaultHomePath([homePath fileSystemRepresentation]); - } NS_HANDLER { - NSLog(@"Exception: %@", localException); -#ifndef DEDICATED - NSRunAlertPanel(nil, @"Unable to create '%@'. Please make sure that you have permission to write to this folder and re-run the game.", @"OK", nil, nil, homePath); -#endif - Sys_Quit(); - } NS_ENDHANDLER; - } while(0); - - // Provoke the CD scanning code into looking up the CD. - Sys_CheckCD(); - - // Let the filesystem know where our local install is - Sys_SetDefaultInstallPath([installationPath cString]); - - cmdline = NULL; -#if 0 - if (GRCheckFileForCmd()) { - GRGetWaitingCmd(); - if (GRHasProperty( 'Exec' )) { - NSString *cfgPath, *grCfg; - cfgPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; - cfgPath = [cfgPath stringByAppendingPathComponent: [NSString stringWithCString: GRGetPropertyStr( 'Exec' )]]; - grCfg = [NSString stringWithContentsOfFile: cfgPath]; - cmdline = malloc(strlen([grCfg cString])+1); - [grCfg getCString: cmdline]; - } - } -#endif - if (!cmdline) { - // merge the command line, this is kinda silly - for (commandLineLength = 1, argumentIndex = 1; argumentIndex < argc; argumentIndex++) - commandLineLength += strlen(argv[argumentIndex]) + 1; - cmdline = malloc(commandLineLength); - *cmdline = '\0'; - for (argumentIndex = 1; argumentIndex < argc; argumentIndex++) { - if (argumentIndex > 1) - strcat(cmdline, " "); - strcat(cmdline, argv[argumentIndex]); - } - } - Com_Printf("command line: %s\n", cmdline); - - Com_Init(cmdline); - -#ifndef DEDICATED - [NSApp activateIgnoringOtherApps:YES]; -#endif - - while (1) { - Com_Frame(); - - if ((count & 15)==0) { - // We should think about doing this less frequently than every frame - [pool release]; - pool = [[NSAutoreleasePool alloc] init]; - } - } - - [pool release]; -} - -@end - - - -// Creates any directories needed to be able to create a file at the specified path. Raises an exception on failure. -static void Sys_CreatePathToFile(NSString *path, NSDictionary *attributes) -{ - NSArray *pathComponents; - unsigned int dirIndex, dirCount; - unsigned int startingIndex; - NSFileManager *manager; - - manager = [NSFileManager defaultManager]; - pathComponents = [path pathComponents]; - dirCount = [pathComponents count] - 1; - - startingIndex = 0; - for (dirIndex = startingIndex; dirIndex < dirCount; dirIndex++) { - NSString *partialPath; - BOOL fileExists; - - partialPath = [NSString pathWithComponents:[pathComponents subarrayWithRange:NSMakeRange(0, dirIndex + 1)]]; - - // Don't use the 'fileExistsAtPath:isDirectory:' version since it doesn't traverse symlinks - fileExists = [manager fileExistsAtPath:partialPath]; - if (!fileExists) { - if (![manager createDirectoryAtPath:partialPath attributes:attributes]) { - [NSException raise:NSGenericException format:@"Unable to create a directory at path: %@", partialPath]; - } - } else { - NSDictionary *attributes; - - attributes = [manager fileAttributesAtPath:partialPath traverseLink:YES]; - if (![[attributes objectForKey:NSFileType] isEqualToString: NSFileTypeDirectory]) { - [NSException raise:NSGenericException format:@"Unable to write to path \"%@\" because \"%@\" is not a directory", - path, partialPath]; - } - } - } -} - -#ifdef DEDICATED -void S_ClearSoundBuffer( void ) { -} -#endif diff --git a/code/macosx/Quake3.icns b/code/macosx/Quake3.icns deleted file mode 100644 index 30e3b673cdf4f147208df4a93e289ab0b0f1494a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 35224 zcmeG_cVHDo^LzJt@4e;qmb{mqP$IooL6F{*4pIa`DS0XMqI9H(E~qFV2q@A?XrU`A zh=Nii;Q>-Y%Kc{V1&m1Z^W)>6-(qfOXJ%)%%>a-~J?k!+)YL z;qSA*|2@qD(IJh{%Ym=p$%0n5&b0`iVD;E)2YAf#_f5iAGZPjh0EIj?O}aK z>+IbxAs!*-g~?%JQ`Pxl;y@ByK1zej=S|_Vx8?jWdEyQ9VVHr=^v2orGkxgnhd${2 zF!}Z%Z8qS}4@TKxvR+n~tT5BrySEWafDA##WC!{-K^b92t&Rj56K0J3Z6;%Em{fF( z$_SHzcE+(`MyJd35uoa}(q)7VqSomH2ewc1+cYRV{rB0XFp?(KuQh1Iuwf0z%&<<| zB4fs)73(&Cb@cr=3uZO_ZpW7!K3}tV=IG|a?68(^Zk4`Z&8BY-&gyh^d9%G=ZQ1zI zoRMuk2&5~Kw*JWZn~%)weraXXgIib37+O0Dp^0G;LhQyTKWKS5r}m+F0Zs_|#H(^* zRO)YY{re_yXM}m3jtok=G%b)jMgoPT+(F)7#@qLe7DFLwXK&BB5%TRLFa>RGSM`^^ zQ9Ju{W`?;R)#-4lYuwh(2;dKEpr1OU4K17i&rJ*OZyMfI4e*?)uY@<(2(L|<73Pdi z4X>&Z9*e=QiQ&z0;Q;{vGTb1mesuAjBkG*i5)^ zd2kU4<`<9(8Tzn*fiwy_(<&n+C3?RACIbjs6=WflRltPVM>I;QgDewe6l9<=z+o_< zvA~f5e`BF&v6UA|gvc?7Re-D(R4^71Oq5xmLx?YtO2vFOPlWMYHk-o}h`B5*Sq1ly zK&H}J+!hpNLk5>cE#b4kUfNU5;WBP9z2oC1zuRslzZ3OJksBm|I$3V6%{!~u|l3goB&ApjAArUN*) zfFRK1g2{yhi`0A&=B^ z2)UHtYjA$_T_s|8Z}F@=+1~a3`gluAFfu1os9)snp_!ZPHvVt5Z%#s4dkQ z!?vPyu=7Z=+@@Z80CU=v_NL+K)QP!0E33p@0-0`8t>O7BR#omf_c(Pd(iZ+wilR!c zpUvC0Ams+tdHS}zv)4-ib*goFt5J)Me?S=?j00~{Z=a&UTSvwvKF|bfQoR*F->0Zw zhu@|`hbgM~^0uLg4;vL>i>i}RaMwxs zxBN<1sOC$k>VH8$EbxCg8ux2igT=*_AEN#OaE>3gow-+e*6j)nugE~`-Y?6)<(crr zDgJaPd;fLQsPm?ZwJN~Vza;luGYmNhEAeB~s5NN)1!d1oPcrehm!Rd}bGxj4Fzk;C z={XxMIL+v=_)+|Wa*Jtb`cc$j;)C*|xw9jhuph;@c#?d?L2rM|KycSTFX6Rv%W!5Uv%uGIn72-(DFz@IT3UxP~n|80XPFO9-yR&4`4nWe0hl0q$bv&)8`M z>kD(J!n;(Mpvov}2TF%4IB;cD2{fdPIuGp`U4~l~xu(=oqVV=mf3Jw3|`Xi=R zdBU|4jgMS)G)(Nk{N>kB1$f7w@P9r^3_LP;e9pu8!1d4Z!J{OB5yRt?1>?h^iX(0< zTnT*t?m*Sx3eGIt`OrY@ZzC8o+^WA{tI_z1BU2In%lK3nvB)??#wr4*(PLtYTn}Mg ze~wS@Uf5;k9-kQ|4!*fIOnl#Q4S2`LUPT{;88!B{rn7_H#Zc;#KadYu`sra9nR6}^ zXFGoW03#3mGDCv1UuVf6JM!x+Azhk{Y2RJ?PzbJezp+ES6T*!B*K(AQHJ&)U&$uwV z=6hK^U`ZMuW~?h*E13{xvAumqcMF2U9X)JFgAke!W*)h+Q4YQ>6Ez>$M3ogLYmBZ0 zPwp`D?A7faG%3swHg0Fh3NvCxrJ%_eyW5YkwVJ)I%L=oNZQtqIxH1-V=IU+_=wUZ* z)VceBx`OPm(DnAH%rWl{XkIf|BNb(anT3~k+m#vMM8`ExYtb)j?6?slJK4eMcT1}d z&B&fIXUWP9+jk#6f1es2zI}O*?=`CE`ndz&e6@b{$_3LVW^_*_$A(=l>zvG8JK(icuZj;oUO0qA^^PAN==uI~UP|im z1JiUFXnt5!@8teg#v{M)3fK-D9LruD7WF)`w+=e^`wp+}NL~g4MC-iWbzH}P|JrRj zn)|L05LNf?s)4?_w%Mvbls6b7;&yJYfg@C|t3b8$NSs4m-Smb7fqfwTT`6_QEW7 zc>5gpJ6elm_ zhZ`K|iNdoc3!yl8AqrR7)14W9d#nJ8?V*TrUqj(R!&p#E9fQK*ygDfSS_cG0RGSeF ze^Ud61qo&hi&#FQNDOwpO`^BR*VbTLmUw9@s$CkB)gx;_QoME35eFT|VOJ^1% zokf`d4VvAMaVY8VK1Qpt# zQ38=fD$|HnU3=ajKRHf0IOi>Px5uvnrF0#06 zX1zuslknNNxgn(CDh+0v-RZL+R4HD7OdbbtC`Hih51_eHlCN|`gQ!Z0e5Cg}HM}hF zlrxaP>jxJhHGzvXen%#nUnoKz4|x8mK?dUc?Pzf!hwXNQBbyQfgBgs%2&UZwh$I?e z!3bpWfpeXJ5eX(5VeoShilq^HK#)l53n9W64IIfDw4_j|@WYeaw5Cl+Rc$!5`p?TNyMo$=7BW2_I#5&i&JA#Kj!D?v~SCdrMM za{$)djKXnXdm$jel4gF%3V}wUYBUG5fY5EhPz#L`+Abi+9384*!M6Uy@@NsaN z4ZIv3HX3Liwoem)u-WpkjIE6>!vtVDCh3)Mfg2jzFSbD?wo5H-bRvMjUf@C(`4|Gb zL}I$g1xSXAf`>(k0E#TS$N>|DF~A0!Q^m_zDmH*<|{{Fz9BH)UUY=a zgPZuV2~XxfNn_{2JpF?-|9sLv;6`ZSg&O~apIrHCy??^b{^Iv$|Ae2n`+AFi!ml`X zyZt}mxBgPn>!0v@uTg{k3BNB)4gE*_H>r1CB!BcD)UcfOHH?g7a65V6t#CGH}N{>LcE}vYDaQxnV zEk&KKekfA9x?|=WvE@Vm*E;grqgL!bM^RThWB#;*6!pu2&u8^+;C<4n29Gvz^&8aH zwu>k#ztTSHepaHE|JQl`s|F|uFHmRePob#2&UMt?=eX$w-%+RHMpD!^RStEt&fmoS z4Z+EyPTGc0)EAPa)YVu1M*bUu{E|9mdyAqz<1eCqey|<)H?9hZHB`R214XT1e@LBy zAoiJQA(gAGPf@ecH0oIJncVPVjoK}#T1HI*qu%Fz4*r4E*PP%z3f?zRTj0s~%=9Yt z1>w0xy^DrXs~%eLQ)(p_uR|WZUiGJD!Q<|k$zHGwSuPY0LhXvP{(4tGzN-4dY$QH- zvm0u7>m6`Ao|z6wm^V}<_62!mHlUj6Pqw%MzAk(0P=V3>LiiI+A z!50QDV%jc$KG_dysv1;$96Z26-usQWv8z*`2u1$=Ja*@}(r?nsEcZC)|NQrW zN`#(7@BKF3AtH8Vhlvf^Nnv8L7%tnR;PRsv-jl{n&}4*(v#}XrX5CP@w<9x5-#1fZYp9aFjp0FyLb>4J?Nh^?~2 z*@c7*B7?|9g`p_$^GWb1GccF|5iNL-5ZMw&G6Mn%M1&xSwQ|7`7Z)O?%I99jy<47hKemxL18SkMovI$1citp)maEFsniN!9Vvv{P(i90iV(ay z1I=Ox<7mwS#ESru2mmkVkTB8&h;itq@E$hhZQ3J-;{lPh_Yq^f>MSReXMa56&=t)q zC-B$Nt6I@~Tpqpxm2Ia9rS!%k^LlPU$=TiwnWzlngeI%6P#e$>_&HZxR)*hdP{%Rz z?wc5d2irGvRk)OvmE9|&HzgyO;=RSoO6NSFB6Mfr-EqZT|14h~db9uS3aj6D^)4n} zQ~ybCqC71h^_SJF(}Pm)A=r{Vv@i-$XbXgo_Yt%2ZK?+xC}2*YN*c-`f1f(j66Xu3 z6CI^=zPqmi@`cpeZZgQ1QJ?oz-9>EO5^7^lmEaCyTjo(;^ra!)Dr(bPCK2Fje@uP( zw#5ukjSbYckq$jT)wWY#W%yJ8HO!^9j|oaK?ku%`aw4wLzJSV~RT<;nxJeydP*nm@ zk5cMHPF*oT@ZkM!bz>}L3`PC0u9Xp>X%zL-w)PmB3p>f%-i!ihF?Hv{_O1?q7Ere@ zZtrfPaRrxl(aFTa>=!9KXgM(V<~qeJWfZKHm4&rHA_vq2B=d^cg zSmz*K{UI|)ckkS$X{vZB;!_?G6QJGO7ryplo0ScbUcDeCgIiyybv zFGoCaRE^g=y#9Jq6K^`=n(7Q{-=RgcO1J`X!6UwYb2kY^wh6HY%EU`t=4@)(pgseXCuEuGJJPfFpqsxe_Hb@~~0^<&%Zr!?;*V{-gK>|l*^yZwL0c~3~bP=PH&RyOZ zFm~F6PPLO9;)RI2n7VN1*3~0@)eDi>SG88FP7{``%Xp)6+gB?~<{(*0=gwVv_UPOD zohAF$WcO{A8nAtcxT~pixFG|KbCDt;p-!t-?@avs#Ln4+dv)v5`Spe_#vH_vH0jvo zjqZK=h6V_SP2cqG4=ZP+C)BCtlg&WfPjU008&NZmCZSrj4n5N6e)QY5Gha*@-nUQh zp5422ZdytFA+j1=w6HGJ6c_ePGK`o;0vKkxfw?qHPOsz4!rHHg4XyZuhotw)KbOAzxD$LG+QKt`HLU z$OYuabt^vGc;LXdm%^D8>$e>%CWk^98T`Cv@iUDZM))i&?eyWhYe!-l;# zGCh0D#K}`a(>ODx&sg&Lu9H{BQ>bSMakrPtb%zkTJDy^dT+G|DdR}O9Xo_U&l*!}9 zWR4m!eCVKFU0c>rE=F2WwKl!q8aRCT$n=acW5!RKI&Jp6g*i)CtX>mZ&HrfSiX}^z zE?M+JM;plfh8~JzBcZ*nLpNs6nDN214`$AqGk?M2oSel=7B84Ld)BncQznhg%z!4p z)w^AT%A%#HvblDLzF2%lcJ}!3Q>V?Cvmj^r>NTH!zG>UG-MjZ5ICbVs{)80RFgk%- zUGQyo5b@FJ;{Av7_U#F6Gj91}rI{&oC?< z+73;}!ax3O)0bcG*>~v3fs?1t9GqU2VQuv*2)|SCX!M5)doLg8!q4Axh_8!g)?bYx6YU`%;4_iHL;+W9zfp4~L)M6o^(3mwr>MQh z^7bFtvwiE9P3u3UTf1Q1vsTa*L}Qd<&wG6r;P61rBNlf z5%GB&P+g%wXb)8F+JE@udGnX8{&W)vJ9r@f=&3V#Q&UCOo)mTE9&~w01F@o7KDF;y z?*4syzTUcJ{n}-V7JN8)bngz0l48vuV+*RzAxVq(l@@QjHEiq$3s-->bMJwJ`KQn1 zO-dFRp-sQvxlwRoaRad=^$-@5yJy?_RXOvgWWCet&31LG_%sX#YbQz;=SU?;`K9)#k zsygq=v16ys>>V9I;&#`e3RuqvDKdUCu9Ca|^TCxIDzS)l8rdyFZsAt#eh;=%Ykh|~ z3r~zs6roCMsr`p?_pa$|SCVItjo+0zcJ$O1CXZ(Y zRdDCdl|B94u#3>2+LNEVGv_riFhw<{cAhwSWN8ENXpO6>TX*hU-qX(wUT|&d(BXZ% z7QRaSh&TyU?ujG$IrU*JT0z~rdFS$1y?hynLw$F6@6LJ68NgAEI(p*hkp(qFh#y!& z-3OL!Z@T!fIZXYyZ|}}IjagVq`1sMo`SU;uZw^&bc<1t$Z#c*hV&6Tpd+*m%>z#!s z$;I#U^K<9bmB1o0kD@S3Cp*Ax!awiazhzPl(8R5F{HJ3la_3bO0e&_Gz4~oaN8sT! zzHsH616#*c#bWjs<{v-2pc)HUCSjI~pSN=WOW@+|eTO$^q?|=j2^;SoIG#7XD(-bU z&9bst6!`OjbARm4-8?#80Gbj$rVbuI0QW@*Dc-?67nV0NfahNS^tIjlHoq4SniAHO z9yq!`I|VnUe<}6*jdKed8Ue0)@b=DqU%nH=IEy%QsDnp$XC-2mj)m0KTR%=uQ$k}> zH&MIyZyxN!Qf5+lhj(WMFiZV&)a6@0PELaGfSa_Q+L^nlpGysmF=kMCM|X|z!+>#X zpQV1gb!J>V=J&0kcI1BA$0mXSwxmrVhJ;*TI62w}FEYRp{A%x-j_PxW-J3dgY-@jGCSvae^05(afTmMBb}wnE z0&2(0rw(uFqob)8ZX6qmsS~KJJLfl60=4bW7jidrQUPuqb)g`ypBZ_eI8p(kA z>d`BEH?)%gZYA|wL2e&2K!d3-cTKE@>(*F*_s}QpSb$qf{dO(4mmZ*w)E7H45}__D zX>DoVhS#zXJBPY>ZBH)?5UWvNZ5FC^(GKmb*Mu*?d|6gbLh{fXT1V4 zXHi#v-Pq2Mg_xzs7B!CoO0QqOpOOZY4C>}DE1TQv*=CoIjhH1eC!Pb#6f& z4N%UWo!(Fhl(ygglo1P*&SC2NX=zHJ9Jn&IrVJ>}zC9O;14@UB)X6ESGNA0ZKcR*g zDD}@=7!?DQRzFfl$Hz;7vW3b{69Ogh-Gz6(K&f|{I+z(J2FhkCl*R%|wG$VHx`0wE zkIK!A!IYKM=&Aysq~={5UxVKX~hq^>SnM=K! zgzNY=T^azR$xi;9+BwLMDf6iTi9lhwS6m)o!6TQtn%eS~9Snlym`(KzV4CKGn-N-I z5w)qW5hjvloK1CdLi<>j?ArsQa6Q>HYGYRgObpBTKGnuf0!{Vq-N9xSD49%c=nM^H z8K+S#b$p;m`W8Yhpv<5?jZh{PHBkwFhB5lRhYh!D2DPRWt`eMZs*aEZLbcpCthket zsFm%6K=2IRlP16fUrrk<9+xrH!WQr@hEov%&T&#&Ua(~6=RG~0{THZh~4k5AtF?(PbBEH7d)ane#6ZZ6q#%0}r zRxTFgl4kYXq9R0Eodz6FZiYWPsubQw43Vp{un4k*1Od)!BuH`gYEX%@UhxLVHd3Rsw+-PkN93b(>q zFBruJ2EMyq(9Qus;IA8N=VMGvomeLqLRC?0ji6UdKyW5VdL=FbNvfp9`DGXTkfcshoL@=fY9+-*N1(d#34S$=s}~m^t)-y`2?;S88mgZVAESBzJ)p)v zz%@ur2u7s*S)(!3(BT@|X7LHp`UsR5A2bjUJaUB^4Ikn|ZKH(vSR=U@F%(9P5F#Xj z*=dyW0l_vjjf)SOnE=5%X;F!|%p8cy>jx9#qSyd2;dQUV%v*rCOs>Le zl1l{arEo0QRxd6AMrloTJM1-UGV8nCe7#I8Vgs4O5{ab} zwUWCW6gLZkY+zW9I0B7X0Rot?X#+#Rk}9+s1uq9wGz%srVl&AB$5N)Xs--ZjYy#Mr zAqh_=lS@@*uSv#V2*;>f#3v@kLsJ)mKAFyK*Ge;BF!{_65t}Q9VA>9#uMYVsAVAu?7vA!0gHebk`zHbIaJJ0^EDdq1CxAFI)xB|b9Lhc z+;%-N9r1+hhvNJ3(g&mk8ep;#(aDCA0&TBFfwGjw93)f-niEh*OL zuow+;1?Z7UWSNMoYd}lW!6|=+98e*NL?PE2EjG75u4-C}-)7WgD|m95ObXo>aEV2T z35V1biVQVdqt)s3dSj+ZX0+J7{@rg+Z(MAx=GbXs~K#8(gLdK9OWMt}fTCFCeMyim4EeFwXFD*k-f-8~J zk|ToQ(19gnW7r)|N65wY_+w&xCJsn8)=dD(0Rs~pKx=~6=kvNk4rB{iktJke>h(IE zHbc!*!NAI-0uBqzO9ZE)<+#aMFc!5l76f!ZN!z9)q4Z#%26l$$bt23F+77LbHE>!CGd(9j$ zRc{@TnGmo-yQ8eh9>34yal4!#l9mZ=)oN5qIFuyfvq|Dp7y^>bm#E-GhpAj($f9)Xd! z>7a2S3S{~G9wWG~{DjJM>l|PRd~1Ry#_Mr|EEq|V#ca}RwQ2>l3x3?N1+fVxTPjx@ zLKeNv_E1cW#|WL|#Z`(=f==2&48xM_i3xdSxJl4OXpb6hY%Yr=zJXa_aYPD*3OZ-C zyWJtL)DHr1JK|EXc?WIaxvI<{!0UB8ZO|R9S|$}sxJ;7Ri{SahfE7z7SDBo+3o#xO z6Lbfw;Hm*T42Rs5;`KvS3!IRVig;`mgMd&=N03a8zz7rKjqw;j8#hpeo@ZP|WT*sK zuhS&ruz~v&Vh}8CFyxcOxb>LTQw6U8K`U%?^Nhgi_1ZNY2z|JcSeOx?ONV`GYZ_ix zqHWkV)s>)a9-ET<5q?CH;1BsohX(Uls=^S(M;n2MBd_YhJm8*kQt)ipl>~4Y(jqq^ zSRzN13>+@23_<`-B@eJzWZ-wJtAd`m7!BAxhnL_18D=Rsz==+{15Dtpb5*z@aeg(d z66|=~4kJwmSzZet3#gnFpBU#=V0v6Mn4(z%^#j1^HDS84642v)a!ii}WAK;+=MeH` zcnJ#+$cmI?TwM+a7(_K<5-=665 zI`u4|Ym`d5Itpw5)BmrTOB*p7<=}D+# ztrMRZumG8@0kU0AKy7g)4>l6OnPDLaS}|2s)#bI(R3S9osfS}}Y-4@snHl@HK=s%Z zxGq1=?{jEqYJ<4MfQbn{udJHOW0w7d*lb^n*P*6~jp7ocO;D93t>$z^i6A^-yMtaQ z#0qS6onU;d0k~M=G^fkL0~*U7?{X-Brf3uwAJAe6B242FKY>r1}$LCurdVMOY;< z=$2uMFWM@`6oD&ffb(!{elRu8A;c6%Oq2jq*p8ry15P>HmlkK^Wg~_;&d3L6p6dwU zh=Ij%)Pe~IyfN9t0iWF-Yl5?LES?Q~TQ;C|DF%#o#2T2{h#A!&&H<?W@f3{223pNkWd#99 zVFGRhL)a;x$H){JM)CrBj1;{YK_*HgNHvY@8f_SZNQqZ`5zhE2FiO%XMhhsBLjWk9 z45I|?{TRhDZ~!IY(x_H$4WO7}_C@>?I?yI=>{a4lJCfHC+0ZAykI1@y30%`$Qn=d8 ze7H(wEV%NytYV0Pa6I$ngQy1h86rzi3^9trAK>6D#Y1PcTzp(=VV6KAZ()L%h@os@ z#+=F)R>)YY78VI&KuDr*0p}sHqtDeex5@|_(l@m!FpkC7H?pfB#9{M|_3iMZI^efd zcc@94W~=Gaf&{j}QNyig;EH@#4X=@nA*JsXpP7RpS)i&9?ih@VPxagQ7*d1FWD{XX zUpXG0g)~$(A;w;g3kIAKs9JQu5rL}5RDi&H$91a*9`IFwVjklDgdXzM4q(q8I%cdB z6XTXbceHh4;0`$oX0Fm3;Dr_-{IISrft%H?S8&1IR@mU#!KI^{I=&#>XAs?R`Esq* zCS3~S=#A0}m=L^}YWw4SFfutXY7)8HDqVnhJh8?WrIPTOfaUU|YWf2{EdyX4!IMZO z3bRH4J~~gLG{b{m%w-VpqD$zio#X=rLF-#tW9fA->N)r=;eD^)7B!*A8e79x(Op%>yo zr+5(($uwra3r@9*A?V|gbCH}Ol*<%KjYf&p&_G z0)-aNMC)}1BX*;sY}SxP4ripD{y;)X)#`PdG;h(Od9#`_@S{xC{V+2wX$I0*8#V)U z^Ck^yRZWSHc3UkPg-WT`=|Xy;R;`w+lq$JM%qJlPQgWm!z19Rix(TFP%od0x9JY`{ zXpgc)nT!x)=yYoEh&bA6K9KGP=Z$F$fUBRS7Q(3OjRu3!pf_qkG+zxmR7$*A0Fl0f z!I5h;K(#X068FB}EIpnwgN9I+bWKpg!*xE2+18bL6)WPMl5H$S8s?>oiIw+_W49f;h-TkSu{z zYtThmt#-TB?!f*qcKiJx)u|3KczkyiUtC;_Uk~1}IV#Bs;gQb+0gl5867dii)EWrX z*aZBbWdmwJLLem9!LV8(nsm5u6y%2}2>dU20xW91#t*OB=(fbf1!AJ1Eu`3-?2M-8 z)~M4dBtk9+oEAjvL@wMdlEsDJ5a?l`V`8G6a;VGmrsBFjJ(D1jCE4WM!tyIH$HaL2emfj)VQ}4*qvPUW{f3!DhE!*?+hbL8!99kbvlGW4dL+2kIDfRy zZ-rY$FSRGp-0(agkvY`~!H`)D6@m9OQjwZizc1QnlR{Z!tqgZn(5=GesZDbE+#VAT z5%5|`6c3~BGmC)2tev9PFCM+I@bvmWl7fp~7Xn`u#2p+j#6?aG6NZ4JNr($TeY_$FT+t4XRmA}P z5E%Jgw0srVUVMZuw8uKUHYKK8f?hv3BhWrYTvAM&A36^0b0)fcRymGLOz|GL6@bo@ z1>=Ek=pb(XQZ4@?M?syJLa4v>Uk zu-0-?z=eYhWtAug^b915TtRmf#1Jfatbj`eG;xa6p~W<|z#a>-ag?H_Jue`NQp^rD z16Sne6MQDTyRWMm1J7wpOEWv5J6Nb8$rA-Mwz|3>dwalDH3|k82UNNQuMtNkdT{k< z5~EU7l;~%W6B`Yl4s;wSxKbu;*u~pT_|=3aI;e%)9K-7oAjNk!5=8M+i=tNUB zCdLB64AX}V9ikkmCq@lF7-Gp1gV81q_~{;>mW?a8W99I+fh7qf`1Ck%aYSoafEPIf zG+yXPffX4CHbLkn2;w@Ul~92#aioFe<3P$75B75&A_-?uo(;~8wYnQ78QNq{mNR}q zq$7aQ{HR(k7!2UoC&?Ma&xo`KW$@_}b1kO|VYDt;Mx!l3DWDB?o#2Xt5KSc+gfOHz zAO@_dzFkIR^{I4ZVh%_lz+ma>k{1w_Bh478_AoCZ2KalJQPRRBfUrmEU=SA&319ZWfl^}~5BLNc5~3mn3&?_c zI_?pZ+zI|B|97h;c6|SmJ#G?SFxG z@4L5eP!j)tq3W?Z+~C}wEbV`Rbi?`N58ilr`hB2(`hb_GKOXdd7H9}PU6Ob{<+z@m!lnCxl{)I3&-G>94{rAYk>YG?`z=|&Pz#_rl5b-`=*!Ge{E;b zziu-A+4f6G+Pn0Ym4yRyQRfnjm6&=c_~RZ7Jd@4dvfy2(yy5bIbC1Y1F+Ulp#OSKpC|mR@r92?x&D5(7q02?3TpjUN|oKp z8TiulUjhApyhQ!K!~EY~^7c#Xe?R)` ztDH|u?ep}lB6d>i%{1SYSs_Smo*`B{rWEVnHQ_lvgV1LAAGGAnt&^VUtut$_qj{(c z^Fe#BXL=RN4{rf~(V_8`;QZvXk~!-_MEJT|PnrfZcIUvL@|KPd4SkkPfj<2T_+%(m zdVF%N=W)Pgb+^+$uBT4=;3eo|k_Udu4C&V|=Vpf9Fg|1MaeeO>bpOAf+T`ieTCR(g zIR95#!}R3G-dcY6jWktudi4jPQ4MXp$29O!RAAp-s8M`jR?FuL0C)+5PvGzR?19tY zk4dftK)nA^cBn_H?(rk^NTuLuERFhoTKnhRfnu1t;uY)2j4F@YGV?CJMU~ylPH*k4 z_?4qabXF*mDVK{tTFD=C-qch;KNVDkOQ@p!nYAAmG3e4usnWYsM|hueJB3sE7JdH} zEf}DEs?rKXBYd{H?3>9=9~Uu^t)MrhxnrMGJ>pcw%P$PT{Nc}It+*A2nRvxqGotxp zC+wB$SllW(`#EeMgmLPY>t8wwA7XxHBG}x{Sizme>D3==u;NcJncCkPiNwz#kX;*_ zKimLI)6LIhXNpCr^?sWF^th1!@jYyKg=V1g7bHs*stRAuczoZg+@aZv7ml<)UB6tV zkR&gNJOZdcR)mJb*BT#};3H&ox(glKmr;+$6G&JjNfN~4n_B} zvLpf?uU^JJio!y1I-DJP{YmR}^|SOH9btr@FV7uZoh9H3B@6-%UJ7u6FSI{Q4I+<} z`^!g|AK>8CAWl3u|H6Qi9s*YN!E?(8l`5lU7cL16bv|JKTi&gx6u8PFtdV9MS~jeS zk|2c=nMfcM3OO7Oiyi51^T-!cidK)Zf*=N)1vKCgh-4BWiIh!-Ei3h@nol4gXjpi%2W=>wwv*6j+2&XJocQsGJ0(%V@u51sL13QP97cRfVbZM+se zE8YJjee|ff3fdk6HoE#ODL^mDhLc1c%IE*ncVo!x$g}n7Rj({a4~3rPEU^;TMCATW z7CnL3KERmwjHpfY!H-{XK)x6ePfWUw@nxm3A^Pa#(M)jp<5T=egur9E{8tp|e0M|m zL8ZUt5$PrSLydXE%h#W;(o-2z>1lhCYLF7%Fm*yks1JPh^O=dkNf^ECSY$v;|2D0q zKqxEOJK|OC^ax8?-q;%KNkzc;clG7fOO7p@kR1vQ36|eE&u9W1f=wQ_V#m3ww@OP& z{x-3osI+8%R!iN|^1(SazP{-Fd$1V&&E%nW>8-2hcC3Jr4-HI|@G7hxPi+Ii;s-j7 z{A~NVoA)A%Y=wD%UY6Y7m(@bIuDt)>PHLri|Bs@_bib(R#*f=R3r(IF8ri}Q{}Y<0 z>U@Mqa-7Zjj#`m_uJr!Bzl;IsFD>4k-O}&{c0b@=_d_+kG`ffv5r_{-r>Gcz+s4DS3&91_BpoBxv}7AfLdbephj?e0^*-n@&&(pFYl zygk&!_<4C(znj!eo_VLFy#K|;cW?fBYTt&H6Gy%~D!p5aIE7IBpQtXcL-H78utndj z59TiYZ2OVZaATH%n^wAYL<7^O<@&#!*hMtFxCB0*1-IGhqq{b)oIQC;_L$J%H<|=V zlK0OC{x8i1qal#Ml~BLkpzLX%9gXzAWXp&;mgVL8kH6nhJoFy4s*EZ-xpCgKaT&u0 z_h?lw!3Ez%!#x>Ka_gir9@zVTLHVDpCs;yV$`$-1Eh+wVd==ir^7Vgjb_+wNyTxVD|6B9NwMx>< z;iS)>)&83hTXqSCxwQDs^3jQg_saEuJ*9!LVc}g^`>C7bN5*UZ<%B=2y)5gc63}0C zecs5RqGus(0CzWJ)M2ImbQ|=S-uz&g@r9mg;-9|*Ud-J~S;L&XPLXi(=DPGWvE
  • _#OUv%A z9-Hujp1kGj0Jna)1oVG8vI-yRM$!(*_Q?&w!Rre8OW?5_c?V`_k_pzDR!swzC>Q z|EcS9hdZ9Kx$rO4KCJ4^1@HI%!V!MJ^oi&nT?K5e+8u}wF3f!A30q4K>;GH8xee_9 z?wpZ$52qatK#D&Zl?-rV80`PY>4To<>)ijQ4bf|1{%=nk5d}h;();hLMkN94DgY1s zbxSiccMEt9wBCC`t zxjlLq)>9ihpm&$P=LVQrP(+pPn9%xhJKO(C;Ukr~?_Q@$Z@fDUzw)Sc4fNm18E(fs z7w=QyZQ1poxoi4}ynk9`cE3oK{61kAe$1A?f2QAmYEKta*Vkv%e6Ck9|5RxOegeGC zlHalhV^qcW--1IW)Rncv(_ZlHk5Iz{RLM`H`{Gw#H7>#U-&zuR{|s-pF02@w@M7H$ zP@1-jDmgQ{2X-^7d<*)2Ul`H9zJ&T|QNJhbtON6ZE5&T3?jIf98H+1Fe>TL53rp@( zKg{m_=>Msi{pjuQDMi%j>0Mv+@{5q^qmr_3Mm5L! zt#d*Dp${VG&(h0Ej!*6Q+;75g{r@PbR+N-&8&wb2HB18id#ALb-{!qjR+2xl&5K_C z;C~RXxVUU{dUdQ{mks)NO>RuTFC1J}oS)t51$!T$RQh2_+2`q1uztlb(7$a$U3!13 zds)e$u`U0@eKsuZITLS2Y1v2Vl`yw#5a|DMd`Z9)IX<0{cEU&FF{yT&wpvC%(P zDjNDn>C!Cx$VG-Gpnv5Q*!_UFp$$s^*qU7zgD*A-y51~VnoX~B)_S0S*#|LLDX($K z&CfDxz4-a(Hn~=^ILnEjbCSxSf8jVcwtrrOl4~nQS9$UM7pDDIyfDi}PqYX0&kQ;6 z{m-jk{M*9xxEJ4lY2r`C3$mQFei!JU5yD?IL%c@CKg}JDKOFpm6Vv$9)%jx`74*}~ zueABqpC%8ry!iezr28(;85bFUEA;<^5MJ{MMbnG>#tzcI`1_v_u0J(B-9szVz-G`S zT0c_MIkkSoK=BKAe-O!?u{Lw0hmYfIb-3u>q!2bgLXoz1#yf9vU%Y-o+@{xnAr5-Y zmH&1(Jbn~*1xa~yuQr3*J?GI4sPG>rcoo5I+{QxpUwZELr7^?tGml^~#r8H0@i!P= zcp^B_iE8>)qU6l&^I304B7TCWPK@UKPxLcbOcIVnzz@*AFZwYwAY$|IOQ zzM=xjmpAh=`@i^muA - - - - IBEditorPositions - - 29 - 69 252 121 44 0 0 1152 746 - - IBFramework Version - 248.0 - IBOpenObjects - - 29 - - IBSystem Version - 5V21 - - diff --git a/code/macosx/Quake3.nib/objects.nib b/code/macosx/Quake3.nib/objects.nib deleted file mode 100644 index fbea89acbecfd2a014a31c83c001191365453f66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 765 zcmZ8f%Wl&^6dltxjc8heV2hL;s@RcTS5AW}c@am&AAly#C=BrsJ6KrG z5R*!kc*%+)^#k|?Bz}P$pF7MO^+2a~z}JLey=is-PsTAl+!nL%%8>X5x;isQ`00qru3?gz;qGb~=-ZM_tTm z7|28lgYGDR-L;(_2_lOVKQ{hmTCrA@V)Qc;+tf5oB9snH1XweWyg*HaF5a!zYm~q< zP1~s&drqcd#9VTiDZs&7mXAk7bM946yDy15_AwhvnTT)dJKO+SKi#9R$)2;zePFE7z&aRs);r*wIxJAKd@gb{C*{#xxDgI_kyeNBp_WGA3HpEsaa z9WJSwl?x@5cG@^?cf)|Q(DMj`$Y*LXQ_EbfmU&I(0NBW0s_T;Rbc3N*|6^tvb3#4x zc-rcp1)!>yP`VkIR15g2-^Q+I*?=6XSviEmq;_B{-~cOOA(>W<3-Qo)Y&z&i+#?(e z1h8%)i_x!g0paGhc0UtaFvFQPTOSgSjLK+bn&i8%cl5{G;`&XoijgW7kBViC-WPd{ cJ`^(pJ|A - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - qagame - CFBundleGetInfoString - Quake 3 Arena (1.16) - CFBundleIconFile - Quake3.icns - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.16 - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - - -"; - }; - 00F5ED39FEBA95B7C697A12F = { - buildActionMask = 2147483647; - files = ( - 13380E0F00ADFAACC697A10E, - 13380E1300ADFAD5C697A10E, - 13380E1500ADFB0CC697A10E, - 13380E1700ADFBFDC697A10E, - 13380E1900ADFC10C697A10E, - 13380E1B00ADFC22C697A10E, - 13380E1D00ADFC32C697A10E, - 13380E1F00ADFC43C697A10E, - 13380E2500ADFCA7C697A10E, - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 00F5ED55FEBA95B7C697A12F = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 00F5ED56FEBA95B7C697A12F = { - buildActionMask = 2147483647; - files = ( - 13380E0900ADF941C697A10E, - 13380E0B00ADFA16C697A10E, - 13380E0C00ADFA72C697A10E, - 13380E0D00ADFA94C697A10E, - 13380E0E00ADFA9EC697A10E, - 13380E1000ADFAACC697A10E, - 13380E1100ADFAACC697A10E, - 13380E1200ADFACAC697A10E, - 13380E1400ADFAD5C697A10E, - 13380E1600ADFB0CC697A10E, - 13380E1800ADFBFDC697A10E, - 13380E1A00ADFC10C697A10E, - 13380E1C00ADFC22C697A10E, - 13380E1E00ADFC32C697A10E, - 13380E2000ADFC43C697A10E, - 13380E2100ADFC59C697A10E, - 13380E2200ADFC78C697A10E, - 13380E2300ADFC85C697A10E, - 13380E2400ADFC9CC697A10E, - 13380E2600ADFCA7C697A10E, - 13380E2700ADFCBDC697A10E, - 13380E2800ADFCC8C697A10E, - 13380E2900ADFCD1C697A10E, - 13380E2A00ADFCEBC697A10E, - 13380E2B00ADFCF6C697A10E, - 13380E2C00ADFD01C697A10E, - 13380E2D00ADFD1FC697A10E, - 13380E2E00ADFD28C697A10E, - 13380E2F00ADFD38C697A10E, - 13380E3000ADFD46C697A10E, - 13380E3100ADFD58C697A10E, - 13380E3200ADFD71C697A10E, - 13380E3300ADFD85C697A10E, - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 00F5ED77FEBA95B7C697A12F = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 00F5ED78FEBA95B7C697A12F = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 00F5ED90FEBA9615C697A12F = { - buildPhases = ( - 00F5ED91FEBA9615C697A12F, - 00F5ED92FEBA9615C697A12F, - 00F5ED93FEBA9615C697A12F, - 00F5ED94FEBA9615C697A12F, - 00F5ED95FEBA9615C697A12F, - ); - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ""; - HEADER_SEARCH_PATHS = ""; - INSTALL_PATH = "/Users/Shared/$(USER)/InstalledProducts"; - LIBRARY_SEARCH_PATHS = ""; - OTHER_LDFLAGS = "-bundle -undefined error"; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = cgame; - PROFILE_FLAGS = ""; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wall -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = bundle; - }; - dependencies = ( - ); - isa = PBXBundleTarget; - name = cgame; - productInstallPath = "/Users/Shared/$(USER)/InstalledProducts"; - productName = cgame; - productReference = 07F3F508FFE98E8EC697A10E; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - BNDL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - - -"; - }; - 00F5ED91FEBA9615C697A12F = { - buildActionMask = 2147483647; - files = ( - 13380E3600ADFDCFC697A10E, - 13380E5100AE0235C697A10E, - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 00F5ED92FEBA9615C697A12F = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 00F5ED93FEBA9615C697A12F = { - buildActionMask = 2147483647; - files = ( - 13380E3400ADFDA1C697A10E, - 13380E3500ADFDA1C697A10E, - 13380E3700ADFDCFC697A10E, - 13380E3800ADFDCFC697A10E, - 13380E3900ADFDE1C697A10E, - 13380E3B00ADFE0CC697A10E, - 13380E3C00ADFE1EC697A10E, - 13380E3D00ADFE24C697A10E, - 13380E3E00ADFE3DC697A10E, - 13380E3F00ADFE4AC697A10E, - 13380E4000ADFE58C697A10E, - 13380E4100ADFE6BC697A10E, - 13380E4200ADFE7AC697A10E, - 13380E4300ADFE88C697A10E, - 13380E4400ADFE97C697A10E, - 13380E4500ADFEA7C697A10E, - 13380E4600ADFEB8C697A10E, - 13380E4700ADFEC9C697A10E, - 13380E4800ADFED7C697A10E, - 13380E4900ADFEE7C697A10E, - 13380E4A00ADFEF5C697A10E, - 13380E4B00ADFF05C697A10E, - 13380E4C00ADFF27C697A10E, - 13380E4F00AE0112C697A10E, - 13380E5000AE020FC697A10E, - 13380E5200AE0235C697A10E, - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 00F5ED94FEBA9615C697A12F = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 00F5ED95FEBA9615C697A12F = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; -//000 -//001 -//002 -//003 -//004 -//010 -//011 -//012 -//013 -//014 - 011F78F200B25B65C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = macosx_qgl.h; - refType = 4; - sourceTree = ""; - }; - 011F78F300B25B66C697A10E = { - fileRef = 011F78F200B25B65C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 012AD90700868211C697A10E = { - children = ( - 012AD90800868211C697A10E, - 012AD90900868211C697A10E, - 012AD90A00868211C697A10E, - 012AD90B00868211C697A10E, - 012AD90C00868211C697A10E, - 012AD90D00868211C697A10E, - 012AD90E00868211C697A10E, - 012AD90F00868211C697A10E, - 012AD91000868211C697A10E, - 012AD91100868211C697A10E, - 012AD91200868211C697A10E, - 012AD91300868211C697A10E, - 012AD91400868211C697A10E, - 012AD91500868211C697A10E, - 012AD91600868211C697A10E, - 012AD91700868211C697A10E, - 012AD91800868211C697A10E, - 012AD91900868211C697A10E, - 012AD91A00868211C697A10E, - 012AD91B00868211C697A10E, - 012AD91C00868211C697A10E, - 012AD91D00868211C697A10E, - 012AD91E00868211C697A10E, - 012AD91F00868211C697A10E, - 012AD92000868211C697A10E, - 012AD92100868211C697A10E, - 012AD92200868211C697A10E, - 012AD92300868211C697A10E, - 012AD92400868211C697A10E, - 012AD92500868211C697A10E, - 012AD92600868211C697A10E, - 012AD92700868211C697A10E, - 012AD92800868211C697A10E, - 012AD92900868211C697A10E, - 012AD92A00868211C697A10E, - 012AD92B00868211C697A10E, - 012AD92C00868211C697A10E, - 012AD92D00868211C697A10E, - 012AD92E00868211C697A10E, - 012AD92F00868211C697A10E, - 012AD93000868211C697A10E, - 012AD93100868211C697A10E, - 012AD93200868211C697A10E, - 012AD93300868211C697A10E, - 012AD93400868211C697A10E, - 012AD93500868211C697A10E, - 012AD93600868211C697A10E, - 012AD93700868211C697A10E, - 012AD93800868211C697A10E, - 012AD93900868211C697A10E, - 012AD93A00868211C697A10E, - 012AD93B00868211C697A10E, - 012AD93C00868211C697A10E, - ); - isa = PBXGroup; - path = botlib; - refType = 4; - sourceTree = ""; - }; - 012AD90800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aasfile.h; - refType = 4; - sourceTree = ""; - }; - 012AD90900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_bsp.h; - refType = 4; - sourceTree = ""; - }; - 012AD90A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_bspq3.c; - refType = 4; - sourceTree = ""; - }; - 012AD90B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_cluster.c; - refType = 4; - sourceTree = ""; - }; - 012AD90C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_cluster.h; - refType = 4; - sourceTree = ""; - }; - 012AD90D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_debug.c; - refType = 4; - sourceTree = ""; - }; - 012AD90E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_debug.h; - refType = 4; - sourceTree = ""; - }; - 012AD90F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_def.h; - refType = 4; - sourceTree = ""; - }; - 012AD91000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_entity.c; - refType = 4; - sourceTree = ""; - }; - 012AD91100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_entity.h; - refType = 4; - sourceTree = ""; - }; - 012AD91200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_file.c; - refType = 4; - sourceTree = ""; - }; - 012AD91300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_file.h; - refType = 4; - sourceTree = ""; - }; - 012AD91400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_funcs.h; - refType = 4; - sourceTree = ""; - }; - 012AD91500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_main.c; - refType = 4; - sourceTree = ""; - }; - 012AD91600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_main.h; - refType = 4; - sourceTree = ""; - }; - 012AD91700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_move.c; - refType = 4; - sourceTree = ""; - }; - 012AD91800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_move.h; - refType = 4; - sourceTree = ""; - }; - 012AD91900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_optimize.c; - refType = 4; - sourceTree = ""; - }; - 012AD91A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_optimize.h; - refType = 4; - sourceTree = ""; - }; - 012AD91B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_reach.c; - refType = 4; - sourceTree = ""; - }; - 012AD91C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_reach.h; - refType = 4; - sourceTree = ""; - }; - 012AD91D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_route.c; - refType = 4; - sourceTree = ""; - }; - 012AD91E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_route.h; - refType = 4; - sourceTree = ""; - }; - 012AD91F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_routealt.c; - refType = 4; - sourceTree = ""; - }; - 012AD92000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_routealt.h; - refType = 4; - sourceTree = ""; - }; - 012AD92100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_sample.c; - refType = 4; - sourceTree = ""; - }; - 012AD92200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_sample.h; - refType = 4; - sourceTree = ""; - }; - 012AD92300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_ai_char.c; - refType = 4; - sourceTree = ""; - }; - 012AD92400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_ai_chat.c; - refType = 4; - sourceTree = ""; - }; - 012AD92500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_ai_gen.c; - refType = 4; - sourceTree = ""; - }; - 012AD92600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_ai_goal.c; - refType = 4; - sourceTree = ""; - }; - 012AD92700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_ai_move.c; - refType = 4; - sourceTree = ""; - }; - 012AD92800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_ai_weap.c; - refType = 4; - sourceTree = ""; - }; - 012AD92900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_ai_weight.c; - refType = 4; - sourceTree = ""; - }; - 012AD92A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_ai_weight.h; - refType = 4; - sourceTree = ""; - }; - 012AD92B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_ea.c; - refType = 4; - sourceTree = ""; - }; - 012AD92C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_interface.c; - refType = 4; - sourceTree = ""; - }; - 012AD92D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_interface.h; - refType = 4; - sourceTree = ""; - }; - 012AD92E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_crc.c; - refType = 4; - sourceTree = ""; - }; - 012AD92F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_crc.h; - refType = 4; - sourceTree = ""; - }; - 012AD93000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_libvar.c; - refType = 4; - sourceTree = ""; - }; - 012AD93100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_libvar.h; - refType = 4; - sourceTree = ""; - }; - 012AD93200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_log.c; - refType = 4; - sourceTree = ""; - }; - 012AD93300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_log.h; - refType = 4; - sourceTree = ""; - }; - 012AD93400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_memory.c; - refType = 4; - sourceTree = ""; - }; - 012AD93500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_memory.h; - refType = 4; - sourceTree = ""; - }; - 012AD93600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_precomp.c; - refType = 4; - sourceTree = ""; - }; - 012AD93700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_precomp.h; - refType = 4; - sourceTree = ""; - }; - 012AD93800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_script.c; - refType = 4; - sourceTree = ""; - }; - 012AD93900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_script.h; - refType = 4; - sourceTree = ""; - }; - 012AD93A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_struct.c; - refType = 4; - sourceTree = ""; - }; - 012AD93B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_struct.h; - refType = 4; - sourceTree = ""; - }; - 012AD93C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_utils.h; - refType = 4; - sourceTree = ""; - }; - 012AD93D00868211C697A10E = { - children = ( - 012AD93E00868211C697A10E, - 012AD93F00868211C697A10E, - 012AD94000868211C697A10E, - 012AD94100868211C697A10E, - 012AD94200868211C697A10E, - 012AD94300868211C697A10E, - 012AD94400868211C697A10E, - 012AD94500868211C697A10E, - 012AD94600868211C697A10E, - 012AD94700868211C697A10E, - 012AD94800868211C697A10E, - 012AD94900868211C697A10E, - 012AD94A00868211C697A10E, - 012AD94B00868211C697A10E, - 012AD94C00868211C697A10E, - 012AD94D00868211C697A10E, - 012AD94E00868211C697A10E, - 012AD94F00868211C697A10E, - 012AD95000868211C697A10E, - 012AD95100868211C697A10E, - 012AD95200868211C697A10E, - 012AD95300868211C697A10E, - 012AD95400868211C697A10E, - 012AD95500868211C697A10E, - 012AD95600868211C697A10E, - 012AD95700868211C697A10E, - 012AD95800868211C697A10E, - 012AD95900868211C697A10E, - 012AD95A00868211C697A10E, - 012AD95B00868211C697A10E, - 012AD95C00868211C697A10E, - 012AD95D00868211C697A10E, - 012AD95E00868211C697A10E, - 012AD95F00868211C697A10E, - 012AD96000868211C697A10E, - 012AD96100868211C697A10E, - 012AD96200868211C697A10E, - 012AD96300868211C697A10E, - 012AD96400868211C697A10E, - 012AD96500868211C697A10E, - 012AD96600868211C697A10E, - 012AD96700868211C697A10E, - 012AD96800868211C697A10E, - 012AD96900868211C697A10E, - 012AD96A00868211C697A10E, - 012AD96B00868211C697A10E, - 012AD96C00868211C697A10E, - 012AD96D00868211C697A10E, - 012AD96E00868211C697A10E, - 012AD96F00868211C697A10E, - 012AD97000868211C697A10E, - 012AD97100868211C697A10E, - 012AD97200868211C697A10E, - 012AD97300868211C697A10E, - 012AD97400868211C697A10E, - 012AD97500868211C697A10E, - 012AD97600868211C697A10E, - 012AD97700868211C697A10E, - 012AD97800868211C697A10E, - 012AD97900868211C697A10E, - 012AD97A00868211C697A10E, - 012AD97B00868211C697A10E, - 012AD97C00868211C697A10E, - 012AD97D00868211C697A10E, - 012AD97E00868211C697A10E, - 012AD97F00868211C697A10E, - 012AD98000868211C697A10E, - 012AD98100868211C697A10E, - 012AD98200868211C697A10E, - 012AD98300868211C697A10E, - 012AD98400868211C697A10E, - 012AD98500868211C697A10E, - 012AD98600868211C697A10E, - 012AD98700868211C697A10E, - 012AD98800868211C697A10E, - 012AD98900868211C697A10E, - 012AD98A00868211C697A10E, - 012AD98B00868211C697A10E, - 012AD98C00868211C697A10E, - ); - isa = PBXGroup; - path = bspc; - refType = 4; - sourceTree = ""; - }; - 012AD93E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = _files.c; - refType = 4; - sourceTree = ""; - }; - 012AD93F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = aas_areamerging.c; - refType = 4; - sourceTree = ""; - }; - 012AD94000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aas_areamerging.h; - refType = 4; - sourceTree = ""; - }; - 012AD94100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = aas_cfg.c; - refType = 4; - sourceTree = ""; - }; - 012AD94200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aas_cfg.h; - refType = 4; - sourceTree = ""; - }; - 012AD94300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = aas_create.c; - refType = 4; - sourceTree = ""; - }; - 012AD94400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aas_create.h; - refType = 4; - sourceTree = ""; - }; - 012AD94500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = aas_edgemelting.c; - refType = 4; - sourceTree = ""; - }; - 012AD94600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aas_edgemelting.h; - refType = 4; - sourceTree = ""; - }; - 012AD94700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = aas_facemerging.c; - refType = 4; - sourceTree = ""; - }; - 012AD94800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aas_facemerging.h; - refType = 4; - sourceTree = ""; - }; - 012AD94900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = aas_file.c; - refType = 4; - sourceTree = ""; - }; - 012AD94A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aas_file.h; - refType = 4; - sourceTree = ""; - }; - 012AD94B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = aas_gsubdiv.c; - refType = 4; - sourceTree = ""; - }; - 012AD94C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aas_gsubdiv.h; - refType = 4; - sourceTree = ""; - }; - 012AD94D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = aas_map.c; - refType = 4; - sourceTree = ""; - }; - 012AD94E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aas_map.h; - refType = 4; - sourceTree = ""; - }; - 012AD94F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = aas_prunenodes.c; - refType = 4; - sourceTree = ""; - }; - 012AD95000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aas_prunenodes.h; - refType = 4; - sourceTree = ""; - }; - 012AD95100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = aas_store.c; - refType = 4; - sourceTree = ""; - }; - 012AD95200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aas_store.h; - refType = 4; - sourceTree = ""; - }; - 012AD95300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = aasfile.h; - refType = 4; - sourceTree = ""; - }; - 012AD95400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = be_aas_bspc.c; - refType = 4; - sourceTree = ""; - }; - 012AD95500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas_bspc.h; - refType = 4; - sourceTree = ""; - }; - 012AD95600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = brushbsp.c; - refType = 4; - sourceTree = ""; - }; - 012AD95700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = bspc.c; - refType = 4; - sourceTree = ""; - }; - 012AD95800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cfgq3.c; - refType = 4; - sourceTree = ""; - }; - 012AD95900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = csg.c; - refType = 4; - sourceTree = ""; - }; - 012AD95A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = faces.c; - refType = 4; - sourceTree = ""; - }; - 012AD95B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = gldraw.c; - refType = 4; - sourceTree = ""; - }; - 012AD95C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = glfile.c; - refType = 4; - sourceTree = ""; - }; - 012AD95D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_bsp_ent.c; - refType = 4; - sourceTree = ""; - }; - 012AD95E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_bsp_ent.h; - refType = 4; - sourceTree = ""; - }; - 012AD95F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_bsp_hl.c; - refType = 4; - sourceTree = ""; - }; - 012AD96000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_bsp_hl.h; - refType = 4; - sourceTree = ""; - }; - 012AD96100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_bsp_q1.c; - refType = 4; - sourceTree = ""; - }; - 012AD96200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_bsp_q1.h; - refType = 4; - sourceTree = ""; - }; - 012AD96300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_bsp_q2.c; - refType = 4; - sourceTree = ""; - }; - 012AD96400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_bsp_q2.h; - refType = 4; - sourceTree = ""; - }; - 012AD96500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_bsp_q3.c; - refType = 4; - sourceTree = ""; - }; - 012AD96600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_bsp_q3.h; - refType = 4; - sourceTree = ""; - }; - 012AD96700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_bsp_sin.c; - refType = 4; - sourceTree = ""; - }; - 012AD96800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_bsp_sin.h; - refType = 4; - sourceTree = ""; - }; - 012AD96900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_cmd.c; - refType = 4; - sourceTree = ""; - }; - 012AD96A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_cmd.h; - refType = 4; - sourceTree = ""; - }; - 012AD96B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_log.c; - refType = 4; - sourceTree = ""; - }; - 012AD96C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_log.h; - refType = 4; - sourceTree = ""; - }; - 012AD96D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_math.c; - refType = 4; - sourceTree = ""; - }; - 012AD96E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_math.h; - refType = 4; - sourceTree = ""; - }; - 012AD96F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_mem.c; - refType = 4; - sourceTree = ""; - }; - 012AD97000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_mem.h; - refType = 4; - sourceTree = ""; - }; - 012AD97100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_poly.c; - refType = 4; - sourceTree = ""; - }; - 012AD97200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_poly.h; - refType = 4; - sourceTree = ""; - }; - 012AD97300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_qfiles.c; - refType = 4; - sourceTree = ""; - }; - 012AD97400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_qfiles.h; - refType = 4; - sourceTree = ""; - }; - 012AD97500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_threads.c; - refType = 4; - sourceTree = ""; - }; - 012AD97600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_threads.h; - refType = 4; - sourceTree = ""; - }; - 012AD97700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = l_utils.c; - refType = 4; - sourceTree = ""; - }; - 012AD97800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = l_utils.h; - refType = 4; - sourceTree = ""; - }; - 012AD97900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = leakfile.c; - refType = 4; - sourceTree = ""; - }; - 012AD97A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = map.c; - refType = 4; - sourceTree = ""; - }; - 012AD97B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = map_hl.c; - refType = 4; - sourceTree = ""; - }; - 012AD97C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = map_q1.c; - refType = 4; - sourceTree = ""; - }; - 012AD97D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = map_q2.c; - refType = 4; - sourceTree = ""; - }; - 012AD97E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = map_q3.c; - refType = 4; - sourceTree = ""; - }; - 012AD97F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = map_sin.c; - refType = 4; - sourceTree = ""; - }; - 012AD98000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = nodraw.c; - refType = 4; - sourceTree = ""; - }; - 012AD98100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = portals.c; - refType = 4; - sourceTree = ""; - }; - 012AD98200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = prtfile.c; - refType = 4; - sourceTree = ""; - }; - 012AD98300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = q2files.h; - refType = 4; - sourceTree = ""; - }; - 012AD98400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = q3files.h; - refType = 4; - sourceTree = ""; - }; - 012AD98500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = qbsp.h; - refType = 4; - sourceTree = ""; - }; - 012AD98600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = qfiles.h; - refType = 4; - sourceTree = ""; - }; - 012AD98700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = sinfiles.h; - refType = 4; - sourceTree = ""; - }; - 012AD98800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tetrahedron.c; - refType = 4; - sourceTree = ""; - }; - 012AD98900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = tetrahedron.h; - refType = 4; - sourceTree = ""; - }; - 012AD98A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = textures.c; - refType = 4; - sourceTree = ""; - }; - 012AD98B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tree.c; - refType = 4; - sourceTree = ""; - }; - 012AD98C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = writebsp.c; - refType = 4; - sourceTree = ""; - }; - 012AD98D00868211C697A10E = { - children = ( - 012AD98E00868211C697A10E, - 012AD98F00868211C697A10E, - 012AD99000868211C697A10E, - 012AD99100868211C697A10E, - 012AD99200868211C697A10E, - 012AD99300868211C697A10E, - 012AD99400868211C697A10E, - 012AD99500868211C697A10E, - 012AD99600868211C697A10E, - 012AD99700868211C697A10E, - 012AD99800868211C697A10E, - 012AD99900868211C697A10E, - 012AD99A00868211C697A10E, - 012AD99B00868211C697A10E, - 012AD99C00868211C697A10E, - 012AD99D00868211C697A10E, - 012AD99E00868211C697A10E, - 012AD99F00868211C697A10E, - 012AD9A000868211C697A10E, - 012AD9A100868211C697A10E, - 012AD9A200868211C697A10E, - 012AD9A300868211C697A10E, - 012AD9A400868211C697A10E, - ); - isa = PBXGroup; - path = cgame; - refType = 4; - sourceTree = ""; - }; - 012AD98E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_consolecmds.c; - refType = 4; - sourceTree = ""; - }; - 012AD98F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_draw.c; - refType = 4; - sourceTree = ""; - }; - 012AD99000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_drawtools.c; - refType = 4; - sourceTree = ""; - }; - 012AD99100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_effects.c; - refType = 4; - sourceTree = ""; - }; - 012AD99200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_ents.c; - refType = 4; - sourceTree = ""; - }; - 012AD99300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_event.c; - refType = 4; - sourceTree = ""; - }; - 012AD99400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_info.c; - refType = 4; - sourceTree = ""; - }; - 012AD99500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = cg_local.h; - refType = 4; - sourceTree = ""; - }; - 012AD99600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_localents.c; - refType = 4; - sourceTree = ""; - }; - 012AD99700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_main.c; - refType = 4; - sourceTree = ""; - }; - 012AD99800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_marks.c; - refType = 4; - sourceTree = ""; - }; - 012AD99900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_newdraw.c; - refType = 4; - sourceTree = ""; - }; - 012AD99A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_players.c; - refType = 4; - sourceTree = ""; - }; - 012AD99B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_playerstate.c; - refType = 4; - sourceTree = ""; - }; - 012AD99C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_predict.c; - refType = 4; - sourceTree = ""; - }; - 012AD99D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = cg_public.h; - refType = 4; - sourceTree = ""; - }; - 012AD99E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_scoreboard.c; - refType = 4; - sourceTree = ""; - }; - 012AD99F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_servercmds.c; - refType = 4; - sourceTree = ""; - }; - 012AD9A000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_snapshot.c; - refType = 4; - sourceTree = ""; - }; - 012AD9A100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_syscalls.c; - refType = 4; - sourceTree = ""; - }; - 012AD9A200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_view.c; - refType = 4; - sourceTree = ""; - }; - 012AD9A300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cg_weapons.c; - refType = 4; - sourceTree = ""; - }; - 012AD9A400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = tr_types.h; - refType = 4; - sourceTree = ""; - }; - 012AD9A500868211C697A10E = { - children = ( - 012AD9A600868211C697A10E, - 012AD9A700868211C697A10E, - 012AD9A800868211C697A10E, - 012AD9A900868211C697A10E, - 012AD9AA00868211C697A10E, - 012AD9AB00868211C697A10E, - 012AD9AC00868211C697A10E, - 012AD9AD00868211C697A10E, - 012AD9AE00868211C697A10E, - 012AD9AF00868211C697A10E, - 012AD9B000868211C697A10E, - 012AD9B100868211C697A10E, - 012AD9B200868211C697A10E, - 012AD9B300868211C697A10E, - 012AD9B400868211C697A10E, - 012AD9B500868211C697A10E, - 012AD9B600868211C697A10E, - 012AD9B700868211C697A10E, - 012AD9B800868211C697A10E, - ); - isa = PBXGroup; - path = client; - refType = 4; - sourceTree = ""; - }; - 012AD9A600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cl_cgame.c; - refType = 4; - sourceTree = ""; - }; - 012AD9A700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cl_cin.c; - refType = 4; - sourceTree = ""; - }; - 012AD9A800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cl_console.c; - refType = 4; - sourceTree = ""; - }; - 012AD9A900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cl_input.c; - refType = 4; - sourceTree = ""; - }; - 012AD9AA00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cl_keys.c; - refType = 4; - sourceTree = ""; - }; - 012AD9AB00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cl_main.c; - refType = 4; - sourceTree = ""; - }; - 012AD9AC00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cl_net_chan.c; - refType = 4; - sourceTree = ""; - }; - 012AD9AD00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cl_parse.c; - refType = 4; - sourceTree = ""; - }; - 012AD9AE00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cl_scrn.c; - refType = 4; - sourceTree = ""; - }; - 012AD9AF00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cl_ui.c; - refType = 4; - sourceTree = ""; - }; - 012AD9B000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = client.h; - refType = 4; - sourceTree = ""; - }; - 012AD9B100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = keys.h; - refType = 4; - sourceTree = ""; - }; - 012AD9B200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = snd_adpcm.c; - refType = 4; - sourceTree = ""; - }; - 012AD9B300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = snd_dma.c; - refType = 4; - sourceTree = ""; - }; - 012AD9B400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = snd_local.h; - refType = 4; - sourceTree = ""; - }; - 012AD9B500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = snd_mem.c; - refType = 4; - sourceTree = ""; - }; - 012AD9B600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = snd_mix.c; - refType = 4; - sourceTree = ""; - }; - 012AD9B700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = snd_public.h; - refType = 4; - sourceTree = ""; - }; - 012AD9B800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = snd_wavelet.c; - refType = 4; - sourceTree = ""; - }; - 012ADA2400868211C697A10E = { - children = ( - 012ADA2500868211C697A10E, - 012ADA2600868211C697A10E, - 012ADA2700868211C697A10E, - 012ADA2800868211C697A10E, - 012ADA2900868211C697A10E, - 012ADA2A00868211C697A10E, - 012ADA2B00868211C697A10E, - 012ADA2C00868211C697A10E, - 012ADA2D00868211C697A10E, - 012ADA2E00868211C697A10E, - 012ADA2F00868211C697A10E, - 012ADA3000868211C697A10E, - 012ADA3100868211C697A10E, - 012ADA3200868211C697A10E, - 012ADA3300868211C697A10E, - 012ADA3400868211C697A10E, - 012ADA3500868211C697A10E, - 012ADA3600868211C697A10E, - 012ADA3700868211C697A10E, - 012ADA3800868211C697A10E, - 012ADA3900868211C697A10E, - 012ADA3A00868211C697A10E, - 012ADA3B00868211C697A10E, - 012ADA3C00868211C697A10E, - 012ADA3D00868211C697A10E, - 012ADA3E00868211C697A10E, - 012ADA3F00868211C697A10E, - 012ADA4000868211C697A10E, - 012ADA4100868211C697A10E, - 012ADA4200868211C697A10E, - 012ADA4300868211C697A10E, - 012ADA4400868211C697A10E, - 012ADA4500868211C697A10E, - 012ADA4600868211C697A10E, - 012ADA4700868211C697A10E, - 012ADA4800868211C697A10E, - 012ADA4900868211C697A10E, - 012ADA4A00868211C697A10E, - 012ADA4B00868211C697A10E, - 012ADA4C00868211C697A10E, - 012ADA4D00868211C697A10E, - 012ADA4E00868211C697A10E, - 012ADA4F00868211C697A10E, - 012ADA5000868211C697A10E, - 012ADA5100868211C697A10E, - 012ADA5200868211C697A10E, - 012ADA5300868211C697A10E, - 012ADA5400868211C697A10E, - 012ADA5500868211C697A10E, - 012ADA5600868211C697A10E, - 012ADA5700868211C697A10E, - 012ADA5800868211C697A10E, - 012ADA5900868211C697A10E, - 012ADA5A00868211C697A10E, - 012ADA5B00868211C697A10E, - 012ADA5C00868211C697A10E, - 012ADA5D00868211C697A10E, - 012ADA5E00868211C697A10E, - 012ADA5F00868211C697A10E, - 012ADA6000868211C697A10E, - 012ADA6100868211C697A10E, - 012ADA6200868211C697A10E, - 012ADA6300868211C697A10E, - 012ADA6400868211C697A10E, - ); - isa = PBXGroup; - path = game; - refType = 4; - sourceTree = ""; - }; - 012ADA2500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ai_chat.c; - refType = 4; - sourceTree = ""; - }; - 012ADA2600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ai_chat.h; - refType = 4; - sourceTree = ""; - }; - 012ADA2700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ai_cmd.c; - refType = 4; - sourceTree = ""; - }; - 012ADA2800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ai_cmd.h; - refType = 4; - sourceTree = ""; - }; - 012ADA2900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ai_dmnet.c; - refType = 4; - sourceTree = ""; - }; - 012ADA2A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ai_dmnet.h; - refType = 4; - sourceTree = ""; - }; - 012ADA2B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ai_dmq3.c; - refType = 4; - sourceTree = ""; - }; - 012ADA2C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ai_dmq3.h; - refType = 4; - sourceTree = ""; - }; - 012ADA2D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ai_main.c; - refType = 4; - sourceTree = ""; - }; - 012ADA2E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ai_main.h; - refType = 4; - sourceTree = ""; - }; - 012ADA2F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ai_team.c; - refType = 4; - sourceTree = ""; - }; - 012ADA3000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ai_team.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ai_vcmd.c; - refType = 4; - sourceTree = ""; - }; - 012ADA3200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ai_vcmd.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_aas.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_ai_char.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_ai_chat.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_ai_gen.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_ai_goal.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_ai_move.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_ai_weap.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = be_ea.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = bg_lib.c; - refType = 4; - sourceTree = ""; - }; - 012ADA3C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = bg_lib.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = bg_local.h; - refType = 4; - sourceTree = ""; - }; - 012ADA3E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = bg_misc.c; - refType = 4; - sourceTree = ""; - }; - 012ADA3F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = bg_pmove.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = bg_public.h; - refType = 4; - sourceTree = ""; - }; - 012ADA4100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = bg_slidemove.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = botlib.h; - refType = 4; - sourceTree = ""; - }; - 012ADA4300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = chars.h; - refType = 4; - sourceTree = ""; - }; - 012ADA4400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_active.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_arenas.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_bot.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_client.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_cmds.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_combat.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_items.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = g_local.h; - refType = 4; - sourceTree = ""; - }; - 012ADA4C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_main.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_mem.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_misc.c; - refType = 4; - sourceTree = ""; - }; - 012ADA4F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_missile.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_mover.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = g_public.h; - refType = 4; - sourceTree = ""; - }; - 012ADA5200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_rankings.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = g_rankings.h; - refType = 4; - sourceTree = ""; - }; - 012ADA5400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_session.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_spawn.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_svcmds.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_syscalls.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_target.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_team.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = g_team.h; - refType = 4; - sourceTree = ""; - }; - 012ADA5B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_trigger.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_utils.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = g_weapon.c; - refType = 4; - sourceTree = ""; - }; - 012ADA5E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = inv.h; - refType = 4; - sourceTree = ""; - }; - 012ADA5F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = match.h; - refType = 4; - sourceTree = ""; - }; - 012ADA6000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = q_math.c; - refType = 4; - sourceTree = ""; - }; - 012ADA6100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = q_shared.c; - refType = 4; - sourceTree = ""; - }; - 012ADA6200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = q_shared.h; - refType = 4; - sourceTree = ""; - }; - 012ADA6300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = surfaceflags.h; - refType = 4; - sourceTree = ""; - }; - 012ADA6400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = syn.h; - refType = 4; - sourceTree = ""; - }; - 012ADA6500868211C697A10E = { - children = ( - 012ADA6600868211C697A10E, - 012ADA6700868211C697A10E, - 012ADA6800868211C697A10E, - 012ADA6900868211C697A10E, - 012ADA6A00868211C697A10E, - 012ADA6B00868211C697A10E, - 012ADA6C00868211C697A10E, - 012ADA6D00868211C697A10E, - 012ADA6E00868211C697A10E, - 012ADA6F00868211C697A10E, - 012ADA7000868211C697A10E, - 012ADA7100868211C697A10E, - 012ADA7200868211C697A10E, - 012ADA7300868211C697A10E, - 012ADA7400868211C697A10E, - 012ADA7500868211C697A10E, - 012ADA7600868211C697A10E, - 012ADA7700868211C697A10E, - 012ADA7800868211C697A10E, - 012ADA7900868211C697A10E, - 012ADA7A00868211C697A10E, - 012ADA7B00868211C697A10E, - 012ADA7C00868211C697A10E, - 012ADA7D00868211C697A10E, - 012ADA7E00868211C697A10E, - 012ADA7F00868211C697A10E, - 012ADA8000868211C697A10E, - 012ADA8100868211C697A10E, - 012ADA8200868211C697A10E, - 012ADA8300868211C697A10E, - 012ADA8400868211C697A10E, - 012ADA8500868211C697A10E, - 012ADA8600868211C697A10E, - 012ADA8700868211C697A10E, - 012ADA8800868211C697A10E, - 012ADA8900868211C697A10E, - 012ADA8A00868211C697A10E, - 012ADA8B00868211C697A10E, - 012ADA8C00868211C697A10E, - 012ADA8D00868211C697A10E, - 012ADA8E00868211C697A10E, - 012ADA8F00868211C697A10E, - 012ADA9000868211C697A10E, - 012ADA9100868211C697A10E, - 012ADA9200868211C697A10E, - 012ADA9300868211C697A10E, - 012ADA9400868211C697A10E, - 012ADA9500868211C697A10E, - 012ADA9600868211C697A10E, - 012ADA9700868211C697A10E, - 012ADA9800868211C697A10E, - 012ADA9900868211C697A10E, - 012ADA9A00868211C697A10E, - 012ADA9B00868211C697A10E, - 012ADA9C00868211C697A10E, - 012ADA9D00868211C697A10E, - 012ADA9E00868211C697A10E, - 012ADA9F00868211C697A10E, - 012ADAA000868211C697A10E, - 012ADAA100868211C697A10E, - 012ADAA200868211C697A10E, - 012ADAA300868211C697A10E, - ); - isa = PBXGroup; - path = "jpeg-6"; - refType = 4; - sourceTree = ""; - }; - 012ADA6600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcapimin.c; - refType = 4; - sourceTree = ""; - }; - 012ADA6700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcapistd.c; - refType = 4; - sourceTree = ""; - }; - 012ADA6800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jccoefct.c; - refType = 4; - sourceTree = ""; - }; - 012ADA6900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jccolor.c; - refType = 4; - sourceTree = ""; - }; - 012ADA6A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcdctmgr.c; - refType = 4; - sourceTree = ""; - }; - 012ADA6B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jchuff.c; - refType = 4; - sourceTree = ""; - }; - 012ADA6C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jchuff.h; - refType = 4; - sourceTree = ""; - }; - 012ADA6D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcinit.c; - refType = 4; - sourceTree = ""; - }; - 012ADA6E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcmainct.c; - refType = 4; - sourceTree = ""; - }; - 012ADA6F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcmarker.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcmaster.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcomapi.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jconfig.h; - refType = 4; - sourceTree = ""; - }; - 012ADA7300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcparam.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcphuff.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcprepct.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jcsample.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jctrans.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdapimin.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdapistd.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdatadst.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdatasrc.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdcoefct.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdcolor.c; - refType = 4; - sourceTree = ""; - }; - 012ADA7E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jdct.h; - refType = 4; - sourceTree = ""; - }; - 012ADA7F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jddctmgr.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdhuff.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jdhuff.h; - refType = 4; - sourceTree = ""; - }; - 012ADA8200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdinput.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdmainct.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdmarker.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdmaster.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdmerge.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdphuff.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdpostct.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdsample.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jdtrans.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jerror.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jerror.h; - refType = 4; - sourceTree = ""; - }; - 012ADA8D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jfdctflt.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jfdctfst.c; - refType = 4; - sourceTree = ""; - }; - 012ADA8F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jfdctint.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jidctflt.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jidctfst.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jidctint.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jidctred.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jinclude.h; - refType = 4; - sourceTree = ""; - }; - 012ADA9500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jload.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jmemansi.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jmemdos.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jmemmgr.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jmemname.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jmemnobs.c; - refType = 4; - sourceTree = ""; - }; - 012ADA9B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jmemsys.h; - refType = 4; - sourceTree = ""; - }; - 012ADA9C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jmorecfg.h; - refType = 4; - sourceTree = ""; - }; - 012ADA9D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jpegint.h; - refType = 4; - sourceTree = ""; - }; - 012ADA9E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jpeglib.h; - refType = 4; - sourceTree = ""; - }; - 012ADA9F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jpegtran.c; - refType = 4; - sourceTree = ""; - }; - 012ADAA000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jquant1.c; - refType = 4; - sourceTree = ""; - }; - 012ADAA100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jquant2.c; - refType = 4; - sourceTree = ""; - }; - 012ADAA200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = jutils.c; - refType = 4; - sourceTree = ""; - }; - 012ADAA300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = jversion.h; - refType = 4; - sourceTree = ""; - }; - 012ADAA400868211C697A10E = { - children = ( - 012ADAA500868211C697A10E, - 012ADAA600868211C697A10E, - 012ADAA700868211C697A10E, - 012ADAA800868211C697A10E, - 012ADAA900868211C697A10E, - 012ADAAA00868211C697A10E, - 012ADAAB00868211C697A10E, - 012ADAAC00868211C697A10E, - 012ADAAD00868211C697A10E, - 012ADAAE00868211C697A10E, - 012ADAAF00868211C697A10E, - 012ADAB000868211C697A10E, - 012ADAB100868211C697A10E, - 012ADAB200868211C697A10E, - ); - isa = PBXGroup; - path = mac; - refType = 4; - sourceTree = ""; - }; - 012ADAA500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = mac_console.c; - refType = 4; - sourceTree = ""; - }; - 012ADAA600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = mac_event.c; - refType = 4; - sourceTree = ""; - }; - 012ADAA700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = mac_glimp2.c; - refType = 4; - sourceTree = ""; - }; - 012ADAA800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = mac_input.c; - refType = 4; - sourceTree = ""; - }; - 012ADAA900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = mac_local.h; - refType = 4; - sourceTree = ""; - }; - 012ADAAA00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = mac_main.c; - refType = 4; - sourceTree = ""; - }; - 012ADAAB00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = mac_net.c; - refType = 4; - sourceTree = ""; - }; - 012ADAAC00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = mac_snddma.c; - refType = 4; - sourceTree = ""; - }; - 012ADAAD00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = MacGamma.c; - refType = 4; - sourceTree = ""; - }; - 012ADAAE00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = MacGamma.h; - refType = 4; - sourceTree = ""; - }; - 012ADAAF00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = macprefix.h; - refType = 4; - sourceTree = ""; - }; - 012ADAB000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.rez; - path = q3.r; - refType = 4; - sourceTree = ""; - }; - 012ADAB100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = SetupGL.c; - refType = 4; - sourceTree = ""; - }; - 012ADAB200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = SetupGL.h; - refType = 4; - sourceTree = ""; - }; - 012ADAB300868211C697A10E = { - children = ( - 012ADAB400868211C697A10E, - 012ADAB500868211C697A10E, - 012ADAB600868211C697A10E, - 012ADAB700868211C697A10E, - 012ADAB800868211C697A10E, - 012ADAB900868211C697A10E, - 012ADABA00868211C697A10E, - ); - isa = PBXGroup; - path = null; - refType = 4; - sourceTree = ""; - }; - 012ADAB400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = mac_net.c; - refType = 4; - sourceTree = ""; - }; - 012ADAB500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = null_client.c; - refType = 4; - sourceTree = ""; - }; - 012ADAB600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = null_glimp.c; - refType = 4; - sourceTree = ""; - }; - 012ADAB700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = null_input.c; - refType = 4; - sourceTree = ""; - }; - 012ADAB800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = null_main.c; - refType = 4; - sourceTree = ""; - }; - 012ADAB900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = null_net.c; - refType = 4; - sourceTree = ""; - }; - 012ADABA00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = null_snddma.c; - refType = 4; - sourceTree = ""; - }; - 012ADABB00868211C697A10E = { - children = ( - 012ADABC00868211C697A10E, - 012ADABD00868211C697A10E, - 012ADABE00868211C697A10E, - 012ADABF00868211C697A10E, - 012ADAC000868211C697A10E, - 012ADAC100868211C697A10E, - 012ADAC200868211C697A10E, - 012ADAC300868211C697A10E, - 012ADAC400868211C697A10E, - 012ADAC500868211C697A10E, - 012ADAC600868211C697A10E, - 012ADAC700868211C697A10E, - 012ADAC800868211C697A10E, - 012ADAC900868211C697A10E, - 012ADACA00868211C697A10E, - 012ADACB00868211C697A10E, - 012ADACC00868211C697A10E, - 012ADACD00868211C697A10E, - 012ADACE00868211C697A10E, - 012ADACF00868211C697A10E, - 012ADAD000868211C697A10E, - 012ADAD100868211C697A10E, - 012ADAD200868211C697A10E, - 012ADAD300868211C697A10E, - 012ADAD400868211C697A10E, - 012ADAD500868211C697A10E, - 012ADAD600868211C697A10E, - 012ADAD700868211C697A10E, - 012ADAD800868211C697A10E, - 012ADAD900868211C697A10E, - 012ADADA00868211C697A10E, - 012ADADB00868211C697A10E, - 012ADADC00868211C697A10E, - 012ADADD00868211C697A10E, - 012ADADE00868211C697A10E, - 012ADADF00868211C697A10E, - 012ADAE000868211C697A10E, - 012ADAE100868211C697A10E, - 012ADAE200868211C697A10E, - 012ADAE300868211C697A10E, - 012ADAE400868211C697A10E, - 012ADAE500868211C697A10E, - 012ADAE600868211C697A10E, - 012ADAE700868211C697A10E, - 012ADAE800868211C697A10E, - 012ADAE900868211C697A10E, - 012ADAEA00868211C697A10E, - 012ADAEB00868211C697A10E, - ); - isa = PBXGroup; - path = q3_ui; - refType = 4; - sourceTree = ""; - }; - 012ADABC00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = keycodes.h; - refType = 4; - sourceTree = ""; - }; - 012ADABD00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_addbots.c; - refType = 4; - sourceTree = ""; - }; - 012ADABE00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_atoms.c; - refType = 4; - sourceTree = ""; - }; - 012ADABF00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_cdkey.c; - refType = 4; - sourceTree = ""; - }; - 012ADAC000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_cinematics.c; - refType = 4; - sourceTree = ""; - }; - 012ADAC100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_confirm.c; - refType = 4; - sourceTree = ""; - }; - 012ADAC200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_connect.c; - refType = 4; - sourceTree = ""; - }; - 012ADAC300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_controls2.c; - refType = 4; - sourceTree = ""; - }; - 012ADAC400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_credits.c; - refType = 4; - sourceTree = ""; - }; - 012ADAC500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_demo2.c; - refType = 4; - sourceTree = ""; - }; - 012ADAC600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_display.c; - refType = 4; - sourceTree = ""; - }; - 012ADAC700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_gameinfo.c; - refType = 4; - sourceTree = ""; - }; - 012ADAC800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_ingame.c; - refType = 4; - sourceTree = ""; - }; - 012ADAC900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_loadconfig.c; - refType = 4; - sourceTree = ""; - }; - 012ADACA00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ui_local.h; - refType = 4; - sourceTree = ""; - }; - 012ADACB00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_login.c; - refType = 4; - sourceTree = ""; - }; - 012ADACC00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_main.c; - refType = 4; - sourceTree = ""; - }; - 012ADACD00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_menu.c; - refType = 4; - sourceTree = ""; - }; - 012ADACE00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_mfield.c; - refType = 4; - sourceTree = ""; - }; - 012ADACF00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_mods.c; - refType = 4; - sourceTree = ""; - }; - 012ADAD000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_network.c; - refType = 4; - sourceTree = ""; - }; - 012ADAD100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_options.c; - refType = 4; - sourceTree = ""; - }; - 012ADAD200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_playermodel.c; - refType = 4; - sourceTree = ""; - }; - 012ADAD300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_players.c; - refType = 4; - sourceTree = ""; - }; - 012ADAD400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_playersettings.c; - refType = 4; - sourceTree = ""; - }; - 012ADAD500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_preferences.c; - refType = 4; - sourceTree = ""; - }; - 012ADAD600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_qmenu.c; - refType = 4; - sourceTree = ""; - }; - 012ADAD700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_rankings.c; - refType = 4; - sourceTree = ""; - }; - 012ADAD800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_rankstatus.c; - refType = 4; - sourceTree = ""; - }; - 012ADAD900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_removebots.c; - refType = 4; - sourceTree = ""; - }; - 012ADADA00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_saveconfig.c; - refType = 4; - sourceTree = ""; - }; - 012ADADB00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_serverinfo.c; - refType = 4; - sourceTree = ""; - }; - 012ADADC00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_servers2.c; - refType = 4; - sourceTree = ""; - }; - 012ADADD00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_setup.c; - refType = 4; - sourceTree = ""; - }; - 012ADADE00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_signup.c; - refType = 4; - sourceTree = ""; - }; - 012ADADF00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_sound.c; - refType = 4; - sourceTree = ""; - }; - 012ADAE000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_sparena.c; - refType = 4; - sourceTree = ""; - }; - 012ADAE100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_specifyleague.c; - refType = 4; - sourceTree = ""; - }; - 012ADAE200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_specifyserver.c; - refType = 4; - sourceTree = ""; - }; - 012ADAE300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_splevel.c; - refType = 4; - sourceTree = ""; - }; - 012ADAE400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_sppostgame.c; - refType = 4; - sourceTree = ""; - }; - 012ADAE500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_spreset.c; - refType = 4; - sourceTree = ""; - }; - 012ADAE600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_spskill.c; - refType = 4; - sourceTree = ""; - }; - 012ADAE700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_startserver.c; - refType = 4; - sourceTree = ""; - }; - 012ADAE800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = file; - path = ui_syscalls.c; - refType = 4; - sourceTree = ""; - }; - 012ADAE900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_team.c; - refType = 4; - sourceTree = ""; - }; - 012ADAEA00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_teamorders.c; - refType = 4; - sourceTree = ""; - }; - 012ADAEB00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_video.c; - refType = 4; - sourceTree = ""; - }; - 012ADAEC00868211C697A10E = { - children = ( - 012ADAED00868211C697A10E, - 012ADAEE00868211C697A10E, - 012ADAEF00868211C697A10E, - 012ADAF000868211C697A10E, - 012ADAF100868211C697A10E, - 012ADAF200868211C697A10E, - 012ADAF300868211C697A10E, - 012ADAF400868211C697A10E, - 012ADAF500868211C697A10E, - 012ADAF600868211C697A10E, - 012ADAF700868211C697A10E, - 012ADAF800868211C697A10E, - 012ADAF900868211C697A10E, - 016F1B6300ACDA9BC697A10E, - 012ADAFA00868211C697A10E, - 012ADAFB00868211C697A10E, - 012ADAFC00868211C697A10E, - 012ADAFD00868211C697A10E, - 012ADAFE00868211C697A10E, - 012ADAFF00868211C697A10E, - 012ADB0000868211C697A10E, - 012ADB0100868211C697A10E, - 012ADB0200868211C697A10E, - 012ADB0300868211C697A10E, - 012ADB0400868211C697A10E, - 012ADB0500868211C697A10E, - 4FB23863047AB9F60098ACF3, - ); - isa = PBXGroup; - path = qcommon; - refType = 4; - sourceTree = ""; - }; - 012ADAED00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cm_load.c; - refType = 4; - sourceTree = ""; - }; - 012ADAEE00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = cm_local.h; - refType = 4; - sourceTree = ""; - }; - 012ADAEF00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cm_patch.c; - refType = 4; - sourceTree = ""; - }; - 012ADAF000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = cm_patch.h; - refType = 4; - sourceTree = ""; - }; - 012ADAF100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cm_polylib.c; - refType = 4; - sourceTree = ""; - }; - 012ADAF200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = cm_polylib.h; - refType = 4; - sourceTree = ""; - }; - 012ADAF300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = cm_public.h; - refType = 4; - sourceTree = ""; - }; - 012ADAF400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cm_test.c; - refType = 4; - sourceTree = ""; - }; - 012ADAF500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cm_trace.c; - refType = 4; - sourceTree = ""; - }; - 012ADAF600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cmd.c; - refType = 4; - sourceTree = ""; - }; - 012ADAF700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = common.c; - refType = 4; - sourceTree = ""; - }; - 012ADAF800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = cvar.c; - refType = 4; - sourceTree = ""; - }; - 012ADAF900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = files.c; - refType = 4; - sourceTree = ""; - }; - 012ADAFA00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = md4.c; - refType = 4; - sourceTree = ""; - }; - 012ADAFB00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = msg.c; - refType = 4; - sourceTree = ""; - }; - 012ADAFC00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = net_chan.c; - refType = 4; - sourceTree = ""; - }; - 012ADAFD00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = qcommon.h; - refType = 4; - sourceTree = ""; - }; - 012ADAFE00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = qfiles.h; - refType = 4; - sourceTree = ""; - }; - 012ADAFF00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = unzip.c; - refType = 4; - sourceTree = ""; - }; - 012ADB0000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = unzip.h; - refType = 4; - sourceTree = ""; - }; - 012ADB0100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = vm.c; - refType = 4; - sourceTree = ""; - }; - 012ADB0200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = vm_interpreted.c; - refType = 4; - sourceTree = ""; - }; - 012ADB0300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = vm_local.h; - refType = 4; - sourceTree = ""; - }; - 012ADB0400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = vm_ppc.c; - refType = 4; - sourceTree = ""; - }; - 012ADB0500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = vm_x86.c; - refType = 4; - sourceTree = ""; - }; - 012ADB0600868211C697A10E = { - children = ( - 012ADB0700868211C697A10E, - 012ADB0800868211C697A10E, - 012ADB0900868211C697A10E, - 012ADB0A00868211C697A10E, - 012ADB0B00868211C697A10E, - 012ADB0C00868211C697A10E, - 012ADB0D00868211C697A10E, - 012ADB0E00868211C697A10E, - 012ADB0F00868211C697A10E, - 012ADB1000868211C697A10E, - 012ADB1100868211C697A10E, - 012ADB1200868211C697A10E, - 012ADB1300868211C697A10E, - 012ADB1400868211C697A10E, - 012ADB1500868211C697A10E, - 012ADB1600868211C697A10E, - 012ADB1700868211C697A10E, - 012ADB1800868211C697A10E, - 012ADB1900868211C697A10E, - 012ADB1A00868211C697A10E, - 012ADB1B00868211C697A10E, - 012ADB1C00868211C697A10E, - 012ADB1D00868211C697A10E, - 012ADB1E00868211C697A10E, - 012ADB1F00868211C697A10E, - 012ADB2000868211C697A10E, - 012ADB2100868211C697A10E, - 012ADB2200868211C697A10E, - ); - isa = PBXGroup; - path = renderer; - refType = 4; - sourceTree = ""; - }; - 012ADB0700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = amd3d.h; - refType = 4; - sourceTree = ""; - }; - 012ADB0800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = qgl.h; - refType = 4; - sourceTree = ""; - }; - 012ADB0900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = qgl_linked.h; - refType = 4; - sourceTree = ""; - }; - 012ADB0A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_animation.c; - refType = 4; - sourceTree = ""; - }; - 012ADB0B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_backend.c; - refType = 4; - sourceTree = ""; - }; - 012ADB0C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - lineEnding = 0; - path = tr_bsp.c; - refType = 4; - sourceTree = ""; - }; - 012ADB0D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_cmds.c; - refType = 4; - sourceTree = ""; - }; - 012ADB0E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_curve.c; - refType = 4; - sourceTree = ""; - }; - 012ADB0F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_flares.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_font.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_image.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_init.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_light.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = tr_local.h; - refType = 4; - sourceTree = ""; - }; - 012ADB1500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_main.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_marks.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_mesh.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_model.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_noise.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = tr_public.h; - refType = 4; - sourceTree = ""; - }; - 012ADB1B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_scene.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_shade.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_shade_calc.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_shader.c; - refType = 4; - sourceTree = ""; - }; - 012ADB1F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_shadows.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_sky.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_surface.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = tr_world.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2300868211C697A10E = { - children = ( - 012ADB2400868211C697A10E, - 012ADB2500868211C697A10E, - 012ADB2600868211C697A10E, - 012ADB2700868211C697A10E, - 012ADB2800868211C697A10E, - 012ADB2900868211C697A10E, - 012ADB2A00868211C697A10E, - 012ADB2B00868211C697A10E, - 012ADB2C00868211C697A10E, - 012ADB2D00868211C697A10E, - 012ADB2E00868211C697A10E, - ); - isa = PBXGroup; - path = server; - refType = 4; - sourceTree = ""; - }; - 012ADB2400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = server.h; - refType = 4; - sourceTree = ""; - }; - 012ADB2500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = sv_bot.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = sv_ccmds.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = sv_client.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = sv_game.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = sv_init.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = sv_main.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = sv_net_chan.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2C00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = sv_rankings.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = sv_snapshot.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = sv_world.c; - refType = 4; - sourceTree = ""; - }; - 012ADB2F00868211C697A10E = { - children = ( - 012ADB3000868211C697A10E, - 012ADB3100868211C697A10E, - 012ADB3200868211C697A10E, - 012ADB3300868211C697A10E, - 012ADB3400868211C697A10E, - 012ADB3500868211C697A10E, - 012ADB3600868211C697A10E, - 012ADB3700868211C697A10E, - 012ADB3800868211C697A10E, - 012ADB3900868211C697A10E, - 012ADB3A00868211C697A10E, - 012ADB3B00868211C697A10E, - 012ADB3D00868211C697A10E, - 012ADB3E00868211C697A10E, - 012ADB3F00868211C697A10E, - F5ED1435037096A001F6289A, - ); - isa = PBXGroup; - path = splines; - refType = 4; - sourceTree = ""; - }; - 012ADB3000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - path = math_angles.cpp; - refType = 4; - sourceTree = ""; - }; - 012ADB3100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = math_angles.h; - refType = 4; - sourceTree = ""; - }; - 012ADB3200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - path = math_matrix.cpp; - refType = 4; - sourceTree = ""; - }; - 012ADB3300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = math_matrix.h; - refType = 4; - sourceTree = ""; - }; - 012ADB3400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - path = math_quaternion.cpp; - refType = 4; - sourceTree = ""; - }; - 012ADB3500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = math_quaternion.h; - refType = 4; - sourceTree = ""; - }; - 012ADB3600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - path = math_vector.cpp; - refType = 4; - sourceTree = ""; - }; - 012ADB3700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = math_vector.h; - refType = 4; - sourceTree = ""; - }; - 012ADB3800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - path = q_parse.cpp; - refType = 4; - sourceTree = ""; - }; - 012ADB3900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - path = q_shared.cpp; - refType = 4; - sourceTree = ""; - }; - 012ADB3A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.h; - path = q_shared.hpp; - refType = 4; - sourceTree = ""; - }; - 012ADB3B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - path = splines.cpp; - refType = 4; - sourceTree = ""; - }; - 012ADB3D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = util_list.h; - refType = 4; - sourceTree = ""; - }; - 012ADB3E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.cpp.cpp; - path = util_str.cpp; - refType = 4; - sourceTree = ""; - }; - 012ADB3F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = util_str.h; - refType = 4; - sourceTree = ""; - }; - 012ADB4000868211C697A10E = { - children = ( - 012ADB4100868211C697A10E, - 012ADB4200868211C697A10E, - 012ADB4300868211C697A10E, - 012ADB4400868211C697A10E, - 012ADB4500868211C697A10E, - 012ADB4600868211C697A10E, - 012ADB4700868211C697A10E, - 012ADB4800868211C697A10E, - 012ADB4900868211C697A10E, - 012ADB4A00868211C697A10E, - 012ADB4B00868211C697A10E, - ); - isa = PBXGroup; - path = ui; - refType = 4; - sourceTree = ""; - }; - 012ADB4100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = keycodes.h; - refType = 4; - sourceTree = ""; - }; - 012ADB4200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_atoms.c; - refType = 4; - sourceTree = ""; - }; - 012ADB4300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_gameinfo.c; - refType = 4; - sourceTree = ""; - }; - 012ADB4400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ui_local.h; - refType = 4; - sourceTree = ""; - }; - 012ADB4500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_main.c; - refType = 4; - sourceTree = ""; - }; - 012ADB4600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_players.c; - refType = 4; - sourceTree = ""; - }; - 012ADB4700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ui_public.h; - refType = 4; - sourceTree = ""; - }; - 012ADB4800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_shared.c; - refType = 4; - sourceTree = ""; - }; - 012ADB4900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = ui_shared.h; - refType = 4; - sourceTree = ""; - }; - 012ADB4A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_syscalls.c; - refType = 4; - sourceTree = ""; - }; - 012ADB4B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = ui_util.c; - refType = 4; - sourceTree = ""; - }; - 012ADB4C00868211C697A10E = { - children = ( - 012ADB4D00868211C697A10E, - 012ADB4E00868211C697A10E, - 012ADB4F00868211C697A10E, - 012ADB5000868211C697A10E, - 012ADB5100868211C697A10E, - 012ADB5200868211C697A10E, - 012ADB5300868211C697A10E, - 012ADB5400868211C697A10E, - 012ADB5500868211C697A10E, - 012ADB5600868211C697A10E, - 012ADB5700868211C697A10E, - 012ADB5800868211C697A10E, - 012ADB5900868211C697A10E, - ); - isa = PBXGroup; - path = unix; - refType = 4; - sourceTree = ""; - }; - 012ADB4D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = linux_common.c; - refType = 4; - sourceTree = ""; - }; - 012ADB4E00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = linux_glimp.c; - refType = 4; - sourceTree = ""; - }; - 012ADB4F00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = linux_joystick.c; - refType = 4; - sourceTree = ""; - }; - 012ADB5000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = linux_local.h; - refType = 4; - sourceTree = ""; - }; - 012ADB5100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = linux_qgl.c; - refType = 4; - sourceTree = ""; - }; - 012ADB5200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = linux_snd.c; - refType = 4; - sourceTree = ""; - }; - 012ADB5300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = qasm.h; - refType = 4; - sourceTree = ""; - }; - 012ADB5400868211C697A10E = { - isa = PBXFileReference; - lastKnownFileType = image.gif; - path = quake3.gif; - refType = 4; - sourceTree = ""; - }; - 012ADB5500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = unix_glw.h; - refType = 4; - sourceTree = ""; - }; - 012ADB5600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = unix_main.c; - refType = 4; - sourceTree = ""; - }; - 012ADB5700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = unix_net.c; - refType = 4; - sourceTree = ""; - }; - 012ADB5800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = unix_shared.c; - refType = 4; - sourceTree = ""; - }; - 012ADB5900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = vm_x86.c; - refType = 4; - sourceTree = ""; - }; - 012ADB5A00868211C697A10E = { - children = ( - 012ADB5B00868211C697A10E, - 012ADB5C00868211C697A10E, - 012ADB5D00868211C697A10E, - 012ADB5E00868211C697A10E, - 012ADB5F00868211C697A10E, - 012ADB6000868211C697A10E, - 012ADB6100868211C697A10E, - 012ADB6200868211C697A10E, - 012ADB6300868211C697A10E, - 012ADB6400868211C697A10E, - 012ADB6500868211C697A10E, - 012ADB6600868211C697A10E, - 012ADB6700868211C697A10E, - 012ADB6800868211C697A10E, - 012ADB6900868211C697A10E, - 012ADB6A00868211C697A10E, - 012ADB6B00868211C697A10E, - ); - isa = PBXGroup; - path = win32; - refType = 4; - sourceTree = ""; - }; - 012ADB5B00868211C697A10E = { - isa = PBXFileReference; - lastKnownFileType = image.bmp; - path = background.bmp; - refType = 4; - sourceTree = ""; - }; - 012ADB5C00868211C697A10E = { - isa = PBXFileReference; - lastKnownFileType = image.bmp; - path = clear.bmp; - refType = 4; - sourceTree = ""; - }; - 012ADB5D00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = glw_win.h; - refType = 4; - sourceTree = ""; - }; - 012ADB5E00868211C697A10E = { - isa = PBXFileReference; - lastKnownFileType = image.ico; - path = icon2.ico; - refType = 4; - sourceTree = ""; - }; - 012ADB5F00868211C697A10E = { - isa = PBXFileReference; - lastKnownFileType = image.ico; - path = qe3.ico; - refType = 4; - sourceTree = ""; - }; - 012ADB6000868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = resource.h; - refType = 4; - sourceTree = ""; - }; - 012ADB6100868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = win_gamma.c; - refType = 4; - sourceTree = ""; - }; - 012ADB6200868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = win_glimp.c; - refType = 4; - sourceTree = ""; - }; - 012ADB6300868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = win_input.c; - refType = 4; - sourceTree = ""; - }; - 012ADB6400868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = win_local.h; - refType = 4; - sourceTree = ""; - }; - 012ADB6500868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = win_main.c; - refType = 4; - sourceTree = ""; - }; - 012ADB6600868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = win_net.c; - refType = 4; - sourceTree = ""; - }; - 012ADB6700868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = win_qgl.c; - refType = 4; - sourceTree = ""; - }; - 012ADB6800868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = win_shared.c; - refType = 4; - sourceTree = ""; - }; - 012ADB6900868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = win_snd.c; - refType = 4; - sourceTree = ""; - }; - 012ADB6A00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = win_syscon.c; - refType = 4; - sourceTree = ""; - }; - 012ADB6B00868211C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = win_wndproc.c; - refType = 4; - sourceTree = ""; - }; - 015ECC0C00894EC0C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = macosx_display.h; - refType = 4; - sourceTree = ""; - }; - 015ECC0D00894EC0C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = macosx_display.m; - refType = 4; - sourceTree = ""; - }; - 015ECC0E00894EC0C697A10E = { - fileRef = 015ECC0C00894EC0C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 015ECC0F00894EC0C697A10E = { - fileRef = 015ECC0D00894EC0C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016B4A3B00ACCF9FC697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = macosx_glsmp_mutex.m; - refType = 4; - sourceTree = ""; - }; - 016B4A3C00ACCF9FC697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = macosx_glsmp_null.m; - refType = 4; - sourceTree = ""; - }; - 016B4A3D00ACCF9FC697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = macosx_glsmp_ports.m; - refType = 4; - sourceTree = ""; - }; - 016B4A3E00ACCF9FC697A10E = { - fileRef = 016B4A3B00ACCF9FC697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE0200B4BDD1C697A10E = { - explicitFileType = wrapper.cfbundle; - isa = PBXFileReference; - path = ui.bundle; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 016EAE0300B4BDD1C697A10E = { - buildPhases = ( - 016EAE0400B4BDD1C697A10E, - 016EAE0900B4BDD1C697A10E, - 016EAE0A00B4BDD1C697A10E, - 016EAE1200B4BDD1C697A10E, - 016EAE1300B4BDD1C697A10E, - ); - buildSettings = { - INSTALL_PATH = "/Users/Shared/$(USER)/InstalledProducts"; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = "-bundle -undefined error"; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = ui; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = bundle; - }; - dependencies = ( - ); - isa = PBXBundleTarget; - name = ui; - productInstallPath = "/Users/Shared/$(USER)/InstalledProducts"; - productName = ui; - productReference = 016EAE0200B4BDD1C697A10E; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - BNDL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - - -"; - }; - 016EAE0400B4BDD1C697A10E = { - buildActionMask = 2147483647; - files = ( - 016EAE0500B4BDD1C697A10E, - 016EAE0600B4BDD1C697A10E, - 016EAE0700B4BDD1C697A10E, - 016EAE0800B4BDD1C697A10E, - 016EAE1400B4BE42C697A10E, - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 016EAE0500B4BDD1C697A10E = { - fileRef = 012ADB4900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE0600B4BDD1C697A10E = { - fileRef = 012ADB4700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE0700B4BDD1C697A10E = { - fileRef = 012ADB4400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE0800B4BDD1C697A10E = { - fileRef = 012ADB4100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE0900B4BDD1C697A10E = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 016EAE0A00B4BDD1C697A10E = { - buildActionMask = 2147483647; - files = ( - 016EAE0B00B4BDD1C697A10E, - 016EAE0C00B4BDD1C697A10E, - 016EAE0D00B4BDD1C697A10E, - 016EAE0E00B4BDD1C697A10E, - 016EAE0F00B4BDD1C697A10E, - 016EAE1000B4BDD1C697A10E, - 016EAE1100B4BDD1C697A10E, - 016EAE1500B4BE42C697A10E, - 016EAE1600B4BE42C697A10E, - 016EAE1700B4BE53C697A10E, - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 016EAE0B00B4BDD1C697A10E = { - fileRef = 012ADB4B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE0C00B4BDD1C697A10E = { - fileRef = 012ADB4A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE0D00B4BDD1C697A10E = { - fileRef = 012ADB4800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE0E00B4BDD1C697A10E = { - fileRef = 012ADB4600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE0F00B4BDD1C697A10E = { - fileRef = 012ADB4500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE1000B4BDD1C697A10E = { - fileRef = 012ADB4300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE1100B4BDD1C697A10E = { - fileRef = 012ADB4200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE1200B4BDD1C697A10E = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 016EAE1300B4BDD1C697A10E = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 016EAE1400B4BE42C697A10E = { - fileRef = 012ADA6200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE1500B4BE42C697A10E = { - fileRef = 012ADA6000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE1600B4BE42C697A10E = { - fileRef = 012ADA6100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016EAE1700B4BE53C697A10E = { - fileRef = 012ADA3E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 016F1B6300ACDA9BC697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = huffman.c; - refType = 4; - sourceTree = ""; - }; - 016F1B6400ACDA9BC697A10E = { - fileRef = 016F1B6300ACDA9BC697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170304A00B4885DC697A10E = { - explicitFileType = "compiled.mach-o.executable"; - isa = PBXFileReference; - path = Q3DedicatedServer; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 0170304B00B4885DC697A10E = { - buildPhases = ( - 0170304C00B4885DC697A10E, - 0170304D00B4885DC697A10E, - 0170304E00B4885DC697A10E, - 0170304F00B4885DC697A10E, - ); - buildSettings = { - DEBUGGING_SYMBOLS = NO; - GCC_VERSION = 3.3; - INSTALL_PATH = ""; - LIBRARY_SEARCH_PATHS = "\"/Users/zaphod/Quake3/code/macosx/GameRanger SDK/Libraries\""; - OPTIMIZATION_CFLAGS = "-O2"; - OTHER_CFLAGS = "-DDEDICATED -DMACOS_X -DBOTLIB -DMISSIONPACK -force_cpusubtype_ALL -Wno-long-double"; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = Q3DedicatedServer; - REZ_EXECUTABLE = YES; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - }; - dependencies = ( - ); - isa = PBXToolTarget; - name = "Dedicated Server"; - productInstallPath = ""; - productName = "Dedicated Server"; - productReference = 0170304A00B4885DC697A10E; - }; - 0170304C00B4885DC697A10E = { - buildActionMask = 2147483647; - files = ( - 0170305200B488AEC697A10E, - 0170305300B488AEC697A10E, - 0170305400B488AEC697A10E, - 0170305500B488AEC697A10E, - 0170305600B488AEC697A10E, - 0170305700B488AEC697A10E, - 0170305800B488AEC697A10E, - 0170305900B488AEC697A10E, - 0170306B00B489B5C697A10E, - 0170307600B48B5CC697A10E, - 0170307700B48B5CC697A10E, - 0170307800B48B5CC697A10E, - 0170307900B48B5CC697A10E, - 0170307A00B48B5CC697A10E, - 0170307B00B48B5CC697A10E, - 0170307C00B48B5CC697A10E, - 0170307D00B48B5CC697A10E, - 0170307E00B48B5CC697A10E, - 0170307F00B48B5CC697A10E, - 0170308400B48B5CC697A10E, - 0170308500B48B5CC697A10E, - 0170308600B48B5CC697A10E, - 0170308700B48B5CC697A10E, - 0170308800B48B5CC697A10E, - 0170308900B48B5CC697A10E, - 0170308A00B48B5CC697A10E, - 0170308B00B48B5CC697A10E, - 0170308C00B48B5CC697A10E, - 0170308D00B48B5CC697A10E, - 0170308E00B48B5CC697A10E, - 0170308F00B48B5CC697A10E, - 0170309000B48B5CC697A10E, - 0170309100B48B5CC697A10E, - 0170309200B48B5CC697A10E, - 0170309300B48B5CC697A10E, - 0170309400B48B5CC697A10E, - 0170309500B48B5CC697A10E, - 0170309600B48B5CC697A10E, - 0170309700B48B5CC697A10E, - 0170309800B48B5CC697A10E, - 0170309900B48B5CC697A10E, - 0170309A00B48B5CC697A10E, - 0170309B00B48B5CC697A10E, - 0170309C00B48B5CC697A10E, - 0170309E00B48B5CC697A10E, - 0170309F00B48B5CC697A10E, - 017030A000B48B5CC697A10E, - 017030A100B48B5CC697A10E, - 017030A200B48B5CC697A10E, - 017030A300B48B5CC697A10E, - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0170304D00B4885DC697A10E = { - buildActionMask = 2147483647; - files = ( - 0170305B00B488AEC697A10E, - 0170305C00B488AEC697A10E, - 0170305D00B488AEC697A10E, - 0170305E00B488AEC697A10E, - 0170305F00B488AEC697A10E, - 0170306000B488AEC697A10E, - 0170306100B488AEC697A10E, - 0170306200B488AEC697A10E, - 0170306300B488AEC697A10E, - 0170306400B488AEC697A10E, - 0170306500B488AEC697A10E, - 0170306600B488AEC697A10E, - 0170306700B488AEC697A10E, - 0170306800B488AEC697A10E, - 0170306900B488AEC697A10E, - 0170306A00B488AEC697A10E, - 0170306C00B489B5C697A10E, - 0170306D00B489B5C697A10E, - 0170306E00B489B5C697A10E, - 0170306F00B489B5C697A10E, - 0170307000B489B5C697A10E, - 0170307100B489B5C697A10E, - 0170307200B489B5C697A10E, - 0170307400B489B5C697A10E, - 0170307500B489B5C697A10E, - 017030A400B48B5CC697A10E, - 017030A500B48B5CC697A10E, - 017030A600B48B5CC697A10E, - 017030A700B48B5CC697A10E, - 017030A800B48B5CC697A10E, - 017030A900B48B5CC697A10E, - 017030AA00B48B5CC697A10E, - 017030AB00B48B5CC697A10E, - 017030AC00B48B5CC697A10E, - 017030AD00B48B5CC697A10E, - 017030AE00B48B5CC697A10E, - 017030AF00B48B5CC697A10E, - 017030B000B48B5CC697A10E, - 017030B100B48B5CC697A10E, - 017030B200B48B5CC697A10E, - 017030B300B48B5CC697A10E, - 017030B400B48B5CC697A10E, - 017030B500B48B5CC697A10E, - 017030B600B48B5CC697A10E, - 017030B700B48B5CC697A10E, - 017030B800B48B5CC697A10E, - 017030B900B48B5CC697A10E, - 017030BA00B48B5CC697A10E, - 017030BB00B48B5CC697A10E, - 017030BC00B48B5CC697A10E, - 017030BD00B48B5CC697A10E, - 017030BE00B48B5CC697A10E, - 017030BF00B48B5CC697A10E, - 017030C000B48B5CC697A10E, - 017030C100B48B5CC697A10E, - 017030C200B48B5CC697A10E, - 017030C300B48B5CC697A10E, - 017030C400B48B5CC697A10E, - 017030C500B48B5CC697A10E, - 017030C600B48B5CC697A10E, - 017030C700B48B5CC697A10E, - 017030C800B48B5CC697A10E, - 017030C900B48B5CC697A10E, - 017030CA00B48B5CC697A10E, - 017030CB00B48B5CC697A10E, - 017030CC00B48B5CC697A10E, - 017030CD00B48B5CC697A10E, - 017030CE00B48B5CC697A10E, - 017030CF00B48B5CC697A10E, - 017030D000B48B5CC697A10E, - 017030D100B48B5CC697A10E, - 017030D200B48B5CC697A10E, - 017030D300B48B5CC697A10E, - 017030D400B48B5CC697A10E, - 017030D500B48B5CC697A10E, - 017030D600B48B5CC697A10E, - 017030D700B48B5CC697A10E, - 017030D800B48B5CC697A10E, - 017030D900B48B5CC697A10E, - 017030DA00B48B5CC697A10E, - 017030DB00B48B5CC697A10E, - 017030DC00B48B5CC697A10E, - 017030DD00B48B5CC697A10E, - 017030DE00B48B5CC697A10E, - 017030DF00B48B5CC697A10E, - 017030E000B48B5CC697A10E, - 017030E100B48B5CC697A10E, - 017030E200B48B5CC697A10E, - 017030F200B48B5CC697A10E, - 017030F300B48B5CC697A10E, - 017030F400B48B5CC697A10E, - 017030F500B48B5CC697A10E, - 017030F600B48B5CC697A10E, - 017030F700B48B5CC697A10E, - 017030F800B48B5CC697A10E, - 017030F900B48B5CC697A10E, - 017030FA00B48B5CC697A10E, - 017030FB00B48B5CC697A10E, - 017030FC00B48B5CC697A10E, - 017030FD00B48B5CC697A10E, - 017030FE00B48B5CC697A10E, - 017030FF00B48B5CC697A10E, - 0170310000B48B5CC697A10E, - 0170310100B48B5CC697A10E, - 0170310200B48B5CC697A10E, - 0170310300B48B5CC697A10E, - 0170310400B48B5CC697A10E, - 0170310500B48B5CC697A10E, - 0170310600B48B5CC697A10E, - 0170310700B48B5CC697A10E, - 0170310800B48B5CC697A10E, - 0170310900B48B5CC697A10E, - 0170310A00B48B5CC697A10E, - 0170310B00B48B5CC697A10E, - 0170310C00B48B5CC697A10E, - 0170310D00B48B5CC697A10E, - 0170310F00B48B5CC697A10E, - 0170311000B48B5CC697A10E, - 0170311100B48B5CC697A10E, - 0170311200B48B5CC697A10E, - 0170311400B48B5CC697A10E, - 0170311500B48B5CC697A10E, - 0170311600B48B5CC697A10E, - F54951F40354EAA2011BCB42, - 4FB23865047AB9F60098ACF3, - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0170304E00B4885DC697A10E = { - buildActionMask = 2147483647; - files = ( - 0170311700B48E9AC697A10E, - 0170311800B48E9AC697A10E, - 0170311900B48E9AC697A10E, - 0170311A00B48E9AC697A10E, - 0170311B00B48E9AC697A10E, - F54951E80354E75E011BCB42, - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0170304F00B4885DC697A10E = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0170305200B488AEC697A10E = { - fileRef = 012ADB0300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305300B488AEC697A10E = { - fileRef = 012ADB0000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305400B488AEC697A10E = { - fileRef = 012ADAFE00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305500B488AEC697A10E = { - fileRef = 012ADAFD00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305600B488AEC697A10E = { - fileRef = 012ADAF300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305700B488AEC697A10E = { - fileRef = 012ADAF200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305800B488AEC697A10E = { - fileRef = 012ADAF000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305900B488AEC697A10E = { - fileRef = 012ADAEE00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305B00B488AEC697A10E = { - fileRef = 012ADB0200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305C00B488AEC697A10E = { - fileRef = 012ADAFF00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305D00B488AEC697A10E = { - fileRef = 012ADB0100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305E00B488AEC697A10E = { - fileRef = 012ADAFC00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170305F00B488AEC697A10E = { - fileRef = 012ADAFB00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306000B488AEC697A10E = { - fileRef = 012ADAFA00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306100B488AEC697A10E = { - fileRef = 016F1B6300ACDA9BC697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306200B488AEC697A10E = { - fileRef = 012ADAF900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306300B488AEC697A10E = { - fileRef = 012ADAF800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306400B488AEC697A10E = { - fileRef = 012ADAF700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306500B488AEC697A10E = { - fileRef = 012ADAF600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306600B488AEC697A10E = { - fileRef = 012ADAF500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306700B488AEC697A10E = { - fileRef = 012ADAF400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306800B488AEC697A10E = { - fileRef = 012ADAF100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306900B488AEC697A10E = { - fileRef = 012ADAEF00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306A00B488AEC697A10E = { - fileRef = 012ADAED00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306B00B489B5C697A10E = { - fileRef = 012ADB2400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306C00B489B5C697A10E = { - fileRef = 012ADB2500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306D00B489B5C697A10E = { - fileRef = 012ADB2600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306E00B489B5C697A10E = { - fileRef = 012ADB2700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170306F00B489B5C697A10E = { - fileRef = 012ADB2800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307000B489B5C697A10E = { - fileRef = 012ADB2900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307100B489B5C697A10E = { - fileRef = 012ADB2A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307200B489B5C697A10E = { - fileRef = 012ADB2B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307400B489B5C697A10E = { - fileRef = 012ADB2D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307500B489B5C697A10E = { - fileRef = 012ADB2E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307600B48B5CC697A10E = { - fileRef = 012ADB3F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307700B48B5CC697A10E = { - fileRef = 012ADB1400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307800B48B5CC697A10E = { - fileRef = 012ADB1A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307900B48B5CC697A10E = { - fileRef = 012ADB0800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307A00B48B5CC697A10E = { - fileRef = 012ADB0900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307B00B48B5CC697A10E = { - fileRef = 012ADA6C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307C00B48B5CC697A10E = { - fileRef = 012ADA8100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307D00B48B5CC697A10E = { - fileRef = 012ADA8C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307E00B48B5CC697A10E = { - fileRef = 012ADA9B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170307F00B48B5CC697A10E = { - fileRef = 012ADA6200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308400B48B5CC697A10E = { - fileRef = 012AD90800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308500B48B5CC697A10E = { - fileRef = 012AD90900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308600B48B5CC697A10E = { - fileRef = 012AD90C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308700B48B5CC697A10E = { - fileRef = 012AD90E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308800B48B5CC697A10E = { - fileRef = 012AD90F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308900B48B5CC697A10E = { - fileRef = 012AD91100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308A00B48B5CC697A10E = { - fileRef = 012AD91300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308B00B48B5CC697A10E = { - fileRef = 012AD91400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308C00B48B5CC697A10E = { - fileRef = 012AD91600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308D00B48B5CC697A10E = { - fileRef = 012AD91800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308E00B48B5CC697A10E = { - fileRef = 012AD91A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170308F00B48B5CC697A10E = { - fileRef = 012AD91C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309000B48B5CC697A10E = { - fileRef = 012AD91E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309100B48B5CC697A10E = { - fileRef = 012AD92000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309200B48B5CC697A10E = { - fileRef = 012AD92200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309300B48B5CC697A10E = { - fileRef = 012AD92A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309400B48B5CC697A10E = { - fileRef = 012AD92D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309500B48B5CC697A10E = { - fileRef = 012AD92F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309600B48B5CC697A10E = { - fileRef = 012AD93100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309700B48B5CC697A10E = { - fileRef = 012AD93300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309800B48B5CC697A10E = { - fileRef = 012AD93500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309900B48B5CC697A10E = { - fileRef = 012AD93700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309A00B48B5CC697A10E = { - fileRef = 012AD93900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309B00B48B5CC697A10E = { - fileRef = 012AD93B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309C00B48B5CC697A10E = { - fileRef = 012AD93C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309E00B48B5CC697A10E = { - fileRef = 015ECC0C00894EC0C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170309F00B48B5CC697A10E = { - fileRef = 011F78F200B25B65C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030A000B48B5CC697A10E = { - fileRef = 043627A600868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030A100B48B5CC697A10E = { - fileRef = 043627A900868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030A200B48B5CC697A10E = { - fileRef = 043627B000868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030A300B48B5CC697A10E = { - fileRef = 043627AE00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030A400B48B5CC697A10E = { - fileRef = 012ADB5700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030A500B48B5CC697A10E = { - fileRef = 012ADB5800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030A600B48B5CC697A10E = { - fileRef = 012ADB3800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030A700B48B5CC697A10E = { - fileRef = 012ADB3B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030A800B48B5CC697A10E = { - fileRef = 012ADB3E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030A900B48B5CC697A10E = { - fileRef = 012ADB0A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030AA00B48B5CC697A10E = { - fileRef = 012ADB0B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030AB00B48B5CC697A10E = { - fileRef = 012ADB0C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030AC00B48B5CC697A10E = { - fileRef = 012ADB0D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030AD00B48B5CC697A10E = { - fileRef = 012ADB0E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030AE00B48B5CC697A10E = { - fileRef = 012ADB0F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030AF00B48B5CC697A10E = { - fileRef = 012ADB1000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030B000B48B5CC697A10E = { - fileRef = 012ADB1100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030B100B48B5CC697A10E = { - fileRef = 012ADB1200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030B200B48B5CC697A10E = { - fileRef = 012ADB1300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030B300B48B5CC697A10E = { - fileRef = 012ADB1500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030B400B48B5CC697A10E = { - fileRef = 012ADB1600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030B500B48B5CC697A10E = { - fileRef = 012ADB1700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030B600B48B5CC697A10E = { - fileRef = 012ADB1800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030B700B48B5CC697A10E = { - fileRef = 012ADB1900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030B800B48B5CC697A10E = { - fileRef = 012ADB1B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030B900B48B5CC697A10E = { - fileRef = 012ADB1C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030BA00B48B5CC697A10E = { - fileRef = 012ADB1D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030BB00B48B5CC697A10E = { - fileRef = 012ADB1E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030BC00B48B5CC697A10E = { - fileRef = 012ADB1F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030BD00B48B5CC697A10E = { - fileRef = 012ADB2000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030BE00B48B5CC697A10E = { - fileRef = 012ADB2100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030BF00B48B5CC697A10E = { - fileRef = 012ADB2200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030C000B48B5CC697A10E = { - fileRef = 012ADA6600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030C100B48B5CC697A10E = { - fileRef = 012ADA6800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030C200B48B5CC697A10E = { - fileRef = 012ADA6900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030C300B48B5CC697A10E = { - fileRef = 012ADA6A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030C400B48B5CC697A10E = { - fileRef = 012ADA6B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030C500B48B5CC697A10E = { - fileRef = 012ADA6D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030C600B48B5CC697A10E = { - fileRef = 012ADA6E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030C700B48B5CC697A10E = { - fileRef = 012ADA6F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030C800B48B5CC697A10E = { - fileRef = 012ADA7000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030C900B48B5CC697A10E = { - fileRef = 012ADA7100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030CA00B48B5CC697A10E = { - fileRef = 012ADA7300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030CB00B48B5CC697A10E = { - fileRef = 012ADA7400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030CC00B48B5CC697A10E = { - fileRef = 012ADA7500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030CD00B48B5CC697A10E = { - fileRef = 012ADA7600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030CE00B48B5CC697A10E = { - fileRef = 012ADA7800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030CF00B48B5CC697A10E = { - fileRef = 012ADA7900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030D000B48B5CC697A10E = { - fileRef = 012ADA7B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030D100B48B5CC697A10E = { - fileRef = 012ADA7C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030D200B48B5CC697A10E = { - fileRef = 012ADA7D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030D300B48B5CC697A10E = { - fileRef = 012ADA7F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030D400B48B5CC697A10E = { - fileRef = 012ADA8000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030D500B48B5CC697A10E = { - fileRef = 012ADA8200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030D600B48B5CC697A10E = { - fileRef = 012ADA8300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030D700B48B5CC697A10E = { - fileRef = 012ADA8400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030D800B48B5CC697A10E = { - fileRef = 012ADA8500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030D900B48B5CC697A10E = { - fileRef = 012ADA8900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030DA00B48B5CC697A10E = { - fileRef = 012ADA8800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030DB00B48B5CC697A10E = { - fileRef = 012ADA8B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030DC00B48B5CC697A10E = { - fileRef = 012ADA8D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030DD00B48B5CC697A10E = { - fileRef = 012ADA9000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030DE00B48B5CC697A10E = { - fileRef = 012ADA9600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030DF00B48B5CC697A10E = { - fileRef = 012ADA9800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030E000B48B5CC697A10E = { - fileRef = 012ADAA200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030E100B48B5CC697A10E = { - fileRef = 012ADA6000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030E200B48B5CC697A10E = { - fileRef = 012ADA6100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030F200B48B5CC697A10E = { - fileRef = 012AD90A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030F300B48B5CC697A10E = { - fileRef = 012AD90B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030F400B48B5CC697A10E = { - fileRef = 012AD90D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030F500B48B5CC697A10E = { - fileRef = 012AD91000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030F600B48B5CC697A10E = { - fileRef = 012AD91200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030F700B48B5CC697A10E = { - fileRef = 012AD91500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030F800B48B5CC697A10E = { - fileRef = 012AD91700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030F900B48B5CC697A10E = { - fileRef = 012AD91900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030FA00B48B5CC697A10E = { - fileRef = 012AD91B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030FB00B48B5CC697A10E = { - fileRef = 012AD91D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030FC00B48B5CC697A10E = { - fileRef = 012AD91F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030FD00B48B5CC697A10E = { - fileRef = 012AD92100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030FE00B48B5CC697A10E = { - fileRef = 012AD92300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 017030FF00B48B5CC697A10E = { - fileRef = 012AD92400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310000B48B5CC697A10E = { - fileRef = 012AD92500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310100B48B5CC697A10E = { - fileRef = 012AD92600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310200B48B5CC697A10E = { - fileRef = 012AD92700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310300B48B5CC697A10E = { - fileRef = 012AD92800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310400B48B5CC697A10E = { - fileRef = 012AD92900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310500B48B5CC697A10E = { - fileRef = 012AD92B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310600B48B5CC697A10E = { - fileRef = 012AD92C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310700B48B5CC697A10E = { - fileRef = 012AD92E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310800B48B5CC697A10E = { - fileRef = 012AD93000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310900B48B5CC697A10E = { - fileRef = 012AD93200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310A00B48B5CC697A10E = { - fileRef = 012AD93400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310B00B48B5CC697A10E = { - fileRef = 012AD93600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310C00B48B5CC697A10E = { - fileRef = 012AD93800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310D00B48B5CC697A10E = { - fileRef = 012AD93A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170310F00B48B5CC697A10E = { - fileRef = 015ECC0D00894EC0C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311000B48B5CC697A10E = { - fileRef = 043627A700868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311100B48B5CC697A10E = { - fileRef = 016B4A3B00ACCF9FC697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311200B48B5CC697A10E = { - fileRef = 043627A800868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311400B48B5CC697A10E = { - fileRef = 043627AD00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311500B48B5CC697A10E = { - fileRef = 043627B100868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311600B48B5CC697A10E = { - fileRef = 043627AF00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311700B48E9AC697A10E = { - fileRef = 0654BA58FE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311800B48E9AC697A10E = { - fileRef = 0654BA59FE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311900B48E9AC697A10E = { - fileRef = 00E9D914FEDB4D29C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311A00B48E9AC697A10E = { - fileRef = 0654BA5AFE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311B00B48E9AC697A10E = { - fileRef = 0654BA5BFE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 0170311C00B49352C697A10E = { - buildPhases = ( - ); - buildSettings = { - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = All; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - }; - dependencies = ( - 0170311D00B49352C697A10E, - 4FF091EA04897B0000030DA8, - 18A3D356065F6636006A719A, - 18A3D358065F663A006A719A, - 18A3D35A065F663F006A719A, - ); - isa = PBXAggregateTarget; - name = All; - productName = All; - }; - 0170311D00B49352C697A10E = { - isa = PBXTargetDependency; - target = 0654BA5CFE8ECEE0C697A12F; - targetProxy = 1895FF33065E291B00F8B3F4; - }; -//010 -//011 -//012 -//013 -//014 -//040 -//041 -//042 -//043 -//044 - 043627A000868916C697A10E = { - children = ( - 015ECC0C00894EC0C697A10E, - 015ECC0D00894EC0C697A10E, - 011F78F200B25B65C697A10E, - 043627A600868916C697A10E, - 043627A700868916C697A10E, - 016B4A3B00ACCF9FC697A10E, - 016B4A3C00ACCF9FC697A10E, - 016B4A3D00ACCF9FC697A10E, - 043627A800868916C697A10E, - 043627A900868916C697A10E, - 043627AB00868916C697A10E, - 043627AD00868916C697A10E, - 043627AE00868916C697A10E, - 043627AF00868916C697A10E, - 043627B000868916C697A10E, - 043627B100868916C697A10E, - 043627B200868916C697A10E, - 043627B300868916C697A10E, - 043627B400868916C697A10E, - 043627B500868916C697A10E, - 043627B600868916C697A10E, - 043627B700868916C697A10E, - 043627B800868916C697A10E, - ); - isa = PBXGroup; - name = "Mac OS X"; - path = ""; - refType = 4; - sourceTree = ""; - }; - 043627A600868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = macosx_glimp.h; - refType = 4; - sourceTree = ""; - }; - 043627A700868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = macosx_glimp.m; - refType = 4; - sourceTree = ""; - }; - 043627A800868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = macosx_input.m; - refType = 4; - sourceTree = ""; - }; - 043627A900868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = macosx_local.h; - refType = 4; - sourceTree = ""; - }; - 043627AB00868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = macosx_sndcore.m; - refType = 4; - sourceTree = ""; - }; - 043627AD00868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = macosx_sys.m; - refType = 4; - sourceTree = ""; - }; - 043627AE00868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = macosx_timers.h; - refType = 4; - sourceTree = ""; - }; - 043627AF00868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = macosx_timers.m; - refType = 4; - sourceTree = ""; - }; - 043627B000868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = Q3Controller.h; - refType = 4; - sourceTree = ""; - }; - 043627B100868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - path = Q3Controller.m; - refType = 4; - sourceTree = ""; - }; - 043627B200868916C697A10E = { - isa = PBXFileReference; - lastKnownFileType = wrapper.nib; - path = Quake3.nib; - refType = 4; - sourceTree = ""; - }; - 043627B300868916C697A10E = { - isa = PBXFileReference; - lastKnownFileType = image.icns; - path = Quake3.icns; - refType = 4; - sourceTree = ""; - }; - 043627B400868916C697A10E = { - isa = PBXFileReference; - lastKnownFileType = image.jpeg; - path = banner.jpg; - refType = 4; - sourceTree = ""; - }; - 043627B500868916C697A10E = { - isa = PBXFileReference; - lastKnownFileType = text.rtf; - path = Performance.rtf; - refType = 4; - sourceTree = ""; - }; - 043627B600868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.script.sh; - path = BuildRelease; - refType = 4; - sourceTree = ""; - }; - 043627B700868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.script.sh; - path = RecordDemo.zsh; - refType = 4; - sourceTree = ""; - }; - 043627B800868916C697A10E = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.script.sh; - path = timedemo.zsh; - refType = 4; - sourceTree = ""; - }; - 043627BC00868916C697A10E = { - fileRef = 043627A600868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627BD00868916C697A10E = { - fileRef = 043627A900868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627BE00868916C697A10E = { - fileRef = 043627AE00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627BF00868916C697A10E = { - fileRef = 043627B000868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627C000868916C697A10E = { - fileRef = 043627B300868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627C100868916C697A10E = { - fileRef = 043627B200868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627C200868916C697A10E = { - fileRef = 043627B400868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627C500868916C697A10E = { - fileRef = 043627A700868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627C600868916C697A10E = { - fileRef = 043627A800868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627C800868916C697A10E = { - fileRef = 043627AB00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627CA00868916C697A10E = { - fileRef = 043627AD00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627CB00868916C697A10E = { - fileRef = 043627AF00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627CC00868916C697A10E = { - fileRef = 043627B100868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627D20086963EC697A10E = { - fileRef = 012ADAF600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627D30086965EC697A10E = { - fileRef = 012ADA6200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627D40086965EC697A10E = { - fileRef = 012ADA6100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627D50086965EC697A10E = { - fileRef = 012ADA6000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627D600869679C697A10E = { - fileRef = 012ADB1200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627D700869713C697A10E = { - fileRef = 012ADB0300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627D800869713C697A10E = { - fileRef = 012ADAF700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627D900869713C697A10E = { - fileRef = 012ADAF800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627DA00869713C697A10E = { - fileRef = 012ADAF900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627DB00869713C697A10E = { - fileRef = 012ADB0100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627DD00869713C697A10E = { - fileRef = 012ADB0200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627DE00869726C697A10E = { - fileRef = 012ADB0000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627DF00869726C697A10E = { - fileRef = 012ADAFF00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627E00086978DC697A10E = { - fileRef = 012ADB5800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627E100869827C697A10E = { - fileRef = 012ADAEE00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627E200869827C697A10E = { - fileRef = 012ADAF000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627E300869827C697A10E = { - fileRef = 012ADAF200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627E400869827C697A10E = { - fileRef = 012ADAF300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627E500869827C697A10E = { - fileRef = 012ADAFD00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627E600869827C697A10E = { - fileRef = 012ADAFE00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627E700869827C697A10E = { - fileRef = 012ADB0800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627E800869827C697A10E = { - fileRef = 012ADB0900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627E900869827C697A10E = { - fileRef = 012ADB1400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627EA00869827C697A10E = { - fileRef = 012ADB1A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627EB00869827C697A10E = { - fileRef = 012ADB2400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627EC00869827C697A10E = { - fileRef = 012AD9A600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627ED00869827C697A10E = { - fileRef = 012AD9A700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627EE00869827C697A10E = { - fileRef = 012AD9A800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627EF00869827C697A10E = { - fileRef = 012AD9A900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627F000869827C697A10E = { - fileRef = 012AD9AA00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627F100869827C697A10E = { - fileRef = 012AD9AB00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627F200869827C697A10E = { - fileRef = 012AD9AC00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627F300869827C697A10E = { - fileRef = 012AD9AD00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627F400869827C697A10E = { - fileRef = 012AD9AE00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627F500869827C697A10E = { - fileRef = 012AD9AF00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627F600869827C697A10E = { - fileRef = 012ADAED00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627F700869827C697A10E = { - fileRef = 012ADAEF00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627F900869827C697A10E = { - fileRef = 012ADAF400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627FA00869827C697A10E = { - fileRef = 012ADAF500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627FB00869827C697A10E = { - fileRef = 012ADAFA00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627FC00869827C697A10E = { - fileRef = 012ADAFB00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627FD00869827C697A10E = { - fileRef = 012ADAFC00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627FE00869827C697A10E = { - fileRef = 012ADB0A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043627FF00869827C697A10E = { - fileRef = 012ADB0B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280000869827C697A10E = { - fileRef = 012ADB0C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280100869827C697A10E = { - fileRef = 012ADB0D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280200869827C697A10E = { - fileRef = 012ADB0E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280300869827C697A10E = { - fileRef = 012ADB0F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280400869827C697A10E = { - fileRef = 012ADB1000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280500869827C697A10E = { - fileRef = 012ADB1100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280600869827C697A10E = { - fileRef = 012ADB1300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280700869827C697A10E = { - fileRef = 012ADB1500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280800869827C697A10E = { - fileRef = 012ADB1600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280900869827C697A10E = { - fileRef = 012ADB1700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280A00869827C697A10E = { - fileRef = 012ADB1800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280B00869827C697A10E = { - fileRef = 012ADB1900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280C00869827C697A10E = { - fileRef = 012ADB1B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280D00869827C697A10E = { - fileRef = 012ADB1C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280E00869827C697A10E = { - fileRef = 012ADB1D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436280F00869827C697A10E = { - fileRef = 012ADB1E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281000869827C697A10E = { - fileRef = 012ADB1F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281100869827C697A10E = { - fileRef = 012ADB2000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281200869827C697A10E = { - fileRef = 012ADB2100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281300869827C697A10E = { - fileRef = 012ADB2200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281400869827C697A10E = { - fileRef = 012ADB2500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281500869827C697A10E = { - fileRef = 012ADB2600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281600869827C697A10E = { - fileRef = 012ADB2700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281700869827C697A10E = { - fileRef = 012ADB2800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281800869827C697A10E = { - fileRef = 012ADB2900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281900869827C697A10E = { - fileRef = 012ADB2A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281A00869827C697A10E = { - fileRef = 012ADB2B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281C00869827C697A10E = { - fileRef = 012ADB2D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281D00869827C697A10E = { - fileRef = 012ADB2E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281E00869827C697A10E = { - fileRef = 012ADB5700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436281F008698F8C697A10E = { - fileRef = 012AD9B000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 04362820008698F8C697A10E = { - fileRef = 012AD9B100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 04362821008698F8C697A10E = { - fileRef = 012AD9B400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 04362822008698F8C697A10E = { - fileRef = 012AD9B700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 04362823008698F8C697A10E = { - fileRef = 012AD9B200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 04362824008698F8C697A10E = { - fileRef = 012AD9B300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 04362825008698F8C697A10E = { - fileRef = 012AD9B500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 04362826008698F8C697A10E = { - fileRef = 012AD9B600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628270086991FC697A10E = { - fileRef = 012AD9B800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436282E00869A16C697A10E = { - fileRef = 012ADB3B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436282F00869A7FC697A10E = { - fileRef = 012ADB3800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436283000869A8EC697A10E = { - fileRef = 012ADB3F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436283100869A8EC697A10E = { - fileRef = 012ADB3E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436283300869AC5C697A10E = { - fileRef = 012ADA9800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436283400869AC5C697A10E = { - fileRef = 012ADA9600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436284900869B0BC697A10E = { - fileRef = 012ADA8C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436284B00869B0BC697A10E = { - fileRef = 012ADA9B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436286A00869C36C697A10E = { - fileRef = 012ADA8B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436286B00869C6FC697A10E = { - fileRef = 012ADA6600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436286C00869CB4C697A10E = { - fileRef = 012ADA7100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436286D00869CC9C697A10E = { - fileRef = 012ADAA200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436286E00869D0AC697A10E = { - fileRef = 012ADA6F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436286F00869D18C697A10E = { - fileRef = 012ADA7900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287000869D23C697A10E = { - fileRef = 012ADA6D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287100869D3BC697A10E = { - fileRef = 012ADA7400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287200869D48C697A10E = { - fileRef = 012ADA6C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287300869D48C697A10E = { - fileRef = 012ADA6B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287400869D56C697A10E = { - fileRef = 012ADA6A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287500869D61C697A10E = { - fileRef = 012ADA7600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287600869D71C697A10E = { - fileRef = 012ADA6900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287700869D7FC697A10E = { - fileRef = 012ADA7500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287800869D92C697A10E = { - fileRef = 012ADA6800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287900869DBBC697A10E = { - fileRef = 012ADA8D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287A00869DC7C697A10E = { - fileRef = 012ADA7000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287B00869DD4C697A10E = { - fileRef = 012ADA8500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287C00869DDDC697A10E = { - fileRef = 012ADA7800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287D00869DF1C697A10E = { - fileRef = 012ADA8400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287E00869DFAC697A10E = { - fileRef = 012ADA8200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436287F00869E04C697A10E = { - fileRef = 012ADA8900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288000869E10C697A10E = { - fileRef = 012ADA7F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288100869E21C697A10E = { - fileRef = 012ADA8100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288200869E21C697A10E = { - fileRef = 012ADA8000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288300869E3DC697A10E = { - fileRef = 012ADA9000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288400869E4CC697A10E = { - fileRef = 012ADA8800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288500869E56C697A10E = { - fileRef = 012ADA7300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288600869E60C697A10E = { - fileRef = 012ADA7B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288700869E80C697A10E = { - fileRef = 012ADA8300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288800869E8DC697A10E = { - fileRef = 012ADA7C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288900869E96C697A10E = { - fileRef = 012ADA7D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288A00869EA2C697A10E = { - fileRef = 012ADA6E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288B00869ED7C697A10E = { - fileRef = 012AD92C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288C00869EF3C697A10E = { - fileRef = 012AD92400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288D00869F06C697A10E = { - fileRef = 012AD93700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288E00869F06C697A10E = { - fileRef = 012AD93600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436288F00869F0FC697A10E = { - fileRef = 012AD93100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289000869F0FC697A10E = { - fileRef = 012AD93000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289100869F2AC697A10E = { - fileRef = 012AD93900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289200869F2AC697A10E = { - fileRef = 012AD93800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289300869F38C697A10E = { - fileRef = 012AD93500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289400869F38C697A10E = { - fileRef = 012AD93400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289500869F40C697A10E = { - fileRef = 012AD93300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289600869F40C697A10E = { - fileRef = 012AD93200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289700869F4BC697A10E = { - fileRef = 012AD92500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289800869F63C697A10E = { - fileRef = 012AD92B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289900869F7FC697A10E = { - fileRef = 012AD92300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289A00869F8EC697A10E = { - fileRef = 012AD92700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289B00869FAEC697A10E = { - fileRef = 012AD91E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289C00869FAEC697A10E = { - fileRef = 012AD91D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289D00869FBBC697A10E = { - fileRef = 012AD91800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289E00869FBBC697A10E = { - fileRef = 012AD91700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 0436289F00869FC3C697A10E = { - fileRef = 012AD92200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628A000869FC3C697A10E = { - fileRef = 012AD92100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628A100869FDEC697A10E = { - fileRef = 012AD90900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628A200869FDEC697A10E = { - fileRef = 012AD90A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628A300869FE8C697A10E = { - fileRef = 012AD90E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628A400869FE8C697A10E = { - fileRef = 012AD90D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628A500869FEFC697A10E = { - fileRef = 012AD91C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628A600869FEFC697A10E = { - fileRef = 012AD91B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628A70086A057C697A10E = { - fileRef = 012AD91600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628A80086A057C697A10E = { - fileRef = 012AD91500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628A90086A061C697A10E = { - fileRef = 012AD92600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628AA0086A081C697A10E = { - fileRef = 012AD92A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628AB0086A081C697A10E = { - fileRef = 012AD92900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628AC0086A092C697A10E = { - fileRef = 012AD91A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628AD0086A092C697A10E = { - fileRef = 012AD91900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628AE0086A099C697A10E = { - fileRef = 012AD92000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628AF0086A099C697A10E = { - fileRef = 012AD91F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628B00086A0B9C697A10E = { - fileRef = 012AD93B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628B10086A0B9C697A10E = { - fileRef = 012AD92D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628B20086A0B9C697A10E = { - fileRef = 012AD92F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628B30086A0B9C697A10E = { - fileRef = 012AD93C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628B40086A0B9C697A10E = { - fileRef = 012AD93A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628B50086A0B9C697A10E = { - fileRef = 012AD92E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628B60086A0BFC697A10E = { - fileRef = 012AD92800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628B70086A0E6C697A10E = { - fileRef = 012AD91300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628B80086A0E6C697A10E = { - fileRef = 012AD91200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628B90086A0F1C697A10E = { - fileRef = 012AD91100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628BA0086A0F1C697A10E = { - fileRef = 012AD91000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628BB0086A136C697A10E = { - fileRef = 012AD90C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628BC0086A136C697A10E = { - fileRef = 012AD90F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628BD0086A136C697A10E = { - fileRef = 012AD91400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628BE0086A136C697A10E = { - fileRef = 012AD90800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 043628BF0086A136C697A10E = { - fileRef = 012AD90B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; -//040 -//041 -//042 -//043 -//044 -//060 -//061 -//062 -//063 -//064 - 0654BA41FE8ECEE0C697A12F = { - buildSettings = { - }; - buildStyles = ( - 07F3F50BFFE98E8EC697A10E, - 07F3F50CFFE98E8EC697A10E, - ); - hasScannedForEncodings = 1; - isa = PBXProject; - mainGroup = 0654BA42FE8ECEE0C697A12F; - projectDirPath = ""; - targets = ( - 0170311C00B49352C697A10E, - 0654BA5CFE8ECEE0C697A12F, - 4FF0904804896C0E00030DA8, - 00F5ED38FEBA95B7C697A12F, - 00F5ED90FEBA9615C697A12F, - 016EAE0300B4BDD1C697A10E, - 0170304B00B4885DC697A10E, - 4FF0912704896C1600030DA8, - ); - }; - 0654BA42FE8ECEE0C697A12F = { - children = ( - 043627A000868916C697A10E, - 0654BA76FE8ED011C697A12F, - 0654BA57FE8ECEE0C697A12F, - 07FB599DFEB762C8C697A12F, - ); - isa = PBXGroup; - name = Quake3; - refType = 4; - sourceTree = ""; - }; - 0654BA57FE8ECEE0C697A12F = { - children = ( - 0654BA58FE8ECEE0C697A12F, - 0654BA5AFE8ECEE0C697A12F, - 0654BA5BFE8ECEE0C697A12F, - F564505801E623B201F62882, - 00E9D914FEDB4D29C697A12F, - 0654BA59FE8ECEE0C697A12F, - ); - isa = PBXGroup; - name = "External Frameworks and Libraries"; - path = ""; - refType = 4; - sourceTree = ""; - }; - 0654BA58FE8ECEE0C697A12F = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = OpenGL.framework; - path = /System/Library/Frameworks/OpenGL.framework; - refType = 0; - sourceTree = ""; - }; - 0654BA59FE8ECEE0C697A12F = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = Carbon.framework; - path = /System/Library/Frameworks/Carbon.framework; - refType = 0; - sourceTree = ""; - }; - 0654BA5AFE8ECEE0C697A12F = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = AppKit.framework; - path = /System/Library/Frameworks/AppKit.framework; - refType = 0; - sourceTree = ""; - }; - 0654BA5BFE8ECEE0C697A12F = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = Foundation.framework; - path = /System/Library/Frameworks/Foundation.framework; - refType = 0; - sourceTree = ""; - }; - 0654BA5CFE8ECEE0C697A12F = { - buildPhases = ( - 0654BA5DFE8ECEE0C697A12F, - 0654BA61FE8ECEE0C697A12F, - 0654BA65FE8ECEE0C697A12F, - 0654BA6BFE8ECEE0C697A12F, - 0654BA70FE8ECEE0C697A12F, - ); - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ""; - HEADER_SEARCH_PATHS = ""; - INSTALL_PATH = "/Users/Shared/$(USER)/InstalledProducts"; - LIBRARY_SEARCH_PATHS = ""; - OPTIMIZATION_CFLAGS = "-O2"; - OTHER_CFLAGS = "-DMACOS_X -DBOTLIB -DMISSIONPACK -DSMP -force_cpusubtype_ALL"; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = Quake3; - SECTORDER_FLAGS = ""; - USE_GCC3_PFE_SUPPORT = NO; - WARNING_CFLAGS = "-Wno-long-double -Wall -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = app; - }; - dependencies = ( - ); - isa = PBXApplicationTarget; - name = "Quake3 (Application)"; - productInstallPath = "/Users/Shared/$(USER)/InstalledProducts"; - productName = Quake3; - productReference = 09143A93FF39F3EF11CA2562; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - Quake3 - CFBundleGetInfoString - Quake 3 Arena 1.32b - CFBundleIconFile - Quake3.icns - CFBundleIdentifier - com.idsoftware.Quake3 - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Quake3 - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.32b - CFBundleSignature - IDQ3 - CFBundleVersion - 1.3.2 - NSExtensions - - NSMainNibFile - Quake3.nib - NSPrincipalClass - NSApplication - NSServices - - - NSMenuItem - - default - Quake3/Connect To Server - - NSMessage - connectToServer - NSPortName - Quake3 - NSSendTypes - - NSStringPboardType - - - - NSMenuItem - - default - Quake3/Perform Command - - NSMessage - performCommand - NSPortName - Quake3 - NSSendTypes - - NSStringPboardType - - - - - -"; - }; - 0654BA5DFE8ECEE0C697A12F = { - buildActionMask = 2147483647; - files = ( - 043627BC00868916C697A10E, - 043627BD00868916C697A10E, - 043627BE00868916C697A10E, - 043627BF00868916C697A10E, - 043627D30086965EC697A10E, - 043627D700869713C697A10E, - 043627DE00869726C697A10E, - 043627E100869827C697A10E, - 043627E200869827C697A10E, - 043627E300869827C697A10E, - 043627E400869827C697A10E, - 043627E500869827C697A10E, - 043627E600869827C697A10E, - 043627E700869827C697A10E, - 043627E800869827C697A10E, - 043627E900869827C697A10E, - 043627EA00869827C697A10E, - 043627EB00869827C697A10E, - 0436281F008698F8C697A10E, - 04362820008698F8C697A10E, - 04362821008698F8C697A10E, - 04362822008698F8C697A10E, - 0436283000869A8EC697A10E, - 0436284900869B0BC697A10E, - 0436284B00869B0BC697A10E, - 0436287200869D48C697A10E, - 0436288100869E21C697A10E, - 0436288D00869F06C697A10E, - 0436288F00869F0FC697A10E, - 0436289100869F2AC697A10E, - 0436289300869F38C697A10E, - 0436289500869F40C697A10E, - 0436289B00869FAEC697A10E, - 0436289D00869FBBC697A10E, - 0436289F00869FC3C697A10E, - 043628A100869FDEC697A10E, - 043628A300869FE8C697A10E, - 043628A500869FEFC697A10E, - 043628A70086A057C697A10E, - 043628AA0086A081C697A10E, - 043628AC0086A092C697A10E, - 043628AE0086A099C697A10E, - 043628B00086A0B9C697A10E, - 043628B10086A0B9C697A10E, - 043628B20086A0B9C697A10E, - 043628B30086A0B9C697A10E, - 043628B70086A0E6C697A10E, - 043628B90086A0F1C697A10E, - 043628BB0086A136C697A10E, - 043628BC0086A136C697A10E, - 043628BD0086A136C697A10E, - 043628BE0086A136C697A10E, - 015ECC0E00894EC0C697A10E, - 011F78F300B25B66C697A10E, - F5ED1436037096A001F6289A, - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0654BA61FE8ECEE0C697A12F = { - buildActionMask = 2147483647; - files = ( - 043627C000868916C697A10E, - 043627C100868916C697A10E, - 043627C200868916C697A10E, - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0654BA65FE8ECEE0C697A12F = { - buildActionMask = 2147483647; - files = ( - 043627C500868916C697A10E, - 043627C600868916C697A10E, - 043627C800868916C697A10E, - 043627CA00868916C697A10E, - 043627CB00868916C697A10E, - 043627CC00868916C697A10E, - 043627D20086963EC697A10E, - 043627D40086965EC697A10E, - 043627D50086965EC697A10E, - 043627D600869679C697A10E, - 043627D800869713C697A10E, - 043627D900869713C697A10E, - 043627DA00869713C697A10E, - 043627DB00869713C697A10E, - 043627DD00869713C697A10E, - 043627DF00869726C697A10E, - 043627E00086978DC697A10E, - 043627EC00869827C697A10E, - 043627ED00869827C697A10E, - 043627EE00869827C697A10E, - 043627EF00869827C697A10E, - 043627F000869827C697A10E, - 043627F100869827C697A10E, - 043627F200869827C697A10E, - 043627F300869827C697A10E, - 043627F400869827C697A10E, - 043627F500869827C697A10E, - 043627F600869827C697A10E, - 043627F700869827C697A10E, - 043627F900869827C697A10E, - 043627FA00869827C697A10E, - 043627FB00869827C697A10E, - 043627FC00869827C697A10E, - 043627FD00869827C697A10E, - 043627FE00869827C697A10E, - 043627FF00869827C697A10E, - 0436280000869827C697A10E, - 0436280100869827C697A10E, - 0436280200869827C697A10E, - 0436280300869827C697A10E, - 0436280400869827C697A10E, - 0436280500869827C697A10E, - 0436280600869827C697A10E, - 0436280700869827C697A10E, - 0436280800869827C697A10E, - 0436280900869827C697A10E, - 0436280A00869827C697A10E, - 0436280B00869827C697A10E, - 0436280C00869827C697A10E, - 0436280D00869827C697A10E, - 0436280E00869827C697A10E, - 0436280F00869827C697A10E, - 0436281000869827C697A10E, - 0436281100869827C697A10E, - 0436281200869827C697A10E, - 0436281300869827C697A10E, - 0436281400869827C697A10E, - 0436281500869827C697A10E, - 0436281600869827C697A10E, - 0436281700869827C697A10E, - 0436281800869827C697A10E, - 0436281900869827C697A10E, - 0436281A00869827C697A10E, - 0436281C00869827C697A10E, - 0436281D00869827C697A10E, - 0436281E00869827C697A10E, - 04362823008698F8C697A10E, - 04362824008698F8C697A10E, - 04362825008698F8C697A10E, - 04362826008698F8C697A10E, - 043628270086991FC697A10E, - 0436282E00869A16C697A10E, - 0436282F00869A7FC697A10E, - 0436283100869A8EC697A10E, - 0436283300869AC5C697A10E, - 0436283400869AC5C697A10E, - 0436286A00869C36C697A10E, - 0436286B00869C6FC697A10E, - 0436286C00869CB4C697A10E, - 0436286D00869CC9C697A10E, - 0436286E00869D0AC697A10E, - 0436286F00869D18C697A10E, - 0436287000869D23C697A10E, - 0436287100869D3BC697A10E, - 0436287300869D48C697A10E, - 0436287400869D56C697A10E, - 0436287500869D61C697A10E, - 0436287600869D71C697A10E, - 0436287700869D7FC697A10E, - 0436287800869D92C697A10E, - 0436287900869DBBC697A10E, - 0436287A00869DC7C697A10E, - 0436287B00869DD4C697A10E, - 0436287C00869DDDC697A10E, - 0436287D00869DF1C697A10E, - 0436287E00869DFAC697A10E, - 0436287F00869E04C697A10E, - 0436288000869E10C697A10E, - 0436288200869E21C697A10E, - 0436288300869E3DC697A10E, - 0436288400869E4CC697A10E, - 0436288500869E56C697A10E, - 0436288600869E60C697A10E, - 0436288700869E80C697A10E, - 0436288800869E8DC697A10E, - 0436288900869E96C697A10E, - 0436288A00869EA2C697A10E, - 0436288B00869ED7C697A10E, - 0436288C00869EF3C697A10E, - 0436288E00869F06C697A10E, - 0436289000869F0FC697A10E, - 0436289200869F2AC697A10E, - 0436289400869F38C697A10E, - 0436289600869F40C697A10E, - 0436289700869F4BC697A10E, - 0436289800869F63C697A10E, - 0436289900869F7FC697A10E, - 0436289A00869F8EC697A10E, - 0436289C00869FAEC697A10E, - 0436289E00869FBBC697A10E, - 043628A000869FC3C697A10E, - 043628A200869FDEC697A10E, - 043628A400869FE8C697A10E, - 043628A600869FEFC697A10E, - 043628A80086A057C697A10E, - 043628A90086A061C697A10E, - 043628AB0086A081C697A10E, - 043628AD0086A092C697A10E, - 043628AF0086A099C697A10E, - 043628B40086A0B9C697A10E, - 043628B50086A0B9C697A10E, - 043628B60086A0BFC697A10E, - 043628B80086A0E6C697A10E, - 043628BA0086A0F1C697A10E, - 043628BF0086A136C697A10E, - 015ECC0F00894EC0C697A10E, - 016B4A3E00ACCF9FC697A10E, - 016F1B6400ACDA9BC697A10E, - 4FB23867047ABF780098ACF3, - 4FEFFEDA047B008000719638, - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0654BA6BFE8ECEE0C697A12F = { - buildActionMask = 2147483647; - files = ( - 0654BA6CFE8ECEE0C697A12F, - 0654BA6EFE8ECEE0C697A12F, - 0654BA6FFE8ECEE0C697A12F, - 00E9D91DFEDB5295C697A12F, - F564505901E623B201F62882, - F5D8C5E0035259DF0106E832, - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0654BA6CFE8ECEE0C697A12F = { - fileRef = 0654BA58FE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 0654BA6EFE8ECEE0C697A12F = { - fileRef = 0654BA5AFE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 0654BA6FFE8ECEE0C697A12F = { - fileRef = 0654BA5BFE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 0654BA70FE8ECEE0C697A12F = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 0654BA76FE8ED011C697A12F = { - children = ( - 012AD90700868211C697A10E, - 012AD93D00868211C697A10E, - 012AD98D00868211C697A10E, - 012AD9A500868211C697A10E, - 012ADA2400868211C697A10E, - 012ADA6500868211C697A10E, - 012ADAA400868211C697A10E, - 012ADAB300868211C697A10E, - 012ADABB00868211C697A10E, - 012ADAEC00868211C697A10E, - 012ADB0600868211C697A10E, - 012ADB2300868211C697A10E, - 012ADB2F00868211C697A10E, - 012ADB4000868211C697A10E, - 012ADB4C00868211C697A10E, - 012ADB5A00868211C697A10E, - ); - isa = PBXGroup; - name = "Id Source"; - path = ..; - refType = 4; - sourceTree = ""; - }; -//060 -//061 -//062 -//063 -//064 -//070 -//071 -//072 -//073 -//074 - 07F3F507FFE98E8EC697A10E = { - explicitFileType = wrapper.cfbundle; - isa = PBXFileReference; - path = qagame.bundle; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 07F3F508FFE98E8EC697A10E = { - explicitFileType = wrapper.cfbundle; - isa = PBXFileReference; - path = cgame.bundle; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 07F3F50BFFE98E8EC697A10E = { - buildSettings = { - COMMON_CFLAGS = "-DMISSIONPACK -DBOTLIB -DMACOS_X -force_cpusubtype_ALL"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - NO_OPT_CFLAGS = "-O0 -fno-inline -fno-inline-functions"; - OPTIMIZATION_CFLAGS = "-O0"; - OTHER_CFLAGS = "\U0001-g -Wall -DQGL_CHECK_GL_ERRORS $(NO_OPT_CFLAGS) $(COMMON_CFLAGS)"; - ZERO_LINK = YES; - }; - isa = PBXBuildStyle; - name = Development; - }; - 07F3F50CFFE98E8EC697A10E = { - buildSettings = { - COMMON_CFLAGS = "-DMISSIONPACK -DBOTLIB -DMACOS_X -force_cpusubtype_ALL\n"; - COPY_PHASE_STRIP = YES; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - ZERO_LINK = NO; - }; - isa = PBXBuildStyle; - name = Deployment; - }; - 07FB599DFEB762C8C697A12F = { - children = ( - 09143A93FF39F3EF11CA2562, - 07F3F507FFE98E8EC697A10E, - 07F3F508FFE98E8EC697A10E, - 016EAE0200B4BDD1C697A10E, - 0170304A00B4885DC697A10E, - 4FF0912504896C0E00030DA8, - 4FF091E804896C1600030DA8, - ); - isa = PBXGroup; - name = Products; - refType = 4; - sourceTree = ""; - }; -//070 -//071 -//072 -//073 -//074 -//090 -//091 -//092 -//093 -//094 - 09143A93FF39F3EF11CA2562 = { - explicitFileType = wrapper.application; - isa = PBXFileReference; - path = Quake3.app; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; -//090 -//091 -//092 -//093 -//094 -//130 -//131 -//132 -//133 -//134 - 13380E0900ADF941C697A10E = { - fileRef = 012ADA4C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E0B00ADFA16C697A10E = { - fileRef = 012ADA5700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E0C00ADFA72C697A10E = { - fileRef = 012ADA5600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E0D00ADFA94C697A10E = { - fileRef = 012ADA4D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E0E00ADFA9EC697A10E = { - fileRef = 012ADA4600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E0F00ADFAACC697A10E = { - fileRef = 012ADA6200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1000ADFAACC697A10E = { - fileRef = 012ADA6000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1100ADFAACC697A10E = { - fileRef = 012ADA6100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1200ADFACAC697A10E = { - fileRef = 012ADA4500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1300ADFAD5C697A10E = { - fileRef = 012ADA2E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1400ADFAD5C697A10E = { - fileRef = 012ADA2D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1500ADFB0CC697A10E = { - fileRef = 012ADA2C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1600ADFB0CC697A10E = { - fileRef = 012ADA2B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1700ADFBFDC697A10E = { - fileRef = 012ADA3200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1800ADFBFDC697A10E = { - fileRef = 012ADA3100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1900ADFC10C697A10E = { - fileRef = 012ADA2800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1A00ADFC10C697A10E = { - fileRef = 012ADA2700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1B00ADFC22C697A10E = { - fileRef = 012ADA3000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1C00ADFC22C697A10E = { - fileRef = 012ADA2F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1D00ADFC32C697A10E = { - fileRef = 012ADA2600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1E00ADFC32C697A10E = { - fileRef = 012ADA2500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E1F00ADFC43C697A10E = { - fileRef = 012ADA2A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2000ADFC43C697A10E = { - fileRef = 012ADA2900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2100ADFC59C697A10E = { - fileRef = 012ADA5C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2200ADFC78C697A10E = { - fileRef = 012ADA4900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2300ADFC85C697A10E = { - fileRef = 012ADA3E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2400ADFC9CC697A10E = { - fileRef = 012ADA5D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2500ADFCA7C697A10E = { - fileRef = 012ADA5A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2600ADFCA7C697A10E = { - fileRef = 012ADA5900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2700ADFCBDC697A10E = { - fileRef = 012ADA4700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2800ADFCC8C697A10E = { - fileRef = 012ADA4A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2900ADFCD1C697A10E = { - fileRef = 012ADA4F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2A00ADFCEBC697A10E = { - fileRef = 012ADA5500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2B00ADFCF6C697A10E = { - fileRef = 012ADA5400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2C00ADFD01C697A10E = { - fileRef = 012ADA4800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2D00ADFD1FC697A10E = { - fileRef = 012ADA4E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2E00ADFD28C697A10E = { - fileRef = 012ADA5B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E2F00ADFD38C697A10E = { - fileRef = 012ADA5800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3000ADFD46C697A10E = { - fileRef = 012ADA5000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3100ADFD58C697A10E = { - fileRef = 012ADA4400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3200ADFD71C697A10E = { - fileRef = 012ADA3F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3300ADFD85C697A10E = { - fileRef = 012ADA4100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3400ADFDA1C697A10E = { - fileRef = 012AD99700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3500ADFDA1C697A10E = { - fileRef = 012AD9A100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3600ADFDCFC697A10E = { - fileRef = 012ADA6200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3700ADFDCFC697A10E = { - fileRef = 012ADA6100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3800ADFDCFC697A10E = { - fileRef = 012ADA6000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3900ADFDE1C697A10E = { - fileRef = 012ADA3E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3B00ADFE0CC697A10E = { - fileRef = 012AD99C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3C00ADFE1EC697A10E = { - fileRef = 012ADA3F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3D00ADFE24C697A10E = { - fileRef = 012ADA4100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3E00ADFE3DC697A10E = { - fileRef = 012AD99B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E3F00ADFE4AC697A10E = { - fileRef = 012AD99300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4000ADFE58C697A10E = { - fileRef = 012AD99100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4100ADFE6BC697A10E = { - fileRef = 012AD99600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4200ADFE7AC697A10E = { - fileRef = 012AD99800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4300ADFE88C697A10E = { - fileRef = 012AD9A300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4400ADFE97C697A10E = { - fileRef = 012AD99200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4500ADFEA7C697A10E = { - fileRef = 012AD99A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4600ADFEB8C697A10E = { - fileRef = 012AD99000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4700ADFEC9C697A10E = { - fileRef = 012AD9A200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4800ADFED7C697A10E = { - fileRef = 012AD9A000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4900ADFEE7C697A10E = { - fileRef = 012AD99F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4A00ADFEF5C697A10E = { - fileRef = 012AD99E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4B00ADFF05C697A10E = { - fileRef = 012AD99400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4C00ADFF27C697A10E = { - fileRef = 012AD98E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E4F00AE0112C697A10E = { - fileRef = 012AD98F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E5000AE020FC697A10E = { - fileRef = 012AD99900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E5100AE0235C697A10E = { - fileRef = 012ADB4900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 13380E5200AE0235C697A10E = { - fileRef = 012ADB4800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; -//130 -//131 -//132 -//133 -//134 -//180 -//181 -//182 -//183 -//184 - 1895FF2E065E291B00F8B3F4 = { - containerPortal = 0654BA41FE8ECEE0C697A12F; - isa = PBXContainerItemProxy; - proxyType = 1; - remoteGlobalIDString = 4FF0904804896C0E00030DA8; - remoteInfo = "Quake3 G4 (Application)"; - }; - 1895FF33065E291B00F8B3F4 = { - containerPortal = 0654BA41FE8ECEE0C697A12F; - isa = PBXContainerItemProxy; - proxyType = 1; - remoteGlobalIDString = 0654BA5CFE8ECEE0C697A12F; - remoteInfo = "Quake3 (Application)"; - }; - 18A3D355065F6636006A719A = { - containerPortal = 0654BA41FE8ECEE0C697A12F; - isa = PBXContainerItemProxy; - proxyType = 1; - remoteGlobalIDString = 00F5ED38FEBA95B7C697A12F; - remoteInfo = qagame; - }; - 18A3D356065F6636006A719A = { - isa = PBXTargetDependency; - target = 00F5ED38FEBA95B7C697A12F; - targetProxy = 18A3D355065F6636006A719A; - }; - 18A3D357065F663A006A719A = { - containerPortal = 0654BA41FE8ECEE0C697A12F; - isa = PBXContainerItemProxy; - proxyType = 1; - remoteGlobalIDString = 00F5ED90FEBA9615C697A12F; - remoteInfo = cgame; - }; - 18A3D358065F663A006A719A = { - isa = PBXTargetDependency; - target = 00F5ED90FEBA9615C697A12F; - targetProxy = 18A3D357065F663A006A719A; - }; - 18A3D359065F663F006A719A = { - containerPortal = 0654BA41FE8ECEE0C697A12F; - isa = PBXContainerItemProxy; - proxyType = 1; - remoteGlobalIDString = 016EAE0300B4BDD1C697A10E; - remoteInfo = ui; - }; - 18A3D35A065F663F006A719A = { - isa = PBXTargetDependency; - target = 016EAE0300B4BDD1C697A10E; - targetProxy = 18A3D359065F663F006A719A; - }; -//180 -//181 -//182 -//183 -//184 -//4F0 -//4F1 -//4F2 -//4F3 -//4F4 - 4FB23863047AB9F60098ACF3 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.c; - path = vm_ppc_new.c; - refType = 4; - sourceTree = ""; - }; - 4FB23865047AB9F60098ACF3 = { - fileRef = 4FB23863047AB9F60098ACF3; - isa = PBXBuildFile; - settings = { - }; - }; - 4FB23867047ABF780098ACF3 = { - fileRef = 4FB23863047AB9F60098ACF3; - isa = PBXBuildFile; - settings = { - }; - }; - 4FEFFEDA047B008000719638 = { - fileRef = 012ADAF100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0904804896C0E00030DA8 = { - buildPhases = ( - 4FF0904904896C0E00030DA8, - 4FF0908704896C0E00030DA8, - 4FF0908B04896C0E00030DA8, - 4FF0911D04896C0E00030DA8, - 4FF0912404896C0E00030DA8, - ); - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ""; - GCC_VERSION = 3.3; - HEADER_SEARCH_PATHS = ""; - INSTALL_PATH = "/Users/Shared/$(USER)/InstalledProducts"; - LIBRARY_SEARCH_PATHS = "\"/Users/zaphod/QUAKE3/CODE/macosx/GameRanger SDK/Libraries\""; - OPTIMIZATION_CFLAGS = "-O2"; - OTHER_CFLAGS = "-DMACOS_X -DBOTLIB -DMISSIONPACK -DSMP -force_cpusubtype_ALL -faltivec"; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = "Quake3 G4"; - SECTORDER_FLAGS = ""; - USE_GCC3_PFE_SUPPORT = NO; - WARNING_CFLAGS = "-Wno-long-double -Wall -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = app; - }; - dependencies = ( - ); - isa = PBXApplicationTarget; - name = "Quake3 G4 (Application)"; - productInstallPath = "/Users/Shared/$(USER)/InstalledProducts"; - productName = Quake3; - productReference = 4FF0912504896C0E00030DA8; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - Quake3 G4 - CFBundleGetInfoString - Quake 3 Arena 1.3.2 - CFBundleIconFile - Quake3.icns - CFBundleIdentifier - com.idsoftware.Quake3 - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Quake3 - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.3.2 - CFBundleSignature - IDQ3 - CFBundleVersion - 1.3.2 - NSExtensions - - NSMainNibFile - Quake3.nib - NSPrincipalClass - NSApplication - NSServices - - - NSMenuItem - - default - Quake3/Connect To Server - - NSMessage - connectToServer - NSPortName - Quake3 - NSSendTypes - - NSStringPboardType - - - - NSMenuItem - - default - Quake3/Perform Command - - NSMessage - performCommand - NSPortName - Quake3 - NSSendTypes - - NSStringPboardType - - - - - -"; - }; - 4FF0904904896C0E00030DA8 = { - buildActionMask = 2147483647; - files = ( - 4FF0904A04896C0E00030DA8, - 4FF0904B04896C0E00030DA8, - 4FF0904C04896C0E00030DA8, - 4FF0904D04896C0E00030DA8, - 4FF0904E04896C0E00030DA8, - 4FF0904F04896C0E00030DA8, - 4FF0905004896C0E00030DA8, - 4FF0905104896C0E00030DA8, - 4FF0905204896C0E00030DA8, - 4FF0905304896C0E00030DA8, - 4FF0905404896C0E00030DA8, - 4FF0905504896C0E00030DA8, - 4FF0905604896C0E00030DA8, - 4FF0905704896C0E00030DA8, - 4FF0905804896C0E00030DA8, - 4FF0905904896C0E00030DA8, - 4FF0905A04896C0E00030DA8, - 4FF0905B04896C0E00030DA8, - 4FF0905C04896C0E00030DA8, - 4FF0905D04896C0E00030DA8, - 4FF0905E04896C0E00030DA8, - 4FF0905F04896C0E00030DA8, - 4FF0906004896C0E00030DA8, - 4FF0906104896C0E00030DA8, - 4FF0906204896C0E00030DA8, - 4FF0906304896C0E00030DA8, - 4FF0906404896C0E00030DA8, - 4FF0906504896C0E00030DA8, - 4FF0906604896C0E00030DA8, - 4FF0906704896C0E00030DA8, - 4FF0906804896C0E00030DA8, - 4FF0906904896C0E00030DA8, - 4FF0906A04896C0E00030DA8, - 4FF0906B04896C0E00030DA8, - 4FF0906C04896C0E00030DA8, - 4FF0906D04896C0E00030DA8, - 4FF0906E04896C0E00030DA8, - 4FF0906F04896C0E00030DA8, - 4FF0907004896C0E00030DA8, - 4FF0907104896C0E00030DA8, - 4FF0907204896C0E00030DA8, - 4FF0907304896C0E00030DA8, - 4FF0907404896C0E00030DA8, - 4FF0907504896C0E00030DA8, - 4FF0907604896C0E00030DA8, - 4FF0907704896C0E00030DA8, - 4FF0907804896C0E00030DA8, - 4FF0907904896C0E00030DA8, - 4FF0907A04896C0E00030DA8, - 4FF0907B04896C0E00030DA8, - 4FF0907C04896C0E00030DA8, - 4FF0907D04896C0E00030DA8, - 4FF0907E04896C0E00030DA8, - 4FF0907F04896C0E00030DA8, - 4FF0908604896C0E00030DA8, - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 4FF0904A04896C0E00030DA8 = { - fileRef = 043627A600868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0904B04896C0E00030DA8 = { - fileRef = 043627A900868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0904C04896C0E00030DA8 = { - fileRef = 043627AE00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0904D04896C0E00030DA8 = { - fileRef = 043627B000868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0904E04896C0E00030DA8 = { - fileRef = 012ADA6200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0904F04896C0E00030DA8 = { - fileRef = 012ADB0300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905004896C0E00030DA8 = { - fileRef = 012ADB0000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905104896C0E00030DA8 = { - fileRef = 012ADAEE00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905204896C0E00030DA8 = { - fileRef = 012ADAF000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905304896C0E00030DA8 = { - fileRef = 012ADAF200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905404896C0E00030DA8 = { - fileRef = 012ADAF300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905504896C0E00030DA8 = { - fileRef = 012ADAFD00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905604896C0E00030DA8 = { - fileRef = 012ADAFE00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905704896C0E00030DA8 = { - fileRef = 012ADB0800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905804896C0E00030DA8 = { - fileRef = 012ADB0900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905904896C0E00030DA8 = { - fileRef = 012ADB1400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905A04896C0E00030DA8 = { - fileRef = 012ADB1A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905B04896C0E00030DA8 = { - fileRef = 012ADB2400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905C04896C0E00030DA8 = { - fileRef = 012AD9B000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905D04896C0E00030DA8 = { - fileRef = 012AD9B100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905E04896C0E00030DA8 = { - fileRef = 012AD9B400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0905F04896C0E00030DA8 = { - fileRef = 012AD9B700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906004896C0E00030DA8 = { - fileRef = 012ADB3F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906104896C0E00030DA8 = { - fileRef = 012ADA8C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906204896C0E00030DA8 = { - fileRef = 012ADA9B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906304896C0E00030DA8 = { - fileRef = 012ADA6C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906404896C0E00030DA8 = { - fileRef = 012ADA8100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906504896C0E00030DA8 = { - fileRef = 012AD93700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906604896C0E00030DA8 = { - fileRef = 012AD93100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906704896C0E00030DA8 = { - fileRef = 012AD93900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906804896C0E00030DA8 = { - fileRef = 012AD93500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906904896C0E00030DA8 = { - fileRef = 012AD93300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906A04896C0E00030DA8 = { - fileRef = 012AD91E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906B04896C0E00030DA8 = { - fileRef = 012AD91800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906C04896C0E00030DA8 = { - fileRef = 012AD92200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906D04896C0E00030DA8 = { - fileRef = 012AD90900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906E04896C0E00030DA8 = { - fileRef = 012AD90E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0906F04896C0E00030DA8 = { - fileRef = 012AD91C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907004896C0E00030DA8 = { - fileRef = 012AD91600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907104896C0E00030DA8 = { - fileRef = 012AD92A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907204896C0E00030DA8 = { - fileRef = 012AD91A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907304896C0E00030DA8 = { - fileRef = 012AD92000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907404896C0E00030DA8 = { - fileRef = 012AD93B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907504896C0E00030DA8 = { - fileRef = 012AD92D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907604896C0E00030DA8 = { - fileRef = 012AD92F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907704896C0E00030DA8 = { - fileRef = 012AD93C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907804896C0E00030DA8 = { - fileRef = 012AD91300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907904896C0E00030DA8 = { - fileRef = 012AD91100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907A04896C0E00030DA8 = { - fileRef = 012AD90C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907B04896C0E00030DA8 = { - fileRef = 012AD90F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907C04896C0E00030DA8 = { - fileRef = 012AD91400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907D04896C0E00030DA8 = { - fileRef = 012AD90800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907E04896C0E00030DA8 = { - fileRef = 015ECC0C00894EC0C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0907F04896C0E00030DA8 = { - fileRef = 011F78F200B25B65C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0908604896C0E00030DA8 = { - fileRef = F5ED1435037096A001F6289A; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0908704896C0E00030DA8 = { - buildActionMask = 2147483647; - files = ( - 4FF0908804896C0E00030DA8, - 4FF0908904896C0E00030DA8, - 4FF0908A04896C0E00030DA8, - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 4FF0908804896C0E00030DA8 = { - fileRef = 043627B300868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0908904896C0E00030DA8 = { - fileRef = 043627B200868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0908A04896C0E00030DA8 = { - fileRef = 043627B400868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0908B04896C0E00030DA8 = { - buildActionMask = 2147483647; - files = ( - 4FF0908C04896C0E00030DA8, - 4FF0908D04896C0E00030DA8, - 4FF0908E04896C0E00030DA8, - 4FF0908F04896C0E00030DA8, - 4FF0909004896C0E00030DA8, - 4FF0909104896C0E00030DA8, - 4FF0909204896C0E00030DA8, - 4FF0909304896C0E00030DA8, - 4FF0909404896C0E00030DA8, - 4FF0909504896C0E00030DA8, - 4FF0909604896C0E00030DA8, - 4FF0909704896C0E00030DA8, - 4FF0909804896C0E00030DA8, - 4FF0909904896C0E00030DA8, - 4FF0909A04896C0E00030DA8, - 4FF0909B04896C0E00030DA8, - 4FF0909C04896C0E00030DA8, - 4FF0909D04896C0E00030DA8, - 4FF0909E04896C0E00030DA8, - 4FF0909F04896C0E00030DA8, - 4FF090A004896C0E00030DA8, - 4FF090A104896C0E00030DA8, - 4FF090A204896C0E00030DA8, - 4FF090A304896C0E00030DA8, - 4FF090A404896C0E00030DA8, - 4FF090A504896C0E00030DA8, - 4FF090A604896C0E00030DA8, - 4FF090A704896C0E00030DA8, - 4FF090A804896C0E00030DA8, - 4FF090A904896C0E00030DA8, - 4FF090AA04896C0E00030DA8, - 4FF090AB04896C0E00030DA8, - 4FF090AC04896C0E00030DA8, - 4FF090AD04896C0E00030DA8, - 4FF090AE04896C0E00030DA8, - 4FF090AF04896C0E00030DA8, - 4FF090B004896C0E00030DA8, - 4FF090B104896C0E00030DA8, - 4FF090B204896C0E00030DA8, - 4FF090B304896C0E00030DA8, - 4FF090B404896C0E00030DA8, - 4FF090B504896C0E00030DA8, - 4FF090B604896C0E00030DA8, - 4FF090B704896C0E00030DA8, - 4FF090B804896C0E00030DA8, - 4FF090B904896C0E00030DA8, - 4FF090BA04896C0E00030DA8, - 4FF090BB04896C0E00030DA8, - 4FF090BC04896C0E00030DA8, - 4FF090BD04896C0E00030DA8, - 4FF090BE04896C0E00030DA8, - 4FF090BF04896C0E00030DA8, - 4FF090C004896C0E00030DA8, - 4FF090C104896C0E00030DA8, - 4FF090C204896C0E00030DA8, - 4FF090C304896C0E00030DA8, - 4FF090C404896C0E00030DA8, - 4FF090C504896C0E00030DA8, - 4FF090C604896C0E00030DA8, - 4FF090C704896C0E00030DA8, - 4FF090C804896C0E00030DA8, - 4FF090C904896C0E00030DA8, - 4FF090CA04896C0E00030DA8, - 4FF090CB04896C0E00030DA8, - 4FF090CC04896C0E00030DA8, - 4FF090CD04896C0E00030DA8, - 4FF090CE04896C0E00030DA8, - 4FF090CF04896C0E00030DA8, - 4FF090D004896C0E00030DA8, - 4FF090D104896C0E00030DA8, - 4FF090D204896C0E00030DA8, - 4FF090D304896C0E00030DA8, - 4FF090D404896C0E00030DA8, - 4FF090D504896C0E00030DA8, - 4FF090D604896C0E00030DA8, - 4FF090D704896C0E00030DA8, - 4FF090D804896C0E00030DA8, - 4FF090D904896C0E00030DA8, - 4FF090DA04896C0E00030DA8, - 4FF090DB04896C0E00030DA8, - 4FF090DC04896C0E00030DA8, - 4FF090DD04896C0E00030DA8, - 4FF090DE04896C0E00030DA8, - 4FF090DF04896C0E00030DA8, - 4FF090E004896C0E00030DA8, - 4FF090E104896C0E00030DA8, - 4FF090E204896C0E00030DA8, - 4FF090E304896C0E00030DA8, - 4FF090E404896C0E00030DA8, - 4FF090E504896C0E00030DA8, - 4FF090E604896C0E00030DA8, - 4FF090E704896C0E00030DA8, - 4FF090E804896C0E00030DA8, - 4FF090E904896C0E00030DA8, - 4FF090EA04896C0E00030DA8, - 4FF090EB04896C0E00030DA8, - 4FF090EC04896C0E00030DA8, - 4FF090ED04896C0E00030DA8, - 4FF090EE04896C0E00030DA8, - 4FF090EF04896C0E00030DA8, - 4FF090F004896C0E00030DA8, - 4FF090F104896C0E00030DA8, - 4FF090F204896C0E00030DA8, - 4FF090F304896C0E00030DA8, - 4FF090F404896C0E00030DA8, - 4FF090F504896C0E00030DA8, - 4FF090F604896C0E00030DA8, - 4FF090F704896C0E00030DA8, - 4FF090F804896C0E00030DA8, - 4FF090F904896C0E00030DA8, - 4FF090FA04896C0E00030DA8, - 4FF090FB04896C0E00030DA8, - 4FF090FC04896C0E00030DA8, - 4FF090FD04896C0E00030DA8, - 4FF090FE04896C0E00030DA8, - 4FF090FF04896C0E00030DA8, - 4FF0910004896C0E00030DA8, - 4FF0910104896C0E00030DA8, - 4FF0910204896C0E00030DA8, - 4FF0910304896C0E00030DA8, - 4FF0910404896C0E00030DA8, - 4FF0910504896C0E00030DA8, - 4FF0910604896C0E00030DA8, - 4FF0910704896C0E00030DA8, - 4FF0910804896C0E00030DA8, - 4FF0910904896C0E00030DA8, - 4FF0910A04896C0E00030DA8, - 4FF0910B04896C0E00030DA8, - 4FF0910C04896C0E00030DA8, - 4FF0910D04896C0E00030DA8, - 4FF0910E04896C0E00030DA8, - 4FF0910F04896C0E00030DA8, - 4FF0911004896C0E00030DA8, - 4FF0911104896C0E00030DA8, - 4FF0911204896C0E00030DA8, - 4FF0911304896C0E00030DA8, - 4FF0911404896C0E00030DA8, - 4FF0911504896C0E00030DA8, - 4FF0911B04896C0E00030DA8, - 4FF0911C04896C0E00030DA8, - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 4FF0908C04896C0E00030DA8 = { - fileRef = 043627A700868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0908D04896C0E00030DA8 = { - fileRef = 043627A800868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0908E04896C0E00030DA8 = { - fileRef = 043627AB00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0908F04896C0E00030DA8 = { - fileRef = 043627AD00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909004896C0E00030DA8 = { - fileRef = 043627AF00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909104896C0E00030DA8 = { - fileRef = 043627B100868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909204896C0E00030DA8 = { - fileRef = 012ADAF600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909304896C0E00030DA8 = { - fileRef = 012ADA6100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909404896C0E00030DA8 = { - fileRef = 012ADA6000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909504896C0E00030DA8 = { - fileRef = 012ADB1200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909604896C0E00030DA8 = { - fileRef = 012ADAF700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909704896C0E00030DA8 = { - fileRef = 012ADAF800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909804896C0E00030DA8 = { - fileRef = 012ADAF900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909904896C0E00030DA8 = { - fileRef = 012ADB0100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909A04896C0E00030DA8 = { - fileRef = 012ADB0200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909B04896C0E00030DA8 = { - fileRef = 012ADAFF00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909C04896C0E00030DA8 = { - fileRef = 012ADB5800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909D04896C0E00030DA8 = { - fileRef = 012AD9A600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909E04896C0E00030DA8 = { - fileRef = 012AD9A700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0909F04896C0E00030DA8 = { - fileRef = 012AD9A800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090A004896C0E00030DA8 = { - fileRef = 012AD9A900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090A104896C0E00030DA8 = { - fileRef = 012AD9AA00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090A204896C0E00030DA8 = { - fileRef = 012AD9AB00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090A304896C0E00030DA8 = { - fileRef = 012AD9AC00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090A404896C0E00030DA8 = { - fileRef = 012AD9AD00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090A504896C0E00030DA8 = { - fileRef = 012AD9AE00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090A604896C0E00030DA8 = { - fileRef = 012AD9AF00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090A704896C0E00030DA8 = { - fileRef = 012ADAED00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090A804896C0E00030DA8 = { - fileRef = 012ADAEF00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090A904896C0E00030DA8 = { - fileRef = 012ADAF400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090AA04896C0E00030DA8 = { - fileRef = 012ADAF500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090AB04896C0E00030DA8 = { - fileRef = 012ADAFA00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090AC04896C0E00030DA8 = { - fileRef = 012ADAFB00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090AD04896C0E00030DA8 = { - fileRef = 012ADAFC00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090AE04896C0E00030DA8 = { - fileRef = 012ADB0A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090AF04896C0E00030DA8 = { - fileRef = 012ADB0B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090B004896C0E00030DA8 = { - fileRef = 012ADB0C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090B104896C0E00030DA8 = { - fileRef = 012ADB0D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090B204896C0E00030DA8 = { - fileRef = 012ADB0E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090B304896C0E00030DA8 = { - fileRef = 012ADB0F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090B404896C0E00030DA8 = { - fileRef = 012ADB1000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090B504896C0E00030DA8 = { - fileRef = 012ADB1100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090B604896C0E00030DA8 = { - fileRef = 012ADB1300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090B704896C0E00030DA8 = { - fileRef = 012ADB1500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090B804896C0E00030DA8 = { - fileRef = 012ADB1600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090B904896C0E00030DA8 = { - fileRef = 012ADB1700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090BA04896C0E00030DA8 = { - fileRef = 012ADB1800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090BB04896C0E00030DA8 = { - fileRef = 012ADB1900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090BC04896C0E00030DA8 = { - fileRef = 012ADB1B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090BD04896C0E00030DA8 = { - fileRef = 012ADB1C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090BE04896C0E00030DA8 = { - fileRef = 012ADB1D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090BF04896C0E00030DA8 = { - fileRef = 012ADB1E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090C004896C0E00030DA8 = { - fileRef = 012ADB1F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090C104896C0E00030DA8 = { - fileRef = 012ADB2000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090C204896C0E00030DA8 = { - fileRef = 012ADB2100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090C304896C0E00030DA8 = { - fileRef = 012ADB2200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090C404896C0E00030DA8 = { - fileRef = 012ADB2500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090C504896C0E00030DA8 = { - fileRef = 012ADB2600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090C604896C0E00030DA8 = { - fileRef = 012ADB2700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090C704896C0E00030DA8 = { - fileRef = 012ADB2800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090C804896C0E00030DA8 = { - fileRef = 012ADB2900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090C904896C0E00030DA8 = { - fileRef = 012ADB2A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090CA04896C0E00030DA8 = { - fileRef = 012ADB2B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090CB04896C0E00030DA8 = { - fileRef = 012ADB2D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090CC04896C0E00030DA8 = { - fileRef = 012ADB2E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090CD04896C0E00030DA8 = { - fileRef = 012ADB5700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090CE04896C0E00030DA8 = { - fileRef = 012AD9B200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090CF04896C0E00030DA8 = { - fileRef = 012AD9B300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090D004896C0E00030DA8 = { - fileRef = 012AD9B500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090D104896C0E00030DA8 = { - fileRef = 012AD9B600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090D204896C0E00030DA8 = { - fileRef = 012AD9B800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090D304896C0E00030DA8 = { - fileRef = 012ADB3B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090D404896C0E00030DA8 = { - fileRef = 012ADB3800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090D504896C0E00030DA8 = { - fileRef = 012ADB3E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090D604896C0E00030DA8 = { - fileRef = 012ADA9800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090D704896C0E00030DA8 = { - fileRef = 012ADA9600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090D804896C0E00030DA8 = { - fileRef = 012ADA8B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090D904896C0E00030DA8 = { - fileRef = 012ADA6600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090DA04896C0E00030DA8 = { - fileRef = 012ADA7100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090DB04896C0E00030DA8 = { - fileRef = 012ADAA200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090DC04896C0E00030DA8 = { - fileRef = 012ADA6F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090DD04896C0E00030DA8 = { - fileRef = 012ADA7900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090DE04896C0E00030DA8 = { - fileRef = 012ADA6D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090DF04896C0E00030DA8 = { - fileRef = 012ADA7400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090E004896C0E00030DA8 = { - fileRef = 012ADA6B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090E104896C0E00030DA8 = { - fileRef = 012ADA6A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090E204896C0E00030DA8 = { - fileRef = 012ADA7600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090E304896C0E00030DA8 = { - fileRef = 012ADA6900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090E404896C0E00030DA8 = { - fileRef = 012ADA7500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090E504896C0E00030DA8 = { - fileRef = 012ADA6800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090E604896C0E00030DA8 = { - fileRef = 012ADA8D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090E704896C0E00030DA8 = { - fileRef = 012ADA7000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090E804896C0E00030DA8 = { - fileRef = 012ADA8500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090E904896C0E00030DA8 = { - fileRef = 012ADA7800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090EA04896C0E00030DA8 = { - fileRef = 012ADA8400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090EB04896C0E00030DA8 = { - fileRef = 012ADA8200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090EC04896C0E00030DA8 = { - fileRef = 012ADA8900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090ED04896C0E00030DA8 = { - fileRef = 012ADA7F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090EE04896C0E00030DA8 = { - fileRef = 012ADA8000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090EF04896C0E00030DA8 = { - fileRef = 012ADA9000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090F004896C0E00030DA8 = { - fileRef = 012ADA8800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090F104896C0E00030DA8 = { - fileRef = 012ADA7300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090F204896C0E00030DA8 = { - fileRef = 012ADA7B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090F304896C0E00030DA8 = { - fileRef = 012ADA8300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090F404896C0E00030DA8 = { - fileRef = 012ADA7C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090F504896C0E00030DA8 = { - fileRef = 012ADA7D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090F604896C0E00030DA8 = { - fileRef = 012ADA6E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090F704896C0E00030DA8 = { - fileRef = 012AD92C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090F804896C0E00030DA8 = { - fileRef = 012AD92400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090F904896C0E00030DA8 = { - fileRef = 012AD93600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090FA04896C0E00030DA8 = { - fileRef = 012AD93000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090FB04896C0E00030DA8 = { - fileRef = 012AD93800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090FC04896C0E00030DA8 = { - fileRef = 012AD93400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090FD04896C0E00030DA8 = { - fileRef = 012AD93200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090FE04896C0E00030DA8 = { - fileRef = 012AD92500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF090FF04896C0E00030DA8 = { - fileRef = 012AD92B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910004896C0E00030DA8 = { - fileRef = 012AD92300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910104896C0E00030DA8 = { - fileRef = 012AD92700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910204896C0E00030DA8 = { - fileRef = 012AD91D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910304896C0E00030DA8 = { - fileRef = 012AD91700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910404896C0E00030DA8 = { - fileRef = 012AD92100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910504896C0E00030DA8 = { - fileRef = 012AD90A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910604896C0E00030DA8 = { - fileRef = 012AD90D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910704896C0E00030DA8 = { - fileRef = 012AD91B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910804896C0E00030DA8 = { - fileRef = 012AD91500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910904896C0E00030DA8 = { - fileRef = 012AD92600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910A04896C0E00030DA8 = { - fileRef = 012AD92900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910B04896C0E00030DA8 = { - fileRef = 012AD91900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910C04896C0E00030DA8 = { - fileRef = 012AD91F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910D04896C0E00030DA8 = { - fileRef = 012AD93A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910E04896C0E00030DA8 = { - fileRef = 012AD92E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0910F04896C0E00030DA8 = { - fileRef = 012AD92800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0911004896C0E00030DA8 = { - fileRef = 012AD91200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0911104896C0E00030DA8 = { - fileRef = 012AD91000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0911204896C0E00030DA8 = { - fileRef = 012AD90B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0911304896C0E00030DA8 = { - fileRef = 015ECC0D00894EC0C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0911404896C0E00030DA8 = { - fileRef = 016B4A3B00ACCF9FC697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0911504896C0E00030DA8 = { - fileRef = 016F1B6300ACDA9BC697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0911B04896C0E00030DA8 = { - fileRef = 4FB23863047AB9F60098ACF3; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0911C04896C0E00030DA8 = { - fileRef = 012ADAF100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0911D04896C0E00030DA8 = { - buildActionMask = 2147483647; - files = ( - 4FF0911E04896C0E00030DA8, - 4FF0911F04896C0E00030DA8, - 4FF0912004896C0E00030DA8, - 4FF0912104896C0E00030DA8, - 4FF0912204896C0E00030DA8, - 4FF0912304896C0E00030DA8, - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 4FF0911E04896C0E00030DA8 = { - fileRef = 0654BA58FE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0911F04896C0E00030DA8 = { - fileRef = 0654BA5AFE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912004896C0E00030DA8 = { - fileRef = 0654BA5BFE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912104896C0E00030DA8 = { - fileRef = 00E9D914FEDB4D29C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912204896C0E00030DA8 = { - fileRef = F564505801E623B201F62882; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912304896C0E00030DA8 = { - fileRef = 0654BA59FE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912404896C0E00030DA8 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 4FF0912504896C0E00030DA8 = { - explicitFileType = wrapper.application; - isa = PBXFileReference; - path = "Quake3 G4.app"; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4FF0912704896C1600030DA8 = { - buildPhases = ( - 4FF0912804896C1600030DA8, - 4FF0915C04896C1600030DA8, - 4FF091E004896C1600030DA8, - 4FF091E704896C1600030DA8, - ); - buildSettings = { - DEBUGGING_SYMBOLS = NO; - GCC_VERSION = 3.3; - INSTALL_PATH = ""; - LIBRARY_SEARCH_PATHS = "\"/Users/zaphod/Quake3/code/macosx/GameRanger SDK/Libraries\""; - OPTIMIZATION_CFLAGS = "-O2"; - OTHER_CFLAGS = "-DMACOS_X -DBOTLIB -DMISSIONPACK -DSMP -force_cpusubtype_ALL -faltivec -falign-loops=16 -falign-jumps=16 -fstrict-aliasing "; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = Q3DedicatedServer; - REZ_EXECUTABLE = YES; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - }; - dependencies = ( - ); - isa = PBXToolTarget; - name = "Dedicated Server G4"; - productInstallPath = ""; - productName = "Dedicated Server"; - productReference = 4FF091E804896C1600030DA8; - }; - 4FF0912804896C1600030DA8 = { - buildActionMask = 2147483647; - files = ( - 4FF0912904896C1600030DA8, - 4FF0912A04896C1600030DA8, - 4FF0912B04896C1600030DA8, - 4FF0912C04896C1600030DA8, - 4FF0912D04896C1600030DA8, - 4FF0912E04896C1600030DA8, - 4FF0912F04896C1600030DA8, - 4FF0913004896C1600030DA8, - 4FF0913104896C1600030DA8, - 4FF0913204896C1600030DA8, - 4FF0913304896C1600030DA8, - 4FF0913404896C1600030DA8, - 4FF0913504896C1600030DA8, - 4FF0913604896C1600030DA8, - 4FF0913704896C1600030DA8, - 4FF0913804896C1600030DA8, - 4FF0913904896C1600030DA8, - 4FF0913A04896C1600030DA8, - 4FF0913B04896C1600030DA8, - 4FF0913C04896C1600030DA8, - 4FF0913D04896C1600030DA8, - 4FF0913E04896C1600030DA8, - 4FF0913F04896C1600030DA8, - 4FF0914004896C1600030DA8, - 4FF0914104896C1600030DA8, - 4FF0914204896C1600030DA8, - 4FF0914304896C1600030DA8, - 4FF0914404896C1600030DA8, - 4FF0914504896C1600030DA8, - 4FF0914604896C1600030DA8, - 4FF0914704896C1600030DA8, - 4FF0914804896C1600030DA8, - 4FF0914904896C1600030DA8, - 4FF0914A04896C1600030DA8, - 4FF0914B04896C1600030DA8, - 4FF0914C04896C1600030DA8, - 4FF0914D04896C1600030DA8, - 4FF0914E04896C1600030DA8, - 4FF0914F04896C1600030DA8, - 4FF0915004896C1600030DA8, - 4FF0915104896C1600030DA8, - 4FF0915204896C1600030DA8, - 4FF0915304896C1600030DA8, - 4FF0915404896C1600030DA8, - 4FF0915604896C1600030DA8, - 4FF0915704896C1600030DA8, - 4FF0915804896C1600030DA8, - 4FF0915904896C1600030DA8, - 4FF0915A04896C1600030DA8, - 4FF0915B04896C1600030DA8, - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 4FF0912904896C1600030DA8 = { - fileRef = 012ADB0300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912A04896C1600030DA8 = { - fileRef = 012ADB0000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912B04896C1600030DA8 = { - fileRef = 012ADAFE00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912C04896C1600030DA8 = { - fileRef = 012ADAFD00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912D04896C1600030DA8 = { - fileRef = 012ADAF300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912E04896C1600030DA8 = { - fileRef = 012ADAF200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0912F04896C1600030DA8 = { - fileRef = 012ADAF000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913004896C1600030DA8 = { - fileRef = 012ADAEE00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913104896C1600030DA8 = { - fileRef = 012ADB2400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913204896C1600030DA8 = { - fileRef = 012ADB3F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913304896C1600030DA8 = { - fileRef = 012ADB1400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913404896C1600030DA8 = { - fileRef = 012ADB1A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913504896C1600030DA8 = { - fileRef = 012ADB0800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913604896C1600030DA8 = { - fileRef = 012ADB0900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913704896C1600030DA8 = { - fileRef = 012ADA6C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913804896C1600030DA8 = { - fileRef = 012ADA8100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913904896C1600030DA8 = { - fileRef = 012ADA8C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913A04896C1600030DA8 = { - fileRef = 012ADA9B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913B04896C1600030DA8 = { - fileRef = 012ADA6200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913C04896C1600030DA8 = { - fileRef = 012AD90800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913D04896C1600030DA8 = { - fileRef = 012AD90900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913E04896C1600030DA8 = { - fileRef = 012AD90C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0913F04896C1600030DA8 = { - fileRef = 012AD90E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914004896C1600030DA8 = { - fileRef = 012AD90F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914104896C1600030DA8 = { - fileRef = 012AD91100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914204896C1600030DA8 = { - fileRef = 012AD91300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914304896C1600030DA8 = { - fileRef = 012AD91400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914404896C1600030DA8 = { - fileRef = 012AD91600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914504896C1600030DA8 = { - fileRef = 012AD91800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914604896C1600030DA8 = { - fileRef = 012AD91A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914704896C1600030DA8 = { - fileRef = 012AD91C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914804896C1600030DA8 = { - fileRef = 012AD91E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914904896C1600030DA8 = { - fileRef = 012AD92000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914A04896C1600030DA8 = { - fileRef = 012AD92200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914B04896C1600030DA8 = { - fileRef = 012AD92A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914C04896C1600030DA8 = { - fileRef = 012AD92D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914D04896C1600030DA8 = { - fileRef = 012AD92F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914E04896C1600030DA8 = { - fileRef = 012AD93100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0914F04896C1600030DA8 = { - fileRef = 012AD93300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915004896C1600030DA8 = { - fileRef = 012AD93500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915104896C1600030DA8 = { - fileRef = 012AD93700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915204896C1600030DA8 = { - fileRef = 012AD93900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915304896C1600030DA8 = { - fileRef = 012AD93B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915404896C1600030DA8 = { - fileRef = 012AD93C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915604896C1600030DA8 = { - fileRef = 015ECC0C00894EC0C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915704896C1600030DA8 = { - fileRef = 011F78F200B25B65C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915804896C1600030DA8 = { - fileRef = 043627A600868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915904896C1600030DA8 = { - fileRef = 043627A900868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915A04896C1600030DA8 = { - fileRef = 043627B000868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915B04896C1600030DA8 = { - fileRef = 043627AE00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915C04896C1600030DA8 = { - buildActionMask = 2147483647; - files = ( - 4FF0915E04896C1600030DA8, - 4FF0915F04896C1600030DA8, - 4FF0916004896C1600030DA8, - 4FF0916104896C1600030DA8, - 4FF0916204896C1600030DA8, - 4FF0916304896C1600030DA8, - 4FF0916404896C1600030DA8, - 4FF0916504896C1600030DA8, - 4FF0916604896C1600030DA8, - 4FF0916704896C1600030DA8, - 4FF0916804896C1600030DA8, - 4FF0916904896C1600030DA8, - 4FF0916A04896C1600030DA8, - 4FF0916B04896C1600030DA8, - 4FF0916C04896C1600030DA8, - 4FF0916D04896C1600030DA8, - 4FF0916E04896C1600030DA8, - 4FF0916F04896C1600030DA8, - 4FF0917004896C1600030DA8, - 4FF0917104896C1600030DA8, - 4FF0917204896C1600030DA8, - 4FF0917304896C1600030DA8, - 4FF0917404896C1600030DA8, - 4FF0917504896C1600030DA8, - 4FF0917604896C1600030DA8, - 4FF0917704896C1600030DA8, - 4FF0917804896C1600030DA8, - 4FF0917904896C1600030DA8, - 4FF0917A04896C1600030DA8, - 4FF0917B04896C1600030DA8, - 4FF0917C04896C1600030DA8, - 4FF0917D04896C1600030DA8, - 4FF0917E04896C1600030DA8, - 4FF0917F04896C1600030DA8, - 4FF0918004896C1600030DA8, - 4FF0918104896C1600030DA8, - 4FF0918204896C1600030DA8, - 4FF0918304896C1600030DA8, - 4FF0918404896C1600030DA8, - 4FF0918504896C1600030DA8, - 4FF0918604896C1600030DA8, - 4FF0918704896C1600030DA8, - 4FF0918804896C1600030DA8, - 4FF0918904896C1600030DA8, - 4FF0918A04896C1600030DA8, - 4FF0918B04896C1600030DA8, - 4FF0918C04896C1600030DA8, - 4FF0918D04896C1600030DA8, - 4FF0918E04896C1600030DA8, - 4FF0918F04896C1600030DA8, - 4FF0919004896C1600030DA8, - 4FF0919104896C1600030DA8, - 4FF0919204896C1600030DA8, - 4FF0919304896C1600030DA8, - 4FF0919404896C1600030DA8, - 4FF0919504896C1600030DA8, - 4FF0919604896C1600030DA8, - 4FF0919704896C1600030DA8, - 4FF0919804896C1600030DA8, - 4FF0919904896C1600030DA8, - 4FF0919A04896C1600030DA8, - 4FF0919B04896C1600030DA8, - 4FF0919C04896C1600030DA8, - 4FF0919D04896C1600030DA8, - 4FF0919E04896C1600030DA8, - 4FF0919F04896C1600030DA8, - 4FF091A004896C1600030DA8, - 4FF091A104896C1600030DA8, - 4FF091A204896C1600030DA8, - 4FF091A304896C1600030DA8, - 4FF091A404896C1600030DA8, - 4FF091A504896C1600030DA8, - 4FF091A604896C1600030DA8, - 4FF091A704896C1600030DA8, - 4FF091A804896C1600030DA8, - 4FF091A904896C1600030DA8, - 4FF091AA04896C1600030DA8, - 4FF091AB04896C1600030DA8, - 4FF091AC04896C1600030DA8, - 4FF091AD04896C1600030DA8, - 4FF091AE04896C1600030DA8, - 4FF091AF04896C1600030DA8, - 4FF091B004896C1600030DA8, - 4FF091B104896C1600030DA8, - 4FF091B204896C1600030DA8, - 4FF091B304896C1600030DA8, - 4FF091B404896C1600030DA8, - 4FF091B504896C1600030DA8, - 4FF091B604896C1600030DA8, - 4FF091B704896C1600030DA8, - 4FF091B804896C1600030DA8, - 4FF091B904896C1600030DA8, - 4FF091BA04896C1600030DA8, - 4FF091BB04896C1600030DA8, - 4FF091BC04896C1600030DA8, - 4FF091BD04896C1600030DA8, - 4FF091BE04896C1600030DA8, - 4FF091BF04896C1600030DA8, - 4FF091C004896C1600030DA8, - 4FF091C104896C1600030DA8, - 4FF091C204896C1600030DA8, - 4FF091C304896C1600030DA8, - 4FF091C404896C1600030DA8, - 4FF091C504896C1600030DA8, - 4FF091C604896C1600030DA8, - 4FF091C704896C1600030DA8, - 4FF091C804896C1600030DA8, - 4FF091C904896C1600030DA8, - 4FF091CA04896C1600030DA8, - 4FF091CB04896C1600030DA8, - 4FF091CC04896C1600030DA8, - 4FF091CD04896C1600030DA8, - 4FF091CE04896C1600030DA8, - 4FF091CF04896C1600030DA8, - 4FF091D004896C1600030DA8, - 4FF091D104896C1600030DA8, - 4FF091D304896C1600030DA8, - 4FF091D404896C1600030DA8, - 4FF091D504896C1600030DA8, - 4FF091D604896C1600030DA8, - 4FF091D704896C1600030DA8, - 4FF091D804896C1600030DA8, - 4FF091D904896C1600030DA8, - 4FF091DD04896C1600030DA8, - 4FF091DF04896C1600030DA8, - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 4FF0915E04896C1600030DA8 = { - fileRef = 012ADB0200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0915F04896C1600030DA8 = { - fileRef = 012ADAFF00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916004896C1600030DA8 = { - fileRef = 012ADB0100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916104896C1600030DA8 = { - fileRef = 012ADAFC00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916204896C1600030DA8 = { - fileRef = 012ADAFB00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916304896C1600030DA8 = { - fileRef = 012ADAFA00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916404896C1600030DA8 = { - fileRef = 016F1B6300ACDA9BC697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916504896C1600030DA8 = { - fileRef = 012ADAF900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916604896C1600030DA8 = { - fileRef = 012ADAF800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916704896C1600030DA8 = { - fileRef = 012ADAF700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916804896C1600030DA8 = { - fileRef = 012ADAF600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916904896C1600030DA8 = { - fileRef = 012ADAF500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916A04896C1600030DA8 = { - fileRef = 012ADAF400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916B04896C1600030DA8 = { - fileRef = 012ADAF100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916C04896C1600030DA8 = { - fileRef = 012ADAEF00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916D04896C1600030DA8 = { - fileRef = 012ADAED00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916E04896C1600030DA8 = { - fileRef = 012ADB2500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0916F04896C1600030DA8 = { - fileRef = 012ADB2600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917004896C1600030DA8 = { - fileRef = 012ADB2700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917104896C1600030DA8 = { - fileRef = 012ADB2800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917204896C1600030DA8 = { - fileRef = 012ADB2900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917304896C1600030DA8 = { - fileRef = 012ADB2A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917404896C1600030DA8 = { - fileRef = 012ADB2B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917504896C1600030DA8 = { - fileRef = 012ADB2D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917604896C1600030DA8 = { - fileRef = 012ADB2E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917704896C1600030DA8 = { - fileRef = 012ADB5700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917804896C1600030DA8 = { - fileRef = 012ADB5800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917904896C1600030DA8 = { - fileRef = 012ADB3800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917A04896C1600030DA8 = { - fileRef = 012ADB3B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917B04896C1600030DA8 = { - fileRef = 012ADB3E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917C04896C1600030DA8 = { - fileRef = 012ADB0A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917D04896C1600030DA8 = { - fileRef = 012ADB0B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917E04896C1600030DA8 = { - fileRef = 012ADB0C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0917F04896C1600030DA8 = { - fileRef = 012ADB0D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918004896C1600030DA8 = { - fileRef = 012ADB0E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918104896C1600030DA8 = { - fileRef = 012ADB0F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918204896C1600030DA8 = { - fileRef = 012ADB1000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918304896C1600030DA8 = { - fileRef = 012ADB1100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918404896C1600030DA8 = { - fileRef = 012ADB1200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918504896C1600030DA8 = { - fileRef = 012ADB1300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918604896C1600030DA8 = { - fileRef = 012ADB1500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918704896C1600030DA8 = { - fileRef = 012ADB1600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918804896C1600030DA8 = { - fileRef = 012ADB1700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918904896C1600030DA8 = { - fileRef = 012ADB1800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918A04896C1600030DA8 = { - fileRef = 012ADB1900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918B04896C1600030DA8 = { - fileRef = 012ADB1B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918C04896C1600030DA8 = { - fileRef = 012ADB1C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918D04896C1600030DA8 = { - fileRef = 012ADB1D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918E04896C1600030DA8 = { - fileRef = 012ADB1E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0918F04896C1600030DA8 = { - fileRef = 012ADB1F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919004896C1600030DA8 = { - fileRef = 012ADB2000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919104896C1600030DA8 = { - fileRef = 012ADB2100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919204896C1600030DA8 = { - fileRef = 012ADB2200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919304896C1600030DA8 = { - fileRef = 012ADA6600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919404896C1600030DA8 = { - fileRef = 012ADA6800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919504896C1600030DA8 = { - fileRef = 012ADA6900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919604896C1600030DA8 = { - fileRef = 012ADA6A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919704896C1600030DA8 = { - fileRef = 012ADA6B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919804896C1600030DA8 = { - fileRef = 012ADA6D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919904896C1600030DA8 = { - fileRef = 012ADA6E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919A04896C1600030DA8 = { - fileRef = 012ADA6F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919B04896C1600030DA8 = { - fileRef = 012ADA7000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919C04896C1600030DA8 = { - fileRef = 012ADA7100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919D04896C1600030DA8 = { - fileRef = 012ADA7300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919E04896C1600030DA8 = { - fileRef = 012ADA7400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF0919F04896C1600030DA8 = { - fileRef = 012ADA7500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091A004896C1600030DA8 = { - fileRef = 012ADA7600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091A104896C1600030DA8 = { - fileRef = 012ADA7800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091A204896C1600030DA8 = { - fileRef = 012ADA7900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091A304896C1600030DA8 = { - fileRef = 012ADA7B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091A404896C1600030DA8 = { - fileRef = 012ADA7C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091A504896C1600030DA8 = { - fileRef = 012ADA7D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091A604896C1600030DA8 = { - fileRef = 012ADA7F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091A704896C1600030DA8 = { - fileRef = 012ADA8000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091A804896C1600030DA8 = { - fileRef = 012ADA8200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091A904896C1600030DA8 = { - fileRef = 012ADA8300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091AA04896C1600030DA8 = { - fileRef = 012ADA8400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091AB04896C1600030DA8 = { - fileRef = 012ADA8500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091AC04896C1600030DA8 = { - fileRef = 012ADA8900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091AD04896C1600030DA8 = { - fileRef = 012ADA8800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091AE04896C1600030DA8 = { - fileRef = 012ADA8B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091AF04896C1600030DA8 = { - fileRef = 012ADA8D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091B004896C1600030DA8 = { - fileRef = 012ADA9000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091B104896C1600030DA8 = { - fileRef = 012ADA9600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091B204896C1600030DA8 = { - fileRef = 012ADA9800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091B304896C1600030DA8 = { - fileRef = 012ADAA200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091B404896C1600030DA8 = { - fileRef = 012ADA6000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091B504896C1600030DA8 = { - fileRef = 012ADA6100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091B604896C1600030DA8 = { - fileRef = 012AD90A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091B704896C1600030DA8 = { - fileRef = 012AD90B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091B804896C1600030DA8 = { - fileRef = 012AD90D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091B904896C1600030DA8 = { - fileRef = 012AD91000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091BA04896C1600030DA8 = { - fileRef = 012AD91200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091BB04896C1600030DA8 = { - fileRef = 012AD91500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091BC04896C1600030DA8 = { - fileRef = 012AD91700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091BD04896C1600030DA8 = { - fileRef = 012AD91900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091BE04896C1600030DA8 = { - fileRef = 012AD91B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091BF04896C1600030DA8 = { - fileRef = 012AD91D00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091C004896C1600030DA8 = { - fileRef = 012AD91F00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091C104896C1600030DA8 = { - fileRef = 012AD92100868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091C204896C1600030DA8 = { - fileRef = 012AD92300868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091C304896C1600030DA8 = { - fileRef = 012AD92400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091C404896C1600030DA8 = { - fileRef = 012AD92500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091C504896C1600030DA8 = { - fileRef = 012AD92600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091C604896C1600030DA8 = { - fileRef = 012AD92700868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091C704896C1600030DA8 = { - fileRef = 012AD92800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091C804896C1600030DA8 = { - fileRef = 012AD92900868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091C904896C1600030DA8 = { - fileRef = 012AD92B00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091CA04896C1600030DA8 = { - fileRef = 012AD92C00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091CB04896C1600030DA8 = { - fileRef = 012AD92E00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091CC04896C1600030DA8 = { - fileRef = 012AD93000868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091CD04896C1600030DA8 = { - fileRef = 012AD93200868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091CE04896C1600030DA8 = { - fileRef = 012AD93400868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091CF04896C1600030DA8 = { - fileRef = 012AD93600868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091D004896C1600030DA8 = { - fileRef = 012AD93800868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091D104896C1600030DA8 = { - fileRef = 012AD93A00868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091D304896C1600030DA8 = { - fileRef = 015ECC0D00894EC0C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091D404896C1600030DA8 = { - fileRef = 043627A700868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091D504896C1600030DA8 = { - fileRef = 016B4A3B00ACCF9FC697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091D604896C1600030DA8 = { - fileRef = 043627A800868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091D704896C1600030DA8 = { - fileRef = 043627AD00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091D804896C1600030DA8 = { - fileRef = 043627B100868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091D904896C1600030DA8 = { - fileRef = 043627AF00868916C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091DD04896C1600030DA8 = { - fileRef = 012ADAB500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091DF04896C1600030DA8 = { - fileRef = 4FB23863047AB9F60098ACF3; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091E004896C1600030DA8 = { - buildActionMask = 2147483647; - files = ( - 4FF091E104896C1600030DA8, - 4FF091E204896C1600030DA8, - 4FF091E304896C1600030DA8, - 4FF091E404896C1600030DA8, - 4FF091E504896C1600030DA8, - 4FF091E604896C1600030DA8, - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 4FF091E104896C1600030DA8 = { - fileRef = 0654BA58FE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091E204896C1600030DA8 = { - fileRef = 0654BA59FE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091E304896C1600030DA8 = { - fileRef = 00E9D914FEDB4D29C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091E404896C1600030DA8 = { - fileRef = 0654BA5AFE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091E504896C1600030DA8 = { - fileRef = 0654BA5BFE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091E604896C1600030DA8 = { - fileRef = F564505801E623B201F62882; - isa = PBXBuildFile; - settings = { - }; - }; - 4FF091E704896C1600030DA8 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 4FF091E804896C1600030DA8 = { - explicitFileType = "compiled.mach-o.executable"; - isa = PBXFileReference; - path = Q3DedicatedServer; - refType = 3; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4FF091EA04897B0000030DA8 = { - isa = PBXTargetDependency; - target = 4FF0904804896C0E00030DA8; - targetProxy = 1895FF2E065E291B00F8B3F4; - }; -//4F0 -//4F1 -//4F2 -//4F3 -//4F4 -//F50 -//F51 -//F52 -//F53 -//F54 - F54951E80354E75E011BCB42 = { - fileRef = F564505801E623B201F62882; - isa = PBXBuildFile; - settings = { - }; - }; - F54951F40354EAA2011BCB42 = { - fileRef = 012ADAB500868211C697A10E; - isa = PBXBuildFile; - settings = { - }; - }; - F564505801E623B201F62882 = { - isa = PBXFileReference; - lastKnownFileType = wrapper.framework; - name = IOKit.framework; - path = /System/Library/Frameworks/IOKit.framework; - refType = 0; - sourceTree = ""; - }; - F564505901E623B201F62882 = { - fileRef = F564505801E623B201F62882; - isa = PBXBuildFile; - settings = { - }; - }; - F5D8C5E0035259DF0106E832 = { - fileRef = 0654BA59FE8ECEE0C697A12F; - isa = PBXBuildFile; - settings = { - }; - }; - F5ED1435037096A001F6289A = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - path = splines.h; - refType = 4; - sourceTree = ""; - }; - F5ED1436037096A001F6289A = { - fileRef = F5ED1435037096A001F6289A; - isa = PBXBuildFile; - settings = { - }; - }; - }; - rootObject = 0654BA41FE8ECEE0C697A12F; -} diff --git a/code/macosx/RecordDemo.zsh b/code/macosx/RecordDemo.zsh deleted file mode 100644 index 273f4e6..0000000 --- a/code/macosx/RecordDemo.zsh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/zsh -x - -/Local/Public/bungi/BuildOutput/Quake3.app/Contents/MacOS/Quake3 \ - +set sv_pure 0 \ - +set g_syncronousClients 1 \ - +map q3dm6 \ - +record foo - - diff --git a/code/macosx/banner.jpg b/code/macosx/banner.jpg deleted file mode 100644 index 7087c34b77ae2fd40a9cd25d124623f5ec8f4adb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 55841 zcmeFa2V7H2(=dJz#R3)-L=*uLM5Xs4MMb(4=^Y`24go^P5X%LWDj*<5kRrWEZ$cC) z3P^_tp(r4|NC_pR{0~@edG5XMbKmm+ec$_W;GFF4*`1x8GufS;$($j5Bz*#oDak3y z0c3l~00r<5Abmc2Sk}|V5&%?GfXe^?902x{9S6w46dCvjkevqh?W6&~ob1fcv@O}i z?{)Tob@%}A3ebS33mN~rf)WmdO_xx(PqFehda zZeD<&mzQ6hk5`;mjG0eZ9Q@}O2CD<)&&j^^McpN#Rh_=B|gjwjiLJwIWe8Tkh8_c)XOjE3_7)y`NcJ%H5q9L9QJ-vJ()C! z}QM6{Q7wb0v9@&QuN@$jYusE z*}7C$VY)8uQRs53A#v2^#3PA_Zhn^+T(*R}Ep zh{-5#LQk$!1AF#>*zVoIX+On2p&b;?@g3g_V&KejVjus#aGGrl-e`1w6<{_0>~cRs zMw1o-7hGba*hXOg1);hw5Q$Ve3t4SpSLoCV=wwZ0#K&? zB%pH~_eAH(X4J@N_3U8>8|X)LWm^D$q+QF6FrTt9!rAzF5|D?xNpKwC%OeMSE$@r& zH{2(L@}W#vg2=VTZ3#w|fSG$bMAa62;__=}W2zR;nm z#nRA%t|3?o3D7}xdn42Iun5~}^sA2M5fd95w^I|%_E@#*RlR;ucT;Wj6$c+{0`0nP zRG1qrMs51IW+RjY1P&J)N0lFCNhp&jk@{du6(Jk;(s;37ZE6H3T)R$;?9N!dSdlcE zn)NEI3`=F?bYnhO-{;-}+CJ|IfoZVD!xei0s;wg@CE0E_Ek-Mo!^OIoGgpSzp2z0n zkn0)+oyKc%+(dINRF>)0!Vjs3*9t?ek8bIiog=22tObiZx-S-^dJ24{GaS`2X1qnG zFO3&TH>jyNS@nB|^d39Kg`GJP!H#zG4GLIEY?sR*0Yb#%Tha;nz0#viGX&3xYVKNm zNSX+9xSa&NPkc7VK6{-G3kOzp)ZXt!y0B$vJ49@Pvhfg;cn6n}{tN2x8P;v@` zs?QIir|OivRKtke-t4NC=n3jxBeki1yR+IinVMh3NUj?ad}@wvV5H-R&z?^am~w4B zc|@|JgbAmX1%git3B<>Ys^hbb!y+b*n#5Fw!A;+$w<1bV$d#m2*yI)oP@G{Q+h9$v z#=#U{5@X1Zyni$jbnTM^Y~$>3AAy!>GaRc-0xlPlfTvp?!X!X)3)M~nWJo|2vNgwo zV}%6N_baNAI>vod(2BSwOX!-R`ZU%sW=6;EFo7PHWulvpD>on4*mBN;nx+v%aMHKD zYlLsPIaD(?n#xQKYti!_<=!htGd*?mv2`6Su|bdgW-Kf*mS~5j^hU`o zuIkMg@pjp;<~*#Sib-B=%6x4e!gBhVGrBj#*mINir3ucC+l%XnKocPFP*YFr)@L6Q6fI3Non^k zWR^3mmpti#Jb^x@vq&(<#B$}9|Jxh>VErN?svx{I-4ri@8)#drvo zsvIRKo&HJm=@#V3TE*GYY9{)H6nxH8G+$CW;rimFcvyBs;%oZjN2c)$RujjK3N&&3 zJ-mty(;FK);t4@~dM0zhLF9Js%6!C5<^AP6=bj?durB#E>%>wAZOur-4sR>;WWP!& z*4BBd#m)%FZ-dMV9i@;BcG#$Rz`-$xCB%2u;&u9QJY5(E-xnf!Pu4i|`p%Y?RD^yw zu}O3L{1qC;jJmRBkUBqeyojE3E2FFVg}+@T3O!TRln|(|eMVBLtaMEh^@70uf_NmJ z(-^jqml7xL>ua|Tdsq4Nb6vS8Uuk*Yy0HlXWmARYfbtZq_7xS#_Y!#eH!R&KZDw>w zw9C|ad>#zHX84Mh&@<|*D0d6S)S|kyaSll@%;#zg5c)G?RL0NTb!ZXSK7R~L#v1G3 zn-}Y_%h_A9Fjy{Trm_BA`MGHCHH`d*@$@B-@#uq#Msl85bfEjyD--i_oj(pFqV;8R zbA31+RYD1j@)O>s>(HR~DN89+`LgKJ;1Bi1=#$mchT0iSN9R7=AxQX?8EZ1MPvkWd zxTIn-BIiVdYv)AFC;PY|Ikb9PXZ0-={Bi3z8aj+7eEF=q48ccwq1V*%9Wq(C(D{o%{WxGTFqtk`G%q0lE76<0ef7tX&j0{&%c>^T4uq& z)~j=%F3$Y7B8twT>Eo1D8YsqI=u%s%pgLv<%8T!nK(ir9n)8jK5012oxeTF)-XX zus$%uKmz3F7O*vHT~bZHfvw&Ijv5XwBe^STs;$LGIWe*y3O6=`a|=TuhB$`kvdJsM z>s|ONNiJ+33D~gBU5zPPC1!Ms7c+QU8tXq6f~rbAXY}kV%Pqj~^HSS*lV3%wbd&2F z{WN<9l2JSdbsrp=GgvQV6Af$HQ_X4j)(=Lt=SK9iEeAUhSU*mB4pu-oPv=9t1hLXT zA5!sp7GJGKz&azOvX}Mn9u|a%yL}k=aMQ=SwTe#DRqwf?GMtxm(k2O5ipodhH6r8< zq_~>+CTH{_62FGH>PoLa($XDAel63`Bz2AXrfA-prJFPuntU;8`b<-KjTfUS|9mju zDS>j{M{m(bgamY$#KcA~By~KC4GTB1w_6;quz|1})TAG3eeggRl=PDcwRy8)PqJ zr+ZUXuMVdR!K&3}7klw@+%X{zdo6B5P!4N+FZ_!>4J^f5@(vlh5<}(-SU_=6%&LEG zwMGJ_`8YLuL`S-R@C?)*60dC3Co0tD!zFyu&^XVhroalP)`b*}2=8>hl4<9sHBQkD zNviNK`Pkx7-E}4j|G}pW6bB7Wg3z^)Hb2MVdeu^YkBfDFx{v#O(c7}B&v~n}mhBU$I079`sY~;jud1m=tH{K- z6h7$T(b`F|1qr_D1P|1}i0#d{Rm)6_0yHCjXNgXN-B>}a}Hy?gAd4Yw` zFsT+$1SeMNV&INhVW-yU&^lKbI&hh*Ic~y+;nUT=@>w|XIRaw~7nWO5Ev9f?12+$O zW;h@-OeKHcg{+k z;X|#Ab!m>c8`LJn5RyL@-JIt=*nLBKv*7_ToCGXS&VkRPjkt(cTSmr#f>rnU_Vz(r zlmr-LL(>GuyWMC-A9v13m3ylUDkIivYD0Vw#JqUAoCqUUddhcF$>yU_f^|bvbLId8 zCjwel8)+QH*U$M5TevoaW0Lnli0~Me^QQ;syHALsx~Vw1;PbAPQDZ)a+Qi%|-K)<) zq|=HDl+LAW_CW=ra4sC8;h6Z7Tx{KhEzYpW!VW}np_Q@6>y7QR~K9KShI@e0Z& z^^ADgsR40bL>$_$f3pe0AaXWk-3RrVvo(j9Rpv}ADx6qaWXhrnSYj8~kcV%F%A5SGPOeWCfAXX1NY82T!cUlZfr;;t^fXzK9M z(6pM-p%77@{V3X3nz35fv~XWi{EVfe3_|iPJip*fhvj0YE(#a)QIVUi4X4W1wh>v` z(jxV|=mEC;_}8n5CtpN$m;n+{j6qrNsX-|%cH#^a|9G|e9W*6<|Fc}i7p97> z@EPc8w}~2|of53(x9Zf#-k%<610 zfoVhbtqIUi8%L;$YG5g;82gbGVS8%>yUm>*vO#L#)867RLBeaK;FikF15MEV?<+ z`B!`#Ou)xrLQFV5PH4(V!b(uYu`%y*C&a-`&SF6bZ_Q%eJG;Tt4EiQ@vm-4C=}sYR zZTqS_cQIbybuiFH+#jC#5~F4Q+RgX9A!O~(;unr_uG+>9E{F%hgWoDJw>U`Wb&Cd075W|ODv z{(J+*^pQJ9%e+ShxT&$mew}}T^)AKfdi$a_WWQXxvYELoZIwnUx`f?lcQ)Wbu z3zZ<4Hbg!b6Gx27_1;Vu;NJJnwZ3z!A0M6=8x;(a)WulMEEZp`nz72*T*#T1N+pO} zVZ(lIoKgFFhtJ`}dBPz-lb|d-O z^3pipG8{IoY#i z=s)YSFg!C9VH!FY$kk*i#gjfLVz70oC1+I{h3{IeJHRR`b1&fN9zmBSWt;LfAHI7w zoG&qvsQ%Ikn}V~osj=Xqt;3I@H+JS>}D5XoJnepa%~3*==Kf3U)IDh9)06P0`zd5^|J`8j4SjDRij(Z-1b3|*ZWLW zqKJ{JPe-yxF>?i0Q&N6q2KnO%-}+{DrW6f(pL>|txP4kB<=w(UPccbrL5M5TvLNR)Q)?08Ns7?%Emz*<0gu zQgUt3WP`_R-DZ&JQM?i(gQc4l7P&ejA|iNYPCwT{2ctJQ(_)0VjOr!Sf7vpQtvX}YOsaD z#s>b(I0SBBB830M#x zKmI5!ugU8U$CoZ{tQpFv+;mDAJNZRhIhZm(zMx1l+5wzq4Vvf6%Di)Li1i;njt}6q z$r&_|tmiA5^f6rY0jKL=ZzW%!J=gdtI;GB{t+3~3JEui%b>p5R2$Invokb|OCtEct zc^1BfGIJzge|1mBW-D@)&O2tHSj0iNzk1z+o~a+4%Topu9_}lDRXY6D(2P02*LS{c zu*q?4Tj!OQ@s4{+Z%7;;jLN0`QWRiXemc&M6Z*l~t+ueOGBJp6$Pg(zg$@Tbb7@3K zH}+U!drs+H&YIB-nWxqSv+CG$ZI;3+6>9lGj##8@Jgz-;4GGeAIIN)h+|zmYNe5`e zECpIZv_u3EmK9uDP?*1?I}%`P3ZKdMM~C6R zjHGSJB2x+b67%byY%)?X%HQ(nudin7h>Y~x1~pu8Gwk45QW zk%~}d!&!Fa<|+GWF@iC6d?*6*%<}BDhU$2z`#@{xb4R!G5eWaBLo6p26`R9^4Tg2` z+(MK|CWkt6G6?t|AoLvurJSc(cT3X_m|&HYuOWDAX7)SlG+e^pKLhJ z!DStftlGg_U<2fH%qP#rpPI2LO6o*IeF#h%izUcZtpx}Bm!-cv9%676C%U6~EAwH? zpgsw)cQCfPO)y7vo1Gl0dZ+jq3hfO93al5n03i zo{n;&a8ywda*~mW@P=u5a-Lgl#dLlDW&sYl#a#nqX^qdp%+^E;E~L*J*}X&xd88YS z=t58lFWLx_rYR=QBtXOl+-1oVFQY68WUI)|B?29BADc9(Z)Gt@DtuP3sI#(67lCXI zzR!Sj%q}mc9v%$RhYaAd!98g8OaWwQjfyil=*g#MOpM$~?URSUjuaQukK%9ooGqqY z?Hvkj4YaK<=xy3!(O2m$_q2WnM|3Q9QX{kkm|%4f!{`L>Q*Blmup zs}}fLBaw?(2Wx6a6EcW1xs=k4IzsxwLpqX`p_P+}vcRPTYgpcz5gl4>VAdmb7J0Lv zvyzwx>Y%X%iQcvegww39Ma<}g#i!A)gEtLTXbU6pA8w{XB!dY|c@X=mkx55IwY;H7 zzh7D$N++tad}_=G<_hx=;dbd&wq@;I-gzE{i7_jQ8Pl~L84oNado-LlN;lT-&oH+7 z4AdQ+E?+3}w}&QX) z%)2u6(cvS;)rU zv9=3K8Cqzs4Jc|?Uu-0tb=QrQUn$iq*6*3Gf0JD{3LUqoV2Hn5oM|pO`qB`dmnwir zDzS6CQroV{VO6kZs`@H$2D`*v+>E2stecJvI4^K)vda#BHrSpDGI+ZXy^wLfH#zHMq6Q5Bw*JgVDMhWe_b zDL?c6(jpFKvIWcj{J;sq(5PL^LwBi9s!mv26_Y*CuK1z27ZjKbiJiJDPcl)nri$4Z zj@nmMvW}|_=~crmT+CIkypvRw`)j8N~mG#r&XDs zRch&dE;-(yQK;ghYq4dcH&Pz_KK2#o;c)nXTkdj9S#DZoIrn@J914T&I<0U;hzF=A zLYRKQ5u>7Tg1D#UY?4g3K+RE&G$q?c-gHdA+fjrEB~SiKbYWZGo6!8=Fimhfah?Ro zG3yeAdCy7}C{@P!xLXu<-B~vmuw5Z0$E*!viYb*%ACE!rwehemtQ!#))_vxONq`6O z;A*ey6I>M2n9L03DcU&fnM!2N=>bQ_01Qso7+f+F>G(i&tw}&d7zv0W0ggy<-vB~A zPP&Z*3`I4wMkJB?N%PV=zZxV3K!c>{bw!oEY&&+bW8bY~KR>qbkzHZVs?7CvrX7G|g;1ZH95XeG&_ttH1L$|5awNaEZLH5n~^by;R7dmFebv%2>6 zn~E~bEL=Q1*PNW}q0BNc2PZdIs0$Cz4Xqo@>NgcNwU|L*JUp_hEX*v{uC7kvJUkvA z9^7Wz)wv-shwX}R9(5O(6V%1k>m~@53v9q`;cCGG_V=xu-{A$8TG&8br4AjGu!DL@ zfgrvEb8@k9bmdkzvx3UOTpY~6q>2K}#l{=v=xS!K0fkHOY}W^yeQ*Bf?Okmkc2HMt zhzr!r73T7z%|QvcD+u1|kKKVq4rY#Emtf8BH4Yv8TfjE1P={+SE@oc8f;QXEf{1|) zf1vgkF#hAgZ36*Ox0e#(m*Ck+Y{UIqj3D+lP)FCF=zx{~$yom$wgb%KhM6n$x4G=4VW!_CnSXEL`kh#M z&BE3V?h3WoF4TZReibZ#a^c?#6MqoA|DiPccT(BEirxn$eh7uzg!>^XZm0jlt;Jss zbG!9#pn|!bC6SjK6it6!9RGu25dpzJt1ToV{JY{`WfHL0KS%n9MEXY|{~yxz@1g&z zm=99(-;wkG7Uw?`^naC5{~+oAhVOsF_`fOrCyx~T7W_ZKx_=z!U+^v$pXl${?mJ8W zMKNek__NwVV!tom<=veP>$mOh&pG=a@hFWoWLplS6#>7euMw(Gw$CFahqGeBjRYrWe;@)6;HoI?e8b8 zf6;sVg!V_B(q9k$?|b;WX%Wwl)c`!DeCf77!5>%8&XX9|}753cL~hcWOU2m2Qs{1>bE zUli{y?x1nt?`PouW)608viN^tf&Z&v{$`QCxx2z|n>hYkR`~Do-!*kbP^q$Q^!u^X z|0x9V@^bToto*B__jht6XnS)9_j@;C5W8OiS(@3yp*-7$t-ovP>gDtssrAoIPoP!r z`-HBwqp0`|T0hktf7i#q4)cfL_{UNH9h5&Aq{PoL{$0c04)I6Ff0QwQ)uH@xh(AUs z!Lwrxl{&Oz)g_TSgYLK6ZP>qAvk(2m ze5X(H)tx%W0im5{T;LUSqTNpKV7tDPW&quW|MVcA`i|d$oqF3nfW7Ux`tAIFj}a^d zb{uZMVRd>tOMVT!eCugD3y^`%ykuZMV3`eI0oVgDzzRHf;BDXk-LdUZ{QcN&v)%Uh z$8Re9yzw2m?YyI#y*>D`?ZZrA4s&y~fUB9?LcrYjb{Y^@J}|dUZa@q4Q?`dWT5YGd zkDE|S*Wc!^yTTm4<-eh!VP*aO{>2haUG8O0mF zfxX|#1?J}TyCMqEI&Wp;2z7LG0NYT>YHmXZ?UG;_m_Kah<_ePseN0Jv)=}I;79TADj&3lxp-f*x3T&`siWTp5B|8}TQS&jzXjCN z%+1~vOdfOx4M=}deOr0HQ~dktl;&14FngHGZ-`6%4gPicpEtlJfGW&!o7M+iVNPmp zu5jpY8Rw8a$VmTEN@Wgn1sUpJ$|=D|Z2iaTJ2L_Gc1Hl&_iy~ROa3>;{WhaeZD-GH zftPJ!*@EX?FnJYpsRxsw!}}@FU47TVeb>Q#Vr|#Keb>Q#*TH?)!F|`keb>Q#*TH?) z!F|`keb>Q#*TH?)!F|`keb>Q#*TH?)!F|`keb>Q#*TH?)!F|`keb>Q#*TH?)!F|`k z{r?UJ_ir}$bD+5o0JOmqv=josQQ#VAWQPIf02E*b)B$TS?Fydoos<(;Ac*Abmcr@ZERa5zcM4{o?N(*L6=bC!THZb^vsrcQV`d8)r6$ zg4SzE_Qh%xJF|_2B)hJV3a^Tj4Ak02!P^C@>8+{-@wS7AS+H+=(@XDw;sU{NS=!ix zzg~tjL*Wof78#8lXM0a^@Qwr2)r=W*&Ub{1drGqJG!O^V+r>QW%sW+F?IhXtRMeSW zK{K+QjVm)hw9_Cw4+#%<=LqVnfG{&)fo4m@D5%*+yCfr^Uw4H(4D0rcEfydm|CViqt6*sar# zm$m;u0P=STNbvj%FmPBr+a&zWxWKV~D+9?25}4=bL)%8@fBx9*B0qF?|SfMW07z5Di3?Au3ikODj@4^U7X zprkry!c`!N}O7f&yb zt!#%sgSz=eeG7s17ZK1z74)nQaE>RZQXE0gz_Qwk?5)8me!r{AOgcyIhL;5+*@UF}vX_!;=s zm^W$9M0nXLYmS!b%(#yfna40HE<3!T7;C}VH^|cUl-$dd5RthnbhH`O62AqfA{xHD zA*u3;1AMXUSEmDm$TwCJD<1eUrkI82abqoXF4O3=<cE{&L(IAg7$Xq6}%DrzRf8m!l`SKW3&tzT`Rtvn43 z{vhC0yJp5U-&-4LzOWi!JBm|U74 zJ~gPN^(t_M|Fla#B$9aM^Dkb-%Z6+Tg3d+r;d$Jjmrah1XnUp^gSebtYoCsGJ8CSvth)*Nrf7E1&Y-_nksj zt7(#e1e+Dw#7G}E#^l2d4W(7>ROje#gq8}_>4%)SOB_{O_n7xa+MRD&mia*5s$qS7 zxzVs9mA}H@eEiT2ZO{s6*_HADX(cC%dK3-5GM`K=_V!tCa_mOV$@$3{SN! z@|F|a2)@@nmhq;cmJV6?IFF|VZ4mu}G2X%1o;&}TP|B<3EP>KP*Nd3$T|o9L#_?MAQQ_v@_hm5rEA*M(!E=ue!gN1N?;TrLS*zv2NTW%>`wGMPr$gD%bFX_BCPz|x^el0eDEE=A%bk5YGpVhfliq{-U>5pUcl`y z0}2FbH9}t=ac+an3E9Rmt0s}fUA;#xFfk#By!^sN`g{9g!ss^abjDwqeufR@X15ca zJ>G{8(sR3UY(3=A@-LLL(Jbaw0i#VlH{F0ec=2W&bX^_v4kPEis?fX|-*UP`ac81l2oq zY?bnpH($qvKQXi)tSNe{%bhA3HgyU)W$jyhODzk5^zZqCHORe9u z@pZ;nm%!|EUqEg9a?xeea z>wb@ush`c7(>Z)TzRG48`E@8jOp^QR)qDF>24e!r-q<2vjiPEz?>pK(SVf-Sl$MuQ z5s)n@JHE_cRF{B>kGb6Ty720UuWX(y_=62}p<2T-%QwoAhDe_2c2~pLrvq=_l^)1p zyg~qZV=4R7ED!h8Nr4v)(Xlpm&ZkdxS>Fy7(PG|nH|0U&!_=@%jt7|>Cd2e*Hr@7a z{AKCp**3QfP6q~dbc7O{DBELPDawTN(g$jaZ$!^iUiYKo)9enufAQ8u(X2O4{rYvy zX7@##3-(=1wk{!m`26D?%JNOoUj{CONTT~DUY12Hh8@j)rO@S^=_v8;OVi`SN`zdR z$Mt~^AJU!&~src|Pb6@Qv$~YHRwWF7R0yE?3_wN8u}%zcf_l+GMaM&%1M*W?KhfTx`p$|LnTGp}VVNzuOjEpIfY}qBZuw3nF5GHZy9XNf;@f6Dsdynvr^X6ZrWCwPhdM#shcDeDismbO?;Cfj#u2>Hn+Vst2w z=CSBw?LCX80Wpq)3ZmK*hAQp|;akbCoQK7wne>V-n$h@+t232~1@w$dSAR)(Q-BA< z*4T=_OwyxUD?DRkpVGq`ZW-D)aqVbdhIN-{?>R7}$FNI6+L*{9veWY&Pcu_&xvooD zP@X*e=u`WOkP_j;JRK$G)Kc2#==BtoZbg2%Y0^hr;yRblVd(9VU) zm9yhUP-^+T9Q-!TNz`7gviioRNpGCtZ|83mIeSeUbe*lf=iwNmR4n;0nYyApsQZ$b z<%aHTzO@X}H8XF^v&OHimbpZ6!Y-Dph85+K)wpz;nxR$XYQan>avX=;|CWd97m+WZ z#PSq7S=)!bSjxrSW^=x*`=nU?;l}aYE~6V=$QqO2h#m366=biH@J#0Or zT0Zelbf7dZYgMuHtPqZ?sv(lxR0WyFO3ou+-`x z=iVxV=8ons3Z|Of`e%YPof}ozQ1J;!2WM@IP-mtKlPuLs=1oxNmi)I~mq>tc`T?O$ z^w-7{GHCnegE)TnNz;oXv)=g+km-YGl!MMhD`P?(h+kXi1>~o7yC1)2ky&ec`?b72 zsObU)O7%irJQUIq2q}gbX*q<(O}aXes5x<`|wp5=7+qnk}f z#hcQ+;*dPUt>=sS?gzQd%Nkb9PT$jPKtLf(s;aYxtTO!M94l`lK7Lgl3Dt~J*P8=a zyOFQmT2CFLSJ5t~N>Al1w?&Bhy``q3KKHQr@*|)?=Oe6)z$>U@&%-!#CH+M`Z_~7x zw57Dx{pz_^=tlfJad95W@_68s*a?oPl&^B;Jr}dn4lPzFfk8f6HeYIG8wlSjOdfTg zk$Ny9I)U2sD&UH&$2H}dchP!UsHu9{o6$uO47_e8O!5o8<&a(om!fAG+oHU-=>g%Y zNvMjLMlb2L2&EloQR9~3o=je{ObBi`O+agU5s=<0Gr^DIQG-4?mkRM$n7-RVRm(hiXLxYx$}N1pE`Nh6o0|4i*#d2Vc%$Z48~xNrNcg!B*2gU@ z7j>W9rR1gIy!ug>k;C-3H{|X>z}r3f;kSh@32`5Rv0kGNPYb`FNt0%+muC9qRIiwC zAJy9Y=Xl{;>UF`F$@c0Z8pjrzwX}hYz{Tf)EBRXi7XBzR?JLK;sk^xoDV`cQa9Z@rq3G$Rg12FxlA|)k zE?#C>u(mNKOvi~rLOfIaOm6n5@2_vw4;^Yb{&5Dj+=9sm_hS&HNP_bVg%Pf6dER4w zJ`>4n`9f8iO=l7gC1Inr@<-mT3c*Qz%jq8N@8r8(7g=Xc=kj7y!`rIl+J;XWBqXnT3h988Mu#Y64qCq`Q3q&cZ2Kf>#D@O^l2Ubkr`dS z{{E{RT=lKgC)3C@e4-_^kv7GTHc>>E`*p*LT(5F62(I}pnI_Aj$FI%2AJKZ9Y>(Pogc{y2RFVj<>21wQN(I3vCjk6hp#M_I*X;pvW|xP?~}Pm%ep|8 zxBni7T*b5Vg99a|^>A;?jWZFCMN{9MT0$;7gQU!_Rp1`2y>yWN1a;K8&JU@GV5waShgO&Dtl|ElW zuSH+Rq{=>hqeucT?JZ07zomqeyXCG&M=Ds{XJO><&}6WuNv+RCl`ff$@v1AIChJLjs_iz>&SCIg&_lc?K?9TJ zHD)t*B(Nlhe|bDxj7x1(k8r-V>g3B@oc5eYW+~Ozh!*VwO{3Fm&|nf!^!DHjg;aj& zkGFI(4DJ+3P9Q}MyqvjUr6QptH(hiV6!mh_>$4sLjaF0_J2L9uZ@nWn9rW6th@8A| zHpNbj9rHA&*w#bo#dPhGjLxl(0r4@*HMP!px~&7mlGDmt{;%8sf%dIUH65s( zyfXRp6}rGH(>9B(CNEOoH?%O0El>dx1vXCpt zEND3IZ|bMLDU#JlU3+U~xWFS{_QkAsc?>t>Snn~+G~J00t`?f={vsxqvje}x#uGwa z#jzQ8@~aabZDLyIGnzciV9bWy8SN4muld?T9HiG|Cq}wQP?_@mV0nUjOHVq*501g@fqGe%&o|qFS~f`(-g2* zl&AAY-A3D9ogA!dJ?zVLi*+;upS#u+gY_)Uqg3tvd_COu(lK(Q|kL8qA@#sS7JW7-%k!eo|v z20F`q9)4D@JJv|S7EpH}LvkRf>4C_m*f>ha3;m%gy41_v(W*>_!`u1Byx#Td$F(UD zUUyh4bvG)IoC=vLh}_NW2eW8&PqoZN?2EXFwA6df@9?%Wuf%-2@S=t=m}LDD2GiKB zCcx?R_H?v|yP&oG(&RBV?;vxiRE~%`N4lTLpyv zt@fctkIh)7INi2RjF4li=2%i$}rtW~#|ozDOA-jUl={{3<7__>C!aJ4Ja z6Bfr(+w%sLqL(<=JMy5KG%TkSMd@6Kmm- z0d<4LomF%b4UIXrT(HRpG6^=+BgVD@=h7TlZ&gH}8vGi~j(zyh#S(kY%_35CGT~K5 zrs?ec<@MI3;TeJJj`TveZ%1Do8*gCbh3aYXN|=v6A}Zy>=jGaGbc+pQ&Eg*c%6o$Z zwFJ!?WixF(()VT2>rcZr8>RV7XS{XtGKTj(ndY!NoYzl|##P4#UTt4Xym(5%>@Z;@ zdkVFmwhi+rnw_J}{tF4vkzVCXd|^lwWz6F!U$1>8Wx7;`+*WRQkbstg4-QN%Off{G zQubMJQjLxgz9na1=FHX+eZgaIR6u9U+POGI)6ZdB8Et$M1p*_RF{V{$SX~|gL-Dxb z>+?^^)ave9A=I+UBJ%>D1HOcYGZsvKINhupEgI*1{ymvn6oT1^#`SV1icLMjW#i0f zyZt#fTGUgWG|kNQbn*BO*EXTeAn!QKYUBi*H(aovh4qqUK}ukF-JV_=g1L!mYu;Lo z^w7#=qHT|(-*B><>%M)UI*;sncl^mMj;{qK52)QPHmDq=@c)GucObKI{O$7WjSjc> zST07K4NEW2Cu*C0xAgZ04wnSaX~%lz%FH=Wgs|R0N4rXMdnwB<&rweoU4vz-WE)+z z>T#s55DL7y-o}zDp_C&Ob_^ezw&nOrl5;`|QV~2H0_a`6(49X#I9OMkP~^uVtrT@} ze>Pi0$(9BQh)jHj52&z9Y93-yJXMmg@HPqV!Qq?!emr{ieCkQ36Hb8*T5!K^ zya(cb;q#vrhF(vd?Q!u%l{leAVH1<_lbuLjuF>+q{fTF+c@91!Fn5si4_?>vHyx?p ztE}zFP&s*dMf;2YJ+u5x%SNw!ww?kmHoKT`OZo26fZ1c(ubE!O8HO2LMeQlN&58YoXPI6WmFH$BYDXb9t=fB0lel z@XX?x4%b1JpQ&1LJW>Ho#|(SL-|7@3XnY=1ym`{enA3Ln+4IMB1~S^Va>H?KzDG-m zb6?uToH+)Kuap#Aa(^BT(LJBC%$hj75qs%1a8x`|#rWaC-9vY_#^6@Zk&`EIn;FDl z={bnxUT=p-aqi6@5+*xgxKmOH)LRK+Sl-w6ZEcZiNkat~e$&gqn15JdoFFaep}Fj? z$o<$*GV9a9(H4dxp4Ukyufey~*rMLNUR^8d6*?!^qPZoVx-N6HaN5#5eCr)LJ>%^x zGVr;bfPRnAxO+L2nGI?AB>Bo(ljhW>6*c~A7fWe}o6j^?gVigw>uMVL;RvJHvtF=i zMVF4$x_~h0u&{bO9{udZvddx4nf0)2eaw)-d#IQ`w|S@;W!=~E%q(_OzYRarP#r@1 z+m>iq{Fe-jzFlZ^^u$1yUUKv)B7YJMBsL_mHqAFPGAM^1dESf!jKf=#;=IpXzc2sA zNmS(e;oM}@XS?`TakUA-7#R(;&Zu>STK3Q>FPdN$xq>q|Bdt3kiT5^YFJQ;MtSz6M zShI}YY>g1fq(aL_GU+J2ys+I^?J5q0Z^x?qgw$>2q` zb)!d-!6Tg8wxUGPjFAvh716ySJ}^VaH;DOYsBAwP5d7#$QN)4swz|wYFPgHvTvk~* z=}+bZZgGv9n4TEiAKf^ib^n5L zNccJTs4>1A#v`rx6f799)K?*BOOHvfGe7rum;Nzt58;kBRvGQIF!JJp)Pv}4w?NAEQ?P%5)D1}7(E7hE_{YECiNqrGk^0Y@R*E^-`Q zlF@`l#07x`IlgHYOL)T$qJS}QIN*gq)H2^ytB(MhQi;X*xYD>ypw zSbzSz@ZA%7DS9cr1?T)|a-Eta9-Yo{)0VxRi5kxwi&Se- z;kda1@Ap!-xtD)jM(E3!qU646h0|V7&V6Qhe_R%JRM6D}85HV0ddmDhjXw=_!|`82 zg=n<3X+UQLzRexeB#rH``f_@qGxnLTd=aYh(D@UCh7Fwe$XI!VHF{`8wVgL_ZF)$y z>at%i543)g@>J~gA=-<#`YyU#{2=X%b&ISdsm#i3>M`pZN#Pf*y3Sz<;u!cM-h%;({Yh&C~1y*?2GIaXcyiPtVs zoBXaDxBaCDUgNZmomrylqVyaV3yx@wVoXXgzG`xu#s)}fPTqj)5)#PaFt~%jHTa1) z;_4C_m*mdqx-nCiu_XqA-#FbO&s=!5Pb3AT=eiT z?Wzuc0cU7BWXX4iM>(l(;i>!tm-4j;W#wnWUDCNK8BMfbsekcv^gJ*gE$T;Wv=q6f z?Zw|5)IQesV)NQ&c>1)#$s~xV;RiXMTtnGo(N|!Kmd>1D)RVv#dc8EPBlXD4%QQZ3 ziM01DzLt_BkzMjW7Zwp;f+VdpmBBnRhBh0AbE0u5>W5T2fnnoI@c1oHa~GRdE5nEkrl*qc^& z3V@lrX-nUTbH!*@v!^wYvbNTHD@QBQ-NCh>RLp-T3B>G{d1GovW6CD1mw*(Nw!R1wNwFuLfd4JzfVsKy_=4u&3+w;J^d_Y0dPrky(<0;Efp7>-bq+O<@5uUzD0eKvTzkX zdva#V{sI}q9B`a?oNj+HEI+SPT;aIgp%1wucP6HWbem?iNi>XI?)(FMtnY(@KOI3TuJK*?blZm~_;0^!%7(%zETB2GL>>%lLBNAd zlUuK?avc3x0X!j%2KbSKIOVpAuLab?!#x)gl6E(tus0*LbLt1NIjHvxxm73?$TPG~ zDBsodkjjrhU)yRnXOwDA^i-nx6C+%NF^TLtZfs-g6j)FSU*+7d`twSwZZe=7Z08H> zcE~g8v_>U{S;~Gsq_9eeY=&lCmodd%2QXe(JY|iK<(7WIW^TObOC+_8z_|i)qawa8)pWa;dED6ymY=Ql$okKFZY=eV zK^*BunXS0nej_N6dRvlLUHWWw+RDmWIWhlRMM(paK%ZsFEmUdHC|fpUlpAb6qrqKM zvb6VEpRXI&!H$acA?2nZeij+YFq)Nj`xfy|KK@QE#XMQ}h0Gu|_n)mPO#HpDOYk_^ z#?IIax=(V$Q#AwI3hub8OW|bUt∈rCC+zd?x z`EyAtcE!nsFIv`QPiXU~FJ9Q=&d0jBOe&%M5x`4OR7WlGiPUDvN!q)ij6U{hc-sEXGn4DRu_W+mJ~Pixk0&SIew6;G=;Uz{)A zMN%5W_llOLT%%J8S`-Ijc1J!w%>Ml9VN*D75Ghy2@pyy*LC-v735#xVqs6lEwlSBO z{E#`-rz-YF-ZD)tig$V`6k}J|#An-u+py2FX`1VGjI$-&5}Wn8Xo6Y@RvqogD#A&u zVn(dfzB7IR_sP=Z?BFy%devK+6l5|=_h$p}+iKEGmtcyq&LzO|@yc!-shq2#exzY( z@lDk%@LNZ+cZ#Z=PpNqMl;_TqE1#-&Q;$VBx?1hAL^n%iW<9_8ybsr&aK@bevh_u) z$O^ABN^qE@-io0Bf9Pq)>&Rsj!}&!OFE2i$Malf_OkJ#q5clC>>5{mB?M(F5?-^0Z zwh2aC&dqd#MpMZL)n_>rei)pgBuOn|^j4$b63D1FI99VGr&dK&?xD(yv4Ig86=;}s zGN&Mf+|1h6hUz%5hM(oPDInkS_HuRXFavql1z`O5advd*o3@!Z-^bgoo+nXOuDz=G zF5`ain?KpTm0wd~K2{3IT!=Jm?HC+Q*g76FLyVZZl#cl=i2r63XwQ2Bc**X-%7y(G zz(WQzL&p4J9~z=iwEC#?v5{^k0qx*mJJMdG_%&fj`{*B9QH3(M#b*kuvedqEG4I943E2 z#>eQQFUob0{9MFq1F=W^l__r^iM<(=>R8`--J zT@+5bcV}$5QL3sN8dpxt;2(nojJBg68e`=?Z@NT^xa#Q)CdEIUVb~?dsSpY+9yCBP z7vVfqCHdh3I5%JDD9-ph%9yb3Ux7qM9%@2G@yhhl;YzBe`)lt4V`?j;>Od0 zblMe4WD21Bc5$2PGo6GQH(DXo;YyWC?K@JxBwmAA8q)7dx*0>u1%sqABNBS=>PU7fu;j z8g&z!Ev;>B^$8kTD#;2{i|Ku{is!DOMQpnf7F&pL{Hp%A{QF+$K4p2`$jtYX`SR-b z#n^pM$0OS4N^0+c%RoqU%3UL(-1H7h_a}MUc=<>9P&tiAc^FLz=y=^BQUW;da^`B5 zbr~rD;u|`ax)gRgcpT;Sbb>fcjUVTPzv!qXFnLT3B?;Lq91rp_yCmcG6x#--nq>x= zon@gVj-U3;cVSx2;n#28`~^T7k2;PMZ&0+*>>DGo+3jN>xMHM1KG6ALCx+M7arSpZ zbh)^2c(*$KE2kk{v-(5WL4X^7cocReZVv=rI*`>!ZS7cTD|Irg>aMprHi9p5D>dzz zzCI&4UArHJaGYjLdrjA`8N?i#>y2`Jw$mYq*k0vdaX2%IR%m${;!Hb*Z5~R`Z%$^- zHdfe;xN4tKIJZVvTML*geJ7CssGB#q8TG$00tedO$oJly=2kz2y-T}uHk5!g^k*H~ zpzk!#P+z(&+(NgI78HLt=c}8K-VW2|k)gsIW{V4VL8Y^+6BiPDJO9|LADU5E)3xi) z6k?0i?UnmyzAVN-(K1WO-l0khQ|mk&n4l8~lDeEcSe>+d0vFg1L?xW{Fgq3!SfH1{ z^6hQ>ZC-8jRW|V#tQB4LJ^Q-v>UoFqqX9M!t8b|E4~K`I<@<~F^u6Z7_%y)_x}G>= zBgItZ`?H&}bOdOsf#d6Z;3BMbD`aG+Y*8AU+?1GLe~1-xCtv7UT@N<&V9H%maPcK+ zdcIz)aHH}{YC5l6;;GG6FQ13q^R~&_{bIVm0C&OqyOTb+F9r*i25kQIz} zT}@bFTje;dXg-5PF|9Fo0xtKMYdhl-ojQv7T3^x`2m7#hWc$uO&WJs zq4y1B-Kl?l%owFCnD!TtykIbCkt_l<(!z_ohAj)#30kd4f7^eCimW(OS*OTfxTop-2?23b=C!*{R|U z3#B-E$xa>|%qIGI?*(JfSRtcThs)&7l`G@bF>y7UGS*Vx&r16@3!y14u!pi1QJlqD z7}smNG}aZn$5E%Tyt)<#XjJ{53zXREiwuPx7YFHf?Yw-a&r$z+#XW8Gq1*B5dDLr% z?Mz0PDzK>FqOl?_-~!)xzN+Oc`*dz6E>Qa~An9^%$`vizxmVZ+!G8P)AHB>FpyALn zbWvpFOE7Z3$LnVkVLQ;&;0Zw5HQ#YAB7rvV^tJ@h#i`dfPO3KfM+L@xlST@Ki-^6R z{oT8&hY$UiwvFMNl@-k3{G^~Bmv52UbUKE=073$y{yWc+ohFLl5dB!jE$Rkdo~Mj- zn2-3hL!^+aH7BScq`rn7adVzZpx3jUlTrl_9Q8(+WZqADr0kDapI;Qx7aPskB{1qXA1$v$XGgKla zPih|u;G7>kw;l<}+zymRCdN>u&r1lzh#M-nds9aWnBxJ{uUr==swU0Ne=qd~^738` zL*Eyy{{ha7O+e7L%qluY6 zjqo5!CeQt~NlP#FY3umiILG5tca8!4`As2`K1%J$k8?C22n#`cjL5jaZtcAa;>|I&j|yT+mmxaO zne-F>0%z_OWE*znvygJ*tdbb7@G9N4#^@X{5cpvn`>i`}$8d%Ok5c19%1_FGw|l4i zFV=S2E}#$E&hK3ejEla{(=7c3u)FthEtjQT){S&xb?9HZFn*vRPfbN=G8tAp&ixI# z)MKJe%1Rb$cRXj#q8ZYXYDw4sm^P*Tzw&x-K@V7&EHw`C$#zeH`oJ_jnVr92Va3JQ21{BFI{m|Vt9j`L^5 zTT>|m3JQ5-5c{V*&1BB~ZN*VV0XPpwZXCy7&gCV5LM~qA^p%Q#e;Bb-7O0|^0G>vpo3Oe} zhx0<1*x=@&qP~MJQd~LRp=i*SS%;2@D!wjXf$77K))aVv3hZFMYJ{qU19l?r+h8A? zy8|7`{EW_(p#ANvJ9OHwin$;FL{Vp_K)tbXh~(5&Xzgvr4*oGh@3_G>QRNwAmPg*+ zY>HoC?Yqjf1%H}Na6uibPGsyy!kk`H&xao(D`JHo^Yv}tS^fA{Y^?gxv6v>^IAVH% zE>VBrA_r)L%nYcO{8A0=WGSY>hYA5JXfzsJ9F_e=l{PFhiDAYXA*=#Fz_aHYXJIsa zBCYee{Bh1lKt;oj{@t@1*@#t#xO299;7G<>LB|01L85SIl<=P+TRHFj5bNf!^{xrl zL(CR~yl6MCm!nP1sh{si!nJFyR#Pzsg`d ziR|#qvNM3R*?Gi3Misd_kYz<}Ua;}nIo~qbr(2`yZ8A>AJANzCPF5eC{9QQG1Emct zYxHhD*PFh^dG{%^)!8a)9T*C0IH>=BIAmOqI_B7Nz*dJ<4Lsvs@6WEgln#=_tgkq=Q*6pm^H+Fq&{3=* z|A99@Aj-`hXoOgpP>%YQzv*1qdu_D1&`hD&9?j>7!@jjvTm z(*xM%k%OU5eR-bgZVKDz%GGnOEyIaY`XtfVZ+<($9@Zo9)uAkoiqzKoyj^&qC@;?p zkCf)#hfjVn6>8Bu1bC43;j4PE4a(gSG9dFQM4Eq2@W_F49#N-q-_nvIBqqbr;%5uc zv7<@|r3rs`cm+v$w2>@iWv#=cty^}JBh60W!z?5@}kn2z_*843ISDn;U7mo1Ubzwx)uuQ9?^@srqf&+2K0MV$*B%X!QNI1E-3C+h(1QwY z*;At-rn(03IPR;ei`7p|rlydl#f{&$Q_M&dvMOx%&`dp1Id;6^PVDDXEmZ{Tap*Ph z91clQFLR6zbcHLP&ahgPd||kbsh}5D*wVfM2Udhrupl=Zw${J!b{CBbUA}i^Vo>jt z0kV;;IUBicg#yz$zP1~lL$=gv13Ek>ag3t*+o0p?AFAI|;E}(ON(0^)pX);YVJ$xn zl$-9++X8U#uS(p6#X)JmNJ6Pe6gcA;r_GklWY4YT+d#JHq*JWsWq)Qa=Sx4E&vh!# z`45$kL5X2$qhPL0t9zy#^RO(%pG`G30q9dk_gA;6L-PTwl2?HwskWm!P}(Xr$YSyn z+Vn9dvy=W8An_pzH2lXZbzR?yzwwAEHVBhZ)*(cVPweAj3bFoV;%cjnoHIqYK{Vm8 zlDWOoo|-OhZLBnTPj`k?ep2+f?iczu%l4g%_N4a)|`v1)cfuEt=0fT6=tf&71 z>yc9+z1$;EN$;c+O2TO89s2jCXu0{em-f#7zXbj^8$EDxW;7J!-a-i-OaM*$p86w9 zF{TR;`wVP^Bvc$P@cY+xdWqsP{sQ=b>|V$8OY*ah4QVC_lG>?{nlCGhFSfMIl${x} zu$!wNB55ZRVpv!twBu5?Y%*6`IMXCnFWguwHsT%saUw6;+y1z>i?*l$BaS9qR|kSX zT?RxHPJCzfR>xt0>yK4uS(mk>d(nr>p$+-Ps(vl@@P_v%4c~xUyt9zQT=c`U ztUj-?9@B@63fY;Doy~}rz`Zz{j(h;>uSqXnFv$_~Cs01Py8=3=^h$#y3gptNZMym!$s+ z^f88@Kq)V`+tPBZebz`P6oDaqd7?Yz6hP2`_J>E9^>2pnIq+$K-un0D=1J$Qni%vu z@q31Hlc`7x(gj}eW_|*o|M3lu-uT6c1t>*rs@$Tb_A9>Tb8S9&L5Zz@=?fV#|J&?a zFc9AQ^UB<+sVc47P&qq(IT|$GX1sEqXMIVG$+uLt#zA}7NcJ?U`(jIzp z{m0KH6uFC@?TT&r3vi<9xRtn3O&9bRJu~lh?BGClV8c5PhcCq)+!%%xepwFw02`s) z?GjPuU4UiJKNtZIN}$tG?PEL&i>S|yYn>c=tpEsW9GL)bh!^RFme@o+kmAp$HGiEE+ar% zra)2}SYZ4@+^e7a5*d|e{aKse$=qD z>s=niZbhz=>9L|$=4%4}i=~Kd&RlB^DpHp%9h9lTwuzwc#@Ti?)PACN%pSHBzFrxB zv|V~1^j$Oe)-?aCFvzGsb3LKajti62KKgy5Ss3&veZnIcMatN-*?(eZcoZ&R7B))=&;mLOvkt zpfcr;`zT82)k*g}*LG7~%Ek0>$&BvO!4~UTjbBtXQQpPlE4wKjVBC0`kkUOWzjGR(^4Y2}O@A#`elz)x#TTcOZ14EE8zJwWntz4}Vm34W zzku=ZhZvjhrR^FF{g3U_yz2Awmv4tSYb`GW>kj0tznhwnKqVPDeUX8 zl9=&hKI-1*WpAyP9nxv)vt=(#^37EF3wTogxwag8Q3X4>dWa6Istot%_veU%D92%= zb(e*oGw--=Ti_=0AKi5oeB*i^=QTm)}#VhvIEATl;iwJ!Tc8xH1U7HTbSV_b8d| zBLKolG)VXt(Di+A6fA>sR|!X!h3BGwp#6z&@&l`#j9HfBR=7uUtHUWFCLSwChYK!| zQ;~`b)t$BhqLi~!;mzZBd|?a+9mS^=hdZX|Z^pP4EgtLE-@Ny*>$71w^oa7Ew(C$< zUaB8c{VxE{&9=i61n{)Z-wt16pGwBLIB;qu!Q(FeIc~ zE{^Ls?(uaFx$&ysM+J)zZn9d(bM*J#Dq85u+ibCvc4r-%5^eKv%M|YMnB!K?iTB^p zbYptIPLlnc@^v*W4s_cn)O)Y2S~{1X{&O_nGEE?Hp>kbo-4fk%k#Rk|S*^K3vpwu{ zoA1CKV!!`)$zV#qv!;X8B@%n>s-pL%LuJif$Ra^OqSxd1BKXY?9-ep@FF6mZ~0%7k7HjnB0>y~SHP z>PO2wT^aK=Q)o&b(_Gwq_T)+pfdI89^ULk;Di^bIox`^N0zQv6{fpp?n0TRWuV1uP zPR@m>#~uA5SE;$H_U?>=8m-rSyozg3nz>5p-vM+-7h=F^XJazPz*`FS2=ZGXFn+Vbb4?0)W>leoz5LMB|OsQ zYtDaU2l}|0ZVT1x)JIQmww8DG?h!9Ww{-jr!oNOdT5r5ht#wjSN_$SI;xgeq$p}y4 zpwA(2X2)!(1?y9(QkvvWAaJ?s7k{)M?i4&{$rs!4lSg|MCM9 z5!5X&%1($iBs7<)9n{*<6v@UOWCzV&XP|vmogV5xVqyn=ma@^6V!u={fBQ;I5^z>r z{G-Q7wfG$E@j(-@?7slj|FY1i-?O0GBGAQ9Ij9cpT{=%p-U`^yU-HnTRn>oZ1LEBs z<8Y@>%=OE9fv$Sz`#k>Zti`xXyGYuxu2)!>HzMsU zx0AOiMMk$#2;~WE{9j*SV6Ixw;2eOIR$qAqUSt;cFwcUt&>QtA4*Gc8d~KR#WFoDi zvU_tT7&A_Xl?_mT(G}fs9$+>+zYAgS{bAT|1=&^=g>EMA@fI_4I|c_Ip@PcmVv69O;ZKDokbjFRfs`4+0;ma9;3Kd zTE!b`I46a7Xs8&iG5MZ%d31KBzB$8(P+u&9R5{pci|$evs7-2We|VL5ves%OapbYF!bzgw$P*LaQ)gx~EqG0UnazRHX;uW!R+qB%G-E zgkgFU`Y-+3%OF+~D>B^7mxXX=9NMB`RE9+q4}&55mByUa+d+<4r@^8koL57Si;52b z1#iVM&|#W2I|97;r-_LC!I*TOPdwne!(Btaj>H9>Qn0`Lbd=^1RedcXUMY1|Z72vz z`On7y+#VDBZ$izJmQLwUkQwTOv5Fg~cZYV(=km3=LH_gVuAT$m*SOUI0fuah@=79> zPn9SJIER;uCI=f8mAamNeH{8>6*t$@Ls?#L{Ze?R zmXi~+FRTh@!vps;I7Nd`*~Gxk)VZ8GSP~5J=});8bM^jKXs~-_XJ?yjF0BN3q~|gC z^%P^>TP*Hwj>SH1vbQKOxA3}cHm&xRu-rGYMadn^;mKCib@oX9jb8l@3|yK9Tw-|D-+8q zBVyrEC9#_s=a5WfFJyb!Ym0Pp?hkEKQsx=~uG*)5-IO(72~sw3O2x(dtWEC_BUKyB zNwYx1BaN3X6^h$$Y3U!AY71co$pxwzw=*lEp1EkzZc}mKAXp0@#EHnvxpJ+NsjR{< zt#tHdo#+QfhGGUO-E9Wc9Osuic1XC#z0BUspFdXm-jJ$g4I?#ie&+~lSOkRa!Qd}o#q|C3>_G#yW%m@X+8;0j3iMj-HyUD-gh^j{)S0&|QkDhWg5bMD# z8sQ5rT3MyUu4n5A*!})~OK{cb>Jz3m;l814s6I<@!l~Q62>qF2bFk>4E;&t3U1)Y= z6BoInWfEvQ53~QLrnb&jFKTuHv;Z{)xq-a|dZKX4z{=`Q8j?o#m!b*57vKDK#_OV0 zb-Q#MrZ}m|&GH||ieZ0}AT?D%S8^>R=_!Xcq zs*b|R90p66h)x^Ljc$fTn7ZrNULSDun}VF5X#fT^>W2o!I>t$b)a)M zH6SAR(xcR%t+qi3_nPl@lL1bp?WRpOE0%POFn-M-(C$sr*BVkrxT+F!A%rMpPigng zIIaMnn?ww(nN%37F790p!A%bWfmap>SG*ghT$D@%w}on^sM)*~^VmCoQXvWRoG)-! zvLvuaGW#1E>zf;*wimQBS1b))XEMKtjb$$@tHUkBlOjK}_1XRUtq9X24t*S`A8+D` z-Pl*@p?MD!nq+U6#~n&vmKHA{C!XKaXXB<*t%4oC~pgX5o$_yx0+;}kuWZQdmiQ+dwP z0E7Ozl1X0NmpH@&y}@tAiFW}`{r6+@7bauL2M{?_Y+a1e+-zcU^1)1(Ocm;k2g=@^ z?s}8wQol;I!{2)DnQ3w!*+S}OxZ8a7J$dCL*#!HYbMl~q5@SLzJ%bQWZMEy~43Pjy z$Xl^hrj9Ib9!LK1BB?D={ro8c<)Y-h-(PbsBXrTz;=$|AvEt>f874(}|I>l=xE z=QI`bOfuQXYI2=WdW&j`L-VxfKAU6l0pkoyruu=JC~1S^vWQ?^#;Igt+dONO9fS9% z(GJgTUpY`|ypGETG;4LizpvyBE$_i$XbPp27T5OeI>P}S)x-{#8XNBpG}LgG)O@DH zMffl(tbZ7jmxt;HylN0sqPm704HI!e^Apt(Hf3Rx#}+PnA+;W7(n?|eRxie@7Nd1- zfezCTp{!F3bt=V}*&Z$fch;Ku#gaZ8Rr|9jhOlH(q5;aI(eW9qO*yY`@t;Q-=tI=Q zqrT4eS2%mRFi;#bz@`3(4t$J+96RW!x~8CprIdu`A1_A?<#%YNQ$him@BS=hdgat z#P>PIcNclkXA3xmjE6Jd`>c;})x9NqZ?fI3@J7m7w^_qq=9|OhZ!QaJbhv-yXq}$A zXtJ1T(k_8GDe$HzM5DF9g$e?_3F<0teAVoV?167}z3hT`zTAx-($35FAe-`6+DoZ< z2&6-1cn5STD6n)N>a5vMAF|K~gsM1$I`bDsa`Fzt)@PU&{~biS5+#1hkqr!lyD0=XBlnRzTr1f zQ*;79bzlP|W3+*eHgSu`uF@p%QM#UoLMZnH(=g0;_2G8jW2SfxqDH?kKv1fEPT-nH z!!7Ly+ja-L{{F80jDsH|P}ll}-el6oy|&?O`0JBR43xXm7Hvv$CxHDfgX49f+=VsT zNDz#ZX*l)|K+@cL-)lG2PQ!opQ#hDu`iDF7P%?x{q*lCg+4GaRY6mVOeKnnbs8-fp zn(dVwvP&WQO{de249UUv*+cPkX&Fv+e89!%uj+hv##6Dh zOs=a(pAR0yy4d*LL56jc(+VHRXai}q{@MP~mp7H5RVBPstt24sUN!uZ_6wXWi@Fv?XCh|mjd_pKcsxPwNJK+43hmdMq&Q!hv?L4YS42DZbG?zD3!s)WjWuf z_QVn4QP-|Wr&u7?AE~FI2B5A#-DyHye*vTBb>uyemE{?tN`JpxPYn{X_ra`m0U+Czs{ z6gO6VgkXv}m-AtP!Rnh4~9M#ckn|I+mbOxQ|+47J)9h6h5-|GgOKR-fV7kU%y3?J*_u(7OMjLUCZ}tWUd|coWJ5Jk&gXi z6MCdlYPwJ}T8`@>$JM2J?}IaBE>8TcF^$2)a#B)cL10LUUb&VYHWV@&3kns-q996P zz9&4@t9bKgovQK4p%;~D$)Nr9V>)=Me)#L@FIds6HxUUB&Ugsy!;1*Z5RKFw+n^jd zde2v-!ALxt0 z41fNFpy4wWwXB0uB>d3Q00VtyEJV6ws*U~Qy^f-1sF1+2vrsD>Vh+x$`Ux^xgCtyO6@MM|mHf$E z1vK4C|2>E+p)_+rBi*l#wz1YG3q+~lac`Ax`43KbMd@R=cPCjUBq;FYw5LH5+iTAd z9AF0}t2!eRLGMk2*SM9aU5ICyAP4OndE0W%fQ46F!d>K^#&AGN_LkKBs6fTj8;=Nd z7FS%gBec~JOyzv5Ch)XoYS<=$u^7AK=|hq$i3r+iiPp-%i-KJLoHX$&UidRkxiCt9 z*KME%#^b?Z?LvVYFn&$st9A+l%a@9x1XI*ysVGyFJve1hFUpBg$WW_+qnulpp5;K9 zl2%z6(n1X35%9Y47}rEufVDf@XC%?Kaxk0?_nsYX@^Q3hmSY8HW7-g$B-`v@t#2eK!}~hODCmuylOQGeJwCeLGcc%{i!zr4!%NqL zY_I}Je~CC%$fyVd`_;r>fafU>l_@6A*8QO2)b2rZ+^n$zu6K80DMtfIl)gegb>0I^ zJ{ENS9_}`JyvcLhKWUS1Y<$}}VM8$NS}EnEttdvpGjJ__TjJ*44}#DB0=)bnFCzmMONBvHkert*hBuPEiS!7GZR zq;HGYT=##nyIO3&Z>iKJY3k1{wtmoVU&Eu!_|<%3&xdAnWcaGdMo?agJpZTmdGb%* zzKMeas#6|;o0U7`h~dm}54R`3Sw4&o6SFeL=hVLH%FE~sf7~jk^hEHI_{Xwcn_JTX z{s6DpkQ4rn7y5A$KBBeimAosIWJ6u7WWgPZbt|seHaAwu`&JRQlU(zU(yId5#B%M> zTL758A(;dDW)}Qg{vAv!axSc#B8l|k#_e3mN}Ik;H}ab=I?mdk}h4+%qKr{e z4yML4j$S5eS3`ef__K^Eu_wD3<>{;5QCO%EDKH2fJY-e>1=vyA6{A46r0d)3PV9Yn z96Ic@(@`Y8lJ=o^&ghSwpn+6RU;LTX)_spNPe$A*?RjjbYtJ!reMs zS0m>5gC?x@V}JMkj5Bs?J7+}JkjpT~^E`*crw?$f6&39U4L1V}Ku%>U+iZf{O*?Hk z<%;roL4Iz2`Bj1k8r5*1pke-^5!UU5Z%6oTdxb|l$RE~OuH&!=uO7s>L(XQ;ney*y zgG{C-XLYuQR`fU6C0%LeIQ^YYY67@Wx=I&WxBV5vhzZ=8Uv{S~WS}3$T;!Fd8Xqpd z*@2?t-)H<;J&)GiUbC64>rch+Wva^vz-MU6o2U(sAax) ze#}Qu5{2B8l2RSp4!e$dbJ`0I^n$NP%1{}l?EU-2s6({kq<7u-7x3%H?Oy=u2PFs@ z`(GsK0Cy-lc=ga)fjgxrg_NERI0Gq5DCJ5K=7+8vl8w+;Z+C`eVi2Ma0H!tJE6)Kxa?3~ea$Y89;Iamd}(9m}y zZy^aI9qD5GS^s1pFZ8!lVT95ZS$i#e_XSlAz%R;xM>$Mx{Qe6#cstHjVXstGEn ztos?auc`Q*QDZ`+q-8qUz+KnE~ziW;=;LG%0p}d!FbwQo%&-7tj+LLJ4!f& zpY=!ii68G>)-wv?j%l%u!qEngfiNX*x=3|muKi`zOMch9@F%3U^BvX#3CJ?OIwQ85 z)y`cNrXG#IfP8u4JDBtMcrRGtw1uU&f8CL&@^(8r8%6PXk%#p!Aj|RRY-54xTx5L% zA!jx*F}^b3*)h2&ZGNJlb~1tIA>)NWPYeEeQ{dGTsD{m{pFW z6+!Nxk4i$xTmo3-6Eucv<6ep^aO*SX;Yzn~YI}7gtXV$ACf{yc-=G4=7U#}RQ##CiNt@8OXseeX z=!sb{zwG)~POS*>*bBOl_XXaYpI!$!^?oIgBW5nwlrTG}p&+xTDebE}UP~Folz44g ziv-4gkYHHdfy(pXzsVyl*7nP;_&hgB3uRX#W(4?QyO{Ph9<2x*_-_-__Veyn6^=c^ zQ|nr@zTnbnSK) z%t~A?l*>su8l%9^;JzRMSkUa#K{|{drsk4EMf?SqeXZmD{i)xrvGAQ0zTf#l%HxXe z&mvFup^W#3vpnmktDOFUBH-%uo%h?TS;^joX9$xv0`_H+8t4wd!*=2n`?YhvPM){M zy;%Bfx)?O;pJ7lj0J`;YTh(5LEag`)l}dVX0ia5QST=i|4T0XK5w|sHmV!2539va< zSWFWt5mH60hp`sePAP9`x7v;;HUaI~qz8#)y4U{#81i;0<))LS9z z>kZHb_u|1@)qcfDNo$<2r!3)%i<;zSh}uUm2M^JEq3UED4xP|^Ykj4-Y44rEpoABbaD)y5(DL95$`S{+-A_uKZ%uxZ z1XZydP5+U!GmB%2TiXnxT|j%des{);2@x>$m}cYRVVd&lxC9AkBCa}|AZdcV{UQw3 zy1AA7y17s6wc@&GA?Wo?65)8uNy{TOwFxqA9461XnYf2+z%(1ulA5qr&k1?v!o#^$ z!|iKzXny89n9Zh`#Car1VhRcD^?Nk^c$B=}TL@pFU?5v1AP^}oVHf#GBju&VDK>;& zQYA6V+(mY7lgxSSOqYx-oElb-C{Pe%d8DoQoxZj`XW6KKKymM|`=Fy}7-B=$TKlT> zIT%1Gi?geo$L7p#XtrFnnVxCp5*;+dfuleT&m9m6zhoU2G>{m1cJN~uIOJ>qF{>nD z-hSPe-7Wxl*$dJ_4(+4*pU^a*M6D?G`rn9SLn9XIp6&iHU494qWrb=j-~WoCI%*Ga zNJ+okK#$a_I%J%m->GLMz3aNXG@TC8Zi04f7@xiR&*_NX9L$cYpKbpTHYAva3dFwR zP|U@hsD*ZAeg#DgU@D&ut|lQHZf6VT6qzTF3O(iFLlf)zjGs{g;3tU*vj(*5g*{F0 zYR?NwFOQ3j!Fsy&O>lCPqqgUp&~OqiJsr+T`i`gf4kNzqU5cJ8GjDKf%#%^Olc1)uYd}7Lp{0s2uj~@Kon!0Vqv!50n4Sw&} zw%pX(2#q&ds^wLtlW&wYkJ;~qm$g3dsQiv&;h|R3_$EWXm|=OOQ>2S-(n=Kj25~jt zaC1m%W2b2pFXnsir}Rp*W5?GPY}Y+27C#-((Pl3v4vgoWegbXJ$X5Hg(eA5SZe;sQ zxw(9&gz-x+1#eq7E1_Zuj?D9Q1$K8>?v0Lw;Kjxbn#vd%Hp$v*^*x1wTfY{H)IzRPH z?as7?*0{Z#M0myp@x>%c`ZZ?C2X!0MZ|?_j#MC7kEGvY|TlfbE)fF)&<1-0$a}VBr zj7_PqeOE2IYZzL7$M6JJUJ$EZCMVtS*tW-882J6FXR9&zWq|?dn*#!zmm;E+m?V4s z-NZl1?ykZM-~u%AGs6+XW!%iM?D7=aP1_3HL$ao3!~4j&XBy`_@Y*T7z#ns+1MWHw z5r{XZI!|f>F&MJWI)H4DJv6IOOUb%aAOxPrn*hmSxjIPa8zzuFv?iwE3%tRAe-vxFY+MYkF6Wv$n%6q-XG zHU{r8*4D=2NMXtPrYX0OB2^!(>Abe;_%YUob|3coE{Y}!im$IPh4Ti=DtL}1xT(#% z@qlOH%FVM0Dp~5*mGzn16bLoqektmzerNKa(=FK+3%Rvj*<-}C8d@)_*pkn;5h&=` zGPlpBpDO_@wwHhgl^K0#>B)z{=*q3gFE#kN zDzf^BtCd8f@9JhF9BQ_XITpCNbajpeReGZ|(ps93%9in7$uFk9gEAT? zn>^#JK-Vy7@WW~?Z6!%%LOn}~*VdjDK`D?Jt>lKE2OnJ~kDu~M4Mdm-kli z#UdZB-+JKB=mY9dzsB+fZ;2QF2P4`~<;Ue6#-ltI(k=Ja%PWO>9T9EaPX%XYKWK0b z&xh{4Cgj*-eWrN>Mvbia+qajlB%Q7!4E1?E4^5&ce^Z1?Swgxu?w|IT3w-V5kIC!J zCOf-0tzw_kHxbWl>>5jTJf(7|>*_HFib($ex5w?Tz|c#ND*0a1`CV>Y#p}+h@XQLvp+hq9U@D@VTaP{;%berPK1COL zi$Qp@%_BtC@ZH`!2SzS96=xNjmnHu2a^>o9m*89rE~)0d0@qKmv(|6L-v(H8&UXSE zgjZ$crGqpLMrZh&kEE*q0J{BvUSrT&JuA$2kVZACwS&^6HmANKO zG%Niz;B~RKNm0a^YV`4d?J1;+n;P~=YVWnDqck5sX<%t$Fjbl~doP%)$ zj$D2f{{VsgoCU7=pF?TaNsj&&y`6WCDHWbHVi(kKhngi%9$)iL7wEP&nogfGjH|8(Si(NAE^}M5|rO>@}j{Z$k_wh`~8YDKzkIqPfMDg?I!|eX=lQ%L;Kl#Z| z%nNwji(N86&KQ@9P=3Hr09lveqIi5i>hN5V=-=~^7jRl>!ThpBzgG|>{2w1|$X z%^Y$^Cnx7o)>)B%ZN4lry8i&2pS6fEhs%=4%WjgE_2{W13OY4nuLz_*m#Oam_mv@aS+%ZbP z_U=y?0St1VtSZ4Ge)dnZ@P5}MuD>t;05NsVZsO+6H0>(NIk??hy0U$0p;A_nBVUX+ z?_Ga*ypf~-09z-1N%C%$p!s=hFBRWVL+e}_K@H4RRpTqq;0QhtrMUjr#fM&F(=RS9 zLqOEIg^OFtgJn_=BxJ25LI)4_U+l6SZ>Z{8ZIt?ksT7T;Gl*iD(l8i~F>*1*$%gxK z<@+4Cs<*~r=R2EN?1l7fUKTt(Kp3fB3RF$S9PvE3@>Kn$__7d*WV-E@mCcyCWNBX3 z=0;+Xi6ZqRNP?*zp>m8XC;5K|A5RhUox;ZwQKz*`7f*`FkQy7Byx%p1hKSjO8)?m?UOwd z^8-w?zMg$g>zbIlXw2=#J9gs`Wl{ULp*&mS{(suTtv~as%T2tuHhOdYPC1&Y;xQ^g zEj>j>N-ICw0i8ZC+W!D1Wn=#UIX9p~Zoa*ap*6{;s86B8uHk6l(wmR@rz4(Y{N4Pw z)%E`Xucn8oT04QyShSuyThUIV(^B!eu&ig)m;1JSE7X5IXS{~e5u>O}G~*XLhF}={ zJk@vwU)}r)kLpIhYmOKBlk>C8+S8xitQPJgS#7zyMimZmJiOIedO27F(7uon%3Bdxj0Q~FW?UOrS%=^o29t|QbA5MzW z-CQe29EL}CjnQ65mPvUsw4Ao%@c!@YeUb@0$Edp9t8qVFX&&OBkXl{I3Q0wwE?0{G z0J|IcW8eqYiE4c??IJLcIG|Q6NMzzxlpKHSoam8$bn=Kpb>(d)NR$E$NhC5Ec*?CK zxMt?x=`%WWAG>)O*W<_*t*XhXT#1?pZNe`IhNxcbvHlRB#Ul0E_^ zwD#Cz+Gc2yA{UHhijV+56*`{%GHK**%}qzi@EB~g`+Kn4xw?6qengroI!DHbWn^wI z`_J0Lk@^1sugqL(8Xl2+jWXOKO$@9fkqtpW(zg;1Om?aN067uoOUS(&Yg;P_!325< zC?{}e)su-Ff%tgvZeJ3%R3Gz^UV4s&t+e?hqNbE0RUx>ZEZ?>M%NZy9AdZ(^}3s0<=@Z&4}6P+mtKqA=#a4kK;(&E}hZHMIEQwMblm%!ug0 z6%|4+7Ya8{d#in}Ki%<6E>FxmUwWN0!wlAj6u|~?KCtf`Fa(z&=0n2{QMl)v3n>K9Ov;WcZrfk`>X3d*6 dY}vDB&6_rC*|TQNn>K9Ovu4ekHf-6m|Jj>vOvwNM diff --git a/code/macosx/botlib.log b/code/macosx/botlib.log deleted file mode 100644 index 70b2f74..0000000 --- a/code/macosx/botlib.log +++ /dev/null @@ -1,196 +0,0 @@ -item team_redobelisk has modelindex 0item team_blueobelisk has modelindex 0item team_neutralobelisk has modelindex 0item item_botroam has modelindex 0entity worldspawn unknown item -entity target_delay unknown item -entity light unknown item -entity target_delay unknown item -entity target_speaker unknown item -entity trigger_multiple unknown item -entity target_speaker unknown item -entity trigger_multiple unknown item -entity target_speaker unknown item -entity trigger_multiple unknown item -entity target_speaker unknown item -entity trigger_multiple unknown item -entity target_speaker unknown item -entity trigger_multiple unknown item -entity target_speaker unknown item -entity trigger_multiple unknown item -entity misc_model unknown item -entity light unknown item -entity light unknown item -entity target_speaker unknown item -entity target_speaker unknown item -entity func_timer unknown item -entity target_speaker unknown item -entity target_speaker unknown item -entity target_position unknown item -entity info_player_intermission unknown item -entity target_speaker unknown item -entity func_timer unknown item -entity target_speaker unknown item -entity misc_model unknown item -entity light unknown item -entity misc_teleporter_dest unknown item -entity target_position unknown item -entity misc_portal_camera unknown item -entity light unknown item -entity light unknown item -entity target_position unknown item -entity light unknown item -entity info_player_deathmatch unknown item -entity light unknown item -entity light unknown item -entity info_null unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity target_position unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity info_player_deathmatch unknown item -entity info_player_deathmatch unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity misc_model unknown item -entity light unknown item -entity light unknown item -entity misc_model unknown item -entity info_player_deathmatch unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity trigger_multiple unknown item -entity func_timer unknown item -entity target_speaker unknown item -entity trigger_multiple unknown item -entity func_timer unknown item -entity target_speaker unknown item -entity target_speaker unknown item -entity trigger_teleport unknown item -entity misc_portal_surface unknown item -entity misc_portal_surface unknown item -entity info_player_deathmatch unknown item -entity misc_model unknown item -entity light unknown item -entity func_rotating unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity target_position unknown item -entity light unknown item -entity light unknown item -entity target_position unknown item -entity light unknown item -entity light unknown item -entity func_rotating unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity light unknown item -entity misc_model unknown item -entity misc_model unknown item -entity func_timer unknown item -entity target_speaker unknown item -entity target_speaker unknown item -entity func_timer unknown item -entity target_speaker unknown item -entity func_timer unknown item -entity target_speaker unknown item -entity func_door unknown item -entity func_door unknown item -entity light unknown item -entity light unknown item -entity misc_model unknown item -entity light unknown item -bots/crash_c.cskill 1073741824 -{ - 0 Crash - 1 female - 2 0.366667 - 3 bots/crash_w.c - 4 0.366667 - 5 180 - 6 4.166667 - 7 0.366667 - 8 0.366667 - 9 0.450000 - 10 0.450000 - 11 0.450000 - 12 0.450000 - 13 0.450000 - 14 0.450000 - 15 0.450000 - 16 0.366667 - 17 0.450000 - 18 0.450000 - 19 0.450000 - 20 0.450000 - 21 bots/crash_t.c - 22 crash - 23 400 - 24 0.400000 - 25 1.000000 - 26 1.000000 - 27 1.000000 - 28 1.000000 - 29 1.000000 - 30 1.000000 - 31 1.000000 - 32 1.000000 - 33 1.000000 - 34 1.000000 - 35 1.000000 - 36 0.000000 - 37 0.000000 - 38 0.000000 - 39 0.000000 - 40 bots/crash_i.c - 41 0.233333 - 42 0.233333 - 43 0.233333 - 44 0.233333 - 45 0.000000 - 46 0.233333 - 47 0.333333 - 48 1.000000 -} -item info 7 "weapon_gauntlet" has no fuzzy weight -item info 16 "weapon_grapplinghook" has no fuzzy weight -item info 49 "team_redobelisk" has no fuzzy weight -item info 50 "team_blueobelisk" has no fuzzy weight -item info 51 "team_neutralobelisk" has no fuzzy weight diff --git a/code/macosx/macosx_display.h b/code/macosx/macosx_display.h deleted file mode 100644 index 402558a..0000000 --- a/code/macosx/macosx_display.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#include "tr_local.h" -#include "macosx_local.h" - -@class NSDictionary; - -extern NSDictionary *Sys_GetMatchingDisplayMode(qboolean allowStretchedModes); - -extern void Sys_StoreGammaTables(); -extern void Sys_GetGammaTable(glwgamma_t *table); -extern void Sys_SetScreenFade(glwgamma_t *table, float fraction); - -extern void Sys_FadeScreens(); -extern void Sys_FadeScreen(CGDirectDisplayID display); -extern void Sys_UnfadeScreens(); -extern void Sys_UnfadeScreen(CGDirectDisplayID display, glwgamma_t *table); -extern void Sys_ReleaseAllDisplays(); - diff --git a/code/macosx/macosx_display.m b/code/macosx/macosx_display.m deleted file mode 100644 index 52235a5..0000000 --- a/code/macosx/macosx_display.m +++ /dev/null @@ -1,373 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ - -#import "macosx_display.h" - -#include "tr_local.h" -#import "macosx_local.h" - -#import -#import // for interpreting the kCGDisplayIOFlags element of the display mode - - -NSDictionary *Sys_GetMatchingDisplayMode(qboolean allowStretchedModes) -{ - NSArray *displayModes; - NSDictionary *mode; - unsigned int modeIndex, modeCount, bestModeIndex; - int verbose; - cvar_t *cMinFreq, *cMaxFreq; - int minFreq, maxFreq; - unsigned int colorDepth; - - verbose = r_verbose->integer; - - colorDepth = r_colorbits->integer; - if (colorDepth < 16 || !r_fullscreen->integer) - colorDepth = [[glw_state.desktopMode objectForKey: (id)kCGDisplayBitsPerPixel] intValue]; - - cMinFreq = ri.Cvar_Get("r_minDisplayRefresh", "0", CVAR_ARCHIVE); - cMaxFreq = ri.Cvar_Get("r_maxDisplayRefresh", "0", CVAR_ARCHIVE); - - if (cMinFreq && cMaxFreq && cMinFreq->integer && cMaxFreq->integer && - cMinFreq->integer > cMaxFreq->integer) { - ri.Error(ERR_FATAL, "r_minDisplayRefresh must be less than or equal to r_maxDisplayRefresh"); - } - - minFreq = cMinFreq ? cMinFreq->integer : 0; - maxFreq = cMaxFreq ? cMaxFreq->integer : 0; - - displayModes = (NSArray *)CGDisplayAvailableModes(glw_state.display); - if (!displayModes) { - ri.Error(ERR_FATAL, "CGDisplayAvailableModes returned NULL -- 0x%0x is an invalid display", glw_state.display); - } - - modeCount = [displayModes count]; - if (verbose) { - ri.Printf(PRINT_ALL, "%d modes avaliable\n", modeCount); - ri.Printf(PRINT_ALL, "Current mode is %s\n", [[(id)CGDisplayCurrentMode(glw_state.display) description] cString]); - } - - // Default to the current desktop mode - bestModeIndex = 0xFFFFFFFF; - - for ( modeIndex = 0; modeIndex < modeCount; ++modeIndex ) { - id object; - int refresh; - - mode = [displayModes objectAtIndex: modeIndex]; - if (verbose) { - ri.Printf(PRINT_ALL, " mode %d -- %s\n", modeIndex, [[mode description] cString]); - } - - // Make sure we get the right size - object = [mode objectForKey: (id)kCGDisplayWidth]; - - if ([[mode objectForKey: (id)kCGDisplayWidth] intValue] != glConfig.vidWidth || - [[mode objectForKey: (id)kCGDisplayHeight] intValue] != glConfig.vidHeight) { - if (verbose) - ri.Printf(PRINT_ALL, " -- bad size\n"); - continue; - } - - if (!allowStretchedModes) { - if ([[mode objectForKey: (id)kCGDisplayIOFlags] intValue] & kDisplayModeStretchedFlag) { - if (verbose) - ri.Printf(PRINT_ALL, " -- stretched modes disallowed\n"); - continue; - } - } - - // Make sure that our frequency restrictions are observed - refresh = [[mode objectForKey: (id)kCGDisplayRefreshRate] intValue]; - if (minFreq && refresh < minFreq) { - if (verbose) - ri.Printf(PRINT_ALL, " -- refresh too low\n"); - continue; - } - - if (maxFreq && refresh > maxFreq) { - if (verbose) - ri.Printf(PRINT_ALL, " -- refresh too high\n"); - continue; - } - - if ([[mode objectForKey: (id)kCGDisplayBitsPerPixel] intValue] != colorDepth) { - if (verbose) - ri.Printf(PRINT_ALL, " -- bad depth\n"); - continue; - } - - bestModeIndex = modeIndex; - if (verbose) - ri.Printf(PRINT_ALL, " -- OK\n", bestModeIndex); - } - - if (verbose) - ri.Printf(PRINT_ALL, " bestModeIndex = %d\n", bestModeIndex); - - if (bestModeIndex == 0xFFFFFFFF) { - ri.Printf(PRINT_ALL, "No suitable display mode available.\n"); - return nil; - } - - return [displayModes objectAtIndex: bestModeIndex]; -} - - -#define MAX_DISPLAYS 128 - -void Sys_GetGammaTable(glwgamma_t *table) -{ - CGTableCount tableSize = 512; - CGDisplayErr err; - - table->tableSize = tableSize; - if (table->red) - free(table->red); - table->red = malloc(tableSize * sizeof(*table->red)); - if (table->green) - free(table->green); - table->green = malloc(tableSize * sizeof(*table->green)); - if (table->blue) - free(table->blue); - table->blue = malloc(tableSize * sizeof(*table->blue)); - - // TJW: We _could_ loop here if we get back the same size as our table, increasing the table size. - err = CGGetDisplayTransferByTable(table->display, tableSize, table->red, table->green, table->blue, -&table->tableSize); - if (err != CGDisplayNoErr) { - Com_Printf("GLimp_Init: CGGetDisplayTransferByTable returned %d.\n", err); - table->tableSize = 0; - } -} - -void Sys_SetGammaTable(glwgamma_t *table) -{ -} - - -void Sys_StoreGammaTables() -{ - // Store the original gamma for all monitors so that we can fade and unfade them all - CGDirectDisplayID displays[MAX_DISPLAYS]; - CGDisplayCount displayIndex; - CGDisplayErr err; - - err = CGGetActiveDisplayList(MAX_DISPLAYS, displays, &glw_state.displayCount); - if (err != CGDisplayNoErr) - Sys_Error("Cannot get display list -- CGGetActiveDisplayList returned %d.\n", err); - - glw_state.originalDisplayGammaTables = calloc(glw_state.displayCount, sizeof(*glw_state.originalDisplayGammaTables)); - for (displayIndex = 0; displayIndex < glw_state.displayCount; displayIndex++) { - glwgamma_t *table; - - table = &glw_state.originalDisplayGammaTables[displayIndex]; - table->display = displays[displayIndex]; - Sys_GetGammaTable(table); - } -} - - -// This isn't a mathematically correct fade, but we don't care that much. -void Sys_SetScreenFade(glwgamma_t *table, float fraction) -{ - CGTableCount tableSize; - CGGammaValue *red, *blue, *green; - CGTableCount gammaIndex; - - if (!glConfig.deviceSupportsGamma) - return; - - if (!(tableSize = table->tableSize)) - // we couldn't get the table for this display for some reason - return; - -// Com_Printf("0x%08x %f\n", table->display, fraction); - - red = glw_state.tempTable.red; - green = glw_state.tempTable.green; - blue = glw_state.tempTable.blue; - if (glw_state.tempTable.tableSize < tableSize) { - glw_state.tempTable.tableSize = tableSize; - red = realloc(red, sizeof(*red) * tableSize); - green = realloc(green, sizeof(*green) * tableSize); - blue = realloc(blue, sizeof(*blue) * tableSize); - glw_state.tempTable.red = red; - glw_state.tempTable.green = green; - glw_state.tempTable.blue = blue; - } - - for (gammaIndex = 0; gammaIndex < table->tableSize; gammaIndex++) { - red[gammaIndex] = table->red[gammaIndex] * fraction; - blue[gammaIndex] = table->blue[gammaIndex] * fraction; - green[gammaIndex] = table->green[gammaIndex] * fraction; - } - - CGSetDisplayTransferByTable(table->display, table->tableSize, red, green, blue); -} - -// Fades all the active displays at the same time. - -#define FADE_DURATION 0.5 -void Sys_FadeScreens() -{ - CGDisplayCount displayIndex; - int stepIndex; - glwgamma_t *table; - NSTimeInterval start, current; - float time; - - if (!glConfig.deviceSupportsGamma) - return; - - Com_Printf("Fading all displays\n"); - - start = [NSDate timeIntervalSinceReferenceDate]; - time = 0.0; - while (time != FADE_DURATION) { - current = [NSDate timeIntervalSinceReferenceDate]; - time = current - start; - if (time > FADE_DURATION) - time = FADE_DURATION; - - for (displayIndex = 0; displayIndex < glw_state.displayCount; displayIndex++) { - table = &glw_state.originalDisplayGammaTables[displayIndex]; - Sys_SetScreenFade(table, 1.0 - time / FADE_DURATION); - } - } -} - -void Sys_FadeScreen(CGDirectDisplayID display) -{ - CGDisplayCount displayIndex; - glwgamma_t *table; - int stepIndex; - - if (!glConfig.deviceSupportsGamma) - return; - - Com_Printf("Fading display 0x%08x\n", display); - - for (displayIndex = 0; displayIndex < glw_state.displayCount; displayIndex++) { - if (display == glw_state.originalDisplayGammaTables[displayIndex].display) { - NSTimeInterval start, current; - float time; - - start = [NSDate timeIntervalSinceReferenceDate]; - time = 0.0; - - table = &glw_state.originalDisplayGammaTables[displayIndex]; - while (time != FADE_DURATION) { - current = [NSDate timeIntervalSinceReferenceDate]; - time = current - start; - if (time > FADE_DURATION) - time = FADE_DURATION; - - Sys_SetScreenFade(table, 1.0 - time / FADE_DURATION); - } - return; - } - } - - Com_Printf("Unable to find display to fade it\n"); -} - -void Sys_UnfadeScreens() -{ - CGDisplayCount displayIndex; - int stepIndex; - glwgamma_t *table; - NSTimeInterval start, current; - float time; - - if (!glConfig.deviceSupportsGamma) - return; - - Com_Printf("Unfading all displays\n"); - - start = [NSDate timeIntervalSinceReferenceDate]; - time = 0.0; - while (time != FADE_DURATION) { - current = [NSDate timeIntervalSinceReferenceDate]; - time = current - start; - if (time > FADE_DURATION) - time = FADE_DURATION; - - for (displayIndex = 0; displayIndex < glw_state.displayCount; displayIndex++) { - table = &glw_state.originalDisplayGammaTables[displayIndex]; - Sys_SetScreenFade(table, time / FADE_DURATION); - } - } -} - -void Sys_UnfadeScreen(CGDirectDisplayID display, glwgamma_t *table) -{ - CGDisplayCount displayIndex; - int stepIndex; - - if (!glConfig.deviceSupportsGamma) - return; - - Com_Printf("Unfading display 0x%08x\n", display); - - if (table) { - CGTableCount i; - - Com_Printf("Given table:\n"); - for (i = 0; i < table->tableSize; i++) { - Com_Printf(" %f %f %f\n", table->red[i], table->blue[i], table->green[i]); - } - } - - // Search for the original gamma table for the display - if (!table) { - for (displayIndex = 0; displayIndex < glw_state.displayCount; displayIndex++) { - if (display == glw_state.originalDisplayGammaTables[displayIndex].display) { - table = &glw_state.originalDisplayGammaTables[displayIndex]; - break; - } - } - } - - if (table) { - NSTimeInterval start, current; - float time; - - start = [NSDate timeIntervalSinceReferenceDate]; - time = 0.0; - - while (time != FADE_DURATION) { - current = [NSDate timeIntervalSinceReferenceDate]; - time = current - start; - if (time > FADE_DURATION) - time = FADE_DURATION; - Sys_SetScreenFade(table, time / FADE_DURATION); - } - return; - } - - Com_Printf("Unable to find display to unfade it\n"); -} - - - diff --git a/code/macosx/macosx_glimp.h b/code/macosx/macosx_glimp.h deleted file mode 100644 index 92b1ab9..0000000 --- a/code/macosx/macosx_glimp.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#include -#include -#include -#ifndef GL_EXT_abgr -#include -#endif - -// This can be defined to use the CGLMacro.h support which avoids looking up -// the current context. -//#define USE_CGLMACROS - -#ifdef USE_CGLMACROS -#include "macosx_local.h" -#define cgl_ctx glw_state._cgl_ctx -#include -#endif diff --git a/code/macosx/macosx_glimp.m b/code/macosx/macosx_glimp.m deleted file mode 100644 index 2d45a1e..0000000 --- a/code/macosx/macosx_glimp.m +++ /dev/null @@ -1,1114 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#import "macosx_glimp.h" - -#include "tr_local.h" -#import "macosx_local.h" -#import "macosx_display.h" -#import "macosx_timers.h" - -#import -#import - -#import -#import -#import - -cvar_t *r_allowSoftwareGL; // don't abort out if the pixelformat claims software -cvar_t *r_enablerender; // Enable actual rendering -cvar_t *r_appleTransformHint; // Enable Apple transform hint - -static void GLW_InitExtensions( void ); -static qboolean CreateGameWindow( qboolean isSecondTry ); -static unsigned long Sys_QueryVideoMemory(); -static CGDisplayErr Sys_CaptureActiveDisplays(void); - - -glwstate_t glw_state; -qboolean Sys_IsHidden = qfalse; - -#ifdef OMNI_TIMER -OTStampList glThreadStampList; -#endif - -@interface NSOpenGLContext (CGLContextAccess) -- (CGLContextObj) cglContext; -@end - -@implementation NSOpenGLContext (CGLContextAccess) -- (CGLContextObj) cglContext; -{ - return _contextAuxiliary; -} -@end - -/* -============ -CheckErrors -============ -*/ -void CheckErrors( void ) -{ - GLenum err; - - err = qglGetError(); - if ( err != GL_NO_ERROR ) { - ri.Error( ERR_FATAL, "glGetError: %s\n", qglGetString( err ) ); - } -} - -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - -unsigned int QGLBeginStarted = 0; - -void QGLErrorBreak(void) -{ -} - -void QGLCheckError(const char *message) -{ - GLenum error; - static unsigned int errorCount = 0; - - error = _glGetError(); - if (error != GL_NO_ERROR) { - if (errorCount == 100) { - Com_Printf("100 GL errors printed ... disabling further error reporting.\n"); - } else if (errorCount < 100) { - if (errorCount == 0) { - fprintf(stderr, "BREAK ON QGLErrorBreak to stop at the GL errors\n"); - } - fprintf(stderr, "OpenGL Error(%s): 0x%04x -- %s\n", message, (int)error, gluErrorString(error)); - QGLErrorBreak(); - } - errorCount++; - } -} -#endif - -/* -** GLimp_SetMode -*/ - -qboolean GLimp_SetMode( qboolean isSecondTry ) -{ - if ( !CreateGameWindow(isSecondTry) ) { - ri.Printf( PRINT_ALL, "GLimp_Init: window could not be created!\n" ); - return qfalse; - } - - // draw something to show that GL is alive - if (r_enablerender->integer) { - qglClearColor( 0.5, 0.5, 0.7, 0 ); - qglClear( GL_COLOR_BUFFER_BIT ); - GLimp_EndFrame(); - - qglClearColor( 0.5, 0.5, 0.7, 0 ); - qglClear( GL_COLOR_BUFFER_BIT ); - GLimp_EndFrame(); - } - - Sys_UnfadeScreen(Sys_DisplayToUse(), NULL); - - CheckErrors(); - - return qtrue; -} - -/* - ================= - GetPixelAttributes - ================= - */ - -#define ADD_ATTR(x) \ -do { \ - if (attributeIndex >= attributeSize) { \ - attributeSize *= 2; \ - pixelAttributes = NSZoneRealloc(NULL, pixelAttributes, sizeof(*pixelAttributes) * attributeSize); \ - } \ - pixelAttributes[attributeIndex] = x; \ - attributeIndex++; \ - if (verbose) { \ - ri.Printf(PRINT_ALL, "Adding pixel attribute: %d (%s)\n", x, #x); \ - } \ -} while(0) - -static NSOpenGLPixelFormatAttribute *GetPixelAttributes() -{ - NSOpenGLPixelFormatAttribute *pixelAttributes; - unsigned int attributeIndex = 0; - unsigned int attributeSize = 128; - int verbose = 0; - unsigned int colorDepth; - - verbose = r_verbose->integer; - - pixelAttributes = NSZoneMalloc(NULL, sizeof(*pixelAttributes) * attributeSize); - - if (r_fullscreen->integer) { - ADD_ATTR(NSOpenGLPFAFullScreen); - - // Since we are fullscreen, specify the screen that we need. - ADD_ATTR(NSOpenGLPFAScreenMask); - ADD_ATTR(CGDisplayIDToOpenGLDisplayMask(Sys_DisplayToUse())); - } - - // Require hardware acceleration unless otherwise directed - if (!r_allowSoftwareGL->integer) { - ADD_ATTR(NSOpenGLPFAAccelerated); - } - - // Require double-buffer - ADD_ATTR(NSOpenGLPFADoubleBuffer); - - // Specify the number of color bits. If we don't have a valid specified value or we are not full screen, use the current display mode's value. - ADD_ATTR(NSOpenGLPFAColorSize); - colorDepth = r_colorbits->integer; - if (colorDepth < 16) - colorDepth = 16; - else if (colorDepth > 16) - colorDepth = 32; - if (!r_fullscreen->integer) - colorDepth = [[glw_state.desktopMode objectForKey: (id)kCGDisplayBitsPerPixel] intValue]; - ADD_ATTR(colorDepth); - - // Specify the number of depth bits - ADD_ATTR(NSOpenGLPFADepthSize); - ADD_ATTR(r_depthbits->integer ? r_depthbits->integer : 16); - - // Specify the number of stencil bits - if (r_stencilbits->integer) { - ADD_ATTR(NSOpenGLPFAStencilSize); - ADD_ATTR(r_stencilbits->integer); - } - - // Terminate the list - ADD_ATTR(0); - - return pixelAttributes; -} - -// Needs to be visible to Q3Controller.m. -void Sys_UpdateWindowMouseInputRect(void) -{ - NSRect windowRect, screenRect; - NSScreen *screen; - - // It appears we need to flip the coordinate system here. This means we need - // to know the size of the screen. - screen = [glw_state.window screen]; - screenRect = [screen frame]; - windowRect = [glw_state.window frame]; - windowRect.origin.y = screenRect.size.height - (windowRect.origin.y + windowRect.size.height); - - Sys_SetMouseInputRect(CGRectMake(windowRect.origin.x, windowRect.origin.y, - windowRect.size.width, windowRect.size.height)); -} - -// This is needed since CGReleaseAllDisplays() restores the gamma on the displays and we want to fade it up rather than just flickering all the displays -static void ReleaseAllDisplays() -{ - CGDisplayCount displayIndex; - - Com_Printf("Releasing displays\n"); - for (displayIndex = 0; displayIndex < glw_state.displayCount; displayIndex++) { - CGDisplayRelease(glw_state.originalDisplayGammaTables[displayIndex].display); - } -} - -/* -================= -CreateGameWindow -================= -*/ -static qboolean CreateGameWindow( qboolean isSecondTry ) -{ - const char *windowed[] = { "Windowed", "Fullscreen" }; - int current_mode; - NSOpenGLPixelFormatAttribute *pixelAttributes; - NSOpenGLPixelFormat *pixelFormat; - CGDisplayErr err; - - - // get mode info - current_mode = r_mode->integer; - glConfig.isFullscreen = (r_fullscreen->integer != 0); - - glw_state.desktopMode = (NSDictionary *)CGDisplayCurrentMode(glw_state.display); - if (!glw_state.desktopMode) { - ri.Error(ERR_FATAL, "Could not get current graphics mode for display 0x%08x\n", glw_state.display); - } - -#if 0 - ri.Printf( PRINT_ALL, "... desktop mode %d = %dx%d %s\n", glw_state.desktopMode, - glw_state.desktopDesc.width, glw_state.desktopDesc.height, - depthStrings[glw_state.desktopDesc.depth]); -#endif - - ri.Printf( PRINT_ALL, "...setting mode %d:\n", current_mode ); - if ( !R_GetModeInfo( &glConfig.vidWidth, &glConfig.vidHeight, &glConfig.windowAspect, current_mode ) ) { - ri.Printf( PRINT_ALL, " invalid mode\n" ); - return qfalse; - } - ri.Printf( PRINT_ALL, " %d %d %s\n", glConfig.vidWidth, glConfig.vidHeight, windowed[glConfig.isFullscreen] ); - - if (glConfig.isFullscreen) { - - // We'll set up the screen resolution first in case that effects the list of pixel - // formats that are available (for example, a smaller frame buffer might mean more - // bits for depth/stencil buffers). Allow stretched video modes if we are in fallback mode. - glw_state.gameMode = Sys_GetMatchingDisplayMode(isSecondTry); - if (!glw_state.gameMode) { - ri.Printf( PRINT_ALL, "Unable to find requested display mode.\n"); - return qfalse; - } - - // Fade all screens to black - Sys_FadeScreens(); - - err = Sys_CaptureActiveDisplays(); - if ( err != CGDisplayNoErr ) { - CGDisplayRestoreColorSyncSettings(); - ri.Printf( PRINT_ALL, " Unable to capture displays err = %d\n", err ); - return qfalse; - } - - err = CGDisplaySwitchToMode(glw_state.display, (CFDictionaryRef)glw_state.gameMode); - if ( err != CGDisplayNoErr ) { - CGDisplayRestoreColorSyncSettings(); - ReleaseAllDisplays(); - ri.Printf( PRINT_ALL, " Unable to set display mode, err = %d\n", err ); - return qfalse; - } - } else { - glw_state.gameMode = glw_state.desktopMode; - } - - - // Get the GL pixel format - pixelAttributes = GetPixelAttributes(); - pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes: pixelAttributes] autorelease]; - NSZoneFree(NULL, pixelAttributes); - - if (!pixelFormat) { - CGDisplayRestoreColorSyncSettings(); - CGDisplaySwitchToMode(glw_state.display, (CFDictionaryRef)glw_state.desktopMode); - ReleaseAllDisplays(); - ri.Printf( PRINT_ALL, " No pixel format found\n"); - return qfalse; - } - - // Create a context with the desired pixel attributes - OSX_SetGLContext([[NSOpenGLContext alloc] initWithFormat: pixelFormat shareContext: nil]); - if (!OSX_GetNSGLContext()) { - CGDisplayRestoreColorSyncSettings(); - CGDisplaySwitchToMode(glw_state.display, (CFDictionaryRef)glw_state.desktopMode); - ReleaseAllDisplays(); - ri.Printf(PRINT_ALL, "... +[NSOpenGLContext createWithFormat:share:] failed.\n" ); - return qfalse; - } - - if (!glConfig.isFullscreen) { - cvar_t *vid_xpos; - cvar_t *vid_ypos; - NSRect windowRect; - - vid_xpos = ri.Cvar_Get( "vid_xpos", "100", CVAR_ARCHIVE ); - vid_ypos = ri.Cvar_Get( "vid_ypos", "100", CVAR_ARCHIVE ); - - // Create a window of the desired size - windowRect.origin.x = vid_xpos->integer; - windowRect.origin.y = vid_ypos->integer; - windowRect.size.width = glConfig.vidWidth; - windowRect.size.height = glConfig.vidHeight; - - glw_state.window = [[NSWindow alloc] initWithContentRect:windowRect - styleMask:NSTitledWindowMask - backing:NSBackingStoreRetained - defer:NO]; - - [glw_state.window setTitle: @"Quake3"]; - - [glw_state.window orderFront: nil]; - - // Always get mouse moved events (if mouse support is turned off (rare) - // the event system will filter them out. - [glw_state.window setAcceptsMouseMovedEvents: YES]; - - // Direct the context to draw in this window - [OSX_GetNSGLContext() setView: [glw_state.window contentView]]; - - // Sync input rect with where the window actually is... - Sys_UpdateWindowMouseInputRect(); - } else { - CGLError err; - - err = CGLSetFullScreen(OSX_GetCGLContext()); - if (err) { - CGDisplayRestoreColorSyncSettings(); - CGDisplaySwitchToMode(glw_state.display, (CFDictionaryRef)glw_state.desktopMode); - ReleaseAllDisplays(); - Com_Printf("CGLSetFullScreen -> %d (%s)\n", err, CGLErrorString(err)); - return qfalse; - } - - Sys_SetMouseInputRect(CGDisplayBounds(glw_state.display)); - } - - -#ifndef USE_CGLMACROS - // Make this the current context - OSX_GLContextSetCurrent(); -#endif - - // Store off the pixel format attributes that we actually got - [pixelFormat getValues: (long *) &glConfig.colorBits forAttribute: NSOpenGLPFAColorSize forVirtualScreen: 0]; - [pixelFormat getValues: (long *) &glConfig.depthBits forAttribute: NSOpenGLPFADepthSize forVirtualScreen: 0]; - [pixelFormat getValues: (long *) &glConfig.stencilBits forAttribute: NSOpenGLPFAStencilSize forVirtualScreen: 0]; - - glConfig.displayFrequency = [[glw_state.gameMode objectForKey: (id)kCGDisplayRefreshRate] intValue]; - - - ri.Printf(PRINT_ALL, "ok\n" ); - - return qtrue; -} - -// This can be used to temporarily disassociate the GL context from the screen so that CoreGraphics can be used to draw to the screen. -void Sys_PauseGL () -{ - if (!glw_state.glPauseCount) { - qglFinish (); // must do this to ensure the queue is complete - - // Have to call both to actually deallocate kernel resources and free the NSSurface - CGLClearDrawable(OSX_GetCGLContext()); - [OSX_GetNSGLContext() clearDrawable]; - } - glw_state.glPauseCount++; -} - -// This can be used to reverse the pausing caused by Sys_PauseGL() -void Sys_ResumeGL () -{ - if (glw_state.glPauseCount) { - glw_state.glPauseCount--; - if (!glw_state.glPauseCount) { - if (!glConfig.isFullscreen) { - [OSX_GetNSGLContext() setView: [glw_state.window contentView]]; - } else { - CGLError err; - - err = CGLSetFullScreen(OSX_GetCGLContext()); - if (err) - Com_Printf("CGLSetFullScreen -> %d (%s)\n", err, CGLErrorString(err)); - } - } - } -} - -/* -=================== -GLimp_Init - -Don't return unless OpenGL has been properly initialized -=================== -*/ - -static void GLImp_Toggle_Renderer_f(void) -{ - ri.Cvar_Set("r_enablerender", r_enablerender->integer ? "0" : "1"); -} - -#ifdef OMNI_TIMER -static void GLImp_Dump_Stamp_List_f(void) -{ - OTStampListDumpToFile(glThreadStampList, "/tmp/gl_stamps"); -} -#endif - -void GLimp_Init( void ) -{ - static BOOL addedCommands = NO; - cvar_t *lastValidRenderer = ri.Cvar_Get( "r_lastValidRenderer", "(uninitialized)", CVAR_ARCHIVE ); - char *buf; - - if (!addedCommands) { - addedCommands = YES; - -#ifdef OMNI_TIMER - glThreadStampList = OTStampListCreate(64); - Cmd_AddCommand ("dump_stamp_list", GLImp_Dump_Stamp_List_f); -#endif - Cmd_AddCommand ("toggle_renderer", GLImp_Toggle_Renderer_f); - } - - ri.Printf( PRINT_ALL, "Initializing OpenGL subsystem\n" ); - ri.Printf( PRINT_ALL, " Last renderer was '%s'\n", lastValidRenderer->string); - ri.Printf( PRINT_ALL, " r_fullscreen = %d\n", r_fullscreen->integer); - - memset( &glConfig, 0, sizeof( glConfig ) ); - - // We only allow changing the gamma if we are full screen - glConfig.deviceSupportsGamma = (r_fullscreen->integer != 0); - if (glConfig.deviceSupportsGamma) { - Sys_StoreGammaTables(); - } - - r_allowSoftwareGL = ri.Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH ); - r_enablerender = ri.Cvar_Get("r_enablerender", "1", 0 ); - - if (Sys_QueryVideoMemory() == 0 && !r_allowSoftwareGL->integer) { - ri.Error( ERR_FATAL, "Could not initialize OpenGL. There does not appear to be an OpenGL-supported video card in your system.\n" ); - } - - if ( ! GLimp_SetMode(qfalse) ) { - // fall back to the known-good mode - ri.Cvar_Set( "r_fullscreen", "1" ); - ri.Cvar_Set( "r_mode", "3" ); - ri.Cvar_Set( "r_stereo", "0" ); - ri.Cvar_Set( "r_depthBits", "16" ); - ri.Cvar_Set( "r_colorBits", "16" ); - ri.Cvar_Set( "r_stencilBits", "0" ); - if ( GLimp_SetMode(qtrue) ) { - ri.Printf( PRINT_ALL, "------------------\n" ); - return; - } - - ri.Error( ERR_FATAL, "Could not initialize OpenGL\n" ); - return; - } - - ri.Printf( PRINT_ALL, "------------------\n" ); - - // get our config strings - Q_strncpyz( glConfig.vendor_string, (const char *)qglGetString (GL_VENDOR), sizeof( glConfig.vendor_string ) ); - Q_strncpyz( glConfig.renderer_string, (const char *)qglGetString (GL_RENDERER), sizeof( glConfig.renderer_string ) ); - Q_strncpyz( glConfig.version_string, (const char *)qglGetString (GL_VERSION), sizeof( glConfig.version_string ) ); - Q_strncpyz( glConfig.extensions_string, (const char *)qglGetString (GL_EXTENSIONS), sizeof( glConfig.extensions_string ) ); - - // - // chipset specific configuration - // - buf = malloc(strlen(glConfig.renderer_string) + 1); - strcpy( buf, glConfig.renderer_string ); - Q_strlwr( buf ); - - ri.Cvar_Set( "r_lastValidRenderer", glConfig.renderer_string ); - free(buf); - - GLW_InitExtensions(); - -#ifndef USE_CGLMACROS - if (!r_enablerender->integer) - OSX_GLContextClearCurrent(); -#endif -} - - -/* -** GLimp_EndFrame -** -** Responsible for doing a swapbuffers and possibly for other stuff -** as yet to be determined. Probably better not to make this a GLimp -** function and instead do a call to GLimp_SwapBuffers. -*/ -void GLimp_EndFrame (void) -{ - GLSTAMP("GLimp_EndFrame start", 0); - - // - // swapinterval stuff - // - if ( r_swapInterval->modified ) { - r_swapInterval->modified = qfalse; - - if ( !glConfig.stereoEnabled ) { // why? - [[NSOpenGLContext currentContext] setValues: (long *)&r_swapInterval->integer - forParameter: NSOpenGLCPSwapInterval]; - } - } - -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - QGLCheckError("GLimp_EndFrame"); -#endif - - if (!glw_state.glPauseCount && !Sys_IsHidden) { - glw_state.bufferSwapCount++; - [OSX_GetNSGLContext() flushBuffer]; - } - - // Enable turning off GL at any point for performance testing - if (OSX_GLContextIsCurrent() != r_enablerender->integer) { - if (r_enablerender->integer) { - Com_Printf("--- Enabling Renderer ---\n"); - OSX_GLContextSetCurrent(); - } else { - Com_Printf("--- Disabling Renderer ---\n"); - OSX_GLContextClearCurrent(); - } - } - - GLSTAMP("GLimp_EndFrame end", 0); -} - -/* -** GLimp_Shutdown -** -** This routine does all OS specific shutdown procedures for the OpenGL -** subsystem. Under OpenGL this means NULLing out the current DC and -** HGLRC, deleting the rendering context, and releasing the DC acquired -** for the window. The state structure is also nulled out. -** -*/ - -static void _GLimp_RestoreOriginalVideoSettings() -{ - CGDisplayErr err; - - // CGDisplayCurrentMode lies because we've captured the display and thus we won't - // get any notifications about what the current display mode really is. For now, - // we just always force it back to what mode we remember the desktop being in. - if (glConfig.isFullscreen) { - err = CGDisplaySwitchToMode(glw_state.display, (CFDictionaryRef)glw_state.desktopMode); - if ( err != CGDisplayNoErr ) - ri.Printf( PRINT_ALL, " Unable to restore display mode!\n" ); - - ReleaseAllDisplays(); - } -} - -void GLimp_Shutdown( void ) -{ - CGDisplayCount displayIndex; - - Com_Printf("----- Shutting down GL -----\n"); - - Sys_FadeScreen(Sys_DisplayToUse()); - - if (OSX_GetNSGLContext()) { -#ifndef USE_CGLMACROS - OSX_GLContextClearCurrent(); -#endif - // Have to call both to actually deallocate kernel resources and free the NSSurface - CGLClearDrawable(OSX_GetCGLContext()); - [OSX_GetNSGLContext() clearDrawable]; - - [OSX_GetNSGLContext() release]; - OSX_SetGLContext((id)nil); - } - - _GLimp_RestoreOriginalVideoSettings(); - - Sys_UnfadeScreens(); - - // Restore the original gamma if needed. - if (glConfig.deviceSupportsGamma) { - Com_Printf("Restoring ColorSync settings\n"); - CGDisplayRestoreColorSyncSettings(); - } - - if (glw_state.window) { - [glw_state.window release]; - glw_state.window = nil; - } - - if (glw_state.log_fp) { - fclose(glw_state.log_fp); - glw_state.log_fp = 0; - } - - for (displayIndex = 0; displayIndex < glw_state.displayCount; displayIndex++) { - free(glw_state.originalDisplayGammaTables[displayIndex].red); - free(glw_state.originalDisplayGammaTables[displayIndex].blue); - free(glw_state.originalDisplayGammaTables[displayIndex].green); - } - free(glw_state.originalDisplayGammaTables); - if (glw_state.tempTable.red) { - free(glw_state.tempTable.red); - free(glw_state.tempTable.blue); - free(glw_state.tempTable.green); - } - if (glw_state.inGameTable.red) { - free(glw_state.inGameTable.red); - free(glw_state.inGameTable.blue); - free(glw_state.inGameTable.green); - } - - memset(&glConfig, 0, sizeof(glConfig)); - memset(&glState, 0, sizeof(glState)); - memset(&glw_state, 0, sizeof(glw_state)); - - Com_Printf("----- Done shutting down GL -----\n"); -} - -/* -=============== -GLimp_LogComment - -=============== -*/ -void GLimp_LogComment( char *comment ) { - } - -/* -=============== -GLimp_SetGamma - -=============== -*/ -void GLimp_SetGamma(unsigned char red[256], - unsigned char green[256], - unsigned char blue[256]) -{ - CGGammaValue redGamma[256], greenGamma[256], blueGamma[256]; - CGTableCount i; - CGDisplayErr err; - - if (!glConfig.deviceSupportsGamma) - return; - - for (i = 0; i < 256; i++) { - redGamma[i] = red[i] / 255.0; - greenGamma[i] = green[i] / 255.0; - blueGamma[i] = blue[i] / 255.0; - } - - err = CGSetDisplayTransferByTable(glw_state.display, 256, redGamma, greenGamma, blueGamma); - if (err != CGDisplayNoErr) { - Com_Printf("GLimp_SetGamma: CGSetDisplayTransferByByteTable returned %d.\n", err); - } - - // Store the gamma table that we ended up using so we can reapply it later when unhiding or to work around the bug where if you leave the game sitting and the monitor sleeps, when it wakes, the gamma isn't reset. - glw_state.inGameTable.display = glw_state.display; - Sys_GetGammaTable(&glw_state.inGameTable); -} - -qboolean GLimp_ChangeMode( int mode ) -{ - qboolean result; - int oldvalue = r_mode->integer; - - Com_Printf("*** GLimp_ChangeMode\n"); - r_mode->integer = mode; - if (!(result = GLimp_SetMode(qfalse))) - r_mode->integer = oldvalue; - - return result; -} - -/*****************************************************************************/ - -void *qwglGetProcAddress(const char *name) -{ - NSSymbol symbol; - char *symbolName; - - // Prepend a '_' for the Unix C symbol mangling convention - symbolName = malloc(strlen(name) + 2); - strcpy(symbolName + 1, name); - symbolName[0] = '_'; - - if (NSIsSymbolNameDefined(symbolName)) - symbol = NSLookupAndBindSymbol(symbolName); - else - symbol = NULL; - - free(symbolName); - - if (!symbol) - // shouldn't happen ... - return NULL; - - return NSAddressOfSymbol(symbol); -} - -/* -** GLW_InitExtensions -*/ -static void GLW_InitExtensions( void ) -{ - if ( !r_allowExtensions->integer ) - { - ri.Printf( PRINT_ALL, "*** IGNORING OPENGL EXTENSIONS ***\n" ); - return; - } - - ri.Printf( PRINT_ALL, "Initializing OpenGL extensions\n" ); - ri.Printf( PRINT_ALL, "... Supported extensions are %s\n", glConfig.extensions_string); - - // GL_S3_s3tc - glConfig.textureCompression = TC_NONE; - if ( strstr( glConfig.extensions_string, "GL_S3_s3tc" ) ) - { - if ( r_ext_compressed_textures->integer ) - { - glConfig.textureCompression = TC_S3TC; - ri.Printf( PRINT_ALL, "...using GL_S3_s3tc\n" ); - } - else - { - glConfig.textureCompression = TC_NONE; - ri.Printf( PRINT_ALL, "...ignoring GL_S3_s3tc\n" ); - } - } - else - { - ri.Printf( PRINT_ALL, "...GL_S3_s3tc not found\n" ); - } - - -#ifdef GL_EXT_texture_env_add - // GL_EXT_texture_env_add - glConfig.textureEnvAddAvailable = qfalse; - if ( strstr( glConfig.extensions_string, "GL_EXT_texture_env_add" ) ) - { - if ( r_ext_texture_env_add->integer ) - { - glConfig.textureEnvAddAvailable = qtrue; - ri.Printf( PRINT_ALL, "...using GL_EXT_texture_env_add\n" ); - } - else - { - glConfig.textureEnvAddAvailable = qfalse; - ri.Printf( PRINT_ALL, "...ignoring GL_EXT_texture_env_add\n" ); - } - } - else - { - ri.Printf( PRINT_ALL, "...GL_EXT_texture_env_add not found\n" ); - } -#endif - -#ifdef GL_ARB_texture_env_add - // GL_ARB_texture_env_add -- only if we didn't find GL_EXT_texture_env_add - if (!glConfig.textureEnvAddAvailable) { - if ( strstr( glConfig.extensions_string, "GL_ARB_texture_env_add" ) ) - { - if ( r_ext_texture_env_add->integer ) - { - glConfig.textureEnvAddAvailable = qtrue; - ri.Printf( PRINT_ALL, "...using GL_ARB_texture_env_add\n" ); - } - else - { - glConfig.textureEnvAddAvailable = qfalse; - ri.Printf( PRINT_ALL, "...ignoring GL_ARB_texture_env_add\n" ); - } - } - else - { - ri.Printf( PRINT_ALL, "...GL_ARB_texture_env_add not found\n" ); - } - } -#endif - - -#if 0 // Win32 does this differently than we do -- I'll provide a C function that looks the same - // that will do the correct ObjC stuff - // WGL_EXT_swap_control - qwglSwapIntervalEXT = ( BOOL (WINAPI *)(int)) qwglGetProcAddress( "wglSwapIntervalEXT" ); - if ( qwglSwapIntervalEXT ) - { - ri.Printf( PRINT_ALL, "...using WGL_EXT_swap_control\n" ); - r_swapInterval->modified = qtrue; // force a set next frame - } - else - { - ri.Printf( PRINT_ALL, "...WGL_EXT_swap_control not found\n" ); - } -#else - if (r_swapInterval) { - ri.Printf( PRINT_ALL, "...using +[NSOpenGLContext setParameter:] for qwglSwapIntervalEXT\n" ); - r_swapInterval->modified = qtrue; // force a set next frame - } -#endif - - // GL_ARB_multitexture - qglMultiTexCoord2fARB = NULL; - qglActiveTextureARB = NULL; - qglClientActiveTextureARB = NULL; - if ( strstr( glConfig.extensions_string, "GL_ARB_multitexture" ) ) - { - if ( r_ext_multitexture->integer ) - { - qglMultiTexCoord2fARB = ( PFNGLMULTITEXCOORD2FARBPROC ) qwglGetProcAddress( "glMultiTexCoord2fARB" ); - qglActiveTextureARB = ( PFNGLACTIVETEXTUREARBPROC ) qwglGetProcAddress( "glActiveTextureARB" ); - qglClientActiveTextureARB = ( PFNGLCLIENTACTIVETEXTUREARBPROC ) qwglGetProcAddress( "glClientActiveTextureARB" ); - - if ( qglActiveTextureARB ) - { - qglGetIntegerv( GL_MAX_ACTIVE_TEXTURES_ARB, (GLint *)&glConfig.maxActiveTextures ); - - if ( glConfig.maxActiveTextures > 1 ) - { - ri.Printf( PRINT_ALL, "...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" ); - } - } - } - else - { - ri.Printf( PRINT_ALL, "...ignoring GL_ARB_multitexture\n" ); - } - } - else - { - ri.Printf( PRINT_ALL, "...GL_ARB_multitexture not found\n" ); - } - - // GL_EXT_compiled_vertex_array - qglLockArraysEXT = NULL; - qglUnlockArraysEXT = NULL; - if ( strstr( glConfig.extensions_string, "GL_EXT_compiled_vertex_array" ) && ( glConfig.hardwareType != GLHW_RIVA128 ) ) - { - if ( r_ext_compiled_vertex_array->integer ) - { - ri.Printf( PRINT_ALL, "...using GL_EXT_compiled_vertex_array\n" ); - qglLockArraysEXT = ( void ( APIENTRY * )( GLint, GLint ) ) qwglGetProcAddress( "glLockArraysEXT" ); - qglUnlockArraysEXT = ( void ( APIENTRY * )( void ) ) qwglGetProcAddress( "glUnlockArraysEXT" ); - if (!qglLockArraysEXT || !qglUnlockArraysEXT) { - ri.Error (ERR_FATAL, "bad getprocaddress\n"); - } - } - else - { - ri.Printf( PRINT_ALL, "...ignoring GL_EXT_compiled_vertex_array\n" ); - } - } - else - { - ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" ); - } - -#ifdef GL_APPLE_transform_hint - if ( strstr( glConfig.extensions_string, "GL_APPLE_transform_hint" ) ) { - r_appleTransformHint = ri.Cvar_Get("r_appleTransformHint", "1", CVAR_ARCHIVE ); - if (r_appleTransformHint->value) { - ri.Printf( PRINT_ALL, "...using GL_APPLE_transform_hint\n"); - qglHint(GL_TRANSFORM_HINT_APPLE, GL_FASTEST); - CheckErrors(); - } else { - ri.Printf( PRINT_ALL, "...ignoring using GL_APPLE_transform_hint\n"); - } - } else { - ri.Printf( PRINT_ALL, "...GL_APPLE_transform_hint not found\n" ); - } -#endif -} - - -#define MAX_RENDERER_INFO_COUNT 128 - -// Returns zero if there are no hardware renderers. Otherwise, returns the max memory across all renderers (on the presumption that the screen that we'll use has the most memory). -static unsigned long Sys_QueryVideoMemory() -{ - CGLError err; - CGLRendererInfoObj rendererInfo, rendererInfos[MAX_RENDERER_INFO_COUNT]; - long rendererInfoIndex, rendererInfoCount = MAX_RENDERER_INFO_COUNT; - long rendererIndex, rendererCount; - long maxVRAM = 0, vram; - long accelerated; - long rendererID; - long totalRenderers = 0; - - err = CGLQueryRendererInfo(CGDisplayIDToOpenGLDisplayMask(Sys_DisplayToUse()), rendererInfos, &rendererInfoCount); - if (err) { - Com_Printf("CGLQueryRendererInfo -> %d\n", err); - return vram; - } - - //Com_Printf("rendererInfoCount = %d\n", rendererInfoCount); - for (rendererInfoIndex = 0; rendererInfoIndex < rendererInfoCount && totalRenderers < rendererInfoCount; rendererInfoIndex++) { - rendererInfo = rendererInfos[rendererInfoIndex]; - //Com_Printf("rendererInfo: 0x%08x\n", rendererInfo); - - - err = CGLDescribeRenderer(rendererInfo, 0, kCGLRPRendererCount, &rendererCount); - if (err) { - Com_Printf("CGLDescribeRenderer(kCGLRPRendererID) -> %d\n", err); - continue; - } - //Com_Printf(" rendererCount: %d\n", rendererCount); - - for (rendererIndex = 0; rendererIndex < rendererCount; rendererIndex++) { - totalRenderers++; - //Com_Printf(" rendererIndex: %d\n", rendererIndex); - - rendererID = 0xffffffff; - err = CGLDescribeRenderer(rendererInfo, rendererIndex, kCGLRPRendererID, &rendererID); - if (err) { - Com_Printf("CGLDescribeRenderer(kCGLRPRendererID) -> %d\n", err); - continue; - } - //Com_Printf(" rendererID: 0x%08x\n", rendererID); - - accelerated = 0; - err = CGLDescribeRenderer(rendererInfo, rendererIndex, kCGLRPAccelerated, &accelerated); - if (err) { - Com_Printf("CGLDescribeRenderer(kCGLRPAccelerated) -> %d\n", err); - continue; - } - //Com_Printf(" accelerated: %d\n", accelerated); - if (!accelerated) - continue; - - vram = 0; - err = CGLDescribeRenderer(rendererInfo, rendererIndex, kCGLRPVideoMemory, &vram); - if (err) { - Com_Printf("CGLDescribeRenderer -> %d\n", err); - continue; - } - //Com_Printf(" vram: 0x%08x\n", vram); - - // presumably we'll be running on the best card, so we'll take the max of the vrams - if (vram > maxVRAM) - maxVRAM = vram; - } - -#if 0 - err = CGLDestroyRendererInfo(rendererInfo); - if (err) { - Com_Printf("CGLDestroyRendererInfo -> %d\n", err); - } -#endif - } - - return maxVRAM; -} - - -// We will set the Sys_IsHidden global to cause input to be handle differently (we'll just let NSApp handle events in this case). We also will unbind the GL context and restore the video mode. -qboolean Sys_Hide() -{ - if (Sys_IsHidden) - // Eh? - return qfalse; - - if (!r_fullscreen->integer) - // We only support hiding in fullscreen mode right now - return qfalse; - - Sys_IsHidden = qtrue; - - // Don't need to store the current gamma since we always keep it around in glw_state.inGameTable. - - Sys_FadeScreen(Sys_DisplayToUse()); - - // Disassociate the GL context from the screen - // Have to call both to actually deallocate kernel resources and free the NSSurface - CGLClearDrawable(OSX_GetCGLContext()); - [OSX_GetNSGLContext() clearDrawable]; - - // Restore the original video mode - _GLimp_RestoreOriginalVideoSettings(); - - // Restore the original gamma if needed. - if (glConfig.deviceSupportsGamma) { - CGDisplayRestoreColorSyncSettings(); - } - - // Release the screen(s) - ReleaseAllDisplays(); - - Sys_UnfadeScreens(); - - // Shut down the input system so the mouse and keyboard settings are restore to normal - Sys_ShutdownInput(); - - // Hide the application so that when the user clicks on our app icon, we'll get an unhide notification - [NSApp hide: nil]; - - return qtrue; -} - -static CGDisplayErr Sys_CaptureActiveDisplays(void) -{ - CGDisplayErr err; - CGDisplayCount displayIndex; - for (displayIndex = 0; displayIndex < glw_state.displayCount; displayIndex++) { - const glwgamma_t *table; - table = &glw_state.originalDisplayGammaTables[displayIndex]; - err = CGDisplayCapture(table->display); - if (err != CGDisplayNoErr) - return err; - } - return CGDisplayNoErr; -} - -qboolean Sys_Unhide() -{ - CGDisplayErr err; - CGLError glErr; - - if (!Sys_IsHidden) - // Eh? - return qfalse; - - Sys_FadeScreens(); - - // Capture the screen(s) - err = Sys_CaptureActiveDisplays(); - if (err != CGDisplayNoErr) { - Sys_UnfadeScreens(); - ri.Printf( PRINT_ALL, "Unhide failed -- cannot capture the display again.\n" ); - return qfalse; - } - - // Restore the game mode - err = CGDisplaySwitchToMode(glw_state.display, (CFDictionaryRef)glw_state.gameMode); - if ( err != CGDisplayNoErr ) { - ReleaseAllDisplays(); - Sys_UnfadeScreens(); - ri.Printf( PRINT_ALL, "Unhide failed -- Unable to set display mode\n" ); - return qfalse; - } - - // Reassociate the GL context and the screen - glErr = CGLSetFullScreen(OSX_GetCGLContext()); - if (err) { - ReleaseAllDisplays(); - Sys_UnfadeScreens(); - ri.Printf( PRINT_ALL, "Unhide failed: CGLSetFullScreen -> %d (%s)\n", err, CGLErrorString(err)); - return qfalse; - } - - // Restore the current context - [OSX_GetNSGLContext() makeCurrentContext]; - - // Restore the gamma that the game had set - Sys_UnfadeScreen(Sys_DisplayToUse(), &glw_state.inGameTable); - - // Restore the input system (last so if something goes wrong we don't eat the mouse) - Sys_InitInput(); - - Sys_IsHidden = qfalse; - return qtrue; -} - - diff --git a/code/macosx/macosx_glsmp_mutex.m b/code/macosx/macosx_glsmp_mutex.m deleted file mode 100644 index f8e1cc6..0000000 --- a/code/macosx/macosx_glsmp_mutex.m +++ /dev/null @@ -1,176 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#import "macosx_glimp.h" - -#include "tr_local.h" -#import "macosx_local.h" -#import "macosx_display.h" - -#import -#import -#import - -// -// The main Q3 SMP API -// - -static pthread_mutex_t smpMutex; -static pthread_cond_t mainThreadCondition; -static pthread_cond_t renderThreadCondition; - -static volatile qboolean smpDataChanged; -static volatile void *smpData; - - -static void *GLimp_RenderThreadWrapper(void *arg) -{ - Com_Printf("Render thread starting\n"); - - ((void (*)())arg)(); - -#ifndef USE_CGLMACROS - // Unbind the context before we die - OSX_GLContextClearCurrent(); -#endif - - Com_Printf("Render thread terminating\n"); - - return arg; -} - -qboolean GLimp_SpawnRenderThread( void (*function)( void ) ) -{ - pthread_t renderThread; - int rc; - - pthread_mutex_init(&smpMutex, NULL); - pthread_cond_init(&mainThreadCondition, NULL); - pthread_cond_init(&renderThreadCondition, NULL); - - rc = pthread_create(&renderThread, NULL, GLimp_RenderThreadWrapper, function); - if (rc) { - ri.Printf(PRINT_ALL, "pthread_create returned %d: %s", rc, strerror(rc)); - return qfalse; - } else { - rc = pthread_detach(renderThread); - if (rc) { - ri.Printf(PRINT_ALL, "pthread_detach returned %d: %s", rc, strerror(rc)); - } - } - - return qtrue; -} - -// Called in the rendering thread to wait until a command buffer is ready. -// The command buffer returned might be NULL, indicating that the rendering thread should exit. -void *GLimp_RendererSleep(void) -{ - void *data; - - GLSTAMP("GLimp_RendererSleep start", 0); - -#ifndef USE_CGLMACROS - // Clear the current context while we sleep so the main thread can access it - OSX_GLContextClearCurrent(); -#endif - - pthread_mutex_lock(&smpMutex); { - // Clear out any data we had and signal the main thread that we are no longer busy - smpData = NULL; - smpDataChanged = qfalse; - pthread_cond_signal(&mainThreadCondition); - - // Wait until we get something new to work on - while (!smpDataChanged) - pthread_cond_wait(&renderThreadCondition, &smpMutex); - - // Record the data (if any). - data = smpData; - } pthread_mutex_unlock(&smpMutex); - -#ifndef USE_CGLMACROS - // We are going to render a frame... retake the context - OSX_GLContextSetCurrent(); -#endif - - GLSTAMP("GLimp_RendererSleep end", 0); - - return (void *)data; -} - -// Called from the main thread to wait until the rendering thread is done with the command buffer. -void GLimp_FrontEndSleep(void) -{ - GLSTAMP("GLimp_FrontEndSleep start", 0); - - pthread_mutex_lock(&smpMutex); { - while (smpData) { -#if 0 - struct timespec ts; - int result; - - ts.tv_sec = 1; - ts.tv_nsec = 0; - result = pthread_cond_timedwait_relative_np(&mainThreadCondition, &smpMutex, &ts); - if (result) { - Com_Printf("GLimp_FrontEndSleep timed out. Probably due to R_SyncRenderThread called due to Com_Error being called\n"); - break; - } -#else - pthread_cond_wait(&mainThreadCondition, &smpMutex); -#endif - } - } pthread_mutex_unlock(&smpMutex); - - -#ifndef USE_CGLMACROS - // We are done waiting for the background thread, take the current context back. - OSX_GLContextSetCurrent(); -#endif - - GLSTAMP("GLimp_FrontEndSleep end", 0); -} - -// This is called in the main thread to issue another command -// buffer to the rendering thread. This is always called AFTER -// GLimp_FrontEndSleep, so we know that there is no command -// pending in 'smpData'. -void GLimp_WakeRenderer( void *data ) -{ - GLSTAMP("GLimp_WakeRenderer start", data); - -#ifndef USE_CGLMACROS - // We want the background thread to draw stuff. Give up the current context - OSX_GLContextClearCurrent(); -#endif - - pthread_mutex_lock(&smpMutex); { - // Store the new data pointer and wake up the rendering thread - assert(smpData == NULL); - smpData = data; - smpDataChanged = qtrue; - pthread_cond_signal(&renderThreadCondition); - } pthread_mutex_unlock(&smpMutex); - - GLSTAMP("GLimp_WakeRenderer end", data); -} - diff --git a/code/macosx/macosx_glsmp_null.m b/code/macosx/macosx_glsmp_null.m deleted file mode 100644 index a0cb7b1..0000000 --- a/code/macosx/macosx_glsmp_null.m +++ /dev/null @@ -1,46 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#import "macosx_glimp.h" - -#include "tr_local.h" -#import "macosx_local.h" - -qboolean GLimp_SpawnRenderThread( void (*function)( void ) ) -{ - return qfalse; -} - -void *GLimp_RendererSleep(void) -{ - return NULL; -} - -void GLimp_FrontEndSleep(void) -{ - -} - -void GLimp_WakeRenderer( void *data ) -{ - -} - diff --git a/code/macosx/macosx_glsmp_ports.m b/code/macosx/macosx_glsmp_ports.m deleted file mode 100644 index 8f39a4e..0000000 --- a/code/macosx/macosx_glsmp_ports.m +++ /dev/null @@ -1,425 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#import "macosx_glimp.h" - -#include "tr_local.h" -#import "macosx_local.h" -#import "macosx_display.h" - -#import -#import -#import -#import - - -#warning Using Mach Ports SMP acceleration implementation - -/* -=========================================================== - -SMP acceleration - -=========================================================== -*/ - -#import - -#define USE_MACH_PORTS 1 - -// This is a small cover layer that makes for easier calling - -typedef struct _MsgPort { -#if USE_MACH_PORTS - mach_port_t port; - id nsPort; -#else - pthread_mutex_t mutex; - pthread_cond_t condition; - volatile unsigned int status; - unsigned int msgCode; - void *msgData; -#endif -} MsgPort; - -static BOOL portsInited = NO; -static pthread_mutex_t logMutex; - -static unsigned int renderMsgOutstanding; -static unsigned int rendererProcessingCommand; - -static MsgPort rendererMsgPort; -static MsgPort frontEndMsgPort; - -enum { - MsgNone, - MsgPending, -}; - -enum { - MsgCodeInvalid = 0, - RenderCommandMsg = 1, - RenderCompletedMsg = 2, -}; - -static /*inline*/ void MsgPortInit(MsgPort *port) -{ -#if USE_MACH_PORTS - port->nsPort = [[NSMachPort alloc] init]; - port->port = [port->nsPort machPort]; - - //rc = mach_port_allocate(mach_task_self(), MACH_PORT_TYPE_SEND_RECEIVE, &port->port); - //if (rc) { - // fprintf(stderr, "MsgPortInit: mach_port_allocate returned: %d: %s \n",rc, mach_error_string(rc)); - // } -#else - int rc; - rc = pthread_mutex_init(&port->mutex, NULL); - if (rc) { - ri.Printf(PRINT_ALL, "MsgPortInit: pthread_mutex_init returned: %d: %s\n", rc, strerror(rc)); - } - rc = pthread_cond_init(&port->condition, NULL); - if (rc) { - ri.Printf(PRINT_ALL, "EventInit: pthread_cond_init returned %d: %s\n", rc, strerror(rc)); - } - port->status = MsgNone; - port->msgCode = MsgCodeInvalid; - port->msgData = NULL; -#endif -} - -static /*inline*/ void _SendMsg(MsgPort *port, unsigned int msgCode, void *msgData, - const char *functionName, const char *portName, const char *msgName) -{ - int rc; - -#if USE_MACH_PORTS - mach_msg_header_t msg; - - //printf("SendMsg: %s %s %s (%d %08lx)\n",functionName, portName, msgName, msgCode, msgData); -/* - typedef struct - { - mach_msg_bits_t msgh_bits; - mach_msg_size_t msgh_size; - mach_port_t msgh_remote_port; - mach_port_t msgh_local_port; - mach_msg_size_t msgh_reserved; - mach_msg_id_t msgh_id; - } mach_msg_header_t; -*/ - msg.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND,MACH_MSG_TYPE_MAKE_SEND_ONCE); - msg.msgh_size=sizeof(msg); - //msg.msg_type=MSG_TYPE_NORMAL; - msg.msgh_local_port=MACH_PORT_NULL; - msg.msgh_remote_port=port->port; - msg.msgh_reserved = 0; - msg.msgh_id=(mach_msg_id_t)msgData; // HACK - - rc = mach_msg_send(&msg); - if(rc) { - fprintf(stderr,"SendMsg: mach_msg_send returned %d: %s\n", rc, mach_error_string(rc)); - } -#else - //printf("SendMsg: %s %s %s (%d %08lx)\n",functionName, portName, msgName, msgCode, msgData); - rc = pthread_mutex_lock(&port->mutex); - if(rc) { - fprintf(stderr,"SendMsg: pthread_mutex_lock returned %d: %s\n", rc, strerror(rc)); - } - - /* Block until port is empty */ - while(port->status != MsgNone) { - //fprintf(stderr, "SendMsg: %s blocking until port %s is empty\n", functionName, portName); - rc = pthread_cond_wait(&port->condition, &port->mutex); - if(rc) { - fprintf(stderr, "SendMsg: pthread_cond_wait returned %d: %s\n", rc, strerror(rc)); - } - } - - /* Queue msg */ - port->msgCode = msgCode; - port->msgData = msgData; - port->status = MsgPending; - - /* Unlock port */ - rc = pthread_mutex_unlock(&port->mutex); - if(rc) { - fprintf(stderr, "SendMsg: pthread_mutex_unlock returned %d: %s\n", rc, strerror(rc)); - } - - /* Wake up any threads blocked waiting for a message */ - rc = pthread_cond_broadcast(&port->condition); - if(rc) { - fprintf(stderr, "SendMsg: pthread_cond_broadcast returned %d: %s\n", rc, strerror(rc)); - } -#endif -} - -static /*inline*/ void _WaitMsg(MsgPort *port, unsigned int *msgCode, void **msgData, - const char *functionName, const char *portName) -{ - int rc; -#if USE_MACH_PORTS - mach_msg_empty_rcv_t msg; - - //printf("WaitMsg: %s %s\n",functionName, portName); - - msg.header.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND,MACH_MSG_TYPE_MAKE_SEND_ONCE); - msg.header.msgh_size= sizeof(msg); - //msg.msg_type=MSG_TYPE_NORMAL; - msg.header.msgh_local_port=port->port; - msg.header.msgh_remote_port=MACH_PORT_NULL; - msg.header.msgh_reserved = 0; - msg.header.msgh_id=(mach_msg_id_t)msgData; // HACK - - rc = mach_msg_receive(&msg.header); - if(rc) { - fprintf(stderr,"SendMsg: mach_msg_receive returned %d: %s\n", rc, mach_error_string(rc)); - } - - *msgData = (void *)msg.header.msgh_id; - //printf("WaitMsg: %s %s got %08lx\n",functionName, portName, *msgData); -#else - //printf("WaitMsg: %s %s\n",functionName, portName); - - rc = pthread_mutex_lock(&port->mutex); - if(rc) { - fprintf(stderr, "WaitMsg: pthread_mutex_lock returned %d: %s\n", rc, strerror(rc)); - } - - /* Block until port is empty */ - while(port->status != MsgPending) { - rc = pthread_cond_wait(&port->condition, &port->mutex); - if(rc) { - fprintf(stderr, "WaitMsg: pthread_cond_wait returned %d: %s\n", rc, strerror(rc)); - } - } - - /* Remove msg */ - *msgCode = port->msgCode; - *msgData = port->msgData; - - //printf("WaitMsg: %s %s got %d %08lx\n",functionName, portName, *msgCode, *msgData); - - port->status = MsgNone; - port->msgCode = 0; - port->msgData = NULL; - - rc = pthread_mutex_unlock(&port->mutex); - if(rc) { - fprintf(stderr, "WaitMsg: pthread_mutex_unlock returned %d: %s\n", rc, strerror(rc)); - } - - /* Wake up any threads blocked waiting for port to be empty. */ - rc = pthread_cond_broadcast(&port->condition); - if(rc) { - fprintf(stderr, "SendMsg: pthread_cond_broadcast returned %d: %s\n", rc, strerror(rc)); - } -#endif -} - - -#define SendMsg(p, c, d) _SendMsg(p, c, d, __PRETTY_FUNCTION__, #p, #c) -#define WaitMsg(p, c, d) _WaitMsg(p, c, d, __PRETTY_FUNCTION__, #p) - -#if 0 -static void _Log(const char *msg) -{ - int rc; - - rc = pthread_mutex_lock(&logMutex); - if (rc) - ri.Printf(PRINT_ALL, "_Log: pthread_mutex_lock returned %d: %s\n", rc, strerror(rc)); - - fputs(msg,stderr); - fflush(stderr); - - rc = pthread_mutex_unlock(&logMutex); - if (rc) - ri.Printf(PRINT_ALL, "_Log: pthread_mutex_unlock returned %d: %s\n", rc, strerror(rc)); -} -#endif - - -// -// The main Q3 SMP API -// - -static void (*glimpRenderThread)( void ) = NULL; - -static void *GLimp_RenderThreadWrapper(void *arg) -{ - Com_Printf("Render thread starting\n"); - - glimpRenderThread(); - -#ifndef USE_CGLMACROS - // Unbind the context before we die - OSX_GLContextClearCurrent(); -#endif - - // Send one last message back to front end before we die... - // This is somewhat of a hack.. fixme. - if (rendererProcessingCommand) { - SendMsg(&frontEndMsgPort, RenderCompletedMsg, NULL); - rendererProcessingCommand = NO; - } - - Com_Printf("Render thread terminating\n"); - - return arg; -} - -qboolean GLimp_SpawnRenderThread( void (*function)( void ) ) -{ - pthread_t renderThread; - int rc; - - if (!portsInited) { - portsInited = YES; - MsgPortInit(&rendererMsgPort); - MsgPortInit(&frontEndMsgPort); - renderMsgOutstanding = NO; - rendererProcessingCommand = NO; - pthread_mutex_init(&logMutex, NULL); - } - - glimpRenderThread = function; - - rc = pthread_create(&renderThread, - NULL, // attributes - GLimp_RenderThreadWrapper, - NULL); // argument - if (rc) { - ri.Printf(PRINT_ALL, "pthread_create returned %d: %s", rc, strerror(rc)); - return qfalse; - } else { - rc = pthread_detach(renderThread); - if (rc) { - ri.Printf(PRINT_ALL, "pthread_detach returned %d: %s", rc, strerror(rc)); - } - } - - return qtrue; -} - -static volatile void *smpData; - -// TJW - This is calling in the rendering thread to wait until another -// command buffer is ready. The command buffer returned might be NULL, -// indicating that the rendering thread should exit. -void *GLimp_RendererSleep(void) -{ - //_Log(__PRETTY_FUNCTION__ " entered"); - unsigned int msgCode; - void *msgData; - - GLSTAMP("GLimp_RendererSleep start", 0); - -#ifndef USE_CGLMACROS - // Clear the current context while we sleep so the main thread can access it - OSX_GLContextClearCurrent(); -#endif - - // Let the main thread we are idle and that no work is queued - //_Log("rs0\n"); - /* If we actually had some work to do, then tell the front end we completed it. */ - if (rendererProcessingCommand) { - SendMsg(&frontEndMsgPort, RenderCompletedMsg, NULL); - rendererProcessingCommand = NO; - } - - // Wait for new msg - for (;;) { - WaitMsg(&rendererMsgPort, &msgCode, &msgData); - if (1 || msgCode == RenderCommandMsg) { - smpData = msgData; - break; - } else { - printf("renderer received unknown message: %d\n",msgCode); - } - } - -#ifndef USE_CGLMACROS - // We are going to render a frame... retake the context - OSX_GLContextSetCurrent(); -#endif - - rendererProcessingCommand = YES; - - GLSTAMP("GLimp_RendererSleep end", 0); - - return (void *)smpData; -} - - -// TJW - This is from the main thread to wait until the rendering thread -// has completed the command buffer that it has -void GLimp_FrontEndSleep(void) -{ - unsigned int msgCode; - void *msgData; - - GLSTAMP("GLimp_FrontEndSleep start", 1); - - if (renderMsgOutstanding) { - for (;;) { - WaitMsg(&frontEndMsgPort, &msgCode, &msgData); - if(1 || msgCode == RenderCompletedMsg) { - break; - } else { - printf("front end received unknown message: %d\n",msgCode); - } - } - renderMsgOutstanding = NO; - } - -#ifndef USE_CGLMACROS - // We are done waiting for the background thread, take the current context back. - OSX_GLContextSetCurrent(); -#endif - - GLSTAMP("GLimp_FrontEndSleep end", 1); -} - - -// TJW - This is called in the main thread to issue another command -// buffer to the rendering thread. This is always called AFTER -// GLimp_FrontEndSleep, so we know that there is no command -// pending in 'smpData'. -void GLimp_WakeRenderer( void *data ) -{ - GLSTAMP("GLimp_WakeRenderer start", 1); - -#ifndef USE_CGLMACROS - // We want the background thread to draw stuff. Give up the current context - OSX_GLContextClearCurrent(); -#endif - - SendMsg(&rendererMsgPort, RenderCommandMsg, data); - - // Don't set flag saying that the renderer is processing something if it's just - // being told to exit. - //if(data != NULL) - renderMsgOutstanding = YES; - - GLSTAMP("GLimp_WakeRenderer end", 1); -} diff --git a/code/macosx/macosx_input.m b/code/macosx/macosx_input.m deleted file mode 100644 index b9f921b..0000000 --- a/code/macosx/macosx_input.m +++ /dev/null @@ -1,916 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#import -#import -#include - -#import "../client/client.h" -#import "macosx_local.h" -#import "../renderer/tr_local.h" - -#import "Q3Controller.h" -//#import "CGMouseDeltaFix.h" -#import "macosx_timers.h" -#import "macosx_display.h" // For Sys_SetScreenFade - -#import -#import -#import -#import - - -static qboolean inputActive; - -static NSDate *distantPast; - -static cvar_t *in_nomouse; -static cvar_t *in_showevents; -static cvar_t *in_mouseLowEndSlope; -static cvar_t *in_mouseHighEndCutoff; -static cvar_t *in_disableOSMouseScaling; - -static void Sys_StartMouseInput(); -static void Sys_StopMouseInput(); -static qboolean mouseactive = qfalse; -static BOOL inputRectValid = NO; -static CGRect inputRect; -static NXMouseScaling originalScaling; - -static unsigned int currentModifierFlags; - - - -static void Sys_PreventMouseMovement(CGPoint point) -{ - CGEventErr err; - - //Com_Printf("**** Calling CGAssociateMouseAndMouseCursorPosition(false)\n"); - err = CGAssociateMouseAndMouseCursorPosition(false); - if (err != CGEventNoErr) { - Sys_Error("Could not disable mouse movement, CGAssociateMouseAndMouseCursorPosition returned %d\n", err); - } - - // Put the mouse in the position we want to leave it at - err = CGWarpMouseCursorPosition(point); - if (err != CGEventNoErr) { - Sys_Error("Could not disable mouse movement, CGWarpMouseCursorPosition returned %d\n", err); - } -} - -static void Sys_ReenableMouseMovement() -{ - CGEventErr err; - - //Com_Printf("**** Calling CGAssociateMouseAndMouseCursorPosition(true)\n"); - - err = CGAssociateMouseAndMouseCursorPosition(true); - if (err != CGEventNoErr) { - Sys_Error("Could not reenable mouse movement, CGAssociateMouseAndMouseCursorPosition returned %d\n", err); - } - - // Leave the mouse where it was -- don't warp here. -} - - -void Sys_InitInput(void) -{ - // no input with dedicated servers - if ( com_dedicated->integer ) { - return; - } - - // The Cvars don't seem to work really early. - [(Q3Controller *)[NSApp delegate] showBanner]; - - Com_Printf( "------- Input Initialization -------\n" ); - - if (!distantPast) - distantPast = [[NSDate distantPast] retain]; - - // For hide support. If we don't do this, then the command key will get stuck on when we hide (since we won't get the flags changed event when it goes up). - currentModifierFlags = 0; - - r_fullscreen = Cvar_Get( "r_fullscreen", "1", CVAR_ARCHIVE | CVAR_LATCH ); - in_nomouse = Cvar_Get( "in_nomouse", "0", 0 ); - in_showevents = Cvar_Get( "in_showevents", "0", 0 ); - - // these defaults were arrived at via emprical testing between a Windows box and a Mac OS X box -#define ACT_LIKE_WINDOWS -#ifdef ACT_LIKE_WINDOWS - in_mouseLowEndSlope = Cvar_Get("in_mouseLowEndSlope", "3.5", CVAR_ARCHIVE); - if (in_mouseLowEndSlope->value < 1) { - Cvar_Set("in_mouseLowEndSlope", "1"); - } -#else - in_mouseLowEndSlope = Cvar_Get("in_mouseLowEndSlope", "1", CVAR_ARCHIVE); - if (in_mouseLowEndSlope->value < 1) { - Cvar_Set("in_mouseLowEndSlope", "1"); - } -#endif - - in_mouseHighEndCutoff = Cvar_Get("in_mouseHighEndCutoff", "20", CVAR_ARCHIVE); - if (in_mouseLowEndSlope->value < 1) { - Cvar_Set("in_mouseHighEndCutoff", "1"); - } - in_disableOSMouseScaling = Cvar_Get("in_disableOSMouseScaling", "1", CVAR_ARCHIVE ); - - glw_state.display = Sys_DisplayToUse(); - - inputActive = qtrue; - - if ( in_nomouse->integer == 0 ) - Sys_StartMouseInput(); - else - Com_Printf( " in_nomouse is set, skipping.\n" ); - - Com_Printf( "------------------------------------\n" ); -} - -void Sys_ShutdownInput(void) -{ - // no input with dedicated servers - if ( !com_dedicated || com_dedicated->integer ) { - return; - } - - Com_Printf( "------- Input Shutdown -------\n" ); - if ( !inputActive ) { - return; - } - inputActive = qfalse; - - if (mouseactive) - Sys_StopMouseInput(); - - Com_Printf( "------------------------------\n" ); -} - -static void Sys_LockMouseInInputRect(CGRect rect) -{ - CGPoint center; - - center.x = rect.origin.x + rect.size.width / 2.0; - center.y = rect.origin.y + rect.size.height / 2.0; - - // Now, put the mouse in the middle of the input rect (anywhere over it would do) - // and don't allow it to move. This means that the user won't be able to accidentally - // select another application. - Sys_PreventMouseMovement(center); -} - -extern void Sys_UpdateWindowMouseInputRect(void); - -static void Sys_StartMouseInput() -{ - NXEventHandle eventStatus; - CGMouseDelta dx, dy; - - if (mouseactive) { - //Com_Printf("**** Attempted to start mouse input while already started\n"); - return; - } - - Com_Printf("Starting mouse input\n"); - - mouseactive = qtrue; - if (inputRectValid && !glConfig.isFullscreen) - // Make sure that if window moved we don't hose the user... - Sys_UpdateWindowMouseInputRect(); - - Sys_LockMouseInInputRect(inputRect); - - // Grab any mouse delta information to reset the last delta buffer - CGGetLastMouseDelta(&dx, &dy); - - // Turn off mouse scaling - if (in_disableOSMouseScaling->integer==0 && (eventStatus = NXOpenEventStatus())) { - NXMouseScaling newScaling; - - NXGetMouseScaling(eventStatus, &originalScaling); - newScaling.numScaleLevels = 1; - newScaling.scaleThresholds[0] = 1; - newScaling.scaleFactors[0] = -1; - NXSetMouseScaling(eventStatus, &newScaling); - NXCloseEventStatus(eventStatus); - } - - [NSCursor hide]; -} - -static void Sys_StopMouseInput() -{ - NXEventHandle eventStatus; - if (!mouseactive) { - //Com_Printf("**** Attempted to stop mouse input while already stopped\n"); - return; - } - - Com_Printf("Stopping mouse input\n"); - - // Restore mouse scaling - if (in_disableOSMouseScaling->integer == 0 && (eventStatus = NXOpenEventStatus())) { - NXSetMouseScaling(eventStatus, &originalScaling); - NXCloseEventStatus(eventStatus); - } - - mouseactive = qfalse; - Sys_ReenableMouseMovement(); - - [NSCursor unhide]; -} - -//=========================================================================== - -#include -#include -#include - -static char *Sys_ConsoleInput(void) -{ - extern qboolean stdin_active; - static char text[256]; - int len; - fd_set fdset; - struct timeval timeout; - - if (!com_dedicated || !com_dedicated->integer) - return NULL; - - if (!stdin_active) - return NULL; - - FD_ZERO(&fdset); - FD_SET(fileno(stdin), &fdset); - timeout.tv_sec = 0; - timeout.tv_usec = 0; - if (select (1, &fdset, NULL, NULL, &timeout) == -1 || !FD_ISSET(fileno(stdin), &fdset)) - return NULL; - - len = read (fileno(stdin), text, sizeof(text)); - if (len == 0) { // eof! - stdin_active = qfalse; - return NULL; - } - - if (len < 1) - return NULL; - text[len-1] = 0; // rip off the /n and terminate - - return text; -} - -//=========================================================================== -// Mouse input -//=========================================================================== - -#define MAX_DISPLAYS 128 - -CGDirectDisplayID Sys_DisplayToUse(void) -{ - static BOOL gotDisplay = NO; - static CGDirectDisplayID displayToUse; - - cvar_t *vid_screen; - CGDisplayErr err; - CGDirectDisplayID displays[MAX_DISPLAYS]; - CGDisplayCount displayCount; - int displayIndex; - - if (gotDisplay) - return displayToUse; - gotDisplay = YES; - - err = CGGetActiveDisplayList(MAX_DISPLAYS, displays, &displayCount); - if (err != CGDisplayNoErr) - Sys_Error("Cannot get display list -- CGGetActiveDisplayList returned %d.\n", err); - - // -1, the default, means to use the main screen - if ((vid_screen = Cvar_Get("vid_screen", "-1", CVAR_ARCHIVE))) - displayIndex = vid_screen->integer; - else - displayIndex = -1; - - if (displayIndex < 0 || displayIndex >= displayCount) - // This is documented (in CGDirectDisplay.h) to be the main display. We want to - // return this instead of kCGDirectMainDisplay since this will allow us to compare - // display IDs. - displayToUse = displays[0]; - else - displayToUse = displays[displayIndex]; - - return displayToUse; -} - -void Sys_SetMouseInputRect(CGRect newRect) -{ - inputRectValid = YES; - inputRect = newRect; - //Com_Printf("**** inputRect = (%f, %f, %f, %f)\n", newRect.origin.x, newRect.origin.y, newRect.size.width, newRect.size.height); - - if (mouseactive) - Sys_LockMouseInInputRect(inputRect); -} - - -static void Sys_ProcessMouseMovedEvent(NSEvent *mouseMovedEvent, int currentTime) -{ - float dx, dy; - - if (!mouseactive) - return; - - dx = [mouseMovedEvent deltaX]; - dy = [mouseMovedEvent deltaY]; - - if (in_showevents->integer) - Com_Printf("MOUSE MOVED: %d, %d\n", dx, dy); - - Sys_QueEvent(currentTime, SE_MOUSE, dx, dy, 0, NULL ); -} - -// If we are 'paused' (i.e., in any state that our normal key bindings aren't in effect), then interpret cmd-h and cmd-tab as hiding the application. -static qboolean maybeHide() -{ - if ((currentModifierFlags & NSCommandKeyMask) == 0) - return qfalse; - - return Sys_Hide(); -} - -static inline void sendEventForCharacter(NSEvent *event, unichar character, qboolean keyDownFlag, int currentTime) -{ - if (in_showevents->integer) - Com_Printf("CHARACTER: 0x%02x down=%d\n", character, keyDownFlag); - -#ifdef OMNI_TIMER - if (character == NSF9FunctionKey && !keyDownFlag) { - // Log and reset the root timer. We should currently only have the root on the stack. - OTStackPopRoot(); - OTStackReportResults(NULL); - OTStackReset(); - OTStackPushRoot(rootNode); - } -#endif - - switch (character) { - case 0x03: - Sys_QueEvent(currentTime, SE_KEY, K_KP_ENTER, keyDownFlag, 0, NULL); - break; - case '\b': - case '\177': - Sys_QueEvent(currentTime, SE_KEY, K_BACKSPACE, keyDownFlag, 0, NULL); - if (keyDownFlag) { - Sys_QueEvent(currentTime, SE_CHAR, '\b', 0, 0, NULL); - } - break; - case '\t': - if (maybeHide()) - return; - Sys_QueEvent(currentTime, SE_KEY, K_TAB, keyDownFlag, 0, NULL); - if (keyDownFlag) { - Sys_QueEvent(currentTime, SE_CHAR, '\t', 0, 0, NULL); - } - break; - case '\r': - case '\n': - Sys_QueEvent(currentTime, SE_KEY, K_ENTER, keyDownFlag, 0, NULL); - if (keyDownFlag) { - Sys_QueEvent(currentTime, SE_CHAR, '\r', 0, 0, NULL); - } - break; - case '\033': - Sys_QueEvent(currentTime, SE_KEY, K_ESCAPE, keyDownFlag, 0, NULL); - break; - case ' ': - Sys_QueEvent(currentTime, SE_KEY, K_SPACE, keyDownFlag, 0, NULL); - if (keyDownFlag) { - Sys_QueEvent(currentTime, SE_CHAR, ' ', 0, 0, NULL); - } - break; - case NSUpArrowFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_UPARROW, keyDownFlag, 0, NULL); - break; - case NSDownArrowFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_DOWNARROW, keyDownFlag, 0, NULL); - break; - case NSLeftArrowFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_LEFTARROW, keyDownFlag, 0, NULL); - break; - case NSRightArrowFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_RIGHTARROW, keyDownFlag, 0, NULL); - break; - case NSF1FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F1, keyDownFlag, 0, NULL); - break; - case NSF2FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F2, keyDownFlag, 0, NULL); - break; - case NSF3FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F3, keyDownFlag, 0, NULL); - break; - case NSF4FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F4, keyDownFlag, 0, NULL); - break; - case NSF5FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F5, keyDownFlag, 0, NULL); - break; - case NSF6FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F6, keyDownFlag, 0, NULL); - break; - case NSF7FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F7, keyDownFlag, 0, NULL); - break; - case NSF8FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F8, keyDownFlag, 0, NULL); - break; - case NSF9FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F9, keyDownFlag, 0, NULL); - break; - case NSF10FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F10, keyDownFlag, 0, NULL); - break; - case NSF11FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F11, keyDownFlag, 0, NULL); - break; - case NSF12FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_F12, keyDownFlag, 0, NULL); - break; - case NSF13FunctionKey: - Sys_QueEvent(currentTime, SE_KEY, '`', keyDownFlag, 0, NULL); - if (keyDownFlag) { - Sys_QueEvent(currentTime, SE_CHAR, '`', 0, 0, NULL); - } - break; - case NSInsertFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_INS, keyDownFlag, 0, NULL); - break; - case NSDeleteFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_DEL, keyDownFlag, 0, NULL); - break; - case NSPageDownFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_PGDN, keyDownFlag, 0, NULL); - break; - case NSPageUpFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_PGUP, keyDownFlag, 0, NULL); - break; - case NSHomeFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_HOME, keyDownFlag, 0, NULL); - break; - case NSEndFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_END, keyDownFlag, 0, NULL); - break; - case NSPauseFunctionKey: - Sys_QueEvent(currentTime, SE_KEY, K_PAUSE, keyDownFlag, 0, NULL); - break; - default: - if ([event modifierFlags] & NSNumericPadKeyMask) { - switch (character) { - case '0': - Sys_QueEvent(currentTime, SE_KEY, K_KP_INS, keyDownFlag, 0, NULL); - break; - case '1': - Sys_QueEvent(currentTime, SE_KEY, K_KP_END, keyDownFlag, 0, NULL); - break; - case '2': - Sys_QueEvent(currentTime, SE_KEY, K_KP_DOWNARROW, keyDownFlag, 0, NULL); - break; - case '3': - Sys_QueEvent(currentTime, SE_KEY, K_KP_PGDN, keyDownFlag, 0, NULL); - break; - case '4': - Sys_QueEvent(currentTime, SE_KEY, K_KP_LEFTARROW, keyDownFlag, 0, NULL); - break; - case '5': - Sys_QueEvent(currentTime, SE_KEY, K_KP_5, keyDownFlag, 0, NULL); - break; - case '6': - Sys_QueEvent(currentTime, SE_KEY, K_KP_RIGHTARROW, keyDownFlag, 0, NULL); - break; - case '7': - Sys_QueEvent(currentTime, SE_KEY, K_KP_HOME, keyDownFlag, 0, NULL); - break; - case '8': - Sys_QueEvent(currentTime, SE_KEY, K_KP_UPARROW, keyDownFlag, 0, NULL); - break; - case '9': - Sys_QueEvent(currentTime, SE_KEY, K_KP_PGUP, keyDownFlag, 0, NULL); - break; - case '.': - case ',': - Sys_QueEvent(currentTime, SE_KEY, K_KP_DEL, keyDownFlag, 0, NULL); - break; - case '+': - Sys_QueEvent(currentTime, SE_KEY, K_KP_PLUS, keyDownFlag, 0, NULL); - break; - case '-': - Sys_QueEvent(currentTime, SE_KEY, K_KP_MINUS, keyDownFlag, 0, NULL); - break; - case '*': - Sys_QueEvent(currentTime, SE_KEY, K_KP_STAR, keyDownFlag, 0, NULL); - break; - case '/': - Sys_QueEvent(currentTime, SE_KEY, K_KP_SLASH, keyDownFlag, 0, NULL); - break; - case '=': - Sys_QueEvent(currentTime, SE_KEY, K_KP_EQUALS, keyDownFlag, 0, NULL); - break; - default: - //NSLog(@"TODO: Implement character %d", (int)character); - break; - } - } else if (character >= 'a' && character <= 'z') { - if (character == 'h') { - if (maybeHide()) - return; - } - Sys_QueEvent(currentTime, SE_KEY, character, keyDownFlag, 0, NULL); - if (keyDownFlag) { - Sys_QueEvent(currentTime, SE_CHAR, (char)character, 0, 0, NULL); - } - } else if (character >= 'A' && character <= 'Z') { - Sys_QueEvent(currentTime, SE_KEY, 'a' + (character - 'A'), keyDownFlag, 0, NULL); - if (keyDownFlag) { - Sys_QueEvent(currentTime, SE_CHAR, character, 0, 0, NULL); - } - } else if (character >= 32 && character < 127) { - Sys_QueEvent(currentTime, SE_KEY, character, keyDownFlag, 0, NULL); - if (keyDownFlag) { - Sys_QueEvent(currentTime, SE_CHAR, (char)character, 0, 0, NULL); - } - } else { - //NSLog(@"TODO: Implement character %d", (int)character); - } - break; - } -} - -static inline void processKeyEvent(NSEvent *keyEvent, qboolean keyDownFlag, int currentTime) -{ - NSEventType eventType; - NSString *characters; - unsigned int characterIndex, characterCount; - - eventType = [keyEvent type]; - characters = [keyEvent charactersIgnoringModifiers]; - characterCount = [characters length]; - - for (characterIndex = 0; characterIndex < characterCount; characterIndex++) { - sendEventForCharacter(keyEvent, [characters characterAtIndex:characterIndex], keyDownFlag, currentTime); - } -} - -static inline void sendEventForMaskChangeInFlags(int quakeKey, unsigned int modifierMask, unsigned int newModifierFlags, int currentTime) -{ - BOOL oldHadModifier, newHasModifier; - - oldHadModifier = (currentModifierFlags & modifierMask) != 0; - newHasModifier = (newModifierFlags & modifierMask) != 0; - if (oldHadModifier != newHasModifier) { - // NSLog(@"Key %d posted for modifier mask modifierMask", quakeKey); - Sys_QueEvent(currentTime, SE_KEY, quakeKey, newHasModifier, 0, NULL); - } -} - -static inline void processFlagsChangedEvent(NSEvent *flagsChangedEvent, int currentTime) -{ - int newModifierFlags; - - newModifierFlags = [flagsChangedEvent modifierFlags]; - sendEventForMaskChangeInFlags(K_COMMAND, NSCommandKeyMask, newModifierFlags, currentTime); - sendEventForMaskChangeInFlags(K_CAPSLOCK, NSAlphaShiftKeyMask, newModifierFlags, currentTime); - sendEventForMaskChangeInFlags(K_ALT, NSAlternateKeyMask, newModifierFlags, currentTime); - sendEventForMaskChangeInFlags(K_CTRL, NSControlKeyMask, newModifierFlags, currentTime); - sendEventForMaskChangeInFlags(K_SHIFT, NSShiftKeyMask, newModifierFlags, currentTime); - currentModifierFlags = newModifierFlags; -} - -static inline void processSystemDefinedEvent(NSEvent *systemDefinedEvent, int currentTime) -{ - static int oldButtons = 0; - int buttonsDelta; - int buttons; - int isDown; - - if ([systemDefinedEvent subtype] == 7) { - - if (!mouseactive) - return; - - - buttons = [systemDefinedEvent data2]; - buttonsDelta = oldButtons ^ buttons; - - //Com_Printf("uberbuttons: %08lx %08lx\n",buttonsDelta,buttons); - - - if (buttonsDelta & 1) { - isDown = buttons & 1; - Sys_QueEvent(currentTime, SE_KEY, K_MOUSE1, isDown, 0, NULL); - if (in_showevents->integer) { - Com_Printf("MOUSE2: %s\n", isDown ? "down" : "up"); - } - } - - if (buttonsDelta & 2) { - isDown = buttons & 2; - Sys_QueEvent(currentTime, SE_KEY, K_MOUSE2, isDown, 0, NULL); - if (in_showevents->integer) { - Com_Printf("MOUSE3: %s\n", isDown ? "down" : "up"); - } - } - - if (buttonsDelta & 4) { - isDown = buttons & 4; - Sys_QueEvent(currentTime, SE_KEY, K_MOUSE3, isDown, 0, NULL); - if (in_showevents->integer) { - Com_Printf("MOUSE1: %s\n", isDown ? "down" : "up"); - } - } - - if (buttonsDelta & 8) { - isDown = buttons & 8; - Sys_QueEvent(currentTime, SE_KEY, K_MOUSE4, isDown, 0, NULL); - if (in_showevents->integer) { - Com_Printf("MOUSE4: %s\n", isDown ? "down" : "up"); - } - } - - if (buttonsDelta & 16) { - isDown = buttons & 16; - Sys_QueEvent(currentTime, SE_KEY, K_MOUSE5, isDown, 0, NULL); - if (in_showevents->integer) { - Com_Printf("MOUSE5: %s\n", isDown ? "down" : "up"); - } - } - - oldButtons = buttons; - } -} - -static inline void processEvent(NSEvent *event, int currentTime) -{ - NSEventType eventType; - - if (!inputActive) - return; - - eventType = [event type]; - - if (in_showevents->integer) - NSLog(@"event = %@", event); - - switch (eventType) { - // These six event types are ignored since we do all of our mouse down/up process via the uber-mouse system defined event. We have to accept these events however since they get enqueued and the queue will fill up if we don't. - case NSLeftMouseDown: - //Sys_QueEvent(currentTime, SE_KEY, K_MOUSE1, qtrue, 0, NULL); - return; - case NSLeftMouseUp: - //Sys_QueEvent(currentTime, SE_KEY, K_MOUSE1, qfalse, 0, NULL); - return; - case NSRightMouseDown: - //Sys_QueEvent(currentTime, SE_KEY, K_MOUSE2, qtrue, 0, NULL); - return; - case NSRightMouseUp: - //Sys_QueEvent(currentTime, SE_KEY, K_MOUSE2, qfalse, 0, NULL); - return; - case 25: // other mouse down - return; - case 26: // other mouse up - return; - - case NSMouseMoved: - case NSLeftMouseDragged: - case NSRightMouseDragged: - case 27: // other mouse dragged - Sys_ProcessMouseMovedEvent(event, currentTime); - return; - case NSKeyDown: - case NSKeyUp: - processKeyEvent(event, eventType == NSKeyDown, currentTime); - return; - case NSFlagsChanged: - processFlagsChangedEvent(event, currentTime); - return; - case NSSystemDefined: - processSystemDefinedEvent(event, currentTime); - return; - case NSScrollWheel: - if ([event deltaY] < 0.0) { - Sys_QueEvent(currentTime, SE_KEY, K_MWHEELDOWN, qtrue, 0, NULL ); - Sys_QueEvent(currentTime, SE_KEY, K_MWHEELDOWN, qfalse, 0, NULL ); - } else { - Sys_QueEvent(currentTime, SE_KEY, K_MWHEELUP, qtrue, 0, NULL ); - Sys_QueEvent(currentTime, SE_KEY, K_MWHEELUP, qfalse, 0, NULL ); - } - return; - default: - break; - } - [NSApp sendEvent:event]; -} - -static void Sys_SendKeyEvents(int currentTime) -{ -#ifndef DEDICATED - NSEvent *event; - NSDate *timeout; - extern float SNDDMA_GetBufferDuration(); - - timeout = distantPast; - if (Sys_IsHidden) - timeout = [NSDate dateWithTimeIntervalSinceNow: 0.25 * SNDDMA_GetBufferDuration()]; - - // This gets call regardless of whether inputActive is true or not. This is important since we need to be poking the event queue in order for the unhide event to make its way through the system. This means that when we hide, we can just shut down the input system and reeanbled it when we unhide. - while ((event = [NSApp nextEventMatchingMask: NSAnyEventMask - untilDate: timeout - inMode: NSDefaultRunLoopMode - dequeue:YES])) { - if (Sys_IsHidden) { - // Just let NSApp handle events so that we'll get the app activation event - [NSApp sendEvent: event]; - timeout = [NSDate dateWithTimeIntervalSinceNow: 0.1]; - } else { - static int lastEventTime = 0; - static BOOL lastEventTimeValid = NO; - - // Mac OS X 10.0.3 has a bug where the if the monitor goes to sleep in fullscreen GL mode, the gamma won't be restored. We'll restore the gamma if there is a pause while in the game of more than 10 seconds. We don't do this on the 'Sys_IsHidden' branch since unhiding will restore the monitor gamma. - if ((currentTime - lastEventTime > 1 * 1000) && lastEventTimeValid) { - //Com_Printf("Restoring monitor gamma after being idle for %f seconds.\n", (currentTime - lastEventTime) / 1000.0); - [NSCursor hide]; - Sys_SetScreenFade(&glw_state.inGameTable, 1.0); - } - lastEventTime = [event timestamp] * 1000.0; //currentTime; - lastEventTimeValid = YES; - - processEvent(event, lastEventTime); - } - } -#endif -} - -/* -======================================================================== - -EVENT LOOP - -======================================================================== -*/ - -extern qboolean Sys_GetPacket ( netadr_t *net_from, msg_t *net_message ); - -#define MAX_QUED_EVENTS 256 -#define MASK_QUED_EVENTS ( MAX_QUED_EVENTS - 1 ) - -static sysEvent_t eventQue[MAX_QUED_EVENTS]; -static int eventHead, eventTail; -static byte sys_packetReceived[MAX_MSGLEN]; - -/* -================ -Sys_QueEvent - -A time of 0 will get the current time -Ptr should either be null, or point to a block of data that can -be freed by the game later. -================ -*/ -void Sys_QueEvent( int time, sysEventType_t type, int value, int value2, int ptrLength, void *ptr ) { - sysEvent_t *ev; - int i,j; -#ifndef DEDICATED - if (in_showevents->integer) - NSLog(@"EVENT ENQUEUE: time=%d type=%d value=0x%08x value2=0x%08x\n", time, type, value, value2); -#endif - - if ( eventHead - eventTail >= MAX_QUED_EVENTS ) { - Com_Printf("Sys_QueEvent: overflow\n"); - } - - if ( !time ) { - time = Sys_Milliseconds(); - } - - // insert it by time - for ( i = eventTail ; i < eventHead ; i++ ) { - ev = &eventQue[ i & MASK_QUED_EVENTS ]; - if ( ev->evTime > time ) { - break; - } - } - - // insert before i - for ( j = eventHead ; j > i ; j-- ) { - eventQue[ j & MASK_QUED_EVENTS ] = eventQue[ (j-1) & MASK_QUED_EVENTS ]; - } - ev = &eventQue[ i & MASK_QUED_EVENTS ]; - - eventHead++; - - ev->evTime = time; - ev->evType = type; - ev->evValue = value; - ev->evValue2 = value2; - ev->evPtrLength = ptrLength; - ev->evPtr = ptr; -} - -/* -================ -Sys_GetEvent - -================ -*/ -sysEvent_t Sys_GetEvent( void ) -{ - sysEvent_t ev; - char *s; - msg_t netmsg; - netadr_t adr; - int currentTime; - - // return if we have data - if (eventHead > eventTail) { - eventTail++; - return eventQue[ ( eventTail - 1 ) & MASK_QUED_EVENTS ]; - } - - // The queue must be empty. Check all of the event sources. If the events are - // already in the queue, we can't imply any real ordering, so we'll avoid extra - // system calls and give them all the same time. - currentTime = Sys_Milliseconds(); - - // Check for mouse and keyboard events - Sys_SendKeyEvents(currentTime); - - // check for console commands - s = Sys_ConsoleInput(); - if ( s ) { - char *b; - int len; - - len = strlen( s ) + 1; - b = Z_Malloc( len ); - strcpy( b, s ); - Sys_QueEvent( currentTime, SE_CONSOLE, 0, 0, len, b ); - } - - - // During debugging it is sometimes usefull to be able to start/stop mouse input. - // Don't turn on the input when we've disabled it because we're hidden, however. - if (!com_dedicated->integer) { - if (in_nomouse->integer == mouseactive && !Sys_IsHidden) { - if (in_nomouse->integer) - Sys_StopMouseInput(); - else - Sys_StartMouseInput(); - } - } - - // check for network packets - MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) ); - if ( Sys_GetPacket ( &adr, &netmsg ) ) { - netadr_t *buf; - int len; - - // copy out to a seperate buffer for qeueing - len = sizeof( netadr_t ) + netmsg.cursize; - buf = Z_Malloc( len ); - *buf = adr; - memcpy( buf+1, netmsg.data, netmsg.cursize ); - Sys_QueEvent( currentTime, SE_PACKET, 0, 0, len, buf ); - } - - // If we got an event, return it - if (eventHead > eventTail) { - eventTail++; - return eventQue[ ( eventTail - 1 ) & MASK_QUED_EVENTS ]; - } - - // Otherwise, return an empty event to indicate that there are no events pending. - memset( &ev, 0, sizeof( ev ) ); - ev.evTime = currentTime; - - return ev; -} - - - diff --git a/code/macosx/macosx_local.h b/code/macosx/macosx_local.h deleted file mode 100644 index 413e1a3..0000000 --- a/code/macosx/macosx_local.h +++ /dev/null @@ -1,129 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifndef __macosx_local_h -#define __macosx_local_h - -#include "qcommon.h" - -#ifdef __cplusplus -typedef void NSDictionary; -typedef void NSOpenGLContext; -typedef void NSWindow; - -extern "C" { -#else -#import -@class NSEvent, NSOpenGLContext, NSWindow; -#endif - -#include -#include - -// In macosx_input.m -extern void Sys_InitInput(void); -extern void Sys_ShutdownInput(void); -extern void Sys_SetMouseInputRect(CGRect newRect); -extern CGDirectDisplayID Sys_DisplayToUse(void); - -// In macosx_sys.m -extern void Sys_QueEvent(int time, sysEventType_t type, int value, int value2, int ptrLength, void *ptr); -extern void Sys_AnnoyingBanner(); - -// In macosx_glimp.m -extern qboolean Sys_IsHidden; -extern qboolean Sys_Hide(); -extern qboolean Sys_Unhide(); - -typedef struct { - CGDirectDisplayID display; - CGTableCount tableSize; - CGGammaValue *red; - CGGammaValue *blue; - CGGammaValue *green; -} glwgamma_t; - -typedef struct -{ - CGDirectDisplayID display; - NSDictionary *desktopMode; - NSDictionary *gameMode; - - CGDisplayCount displayCount; - glwgamma_t *originalDisplayGammaTables; - glwgamma_t inGameTable; - glwgamma_t tempTable; - - NSOpenGLContext *_ctx; - CGLContextObj _cgl_ctx; - qboolean _ctx_is_current; - NSWindow *window; - - FILE *log_fp; - - unsigned int bufferSwapCount; - unsigned int glPauseCount; -} glwstate_t; - -extern glwstate_t glw_state; - -#define OSX_SetGLContext(context) \ -do { \ - NSOpenGLContext *_context = (context); \ - glw_state._ctx = _context; \ - glw_state._cgl_ctx = [_context cglContext]; \ -} while (0) - -#define OSX_GetNSGLContext() glw_state._ctx -#define OSX_GetCGLContext() glw_state._cgl_ctx - -#define OSX_GLContextIsCurrent() glw_state._ctx_is_current -#define OSX_GLContextSetCurrent() \ -do { \ - [glw_state._ctx makeCurrentContext]; \ - glw_state._ctx_is_current = (glw_state._ctx != nil); \ -} while (0) - -#define OSX_GLContextClearCurrent() \ -do { \ - [NSOpenGLContext clearCurrentContext]; \ - glw_state._ctx_is_current = NO; \ -} while (0) - - -extern void Sys_PauseGL(); -extern void Sys_ResumeGL(); - - -#import "macosx_timers.h" - -#ifdef OMNI_TIMER -extern OTStampList glThreadStampList; -#define GLSTAMP(name, data) OTStampListAddStamp(glThreadStampList, name, data) -#else -#define GLSTAMP(name, data) -#endif - -#ifdef __cplusplus -} -#endif - -#endif // __macosx_local_h diff --git a/code/macosx/macosx_qgl.h b/code/macosx/macosx_qgl.h deleted file mode 100644 index 8db6d98..0000000 --- a/code/macosx/macosx_qgl.h +++ /dev/null @@ -1,5095 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -/**** This file is autogenerated. Run GenerateQGL.pl to update it ****/ - -#ifdef QGL_LOG_GL_CALLS -extern unsigned int QGLLogGLCalls; -extern FILE *QGLDebugFile(void); -#endif - -extern void QGLCheckError(const char *message); -extern unsigned int QGLBeginStarted; - -// This has to be done to avoid infinite recursion between our glGetError wrapper and QGLCheckError() -static inline GLenum _glGetError(void) { - return glGetError(); -} - -// void glAccum (GLenum op, GLfloat value); -static inline void qglAccum(GLenum op, GLfloat value) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glAccum(op=%lu, value=%f)\n", op, value); -#endif - glAccum(op, value); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glAccum"); -#endif -} - -// void glAlphaFunc (GLenum func, GLclampf ref); -static inline void qglAlphaFunc(GLenum func, GLclampf ref) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glAlphaFunc(func=%lu, ref=%f)\n", func, ref); -#endif - glAlphaFunc(func, ref); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glAlphaFunc"); -#endif -} - -// GLboolean glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); -static inline GLboolean qglAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences) -{ - GLboolean returnValue; -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glAreTexturesResident(n=%ld, textures=%p, residences=%p)\n", n, textures, residences); -#endif - returnValue = glAreTexturesResident(n, textures, residences); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glAreTexturesResident"); -#endif - return returnValue; -} - -// void glArrayElement (GLint i); -static inline void qglArrayElement(GLint i) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glArrayElement(i=%ld)\n", i); -#endif - glArrayElement(i); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glArrayElement"); -#endif -} - -// void glBegin (GLenum mode); -static inline void qglBegin(GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glBegin(mode=%lu)\n", mode); -#endif - glBegin(mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - QGLBeginStarted++; - if (!QGLBeginStarted) - QGLCheckError("glBegin"); -#endif -} - -// void glBindTexture (GLenum target, GLuint texture); -static inline void qglBindTexture(GLenum target, GLuint texture) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glBindTexture(target=%lu, texture=%lu)\n", target, texture); -#endif - glBindTexture(target, texture); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glBindTexture"); -#endif -} - -// void glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); -static inline void qglBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glBitmap(width=%ld, height=%ld, xorig=%f, yorig=%f, xmove=%f, ymove=%f, bitmap=%p)\n", width, height, xorig, yorig, xmove, ymove, bitmap); -#endif - glBitmap(width, height, xorig, yorig, xmove, ymove, bitmap); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glBitmap"); -#endif -} - -// void glBlendFunc (GLenum sfactor, GLenum dfactor); -static inline void qglBlendFunc(GLenum sfactor, GLenum dfactor) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glBlendFunc(sfactor=%lu, dfactor=%lu)\n", sfactor, dfactor); -#endif - glBlendFunc(sfactor, dfactor); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glBlendFunc"); -#endif -} - -// void glCallList (GLuint list); -static inline void qglCallList(GLuint list) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glCallList(list=%lu)\n", list); -#endif - glCallList(list); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glCallList"); -#endif -} - -// void glCallLists (GLsizei n, GLenum type, const GLvoid *lists); -static inline void qglCallLists(GLsizei n, GLenum type, const GLvoid *lists) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glCallLists(n=%ld, type=%lu, lists=%p)\n", n, type, lists); -#endif - glCallLists(n, type, lists); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glCallLists"); -#endif -} - -// void glClear (GLbitfield mask); -static inline void qglClear(GLbitfield mask) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glClear(mask=%lu)\n", mask); -#endif - glClear(mask); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glClear"); -#endif -} - -// void glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -static inline void qglClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glClearAccum(red=%f, green=%f, blue=%f, alpha=%f)\n", red, green, blue, alpha); -#endif - glClearAccum(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glClearAccum"); -#endif -} - -// void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -static inline void qglClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glClearColor(red=%f, green=%f, blue=%f, alpha=%f)\n", red, green, blue, alpha); -#endif - glClearColor(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glClearColor"); -#endif -} - -// void glClearDepth (GLclampd depth); -static inline void qglClearDepth(GLclampd depth) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glClearDepth(depth=%f)\n", depth); -#endif - glClearDepth(depth); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glClearDepth"); -#endif -} - -// void glClearIndex (GLfloat c); -static inline void qglClearIndex(GLfloat c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glClearIndex(c=%f)\n", c); -#endif - glClearIndex(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glClearIndex"); -#endif -} - -// void glClearStencil (GLint s); -static inline void qglClearStencil(GLint s) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glClearStencil(s=%ld)\n", s); -#endif - glClearStencil(s); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glClearStencil"); -#endif -} - -// void glClipPlane (GLenum plane, const GLdouble *equation); -static inline void qglClipPlane(GLenum plane, const GLdouble *equation) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glClipPlane(plane=%lu, equation=%p)\n", plane, equation); -#endif - glClipPlane(plane, equation); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glClipPlane"); -#endif -} - -// void glColor3b (GLbyte red, GLbyte green, GLbyte blue); -static inline void qglColor3b(GLbyte red, GLbyte green, GLbyte blue) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3b(red=%d, green=%d, blue=%d)\n", red, green, blue); -#endif - glColor3b(red, green, blue); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3b"); -#endif -} - -// void glColor3bv (const GLbyte *v); -static inline void qglColor3bv(const GLbyte *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3bv(v=%p)\n", v); -#endif - glColor3bv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3bv"); -#endif -} - -// void glColor3d (GLdouble red, GLdouble green, GLdouble blue); -static inline void qglColor3d(GLdouble red, GLdouble green, GLdouble blue) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3d(red=%f, green=%f, blue=%f)\n", red, green, blue); -#endif - glColor3d(red, green, blue); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3d"); -#endif -} - -// void glColor3dv (const GLdouble *v); -static inline void qglColor3dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3dv(v=%p)\n", v); -#endif - glColor3dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3dv"); -#endif -} - -// void glColor3f (GLfloat red, GLfloat green, GLfloat blue); -static inline void qglColor3f(GLfloat red, GLfloat green, GLfloat blue) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3f(red=%f, green=%f, blue=%f)\n", red, green, blue); -#endif - glColor3f(red, green, blue); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3f"); -#endif -} - -// void glColor3fv (const GLfloat *v); -static inline void qglColor3fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3fv(v=%p)\n", v); -#endif - glColor3fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3fv"); -#endif -} - -// void glColor3i (GLint red, GLint green, GLint blue); -static inline void qglColor3i(GLint red, GLint green, GLint blue) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3i(red=%ld, green=%ld, blue=%ld)\n", red, green, blue); -#endif - glColor3i(red, green, blue); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3i"); -#endif -} - -// void glColor3iv (const GLint *v); -static inline void qglColor3iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3iv(v=%p)\n", v); -#endif - glColor3iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3iv"); -#endif -} - -// void glColor3s (GLshort red, GLshort green, GLshort blue); -static inline void qglColor3s(GLshort red, GLshort green, GLshort blue) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3s(red=%d, green=%d, blue=%d)\n", red, green, blue); -#endif - glColor3s(red, green, blue); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3s"); -#endif -} - -// void glColor3sv (const GLshort *v); -static inline void qglColor3sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3sv(v=%p)\n", v); -#endif - glColor3sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3sv"); -#endif -} - -// void glColor3ub (GLubyte red, GLubyte green, GLubyte blue); -static inline void qglColor3ub(GLubyte red, GLubyte green, GLubyte blue) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3ub(red=%u, green=%u, blue=%u)\n", red, green, blue); -#endif - glColor3ub(red, green, blue); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3ub"); -#endif -} - -// void glColor3ubv (const GLubyte *v); -static inline void qglColor3ubv(const GLubyte *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3ubv(v=%p)\n", v); -#endif - glColor3ubv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3ubv"); -#endif -} - -// void glColor3ui (GLuint red, GLuint green, GLuint blue); -static inline void qglColor3ui(GLuint red, GLuint green, GLuint blue) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3ui(red=%lu, green=%lu, blue=%lu)\n", red, green, blue); -#endif - glColor3ui(red, green, blue); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3ui"); -#endif -} - -// void glColor3uiv (const GLuint *v); -static inline void qglColor3uiv(const GLuint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3uiv(v=%p)\n", v); -#endif - glColor3uiv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3uiv"); -#endif -} - -// void glColor3us (GLushort red, GLushort green, GLushort blue); -static inline void qglColor3us(GLushort red, GLushort green, GLushort blue) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3us(red=%u, green=%u, blue=%u)\n", red, green, blue); -#endif - glColor3us(red, green, blue); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3us"); -#endif -} - -// void glColor3usv (const GLushort *v); -static inline void qglColor3usv(const GLushort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor3usv(v=%p)\n", v); -#endif - glColor3usv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor3usv"); -#endif -} - -// void glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); -static inline void qglColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4b(red=%d, green=%d, blue=%d, alpha=%d)\n", red, green, blue, alpha); -#endif - glColor4b(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4b"); -#endif -} - -// void glColor4bv (const GLbyte *v); -static inline void qglColor4bv(const GLbyte *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4bv(v=%p)\n", v); -#endif - glColor4bv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4bv"); -#endif -} - -// void glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); -static inline void qglColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4d(red=%f, green=%f, blue=%f, alpha=%f)\n", red, green, blue, alpha); -#endif - glColor4d(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4d"); -#endif -} - -// void glColor4dv (const GLdouble *v); -static inline void qglColor4dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4dv(v=%p)\n", v); -#endif - glColor4dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4dv"); -#endif -} - -// void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -static inline void qglColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4f(red=%f, green=%f, blue=%f, alpha=%f)\n", red, green, blue, alpha); -#endif - glColor4f(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4f"); -#endif -} - -// void glColor4fv (const GLfloat *v); -static inline void qglColor4fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4fv(v=%p)\n", v); -#endif - glColor4fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4fv"); -#endif -} - -// void glColor4i (GLint red, GLint green, GLint blue, GLint alpha); -static inline void qglColor4i(GLint red, GLint green, GLint blue, GLint alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4i(red=%ld, green=%ld, blue=%ld, alpha=%ld)\n", red, green, blue, alpha); -#endif - glColor4i(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4i"); -#endif -} - -// void glColor4iv (const GLint *v); -static inline void qglColor4iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4iv(v=%p)\n", v); -#endif - glColor4iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4iv"); -#endif -} - -// void glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); -static inline void qglColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4s(red=%d, green=%d, blue=%d, alpha=%d)\n", red, green, blue, alpha); -#endif - glColor4s(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4s"); -#endif -} - -// void glColor4sv (const GLshort *v); -static inline void qglColor4sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4sv(v=%p)\n", v); -#endif - glColor4sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4sv"); -#endif -} - -// void glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); -static inline void qglColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4ub(red=%u, green=%u, blue=%u, alpha=%u)\n", red, green, blue, alpha); -#endif - glColor4ub(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4ub"); -#endif -} - -// void glColor4ubv (const GLubyte *v); -static inline void qglColor4ubv(const GLubyte *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4ubv(v=%p)\n", v); -#endif - glColor4ubv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4ubv"); -#endif -} - -// void glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); -static inline void qglColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4ui(red=%lu, green=%lu, blue=%lu, alpha=%lu)\n", red, green, blue, alpha); -#endif - glColor4ui(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4ui"); -#endif -} - -// void glColor4uiv (const GLuint *v); -static inline void qglColor4uiv(const GLuint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4uiv(v=%p)\n", v); -#endif - glColor4uiv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4uiv"); -#endif -} - -// void glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); -static inline void qglColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4us(red=%u, green=%u, blue=%u, alpha=%u)\n", red, green, blue, alpha); -#endif - glColor4us(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4us"); -#endif -} - -// void glColor4usv (const GLushort *v); -static inline void qglColor4usv(const GLushort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColor4usv(v=%p)\n", v); -#endif - glColor4usv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColor4usv"); -#endif -} - -// void glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -static inline void qglColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColorMask(red=%u, green=%u, blue=%u, alpha=%u)\n", red, green, blue, alpha); -#endif - glColorMask(red, green, blue, alpha); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColorMask"); -#endif -} - -// void glColorMaterial (GLenum face, GLenum mode); -static inline void qglColorMaterial(GLenum face, GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColorMaterial(face=%lu, mode=%lu)\n", face, mode); -#endif - glColorMaterial(face, mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColorMaterial"); -#endif -} - -// void glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -static inline void qglColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glColorPointer(size=%ld, type=%lu, stride=%ld, pointer=%p)\n", size, type, stride, pointer); -#endif - glColorPointer(size, type, stride, pointer); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glColorPointer"); -#endif -} - -// void glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); -static inline void qglCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glCopyPixels(x=%ld, y=%ld, width=%ld, height=%ld, type=%lu)\n", x, y, width, height, type); -#endif - glCopyPixels(x, y, width, height, type); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glCopyPixels"); -#endif -} - -// void glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); -static inline void qglCopyTexImage1D(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glCopyTexImage1D(target=%lu, level=%ld, internalFormat=%lu, x=%ld, y=%ld, width=%ld, border=%ld)\n", target, level, internalFormat, x, y, width, border); -#endif - glCopyTexImage1D(target, level, internalFormat, x, y, width, border); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glCopyTexImage1D"); -#endif -} - -// void glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -static inline void qglCopyTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glCopyTexImage2D(target=%lu, level=%ld, internalFormat=%lu, x=%ld, y=%ld, width=%ld, height=%ld, border=%ld)\n", target, level, internalFormat, x, y, width, height, border); -#endif - glCopyTexImage2D(target, level, internalFormat, x, y, width, height, border); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glCopyTexImage2D"); -#endif -} - -// void glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -static inline void qglCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glCopyTexSubImage1D(target=%lu, level=%ld, xoffset=%ld, x=%ld, y=%ld, width=%ld)\n", target, level, xoffset, x, y, width); -#endif - glCopyTexSubImage1D(target, level, xoffset, x, y, width); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glCopyTexSubImage1D"); -#endif -} - -// void glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -static inline void qglCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glCopyTexSubImage2D(target=%lu, level=%ld, xoffset=%ld, yoffset=%ld, x=%ld, y=%ld, width=%ld, height=%ld)\n", target, level, xoffset, yoffset, x, y, width, height); -#endif - glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glCopyTexSubImage2D"); -#endif -} - -// void glCullFace (GLenum mode); -static inline void qglCullFace(GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glCullFace(mode=%lu)\n", mode); -#endif - glCullFace(mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glCullFace"); -#endif -} - -// void glDeleteLists (GLuint list, GLsizei range); -static inline void qglDeleteLists(GLuint list, GLsizei range) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDeleteLists(list=%lu, range=%ld)\n", list, range); -#endif - glDeleteLists(list, range); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDeleteLists"); -#endif -} - -// void glDeleteTextures (GLsizei n, const GLuint *textures); -static inline void qglDeleteTextures(GLsizei n, const GLuint *textures) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDeleteTextures(n=%ld, textures=%p)\n", n, textures); -#endif - glDeleteTextures(n, textures); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDeleteTextures"); -#endif -} - -// void glDepthFunc (GLenum func); -static inline void qglDepthFunc(GLenum func) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDepthFunc(func=%lu)\n", func); -#endif - glDepthFunc(func); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDepthFunc"); -#endif -} - -// void glDepthMask (GLboolean flag); -static inline void qglDepthMask(GLboolean flag) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDepthMask(flag=%u)\n", flag); -#endif - glDepthMask(flag); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDepthMask"); -#endif -} - -// void glDepthRange (GLclampd zNear, GLclampd zFar); -static inline void qglDepthRange(GLclampd zNear, GLclampd zFar) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDepthRange(zNear=%f, zFar=%f)\n", zNear, zFar); -#endif - glDepthRange(zNear, zFar); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDepthRange"); -#endif -} - -// void glDisable (GLenum cap); -static inline void qglDisable(GLenum cap) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDisable(cap=%lu)\n", cap); -#endif - glDisable(cap); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDisable"); -#endif -} - -// void glDisableClientState (GLenum array); -static inline void qglDisableClientState(GLenum array) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDisableClientState(array=%lu)\n", array); -#endif - glDisableClientState(array); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDisableClientState"); -#endif -} - -// void glDrawArrays (GLenum mode, GLint first, GLsizei count); -static inline void qglDrawArrays(GLenum mode, GLint first, GLsizei count) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDrawArrays(mode=%lu, first=%ld, count=%ld)\n", mode, first, count); -#endif - glDrawArrays(mode, first, count); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDrawArrays"); -#endif -} - -// void glDrawBuffer (GLenum mode); -static inline void qglDrawBuffer(GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDrawBuffer(mode=%lu)\n", mode); -#endif - glDrawBuffer(mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDrawBuffer"); -#endif -} - -// void glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); -static inline void qglDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDrawElements(mode=%lu, count=%ld, type=%lu, indices=%p)\n", mode, count, type, indices); -#endif - glDrawElements(mode, count, type, indices); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDrawElements"); -#endif -} - -// void glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -static inline void qglDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glDrawPixels(width=%ld, height=%ld, format=%lu, type=%lu, pixels=%p)\n", width, height, format, type, pixels); -#endif - glDrawPixels(width, height, format, type, pixels); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glDrawPixels"); -#endif -} - -// void glEdgeFlag (GLboolean flag); -static inline void qglEdgeFlag(GLboolean flag) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEdgeFlag(flag=%u)\n", flag); -#endif - glEdgeFlag(flag); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEdgeFlag"); -#endif -} - -// void glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); -static inline void qglEdgeFlagPointer(GLsizei stride, const GLvoid *pointer) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEdgeFlagPointer(stride=%ld, pointer=%p)\n", stride, pointer); -#endif - glEdgeFlagPointer(stride, pointer); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEdgeFlagPointer"); -#endif -} - -// void glEdgeFlagv (const GLboolean *flag); -static inline void qglEdgeFlagv(const GLboolean *flag) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEdgeFlagv(flag=%p)\n", flag); -#endif - glEdgeFlagv(flag); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEdgeFlagv"); -#endif -} - -// void glEnable (GLenum cap); -static inline void qglEnable(GLenum cap) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEnable(cap=%lu)\n", cap); -#endif - glEnable(cap); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEnable"); -#endif -} - -// void glEnableClientState (GLenum array); -static inline void qglEnableClientState(GLenum array) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEnableClientState(array=%lu)\n", array); -#endif - glEnableClientState(array); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEnableClientState"); -#endif -} - -// void glEnd (void); -static inline void qglEnd(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEnd(void)\n"); -#endif - glEnd(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - QGLBeginStarted--; - if (!QGLBeginStarted) - QGLCheckError("glEnd"); -#endif -} - -// void glEndList (void); -static inline void qglEndList(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEndList(void)\n"); -#endif - glEndList(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEndList"); -#endif -} - -// void glEvalCoord1d (GLdouble u); -static inline void qglEvalCoord1d(GLdouble u) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalCoord1d(u=%f)\n", u); -#endif - glEvalCoord1d(u); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalCoord1d"); -#endif -} - -// void glEvalCoord1dv (const GLdouble *u); -static inline void qglEvalCoord1dv(const GLdouble *u) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalCoord1dv(u=%p)\n", u); -#endif - glEvalCoord1dv(u); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalCoord1dv"); -#endif -} - -// void glEvalCoord1f (GLfloat u); -static inline void qglEvalCoord1f(GLfloat u) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalCoord1f(u=%f)\n", u); -#endif - glEvalCoord1f(u); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalCoord1f"); -#endif -} - -// void glEvalCoord1fv (const GLfloat *u); -static inline void qglEvalCoord1fv(const GLfloat *u) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalCoord1fv(u=%p)\n", u); -#endif - glEvalCoord1fv(u); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalCoord1fv"); -#endif -} - -// void glEvalCoord2d (GLdouble u, GLdouble v); -static inline void qglEvalCoord2d(GLdouble u, GLdouble v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalCoord2d(u=%f, v=%f)\n", u, v); -#endif - glEvalCoord2d(u, v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalCoord2d"); -#endif -} - -// void glEvalCoord2dv (const GLdouble *u); -static inline void qglEvalCoord2dv(const GLdouble *u) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalCoord2dv(u=%p)\n", u); -#endif - glEvalCoord2dv(u); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalCoord2dv"); -#endif -} - -// void glEvalCoord2f (GLfloat u, GLfloat v); -static inline void qglEvalCoord2f(GLfloat u, GLfloat v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalCoord2f(u=%f, v=%f)\n", u, v); -#endif - glEvalCoord2f(u, v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalCoord2f"); -#endif -} - -// void glEvalCoord2fv (const GLfloat *u); -static inline void qglEvalCoord2fv(const GLfloat *u) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalCoord2fv(u=%p)\n", u); -#endif - glEvalCoord2fv(u); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalCoord2fv"); -#endif -} - -// void glEvalMesh1 (GLenum mode, GLint i1, GLint i2); -static inline void qglEvalMesh1(GLenum mode, GLint i1, GLint i2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalMesh1(mode=%lu, i1=%ld, i2=%ld)\n", mode, i1, i2); -#endif - glEvalMesh1(mode, i1, i2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalMesh1"); -#endif -} - -// void glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); -static inline void qglEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalMesh2(mode=%lu, i1=%ld, i2=%ld, j1=%ld, j2=%ld)\n", mode, i1, i2, j1, j2); -#endif - glEvalMesh2(mode, i1, i2, j1, j2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalMesh2"); -#endif -} - -// void glEvalPoint1 (GLint i); -static inline void qglEvalPoint1(GLint i) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalPoint1(i=%ld)\n", i); -#endif - glEvalPoint1(i); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalPoint1"); -#endif -} - -// void glEvalPoint2 (GLint i, GLint j); -static inline void qglEvalPoint2(GLint i, GLint j) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glEvalPoint2(i=%ld, j=%ld)\n", i, j); -#endif - glEvalPoint2(i, j); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glEvalPoint2"); -#endif -} - -// void glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); -static inline void qglFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glFeedbackBuffer(size=%ld, type=%lu, buffer=%p)\n", size, type, buffer); -#endif - glFeedbackBuffer(size, type, buffer); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glFeedbackBuffer"); -#endif -} - -// void glFinish (void); -static inline void qglFinish(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glFinish(void)\n"); -#endif - glFinish(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glFinish"); -#endif -} - -// void glFlush (void); -static inline void qglFlush(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glFlush(void)\n"); -#endif - glFlush(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glFlush"); -#endif -} - -// void glFogf (GLenum pname, GLfloat param); -static inline void qglFogf(GLenum pname, GLfloat param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glFogf(pname=%lu, param=%f)\n", pname, param); -#endif - glFogf(pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glFogf"); -#endif -} - -// void glFogfv (GLenum pname, const GLfloat *params); -static inline void qglFogfv(GLenum pname, const GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glFogfv(pname=%lu, params=%p)\n", pname, params); -#endif - glFogfv(pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glFogfv"); -#endif -} - -// void glFogi (GLenum pname, GLint param); -static inline void qglFogi(GLenum pname, GLint param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glFogi(pname=%lu, param=%ld)\n", pname, param); -#endif - glFogi(pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glFogi"); -#endif -} - -// void glFogiv (GLenum pname, const GLint *params); -static inline void qglFogiv(GLenum pname, const GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glFogiv(pname=%lu, params=%p)\n", pname, params); -#endif - glFogiv(pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glFogiv"); -#endif -} - -// void glFrontFace (GLenum mode); -static inline void qglFrontFace(GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glFrontFace(mode=%lu)\n", mode); -#endif - glFrontFace(mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glFrontFace"); -#endif -} - -// void glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -static inline void qglFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glFrustum(left=%f, right=%f, bottom=%f, top=%f, zNear=%f, zFar=%f)\n", left, right, bottom, top, zNear, zFar); -#endif - glFrustum(left, right, bottom, top, zNear, zFar); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glFrustum"); -#endif -} - -// GLuint glGenLists (GLsizei range); -static inline GLuint qglGenLists(GLsizei range) -{ - GLuint returnValue; -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGenLists(range=%ld)\n", range); -#endif - returnValue = glGenLists(range); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGenLists"); -#endif - return returnValue; -} - -// void glGenTextures (GLsizei n, GLuint *textures); -static inline void qglGenTextures(GLsizei n, GLuint *textures) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGenTextures(n=%ld, textures=%p)\n", n, textures); -#endif - glGenTextures(n, textures); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGenTextures"); -#endif -} - -// void glGetBooleanv (GLenum pname, GLboolean *params); -static inline void qglGetBooleanv(GLenum pname, GLboolean *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetBooleanv(pname=%lu, params=%p)\n", pname, params); -#endif - glGetBooleanv(pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetBooleanv"); -#endif -} - -// void glGetClipPlane (GLenum plane, GLdouble *equation); -static inline void qglGetClipPlane(GLenum plane, GLdouble *equation) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetClipPlane(plane=%lu, equation=%p)\n", plane, equation); -#endif - glGetClipPlane(plane, equation); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetClipPlane"); -#endif -} - -// void glGetDoublev (GLenum pname, GLdouble *params); -static inline void qglGetDoublev(GLenum pname, GLdouble *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetDoublev(pname=%lu, params=%p)\n", pname, params); -#endif - glGetDoublev(pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetDoublev"); -#endif -} - -// GLenum glGetError (void); -static inline GLenum qglGetError(void) -{ - GLenum returnValue; -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetError(void)\n"); -#endif - returnValue = glGetError(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetError"); -#endif - return returnValue; -} - -// void glGetFloatv (GLenum pname, GLfloat *params); -static inline void qglGetFloatv(GLenum pname, GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetFloatv(pname=%lu, params=%p)\n", pname, params); -#endif - glGetFloatv(pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetFloatv"); -#endif -} - -// void glGetIntegerv (GLenum pname, GLint *params); -static inline void qglGetIntegerv(GLenum pname, GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetIntegerv(pname=%lu, params=%p)\n", pname, params); -#endif - glGetIntegerv(pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetIntegerv"); -#endif -} - -// void glGetLightfv (GLenum light, GLenum pname, GLfloat *params); -static inline void qglGetLightfv(GLenum light, GLenum pname, GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetLightfv(light=%lu, pname=%lu, params=%p)\n", light, pname, params); -#endif - glGetLightfv(light, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetLightfv"); -#endif -} - -// void glGetLightiv (GLenum light, GLenum pname, GLint *params); -static inline void qglGetLightiv(GLenum light, GLenum pname, GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetLightiv(light=%lu, pname=%lu, params=%p)\n", light, pname, params); -#endif - glGetLightiv(light, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetLightiv"); -#endif -} - -// void glGetMapdv (GLenum target, GLenum query, GLdouble *v); -static inline void qglGetMapdv(GLenum target, GLenum query, GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetMapdv(target=%lu, query=%lu, v=%p)\n", target, query, v); -#endif - glGetMapdv(target, query, v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetMapdv"); -#endif -} - -// void glGetMapfv (GLenum target, GLenum query, GLfloat *v); -static inline void qglGetMapfv(GLenum target, GLenum query, GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetMapfv(target=%lu, query=%lu, v=%p)\n", target, query, v); -#endif - glGetMapfv(target, query, v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetMapfv"); -#endif -} - -// void glGetMapiv (GLenum target, GLenum query, GLint *v); -static inline void qglGetMapiv(GLenum target, GLenum query, GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetMapiv(target=%lu, query=%lu, v=%p)\n", target, query, v); -#endif - glGetMapiv(target, query, v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetMapiv"); -#endif -} - -// void glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); -static inline void qglGetMaterialfv(GLenum face, GLenum pname, GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetMaterialfv(face=%lu, pname=%lu, params=%p)\n", face, pname, params); -#endif - glGetMaterialfv(face, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetMaterialfv"); -#endif -} - -// void glGetMaterialiv (GLenum face, GLenum pname, GLint *params); -static inline void qglGetMaterialiv(GLenum face, GLenum pname, GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetMaterialiv(face=%lu, pname=%lu, params=%p)\n", face, pname, params); -#endif - glGetMaterialiv(face, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetMaterialiv"); -#endif -} - -// void glGetPixelMapfv (GLenum map, GLfloat *values); -static inline void qglGetPixelMapfv(GLenum map, GLfloat *values) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetPixelMapfv(map=%lu, values=%p)\n", map, values); -#endif - glGetPixelMapfv(map, values); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetPixelMapfv"); -#endif -} - -// void glGetPixelMapuiv (GLenum map, GLuint *values); -static inline void qglGetPixelMapuiv(GLenum map, GLuint *values) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetPixelMapuiv(map=%lu, values=%p)\n", map, values); -#endif - glGetPixelMapuiv(map, values); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetPixelMapuiv"); -#endif -} - -// void glGetPixelMapusv (GLenum map, GLushort *values); -static inline void qglGetPixelMapusv(GLenum map, GLushort *values) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetPixelMapusv(map=%lu, values=%p)\n", map, values); -#endif - glGetPixelMapusv(map, values); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetPixelMapusv"); -#endif -} - -// void glGetPointerv (GLenum pname, GLvoid* *params); -static inline void qglGetPointerv(GLenum pname, GLvoid* *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetPointerv(pname=%lu, params=%p)\n", pname, params); -#endif - glGetPointerv(pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetPointerv"); -#endif -} - -// void glGetPolygonStipple (GLubyte *mask); -static inline void qglGetPolygonStipple(GLubyte *mask) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetPolygonStipple(mask=%p)\n", mask); -#endif - glGetPolygonStipple(mask); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetPolygonStipple"); -#endif -} - -// const GLubyte * glGetString (GLenum name); -static inline const GLubyte * qglGetString(GLenum name) -{ - const GLubyte * returnValue; -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetString(name=%lu)\n", name); -#endif - returnValue = glGetString(name); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetString"); -#endif - return returnValue; -} - -// void glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); -static inline void qglGetTexEnvfv(GLenum target, GLenum pname, GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetTexEnvfv(target=%lu, pname=%lu, params=%p)\n", target, pname, params); -#endif - glGetTexEnvfv(target, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetTexEnvfv"); -#endif -} - -// void glGetTexEnviv (GLenum target, GLenum pname, GLint *params); -static inline void qglGetTexEnviv(GLenum target, GLenum pname, GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetTexEnviv(target=%lu, pname=%lu, params=%p)\n", target, pname, params); -#endif - glGetTexEnviv(target, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetTexEnviv"); -#endif -} - -// void glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); -static inline void qglGetTexGendv(GLenum coord, GLenum pname, GLdouble *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetTexGendv(coord=%lu, pname=%lu, params=%p)\n", coord, pname, params); -#endif - glGetTexGendv(coord, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetTexGendv"); -#endif -} - -// void glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); -static inline void qglGetTexGenfv(GLenum coord, GLenum pname, GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetTexGenfv(coord=%lu, pname=%lu, params=%p)\n", coord, pname, params); -#endif - glGetTexGenfv(coord, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetTexGenfv"); -#endif -} - -// void glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); -static inline void qglGetTexGeniv(GLenum coord, GLenum pname, GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetTexGeniv(coord=%lu, pname=%lu, params=%p)\n", coord, pname, params); -#endif - glGetTexGeniv(coord, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetTexGeniv"); -#endif -} - -// void glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -static inline void qglGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetTexImage(target=%lu, level=%ld, format=%lu, type=%lu, pixels=%p)\n", target, level, format, type, pixels); -#endif - glGetTexImage(target, level, format, type, pixels); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetTexImage"); -#endif -} - -// void glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); -static inline void qglGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetTexLevelParameterfv(target=%lu, level=%ld, pname=%lu, params=%p)\n", target, level, pname, params); -#endif - glGetTexLevelParameterfv(target, level, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetTexLevelParameterfv"); -#endif -} - -// void glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); -static inline void qglGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetTexLevelParameteriv(target=%lu, level=%ld, pname=%lu, params=%p)\n", target, level, pname, params); -#endif - glGetTexLevelParameteriv(target, level, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetTexLevelParameteriv"); -#endif -} - -// void glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); -static inline void qglGetTexParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetTexParameterfv(target=%lu, pname=%lu, params=%p)\n", target, pname, params); -#endif - glGetTexParameterfv(target, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetTexParameterfv"); -#endif -} - -// void glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); -static inline void qglGetTexParameteriv(GLenum target, GLenum pname, GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glGetTexParameteriv(target=%lu, pname=%lu, params=%p)\n", target, pname, params); -#endif - glGetTexParameteriv(target, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glGetTexParameteriv"); -#endif -} - -// void glHint (GLenum target, GLenum mode); -static inline void qglHint(GLenum target, GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glHint(target=%lu, mode=%lu)\n", target, mode); -#endif - glHint(target, mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glHint"); -#endif -} - -// void glIndexMask (GLuint mask); -static inline void qglIndexMask(GLuint mask) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexMask(mask=%lu)\n", mask); -#endif - glIndexMask(mask); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexMask"); -#endif -} - -// void glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); -static inline void qglIndexPointer(GLenum type, GLsizei stride, const GLvoid *pointer) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexPointer(type=%lu, stride=%ld, pointer=%p)\n", type, stride, pointer); -#endif - glIndexPointer(type, stride, pointer); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexPointer"); -#endif -} - -// void glIndexd (GLdouble c); -static inline void qglIndexd(GLdouble c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexd(c=%f)\n", c); -#endif - glIndexd(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexd"); -#endif -} - -// void glIndexdv (const GLdouble *c); -static inline void qglIndexdv(const GLdouble *c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexdv(c=%p)\n", c); -#endif - glIndexdv(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexdv"); -#endif -} - -// void glIndexf (GLfloat c); -static inline void qglIndexf(GLfloat c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexf(c=%f)\n", c); -#endif - glIndexf(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexf"); -#endif -} - -// void glIndexfv (const GLfloat *c); -static inline void qglIndexfv(const GLfloat *c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexfv(c=%p)\n", c); -#endif - glIndexfv(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexfv"); -#endif -} - -// void glIndexi (GLint c); -static inline void qglIndexi(GLint c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexi(c=%ld)\n", c); -#endif - glIndexi(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexi"); -#endif -} - -// void glIndexiv (const GLint *c); -static inline void qglIndexiv(const GLint *c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexiv(c=%p)\n", c); -#endif - glIndexiv(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexiv"); -#endif -} - -// void glIndexs (GLshort c); -static inline void qglIndexs(GLshort c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexs(c=%d)\n", c); -#endif - glIndexs(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexs"); -#endif -} - -// void glIndexsv (const GLshort *c); -static inline void qglIndexsv(const GLshort *c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexsv(c=%p)\n", c); -#endif - glIndexsv(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexsv"); -#endif -} - -// void glIndexub (GLubyte c); -static inline void qglIndexub(GLubyte c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexub(c=%u)\n", c); -#endif - glIndexub(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexub"); -#endif -} - -// void glIndexubv (const GLubyte *c); -static inline void qglIndexubv(const GLubyte *c) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIndexubv(c=%p)\n", c); -#endif - glIndexubv(c); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIndexubv"); -#endif -} - -// void glInitNames (void); -static inline void qglInitNames(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glInitNames(void)\n"); -#endif - glInitNames(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glInitNames"); -#endif -} - -// void glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); -static inline void qglInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glInterleavedArrays(format=%lu, stride=%ld, pointer=%p)\n", format, stride, pointer); -#endif - glInterleavedArrays(format, stride, pointer); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glInterleavedArrays"); -#endif -} - -// GLboolean glIsEnabled (GLenum cap); -static inline GLboolean qglIsEnabled(GLenum cap) -{ - GLboolean returnValue; -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIsEnabled(cap=%lu)\n", cap); -#endif - returnValue = glIsEnabled(cap); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIsEnabled"); -#endif - return returnValue; -} - -// GLboolean glIsList (GLuint list); -static inline GLboolean qglIsList(GLuint list) -{ - GLboolean returnValue; -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIsList(list=%lu)\n", list); -#endif - returnValue = glIsList(list); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIsList"); -#endif - return returnValue; -} - -// GLboolean glIsTexture (GLuint texture); -static inline GLboolean qglIsTexture(GLuint texture) -{ - GLboolean returnValue; -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glIsTexture(texture=%lu)\n", texture); -#endif - returnValue = glIsTexture(texture); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glIsTexture"); -#endif - return returnValue; -} - -// void glLightModelf (GLenum pname, GLfloat param); -static inline void qglLightModelf(GLenum pname, GLfloat param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLightModelf(pname=%lu, param=%f)\n", pname, param); -#endif - glLightModelf(pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLightModelf"); -#endif -} - -// void glLightModelfv (GLenum pname, const GLfloat *params); -static inline void qglLightModelfv(GLenum pname, const GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLightModelfv(pname=%lu, params=%p)\n", pname, params); -#endif - glLightModelfv(pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLightModelfv"); -#endif -} - -// void glLightModeli (GLenum pname, GLint param); -static inline void qglLightModeli(GLenum pname, GLint param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLightModeli(pname=%lu, param=%ld)\n", pname, param); -#endif - glLightModeli(pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLightModeli"); -#endif -} - -// void glLightModeliv (GLenum pname, const GLint *params); -static inline void qglLightModeliv(GLenum pname, const GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLightModeliv(pname=%lu, params=%p)\n", pname, params); -#endif - glLightModeliv(pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLightModeliv"); -#endif -} - -// void glLightf (GLenum light, GLenum pname, GLfloat param); -static inline void qglLightf(GLenum light, GLenum pname, GLfloat param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLightf(light=%lu, pname=%lu, param=%f)\n", light, pname, param); -#endif - glLightf(light, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLightf"); -#endif -} - -// void glLightfv (GLenum light, GLenum pname, const GLfloat *params); -static inline void qglLightfv(GLenum light, GLenum pname, const GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLightfv(light=%lu, pname=%lu, params=%p)\n", light, pname, params); -#endif - glLightfv(light, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLightfv"); -#endif -} - -// void glLighti (GLenum light, GLenum pname, GLint param); -static inline void qglLighti(GLenum light, GLenum pname, GLint param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLighti(light=%lu, pname=%lu, param=%ld)\n", light, pname, param); -#endif - glLighti(light, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLighti"); -#endif -} - -// void glLightiv (GLenum light, GLenum pname, const GLint *params); -static inline void qglLightiv(GLenum light, GLenum pname, const GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLightiv(light=%lu, pname=%lu, params=%p)\n", light, pname, params); -#endif - glLightiv(light, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLightiv"); -#endif -} - -// void glLineStipple (GLint factor, GLushort pattern); -static inline void qglLineStipple(GLint factor, GLushort pattern) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLineStipple(factor=%ld, pattern=%u)\n", factor, pattern); -#endif - glLineStipple(factor, pattern); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLineStipple"); -#endif -} - -// void glLineWidth (GLfloat width); -static inline void qglLineWidth(GLfloat width) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLineWidth(width=%f)\n", width); -#endif - glLineWidth(width); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLineWidth"); -#endif -} - -// void glListBase (GLuint base); -static inline void qglListBase(GLuint base) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glListBase(base=%lu)\n", base); -#endif - glListBase(base); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glListBase"); -#endif -} - -// void glLoadIdentity (void); -static inline void qglLoadIdentity(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLoadIdentity(void)\n"); -#endif - glLoadIdentity(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLoadIdentity"); -#endif -} - -// void glLoadMatrixd (const GLdouble *m); -static inline void qglLoadMatrixd(const GLdouble *m) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLoadMatrixd(m=%p)\n", m); -#endif - glLoadMatrixd(m); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLoadMatrixd"); -#endif -} - -// void glLoadMatrixf (const GLfloat *m); -static inline void qglLoadMatrixf(const GLfloat *m) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLoadMatrixf(m=%p)\n", m); -#endif - glLoadMatrixf(m); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLoadMatrixf"); -#endif -} - -// void glLoadName (GLuint name); -static inline void qglLoadName(GLuint name) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLoadName(name=%lu)\n", name); -#endif - glLoadName(name); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLoadName"); -#endif -} - -// void glLogicOp (GLenum opcode); -static inline void qglLogicOp(GLenum opcode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glLogicOp(opcode=%lu)\n", opcode); -#endif - glLogicOp(opcode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glLogicOp"); -#endif -} - -// void glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -static inline void qglMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMap1d(target=%lu, u1=%f, u2=%f, stride=%ld, order=%ld, points=%p)\n", target, u1, u2, stride, order, points); -#endif - glMap1d(target, u1, u2, stride, order, points); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMap1d"); -#endif -} - -// void glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -static inline void qglMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMap1f(target=%lu, u1=%f, u2=%f, stride=%ld, order=%ld, points=%p)\n", target, u1, u2, stride, order, points); -#endif - glMap1f(target, u1, u2, stride, order, points); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMap1f"); -#endif -} - -// void glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -static inline void qglMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMap2d(target=%lu, u1=%f, u2=%f, ustride=%ld, uorder=%ld, v1=%f, v2=%f, vstride=%ld, vorder=%ld, points=%p)\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -#endif - glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMap2d"); -#endif -} - -// void glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -static inline void qglMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMap2f(target=%lu, u1=%f, u2=%f, ustride=%ld, uorder=%ld, v1=%f, v2=%f, vstride=%ld, vorder=%ld, points=%p)\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -#endif - glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMap2f"); -#endif -} - -// void glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); -static inline void qglMapGrid1d(GLint un, GLdouble u1, GLdouble u2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMapGrid1d(un=%ld, u1=%f, u2=%f)\n", un, u1, u2); -#endif - glMapGrid1d(un, u1, u2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMapGrid1d"); -#endif -} - -// void glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); -static inline void qglMapGrid1f(GLint un, GLfloat u1, GLfloat u2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMapGrid1f(un=%ld, u1=%f, u2=%f)\n", un, u1, u2); -#endif - glMapGrid1f(un, u1, u2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMapGrid1f"); -#endif -} - -// void glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); -static inline void qglMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMapGrid2d(un=%ld, u1=%f, u2=%f, vn=%ld, v1=%f, v2=%f)\n", un, u1, u2, vn, v1, v2); -#endif - glMapGrid2d(un, u1, u2, vn, v1, v2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMapGrid2d"); -#endif -} - -// void glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); -static inline void qglMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMapGrid2f(un=%ld, u1=%f, u2=%f, vn=%ld, v1=%f, v2=%f)\n", un, u1, u2, vn, v1, v2); -#endif - glMapGrid2f(un, u1, u2, vn, v1, v2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMapGrid2f"); -#endif -} - -// void glMaterialf (GLenum face, GLenum pname, GLfloat param); -static inline void qglMaterialf(GLenum face, GLenum pname, GLfloat param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMaterialf(face=%lu, pname=%lu, param=%f)\n", face, pname, param); -#endif - glMaterialf(face, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMaterialf"); -#endif -} - -// void glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); -static inline void qglMaterialfv(GLenum face, GLenum pname, const GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMaterialfv(face=%lu, pname=%lu, params=%p)\n", face, pname, params); -#endif - glMaterialfv(face, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMaterialfv"); -#endif -} - -// void glMateriali (GLenum face, GLenum pname, GLint param); -static inline void qglMateriali(GLenum face, GLenum pname, GLint param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMateriali(face=%lu, pname=%lu, param=%ld)\n", face, pname, param); -#endif - glMateriali(face, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMateriali"); -#endif -} - -// void glMaterialiv (GLenum face, GLenum pname, const GLint *params); -static inline void qglMaterialiv(GLenum face, GLenum pname, const GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMaterialiv(face=%lu, pname=%lu, params=%p)\n", face, pname, params); -#endif - glMaterialiv(face, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMaterialiv"); -#endif -} - -// void glMatrixMode (GLenum mode); -static inline void qglMatrixMode(GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMatrixMode(mode=%lu)\n", mode); -#endif - glMatrixMode(mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMatrixMode"); -#endif -} - -// void glMultMatrixd (const GLdouble *m); -static inline void qglMultMatrixd(const GLdouble *m) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMultMatrixd(m=%p)\n", m); -#endif - glMultMatrixd(m); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMultMatrixd"); -#endif -} - -// void glMultMatrixf (const GLfloat *m); -static inline void qglMultMatrixf(const GLfloat *m) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glMultMatrixf(m=%p)\n", m); -#endif - glMultMatrixf(m); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glMultMatrixf"); -#endif -} - -// void glNewList (GLuint list, GLenum mode); -static inline void qglNewList(GLuint list, GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNewList(list=%lu, mode=%lu)\n", list, mode); -#endif - glNewList(list, mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNewList"); -#endif -} - -// void glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); -static inline void qglNormal3b(GLbyte nx, GLbyte ny, GLbyte nz) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormal3b(nx=%d, ny=%d, nz=%d)\n", nx, ny, nz); -#endif - glNormal3b(nx, ny, nz); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormal3b"); -#endif -} - -// void glNormal3bv (const GLbyte *v); -static inline void qglNormal3bv(const GLbyte *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormal3bv(v=%p)\n", v); -#endif - glNormal3bv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormal3bv"); -#endif -} - -// void glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); -static inline void qglNormal3d(GLdouble nx, GLdouble ny, GLdouble nz) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormal3d(nx=%f, ny=%f, nz=%f)\n", nx, ny, nz); -#endif - glNormal3d(nx, ny, nz); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormal3d"); -#endif -} - -// void glNormal3dv (const GLdouble *v); -static inline void qglNormal3dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormal3dv(v=%p)\n", v); -#endif - glNormal3dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormal3dv"); -#endif -} - -// void glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); -static inline void qglNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormal3f(nx=%f, ny=%f, nz=%f)\n", nx, ny, nz); -#endif - glNormal3f(nx, ny, nz); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormal3f"); -#endif -} - -// void glNormal3fv (const GLfloat *v); -static inline void qglNormal3fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormal3fv(v=%p)\n", v); -#endif - glNormal3fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormal3fv"); -#endif -} - -// void glNormal3i (GLint nx, GLint ny, GLint nz); -static inline void qglNormal3i(GLint nx, GLint ny, GLint nz) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormal3i(nx=%ld, ny=%ld, nz=%ld)\n", nx, ny, nz); -#endif - glNormal3i(nx, ny, nz); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormal3i"); -#endif -} - -// void glNormal3iv (const GLint *v); -static inline void qglNormal3iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormal3iv(v=%p)\n", v); -#endif - glNormal3iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormal3iv"); -#endif -} - -// void glNormal3s (GLshort nx, GLshort ny, GLshort nz); -static inline void qglNormal3s(GLshort nx, GLshort ny, GLshort nz) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormal3s(nx=%d, ny=%d, nz=%d)\n", nx, ny, nz); -#endif - glNormal3s(nx, ny, nz); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormal3s"); -#endif -} - -// void glNormal3sv (const GLshort *v); -static inline void qglNormal3sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormal3sv(v=%p)\n", v); -#endif - glNormal3sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormal3sv"); -#endif -} - -// void glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); -static inline void qglNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glNormalPointer(type=%lu, stride=%ld, pointer=%p)\n", type, stride, pointer); -#endif - glNormalPointer(type, stride, pointer); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glNormalPointer"); -#endif -} - -// void glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -static inline void qglOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glOrtho(left=%f, right=%f, bottom=%f, top=%f, zNear=%f, zFar=%f)\n", left, right, bottom, top, zNear, zFar); -#endif - glOrtho(left, right, bottom, top, zNear, zFar); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glOrtho"); -#endif -} - -// void glPassThrough (GLfloat token); -static inline void qglPassThrough(GLfloat token) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPassThrough(token=%f)\n", token); -#endif - glPassThrough(token); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPassThrough"); -#endif -} - -// void glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); -static inline void qglPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat *values) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPixelMapfv(map=%lu, mapsize=%ld, values=%p)\n", map, mapsize, values); -#endif - glPixelMapfv(map, mapsize, values); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPixelMapfv"); -#endif -} - -// void glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); -static inline void qglPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPixelMapuiv(map=%lu, mapsize=%ld, values=%p)\n", map, mapsize, values); -#endif - glPixelMapuiv(map, mapsize, values); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPixelMapuiv"); -#endif -} - -// void glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); -static inline void qglPixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPixelMapusv(map=%lu, mapsize=%ld, values=%p)\n", map, mapsize, values); -#endif - glPixelMapusv(map, mapsize, values); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPixelMapusv"); -#endif -} - -// void glPixelStoref (GLenum pname, GLfloat param); -static inline void qglPixelStoref(GLenum pname, GLfloat param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPixelStoref(pname=%lu, param=%f)\n", pname, param); -#endif - glPixelStoref(pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPixelStoref"); -#endif -} - -// void glPixelStorei (GLenum pname, GLint param); -static inline void qglPixelStorei(GLenum pname, GLint param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPixelStorei(pname=%lu, param=%ld)\n", pname, param); -#endif - glPixelStorei(pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPixelStorei"); -#endif -} - -// void glPixelTransferf (GLenum pname, GLfloat param); -static inline void qglPixelTransferf(GLenum pname, GLfloat param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPixelTransferf(pname=%lu, param=%f)\n", pname, param); -#endif - glPixelTransferf(pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPixelTransferf"); -#endif -} - -// void glPixelTransferi (GLenum pname, GLint param); -static inline void qglPixelTransferi(GLenum pname, GLint param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPixelTransferi(pname=%lu, param=%ld)\n", pname, param); -#endif - glPixelTransferi(pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPixelTransferi"); -#endif -} - -// void glPixelZoom (GLfloat xfactor, GLfloat yfactor); -static inline void qglPixelZoom(GLfloat xfactor, GLfloat yfactor) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPixelZoom(xfactor=%f, yfactor=%f)\n", xfactor, yfactor); -#endif - glPixelZoom(xfactor, yfactor); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPixelZoom"); -#endif -} - -// void glPointSize (GLfloat size); -static inline void qglPointSize(GLfloat size) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPointSize(size=%f)\n", size); -#endif - glPointSize(size); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPointSize"); -#endif -} - -// void glPolygonMode (GLenum face, GLenum mode); -static inline void qglPolygonMode(GLenum face, GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPolygonMode(face=%lu, mode=%lu)\n", face, mode); -#endif - glPolygonMode(face, mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPolygonMode"); -#endif -} - -// void glPolygonOffset (GLfloat factor, GLfloat units); -static inline void qglPolygonOffset(GLfloat factor, GLfloat units) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPolygonOffset(factor=%f, units=%f)\n", factor, units); -#endif - glPolygonOffset(factor, units); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPolygonOffset"); -#endif -} - -// void glPolygonStipple (const GLubyte *mask); -static inline void qglPolygonStipple(const GLubyte *mask) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPolygonStipple(mask=%p)\n", mask); -#endif - glPolygonStipple(mask); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPolygonStipple"); -#endif -} - -// void glPopAttrib (void); -static inline void qglPopAttrib(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPopAttrib(void)\n"); -#endif - glPopAttrib(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPopAttrib"); -#endif -} - -// void glPopClientAttrib (void); -static inline void qglPopClientAttrib(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPopClientAttrib(void)\n"); -#endif - glPopClientAttrib(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPopClientAttrib"); -#endif -} - -// void glPopMatrix (void); -static inline void qglPopMatrix(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPopMatrix(void)\n"); -#endif - glPopMatrix(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPopMatrix"); -#endif -} - -// void glPopName (void); -static inline void qglPopName(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPopName(void)\n"); -#endif - glPopName(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPopName"); -#endif -} - -// void glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); -static inline void qglPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPrioritizeTextures(n=%ld, textures=%p, priorities=%p)\n", n, textures, priorities); -#endif - glPrioritizeTextures(n, textures, priorities); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPrioritizeTextures"); -#endif -} - -// void glPushAttrib (GLbitfield mask); -static inline void qglPushAttrib(GLbitfield mask) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPushAttrib(mask=%lu)\n", mask); -#endif - glPushAttrib(mask); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPushAttrib"); -#endif -} - -// void glPushClientAttrib (GLbitfield mask); -static inline void qglPushClientAttrib(GLbitfield mask) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPushClientAttrib(mask=%lu)\n", mask); -#endif - glPushClientAttrib(mask); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPushClientAttrib"); -#endif -} - -// void glPushMatrix (void); -static inline void qglPushMatrix(void) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPushMatrix(void)\n"); -#endif - glPushMatrix(); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPushMatrix"); -#endif -} - -// void glPushName (GLuint name); -static inline void qglPushName(GLuint name) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glPushName(name=%lu)\n", name); -#endif - glPushName(name); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glPushName"); -#endif -} - -// void glRasterPos2d (GLdouble x, GLdouble y); -static inline void qglRasterPos2d(GLdouble x, GLdouble y) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos2d(x=%f, y=%f)\n", x, y); -#endif - glRasterPos2d(x, y); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos2d"); -#endif -} - -// void glRasterPos2dv (const GLdouble *v); -static inline void qglRasterPos2dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos2dv(v=%p)\n", v); -#endif - glRasterPos2dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos2dv"); -#endif -} - -// void glRasterPos2f (GLfloat x, GLfloat y); -static inline void qglRasterPos2f(GLfloat x, GLfloat y) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos2f(x=%f, y=%f)\n", x, y); -#endif - glRasterPos2f(x, y); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos2f"); -#endif -} - -// void glRasterPos2fv (const GLfloat *v); -static inline void qglRasterPos2fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos2fv(v=%p)\n", v); -#endif - glRasterPos2fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos2fv"); -#endif -} - -// void glRasterPos2i (GLint x, GLint y); -static inline void qglRasterPos2i(GLint x, GLint y) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos2i(x=%ld, y=%ld)\n", x, y); -#endif - glRasterPos2i(x, y); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos2i"); -#endif -} - -// void glRasterPos2iv (const GLint *v); -static inline void qglRasterPos2iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos2iv(v=%p)\n", v); -#endif - glRasterPos2iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos2iv"); -#endif -} - -// void glRasterPos2s (GLshort x, GLshort y); -static inline void qglRasterPos2s(GLshort x, GLshort y) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos2s(x=%d, y=%d)\n", x, y); -#endif - glRasterPos2s(x, y); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos2s"); -#endif -} - -// void glRasterPos2sv (const GLshort *v); -static inline void qglRasterPos2sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos2sv(v=%p)\n", v); -#endif - glRasterPos2sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos2sv"); -#endif -} - -// void glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); -static inline void qglRasterPos3d(GLdouble x, GLdouble y, GLdouble z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos3d(x=%f, y=%f, z=%f)\n", x, y, z); -#endif - glRasterPos3d(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos3d"); -#endif -} - -// void glRasterPos3dv (const GLdouble *v); -static inline void qglRasterPos3dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos3dv(v=%p)\n", v); -#endif - glRasterPos3dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos3dv"); -#endif -} - -// void glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); -static inline void qglRasterPos3f(GLfloat x, GLfloat y, GLfloat z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos3f(x=%f, y=%f, z=%f)\n", x, y, z); -#endif - glRasterPos3f(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos3f"); -#endif -} - -// void glRasterPos3fv (const GLfloat *v); -static inline void qglRasterPos3fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos3fv(v=%p)\n", v); -#endif - glRasterPos3fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos3fv"); -#endif -} - -// void glRasterPos3i (GLint x, GLint y, GLint z); -static inline void qglRasterPos3i(GLint x, GLint y, GLint z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos3i(x=%ld, y=%ld, z=%ld)\n", x, y, z); -#endif - glRasterPos3i(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos3i"); -#endif -} - -// void glRasterPos3iv (const GLint *v); -static inline void qglRasterPos3iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos3iv(v=%p)\n", v); -#endif - glRasterPos3iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos3iv"); -#endif -} - -// void glRasterPos3s (GLshort x, GLshort y, GLshort z); -static inline void qglRasterPos3s(GLshort x, GLshort y, GLshort z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos3s(x=%d, y=%d, z=%d)\n", x, y, z); -#endif - glRasterPos3s(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos3s"); -#endif -} - -// void glRasterPos3sv (const GLshort *v); -static inline void qglRasterPos3sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos3sv(v=%p)\n", v); -#endif - glRasterPos3sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos3sv"); -#endif -} - -// void glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -static inline void qglRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos4d(x=%f, y=%f, z=%f, w=%f)\n", x, y, z, w); -#endif - glRasterPos4d(x, y, z, w); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos4d"); -#endif -} - -// void glRasterPos4dv (const GLdouble *v); -static inline void qglRasterPos4dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos4dv(v=%p)\n", v); -#endif - glRasterPos4dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos4dv"); -#endif -} - -// void glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -static inline void qglRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos4f(x=%f, y=%f, z=%f, w=%f)\n", x, y, z, w); -#endif - glRasterPos4f(x, y, z, w); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos4f"); -#endif -} - -// void glRasterPos4fv (const GLfloat *v); -static inline void qglRasterPos4fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos4fv(v=%p)\n", v); -#endif - glRasterPos4fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos4fv"); -#endif -} - -// void glRasterPos4i (GLint x, GLint y, GLint z, GLint w); -static inline void qglRasterPos4i(GLint x, GLint y, GLint z, GLint w) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos4i(x=%ld, y=%ld, z=%ld, w=%ld)\n", x, y, z, w); -#endif - glRasterPos4i(x, y, z, w); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos4i"); -#endif -} - -// void glRasterPos4iv (const GLint *v); -static inline void qglRasterPos4iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos4iv(v=%p)\n", v); -#endif - glRasterPos4iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos4iv"); -#endif -} - -// void glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); -static inline void qglRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos4s(x=%d, y=%d, z=%d, w=%d)\n", x, y, z, w); -#endif - glRasterPos4s(x, y, z, w); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos4s"); -#endif -} - -// void glRasterPos4sv (const GLshort *v); -static inline void qglRasterPos4sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRasterPos4sv(v=%p)\n", v); -#endif - glRasterPos4sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRasterPos4sv"); -#endif -} - -// void glReadBuffer (GLenum mode); -static inline void qglReadBuffer(GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glReadBuffer(mode=%lu)\n", mode); -#endif - glReadBuffer(mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glReadBuffer"); -#endif -} - -// void glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); -static inline void qglReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glReadPixels(x=%ld, y=%ld, width=%ld, height=%ld, format=%lu, type=%lu, pixels=%p)\n", x, y, width, height, format, type, pixels); -#endif - glReadPixels(x, y, width, height, format, type, pixels); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glReadPixels"); -#endif -} - -// void glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); -static inline void qglRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRectd(x1=%f, y1=%f, x2=%f, y2=%f)\n", x1, y1, x2, y2); -#endif - glRectd(x1, y1, x2, y2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRectd"); -#endif -} - -// void glRectdv (const GLdouble *v1, const GLdouble *v2); -static inline void qglRectdv(const GLdouble *v1, const GLdouble *v2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRectdv(v1=%p, v2=%p)\n", v1, v2); -#endif - glRectdv(v1, v2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRectdv"); -#endif -} - -// void glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); -static inline void qglRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRectf(x1=%f, y1=%f, x2=%f, y2=%f)\n", x1, y1, x2, y2); -#endif - glRectf(x1, y1, x2, y2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRectf"); -#endif -} - -// void glRectfv (const GLfloat *v1, const GLfloat *v2); -static inline void qglRectfv(const GLfloat *v1, const GLfloat *v2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRectfv(v1=%p, v2=%p)\n", v1, v2); -#endif - glRectfv(v1, v2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRectfv"); -#endif -} - -// void glRecti (GLint x1, GLint y1, GLint x2, GLint y2); -static inline void qglRecti(GLint x1, GLint y1, GLint x2, GLint y2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRecti(x1=%ld, y1=%ld, x2=%ld, y2=%ld)\n", x1, y1, x2, y2); -#endif - glRecti(x1, y1, x2, y2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRecti"); -#endif -} - -// void glRectiv (const GLint *v1, const GLint *v2); -static inline void qglRectiv(const GLint *v1, const GLint *v2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRectiv(v1=%p, v2=%p)\n", v1, v2); -#endif - glRectiv(v1, v2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRectiv"); -#endif -} - -// void glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); -static inline void qglRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRects(x1=%d, y1=%d, x2=%d, y2=%d)\n", x1, y1, x2, y2); -#endif - glRects(x1, y1, x2, y2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRects"); -#endif -} - -// void glRectsv (const GLshort *v1, const GLshort *v2); -static inline void qglRectsv(const GLshort *v1, const GLshort *v2) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRectsv(v1=%p, v2=%p)\n", v1, v2); -#endif - glRectsv(v1, v2); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRectsv"); -#endif -} - -// GLint glRenderMode (GLenum mode); -static inline GLint qglRenderMode(GLenum mode) -{ - GLint returnValue; -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRenderMode(mode=%lu)\n", mode); -#endif - returnValue = glRenderMode(mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRenderMode"); -#endif - return returnValue; -} - -// void glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -static inline void qglRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRotated(angle=%f, x=%f, y=%f, z=%f)\n", angle, x, y, z); -#endif - glRotated(angle, x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRotated"); -#endif -} - -// void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -static inline void qglRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glRotatef(angle=%f, x=%f, y=%f, z=%f)\n", angle, x, y, z); -#endif - glRotatef(angle, x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glRotatef"); -#endif -} - -// void glScaled (GLdouble x, GLdouble y, GLdouble z); -static inline void qglScaled(GLdouble x, GLdouble y, GLdouble z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glScaled(x=%f, y=%f, z=%f)\n", x, y, z); -#endif - glScaled(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glScaled"); -#endif -} - -// void glScalef (GLfloat x, GLfloat y, GLfloat z); -static inline void qglScalef(GLfloat x, GLfloat y, GLfloat z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glScalef(x=%f, y=%f, z=%f)\n", x, y, z); -#endif - glScalef(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glScalef"); -#endif -} - -// void glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -static inline void qglScissor(GLint x, GLint y, GLsizei width, GLsizei height) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glScissor(x=%ld, y=%ld, width=%ld, height=%ld)\n", x, y, width, height); -#endif - glScissor(x, y, width, height); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glScissor"); -#endif -} - -// void glSelectBuffer (GLsizei size, GLuint *buffer); -static inline void qglSelectBuffer(GLsizei size, GLuint *buffer) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glSelectBuffer(size=%ld, buffer=%p)\n", size, buffer); -#endif - glSelectBuffer(size, buffer); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glSelectBuffer"); -#endif -} - -// void glShadeModel (GLenum mode); -static inline void qglShadeModel(GLenum mode) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glShadeModel(mode=%lu)\n", mode); -#endif - glShadeModel(mode); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glShadeModel"); -#endif -} - -// void glStencilFunc (GLenum func, GLint ref, GLuint mask); -static inline void qglStencilFunc(GLenum func, GLint ref, GLuint mask) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glStencilFunc(func=%lu, ref=%ld, mask=%lu)\n", func, ref, mask); -#endif - glStencilFunc(func, ref, mask); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glStencilFunc"); -#endif -} - -// void glStencilMask (GLuint mask); -static inline void qglStencilMask(GLuint mask) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glStencilMask(mask=%lu)\n", mask); -#endif - glStencilMask(mask); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glStencilMask"); -#endif -} - -// void glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); -static inline void qglStencilOp(GLenum fail, GLenum zfail, GLenum zpass) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glStencilOp(fail=%lu, zfail=%lu, zpass=%lu)\n", fail, zfail, zpass); -#endif - glStencilOp(fail, zfail, zpass); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glStencilOp"); -#endif -} - -// void glTexCoord1d (GLdouble s); -static inline void qglTexCoord1d(GLdouble s) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord1d(s=%f)\n", s); -#endif - glTexCoord1d(s); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord1d"); -#endif -} - -// void glTexCoord1dv (const GLdouble *v); -static inline void qglTexCoord1dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord1dv(v=%p)\n", v); -#endif - glTexCoord1dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord1dv"); -#endif -} - -// void glTexCoord1f (GLfloat s); -static inline void qglTexCoord1f(GLfloat s) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord1f(s=%f)\n", s); -#endif - glTexCoord1f(s); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord1f"); -#endif -} - -// void glTexCoord1fv (const GLfloat *v); -static inline void qglTexCoord1fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord1fv(v=%p)\n", v); -#endif - glTexCoord1fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord1fv"); -#endif -} - -// void glTexCoord1i (GLint s); -static inline void qglTexCoord1i(GLint s) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord1i(s=%ld)\n", s); -#endif - glTexCoord1i(s); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord1i"); -#endif -} - -// void glTexCoord1iv (const GLint *v); -static inline void qglTexCoord1iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord1iv(v=%p)\n", v); -#endif - glTexCoord1iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord1iv"); -#endif -} - -// void glTexCoord1s (GLshort s); -static inline void qglTexCoord1s(GLshort s) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord1s(s=%d)\n", s); -#endif - glTexCoord1s(s); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord1s"); -#endif -} - -// void glTexCoord1sv (const GLshort *v); -static inline void qglTexCoord1sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord1sv(v=%p)\n", v); -#endif - glTexCoord1sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord1sv"); -#endif -} - -// void glTexCoord2d (GLdouble s, GLdouble t); -static inline void qglTexCoord2d(GLdouble s, GLdouble t) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord2d(s=%f, t=%f)\n", s, t); -#endif - glTexCoord2d(s, t); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord2d"); -#endif -} - -// void glTexCoord2dv (const GLdouble *v); -static inline void qglTexCoord2dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord2dv(v=%p)\n", v); -#endif - glTexCoord2dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord2dv"); -#endif -} - -// void glTexCoord2f (GLfloat s, GLfloat t); -static inline void qglTexCoord2f(GLfloat s, GLfloat t) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord2f(s=%f, t=%f)\n", s, t); -#endif - glTexCoord2f(s, t); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord2f"); -#endif -} - -// void glTexCoord2fv (const GLfloat *v); -static inline void qglTexCoord2fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord2fv(v=%p)\n", v); -#endif - glTexCoord2fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord2fv"); -#endif -} - -// void glTexCoord2i (GLint s, GLint t); -static inline void qglTexCoord2i(GLint s, GLint t) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord2i(s=%ld, t=%ld)\n", s, t); -#endif - glTexCoord2i(s, t); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord2i"); -#endif -} - -// void glTexCoord2iv (const GLint *v); -static inline void qglTexCoord2iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord2iv(v=%p)\n", v); -#endif - glTexCoord2iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord2iv"); -#endif -} - -// void glTexCoord2s (GLshort s, GLshort t); -static inline void qglTexCoord2s(GLshort s, GLshort t) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord2s(s=%d, t=%d)\n", s, t); -#endif - glTexCoord2s(s, t); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord2s"); -#endif -} - -// void glTexCoord2sv (const GLshort *v); -static inline void qglTexCoord2sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord2sv(v=%p)\n", v); -#endif - glTexCoord2sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord2sv"); -#endif -} - -// void glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); -static inline void qglTexCoord3d(GLdouble s, GLdouble t, GLdouble r) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord3d(s=%f, t=%f, r=%f)\n", s, t, r); -#endif - glTexCoord3d(s, t, r); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord3d"); -#endif -} - -// void glTexCoord3dv (const GLdouble *v); -static inline void qglTexCoord3dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord3dv(v=%p)\n", v); -#endif - glTexCoord3dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord3dv"); -#endif -} - -// void glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); -static inline void qglTexCoord3f(GLfloat s, GLfloat t, GLfloat r) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord3f(s=%f, t=%f, r=%f)\n", s, t, r); -#endif - glTexCoord3f(s, t, r); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord3f"); -#endif -} - -// void glTexCoord3fv (const GLfloat *v); -static inline void qglTexCoord3fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord3fv(v=%p)\n", v); -#endif - glTexCoord3fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord3fv"); -#endif -} - -// void glTexCoord3i (GLint s, GLint t, GLint r); -static inline void qglTexCoord3i(GLint s, GLint t, GLint r) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord3i(s=%ld, t=%ld, r=%ld)\n", s, t, r); -#endif - glTexCoord3i(s, t, r); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord3i"); -#endif -} - -// void glTexCoord3iv (const GLint *v); -static inline void qglTexCoord3iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord3iv(v=%p)\n", v); -#endif - glTexCoord3iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord3iv"); -#endif -} - -// void glTexCoord3s (GLshort s, GLshort t, GLshort r); -static inline void qglTexCoord3s(GLshort s, GLshort t, GLshort r) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord3s(s=%d, t=%d, r=%d)\n", s, t, r); -#endif - glTexCoord3s(s, t, r); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord3s"); -#endif -} - -// void glTexCoord3sv (const GLshort *v); -static inline void qglTexCoord3sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord3sv(v=%p)\n", v); -#endif - glTexCoord3sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord3sv"); -#endif -} - -// void glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); -static inline void qglTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord4d(s=%f, t=%f, r=%f, q=%f)\n", s, t, r, q); -#endif - glTexCoord4d(s, t, r, q); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord4d"); -#endif -} - -// void glTexCoord4dv (const GLdouble *v); -static inline void qglTexCoord4dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord4dv(v=%p)\n", v); -#endif - glTexCoord4dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord4dv"); -#endif -} - -// void glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); -static inline void qglTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord4f(s=%f, t=%f, r=%f, q=%f)\n", s, t, r, q); -#endif - glTexCoord4f(s, t, r, q); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord4f"); -#endif -} - -// void glTexCoord4fv (const GLfloat *v); -static inline void qglTexCoord4fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord4fv(v=%p)\n", v); -#endif - glTexCoord4fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord4fv"); -#endif -} - -// void glTexCoord4i (GLint s, GLint t, GLint r, GLint q); -static inline void qglTexCoord4i(GLint s, GLint t, GLint r, GLint q) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord4i(s=%ld, t=%ld, r=%ld, q=%ld)\n", s, t, r, q); -#endif - glTexCoord4i(s, t, r, q); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord4i"); -#endif -} - -// void glTexCoord4iv (const GLint *v); -static inline void qglTexCoord4iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord4iv(v=%p)\n", v); -#endif - glTexCoord4iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord4iv"); -#endif -} - -// void glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); -static inline void qglTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord4s(s=%d, t=%d, r=%d, q=%d)\n", s, t, r, q); -#endif - glTexCoord4s(s, t, r, q); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord4s"); -#endif -} - -// void glTexCoord4sv (const GLshort *v); -static inline void qglTexCoord4sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoord4sv(v=%p)\n", v); -#endif - glTexCoord4sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoord4sv"); -#endif -} - -// void glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -static inline void qglTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexCoordPointer(size=%ld, type=%lu, stride=%ld, pointer=%p)\n", size, type, stride, pointer); -#endif - glTexCoordPointer(size, type, stride, pointer); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexCoordPointer"); -#endif -} - -// void glTexEnvf (GLenum target, GLenum pname, GLfloat param); -static inline void qglTexEnvf(GLenum target, GLenum pname, GLfloat param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexEnvf(target=%lu, pname=%lu, param=%f)\n", target, pname, param); -#endif - glTexEnvf(target, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexEnvf"); -#endif -} - -// void glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); -static inline void qglTexEnvfv(GLenum target, GLenum pname, const GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexEnvfv(target=%lu, pname=%lu, params=%p)\n", target, pname, params); -#endif - glTexEnvfv(target, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexEnvfv"); -#endif -} - -// void glTexEnvi (GLenum target, GLenum pname, GLint param); -static inline void qglTexEnvi(GLenum target, GLenum pname, GLint param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexEnvi(target=%lu, pname=%lu, param=%ld)\n", target, pname, param); -#endif - glTexEnvi(target, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexEnvi"); -#endif -} - -// void glTexEnviv (GLenum target, GLenum pname, const GLint *params); -static inline void qglTexEnviv(GLenum target, GLenum pname, const GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexEnviv(target=%lu, pname=%lu, params=%p)\n", target, pname, params); -#endif - glTexEnviv(target, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexEnviv"); -#endif -} - -// void glTexGend (GLenum coord, GLenum pname, GLdouble param); -static inline void qglTexGend(GLenum coord, GLenum pname, GLdouble param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexGend(coord=%lu, pname=%lu, param=%f)\n", coord, pname, param); -#endif - glTexGend(coord, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexGend"); -#endif -} - -// void glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); -static inline void qglTexGendv(GLenum coord, GLenum pname, const GLdouble *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexGendv(coord=%lu, pname=%lu, params=%p)\n", coord, pname, params); -#endif - glTexGendv(coord, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexGendv"); -#endif -} - -// void glTexGenf (GLenum coord, GLenum pname, GLfloat param); -static inline void qglTexGenf(GLenum coord, GLenum pname, GLfloat param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexGenf(coord=%lu, pname=%lu, param=%f)\n", coord, pname, param); -#endif - glTexGenf(coord, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexGenf"); -#endif -} - -// void glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); -static inline void qglTexGenfv(GLenum coord, GLenum pname, const GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexGenfv(coord=%lu, pname=%lu, params=%p)\n", coord, pname, params); -#endif - glTexGenfv(coord, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexGenfv"); -#endif -} - -// void glTexGeni (GLenum coord, GLenum pname, GLint param); -static inline void qglTexGeni(GLenum coord, GLenum pname, GLint param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexGeni(coord=%lu, pname=%lu, param=%ld)\n", coord, pname, param); -#endif - glTexGeni(coord, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexGeni"); -#endif -} - -// void glTexGeniv (GLenum coord, GLenum pname, const GLint *params); -static inline void qglTexGeniv(GLenum coord, GLenum pname, const GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexGeniv(coord=%lu, pname=%lu, params=%p)\n", coord, pname, params); -#endif - glTexGeniv(coord, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexGeniv"); -#endif -} - -// void glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -static inline void qglTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexImage1D(target=%lu, level=%ld, internalformat=%ld, width=%ld, border=%ld, format=%lu, type=%lu, pixels=%p)\n", target, level, internalformat, width, border, format, type, pixels); -#endif - glTexImage1D(target, level, internalformat, width, border, format, type, pixels); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexImage1D"); -#endif -} - -// void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -static inline void qglTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexImage2D(target=%lu, level=%ld, internalformat=%ld, width=%ld, height=%ld, border=%ld, format=%lu, type=%lu, pixels=%p)\n", target, level, internalformat, width, height, border, format, type, pixels); -#endif - glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexImage2D"); -#endif -} - -// void glTexParameterf (GLenum target, GLenum pname, GLfloat param); -static inline void qglTexParameterf(GLenum target, GLenum pname, GLfloat param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexParameterf(target=%lu, pname=%lu, param=%f)\n", target, pname, param); -#endif - glTexParameterf(target, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexParameterf"); -#endif -} - -// void glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); -static inline void qglTexParameterfv(GLenum target, GLenum pname, const GLfloat *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexParameterfv(target=%lu, pname=%lu, params=%p)\n", target, pname, params); -#endif - glTexParameterfv(target, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexParameterfv"); -#endif -} - -// void glTexParameteri (GLenum target, GLenum pname, GLint param); -static inline void qglTexParameteri(GLenum target, GLenum pname, GLint param) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexParameteri(target=%lu, pname=%lu, param=%ld)\n", target, pname, param); -#endif - glTexParameteri(target, pname, param); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexParameteri"); -#endif -} - -// void glTexParameteriv (GLenum target, GLenum pname, const GLint *params); -static inline void qglTexParameteriv(GLenum target, GLenum pname, const GLint *params) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexParameteriv(target=%lu, pname=%lu, params=%p)\n", target, pname, params); -#endif - glTexParameteriv(target, pname, params); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexParameteriv"); -#endif -} - -// void glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -static inline void qglTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexSubImage1D(target=%lu, level=%ld, xoffset=%ld, width=%ld, format=%lu, type=%lu, pixels=%p)\n", target, level, xoffset, width, format, type, pixels); -#endif - glTexSubImage1D(target, level, xoffset, width, format, type, pixels); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexSubImage1D"); -#endif -} - -// void glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -static inline void qglTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTexSubImage2D(target=%lu, level=%ld, xoffset=%ld, yoffset=%ld, width=%ld, height=%ld, format=%lu, type=%lu, pixels=%p)\n", target, level, xoffset, yoffset, width, height, format, type, pixels); -#endif - glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTexSubImage2D"); -#endif -} - -// void glTranslated (GLdouble x, GLdouble y, GLdouble z); -static inline void qglTranslated(GLdouble x, GLdouble y, GLdouble z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTranslated(x=%f, y=%f, z=%f)\n", x, y, z); -#endif - glTranslated(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTranslated"); -#endif -} - -// void glTranslatef (GLfloat x, GLfloat y, GLfloat z); -static inline void qglTranslatef(GLfloat x, GLfloat y, GLfloat z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glTranslatef(x=%f, y=%f, z=%f)\n", x, y, z); -#endif - glTranslatef(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glTranslatef"); -#endif -} - -// void glVertex2d (GLdouble x, GLdouble y); -static inline void qglVertex2d(GLdouble x, GLdouble y) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex2d(x=%f, y=%f)\n", x, y); -#endif - glVertex2d(x, y); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex2d"); -#endif -} - -// void glVertex2dv (const GLdouble *v); -static inline void qglVertex2dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex2dv(v=%p)\n", v); -#endif - glVertex2dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex2dv"); -#endif -} - -// void glVertex2f (GLfloat x, GLfloat y); -static inline void qglVertex2f(GLfloat x, GLfloat y) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex2f(x=%f, y=%f)\n", x, y); -#endif - glVertex2f(x, y); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex2f"); -#endif -} - -// void glVertex2fv (const GLfloat *v); -static inline void qglVertex2fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex2fv(v=%p)\n", v); -#endif - glVertex2fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex2fv"); -#endif -} - -// void glVertex2i (GLint x, GLint y); -static inline void qglVertex2i(GLint x, GLint y) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex2i(x=%ld, y=%ld)\n", x, y); -#endif - glVertex2i(x, y); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex2i"); -#endif -} - -// void glVertex2iv (const GLint *v); -static inline void qglVertex2iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex2iv(v=%p)\n", v); -#endif - glVertex2iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex2iv"); -#endif -} - -// void glVertex2s (GLshort x, GLshort y); -static inline void qglVertex2s(GLshort x, GLshort y) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex2s(x=%d, y=%d)\n", x, y); -#endif - glVertex2s(x, y); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex2s"); -#endif -} - -// void glVertex2sv (const GLshort *v); -static inline void qglVertex2sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex2sv(v=%p)\n", v); -#endif - glVertex2sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex2sv"); -#endif -} - -// void glVertex3d (GLdouble x, GLdouble y, GLdouble z); -static inline void qglVertex3d(GLdouble x, GLdouble y, GLdouble z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex3d(x=%f, y=%f, z=%f)\n", x, y, z); -#endif - glVertex3d(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex3d"); -#endif -} - -// void glVertex3dv (const GLdouble *v); -static inline void qglVertex3dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex3dv(v=%p)\n", v); -#endif - glVertex3dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex3dv"); -#endif -} - -// void glVertex3f (GLfloat x, GLfloat y, GLfloat z); -static inline void qglVertex3f(GLfloat x, GLfloat y, GLfloat z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex3f(x=%f, y=%f, z=%f)\n", x, y, z); -#endif - glVertex3f(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex3f"); -#endif -} - -// void glVertex3fv (const GLfloat *v); -static inline void qglVertex3fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex3fv(v=%p)\n", v); -#endif - glVertex3fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex3fv"); -#endif -} - -// void glVertex3i (GLint x, GLint y, GLint z); -static inline void qglVertex3i(GLint x, GLint y, GLint z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex3i(x=%ld, y=%ld, z=%ld)\n", x, y, z); -#endif - glVertex3i(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex3i"); -#endif -} - -// void glVertex3iv (const GLint *v); -static inline void qglVertex3iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex3iv(v=%p)\n", v); -#endif - glVertex3iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex3iv"); -#endif -} - -// void glVertex3s (GLshort x, GLshort y, GLshort z); -static inline void qglVertex3s(GLshort x, GLshort y, GLshort z) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex3s(x=%d, y=%d, z=%d)\n", x, y, z); -#endif - glVertex3s(x, y, z); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex3s"); -#endif -} - -// void glVertex3sv (const GLshort *v); -static inline void qglVertex3sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex3sv(v=%p)\n", v); -#endif - glVertex3sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex3sv"); -#endif -} - -// void glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -static inline void qglVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex4d(x=%f, y=%f, z=%f, w=%f)\n", x, y, z, w); -#endif - glVertex4d(x, y, z, w); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex4d"); -#endif -} - -// void glVertex4dv (const GLdouble *v); -static inline void qglVertex4dv(const GLdouble *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex4dv(v=%p)\n", v); -#endif - glVertex4dv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex4dv"); -#endif -} - -// void glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -static inline void qglVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex4f(x=%f, y=%f, z=%f, w=%f)\n", x, y, z, w); -#endif - glVertex4f(x, y, z, w); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex4f"); -#endif -} - -// void glVertex4fv (const GLfloat *v); -static inline void qglVertex4fv(const GLfloat *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex4fv(v=%p)\n", v); -#endif - glVertex4fv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex4fv"); -#endif -} - -// void glVertex4i (GLint x, GLint y, GLint z, GLint w); -static inline void qglVertex4i(GLint x, GLint y, GLint z, GLint w) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex4i(x=%ld, y=%ld, z=%ld, w=%ld)\n", x, y, z, w); -#endif - glVertex4i(x, y, z, w); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex4i"); -#endif -} - -// void glVertex4iv (const GLint *v); -static inline void qglVertex4iv(const GLint *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex4iv(v=%p)\n", v); -#endif - glVertex4iv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex4iv"); -#endif -} - -// void glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); -static inline void qglVertex4s(GLshort x, GLshort y, GLshort z, GLshort w) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex4s(x=%d, y=%d, z=%d, w=%d)\n", x, y, z, w); -#endif - glVertex4s(x, y, z, w); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex4s"); -#endif -} - -// void glVertex4sv (const GLshort *v); -static inline void qglVertex4sv(const GLshort *v) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertex4sv(v=%p)\n", v); -#endif - glVertex4sv(v); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertex4sv"); -#endif -} - -// void glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -static inline void qglVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glVertexPointer(size=%ld, type=%lu, stride=%ld, pointer=%p)\n", size, type, stride, pointer); -#endif - glVertexPointer(size, type, stride, pointer); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glVertexPointer"); -#endif -} - -// void glViewport (GLint x, GLint y, GLsizei width, GLsizei height); -static inline void qglViewport(GLint x, GLint y, GLsizei width, GLsizei height) -{ -#if !defined(NDEBUG) && defined(QGL_LOG_GL_CALLS) - if (QGLLogGLCalls) - fprintf(QGLDebugFile(), "glViewport(x=%ld, y=%ld, width=%ld, height=%ld)\n", x, y, width, height); -#endif - glViewport(x, y, width, height); -#if !defined(NDEBUG) && defined(QGL_CHECK_GL_ERRORS) - if (!QGLBeginStarted) - QGLCheckError("glViewport"); -#endif -} - -// Prevent calls to the 'normal' GL functions -#define glAccum CALL_THE_QGL_VERSION_OF_glAccum -#define glAlphaFunc CALL_THE_QGL_VERSION_OF_glAlphaFunc -#define glAreTexturesResident CALL_THE_QGL_VERSION_OF_glAreTexturesResident -#define glArrayElement CALL_THE_QGL_VERSION_OF_glArrayElement -#define glBegin CALL_THE_QGL_VERSION_OF_glBegin -#define glBindTexture CALL_THE_QGL_VERSION_OF_glBindTexture -#define glBitmap CALL_THE_QGL_VERSION_OF_glBitmap -#define glBlendFunc CALL_THE_QGL_VERSION_OF_glBlendFunc -#define glCallList CALL_THE_QGL_VERSION_OF_glCallList -#define glCallLists CALL_THE_QGL_VERSION_OF_glCallLists -#define glClear CALL_THE_QGL_VERSION_OF_glClear -#define glClearAccum CALL_THE_QGL_VERSION_OF_glClearAccum -#define glClearColor CALL_THE_QGL_VERSION_OF_glClearColor -#define glClearDepth CALL_THE_QGL_VERSION_OF_glClearDepth -#define glClearIndex CALL_THE_QGL_VERSION_OF_glClearIndex -#define glClearStencil CALL_THE_QGL_VERSION_OF_glClearStencil -#define glClipPlane CALL_THE_QGL_VERSION_OF_glClipPlane -#define glColor3b CALL_THE_QGL_VERSION_OF_glColor3b -#define glColor3bv CALL_THE_QGL_VERSION_OF_glColor3bv -#define glColor3d CALL_THE_QGL_VERSION_OF_glColor3d -#define glColor3dv CALL_THE_QGL_VERSION_OF_glColor3dv -#define glColor3f CALL_THE_QGL_VERSION_OF_glColor3f -#define glColor3fv CALL_THE_QGL_VERSION_OF_glColor3fv -#define glColor3i CALL_THE_QGL_VERSION_OF_glColor3i -#define glColor3iv CALL_THE_QGL_VERSION_OF_glColor3iv -#define glColor3s CALL_THE_QGL_VERSION_OF_glColor3s -#define glColor3sv CALL_THE_QGL_VERSION_OF_glColor3sv -#define glColor3ub CALL_THE_QGL_VERSION_OF_glColor3ub -#define glColor3ubv CALL_THE_QGL_VERSION_OF_glColor3ubv -#define glColor3ui CALL_THE_QGL_VERSION_OF_glColor3ui -#define glColor3uiv CALL_THE_QGL_VERSION_OF_glColor3uiv -#define glColor3us CALL_THE_QGL_VERSION_OF_glColor3us -#define glColor3usv CALL_THE_QGL_VERSION_OF_glColor3usv -#define glColor4b CALL_THE_QGL_VERSION_OF_glColor4b -#define glColor4bv CALL_THE_QGL_VERSION_OF_glColor4bv -#define glColor4d CALL_THE_QGL_VERSION_OF_glColor4d -#define glColor4dv CALL_THE_QGL_VERSION_OF_glColor4dv -#define glColor4f CALL_THE_QGL_VERSION_OF_glColor4f -#define glColor4fv CALL_THE_QGL_VERSION_OF_glColor4fv -#define glColor4i CALL_THE_QGL_VERSION_OF_glColor4i -#define glColor4iv CALL_THE_QGL_VERSION_OF_glColor4iv -#define glColor4s CALL_THE_QGL_VERSION_OF_glColor4s -#define glColor4sv CALL_THE_QGL_VERSION_OF_glColor4sv -#define glColor4ub CALL_THE_QGL_VERSION_OF_glColor4ub -#define glColor4ubv CALL_THE_QGL_VERSION_OF_glColor4ubv -#define glColor4ui CALL_THE_QGL_VERSION_OF_glColor4ui -#define glColor4uiv CALL_THE_QGL_VERSION_OF_glColor4uiv -#define glColor4us CALL_THE_QGL_VERSION_OF_glColor4us -#define glColor4usv CALL_THE_QGL_VERSION_OF_glColor4usv -#define glColorMask CALL_THE_QGL_VERSION_OF_glColorMask -#define glColorMaterial CALL_THE_QGL_VERSION_OF_glColorMaterial -#define glColorPointer CALL_THE_QGL_VERSION_OF_glColorPointer -#define glCopyPixels CALL_THE_QGL_VERSION_OF_glCopyPixels -#define glCopyTexImage1D CALL_THE_QGL_VERSION_OF_glCopyTexImage1D -#define glCopyTexImage2D CALL_THE_QGL_VERSION_OF_glCopyTexImage2D -#define glCopyTexSubImage1D CALL_THE_QGL_VERSION_OF_glCopyTexSubImage1D -#define glCopyTexSubImage2D CALL_THE_QGL_VERSION_OF_glCopyTexSubImage2D -#define glCullFace CALL_THE_QGL_VERSION_OF_glCullFace -#define glDeleteLists CALL_THE_QGL_VERSION_OF_glDeleteLists -#define glDeleteTextures CALL_THE_QGL_VERSION_OF_glDeleteTextures -#define glDepthFunc CALL_THE_QGL_VERSION_OF_glDepthFunc -#define glDepthMask CALL_THE_QGL_VERSION_OF_glDepthMask -#define glDepthRange CALL_THE_QGL_VERSION_OF_glDepthRange -#define glDisable CALL_THE_QGL_VERSION_OF_glDisable -#define glDisableClientState CALL_THE_QGL_VERSION_OF_glDisableClientState -#define glDrawArrays CALL_THE_QGL_VERSION_OF_glDrawArrays -#define glDrawBuffer CALL_THE_QGL_VERSION_OF_glDrawBuffer -#define glDrawElements CALL_THE_QGL_VERSION_OF_glDrawElements -#define glDrawPixels CALL_THE_QGL_VERSION_OF_glDrawPixels -#define glEdgeFlag CALL_THE_QGL_VERSION_OF_glEdgeFlag -#define glEdgeFlagPointer CALL_THE_QGL_VERSION_OF_glEdgeFlagPointer -#define glEdgeFlagv CALL_THE_QGL_VERSION_OF_glEdgeFlagv -#define glEnable CALL_THE_QGL_VERSION_OF_glEnable -#define glEnableClientState CALL_THE_QGL_VERSION_OF_glEnableClientState -#define glEnd CALL_THE_QGL_VERSION_OF_glEnd -#define glEndList CALL_THE_QGL_VERSION_OF_glEndList -#define glEvalCoord1d CALL_THE_QGL_VERSION_OF_glEvalCoord1d -#define glEvalCoord1dv CALL_THE_QGL_VERSION_OF_glEvalCoord1dv -#define glEvalCoord1f CALL_THE_QGL_VERSION_OF_glEvalCoord1f -#define glEvalCoord1fv CALL_THE_QGL_VERSION_OF_glEvalCoord1fv -#define glEvalCoord2d CALL_THE_QGL_VERSION_OF_glEvalCoord2d -#define glEvalCoord2dv CALL_THE_QGL_VERSION_OF_glEvalCoord2dv -#define glEvalCoord2f CALL_THE_QGL_VERSION_OF_glEvalCoord2f -#define glEvalCoord2fv CALL_THE_QGL_VERSION_OF_glEvalCoord2fv -#define glEvalMesh1 CALL_THE_QGL_VERSION_OF_glEvalMesh1 -#define glEvalMesh2 CALL_THE_QGL_VERSION_OF_glEvalMesh2 -#define glEvalPoint1 CALL_THE_QGL_VERSION_OF_glEvalPoint1 -#define glEvalPoint2 CALL_THE_QGL_VERSION_OF_glEvalPoint2 -#define glFeedbackBuffer CALL_THE_QGL_VERSION_OF_glFeedbackBuffer -#define glFinish CALL_THE_QGL_VERSION_OF_glFinish -#define glFlush CALL_THE_QGL_VERSION_OF_glFlush -#define glFogf CALL_THE_QGL_VERSION_OF_glFogf -#define glFogfv CALL_THE_QGL_VERSION_OF_glFogfv -#define glFogi CALL_THE_QGL_VERSION_OF_glFogi -#define glFogiv CALL_THE_QGL_VERSION_OF_glFogiv -#define glFrontFace CALL_THE_QGL_VERSION_OF_glFrontFace -#define glFrustum CALL_THE_QGL_VERSION_OF_glFrustum -#define glGenLists CALL_THE_QGL_VERSION_OF_glGenLists -#define glGenTextures CALL_THE_QGL_VERSION_OF_glGenTextures -#define glGetBooleanv CALL_THE_QGL_VERSION_OF_glGetBooleanv -#define glGetClipPlane CALL_THE_QGL_VERSION_OF_glGetClipPlane -#define glGetDoublev CALL_THE_QGL_VERSION_OF_glGetDoublev -#define glGetError CALL_THE_QGL_VERSION_OF_glGetError -#define glGetFloatv CALL_THE_QGL_VERSION_OF_glGetFloatv -#define glGetIntegerv CALL_THE_QGL_VERSION_OF_glGetIntegerv -#define glGetLightfv CALL_THE_QGL_VERSION_OF_glGetLightfv -#define glGetLightiv CALL_THE_QGL_VERSION_OF_glGetLightiv -#define glGetMapdv CALL_THE_QGL_VERSION_OF_glGetMapdv -#define glGetMapfv CALL_THE_QGL_VERSION_OF_glGetMapfv -#define glGetMapiv CALL_THE_QGL_VERSION_OF_glGetMapiv -#define glGetMaterialfv CALL_THE_QGL_VERSION_OF_glGetMaterialfv -#define glGetMaterialiv CALL_THE_QGL_VERSION_OF_glGetMaterialiv -#define glGetPixelMapfv CALL_THE_QGL_VERSION_OF_glGetPixelMapfv -#define glGetPixelMapuiv CALL_THE_QGL_VERSION_OF_glGetPixelMapuiv -#define glGetPixelMapusv CALL_THE_QGL_VERSION_OF_glGetPixelMapusv -#define glGetPointerv CALL_THE_QGL_VERSION_OF_glGetPointerv -#define glGetPolygonStipple CALL_THE_QGL_VERSION_OF_glGetPolygonStipple -#define glGetString CALL_THE_QGL_VERSION_OF_glGetString -#define glGetTexEnvfv CALL_THE_QGL_VERSION_OF_glGetTexEnvfv -#define glGetTexEnviv CALL_THE_QGL_VERSION_OF_glGetTexEnviv -#define glGetTexGendv CALL_THE_QGL_VERSION_OF_glGetTexGendv -#define glGetTexGenfv CALL_THE_QGL_VERSION_OF_glGetTexGenfv -#define glGetTexGeniv CALL_THE_QGL_VERSION_OF_glGetTexGeniv -#define glGetTexImage CALL_THE_QGL_VERSION_OF_glGetTexImage -#define glGetTexLevelParameterfv CALL_THE_QGL_VERSION_OF_glGetTexLevelParameterfv -#define glGetTexLevelParameteriv CALL_THE_QGL_VERSION_OF_glGetTexLevelParameteriv -#define glGetTexParameterfv CALL_THE_QGL_VERSION_OF_glGetTexParameterfv -#define glGetTexParameteriv CALL_THE_QGL_VERSION_OF_glGetTexParameteriv -#define glHint CALL_THE_QGL_VERSION_OF_glHint -#define glIndexMask CALL_THE_QGL_VERSION_OF_glIndexMask -#define glIndexPointer CALL_THE_QGL_VERSION_OF_glIndexPointer -#define glIndexd CALL_THE_QGL_VERSION_OF_glIndexd -#define glIndexdv CALL_THE_QGL_VERSION_OF_glIndexdv -#define glIndexf CALL_THE_QGL_VERSION_OF_glIndexf -#define glIndexfv CALL_THE_QGL_VERSION_OF_glIndexfv -#define glIndexi CALL_THE_QGL_VERSION_OF_glIndexi -#define glIndexiv CALL_THE_QGL_VERSION_OF_glIndexiv -#define glIndexs CALL_THE_QGL_VERSION_OF_glIndexs -#define glIndexsv CALL_THE_QGL_VERSION_OF_glIndexsv -#define glIndexub CALL_THE_QGL_VERSION_OF_glIndexub -#define glIndexubv CALL_THE_QGL_VERSION_OF_glIndexubv -#define glInitNames CALL_THE_QGL_VERSION_OF_glInitNames -#define glInterleavedArrays CALL_THE_QGL_VERSION_OF_glInterleavedArrays -#define glIsEnabled CALL_THE_QGL_VERSION_OF_glIsEnabled -#define glIsList CALL_THE_QGL_VERSION_OF_glIsList -#define glIsTexture CALL_THE_QGL_VERSION_OF_glIsTexture -#define glLightModelf CALL_THE_QGL_VERSION_OF_glLightModelf -#define glLightModelfv CALL_THE_QGL_VERSION_OF_glLightModelfv -#define glLightModeli CALL_THE_QGL_VERSION_OF_glLightModeli -#define glLightModeliv CALL_THE_QGL_VERSION_OF_glLightModeliv -#define glLightf CALL_THE_QGL_VERSION_OF_glLightf -#define glLightfv CALL_THE_QGL_VERSION_OF_glLightfv -#define glLighti CALL_THE_QGL_VERSION_OF_glLighti -#define glLightiv CALL_THE_QGL_VERSION_OF_glLightiv -#define glLineStipple CALL_THE_QGL_VERSION_OF_glLineStipple -#define glLineWidth CALL_THE_QGL_VERSION_OF_glLineWidth -#define glListBase CALL_THE_QGL_VERSION_OF_glListBase -#define glLoadIdentity CALL_THE_QGL_VERSION_OF_glLoadIdentity -#define glLoadMatrixd CALL_THE_QGL_VERSION_OF_glLoadMatrixd -#define glLoadMatrixf CALL_THE_QGL_VERSION_OF_glLoadMatrixf -#define glLoadName CALL_THE_QGL_VERSION_OF_glLoadName -#define glLogicOp CALL_THE_QGL_VERSION_OF_glLogicOp -#define glMap1d CALL_THE_QGL_VERSION_OF_glMap1d -#define glMap1f CALL_THE_QGL_VERSION_OF_glMap1f -#define glMap2d CALL_THE_QGL_VERSION_OF_glMap2d -#define glMap2f CALL_THE_QGL_VERSION_OF_glMap2f -#define glMapGrid1d CALL_THE_QGL_VERSION_OF_glMapGrid1d -#define glMapGrid1f CALL_THE_QGL_VERSION_OF_glMapGrid1f -#define glMapGrid2d CALL_THE_QGL_VERSION_OF_glMapGrid2d -#define glMapGrid2f CALL_THE_QGL_VERSION_OF_glMapGrid2f -#define glMaterialf CALL_THE_QGL_VERSION_OF_glMaterialf -#define glMaterialfv CALL_THE_QGL_VERSION_OF_glMaterialfv -#define glMateriali CALL_THE_QGL_VERSION_OF_glMateriali -#define glMaterialiv CALL_THE_QGL_VERSION_OF_glMaterialiv -#define glMatrixMode CALL_THE_QGL_VERSION_OF_glMatrixMode -#define glMultMatrixd CALL_THE_QGL_VERSION_OF_glMultMatrixd -#define glMultMatrixf CALL_THE_QGL_VERSION_OF_glMultMatrixf -#define glNewList CALL_THE_QGL_VERSION_OF_glNewList -#define glNormal3b CALL_THE_QGL_VERSION_OF_glNormal3b -#define glNormal3bv CALL_THE_QGL_VERSION_OF_glNormal3bv -#define glNormal3d CALL_THE_QGL_VERSION_OF_glNormal3d -#define glNormal3dv CALL_THE_QGL_VERSION_OF_glNormal3dv -#define glNormal3f CALL_THE_QGL_VERSION_OF_glNormal3f -#define glNormal3fv CALL_THE_QGL_VERSION_OF_glNormal3fv -#define glNormal3i CALL_THE_QGL_VERSION_OF_glNormal3i -#define glNormal3iv CALL_THE_QGL_VERSION_OF_glNormal3iv -#define glNormal3s CALL_THE_QGL_VERSION_OF_glNormal3s -#define glNormal3sv CALL_THE_QGL_VERSION_OF_glNormal3sv -#define glNormalPointer CALL_THE_QGL_VERSION_OF_glNormalPointer -#define glOrtho CALL_THE_QGL_VERSION_OF_glOrtho -#define glPassThrough CALL_THE_QGL_VERSION_OF_glPassThrough -#define glPixelMapfv CALL_THE_QGL_VERSION_OF_glPixelMapfv -#define glPixelMapuiv CALL_THE_QGL_VERSION_OF_glPixelMapuiv -#define glPixelMapusv CALL_THE_QGL_VERSION_OF_glPixelMapusv -#define glPixelStoref CALL_THE_QGL_VERSION_OF_glPixelStoref -#define glPixelStorei CALL_THE_QGL_VERSION_OF_glPixelStorei -#define glPixelTransferf CALL_THE_QGL_VERSION_OF_glPixelTransferf -#define glPixelTransferi CALL_THE_QGL_VERSION_OF_glPixelTransferi -#define glPixelZoom CALL_THE_QGL_VERSION_OF_glPixelZoom -#define glPointSize CALL_THE_QGL_VERSION_OF_glPointSize -#define glPolygonMode CALL_THE_QGL_VERSION_OF_glPolygonMode -#define glPolygonOffset CALL_THE_QGL_VERSION_OF_glPolygonOffset -#define glPolygonStipple CALL_THE_QGL_VERSION_OF_glPolygonStipple -#define glPopAttrib CALL_THE_QGL_VERSION_OF_glPopAttrib -#define glPopClientAttrib CALL_THE_QGL_VERSION_OF_glPopClientAttrib -#define glPopMatrix CALL_THE_QGL_VERSION_OF_glPopMatrix -#define glPopName CALL_THE_QGL_VERSION_OF_glPopName -#define glPrioritizeTextures CALL_THE_QGL_VERSION_OF_glPrioritizeTextures -#define glPushAttrib CALL_THE_QGL_VERSION_OF_glPushAttrib -#define glPushClientAttrib CALL_THE_QGL_VERSION_OF_glPushClientAttrib -#define glPushMatrix CALL_THE_QGL_VERSION_OF_glPushMatrix -#define glPushName CALL_THE_QGL_VERSION_OF_glPushName -#define glRasterPos2d CALL_THE_QGL_VERSION_OF_glRasterPos2d -#define glRasterPos2dv CALL_THE_QGL_VERSION_OF_glRasterPos2dv -#define glRasterPos2f CALL_THE_QGL_VERSION_OF_glRasterPos2f -#define glRasterPos2fv CALL_THE_QGL_VERSION_OF_glRasterPos2fv -#define glRasterPos2i CALL_THE_QGL_VERSION_OF_glRasterPos2i -#define glRasterPos2iv CALL_THE_QGL_VERSION_OF_glRasterPos2iv -#define glRasterPos2s CALL_THE_QGL_VERSION_OF_glRasterPos2s -#define glRasterPos2sv CALL_THE_QGL_VERSION_OF_glRasterPos2sv -#define glRasterPos3d CALL_THE_QGL_VERSION_OF_glRasterPos3d -#define glRasterPos3dv CALL_THE_QGL_VERSION_OF_glRasterPos3dv -#define glRasterPos3f CALL_THE_QGL_VERSION_OF_glRasterPos3f -#define glRasterPos3fv CALL_THE_QGL_VERSION_OF_glRasterPos3fv -#define glRasterPos3i CALL_THE_QGL_VERSION_OF_glRasterPos3i -#define glRasterPos3iv CALL_THE_QGL_VERSION_OF_glRasterPos3iv -#define glRasterPos3s CALL_THE_QGL_VERSION_OF_glRasterPos3s -#define glRasterPos3sv CALL_THE_QGL_VERSION_OF_glRasterPos3sv -#define glRasterPos4d CALL_THE_QGL_VERSION_OF_glRasterPos4d -#define glRasterPos4dv CALL_THE_QGL_VERSION_OF_glRasterPos4dv -#define glRasterPos4f CALL_THE_QGL_VERSION_OF_glRasterPos4f -#define glRasterPos4fv CALL_THE_QGL_VERSION_OF_glRasterPos4fv -#define glRasterPos4i CALL_THE_QGL_VERSION_OF_glRasterPos4i -#define glRasterPos4iv CALL_THE_QGL_VERSION_OF_glRasterPos4iv -#define glRasterPos4s CALL_THE_QGL_VERSION_OF_glRasterPos4s -#define glRasterPos4sv CALL_THE_QGL_VERSION_OF_glRasterPos4sv -#define glReadBuffer CALL_THE_QGL_VERSION_OF_glReadBuffer -#define glReadPixels CALL_THE_QGL_VERSION_OF_glReadPixels -#define glRectd CALL_THE_QGL_VERSION_OF_glRectd -#define glRectdv CALL_THE_QGL_VERSION_OF_glRectdv -#define glRectf CALL_THE_QGL_VERSION_OF_glRectf -#define glRectfv CALL_THE_QGL_VERSION_OF_glRectfv -#define glRecti CALL_THE_QGL_VERSION_OF_glRecti -#define glRectiv CALL_THE_QGL_VERSION_OF_glRectiv -#define glRects CALL_THE_QGL_VERSION_OF_glRects -#define glRectsv CALL_THE_QGL_VERSION_OF_glRectsv -#define glRenderMode CALL_THE_QGL_VERSION_OF_glRenderMode -#define glRotated CALL_THE_QGL_VERSION_OF_glRotated -#define glRotatef CALL_THE_QGL_VERSION_OF_glRotatef -#define glScaled CALL_THE_QGL_VERSION_OF_glScaled -#define glScalef CALL_THE_QGL_VERSION_OF_glScalef -#define glScissor CALL_THE_QGL_VERSION_OF_glScissor -#define glSelectBuffer CALL_THE_QGL_VERSION_OF_glSelectBuffer -#define glShadeModel CALL_THE_QGL_VERSION_OF_glShadeModel -#define glStencilFunc CALL_THE_QGL_VERSION_OF_glStencilFunc -#define glStencilMask CALL_THE_QGL_VERSION_OF_glStencilMask -#define glStencilOp CALL_THE_QGL_VERSION_OF_glStencilOp -#define glTexCoord1d CALL_THE_QGL_VERSION_OF_glTexCoord1d -#define glTexCoord1dv CALL_THE_QGL_VERSION_OF_glTexCoord1dv -#define glTexCoord1f CALL_THE_QGL_VERSION_OF_glTexCoord1f -#define glTexCoord1fv CALL_THE_QGL_VERSION_OF_glTexCoord1fv -#define glTexCoord1i CALL_THE_QGL_VERSION_OF_glTexCoord1i -#define glTexCoord1iv CALL_THE_QGL_VERSION_OF_glTexCoord1iv -#define glTexCoord1s CALL_THE_QGL_VERSION_OF_glTexCoord1s -#define glTexCoord1sv CALL_THE_QGL_VERSION_OF_glTexCoord1sv -#define glTexCoord2d CALL_THE_QGL_VERSION_OF_glTexCoord2d -#define glTexCoord2dv CALL_THE_QGL_VERSION_OF_glTexCoord2dv -#define glTexCoord2f CALL_THE_QGL_VERSION_OF_glTexCoord2f -#define glTexCoord2fv CALL_THE_QGL_VERSION_OF_glTexCoord2fv -#define glTexCoord2i CALL_THE_QGL_VERSION_OF_glTexCoord2i -#define glTexCoord2iv CALL_THE_QGL_VERSION_OF_glTexCoord2iv -#define glTexCoord2s CALL_THE_QGL_VERSION_OF_glTexCoord2s -#define glTexCoord2sv CALL_THE_QGL_VERSION_OF_glTexCoord2sv -#define glTexCoord3d CALL_THE_QGL_VERSION_OF_glTexCoord3d -#define glTexCoord3dv CALL_THE_QGL_VERSION_OF_glTexCoord3dv -#define glTexCoord3f CALL_THE_QGL_VERSION_OF_glTexCoord3f -#define glTexCoord3fv CALL_THE_QGL_VERSION_OF_glTexCoord3fv -#define glTexCoord3i CALL_THE_QGL_VERSION_OF_glTexCoord3i -#define glTexCoord3iv CALL_THE_QGL_VERSION_OF_glTexCoord3iv -#define glTexCoord3s CALL_THE_QGL_VERSION_OF_glTexCoord3s -#define glTexCoord3sv CALL_THE_QGL_VERSION_OF_glTexCoord3sv -#define glTexCoord4d CALL_THE_QGL_VERSION_OF_glTexCoord4d -#define glTexCoord4dv CALL_THE_QGL_VERSION_OF_glTexCoord4dv -#define glTexCoord4f CALL_THE_QGL_VERSION_OF_glTexCoord4f -#define glTexCoord4fv CALL_THE_QGL_VERSION_OF_glTexCoord4fv -#define glTexCoord4i CALL_THE_QGL_VERSION_OF_glTexCoord4i -#define glTexCoord4iv CALL_THE_QGL_VERSION_OF_glTexCoord4iv -#define glTexCoord4s CALL_THE_QGL_VERSION_OF_glTexCoord4s -#define glTexCoord4sv CALL_THE_QGL_VERSION_OF_glTexCoord4sv -#define glTexCoordPointer CALL_THE_QGL_VERSION_OF_glTexCoordPointer -#define glTexEnvf CALL_THE_QGL_VERSION_OF_glTexEnvf -#define glTexEnvfv CALL_THE_QGL_VERSION_OF_glTexEnvfv -#define glTexEnvi CALL_THE_QGL_VERSION_OF_glTexEnvi -#define glTexEnviv CALL_THE_QGL_VERSION_OF_glTexEnviv -#define glTexGend CALL_THE_QGL_VERSION_OF_glTexGend -#define glTexGendv CALL_THE_QGL_VERSION_OF_glTexGendv -#define glTexGenf CALL_THE_QGL_VERSION_OF_glTexGenf -#define glTexGenfv CALL_THE_QGL_VERSION_OF_glTexGenfv -#define glTexGeni CALL_THE_QGL_VERSION_OF_glTexGeni -#define glTexGeniv CALL_THE_QGL_VERSION_OF_glTexGeniv -#define glTexImage1D CALL_THE_QGL_VERSION_OF_glTexImage1D -#define glTexImage2D CALL_THE_QGL_VERSION_OF_glTexImage2D -#define glTexParameterf CALL_THE_QGL_VERSION_OF_glTexParameterf -#define glTexParameterfv CALL_THE_QGL_VERSION_OF_glTexParameterfv -#define glTexParameteri CALL_THE_QGL_VERSION_OF_glTexParameteri -#define glTexParameteriv CALL_THE_QGL_VERSION_OF_glTexParameteriv -#define glTexSubImage1D CALL_THE_QGL_VERSION_OF_glTexSubImage1D -#define glTexSubImage2D CALL_THE_QGL_VERSION_OF_glTexSubImage2D -#define glTranslated CALL_THE_QGL_VERSION_OF_glTranslated -#define glTranslatef CALL_THE_QGL_VERSION_OF_glTranslatef -#define glVertex2d CALL_THE_QGL_VERSION_OF_glVertex2d -#define glVertex2dv CALL_THE_QGL_VERSION_OF_glVertex2dv -#define glVertex2f CALL_THE_QGL_VERSION_OF_glVertex2f -#define glVertex2fv CALL_THE_QGL_VERSION_OF_glVertex2fv -#define glVertex2i CALL_THE_QGL_VERSION_OF_glVertex2i -#define glVertex2iv CALL_THE_QGL_VERSION_OF_glVertex2iv -#define glVertex2s CALL_THE_QGL_VERSION_OF_glVertex2s -#define glVertex2sv CALL_THE_QGL_VERSION_OF_glVertex2sv -#define glVertex3d CALL_THE_QGL_VERSION_OF_glVertex3d -#define glVertex3dv CALL_THE_QGL_VERSION_OF_glVertex3dv -#define glVertex3f CALL_THE_QGL_VERSION_OF_glVertex3f -#define glVertex3fv CALL_THE_QGL_VERSION_OF_glVertex3fv -#define glVertex3i CALL_THE_QGL_VERSION_OF_glVertex3i -#define glVertex3iv CALL_THE_QGL_VERSION_OF_glVertex3iv -#define glVertex3s CALL_THE_QGL_VERSION_OF_glVertex3s -#define glVertex3sv CALL_THE_QGL_VERSION_OF_glVertex3sv -#define glVertex4d CALL_THE_QGL_VERSION_OF_glVertex4d -#define glVertex4dv CALL_THE_QGL_VERSION_OF_glVertex4dv -#define glVertex4f CALL_THE_QGL_VERSION_OF_glVertex4f -#define glVertex4fv CALL_THE_QGL_VERSION_OF_glVertex4fv -#define glVertex4i CALL_THE_QGL_VERSION_OF_glVertex4i -#define glVertex4iv CALL_THE_QGL_VERSION_OF_glVertex4iv -#define glVertex4s CALL_THE_QGL_VERSION_OF_glVertex4s -#define glVertex4sv CALL_THE_QGL_VERSION_OF_glVertex4sv -#define glVertexPointer CALL_THE_QGL_VERSION_OF_glVertexPointer -#define glViewport CALL_THE_QGL_VERSION_OF_glViewport diff --git a/code/macosx/macosx_sndcore.m b/code/macosx/macosx_sndcore.m deleted file mode 100644 index d478ea0..0000000 --- a/code/macosx/macosx_sndcore.m +++ /dev/null @@ -1,325 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ - -// mac_snddma.c -// all other sound mixing is portable - -#include "../client/snd_local.h" - -#include -#include -#include - -// For 'ri' -#include "../renderer/tr_local.h" - -#import -#import - -static unsigned int submissionChunk; -static unsigned int maxMixedSamples; -static short *s_mixedSamples; -static int s_chunkCount; // number of chunks submitted -static qboolean s_isRunning; - -static AudioDeviceID outputDeviceID; -static AudioStreamBasicDescription outputStreamBasicDescription; - -/* -=============== -audioDeviceIOProc -=============== -*/ - -OSStatus audioDeviceIOProc(AudioDeviceID inDevice, - const AudioTimeStamp *inNow, - const AudioBufferList *inInputData, - const AudioTimeStamp *inInputTime, - AudioBufferList *outOutputData, - const AudioTimeStamp *inOutputTime, - void *inClientData) -{ - int offset; - short *samples; - unsigned int sampleIndex; - float *outBuffer; - float scale, temp; - - offset = ( s_chunkCount * submissionChunk ) % maxMixedSamples; - samples = s_mixedSamples + offset; - - assert(outOutputData->mNumberBuffers == 1); - assert(outOutputData->mBuffers[0].mNumberChannels == 2); - //assert(outOutputData->mBuffers[0].mDataByteSize == (dma.submission_chunk * sizeof(float))); - - outBuffer = (float *)outOutputData->mBuffers[0].mData; - - // If we have run out of samples, return silence - if (s_chunkCount * submissionChunk > dma.channels * s_paintedtime) { - memset(outBuffer, 0, sizeof(*outBuffer) * dma.submission_chunk); - } else { - scale = (1.0f / SHRT_MAX); - if (outputStreamBasicDescription.mSampleRate == 44100 && dma.speed == 22050) { - for (sampleIndex = 0; sampleIndex < dma.submission_chunk; sampleIndex+=2) { - // Convert the samples from shorts to floats. Scale the floats to be [-1..1]. - temp = samples[sampleIndex + 0] * scale; - outBuffer[(sampleIndex<<1)+0] = temp; - outBuffer[(sampleIndex<<1)+2] = temp; - - temp = samples[sampleIndex + 1] * scale; - outBuffer[(sampleIndex<<1)+1] = temp; - outBuffer[(sampleIndex<<1)+3] = temp; - } - } else if (outputStreamBasicDescription.mSampleRate == 44100 && dma.speed == 11025) { - for (sampleIndex = 0; sampleIndex < dma.submission_chunk; sampleIndex+=4) { - // Convert the samples from shorts to floats. Scale the floats to be [-1..1]. - temp = samples[sampleIndex + 0] * scale; - outBuffer[(sampleIndex<<1)+0] = temp; - outBuffer[(sampleIndex<<1)+2] = temp; - outBuffer[(sampleIndex<<1)+4] = temp; - outBuffer[(sampleIndex<<1)+6] = temp; - - temp = samples[sampleIndex + 1] * scale; - outBuffer[(sampleIndex<<1)+1] = temp; - outBuffer[(sampleIndex<<1)+3] = temp; - outBuffer[(sampleIndex<<1)+5] = temp; - outBuffer[(sampleIndex<<1)+7] = temp; - } - } else { - for (sampleIndex = 0; sampleIndex < dma.submission_chunk; sampleIndex++) { - // Convert the samples from shorts to floats. Scale the floats to be [-1..1]. - outBuffer[sampleIndex] = samples[sampleIndex] * scale; - } - } - } - - s_chunkCount++; // this is the next buffer we will submit - return 0; -} - - -/* -=============== -S_MakeTestPattern -=============== -*/ -void S_MakeTestPattern( void ) { - int i; - float v; - int sample; - - for ( i = 0 ; i < dma.samples / 2 ; i ++ ) { - v = sin( M_PI * 2 * i / 64 ); - sample = v * 0x4000; - ((short *)dma.buffer)[i*2] = sample; - ((short *)dma.buffer)[i*2+1] = sample; - } -} - -/* -=============== -SNDDMA_Init -=============== -*/ -qboolean SNDDMA_Init(void) -{ - cvar_t *bufferSize; - cvar_t *chunkSize; - OSStatus status; - UInt32 propertySize, bufferByteCount; - - if (s_isRunning) - return qtrue; - - chunkSize = ri.Cvar_Get( "s_chunksize", "2048", CVAR_ARCHIVE ); - bufferSize = ri.Cvar_Get( "s_buffersize", "16384", CVAR_ARCHIVE ); - Com_Printf(" Chunk size = %d\n", chunkSize->integer); - Com_Printf("Buffer size = %d\n", bufferSize->integer); - - if (!chunkSize->integer) - ri.Error(ERR_FATAL, "s_chunksize must be non-zero\n"); - if (!bufferSize->integer) - ri.Error(ERR_FATAL, "s_buffersize must be non-zero\n"); - if (chunkSize->integer >= bufferSize->integer) - ri.Error(ERR_FATAL, "s_chunksize must be less than s_buffersize\n"); - if (bufferSize->integer % chunkSize->integer) - ri.Error(ERR_FATAL, "s_buffersize must be an even multiple of s_chunksize\n"); - - // Get the output device - propertySize = sizeof(outputDeviceID); - status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &propertySize, &outputDeviceID); - if (status) { - Com_Printf("AudioHardwareGetProperty returned %d\n", status); - return qfalse; - } - - if (outputDeviceID == kAudioDeviceUnknown) { - Com_Printf("AudioHardwareGetProperty: outputDeviceID is kAudioDeviceUnknown\n"); - return qfalse; - } - - // Configure the output device - propertySize = sizeof(bufferByteCount); - bufferByteCount = chunkSize->integer * sizeof(float); - status = AudioDeviceSetProperty(outputDeviceID, NULL, 0, NO, kAudioDevicePropertyBufferSize, propertySize, &bufferByteCount); - if (status) { - Com_Printf("AudioDeviceSetProperty: returned %d when setting kAudioDevicePropertyBufferSize to %d\n", status, chunkSize->integer); - return qfalse; - } - - propertySize = sizeof(bufferByteCount); - status = AudioDeviceGetProperty(outputDeviceID, 0, NO, kAudioDevicePropertyBufferSize, &propertySize, &bufferByteCount); - if (status) { - Com_Printf("AudioDeviceGetProperty: returned %d when setting kAudioDevicePropertyBufferSize\n", status); - return qfalse; - } - - // Print out the device status - propertySize = sizeof(outputStreamBasicDescription); - status = AudioDeviceGetProperty(outputDeviceID, 0, NO, kAudioDevicePropertyStreamFormat, &propertySize, &outputStreamBasicDescription); - if (status) { - Com_Printf("AudioDeviceGetProperty: returned %d when getting kAudioDevicePropertyStreamFormat\n", status); - return qfalse; - } - - Com_Printf("Hardware format:\n"); - Com_Printf(" %f mSampleRate\n", outputStreamBasicDescription.mSampleRate); - Com_Printf(" %c%c%c%c mFormatID\n", - (outputStreamBasicDescription.mFormatID & 0xff000000) >> 24, - (outputStreamBasicDescription.mFormatID & 0x00ff0000) >> 16, - (outputStreamBasicDescription.mFormatID & 0x0000ff00) >> 8, - (outputStreamBasicDescription.mFormatID & 0x000000ff) >> 0); - Com_Printf(" %5d mBytesPerPacket\n", outputStreamBasicDescription.mBytesPerPacket); - Com_Printf(" %5d mFramesPerPacket\n", outputStreamBasicDescription.mFramesPerPacket); - Com_Printf(" %5d mBytesPerFrame\n", outputStreamBasicDescription.mBytesPerFrame); - Com_Printf(" %5d mChannelsPerFrame\n", outputStreamBasicDescription.mChannelsPerFrame); - Com_Printf(" %5d mBitsPerChannel\n", outputStreamBasicDescription.mBitsPerChannel); - - if(outputStreamBasicDescription.mFormatID != kAudioFormatLinearPCM) { - Com_Printf("Default Audio Device doesn't support Linear PCM!"); - return qfalse; - } - - // Start sound running - status = AudioDeviceAddIOProc(outputDeviceID, audioDeviceIOProc, NULL); - if (status) { - Com_Printf("AudioDeviceAddIOProc: returned %d\n", status); - return qfalse; - } - - submissionChunk = chunkSize->integer; - if (outputStreamBasicDescription.mSampleRate == 44100) { - submissionChunk = chunkSize->integer/2; - } - maxMixedSamples = bufferSize->integer; - s_mixedSamples = calloc(1, sizeof(*s_mixedSamples) * maxMixedSamples); - Com_Printf("Chunk Count = %d\n", (maxMixedSamples / submissionChunk)); - - // Tell the main app what we expect from it - dma.samples = maxMixedSamples; - dma.submission_chunk = submissionChunk; - dma.samplebits = 16; - dma.buffer = (byte *)s_mixedSamples; - dma.channels = outputStreamBasicDescription.mChannelsPerFrame; - dma.speed = 22050; //(unsigned long)outputStreamBasicDescription.mSampleRate; - - // We haven't enqueued anything yet - s_chunkCount = 0; - - status = AudioDeviceStart(outputDeviceID, audioDeviceIOProc); - if (status) { - Com_Printf("AudioDeviceStart: returned %d\n", status); - return qfalse; - } - - s_isRunning = qtrue; - - return qtrue; -} - -/* -=============== -SNDDMA_GetBufferDuration -=============== -*/ -float SNDDMA_GetBufferDuration(void) -{ - return (float)dma.samples / (float)(dma.channels * dma.speed); -} - -/* -=============== -SNDDMA_GetDMAPos -=============== -*/ -int SNDDMA_GetDMAPos(void) -{ - return s_chunkCount * dma.submission_chunk; -} - -/* -=============== -SNDDMA_Shutdown -=============== -*/ -void SNDDMA_Shutdown(void) -{ - OSStatus status; - - if (!s_isRunning) - return; - - status = AudioDeviceStop(outputDeviceID, audioDeviceIOProc); - if (status) { - Com_Printf("AudioDeviceStop: returned %d\n", status); - return; - } - - s_isRunning = qfalse; - - status = AudioDeviceRemoveIOProc(outputDeviceID, audioDeviceIOProc); - if (status) { - Com_Printf("AudioDeviceRemoveIOProc: returned %d\n", status); - return; - } - - free(s_mixedSamples); - s_mixedSamples = NULL; - dma.samples = NULL; -} - -/* -=============== -SNDDMA_BeginPainting -=============== -*/ -void SNDDMA_BeginPainting(void) { -} - -/* -=============== -SNDDMA_Submit -=============== -*/ -void SNDDMA_Submit(void) { -} - diff --git a/code/macosx/macosx_snddma.m b/code/macosx/macosx_snddma.m deleted file mode 100644 index e7451bb..0000000 --- a/code/macosx/macosx_snddma.m +++ /dev/null @@ -1,205 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ - -// mac_snddma.c -// all other sound mixing is portable - -#include "../client/snd_local.h" -#include - -// For 'ri' -#include "../renderer/tr_local.h" - -#import - -// TJW - Different versions of SoundManager have different DMA buffer sizes. On MacOS X DP2, -// the buffer size is 8K. On MacOS 9 it is much smaller. The SoundManager guy at Apple says -// that the size of the buffer will be decreasing for final release to help get rid of latency. -//#define MAX_MIXED_SAMPLES (0x8000 * 64) -//#define SUBMISSION_CHUNK (0x100 * 64) - -// Original MacOS 9 sizes -//#define MAX_MIXED_SAMPLES 0x8000 -//#define SUBMISSION_CHUNK 0x100 - - -static unsigned int submissionChunk; -static unsigned int maxMixedSamples; - -static short *s_mixedSamples; -static int s_chunkCount; // number of chunks submitted -static SndChannel *s_sndChan; -static ExtSoundHeader s_sndHeader; - -/* -=============== -S_Callback -=============== -*/ -void S_Callback( SndChannel *sc, SndCommand *cmd ) -{ - SndCommand mySndCmd; - SndCommand mySndCmd2; - int offset; - - offset = ( s_chunkCount * submissionChunk ) & (maxMixedSamples-1); - - // queue up another sound buffer - memset( &s_sndHeader, 0, sizeof( s_sndHeader ) ); - s_sndHeader.samplePtr = (void *)(s_mixedSamples + offset); - s_sndHeader.numChannels = 2; - s_sndHeader.sampleRate = rate22khz; - s_sndHeader.loopStart = 0; - s_sndHeader.loopEnd = 0; - s_sndHeader.encode = extSH; - s_sndHeader.baseFrequency = 1; - s_sndHeader.numFrames = submissionChunk / 2; - s_sndHeader.markerChunk = NULL; - s_sndHeader.instrumentChunks = NULL; - s_sndHeader.AESRecording = NULL; - s_sndHeader.sampleSize = 16; - - mySndCmd.cmd = bufferCmd; - mySndCmd.param1 = 0; - mySndCmd.param2 = (int)&s_sndHeader; - SndDoCommand( sc, &mySndCmd, true ); - - // and another callback - mySndCmd2.cmd = callBackCmd; - mySndCmd2.param1 = 0; - mySndCmd2.param2 = 0; - SndDoCommand( sc, &mySndCmd2, true ); - - s_chunkCount++; // this is the next buffer we will submit -} - -/* -=============== -S_MakeTestPattern -=============== -*/ -void S_MakeTestPattern( void ) { - int i; - float v; - int sample; - - for ( i = 0 ; i < dma.samples / 2 ; i ++ ) { - v = sin( M_PI * 2 * i / 64 ); - sample = v * 0x4000; - ((short *)dma.buffer)[i*2] = sample; - ((short *)dma.buffer)[i*2+1] = sample; - } -} - -/* -=============== -SNDDMA_Init -=============== -*/ -qboolean SNDDMA_Init(void) -{ - int err; - cvar_t *bufferSize; - cvar_t *chunkSize; - - chunkSize = ri.Cvar_Get( "s_chunksize", "8192", CVAR_ARCHIVE ); - bufferSize = ri.Cvar_Get( "s_buffersize", "65536", CVAR_ARCHIVE ); - - if (!chunkSize->integer) { - ri.Error(ERR_FATAL, "snd_chunkSize must be non-zero\n"); - } - - if (!bufferSize->integer) { - ri.Error(ERR_FATAL, "snd_bufferSize must be non-zero\n"); - } - - if (chunkSize->integer >= bufferSize->integer) { - ri.Error(ERR_FATAL, "snd_chunkSize must be less than snd_bufferSize\n"); - } - - if (bufferSize->integer % chunkSize->integer) { - ri.Error(ERR_FATAL, "snd_bufferSize must be an even multiple of snd_chunkSize\n"); - } - - // create a sound channel - s_sndChan = NULL; - err = SndNewChannel( &s_sndChan, sampledSynth, initStereo, NewSndCallBackProc(S_Callback) ); - if ( err ) { - return false; - } - - submissionChunk = chunkSize->integer; - maxMixedSamples = bufferSize->integer; - - s_mixedSamples = NSZoneMalloc(NULL, sizeof(*s_mixedSamples) * maxMixedSamples); - - dma.channels = 2; - dma.samples = maxMixedSamples; - dma.submission_chunk = submissionChunk; - dma.samplebits = 16; - dma.speed = 22050; - dma.buffer = (byte *)s_mixedSamples; - - // que up the first submission-chunk sized buffer - s_chunkCount = 0; - - S_Callback( s_sndChan, NULL ); - - return qtrue; -} - -/* -=============== -SNDDMA_GetDMAPos -=============== -*/ -int SNDDMA_GetDMAPos(void) { - return s_chunkCount * submissionChunk; -} - -/* -=============== -SNDDMA_Shutdown -=============== -*/ -void SNDDMA_Shutdown(void) { - if ( s_sndChan ) { - SndDisposeChannel( s_sndChan, true ); - s_sndChan = NULL; - } -} - -/* -=============== -SNDDMA_BeginPainting -=============== -*/ -void SNDDMA_BeginPainting(void) { -} - -/* -=============== -SNDDMA_Submit -=============== -*/ -void SNDDMA_Submit(void) { -} diff --git a/code/macosx/macosx_sys.m b/code/macosx/macosx_sys.m deleted file mode 100644 index 822b30d..0000000 --- a/code/macosx/macosx_sys.m +++ /dev/null @@ -1,537 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#import "../client/client.h" -#import "macosx_local.h" - -#import "dlfcn.h" -#import "Q3Controller.h" - -#import -#import -#import -#import -#import - -#import -#import -#import -#import -#import - -#ifdef OMNI_TIMER -#import "macosx_timers.h" -#endif - -qboolean stdin_active = qfalse; - -//=========================================================================== - -int main(int argc, const char *argv[]) { -#ifdef DEDICATED - Q3Controller *controller; - - stdin_active = qtrue; - controller = [[Q3Controller alloc] init]; - [controller quakeMain]; - return 0; -#else - return NSApplicationMain(argc, argv); -#endif -} - -//=========================================================================== - -/* -================= -Sys_UnloadDll - -================= -*/ -void Sys_UnloadDll( void *dllHandle ) { - if ( !dllHandle ) { - return; - } - dlclose( dllHandle ); -} - -/* -================= -Sys_LoadDll - -Used to load a development dll instead of a virtual machine -================= -*/ -extern char *FS_BuildOSPath( const char *base, const char *game, const char *qpath ); - -void * QDECL Sys_LoadDll( const char *name, char *fqpath , int (QDECL **entryPoint)(int, ...), - int (QDECL *systemcalls)(int, ...) ) { - void *libHandle; - void (*dllEntry)( int (*syscallptr)(int, ...) ); - NSString *bundlePath, *libraryPath; - const char *path; - - // TTimo - // I don't understand the search strategy here. How can the Quake3 bundle know about the location - // of the other bundles? is that configured somewhere in XCode? - /* - bundlePath = [[NSBundle mainBundle] pathForResource: [NSString stringWithCString: name] ofType: @"bundle"]; - libraryPath = [NSString stringWithFormat: @"%@/Contents/MacOS/%s", bundlePath, name]; - */ - libraryPath = [NSString stringWithFormat: @"%s.bundle/Contents/MacOS/%s", name, name]; - if (!libraryPath) - return NULL; - - path = [libraryPath cString]; - Com_Printf("Loading '%s'.\n", path); - libHandle = dlopen( [libraryPath cString], RTLD_LAZY ); - if (!libHandle) { - libHandle = dlopen( name, RTLD_LAZY ); - if (!libHandle) { - Com_Printf("Error loading dll: %s\n", dlerror()); - return NULL; - } - } - - dllEntry = dlsym( libHandle, "_dllEntry" ); - if (!dllEntry) { - Com_Printf("Error loading dll: No dllEntry symbol.\n"); - dlclose(libHandle); - return NULL; - } - - *entryPoint = dlsym( libHandle, "_vmMain" ); - if (!*entryPoint) { - Com_Printf("Error loading dll: No vmMain symbol.\n"); - dlclose(libHandle); - return NULL; - } - - dllEntry(systemcalls); - return libHandle; -} - -//=========================================================================== - -char *Sys_GetClipboardData(void) // FIXME -{ - NSPasteboard *pasteboard; - NSArray *pasteboardTypes; - - pasteboard = [NSPasteboard generalPasteboard]; - pasteboardTypes = [pasteboard types]; - if ([pasteboardTypes containsObject:NSStringPboardType]) { - NSString *clipboardString; - - clipboardString = [pasteboard stringForType:NSStringPboardType]; - if (clipboardString && [clipboardString length] > 0) { - return strdup([clipboardString cString]); - } - } - return NULL; -} - -char *Sys_GetWholeClipboard ( void ) -{ - return NULL; -} - -void Sys_SetClipboard (const char *contents) -{ -} - - -/* -================== -Sys_FunctionCheckSum -================== -*/ -int Sys_FunctionCheckSum(void *f1) { - return 0; -} - -/* -================== -Sys_MonkeyShouldBeSpanked -================== -*/ -int Sys_MonkeyShouldBeSpanked( void ) { - return 0; -} - -//=========================================================================== - -void Sys_BeginProfiling(void) -{ -} - -void Sys_EndProfiling(void) -{ -} - -//=========================================================================== - -/* -================ -Sys_Init - -The cvar and file system has been setup, so configurations are loaded -================ -*/ -void Sys_Init(void) -{ -#ifdef OMNI_TIMER - InitializeTimers(); - OTStackPushRoot(rootNode); -#endif - - NET_Init(); - Sys_InitInput(); -} - -/* -================= -Sys_Shutdown -================= -*/ -void Sys_Shutdown(void) -{ - Com_Printf( "----- Sys_Shutdown -----\n" ); - Sys_EndProfiling(); - Sys_ShutdownInput(); - Com_Printf( "------------------------\n" ); -} - -void Sys_Error(const char *error, ...) -{ - va_list argptr; - NSString *formattedString; - - Sys_Shutdown(); - - va_start(argptr,error); - formattedString = [[NSString alloc] initWithFormat:[NSString stringWithCString:error] arguments:argptr]; - va_end(argptr); - - NSLog(@"Sys_Error: %@", formattedString); - NSRunAlertPanel(@"Quake 3 Error", formattedString, nil, nil, nil); - - Sys_Quit(); -} - -void Sys_Quit(void) -{ - Sys_Shutdown(); - [NSApp terminate:nil]; -} - -/* -================ -Sys_Print - -This is called for all console output, even if the game is running -full screen and the dedicated console window is hidden. -================ -*/ - -char *ansiColors[8] = - { "\033[30m" , /* ANSI Black */ - "\033[31m" , /* ANSI Red */ - "\033[32m" , /* ANSI Green */ - "\033[33m" , /* ANSI Yellow */ - "\033[34m" , /* ANSI Blue */ - "\033[36m" , /* ANSI Cyan */ - "\033[35m" , /* ANSI Magenta */ - "\033[37m" }; /* ANSI White */ - -void Sys_Print(const char *text) -{ -#if 0 - /* Okay, this is a stupid hack, but what the hell, I was bored. ;) */ - const char *scan = text; - int index; - - /* Make sure terminal mode is reset at the start of the line... */ - fputs("\033[0m", stdout); - - while(*scan) { - /* See if we have a color control code. If so, snarf the character, - print what we have so far, print the ANSI Terminal color code, - skip over the color control code and continue */ - if(Q_IsColorString(scan)) { - index = ColorIndex(scan[1]); - - /* Flush current message */ - if(scan != text) { - fwrite(text, scan - text, 1, stdout); - } - - /* Write ANSI color code */ - fputs(ansiColors[index], stdout); - - /* Reset search */ - text = scan+2; - scan = text; - continue; - } - scan++; - } - - /* Flush whatever's left */ - fputs(text, stdout); - - /* Make sure terminal mode is reset at the end of the line too... */ - fputs("\033[0m", stdout); - -#else - fputs(text, stdout); -#endif -} - - - -/* -================ -Sys_CheckCD - -Return true if the proper CD is in the drive -================ -*/ - -qboolean Sys_ObjectIsCDRomDevice(io_object_t object) -{ - CFStringRef value; - kern_return_t krc; - CFDictionaryRef properties; - qboolean isCDROM = qfalse; - io_iterator_t parentIterator; - io_object_t parent; - - krc = IORegistryEntryCreateCFProperties(object, &properties, kCFAllocatorDefault, (IOOptionBits)0); - if (krc != KERN_SUCCESS) { - fprintf(stderr, "IORegistryEntryCreateCFProperties returned 0x%08x -- %s\n", krc, mach_error_string(krc)); - return qfalse; - } - - //NSLog(@"properties = %@", properties); - - // See if this is a CD-ROM - value = CFDictionaryGetValue(properties, CFSTR(kIOCDMediaTypeKey)); - if (value && CFStringCompare(value, CFSTR("CD-ROM"), 0) == kCFCompareEqualTo) - isCDROM = qtrue; - CFRelease(properties); - - // If it isn't check each of its parents. It seems that the parent enumerator only returns the immediate parent. Maybe the plural indicates that an object can have multiple direct parents. So, we'll call ourselves recursively for each parent. - if (!isCDROM) { - krc = IORegistryEntryGetParentIterator(object, kIOServicePlane, &parentIterator); - if (krc != KERN_SUCCESS) { - fprintf(stderr, "IOServiceGetMatchingServices returned 0x%08x -- %s\n", - krc, mach_error_string(krc)); - } else { - while (!isCDROM && (parent = IOIteratorNext(parentIterator))) { - if (Sys_ObjectIsCDRomDevice(parent)) - isCDROM = qtrue; - IOObjectRelease(parent); - } - - IOObjectRelease(parentIterator); - } - } - - //NSLog(@"Sys_ObjectIsCDRomDevice -> %d", isCDROM); - return isCDROM; -} - -qboolean Sys_IsCDROMDevice(const char *deviceName) -{ - kern_return_t krc; - io_iterator_t deviceIterator; - mach_port_t masterPort; - io_object_t object; - qboolean isCDROM = qfalse; - - krc = IOMasterPort(bootstrap_port, &masterPort); - if (krc != KERN_SUCCESS) { - fprintf(stderr, "IOMasterPort returned 0x%08x -- %s\n", krc, mach_error_string(krc)); - return qfalse; - } - - // Get an iterator for this BSD device. If it is a CD, it will likely only be one partition of the larger CD-ROM device. - krc = IOServiceGetMatchingServices(masterPort, - IOBSDNameMatching(masterPort, 0, deviceName), - &deviceIterator); - if (krc != KERN_SUCCESS) { - fprintf(stderr, "IOServiceGetMatchingServices returned 0x%08x -- %s\n", - krc, mach_error_string(krc)); - return qfalse; - } - - while (!isCDROM && (object = IOIteratorNext(deviceIterator))) { - if (Sys_ObjectIsCDRomDevice(object)) { - isCDROM = qtrue; - } - IOObjectRelease(object); - } - - IOObjectRelease(deviceIterator); - - //NSLog(@"Sys_IsCDROMDevice -> %d", isCDROM); - return isCDROM; -} - -qboolean Sys_CheckCD( void ) -{ - // DO NOT just return success here if we have a library directory. - // Actually look for the CD. - - // We'll look through the actual mount points rather than just looking - // for a particular directory since (a) the mount point may change - // between OS version (/foo in Public Beta, /Volumes/foo after Public Beta) - // and (b) this way someone can't just create a directory and warez the files. - - unsigned int mountCount; - struct statfs *mounts; - - mountCount = getmntinfo(&mounts, MNT_NOWAIT); - if (mountCount <= 0) { - perror("getmntinfo"); -#if 1 // Q3:TA doesn't need a CD, but we still need to locate it to allow for partial installs - return qtrue; -#else - return qfalse; -#endif - } - - while (mountCount--) { - const char *lastComponent; - - if ((mounts[mountCount].f_flags & MNT_RDONLY) != MNT_RDONLY) { - // Should have been a read only CD... this isn't it - continue; - } - - if ((mounts[mountCount].f_flags & MNT_LOCAL) != MNT_LOCAL) { - // Should have been a local filesystem - continue; - } - - lastComponent = strrchr(mounts[mountCount].f_mntonname, '/'); - if (!lastComponent) { - // No slash in the mount point! How is that possible? - continue; - } - - // Skip the slash and look for the game name - lastComponent++; - if ((strcasecmp(lastComponent, "Quake3") != 0)) { - continue; - } - - -#if 0 - fprintf(stderr, "f_bsize: %d\n", mounts[mountCount].f_bsize); - fprintf(stderr, "f_blocks: %d\n", mounts[mountCount].f_blocks); - fprintf(stderr, "type: %d\n", mounts[mountCount].f_type); - fprintf(stderr, "flags: %d\n", mounts[mountCount].f_flags); - fprintf(stderr, "fstype: %s\n", mounts[mountCount].f_fstypename); - fprintf(stderr, "f_mntonname: %s\n", mounts[mountCount].f_mntonname); - fprintf(stderr, "f_mntfromname: %s\n", mounts[mountCount].f_mntfromname); - fprintf(stderr, "\n\n"); -#endif - - lastComponent = strrchr(mounts[mountCount].f_mntfromname, '/'); - if (!lastComponent) { - // No slash in the device name! How is that possible? - continue; - } - lastComponent++; - if (!Sys_IsCDROMDevice(lastComponent)) - continue; - - // This looks good - Sys_SetDefaultCDPath(mounts[mountCount].f_mntonname); - return qtrue; - } - -#if 1 // Q3:TA doesn't need a CD, but we still need to locate it to allow for partial installs - return qtrue; -#else - return qfalse; -#endif -} - - -//=================================================================== - -void Sys_BeginStreamedFile( fileHandle_t f, int readAhead ) { -} - -void Sys_EndStreamedFile( fileHandle_t f ) { -} - -int Sys_StreamedRead( void *buffer, int size, int count, fileHandle_t f ) { - return FS_Read( buffer, size * count, f ); -} - -void Sys_StreamSeek( fileHandle_t f, int offset, int origin ) { - FS_Seek( f, offset, origin ); -} - - -void OutputDebugString(char * s) -{ -#ifdef DEBUG - fprintf(stderr, "%s", s); -#endif -} - -/* -================== -Sys_LowPhysicalMemory() -================== -*/ -#define MEM_THRESHOLD 96*1024*1024 - -qboolean Sys_LowPhysicalMemory() -{ - return NSRealMemoryAvailable() <= MEM_THRESHOLD; -} - -static unsigned int _Sys_ProcessorCount = 0; - -unsigned int Sys_ProcessorCount() -{ - if (!_Sys_ProcessorCount) { - int name[] = {CTL_HW, HW_NCPU}; - size_t size; - - size = sizeof(_Sys_ProcessorCount); - if (sysctl(name, 2, &_Sys_ProcessorCount, &size, NULL, 0) < 0) { - perror("sysctl"); - _Sys_ProcessorCount = 1; - } else { - Com_Printf("System processor count is %d\n", _Sys_ProcessorCount); - } - } - - return _Sys_ProcessorCount; -} - diff --git a/code/macosx/macosx_timers.h b/code/macosx/macosx_timers.h deleted file mode 100644 index 1af18ea..0000000 --- a/code/macosx/macosx_timers.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifdef OMNI_TIMER - -#import - -#define OTSTART(node) OTStackPush(node) -#define OTSTOP(node) OTStackPop() - -extern OTStackNode *rootNode; -extern OTStackNode *markFragmentsNode1; -extern OTStackNode *markFragmentsNode2; -extern OTStackNode *markFragmentsGrid; -extern OTStackNode *markFragmentsNode4; -extern OTStackNode *addMarkFragmentsNode; -extern OTStackNode *chopPolyNode; -extern OTStackNode *boxTraceNode; -extern OTStackNode *boxOnPlaneSideNode; -extern OTStackNode *recursiveWorldNode; -extern OTStackNode *surfaceAnimNode; -extern OTStackNode *surfaceFaceNode; -extern OTStackNode *surfaceMeshNode; -extern OTStackNode *surfaceEndNode; -extern OTStackNode *shadowEndNode; -extern OTStackNode *stageIteratorGenericNode; -extern OTStackNode *computeColorAndTexNode; -extern OTStackNode *mp3DecodeNode; - -extern void InitializeTimers(); - -#else - -#define OTSTART(node) -#define OTSTOP(node) - -#endif - diff --git a/code/macosx/macosx_timers.m b/code/macosx/macosx_timers.m deleted file mode 100644 index af8d6ca..0000000 --- a/code/macosx/macosx_timers.m +++ /dev/null @@ -1,75 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifdef OMNI_TIMER - -#import "macosx_timers.h" - -#import -#import - -OTStackNode *rootNode; -OTStackNode *markFragmentsNode1; -OTStackNode *markFragmentsNode2; -OTStackNode *markFragmentsGrid; -OTStackNode *markFragmentsNode4; -OTStackNode *addMarkFragmentsNode; -OTStackNode *chopPolyNode; -OTStackNode *boxTraceNode; -OTStackNode *boxOnPlaneSideNode; -OTStackNode *recursiveWorldNode; -OTStackNode *surfaceAnimNode; -OTStackNode *surfaceFaceNode; -OTStackNode *surfaceMeshNode; -OTStackNode *surfaceEndNode; -OTStackNode *shadowEndNode; -OTStackNode *stageIteratorGenericNode; -OTStackNode *computeColorAndTexNode; -OTStackNode *mp3DecodeNode; - -void InitializeTimers() -{ - const char *env; - - OTSetup(); - - rootNode = OTStackNodeCreate("root"); - markFragmentsNode1 = OTStackNodeCreate("R_MarkFragments 1"); - markFragmentsNode2 = OTStackNodeCreate("R_MarkFragments 2"); - markFragmentsGrid = OTStackNodeCreate("R_MarkFragmentsGrid"); - markFragmentsNode4 = OTStackNodeCreate("R_MarkFragments 4"); - addMarkFragmentsNode = OTStackNodeCreate("R_AddMarkFragments"); - chopPolyNode = OTStackNodeCreate("R_ChopPolyBehindPlane"); - boxTraceNode = OTStackNodeCreate("CM_BoxTrace"); - boxOnPlaneSideNode = OTStackNodeCreate("BoxOnPlaneSide"); - recursiveWorldNode = OTStackNodeCreate("R_RecursiveWorldNode"); - surfaceAnimNode = OTStackNodeCreate("RB_SurfaceAnim"); - surfaceFaceNode = OTStackNodeCreate("RB_SurfaceFace"); - surfaceMeshNode = OTStackNodeCreate("RB_SurfaceMesh"); - surfaceEndNode = OTStackNodeCreate("RB_EndSurface"); - shadowEndNode = OTStackNodeCreate("RB_ShadowTessEnd"); - stageIteratorGenericNode = OTStackNodeCreate("RB_StageIteratorGeneric"); - computeColorAndTexNode = OTStackNodeCreate("ComputeColors & ComputeTexCoords"); - mp3DecodeNode = OTStackNodeCreate("MP3Stream_Decode"); -} - -#endif // OMNI_TIMER - diff --git a/code/macosx/timedemo.zsh b/code/macosx/timedemo.zsh deleted file mode 100644 index 14e834a..0000000 --- a/code/macosx/timedemo.zsh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/zsh - -buildRoot=./build -executable=$buildRoot/Quake3.app/Contents/MacOS/Quake3 -ls -l $executable - -flags="$flags +set timedemo 1" -flags="$flags +set s_initsound 0" -flags="$flags +set vm_cgame 1" -flags="$flags +set vm_game 1" -flags="$flags +set r_texturebits 16" -flags="$flags +set r_depthbits 16" -flags="$flags +set r_colorbits 16" -flags="$flags +set stencilbits 8" - -flags="$flags +set r_appleTransformHint 1" - -echo flags=$flags - -function demo { - echo Demo $* - $executable $flags +demo $* |& egrep "(seconds|VM)" -} - -demo foo - diff --git a/code/opts.lnt b/code/opts.lnt deleted file mode 100644 index e38d821..0000000 --- a/code/opts.lnt +++ /dev/null @@ -1,26 +0,0 @@ --e64 // type mismatch (enum to int) --e641 // converting enum to int --e734 // loss of precision --e736 // loss of precision --e747 // float to double prototype coersion --e534 // ignoring return value --e524 // loss of precision (float to int) --e732 // loss of sign (float to unsigned char) --e702 // shift right of signed quantity --e737 // loss of sign bit (int to unsigned int) --e713 // loss of precision (unsigned int to int) --e701 // shift left of signed quantity - --e765 // external could be made static - --d__LINT__ --ig:\quake3\bin_nt\supplement\ansi --ig:\quake3\bin_nt\supplement --igame --ibotai --icgame --igame --iserver --iclient --iqcommon --irenderer diff --git a/code/q3_ui/Conscript b/code/q3_ui/Conscript deleted file mode 100644 index d3967d7..0000000 --- a/code/q3_ui/Conscript +++ /dev/null @@ -1,93 +0,0 @@ -# Q3 ui building - -# qvm building against native: -# only native has ui_syscalls.c -# qvm uses a ui_syscalls.asm with equ stubs -# qvm has additional bg_lib.c - -Import qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); - -$env = new cons( - # the code has the very bad habit of doing things like #include "../ui/ui_shared.h" - # this seems to confuse the dependency analysis, explicit toplevel includes seem to fix - CPPPATH => '#cgame:#game:#q3_ui', - CC => $CC, - CXX => $CXX, - LINK => $LINK, - ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }, - CFLAGS => $BASE_CFLAGS . '-fPIC', - LDFLAGS => '-shared -ldl -lm' -); - -# qvm building -# we heavily customize the cons environment -$vm_env = new cons( - # the code has the very bad habit of doing things like #include "../ui/ui_shared.h" - # this seems to confuse the dependency analysis, explicit toplevel includes seem to fix - CPPPATH => '#cgame:#game:#q3_ui', - CC => 'q3lcc', - CCCOM => '%CC %CFLAGS %_IFLAGS -c %< -o %>', - SUFOBJ => '.asm', - LINK => 'q3asm', - CFLAGS => '-DQ3_VM -S -Wf-target=bytecode -Wf-g', - # need to know where to find the compiler tools - ENV => { PATH => $ENV{PATH} . ":./qvmtools", }, -); - -# the file with vmMain function MUST be the first one of the list -@FILES = qw( - ui_main.c - ../game/bg_misc.c - ../game/q_math.c - ../game/q_shared.c - ui_addbots.c - ui_atoms.c - ui_cdkey.c - ui_cinematics.c - ui_confirm.c - ui_connect.c - ui_controls2.c - ui_credits.c - ui_demo2.c - ui_display.c - ui_gameinfo.c - ui_ingame.c - ui_menu.c - ui_mfield.c - ui_mods.c - ui_network.c - ui_options.c - ui_playermodel.c - ui_players.c - ui_playersettings.c - ui_preferences.c - ui_qmenu.c - ui_removebots.c - ui_serverinfo.c - ui_servers2.c - ui_setup.c - ui_sound.c - ui_sparena.c - ui_specifyserver.c - ui_splevel.c - ui_sppostgame.c - ui_spskill.c - ui_startserver.c - ui_team.c - ui_teamorders.c - ui_video.c - ); -$FILESREF = \@FILES; - -if ($NO_SO eq 0) -{ - Program $env 'uii386.so', @$FILESREF, '../ui/ui_syscalls.c'; - Install $env $INSTALL_DIR, 'uii386.so'; -} -if ($NO_VM eq 0) -{ - Depends $vm_env 'ui.qvm', '#qvmtools/q3lcc'; - Depends $vm_env 'ui.qvm', '#qvmtools/q3asm'; - Program $vm_env 'ui.qvm', @$FILESREF, '../game/bg_lib.c', '../ui/ui_syscalls.asm'; - Install $vm_env $INSTALL_DIR . '/vm', 'ui.qvm'; -} diff --git a/code/q3_ui/compile.bat b/code/q3_ui/compile.bat deleted file mode 100644 index 64308bb..0000000 --- a/code/q3_ui/compile.bat +++ /dev/null @@ -1,2 +0,0 @@ -lcc -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1 - diff --git a/code/q3_ui/q3_ui.bat b/code/q3_ui/q3_ui.bat index 189e648..fcf8227 100644 --- a/code/q3_ui/q3_ui.bat +++ b/code/q3_ui/q3_ui.bat @@ -7,6 +7,9 @@ cd vm set cc=lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui %1 +rem update PATH variable to point to the quake3 sdk tools +set PATH=.\..\..\win32\mod-sdk-setup\bin;%PATH% + lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_main.c @if errorlevel 1 goto quit lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_cdkey.c diff --git a/code/q3_ui/q3_ui.q3asm b/code/q3_ui/q3_ui.q3asm index 8257bc3..f678695 100644 --- a/code/q3_ui/q3_ui.q3asm +++ b/code/q3_ui/q3_ui.q3asm @@ -1,6 +1,6 @@ -o "\quake3\baseq3\vm\ui" ui_main -..\..\ui\ui_syscalls +..\ui_syscalls ui_gameinfo ui_atoms ui_cinematics diff --git a/code/q3_ui/q3_ui.sh b/code/q3_ui/q3_ui.sh deleted file mode 100644 index 18ebaf3..0000000 --- a/code/q3_ui/q3_ui.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -mkdir -p vm -cd vm - -CC="q3lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I../../cgame -I../../game -I../../q3_ui " - -$CC ../ui_main.c -$CC ../ui_cdkey.c -$CC ../ui_ingame.c -$CC ../ui_confirm.c -$CC ../ui_setup.c -$CC ../../game/bg_misc.c -$CC ../../game/bg_lib.c -$CC ../../game/q_math.c -$CC ../../game/q_shared.c -$CC ../ui_gameinfo.c -$CC ../ui_atoms.c -$CC ../ui_connect.c -$CC ../ui_controls2.c -$CC ../ui_demo2.c -$CC ../ui_mfield.c -$CC ../ui_credits.c -$CC ../ui_menu.c -$CC ../ui_options.c -$CC ../ui_display.c -$CC ../ui_sound.c -$CC ../ui_network.c -$CC ../ui_playermodel.c -$CC ../ui_players.c -$CC ../ui_playersettings.c -$CC ../ui_preferences.c -$CC ../ui_qmenu.c -$CC ../ui_serverinfo.c -$CC ../ui_servers2.c -$CC ../ui_sparena.c -$CC ../ui_specifyserver.c -$CC ../ui_splevel.c -$CC ../ui_sppostgame.c -$CC ../ui_startserver.c -$CC ../ui_syscalls.c -$CC ../ui_team.c -$CC ../ui_video.c -$CC ../ui_cinematics.c -$CC ../ui_spskill.c -$CC ../ui_addbots.c -$CC ../ui_removebots.c -$CC ../ui_loadconfig.c -$CC ../ui_saveconfig.c -$CC ../ui_teamorders.c -$CC ../ui_mods.c - -q3asm -f ../q3_ui - -cd .. diff --git a/code/q3_ui/q3_ui.vcproj b/code/q3_ui/q3_ui.vcproj deleted file mode 100644 index 4ffaba9..0000000 --- a/code/q3_ui/q3_ui.vcproj +++ /dev/null @@ -1,2008 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/q3_ui/ui.q3asm b/code/q3_ui/ui.q3asm deleted file mode 100644 index cbb6251..0000000 --- a/code/q3_ui/ui.q3asm +++ /dev/null @@ -1,45 +0,0 @@ --o "\quake3\baseq3\vm\ui" -ui_main -..\ui_syscalls -ui_gameinfo -ui_atoms -ui_cinematics -ui_connect -ui_controls2 -ui_demo2 -ui_mfield -ui_credits -ui_menu -ui_ingame -ui_confirm -ui_setup -ui_options -ui_display -ui_sound -ui_network -ui_playermodel -ui_players -ui_playersettings -ui_preferences -ui_qmenu -ui_serverinfo -ui_servers2 -ui_sparena -ui_specifyserver -ui_sppostgame -ui_splevel -ui_spskill -ui_startserver -ui_team -ui_video -ui_addbots -ui_removebots -ui_teamorders -ui_loadconfig -ui_saveconfig -ui_cdkey -ui_mods -bg_misc -bg_lib -q_math -q_shared diff --git a/code/q3_ui/ui_loadconfig.c b/code/q3_ui/ui_loadconfig.c deleted file mode 100644 index 7d5e5f1..0000000 --- a/code/q3_ui/ui_loadconfig.c +++ /dev/null @@ -1,274 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// -/* -============================================================================= - -LOAD CONFIG MENU - -============================================================================= -*/ - -#include "ui_local.h" - - -#define ART_BACK0 "menu/art/back_0" -#define ART_BACK1 "menu/art/back_1" -#define ART_FIGHT0 "menu/art/load_0" -#define ART_FIGHT1 "menu/art/load_1" -#define ART_FRAMEL "menu/art/frame2_l" -#define ART_FRAMER "menu/art/frame1_r" -#define ART_ARROWS "menu/art/arrows_horz_0" -#define ART_ARROWLEFT "menu/art/arrows_horz_left" -#define ART_ARROWRIGHT "menu/art/arrows_horz_right" - -#define MAX_CONFIGS 128 -#define NAMEBUFSIZE ( MAX_CONFIGS * 16 ) - -#define ID_BACK 10 -#define ID_GO 11 -#define ID_LIST 12 -#define ID_LEFT 13 -#define ID_RIGHT 14 - -#define ARROWS_WIDTH 128 -#define ARROWS_HEIGHT 48 - - -typedef struct { - menuframework_s menu; - - menutext_s banner; - menubitmap_s framel; - menubitmap_s framer; - - menulist_s list; - - menubitmap_s arrows; - menubitmap_s left; - menubitmap_s right; - menubitmap_s back; - menubitmap_s go; - - char names[NAMEBUFSIZE]; - char* configlist[MAX_CONFIGS]; -} configs_t; - -static configs_t s_configs; - - -/* -=============== -LoadConfig_MenuEvent -=============== -*/ -static void LoadConfig_MenuEvent( void *ptr, int event ) { - if( event != QM_ACTIVATED ) { - return; - } - - switch ( ((menucommon_s*)ptr)->id ) { - case ID_GO: - trap_Cmd_ExecuteText( EXEC_APPEND, va( "exec %s\n", s_configs.list.itemnames[s_configs.list.curvalue] ) ); - UI_PopMenu(); - break; - - case ID_BACK: - UI_PopMenu(); - break; - - case ID_LEFT: - ScrollList_Key( &s_configs.list, K_LEFTARROW ); - break; - - case ID_RIGHT: - ScrollList_Key( &s_configs.list, K_RIGHTARROW ); - break; - } -} - - -/* -=============== -LoadConfig_MenuInit -=============== -*/ -static void LoadConfig_MenuInit( void ) { - int i; - int len; - char *configname; - - UI_LoadConfig_Cache(); - - memset( &s_configs, 0 ,sizeof(configs_t) ); - s_configs.menu.wrapAround = qtrue; - s_configs.menu.fullscreen = qtrue; - - s_configs.banner.generic.type = MTYPE_BTEXT; - s_configs.banner.generic.x = 320; - s_configs.banner.generic.y = 16; - s_configs.banner.string = "LOAD CONFIG"; - s_configs.banner.color = color_white; - s_configs.banner.style = UI_CENTER; - - s_configs.framel.generic.type = MTYPE_BITMAP; - s_configs.framel.generic.name = ART_FRAMEL; - s_configs.framel.generic.flags = QMF_INACTIVE; - s_configs.framel.generic.x = 0; - s_configs.framel.generic.y = 78; - s_configs.framel.width = 256; - s_configs.framel.height = 329; - - s_configs.framer.generic.type = MTYPE_BITMAP; - s_configs.framer.generic.name = ART_FRAMER; - s_configs.framer.generic.flags = QMF_INACTIVE; - s_configs.framer.generic.x = 376; - s_configs.framer.generic.y = 76; - s_configs.framer.width = 256; - s_configs.framer.height = 334; - - s_configs.arrows.generic.type = MTYPE_BITMAP; - s_configs.arrows.generic.name = ART_ARROWS; - s_configs.arrows.generic.flags = QMF_INACTIVE; - s_configs.arrows.generic.x = 320-ARROWS_WIDTH/2; - s_configs.arrows.generic.y = 400; - s_configs.arrows.width = ARROWS_WIDTH; - s_configs.arrows.height = ARROWS_HEIGHT; - - s_configs.left.generic.type = MTYPE_BITMAP; - s_configs.left.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_MOUSEONLY; - s_configs.left.generic.x = 320-ARROWS_WIDTH/2; - s_configs.left.generic.y = 400; - s_configs.left.generic.id = ID_LEFT; - s_configs.left.generic.callback = LoadConfig_MenuEvent; - s_configs.left.width = ARROWS_WIDTH/2; - s_configs.left.height = ARROWS_HEIGHT; - s_configs.left.focuspic = ART_ARROWLEFT; - - s_configs.right.generic.type = MTYPE_BITMAP; - s_configs.right.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_MOUSEONLY; - s_configs.right.generic.x = 320; - s_configs.right.generic.y = 400; - s_configs.right.generic.id = ID_RIGHT; - s_configs.right.generic.callback = LoadConfig_MenuEvent; - s_configs.right.width = ARROWS_WIDTH/2; - s_configs.right.height = ARROWS_HEIGHT; - s_configs.right.focuspic = ART_ARROWRIGHT; - - s_configs.back.generic.type = MTYPE_BITMAP; - s_configs.back.generic.name = ART_BACK0; - s_configs.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; - s_configs.back.generic.id = ID_BACK; - s_configs.back.generic.callback = LoadConfig_MenuEvent; - s_configs.back.generic.x = 0; - s_configs.back.generic.y = 480-64; - s_configs.back.width = 128; - s_configs.back.height = 64; - s_configs.back.focuspic = ART_BACK1; - - s_configs.go.generic.type = MTYPE_BITMAP; - s_configs.go.generic.name = ART_FIGHT0; - s_configs.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS; - s_configs.go.generic.id = ID_GO; - s_configs.go.generic.callback = LoadConfig_MenuEvent; - s_configs.go.generic.x = 640; - s_configs.go.generic.y = 480-64; - s_configs.go.width = 128; - s_configs.go.height = 64; - s_configs.go.focuspic = ART_FIGHT1; - - // scan for configs - s_configs.list.generic.type = MTYPE_SCROLLLIST; - s_configs.list.generic.flags = QMF_PULSEIFFOCUS; - s_configs.list.generic.callback = LoadConfig_MenuEvent; - s_configs.list.generic.id = ID_LIST; - s_configs.list.generic.x = 118; - s_configs.list.generic.y = 130; - s_configs.list.width = 16; - s_configs.list.height = 14; - s_configs.list.numitems = trap_FS_GetFileList( "", "cfg", s_configs.names, NAMEBUFSIZE ); - s_configs.list.itemnames = (const char **)s_configs.configlist; - s_configs.list.columns = 3; - - if (!s_configs.list.numitems) { - strcpy(s_configs.names,"No Files Found."); - s_configs.list.numitems = 1; - - //degenerate case, not selectable - s_configs.go.generic.flags |= (QMF_INACTIVE|QMF_HIDDEN); - } - else if (s_configs.list.numitems > MAX_CONFIGS) - s_configs.list.numitems = MAX_CONFIGS; - - configname = s_configs.names; - for ( i = 0; i < s_configs.list.numitems; i++ ) { - s_configs.list.itemnames[i] = configname; - - // strip extension - len = strlen( configname ); - if (!Q_stricmp(configname + len - 4,".cfg")) - configname[len-4] = '\0'; - - Q_strupr(configname); - - configname += len + 1; - } - - Menu_AddItem( &s_configs.menu, &s_configs.banner ); - Menu_AddItem( &s_configs.menu, &s_configs.framel ); - Menu_AddItem( &s_configs.menu, &s_configs.framer ); - Menu_AddItem( &s_configs.menu, &s_configs.list ); - Menu_AddItem( &s_configs.menu, &s_configs.arrows ); - Menu_AddItem( &s_configs.menu, &s_configs.left ); - Menu_AddItem( &s_configs.menu, &s_configs.right ); - Menu_AddItem( &s_configs.menu, &s_configs.back ); - Menu_AddItem( &s_configs.menu, &s_configs.go ); -} - -/* -================= -UI_LoadConfig_Cache -================= -*/ -void UI_LoadConfig_Cache( void ) { - trap_R_RegisterShaderNoMip( ART_BACK0 ); - trap_R_RegisterShaderNoMip( ART_BACK1 ); - trap_R_RegisterShaderNoMip( ART_FIGHT0 ); - trap_R_RegisterShaderNoMip( ART_FIGHT1 ); - trap_R_RegisterShaderNoMip( ART_FRAMEL ); - trap_R_RegisterShaderNoMip( ART_FRAMER ); - trap_R_RegisterShaderNoMip( ART_ARROWS ); - trap_R_RegisterShaderNoMip( ART_ARROWLEFT ); - trap_R_RegisterShaderNoMip( ART_ARROWRIGHT ); -} - - -/* -=============== -UI_LoadConfigMenu -=============== -*/ -void UI_LoadConfigMenu( void ) { - LoadConfig_MenuInit(); - UI_PushMenu( &s_configs.menu ); -} - diff --git a/code/q3_ui/ui_local.h b/code/q3_ui/ui_local.h index 5d66770..24aef16 100644 --- a/code/q3_ui/ui_local.h +++ b/code/q3_ui/ui_local.h @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "../game/q_shared.h" #include "../cgame/tr_types.h" //NOTE: include the ui_public.h from the new UI -#include "../ui/ui_public.h" // bk001205 - yes, do have to use this +#include "ui_public.h" // bk001205 - yes, do have to use this //redefine to old API version #undef UI_API_VERSION #define UI_API_VERSION 4 diff --git a/code/ui/ui_public.h b/code/q3_ui/ui_public.h similarity index 100% rename from code/ui/ui_public.h rename to code/q3_ui/ui_public.h diff --git a/code/q3_ui/ui_qmenu.c b/code/q3_ui/ui_qmenu.c index a6ec29e..868f827 100644 --- a/code/q3_ui/ui_qmenu.c +++ b/code/q3_ui/ui_qmenu.c @@ -1722,12 +1722,7 @@ void Menu_Cache( void ) uis.rb_off = trap_R_RegisterShaderNoMip( "menu/art/switch_off" ); uis.whiteShader = trap_R_RegisterShaderNoMip( "white" ); - if ( uis.glconfig.hardwareType == GLHW_RAGEPRO ) { - // the blend effect turns to shit with the normal - uis.menuBackShader = trap_R_RegisterShaderNoMip( "menubackRagePro" ); - } else { - uis.menuBackShader = trap_R_RegisterShaderNoMip( "menuback" ); - } + uis.menuBackShader = trap_R_RegisterShaderNoMip( "menuback" ); uis.menuBackNoLogoShader = trap_R_RegisterShaderNoMip( "menubacknologo" ); menu_in_sound = trap_S_RegisterSound( "sound/misc/menu1.wav", qfalse ); diff --git a/code/q3_ui/ui_saveconfig.c b/code/q3_ui/ui_saveconfig.c deleted file mode 100644 index 4ac7d46..0000000 --- a/code/q3_ui/ui_saveconfig.c +++ /dev/null @@ -1,212 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// -/* -============================================================================= - -SAVE CONFIG MENU - -============================================================================= -*/ - -#include "ui_local.h" - - -#define ART_BACK0 "menu/art/back_0" -#define ART_BACK1 "menu/art/back_1" -#define ART_SAVE0 "menu/art/save_0" -#define ART_SAVE1 "menu/art/save_1" -#define ART_BACKGROUND "menu/art/cut_frame" - -#define ID_NAME 10 -#define ID_BACK 11 -#define ID_SAVE 12 - - -typedef struct { - menuframework_s menu; - - menutext_s banner; - menubitmap_s background; - menufield_s savename; - menubitmap_s back; - menubitmap_s save; -} saveConfig_t; - -static saveConfig_t saveConfig; - - -/* -=============== -UI_SaveConfigMenu_BackEvent -=============== -*/ -static void UI_SaveConfigMenu_BackEvent( void *ptr, int event ) { - if( event != QM_ACTIVATED ) { - return; - } - - UI_PopMenu(); -} - - -/* -=============== -UI_SaveConfigMenu_SaveEvent -=============== -*/ -static void UI_SaveConfigMenu_SaveEvent( void *ptr, int event ) { - char configname[MAX_QPATH]; - - if( event != QM_ACTIVATED ) { - return; - } - - if( !saveConfig.savename.field.buffer[0] ) { - return; - } - - COM_StripExtension(saveConfig.savename.field.buffer, configname ); - trap_Cmd_ExecuteText( EXEC_APPEND, va( "writeconfig %s.cfg\n", configname ) ); - UI_PopMenu(); -} - - -/* -=============== -UI_SaveConfigMenu_SavenameDraw -=============== -*/ -static void UI_SaveConfigMenu_SavenameDraw( void *self ) { - menufield_s *f; - int style; - float *color; - - f = (menufield_s *)self; - - if( f == Menu_ItemAtCursor( &saveConfig.menu ) ) { - style = UI_LEFT|UI_PULSE|UI_SMALLFONT; - color = text_color_highlight; - } - else { - style = UI_LEFT|UI_SMALLFONT; - color = colorRed; - } - - UI_DrawProportionalString( 320, 192, "Enter filename:", UI_CENTER|UI_SMALLFONT, color_orange ); - UI_FillRect( f->generic.x, f->generic.y, f->field.widthInChars*SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, colorBlack ); - MField_Draw( &f->field, f->generic.x, f->generic.y, style, color ); -} - - -/* -================= -UI_SaveConfigMenu_Init -================= -*/ -static void UI_SaveConfigMenu_Init( void ) { - memset( &saveConfig, 0, sizeof(saveConfig) ); - - UI_SaveConfigMenu_Cache(); - saveConfig.menu.wrapAround = qtrue; - saveConfig.menu.fullscreen = qtrue; - - saveConfig.banner.generic.type = MTYPE_BTEXT; - saveConfig.banner.generic.x = 320; - saveConfig.banner.generic.y = 16; - saveConfig.banner.string = "SAVE CONFIG"; - saveConfig.banner.color = color_white; - saveConfig.banner.style = UI_CENTER; - - saveConfig.background.generic.type = MTYPE_BITMAP; - saveConfig.background.generic.name = ART_BACKGROUND; - saveConfig.background.generic.flags = QMF_INACTIVE; - saveConfig.background.generic.x = 142; - saveConfig.background.generic.y = 118; - saveConfig.background.width = 359; - saveConfig.background.height = 256; - - saveConfig.savename.generic.type = MTYPE_FIELD; - saveConfig.savename.generic.flags = QMF_NODEFAULTINIT|QMF_UPPERCASE; - saveConfig.savename.generic.ownerdraw = UI_SaveConfigMenu_SavenameDraw; - saveConfig.savename.field.widthInChars = 20; - saveConfig.savename.field.maxchars = 20; - saveConfig.savename.generic.x = 240; - saveConfig.savename.generic.y = 155+72; - saveConfig.savename.generic.left = 240; - saveConfig.savename.generic.top = 155+72; - saveConfig.savename.generic.right = 233 + 20*SMALLCHAR_WIDTH; - saveConfig.savename.generic.bottom = 155+72 + SMALLCHAR_HEIGHT+2; - - saveConfig.back.generic.type = MTYPE_BITMAP; - saveConfig.back.generic.name = ART_BACK0; - saveConfig.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; - saveConfig.back.generic.id = ID_BACK; - saveConfig.back.generic.callback = UI_SaveConfigMenu_BackEvent; - saveConfig.back.generic.x = 0; - saveConfig.back.generic.y = 480-64; - saveConfig.back.width = 128; - saveConfig.back.height = 64; - saveConfig.back.focuspic = ART_BACK1; - - saveConfig.save.generic.type = MTYPE_BITMAP; - saveConfig.save.generic.name = ART_SAVE0; - saveConfig.save.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS; - saveConfig.save.generic.id = ID_SAVE; - saveConfig.save.generic.callback = UI_SaveConfigMenu_SaveEvent; - saveConfig.save.generic.x = 640; - saveConfig.save.generic.y = 480-64; - saveConfig.save.width = 128; - saveConfig.save.height = 64; - saveConfig.save.focuspic = ART_SAVE1; - - Menu_AddItem( &saveConfig.menu, &saveConfig.banner ); - Menu_AddItem( &saveConfig.menu, &saveConfig.background ); - Menu_AddItem( &saveConfig.menu, &saveConfig.savename ); - Menu_AddItem( &saveConfig.menu, &saveConfig.back ); - Menu_AddItem( &saveConfig.menu, &saveConfig.save ); -} - - -/* -================= -UI_SaveConfigMenu_Cache -================= -*/ -void UI_SaveConfigMenu_Cache( void ) { - trap_R_RegisterShaderNoMip( ART_BACK0 ); - trap_R_RegisterShaderNoMip( ART_BACK1 ); - trap_R_RegisterShaderNoMip( ART_SAVE0 ); - trap_R_RegisterShaderNoMip( ART_SAVE1 ); - trap_R_RegisterShaderNoMip( ART_BACKGROUND ); -} - - -/* -=============== -UI_SaveConfigMenu -=============== -*/ -void UI_SaveConfigMenu( void ) { - UI_SaveConfigMenu_Init(); - UI_PushMenu( &saveConfig.menu ); -} diff --git a/code/ui/ui_syscalls.asm b/code/q3_ui/ui_syscalls.asm similarity index 100% rename from code/ui/ui_syscalls.asm rename to code/q3_ui/ui_syscalls.asm diff --git a/code/ui/ui_syscalls.c b/code/q3_ui/ui_syscalls.c similarity index 100% rename from code/ui/ui_syscalls.c rename to code/q3_ui/ui_syscalls.c diff --git a/code/q3_ui/ui_video.c b/code/q3_ui/ui_video.c index a7f16f4..6c16bba 100644 --- a/code/q3_ui/ui_video.c +++ b/code/q3_ui/ui_video.c @@ -241,7 +241,6 @@ GRAPHICS OPTIONS MENU static const char *s_drivers[] = { OPENGL_DRIVER_NAME, - _3DFX_DRIVER_NAME, 0 }; @@ -886,7 +885,7 @@ void GraphicsOptions_MenuInit( void ) s_graphicsoptions.driver.generic.x = 400; s_graphicsoptions.driver.generic.y = y; s_graphicsoptions.driver.itemnames = s_driver_names; - s_graphicsoptions.driver.curvalue = (uis.glconfig.driverType == GLDRV_VOODOO); + s_graphicsoptions.driver.curvalue = 0; y += BIGCHAR_HEIGHT+2; // references/modifies "r_allowExtensions" @@ -1033,12 +1032,6 @@ void GraphicsOptions_MenuInit( void ) GraphicsOptions_SetMenuItems(); GraphicsOptions_GetInitialVideo(); - - if ( uis.glconfig.driverType == GLDRV_ICD && - uis.glconfig.hardwareType == GLHW_3DFX_2D3D ) - { - s_graphicsoptions.driver.generic.flags |= QMF_HIDDEN|QMF_INACTIVE; - } } diff --git a/code/qcommon/cmd.c.save b/code/qcommon/cmd.c.save deleted file mode 100644 index 47f8eb9..0000000 --- a/code/qcommon/cmd.c.save +++ /dev/null @@ -1,636 +0,0 @@ -// cmd.c -- Quake script command processing module - -#include "../game/q_shared.h" -#include "qcommon.h" - -#define MAX_CMD_BUFFER 8192 -int cmd_wait; -msg_t cmd_text; -byte cmd_text_buf[MAX_CMD_BUFFER]; -char cmd_defer_text_buf[MAX_CMD_BUFFER]; - - -//============================================================================= - -/* -============ -Cmd_Wait_f - -Causes execution of the remainder of the command buffer to be delayed until -next frame. This allows commands like: -bind g "cmd use rocket ; +attack ; wait ; -attack ; cmd use blaster" -============ -*/ -void Cmd_Wait_f( void ) { - if ( Cmd_Argc() == 2 ) { - cmd_wait = atoi( Cmd_Argv( 1 ) ); - } else { - cmd_wait = 1; - } -} - - -/* -============================================================================= - - COMMAND BUFFER - -============================================================================= -*/ - -/* -============ -Cbuf_Init -============ -*/ -void Cbuf_Init (void) -{ - MSG_Init (&cmd_text, cmd_text_buf, sizeof(cmd_text_buf)); -} - -/* -============ -Cbuf_AddText - -Adds command text at the end of the buffer, does NOT add a final \n -============ -*/ -void Cbuf_AddText( const char *text ) { - int l; - - l = strlen (text); - - if (cmd_text.cursize + l >= cmd_text.maxsize) - { - Com_Printf ("Cbuf_AddText: overflow\n"); - return; - } - MSG_WriteData (&cmd_text, text, strlen (text)); -} - - -/* -============ -Cbuf_InsertText - -Adds command text immediately after the current command -Adds a \n to the text -============ -*/ -void Cbuf_InsertText( const char *text ) { - int len; - int i; - - len = strlen( text ) + 1; - if ( len + cmd_text.cursize > cmd_text.maxsize ) { - Com_Printf( "Cbuf_InsertText overflowed\n" ); - return; - } - - // move the existing command text - for ( i = cmd_text.cursize - 1 ; i >= 0 ; i-- ) { - cmd_text.data[ i + len ] = cmd_text.data[ i ]; - } - - // copy the new text in - memcpy( cmd_text.data, text, len - 1 ); - - // add a \n - cmd_text.data[ len - 1 ] = '\n'; - - cmd_text.cursize += len; -} - - -/* -============ -Cbuf_ExecuteText -============ -*/ -void Cbuf_ExecuteText (int exec_when, const char *text) -{ - switch (exec_when) - { - case EXEC_NOW: - Cmd_ExecuteString (text); - break; - case EXEC_INSERT: - Cbuf_InsertText (text); - break; - case EXEC_APPEND: - Cbuf_AddText (text); - break; - default: - Com_Error (ERR_FATAL, "Cbuf_ExecuteText: bad exec_when"); - } -} - -/* -============ -Cbuf_Execute -============ -*/ -void Cbuf_Execute (void) -{ - int i; - char *text; - char line[MAX_CMD_BUFFER]; - int quotes; - - while (cmd_text.cursize) - { - if ( cmd_wait ) { - // skip out while text still remains in buffer, leaving it - // for next frame - cmd_wait--; - break; - } - - // find a \n or ; line break - text = (char *)cmd_text.data; - - quotes = 0; - for (i=0 ; i< cmd_text.cursize ; i++) - { - if (text[i] == '"') - quotes++; - if ( !(quotes&1) && text[i] == ';') - break; // don't break if inside a quoted string - if (text[i] == '\n' || text[i] == '\r' ) - break; - } - - - memcpy (line, text, i); - line[i] = 0; - -// delete the text from the command buffer and move remaining commands down -// this is necessary because commands (exec) can insert data at the -// beginning of the text buffer - - if (i == cmd_text.cursize) - cmd_text.cursize = 0; - else - { - i++; - cmd_text.cursize -= i; - memmove (text, text+i, cmd_text.cursize); - text[cmd_text.cursize] = 0; - } - -// execute the command line - Cmd_ExecuteString (line); - } -} - - -/* -============================================================================== - - SCRIPT COMMANDS - -============================================================================== -*/ - - -/* -=============== -Cmd_Exec_f -=============== -*/ -void Cmd_Exec_f( void ) { - fileHandle_t f; - int len; - char filename[MAX_QPATH]; - char *buffer; - - if (Cmd_Argc () != 2) { - Com_Printf ("exec : execute a script file\n"); - return; - } - - Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) ); - COM_DefaultExtension( filename, sizeof( filename ), ".cfg" ); - len = FS_FOpenFileRead( filename, &f, qfalse ); - if ( len <= 0 ) { - Com_Printf ("Couldn't read %s.\n", filename ); - return; - } - - buffer = Z_Malloc(len+1); - - if (FS_Read(buffer, len, f) == len) { - FS_FCloseFile( f ); - buffer[len] = 0; - Com_Printf ("execing %s\n",Cmd_Argv(1)); - Cbuf_InsertText (buffer); - } - else { - Com_Printf ("couldn't exec %s\n",Cmd_Argv(1)); - } - - Z_Free(buffer); -} - - -/* -=============== -Cmd_Vstr_f - -Inserts the current value of a variable as command text -=============== -*/ -void Cmd_Vstr_f( void ) { - char *v; - - if (Cmd_Argc () != 2) { - Com_Printf ("vstr : execute a variable command\n"); - return; - } - - v = Cvar_VariableString( Cmd_Argv( 1 ) ); - Cbuf_InsertText( va("%s\n", v ) ); -} - - -/* -=============== -Cmd_Echo_f - -Just prints the rest of the line to the console -=============== -*/ -void Cmd_Echo_f (void) -{ - int i; - - for (i=1 ; i= cmd_argc ) { - return ""; - } - return cmd_argv[arg]; -} - -/* -============ -Cmd_ArgvBuffer - -The interpreted versions use this because -they can't have pointers returned to them -============ -*/ -void Cmd_ArgvBuffer( int arg, char *buffer, int bufferLength ) { - Q_strncpyz( buffer, Cmd_Argv( arg ), bufferLength ); -} - - -/* -============ -Cmd_Args - -Returns a single string containing argv(1) to argv(argc()-1) -============ -*/ -char *Cmd_Args( void ) { - static char cmd_args[MAX_STRING_CHARS]; - int i; - - cmd_args[0] = 0; - for ( i = 1 ; i < cmd_argc ; i++ ) { - strcat( cmd_args, cmd_argv[i] ); - if ( i != cmd_argc ) { - strcat( cmd_args, " " ); - } - } - - return cmd_args; -} - - -/* -============ -Cmd_ArgsBuffer - -The interpreted versions use this because -they can't have pointers returned to them -============ -*/ -void Cmd_ArgsBuffer( char *buffer, int bufferLength ) { - Q_strncpyz( buffer, Cmd_Args(), bufferLength ); -} - - -/* -============ -Cmd_TokenizeString - -Parses the given string into command line tokens. -The text is copied to a seperate buffer and 0 characters -are inserted in the apropriate place, The argv array -will point into this temporary buffer. -============ -*/ -void Cmd_TokenizeString( const char *text_in ) { - const char *text; - char *textOut; - - // clear previous args - cmd_argc = 0; - - if ( !text_in ) { - return; - } - - text = text_in; - textOut = cmd_tokenized; - - while ( 1 ) { - if ( cmd_argc == MAX_STRING_TOKENS ) { - return; // this is usually something malicious - } - - while ( 1 ) { - // skip whitespace - while ( *text && *text <= ' ' ) { - text++; - } - if ( !*text ) { - return; // all tokens parsed - } - - // skip // comments - if ( text[0] == '/' && text[1] == '/' ) { - return; // all tokens parsed - } - - // skip /* */ comments - if ( text[0] == '/' && text[1] =='*' ) { - while ( *text && ( text[0] != '*' || text[1] != '/' ) ) { - text++; - } - if ( !*text ) { - return; // all tokens parsed - } - text += 2; - } else { - break; // we are ready to parse a token - } - } - - // handle quoted strings - if ( *text == '"' ) { - cmd_argv[cmd_argc] = textOut; - cmd_argc++; - text++; - while ( *text && *text != '"' ) { - *textOut++ = *text++; - } - *textOut++ = 0; - if ( !*text ) { - return; // all tokens parsed - } - text++; - continue; - } - - // regular token - cmd_argv[cmd_argc] = textOut; - cmd_argc++; - - // skip until whitespace, quote, or command - while ( *text > ' ' ) { - if ( text[0] == '"' ) { - break; - } - - if ( text[0] == '/' && text[1] == '/' ) { - break; - } - - // skip /* */ comments - if ( text[0] == '/' && text[1] =='*' ) { - break; - } - - *textOut++ = *text++; - } - - *textOut++ = 0; - - if ( !*text ) { - return; // all tokens parsed - } - } - -} - - -/* -============ -Cmd_AddCommand -============ -*/ -void Cmd_AddCommand( const char *cmd_name, xcommand_t function ) { - cmd_function_t *cmd; - - // fail if the command already exists - for ( cmd = cmd_functions ; cmd ; cmd=cmd->next ) { - if ( !strcmp( cmd_name, cmd->name ) ) { - // allow completion-only commands to be silently doubled - if ( function != NULL ) { - Com_Printf ("Cmd_AddCommand: %s already defined\n", cmd_name); - } - return; - } - } - - cmd = Z_Malloc (sizeof(cmd_function_t)); - cmd->name = CopyString( cmd_name ); - cmd->function = function; - cmd->next = cmd_functions; - cmd_functions = cmd; -} - -/* -============ -Cmd_RemoveCommand -============ -*/ -void Cmd_RemoveCommand( const char *cmd_name ) { - cmd_function_t *cmd, **back; - - back = &cmd_functions; - while( 1 ) { - cmd = *back; - if ( !cmd ) { - // command wasn't active - return; - } - if ( !strcmp( cmd_name, cmd->name ) ) { - *back = cmd->next; - Z_Free (cmd); - return; - } - back = &cmd->next; - } -} - - -/* -============ -Cmd_CommandCompletion -============ -*/ -void Cmd_CommandCompletion( void(*callback)(const char *s) ) { - cmd_function_t *cmd; - - for (cmd=cmd_functions ; cmd ; cmd=cmd->next) { - callback( cmd->name ); - } -} - - -/* -============ -Cmd_ExecuteString - -A complete command line has been parsed, so try to execute it -============ -*/ -void Cmd_ExecuteString( const char *text ) { - cmd_function_t *cmd, **prev; - - // execute the command line - Cmd_TokenizeString( text ); - if ( !Cmd_Argc() ) { - return; // no tokens - } - - // check registered command functions - for ( prev = &cmd_functions ; *prev ; prev = &cmd->next ) { - cmd = *prev; - if ( !Q_stricmp( cmd_argv[0],cmd->name ) ) { - // rearrange the links so that the command will be - // near the head of the list next time it is used - *prev = cmd->next; - cmd->next = cmd_functions; - cmd_functions = cmd; - - // perform the action - if ( !cmd->function ) { - // let the cgame or game handle it - break; - } else { - cmd->function (); - } - return; - } - } - - // check cvars - if ( Cvar_Command() ) { - return; - } - - // check client game commands - if ( com_cl_running && com_cl_running->integer && CL_GameCommand() ) { - return; - } - - // check server game commands - if ( com_sv_running && com_sv_running->integer && SV_GameCommand() ) { - return; - } - - // check ui commands - if ( com_cl_running && com_cl_running->integer && UI_GameCommand() ) { - return; - } - - // send it as a server command if we are connected - // this will usually result in a chat message - CL_ForwardCommandToServer (); -} - -/* -============ -Cmd_List_f -============ -*/ -void Cmd_List_f (void) -{ - cmd_function_t *cmd; - int i; - char *match; - - if ( Cmd_Argc() > 1 ) { - match = Cmd_Argv( 1 ); - } else { - match = NULL; - } - - i = 0; - for (cmd=cmd_functions ; cmd ; cmd=cmd->next) { - if (match && !Com_Filter(match, cmd->name, qfalse)) continue; - - Com_Printf ("%s\n", cmd->name); - i++; - } - Com_Printf ("%i commands\n", i); -} - -/* -============ -Cmd_Init -============ -*/ -void Cmd_Init (void) { - Cmd_AddCommand ("cmdlist",Cmd_List_f); - Cmd_AddCommand ("exec",Cmd_Exec_f); - Cmd_AddCommand ("vstr",Cmd_Vstr_f); - Cmd_AddCommand ("echo",Cmd_Echo_f); - Cmd_AddCommand ("wait", Cmd_Wait_f); -} - diff --git a/code/qcommon/vm_ppc.c b/code/qcommon/vm_ppc.c deleted file mode 100644 index a891ef6..0000000 --- a/code/qcommon/vm_ppc.c +++ /dev/null @@ -1,1479 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// vm_ppc.c -// ppc dynamic compiler - -#include "vm_local.h" - -#pragma opt_pointer_analysis off - - -typedef enum { - R_REAL_STACK = 1, - // registers 3-11 are the parameter passing registers - - // state - R_STACK = 3, // local - R_OPSTACK, // global - - // constants - R_MEMBASE, // global - R_MEMMASK, - R_ASMCALL, // global - R_INSTRUCTIONS, // global - R_NUM_INSTRUCTIONS, // global - R_CVM, // currentVM - - // temps - R_TOP = 11, - R_SECOND = 12, - R_EA = 2 // effective address calculation - -} regNums_t; - -#define RG_REAL_STACK r1 -#define RG_STACK r3 -#define RG_OPSTACK r4 -#define RG_MEMBASE r5 -#define RG_MEMMASK r6 -#define RG_ASMCALL r7 -#define RG_INSTRUCTIONS r8 -#define RG_NUM_INSTRUCTIONS r9 -#define RG_CVM r10 -#define RG_TOP r12 -#define RG_SECOND r13 -#define RG_EA r14 - -// this doesn't have the low order bits set for instructions i'm not using... -typedef enum { - PPC_TDI = 0x08000000, - PPC_TWI = 0x0c000000, - PPC_MULLI = 0x1c000000, - PPC_SUBFIC = 0x20000000, - PPC_CMPI = 0x28000000, - PPC_CMPLI = 0x2c000000, - PPC_ADDIC = 0x30000000, - PPC_ADDIC_ = 0x34000000, - PPC_ADDI = 0x38000000, - PPC_ADDIS = 0x3c000000, - PPC_BC = 0x40000000, - PPC_SC = 0x44000000, - PPC_B = 0x48000000, - - PPC_MCRF = 0x4c000000, - PPC_BCLR = 0x4c000020, - PPC_RFID = 0x4c000000, - PPC_CRNOR = 0x4c000000, - PPC_RFI = 0x4c000000, - PPC_CRANDC = 0x4c000000, - PPC_ISYNC = 0x4c000000, - PPC_CRXOR = 0x4c000000, - PPC_CRNAND = 0x4c000000, - PPC_CREQV = 0x4c000000, - PPC_CRORC = 0x4c000000, - PPC_CROR = 0x4c000000, -//------------ - PPC_BCCTR = 0x4c000420, - PPC_RLWIMI = 0x50000000, - PPC_RLWINM = 0x54000000, - PPC_RLWNM = 0x5c000000, - PPC_ORI = 0x60000000, - PPC_ORIS = 0x64000000, - PPC_XORI = 0x68000000, - PPC_XORIS = 0x6c000000, - PPC_ANDI_ = 0x70000000, - PPC_ANDIS_ = 0x74000000, - PPC_RLDICL = 0x78000000, - PPC_RLDICR = 0x78000000, - PPC_RLDIC = 0x78000000, - PPC_RLDIMI = 0x78000000, - PPC_RLDCL = 0x78000000, - PPC_RLDCR = 0x78000000, - PPC_CMP = 0x7c000000, - PPC_TW = 0x7c000000, - PPC_SUBFC = 0x7c000010, - PPC_MULHDU = 0x7c000000, - PPC_ADDC = 0x7c000014, - PPC_MULHWU = 0x7c000000, - PPC_MFCR = 0x7c000000, - PPC_LWAR = 0x7c000000, - PPC_LDX = 0x7c000000, - PPC_LWZX = 0x7c00002e, - PPC_SLW = 0x7c000030, - PPC_CNTLZW = 0x7c000000, - PPC_SLD = 0x7c000000, - PPC_AND = 0x7c000038, - PPC_CMPL = 0x7c000040, - PPC_SUBF = 0x7c000050, - PPC_LDUX = 0x7c000000, -//------------ - PPC_DCBST = 0x7c000000, - PPC_LWZUX = 0x7c00006c, - PPC_CNTLZD = 0x7c000000, - PPC_ANDC = 0x7c000000, - PPC_TD = 0x7c000000, - PPC_MULHD = 0x7c000000, - PPC_MULHW = 0x7c000000, - PPC_MTSRD = 0x7c000000, - PPC_MFMSR = 0x7c000000, - PPC_LDARX = 0x7c000000, - PPC_DCBF = 0x7c000000, - PPC_LBZX = 0x7c0000ae, - PPC_NEG = 0x7c000000, - PPC_MTSRDIN = 0x7c000000, - PPC_LBZUX = 0x7c000000, - PPC_NOR = 0x7c0000f8, - PPC_SUBFE = 0x7c000000, - PPC_ADDE = 0x7c000000, - PPC_MTCRF = 0x7c000000, - PPC_MTMSR = 0x7c000000, - PPC_STDX = 0x7c000000, - PPC_STWCX_ = 0x7c000000, - PPC_STWX = 0x7c00012e, - PPC_MTMSRD = 0x7c000000, - PPC_STDUX = 0x7c000000, - PPC_STWUX = 0x7c00016e, - PPC_SUBFZE = 0x7c000000, - PPC_ADDZE = 0x7c000000, - PPC_MTSR = 0x7c000000, - PPC_STDCX_ = 0x7c000000, - PPC_STBX = 0x7c0001ae, - PPC_SUBFME = 0x7c000000, - PPC_MULLD = 0x7c000000, -//------------ - PPC_ADDME = 0x7c000000, - PPC_MULLW = 0x7c0001d6, - PPC_MTSRIN = 0x7c000000, - PPC_DCBTST = 0x7c000000, - PPC_STBUX = 0x7c000000, - PPC_ADD = 0x7c000214, - PPC_DCBT = 0x7c000000, - PPC_LHZX = 0x7c00022e, - PPC_EQV = 0x7c000000, - PPC_TLBIE = 0x7c000000, - PPC_ECIWX = 0x7c000000, - PPC_LHZUX = 0x7c000000, - PPC_XOR = 0x7c000278, - PPC_MFSPR = 0x7c0002a6, - PPC_LWAX = 0x7c000000, - PPC_LHAX = 0x7c000000, - PPC_TLBIA = 0x7c000000, - PPC_MFTB = 0x7c000000, - PPC_LWAUX = 0x7c000000, - PPC_LHAUX = 0x7c000000, - PPC_STHX = 0x7c00032e, - PPC_ORC = 0x7c000338, - PPC_SRADI = 0x7c000000, - PPC_SLBIE = 0x7c000000, - PPC_ECOWX = 0x7c000000, - PPC_STHUX = 0x7c000000, - PPC_OR = 0x7c000378, - PPC_DIVDU = 0x7c000000, - PPC_DIVWU = 0x7c000396, - PPC_MTSPR = 0x7c0003a6, - PPC_DCBI = 0x7c000000, - PPC_NAND = 0x7c000000, - PPC_DIVD = 0x7c000000, -//------------ - PPC_DIVW = 0x7c0003d6, - PPC_SLBIA = 0x7c000000, - PPC_MCRXR = 0x7c000000, - PPC_LSWX = 0x7c000000, - PPC_LWBRX = 0x7c000000, - PPC_LFSX = 0x7c000000, - PPC_SRW = 0x7c000430, - PPC_SRD = 0x7c000000, - PPC_TLBSYNC = 0x7c000000, - PPC_LFSUX = 0x7c000000, - PPC_MFSR = 0x7c000000, - PPC_LSWI = 0x7c000000, - PPC_SYNC = 0x7c000000, - PPC_LFDX = 0x7c000000, - PPC_LFDUX = 0x7c000000, - PPC_MFSRIN = 0x7c000000, - PPC_STSWX = 0x7c000000, - PPC_STWBRX = 0x7c000000, - PPC_STFSX = 0x7c000000, - PPC_STFSUX = 0x7c000000, - PPC_STSWI = 0x7c000000, - PPC_STFDX = 0x7c000000, - PPC_DCBA = 0x7c000000, - PPC_STFDUX = 0x7c000000, - PPC_LHBRX = 0x7c000000, - PPC_SRAW = 0x7c000630, - PPC_SRAD = 0x7c000000, - PPC_SRAWI = 0x7c000000, - PPC_EIEIO = 0x7c000000, - PPC_STHBRX = 0x7c000000, - PPC_EXTSH = 0x7c000734, - PPC_EXTSB = 0x7c000774, - PPC_ICBI = 0x7c000000, -//------------ - PPC_STFIWX = 0x7c0007ae, - PPC_EXTSW = 0x7c000000, - PPC_DCBZ = 0x7c000000, - PPC_LWZ = 0x80000000, - PPC_LWZU = 0x84000000, - PPC_LBZ = 0x88000000, - PPC_LBZU = 0x8c000000, - PPC_STW = 0x90000000, - PPC_STWU = 0x94000000, - PPC_STB = 0x98000000, - PPC_STBU = 0x9c000000, - PPC_LHZ = 0xa0000000, - PPC_LHZU = 0xa4000000, - PPC_LHA = 0xa8000000, - PPC_LHAU = 0xac000000, - PPC_STH = 0xb0000000, - PPC_STHU = 0xb4000000, - PPC_LMW = 0xb8000000, - PPC_STMW = 0xbc000000, - PPC_LFS = 0xc0000000, - PPC_LFSU = 0xc4000000, - PPC_LFD = 0xc8000000, - PPC_LFDU = 0xcc000000, - PPC_STFS = 0xd0000000, - PPC_STFSU = 0xd4000000, - PPC_STFD = 0xd8000000, - PPC_STFDU = 0xdc000000, - PPC_LD = 0xe8000000, - PPC_LDU = 0xe8000001, - PPC_LWA = 0xe8000002, - PPC_FDIVS = 0xec000024, - PPC_FSUBS = 0xec000028, - PPC_FADDS = 0xec00002a, -//------------ - PPC_FSQRTS = 0xec000000, - PPC_FRES = 0xec000000, - PPC_FMULS = 0xec000032, - PPC_FMSUBS = 0xec000000, - PPC_FMADDS = 0xec000000, - PPC_FNMSUBS = 0xec000000, - PPC_FNMADDS = 0xec000000, - PPC_STD = 0xf8000000, - PPC_STDU = 0xf8000001, - PPC_FCMPU = 0xfc000000, - PPC_FRSP = 0xfc000018, - PPC_FCTIW = 0xfc000000, - PPC_FCTIWZ = 0xfc00001e, - PPC_FDIV = 0xfc000000, - PPC_FSUB = 0xfc000028, - PPC_FADD = 0xfc000000, - PPC_FSQRT = 0xfc000000, - PPC_FSEL = 0xfc000000, - PPC_FMUL = 0xfc000000, - PPC_FRSQRTE = 0xfc000000, - PPC_FMSUB = 0xfc000000, - PPC_FMADD = 0xfc000000, - PPC_FNMSUB = 0xfc000000, - PPC_FNMADD = 0xfc000000, - PPC_FCMPO = 0xfc000000, - PPC_MTFSB1 = 0xfc000000, - PPC_FNEG = 0xfc000050, - PPC_MCRFS = 0xfc000000, - PPC_MTFSB0 = 0xfc000000, - PPC_FMR = 0xfc000000, - PPC_MTFSFI = 0xfc000000, - PPC_FNABS = 0xfc000000, - PPC_FABS = 0xfc000000, -//------------ - PPC_MFFS = 0xfc000000, - PPC_MTFSF = 0xfc000000, - PPC_FCTID = 0xfc000000, - PPC_FCTIDZ = 0xfc000000, - PPC_FCFID = 0xfc000000 - -} ppcOpcodes_t; - - -// the newly generated code -static unsigned *buf; -static int compiledOfs; // in dwords - -// fromt the original bytecode -static byte *code; -static int pc; - -void AsmCall( void ); - -double itofConvert[2]; - -static int Constant4( void ) { - int v; - - v = code[pc] | (code[pc+1]<<8) | (code[pc+2]<<16) | (code[pc+3]<<24); - pc += 4; - return v; -} - -static int Constant1( void ) { - int v; - - v = code[pc]; - pc += 1; - return v; -} - -static void Emit4( int i ) { - buf[ compiledOfs ] = i; - compiledOfs++; -} - -static void Inst( int opcode, int destReg, int aReg, int bReg ) { - unsigned r; - - r = opcode | ( destReg << 21 ) | ( aReg << 16 ) | ( bReg << 11 ) ; - buf[ compiledOfs ] = r; - compiledOfs++; -} - -static void Inst4( int opcode, int destReg, int aReg, int bReg, int cReg ) { - unsigned r; - - r = opcode | ( destReg << 21 ) | ( aReg << 16 ) | ( bReg << 11 ) | ( cReg << 6 ); - buf[ compiledOfs ] = r; - compiledOfs++; -} - -static void InstImm( int opcode, int destReg, int aReg, int immediate ) { - unsigned r; - - if ( immediate > 32767 || immediate < -32768 ) { - Com_Error( ERR_FATAL, "VM_Compile: immediate value %i out of range, opcode %x,%d,%d", immediate, opcode, destReg, aReg ); - } - r = opcode | ( destReg << 21 ) | ( aReg << 16 ) | ( immediate & 0xffff ); - buf[ compiledOfs ] = r; - compiledOfs++; -} - -static void InstImmU( int opcode, int destReg, int aReg, int immediate ) { - unsigned r; - - if ( immediate > 0xffff || immediate < 0 ) { - Com_Error( ERR_FATAL, "VM_Compile: immediate value %i out of range", immediate ); - } - r = opcode | ( destReg << 21 ) | ( aReg << 16 ) | ( immediate & 0xffff ); - buf[ compiledOfs ] = r; - compiledOfs++; -} - -static qboolean rtopped; -static int pop0, pop1, oc0, oc1; -static vm_t *tvm; -static int instruction; -static byte *jused; -static int pass; - -static void ltop() { - if (rtopped == qfalse) { - InstImm( PPC_LWZ, R_TOP, R_OPSTACK, 0 ); // get value from opstack - } -} - -static void ltopandsecond() { - if (pass>=0 && buf[compiledOfs-1] == (PPC_STWU | R_TOP<<21 | R_OPSTACK<<16 | 4 ) && jused[instruction]==0 ) { - compiledOfs--; - if (!pass) { - tvm->instructionPointers[instruction] = compiledOfs * 4; - } - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - } else if (pass>=0 && buf[compiledOfs-1] == (PPC_STW | R_TOP<<21 | R_OPSTACK<<16 | 0 ) && jused[instruction]==0 ) { - compiledOfs--; - if (!pass) { - tvm->instructionPointers[instruction] = compiledOfs * 4; - } - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -8 ); - } else { - ltop(); // get value from opstack - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -8 ); - } - rtopped = qfalse; -} - -// TJW: Unused -#if 0 -static void fltop() { - if (rtopped == qfalse) { - InstImm( PPC_LFS, R_TOP, R_OPSTACK, 0 ); // get value from opstack - } -} -#endif - -static void fltopandsecond() { - InstImm( PPC_LFS, R_TOP, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_LFS, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -8 ); - rtopped = qfalse; - return; -} - -/* -================= -VM_Compile -================= -*/ -void VM_Compile( vm_t *vm, vmHeader_t *header ) { - int op; - int maxLength; - int v; - int i; - - // set up the into-to-float variables - ((int *)itofConvert)[0] = 0x43300000; - ((int *)itofConvert)[1] = 0x80000000; - ((int *)itofConvert)[2] = 0x43300000; - - // allocate a very large temp buffer, we will shrink it later - maxLength = header->codeLength * 8; - buf = Z_Malloc( maxLength ); - jused = Z_Malloc(header->instructionCount + 2); - Com_Memset(jused, 0, header->instructionCount+2); - - // compile everything twice, so the second pass will have valid instruction - // pointers for branches - for ( pass = -1 ; pass < 2 ; pass++ ) { - - rtopped = qfalse; - // translate all instructions - pc = 0; - - pop0 = 343545; - pop1 = 2443545; - oc0 = -2343535; - oc1 = 24353454; - tvm = vm; - code = (byte *)header + header->codeOffset; - compiledOfs = 0; -#ifndef __GNUC__ - // metrowerks seems to require this header in front of functions - Emit4( (int)(buf+2) ); - Emit4( 0 ); -#endif - - for ( instruction = 0 ; instruction < header->instructionCount ; instruction++ ) { - if ( compiledOfs*4 > maxLength - 16 ) { - Com_Error( ERR_DROP, "VM_Compile: maxLength exceeded" ); - } - - op = code[ pc ]; - if ( !pass ) { - vm->instructionPointers[ instruction ] = compiledOfs * 4; - } - pc++; - switch ( op ) { - case 0: - break; - case OP_BREAK: - InstImmU( PPC_ADDI, R_TOP, 0, 0 ); - InstImm( PPC_LWZ, R_TOP, R_TOP, 0 ); // *(int *)0 to crash to debugger - rtopped = qfalse; - break; - case OP_ENTER: - InstImm( PPC_ADDI, R_STACK, R_STACK, -Constant4() ); // sub R_STACK, R_STACK, imm - rtopped = qfalse; - break; - case OP_CONST: - v = Constant4(); - if (code[pc] == OP_LOAD4 || code[pc] == OP_LOAD2 || code[pc] == OP_LOAD1) { - v &= vm->dataMask; - } - if ( v < 32768 && v >= -32768 ) { - InstImmU( PPC_ADDI, R_TOP, 0, v & 0xffff ); - } else { - InstImmU( PPC_ADDIS, R_TOP, 0, (v >> 16)&0xffff ); - if ( v & 0xffff ) { - InstImmU( PPC_ORI, R_TOP, R_TOP, v & 0xffff ); - } - } - if (code[pc] == OP_LOAD4) { - Inst( PPC_LWZX, R_TOP, R_TOP, R_MEMBASE ); // load from memory base - pc++; - instruction++; - } else if (code[pc] == OP_LOAD2) { - Inst( PPC_LHZX, R_TOP, R_TOP, R_MEMBASE ); // load from memory base - pc++; - instruction++; - } else if (code[pc] == OP_LOAD1) { - Inst( PPC_LBZX, R_TOP, R_TOP, R_MEMBASE ); // load from memory base - pc++; - instruction++; - } - if (code[pc] == OP_STORE4) { - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - //Inst( PPC_AND, R_MEMMASK, R_SECOND, R_SECOND ); // mask it - Inst( PPC_STWX, R_TOP, R_SECOND, R_MEMBASE ); // store from memory base - pc++; - instruction++; - rtopped = qfalse; - break; - } else if (code[pc] == OP_STORE2) { - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - //Inst( PPC_AND, R_MEMMASK, R_SECOND, R_SECOND ); // mask it - Inst( PPC_STHX, R_TOP, R_SECOND, R_MEMBASE ); // store from memory base - pc++; - instruction++; - rtopped = qfalse; - break; - } else if (code[pc] == OP_STORE1) { - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - //Inst( PPC_AND, R_MEMMASK, R_SECOND, R_SECOND ); // mask it - Inst( PPC_STBX, R_TOP, R_SECOND, R_MEMBASE ); // store from memory base - pc++; - instruction++; - rtopped = qfalse; - break; - } - if (code[pc] == OP_JUMP) { - jused[v] = 1; - } - InstImm( PPC_STWU, R_TOP, R_OPSTACK, 4 ); - rtopped = qtrue; - break; - case OP_LOCAL: - oc0 = oc1; - oc1 = Constant4(); - if (code[pc] == OP_LOAD4 || code[pc] == OP_LOAD2 || code[pc] == OP_LOAD1) { - oc1 &= vm->dataMask; - } - InstImm( PPC_ADDI, R_TOP, R_STACK, oc1 ); - if (code[pc] == OP_LOAD4) { - Inst( PPC_LWZX, R_TOP, R_TOP, R_MEMBASE ); // load from memory base - pc++; - instruction++; - } else if (code[pc] == OP_LOAD2) { - Inst( PPC_LHZX, R_TOP, R_TOP, R_MEMBASE ); // load from memory base - pc++; - instruction++; - } else if (code[pc] == OP_LOAD1) { - Inst( PPC_LBZX, R_TOP, R_TOP, R_MEMBASE ); // load from memory base - pc++; - instruction++; - } - if (code[pc] == OP_STORE4) { - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - //Inst( PPC_AND, R_MEMMASK, R_SECOND, R_SECOND ); // mask it - Inst( PPC_STWX, R_TOP, R_SECOND, R_MEMBASE ); // store from memory base - pc++; - instruction++; - rtopped = qfalse; - break; - } else if (code[pc] == OP_STORE2) { - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - //Inst( PPC_AND, R_MEMMASK, R_SECOND, R_SECOND ); // mask it - Inst( PPC_STHX, R_TOP, R_SECOND, R_MEMBASE ); // store from memory base - pc++; - instruction++; - rtopped = qfalse; - break; - } else if (code[pc] == OP_STORE1) { - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - //Inst( PPC_AND, R_MEMMASK, R_SECOND, R_SECOND ); // mask it - Inst( PPC_STBX, R_TOP, R_SECOND, R_MEMBASE ); // store from memory base - pc++; - instruction++; - rtopped = qfalse; - break; - } - InstImm( PPC_STWU, R_TOP, R_OPSTACK, 4 ); - rtopped = qtrue; - break; - case OP_ARG: - ltop(); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - InstImm( PPC_ADDI, R_EA, R_STACK, Constant1() ); // location to put it - Inst( PPC_STWX, R_TOP, R_EA, R_MEMBASE ); - rtopped = qfalse; - break; - case OP_CALL: - Inst( PPC_MFSPR, R_SECOND, 8, 0 ); // move from link register - InstImm( PPC_STWU, R_SECOND, R_REAL_STACK, -16 ); // save off the old return address - - Inst( PPC_MTSPR, R_ASMCALL, 9, 0 ); // move to count register - Inst( PPC_BCCTR | 1, 20, 0, 0 ); // jump and link to the count register - - InstImm( PPC_LWZ, R_SECOND, R_REAL_STACK, 0 ); // fetch the old return address - InstImm( PPC_ADDI, R_REAL_STACK, R_REAL_STACK, 16 ); - Inst( PPC_MTSPR, R_SECOND, 8, 0 ); // move to link register - rtopped = qfalse; - break; - case OP_PUSH: - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, 4 ); - rtopped = qfalse; - break; - case OP_POP: - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - rtopped = qfalse; - break; - case OP_LEAVE: - InstImm( PPC_ADDI, R_STACK, R_STACK, Constant4() ); // add R_STACK, R_STACK, imm - Inst( PPC_BCLR, 20, 0, 0 ); // branch unconditionally to link register - rtopped = qfalse; - break; - case OP_LOAD4: - ltop(); // get value from opstack - //Inst( PPC_AND, R_MEMMASK, R_TOP, R_TOP ); // mask it - Inst( PPC_LWZX, R_TOP, R_TOP, R_MEMBASE ); // load from memory base - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); - rtopped = qtrue; - break; - case OP_LOAD2: - ltop(); // get value from opstack - //Inst( PPC_AND, R_MEMMASK, R_TOP, R_TOP ); // mask it - Inst( PPC_LHZX, R_TOP, R_TOP, R_MEMBASE ); // load from memory base - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); - rtopped = qtrue; - break; - case OP_LOAD1: - ltop(); // get value from opstack - //Inst( PPC_AND, R_MEMMASK, R_TOP, R_TOP ); // mask it - Inst( PPC_LBZX, R_TOP, R_TOP, R_MEMBASE ); // load from memory base - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); - rtopped = qtrue; - break; - case OP_STORE4: - ltopandsecond(); // get value from opstack - //Inst( PPC_AND, R_MEMMASK, R_SECOND, R_SECOND ); // mask it - Inst( PPC_STWX, R_TOP, R_SECOND, R_MEMBASE ); // store from memory base - rtopped = qfalse; - break; - case OP_STORE2: - ltopandsecond(); // get value from opstack - //Inst( PPC_AND, R_MEMMASK, R_SECOND, R_SECOND ); // mask it - Inst( PPC_STHX, R_TOP, R_SECOND, R_MEMBASE ); // store from memory base - rtopped = qfalse; - break; - case OP_STORE1: - ltopandsecond(); // get value from opstack - //Inst( PPC_AND, R_MEMMASK, R_SECOND, R_SECOND ); // mask it - Inst( PPC_STBX, R_TOP, R_SECOND, R_MEMBASE ); // store from memory base - rtopped = qfalse; - break; - - case OP_EQ: - ltopandsecond(); // get value from opstack - Inst( PPC_CMP, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 4, 2, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (v&0x3ffffff) ); - rtopped = qfalse; - break; - case OP_NE: - ltopandsecond(); // get value from opstack - Inst( PPC_CMP, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 12, 2, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 4, 2, v ); - - rtopped = qfalse; - break; - case OP_LTI: - ltopandsecond(); // get value from opstack - Inst( PPC_CMP, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 4, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 12, 0, v ); - rtopped = qfalse; - break; - case OP_LEI: - ltopandsecond(); // get value from opstack - Inst( PPC_CMP, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 12, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 4, 1, v ); - rtopped = qfalse; - break; - case OP_GTI: - ltopandsecond(); // get value from opstack - Inst( PPC_CMP, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 4, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 12, 1, v ); - rtopped = qfalse; - break; - case OP_GEI: - ltopandsecond(); // get value from opstack - Inst( PPC_CMP, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 12, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 4, 0, v ); - rtopped = qfalse; - break; - case OP_LTU: - ltopandsecond(); // get value from opstack - Inst( PPC_CMPL, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 4, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 12, 0, v ); - rtopped = qfalse; - break; - case OP_LEU: - ltopandsecond(); // get value from opstack - Inst( PPC_CMPL, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 12, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 4, 1, v ); - rtopped = qfalse; - break; - case OP_GTU: - ltopandsecond(); // get value from opstack - Inst( PPC_CMPL, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 4, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 12, 1, v ); - rtopped = qfalse; - break; - case OP_GEU: - ltopandsecond(); // get value from opstack - Inst( PPC_CMPL, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 12, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 4, 0, v ); - rtopped = qfalse; - break; - - case OP_EQF: - fltopandsecond(); // get value from opstack - Inst( PPC_FCMPU, 0, R_TOP, R_SECOND ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 4, 2, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 12, 2, v ); - rtopped = qfalse; - break; - case OP_NEF: - fltopandsecond(); // get value from opstack - Inst( PPC_FCMPU, 0, R_TOP, R_SECOND ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 12, 2, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 4, 2, v ); - rtopped = qfalse; - break; - case OP_LTF: - fltopandsecond(); // get value from opstack - Inst( PPC_FCMPU, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 4, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 12, 0, v ); - rtopped = qfalse; - break; - case OP_LEF: - fltopandsecond(); // get value from opstack - Inst( PPC_FCMPU, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 12, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 4, 1, v ); - rtopped = qfalse; - break; - case OP_GTF: - fltopandsecond(); // get value from opstack - Inst( PPC_FCMPU, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 4, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 12, 1, v ); - rtopped = qfalse; - break; - case OP_GEF: - fltopandsecond(); // get value from opstack - Inst( PPC_FCMPU, 0, R_SECOND, R_TOP ); - i = Constant4(); - jused[i] = 1; - InstImm( PPC_BC, 12, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4(PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( PPC_BC, 4, 0, v ); - rtopped = qfalse; - break; - - case OP_NEGI: - ltop(); // get value from opstack - InstImm( PPC_SUBFIC, R_TOP, R_TOP, 0 ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_ADD: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_ADD, R_TOP, R_TOP, R_SECOND ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_SUB: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_SUBF, R_TOP, R_TOP, R_SECOND ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_DIVI: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_DIVW, R_TOP, R_SECOND, R_TOP ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_DIVU: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_DIVWU, R_TOP, R_SECOND, R_TOP ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_MODI: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_DIVW, R_EA, R_SECOND, R_TOP ); - Inst( PPC_MULLW, R_EA, R_TOP, R_EA ); - Inst( PPC_SUBF, R_TOP, R_EA, R_SECOND ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_MODU: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_DIVWU, R_EA, R_SECOND, R_TOP ); - Inst( PPC_MULLW, R_EA, R_TOP, R_EA ); - Inst( PPC_SUBF, R_TOP, R_EA, R_SECOND ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_MULI: - case OP_MULU: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_MULLW, R_TOP, R_SECOND, R_TOP ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_BAND: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_AND, R_SECOND, R_TOP, R_TOP ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_BOR: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_OR, R_SECOND, R_TOP, R_TOP ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_BXOR: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_XOR, R_SECOND, R_TOP, R_TOP ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_BCOM: - ltop(); // get value from opstack - Inst( PPC_NOR, R_TOP, R_TOP, R_TOP ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_LSH: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_SLW, R_SECOND, R_TOP, R_TOP ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_RSHI: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_SRAW, R_SECOND, R_TOP, R_TOP ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - case OP_RSHU: - ltop(); // get value from opstack - InstImm( PPC_LWZU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_SRW, R_SECOND, R_TOP, R_TOP ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qtrue; - break; - - case OP_NEGF: - InstImm( PPC_LFS, R_TOP, R_OPSTACK, 0 ); // get value from opstack - Inst( PPC_FNEG, R_TOP, 0, R_TOP ); - InstImm( PPC_STFS, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qfalse; - break; - case OP_ADDF: - InstImm( PPC_LFS, R_TOP, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_LFSU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_FADDS, R_TOP, R_SECOND, R_TOP ); - InstImm( PPC_STFS, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qfalse; - break; - case OP_SUBF: - InstImm( PPC_LFS, R_TOP, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_LFSU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_FSUBS, R_TOP, R_SECOND, R_TOP ); - InstImm( PPC_STFS, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qfalse; - break; - case OP_DIVF: - InstImm( PPC_LFS, R_TOP, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_LFSU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst( PPC_FDIVS, R_TOP, R_SECOND, R_TOP ); - InstImm( PPC_STFS, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qfalse; - break; - case OP_MULF: - InstImm( PPC_LFS, R_TOP, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_LFSU, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - Inst4( PPC_FMULS, R_TOP, R_SECOND, 0, R_TOP ); - InstImm( PPC_STFS, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qfalse; - break; - - case OP_CVIF: - v = (int)&itofConvert; - InstImmU( PPC_ADDIS, R_EA, 0, (v >> 16)&0xffff ); - InstImmU( PPC_ORI, R_EA, R_EA, v & 0xffff ); - InstImm( PPC_LWZ, R_TOP, R_OPSTACK, 0 ); // get value from opstack - InstImmU( PPC_XORIS, R_TOP, R_TOP, 0x8000 ); - InstImm( PPC_STW, R_TOP, R_EA, 12 ); - InstImm( PPC_LFD, R_TOP, R_EA, 0 ); - InstImm( PPC_LFD, R_SECOND, R_EA, 8 ); - Inst( PPC_FSUB, R_TOP, R_SECOND, R_TOP ); - // Inst( PPC_FRSP, R_TOP, 0, R_TOP ); - InstImm( PPC_STFS, R_TOP, R_OPSTACK, 0 ); // save value to opstack - rtopped = qfalse; - break; - case OP_CVFI: - InstImm( PPC_LFS, R_TOP, R_OPSTACK, 0 ); // get value from opstack - Inst( PPC_FCTIWZ, R_TOP, 0, R_TOP ); - Inst( PPC_STFIWX, R_TOP, 0, R_OPSTACK ); // save value to opstack - rtopped = qfalse; - break; - case OP_SEX8: - ltop(); // get value from opstack - Inst( PPC_EXTSB, R_TOP, R_TOP, 0 ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); - rtopped = qtrue; - break; - case OP_SEX16: - ltop(); // get value from opstack - Inst( PPC_EXTSH, R_TOP, R_TOP, 0 ); - InstImm( PPC_STW, R_TOP, R_OPSTACK, 0 ); - rtopped = qtrue; - break; - - case OP_BLOCK_COPY: - v = Constant4() >> 2; - ltop(); // source - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, -4 ); // dest - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -8 ); - InstImmU( PPC_ADDI, R_EA, 0, v ); // count - // FIXME: range check - Inst( PPC_MTSPR, R_EA, 9, 0 ); // move to count register - - Inst( PPC_ADD, R_TOP, R_TOP, R_MEMBASE ); - InstImm( PPC_ADDI, R_TOP, R_TOP, -4 ); - Inst( PPC_ADD, R_SECOND, R_SECOND, R_MEMBASE ); - InstImm( PPC_ADDI, R_SECOND, R_SECOND, -4 ); - - InstImm( PPC_LWZU, R_EA, R_TOP, 4 ); // source - InstImm( PPC_STWU, R_EA, R_SECOND, 4 ); // dest - Inst( PPC_BC | 0xfff8 , 16, 0, 0 ); // loop - rtopped = qfalse; - break; - - case OP_JUMP: - ltop(); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - Inst( PPC_RLWINM | ( 29 << 1 ), R_TOP, R_TOP, 2 ); - // FIXME: range check - Inst( PPC_LWZX, R_TOP, R_TOP, R_INSTRUCTIONS ); - Inst( PPC_MTSPR, R_TOP, 9, 0 ); // move to count register - Inst( PPC_BCCTR, 20, 0, 0 ); // jump to the count register - rtopped = qfalse; - break; - default: - Com_Error( ERR_DROP, "VM_CompilePPC: bad opcode %i at instruction %i, offset %i", op, instruction, pc ); - } - pop0 = pop1; - pop1 = op; - } - - Com_Printf( "VM file %s pass %d compiled to %i bytes of code\n", vm->name, (pass+1), compiledOfs*4 ); - - if ( pass == 0 ) { - // copy to an exact size buffer on the hunk - vm->codeLength = compiledOfs * 4; - vm->codeBase = Hunk_Alloc( vm->codeLength, h_low ); - Com_Memcpy( vm->codeBase, buf, vm->codeLength ); - Z_Free( buf ); - - // offset all the instruction pointers for the new location - for ( i = 0 ; i < header->instructionCount ; i++ ) { - vm->instructionPointers[i] += (int)vm->codeBase; - } - - // go back over it in place now to fixup reletive jump targets - buf = (unsigned *)vm->codeBase; - } - } - Z_Free( jused ); -} - -/* -============== -VM_CallCompiled - -This function is called directly by the generated code -============== -*/ -int VM_CallCompiled( vm_t *vm, int *args ) { - int stack[1024]; - int programStack; - int stackOnEntry; - byte *image; - - currentVM = vm; - - // interpret the code - vm->currentlyInterpreting = qtrue; - - // we might be called recursively, so this might not be the very top - programStack = vm->programStack; - stackOnEntry = programStack; - image = vm->dataBase; - - // set up the stack frame - programStack -= 48; - - *(int *)&image[ programStack + 44] = args[9]; - *(int *)&image[ programStack + 40] = args[8]; - *(int *)&image[ programStack + 36] = args[7]; - *(int *)&image[ programStack + 32] = args[6]; - *(int *)&image[ programStack + 28] = args[5]; - *(int *)&image[ programStack + 24] = args[4]; - *(int *)&image[ programStack + 20] = args[3]; - *(int *)&image[ programStack + 16] = args[2]; - *(int *)&image[ programStack + 12] = args[1]; - *(int *)&image[ programStack + 8 ] = args[0]; - *(int *)&image[ programStack + 4 ] = 0; // return stack - *(int *)&image[ programStack ] = -1; // will terminate the loop on return - - // off we go into generated code... - // the PPC calling standard says the parms will all go into R3 - R11, so - // no special asm code is needed here -#ifdef __GNUC__ - ((void(*)(int, int, int, int, int, int, int, int))(vm->codeBase))( - programStack, (int)&stack, - (int)image, vm->dataMask, (int)&AsmCall, - (int)vm->instructionPointers, vm->instructionPointersLength, - (int)vm ); -#else - ((void(*)(int, int, int, int, int, int, int, int))(vm->codeBase))( - programStack, (int)&stack, - (int)image, vm->dataMask, *(int *)&AsmCall /* skip function pointer header */, - (int)vm->instructionPointers, vm->instructionPointersLength, - (int)vm ); -#endif - vm->programStack = stackOnEntry; - - vm->currentlyInterpreting = qfalse; - - return stack[1]; -} - - -/* -================== -AsmCall - -Put this at end of file because gcc messes up debug line numbers -================== -*/ -#ifdef __GNUC__ - -void AsmCall( void ) { -asm ( - // pop off the destination instruction -" lwz r12,0(r4) \n" // RG_TOP, 0(RG_OPSTACK) -" addi r4,r4,-4 \n" // RG_OPSTACK, RG_OPSTACK, -4 \n" - - // see if it is a system trap -" cmpwi r12,0 \n" // RG_TOP, 0 \n" -" bc 12,0, systemTrap \n" - - // calling another VM function, so lookup in instructionPointers -" slwi r12,r12,2 \n" // RG_TOP,RG_TOP,2 - // FIXME: range check -" lwzx r12, r8, r12 \n" // RG_TOP, RG_INSTRUCTIONS(RG_TOP) -" mtctr r12 \n" // RG_TOP -); - -#if defined(MACOS_X) && defined(__OPTIMIZE__) - // On Mac OS X, gcc doesn't push a frame when we are optimized, so trying to tear it down results in grave disorder. -#warning Mac OS X optimization on, not popping GCC AsmCall frame -#else - // Mac OS X Server and unoptimized compiles include a GCC AsmCall frame - asm ( -" lwz r1,0(r1) \n" // pop off the GCC AsmCall frame -" lmw r30,-8(r1) \n" -); -#endif - -asm ( -" bcctr 20,0 \n" // when it hits a leave, it will branch to the current link register - - // calling a system trap -"systemTrap: \n" - // convert to positive system call number -" subfic r12,r12,-1 \n" - - // save all our registers, including the current link register -" mflr r13 \n" // RG_SECOND // copy off our link register -" addi r1,r1,-92 \n" // required 24 byets of linkage, 32 bytes of parameter, plus our saves -" stw r3,56(r1) \n" // RG_STACK, -36(REAL_STACK) -" stw r4,60(r1) \n" // RG_OPSTACK, 4(RG_REAL_STACK) -" stw r5,64(r1) \n" // RG_MEMBASE, 8(RG_REAL_STACK) -" stw r6,68(r1) \n" // RG_MEMMASK, 12(RG_REAL_STACK) -" stw r7,72(r1) \n" // RG_ASMCALL, 16(RG_REAL_STACK) -" stw r8,76(r1) \n" // RG_INSTRUCTIONS, 20(RG_REAL_STACK) -" stw r9,80(r1) \n" // RG_NUM_INSTRUCTIONS, 24(RG_REAL_STACK) -" stw r10,84(r1) \n" // RG_VM, 28(RG_REAL_STACK) -" stw r13,88(r1) \n" // RG_SECOND, 32(RG_REAL_STACK) // link register - - // save the vm stack position to allow recursive VM entry -" addi r13,r3,-4 \n" // RG_TOP, RG_STACK, -4 -" stw r13,0(r10) \n" //RG_TOP, VM_OFFSET_PROGRAM_STACK(RG_VM) - - // save the system call number as the 0th parameter -" add r3,r3,r5 \n" // r3, RG_STACK, RG_MEMBASE // r3 is the first parameter to vm->systemCalls -" stwu r12,4(r3) \n" // RG_TOP, 4(r3) - - // make the system call with the address of all the VM parms as a parameter - // vm->systemCalls( &parms ) -" lwz r12,4(r10) \n" // RG_TOP, VM_OFFSET_SYSTEM_CALL(RG_VM) -" mtctr r12 \n" // RG_TOP -" bcctrl 20,0 \n" -" mr r12,r3 \n" // RG_TOP, r3 - - // pop our saved registers -" lwz r3,56(r1) \n" // RG_STACK, 0(RG_REAL_STACK) -" lwz r4,60(r1) \n" // RG_OPSTACK, 4(RG_REAL_STACK) -" lwz r5,64(r1) \n" // RG_MEMBASE, 8(RG_REAL_STACK) -" lwz r6,68(r1) \n" // RG_MEMMASK, 12(RG_REAL_STACK) -" lwz r7,72(r1) \n" // RG_ASMCALL, 16(RG_REAL_STACK) -" lwz r8,76(r1) \n" // RG_INSTRUCTIONS, 20(RG_REAL_STACK) -" lwz r9,80(r1) \n" // RG_NUM_INSTRUCTIONS, 24(RG_REAL_STACK) -" lwz r10,84(r1) \n" // RG_VM, 28(RG_REAL_STACK) -" lwz r13,88(r1) \n" // RG_SECOND, 32(RG_REAL_STACK) -" addi r1,r1,92 \n" // RG_REAL_STACK, RG_REAL_STACK, 36 - - // restore the old link register -" mtlr r13 \n" // RG_SECOND - - // save off the return value -" stwu r12,4(r4) \n" // RG_TOP, 0(RG_OPSTACK) - - // GCC adds its own prolog / epilog code - ); -} -#else - -// codewarrior version - -void asm AsmCall( void ) { - - // pop off the destination instruction - - lwz r12,0(r4) // RG_TOP, 0(RG_OPSTACK) - - addi r4,r4,-4 // RG_OPSTACK, RG_OPSTACK, -4 - - - - // see if it is a system trap - - cmpwi r12,0 // RG_TOP, 0 - - bc 12,0, systemTrap - - - - // calling another VM function, so lookup in instructionPointers - - slwi r12,r12,2 // RG_TOP,RG_TOP,2 - - // FIXME: range check - - lwzx r12, r8, r12 // RG_TOP, RG_INSTRUCTIONS(RG_TOP) - - mtctr r12 // RG_TOP - - - - bcctr 20,0 // when it hits a leave, it will branch to the current link register - - - - // calling a system trap - -systemTrap: - - // convert to positive system call number - - subfic r12,r12,-1 - - - - // save all our registers, including the current link register - - mflr r13 // RG_SECOND // copy off our link register - - addi r1,r1,-92 // required 24 byets of linkage, 32 bytes of parameter, plus our saves - - stw r3,56(r1) // RG_STACK, -36(REAL_STACK) - - stw r4,60(r1) // RG_OPSTACK, 4(RG_REAL_STACK) - - stw r5,64(r1) // RG_MEMBASE, 8(RG_REAL_STACK) - - stw r6,68(r1) // RG_MEMMASK, 12(RG_REAL_STACK) - - stw r7,72(r1) // RG_ASMCALL, 16(RG_REAL_STACK) - - stw r8,76(r1) // RG_INSTRUCTIONS, 20(RG_REAL_STACK) - - stw r9,80(r1) // RG_NUM_INSTRUCTIONS, 24(RG_REAL_STACK) - - stw r10,84(r1) // RG_VM, 28(RG_REAL_STACK) - - stw r13,88(r1) // RG_SECOND, 32(RG_REAL_STACK) // link register - - - - // save the vm stack position to allow recursive VM entry - - addi r13,r3,-4 // RG_TOP, RG_STACK, -4 - - stw r13,0(r10) //RG_TOP, VM_OFFSET_PROGRAM_STACK(RG_VM) - - - - // save the system call number as the 0th parameter - - add r3,r3,r5 // r3, RG_STACK, RG_MEMBASE // r3 is the first parameter to vm->systemCalls - - stwu r12,4(r3) // RG_TOP, 4(r3) - - - - // make the system call with the address of all the VM parms as a parameter - - // vm->systemCalls( &parms ) - - lwz r12,4(r10) // RG_TOP, VM_OFFSET_SYSTEM_CALL(RG_VM) - - - - // perform macos cross fragment fixup crap - - lwz r9,0(r12) - - stw r2,52(r1) // save old TOC - - lwz r2,4(r12) - - - - mtctr r9 // RG_TOP - - bcctrl 20,0 - - - - lwz r2,52(r1) // restore TOC - - - - mr r12,r3 // RG_TOP, r3 - - - - // pop our saved registers - - lwz r3,56(r1) // RG_STACK, 0(RG_REAL_STACK) - - lwz r4,60(r1) // RG_OPSTACK, 4(RG_REAL_STACK) - - lwz r5,64(r1) // RG_MEMBASE, 8(RG_REAL_STACK) - - lwz r6,68(r1) // RG_MEMMASK, 12(RG_REAL_STACK) - - lwz r7,72(r1) // RG_ASMCALL, 16(RG_REAL_STACK) - - lwz r8,76(r1) // RG_INSTRUCTIONS, 20(RG_REAL_STACK) - - lwz r9,80(r1) // RG_NUM_INSTRUCTIONS, 24(RG_REAL_STACK) - - lwz r10,84(r1) // RG_VM, 28(RG_REAL_STACK) - - lwz r13,88(r1) // RG_SECOND, 32(RG_REAL_STACK) - - addi r1,r1,92 // RG_REAL_STACK, RG_REAL_STACK, 36 - - - - // restore the old link register - - mtlr r13 // RG_SECOND - - - - // save off the return value - - stwu r12,4(r4) // RG_TOP, 0(RG_OPSTACK) - - - - blr - -} - - - - -#endif diff --git a/code/qcommon/vm_ppc_new.c b/code/qcommon/vm_ppc_new.c deleted file mode 100644 index 83c77db..0000000 --- a/code/qcommon/vm_ppc_new.c +++ /dev/null @@ -1,2119 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// vm_ppc.c -// ppc dynamic compiler - -#include "vm_local.h" - -#pragma opt_pointer_analysis off - -#define DEBUG_VM 0 - -#if DEBUG_VM -static char *opnames[256] = { - "OP_UNDEF", - - "OP_IGNORE", - - "OP_BREAK", - - "OP_ENTER", - "OP_LEAVE", - "OP_CALL", - "OP_PUSH", - "OP_POP", - - "OP_CONST", - - "OP_LOCAL", - - "OP_JUMP", - - //------------------- - - "OP_EQ", - "OP_NE", - - "OP_LTI", - "OP_LEI", - "OP_GTI", - "OP_GEI", - - "OP_LTU", - "OP_LEU", - "OP_GTU", - "OP_GEU", - - "OP_EQF", - "OP_NEF", - - "OP_LTF", - "OP_LEF", - "OP_GTF", - "OP_GEF", - - //------------------- - - "OP_LOAD1", - "OP_LOAD2", - "OP_LOAD4", - "OP_STORE1", - "OP_STORE2", - "OP_STORE4", - "OP_ARG", - - "OP_BLOCK_COPY", - - //------------------- - - "OP_SEX8", - "OP_SEX16", - - "OP_NEGI", - "OP_ADD", - "OP_SUB", - "OP_DIVI", - "OP_DIVU", - "OP_MODI", - "OP_MODU", - "OP_MULI", - "OP_MULU", - - "OP_BAND", - "OP_BOR", - "OP_BXOR", - "OP_BCOM", - - "OP_LSH", - "OP_RSHI", - "OP_RSHU", - - "OP_NEGF", - "OP_ADDF", - "OP_SUBF", - "OP_DIVF", - "OP_MULF", - - "OP_CVIF", - "OP_CVFI" -}; -#endif - -typedef enum { - R_REAL_STACK = 1, - // registers 3-11 are the parameter passing registers - - // state - R_STACK = 3, // local - R_OPSTACK, // global - - // constants - R_MEMBASE, // global - R_MEMMASK, - R_ASMCALL, // global - R_INSTRUCTIONS, // global - R_NUM_INSTRUCTIONS, // global - R_CVM, // currentVM - - // temps - R_TOP = 11, - R_SECOND = 12, - R_EA = 2 // effective address calculation - -} regNums_t; - -#define RG_REAL_STACK r1 -#define RG_STACK r3 -#define RG_OPSTACK r4 -#define RG_MEMBASE r5 -#define RG_MEMMASK r6 -#define RG_ASMCALL r7 -#define RG_INSTRUCTIONS r8 -#define RG_NUM_INSTRUCTIONS r9 -#define RG_CVM r10 -#define RG_TOP r12 -#define RG_SECOND r13 -#define RG_EA r14 - -// The deepest value I saw in the Quake3 games was 9. -#define OP_STACK_MAX_DEPTH 12 - -// These are all volatile and thus must be saved -// upon entry to the VM code. -static int opStackIntRegisters[OP_STACK_MAX_DEPTH] = -{ - 16, 17, 18, 19, - 20, 21, 22, 23, - 24, 25, 26, 27 -}; - -static unsigned int *opStackLoadInstructionAddr[OP_STACK_MAX_DEPTH]; - -// We use different registers for the floating point -// operand stack (these are volatile in the PPC ABI) -static int opStackFloatRegisters[OP_STACK_MAX_DEPTH] = -{ - 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11 -}; - -static int opStackRegType[OP_STACK_MAX_DEPTH] = -{ - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0 -}; - -// this doesn't have the low order bits set for instructions i'm not using... -typedef enum { - PPC_TDI = 0x08000000, - PPC_TWI = 0x0c000000, - PPC_MULLI = 0x1c000000, - PPC_SUBFIC = 0x20000000, - PPC_CMPI = 0x28000000, - PPC_CMPLI = 0x2c000000, - PPC_ADDIC = 0x30000000, - PPC_ADDIC_ = 0x34000000, - PPC_ADDI = 0x38000000, - PPC_ADDIS = 0x3c000000, - PPC_BC = 0x40000000, - PPC_SC = 0x44000000, - PPC_B = 0x48000000, - - PPC_MCRF = 0x4c000000, - PPC_BCLR = 0x4c000020, - PPC_RFID = 0x4c000000, - PPC_CRNOR = 0x4c000000, - PPC_RFI = 0x4c000000, - PPC_CRANDC = 0x4c000000, - PPC_ISYNC = 0x4c000000, - PPC_CRXOR = 0x4c000000, - PPC_CRNAND = 0x4c000000, - PPC_CREQV = 0x4c000000, - PPC_CRORC = 0x4c000000, - PPC_CROR = 0x4c000000, -//------------ - PPC_BCCTR = 0x4c000420, - PPC_RLWIMI = 0x50000000, - PPC_RLWINM = 0x54000000, - PPC_RLWNM = 0x5c000000, - PPC_ORI = 0x60000000, - PPC_ORIS = 0x64000000, - PPC_XORI = 0x68000000, - PPC_XORIS = 0x6c000000, - PPC_ANDI_ = 0x70000000, - PPC_ANDIS_ = 0x74000000, - PPC_RLDICL = 0x78000000, - PPC_RLDICR = 0x78000000, - PPC_RLDIC = 0x78000000, - PPC_RLDIMI = 0x78000000, - PPC_RLDCL = 0x78000000, - PPC_RLDCR = 0x78000000, - PPC_CMP = 0x7c000000, - PPC_TW = 0x7c000000, - PPC_SUBFC = 0x7c000010, - PPC_MULHDU = 0x7c000000, - PPC_ADDC = 0x7c000014, - PPC_MULHWU = 0x7c000000, - PPC_MFCR = 0x7c000000, - PPC_LWAR = 0x7c000000, - PPC_LDX = 0x7c000000, - PPC_LWZX = 0x7c00002e, - PPC_SLW = 0x7c000030, - PPC_CNTLZW = 0x7c000000, - PPC_SLD = 0x7c000000, - PPC_AND = 0x7c000038, - PPC_CMPL = 0x7c000040, - PPC_SUBF = 0x7c000050, - PPC_LDUX = 0x7c000000, -//------------ - PPC_DCBST = 0x7c000000, - PPC_LWZUX = 0x7c00006c, - PPC_CNTLZD = 0x7c000000, - PPC_ANDC = 0x7c000000, - PPC_TD = 0x7c000000, - PPC_MULHD = 0x7c000000, - PPC_MULHW = 0x7c000000, - PPC_MTSRD = 0x7c000000, - PPC_MFMSR = 0x7c000000, - PPC_LDARX = 0x7c000000, - PPC_DCBF = 0x7c000000, - PPC_LBZX = 0x7c0000ae, - PPC_NEG = 0x7c000000, - PPC_MTSRDIN = 0x7c000000, - PPC_LBZUX = 0x7c000000, - PPC_NOR = 0x7c0000f8, - PPC_SUBFE = 0x7c000000, - PPC_ADDE = 0x7c000000, - PPC_MTCRF = 0x7c000000, - PPC_MTMSR = 0x7c000000, - PPC_STDX = 0x7c000000, - PPC_STWCX_ = 0x7c000000, - PPC_STWX = 0x7c00012e, - PPC_MTMSRD = 0x7c000000, - PPC_STDUX = 0x7c000000, - PPC_STWUX = 0x7c00016e, - PPC_SUBFZE = 0x7c000000, - PPC_ADDZE = 0x7c000000, - PPC_MTSR = 0x7c000000, - PPC_STDCX_ = 0x7c000000, - PPC_STBX = 0x7c0001ae, - PPC_SUBFME = 0x7c000000, - PPC_MULLD = 0x7c000000, -//------------ - PPC_ADDME = 0x7c000000, - PPC_MULLW = 0x7c0001d6, - PPC_MTSRIN = 0x7c000000, - PPC_DCBTST = 0x7c000000, - PPC_STBUX = 0x7c000000, - PPC_ADD = 0x7c000214, - PPC_DCBT = 0x7c000000, - PPC_LHZX = 0x7c00022e, - PPC_EQV = 0x7c000000, - PPC_TLBIE = 0x7c000000, - PPC_ECIWX = 0x7c000000, - PPC_LHZUX = 0x7c000000, - PPC_XOR = 0x7c000278, - PPC_MFSPR = 0x7c0002a6, - PPC_LWAX = 0x7c000000, - PPC_LHAX = 0x7c000000, - PPC_TLBIA = 0x7c000000, - PPC_MFTB = 0x7c000000, - PPC_LWAUX = 0x7c000000, - PPC_LHAUX = 0x7c000000, - PPC_STHX = 0x7c00032e, - PPC_ORC = 0x7c000338, - PPC_SRADI = 0x7c000000, - PPC_SLBIE = 0x7c000000, - PPC_ECOWX = 0x7c000000, - PPC_STHUX = 0x7c000000, - PPC_OR = 0x7c000378, - PPC_DIVDU = 0x7c000000, - PPC_DIVWU = 0x7c000396, - PPC_MTSPR = 0x7c0003a6, - PPC_DCBI = 0x7c000000, - PPC_NAND = 0x7c000000, - PPC_DIVD = 0x7c000000, -//------------ - PPC_DIVW = 0x7c0003d6, - PPC_SLBIA = 0x7c000000, - PPC_MCRXR = 0x7c000000, - PPC_LSWX = 0x7c000000, - PPC_LWBRX = 0x7c000000, - PPC_LFSX = 0x7c00042e, - PPC_SRW = 0x7c000430, - PPC_SRD = 0x7c000000, - PPC_TLBSYNC = 0x7c000000, - PPC_LFSUX = 0x7c000000, - PPC_MFSR = 0x7c000000, - PPC_LSWI = 0x7c000000, - PPC_SYNC = 0x7c000000, - PPC_LFDX = 0x7c000000, - PPC_LFDUX = 0x7c000000, - PPC_MFSRIN = 0x7c000000, - PPC_STSWX = 0x7c000000, - PPC_STWBRX = 0x7c000000, - PPC_STFSX = 0x7c00052e, - PPC_STFSUX = 0x7c000000, - PPC_STSWI = 0x7c000000, - PPC_STFDX = 0x7c000000, - PPC_DCBA = 0x7c000000, - PPC_STFDUX = 0x7c000000, - PPC_LHBRX = 0x7c000000, - PPC_SRAW = 0x7c000630, - PPC_SRAD = 0x7c000000, - PPC_SRAWI = 0x7c000000, - PPC_EIEIO = 0x7c000000, - PPC_STHBRX = 0x7c000000, - PPC_EXTSH = 0x7c000734, - PPC_EXTSB = 0x7c000774, - PPC_ICBI = 0x7c000000, -//------------ - PPC_STFIWX = 0x7c0007ae, - PPC_EXTSW = 0x7c000000, - PPC_DCBZ = 0x7c000000, - PPC_LWZ = 0x80000000, - PPC_LWZU = 0x84000000, - PPC_LBZ = 0x88000000, - PPC_LBZU = 0x8c000000, - PPC_STW = 0x90000000, - PPC_STWU = 0x94000000, - PPC_STB = 0x98000000, - PPC_STBU = 0x9c000000, - PPC_LHZ = 0xa0000000, - PPC_LHZU = 0xa4000000, - PPC_LHA = 0xa8000000, - PPC_LHAU = 0xac000000, - PPC_STH = 0xb0000000, - PPC_STHU = 0xb4000000, - PPC_LMW = 0xb8000000, - PPC_STMW = 0xbc000000, - PPC_LFS = 0xc0000000, - PPC_LFSU = 0xc4000000, - PPC_LFD = 0xc8000000, - PPC_LFDU = 0xcc000000, - PPC_STFS = 0xd0000000, - PPC_STFSU = 0xd4000000, - PPC_STFD = 0xd8000000, - PPC_STFDU = 0xdc000000, - PPC_LD = 0xe8000000, - PPC_LDU = 0xe8000001, - PPC_LWA = 0xe8000002, - PPC_FDIVS = 0xec000024, - PPC_FSUBS = 0xec000028, - PPC_FADDS = 0xec00002a, -//------------ - PPC_FSQRTS = 0xec000000, - PPC_FRES = 0xec000000, - PPC_FMULS = 0xec000032, - PPC_FMSUBS = 0xec000000, - PPC_FMADDS = 0xec000000, - PPC_FNMSUBS = 0xec000000, - PPC_FNMADDS = 0xec000000, - PPC_STD = 0xf8000000, - PPC_STDU = 0xf8000001, - PPC_FCMPU = 0xfc000000, - PPC_FRSP = 0xfc000018, - PPC_FCTIW = 0xfc000000, - PPC_FCTIWZ = 0xfc00001e, - PPC_FDIV = 0xfc000000, - PPC_FSUB = 0xfc000028, - PPC_FADD = 0xfc000000, - PPC_FSQRT = 0xfc000000, - PPC_FSEL = 0xfc000000, - PPC_FMUL = 0xfc000000, - PPC_FRSQRTE = 0xfc000000, - PPC_FMSUB = 0xfc000000, - PPC_FMADD = 0xfc000000, - PPC_FNMSUB = 0xfc000000, - PPC_FNMADD = 0xfc000000, - PPC_FCMPO = 0xfc000000, - PPC_MTFSB1 = 0xfc000000, - PPC_FNEG = 0xfc000050, - PPC_MCRFS = 0xfc000000, - PPC_MTFSB0 = 0xfc000000, - PPC_FMR = 0xfc000000, - PPC_MTFSFI = 0xfc000000, - PPC_FNABS = 0xfc000000, - PPC_FABS = 0xfc000000, -//------------ - PPC_MFFS = 0xfc000000, - PPC_MTFSF = 0xfc000000, - PPC_FCTID = 0xfc000000, - PPC_FCTIDZ = 0xfc000000, - PPC_FCFID = 0xfc000000 - -} ppcOpcodes_t; - - -// the newly generated code -static unsigned *buf; -static int compiledOfs; // in dwords -static int pass; - -// fromt the original bytecode -static byte *code; -static int pc; - -void AsmCall( void ); - -double itofConvert[2]; - -static int Constant4( void ) { - int v; - - v = code[pc] | (code[pc+1]<<8) | (code[pc+2]<<16) | (code[pc+3]<<24); - pc += 4; - return v; -} - -static int Constant1( void ) { - int v; - - v = code[pc]; - pc += 1; - return v; -} - -static void Emit4( char *opname, int i ) { - #if DEBUG_VM - if(pass == 1) - printf("\t\t\t%p %s\t%08lx\n",&buf[compiledOfs],opname,i&0x3ffffff); - #endif - buf[ compiledOfs ] = i; - compiledOfs++; -} - -static void Inst( char *opname, int opcode, int destReg, int aReg, int bReg ) { - unsigned r; - - #if DEBUG_VM - if(pass == 1) - printf("\t\t\t%p %s\tr%d,r%d,r%d\n",&buf[compiledOfs],opname,destReg,aReg,bReg); - #endif - r = opcode | ( destReg << 21 ) | ( aReg << 16 ) | ( bReg << 11 ) ; - buf[ compiledOfs ] = r; - compiledOfs++; -} - -static void Inst4( char *opname, int opcode, int destReg, int aReg, int bReg, int cReg ) { - unsigned r; - - #if DEBUG_VM - if(pass == 1) - printf("\t\t\t%p %s\tr%d,r%d,r%d,r%d\n",&buf[compiledOfs],opname,destReg,aReg,bReg,cReg); - #endif - r = opcode | ( destReg << 21 ) | ( aReg << 16 ) | ( bReg << 11 ) | ( cReg << 6 ); - buf[ compiledOfs ] = r; - compiledOfs++; -} - -static void InstImm( char *opname, int opcode, int destReg, int aReg, int immediate ) { - unsigned r; - - if ( immediate > 32767 || immediate < -32768 ) { - Com_Error( ERR_FATAL, "VM_Compile: immediate value %i out of range, opcode %x,%d,%d", immediate, opcode, destReg, aReg ); - } - #if DEBUG_VM - if(pass == 1) - printf("\t\t\t%p %s\tr%d,r%d,0x%x\n",&buf[compiledOfs],opname,destReg,aReg,immediate); - #endif - r = opcode | ( destReg << 21 ) | ( aReg << 16 ) | ( immediate & 0xffff ); - buf[ compiledOfs ] = r; - compiledOfs++; -} - -static void InstImmU( char *opname, int opcode, int destReg, int aReg, int immediate ) { - unsigned r; - - if ( immediate > 0xffff || immediate < 0 ) { - Com_Error( ERR_FATAL, "VM_Compile: immediate value %i out of range", immediate ); - } - #if DEBUG_VM - if(pass == 1) - printf("\t\t\t%p %s\tr%d,r%d,0x%x\n",&buf[compiledOfs],opname,destReg,aReg,immediate); - #endif - r = opcode | ( destReg << 21 ) | ( aReg << 16 ) | ( immediate & 0xffff ); - buf[ compiledOfs ] = r; - compiledOfs++; -} - -static int pop0, pop1, oc0, oc1; -static vm_t *tvm; -static int instruction; -static byte *jused; - -static void ltop() { -// if (rtopped == qfalse) { -// InstImm( PPC_LWZ, R_TOP, R_OPSTACK, 0 ); // get value from opstack -// } -} - -static void ltopandsecond() { -#if 0 - if (pass>=0 && buf[compiledOfs-1] == (PPC_STWU | R_TOP<<21 | R_OPSTACK<<16 | 4 ) && jused[instruction]==0 ) { - compiledOfs--; - if (!pass) { - tvm->instructionPointers[instruction] = compiledOfs * 4; - } - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -4 ); - } else if (pass>=0 && buf[compiledOfs-1] == (PPC_STW | R_TOP<<21 | R_OPSTACK<<16 | 0 ) && jused[instruction]==0 ) { - compiledOfs--; - if (!pass) { - tvm->instructionPointers[instruction] = compiledOfs * 4; - } - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -8 ); - } else { - ltop(); // get value from opstack - InstImm( PPC_LWZ, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -8 ); - } - rtopped = qfalse; -#endif -} - -static void spillOpStack(int depth) -{ - // Store out each register on the operand stack to it's correct location. - int i; - - for(i = 0; i < depth; i++) - { - assert(opStackRegType[i]); - assert(opStackRegType[i] == 1); - switch(opStackRegType[i]) - { - case 1: // Integer register - InstImm( "stw", PPC_STW, opStackIntRegisters[i], R_OPSTACK, i*4+4); - break; - case 2: // Float register - InstImm( "stfs", PPC_STFS, opStackFloatRegisters[i], R_OPSTACK, i*4+4); - break; - } - opStackRegType[i] = 0; - } -} - -static void loadOpStack(int depth) -{ - // Back off operand stack pointer and reload all operands. -// InstImm( "addi", PPC_ADDI, R_OPSTACK, R_OPSTACK, -(depth)*4 ); - - int i; - - for(i = 0; i < depth; i++) - { - assert(opStackRegType[i] == 0); - // For now we're stuck reloading everything as an integer. - opStackLoadInstructionAddr[i] = &buf[compiledOfs]; - InstImm( "lwz", PPC_LWZ, opStackIntRegisters[i], R_OPSTACK, i*4+4); - opStackRegType[i] = 1; - } -} - -static void makeInteger(int depth) -{ - // This should really never be necessary... - assert(opStackRegType[depth] == 1); - //assert(opStackRegType[depth] == 2); - if(opStackRegType[depth] == 2) - { - unsigned instruction; - assert(opStackLoadInstructionAddr[depth]); - - printf("patching float load at %p to int load\n",opStackLoadInstructionAddr[depth]); - // Repatch load instruction to use LFS instead of LWZ - instruction = *opStackLoadInstructionAddr[depth]; - instruction &= ~PPC_LFSX; - instruction |= PPC_LWZX; - *opStackLoadInstructionAddr[depth] = instruction; - opStackLoadInstructionAddr[depth] = 0; - opStackRegType[depth] = 1; - #if 0 - InstImm( "stfs", PPC_STFS, opStackFloatRegisters[depth], R_OPSTACK, depth*4+4); - // For XXX make sure we force enough NOPs to get the load into - // another dispatch group to avoid pipeline flush. - Inst( "ori", PPC_ORI, 0, 0, 0 ); - Inst( "ori", PPC_ORI, 0, 0, 0 ); - Inst( "ori", PPC_ORI, 0, 0, 0 ); - Inst( "ori", PPC_ORI, 0, 0, 0 ); - InstImm( "lwz", PPC_LWZ, opStackIntRegisters[depth], R_OPSTACK, depth*4+4); - opStackRegType[depth] = 1; - #endif - } -} - -static void makeFloat(int depth) -{ - //assert(opStackRegType[depth] == 1); - if(opStackRegType[depth] == 1) - { - unsigned instruction; - unsigned destReg, aReg, bReg, imm; - - if(opStackLoadInstructionAddr[depth]) - { - // Repatch load instruction to use LFS instead of LWZ - instruction = *opStackLoadInstructionAddr[depth]; - // Figure out if it's LWZ or LWZX - if((instruction & 0xfc000000) == PPC_LWZ) - { - //printf("patching LWZ at %p to LFS at depth %ld\n",opStackLoadInstructionAddr[depth],depth); - //printf("old instruction: %08lx\n",instruction); - // Extract registers - destReg = (instruction >> 21) & 31; - aReg = (instruction >> 16) & 31; - imm = instruction & 0xffff; - - // Calculate correct FP register to use. - // THIS ASSUMES REGISTER USAGE FOR THE STACK IS n, n+1, n+2, etc! - //printf("old dest: %ld\n",destReg); - destReg = (destReg - opStackIntRegisters[0]) + opStackFloatRegisters[0]; - instruction = PPC_LFS | ( destReg << 21 ) | ( aReg << 16 ) | imm ; - //printf("new dest: %ld\n",destReg); - //printf("new instruction: %08lx\n",instruction); - } - else - { - //printf("patching LWZX at %p to LFSX at depth %ld\n",opStackLoadInstructionAddr[depth],depth); - //printf("old instruction: %08lx\n",instruction); - // Extract registers - destReg = (instruction >> 21) & 31; - aReg = (instruction >> 16) & 31; - bReg = (instruction >> 11) & 31; - // Calculate correct FP register to use. - // THIS ASSUMES REGISTER USAGE FOR THE STACK IS n, n+1, n+2, etc! - //printf("old dest: %ld\n",destReg); - destReg = (destReg - opStackIntRegisters[0]) + opStackFloatRegisters[0]; - instruction = PPC_LFSX | ( destReg << 21 ) | ( aReg << 16 ) | ( bReg << 11 ) ; - //printf("new dest: %ld\n",destReg); - //printf("new instruction: %08lx\n",instruction); - } - *opStackLoadInstructionAddr[depth] = instruction; - opStackLoadInstructionAddr[depth] = 0; - } - else - { - //printf("doing float constant load at %p for depth %ld\n",&buf[compiledOfs],depth); - // It was likely loaded as a constant so we have to save/load it. A more - // interesting implementation might be to generate code to do a "PC relative" - // load from the VM code region. - InstImm( "stw", PPC_STW, opStackIntRegisters[depth], R_OPSTACK, depth*4+4); - // For XXX make sure we force enough NOPs to get the load into - // another dispatch group to avoid pipeline flush. - Inst( "ori", PPC_ORI, 0, 0, 0 ); - Inst( "ori", PPC_ORI, 0, 0, 0 ); - Inst( "ori", PPC_ORI, 0, 0, 0 ); - Inst( "ori", PPC_ORI, 0, 0, 0 ); - InstImm( "lfs", PPC_LFS, opStackFloatRegisters[depth], R_OPSTACK, depth*4+4); - } - opStackRegType[depth] = 2; - } -} - -// TJW: Unused -#if 0 -static void fltop() { - if (rtopped == qfalse) { - InstImm( PPC_LFS, R_TOP, R_OPSTACK, 0 ); // get value from opstack - } -} -#endif - -#if 0 -static void fltopandsecond() { - InstImm( PPC_LFS, R_TOP, R_OPSTACK, 0 ); // get value from opstack - InstImm( PPC_LFS, R_SECOND, R_OPSTACK, -4 ); // get value from opstack - InstImm( PPC_ADDI, R_OPSTACK, R_OPSTACK, -8 ); - rtopped = qfalse; - return; -} -#endif - -#define assertInteger(depth) assert(opStackRegType[depth] == 1) - -/* -================= -VM_Compile -================= -*/ -void VM_Compile( vm_t *vm, vmHeader_t *header ) { - int op; - int maxLength; - int v; - int i; - int opStackDepth; - - int mainFunction; - - // set up the into-to-float variables - ((int *)itofConvert)[0] = 0x43300000; - ((int *)itofConvert)[1] = 0x80000000; - ((int *)itofConvert)[2] = 0x43300000; - - // allocate a very large temp buffer, we will shrink it later - maxLength = header->codeLength * 8; - buf = Z_Malloc( maxLength ); - jused = Z_Malloc(header->instructionCount + 2); - Com_Memset(jused, 0, header->instructionCount+2); - - // compile everything twice, so the second pass will have valid instruction - // pointers for branches - for ( pass = -1 ; pass < 2 ; pass++ ) { - - // translate all instructions - pc = 0; - mainFunction = 0; - opStackDepth = 0; - - pop0 = 343545; - pop1 = 2443545; - oc0 = -2343535; - oc1 = 24353454; - tvm = vm; - code = (byte *)header + header->codeOffset; - compiledOfs = 0; -#ifndef __GNUC__ - // metrowerks seems to require this header in front of functions - Emit4( (int)(buf+2) ); - Emit4( 0 ); -#endif - - for ( instruction = 0 ; instruction < header->instructionCount ; instruction++ ) { - if ( compiledOfs*4 > maxLength - 16 ) { - Com_Error( ERR_DROP, "VM_Compile: maxLength exceeded" ); - } - - op = code[ pc ]; - if ( !pass ) { - vm->instructionPointers[ instruction ] = compiledOfs * 4; - } - pc++; - switch ( op ) { - case 0: - break; - case OP_BREAK: - #if DEBUG_VM - if(pass == 1) - printf("%08lx BREAK\n",instruction); - #endif - InstImmU( "addi", PPC_ADDI, R_TOP, 0, 0 ); - InstImm( "lwz", PPC_LWZ, R_TOP, R_TOP, 0 ); // *(int *)0 to crash to debugger - break; - case OP_ENTER: - opStackDepth = 0; - v = Constant4(); - #if DEBUG_VM - if(pass == 1) - printf("%08x ENTER\t%04x\n",instruction,v); - #endif - opStackRegType[opStackDepth] = 0; - mainFunction++; - if(mainFunction == 1) - { - // Main VM entry point is the first thing we compile, so save off operand stack - // registers here. This avoids issues with trying to trick the native compiler - // into doing it, and properly matches the PowerPC ABI - InstImm( "addi", PPC_ADDI, R_REAL_STACK, R_REAL_STACK, -OP_STACK_MAX_DEPTH*4 ); // sub R_STACK, R_STACK, imm - for(i = 0; i < OP_STACK_MAX_DEPTH; i++) - InstImm( "stw", PPC_STW, opStackIntRegisters[i], R_REAL_STACK, i*4); - } - InstImm( "addi", PPC_ADDI, R_STACK, R_STACK, -v ); // sub R_STACK, R_STACK, imm - break; - case OP_CONST: - v = Constant4(); - #if DEBUG_VM - if(pass == 1) - printf("%08x CONST\t%08x\n",instruction,v); - #endif - opStackLoadInstructionAddr[opStackDepth] = 0; - if ( v < 32768 && v >= -32768 ) { - InstImmU( "addi", PPC_ADDI, opStackIntRegisters[opStackDepth], 0, v & 0xffff ); - } else { - InstImmU( "addis", PPC_ADDIS, opStackIntRegisters[opStackDepth], 0, (v >> 16)&0xffff ); - if ( v & 0xffff ) { - InstImmU( "ori", PPC_ORI, opStackIntRegisters[opStackDepth], opStackIntRegisters[opStackDepth], v & 0xffff ); - } - } - opStackRegType[opStackDepth] = 1; - opStackDepth += 1; - if (code[pc] == OP_JUMP) { - jused[v] = 1; - } - break; - case OP_LOCAL: - oc1 = Constant4(); - #if DEBUG_VM - if(pass == 1) - printf("%08x LOCAL\t%08x\n",instruction,oc1); - #endif - if (code[pc] == OP_LOAD4 || code[pc] == OP_LOAD2 || code[pc] == OP_LOAD1) { - oc1 &= vm->dataMask; - } - InstImm( "addi", PPC_ADDI, opStackIntRegisters[opStackDepth], R_STACK, oc1 ); - opStackRegType[opStackDepth] = 1; - opStackLoadInstructionAddr[opStackDepth] = 0; - opStackDepth += 1; - break; - case OP_ARG: - v = Constant1(); - #if DEBUG_VM - if(pass == 1) - printf("%08x ARG \t%08x\n",instruction,v); - #endif - InstImm( "addi", PPC_ADDI, R_EA, R_STACK, v ); // location to put it - if(opStackRegType[opStackDepth-1] == 1) - Inst( "stwx", PPC_STWX, opStackIntRegisters[opStackDepth-1], R_EA, R_MEMBASE ); - else - Inst( "stfsx", PPC_STFSX, opStackFloatRegisters[opStackDepth-1], R_EA, R_MEMBASE ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - - break; - case OP_CALL: - #if DEBUG_VM - if(pass == 1) - printf("%08x CALL\n",instruction); - #endif - assertInteger(opStackDepth-1); - assert(opStackDepth > 0); - Inst( "mflr", PPC_MFSPR, R_SECOND, 8, 0 ); // move from link register - InstImm( "stwu", PPC_STWU, R_SECOND, R_REAL_STACK, -16 ); // save off the old return address - - // Spill operand stack registers. - spillOpStack(opStackDepth); - - // We need to leave R_OPSTACK pointing to the top entry on the stack, which is the call address. - // It will be consumed (and R4 decremented) by the AsmCall code. - InstImm( "addi", PPC_ADDI, R_OPSTACK, R_OPSTACK, opStackDepth*4); - - Inst( "mtctr", PPC_MTSPR, R_ASMCALL, 9, 0 ); // move to count register - Inst( "bctrl", PPC_BCCTR | 1, 20, 0, 0 ); // jump and link to the count register - - // R4 now points to the top of the operand stack, which has the return value in it. We want to - // back off the pointer to point to the base of our local operand stack and then reload the stack. - - InstImm("addi", PPC_ADDI, R_OPSTACK, R_OPSTACK, -opStackDepth*4); - - // Reload operand stack. - loadOpStack(opStackDepth); - - InstImm( "lwz", PPC_LWZ, R_SECOND, R_REAL_STACK, 0 ); // fetch the old return address - InstImm( "addi", PPC_ADDI, R_REAL_STACK, R_REAL_STACK, 16 ); - Inst( "mtlr", PPC_MTSPR, R_SECOND, 8, 0 ); // move to link register - break; - case OP_PUSH: - #if DEBUG_VM - if(pass == 1) - printf("%08x PUSH\n",instruction); - #endif - opStackRegType[opStackDepth] = 1; // Garbage int value. - opStackDepth += 1; - break; - case OP_POP: - #if DEBUG_VM - if(pass == 1) - printf("%08x POP\n",instruction); - #endif - opStackDepth -= 1; - opStackRegType[opStackDepth] = 0; // ?? - opStackLoadInstructionAddr[opStackDepth-1] = 0; - break; - case OP_LEAVE: - #if DEBUG_VM - if(pass == 1) - printf("%08x LEAVE\n",instruction); - #endif - assert(opStackDepth == 1); - assert(opStackRegType[0] != 0); - // Save return value onto top of op stack. We also have to increment R_OPSTACK - switch(opStackRegType[0]) - { - case 1: // Integer register - InstImm( "stw", PPC_STWU, opStackIntRegisters[0], R_OPSTACK, 4); - break; - case 2: // Float register - InstImm( "stfs", PPC_STFSU, opStackFloatRegisters[0], R_OPSTACK, 4); - break; - } - InstImm( "addi", PPC_ADDI, R_STACK, R_STACK, Constant4() ); // add R_STACK, R_STACK, imm - if(mainFunction == 1) - { - for(i = 0; i < OP_STACK_MAX_DEPTH; i++) - InstImm( "lwz", PPC_LWZ, opStackIntRegisters[i], R_REAL_STACK, i*4); - InstImm( "addi", PPC_ADDI, R_REAL_STACK, R_REAL_STACK, OP_STACK_MAX_DEPTH*4 ); - } - opStackDepth--; - opStackRegType[opStackDepth] = 0; - opStackLoadInstructionAddr[opStackDepth] = 0; - Inst( "blr", PPC_BCLR, 20, 0, 0 ); // branch unconditionally to link register - break; - case OP_LOAD4: - #if DEBUG_VM - if(pass == 1) - printf("%08x LOAD4\n",instruction); - #endif - // We should try to figure out whether to use LWZX or LFSX based - // on some kind of code analysis after subsequent passes. I think what - // we could do is store the compiled load instruction address along with - // the register type. When we hit the first mismatched operator, we go back - // and patch the load. Since LCC's operand stack should be at 0 depth by the - // time we hit a branch, this should work fairly well. FIXME FIXME FIXME. - assertInteger(opStackDepth-1); - opStackLoadInstructionAddr[opStackDepth-1] = &buf[ compiledOfs ]; - Inst( "lwzx", PPC_LWZX, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], R_MEMBASE );// load from memory base - opStackRegType[opStackDepth-1] = 1; - break; - case OP_LOAD2: - #if DEBUG_VM - if(pass == 1) - printf("%08x LOAD2\n",instruction); - #endif - assertInteger(opStackDepth-1); - opStackLoadInstructionAddr[opStackDepth-1] = 0; - Inst( "lhzx", PPC_LHZX, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], R_MEMBASE );// load from memory base - opStackRegType[opStackDepth-1] = 1; - break; - case OP_LOAD1: - #if DEBUG_VM - if(pass == 1) - printf("%08x LOAD1\n",instruction); - #endif - assertInteger(opStackDepth-1); - opStackLoadInstructionAddr[opStackDepth-1] = 0; - Inst( "lbzx", PPC_LBZX, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], R_MEMBASE );// load from memory base - opStackRegType[opStackDepth-1] = 1; - break; - case OP_STORE4: - #if DEBUG_VM - if(pass == 1) - printf("%08x STORE4\n",instruction); - #endif - assertInteger(opStackDepth-2); - if(opStackRegType[opStackDepth-1] == 1) - Inst( "stwx", PPC_STWX, opStackIntRegisters[opStackDepth-1], - opStackIntRegisters[opStackDepth-2], R_MEMBASE ); // store from memory base - else - Inst( "stfsx", PPC_STFSX, opStackFloatRegisters[opStackDepth-1], - opStackIntRegisters[opStackDepth-2], R_MEMBASE ); // store from memory base - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - break; - case OP_STORE2: - #if DEBUG_VM - if(pass == 1) - printf("%08x STORE2\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "sthx", PPC_STHX, opStackIntRegisters[opStackDepth-1], - opStackIntRegisters[opStackDepth-2], R_MEMBASE ); // store from memory base - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - break; - case OP_STORE1: - #if DEBUG_VM - if(pass == 1) - printf("%08x STORE1\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "stbx", PPC_STBX, opStackIntRegisters[opStackDepth-1], - opStackIntRegisters[opStackDepth-2], R_MEMBASE ); // store from memory base - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - break; - - case OP_EQ: - #if DEBUG_VM - if(pass == 1) - printf("%08x EQ\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 4, 2, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (v&0x3ffffff) ); - break; - case OP_NE: - #if DEBUG_VM - if(pass == 1) - printf("%08x NE\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 12, 2, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 4, 2, v ); - - break; - case OP_LTI: - #if DEBUG_VM - if(pass == 1) - printf("%08x LTI\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 4, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 12, 0, v ); - break; - case OP_LEI: - #if DEBUG_VM - if(pass == 1) - printf("%08x LEI\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 12, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 4, 1, v ); - break; - case OP_GTI: - #if DEBUG_VM - if(pass == 1) - printf("%08x GTI\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 4, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 12, 1, v ); - break; - case OP_GEI: - #if DEBUG_VM - if(pass == 1) - printf("%08x GEI\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 12, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 4, 0, v ); - break; - case OP_LTU: - #if DEBUG_VM - if(pass == 1) - printf("%08x LTU\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 4, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 12, 0, v ); - break; - case OP_LEU: - #if DEBUG_VM - if(pass == 1) - printf("%08x LEU\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 12, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 4, 1, v ); - break; - case OP_GTU: - #if DEBUG_VM - if(pass == 1) - printf("%08x GTU\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 4, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 12, 1, v ); - break; - case OP_GEU: - #if DEBUG_VM - if(pass == 1) - printf("%08x GEU\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 12, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 4, 0, v ); - break; - - case OP_EQF: - #if DEBUG_VM - if(pass == 1) - printf("%08x EQF\n",instruction); - #endif - makeFloat(opStackDepth-1); - makeFloat(opStackDepth-2); - Inst( "fcmpu", PPC_FCMPU, 0, opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 4, 2, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 12, 2, v ); - break; - case OP_NEF: - #if DEBUG_VM - if(pass == 1) - printf("%08x NEF\n",instruction); - #endif - makeFloat(opStackDepth-1); - makeFloat(opStackDepth-2); - Inst( "fcmpu", PPC_FCMPU, 0, opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 12, 2, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 4, 2, v ); - break; - case OP_LTF: - #if DEBUG_VM - if(pass == 1) - printf("%08x LTF\n",instruction); - #endif - makeFloat(opStackDepth-1); - makeFloat(opStackDepth-2); - Inst( "fcmpu", PPC_FCMPU, 0, opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 4, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 12, 0, v ); - break; - case OP_LEF: - #if DEBUG_VM - if(pass == 1) - printf("%08x LEF\n",instruction); - #endif - makeFloat(opStackDepth-1); - makeFloat(opStackDepth-2); - Inst( "fcmpu", PPC_FCMPU, 0, opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 12, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 4, 1, v ); - break; - case OP_GTF: - #if DEBUG_VM - if(pass == 1) - printf("%08x GTF\n",instruction); - #endif - makeFloat(opStackDepth-1); - makeFloat(opStackDepth-2); - Inst( "fcmpu", PPC_FCMPU, 0, opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 4, 1, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 12, 1, v ); - break; - case OP_GEF: - #if DEBUG_VM - if(pass == 1) - printf("%08x GEF\n",instruction); - #endif - makeFloat(opStackDepth-1); - makeFloat(opStackDepth-2); - Inst( "fcmpu", PPC_FCMPU, 0, opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - i = Constant4(); - jused[i] = 1; - InstImm( "bc", PPC_BC, 12, 0, 8 ); - if ( pass==1 ) { - v = vm->instructionPointers[ i ] - (int)&buf[compiledOfs]; - } else { - v = 0; - } - Emit4("b", PPC_B | (unsigned int)(v&0x3ffffff) ); -// InstImm( "bc", PPC_BC, 4, 0, v ); - break; - - case OP_NEGI: - #if DEBUG_VM - if(pass == 1) - printf("%08x NEGI\n",instruction); - #endif - assertInteger(opStackDepth-1); - InstImm( "subfic", PPC_SUBFIC, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], 0 ); - opStackLoadInstructionAddr[opStackDepth-1] = 0; - break; - case OP_ADD: - #if DEBUG_VM - if(pass == 1) - printf("%08x ADD\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "add", PPC_ADD, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-2] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_SUB: - #if DEBUG_VM - if(pass == 1) - printf("%08x SUB\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "subf", PPC_SUBF, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-2] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_DIVI: - #if DEBUG_VM - if(pass == 1) - printf("%08x DIVI\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "divw", PPC_DIVW, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_DIVU: - #if DEBUG_VM - if(pass == 1) - printf("%08x DIVU\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "divwu", PPC_DIVWU, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_MODI: - #if DEBUG_VM - if(pass == 1) - printf("%08x MODI\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "divw", PPC_DIVW, R_EA, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - Inst( "mullw", PPC_MULLW, R_EA, opStackIntRegisters[opStackDepth-1], R_EA ); - Inst( "subf", PPC_SUBF, opStackIntRegisters[opStackDepth-2], R_EA, opStackIntRegisters[opStackDepth-2] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_MODU: - #if DEBUG_VM - if(pass == 1) - printf("%08x MODU\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "divwu", PPC_DIVWU, R_EA, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - Inst( "mullw", PPC_MULLW, R_EA, opStackIntRegisters[opStackDepth-1], R_EA ); - Inst( "subf", PPC_SUBF, opStackIntRegisters[opStackDepth-2], R_EA, opStackIntRegisters[opStackDepth-2] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_MULI: - case OP_MULU: - #if DEBUG_VM - if(pass == 1) - printf("%08x MULI\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "mullw", PPC_MULLW, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-2] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_BAND: - #if DEBUG_VM - if(pass == 1) - printf("%08x BAND\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "and", PPC_AND, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_BOR: - #if DEBUG_VM - if(pass == 1) - printf("%08x BOR\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "or", PPC_OR, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_BXOR: - #if DEBUG_VM - if(pass == 1) - printf("%08x BXOR\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "xor", PPC_XOR, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_BCOM: - #if DEBUG_VM - if(pass == 1) - printf("%08x BCOM\n",instruction); - #endif - assertInteger(opStackDepth-1); - Inst( "nor", PPC_NOR, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1] ); - opStackLoadInstructionAddr[opStackDepth-1] = 0; - break; - case OP_LSH: - #if DEBUG_VM - if(pass == 1) - printf("%08x LSH\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "slw", PPC_SLW, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_RSHI: - #if DEBUG_VM - if(pass == 1) - printf("%08x RSHI\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "sraw", PPC_SRAW, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_RSHU: - #if DEBUG_VM - if(pass == 1) - printf("%08x RSHU\n",instruction); - #endif - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - Inst( "srw", PPC_SRW, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - - case OP_NEGF: - #if DEBUG_VM - if(pass == 1) - printf("%08x NEGF\n",instruction); - #endif - makeFloat(opStackDepth-1); - Inst( "fneg", PPC_FNEG, opStackFloatRegisters[opStackDepth-1], 0, opStackFloatRegisters[opStackDepth-1] ); - opStackLoadInstructionAddr[opStackDepth-1] = 0; - break; - case OP_ADDF: - #if DEBUG_VM - if(pass == 1) - printf("%08x ADDF\n",instruction); - #endif - makeFloat(opStackDepth-1); - makeFloat(opStackDepth-2); - Inst( "fadds", PPC_FADDS, opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_SUBF: - #if DEBUG_VM - if(pass == 1) - printf("%08x SUBF\n",instruction); - #endif - makeFloat(opStackDepth-1); - makeFloat(opStackDepth-2); - Inst( "fsubs", PPC_FSUBS, opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_DIVF: - #if DEBUG_VM - if(pass == 1) - printf("%08x DIVF\n",instruction); - #endif - makeFloat(opStackDepth-1); - makeFloat(opStackDepth-2); - Inst( "fdivs", PPC_FDIVS, opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - case OP_MULF: - #if DEBUG_VM - if(pass == 1) - printf("%08x MULF\n",instruction); - #endif - makeFloat(opStackDepth-1); - makeFloat(opStackDepth-2); - Inst4( "fmuls", PPC_FMULS, opStackFloatRegisters[opStackDepth-2], opStackFloatRegisters[opStackDepth-2], 0, opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - - case OP_CVIF: - #if DEBUG_VM - if(pass == 1) - printf("%08x CVIF\n",instruction); - #endif - assertInteger(opStackDepth-1); - //makeInteger(opStackDepth-1); - v = (int)&itofConvert; - InstImmU( "addis", PPC_ADDIS, R_EA, 0, (v >> 16)&0xffff ); - InstImmU( "ori", PPC_ORI, R_EA, R_EA, v & 0xffff ); - InstImmU( "xoris", PPC_XORIS, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], 0x8000 ); - InstImm( "stw", PPC_STW, opStackIntRegisters[opStackDepth-1], R_EA, 12 ); - InstImm( "lfd", PPC_LFD, opStackFloatRegisters[opStackDepth-1], R_EA, 0 ); - Inst( "ori", PPC_ORI, 0, 0, 0); - Inst( "ori", PPC_ORI, 0, 0, 0); - Inst( "ori", PPC_ORI, 0, 0, 0); - InstImm( "lfd", PPC_LFD, 13, R_EA, 8 ); - Inst( "fsub", PPC_FSUB, opStackFloatRegisters[opStackDepth-1], 13, opStackFloatRegisters[opStackDepth-1] ); - opStackRegType[opStackDepth-1] = 2; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - // Inst( PPC_FRSP, R_TOP, 0, R_TOP ); - break; - case OP_CVFI: - #if DEBUG_VM - if(pass == 1) - printf("%08x CVFI\n",instruction); - #endif - makeFloat(opStackDepth-1); - - InstImm( "addi", PPC_ADDI, R_OPSTACK, R_OPSTACK, opStackDepth*4); - - Inst( "fctiwz", PPC_FCTIWZ, opStackFloatRegisters[opStackDepth-1], 0, opStackFloatRegisters[opStackDepth-1] ); - Inst( "stfiwx", PPC_STFIWX, opStackFloatRegisters[opStackDepth-1], 0, R_OPSTACK ); // save value to opstack (dummy area now) - Inst( "ori", PPC_ORI, 0, 0, 0); - Inst( "ori", PPC_ORI, 0, 0, 0); - Inst( "ori", PPC_ORI, 0, 0, 0); - Inst( "ori", PPC_ORI, 0, 0, 0); - InstImm( "lwz", PPC_LWZ, opStackIntRegisters[opStackDepth-1], R_OPSTACK, 0 ); - - InstImm( "addi", PPC_ADDI, R_OPSTACK, R_OPSTACK, -opStackDepth*4); - - opStackRegType[opStackDepth-1] = 1; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - break; - case OP_SEX8: - #if DEBUG_VM - if(pass == 1) - printf("%08x SEX8\n",instruction); - #endif - assertInteger(opStackDepth-1); - Inst( "extsb", PPC_EXTSB, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], 0 ); - opStackLoadInstructionAddr[opStackDepth-1] = 0; - break; - case OP_SEX16: - #if DEBUG_VM - if(pass == 1) - printf("%08x SEX16\n",instruction); - #endif - assertInteger(opStackDepth-1); - Inst( "extsh", PPC_EXTSH, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], 0 ); - opStackLoadInstructionAddr[opStackDepth-1] = 0; - break; - - case OP_BLOCK_COPY: - v = Constant4() >> 2; - #if DEBUG_VM - if(pass == 1) - printf("%08x BLOCK_COPY\t%08lx\n",instruction,v<<2); - #endif - assert(opStackDepth >= 2); - assertInteger(opStackDepth-1); - assertInteger(opStackDepth-2); - InstImmU( "addi", PPC_ADDI, R_EA, 0, v ); // count - // FIXME: range check - Inst( "mtctr", PPC_MTSPR, R_EA, 9, 0 ); // move to count register - - Inst( "add", PPC_ADD, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], R_MEMBASE ); - InstImm( "addi", PPC_ADDI, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], -4 ); - Inst( "add", PPC_ADD, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-2], R_MEMBASE ); - InstImm( "addi", PPC_ADDI, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-2], -4 ); - - InstImm( "lwzu", PPC_LWZU, R_EA, opStackIntRegisters[opStackDepth-1], 4 ); // source - InstImm( "stwu", PPC_STWU, R_EA, opStackIntRegisters[opStackDepth-2], 4 ); // dest - Inst( "b", PPC_BC | 0xfff8 , 16, 0, 0 ); // loop - opStackRegType[opStackDepth-1] = 0; - opStackRegType[opStackDepth-2] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-2] = 0; - opStackDepth -= 2; - break; - - case OP_JUMP: - #if DEBUG_VM - if(pass == 1) - printf("%08x JUMP\n",instruction); - #endif - assert(opStackDepth == 1); - assertInteger(opStackDepth-1); - - Inst( "rlwinm", PPC_RLWINM | ( 29 << 1 ), opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], 2 ); - // FIXME: range check - Inst( "lwzx", PPC_LWZX, opStackIntRegisters[opStackDepth-1], opStackIntRegisters[opStackDepth-1], R_INSTRUCTIONS ); - Inst( "mtctr", PPC_MTSPR, opStackIntRegisters[opStackDepth-1], 9, 0 ); // move to count register - Inst( "bctr", PPC_BCCTR, 20, 0, 0 ); // jump to the count register - opStackRegType[opStackDepth-1] = 0; - opStackLoadInstructionAddr[opStackDepth-1] = 0; - opStackDepth -= 1; - break; - default: - Com_Error( ERR_DROP, "VM_CompilePPC: bad opcode %i at instruction %i, offset %i", op, instruction, pc ); - } - pop0 = pop1; - pop1 = op; - assert(opStackDepth >= 0); - assert(opStackDepth < OP_STACK_MAX_DEPTH); - - //printf("%4d\t%s\n",opStackDepth,opnames[op]); - } - - Com_Printf( "VM file %s pass %d compiled to %i bytes of code\n", vm->name, (pass+1), compiledOfs*4 ); - - if ( pass == 0 ) { - // copy to an exact size buffer on the hunk - vm->codeLength = compiledOfs * 4; - vm->codeBase = Hunk_Alloc( vm->codeLength, h_low ); - Com_Memcpy( vm->codeBase, buf, vm->codeLength ); - - //printf("codeBase: %p\n",vm->codeBase); - - Z_Free( buf ); - - // offset all the instruction pointers for the new location - for ( i = 0 ; i < header->instructionCount ; i++ ) { - vm->instructionPointers[i] += (int)vm->codeBase; - //printf("%08x %08lx\n",i,vm->instructionPointers[i]); - } - - // go back over it in place now to fixup reletive jump targets - buf = (unsigned *)vm->codeBase; - } - } - if(0) - { - char buf[256]; - printf("wait..\n"); - gets(buf); - } - Z_Free( jused ); -} - -/* -============== -VM_CallCompiled - -This function is called directly by the generated code -============== -*/ -int VM_CallCompiled( vm_t *vm, int *args ) { - int stack[1024]; - int programStack; - int stackOnEntry; - byte *image; - - currentVM = vm; - - //printf("VM_CallCompiled: %p %08lx %08lx %08lx\n", - // vm, args[0],args[1],args[2]); - - // interpret the code - vm->currentlyInterpreting = qtrue; - - // we might be called recursively, so this might not be the very top - programStack = vm->programStack; - stackOnEntry = programStack; - image = vm->dataBase; - - // set up the stack frame - programStack -= 48; - - *(int *)&image[ programStack + 44] = args[9]; - *(int *)&image[ programStack + 40] = args[8]; - *(int *)&image[ programStack + 36] = args[7]; - *(int *)&image[ programStack + 32] = args[6]; - *(int *)&image[ programStack + 28] = args[5]; - *(int *)&image[ programStack + 24] = args[4]; - *(int *)&image[ programStack + 20] = args[3]; - *(int *)&image[ programStack + 16] = args[2]; - *(int *)&image[ programStack + 12] = args[1]; - *(int *)&image[ programStack + 8 ] = args[0]; - *(int *)&image[ programStack + 4 ] = 0; // return stack - *(int *)&image[ programStack ] = -1; // will terminate the loop on return - - // Cheesy... manually save registers used by VM call... - // off we go into generated code... - // the PPC calling standard says the parms will all go into R3 - R11, so - // no special asm code is needed here -#ifdef __GNUC__ - ((void(*)(int, int, int, int, int, int, int, int))(vm->codeBase))( - programStack, (int)&stack, - (int)image, vm->dataMask, (int)&AsmCall, - (int)vm->instructionPointers, vm->instructionPointersLength, - (int)vm ); -#else - ((void(*)(int, int, int, int, int, int, int, int))(vm->codeBase))( - programStack, (int)&stack, - (int)image, vm->dataMask, *(int *)&AsmCall /* skip function pointer header */, - (int)vm->instructionPointers, vm->instructionPointersLength, - (int)vm ); -#endif - vm->programStack = stackOnEntry; - - vm->currentlyInterpreting = qfalse; - - return stack[1]; -} - - -/* -================== -AsmCall - -Put this at end of file because gcc messes up debug line numbers -================== -*/ -#ifdef __GNUC__ - -void AsmCall( void ) { -asm ( - // pop off the destination instruction -" lwz r12,0(r4) \n" // RG_TOP, 0(RG_OPSTACK) -" addi r4,r4,-4 \n" // RG_OPSTACK, RG_OPSTACK, -4 \n" - - // see if it is a system trap -" cmpwi r12,0 \n" // RG_TOP, 0 \n" -" bc 12,0, systemTrap \n" - - // calling another VM function, so lookup in instructionPointers -" slwi r12,r12,2 \n" // RG_TOP,RG_TOP,2 - // FIXME: range check -" lwzx r12, r8, r12 \n" // RG_TOP, RG_INSTRUCTIONS(RG_TOP) -" mtctr r12 \n" // RG_TOP -); - -#if defined(MACOS_X) && defined(__OPTIMIZE__) - // On Mac OS X, gcc doesn't push a frame when we are optimized, so trying to tear it down results in grave disorder. -#warning Mac OS X optimization on, not popping GCC AsmCall frame -#else - // Mac OS X Server and unoptimized compiles include a GCC AsmCall frame - asm ( -" lwz r1,0(r1) \n" // pop off the GCC AsmCall frame -" lmw r30,-8(r1) \n" -); -#endif - -asm ( -" bcctr 20,0 \n" // when it hits a leave, it will branch to the current link register - - // calling a system trap -"systemTrap: \n" - // convert to positive system call number -" subfic r12,r12,-1 \n" - - // save all our registers, including the current link register -" mflr r13 \n" // RG_SECOND // copy off our link register -" addi r1,r1,-92 \n" // required 24 byets of linkage, 32 bytes of parameter, plus our saves -" stw r3,56(r1) \n" // RG_STACK, -36(REAL_STACK) -" stw r4,60(r1) \n" // RG_OPSTACK, 4(RG_REAL_STACK) -" stw r5,64(r1) \n" // RG_MEMBASE, 8(RG_REAL_STACK) -" stw r6,68(r1) \n" // RG_MEMMASK, 12(RG_REAL_STACK) -" stw r7,72(r1) \n" // RG_ASMCALL, 16(RG_REAL_STACK) -" stw r8,76(r1) \n" // RG_INSTRUCTIONS, 20(RG_REAL_STACK) -" stw r9,80(r1) \n" // RG_NUM_INSTRUCTIONS, 24(RG_REAL_STACK) -" stw r10,84(r1) \n" // RG_VM, 28(RG_REAL_STACK) -" stw r13,88(r1) \n" // RG_SECOND, 32(RG_REAL_STACK) // link register - - // save the vm stack position to allow recursive VM entry -" addi r13,r3,-4 \n" // RG_TOP, RG_STACK, -4 -" stw r13,0(r10) \n" //RG_TOP, VM_OFFSET_PROGRAM_STACK(RG_VM) - - // save the system call number as the 0th parameter -" add r3,r3,r5 \n" // r3, RG_STACK, RG_MEMBASE // r3 is the first parameter to vm->systemCalls -" stwu r12,4(r3) \n" // RG_TOP, 4(r3) - - // make the system call with the address of all the VM parms as a parameter - // vm->systemCalls( &parms ) -" lwz r12,4(r10) \n" // RG_TOP, VM_OFFSET_SYSTEM_CALL(RG_VM) -" mtctr r12 \n" // RG_TOP -" bcctrl 20,0 \n" -" mr r12,r3 \n" // RG_TOP, r3 - - // pop our saved registers -" lwz r3,56(r1) \n" // RG_STACK, 0(RG_REAL_STACK) -" lwz r4,60(r1) \n" // RG_OPSTACK, 4(RG_REAL_STACK) -" lwz r5,64(r1) \n" // RG_MEMBASE, 8(RG_REAL_STACK) -" lwz r6,68(r1) \n" // RG_MEMMASK, 12(RG_REAL_STACK) -" lwz r7,72(r1) \n" // RG_ASMCALL, 16(RG_REAL_STACK) -" lwz r8,76(r1) \n" // RG_INSTRUCTIONS, 20(RG_REAL_STACK) -" lwz r9,80(r1) \n" // RG_NUM_INSTRUCTIONS, 24(RG_REAL_STACK) -" lwz r10,84(r1) \n" // RG_VM, 28(RG_REAL_STACK) -" lwz r13,88(r1) \n" // RG_SECOND, 32(RG_REAL_STACK) -" addi r1,r1,92 \n" // RG_REAL_STACK, RG_REAL_STACK, 36 - - // restore the old link register -" mtlr r13 \n" // RG_SECOND - - // save off the return value -" stwu r12,4(r4) \n" // RG_TOP, 0(RG_OPSTACK) - - // GCC adds its own prolog / epliog code - ); -} -#else - -// codewarrior version - -void asm AsmCall( void ) { - - // pop off the destination instruction - - lwz r12,0(r4) // RG_TOP, 0(RG_OPSTACK) - - addi r4,r4,-4 // RG_OPSTACK, RG_OPSTACK, -4 - - - - // see if it is a system trap - - cmpwi r12,0 // RG_TOP, 0 - - bc 12,0, systemTrap - - - - // calling another VM function, so lookup in instructionPointers - - slwi r12,r12,2 // RG_TOP,RG_TOP,2 - - // FIXME: range check - - lwzx r12, r8, r12 // RG_TOP, RG_INSTRUCTIONS(RG_TOP) - - mtctr r12 // RG_TOP - - - - bcctr 20,0 // when it hits a leave, it will branch to the current link register - - - - // calling a system trap - -systemTrap: - - // convert to positive system call number - - subfic r12,r12,-1 - - - - // save all our registers, including the current link register - - mflr r13 // RG_SECOND // copy off our link register - - addi r1,r1,-92 // required 24 byets of linkage, 32 bytes of parameter, plus our saves - - stw r3,56(r1) // RG_STACK, -36(REAL_STACK) - - stw r4,60(r1) // RG_OPSTACK, 4(RG_REAL_STACK) - - stw r5,64(r1) // RG_MEMBASE, 8(RG_REAL_STACK) - - stw r6,68(r1) // RG_MEMMASK, 12(RG_REAL_STACK) - - stw r7,72(r1) // RG_ASMCALL, 16(RG_REAL_STACK) - - stw r8,76(r1) // RG_INSTRUCTIONS, 20(RG_REAL_STACK) - - stw r9,80(r1) // RG_NUM_INSTRUCTIONS, 24(RG_REAL_STACK) - - stw r10,84(r1) // RG_VM, 28(RG_REAL_STACK) - - stw r13,88(r1) // RG_SECOND, 32(RG_REAL_STACK) // link register - - - - // save the vm stack position to allow recursive VM entry - - addi r13,r3,-4 // RG_TOP, RG_STACK, -4 - - stw r13,0(r10) //RG_TOP, VM_OFFSET_PROGRAM_STACK(RG_VM) - - - - // save the system call number as the 0th parameter - - add r3,r3,r5 // r3, RG_STACK, RG_MEMBASE // r3 is the first parameter to vm->systemCalls - - stwu r12,4(r3) // RG_TOP, 4(r3) - - - - // make the system call with the address of all the VM parms as a parameter - - // vm->systemCalls( &parms ) - - lwz r12,4(r10) // RG_TOP, VM_OFFSET_SYSTEM_CALL(RG_VM) - - - - // perform macos cross fragment fixup crap - - lwz r9,0(r12) - - stw r2,52(r1) // save old TOC - - lwz r2,4(r12) - - - - mtctr r9 // RG_TOP - - bcctrl 20,0 - - - - lwz r2,52(r1) // restore TOC - - - - mr r12,r3 // RG_TOP, r3 - - - - // pop our saved registers - - lwz r3,56(r1) // RG_STACK, 0(RG_REAL_STACK) - - lwz r4,60(r1) // RG_OPSTACK, 4(RG_REAL_STACK) - - lwz r5,64(r1) // RG_MEMBASE, 8(RG_REAL_STACK) - - lwz r6,68(r1) // RG_MEMMASK, 12(RG_REAL_STACK) - - lwz r7,72(r1) // RG_ASMCALL, 16(RG_REAL_STACK) - - lwz r8,76(r1) // RG_INSTRUCTIONS, 20(RG_REAL_STACK) - - lwz r9,80(r1) // RG_NUM_INSTRUCTIONS, 24(RG_REAL_STACK) - - lwz r10,84(r1) // RG_VM, 28(RG_REAL_STACK) - - lwz r13,88(r1) // RG_SECOND, 32(RG_REAL_STACK) - - addi r1,r1,92 // RG_REAL_STACK, RG_REAL_STACK, 36 - - - - // restore the old link register - - mtlr r13 // RG_SECOND - - - - // save off the return value - - stwu r12,4(r4) // RG_TOP, 0(RG_OPSTACK) - - - - blr - -} - - - - -#endif diff --git a/code/qcommon/vm_x86.c b/code/qcommon/vm_x86.c index f9b0982..8c138be 100644 --- a/code/qcommon/vm_x86.c +++ b/code/qcommon/vm_x86.c @@ -31,6 +31,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include // for PROT_ stuff #endif +// +#ifdef _WIN32 +#include +#endif +// + /* eax scratch @@ -1082,6 +1088,15 @@ void VM_Compile( vm_t *vm, vmHeader_t *header ) { } #endif + // +#ifdef _WIN32 + { + DWORD oldProtect; + if (!VirtualProtect(vm->codeBase, compiledOfs, PAGE_EXECUTE_READWRITE, &oldProtect)) + Com_Error(ERR_FATAL, "VM_CompileX86: VirtualProtect failed"); + } +#endif + // } /* diff --git a/code/quake3.sln b/code/quake3.sln deleted file mode 100644 index 845e123..0000000 --- a/code/quake3.sln +++ /dev/null @@ -1,145 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Splines", "splines\Splines.vcproj", "{DBAF2C53-3858-455D-A1AE-3FC093515314}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "botlib", "botlib\botlib.vcproj", "{A410161F-AE9F-485D-A01F-5294891430A6}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgame", "cgame\cgame.vcproj", "{C878E295-CB82-4B40-8ECF-5CE5525466FA}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "game", "game\game.vcproj", "{F9EE10DA-2404-4154-B904-F93C936C040A}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "q3_ui", "q3_ui\q3_ui.vcproj", "{D454C4C7-7765-4149-ABAD-05FDEB9D94F8}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quake3", "quake3.vcproj", "{81CB51C4-B434-4E12-B69B-BAEE102F2852}" - ProjectSection(ProjectDependencies) = postProject - {A410161F-AE9F-485D-A01F-5294891430A6} = {A410161F-AE9F-485D-A01F-5294891430A6} - {DBAF2C53-3858-455D-A1AE-3FC093515314} = {DBAF2C53-3858-455D-A1AE-3FC093515314} - {AB424155-FBED-4D8D-B007-5B6CF93EA395} = {AB424155-FBED-4D8D-B007-5B6CF93EA395} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "renderer", "renderer\renderer.vcproj", "{AB424155-FBED-4D8D-B007-5B6CF93EA395}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ui", "ui\ui.vcproj", "{A8EAC38E-C7DA-42F8-811D-77FD092B9D19}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 8 - SccProjectUniqueName0 = splines\\Splines.vcproj - SccProjectName0 = \u0022$/MissionPack/code/Splines\u0022,\u0020WJNAAAAA - SccLocalPath0 = splines - SccProvider0 = MSSCCI:Perforce\u0020SCM - SccProjectUniqueName1 = botlib\\botlib.vcproj - SccProjectName1 = \u0022$/MissionPack/code/botlib\u0022,\u0020HBAAAAAA - SccLocalPath1 = botlib - SccProvider1 = MSSCCI:Perforce\u0020SCM - SccProjectUniqueName2 = cgame\\cgame.vcproj - SccProjectName2 = \u0022$/MissionPack/code/cgame\u0022,\u0020NPAAAAAA - SccLocalPath2 = cgame - SccProvider2 = MSSCCI:Perforce\u0020SCM - SccProjectUniqueName3 = game\\game.vcproj - SccProjectName3 = \u0022$/MissionPack/code/game\u0022,\u0020CYAAAAAA - SccLocalPath3 = game - SccProvider3 = MSSCCI:Perforce\u0020SCM - SccProjectUniqueName4 = q3_ui\\q3_ui.vcproj - SccProjectName4 = \u0022$/MissionPack/code/q3_ui\u0022,\u0020VFLAAAAA - SccLocalPath4 = q3_ui - SccProvider4 = MSSCCI:Perforce\u0020SCM - SccProjectUniqueName5 = quake3.vcproj - SccProjectName5 = \u0022$/MissionPack/code\u0022,\u0020CAAAAAAA - SccLocalPath5 = . - SccProvider5 = MSSCCI:Perforce\u0020SCM - SccProjectUniqueName6 = renderer\\renderer.vcproj - SccProjectName6 = \u0022$/MissionPack/code/renderer\u0022,\u0020EJBAAAAA - SccLocalPath6 = renderer - SccProvider6 = MSSCCI:Perforce\u0020SCM - SccProjectUniqueName7 = ui\\ui.vcproj - SccProjectName7 = \u0022$/MissionPack/code/ui\u0022,\u0020AOBAAAAA - SccLocalPath7 = ui - SccProvider7 = MSSCCI:Perforce\u0020SCM - EndGlobalSection - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Debug TA = Debug TA - Release = Release - Release TA = Release TA - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {DBAF2C53-3858-455D-A1AE-3FC093515314}.Debug.ActiveCfg = Debug|Win32 - {DBAF2C53-3858-455D-A1AE-3FC093515314}.Debug.Build.0 = Debug|Win32 - {DBAF2C53-3858-455D-A1AE-3FC093515314}.Debug TA.ActiveCfg = Debug|Win32 - {DBAF2C53-3858-455D-A1AE-3FC093515314}.Debug TA.Build.0 = Debug|Win32 - {DBAF2C53-3858-455D-A1AE-3FC093515314}.Release.ActiveCfg = Release|Win32 - {DBAF2C53-3858-455D-A1AE-3FC093515314}.Release.Build.0 = Release|Win32 - {DBAF2C53-3858-455D-A1AE-3FC093515314}.Release TA.ActiveCfg = Release|Win32 - {DBAF2C53-3858-455D-A1AE-3FC093515314}.Release TA.Build.0 = Release|Win32 - {A410161F-AE9F-485D-A01F-5294891430A6}.Debug.ActiveCfg = Debug|Win32 - {A410161F-AE9F-485D-A01F-5294891430A6}.Debug.Build.0 = Debug|Win32 - {A410161F-AE9F-485D-A01F-5294891430A6}.Debug TA.ActiveCfg = Debug TA|Win32 - {A410161F-AE9F-485D-A01F-5294891430A6}.Debug TA.Build.0 = Debug TA|Win32 - {A410161F-AE9F-485D-A01F-5294891430A6}.Release.ActiveCfg = Release|Win32 - {A410161F-AE9F-485D-A01F-5294891430A6}.Release.Build.0 = Release|Win32 - {A410161F-AE9F-485D-A01F-5294891430A6}.Release TA.ActiveCfg = Release TA|Win32 - {A410161F-AE9F-485D-A01F-5294891430A6}.Release TA.Build.0 = Release TA|Win32 - {C878E295-CB82-4B40-8ECF-5CE5525466FA}.Debug.ActiveCfg = Debug|Win32 - {C878E295-CB82-4B40-8ECF-5CE5525466FA}.Debug.Build.0 = Debug|Win32 - {C878E295-CB82-4B40-8ECF-5CE5525466FA}.Debug TA.ActiveCfg = Debug TA|Win32 - {C878E295-CB82-4B40-8ECF-5CE5525466FA}.Debug TA.Build.0 = Debug TA|Win32 - {C878E295-CB82-4B40-8ECF-5CE5525466FA}.Release.ActiveCfg = Release|Win32 - {C878E295-CB82-4B40-8ECF-5CE5525466FA}.Release.Build.0 = Release|Win32 - {C878E295-CB82-4B40-8ECF-5CE5525466FA}.Release TA.ActiveCfg = Release TA|Win32 - {C878E295-CB82-4B40-8ECF-5CE5525466FA}.Release TA.Build.0 = Release TA|Win32 - {F9EE10DA-2404-4154-B904-F93C936C040A}.Debug.ActiveCfg = Debug|Win32 - {F9EE10DA-2404-4154-B904-F93C936C040A}.Debug.Build.0 = Debug|Win32 - {F9EE10DA-2404-4154-B904-F93C936C040A}.Debug TA.ActiveCfg = Debug TA|Win32 - {F9EE10DA-2404-4154-B904-F93C936C040A}.Debug TA.Build.0 = Debug TA|Win32 - {F9EE10DA-2404-4154-B904-F93C936C040A}.Release.ActiveCfg = Release|Win32 - {F9EE10DA-2404-4154-B904-F93C936C040A}.Release.Build.0 = Release|Win32 - {F9EE10DA-2404-4154-B904-F93C936C040A}.Release TA.ActiveCfg = Release TA|Win32 - {F9EE10DA-2404-4154-B904-F93C936C040A}.Release TA.Build.0 = Release TA|Win32 - {D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Debug.ActiveCfg = Debug|Win32 - {D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Debug.Build.0 = Debug|Win32 - {D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Debug TA.ActiveCfg = Debug TA|Win32 - {D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Release.ActiveCfg = Release|Win32 - {D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Release.Build.0 = Release|Win32 - {D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Release TA.ActiveCfg = Release TA|Win32 - {81CB51C4-B434-4E12-B69B-BAEE102F2852}.Debug.ActiveCfg = Debug|Win32 - {81CB51C4-B434-4E12-B69B-BAEE102F2852}.Debug.Build.0 = Debug|Win32 - {81CB51C4-B434-4E12-B69B-BAEE102F2852}.Debug TA.ActiveCfg = Debug TA|Win32 - {81CB51C4-B434-4E12-B69B-BAEE102F2852}.Debug TA.Build.0 = Debug TA|Win32 - {81CB51C4-B434-4E12-B69B-BAEE102F2852}.Release.ActiveCfg = Release|Win32 - {81CB51C4-B434-4E12-B69B-BAEE102F2852}.Release.Build.0 = Release|Win32 - {81CB51C4-B434-4E12-B69B-BAEE102F2852}.Release TA.ActiveCfg = Release TA|Win32 - {81CB51C4-B434-4E12-B69B-BAEE102F2852}.Release TA.Build.0 = Release TA|Win32 - {AB424155-FBED-4D8D-B007-5B6CF93EA395}.Debug.ActiveCfg = Debug|Win32 - {AB424155-FBED-4D8D-B007-5B6CF93EA395}.Debug.Build.0 = Debug|Win32 - {AB424155-FBED-4D8D-B007-5B6CF93EA395}.Debug TA.ActiveCfg = Debug TA|Win32 - {AB424155-FBED-4D8D-B007-5B6CF93EA395}.Debug TA.Build.0 = Debug TA|Win32 - {AB424155-FBED-4D8D-B007-5B6CF93EA395}.Release.ActiveCfg = Release|Win32 - {AB424155-FBED-4D8D-B007-5B6CF93EA395}.Release.Build.0 = Release|Win32 - {AB424155-FBED-4D8D-B007-5B6CF93EA395}.Release TA.ActiveCfg = Release TA|Win32 - {AB424155-FBED-4D8D-B007-5B6CF93EA395}.Release TA.Build.0 = Release TA|Win32 - {A8EAC38E-C7DA-42F8-811D-77FD092B9D19}.Debug.ActiveCfg = Debug|Win32 - {A8EAC38E-C7DA-42F8-811D-77FD092B9D19}.Debug TA.ActiveCfg = Debug TA|Win32 - {A8EAC38E-C7DA-42F8-811D-77FD092B9D19}.Debug TA.Build.0 = Debug TA|Win32 - {A8EAC38E-C7DA-42F8-811D-77FD092B9D19}.Release.ActiveCfg = Release|Win32 - {A8EAC38E-C7DA-42F8-811D-77FD092B9D19}.Release TA.ActiveCfg = Release TA|Win32 - {A8EAC38E-C7DA-42F8-811D-77FD092B9D19}.Release TA.Build.0 = Release TA|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/code/quake3.vcproj b/code/quake3.vcproj deleted file mode 100644 index 959379f..0000000 --- a/code/quake3.vcproj +++ /dev/null @@ -1,3463 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/renderer.lnt b/code/renderer.lnt deleted file mode 100644 index bc65f9f..0000000 --- a/code/renderer.lnt +++ /dev/null @@ -1,27 +0,0 @@ -opts.lnt - -renderer\tr_bsp.c -renderer\tr_calc.c -renderer\tr_calc_c.c -renderer\tr_curve.c -renderer\tr_draw.c -renderer\tr_image.c -renderer\tr_init.c -renderer\tr_light.c -renderer\tr_main.c -renderer\tr_mesh.c -renderer\tr_misc.c -renderer\tr_model.c -renderer\tr_noise.c -renderer\tr_shade.c -renderer\tr_shader.c -renderer\tr_sky.c -renderer\tr_stripify.c -renderer\tr_subdivide.c -renderer\tr_surf.c -renderer\tr_world.c - -game\q_math.c -game\q_shared.c - -null\null_glimp.c diff --git a/code/renderer/qgl.h b/code/renderer/qgl.h index 3aa111a..bf648f6 100644 --- a/code/renderer/qgl.h +++ b/code/renderer/qgl.h @@ -514,9 +514,6 @@ extern int ( WINAPI * qwglGetPixelFormat)(HDC); extern BOOL ( WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *); extern BOOL ( WINAPI * qwglSwapBuffers)(HDC); -extern BOOL ( WINAPI * qwglGetDeviceGammaRamp3DFX)( HDC, LPVOID ); -extern BOOL ( WINAPI * qwglSetDeviceGammaRamp3DFX)( HDC, LPVOID ); - extern BOOL ( WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT); extern HGLRC ( WINAPI * qwglCreateContext)(HDC); extern HGLRC ( WINAPI * qwglCreateLayerContext)(HDC, int); diff --git a/code/renderer/ref_trin.def b/code/renderer/ref_trin.def deleted file mode 100644 index cfbb471..0000000 --- a/code/renderer/ref_trin.def +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS - GetRefAPI diff --git a/code/renderer/renderer.vcproj b/code/renderer/renderer.vcproj deleted file mode 100644 index 848f39b..0000000 --- a/code/renderer/renderer.vcproj +++ /dev/null @@ -1,6112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/renderer/tr_bsp.c b/code/renderer/tr_bsp.c index 1f5db42..33e6cfb 100644 --- a/code/renderer/tr_bsp.c +++ b/code/renderer/tr_bsp.c @@ -158,7 +158,7 @@ static void R_LoadLightmaps( lump_t *l ) { } // if we are in r_vertexLight mode, we don't need the lightmaps at all - if ( r_vertexLight->integer || glConfig.hardwareType == GLHW_PERMEDIA2 ) { + if ( r_vertexLight->integer ) { return; } @@ -277,7 +277,7 @@ static shader_t *ShaderForShaderNum( int shaderNum, int lightmapNum ) { } dsh = &s_worldData.shaders[ shaderNum ]; - if ( r_vertexLight->integer || glConfig.hardwareType == GLHW_PERMEDIA2 ) { + if ( r_vertexLight->integer ) { lightmapNum = LIGHTMAP_BY_VERTEX; } diff --git a/code/renderer/tr_image.c b/code/renderer/tr_image.c index edebb4b..27fdd3a 100644 --- a/code/renderer/tr_image.c +++ b/code/renderer/tr_image.c @@ -110,14 +110,6 @@ void GL_TextureMode( const char *string ) { } } - // hack to prevent trilinear from being set on voodoo, - // because their driver freaks... - if ( i == 5 && glConfig.hardwareType == GLHW_3DFX_2D3D ) { - ri.Printf( PRINT_ALL, "Refusing to set trilinear on a voodoo.\n" ); - i = 3; - } - - if ( i == 6 ) { ri.Printf (PRINT_ALL, "bad filter name\n"); return; diff --git a/code/renderer/tr_init.c b/code/renderer/tr_init.c index d7e8db5..b7a969a 100644 --- a/code/renderer/tr_init.c +++ b/code/renderer/tr_init.c @@ -776,15 +776,7 @@ void GfxInfo_f( void ) ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize ); ri.Printf( PRINT_ALL, "GL_MAX_ACTIVE_TEXTURES_ARB: %d\n", glConfig.maxActiveTextures ); ri.Printf( PRINT_ALL, "\nPIXELFORMAT: color(%d-bits) Z(%d-bit) stencil(%d-bits)\n", glConfig.colorBits, glConfig.depthBits, glConfig.stencilBits ); - ri.Printf( PRINT_ALL, "MODE: %d, %d x %d %s hz:", r_mode->integer, glConfig.vidWidth, glConfig.vidHeight, fsstrings[r_fullscreen->integer == 1] ); - if ( glConfig.displayFrequency ) - { - ri.Printf( PRINT_ALL, "%d\n", glConfig.displayFrequency ); - } - else - { - ri.Printf( PRINT_ALL, "N/A\n" ); - } + ri.Printf( PRINT_ALL, "MODE: %d, %d x %d %s", r_mode->integer, glConfig.vidWidth, glConfig.vidHeight, fsstrings[r_fullscreen->integer == 1] ); if ( glConfig.deviceSupportsGamma ) { ri.Printf( PRINT_ALL, "GAMMA: hardware w/ %d overbright bits\n", tr.overbrightBits ); @@ -827,18 +819,10 @@ void GfxInfo_f( void ) ri.Printf( PRINT_ALL, "compiled vertex arrays: %s\n", enablestrings[qglLockArraysEXT != 0 ] ); ri.Printf( PRINT_ALL, "texenv add: %s\n", enablestrings[glConfig.textureEnvAddAvailable != 0] ); ri.Printf( PRINT_ALL, "compressed textures: %s\n", enablestrings[glConfig.textureCompression!=TC_NONE] ); - if ( r_vertexLight->integer || glConfig.hardwareType == GLHW_PERMEDIA2 ) + if ( r_vertexLight->integer ) { ri.Printf( PRINT_ALL, "HACK: using vertex lightmap approximation\n" ); } - if ( glConfig.hardwareType == GLHW_RAGEPRO ) - { - ri.Printf( PRINT_ALL, "HACK: ragePro approximations\n" ); - } - if ( glConfig.hardwareType == GLHW_RIVA128 ) - { - ri.Printf( PRINT_ALL, "HACK: riva128 approximations\n" ); - } if ( glConfig.smpActive ) { ri.Printf( PRINT_ALL, "Using dual processor acceleration\n" ); } diff --git a/code/renderer/tr_scene.c b/code/renderer/tr_scene.c index 8cde15b..a569cf6 100644 --- a/code/renderer/tr_scene.c +++ b/code/renderer/tr_scene.c @@ -151,12 +151,6 @@ void RE_AddPolyToScene( qhandle_t hShader, int numVerts, const polyVert_t *verts Com_Memcpy( poly->verts, &verts[numVerts*j], numVerts * sizeof( *verts ) ); - if ( glConfig.hardwareType == GLHW_RAGEPRO ) { - poly->verts->modulate[0] = 255; - poly->verts->modulate[1] = 255; - poly->verts->modulate[2] = 255; - poly->verts->modulate[3] = 255; - } // done. r_numpolys++; r_numpolyverts += numVerts; @@ -241,10 +235,6 @@ void RE_AddDynamicLightToScene( const vec3_t org, float intensity, float r, floa if ( intensity <= 0 ) { return; } - // these cards don't have the correct blend mode - if ( glConfig.hardwareType == GLHW_RIVA128 || glConfig.hardwareType == GLHW_PERMEDIA2 ) { - return; - } dl = &backEndData[tr.smpFrame]->dlights[r_numdlights++]; VectorCopy (org, dl->origin); dl->radius = intensity; @@ -360,9 +350,7 @@ void RE_RenderScene( const refdef_t *fd ) { // turn off dynamic lighting globally by clearing all the // dlights if it needs to be disabled or if vertex lighting is enabled - if ( r_dynamiclight->integer == 0 || - r_vertexLight->integer == 1 || - glConfig.hardwareType == GLHW_PERMEDIA2 ) { + if ( r_dynamiclight->integer == 0 || r_vertexLight->integer == 1 ) { tr.refdef.num_dlights = 0; } diff --git a/code/renderer/tr_shade.c b/code/renderer/tr_shade.c index e6f8688..0c1feed 100644 --- a/code/renderer/tr_shade.c +++ b/code/renderer/tr_shade.c @@ -982,7 +982,7 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input ) // // set state // - if ( pStage->bundle[0].vertexLightmap && ( (r_vertexLight->integer && !r_uiFullScreen->integer) || glConfig.hardwareType == GLHW_PERMEDIA2 ) && r_lightmap->integer ) + if ( pStage->bundle[0].vertexLightmap && ( r_vertexLight->integer && !r_uiFullScreen->integer ) && r_lightmap->integer ) { GL_Bind( tr.whiteImage ); } diff --git a/code/renderer/tr_shader.c b/code/renderer/tr_shader.c index b554f34..88cd682 100644 --- a/code/renderer/tr_shader.c +++ b/code/renderer/tr_shader.c @@ -1756,14 +1756,6 @@ static qboolean CollapseMultitexture( void ) { return qfalse; } - // on voodoo2, don't combine different tmus - if ( glConfig.driverType == GLDRV_VOODOO ) { - if ( stages[0].bundle[0].image[0]->TMU == - stages[1].bundle[0].image[0]->TMU ) { - return qfalse; - } - } - abits = stages[0].stateBits; bbits = stages[1].stateBits; @@ -2239,7 +2231,7 @@ static shader_t *FinishShader( void ) { // // if we are in r_vertexLight mode, never use a lightmap texture // - if ( stage > 1 && ( (r_vertexLight->integer && !r_uiFullScreen->integer) || glConfig.hardwareType == GLHW_PERMEDIA2 ) ) { + if ( stage > 1 && ( r_vertexLight->integer && !r_uiFullScreen->integer ) ) { VertexLightingCollapse(); stage = 1; hasLightmapStage = qfalse; diff --git a/code/server/sv_rankings.c b/code/server/sv_rankings.c deleted file mode 100644 index d21a799..0000000 --- a/code/server/sv_rankings.c +++ /dev/null @@ -1,1537 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// sv_rankings.c -- global rankings interface - -#include "server.h" -#include "..\rankings\1.0\gr\grapi.h" -#include "..\rankings\1.0\gr\grlog.h" - -typedef struct -{ - GR_CONTEXT context; - uint64_t game_id; - uint64_t match; - uint64_t player_id; - GR_PLAYER_TOKEN token; - grank_status_t grank_status; - grank_status_t final_status; // status to set after cleanup - uint32_t grank; // global rank - char name[32]; -} ranked_player_t; - -static int s_rankings_contexts = 0; -static qboolean s_rankings_active = qfalse; -static GR_CONTEXT s_server_context = 0; -static uint64_t s_server_match = 0; -static char* s_rankings_game_key = NULL; -static uint64_t s_rankings_game_id = 0; -static ranked_player_t* s_ranked_players = NULL; -static qboolean s_server_quitting = qfalse; -static const char s_ascii_encoding[] = - "0123456789abcdef" - "ghijklmnopqrstuv" - "wxyzABCDEFGHIJKL" - "MNOPQRSTUVWXYZ[]"; - -// private functions -static void SV_RankNewGameCBF( GR_NEWGAME* gr_newgame, void* cbf_arg ); -static void SV_RankUserCBF( GR_LOGIN* gr_login, void* cbf_arg ); -static void SV_RankJoinGameCBF( GR_JOINGAME* gr_joingame, void* cbf_arg ); -static void SV_RankSendReportsCBF( GR_STATUS* gr_status, void* cbf_arg ); -static void SV_RankCleanupCBF( GR_STATUS* gr_status, void* cbf_arg ); -static void SV_RankCloseContext( ranked_player_t* ranked_player ); -static int SV_RankAsciiEncode( char* dest, const unsigned char* src, - int src_len ); -static int SV_RankAsciiDecode( unsigned char* dest, const char* src, - int src_len ); -static void SV_RankEncodeGameID( uint64_t game_id, char* result, - int len ); -static uint64_t SV_RankDecodePlayerID( const char* string ); -static void SV_RankDecodePlayerKey( const char* string, GR_PLAYER_TOKEN key ); -static char* SV_RankStatusString( GR_STATUS status ); -static void SV_RankError( const char* fmt, ... ); -static char SV_RankGameKey[64]; - -/* -================ -SV_RankBegin -================ -*/ -void SV_RankBegin( char *gamekey ) -{ - GR_INIT init; - GR_STATUS status; - - assert( s_rankings_contexts == 0 ); - assert( !s_rankings_active ); - assert( s_ranked_players == NULL ); - - if( sv_enableRankings->integer == 0 || Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER ) - { - s_rankings_active = qfalse; - if( sv_rankingsActive->integer == 1 ) - { - Cvar_Set( "sv_rankingsActive", "0" ); - } - return; - } - - // only allow official game key on pure servers - if( strcmp(gamekey, GR_GAMEKEY) == 0 ) - { -/* - if( Cvar_VariableValue("sv_pure") != 1 ) - { - Cvar_Set( "sv_enableRankings", "0" ); - return; - } -*/ - - // substitute game-specific game key - switch( (int)Cvar_VariableValue("g_gametype") ) - { - case GT_FFA: - gamekey = "Q3 Free For All"; - break; - case GT_TOURNAMENT: - gamekey = "Q3 Tournament"; - break; - case GT_TEAM: - gamekey = "Q3 Team Deathmatch"; - break; - case GT_CTF: - gamekey = "Q3 Capture the Flag"; - break; - case GT_1FCTF: - gamekey = "Q3 One Flag CTF"; - break; - case GT_OBELISK: - gamekey = "Q3 Overload"; - break; - case GT_HARVESTER: - gamekey = "Q3 Harvester"; - break; - default: - break; - } - } - s_rankings_game_key = gamekey; - - // initialize rankings - GRankLogLevel( GRLOG_OFF ); - memset(SV_RankGameKey,0,sizeof(SV_RankGameKey)); - strncpy(SV_RankGameKey,gamekey,sizeof(SV_RankGameKey)-1); - init = GRankInit( 1, SV_RankGameKey, GR_OPT_POLL, GR_OPT_END ); - s_server_context = init.context; - s_rankings_contexts++; - Com_DPrintf( "SV_RankBegin(); GR_GAMEKEY is %s\n", gamekey ); - Com_DPrintf( "SV_RankBegin(); s_rankings_contexts=%d\n",s_rankings_contexts ); - Com_DPrintf( "SV_RankBegin(); s_server_context=%d\n",init.context ); - - // new game - if(!strlen(Cvar_VariableString( "sv_leagueName" ))) - { - status = GRankNewGameAsync - ( - s_server_context, - SV_RankNewGameCBF, - NULL, - GR_OPT_LEAGUENAME, - (void*)(Cvar_VariableString( "sv_leagueName" )), - GR_OPT_END - ); - } - else - { - status = GRankNewGameAsync - ( - s_server_context, - SV_RankNewGameCBF, - NULL, - GR_OPT_END - ); - } - - if( status != GR_STATUS_PENDING ) - { - SV_RankError( "SV_RankBegin: Expected GR_STATUS_PENDING, got %s", - SV_RankStatusString( status ) ); - return; - } - - // logging - if( com_developer->value ) - { - GRankLogLevel( GRLOG_TRACE ); - } - - // allocate rankings info for each player - s_ranked_players = Z_Malloc( sv_maxclients->value * - sizeof(ranked_player_t) ); - memset( (void*)s_ranked_players, 0 ,sv_maxclients->value - * sizeof(ranked_player_t)); -} - -/* -================ -SV_RankEnd -================ -*/ -void SV_RankEnd( void ) -{ - GR_STATUS status; - int i; - - Com_DPrintf( "SV_RankEnd();\n" ); - - if( !s_rankings_active ) - { - // cleanup after error during game - if( s_ranked_players != NULL ) - { - for( i = 0; i < sv_maxclients->value; i++ ) - { - if( s_ranked_players[i].context != 0 ) - { - SV_RankCloseContext( &(s_ranked_players[i]) ); - } - } - } - if( s_server_context != 0 ) - { - SV_RankCloseContext( NULL ); - } - - return; - } - - for( i = 0; i < sv_maxclients->value; i++ ) - { - if( s_ranked_players[i].grank_status == QGR_STATUS_ACTIVE ) - { - SV_RankUserLogout( i ); - Com_DPrintf( "SV_RankEnd: SV_RankUserLogout %d\n",i ); - } - } - - assert( s_server_context != 0 ); - - // send match reports, proceed to SV_RankSendReportsCBF - status = GRankSendReportsAsync - ( - s_server_context, - 0, - SV_RankSendReportsCBF, - NULL, - GR_OPT_END - ); - - if( status != GR_STATUS_PENDING ) - { - SV_RankError( "SV_RankEnd: Expected GR_STATUS_PENDING, got %s", - SV_RankStatusString( status ) ); - } - - s_rankings_active = qfalse; - Cvar_Set( "sv_rankingsActive", "0" ); -} - -/* -================ -SV_RankPoll -================ -*/ -void SV_RankPoll( void ) -{ - GRankPoll(); -} - -/* -================ -SV_RankCheckInit -================ -*/ -qboolean SV_RankCheckInit( void ) -{ - return (s_rankings_contexts > 0); -} - -/* -================ -SV_RankActive -================ -*/ -qboolean SV_RankActive( void ) -{ - return s_rankings_active; -} - -/* -================= -SV_RankUserStatus -================= -*/ -grank_status_t SV_RankUserStatus( int index ) -{ - if( !s_rankings_active ) - { - return GR_STATUS_ERROR; - } - - assert( s_ranked_players != NULL ); - assert( index >= 0 ); - assert( index < sv_maxclients->value ); - - return s_ranked_players[index].grank_status; -} - -/* -================ -SV_RankUserGRank -================ -*/ -int SV_RankUserGrank( int index ) -{ - if( !s_rankings_active ) - { - return 0; - } - - assert( s_ranked_players != NULL ); - assert( index >= 0 ); - assert( index < sv_maxclients->value ); - - return s_ranked_players[index].grank; -} - -/* -================ -SV_RankUserReset -================ -*/ -void SV_RankUserReset( int index ) -{ - if( !s_rankings_active ) - { - return; - } - - assert( s_ranked_players != NULL ); - assert( index >= 0 ); - assert( index < sv_maxclients->value ); - - switch( s_ranked_players[index].grank_status ) - { - case QGR_STATUS_SPECTATOR: - case QGR_STATUS_NO_USER: - case QGR_STATUS_BAD_PASSWORD: - case QGR_STATUS_USER_EXISTS: - case QGR_STATUS_NO_MEMBERSHIP: - case QGR_STATUS_TIMEOUT: - case QGR_STATUS_ERROR: - s_ranked_players[index].grank_status = QGR_STATUS_NEW; - break; - default: - break; - } -} - -/* -================ -SV_RankUserSpectate -================ -*/ -void SV_RankUserSpectate( int index ) -{ - if( !s_rankings_active ) - { - return; - } - - assert( s_ranked_players != NULL ); - assert( index >= 0 ); - assert( index < sv_maxclients->value ); - - // GRANK_FIXME - check current status? - s_ranked_players[index].grank_status = QGR_STATUS_SPECTATOR; -} - -/* -================ -SV_RankUserCreate -================ -*/ -void SV_RankUserCreate( int index, char* username, char* password, - char* email ) -{ - GR_INIT init; - GR_STATUS status; - - assert( index >= 0 ); - assert( index < sv_maxclients->value ); - assert( username != NULL ); - assert( password != NULL ); - assert( email != NULL ); - assert( s_ranked_players ); - assert( s_ranked_players[index].grank_status != QGR_STATUS_ACTIVE ); - - Com_DPrintf( "SV_RankUserCreate( %d, %s, \"****\", %s );\n", index, - username, email ); - - if( !s_rankings_active ) - { - Com_DPrintf( "SV_RankUserCreate: Not ready to create\n" ); - s_ranked_players[index].grank_status = QGR_STATUS_ERROR; - return; - } - - if( s_ranked_players[index].grank_status == QGR_STATUS_ACTIVE ) - { - Com_DPrintf( "SV_RankUserCreate: Got Create from active player\n" ); - return; - } - - // get a separate context for the new user - init = GRankInit( 0, SV_RankGameKey, GR_OPT_POLL, GR_OPT_END ); - s_ranked_players[index].context = init.context; - s_rankings_contexts++; - Com_DPrintf( "SV_RankUserCreate(); s_rankings_contexts=%d\n",s_rankings_contexts ); - Com_DPrintf( "SV_RankUserCreate(); s_ranked_players[%d].context=%d\n",index,init.context ); - - // attempt to create a new account, proceed to SV_RankUserCBF - status = GRankUserCreateAsync - ( - s_ranked_players[index].context, - username, - password, - email, - SV_RankUserCBF, - (void*)&s_ranked_players[index], - GR_OPT_END - ); - - if( status == GR_STATUS_PENDING ) - { - s_ranked_players[index].grank_status = QGR_STATUS_PENDING; - s_ranked_players[index].final_status = QGR_STATUS_NEW; - } - else - { - SV_RankError( "SV_RankUserCreate: Expected GR_STATUS_PENDING, got %s", - SV_RankStatusString( status ) ); - } -} - -/* -================ -SV_RankUserLogin -================ -*/ -void SV_RankUserLogin( int index, char* username, char* password ) -{ - GR_INIT init; - GR_STATUS status; - - assert( index >= 0 ); - assert( index < sv_maxclients->value ); - assert( username != NULL ); - assert( password != NULL ); - assert( s_ranked_players ); - assert( s_ranked_players[index].grank_status != QGR_STATUS_ACTIVE ); - - Com_DPrintf( "SV_RankUserLogin( %d, %s, \"****\" );\n", index, username ); - - if( !s_rankings_active ) - { - Com_DPrintf( "SV_RankUserLogin: Not ready for login\n" ); - s_ranked_players[index].grank_status = QGR_STATUS_ERROR; - return; - } - - if( s_ranked_players[index].grank_status == QGR_STATUS_ACTIVE ) - { - Com_DPrintf( "SV_RankUserLogin: Got Login from active player\n" ); - return; - } - - // get a separate context for the new user - init = GRankInit( 0, SV_RankGameKey, GR_OPT_POLL, GR_OPT_END ); - s_ranked_players[index].context = init.context; - s_rankings_contexts++; - Com_DPrintf( "SV_RankUserLogin(); s_rankings_contexts=%d\n",s_rankings_contexts ); - Com_DPrintf( "SV_RankUserLogin(); s_ranked_players[%d].context=%d\n",index,init.context ); - - // login user, proceed to SV_RankUserCBF - status = GRankUserLoginAsync - ( - s_ranked_players[index].context, - username, - password, - SV_RankUserCBF, - (void*)&s_ranked_players[index], - GR_OPT_END - ); - - if( status == GR_STATUS_PENDING ) - { - s_ranked_players[index].grank_status = QGR_STATUS_PENDING; - s_ranked_players[index].final_status = QGR_STATUS_NEW; - } - else - { - SV_RankError( "SV_RankUserLogin: Expected GR_STATUS_PENDING, got %s", - SV_RankStatusString( status ) ); - } -} - -/* -=================== -SV_RankUserValidate -=================== -*/ -qboolean SV_RankUserValidate( int index, const char* player_id, const char* key, int token_len, int rank, char* name ) -{ - GR_INIT init; - GR_STATUS status; - qboolean rVal; - ranked_player_t* ranked_player; - int i; - - assert( s_ranked_players ); - assert( s_ranked_players[index].grank_status != QGR_STATUS_ACTIVE ); - - rVal = qfalse; - - if( !s_rankings_active ) - { - Com_DPrintf( "SV_RankUserValidate: Not ready to validate\n" ); - s_ranked_players[index].grank_status = QGR_STATUS_ERROR; - return rVal; - } - - ranked_player = &(s_ranked_players[index]); - - if ( (player_id != NULL) && (key != NULL)) - { - // the real player_id and key is set when SV_RankJoinGameCBF - // is called we do this so that SV_RankUserValidate - // can be shared by both server side login and client side login - - // for client side logined in players - // server is creating GR_OPT_PLAYERCONTEXT - init = GRankInit( 0, SV_RankGameKey, GR_OPT_POLL, GR_OPT_END ); - ranked_player->context = init.context; - s_rankings_contexts++; - Com_DPrintf( "SV_RankUserValidate(); s_rankings_contexts=%d\n",s_rankings_contexts ); - Com_DPrintf( "SV_RankUserValidate(); s_ranked_players[%d].context=%d\n",index,init.context ); - - // uudecode player id and player token - ranked_player->player_id = SV_RankDecodePlayerID(player_id); - Com_DPrintf( "SV_RankUserValidate(); ranked_player->player_id =%u\n", (uint32_t)ranked_player->player_id ); - SV_RankDecodePlayerKey(key, ranked_player->token); - - // save name and check for duplicates - Q_strncpyz( ranked_player->name, name, sizeof(ranked_player->name) ); - for( i = 0; i < sv_maxclients->value; i++ ) - { - if( (i != index) && (s_ranked_players[i].grank_status == QGR_STATUS_ACTIVE) && - (strcmp( s_ranked_players[i].name, name ) == 0) ) - { - Com_DPrintf( "SV_RankUserValidate: Duplicate login\n" ); - ranked_player->grank_status = QGR_STATUS_NO_USER; - ranked_player->final_status = QGR_STATUS_NEW; - ranked_player->grank = 0; - return qfalse; - } - } - - // then validate - status = GRankPlayerValidate( - s_server_context, - ranked_player->player_id, - ranked_player->token, - token_len, - GR_OPT_PLAYERCONTEXT, - ranked_player->context, - GR_OPT_END); - } - else - { - // make server side login (bots) happy - status = GR_STATUS_OK; - } - - if (status == GR_STATUS_OK) - { - ranked_player->grank_status = QGR_STATUS_ACTIVE; - ranked_player->final_status = QGR_STATUS_NEW; - ranked_player->grank = rank; - rVal = qtrue; - } - else if (status == GR_STATUS_INVALIDUSER) - { - ranked_player->grank_status = QGR_STATUS_INVALIDUSER; - ranked_player->final_status = QGR_STATUS_NEW; - ranked_player->grank = 0; - rVal = qfalse; - } - else - { - SV_RankError( "SV_RankUserValidate: Unexpected status %s", - SV_RankStatusString( status ) ); - s_ranked_players[index].grank_status = QGR_STATUS_ERROR; - ranked_player->grank = 0; - } - - return rVal; -} - -/* -================ -SV_RankUserLogout -================ -*/ -void SV_RankUserLogout( int index ) -{ - GR_STATUS status; - GR_STATUS cleanup_status; - - if( !s_rankings_active ) - { - return; - } - - assert( index >= 0 ); - assert( index < sv_maxclients->value ); - assert( s_ranked_players ); - - if( s_ranked_players[index].context == 0 ) { - return; - } - - Com_DPrintf( "SV_RankUserLogout( %d );\n", index ); - - // masqueraded player may not be active yet, if they fail validation, - // but still they have a context needs to be cleaned - // what matters is the s_ranked_players[index].context - - // send reports, proceed to SV_RankSendReportsCBF - status = GRankSendReportsAsync - ( - s_ranked_players[index].context, - 0, - SV_RankSendReportsCBF, - (void*)&s_ranked_players[index], - GR_OPT_END - ); - - if( status == GR_STATUS_PENDING ) - { - s_ranked_players[index].grank_status = QGR_STATUS_PENDING; - s_ranked_players[index].final_status = QGR_STATUS_NEW; - } - else - { - SV_RankError( "SV_RankUserLogout: Expected GR_STATUS_PENDING, got %s", - SV_RankStatusString( status ) ); - - cleanup_status = GRankCleanupAsync - ( - s_ranked_players[index].context, - 0, - SV_RankCleanupCBF, - (void*)&s_ranked_players[index], - GR_OPT_END - ); - - if( cleanup_status != GR_STATUS_PENDING ) - { - SV_RankError( "SV_RankUserLogout: Expected " - "GR_STATUS_PENDING from GRankCleanupAsync, got %s", - SV_RankStatusString( cleanup_status ) ); - SV_RankCloseContext( &(s_ranked_players[index]) ); - } - } -} - -/* -================ -SV_RankReportInt -================ -*/ -void SV_RankReportInt( int index1, int index2, int key, int value, - qboolean accum ) -{ - GR_STATUS status; - GR_CONTEXT context; - uint64_t match; - uint64_t user1; - uint64_t user2; - int opt_accum; - - if( !s_rankings_active ) - { - return; - } - - assert( index1 >= -1 ); - assert( index1 < sv_maxclients->value ); - assert( index2 >= -1 ); - assert( index2 < sv_maxclients->value ); - assert( s_ranked_players ); - -// Com_DPrintf( "SV_RankReportInt( %d, %d, %d, %d, %d );\n", index1, index2, -// key, value, accum ); - - // get context, match, and player_id for player index1 - if( index1 == -1 ) - { - context = s_server_context; - match = s_server_match; - user1 = 0; - } - else - { - if( s_ranked_players[index1].grank_status != QGR_STATUS_ACTIVE ) - { - Com_DPrintf( "SV_RankReportInt: Expecting QGR_STATUS_ACTIVE" - " Got Unexpected status %d for player %d\n", - s_ranked_players[index1].grank_status, index1 ); - return; - } - - context = s_ranked_players[index1].context; - match = s_ranked_players[index1].match; - user1 = s_ranked_players[index1].player_id; - } - - // get player_id for player index2 - if( index2 == -1 ) - { - user2 = 0; - } - else - { - if( s_ranked_players[index2].grank_status != QGR_STATUS_ACTIVE ) - { - Com_DPrintf( "SV_RankReportInt: Expecting QGR_STATUS_ACTIVE" - " Got Unexpected status %d for player %d\n", - s_ranked_players[index2].grank_status, index2 ); - return; - } - - user2 = s_ranked_players[index2].player_id; - } - - opt_accum = accum ? GR_OPT_ACCUM : GR_OPT_END; - - status = GRankReportInt - ( - context, - match, - user1, - user2, - key, - value, - opt_accum, - GR_OPT_END - ); - - if( status != GR_STATUS_OK ) - { - SV_RankError( "SV_RankReportInt: Unexpected status %s", - SV_RankStatusString( status ) ); - } - - if( user2 != 0 ) - { - context = s_ranked_players[index2].context; - match = s_ranked_players[index2].match; - - status = GRankReportInt - ( - context, - match, - user1, - user2, - key, - value, - opt_accum, - GR_OPT_END - ); - - if( status != GR_STATUS_OK ) - { - SV_RankError( "SV_RankReportInt: Unexpected status %s", - SV_RankStatusString( status ) ); - } - } -} - -/* -================ -SV_RankReportStr -================ -*/ -void SV_RankReportStr( int index1, int index2, int key, char* value ) -{ - GR_STATUS status; - GR_CONTEXT context; - uint64_t match; - uint64_t user1; - uint64_t user2; - - if( !s_rankings_active ) - { - return; - } - - assert( index1 >= -1 ); - assert( index1 < sv_maxclients->value ); - assert( index2 >= -1 ); - assert( index2 < sv_maxclients->value ); - assert( s_ranked_players ); - -// Com_DPrintf( "SV_RankReportStr( %d, %d, %d, \"%s\" );\n", index1, index2, -// key, value ); - - // get context, match, and player_id for player index1 - if( index1 == -1 ) - { - context = s_server_context; - match = s_server_match; - user1 = 0; - } - else - { - if( s_ranked_players[index1].grank_status != QGR_STATUS_ACTIVE ) - { - Com_DPrintf( "SV_RankReportStr: Unexpected status %d\n", - s_ranked_players[index1].grank_status ); - return; - } - - context = s_ranked_players[index1].context; - match = s_ranked_players[index1].match; - user1 = s_ranked_players[index1].player_id; - } - - // get player_id for player index2 - if( index2 == -1 ) - { - user2 = 0; - } - else - { - if( s_ranked_players[index2].grank_status != QGR_STATUS_ACTIVE ) - { - Com_DPrintf( "SV_RankReportStr: Unexpected status %d\n", - s_ranked_players[index2].grank_status ); - return; - } - - user2 = s_ranked_players[index2].player_id; - } - - status = GRankReportStr - ( - context, - match, - user1, - user2, - key, - value, - GR_OPT_END - ); - - if( status != GR_STATUS_OK ) - { - SV_RankError( "SV_RankReportStr: Unexpected status %s", - SV_RankStatusString( status ) ); - } - - if( user2 != 0 ) - { - context = s_ranked_players[index2].context; - match = s_ranked_players[index2].match; - - status = GRankReportStr - ( - context, - match, - user1, - user2, - key, - value, - GR_OPT_END - ); - - if( status != GR_STATUS_OK ) - { - SV_RankError( "SV_RankReportInt: Unexpected status %s", - SV_RankStatusString( status ) ); - } - } -} - -/* -================ -SV_RankQuit -================ -*/ -void SV_RankQuit( void ) -{ - int i; - int j = 0; - // yuck - - while( s_rankings_contexts > 1 ) - { - assert(s_ranked_players); - if( s_ranked_players != NULL ) - { - for( i = 0; i < sv_maxclients->value; i++ ) - { - // check for players that weren't yet active in SV_RankEnd - if( s_ranked_players[i].grank_status == QGR_STATUS_ACTIVE ) - { - SV_RankUserLogout( i ); - Com_DPrintf( "SV_RankQuit: SV_RankUserLogout %d\n",i ); - } - else - { - if( s_ranked_players[i].context ) - { - GR_STATUS cleanup_status; - cleanup_status = GRankCleanupAsync - ( - s_ranked_players[i].context, - 0, - SV_RankCleanupCBF, - (void*)&(s_ranked_players[i]), - GR_OPT_END - ); - - if( cleanup_status != GR_STATUS_PENDING ) - { - SV_RankError( "SV_RankQuit: Expected " - "GR_STATUS_PENDING from GRankCleanupAsync, got %s", - SV_RankStatusString( cleanup_status ) ); - } - } - } - } - } - SV_RankPoll(); - - // should've finished by now - assert( (j++) < 68 ); - } -} - -/* -============================================================================== - -Private Functions - -============================================================================== -*/ - -/* -================= -SV_RankNewGameCBF -================= -*/ -static void SV_RankNewGameCBF( GR_NEWGAME* gr_newgame, void* cbf_arg ) -{ - GR_MATCH match; - int i; - - assert( gr_newgame != NULL ); - assert( cbf_arg == NULL ); - - Com_DPrintf( "SV_RankNewGameCBF( %08X, %08X );\n", gr_newgame, cbf_arg ); - - if( gr_newgame->status == GR_STATUS_OK ) - { - char info[MAX_INFO_STRING]; - char gameid[sizeof(s_ranked_players[i].game_id) * 4 / 3 + 2]; - - // save game id - s_rankings_game_id = gr_newgame->game_id; - - // encode gameid - memset(gameid,0,sizeof(gameid)); - SV_RankEncodeGameID(s_rankings_game_id,gameid,sizeof(gameid)); - - // set CS_GRANK rankingsGameID to pass to client - memset(info,0,sizeof(info)); - Info_SetValueForKey( info, "rankingsGameKey", s_rankings_game_key ); - Info_SetValueForKey( info, "rankingsGameID", gameid ); - SV_SetConfigstring( CS_GRANK, info ); - - // initialize client status - for( i = 0; i < sv_maxclients->value; i++ ) - s_ranked_players[i].grank_status = QGR_STATUS_NEW; - - // start new match - match = GRankStartMatch( s_server_context ); - s_server_match = match.match; - - // ready to go - s_rankings_active = qtrue; - Cvar_Set( "sv_rankingsActive", "1" ); - - } - else if( gr_newgame->status == GR_STATUS_BADLEAGUE ) - { - SV_RankError( "SV_RankNewGameCBF: Invalid League name\n" ); - } - else - { - //GRank handle new game failure - // force SV_RankEnd() to run - //SV_RankEnd(); - SV_RankError( "SV_RankNewGameCBF: Unexpected status %s", - SV_RankStatusString( gr_newgame->status ) ); - } -} - -/* -================ -SV_RankUserCBF -================ -*/ -static void SV_RankUserCBF( GR_LOGIN* gr_login, void* cbf_arg ) -{ - ranked_player_t* ranked_player; - GR_STATUS join_status; - GR_STATUS cleanup_status; - - assert( gr_login != NULL ); - assert( cbf_arg != NULL ); - - Com_DPrintf( "SV_RankUserCBF( %08X, %08X );\n", gr_login, cbf_arg ); - - ranked_player = (ranked_player_t*)cbf_arg; - assert(ranked_player); - assert( ranked_player->context ); - - switch( gr_login->status ) - { - case GR_STATUS_OK: - // attempt to join the game, proceed to SV_RankJoinGameCBF - join_status = GRankJoinGameAsync - ( - ranked_player->context, - s_rankings_game_id, - SV_RankJoinGameCBF, - cbf_arg, - GR_OPT_END - ); - - if( join_status != GR_STATUS_PENDING ) - { - SV_RankError( "SV_RankUserCBF: Expected GR_STATUS_PENDING " - "from GRankJoinGameAsync, got %s", - SV_RankStatusString( join_status ) ); - } - break; - case GR_STATUS_NOUSER: - Com_DPrintf( "SV_RankUserCBF: Got status %s\n", - SV_RankStatusString( gr_login->status ) ); - ranked_player->final_status = QGR_STATUS_NO_USER; - break; - case GR_STATUS_BADPASSWORD: - Com_DPrintf( "SV_RankUserCBF: Got status %s\n", - SV_RankStatusString( gr_login->status ) ); - ranked_player->final_status = QGR_STATUS_BAD_PASSWORD; - break; - case GR_STATUS_TIMEOUT: - Com_DPrintf( "SV_RankUserCBF: Got status %s\n", - SV_RankStatusString( gr_login->status ) ); - ranked_player->final_status = QGR_STATUS_TIMEOUT; - break; - default: - Com_DPrintf( "SV_RankUserCBF: Unexpected status %s\n", - SV_RankStatusString( gr_login->status ) ); - ranked_player->final_status = QGR_STATUS_ERROR; - break; - } - - if( ranked_player->final_status != QGR_STATUS_NEW ) - { - // login or create failed, so clean up before the next attempt - cleanup_status = GRankCleanupAsync - ( - ranked_player->context, - 0, - SV_RankCleanupCBF, - (void*)ranked_player, - GR_OPT_END - ); - - if( cleanup_status != GR_STATUS_PENDING ) - { - SV_RankError( "SV_RankUserCBF: Expected GR_STATUS_PENDING " - "from GRankCleanupAsync, got %s", - SV_RankStatusString( cleanup_status ) ); - SV_RankCloseContext( ranked_player ); - } - } -} - -/* -================ -SV_RankJoinGameCBF -================ -*/ -static void SV_RankJoinGameCBF( GR_JOINGAME* gr_joingame, void* cbf_arg ) -{ - ranked_player_t* ranked_player; - GR_MATCH match; - GR_STATUS cleanup_status; - - assert( gr_joingame != NULL ); - assert( cbf_arg != NULL ); - - Com_DPrintf( "SV_RankJoinGameCBF( %08X, %08X );\n", gr_joingame, cbf_arg ); - - ranked_player = (ranked_player_t*)cbf_arg; - - assert( ranked_player ); - assert( ranked_player->context != 0 ); - - if( gr_joingame->status == GR_STATUS_OK ) - { - int i; - // save user id - ranked_player->player_id = gr_joingame->player_id; - memcpy(ranked_player->token,gr_joingame->token, - sizeof(GR_PLAYER_TOKEN)) ; - match = GRankStartMatch( ranked_player->context ); - ranked_player->match = match.match; - ranked_player->grank = gr_joingame->rank; - - // find the index and call SV_RankUserValidate - for (i=0;ivalue;i++) - if ( ranked_player == &s_ranked_players[i] ) - SV_RankUserValidate(i,NULL,NULL,0, gr_joingame->rank,ranked_player->name); - } - else - { - //GRand handle join game failure - SV_RankError( "SV_RankJoinGameCBF: Unexpected status %s", - SV_RankStatusString( gr_joingame->status ) ); - - cleanup_status = GRankCleanupAsync - ( - ranked_player->context, - 0, - SV_RankCleanupCBF, - cbf_arg, - GR_OPT_END - ); - - if( cleanup_status != GR_STATUS_PENDING ) - { - SV_RankError( "SV_RankJoinGameCBF: Expected " - "GR_STATUS_PENDING from GRankCleanupAsync, got %s", - SV_RankStatusString( cleanup_status ) ); - SV_RankCloseContext( ranked_player ); - } - } -} - -/* -================ -SV_RankSendReportsCBF -================ -*/ -static void SV_RankSendReportsCBF( GR_STATUS* status, void* cbf_arg ) -{ - ranked_player_t* ranked_player; - GR_CONTEXT context; - GR_STATUS cleanup_status; - - assert( status != NULL ); - // NULL cbf_arg means server is sending match reports - - Com_DPrintf( "SV_RankSendReportsCBF( %08X, %08X );\n", status, cbf_arg ); - - ranked_player = (ranked_player_t*)cbf_arg; - if( ranked_player == NULL ) - { - Com_DPrintf( "SV_RankSendReportsCBF: server\n" ); - context = s_server_context; - } - else - { - Com_DPrintf( "SV_RankSendReportsCBF: player\n" ); - context = ranked_player->context; - } - - //assert( context != 0 ); - if( *status != GR_STATUS_OK ) - { - SV_RankError( "SV_RankSendReportsCBF: Unexpected status %s", - SV_RankStatusString( *status ) ); - } - - if( context == 0 ) - { - Com_DPrintf( "SV_RankSendReportsCBF: WARNING: context == 0" ); - SV_RankCloseContext( ranked_player ); - } - else - { - cleanup_status = GRankCleanupAsync - ( - context, - 0, - SV_RankCleanupCBF, - cbf_arg, - GR_OPT_END - ); - - if( cleanup_status != GR_STATUS_PENDING ) - { - SV_RankError( "SV_RankSendReportsCBF: Expected " - "GR_STATUS_PENDING from GRankCleanupAsync, got %s", - SV_RankStatusString( cleanup_status ) ); - SV_RankCloseContext( ranked_player ); - } - } -} - -/* -================ -SV_RankCleanupCBF -================ -*/ -static void SV_RankCleanupCBF( GR_STATUS* status, void* cbf_arg ) -{ - ranked_player_t* ranked_player; - ranked_player = (ranked_player_t*)cbf_arg; - - assert( status != NULL ); - // NULL cbf_arg means server is cleaning up - - Com_DPrintf( "SV_RankCleanupCBF( %08X, %08X );\n", status, cbf_arg ); - - if( *status != GR_STATUS_OK ) - { - SV_RankError( "SV_RankCleanupCBF: Unexpected status %s", - SV_RankStatusString( *status ) ); - } - - SV_RankCloseContext( ranked_player ); -} - -/* -================ -SV_RankCloseContext -================ -*/ -static void SV_RankCloseContext( ranked_player_t* ranked_player ) -{ - if( ranked_player == NULL ) - { - // server cleanup - if( s_server_context == 0 ) - { - return; - } - s_server_context = 0; - s_server_match = 0; - } - else - { - // player cleanup - if( s_ranked_players == NULL ) - { - return; - } - if( ranked_player->context == 0 ) - { - return; - } - ranked_player->context = 0; - ranked_player->match = 0; - ranked_player->player_id = 0; - memset( ranked_player->token, 0, sizeof(GR_PLAYER_TOKEN) ); - ranked_player->grank_status = ranked_player->final_status; - ranked_player->final_status = QGR_STATUS_NEW; - ranked_player->name[0] = '\0'; - } - - assert( s_rankings_contexts > 0 ); - s_rankings_contexts--; - Com_DPrintf( "SV_RankCloseContext: s_rankings_contexts = %d\n", - s_rankings_contexts ); - - if( s_rankings_contexts == 0 ) - { - GRankLogLevel( GRLOG_OFF ); - - if( s_ranked_players != NULL ) - { - Z_Free( s_ranked_players ); - s_ranked_players = NULL; - } - - s_rankings_active = qfalse; - Cvar_Set( "sv_rankingsActive", "0" ); - } -} - -/* -================ -SV_RankAsciiEncode - -Encodes src_len bytes of binary data from the src buffer as ASCII text, -using 6 bits per character. The result string is null-terminated and -stored in the dest buffer. - -The dest buffer must be at least (src_len * 4) / 3 + 2 bytes in length. - -Returns the length of the result string, not including the null. -================ -*/ -static int SV_RankAsciiEncode( char* dest, const unsigned char* src, - int src_len ) -{ - unsigned char bin[3]; - unsigned char txt[4]; - int dest_len = 0; - int i; - int j; - int num_chars; - - assert( dest != NULL ); - assert( src != NULL ); - - for( i = 0; i < src_len; i += 3 ) - { - // read three bytes of input - for( j = 0; j < 3; j++ ) - { - bin[j] = (i + j < src_len) ? src[i + j] : 0; - } - - // get four 6-bit values from three bytes - txt[0] = bin[0] >> 2; - txt[1] = ((bin[0] << 4) | (bin[1] >> 4)) & 63; - txt[2] = ((bin[1] << 2) | (bin[2] >> 6)) & 63; - txt[3] = bin[2] & 63; - - // store ASCII encoding of 6-bit values - num_chars = (i + 2 < src_len) ? 4 : ((src_len - i) * 4) / 3 + 1; - for( j = 0; j < num_chars; j++ ) - { - dest[dest_len++] = s_ascii_encoding[txt[j]]; - } - } - - dest[dest_len] = '\0'; - - return dest_len; -} - -/* -================ -SV_RankAsciiDecode - -Decodes src_len characters of ASCII text from the src buffer, stores -the binary result in the dest buffer. - -The dest buffer must be at least (src_len * 3) / 4 bytes in length. - -Returns the length of the binary result, or zero for invalid input. -================ -*/ -static int SV_RankAsciiDecode( unsigned char* dest, const char* src, - int src_len ) -{ - static unsigned char s_inverse_encoding[256]; - static char s_init = 0; - - unsigned char bin[3]; - unsigned char txt[4]; - int dest_len = 0; - int i; - int j; - int num_bytes; - - assert( dest != NULL ); - assert( src != NULL ); - - if( !s_init ) - { - // initialize lookup table for decoding - memset( s_inverse_encoding, 255, sizeof(s_inverse_encoding) ); - for( i = 0; i < 64; i++ ) - { - s_inverse_encoding[s_ascii_encoding[i]] = i; - } - s_init = 1; - } - - for( i = 0; i < src_len; i += 4 ) - { - // read four characters of input, decode them to 6-bit values - for( j = 0; j < 4; j++ ) - { - txt[j] = (i + j < src_len) ? s_inverse_encoding[src[i + j]] : 0; - if (txt[j] == 255) - { - return 0; // invalid input character - } - } - - // get three bytes from four 6-bit values - bin[0] = (txt[0] << 2) | (txt[1] >> 4); - bin[1] = (txt[1] << 4) | (txt[2] >> 2); - bin[2] = (txt[2] << 6) | txt[3]; - - // store binary data - num_bytes = (i + 3 < src_len) ? 3 : ((src_len - i) * 3) / 4; - for( j = 0; j < num_bytes; j++ ) - { - dest[dest_len++] = bin[j]; - } - } - - return dest_len; -} - -/* -================ -SV_RankEncodeGameID -================ -*/ -static void SV_RankEncodeGameID( uint64_t game_id, char* result, - int len ) -{ - assert( result != NULL ); - - if( len < ( ( sizeof(game_id) * 4) / 3 + 2) ) - { - Com_DPrintf( "SV_RankEncodeGameID: result buffer too small\n" ); - result[0] = '\0'; - } - else - { - qint64 gameid = LittleLong64(*(qint64*)&game_id); - SV_RankAsciiEncode( result, (unsigned char*)&gameid, - sizeof(qint64) ); - } -} - -/* -================ -SV_RankDecodePlayerID -================ -*/ -static uint64_t SV_RankDecodePlayerID( const char* string ) -{ - unsigned char buffer[9]; - int len; - qint64 player_id; - - assert( string != NULL ); - - len = strlen (string) ; - Com_DPrintf( "SV_RankDecodePlayerID: string length %d\n",len ); - SV_RankAsciiDecode( buffer, string, len ); - player_id = LittleLong64(*(qint64*)buffer); - return *(uint64_t*)&player_id; -} - -/* -================ -SV_RankDecodePlayerKey -================ -*/ -static void SV_RankDecodePlayerKey( const char* string, GR_PLAYER_TOKEN key ) -{ - unsigned char buffer[1400]; - int len; - assert( string != NULL ); - - len = strlen (string) ; - Com_DPrintf( "SV_RankDecodePlayerKey: string length %d\n",len ); - - memset(key,0,sizeof(GR_PLAYER_TOKEN)); - memset(buffer,0,sizeof(buffer)); - memcpy( key, buffer, SV_RankAsciiDecode( buffer, string, len ) ); -} - -/* -================ -SV_RankStatusString -================ -*/ -static char* SV_RankStatusString( GR_STATUS status ) -{ - switch( status ) - { - case GR_STATUS_OK: return "GR_STATUS_OK"; - case GR_STATUS_ERROR: return "GR_STATUS_ERROR"; - case GR_STATUS_BADPARAMS: return "GR_STATUS_BADPARAMS"; - case GR_STATUS_NETWORK: return "GR_STATUS_NETWORK"; - case GR_STATUS_NOUSER: return "GR_STATUS_NOUSER"; - case GR_STATUS_BADPASSWORD: return "GR_STATUS_BADPASSWORD"; - case GR_STATUS_BADGAME: return "GR_STATUS_BADGAME"; - case GR_STATUS_PENDING: return "GR_STATUS_PENDING"; - case GR_STATUS_BADDOMAIN: return "GR_STATUS_BADDOMAIN"; - case GR_STATUS_DOMAINLOCK: return "GR_STATUS_DOMAINLOCK"; - case GR_STATUS_TIMEOUT: return "GR_STATUS_TIMEOUT"; - case GR_STATUS_INVALIDUSER: return "GR_STATUS_INVALIDUSER"; - case GR_STATUS_INVALIDCONTEXT: return "GR_STATUS_INVALIDCONTEXT"; - default: return "(UNKNOWN)"; - } -} - -/* -================ -SV_RankError -================ -*/ -static void SV_RankError( const char* fmt, ... ) -{ - va_list arg_ptr; - char text[1024]; - - va_start( arg_ptr, fmt ); - vsprintf( text, fmt, arg_ptr ); - va_end( arg_ptr ); - - Com_DPrintf( "****************************************\n" ); - Com_DPrintf( "SV_RankError: %s\n", text ); - Com_DPrintf( "****************************************\n" ); - - s_rankings_active = qfalse; - Cvar_Set( "sv_rankingsActive", "0" ); - // FIXME - attempt clean shutdown? -} - diff --git a/code/splines/Splines.vcproj b/code/splines/Splines.vcproj deleted file mode 100644 index b39ad18..0000000 --- a/code/splines/Splines.vcproj +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/splines/math_angles.cpp b/code/splines/math_angles.cpp deleted file mode 100644 index 5e6b597..0000000 --- a/code/splines/math_angles.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#include "q_shared.h" -#include - -angles_t ang_zero( 0.0f, 0.0f, 0.0f ); - -void toAngles( mat3_t &src, angles_t &dst ) { - double theta; - double cp; - double sp; - - sp = src[ 0 ][ 2 ]; - - // cap off our sin value so that we don't get any NANs - if ( sp > 1.0 ) { - sp = 1.0; - } else if ( sp < -1.0 ) { - sp = -1.0; - } - - theta = -asin( sp ); - cp = cos( theta ); - - if ( cp > 8192 * FLT_EPSILON ) { - dst.pitch = theta * 180 / M_PI; - dst.yaw = atan2( src[ 0 ][ 1 ], src[ 0 ][ 0 ] ) * 180 / M_PI; - dst.roll = atan2( src[ 1 ][ 2 ], src[ 2 ][ 2 ] ) * 180 / M_PI; - } else { - dst.pitch = theta * 180 / M_PI; - dst.yaw = -atan2( src[ 1 ][ 0 ], src[ 1 ][ 1 ] ) * 180 / M_PI; - dst.roll = 0; - } -} - -void toAngles( quat_t &src, angles_t &dst ) { - mat3_t temp; - - toMatrix( src, temp ); - toAngles( temp, dst ); -} - -void toAngles( idVec3_t &src, angles_t &dst ) { - dst.pitch = src[ 0 ]; - dst.yaw = src[ 1 ]; - dst.roll = src[ 2 ]; -} - -void angles_t::toVectors( idVec3_t *forward, idVec3_t *right, idVec3_t *up ) { - float angle; - static float sr, sp, sy, cr, cp, cy; // static to help MS compiler fp bugs - - angle = yaw * ( M_PI * 2 / 360 ); - sy = sin( angle ); - cy = cos( angle ); - - angle = pitch * ( M_PI * 2 / 360 ); - sp = sin( angle ); - cp = cos( angle ); - - angle = roll * ( M_PI * 2 / 360 ); - sr = sin( angle ); - cr = cos( angle ); - - if ( forward ) { - forward->set( cp * cy, cp * sy, -sp ); - } - - if ( right ) { - right->set( -sr * sp * cy + cr * sy, -sr * sp * sy + -cr * cy, -sr * cp ); - } - - if ( up ) { - up->set( cr * sp * cy + -sr * -sy, cr * sp * sy + -sr * cy, cr * cp ); - } -} - -idVec3_t angles_t::toForward( void ) { - float angle; - static float sp, sy, cp, cy; // static to help MS compiler fp bugs - - angle = yaw * ( M_PI * 2 / 360 ); - sy = sin( angle ); - cy = cos( angle ); - - angle = pitch * ( M_PI * 2 / 360 ); - sp = sin( angle ); - cp = cos( angle ); - - return idVec3_t( cp * cy, cp * sy, -sp ); -} - -/* -================= -Normalize360 - -returns angles normalized to the range [0 <= angle < 360] -================= -*/ -angles_t& angles_t::Normalize360( void ) { - pitch = (360.0 / 65536) * ( ( int )( pitch * ( 65536 / 360.0 ) ) & 65535 ); - yaw = (360.0 / 65536) * ( ( int )( yaw * ( 65536 / 360.0 ) ) & 65535 ); - roll = (360.0 / 65536) * ( ( int )( roll * ( 65536 / 360.0 ) ) & 65535 ); - - return *this; -} - - -/* -================= -Normalize180 - -returns angles normalized to the range [-180 < angle <= 180] -================= -*/ -angles_t& angles_t::Normalize180( void ) { - Normalize360(); - - if ( pitch > 180.0 ) { - pitch -= 360.0; - } - - if ( yaw > 180.0 ) { - yaw -= 360.0; - } - - if ( roll > 180.0 ) { - roll -= 360.0; - } - return *this; -} diff --git a/code/splines/math_angles.h b/code/splines/math_angles.h deleted file mode 100644 index 8e12271..0000000 --- a/code/splines/math_angles.h +++ /dev/null @@ -1,195 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifndef __MATH_ANGLES_H__ -#define __MATH_ANGLES_H__ - -#include -#include - -#include "math_vector.h" - -class mat3_t; -class quat_t; -class idVec3_t; -typedef idVec3_t &vec3_p; - -class angles_t { -public: - float pitch; - float yaw; - float roll; - - angles_t(); - angles_t( float pitch, float yaw, float roll ); - angles_t( const idVec3_t &vec ); - - friend void toAngles( idVec3_t &src, angles_t &dst ); - friend void toAngles( quat_t &src, angles_t &dst ); - friend void toAngles( mat3_t &src, angles_t &dst ); - - operator vec3_p(); - - float operator[]( int index ) const; - float& operator[]( int index ); - - void set( float pitch, float yaw, float roll ); - - void operator=( angles_t const &a ); - void operator=( idVec3_t const &a ); - - friend angles_t operator+( const angles_t &a, const angles_t &b ); - angles_t &operator+=( angles_t const &a ); - angles_t &operator+=( idVec3_t const &a ); - - friend angles_t operator-( angles_t &a, angles_t &b ); - angles_t &operator-=( angles_t &a ); - - friend angles_t operator*( const angles_t &a, float b ); - friend angles_t operator*( float a, const angles_t &b ); - angles_t &operator*=( float a ); - - friend int operator==( angles_t &a, angles_t &b ); - - friend int operator!=( angles_t &a, angles_t &b ); - - void toVectors( idVec3_t *forward, idVec3_t *right = NULL, idVec3_t *up = NULL ); - idVec3_t toForward( void ); - - angles_t &Zero( void ); - - angles_t &Normalize360( void ); - angles_t &Normalize180( void ); -}; - -extern angles_t ang_zero; - -inline angles_t::angles_t() {} - -inline angles_t::angles_t( float pitch, float yaw, float roll ) { - this->pitch = pitch; - this->yaw = yaw; - this->roll = roll; -} - -inline angles_t::angles_t( const idVec3_t &vec ) { - this->pitch = vec.x; - this->yaw = vec.y; - this->roll = vec.z; -} - -inline float angles_t::operator[]( int index ) const { - assert( ( index >= 0 ) && ( index < 3 ) ); - return ( &pitch )[ index ]; -} - -inline float& angles_t::operator[]( int index ) { - assert( ( index >= 0 ) && ( index < 3 ) ); - return ( &pitch )[ index ]; -} - -inline angles_t::operator vec3_p( void ) { - return *( idVec3_t * )&pitch; -} - -inline void angles_t::set( float pitch, float yaw, float roll ) { - this->pitch = pitch; - this->yaw = yaw; - this->roll = roll; -} - -inline void angles_t::operator=( angles_t const &a ) { - pitch = a.pitch; - yaw = a.yaw; - roll = a.roll; -} - -inline void angles_t::operator=( idVec3_t const &a ) { - pitch = a[ 0 ]; - yaw = a[ 1 ]; - roll = a[ 2 ]; -} - -inline angles_t operator+( const angles_t &a, const angles_t &b ) { - return angles_t( a.pitch + b.pitch, a.yaw + b.yaw, a.roll + b.roll ); -} - -inline angles_t& angles_t::operator+=( angles_t const &a ) { - pitch += a.pitch; - yaw += a.yaw; - roll += a.roll; - - return *this; -} - -inline angles_t& angles_t::operator+=( idVec3_t const &a ) { - pitch += a.x; - yaw += a.y; - roll += a.z; - - return *this; -} - -inline angles_t operator-( angles_t &a, angles_t &b ) { - return angles_t( a.pitch - b.pitch, a.yaw - b.yaw, a.roll - b.roll ); -} - -inline angles_t& angles_t::operator-=( angles_t &a ) { - pitch -= a.pitch; - yaw -= a.yaw; - roll -= a.roll; - - return *this; -} - -inline angles_t operator*( const angles_t &a, float b ) { - return angles_t( a.pitch * b, a.yaw * b, a.roll * b ); -} - -inline angles_t operator*( float a, const angles_t &b ) { - return angles_t( a * b.pitch, a * b.yaw, a * b.roll ); -} - -inline angles_t& angles_t::operator*=( float a ) { - pitch *= a; - yaw *= a; - roll *= a; - - return *this; -} - -inline int operator==( angles_t &a, angles_t &b ) { - return ( ( a.pitch == b.pitch ) && ( a.yaw == b.yaw ) && ( a.roll == b.roll ) ); -} - -inline int operator!=( angles_t &a, angles_t &b ) { - return ( ( a.pitch != b.pitch ) || ( a.yaw != b.yaw ) || ( a.roll != b.roll ) ); -} - -inline angles_t& angles_t::Zero( void ) { - pitch = 0.0f; - yaw = 0.0f; - roll = 0.0f; - - return *this; -} - -#endif /* !__MATH_ANGLES_H__ */ diff --git a/code/splines/math_matrix.cpp b/code/splines/math_matrix.cpp deleted file mode 100644 index 5f8181a..0000000 --- a/code/splines/math_matrix.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#include "q_shared.h" - -mat3_t mat3_default( idVec3_t( 1, 0, 0 ), idVec3_t( 0, 1, 0 ), idVec3_t( 0, 0, 1 ) ); - -void toMatrix( quat_t const &src, mat3_t &dst ) { - float wx, wy, wz; - float xx, yy, yz; - float xy, xz, zz; - float x2, y2, z2; - - x2 = src.x + src.x; - y2 = src.y + src.y; - z2 = src.z + src.z; - - xx = src.x * x2; - xy = src.x * y2; - xz = src.x * z2; - - yy = src.y * y2; - yz = src.y * z2; - zz = src.z * z2; - - wx = src.w * x2; - wy = src.w * y2; - wz = src.w * z2; - - dst[ 0 ][ 0 ] = 1.0f - ( yy + zz ); - dst[ 0 ][ 1 ] = xy - wz; - dst[ 0 ][ 2 ] = xz + wy; - - dst[ 1 ][ 0 ] = xy + wz; - dst[ 1 ][ 1 ] = 1.0f - ( xx + zz ); - dst[ 1 ][ 2 ] = yz - wx; - - dst[ 2 ][ 0 ] = xz - wy; - dst[ 2 ][ 1 ] = yz + wx; - dst[ 2 ][ 2 ] = 1.0f - ( xx + yy ); -} - -void toMatrix( angles_t const &src, mat3_t &dst ) { - float angle; - static float sr, sp, sy, cr, cp, cy; // static to help MS compiler fp bugs - - angle = src.yaw * ( M_PI * 2.0f / 360.0f ); - sy = sin( angle ); - cy = cos( angle ); - - angle = src.pitch * ( M_PI * 2.0f / 360.0f ); - sp = sin( angle ); - cp = cos( angle ); - - angle = src.roll * ( M_PI * 2.0f / 360.0f ); - sr = sin( angle ); - cr = cos( angle ); - - dst[ 0 ].set( cp * cy, cp * sy, -sp ); - dst[ 1 ].set( sr * sp * cy + cr * -sy, sr * sp * sy + cr * cy, sr * cp ); - dst[ 2 ].set( cr * sp * cy + -sr * -sy, cr * sp * sy + -sr * cy, cr * cp ); -} - -void toMatrix( idVec3_t const &src, mat3_t &dst ) { - angles_t sup = src; - toMatrix(sup, dst); -} - -void mat3_t::ProjectVector( const idVec3_t &src, idVec3_t &dst ) const { - dst.x = src * mat[ 0 ]; - dst.y = src * mat[ 1 ]; - dst.z = src * mat[ 2 ]; -} - -void mat3_t::UnprojectVector( const idVec3_t &src, idVec3_t &dst ) const { - dst = mat[ 0 ] * src.x + mat[ 1 ] * src.y + mat[ 2 ] * src.z; -} - -void mat3_t::Transpose( mat3_t &matrix ) { - int i; - int j; - - for( i = 0; i < 3; i++ ) { - for( j = 0; j < 3; j++ ) { - matrix[ i ][ j ] = mat[ j ][ i ]; - } - } -} - -void mat3_t::Transpose( void ) { - float temp; - int i; - int j; - - for( i = 0; i < 3; i++ ) { - for( j = i + 1; j < 3; j++ ) { - temp = mat[ i ][ j ]; - mat[ i ][ j ] = mat[ j ][ i ]; - mat[ j ][ i ] = temp; - } - } -} - -mat3_t mat3_t::Inverse( void ) const { - mat3_t inv( *this ); - - inv.Transpose(); - - return inv; -} - -void mat3_t::Clear( void ) { - mat[0].set( 1, 0, 0 ); - mat[1].set( 0, 1, 0 ); - mat[2].set( 0, 0, 1 ); -} diff --git a/code/splines/math_matrix.h b/code/splines/math_matrix.h deleted file mode 100644 index 91f146e..0000000 --- a/code/splines/math_matrix.h +++ /dev/null @@ -1,223 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifndef __MATH_MATRIX_H__ -#define __MATH_MATRIX_H__ - -#include -#include "math_vector.h" - -#ifndef ID_INLINE -#ifdef _WIN32 -#define ID_INLINE __inline -#else -#define ID_INLINE inline -#endif -#endif - -class quat_t; -class angles_t; - -class mat3_t { -public: - idVec3_t mat[ 3 ]; - - mat3_t(); - mat3_t( float src[ 3 ][ 3 ] ); - mat3_t( idVec3_t const &x, idVec3_t const &y, idVec3_t const &z ); - mat3_t( const float xx, const float xy, const float xz, const float yx, const float yy, const float yz, const float zx, const float zy, const float zz ); - - friend void toMatrix( quat_t const &src, mat3_t &dst ); - friend void toMatrix( angles_t const &src, mat3_t &dst ); - friend void toMatrix( idVec3_t const &src, mat3_t &dst ); - - idVec3_t operator[]( int index ) const; - idVec3_t &operator[]( int index ); - - idVec3_t operator*( const idVec3_t &vec ) const; - mat3_t operator*( const mat3_t &a ) const; - mat3_t operator*( float a ) const; - mat3_t operator+( mat3_t const &a ) const; - mat3_t operator-( mat3_t const &a ) const; - - friend idVec3_t operator*( const idVec3_t &vec, const mat3_t &mat ); - friend mat3_t operator*( float a, mat3_t const &b ); - - mat3_t &operator*=( float a ); - mat3_t &operator+=( mat3_t const &a ); - mat3_t &operator-=( mat3_t const &a ); - - void Clear( void ); - - void ProjectVector( const idVec3_t &src, idVec3_t &dst ) const; - void UnprojectVector( const idVec3_t &src, idVec3_t &dst ) const; - - void OrthoNormalize( void ); - void Transpose( mat3_t &matrix ); - void Transpose( void ); - mat3_t Inverse( void ) const; - void Identity( void ); - - friend void InverseMultiply( const mat3_t &inv, const mat3_t &b, mat3_t &dst ); - friend mat3_t SkewSymmetric( idVec3_t const &src ); -}; - -ID_INLINE mat3_t::mat3_t() { -} - -ID_INLINE mat3_t::mat3_t( float src[ 3 ][ 3 ] ) { - memcpy( mat, src, sizeof( src ) ); -} - -ID_INLINE mat3_t::mat3_t( idVec3_t const &x, idVec3_t const &y, idVec3_t const &z ) { - mat[ 0 ].x = x.x; mat[ 0 ].y = x.y; mat[ 0 ].z = x.z; - mat[ 1 ].x = y.x; mat[ 1 ].y = y.y; mat[ 1 ].z = y.z; - mat[ 2 ].x = z.x; mat[ 2 ].y = z.y; mat[ 2 ].z = z.z; -} - -ID_INLINE mat3_t::mat3_t( const float xx, const float xy, const float xz, const float yx, const float yy, const float yz, const float zx, const float zy, const float zz ) { - mat[ 0 ].x = xx; mat[ 0 ].y = xy; mat[ 0 ].z = xz; - mat[ 1 ].x = yx; mat[ 1 ].y = yy; mat[ 1 ].z = yz; - mat[ 2 ].x = zx; mat[ 2 ].y = zy; mat[ 2 ].z = zz; -} - -ID_INLINE idVec3_t mat3_t::operator[]( int index ) const { - assert( ( index >= 0 ) && ( index < 3 ) ); - return mat[ index ]; -} - -ID_INLINE idVec3_t& mat3_t::operator[]( int index ) { - assert( ( index >= 0 ) && ( index < 3 ) ); - return mat[ index ]; -} - -ID_INLINE idVec3_t mat3_t::operator*( const idVec3_t &vec ) const { - return idVec3_t( - mat[ 0 ].x * vec.x + mat[ 1 ].x * vec.y + mat[ 2 ].x * vec.z, - mat[ 0 ].y * vec.x + mat[ 1 ].y * vec.y + mat[ 2 ].y * vec.z, - mat[ 0 ].z * vec.x + mat[ 1 ].z * vec.y + mat[ 2 ].z * vec.z ); -} - -ID_INLINE mat3_t mat3_t::operator*( const mat3_t &a ) const { - return mat3_t( - mat[0].x * a[0].x + mat[0].y * a[1].x + mat[0].z * a[2].x, - mat[0].x * a[0].y + mat[0].y * a[1].y + mat[0].z * a[2].y, - mat[0].x * a[0].z + mat[0].y * a[1].z + mat[0].z * a[2].z, - mat[1].x * a[0].x + mat[1].y * a[1].x + mat[1].z * a[2].x, - mat[1].x * a[0].y + mat[1].y * a[1].y + mat[1].z * a[2].y, - mat[1].x * a[0].z + mat[1].y * a[1].z + mat[1].z * a[2].z, - mat[2].x * a[0].x + mat[2].y * a[1].x + mat[2].z * a[2].x, - mat[2].x * a[0].y + mat[2].y * a[1].y + mat[2].z * a[2].y, - mat[2].x * a[0].z + mat[2].y * a[1].z + mat[2].z * a[2].z ); -} - -ID_INLINE mat3_t mat3_t::operator*( float a ) const { - return mat3_t( - mat[0].x * a, mat[0].y * a, mat[0].z * a, - mat[1].x * a, mat[1].y * a, mat[1].z * a, - mat[2].x * a, mat[2].y * a, mat[2].z * a ); -} - -ID_INLINE mat3_t mat3_t::operator+( mat3_t const &a ) const { - return mat3_t( - mat[0].x + a[0].x, mat[0].y + a[0].y, mat[0].z + a[0].z, - mat[1].x + a[1].x, mat[1].y + a[1].y, mat[1].z + a[1].z, - mat[2].x + a[2].x, mat[2].y + a[2].y, mat[2].z + a[2].z ); -} - -ID_INLINE mat3_t mat3_t::operator-( mat3_t const &a ) const { - return mat3_t( - mat[0].x - a[0].x, mat[0].y - a[0].y, mat[0].z - a[0].z, - mat[1].x - a[1].x, mat[1].y - a[1].y, mat[1].z - a[1].z, - mat[2].x - a[2].x, mat[2].y - a[2].y, mat[2].z - a[2].z ); -} - -ID_INLINE idVec3_t operator*( const idVec3_t &vec, const mat3_t &mat ) { - return idVec3_t( - mat[ 0 ].x * vec.x + mat[ 1 ].x * vec.y + mat[ 2 ].x * vec.z, - mat[ 0 ].y * vec.x + mat[ 1 ].y * vec.y + mat[ 2 ].y * vec.z, - mat[ 0 ].z * vec.x + mat[ 1 ].z * vec.y + mat[ 2 ].z * vec.z ); -} - -ID_INLINE mat3_t operator*( float a, mat3_t const &b ) { - return mat3_t( - b[0].x * a, b[0].y * a, b[0].z * a, - b[1].x * a, b[1].y * a, b[1].z * a, - b[2].x * a, b[2].y * a, b[2].z * a ); -} - -ID_INLINE mat3_t &mat3_t::operator*=( float a ) { - mat[0].x *= a; mat[0].y *= a; mat[0].z *= a; - mat[1].x *= a; mat[1].y *= a; mat[1].z *= a; - mat[2].x *= a; mat[2].y *= a; mat[2].z *= a; - - return *this; -} - -ID_INLINE mat3_t &mat3_t::operator+=( mat3_t const &a ) { - mat[0].x += a[0].x; mat[0].y += a[0].y; mat[0].z += a[0].z; - mat[1].x += a[1].x; mat[1].y += a[1].y; mat[1].z += a[1].z; - mat[2].x += a[2].x; mat[2].y += a[2].y; mat[2].z += a[2].z; - - return *this; -} - -ID_INLINE mat3_t &mat3_t::operator-=( mat3_t const &a ) { - mat[0].x -= a[0].x; mat[0].y -= a[0].y; mat[0].z -= a[0].z; - mat[1].x -= a[1].x; mat[1].y -= a[1].y; mat[1].z -= a[1].z; - mat[2].x -= a[2].x; mat[2].y -= a[2].y; mat[2].z -= a[2].z; - - return *this; -} - -ID_INLINE void mat3_t::OrthoNormalize( void ) { - mat[ 0 ].Normalize(); - mat[ 2 ].Cross( mat[ 0 ], mat[ 1 ] ); - mat[ 2 ].Normalize(); - mat[ 1 ].Cross( mat[ 2 ], mat[ 0 ] ); - mat[ 1 ].Normalize(); -} - -ID_INLINE void mat3_t::Identity( void ) { - mat[ 0 ].x = 1.f; mat[ 0 ].y = 0.f; mat[ 0 ].z = 0.f; - mat[ 1 ].x = 0.f; mat[ 1 ].y = 1.f; mat[ 1 ].z = 0.f; - mat[ 2 ].x = 0.f; mat[ 2 ].y = 0.f; mat[ 2 ].z = 1.f; -} - -ID_INLINE void InverseMultiply( const mat3_t &inv, const mat3_t &b, mat3_t &dst ) { - dst[0].x = inv[0].x * b[0].x + inv[1].x * b[1].x + inv[2].x * b[2].x; - dst[0].y = inv[0].x * b[0].y + inv[1].x * b[1].y + inv[2].x * b[2].y; - dst[0].z = inv[0].x * b[0].z + inv[1].x * b[1].z + inv[2].x * b[2].z; - dst[1].x = inv[0].y * b[0].x + inv[1].y * b[1].x + inv[2].y * b[2].x; - dst[1].y = inv[0].y * b[0].y + inv[1].y * b[1].y + inv[2].y * b[2].y; - dst[1].z = inv[0].y * b[0].z + inv[1].y * b[1].z + inv[2].y * b[2].z; - dst[2].x = inv[0].z * b[0].x + inv[1].z * b[1].x + inv[2].z * b[2].x; - dst[2].y = inv[0].z * b[0].y + inv[1].z * b[1].y + inv[2].z * b[2].y; - dst[2].z = inv[0].z * b[0].z + inv[1].z * b[1].z + inv[2].z * b[2].z; -} - -ID_INLINE mat3_t SkewSymmetric( idVec3_t const &src ) { - return mat3_t( 0.0f, -src.z, src.y, src.z, 0.0f, -src.x, -src.y, src.x, 0.0f ); -} - -extern mat3_t mat3_default; - -#endif /* !__MATH_MATRIX_H__ */ diff --git a/code/splines/math_quaternion.cpp b/code/splines/math_quaternion.cpp deleted file mode 100644 index d799ce9..0000000 --- a/code/splines/math_quaternion.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#include "math_quaternion.h" -#include "math_matrix.h" - -void toQuat( idVec3_t &src, quat_t &dst ) { - dst.x = src.x; - dst.y = src.y; - dst.z = src.z; - dst.w = 0.0f; -} - -void toQuat( angles_t &src, quat_t &dst ) { - mat3_t temp; - - toMatrix( src, temp ); - toQuat( temp, dst ); -} - -void toQuat( mat3_t &src, quat_t &dst ) { - float trace; - float s; - int i; - int j; - int k; - - static int next[ 3 ] = { 1, 2, 0 }; - - trace = src[ 0 ][ 0 ] + src[ 1 ][ 1 ] + src[ 2 ][ 2 ]; - if ( trace > 0.0f ) { - s = ( float )sqrt( trace + 1.0f ); - dst.w = s * 0.5f; - s = 0.5f / s; - - dst.x = ( src[ 2 ][ 1 ] - src[ 1 ][ 2 ] ) * s; - dst.y = ( src[ 0 ][ 2 ] - src[ 2 ][ 0 ] ) * s; - dst.z = ( src[ 1 ][ 0 ] - src[ 0 ][ 1 ] ) * s; - } else { - i = 0; - if ( src[ 1 ][ 1 ] > src[ 0 ][ 0 ] ) { - i = 1; - } - if ( src[ 2 ][ 2 ] > src[ i ][ i ] ) { - i = 2; - } - - j = next[ i ]; - k = next[ j ]; - - s = ( float )sqrt( ( src[ i ][ i ] - ( src[ j ][ j ] + src[ k ][ k ] ) ) + 1.0f ); - dst[ i ] = s * 0.5f; - - s = 0.5f / s; - - dst.w = ( src[ k ][ j ] - src[ j ][ k ] ) * s; - dst[ j ] = ( src[ j ][ i ] + src[ i ][ j ] ) * s; - dst[ k ] = ( src[ k ][ i ] + src[ i ][ k ] ) * s; - } -} diff --git a/code/splines/math_quaternion.h b/code/splines/math_quaternion.h deleted file mode 100644 index c899b27..0000000 --- a/code/splines/math_quaternion.h +++ /dev/null @@ -1,190 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifndef __MATH_QUATERNION_H__ -#define __MATH_QUATERNION_H__ - -#include -#include - -class idVec3_t; -class angles_t; -class mat3_t; - -class quat_t { -public: - float x; - float y; - float z; - float w; - - quat_t(); - quat_t( float x, float y, float z, float w ); - - friend void toQuat( idVec3_t &src, quat_t &dst ); - friend void toQuat( angles_t &src, quat_t &dst ); - friend void toQuat( mat3_t &src, quat_t &dst ); - - float *vec4( void ); - - float operator[]( int index ) const; - float &operator[]( int index ); - - void set( float x, float y, float z, float w ); - - void operator=( quat_t a ); - - friend quat_t operator+( quat_t a, quat_t b ); - quat_t &operator+=( quat_t a ); - - friend quat_t operator-( quat_t a, quat_t b ); - quat_t &operator-=( quat_t a ); - - friend quat_t operator*( quat_t a, float b ); - friend quat_t operator*( float a, quat_t b ); - quat_t &operator*=( float a ); - - friend int operator==( quat_t a, quat_t b ); - friend int operator!=( quat_t a, quat_t b ); - - float Length( void ); - quat_t &Normalize( void ); - - quat_t operator-(); -}; - -inline quat_t::quat_t() { -} - -inline quat_t::quat_t( float x, float y, float z, float w ) { - this->x = x; - this->y = y; - this->z = z; - this->w = w; -} - -inline float *quat_t::vec4( void ) { - return &x; -} - -inline float quat_t::operator[]( int index ) const { - assert( ( index >= 0 ) && ( index < 4 ) ); - return ( &x )[ index ]; -} - -inline float& quat_t::operator[]( int index ) { - assert( ( index >= 0 ) && ( index < 4 ) ); - return ( &x )[ index ]; -} - -inline void quat_t::set( float x, float y, float z, float w ) { - this->x = x; - this->y = y; - this->z = z; - this->w = w; -} - -inline void quat_t::operator=( quat_t a ) { - x = a.x; - y = a.y; - z = a.z; - w = a.w; -} - -inline quat_t operator+( quat_t a, quat_t b ) { - return quat_t( a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w ); -} - -inline quat_t& quat_t::operator+=( quat_t a ) { - x += a.x; - y += a.y; - z += a.z; - w += a.w; - - return *this; -} - -inline quat_t operator-( quat_t a, quat_t b ) { - return quat_t( a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w ); -} - -inline quat_t& quat_t::operator-=( quat_t a ) { - x -= a.x; - y -= a.y; - z -= a.z; - w -= a.w; - - return *this; -} - -inline quat_t operator*( quat_t a, float b ) { - return quat_t( a.x * b, a.y * b, a.z * b, a.w * b ); -} - -inline quat_t operator*( float a, quat_t b ) { - return b * a; -} - -inline quat_t& quat_t::operator*=( float a ) { - x *= a; - y *= a; - z *= a; - w *= a; - - return *this; -} - -inline int operator==( quat_t a, quat_t b ) { - return ( ( a.x == b.x ) && ( a.y == b.y ) && ( a.z == b.z ) && ( a.w == b.w ) ); -} - -inline int operator!=( quat_t a, quat_t b ) { - return ( ( a.x != b.x ) || ( a.y != b.y ) || ( a.z != b.z ) && ( a.w != b.w ) ); -} - -inline float quat_t::Length( void ) { - float length; - - length = x * x + y * y + z * z + w * w; - return ( float )sqrt( length ); -} - -inline quat_t& quat_t::Normalize( void ) { - float length; - float ilength; - - length = this->Length(); - if ( length ) { - ilength = 1 / length; - x *= ilength; - y *= ilength; - z *= ilength; - w *= ilength; - } - - return *this; -} - -inline quat_t quat_t::operator-() { - return quat_t( -x, -y, -z, -w ); -} - -#endif /* !__MATH_QUATERNION_H__ */ diff --git a/code/splines/math_vector.cpp b/code/splines/math_vector.cpp deleted file mode 100644 index baa93d3..0000000 --- a/code/splines/math_vector.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -//#include "../game/q_shared.h" -#include "math_vector.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h - -#define LERP_DELTA 1e-6 - -idVec3_t vec_zero( 0.0f, 0.0f, 0.0f ); - -Bounds boundsZero; - -float idVec3_t::toYaw( void ) { - float yaw; - - if ( ( y == 0 ) && ( x == 0 ) ) { - yaw = 0; - } else { - yaw = atan2( y, x ) * 180 / M_PI; - if ( yaw < 0 ) { - yaw += 360; - } - } - - return yaw; -} - -float idVec3_t::toPitch( void ) { - float forward; - float pitch; - - if ( ( x == 0 ) && ( y == 0 ) ) { - if ( z > 0 ) { - pitch = 90; - } else { - pitch = 270; - } - } else { - forward = ( float )idSqrt( x * x + y * y ); - pitch = atan2( z, forward ) * 180 / M_PI; - if ( pitch < 0 ) { - pitch += 360; - } - } - - return pitch; -} - -/* -angles_t idVec3_t::toAngles( void ) { - float forward; - float yaw; - float pitch; - - if ( ( x == 0 ) && ( y == 0 ) ) { - yaw = 0; - if ( z > 0 ) { - pitch = 90; - } else { - pitch = 270; - } - } else { - yaw = atan2( y, x ) * 180 / M_PI; - if ( yaw < 0 ) { - yaw += 360; - } - - forward = ( float )idSqrt( x * x + y * y ); - pitch = atan2( z, forward ) * 180 / M_PI; - if ( pitch < 0 ) { - pitch += 360; - } - } - - return angles_t( -pitch, yaw, 0 ); -} -*/ - -idVec3_t LerpVector( idVec3_t &w1, idVec3_t &w2, const float t ) { - float omega, cosom, sinom, scale0, scale1; - - cosom = w1 * w2; - if ( ( 1.0 - cosom ) > LERP_DELTA ) { - omega = acos( cosom ); - sinom = sin( omega ); - scale0 = sin( ( 1.0 - t ) * omega ) / sinom; - scale1 = sin( t * omega ) / sinom; - } else { - scale0 = 1.0 - t; - scale1 = t; - } - - return ( w1 * scale0 + w2 * scale1 ); -} - -/* -============= -idVec3_t::string - -This is just a convenience function -for printing vectors -============= -*/ -char *idVec3_t::string( void ) { - static int index = 0; - static char str[ 8 ][ 36 ]; - char *s; - - // use an array so that multiple toString's won't collide - s = str[ index ]; - index = (index + 1)&7; - - sprintf( s, "%.2f %.2f %.2f", x, y, z ); - - return s; -} diff --git a/code/splines/math_vector.h b/code/splines/math_vector.h deleted file mode 100644 index 188907f..0000000 --- a/code/splines/math_vector.h +++ /dev/null @@ -1,574 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifndef __MATH_VECTOR_H__ -#define __MATH_VECTOR_H__ - -#if defined(_WIN32) -#pragma warning(disable : 4244) -#endif - -#include -#include - -//#define DotProduct(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2]) -//#define VectorSubtract(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2]) -//#define VectorAdd(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2]) -//#define VectorCopy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2]) -//#define VectorCopy(a,b) ((b).x=(a).x,(b).y=(a).y,(b).z=(a).z]) - -//#define VectorScale(v, s, o) ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s)) -#define __VectorMA(v, s, b, o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s)) -//#define CrossProduct(a,b,c) ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0]) - -#define DotProduct4(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]+(x)[3]*(y)[3]) -#define VectorSubtract4(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2],(c)[3]=(a)[3]-(b)[3]) -#define VectorAdd4(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2],(c)[3]=(a)[3]+(b)[3]) -#define VectorCopy4(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3]) -#define VectorScale4(v, s, o) ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s),(o)[3]=(v)[3]*(s)) -#define VectorMA4(v, s, b, o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s),(o)[3]=(v)[3]+(b)[3]*(s)) - - -//#define VectorClear(a) ((a)[0]=(a)[1]=(a)[2]=0) -#define VectorNegate(a,b) ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2]) -//#define VectorSet(v, x, y, z) ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z)) -#define Vector4Copy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3]) - -#define SnapVector(v) {v[0]=(int)v[0];v[1]=(int)v[1];v[2]=(int)v[2];} - - -//#include "util_heap.h" - -#ifndef EQUAL_EPSILON -#define EQUAL_EPSILON 0.001 -#endif - -float Q_fabs( float f ); - -#ifndef ID_INLINE -#ifdef _WIN32 -#define ID_INLINE __inline -#else -#define ID_INLINE inline -#endif -#endif - -// if this is defined, vec3 will take four elements, which may allow -// easier SIMD optimizations -//#define FAT_VEC3 -//#ifdef __ppc__ -//#pragma align(16) -//#endif - -class angles_t; -#ifdef __ppc__ -// Vanilla PPC code, but since PPC has a reciprocal square root estimate instruction, -// runs *much* faster than calling sqrt(). We'll use two Newton-Raphson -// refinement steps to get bunch more precision in the 1/sqrt() value for very little cost. -// We'll then multiply 1/sqrt times the original value to get the sqrt. -// This is about 12.4 times faster than sqrt() and according to my testing (not exhaustive) -// it returns fairly accurate results (error below 1.0e-5 up to 100000.0 in 0.1 increments). - -static inline float idSqrt(float x) { - const float half = 0.5; - const float one = 1.0; - float B, y0, y1; - - // This'll NaN if it hits frsqrte. Handle both +0.0 and -0.0 - if (fabs(x) == 0.0) - return x; - B = x; - -#ifdef __GNUC__ - asm("frsqrte %0,%1" : "=f" (y0) : "f" (B)); -#else - y0 = __frsqrte(B); -#endif - /* First refinement step */ - - y1 = y0 + half*y0*(one - B*y0*y0); - - /* Second refinement step -- copy the output of the last step to the input of this step */ - - y0 = y1; - y1 = y0 + half*y0*(one - B*y0*y0); - - /* Get sqrt(x) from x * 1/sqrt(x) */ - return x * y1; -} -#else -static inline double idSqrt(double x) { - return sqrt(x); -} -#endif - - -//class idVec3_t : public idHeap { -class idVec3_t { -public: -#ifndef FAT_VEC3 - float x,y,z; -#else - float x,y,z,dist; -#endif - -#ifndef FAT_VEC3 - idVec3_t() {}; -#else - idVec3_t() {dist = 0.0f;}; -#endif - idVec3_t( const float x, const float y, const float z ); - - operator float *(); - - float operator[]( const int index ) const; - float &operator[]( const int index ); - - void set( const float x, const float y, const float z ); - - idVec3_t operator-() const; - - idVec3_t &operator=( const idVec3_t &a ); - - float operator*( const idVec3_t &a ) const; - idVec3_t operator*( const float a ) const; - friend idVec3_t operator*( float a, idVec3_t b ); - - idVec3_t operator+( const idVec3_t &a ) const; - idVec3_t operator-( const idVec3_t &a ) const; - - idVec3_t &operator+=( const idVec3_t &a ); - idVec3_t &operator-=( const idVec3_t &a ); - idVec3_t &operator*=( const float a ); - - int operator==( const idVec3_t &a ) const; - int operator!=( const idVec3_t &a ) const; - - idVec3_t Cross( const idVec3_t &a ) const; - idVec3_t &Cross( const idVec3_t &a, const idVec3_t &b ); - - float Length( void ) const; - float Normalize( void ); - - void Zero( void ); - void Snap( void ); - void SnapTowards( const idVec3_t &to ); - - float toYaw( void ); - float toPitch( void ); - angles_t toAngles( void ); - friend idVec3_t LerpVector( const idVec3_t &w1, const idVec3_t &w2, const float t ); - - char *string( void ); -}; - -extern idVec3_t vec_zero; - -ID_INLINE idVec3_t::idVec3_t( const float x, const float y, const float z ) { - this->x = x; - this->y = y; - this->z = z; -#ifdef FAT_VEC3 - this->dist = 0.0f; -#endif -} - -ID_INLINE float idVec3_t::operator[]( const int index ) const { - return ( &x )[ index ]; -} - -ID_INLINE float &idVec3_t::operator[]( const int index ) { - return ( &x )[ index ]; -} - -ID_INLINE idVec3_t::operator float *( void ) { - return &x; -} - -ID_INLINE idVec3_t idVec3_t::operator-() const { - return idVec3_t( -x, -y, -z ); -} - -ID_INLINE idVec3_t &idVec3_t::operator=( const idVec3_t &a ) { - x = a.x; - y = a.y; - z = a.z; - - return *this; -} - -ID_INLINE void idVec3_t::set( const float x, const float y, const float z ) { - this->x = x; - this->y = y; - this->z = z; -} - -ID_INLINE idVec3_t idVec3_t::operator-( const idVec3_t &a ) const { - return idVec3_t( x - a.x, y - a.y, z - a.z ); -} - -ID_INLINE float idVec3_t::operator*( const idVec3_t &a ) const { - return x * a.x + y * a.y + z * a.z; -} - -ID_INLINE idVec3_t idVec3_t::operator*( const float a ) const { - return idVec3_t( x * a, y * a, z * a ); -} - -ID_INLINE idVec3_t operator*( const float a, const idVec3_t b ) { - return idVec3_t( b.x * a, b.y * a, b.z * a ); -} - -ID_INLINE idVec3_t idVec3_t::operator+( const idVec3_t &a ) const { - return idVec3_t( x + a.x, y + a.y, z + a.z ); -} - -ID_INLINE idVec3_t &idVec3_t::operator+=( const idVec3_t &a ) { - x += a.x; - y += a.y; - z += a.z; - - return *this; -} - -ID_INLINE idVec3_t &idVec3_t::operator-=( const idVec3_t &a ) { - x -= a.x; - y -= a.y; - z -= a.z; - - return *this; -} - -ID_INLINE idVec3_t &idVec3_t::operator*=( const float a ) { - x *= a; - y *= a; - z *= a; - - return *this; -} - -ID_INLINE int idVec3_t::operator==( const idVec3_t &a ) const { - if ( Q_fabs( x - a.x ) > EQUAL_EPSILON ) { - return false; - } - - if ( Q_fabs( y - a.y ) > EQUAL_EPSILON ) { - return false; - } - - if ( Q_fabs( z - a.z ) > EQUAL_EPSILON ) { - return false; - } - - return true; -} - -ID_INLINE int idVec3_t::operator!=( const idVec3_t &a ) const { - if ( Q_fabs( x - a.x ) > EQUAL_EPSILON ) { - return true; - } - - if ( Q_fabs( y - a.y ) > EQUAL_EPSILON ) { - return true; - } - - if ( Q_fabs( z - a.z ) > EQUAL_EPSILON ) { - return true; - } - - return false; -} - -ID_INLINE idVec3_t idVec3_t::Cross( const idVec3_t &a ) const { - return idVec3_t( y * a.z - z * a.y, z * a.x - x * a.z, x * a.y - y * a.x ); -} - -ID_INLINE idVec3_t &idVec3_t::Cross( const idVec3_t &a, const idVec3_t &b ) { - x = a.y * b.z - a.z * b.y; - y = a.z * b.x - a.x * b.z; - z = a.x * b.y - a.y * b.x; - - return *this; -} - -ID_INLINE float idVec3_t::Length( void ) const { - float length; - - length = x * x + y * y + z * z; - return ( float )idSqrt( length ); -} - -ID_INLINE float idVec3_t::Normalize( void ) { - float length; - float ilength; - - length = this->Length(); - if ( length ) { - ilength = 1.0f / length; - x *= ilength; - y *= ilength; - z *= ilength; - } - - return length; -} - -ID_INLINE void idVec3_t::Zero( void ) { - x = 0.0f; - y = 0.0f; - z = 0.0f; -} - -ID_INLINE void idVec3_t::Snap( void ) { - x = float( int( x ) ); - y = float( int( y ) ); - z = float( int( z ) ); -} - -/* -====================== -SnapTowards - -Round a vector to integers for more efficient network -transmission, but make sure that it rounds towards a given point -rather than blindly truncating. This prevents it from truncating -into a wall. -====================== -*/ -ID_INLINE void idVec3_t::SnapTowards( const idVec3_t &to ) { - if ( to.x <= x ) { - x = float( int( x ) ); - } else { - x = float( int( x ) + 1 ); - } - - if ( to.y <= y ) { - y = float( int( y ) ); - } else { - y = float( int( y ) + 1 ); - } - - if ( to.z <= z ) { - z = float( int( z ) ); - } else { - z = float( int( z ) + 1 ); - } -} - -//=============================================================== - -class Bounds { -public: - idVec3_t b[2]; - - Bounds(); - Bounds( const idVec3_t &mins, const idVec3_t &maxs ); - - void Clear(); - void Zero(); - float Radius(); // radius from origin, not from center - idVec3_t Center(); - void AddPoint( const idVec3_t &v ); - void AddBounds( const Bounds &bb ); - bool IsCleared(); - bool ContainsPoint( const idVec3_t &p ); - bool IntersectsBounds( const Bounds &b2 ); // touching is NOT intersecting -}; - -extern Bounds boundsZero; - -ID_INLINE Bounds::Bounds(){ -} - -ID_INLINE bool Bounds::IsCleared() { - return b[0][0] > b[1][0]; -} - -ID_INLINE bool Bounds::ContainsPoint( const idVec3_t &p ) { - if ( p[0] < b[0][0] || p[1] < b[0][1] || p[2] < b[0][2] - || p[0] > b[1][0] || p[1] > b[1][1] || p[2] > b[1][2] ) { - return false; - } - return true; -} - -ID_INLINE bool Bounds::IntersectsBounds( const Bounds &b2 ) { - if ( b2.b[1][0] < b[0][0] || b2.b[1][1] < b[0][1] || b2.b[1][2] < b[0][2] - || b2.b[0][0] > b[1][0] || b2.b[0][1] > b[1][1] || b2.b[0][2] > b[1][2] ) { - return false; - } - return true; -} - -ID_INLINE Bounds::Bounds( const idVec3_t &mins, const idVec3_t &maxs ) { - b[0] = mins; - b[1] = maxs; -} - -ID_INLINE idVec3_t Bounds::Center() { - return idVec3_t( ( b[1][0] + b[0][0] ) * 0.5f, ( b[1][1] + b[0][1] ) * 0.5f, ( b[1][2] + b[0][2] ) * 0.5f ); -} - -ID_INLINE void Bounds::Clear() { - b[0][0] = b[0][1] = b[0][2] = 99999; - b[1][0] = b[1][1] = b[1][2] = -99999; -} - -ID_INLINE void Bounds::Zero() { - b[0][0] = b[0][1] = b[0][2] = - b[1][0] = b[1][1] = b[1][2] = 0; -} - -ID_INLINE void Bounds::AddPoint( const idVec3_t &v ) { - if ( v[0] < b[0][0]) { - b[0][0] = v[0]; - } - if ( v[0] > b[1][0]) { - b[1][0] = v[0]; - } - if ( v[1] < b[0][1] ) { - b[0][1] = v[1]; - } - if ( v[1] > b[1][1]) { - b[1][1] = v[1]; - } - if ( v[2] < b[0][2] ) { - b[0][2] = v[2]; - } - if ( v[2] > b[1][2]) { - b[1][2] = v[2]; - } -} - - -ID_INLINE void Bounds::AddBounds( const Bounds &bb ) { - if ( bb.b[0][0] < b[0][0]) { - b[0][0] = bb.b[0][0]; - } - if ( bb.b[0][1] < b[0][1]) { - b[0][1] = bb.b[0][1]; - } - if ( bb.b[0][2] < b[0][2]) { - b[0][2] = bb.b[0][2]; - } - - if ( bb.b[1][0] > b[1][0]) { - b[1][0] = bb.b[1][0]; - } - if ( bb.b[1][1] > b[1][1]) { - b[1][1] = bb.b[1][1]; - } - if ( bb.b[1][2] > b[1][2]) { - b[1][2] = bb.b[1][2]; - } -} - -ID_INLINE float Bounds::Radius( ) { - int i; - float total; - float a, aa; - - total = 0; - for (i=0 ; i<3 ; i++) { - a = (float)fabs( b[0][i] ); - aa = (float)fabs( b[1][i] ); - if ( aa > a ) { - a = aa; - } - total += a * a; - } - - return (float)idSqrt( total ); -} - -//=============================================================== - - -class idVec2_t { -public: - float x; - float y; - - operator float *(); - float operator[]( int index ) const; - float &operator[]( int index ); -}; - -ID_INLINE float idVec2_t::operator[]( int index ) const { - return ( &x )[ index ]; -} - -ID_INLINE float& idVec2_t::operator[]( int index ) { - return ( &x )[ index ]; -} - -ID_INLINE idVec2_t::operator float *( void ) { - return &x; -} - -class vec4_t : public idVec3_t { -public: -#ifndef FAT_VEC3 - float dist; -#endif - vec4_t(); - ~vec4_t() {}; - - vec4_t( float x, float y, float z, float dist ); - float operator[]( int index ) const; - float &operator[]( int index ); -}; - -ID_INLINE vec4_t::vec4_t() {} -ID_INLINE vec4_t::vec4_t( float x, float y, float z, float dist ) { - this->x = x; - this->y = y; - this->z = z; - this->dist = dist; -} - -ID_INLINE float vec4_t::operator[]( int index ) const { - return ( &x )[ index ]; -} - -ID_INLINE float& vec4_t::operator[]( int index ) { - return ( &x )[ index ]; -} - - -class idVec5_t : public idVec3_t { -public: - float s; - float t; - float operator[]( int index ) const; - float &operator[]( int index ); -}; - - -ID_INLINE float idVec5_t::operator[]( int index ) const { - return ( &x )[ index ]; -} - -ID_INLINE float& idVec5_t::operator[]( int index ) { - return ( &x )[ index ]; -} - -#endif /* !__MATH_VECTOR_H__ */ diff --git a/code/splines/q_parse.cpp b/code/splines/q_parse.cpp deleted file mode 100644 index 33b6b4b..0000000 --- a/code/splines/q_parse.cpp +++ /dev/null @@ -1,535 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// q_parse.c -- support for parsing text files - -#include "q_shared.hpp" - -/* -============================================================================ - -PARSING - -============================================================================ -*/ - -// multiple character punctuation tokens -static const char *punctuation[] = { - "+=", "-=", "*=", "/=", "&=", "|=", "++", "--", - "&&", "||", "<=", ">=", "==", "!=", - NULL -}; - -typedef struct { - char token[MAX_TOKEN_CHARS]; - int lines; - qboolean ungetToken; - char parseFile[MAX_QPATH]; -} parseInfo_t; - -#define MAX_PARSE_INFO 16 -static parseInfo_t parseInfo[MAX_PARSE_INFO]; -static int parseInfoNum; -static parseInfo_t *pi = &parseInfo[0]; - -/* -=================== -Com_BeginParseSession -=================== -*/ -void Com_BeginParseSession( const char *filename ) { - if ( parseInfoNum == MAX_PARSE_INFO - 1 ) { - Com_Error( ERR_FATAL, "Com_BeginParseSession: session overflow" ); - } - parseInfoNum++; - pi = &parseInfo[parseInfoNum]; - - pi->lines = 1; - Q_strncpyz( pi->parseFile, filename, sizeof( pi->parseFile ) ); -} - -/* -=================== -Com_EndParseSession -=================== -*/ -void Com_EndParseSession( void ) { - if ( parseInfoNum == 0 ) { - Com_Error( ERR_FATAL, "Com_EndParseSession: session underflow" ); - } - parseInfoNum--; - pi = &parseInfo[parseInfoNum]; -} - -/* -=================== -Com_GetCurrentParseLine -=================== -*/ -int Com_GetCurrentParseLine( void ) { - return pi->lines; -} - -/* -=================== -Com_ScriptError - -Prints the script name and line number in the message -=================== -*/ -void Com_ScriptError( const char *msg, ... ) { - va_list argptr; - char string[32000]; - - va_start( argptr, msg ); - vsprintf( string, msg,argptr ); - va_end( argptr ); - - Com_Error( ERR_DROP, "File %s, line %i: %s", pi->parseFile, pi->lines, string ); -} - -void Com_ScriptWarning( const char *msg, ... ) { - va_list argptr; - char string[32000]; - - va_start( argptr, msg ); - vsprintf( string, msg,argptr ); - va_end( argptr ); - - Com_Printf( "File %s, line %i: %s", pi->parseFile, pi->lines, string ); -} - - -/* -=================== -Com_UngetToken - -Calling this will make the next Com_Parse return -the current token instead of advancing the pointer -=================== -*/ -void Com_UngetToken( void ) { - if ( pi->ungetToken ) { - Com_ScriptError( "UngetToken called twice" ); - } - pi->ungetToken = qtrue; -} - - -static const char *SkipWhitespace( const char (*data), qboolean *hasNewLines ) { - int c; - - while( (c = *data) <= ' ') { - if( !c ) { - return NULL; - } - if( c == '\n' ) { - pi->lines++; - *hasNewLines = qtrue; - } - data++; - } - - return data; -} - -/* -============== -Com_ParseExt - -Parse a token out of a string -Will never return NULL, just empty strings. -An empty string will only be returned at end of file. - -If "allowLineBreaks" is qtrue then an empty -string will be returned if the next token is -a newline. -============== -*/ -static char *Com_ParseExt( const char *(*data_p), qboolean allowLineBreaks ) { - int c = 0, len; - qboolean hasNewLines = qfalse; - const char *data; - const char **punc; - - if ( !data_p ) { - Com_Error( ERR_FATAL, "Com_ParseExt: NULL data_p" ); - } - - data = *data_p; - len = 0; - pi->token[0] = 0; - - // make sure incoming data is valid - if ( !data ) { - *data_p = NULL; - return pi->token; - } - - // skip any leading whitespace - while ( 1 ) { - // skip whitespace - data = SkipWhitespace( data, &hasNewLines ); - if ( !data ) { - *data_p = NULL; - return pi->token; - } - if ( hasNewLines && !allowLineBreaks ) { - *data_p = data; - return pi->token; - } - - c = *data; - - // skip double slash comments - if ( c == '/' && data[1] == '/' ) { - while (*data && *data != '\n') { - data++; - } - continue; - } - - // skip /* */ comments - if ( c=='/' && data[1] == '*' ) { - while ( *data && ( *data != '*' || data[1] != '/' ) ) { - if( *data == '\n' ) { - pi->lines++; - } - data++; - } - if ( *data ) { - data += 2; - } - continue; - } - - // a real token to parse - break; - } - - // handle quoted strings - if ( c == '\"' ) { - data++; - while( 1 ) { - c = *data++; - if ( ( c=='\\' ) && ( *data == '\"' ) ) { - // allow quoted strings to use \" to indicate the " character - data++; - } else if ( c=='\"' || !c ) { - pi->token[len] = 0; - *data_p = ( char * ) data; - return pi->token; - } else if( *data == '\n' ) { - pi->lines++; - } - if ( len < MAX_TOKEN_CHARS - 1 ) { - pi->token[len] = c; - len++; - } - } - } - - // check for a number - // is this parsing of negative numbers going to cause expression problems - if ( ( c >= '0' && c <= '9' ) || ( c == '-' && data[ 1 ] >= '0' && data[ 1 ] <= '9' ) || - ( c == '.' && data[ 1 ] >= '0' && data[ 1 ] <= '9' ) ) { - do { - - if (len < MAX_TOKEN_CHARS - 1) { - pi->token[len] = c; - len++; - } - data++; - - c = *data; - } while ( ( c >= '0' && c <= '9' ) || c == '.' ); - - // parse the exponent - if ( c == 'e' || c == 'E' ) { - if (len < MAX_TOKEN_CHARS - 1) { - pi->token[len] = c; - len++; - } - data++; - c = *data; - - if ( c == '-' || c == '+' ) { - if (len < MAX_TOKEN_CHARS - 1) { - pi->token[len] = c; - len++; - } - data++; - c = *data; - } - - do { - if (len < MAX_TOKEN_CHARS - 1) { - pi->token[len] = c; - len++; - } - data++; - - c = *data; - } while ( c >= '0' && c <= '9' ); - } - - if (len == MAX_TOKEN_CHARS) { - len = 0; - } - pi->token[len] = 0; - - *data_p = ( char * ) data; - return pi->token; - } - - // check for a regular word - // we still allow forward and back slashes in name tokens for pathnames - // and also colons for drive letters - if ( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || c == '_' || c == '/' || c == '\\' ) { - do { - if (len < MAX_TOKEN_CHARS - 1) { - pi->token[len] = c; - len++; - } - data++; - - c = *data; - } while ( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || c == '_' - || ( c >= '0' && c <= '9' ) || c == '/' || c == '\\' || c == ':' || c == '.' ); - - if (len == MAX_TOKEN_CHARS) { - len = 0; - } - pi->token[len] = 0; - - *data_p = ( char * ) data; - return pi->token; - } - - // check for multi-character punctuation token - for ( punc = punctuation ; *punc ; punc++ ) { - int l; - int j; - - l = strlen( *punc ); - for ( j = 0 ; j < l ; j++ ) { - if ( data[j] != (*punc)[j] ) { - break; - } - } - if ( j == l ) { - // a valid multi-character punctuation - memcpy( pi->token, *punc, l ); - pi->token[l] = 0; - data += l; - *data_p = (char *)data; - return pi->token; - } - } - - // single character punctuation - pi->token[0] = *data; - pi->token[1] = 0; - data++; - *data_p = (char *)data; - - return pi->token; -} - -/* -=================== -Com_Parse -=================== -*/ -const char *Com_Parse( const char *(*data_p) ) { - if ( pi->ungetToken ) { - pi->ungetToken = qfalse; - return pi->token; - } - return Com_ParseExt( data_p, qtrue ); -} - -/* -=================== -Com_ParseOnLine -=================== -*/ -const char *Com_ParseOnLine( const char *(*data_p) ) { - if ( pi->ungetToken ) { - pi->ungetToken = qfalse; - return pi->token; - } - return Com_ParseExt( data_p, qfalse ); -} - - - -/* -================== -Com_MatchToken -================== -*/ -void Com_MatchToken( const char *(*buf_p), const char *match, qboolean warning ) { - const char *token; - - token = Com_Parse( buf_p ); - if ( strcmp( token, match ) ) { - if (warning) { - Com_ScriptWarning( "MatchToken: %s != %s", token, match ); - } else { - Com_ScriptError( "MatchToken: %s != %s", token, match ); - } - } -} - - -/* -================= -Com_SkipBracedSection - -The next token should be an open brace. -Skips until a matching close brace is found. -Internal brace depths are properly skipped. -================= -*/ -void Com_SkipBracedSection( const char *(*program) ) { - const char *token; - int depth; - - depth = 0; - do { - token = Com_Parse( program ); - if( token[1] == 0 ) { - if( token[0] == '{' ) { - depth++; - } - else if( token[0] == '}' ) { - depth--; - } - } - } while( depth && *program ); -} - -/* -================= -Com_SkipRestOfLine -================= -*/ -void Com_SkipRestOfLine ( const char *(*data) ) { - const char *p; - int c; - - p = *data; - while ( (c = *p++) != 0 ) { - if ( c == '\n' ) { - pi->lines++; - break; - } - } - - *data = p; -} - -/* -==================== -Com_ParseRestOfLine -==================== -*/ -const char *Com_ParseRestOfLine( const char *(*data_p) ) { - static char line[MAX_TOKEN_CHARS]; - const char *token; - - line[0] = 0; - while( 1 ) { - token = Com_ParseOnLine( data_p ); - if ( !token[0] ) { - break; - } - if ( line[0] ) { - Q_strcat( line, sizeof(line), " " ); - } - Q_strcat( line, sizeof(line), token ); - } - - return line; -} - - -float Com_ParseFloat( const char *(*buf_p) ) { - const char *token; - - token = Com_Parse( buf_p ); - if ( !token[0] ) { - return 0; - } - return atof( token ); -} - -int Com_ParseInt( const char *(*buf_p) ) { - const char *token; - - token = Com_Parse( buf_p ); - if ( !token[0] ) { - return 0; - } - return atoi( token ); -} - - - -void Com_Parse1DMatrix( const char *(*buf_p), int x, float *m ) { - const char *token; - int i; - - Com_MatchToken( buf_p, "(" ); - - for (i = 0 ; i < x ; i++) { - token = Com_Parse(buf_p); - m[i] = atof(token); - } - - Com_MatchToken( buf_p, ")" ); -} - -void Com_Parse2DMatrix( const char *(*buf_p), int y, int x, float *m ) { - int i; - - Com_MatchToken( buf_p, "(" ); - - for (i = 0 ; i < y ; i++) { - Com_Parse1DMatrix (buf_p, x, m + i * x); - } - - Com_MatchToken( buf_p, ")" ); -} - -void Com_Parse3DMatrix( const char *(*buf_p), int z, int y, int x, float *m ) { - int i; - - Com_MatchToken( buf_p, "(" ); - - for (i = 0 ; i < z ; i++) { - Com_Parse2DMatrix (buf_p, y, x, m + i * x*y); - } - - Com_MatchToken( buf_p, ")" ); -} - diff --git a/code/splines/q_shared.cpp b/code/splines/q_shared.cpp deleted file mode 100644 index ecd2342..0000000 --- a/code/splines/q_shared.cpp +++ /dev/null @@ -1,976 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// q_shared.c -- stateless support routines that are included in each code dll -#include "q_shared.hpp" - -/* -============================================================================ - -GROWLISTS - -============================================================================ -*/ - -// malloc / free all in one place for debugging -extern "C" void *Com_Allocate( int bytes ); -extern "C" void Com_Dealloc( void *ptr ); - -void Com_InitGrowList( growList_t *list, int maxElements ) { - list->maxElements = maxElements; - list->currentElements = 0; - list->elements = (void **)Com_Allocate( list->maxElements * sizeof( void * ) ); -} - -int Com_AddToGrowList( growList_t *list, void *data ) { - void **old; - - if ( list->currentElements != list->maxElements ) { - list->elements[list->currentElements] = data; - return list->currentElements++; - } - - // grow, reallocate and move - old = list->elements; - - if ( list->maxElements < 0 ) { - Com_Error( ERR_FATAL, "Com_AddToGrowList: maxElements = %i", list->maxElements ); - } - - if ( list->maxElements == 0 ) { - // initialize the list to hold 100 elements - Com_InitGrowList( list, 100 ); - return Com_AddToGrowList( list, data ); - } - - list->maxElements *= 2; - - Com_DPrintf( "Resizing growlist to %i maxElements\n", list->maxElements ); - - list->elements = (void **)Com_Allocate( list->maxElements * sizeof( void * ) ); - - if ( !list->elements ) { - Com_Error( ERR_DROP, "Growlist alloc failed" ); - } - - memcpy( list->elements, old, list->currentElements * sizeof( void * ) ); - - Com_Dealloc( old ); - - return Com_AddToGrowList( list, data ); -} - -void *Com_GrowListElement( const growList_t *list, int index ) { - if ( index < 0 || index >= list->currentElements ) { - Com_Error( ERR_DROP, "Com_GrowListElement: %i out of range of %i", - index, list->currentElements ); - } - return list->elements[index]; -} - -int Com_IndexForGrowListElement( const growList_t *list, const void *element ) { - int i; - - for ( i = 0 ; i < list->currentElements ; i++ ) { - if ( list->elements[i] == element ) { - return i; - } - } - return -1; -} - -//============================================================================ - - -float Com_Clamp( float min, float max, float value ) { - if ( value < min ) { - return min; - } - if ( value > max ) { - return max; - } - return value; -} - -/* -============ -Com_StringContains -============ -*/ -const char *Com_StringContains( const char *str1, const char *str2, int casesensitive) { - int len, i, j; - - len = strlen(str1) - strlen(str2); - for (i = 0; i <= len; i++, str1++) { - for (j = 0; str2[j]; j++) { - if (casesensitive) { - if (str1[j] != str2[j]) { - break; - } - } - else { - if (toupper(str1[j]) != toupper(str2[j])) { - break; - } - } - } - if (!str2[j]) { - return str1; - } - } - return NULL; -} - -/* -============ -Com_Filter -============ -*/ -int Com_Filter( const char *filter, const char *name, int casesensitive) -{ - char buf[MAX_TOKEN_CHARS]; - const char *ptr; - int i, found; - - while(*filter) { - if (*filter == '*') { - filter++; - for (i = 0; *filter; i++) { - if (*filter == '*' || *filter == '?') break; - buf[i] = *filter; - filter++; - } - buf[i] = '\0'; - if (strlen(buf)) { - ptr = Com_StringContains(name, buf, casesensitive); - if (!ptr) return qfalse; - name = ptr + strlen(buf); - } - } - else if (*filter == '?') { - filter++; - name++; - } - else if (*filter == '[' && *(filter+1) == '[') { - filter++; - } - else if (*filter == '[') { - filter++; - found = qfalse; - while(*filter && !found) { - if (*filter == ']' && *(filter+1) != ']') break; - if (*(filter+1) == '-' && *(filter+2) && (*(filter+2) != ']' || *(filter+3) == ']')) { - if (casesensitive) { - if (*name >= *filter && *name <= *(filter+2)) found = qtrue; - } - else { - if (toupper(*name) >= toupper(*filter) && - toupper(*name) <= toupper(*(filter+2))) found = qtrue; - } - filter += 3; - } - else { - if (casesensitive) { - if (*filter == *name) found = qtrue; - } - else { - if (toupper(*filter) == toupper(*name)) found = qtrue; - } - filter++; - } - } - if (!found) return qfalse; - while(*filter) { - if (*filter == ']' && *(filter+1) != ']') break; - filter++; - } - filter++; - name++; - } - else { - if (casesensitive) { - if (*filter != *name) return qfalse; - } - else { - if (toupper(*filter) != toupper(*name)) return qfalse; - } - filter++; - name++; - } - } - return qtrue; -} - - -/* -================ -Com_HashString - -================ -*/ -int Com_HashString( const char *fname ) { - int i; - long hash; - char letter; - - hash = 0; - i = 0; - while (fname[i] != '\0') { - letter = tolower(fname[i]); - if (letter =='.') break; // don't include extension - if (letter =='\\') letter = '/'; // damn path names - hash+=(long)(letter)*(i+119); - i++; - } - hash &= (FILE_HASH_SIZE-1); - return hash; -} - - -/* -============ -Com_SkipPath -============ -*/ -char *Com_SkipPath (char *pathname) -{ - char *last; - - last = pathname; - while (*pathname) - { - if (*pathname=='/') - last = pathname+1; - pathname++; - } - return last; -} - -/* -============ -Com_StripExtension -============ -*/ -void Com_StripExtension( const char *in, char *out ) { - while ( *in && *in != '.' ) { - *out++ = *in++; - } - *out = 0; -} - - -/* -================== -Com_DefaultExtension -================== -*/ -void Com_DefaultExtension (char *path, int maxSize, const char *extension ) { - char oldPath[MAX_QPATH]; - char *src; - -// -// if path doesn't have a .EXT, append extension -// (extension should include the .) -// - src = path + strlen(path) - 1; - - while (*src != '/' && src != path) { - if ( *src == '.' ) { - return; // it has an extension - } - src--; - } - - Q_strncpyz( oldPath, path, sizeof( oldPath ) ); - Com_sprintf( path, maxSize, "%s%s", oldPath, extension ); -} - -/* -============================================================================ - - BYTE ORDER FUNCTIONS - -============================================================================ -*/ - -// can't just use function pointers, or dll linkage can -// mess up when qcommon is included in multiple places -static short (*_BigShort) (short l); -static short (*_LittleShort) (short l); -static int (*_BigLong) (int l); -static int (*_LittleLong) (int l); -static float (*_BigFloat) (float l); -static float (*_LittleFloat) (float l); - -short BigShort(short l){return _BigShort(l);} -short LittleShort(short l) {return _LittleShort(l);} -int BigLong (int l) {return _BigLong(l);} -int LittleLong (int l) {return _LittleLong(l);} -float BigFloat (float l) {return _BigFloat(l);} -float LittleFloat (float l) {return _LittleFloat(l);} - -short ShortSwap (short l) -{ - byte b1,b2; - - b1 = l&255; - b2 = (l>>8)&255; - - return (b1<<8) + b2; -} - -short ShortNoSwap (short l) -{ - return l; -} - -int LongSwap (int l) -{ - byte b1,b2,b3,b4; - - b1 = l&255; - b2 = (l>>8)&255; - b3 = (l>>16)&255; - b4 = (l>>24)&255; - - return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4; -} - -int LongNoSwap (int l) -{ - return l; -} - -float FloatSwap (float f) -{ - union - { - float f; - byte b[4]; - } dat1, dat2; - - - dat1.f = f; - dat2.b[0] = dat1.b[3]; - dat2.b[1] = dat1.b[2]; - dat2.b[2] = dat1.b[1]; - dat2.b[3] = dat1.b[0]; - return dat2.f; -} - -float FloatNoSwap (float f) -{ - return f; -} - -/* -================ -Swap_Init -================ -*/ -void Swap_Init (void) -{ - byte swaptest[2] = {1,0}; - -// set the byte swapping variables in a portable manner - if ( *(short *)swaptest == 1) - { - _BigShort = ShortSwap; - _LittleShort = ShortNoSwap; - _BigLong = LongSwap; - _LittleLong = LongNoSwap; - _BigFloat = FloatSwap; - _LittleFloat = FloatNoSwap; - } - else - { - _BigShort = ShortNoSwap; - _LittleShort = ShortSwap; - _BigLong = LongNoSwap; - _LittleLong = LongSwap; - _BigFloat = FloatNoSwap; - _LittleFloat = FloatSwap; - } - -} - -/* -=============== -Com_ParseInfos -=============== -*/ -int Com_ParseInfos( const char *buf, int max, char infos[][MAX_INFO_STRING] ) { - const char *token; - int count; - char key[MAX_TOKEN_CHARS]; - - count = 0; - - while ( 1 ) { - token = Com_Parse( &buf ); - if ( !token[0] ) { - break; - } - if ( strcmp( token, "{" ) ) { - Com_Printf( "Missing { in info file\n" ); - break; - } - - if ( count == max ) { - Com_Printf( "Max infos exceeded\n" ); - break; - } - - infos[count][0] = 0; - while ( 1 ) { - token = Com_Parse( &buf ); - if ( !token[0] ) { - Com_Printf( "Unexpected end of info file\n" ); - break; - } - if ( !strcmp( token, "}" ) ) { - break; - } - Q_strncpyz( key, token, sizeof( key ) ); - - token = Com_ParseOnLine( &buf ); - if ( !token[0] ) { - token = ""; - } - Info_SetValueForKey( infos[count], key, token ); - } - count++; - } - - return count; -} - - - -/* -============================================================================ - - LIBRARY REPLACEMENT FUNCTIONS - -============================================================================ -*/ - -int Q_isprint( int c ) -{ - if ( c >= 0x20 && c <= 0x7E ) - return ( 1 ); - return ( 0 ); -} - -int Q_islower( int c ) -{ - if (c >= 'a' && c <= 'z') - return ( 1 ); - return ( 0 ); -} - -int Q_isupper( int c ) -{ - if (c >= 'A' && c <= 'Z') - return ( 1 ); - return ( 0 ); -} - -int Q_isalpha( int c ) -{ - if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) - return ( 1 ); - return ( 0 ); -} - -char* Q_strrchr( const char* string, int c ) -{ - char cc = c; - char *s; - char *sp=(char *)0; - - s = (char*)string; - - while (*s) - { - if (*s == cc) - sp = s; - s++; - } - if (cc == 0) - sp = s; - - return sp; -} - -/* -============= -Q_strncpyz - -Safe strncpy that ensures a trailing zero -============= -*/ -void Q_strncpyz( char *dest, const char *src, int destsize ) { - if ( !src ) { - Com_Error( ERR_FATAL, "Q_strncpyz: NULL src" ); - } - if ( destsize < 1 ) { - Com_Error(ERR_FATAL,"Q_strncpyz: destsize < 1" ); - } - - strncpy( dest, src, destsize-1 ); - dest[destsize-1] = 0; -} - -int Q_stricmpn (const char *s1, const char *s2, int n) { - int c1, c2; - - do { - c1 = *s1++; - c2 = *s2++; - - if (!n--) { - return 0; // strings are equal until end point - } - - if (c1 != c2) { - if (c1 >= 'a' && c1 <= 'z') { - c1 -= ('a' - 'A'); - } - if (c2 >= 'a' && c2 <= 'z') { - c2 -= ('a' - 'A'); - } - if (c1 != c2) { - return c1 < c2 ? -1 : 1; - } - } - } while (c1); - - return 0; // strings are equal -} - -int Q_strncmp (const char *s1, const char *s2, int n) { - int c1, c2; - - do { - c1 = *s1++; - c2 = *s2++; - - if (!n--) { - return 0; // strings are equal until end point - } - - if (c1 != c2) { - return c1 < c2 ? -1 : 1; - } - } while (c1); - - return 0; // strings are equal -} - -int Q_stricmp (const char *s1, const char *s2) { - return Q_stricmpn (s1, s2, 99999); -} - - -char *Q_strlwr( char *s1 ) { - char *s; - - s = s1; - while ( *s ) { - *s = tolower(*s); - s++; - } - return s1; -} - -char *Q_strupr( char *s1 ) { - char *s; - - s = s1; - while ( *s ) { - *s = toupper(*s); - s++; - } - return s1; -} - - -// never goes past bounds or leaves without a terminating 0 -void Q_strcat( char *dest, int size, const char *src ) { - int l1; - - l1 = strlen( dest ); - if ( l1 >= size ) { - Com_Error( ERR_FATAL, "Q_strcat: already overflowed" ); - } - Q_strncpyz( dest + l1, src, size - l1 ); -} - - -int Q_PrintStrlen( const char *string ) { - int len; - const char *p; - - if( !string ) { - return 0; - } - - len = 0; - p = string; - while( *p ) { - if( Q_IsColorString( p ) ) { - p += 2; - continue; - } - p++; - len++; - } - - return len; -} - - -char *Q_CleanStr( char *string ) { - char* d; - char* s; - int c; - - s = string; - d = string; - while ((c = *s) != 0 ) { - if ( Q_IsColorString( s ) ) { - s++; - } - else if ( c >= 0x20 && c <= 0x7E ) { - *d++ = c; - } - s++; - } - *d = '\0'; - - return string; -} - - -void QDECL Com_sprintf( char *dest, int size, const char *fmt, ...) { - int len; - va_list argptr; - char bigbuffer[32000]; // big, but small enough to fit in PPC stack - - va_start (argptr,fmt); - len = vsprintf (bigbuffer,fmt,argptr); - va_end (argptr); - if ( len >= sizeof( bigbuffer ) ) { - Com_Error( ERR_FATAL, "Com_sprintf: overflowed bigbuffer" ); - } - if (len >= size) { - Com_Printf ("Com_sprintf: overflow of %i in %i\n", len, size); - } - Q_strncpyz (dest, bigbuffer, size ); -} - - -/* -============ -va - -does a varargs printf into a temp buffer, so I don't need to have -varargs versions of all text functions. -FIXME: make this buffer size safe someday -============ -*/ -char * QDECL va( char *format, ... ) { - va_list argptr; - static char string[2][32000]; // in case va is called by nested functions - static int index = 0; - char *buf; - - buf = string[index & 1]; - index++; - - va_start (argptr, format); - vsprintf (buf, format,argptr); - va_end (argptr); - - return buf; -} - - -/* -===================================================================== - - INFO STRINGS - -===================================================================== -*/ - -/* -=============== -Info_ValueForKey - -Searches the string for the given -key and returns the associated value, or an empty string. -FIXME: overflow check? -=============== -*/ -char *Info_ValueForKey( const char *s, const char *key ) { - char pkey[MAX_INFO_KEY]; - static char value[2][MAX_INFO_VALUE]; // use two buffers so compares - // work without stomping on each other - static int valueindex = 0; - char *o; - - if ( !s || !key ) { - return ""; - } - - if ( strlen( s ) >= MAX_INFO_STRING ) { - Com_Error( ERR_DROP, "Info_ValueForKey: oversize infostring" ); - } - - valueindex ^= 1; - if (*s == '\\') - s++; - while (1) - { - o = pkey; - while (*s != '\\') - { - if (!*s) - return ""; - *o++ = *s++; - } - *o = 0; - s++; - - o = value[valueindex]; - - while (*s != '\\' && *s) - { - *o++ = *s++; - } - *o = 0; - - if (!Q_stricmp (key, pkey) ) - return value[valueindex]; - - if (!*s) - break; - s++; - } - - return ""; -} - - -/* -=================== -Info_NextPair - -Used to itterate through all the key/value pairs in an info string -=================== -*/ -void Info_NextPair( const char *(*head), char key[MAX_INFO_KEY], char value[MAX_INFO_VALUE] ) { - char *o; - const char *s; - - s = *head; - - if ( *s == '\\' ) { - s++; - } - key[0] = 0; - value[0] = 0; - - o = key; - while ( *s != '\\' ) { - if ( !*s ) { - *o = 0; - *head = s; - return; - } - *o++ = *s++; - } - *o = 0; - s++; - - o = value; - while ( *s != '\\' && *s ) { - *o++ = *s++; - } - *o = 0; - - *head = s; -} - - -/* -=================== -Info_RemoveKey -=================== -*/ -void Info_RemoveKey( char *s, const char *key ) { - char *start; - char pkey[MAX_INFO_KEY]; - char value[MAX_INFO_VALUE]; - char *o; - - if ( strlen( s ) >= MAX_INFO_STRING ) { - Com_Error( ERR_DROP, "Info_RemoveKey: oversize infostring" ); - } - - if (strchr (key, '\\')) { - return; - } - - while (1) - { - start = s; - if (*s == '\\') - s++; - o = pkey; - while (*s != '\\') - { - if (!*s) - return; - *o++ = *s++; - } - *o = 0; - s++; - - o = value; - while (*s != '\\' && *s) - { - if (!*s) - return; - *o++ = *s++; - } - *o = 0; - - if (!strcmp (key, pkey) ) - { - strcpy (start, s); // remove this part - return; - } - - if (!*s) - return; - } - -} - - -/* -================== -Info_Validate - -Some characters are illegal in info strings because they -can mess up the server's parsing -================== -*/ -qboolean Info_Validate( const char *s ) { - if ( strchr( s, '\"' ) ) { - return qfalse; - } - if ( strchr( s, ';' ) ) { - return qfalse; - } - return qtrue; -} - -/* -================== -Info_SetValueForKey - -Changes or adds a key/value pair -================== -*/ -void Info_SetValueForKey( char *s, const char *key, const char *value ) { - char newi[MAX_INFO_STRING]; - - if ( strlen( s ) >= MAX_INFO_STRING ) { - Com_Error( ERR_DROP, "Info_SetValueForKey: oversize infostring" ); - } - - if (strchr (key, '\\') || strchr (value, '\\')) - { - Com_Printf ("Can't use keys or values with a \\\n"); - return; - } - - if (strchr (key, ';') || strchr (value, ';')) - { - Com_Printf ("Can't use keys or values with a semicolon\n"); - return; - } - - if (strchr (key, '\"') || strchr (value, '\"')) - { - Com_Printf ("Can't use keys or values with a \"\n"); - return; - } - - Info_RemoveKey (s, key); - if (!value || !strlen(value)) - return; - - Com_sprintf (newi, sizeof(newi), "\\%s\\%s", key, value); - - if (strlen(newi) + strlen(s) > MAX_INFO_STRING) - { - Com_Printf ("Info string length exceeded\n"); - return; - } - - strcat (s, newi); -} - -//==================================================================== - - -/* -=============== -ParseHex -=============== -*/ -int ParseHex( const char *text ) { - int value; - int c; - - value = 0; - while ( ( c = *text++ ) != 0 ) { - if ( c >= '0' && c <= '9' ) { - value = value * 16 + c - '0'; - continue; - } - if ( c >= 'a' && c <= 'f' ) { - value = value * 16 + 10 + c - 'a'; - continue; - } - if ( c >= 'A' && c <= 'F' ) { - value = value * 16 + 10 + c - 'A'; - continue; - } - } - - return value; -} diff --git a/code/splines/q_shared.h b/code/splines/q_shared.h deleted file mode 100644 index faaaa22..0000000 --- a/code/splines/q_shared.h +++ /dev/null @@ -1,810 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifndef __Q_SHARED_H -#define __Q_SHARED_H - -// q_shared.h -- included first by ALL program modules. -// these are the definitions that have no dependance on -// central system services, and can be used by any part -// of the program without any state issues. - -// A user mod should never modify this file - -// incursion of DOOM code into the Q3A codebase -//#define Q3_VERSION "DOOM 0.01" - -// alignment macros for SIMD -#define ALIGN_ON -#define ALIGN_OFF - -#ifdef _WIN32 - -#pragma warning(disable : 4018) // signed/unsigned mismatch -#pragma warning(disable : 4032) -#pragma warning(disable : 4051) -#pragma warning(disable : 4057) // slightly different base types -#pragma warning(disable : 4100) // unreferenced formal parameter -#pragma warning(disable : 4115) -#pragma warning(disable : 4125) // decimal digit terminates octal escape sequence -#pragma warning(disable : 4127) // conditional expression is constant -#pragma warning(disable : 4136) -#pragma warning(disable : 4201) -#pragma warning(disable : 4214) -#pragma warning(disable : 4244) -#pragma warning(disable : 4305) // truncation from const double to float -#pragma warning(disable : 4310) // cast truncates constant value -#pragma warning(disable : 4514) -#pragma warning(disable : 4711) // selected for automatic inline expansion -#pragma warning(disable : 4220) // varargs matches remaining parameters - -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef WIN32 // mac doesn't have malloc.h -#include // for _alloca() -#endif -#ifdef _WIN32 - -//#pragma intrinsic( memset, memcpy ) - -#endif - - -// this is the define for determining if we have an asm version of a C function -#if (defined _M_IX86 || defined __i386__) && !defined __sun__ && !defined __LCC__ -#define id386 1 -#else -#define id386 0 -#endif - -// for windows fastcall option - -#define QDECL - -//======================= WIN32 DEFINES ================================= - -#ifdef WIN32 - -#define MAC_STATIC - -#undef QDECL -#define QDECL __cdecl - -// buildstring will be incorporated into the version string -#ifdef NDEBUG -#ifdef _M_IX86 -#define CPUSTRING "win-x86" -#elif defined _M_ALPHA -#define CPUSTRING "win-AXP" -#endif -#else -#ifdef _M_IX86 -#define CPUSTRING "win-x86-debug" -#elif defined _M_ALPHA -#define CPUSTRING "win-AXP-debug" -#endif -#endif - - -#define PATH_SEP '\\' - -#endif - -//======================= MAC OS X SERVER DEFINES ===================== - -#if defined(__MACH__) && defined(__APPLE__) - -#define MAC_STATIC - -#ifdef __ppc__ -#define CPUSTRING "MacOSXS-ppc" -#elif defined __i386__ -#define CPUSTRING "MacOSXS-i386" -#else -#define CPUSTRING "MacOSXS-other" -#endif - -#define PATH_SEP '/' - -#define GAME_HARD_LINKED -#define CGAME_HARD_LINKED -#define UI_HARD_LINKED -#define _alloca alloca - -#undef ALIGN_ON -#undef ALIGN_OFF -#define ALIGN_ON #pragma align(16) -#define ALIGN_OFF #pragma align() - -#ifdef __cplusplus - extern "C" { -#endif - -void *osxAllocateMemory(long size); -void osxFreeMemory(void *pointer); - -#ifdef __cplusplus - } -#endif - -#endif - -//======================= MAC DEFINES ================================= - -#ifdef __MACOS__ - -#define MAC_STATIC static - -#define CPUSTRING "MacOS-PPC" - -#define PATH_SEP ':' - -void Sys_PumpEvents( void ); - -#endif - -#ifdef __MRC__ - -#define MAC_STATIC - -#define CPUSTRING "MacOS-PPC" - -#define PATH_SEP ':' - -void Sys_PumpEvents( void ); - -#undef QDECL -#define QDECL __cdecl - -#define _alloca alloca -#endif - -//======================= LINUX DEFINES ================================= - -// the mac compiler can't handle >32k of locals, so we -// just waste space and make big arrays static... -#ifdef __linux__ - -// bk001205 - from Makefile -#define stricmp strcasecmp - -#define MAC_STATIC // bk: FIXME - -#ifdef __i386__ -#define CPUSTRING "linux-i386" -#elif defined __axp__ -#define CPUSTRING "linux-alpha" -#else -#define CPUSTRING "linux-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 - -#endif - -//============================================================= - - - -typedef enum {qfalse, qtrue} qboolean; - -typedef unsigned char byte; - -#define EQUAL_EPSILON 0.001 - -typedef int qhandle_t; -typedef int sfxHandle_t; -typedef int fileHandle_t; -typedef int clipHandle_t; - -typedef enum { - INVALID_JOINT = -1 -} jointHandle_t; - -#ifndef NULL -#define NULL ((void *)0) -#endif - -#define MAX_QINT 0x7fffffff -#define MIN_QINT (-MAX_QINT-1) - -#ifndef max -#define max( x, y ) ( ( ( x ) > ( y ) ) ? ( x ) : ( y ) ) -#define min( x, y ) ( ( ( x ) < ( y ) ) ? ( x ) : ( y ) ) -#endif - -#ifndef sign -#define sign( f ) ( ( f > 0 ) ? 1 : ( ( f < 0 ) ? -1 : 0 ) ) -#endif - -// angle indexes -#define PITCH 0 // up / down -#define YAW 1 // left / right -#define ROLL 2 // fall over - -// the game guarantees that no string from the network will ever -// exceed MAX_STRING_CHARS -#define MAX_STRING_CHARS 1024 // max length of a string passed to Cmd_TokenizeString -#define MAX_STRING_TOKENS 256 // max tokens resulting from Cmd_TokenizeString -#define MAX_TOKEN_CHARS 1024 // max length of an individual token - -#define MAX_INFO_STRING 1024 -#define MAX_INFO_KEY 1024 -#define MAX_INFO_VALUE 1024 - - -#define MAX_QPATH 64 // max length of a quake game pathname -#define MAX_OSPATH 128 // max length of a filesystem pathname - -#define MAX_NAME_LENGTH 32 // max length of a client name - -// paramters for command buffer stuffing -typedef enum { - EXEC_NOW, // don't return until completed, a VM should NEVER use this, - // because some commands might cause the VM to be unloaded... - EXEC_INSERT, // insert at current position, but don't run yet - EXEC_APPEND // add to end of the command buffer (normal case) -} cbufExec_t; - - -// -// these aren't needed by any of the VMs. put in another header? -// -#define MAX_MAP_AREA_BYTES 32 // bit vector of area visibility - -#undef ERR_FATAL // malloc.h on unix - -// parameters to the main Error routine -typedef enum { - ERR_NONE, - ERR_FATAL, // exit the entire game with a popup window - ERR_DROP, // print to console and disconnect from game - ERR_DISCONNECT, // don't kill server - ERR_NEED_CD // pop up the need-cd dialog -} errorParm_t; - - -// font rendering values used by ui and cgame - -#define PROP_GAP_WIDTH 3 -#define PROP_SPACE_WIDTH 8 -#define PROP_HEIGHT 27 -#define PROP_SMALL_SIZE_SCALE 0.75 - -#define BLINK_DIVISOR 200 -#define PULSE_DIVISOR 75 - -#define UI_LEFT 0x00000000 // default -#define UI_CENTER 0x00000001 -#define UI_RIGHT 0x00000002 -#define UI_FORMATMASK 0x00000007 -#define UI_SMALLFONT 0x00000010 -#define UI_BIGFONT 0x00000020 // default -#define UI_GIANTFONT 0x00000040 -#define UI_DROPSHADOW 0x00000800 -#define UI_BLINK 0x00001000 -#define UI_INVERSE 0x00002000 -#define UI_PULSE 0x00004000 - - -/* -============================================================== - -MATHLIB - -============================================================== -*/ -#ifdef __cplusplus // so we can include this in C code -#define SIDE_FRONT 0 -#define SIDE_BACK 1 -#define SIDE_ON 2 -#define SIDE_CROSS 3 - -#define Q_PI 3.14159265358979323846 -#ifndef M_PI -#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h -#endif - -#include "math_vector.h" -#include "math_angles.h" -#include "math_matrix.h" -#include "math_quaternion.h" - -class idVec3_t; // for defining vectors -typedef idVec3_t &vec3_p; // for passing vectors as function arguments -typedef const idVec3_t &vec3_c; // for passing vectors as const function arguments - -class angles_t; // for defining angle vectors -typedef angles_t &angles_p; // for passing angles as function arguments -typedef const angles_t &angles_c; // for passing angles as const function arguments - -class mat3_t; // for defining matrices -typedef mat3_t &mat3_p; // for passing matrices as function arguments -typedef const mat3_t &mat3_c; // for passing matrices as const function arguments - - - -#define NUMVERTEXNORMALS 162 -extern idVec3_t bytedirs[NUMVERTEXNORMALS]; - -// all drawing is done to a 640*480 virtual screen size -// and will be automatically scaled to the real resolution -#define SCREEN_WIDTH 640 -#define SCREEN_HEIGHT 480 - -#define TINYCHAR_WIDTH (SMALLCHAR_WIDTH) -#define TINYCHAR_HEIGHT (SMALLCHAR_HEIGHT/2) - -#define SMALLCHAR_WIDTH 8 -#define SMALLCHAR_HEIGHT 16 - -#define BIGCHAR_WIDTH 16 -#define BIGCHAR_HEIGHT 16 - -#define GIANTCHAR_WIDTH 32 -#define GIANTCHAR_HEIGHT 48 - -extern vec4_t colorBlack; -extern vec4_t colorRed; -extern vec4_t colorGreen; -extern vec4_t colorBlue; -extern vec4_t colorYellow; -extern vec4_t colorMagenta; -extern vec4_t colorCyan; -extern vec4_t colorWhite; -extern vec4_t colorLtGrey; -extern vec4_t colorMdGrey; -extern vec4_t colorDkGrey; - -#define Q_COLOR_ESCAPE '^' -#define Q_IsColorString(p) ( p && *(p) == Q_COLOR_ESCAPE && *((p)+1) && *((p)+1) != Q_COLOR_ESCAPE ) - -#define COLOR_BLACK '0' -#define COLOR_RED '1' -#define COLOR_GREEN '2' -#define COLOR_YELLOW '3' -#define COLOR_BLUE '4' -#define COLOR_CYAN '5' -#define COLOR_MAGENTA '6' -#define COLOR_WHITE '7' -#define ColorIndex(c) ( ( (c) - '0' ) & 7 ) - -#define S_COLOR_BLACK "^0" -#define S_COLOR_RED "^1" -#define S_COLOR_GREEN "^2" -#define S_COLOR_YELLOW "^3" -#define S_COLOR_BLUE "^4" -#define S_COLOR_CYAN "^5" -#define S_COLOR_MAGENTA "^6" -#define S_COLOR_WHITE "^7" - -extern vec4_t g_color_table[8]; - -#define MAKERGB( v, r, g, b ) v[0]=r;v[1]=g;v[2]=b -#define MAKERGBA( v, r, g, b, a ) v[0]=r;v[1]=g;v[2]=b;v[3]=a - -#define DEG2RAD( a ) ( ( (a) * M_PI ) / 180.0F ) -#define RAD2DEG( a ) ( ( (a) * 180.0f ) / M_PI ) - -struct cplane_s; - -extern idVec3_t vec3_origin; -extern vec4_t vec4_origin; -extern mat3_t axisDefault; - -#define nanmask (255<<23) - -#define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask) - -float Q_fabs( float f ); -float Q_rsqrt( float f ); // reciprocal square root - -#define SQRTFAST( x ) ( 1.0f / Q_rsqrt( x ) ) - -signed char ClampChar( int i ); -signed short ClampShort( int i ); - -// this isn't a real cheap function to call! -int DirToByte( const idVec3_t &dir ); -void ByteToDir( int b, vec3_p dir ); - -#define DotProduct(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2]) -#define VectorSubtract(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2]) -#define VectorAdd(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2]) -#define VectorCopy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2]) -//#define VectorCopy(a,b) ((b).x=(a).x,(b).y=(a).y,(b).z=(a).z]) - -#define VectorScale(v, s, o) ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s)) -#define VectorMA(v, s, b, o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s)) -#define CrossProduct(a,b,c) ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0]) - -#define DotProduct4(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]+(x)[3]*(y)[3]) -#define VectorSubtract4(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2],(c)[3]=(a)[3]-(b)[3]) -#define VectorAdd4(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2],(c)[3]=(a)[3]+(b)[3]) -#define VectorCopy4(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3]) -#define VectorScale4(v, s, o) ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s),(o)[3]=(v)[3]*(s)) -#define VectorMA4(v, s, b, o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s),(o)[3]=(v)[3]+(b)[3]*(s)) - - -#define VectorClear(a) ((a)[0]=(a)[1]=(a)[2]=0) -#define VectorNegate(a,b) ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2]) -#define VectorSet(v, x, y, z) ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z)) -#define Vector4Copy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3]) - -#define SnapVector(v) {v[0]=(int)v[0];v[1]=(int)v[1];v[2]=(int)v[2];} - -float NormalizeColor( vec3_c in, vec3_p out ); - -int VectorCompare( vec3_c v1, vec3_c v2 ); -float VectorLength( vec3_c v ); -float Distance( vec3_c p1, vec3_c p2 ); -float DistanceSquared( vec3_c p1, vec3_c p2 ); -float VectorNormalize (vec3_p v); // returns vector length -void VectorNormalizeFast(vec3_p v); // does NOT return vector length, uses rsqrt approximation -float VectorNormalize2( vec3_c v, vec3_p out ); -void VectorInverse (vec3_p v); -void VectorRotate( vec3_c in, mat3_c matrix, vec3_p out ); -void VectorPolar(vec3_p v, float radius, float theta, float phi); -void VectorSnap(vec3_p v); -void Vector53Copy( const idVec5_t &in, vec3_p out); -void Vector5Scale( const idVec5_t &v, float scale, idVec5_t &out); -void Vector5Add( const idVec5_t &va, const idVec5_t &vb, idVec5_t &out); -void VectorRotate3( vec3_c vIn, vec3_c vRotation, vec3_p out); -void VectorRotate3Origin(vec3_c vIn, vec3_c vRotation, vec3_c vOrigin, vec3_p out); - - -int Q_log2(int val); - -int Q_rand( int *seed ); -float Q_random( int *seed ); -float Q_crandom( int *seed ); - -#define random() ((rand () & 0x7fff) / ((float)0x7fff)) -#define crandom() (2.0 * (random() - 0.5)) - -float Q_rint( float in ); - -void vectoangles( vec3_c value1, angles_p angles); -void AnglesToAxis( angles_c angles, mat3_p axis ); - -void AxisCopy( mat3_c in, mat3_p out ); -qboolean AxisRotated( mat3_c in ); // assumes a non-degenerate axis - -int SignbitsForNormal( vec3_c normal ); -int BoxOnPlaneSide( const Bounds &b, struct cplane_s *p ); - -float AngleMod(float a); -float LerpAngle (float from, float to, float frac); -float AngleSubtract( float a1, float a2 ); -void AnglesSubtract( angles_c v1, angles_c v2, angles_p v3 ); - -float AngleNormalize360 ( float angle ); -float AngleNormalize180 ( float angle ); -float AngleDelta ( float angle1, float angle2 ); - -qboolean PlaneFromPoints( vec4_t &plane, vec3_c a, vec3_c b, vec3_c c ); -void ProjectPointOnPlane( vec3_p dst, vec3_c p, vec3_c normal ); -void RotatePointAroundVector( vec3_p dst, vec3_c dir, vec3_c point, float degrees ); -void RotateAroundDirection( mat3_p axis, float yaw ); -void MakeNormalVectors( vec3_c forward, vec3_p right, vec3_p up ); -// perpendicular vector could be replaced by this - -int PlaneTypeForNormal( vec3_c normal ); - -void MatrixMultiply( mat3_c in1, mat3_c in2, mat3_p out ); -void MatrixInverseMultiply( mat3_c in1, mat3_c in2, mat3_p out ); // in2 is transposed during multiply -void MatrixTransformVector( vec3_c in, mat3_c matrix, vec3_p out ); -void MatrixProjectVector( vec3_c in, mat3_c matrix, vec3_p out ); // Places the vector into a new coordinate system. -void AngleVectors( angles_c angles, vec3_p forward, vec3_p right, vec3_p up); -void PerpendicularVector( vec3_p dst, vec3_c src ); - -float TriangleArea( vec3_c a, vec3_c b, vec3_c c ); -#endif // __cplusplus - -//============================================= - -float Com_Clamp( float min, float max, float value ); - -#define FILE_HASH_SIZE 1024 -int Com_HashString( const char *fname ); - -char *Com_SkipPath( char *pathname ); - -// it is ok for out == in -void Com_StripExtension( const char *in, char *out ); - -// "extension" should include the dot: ".map" -void Com_DefaultExtension( char *path, int maxSize, const char *extension ); - -int Com_ParseInfos( const char *buf, int max, char infos[][MAX_INFO_STRING] ); - -/* -===================================================================================== - -SCRIPT PARSING - -===================================================================================== -*/ - -// this just controls the comment printing, it doesn't actually load a file -void Com_BeginParseSession( const char *filename ); -void Com_EndParseSession( void ); - -int Com_GetCurrentParseLine( void ); - -// Will never return NULL, just empty strings. -// An empty string will only be returned at end of file. -// ParseOnLine will return empty if there isn't another token on this line - -// this funny typedef just means a moving pointer into a const char * buffer -const char *Com_Parse( const char *(*data_p) ); -const char *Com_ParseOnLine( const char *(*data_p) ); -const char *Com_ParseRestOfLine( const char *(*data_p) ); - -void Com_UngetToken( void ); - -#ifdef __cplusplus -void Com_MatchToken( const char *(*buf_p), const char *match, qboolean warning = qfalse ); -#else -void Com_MatchToken( const char *(*buf_p), const char *match, qboolean warning ); -#endif - -void Com_ScriptError( const char *msg, ... ); -void Com_ScriptWarning( const char *msg, ... ); - -void Com_SkipBracedSection( const char *(*program) ); -void Com_SkipRestOfLine( const char *(*data) ); - -float Com_ParseFloat( const char *(*buf_p) ); -int Com_ParseInt( const char *(*buf_p) ); - -void Com_Parse1DMatrix( const char *(*buf_p), int x, float *m ); -void Com_Parse2DMatrix( const char *(*buf_p), int y, int x, float *m ); -void Com_Parse3DMatrix( const char *(*buf_p), int z, int y, int x, float *m ); - -//===================================================================================== -#ifdef __cplusplus - extern "C" { -#endif - -void QDECL Com_sprintf (char *dest, int size, const char *fmt, ...); - - -// mode parm for FS_FOpenFile -typedef enum { - FS_READ, - FS_WRITE, - FS_APPEND, - FS_APPEND_SYNC -} fsMode_t; - -typedef enum { - FS_SEEK_CUR, - FS_SEEK_END, - FS_SEEK_SET -} fsOrigin_t; - -//============================================= - -int Q_isprint( int c ); -int Q_islower( int c ); -int Q_isupper( int c ); -int Q_isalpha( int c ); - -// portable case insensitive compare -int Q_stricmp (const char *s1, const char *s2); -int Q_strncmp (const char *s1, const char *s2, int n); -int Q_stricmpn (const char *s1, const char *s2, int n); -char *Q_strlwr( char *s1 ); -char *Q_strupr( char *s1 ); -char *Q_strrchr( const char* string, int c ); - -// 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 ); - -// strlen that discounts Quake color sequences -int Q_PrintStrlen( const char *string ); -// removes color sequences from string -char *Q_CleanStr( char *string ); - -int Com_Filter( const char *filter, const char *name, int casesensitive ); -const char *Com_StringContains( const char *str1, const char *str2, int casesensitive ); - - -//============================================= - -short BigShort(short l); -short LittleShort(short l); -int BigLong (int l); -int LittleLong (int l); -float BigFloat (float l); -float LittleFloat (float l); - -void Swap_Init (void); -char * QDECL va(char *format, ...); - -#ifdef __cplusplus - } -#endif - - -//============================================= -#ifdef __cplusplus -// -// mapfile parsing -// -typedef struct ePair_s { - char *key; - char *value; -} ePair_t; - -typedef struct mapSide_s { - char material[MAX_QPATH]; - vec4_t plane; - vec4_t textureVectors[2]; -} mapSide_t; - -typedef struct { - int numSides; - mapSide_t **sides; -} mapBrush_t; - -typedef struct { - idVec3_t xyz; - float st[2]; -} patchVertex_t; - -typedef struct { - char material[MAX_QPATH]; - int width, height; - patchVertex_t *patchVerts; -} mapPatch_t; - -typedef struct { - char modelName[MAX_QPATH]; - float matrix[16]; -} mapModel_t; - -typedef struct mapPrimitive_s { - int numEpairs; - ePair_t **ePairs; - - // only one of these will be non-NULL - mapBrush_t *brush; - mapPatch_t *patch; - mapModel_t *model; -} mapPrimitive_t; - -typedef struct mapEntity_s { - int numPrimitives; - mapPrimitive_t **primitives; - - int numEpairs; - ePair_t **ePairs; -} mapEntity_t; - -typedef struct { - int numEntities; - mapEntity_t **entities; -} mapFile_t; - - -// the order of entities, brushes, and sides will be maintained, the -// lists won't be swapped on each load or save -mapFile_t *ParseMapFile( const char *text ); -void FreeMapFile( mapFile_t *mapFile ); -void WriteMapFile( const mapFile_t *mapFile, FILE *f ); - -// key names are case-insensitive -const char *ValueForMapEntityKey( const mapEntity_t *ent, const char *key ); -float FloatForMapEntityKey( const mapEntity_t *ent, const char *key ); -qboolean GetVectorForMapEntityKey( const mapEntity_t *ent, const char *key, idVec3_t &vec ); - -typedef struct { - idVec3_t xyz; - idVec2_t st; - idVec3_t normal; - idVec3_t tangents[2]; - byte smoothing[4]; // colors for silhouette smoothing -} drawVert_t; - -typedef struct { - int width, height; - drawVert_t *verts; -} drawVertMesh_t; - -// Tesselate a map patch into smoothed, drawable vertexes -// MaxError of around 4 is reasonable -drawVertMesh_t *SubdivideMapPatch( const mapPatch_t *patch, float maxError ); -#endif // __cplusplus - -//========================================= - -#ifdef __cplusplus - extern "C" { -#endif - -void QDECL Com_Error( int level, const char *error, ... ); -void QDECL Com_Printf( const char *msg, ... ); -void QDECL Com_DPrintf( const char *msg, ... ); - -#ifdef __cplusplus - } -#endif - - -typedef struct { - qboolean frameMemory; - int currentElements; - int maxElements; // will reallocate and move when exceeded - void **elements; -} growList_t; - -// you don't need to init the growlist if you don't mind it growing and moving -// the list as it expands -void Com_InitGrowList( growList_t *list, int maxElements ); -int Com_AddToGrowList( growList_t *list, void *data ); -void *Com_GrowListElement( const growList_t *list, int index ); -int Com_IndexForGrowListElement( const growList_t *list, const void *element ); - - -// -// key / value info strings -// -char *Info_ValueForKey( const char *s, const char *key ); -void Info_RemoveKey( char *s, const char *key ); -void Info_SetValueForKey( char *s, const char *key, const char *value ); -qboolean Info_Validate( const char *s ); -void Info_NextPair( const char *(*s), char key[MAX_INFO_KEY], char value[MAX_INFO_VALUE] ); - -// get cvar defs, collision defs, etc -//#include "../shared/interface.h" - -// get key code numbers for events -//#include "../shared/keycodes.h" - -#ifdef __cplusplus -// get the polygon winding functions -//#include "../shared/windings.h" - -// get the flags class -//#include "../shared/idflags.h" -#endif // __cplusplus - -#endif // __Q_SHARED_H - diff --git a/code/splines/q_shared.hpp b/code/splines/q_shared.hpp deleted file mode 100644 index faaaa22..0000000 --- a/code/splines/q_shared.hpp +++ /dev/null @@ -1,810 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifndef __Q_SHARED_H -#define __Q_SHARED_H - -// q_shared.h -- included first by ALL program modules. -// these are the definitions that have no dependance on -// central system services, and can be used by any part -// of the program without any state issues. - -// A user mod should never modify this file - -// incursion of DOOM code into the Q3A codebase -//#define Q3_VERSION "DOOM 0.01" - -// alignment macros for SIMD -#define ALIGN_ON -#define ALIGN_OFF - -#ifdef _WIN32 - -#pragma warning(disable : 4018) // signed/unsigned mismatch -#pragma warning(disable : 4032) -#pragma warning(disable : 4051) -#pragma warning(disable : 4057) // slightly different base types -#pragma warning(disable : 4100) // unreferenced formal parameter -#pragma warning(disable : 4115) -#pragma warning(disable : 4125) // decimal digit terminates octal escape sequence -#pragma warning(disable : 4127) // conditional expression is constant -#pragma warning(disable : 4136) -#pragma warning(disable : 4201) -#pragma warning(disable : 4214) -#pragma warning(disable : 4244) -#pragma warning(disable : 4305) // truncation from const double to float -#pragma warning(disable : 4310) // cast truncates constant value -#pragma warning(disable : 4514) -#pragma warning(disable : 4711) // selected for automatic inline expansion -#pragma warning(disable : 4220) // varargs matches remaining parameters - -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef WIN32 // mac doesn't have malloc.h -#include // for _alloca() -#endif -#ifdef _WIN32 - -//#pragma intrinsic( memset, memcpy ) - -#endif - - -// this is the define for determining if we have an asm version of a C function -#if (defined _M_IX86 || defined __i386__) && !defined __sun__ && !defined __LCC__ -#define id386 1 -#else -#define id386 0 -#endif - -// for windows fastcall option - -#define QDECL - -//======================= WIN32 DEFINES ================================= - -#ifdef WIN32 - -#define MAC_STATIC - -#undef QDECL -#define QDECL __cdecl - -// buildstring will be incorporated into the version string -#ifdef NDEBUG -#ifdef _M_IX86 -#define CPUSTRING "win-x86" -#elif defined _M_ALPHA -#define CPUSTRING "win-AXP" -#endif -#else -#ifdef _M_IX86 -#define CPUSTRING "win-x86-debug" -#elif defined _M_ALPHA -#define CPUSTRING "win-AXP-debug" -#endif -#endif - - -#define PATH_SEP '\\' - -#endif - -//======================= MAC OS X SERVER DEFINES ===================== - -#if defined(__MACH__) && defined(__APPLE__) - -#define MAC_STATIC - -#ifdef __ppc__ -#define CPUSTRING "MacOSXS-ppc" -#elif defined __i386__ -#define CPUSTRING "MacOSXS-i386" -#else -#define CPUSTRING "MacOSXS-other" -#endif - -#define PATH_SEP '/' - -#define GAME_HARD_LINKED -#define CGAME_HARD_LINKED -#define UI_HARD_LINKED -#define _alloca alloca - -#undef ALIGN_ON -#undef ALIGN_OFF -#define ALIGN_ON #pragma align(16) -#define ALIGN_OFF #pragma align() - -#ifdef __cplusplus - extern "C" { -#endif - -void *osxAllocateMemory(long size); -void osxFreeMemory(void *pointer); - -#ifdef __cplusplus - } -#endif - -#endif - -//======================= MAC DEFINES ================================= - -#ifdef __MACOS__ - -#define MAC_STATIC static - -#define CPUSTRING "MacOS-PPC" - -#define PATH_SEP ':' - -void Sys_PumpEvents( void ); - -#endif - -#ifdef __MRC__ - -#define MAC_STATIC - -#define CPUSTRING "MacOS-PPC" - -#define PATH_SEP ':' - -void Sys_PumpEvents( void ); - -#undef QDECL -#define QDECL __cdecl - -#define _alloca alloca -#endif - -//======================= LINUX DEFINES ================================= - -// the mac compiler can't handle >32k of locals, so we -// just waste space and make big arrays static... -#ifdef __linux__ - -// bk001205 - from Makefile -#define stricmp strcasecmp - -#define MAC_STATIC // bk: FIXME - -#ifdef __i386__ -#define CPUSTRING "linux-i386" -#elif defined __axp__ -#define CPUSTRING "linux-alpha" -#else -#define CPUSTRING "linux-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 - -#endif - -//============================================================= - - - -typedef enum {qfalse, qtrue} qboolean; - -typedef unsigned char byte; - -#define EQUAL_EPSILON 0.001 - -typedef int qhandle_t; -typedef int sfxHandle_t; -typedef int fileHandle_t; -typedef int clipHandle_t; - -typedef enum { - INVALID_JOINT = -1 -} jointHandle_t; - -#ifndef NULL -#define NULL ((void *)0) -#endif - -#define MAX_QINT 0x7fffffff -#define MIN_QINT (-MAX_QINT-1) - -#ifndef max -#define max( x, y ) ( ( ( x ) > ( y ) ) ? ( x ) : ( y ) ) -#define min( x, y ) ( ( ( x ) < ( y ) ) ? ( x ) : ( y ) ) -#endif - -#ifndef sign -#define sign( f ) ( ( f > 0 ) ? 1 : ( ( f < 0 ) ? -1 : 0 ) ) -#endif - -// angle indexes -#define PITCH 0 // up / down -#define YAW 1 // left / right -#define ROLL 2 // fall over - -// the game guarantees that no string from the network will ever -// exceed MAX_STRING_CHARS -#define MAX_STRING_CHARS 1024 // max length of a string passed to Cmd_TokenizeString -#define MAX_STRING_TOKENS 256 // max tokens resulting from Cmd_TokenizeString -#define MAX_TOKEN_CHARS 1024 // max length of an individual token - -#define MAX_INFO_STRING 1024 -#define MAX_INFO_KEY 1024 -#define MAX_INFO_VALUE 1024 - - -#define MAX_QPATH 64 // max length of a quake game pathname -#define MAX_OSPATH 128 // max length of a filesystem pathname - -#define MAX_NAME_LENGTH 32 // max length of a client name - -// paramters for command buffer stuffing -typedef enum { - EXEC_NOW, // don't return until completed, a VM should NEVER use this, - // because some commands might cause the VM to be unloaded... - EXEC_INSERT, // insert at current position, but don't run yet - EXEC_APPEND // add to end of the command buffer (normal case) -} cbufExec_t; - - -// -// these aren't needed by any of the VMs. put in another header? -// -#define MAX_MAP_AREA_BYTES 32 // bit vector of area visibility - -#undef ERR_FATAL // malloc.h on unix - -// parameters to the main Error routine -typedef enum { - ERR_NONE, - ERR_FATAL, // exit the entire game with a popup window - ERR_DROP, // print to console and disconnect from game - ERR_DISCONNECT, // don't kill server - ERR_NEED_CD // pop up the need-cd dialog -} errorParm_t; - - -// font rendering values used by ui and cgame - -#define PROP_GAP_WIDTH 3 -#define PROP_SPACE_WIDTH 8 -#define PROP_HEIGHT 27 -#define PROP_SMALL_SIZE_SCALE 0.75 - -#define BLINK_DIVISOR 200 -#define PULSE_DIVISOR 75 - -#define UI_LEFT 0x00000000 // default -#define UI_CENTER 0x00000001 -#define UI_RIGHT 0x00000002 -#define UI_FORMATMASK 0x00000007 -#define UI_SMALLFONT 0x00000010 -#define UI_BIGFONT 0x00000020 // default -#define UI_GIANTFONT 0x00000040 -#define UI_DROPSHADOW 0x00000800 -#define UI_BLINK 0x00001000 -#define UI_INVERSE 0x00002000 -#define UI_PULSE 0x00004000 - - -/* -============================================================== - -MATHLIB - -============================================================== -*/ -#ifdef __cplusplus // so we can include this in C code -#define SIDE_FRONT 0 -#define SIDE_BACK 1 -#define SIDE_ON 2 -#define SIDE_CROSS 3 - -#define Q_PI 3.14159265358979323846 -#ifndef M_PI -#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h -#endif - -#include "math_vector.h" -#include "math_angles.h" -#include "math_matrix.h" -#include "math_quaternion.h" - -class idVec3_t; // for defining vectors -typedef idVec3_t &vec3_p; // for passing vectors as function arguments -typedef const idVec3_t &vec3_c; // for passing vectors as const function arguments - -class angles_t; // for defining angle vectors -typedef angles_t &angles_p; // for passing angles as function arguments -typedef const angles_t &angles_c; // for passing angles as const function arguments - -class mat3_t; // for defining matrices -typedef mat3_t &mat3_p; // for passing matrices as function arguments -typedef const mat3_t &mat3_c; // for passing matrices as const function arguments - - - -#define NUMVERTEXNORMALS 162 -extern idVec3_t bytedirs[NUMVERTEXNORMALS]; - -// all drawing is done to a 640*480 virtual screen size -// and will be automatically scaled to the real resolution -#define SCREEN_WIDTH 640 -#define SCREEN_HEIGHT 480 - -#define TINYCHAR_WIDTH (SMALLCHAR_WIDTH) -#define TINYCHAR_HEIGHT (SMALLCHAR_HEIGHT/2) - -#define SMALLCHAR_WIDTH 8 -#define SMALLCHAR_HEIGHT 16 - -#define BIGCHAR_WIDTH 16 -#define BIGCHAR_HEIGHT 16 - -#define GIANTCHAR_WIDTH 32 -#define GIANTCHAR_HEIGHT 48 - -extern vec4_t colorBlack; -extern vec4_t colorRed; -extern vec4_t colorGreen; -extern vec4_t colorBlue; -extern vec4_t colorYellow; -extern vec4_t colorMagenta; -extern vec4_t colorCyan; -extern vec4_t colorWhite; -extern vec4_t colorLtGrey; -extern vec4_t colorMdGrey; -extern vec4_t colorDkGrey; - -#define Q_COLOR_ESCAPE '^' -#define Q_IsColorString(p) ( p && *(p) == Q_COLOR_ESCAPE && *((p)+1) && *((p)+1) != Q_COLOR_ESCAPE ) - -#define COLOR_BLACK '0' -#define COLOR_RED '1' -#define COLOR_GREEN '2' -#define COLOR_YELLOW '3' -#define COLOR_BLUE '4' -#define COLOR_CYAN '5' -#define COLOR_MAGENTA '6' -#define COLOR_WHITE '7' -#define ColorIndex(c) ( ( (c) - '0' ) & 7 ) - -#define S_COLOR_BLACK "^0" -#define S_COLOR_RED "^1" -#define S_COLOR_GREEN "^2" -#define S_COLOR_YELLOW "^3" -#define S_COLOR_BLUE "^4" -#define S_COLOR_CYAN "^5" -#define S_COLOR_MAGENTA "^6" -#define S_COLOR_WHITE "^7" - -extern vec4_t g_color_table[8]; - -#define MAKERGB( v, r, g, b ) v[0]=r;v[1]=g;v[2]=b -#define MAKERGBA( v, r, g, b, a ) v[0]=r;v[1]=g;v[2]=b;v[3]=a - -#define DEG2RAD( a ) ( ( (a) * M_PI ) / 180.0F ) -#define RAD2DEG( a ) ( ( (a) * 180.0f ) / M_PI ) - -struct cplane_s; - -extern idVec3_t vec3_origin; -extern vec4_t vec4_origin; -extern mat3_t axisDefault; - -#define nanmask (255<<23) - -#define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask) - -float Q_fabs( float f ); -float Q_rsqrt( float f ); // reciprocal square root - -#define SQRTFAST( x ) ( 1.0f / Q_rsqrt( x ) ) - -signed char ClampChar( int i ); -signed short ClampShort( int i ); - -// this isn't a real cheap function to call! -int DirToByte( const idVec3_t &dir ); -void ByteToDir( int b, vec3_p dir ); - -#define DotProduct(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2]) -#define VectorSubtract(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2]) -#define VectorAdd(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2]) -#define VectorCopy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2]) -//#define VectorCopy(a,b) ((b).x=(a).x,(b).y=(a).y,(b).z=(a).z]) - -#define VectorScale(v, s, o) ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s)) -#define VectorMA(v, s, b, o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s)) -#define CrossProduct(a,b,c) ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0]) - -#define DotProduct4(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]+(x)[3]*(y)[3]) -#define VectorSubtract4(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2],(c)[3]=(a)[3]-(b)[3]) -#define VectorAdd4(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2],(c)[3]=(a)[3]+(b)[3]) -#define VectorCopy4(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3]) -#define VectorScale4(v, s, o) ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s),(o)[3]=(v)[3]*(s)) -#define VectorMA4(v, s, b, o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s),(o)[3]=(v)[3]+(b)[3]*(s)) - - -#define VectorClear(a) ((a)[0]=(a)[1]=(a)[2]=0) -#define VectorNegate(a,b) ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2]) -#define VectorSet(v, x, y, z) ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z)) -#define Vector4Copy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3]) - -#define SnapVector(v) {v[0]=(int)v[0];v[1]=(int)v[1];v[2]=(int)v[2];} - -float NormalizeColor( vec3_c in, vec3_p out ); - -int VectorCompare( vec3_c v1, vec3_c v2 ); -float VectorLength( vec3_c v ); -float Distance( vec3_c p1, vec3_c p2 ); -float DistanceSquared( vec3_c p1, vec3_c p2 ); -float VectorNormalize (vec3_p v); // returns vector length -void VectorNormalizeFast(vec3_p v); // does NOT return vector length, uses rsqrt approximation -float VectorNormalize2( vec3_c v, vec3_p out ); -void VectorInverse (vec3_p v); -void VectorRotate( vec3_c in, mat3_c matrix, vec3_p out ); -void VectorPolar(vec3_p v, float radius, float theta, float phi); -void VectorSnap(vec3_p v); -void Vector53Copy( const idVec5_t &in, vec3_p out); -void Vector5Scale( const idVec5_t &v, float scale, idVec5_t &out); -void Vector5Add( const idVec5_t &va, const idVec5_t &vb, idVec5_t &out); -void VectorRotate3( vec3_c vIn, vec3_c vRotation, vec3_p out); -void VectorRotate3Origin(vec3_c vIn, vec3_c vRotation, vec3_c vOrigin, vec3_p out); - - -int Q_log2(int val); - -int Q_rand( int *seed ); -float Q_random( int *seed ); -float Q_crandom( int *seed ); - -#define random() ((rand () & 0x7fff) / ((float)0x7fff)) -#define crandom() (2.0 * (random() - 0.5)) - -float Q_rint( float in ); - -void vectoangles( vec3_c value1, angles_p angles); -void AnglesToAxis( angles_c angles, mat3_p axis ); - -void AxisCopy( mat3_c in, mat3_p out ); -qboolean AxisRotated( mat3_c in ); // assumes a non-degenerate axis - -int SignbitsForNormal( vec3_c normal ); -int BoxOnPlaneSide( const Bounds &b, struct cplane_s *p ); - -float AngleMod(float a); -float LerpAngle (float from, float to, float frac); -float AngleSubtract( float a1, float a2 ); -void AnglesSubtract( angles_c v1, angles_c v2, angles_p v3 ); - -float AngleNormalize360 ( float angle ); -float AngleNormalize180 ( float angle ); -float AngleDelta ( float angle1, float angle2 ); - -qboolean PlaneFromPoints( vec4_t &plane, vec3_c a, vec3_c b, vec3_c c ); -void ProjectPointOnPlane( vec3_p dst, vec3_c p, vec3_c normal ); -void RotatePointAroundVector( vec3_p dst, vec3_c dir, vec3_c point, float degrees ); -void RotateAroundDirection( mat3_p axis, float yaw ); -void MakeNormalVectors( vec3_c forward, vec3_p right, vec3_p up ); -// perpendicular vector could be replaced by this - -int PlaneTypeForNormal( vec3_c normal ); - -void MatrixMultiply( mat3_c in1, mat3_c in2, mat3_p out ); -void MatrixInverseMultiply( mat3_c in1, mat3_c in2, mat3_p out ); // in2 is transposed during multiply -void MatrixTransformVector( vec3_c in, mat3_c matrix, vec3_p out ); -void MatrixProjectVector( vec3_c in, mat3_c matrix, vec3_p out ); // Places the vector into a new coordinate system. -void AngleVectors( angles_c angles, vec3_p forward, vec3_p right, vec3_p up); -void PerpendicularVector( vec3_p dst, vec3_c src ); - -float TriangleArea( vec3_c a, vec3_c b, vec3_c c ); -#endif // __cplusplus - -//============================================= - -float Com_Clamp( float min, float max, float value ); - -#define FILE_HASH_SIZE 1024 -int Com_HashString( const char *fname ); - -char *Com_SkipPath( char *pathname ); - -// it is ok for out == in -void Com_StripExtension( const char *in, char *out ); - -// "extension" should include the dot: ".map" -void Com_DefaultExtension( char *path, int maxSize, const char *extension ); - -int Com_ParseInfos( const char *buf, int max, char infos[][MAX_INFO_STRING] ); - -/* -===================================================================================== - -SCRIPT PARSING - -===================================================================================== -*/ - -// this just controls the comment printing, it doesn't actually load a file -void Com_BeginParseSession( const char *filename ); -void Com_EndParseSession( void ); - -int Com_GetCurrentParseLine( void ); - -// Will never return NULL, just empty strings. -// An empty string will only be returned at end of file. -// ParseOnLine will return empty if there isn't another token on this line - -// this funny typedef just means a moving pointer into a const char * buffer -const char *Com_Parse( const char *(*data_p) ); -const char *Com_ParseOnLine( const char *(*data_p) ); -const char *Com_ParseRestOfLine( const char *(*data_p) ); - -void Com_UngetToken( void ); - -#ifdef __cplusplus -void Com_MatchToken( const char *(*buf_p), const char *match, qboolean warning = qfalse ); -#else -void Com_MatchToken( const char *(*buf_p), const char *match, qboolean warning ); -#endif - -void Com_ScriptError( const char *msg, ... ); -void Com_ScriptWarning( const char *msg, ... ); - -void Com_SkipBracedSection( const char *(*program) ); -void Com_SkipRestOfLine( const char *(*data) ); - -float Com_ParseFloat( const char *(*buf_p) ); -int Com_ParseInt( const char *(*buf_p) ); - -void Com_Parse1DMatrix( const char *(*buf_p), int x, float *m ); -void Com_Parse2DMatrix( const char *(*buf_p), int y, int x, float *m ); -void Com_Parse3DMatrix( const char *(*buf_p), int z, int y, int x, float *m ); - -//===================================================================================== -#ifdef __cplusplus - extern "C" { -#endif - -void QDECL Com_sprintf (char *dest, int size, const char *fmt, ...); - - -// mode parm for FS_FOpenFile -typedef enum { - FS_READ, - FS_WRITE, - FS_APPEND, - FS_APPEND_SYNC -} fsMode_t; - -typedef enum { - FS_SEEK_CUR, - FS_SEEK_END, - FS_SEEK_SET -} fsOrigin_t; - -//============================================= - -int Q_isprint( int c ); -int Q_islower( int c ); -int Q_isupper( int c ); -int Q_isalpha( int c ); - -// portable case insensitive compare -int Q_stricmp (const char *s1, const char *s2); -int Q_strncmp (const char *s1, const char *s2, int n); -int Q_stricmpn (const char *s1, const char *s2, int n); -char *Q_strlwr( char *s1 ); -char *Q_strupr( char *s1 ); -char *Q_strrchr( const char* string, int c ); - -// 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 ); - -// strlen that discounts Quake color sequences -int Q_PrintStrlen( const char *string ); -// removes color sequences from string -char *Q_CleanStr( char *string ); - -int Com_Filter( const char *filter, const char *name, int casesensitive ); -const char *Com_StringContains( const char *str1, const char *str2, int casesensitive ); - - -//============================================= - -short BigShort(short l); -short LittleShort(short l); -int BigLong (int l); -int LittleLong (int l); -float BigFloat (float l); -float LittleFloat (float l); - -void Swap_Init (void); -char * QDECL va(char *format, ...); - -#ifdef __cplusplus - } -#endif - - -//============================================= -#ifdef __cplusplus -// -// mapfile parsing -// -typedef struct ePair_s { - char *key; - char *value; -} ePair_t; - -typedef struct mapSide_s { - char material[MAX_QPATH]; - vec4_t plane; - vec4_t textureVectors[2]; -} mapSide_t; - -typedef struct { - int numSides; - mapSide_t **sides; -} mapBrush_t; - -typedef struct { - idVec3_t xyz; - float st[2]; -} patchVertex_t; - -typedef struct { - char material[MAX_QPATH]; - int width, height; - patchVertex_t *patchVerts; -} mapPatch_t; - -typedef struct { - char modelName[MAX_QPATH]; - float matrix[16]; -} mapModel_t; - -typedef struct mapPrimitive_s { - int numEpairs; - ePair_t **ePairs; - - // only one of these will be non-NULL - mapBrush_t *brush; - mapPatch_t *patch; - mapModel_t *model; -} mapPrimitive_t; - -typedef struct mapEntity_s { - int numPrimitives; - mapPrimitive_t **primitives; - - int numEpairs; - ePair_t **ePairs; -} mapEntity_t; - -typedef struct { - int numEntities; - mapEntity_t **entities; -} mapFile_t; - - -// the order of entities, brushes, and sides will be maintained, the -// lists won't be swapped on each load or save -mapFile_t *ParseMapFile( const char *text ); -void FreeMapFile( mapFile_t *mapFile ); -void WriteMapFile( const mapFile_t *mapFile, FILE *f ); - -// key names are case-insensitive -const char *ValueForMapEntityKey( const mapEntity_t *ent, const char *key ); -float FloatForMapEntityKey( const mapEntity_t *ent, const char *key ); -qboolean GetVectorForMapEntityKey( const mapEntity_t *ent, const char *key, idVec3_t &vec ); - -typedef struct { - idVec3_t xyz; - idVec2_t st; - idVec3_t normal; - idVec3_t tangents[2]; - byte smoothing[4]; // colors for silhouette smoothing -} drawVert_t; - -typedef struct { - int width, height; - drawVert_t *verts; -} drawVertMesh_t; - -// Tesselate a map patch into smoothed, drawable vertexes -// MaxError of around 4 is reasonable -drawVertMesh_t *SubdivideMapPatch( const mapPatch_t *patch, float maxError ); -#endif // __cplusplus - -//========================================= - -#ifdef __cplusplus - extern "C" { -#endif - -void QDECL Com_Error( int level, const char *error, ... ); -void QDECL Com_Printf( const char *msg, ... ); -void QDECL Com_DPrintf( const char *msg, ... ); - -#ifdef __cplusplus - } -#endif - - -typedef struct { - qboolean frameMemory; - int currentElements; - int maxElements; // will reallocate and move when exceeded - void **elements; -} growList_t; - -// you don't need to init the growlist if you don't mind it growing and moving -// the list as it expands -void Com_InitGrowList( growList_t *list, int maxElements ); -int Com_AddToGrowList( growList_t *list, void *data ); -void *Com_GrowListElement( const growList_t *list, int index ); -int Com_IndexForGrowListElement( const growList_t *list, const void *element ); - - -// -// key / value info strings -// -char *Info_ValueForKey( const char *s, const char *key ); -void Info_RemoveKey( char *s, const char *key ); -void Info_SetValueForKey( char *s, const char *key, const char *value ); -qboolean Info_Validate( const char *s ); -void Info_NextPair( const char *(*s), char key[MAX_INFO_KEY], char value[MAX_INFO_VALUE] ); - -// get cvar defs, collision defs, etc -//#include "../shared/interface.h" - -// get key code numbers for events -//#include "../shared/keycodes.h" - -#ifdef __cplusplus -// get the polygon winding functions -//#include "../shared/windings.h" - -// get the flags class -//#include "../shared/idflags.h" -#endif // __cplusplus - -#endif // __Q_SHARED_H - diff --git a/code/splines/splines.cpp b/code/splines/splines.cpp deleted file mode 100644 index 9bcef08..0000000 --- a/code/splines/splines.cpp +++ /dev/null @@ -1,1250 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ - -//#include "stdafx.h" -//#include "qe3.h" - -#include "q_shared.hpp" -#include "splines.h" - -extern "C" { -int FS_Write( const void *buffer, int len, fileHandle_t h ); -int FS_ReadFile( const char *qpath, void **buffer ); -void FS_FreeFile( void *buffer ); -fileHandle_t FS_FOpenFileWrite( const char *filename ); -void FS_FCloseFile( fileHandle_t f ); -} - -float Q_fabs( float f ) { - int tmp = * ( int * ) &f; - tmp &= 0x7FFFFFFF; - return * ( float * ) &tmp; -} - - -//#include "../shared/windings.h" -//#include "../qcommon/qcommon.h" -//#include "../sys/sys_public.h" -//#include "../game/game_entity.h" - -idCameraDef splineList; -idCameraDef *g_splineList = &splineList; - -idVec3_t idSplineList::zero(0,0,0); -/* -void glLabeledPoint(idVec3_t &color, idVec3_t &point, float size, const char *label) { - qglColor3fv(color); - qglPointSize(size); - qglBegin(GL_POINTS); - qglVertex3fv(point); - qglEnd(); - idVec3_t v = point; - v.x += 1; - v.y += 1; - v.z += 1; - qglRasterPos3fv (v); - qglCallLists (strlen(label), GL_UNSIGNED_BYTE, label); -} - - -void glBox(idVec3_t &color, idVec3_t &point, float size) { - idVec3_t mins(point); - idVec3_t maxs(point); - mins[0] -= size; - mins[1] += size; - mins[2] -= size; - maxs[0] += size; - maxs[1] -= size; - maxs[2] += size; - qglColor3fv(color); - qglBegin(GL_LINE_LOOP); - qglVertex3f(mins[0],mins[1],mins[2]); - qglVertex3f(maxs[0],mins[1],mins[2]); - qglVertex3f(maxs[0],maxs[1],mins[2]); - qglVertex3f(mins[0],maxs[1],mins[2]); - qglEnd(); - qglBegin(GL_LINE_LOOP); - qglVertex3f(mins[0],mins[1],maxs[2]); - qglVertex3f(maxs[0],mins[1],maxs[2]); - qglVertex3f(maxs[0],maxs[1],maxs[2]); - qglVertex3f(mins[0],maxs[1],maxs[2]); - qglEnd(); - - qglBegin(GL_LINES); - qglVertex3f(mins[0],mins[1],mins[2]); - qglVertex3f(mins[0],mins[1],maxs[2]); - qglVertex3f(mins[0],maxs[1],maxs[2]); - qglVertex3f(mins[0],maxs[1],mins[2]); - qglVertex3f(maxs[0],mins[1],mins[2]); - qglVertex3f(maxs[0],mins[1],maxs[2]); - qglVertex3f(maxs[0],maxs[1],maxs[2]); - qglVertex3f(maxs[0],maxs[1],mins[2]); - qglEnd(); - -} - -void splineTest() { - //g_splineList->load("p:/doom/base/maps/test_base1.camera"); -} - -void splineDraw() { - //g_splineList->addToRenderer(); -} - - -//extern void D_DebugLine( const idVec3_t &color, const idVec3_t &start, const idVec3_t &end ); - -void debugLine(idVec3_t &color, float x, float y, float z, float x2, float y2, float z2) { - //idVec3_t from(x, y, z); - //idVec3_t to(x2, y2, z2); - //D_DebugLine(color, from, to); -} - - -void idSplineList::addToRenderer() { - - if (controlPoints.Num() == 0) { - return; - } - - idVec3_t mins, maxs; - idVec3_t yellow(1.0, 1.0, 0); - idVec3_t white(1.0, 1.0, 1.0); - int i; - - for(i = 0; i < controlPoints.Num(); i++) { - VectorCopy(*controlPoints[i], mins); - VectorCopy(mins, maxs); - mins[0] -= 8; - mins[1] += 8; - mins[2] -= 8; - maxs[0] += 8; - maxs[1] -= 8; - maxs[2] += 8; - debugLine( yellow, mins[0], mins[1], mins[2], maxs[0], mins[1], mins[2]); - debugLine( yellow, maxs[0], mins[1], mins[2], maxs[0], maxs[1], mins[2]); - debugLine( yellow, maxs[0], maxs[1], mins[2], mins[0], maxs[1], mins[2]); - debugLine( yellow, mins[0], maxs[1], mins[2], mins[0], mins[1], mins[2]); - - debugLine( yellow, mins[0], mins[1], maxs[2], maxs[0], mins[1], maxs[2]); - debugLine( yellow, maxs[0], mins[1], maxs[2], maxs[0], maxs[1], maxs[2]); - debugLine( yellow, maxs[0], maxs[1], maxs[2], mins[0], maxs[1], maxs[2]); - debugLine( yellow, mins[0], maxs[1], maxs[2], mins[0], mins[1], maxs[2]); - - } - - int step = 0; - idVec3_t step1; - for(i = 3; i < controlPoints.Num(); i++) { - for (float tension = 0.0f; tension < 1.001f; tension += 0.1f) { - float x = 0; - float y = 0; - float z = 0; - for (int j = 0; j < 4; j++) { - x += controlPoints[i - (3 - j)]->x * calcSpline(j, tension); - y += controlPoints[i - (3 - j)]->y * calcSpline(j, tension); - z += controlPoints[i - (3 - j)]->z * calcSpline(j, tension); - } - if (step == 0) { - step1[0] = x; - step1[1] = y; - step1[2] = z; - step = 1; - } else { - debugLine( white, step1[0], step1[1], step1[2], x, y, z); - step = 0; - } - - } - } -} -*/ - -void idSplineList::buildSpline() { - //int start = Sys_Milliseconds(); - clearSpline(); - for(int i = 3; i < controlPoints.Num(); i++) { - for (float tension = 0.0f; tension < 1.001f; tension += granularity) { - float x = 0; - float y = 0; - float z = 0; - for (int j = 0; j < 4; j++) { - x += controlPoints[i - (3 - j)]->x * calcSpline(j, tension); - y += controlPoints[i - (3 - j)]->y * calcSpline(j, tension); - z += controlPoints[i - (3 - j)]->z * calcSpline(j, tension); - } - splinePoints.Append(new idVec3_t(x, y, z)); - } - } - dirty = false; - //Com_Printf("Spline build took %f seconds\n", (float)(Sys_Milliseconds() - start) / 1000); -} - -/* -void idSplineList::draw(bool editMode) { - int i; - vec4_t yellow(1, 1, 0, 1); - - if (controlPoints.Num() == 0) { - return; - } - - if (dirty) { - buildSpline(); - } - - - qglColor3fv(controlColor); - qglPointSize(5); - - qglBegin(GL_POINTS); - for (i = 0; i < controlPoints.Num(); i++) { - qglVertex3fv(*controlPoints[i]); - } - qglEnd(); - - if (editMode) { - for(i = 0; i < controlPoints.Num(); i++) { - glBox(activeColor, *controlPoints[i], 4); - } - } - - //Draw the curve - qglColor3fv(pathColor); - qglBegin(GL_LINE_STRIP); - int count = splinePoints.Num(); - for (i = 0; i < count; i++) { - qglVertex3fv(*splinePoints[i]); - } - qglEnd(); - - if (editMode) { - qglColor3fv(segmentColor); - qglPointSize(3); - qglBegin(GL_POINTS); - for (i = 0; i < count; i++) { - qglVertex3fv(*splinePoints[i]); - } - qglEnd(); - } - if (count > 0) { - //assert(activeSegment >=0 && activeSegment < count); - if (activeSegment >=0 && activeSegment < count) { - glBox(activeColor, *splinePoints[activeSegment], 6); - glBox(yellow, *splinePoints[activeSegment], 8); - } - } - -} -*/ - -float idSplineList::totalDistance() { - - if (controlPoints.Num() == 0) { - return 0.0; - } - - if (dirty) { - buildSpline(); - } - - float dist = 0.0; - idVec3_t temp; - int count = splinePoints.Num(); - for(int i = 1; i < count; i++) { - temp = *splinePoints[i-1]; - temp -= *splinePoints[i]; - dist += temp.Length(); - } - return dist; -} - -void idSplineList::initPosition(long bt, long totalTime) { - - if (dirty) { - buildSpline(); - } - - if (splinePoints.Num() == 0) { - return; - } - - baseTime = bt; - time = totalTime; - - // calc distance to travel ( this will soon be broken into time segments ) - splineTime.Clear(); - splineTime.Append(bt); - double dist = totalDistance(); - double distSoFar = 0.0; - idVec3_t temp; - int count = splinePoints.Num(); - //for(int i = 2; i < count - 1; i++) { - for(int i = 1; i < count; i++) { - temp = *splinePoints[i-1]; - temp -= *splinePoints[i]; - distSoFar += temp.Length(); - double percent = distSoFar / dist; - percent *= totalTime; - splineTime.Append(percent + bt); - } - assert(splineTime.Num() == splinePoints.Num()); - activeSegment = 0; -} - - - -float idSplineList::calcSpline(int step, float tension) { - switch(step) { - case 0: return (pow(1 - tension, 3)) / 6; - case 1: return (3 * pow(tension, 3) - 6 * pow(tension, 2) + 4) / 6; - case 2: return (-3 * pow(tension, 3) + 3 * pow(tension, 2) + 3 * tension + 1) / 6; - case 3: return pow(tension, 3) / 6; - } - return 0.0; -} - - - -void idSplineList::updateSelection(const idVec3_t &move) { - if (selected) { - dirty = true; - VectorAdd(*selected, move, *selected); - } -} - - -void idSplineList::setSelectedPoint(idVec3_t *p) { - if (p) { - p->Snap(); - for(int i = 0; i < controlPoints.Num(); i++) { - if (*p == *controlPoints[i]) { - selected = controlPoints[i]; - } - } - } else { - selected = NULL; - } -} - -const idVec3_t *idSplineList::getPosition(long t) { - static idVec3_t interpolatedPos; - //static long lastTime = -1; - - int count = splineTime.Num(); - if (count == 0) { - return &zero; - } - - Com_Printf("Time: %d\n", t); - assert(splineTime.Num() == splinePoints.Num()); - - while (activeSegment < count) { - if (splineTime[activeSegment] >= t) { - if (activeSegment > 0 && activeSegment < count - 1) { - double timeHi = splineTime[activeSegment + 1]; - double timeLo = splineTime[activeSegment - 1]; - double percent = (timeHi - t) / (timeHi - timeLo); - // pick two bounding points - idVec3_t v1 = *splinePoints[activeSegment-1]; - idVec3_t v2 = *splinePoints[activeSegment+1]; - v2 *= (1.0 - percent); - v1 *= percent; - v2 += v1; - interpolatedPos = v2; - return &interpolatedPos; - } - return splinePoints[activeSegment]; - } else { - activeSegment++; - } - } - return splinePoints[count-1]; -} - -void idSplineList::parse(const char *(*text) ) { - const char *token; - //Com_MatchToken( text, "{" ); - do { - token = Com_Parse( text ); - - if ( !token[0] ) { - break; - } - if ( !Q_stricmp (token, "}") ) { - break; - } - - do { - // if token is not a brace, it is a key for a key/value pair - if ( !token[0] || !Q_stricmp (token, "(") || !Q_stricmp(token, "}")) { - break; - } - - Com_UngetToken(); - idStr key = Com_ParseOnLine(text); - const char *token = Com_Parse(text); - if (Q_stricmp(key.c_str(), "granularity") == 0) { - granularity = atof(token); - } else if (Q_stricmp(key.c_str(), "name") == 0) { - name = token; - } - token = Com_Parse(text); - - } while (1); - - if ( !Q_stricmp (token, "}") ) { - break; - } - - Com_UngetToken(); - // read the control point - idVec3_t point; - Com_Parse1DMatrix( text, 3, point ); - addPoint(point.x, point.y, point.z); - } while (1); - - //Com_UngetToken(); - //Com_MatchToken( text, "}" ); - dirty = true; -} - -void idSplineList::write(fileHandle_t file, const char *p) { - idStr s = va("\t\t%s {\n", p); - FS_Write(s.c_str(), s.length(), file); - //s = va("\t\tname %s\n", name.c_str()); - //FS_Write(s.c_str(), s.length(), file); - s = va("\t\t\tgranularity %f\n", granularity); - FS_Write(s.c_str(), s.length(), file); - int count = controlPoints.Num(); - for (int i = 0; i < count; i++) { - s = va("\t\t\t( %f %f %f )\n", controlPoints[i]->x, controlPoints[i]->y, controlPoints[i]->z); - FS_Write(s.c_str(), s.length(), file); - } - s = "\t\t}\n"; - FS_Write(s.c_str(), s.length(), file); -} - - -void idCameraDef::getActiveSegmentInfo(int segment, idVec3_t &origin, idVec3_t &direction, float *fov) { -#if 0 - if (!cameraSpline.validTime()) { - buildCamera(); - } - double d = (double)segment / numSegments(); - getCameraInfo(d * totalTime * 1000, origin, direction, fov); -#endif -/* - if (!cameraSpline.validTime()) { - buildCamera(); - } - origin = *cameraSpline.getSegmentPoint(segment); - - - idVec3_t temp; - - int numTargets = getTargetSpline()->controlPoints.Num(); - int count = cameraSpline.splineTime.Num(); - if (numTargets == 0) { - // follow the path - if (cameraSpline.getActiveSegment() < count - 1) { - temp = *cameraSpline.splinePoints[cameraSpline.getActiveSegment()+1]; - } - } else if (numTargets == 1) { - temp = *getTargetSpline()->controlPoints[0]; - } else { - temp = *getTargetSpline()->getSegmentPoint(segment); - } - - temp -= origin; - temp.Normalize(); - direction = temp; -*/ -} - -bool idCameraDef::getCameraInfo(long time, idVec3_t &origin, idVec3_t &direction, float *fv) { - - - if ((time - startTime) / 1000 > totalTime) { - return false; - } - - - for (int i = 0; i < events.Num(); i++) { - if (time >= startTime + events[i]->getTime() && !events[i]->getTriggered()) { - events[i]->setTriggered(true); - if (events[i]->getType() == idCameraEvent::EVENT_TARGET) { - setActiveTargetByName(events[i]->getParam()); - getActiveTarget()->start(startTime + events[i]->getTime()); - //Com_Printf("Triggered event switch to target: %s\n",events[i]->getParam()); - } else if (events[i]->getType() == idCameraEvent::EVENT_TRIGGER) { - //idEntity *ent = NULL; - //ent = level.FindTarget( ent, events[i]->getParam()); - //if (ent) { - // ent->signal( SIG_TRIGGER ); - // ent->ProcessEvent( &EV_Activate, world ); - //} - } else if (events[i]->getType() == idCameraEvent::EVENT_FOV) { - //*fv = fov = atof(events[i]->getParam()); - } else if (events[i]->getType() == idCameraEvent::EVENT_STOP) { - return false; - } - } - } - - origin = *cameraPosition->getPosition(time); - - *fv = fov.getFOV(time); - - idVec3_t temp = origin; - - int numTargets = targetPositions.Num(); - if (numTargets == 0) { -/* - // follow the path - if (cameraSpline.getActiveSegment() < count - 1) { - temp = *cameraSpline.splinePoints[cameraSpline.getActiveSegment()+1]; - if (temp == origin) { - int index = cameraSpline.getActiveSegment() + 2; - while (temp == origin && index < count - 1) { - temp = *cameraSpline.splinePoints[index++]; - } - } - } -*/ - } else { - temp = *getActiveTarget()->getPosition(time); - } - - temp -= origin; - temp.Normalize(); - direction = temp; - - return true; -} - -bool idCameraDef::waitEvent(int index) { - //for (int i = 0; i < events.Num(); i++) { - // if (events[i]->getSegment() == index && events[i]->getType() == idCameraEvent::EVENT_WAIT) { - // return true; - // } - //} - return false; -} - - -#define NUM_CCELERATION_SEGS 10 -#define CELL_AMT 5 - -void idCameraDef::buildCamera() { - int i; - //int lastSwitch = 0; - idList waits; - idList targets; - - totalTime = baseTime; - cameraPosition->setTime(totalTime * 1000); - // we have a base time layout for the path and the target path - // now we need to layer on any wait or speed changes - for (i = 0; i < events.Num(); i++) { - //idCameraEvent *ev = events[i]; - events[i]->setTriggered(false); - switch (events[i]->getType()) { - case idCameraEvent::EVENT_TARGET : { - targets.Append(i); - break; - } - case idCameraEvent::EVENT_WAIT : { - waits.Append(atof(events[i]->getParam())); - cameraPosition->addVelocity(events[i]->getTime(), atof(events[i]->getParam()) * 1000, 0); - break; - } - case idCameraEvent::EVENT_TARGETWAIT : { - //targetWaits.Append(i); - break; - } - case idCameraEvent::EVENT_SPEED : { -/* - // take the average delay between up to the next five segments - float adjust = atof(events[i]->getParam()); - int index = events[i]->getSegment(); - total = 0; - count = 0; - - // get total amount of time over the remainder of the segment - for (j = index; j < cameraSpline.numSegments() - 1; j++) { - total += cameraSpline.getSegmentTime(j + 1) - cameraSpline.getSegmentTime(j); - count++; - } - - // multiply that by the adjustment - double newTotal = total * adjust; - // what is the difference.. - newTotal -= total; - totalTime += newTotal / 1000; - - // per segment difference - newTotal /= count; - int additive = newTotal; - - // now propogate that difference out to each segment - for (j = index; j < cameraSpline.numSegments(); j++) { - cameraSpline.addSegmentTime(j, additive); - additive += newTotal; - } - break; -*/ - } - default: break; // FIXME: what about other idCameraEvent? - } - } - - - for (i = 0; i < waits.Num(); i++) { - totalTime += waits[i]; - } - - // on a new target switch, we need to take time to this point ( since last target switch ) - // and allocate it across the active target, then reset time to this point - long timeSoFar = 0; - long total = (int)(totalTime * 1000); - for (i = 0; i < targets.Num(); i++) { - long t; - if (i < targets.Num() - 1) { - t = events[targets[i+1]]->getTime(); - } else { - t = total - timeSoFar; - } - // t is how much time to use for this target - setActiveTargetByName(events[targets[i]]->getParam()); - getActiveTarget()->setTime(t); - timeSoFar += t; - } - - -} - -void idCameraDef::startCamera(long t) { - buildCamera(); - cameraPosition->start(t); - //for (int i = 0; i < targetPositions.Num(); i++) { - // targetPositions[i]-> - //} - startTime = t; - cameraRunning = true; -} - - -void idCameraDef::parse(const char *(*text) ) { - - const char *token; - do { - token = Com_Parse( text ); - - if ( !token[0] ) { - break; - } - if ( !Q_stricmp (token, "}") ) { - break; - } - - if (Q_stricmp(token, "time") == 0) { - baseTime = Com_ParseFloat(text); - } - - if (Q_stricmp(token, "camera_fixed") == 0) { - cameraPosition = new idFixedPosition(); - cameraPosition->parse(text); - } - - if (Q_stricmp(token, "camera_interpolated") == 0) { - cameraPosition = new idInterpolatedPosition(); - cameraPosition->parse(text); - } - - if (Q_stricmp(token, "camera_spline") == 0) { - cameraPosition = new idSplinePosition(); - cameraPosition->parse(text); - } - - if (Q_stricmp(token, "target_fixed") == 0) { - idFixedPosition *pos = new idFixedPosition(); - pos->parse(text); - targetPositions.Append(pos); - } - - if (Q_stricmp(token, "target_interpolated") == 0) { - idInterpolatedPosition *pos = new idInterpolatedPosition(); - pos->parse(text); - targetPositions.Append(pos); - } - - if (Q_stricmp(token, "target_spline") == 0) { - idSplinePosition *pos = new idSplinePosition(); - pos->parse(text); - targetPositions.Append(pos); - } - - if (Q_stricmp(token, "fov") == 0) { - fov.parse(text); - } - - if (Q_stricmp(token, "event") == 0) { - idCameraEvent *event = new idCameraEvent(); - event->parse(text); - addEvent(event); - } - - - } while (1); - - Com_UngetToken(); - Com_MatchToken( text, "}" ); - -} - -qboolean idCameraDef::load(const char *filename) { - char *buf; - const char *buf_p; - //int length = - FS_ReadFile( filename, (void **)&buf ); - if ( !buf ) { - return qfalse; - } - - clear(); - Com_BeginParseSession( filename ); - buf_p = buf; - parse(&buf_p); - Com_EndParseSession(); - FS_FreeFile( buf ); - - return qtrue; -} - -void idCameraDef::save(const char *filename) { - fileHandle_t file = FS_FOpenFileWrite(filename); - if (file) { - int i; - idStr s = "cameraPathDef { \n"; - FS_Write(s.c_str(), s.length(), file); - s = va("\ttime %f\n", baseTime); - FS_Write(s.c_str(), s.length(), file); - - cameraPosition->write(file, va("camera_%s",cameraPosition->typeStr())); - - for (i = 0; i < numTargets(); i++) { - targetPositions[i]->write(file, va("target_%s", targetPositions[i]->typeStr())); - } - - for (i = 0; i < events.Num(); i++) { - events[i]->write(file, "event"); - } - - fov.write(file, "fov"); - - s = "}\n"; - FS_Write(s.c_str(), s.length(), file); - } - FS_FCloseFile(file); -} - -int idCameraDef::sortEvents(const void *p1, const void *p2) { - idCameraEvent *ev1 = (idCameraEvent*)(p1); - idCameraEvent *ev2 = (idCameraEvent*)(p2); - - if (ev1->getTime() > ev2->getTime()) { - return -1; - } - if (ev1->getTime() < ev2->getTime()) { - return 1; - } - return 0; -} - -void idCameraDef::addEvent(idCameraEvent *event) { - events.Append(event); - //events.Sort(&sortEvents); - -} -void idCameraDef::addEvent(idCameraEvent::eventType t, const char *param, long time) { - addEvent(new idCameraEvent(t, param, time)); - buildCamera(); -} - - -const char *idCameraEvent::eventStr[] = { - "NA", - "WAIT", - "TARGETWAIT", - "SPEED", - "TARGET", - "SNAPTARGET", - "FOV", - "SCRIPT", - "TRIGGER", - "STOP" -}; - -void idCameraEvent::parse(const char *(*text) ) { - const char *token; - Com_MatchToken( text, "{" ); - do { - token = Com_Parse( text ); - - if ( !token[0] ) { - break; - } - if ( !strcmp (token, "}") ) { - break; - } - - // here we may have to jump over brush epairs ( only used in editor ) - do { - // if token is not a brace, it is a key for a key/value pair - if ( !token[0] || !strcmp (token, "(") || !strcmp(token, "}")) { - break; - } - - Com_UngetToken(); - idStr key = Com_ParseOnLine(text); - const char *token = Com_Parse(text); - if (Q_stricmp(key.c_str(), "type") == 0) { - type = static_cast(atoi(token)); - } else if (Q_stricmp(key.c_str(), "param") == 0) { - paramStr = token; - } else if (Q_stricmp(key.c_str(), "time") == 0) { - time = atoi(token); - } - token = Com_Parse(text); - - } while (1); - - if ( !strcmp (token, "}") ) { - break; - } - - } while (1); - - Com_UngetToken(); - Com_MatchToken( text, "}" ); -} - -void idCameraEvent::write(fileHandle_t file, const char *name) { - idStr s = va("\t%s {\n", name); - FS_Write(s.c_str(), s.length(), file); - s = va("\t\ttype %d\n", static_cast(type)); - FS_Write(s.c_str(), s.length(), file); - s = va("\t\tparam %s\n", paramStr.c_str()); - FS_Write(s.c_str(), s.length(), file); - s = va("\t\ttime %d\n", time); - FS_Write(s.c_str(), s.length(), file); - s = "\t}\n"; - FS_Write(s.c_str(), s.length(), file); -} - - -const char *idCameraPosition::positionStr[] = { - "Fixed", - "Interpolated", - "Spline", -}; - - - -const idVec3_t *idInterpolatedPosition::getPosition(long t) { - static idVec3_t interpolatedPos; - - float velocity = getVelocity(t); - float timePassed = t - lastTime; - lastTime = t; - - // convert to seconds - timePassed /= 1000; - - float distToTravel = timePassed *= velocity; - - idVec3_t temp = startPos; - temp -= endPos; - float distance = temp.Length(); - - distSoFar += distToTravel; - float percent = (float)(distSoFar) / distance; - - if (percent > 1.0) { - percent = 1.0; - } else if (percent < 0.0) { - percent = 0.0; - } - - // the following line does a straigt calc on percentage of time - // float percent = (float)(startTime + time - t) / time; - - idVec3_t v1 = startPos; - idVec3_t v2 = endPos; - v1 *= (1.0 - percent); - v2 *= percent; - v1 += v2; - interpolatedPos = v1; - return &interpolatedPos; -} - - -void idCameraFOV::parse(const char *(*text) ) { - const char *token; - Com_MatchToken( text, "{" ); - do { - token = Com_Parse( text ); - - if ( !token[0] ) { - break; - } - if ( !strcmp (token, "}") ) { - break; - } - - // here we may have to jump over brush epairs ( only used in editor ) - do { - // if token is not a brace, it is a key for a key/value pair - if ( !token[0] || !strcmp (token, "(") || !strcmp(token, "}")) { - break; - } - - Com_UngetToken(); - idStr key = Com_ParseOnLine(text); - const char *token = Com_Parse(text); - if (Q_stricmp(key.c_str(), "fov") == 0) { - fov = atof(token); - } else if (Q_stricmp(key.c_str(), "startFOV") == 0) { - startFOV = atof(token); - } else if (Q_stricmp(key.c_str(), "endFOV") == 0) { - endFOV = atof(token); - } else if (Q_stricmp(key.c_str(), "time") == 0) { - time = atoi(token); - } - token = Com_Parse(text); - - } while (1); - - if ( !strcmp (token, "}") ) { - break; - } - - } while (1); - - Com_UngetToken(); - Com_MatchToken( text, "}" ); -} - -bool idCameraPosition::parseToken(const char *key, const char *(*text)) { - const char *token = Com_Parse(text); - if (Q_stricmp(key, "time") == 0) { - time = atol(token); - return true; - } else if (Q_stricmp(key, "type") == 0) { - type = static_cast(atoi(token)); - return true; - } else if (Q_stricmp(key, "velocity") == 0) { - long t = atol(token); - token = Com_Parse(text); - long d = atol(token); - token = Com_Parse(text); - float s = atof(token); - addVelocity(t, d, s); - return true; - } else if (Q_stricmp(key, "baseVelocity") == 0) { - baseVelocity = atof(token); - return true; - } else if (Q_stricmp(key, "name") == 0) { - name = token; - return true; - } else if (Q_stricmp(key, "time") == 0) { - time = atoi(token); - return true; - } - Com_UngetToken(); - return false; -} - - - -void idFixedPosition::parse(const char *(*text) ) { - const char *token; - Com_MatchToken( text, "{" ); - do { - token = Com_Parse( text ); - - if ( !token[0] ) { - break; - } - if ( !strcmp (token, "}") ) { - break; - } - - // here we may have to jump over brush epairs ( only used in editor ) - do { - // if token is not a brace, it is a key for a key/value pair - if ( !token[0] || !strcmp (token, "(") || !strcmp(token, "}")) { - break; - } - - Com_UngetToken(); - idStr key = Com_ParseOnLine(text); - - const char *token = Com_Parse(text); - if (Q_stricmp(key.c_str(), "pos") == 0) { - Com_UngetToken(); - Com_Parse1DMatrix( text, 3, pos ); - } else { - Com_UngetToken(); - idCameraPosition::parseToken(key.c_str(), text); - } - token = Com_Parse(text); - - } while (1); - - if ( !strcmp (token, "}") ) { - break; - } - - } while (1); - - Com_UngetToken(); - Com_MatchToken( text, "}" ); -} - -void idInterpolatedPosition::parse(const char *(*text) ) { - const char *token; - Com_MatchToken( text, "{" ); - do { - token = Com_Parse( text ); - - if ( !token[0] ) { - break; - } - if ( !strcmp (token, "}") ) { - break; - } - - // here we may have to jump over brush epairs ( only used in editor ) - do { - // if token is not a brace, it is a key for a key/value pair - if ( !token[0] || !strcmp (token, "(") || !strcmp(token, "}")) { - break; - } - - Com_UngetToken(); - idStr key = Com_ParseOnLine(text); - - const char *token = Com_Parse(text); - if (Q_stricmp(key.c_str(), "startPos") == 0) { - Com_UngetToken(); - Com_Parse1DMatrix( text, 3, startPos ); - } else if (Q_stricmp(key.c_str(), "endPos") == 0) { - Com_UngetToken(); - Com_Parse1DMatrix( text, 3, endPos ); - } else { - Com_UngetToken(); - idCameraPosition::parseToken(key.c_str(), text); - } - token = Com_Parse(text); - - } while (1); - - if ( !strcmp (token, "}") ) { - break; - } - - } while (1); - - Com_UngetToken(); - Com_MatchToken( text, "}" ); -} - - -void idSplinePosition::parse(const char *(*text) ) { - const char *token; - Com_MatchToken( text, "{" ); - do { - token = Com_Parse( text ); - - if ( !token[0] ) { - break; - } - if ( !strcmp (token, "}") ) { - break; - } - - // here we may have to jump over brush epairs ( only used in editor ) - do { - // if token is not a brace, it is a key for a key/value pair - if ( !token[0] || !strcmp (token, "(") || !strcmp(token, "}")) { - break; - } - - Com_UngetToken(); - idStr key = Com_ParseOnLine(text); - - const char *token = Com_Parse(text); - if (Q_stricmp(key.c_str(), "target") == 0) { - target.parse(text); - } else { - Com_UngetToken(); - idCameraPosition::parseToken(key.c_str(), text); - } - token = Com_Parse(text); - - } while (1); - - if ( !strcmp (token, "}") ) { - break; - } - - } while (1); - - Com_UngetToken(); - Com_MatchToken( text, "}" ); -} - - - -void idCameraFOV::write(fileHandle_t file, const char *p) { - idStr s = va("\t%s {\n", p); - FS_Write(s.c_str(), s.length(), file); - - s = va("\t\tfov %f\n", fov); - FS_Write(s.c_str(), s.length(), file); - - s = va("\t\tstartFOV %f\n", startFOV); - FS_Write(s.c_str(), s.length(), file); - - s = va("\t\tendFOV %f\n", endFOV); - FS_Write(s.c_str(), s.length(), file); - - s = va("\t\ttime %i\n", time); - FS_Write(s.c_str(), s.length(), file); - - s = "\t}\n"; - FS_Write(s.c_str(), s.length(), file); -} - - -void idCameraPosition::write(fileHandle_t file, const char *p) { - - idStr s = va("\t\ttime %i\n", time); - FS_Write(s.c_str(), s.length(), file); - - s = va("\t\ttype %i\n", static_cast(type)); - FS_Write(s.c_str(), s.length(), file); - - s = va("\t\tname %s\n", name.c_str()); - FS_Write(s.c_str(), s.length(), file); - - s = va("\t\tbaseVelocity %f\n", baseVelocity); - FS_Write(s.c_str(), s.length(), file); - - for (int i = 0; i < velocities.Num(); i++) { - s = va("\t\tvelocity %i %i %f\n", velocities[i]->startTime, velocities[i]->time, velocities[i]->speed); - FS_Write(s.c_str(), s.length(), file); - } - -} - -void idFixedPosition::write(fileHandle_t file, const char *p) { - idStr s = va("\t%s {\n", p); - FS_Write(s.c_str(), s.length(), file); - idCameraPosition::write(file, p); - s = va("\t\tpos ( %f %f %f )\n", pos.x, pos.y, pos.z); - FS_Write(s.c_str(), s.length(), file); - s = "\t}\n"; - FS_Write(s.c_str(), s.length(), file); -} - -void idInterpolatedPosition::write(fileHandle_t file, const char *p) { - idStr s = va("\t%s {\n", p); - FS_Write(s.c_str(), s.length(), file); - idCameraPosition::write(file, p); - s = va("\t\tstartPos ( %f %f %f )\n", startPos.x, startPos.y, startPos.z); - FS_Write(s.c_str(), s.length(), file); - s = va("\t\tendPos ( %f %f %f )\n", endPos.x, endPos.y, endPos.z); - FS_Write(s.c_str(), s.length(), file); - s = "\t}\n"; - FS_Write(s.c_str(), s.length(), file); -} - -void idSplinePosition::write(fileHandle_t file, const char *p) { - idStr s = va("\t%s {\n", p); - FS_Write(s.c_str(), s.length(), file); - idCameraPosition::write(file, p); - target.write(file, "target"); - s = "\t}\n"; - FS_Write(s.c_str(), s.length(), file); -} - -void idCameraDef::addTarget(const char *name, idCameraPosition::positionType type) { - //const char *text = (name == NULL) ? va("target0%d", numTargets()+1) : name; // TTimo: unused - idCameraPosition *pos = newFromType(type); - if (pos) { - pos->setName(name); - targetPositions.Append(pos); - activeTarget = numTargets()-1; - if (activeTarget == 0) { - // first one - addEvent(idCameraEvent::EVENT_TARGET, name, 0); - } - } -} - - - -idCameraDef camera; - -extern "C" { -qboolean loadCamera(const char *name) { - camera.clear(); - return static_cast(camera.load(name)); -} - -qboolean getCameraInfo(int time, float *origin, float*angles) { - idVec3_t dir, org; - org[0] = origin[0]; - org[1] = origin[1]; - org[2] = origin[2]; - float fov = 90; - if (camera.getCameraInfo(time, org, dir, &fov)) { - origin[0] = org[0]; - origin[1] = org[1]; - origin[2] = org[2]; - angles[1] = atan2 (dir[1], dir[0])*180/3.14159; - angles[0] = asin (dir[2])*180/3.14159; - return qtrue; - } - return qfalse; -} - -void startCamera(int time) { - camera.startCamera(time); -} - -} - - diff --git a/code/splines/splines.h b/code/splines/splines.h deleted file mode 100644 index 0a60123..0000000 --- a/code/splines/splines.h +++ /dev/null @@ -1,1075 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifndef __SPLINES_H -#define __SPLINES_H - -extern "C" { -#ifdef Q3RADIANT -#include "../qgl.h" -#else -//#include "../renderer/qgl.h" -#endif -} -#include "util_list.h" -#include "util_str.h" -#include "math_vector.h" - -typedef int fileHandle_t; - -//extern void glBox(idVec3_t &color, idVec3_t &point, float size); -//extern void glLabeledPoint(idVec3_t &color, idVec3_t &point, float size, const char *label); - -static vec4_t blue(0, 0, 1, 1); -static vec4_t red(1, 0, 0, 1); - -class idPointListInterface { -public: - idPointListInterface() { - selectedPoints.Clear(); - } - virtual ~idPointListInterface() {} - - virtual int numPoints() { - return 0; - } - - virtual void addPoint(const float x, const float y, const float z) {} - virtual void addPoint(const idVec3_t &v) {} - virtual void removePoint(int index) {} - virtual idVec3_t *getPoint(int index) { return NULL; } - - int selectPointByRay(float ox, float oy, float oz, float dx, float dy, float dz, bool single) { - idVec3_t origin(ox, oy, oz); - idVec3_t dir(dx, dy, dz); - return selectPointByRay(origin, dir, single); - } - - int selectPointByRay(const idVec3_t origin, const idVec3_t direction, bool single) { - int i, besti, count; - float d, bestd; - idVec3_t temp, temp2; - - // find the point closest to the ray - besti = -1; - bestd = 8; - count = numPoints(); - - for (i=0; i < count; i++) { - temp = *getPoint(i); - temp2 = temp; - temp -= origin; - d = DotProduct(temp, direction); - __VectorMA (origin, d, direction, temp); - temp2 -= temp; - d = temp2.Length(); - if (d <= bestd) { - bestd = d; - besti = i; - } - } - - if (besti >= 0) { - selectPoint(besti, single); - } - - return besti; - } - - int isPointSelected(int index) { - int count = selectedPoints.Num(); - for (int i = 0; i < count; i++) { - if (selectedPoints[i] == index) { - return i; - } - } - return -1; - } - - int selectPoint(int index, bool single) { - if (index >= 0 && index < numPoints()) { - if (single) { - deselectAll(); - } else { - if (isPointSelected(index) >= 0) { - selectedPoints.Remove(index); - } - } - return selectedPoints.Append(index); - } - return -1; - } - - void selectAll() { - selectedPoints.Clear(); - for (int i = 0; i < numPoints(); i++) { - selectedPoints.Append(i); - } - } - - void deselectAll() { - selectedPoints.Clear(); - } - - virtual void updateSelection(float x, float y, float z) { - idVec3_t move(x, y, z); - updateSelection(move); - } - - virtual void updateSelection(const idVec3_t &move) { - int count = selectedPoints.Num(); - for (int i = 0; i < count; i++) { - *getPoint(selectedPoints[i]) += move; - } - } -/* - void drawSelection() { - int count = selectedPoints.Num(); - for (int i = 0; i < count; i++) { - glBox(red, *getPoint(selectedPoints[i]), 4); - } - } -*/ -protected: - idList selectedPoints; - -}; - - -class idSplineList { - -public: - - idSplineList() { - clear(); - } - - idSplineList(const char *p) { - clear(); - name = p; - }; - - ~idSplineList() { - clear(); - }; - - void clearControl() { - for (int i = 0; i < controlPoints.Num(); i++) { - delete controlPoints[i]; - } - controlPoints.Clear(); - } - - void clearSpline() { - for (int i = 0; i < splinePoints.Num(); i++) { - delete splinePoints[i]; - } - splinePoints.Clear(); - } - - void parse(const char *(*text)); - void write(fileHandle_t file, const char *name); - - void clear() { - clearControl(); - clearSpline(); - splineTime.Clear(); - selected = NULL; - dirty = true; - activeSegment = 0; - granularity = 0.025; - pathColor.set(1.0, 0.5, 0.0); - controlColor.set(0.7, 0.0, 1.0); - segmentColor.set(0.0, 0.0, 1.0); - activeColor.set(1.0, 0.0, 0.0); - } - - void initPosition(long startTime, long totalTime); - const idVec3_t *getPosition(long time); - - -// void draw(bool editMode); - void addToRenderer(); - - void setSelectedPoint(idVec3_t *p); - idVec3_t *getSelectedPoint() { - return selected; - } - - void addPoint(const idVec3_t &v) { - controlPoints.Append(new idVec3_t(v)); - dirty = true; - } - - void addPoint(float x, float y, float z) { - controlPoints.Append(new idVec3_t(x, y, z)); - dirty = true; - } - - void updateSelection(const idVec3_t &move); - - void startEdit() { - editMode = true; - } - - void stopEdit() { - editMode = false; - } - - void buildSpline(); - - void setGranularity(float f) { - granularity = f; - } - - float getGranularity() { - return granularity; - } - - int numPoints() { - return controlPoints.Num(); - } - - idVec3_t *getPoint(int index) { - assert(index >= 0 && index < controlPoints.Num()); - return controlPoints[index]; - } - - idVec3_t *getSegmentPoint(int index) { - assert(index >= 0 && index < splinePoints.Num()); - return splinePoints[index]; - } - - - void setSegmentTime(int index, int time) { - assert(index >= 0 && index < splinePoints.Num()); - splineTime[index] = time; - } - - double getSegmentTime(int index) { - assert(index >= 0 && index < splinePoints.Num()); - return splineTime[index]; - } - void addSegmentTime(int index, int time) { - assert(index >= 0 && index < splinePoints.Num()); - splineTime[index] += time; - } - - float totalDistance(); - - static idVec3_t zero; - - int getActiveSegment() { - return activeSegment; - } - - void setActiveSegment(int i) { - //assert(i >= 0 && (splinePoints.Num() > 0 && i < splinePoints.Num())); - activeSegment = i; - } - - int numSegments() { - return splinePoints.Num(); - } - - void setColors(idVec3_t &path, idVec3_t &segment, idVec3_t &control, idVec3_t &active) { - pathColor = path; - segmentColor = segment; - controlColor = control; - activeColor = active; - } - - const char *getName() { - return name.c_str(); - } - - void setName(const char *p) { - name = p; - } - - bool validTime() { - if (dirty) { - buildSpline(); - } - // gcc doesn't allow static casting away from bools - // why? I've no idea... - return (bool)(splineTime.Num() > 0 && splineTime.Num() == splinePoints.Num()); - } - - void setTime(long t) { - time = t; - } - - void setBaseTime(long t) { - baseTime = t; - } - -protected: - idStr name; - float calcSpline(int step, float tension); - idList controlPoints; - idList splinePoints; - idList splineTime; - idVec3_t *selected; - idVec3_t pathColor, segmentColor, controlColor, activeColor; - float granularity; - bool editMode; - bool dirty; - int activeSegment; - long baseTime; - long time; - friend class idCamera; -}; - -// time in milliseconds -// velocity where 1.0 equal rough walking speed -struct idVelocity { - idVelocity(long start, long duration, float s) { - startTime = start; - time = duration; - speed = s; - } - long startTime; - long time; - float speed; -}; - -// can either be a look at or origin position for a camera -// -class idCameraPosition : public idPointListInterface { -public: - - virtual void clear() { - editMode = false; - for (int i = 0; i < velocities.Num(); i++) { - delete velocities[i]; - velocities[i] = NULL; - } - velocities.Clear(); - } - - idCameraPosition(const char *p) { - name = p; - } - - idCameraPosition() { - time = 0; - name = "position"; - } - - idCameraPosition(long t) { - time = t; - } - - virtual ~idCameraPosition() { - clear(); - } - - - // this can be done with RTTI syntax but i like the derived classes setting a type - // makes serialization a bit easier to see - // - enum positionType { - FIXED = 0x00, - INTERPOLATED, - SPLINE, - POSITION_COUNT - }; - - - virtual void start(long t) { - startTime = t; - } - - long getTime() { - return time; - } - - virtual void setTime(long t) { - time = t; - } - - float getVelocity(long t) { - long check = t - startTime; - for (int i = 0; i < velocities.Num(); i++) { - if (check >= velocities[i]->startTime && check <= velocities[i]->startTime + velocities[i]->time) { - return velocities[i]->speed; - } - } - return baseVelocity; - } - - void addVelocity(long start, long duration, float speed) { - velocities.Append(new idVelocity(start, duration, speed)); - } - - virtual const idVec3_t *getPosition(long t) { - assert(true); - return NULL; - } - -// virtual void draw(bool editMode) {}; - - virtual void parse(const char *(*text)) {}; - virtual void write(fileHandle_t file, const char *name); - virtual bool parseToken(const char *key, const char *(*text)); - - const char *getName() { - return name.c_str(); - } - - void setName(const char *p) { - name = p; - } - - virtual void startEdit() { - editMode = true; - } - - virtual void stopEdit() { - editMode = false; - } - -// virtual void draw() {}; - - const char *typeStr() { - return positionStr[static_cast(type)]; - } - - void calcVelocity(float distance) { - float secs = (float)time / 1000; - baseVelocity = distance / secs; - } - -protected: - static const char* positionStr[POSITION_COUNT]; - long startTime; - long time; - idCameraPosition::positionType type; - idStr name; - bool editMode; - idList velocities; - float baseVelocity; -}; - -class idFixedPosition : public idCameraPosition { -public: - - void init() { - pos.Zero(); - type = idCameraPosition::FIXED; - } - - idFixedPosition() : idCameraPosition() { - init(); - } - - idFixedPosition(idVec3_t p) : idCameraPosition() { - init(); - pos = p; - } - - virtual void addPoint(const idVec3_t &v) { - pos = v; - } - - virtual void addPoint(const float x, const float y, const float z) { - pos.set(x, y, z); - } - - - ~idFixedPosition() { - } - - virtual const idVec3_t *getPosition(long t) { - return &pos; - } - - void parse(const char *(*text)); - void write(fileHandle_t file, const char *name); - - virtual int numPoints() { - return 1; - } - - virtual idVec3_t *getPoint(int index) { - if (index != 0) { - assert(true); - }; - return &pos; - } -/* - virtual void draw(bool editMode) { - glLabeledPoint(blue, pos, (editMode) ? 5 : 3, "Fixed point"); - } -*/ -protected: - idVec3_t pos; -}; - -class idInterpolatedPosition : public idCameraPosition { -public: - - void init() { - type = idCameraPosition::INTERPOLATED; - first = true; - startPos.Zero(); - endPos.Zero(); - } - - idInterpolatedPosition() : idCameraPosition() { - init(); - } - - idInterpolatedPosition(idVec3_t start, idVec3_t end, long time) : idCameraPosition(time) { - init(); - startPos = start; - endPos = end; - } - - ~idInterpolatedPosition() { - } - - virtual const idVec3_t *getPosition(long t); - - void parse(const char *(*text)); - void write(fileHandle_t file, const char *name); - - virtual int numPoints() { - return 2; - } - - virtual idVec3_t *getPoint(int index) { - assert(index >= 0 && index < 2); - if (index == 0) { - return &startPos; - } - return &endPos; - } - - virtual void addPoint(const float x, const float y, const float z) { - if (first) { - startPos.set(x, y, z); - first = false; - } else { - endPos.set(x, y, z); - first = true; - } - } - - virtual void addPoint(const idVec3_t &v) { - if (first) { - startPos = v; - first = false; - } else { - endPos = v; - first = true; - } - } -/* - virtual void draw(bool editMode) { - glLabeledPoint(blue, startPos, (editMode) ? 5 : 3, "Start interpolated"); - glLabeledPoint(blue, endPos, (editMode) ? 5 : 3, "End interpolated"); - qglBegin(GL_LINES); - qglVertex3fv(startPos); - qglVertex3fv(endPos); - qglEnd(); - } -*/ - virtual void start(long t) { - idCameraPosition::start(t); - lastTime = startTime; - distSoFar = 0.0; - idVec3_t temp = startPos; - temp -= endPos; - calcVelocity(temp.Length()); - } - -protected: - bool first; - idVec3_t startPos; - idVec3_t endPos; - long lastTime; - float distSoFar; -}; - -class idSplinePosition : public idCameraPosition { -public: - - void init() { - type = idCameraPosition::SPLINE; - } - - idSplinePosition() : idCameraPosition() { - init(); - } - - idSplinePosition(long time) : idCameraPosition(time) { - init(); - } - - ~idSplinePosition() { - } - - virtual void start(long t) { - idCameraPosition::start(t); - target.initPosition(t, time); - calcVelocity(target.totalDistance()); - } - - virtual const idVec3_t *getPosition(long t) { - return target.getPosition(t); - } - - //virtual const idVec3_t *getPosition(long t) const { - - void addControlPoint(idVec3_t &v) { - target.addPoint(v); - } - - void parse(const char *(*text)); - void write(fileHandle_t file, const char *name); - - virtual int numPoints() { - return target.numPoints(); - } - - virtual idVec3_t *getPoint(int index) { - return target.getPoint(index); - } - - virtual void addPoint(const idVec3_t &v) { - target.addPoint(v); - } - - virtual void addPoint(const float x, const float y, const float z) { - target.addPoint(x, y, z); - } - -/* virtual void draw(bool editMode) { - target.draw(editMode); - } -*/ - virtual void updateSelection(const idVec3_t &move) { - idCameraPosition::updateSelection(move); - target.buildSpline(); - } - -protected: - idSplineList target; -}; - -class idCameraFOV { -public: - - idCameraFOV() { - time = 0; - fov = 90; - } - - idCameraFOV(int v) { - time = 0; - fov = v; - } - - idCameraFOV(int s, int e, long t) { - startFOV = s; - endFOV = e; - time = t; - } - - - ~idCameraFOV(){} - - void setFOV(float f) { - fov = f; - } - - float getFOV(long t) { - if (time) { - assert(startTime); - float percent = t / startTime; - float temp = startFOV - endFOV; - temp *= percent; - fov = startFOV + temp; - } - return fov; - } - - void start(long t) { - startTime = t; - } - - void parse(const char *(*text)); - void write(fileHandle_t file, const char *name); - -protected: - float fov; - float startFOV; - float endFOV; - int startTime; - int time; -}; - - - - -class idCameraEvent { -public: - enum eventType { - EVENT_NA = 0x00, - EVENT_WAIT, - EVENT_TARGETWAIT, - EVENT_SPEED, - EVENT_TARGET, - EVENT_SNAPTARGET, - EVENT_FOV, - EVENT_SCRIPT, - EVENT_TRIGGER, - EVENT_STOP, - EVENT_COUNT - }; - - static const char* eventStr[EVENT_COUNT]; - - idCameraEvent() { - paramStr = ""; - type = EVENT_NA; - time = 0; - } - - idCameraEvent(eventType t, const char *param, long n) { - type = t; - paramStr = param; - time = n; - } - - ~idCameraEvent() {}; - - eventType getType() { - return type; - } - - const char *typeStr() { - return eventStr[static_cast(type)]; - } - - const char *getParam() { - return paramStr.c_str(); - } - - long getTime() { - return time; - } - - void setTime(long n) { - time = n; - } - - void parse(const char *(*text)); - void write(fileHandle_t file, const char *name); - - void setTriggered(bool b) { - triggered = b; - } - - bool getTriggered() { - return triggered; - } - -protected: - eventType type; - idStr paramStr; - long time; - bool triggered; - -}; - -class idCameraDef { -public: - - void clear() { - currentCameraPosition = 0; - cameraRunning = false; - lastDirection.Zero(); - baseTime = 30; - activeTarget = 0; - name = "camera01"; - fov.setFOV(90); - int i; - for (i = 0; i < targetPositions.Num(); i++) { - delete targetPositions[i]; - } - for (i = 0; i < events.Num(); i++) { - delete events[i]; - } - delete cameraPosition; - cameraPosition = NULL; - events.Clear(); - targetPositions.Clear(); - } - - idCameraPosition *startNewCamera(idCameraPosition::positionType type) { - clear(); - if (type == idCameraPosition::SPLINE) { - cameraPosition = new idSplinePosition(); - } else if (type == idCameraPosition::INTERPOLATED) { - cameraPosition = new idInterpolatedPosition(); - } else { - cameraPosition = new idFixedPosition(); - } - return cameraPosition; - } - - idCameraDef() { - clear(); - } - - ~idCameraDef() { - clear(); - } - - void addEvent(idCameraEvent::eventType t, const char *param, long time); - - void addEvent(idCameraEvent *event); - - static int sortEvents(const void *p1, const void *p2); - - int numEvents() { - return events.Num(); - } - - idCameraEvent *getEvent(int index) { - assert(index >= 0 && index < events.Num()); - return events[index]; - } - - void parse(const char *(*text)); - qboolean load(const char *filename); - void save(const char *filename); - - void buildCamera(); - - //idSplineList *getcameraPosition() { - // return &cameraPosition; - //} - - static idCameraPosition *newFromType(idCameraPosition::positionType t) { - switch (t) { - case idCameraPosition::FIXED : return new idFixedPosition(); - case idCameraPosition::INTERPOLATED : return new idInterpolatedPosition(); - case idCameraPosition::SPLINE : return new idSplinePosition(); - default: - break; - }; - return NULL; - } - - void addTarget(const char *name, idCameraPosition::positionType type); - - idCameraPosition *getActiveTarget() { - if (targetPositions.Num() == 0) { - addTarget(NULL, idCameraPosition::FIXED); - } - return targetPositions[activeTarget]; - } - - idCameraPosition *getActiveTarget(int index) { - if (targetPositions.Num() == 0) { - addTarget(NULL, idCameraPosition::FIXED); - return targetPositions[0]; - } - return targetPositions[index]; - } - - int numTargets() { - return targetPositions.Num(); - } - - - void setActiveTargetByName(const char *name) { - for (int i = 0; i < targetPositions.Num(); i++) { - if (Q_stricmp(name, targetPositions[i]->getName()) == 0) { - setActiveTarget(i); - return; - } - } - } - - void setActiveTarget(int index) { - assert(index >= 0 && index < targetPositions.Num()); - activeTarget = index; - } - - void setRunning(bool b) { - cameraRunning = b; - } - - void setBaseTime(float f) { - baseTime = f; - } - - float getBaseTime() { - return baseTime; - } - - float getTotalTime() { - return totalTime; - } - - void startCamera(long t); - void stopCamera() { - cameraRunning = true; - } - void getActiveSegmentInfo(int segment, idVec3_t &origin, idVec3_t &direction, float *fv); - - bool getCameraInfo(long time, idVec3_t &origin, idVec3_t &direction, float *fv); - bool getCameraInfo(long time, float *origin, float *direction, float *fv) { - idVec3_t org, dir; - org[0] = origin[0]; - org[1] = origin[1]; - org[2] = origin[2]; - dir[0] = direction[0]; - dir[1] = direction[1]; - dir[2] = direction[2]; - bool b = getCameraInfo(time, org, dir, fv); - origin[0] = org[0]; - origin[1] = org[1]; - origin[2] = org[2]; - direction[0] = dir[0]; - direction[1] = dir[1]; - direction[2] = dir[2]; - return b; - } -/* - void draw(bool editMode) { - // gcc doesn't allow casting away from bools - // why? I've no idea... - if (cameraPosition) { - cameraPosition->draw((bool)((editMode || cameraRunning) && cameraEdit)); - int count = targetPositions.Num(); - for (int i = 0; i < count; i++) { - targetPositions[i]->draw((bool)((editMode || cameraRunning) && i == activeTarget && !cameraEdit)); - } - } - } -*/ -/* - int numSegments() { - if (cameraEdit) { - return cameraPosition.numSegments(); - } - return getTargetSpline()->numSegments(); - } - - int getActiveSegment() { - if (cameraEdit) { - return cameraPosition.getActiveSegment(); - } - return getTargetSpline()->getActiveSegment(); - } - - void setActiveSegment(int i) { - if (cameraEdit) { - cameraPosition.setActiveSegment(i); - } else { - getTargetSpline()->setActiveSegment(i); - } - } -*/ - int numPoints() { - if (cameraEdit) { - return cameraPosition->numPoints(); - } - return getActiveTarget()->numPoints(); - } - - const idVec3_t *getPoint(int index) { - if (cameraEdit) { - return cameraPosition->getPoint(index); - } - return getActiveTarget()->getPoint(index); - } - - void stopEdit() { - editMode = false; - if (cameraEdit) { - cameraPosition->stopEdit(); - } else { - getActiveTarget()->stopEdit(); - } - } - - void startEdit(bool camera) { - cameraEdit = camera; - if (camera) { - cameraPosition->startEdit(); - for (int i = 0; i < targetPositions.Num(); i++) { - targetPositions[i]->stopEdit(); - } - } else { - getActiveTarget()->startEdit(); - cameraPosition->stopEdit(); - } - editMode = true; - } - - bool waitEvent(int index); - - const char *getName() { - return name.c_str(); - } - - void setName(const char *p) { - name = p; - } - - idCameraPosition *getPositionObj() { - if (cameraPosition == NULL) { - cameraPosition = new idFixedPosition(); - } - return cameraPosition; - } - -protected: - idStr name; - int currentCameraPosition; - idVec3_t lastDirection; - bool cameraRunning; - idCameraPosition *cameraPosition; - idList targetPositions; - idList events; - idCameraFOV fov; - int activeTarget; - float totalTime; - float baseTime; - long startTime; - - bool cameraEdit; - bool editMode; -}; - -extern bool g_splineMode; - -extern idCameraDef *g_splineList; - - -#endif diff --git a/code/splines/util_list.h b/code/splines/util_list.h deleted file mode 100644 index 6fcc472..0000000 --- a/code/splines/util_list.h +++ /dev/null @@ -1,346 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifndef __UTIL_LIST_H__ -#define __UTIL_LIST_H__ - -#include -#include - -template< class type > -class idList { -private: - int m_num; - int m_size; - int m_granularity; - type *m_list; - -public: - idList( int granularity = 16 ); - ~idList(); - void Clear( void ); - int Num( void ); - void SetNum( int num ); - void SetGranularity( int granularity ); - void Condense( void ); - int Size( void ); - void Resize( int size ); - type operator[]( int index ) const; - type &operator[]( int index ); - int Append( type const & obj ); - int AddUnique( type const & obj ); - type *Find( type const & obj, int *index = NULL ); - bool RemoveIndex( int index ); - bool Remove( type const & obj ); - typedef int cmp_t(const void *, const void *); - void Sort( cmp_t *compare ); -}; - -/* -================ -idList::idList( int ) -================ -*/ -template< class type > -inline idList::idList( int granularity ) { - assert( granularity > 0 ); - - m_list = NULL; - m_granularity = granularity; - Clear(); -} - -/* -================ -idList::~idList -================ -*/ -template< class type > -inline idList::~idList() { - Clear(); -} - -/* -================ -idList::Clear -================ -*/ -template< class type > -inline void idList::Clear( void ) { - if ( m_list ) { - delete[] m_list; - } - - m_list = NULL; - m_num = 0; - m_size = 0; -} - -/* -================ -idList::Num -================ -*/ -template< class type > -inline int idList::Num( void ) { - return m_num; -} - -/* -================ -idList::SetNum -================ -*/ -template< class type > -inline void idList::SetNum( int num ) { - assert( num >= 0 ); - if ( num > m_size ) { - // resize it up to the closest level of granularity - Resize( ( ( num + m_granularity - 1 ) / m_granularity ) * m_granularity ); - } - m_num = num; -} - -/* -================ -idList::SetGranularity -================ -*/ -template< class type > -inline void idList::SetGranularity( int granularity ) { - int newsize; - - assert( granularity > 0 ); - m_granularity = granularity; - - if ( m_list ) { - // resize it to the closest level of granularity - newsize = ( ( m_num + m_granularity - 1 ) / m_granularity ) * m_granularity; - if ( newsize != m_size ) { - Resize( newsize ); - } - } -} - -/* -================ -idList::Condense - -Resizes the array to exactly the number of elements it contains -================ -*/ -template< class type > -inline void idList::Condense( void ) { - if ( m_list ) { - if ( m_num ) { - Resize( m_num ); - } else { - Clear(); - } - } -} - -/* -================ -idList::Size -================ -*/ -template< class type > -inline int idList::Size( void ) { - return m_size; -} - -/* -================ -idList::Resize -================ -*/ -template< class type > -inline void idList::Resize( int size ) { - type *temp; - int i; - - assert( size > 0 ); - - if ( size <= 0 ) { - Clear(); - return; - } - - temp = m_list; - m_size = size; - if ( m_size < m_num ) { - m_num = m_size; - } - - m_list = new type[ m_size ]; - for( i = 0; i < m_num; i++ ) { - m_list[ i ] = temp[ i ]; - } - - if ( temp ) { - delete[] temp; - } -} - -/* -================ -idList::operator[] const -================ -*/ -template< class type > -inline type idList::operator[]( int index ) const { - assert( index >= 0 ); - assert( index < m_num ); - - return m_list[ index ]; -} - -/* -================ -idList::operator[] -================ -*/ -template< class type > -inline type &idList::operator[]( int index ) { - assert( index >= 0 ); - assert( index < m_num ); - - return m_list[ index ]; -} - -/* -================ -idList::Append -================ -*/ -template< class type > -inline int idList::Append( type const & obj ) { - if ( !m_list ) { - Resize( m_granularity ); - } - - if ( m_num == m_size ) { - Resize( m_size + m_granularity ); - } - - m_list[ m_num ] = obj; - m_num++; - - return m_num - 1; -} - -/* -================ -idList::AddUnique -================ -*/ -template< class type > -inline int idList::AddUnique( type const & obj ) { - int index; - - if ( !Find( obj, &index ) ) { - index = Append( obj ); - } - - return index; -} - -/* -================ -idList::Find -================ -*/ -template< class type > -inline type *idList::Find( type const & obj, int *index ) { - int i; - - for( i = 0; i < m_num; i++ ) { - if ( m_list[ i ] == obj ) { - if ( index ) { - *index = i; - } - return &m_list[ i ]; - } - } - - return NULL; -} - -/* -================ -idList::RemoveIndex -================ -*/ -template< class type > -inline bool idList::RemoveIndex( int index ) { - int i; - - if ( !m_list || !m_num ) { - return false; - } - - assert( index >= 0 ); - assert( index < m_num ); - - if ( ( index < 0 ) || ( index >= m_num ) ) { - return false; - } - - m_num--; - for( i = index; i < m_num; i++ ) { - m_list[ i ] = m_list[ i + 1 ]; - } - - return true; -} - -/* -================ -idList::Remove -================ -*/ -template< class type > -inline bool idList::Remove( type const & obj ) { - int index; - - if ( Find( obj, &index ) ) { - return RemoveIndex( index ); - } - - return false; -} - -/* -================ -idList::Sort -================ -*/ -template< class type > -inline void idList::Sort( cmp_t *compare ) { - if ( !m_list ) { - return; - } - - qsort( ( void * )m_list, ( size_t )m_num, sizeof( type ), compare ); -} - -#endif /* !__UTIL_LIST_H__ */ diff --git a/code/splines/util_str.cpp b/code/splines/util_str.cpp deleted file mode 100644 index 395f62b..0000000 --- a/code/splines/util_str.cpp +++ /dev/null @@ -1,620 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -//need to rewrite this - -#include "util_str.h" -#include -#include -#include -#include - -#ifdef _WIN32 -#pragma warning(disable : 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data -#pragma warning(disable : 4710) // function 'blah' not inlined -#endif - -static const int STR_ALLOC_GRAN = 20; - -char *idStr::toLower - ( - char *s1 - ) - - { - char *s; - - s = s1; - while( *s ) - { - *s = ::tolower( *s ); - s++; - } - - return s1; - } - -char *idStr::toUpper - ( - char *s1 - ) - - { - char *s; - - s = s1; - while( *s ) - { - *s = ::toupper( *s ); - s++; - } - - return s1; - } - - -int idStr::icmpn - ( - const char *s1, - const char *s2, - int n - ) - - { - int c1; - int c2; - - do - { - c1 = *s1++; - c2 = *s2++; - - if ( !n-- ) - { - // idStrings are equal until end point - return 0; - } - - if ( c1 != c2 ) - { - if ( c1 >= 'a' && c1 <= 'z' ) - { - c1 -= ( 'a' - 'A' ); - } - - if ( c2 >= 'a' && c2 <= 'z' ) - { - c2 -= ( 'a' - 'A' ); - } - - if ( c1 < c2 ) - { - // strings less than - return -1; - } - else if ( c1 > c2 ) - { - // strings greater than - return 1; - } - } - } - while( c1 ); - - // strings are equal - return 0; - } - -int idStr::icmp - ( - const char *s1, - const char *s2 - ) - - { - int c1; - int c2; - - do - { - c1 = *s1++; - c2 = *s2++; - - if ( c1 != c2 ) - { - if ( c1 >= 'a' && c1 <= 'z' ) - { - c1 -= ( 'a' - 'A' ); - } - - if ( c2 >= 'a' && c2 <= 'z' ) - { - c2 -= ( 'a' - 'A' ); - } - - if ( c1 < c2 ) - { - // strings less than - return -1; - } - else if ( c1 > c2 ) - { - // strings greater than - return 1; - } - } - } - while( c1 ); - - // strings are equal - return 0; - } - -int idStr::cmpn - ( - const char *s1, - const char *s2, - int n - ) - - { - int c1; - int c2; - - do - { - c1 = *s1++; - c2 = *s2++; - - if ( !n-- ) - { - // strings are equal until end point - return 0; - } - - if ( c1 < c2 ) - { - // strings less than - return -1; - } - else if ( c1 > c2 ) - { - // strings greater than - return 1; - } - } - while( c1 ); - - // strings are equal - return 0; - } - -int idStr::cmp - ( - const char *s1, - const char *s2 - ) - - { - int c1; - int c2; - - do - { - c1 = *s1++; - c2 = *s2++; - - if ( c1 < c2 ) - { - // strings less than - return -1; - } - else if ( c1 > c2 ) - { - // strings greater than - return 1; - } - } - while( c1 ); - - // strings are equal - return 0; - } - -/* -============ -IsNumeric - -Checks a string to see if it contains only numerical values. -============ -*/ -bool idStr::isNumeric - ( - const char *str - ) - - { - int len; - int i; - bool dot; - - if ( *str == '-' ) - { - str++; - } - - dot = false; - len = strlen( str ); - for( i = 0; i < len; i++ ) - { - if ( !isdigit( str[ i ] ) ) - { - if ( ( str[ i ] == '.' ) && !dot ) - { - dot = true; - continue; - } - return false; - } - } - - return true; - } - -idStr operator+ - ( - const idStr& a, - const float b - ) - - { - char text[ 20 ]; - - idStr result( a ); - - sprintf( text, "%f", b ); - result.append( text ); - - return result; - } - -idStr operator+ - ( - const idStr& a, - const int b - ) - - { - char text[ 20 ]; - - idStr result( a ); - - sprintf( text, "%d", b ); - result.append( text ); - - return result; - } - -idStr operator+ - ( - const idStr& a, - const unsigned b - ) - - { - char text[ 20 ]; - - idStr result( a ); - - sprintf( text, "%u", b ); - result.append( text ); - - return result; - } - -idStr& idStr::operator+= - ( - const float a - ) - - { - char text[ 20 ]; - - sprintf( text, "%f", a ); - append( text ); - - return *this; - } - -idStr& idStr::operator+= - ( - const int a - ) - - { - char text[ 20 ]; - - sprintf( text, "%d", a ); - append( text ); - - return *this; - } - -idStr& idStr::operator+= - ( - const unsigned a - ) - - { - char text[ 20 ]; - - sprintf( text, "%u", a ); - append( text ); - - return *this; - } - -void idStr::CapLength - ( - int newlen - ) - - { - assert ( m_data ); - - if ( length() <= newlen ) - return; - - EnsureDataWritable (); - - m_data->data[newlen] = 0; - m_data->len = newlen; - } - -void idStr::EnsureDataWritable - ( - void - ) - - { - assert ( m_data ); - strdata *olddata; - int len; - - if ( !m_data->refcount ) - return; - - olddata = m_data; - len = length(); - - m_data = new strdata; - - EnsureAlloced ( len + 1, false ); - strncpy ( m_data->data, olddata->data, len+1 ); - m_data->len = len; - - olddata->DelRef (); - } - -void idStr::EnsureAlloced (int amount, bool keepold) { - - if ( !m_data ) { - m_data = new strdata(); - } - - // Now, let's make sure it's writable - EnsureDataWritable (); - - char *newbuffer; - bool wasalloced = ( m_data->alloced != 0 ); - - if ( amount < m_data->alloced ) { - return; - } - - assert ( amount ); - if ( amount == 1 ) { - m_data->alloced = 1; - } else { - int newsize, mod; - mod = amount % STR_ALLOC_GRAN; - if ( !mod ) { - newsize = amount; - } else { - newsize = amount + STR_ALLOC_GRAN - mod; - } - m_data->alloced = newsize; - } - - newbuffer = new char[m_data->alloced]; - if ( wasalloced && keepold ) { - strcpy ( newbuffer, m_data->data ); - } - - if ( m_data->data ) { - delete [] m_data->data; - } - m_data->data = newbuffer; -} - -void idStr::BackSlashesToSlashes - ( - void - ) - - { - int i; - - EnsureDataWritable (); - - for ( i=0; i < m_data->len; i++ ) - { - if ( m_data->data[i] == '\\' ) - m_data->data[i] = '/'; - } - } - -void idStr::snprintf - ( - char *dst, - int size, - const char *fmt, - ... - ) - - { - char buffer[0x10000]; - int len; - va_list argptr; - - va_start (argptr,fmt); - len = vsprintf (buffer,fmt,argptr); - va_end (argptr); - - assert ( len < size ); - - strncpy (dst, buffer, size-1); - } - -#ifdef _WIN32 -#pragma warning(disable : 4189) // local variable is initialized but not referenced -#endif - -/* -================= -TestStringClass - -This is a fairly rigorous test of the idStr class's functionality. -Because of the fairly global and subtle ramifications of a bug occuring -in this class, it should be run after any changes to the class. -Add more tests as functionality is changed. Tests should include -any possible bounds violation and NULL data tests. -================= -*/ -void TestStringClass - ( - void - ) - - { - char ch; // ch == ? - idStr *t; // t == ? - idStr a; // a.len == 0, a.data == "\0" - idStr b; // b.len == 0, b.data == "\0" - idStr c( "test" ); // c.len == 4, c.data == "test\0" - idStr d( c ); // d.len == 4, d.data == "test\0" - idStr e( reinterpret_cast(NULL) ); - // e.len == 0, e.data == "\0" ASSERT! - int i; // i == ? - - i = a.length(); // i == 0 - i = c.length(); // i == 4 - - // TTimo: not used -// const char *s1 = a.c_str(); // s1 == "\0" -// const char *s2 = c.c_str(); // s2 == "test\0" - - t = new idStr(); // t->len == 0, t->data == "\0" - delete t; // t == ? - - b = "test"; // b.len == 4, b.data == "test\0" - t = new idStr( "test" ); // t->len == 4, t->data == "test\0" - delete t; // t == ? - - a = c; // a.len == 4, a.data == "test\0" -// a = ""; - a = NULL; // a.len == 0, a.data == "\0" ASSERT! - a = c + d; // a.len == 8, a.data == "testtest\0" - a = c + "wow"; // a.len == 7, a.data == "testwow\0" - a = c + reinterpret_cast(NULL); - // a.len == 4, a.data == "test\0" ASSERT! - a = "this" + d; // a.len == 8, a.data == "thistest\0" - a = reinterpret_cast(NULL) + d; - // a.len == 4, a.data == "test\0" ASSERT! - a += c; // a.len == 8, a.data == "testtest\0" - a += "wow"; // a.len == 11, a.data == "testtestwow\0" - a += reinterpret_cast(NULL); - // a.len == 11, a.data == "testtestwow\0" ASSERT! - - a = "test"; // a.len == 4, a.data == "test\0" - ch = a[ 0 ]; // ch == 't' - ch = a[ -1 ]; // ch == 0 ASSERT! - ch = a[ 1000 ]; // ch == 0 ASSERT! - ch = a[ 0 ]; // ch == 't' - ch = a[ 1 ]; // ch == 'e' - ch = a[ 2 ]; // ch == 's' - ch = a[ 3 ]; // ch == 't' - ch = a[ 4 ]; // ch == '\0' ASSERT! - ch = a[ 5 ]; // ch == '\0' ASSERT! - - a[ 1 ] = 'b'; // a.len == 4, a.data == "tbst\0" - a[ -1 ] = 'b'; // a.len == 4, a.data == "tbst\0" ASSERT! - a[ 0 ] = '0'; // a.len == 4, a.data == "0bst\0" - a[ 1 ] = '1'; // a.len == 4, a.data == "01st\0" - a[ 2 ] = '2'; // a.len == 4, a.data == "012t\0" - a[ 3 ] = '3'; // a.len == 4, a.data == "0123\0" - a[ 4 ] = '4'; // a.len == 4, a.data == "0123\0" ASSERT! - a[ 5 ] = '5'; // a.len == 4, a.data == "0123\0" ASSERT! - a[ 7 ] = '7'; // a.len == 4, a.data == "0123\0" ASSERT! - - a = "test"; // a.len == 4, a.data == "test\0" - b = "no"; // b.len == 2, b.data == "no\0" - - i = ( a == b ); // i == 0 - i = ( a == c ); // i == 1 - - i = ( a == "blow" ); // i == 0 - i = ( a == "test" ); // i == 1 - i = ( a == NULL ); // i == 0 ASSERT! - - i = ( "test" == b ); // i == 0 - i = ( "test" == a ); // i == 1 - i = ( NULL == a ); // i == 0 ASSERT! - - i = ( a != b ); // i == 1 - i = ( a != c ); // i == 0 - - i = ( a != "blow" ); // i == 1 - i = ( a != "test" ); // i == 0 - i = ( a != NULL ); // i == 1 ASSERT! - - i = ( "test" != b ); // i == 1 - i = ( "test" != a ); // i == 0 - i = ( NULL != a ); // i == 1 ASSERT! - - a = "test"; // a.data == "test" - b = a; // b.data == "test" - - a = "not"; // a.data == "not", b.data == "test" - - a = b; // a.data == b.data == "test" - - a += b; // a.data == "testtest", b.data = "test" - - a = b; - - a[1] = '1'; // a.data = "t1st", b.data = "test" - } - -#ifdef _WIN32 -#pragma warning(default : 4189) // local variable is initialized but not referenced -#pragma warning(disable : 4514) // unreferenced inline function has been removed -#endif diff --git a/code/splines/util_str.h b/code/splines/util_str.h deleted file mode 100644 index 2ef3fc2..0000000 --- a/code/splines/util_str.h +++ /dev/null @@ -1,817 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -//need to rewrite this - -#ifndef __UTIL_STR_H__ -#define __UTIL_STR_H__ - -#include -#include -#include - -#ifdef _WIN32 -#pragma warning(disable : 4710) // function 'blah' not inlined -#endif - -void TestStringClass (); - -class strdata - { - public: - strdata () : len( 0 ), refcount ( 0 ), data ( NULL ), alloced ( 0 ) {} - ~strdata () - { - if ( data ) - delete [] data; - } - - void AddRef () { refcount++; } - bool DelRef () // True if killed - { - refcount--; - if ( refcount < 0 ) - { - delete this; - return true; - } - - return false; - } - - int len; - int refcount; - char *data; - int alloced; - }; - -class idStr { -protected: - strdata *m_data; - void EnsureAlloced ( int, bool keepold = true ); - void EnsureDataWritable (); - -public: - ~idStr(); - idStr(); - idStr( const char *text ); - idStr( const idStr& string ); - idStr( const idStr string, int start, int end ); - idStr( const char ch ); - idStr( const int num ); - idStr( const float num ); - idStr( const unsigned num ); - int length( void ) const; - int allocated( void ) const; - const char * c_str( void ) const; - - void append( const char *text ); - void append( const idStr& text ); - char operator[]( int index ) const; - char& operator[]( int index ); - - void operator=( const idStr& text ); - void operator=( const char *text ); - - friend idStr operator+( const idStr& a, const idStr& b ); - friend idStr operator+( const idStr& a, const char *b ); - friend idStr operator+( const char *a, const idStr& b ); - - friend idStr operator+( const idStr& a, const float b ); - friend idStr operator+( const idStr& a, const int b ); - friend idStr operator+( const idStr& a, const unsigned b ); - friend idStr operator+( const idStr& a, const bool b ); - friend idStr operator+( const idStr& a, const char b ); - - idStr& operator+=( const idStr& a ); - idStr& operator+=( const char *a ); - idStr& operator+=( const float a ); - idStr& operator+=( const char a ); - idStr& operator+=( const int a ); - idStr& operator+=( const unsigned a ); - idStr& operator+=( const bool a ); - - static char *toLower( char *s1 ); - static char *toUpper( char *s1 ); - - friend bool operator==( const idStr& a, const idStr& b ); - friend bool operator==( const idStr& a, const char *b ); - friend bool operator==( const char *a, const idStr& b ); - - friend bool operator!=( const idStr& a, const idStr& b ); - friend bool operator!=( const idStr& a, const char *b ); - friend bool operator!=( const char *a, const idStr& b ); - - operator const char * () const; - operator const char * (); - - int icmpn( const char *text, int n ) const; - int icmpn( const idStr& text, int n ) const; - int icmp( const char *text ) const; - int icmp( const idStr& text ) const; - int cmpn( const char *text, int n ) const; - int cmpn( const idStr& text, int n ) const; - int cmp( const char *text ) const; - int cmp( const idStr& text ) const; - - void tolower( void ); - void toupper( void ); - - static int icmpn( const char *s1, const char *s2, int n ); - static int icmp( const char *s1, const char *s2 ); - static int cmpn( const char *s1, const char *s2, int n ); - static int cmp( const char *s1, const char *s2 ); - - static void snprintf ( char *dst, int size, const char *fmt, ... ); - - static bool isNumeric( const char *str ); - bool isNumeric( void ) const; - - void CapLength ( int ); - - void BackSlashesToSlashes (); - -}; - -inline idStr::~idStr() - { - if ( m_data ) - { - m_data->DelRef (); - m_data = NULL; - } - } - -inline idStr::idStr() : m_data ( NULL ) - { - EnsureAlloced ( 1 ); - m_data->data[ 0 ] = 0; - } - -inline idStr::idStr - ( - const char *text - ) : m_data ( NULL ) - - { - int len; - - assert( text ); - - if ( text ) - { - len = strlen( text ); - EnsureAlloced ( len + 1 ); - strcpy( m_data->data, text ); - m_data->len = len; - } - else - { - EnsureAlloced ( 1 ); - m_data->data[ 0 ] = 0; - m_data->len = 0; - } - } - -inline idStr::idStr - ( - const idStr& text - ) : m_data ( NULL ) - - { - m_data = text.m_data; - m_data->AddRef (); - } - -inline idStr::idStr - ( - const idStr text, - int start, - int end - ) : m_data ( NULL ) - - { - int i; - int len; - - if ( end > text.length() ) - { - end = text.length(); - } - - if ( start > text.length() ) - { - start = text.length(); - } - - len = end - start; - if ( len < 0 ) - { - len = 0; - } - - EnsureAlloced ( len + 1 ); - - for( i = 0; i < len; i++ ) - { - m_data->data[ i ] = text[ start + i ]; - } - - m_data->data[ len ] = 0; - m_data->len = len; - } - -inline idStr::idStr - ( - const char ch - ) : m_data ( NULL ) - - { - EnsureAlloced ( 2 ); - - m_data->data[ 0 ] = ch; - m_data->data[ 1 ] = 0; - m_data->len = 1; - } - -inline idStr::idStr - ( - const float num - ) : m_data ( NULL ) - - { - char text[ 32 ]; - int len; - - sprintf( text, "%.3f", num ); - len = strlen( text ); - EnsureAlloced( len + 1 ); - strcpy( m_data->data, text ); - m_data->len = len; - } - -inline idStr::idStr - ( - const int num - ) : m_data ( NULL ) - - { - char text[ 32 ]; - int len; - - sprintf( text, "%d", num ); - len = strlen( text ); - EnsureAlloced( len + 1 ); - strcpy( m_data->data, text ); - m_data->len = len; - } - -inline idStr::idStr - ( - const unsigned num - ) : m_data ( NULL ) - - { - char text[ 32 ]; - int len; - - sprintf( text, "%u", num ); - len = strlen( text ); - EnsureAlloced( len + 1 ); - strcpy( m_data->data, text ); - m_data->len = len; - } - -inline int idStr::length( void ) const - { - return ( m_data != NULL ) ? m_data->len : 0; - } - -inline int idStr::allocated( void ) const - { - return ( m_data != NULL ) ? m_data->alloced + sizeof( *m_data ) : 0; - } - -inline const char *idStr::c_str( void ) const - { - assert( m_data ); - - return m_data->data; - } - -inline void idStr::append - ( - const char *text - ) - - { - int len; - - assert( text ); - - if ( text ) - { - len = length() + strlen( text ); - EnsureAlloced( len + 1 ); - - strcat( m_data->data, text ); - m_data->len = len; - } - } - -inline void idStr::append - ( - const idStr& text - ) - - { - int len; - - len = length() + text.length(); - EnsureAlloced ( len + 1 ); - - strcat ( m_data->data, text.c_str () ); - m_data->len = len; - } - -inline char idStr::operator[]( int index ) const - { - assert ( m_data ); - - if ( !m_data ) - return 0; - - // don't include the '/0' in the test, because technically, it's out of bounds - assert( ( index >= 0 ) && ( index < m_data->len ) ); - - // In release mode, give them a null character - // don't include the '/0' in the test, because technically, it's out of bounds - if ( ( index < 0 ) || ( index >= m_data->len ) ) - { - return 0; - } - - return m_data->data[ index ]; - } - -inline char& idStr::operator[] - ( - int index - ) - - { - // Used for result for invalid indices - static char dummy = 0; - assert ( m_data ); - - // We don't know if they'll write to it or not - // if it's not a const object - EnsureDataWritable (); - - if ( !m_data ) - return dummy; - - // don't include the '/0' in the test, because technically, it's out of bounds - assert( ( index >= 0 ) && ( index < m_data->len ) ); - - // In release mode, let them change a safe variable - // don't include the '/0' in the test, because technically, it's out of bounds - if ( ( index < 0 ) || ( index >= m_data->len ) ) - { - return dummy; - } - - return m_data->data[ index ]; - } - -inline void idStr::operator= - ( - const idStr& text - ) - - { - // adding the reference before deleting our current reference prevents - // us from deleting our string if we are copying from ourself - text.m_data->AddRef(); - m_data->DelRef(); - m_data = text.m_data; - } - -inline void idStr::operator= - ( - const char *text - ) - - { - int len; - - assert( text ); - - if ( !text ) - { - // safe behaviour if NULL - EnsureAlloced ( 1, false ); - m_data->data[0] = 0; - m_data->len = 0; - return; - } - - if ( !m_data ) - { - len = strlen ( text ); - EnsureAlloced( len + 1, false ); - strcpy ( m_data->data, text ); - m_data->len = len; - return; - } - - if ( text == m_data->data ) - return; // Copying same thing. Punt. - - // If we alias and I don't do this, I could corrupt other strings... This - // will get called with EnsureAlloced anyway - EnsureDataWritable (); - - // Now we need to check if we're aliasing.. - if ( text >= m_data->data && text <= m_data->data + m_data->len ) - { - // Great, we're aliasing. We're copying from inside ourselves. - // This means that I don't have to ensure that anything is alloced, - // though I'll assert just in case. - int diff = text - m_data->data; - int i; - - assert ( strlen ( text ) < (unsigned) m_data->len ); - - for ( i = 0; text[i]; i++ ) - { - m_data->data[i] = text[i]; - } - - m_data->data[i] = 0; - - m_data->len -= diff; - - return; - } - - len = strlen( text ); - EnsureAlloced ( len + 1, false ); - strcpy( m_data->data, text ); - m_data->len = len; - } - -inline idStr operator+ - ( - const idStr& a, - const idStr& b - ) - - { - idStr result( a ); - - result.append( b ); - - return result; - } - -inline idStr operator+ - ( - const idStr& a, - const char *b - ) - - { - idStr result( a ); - - result.append( b ); - - return result; - } - -inline idStr operator+ - ( - const char *a, - const idStr& b - ) - - { - idStr result( a ); - - result.append( b ); - - return result; - } - -inline idStr operator+ - ( - const idStr& a, - const bool b - ) - - { - idStr result( a ); - - result.append( b ? "true" : "false" ); - - return result; - } - -inline idStr operator+ - ( - const idStr& a, - const char b - ) - - { - char text[ 2 ]; - - text[ 0 ] = b; - text[ 1 ] = 0; - - return a + text; - } - -inline idStr& idStr::operator+= - ( - const idStr& a - ) - - { - append( a ); - return *this; - } - -inline idStr& idStr::operator+= - ( - const char *a - ) - - { - append( a ); - return *this; - } - -inline idStr& idStr::operator+= - ( - const char a - ) - - { - char text[ 2 ]; - - text[ 0 ] = a; - text[ 1 ] = 0; - append( text ); - - return *this; - } - -inline idStr& idStr::operator+= - ( - const bool a - ) - - { - append( a ? "true" : "false" ); - return *this; - } - -inline bool operator== - ( - const idStr& a, - const idStr& b - ) - - { - return ( !strcmp( a.c_str(), b.c_str() ) ); - } - -inline bool operator== - ( - const idStr& a, - const char *b - ) - - { - assert( b ); - if ( !b ) - { - return false; - } - return ( !strcmp( a.c_str(), b ) ); - } - -inline bool operator== - ( - const char *a, - const idStr& b - ) - - { - assert( a ); - if ( !a ) - { - return false; - } - return ( !strcmp( a, b.c_str() ) ); - } - -inline bool operator!= - ( - const idStr& a, - const idStr& b - ) - - { - return !( a == b ); - } - -inline bool operator!= - ( - const idStr& a, - const char *b - ) - - { - return !( a == b ); - } - -inline bool operator!= - ( - const char *a, - const idStr& b - ) - - { - return !( a == b ); - } - -inline int idStr::icmpn - ( - const char *text, - int n - ) const - - { - assert( m_data ); - assert( text ); - - return idStr::icmpn( m_data->data, text, n ); - } - -inline int idStr::icmpn - ( - const idStr& text, - int n - ) const - - { - assert( m_data ); - assert( text.m_data ); - - return idStr::icmpn( m_data->data, text.m_data->data, n ); - } - -inline int idStr::icmp - ( - const char *text - ) const - - { - assert( m_data ); - assert( text ); - - return idStr::icmp( m_data->data, text ); - } - -inline int idStr::icmp - ( - const idStr& text - ) const - - { - assert( c_str () ); - assert( text.c_str () ); - - return idStr::icmp( c_str () , text.c_str () ); - } - -inline int idStr::cmp - ( - const char *text - ) const - - { - assert( m_data ); - assert( text ); - - return idStr::cmp( m_data->data, text ); - } - -inline int idStr::cmp - ( - const idStr& text - ) const - - { - assert( c_str () ); - assert( text.c_str () ); - - return idStr::cmp( c_str () , text.c_str () ); - } - -inline int idStr::cmpn - ( - const char *text, - int n - ) const - - { - assert( c_str () ); - assert( text ); - - return idStr::cmpn( c_str () , text, n ); - } - -inline int idStr::cmpn - ( - const idStr& text, - int n - ) const - - { - assert( c_str () ); - assert( text.c_str () ); - - return idStr::cmpn( c_str () , text.c_str () , n ); - } - -inline void idStr::tolower - ( - void - ) - - { - assert( m_data ); - - EnsureDataWritable (); - - idStr::toLower( m_data->data ); - } - -inline void idStr::toupper - ( - void - ) - - { - assert( m_data ); - - EnsureDataWritable (); - - idStr::toUpper( m_data->data ); - } - -inline bool idStr::isNumeric - ( - void - ) const - - { - assert( m_data ); - return idStr::isNumeric( m_data->data ); - } - -inline idStr::operator const char *() { - return c_str(); -} - -inline idStr::operator const char * - ( - void - ) const - - { - return c_str (); - } - -#endif diff --git a/code/ui/Conscript b/code/ui/Conscript deleted file mode 100644 index 86cdce2..0000000 --- a/code/ui/Conscript +++ /dev/null @@ -1,62 +0,0 @@ -# TA ui building - -# qvm building against native: -# only native has ui_syscalls.c -# qvm uses a custom ui_syscalls.asm with equ stubs -# qvm has additional bg_lib.c - -Import qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO CC CXX LINK ); - -$env = new cons( - # the code has the very bad habit of doing things like #include "../ui/ui_shared.h" - # this seems to confuse the dependency analysis, explicit toplevel includes seem to fix - CPPPATH => '#cgame:#game:#ui', - CC => $CC, - CXX => $CXX, - LINK => $LINK, - ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }, - CFLAGS => $BASE_CFLAGS . '-DMISSIONPACK -fPIC', - LDFLAGS => '-shared -ldl -lm' -); - -# qvm building -# we heavily customize the cons environment -$vm_env = new cons( - # the code has the very bad habit of doing things like #include "../ui/ui_shared.h" - # this seems to confuse the dependency analysis, explicit toplevel includes seem to fix - CPPPATH => '#cgame:#game:#ui', - CC => 'q3lcc', - CCCOM => '%CC %CFLAGS %_IFLAGS -c %< -o %>', - SUFOBJ => '.asm', - LINK => 'q3asm', - CFLAGS => '-DQ3_VM -DMISSIONPACK -S -Wf-target=bytecode -Wf-g', - # need to know where to find the compiler tools - ENV => { PATH => $ENV{PATH} . ":./qvmtools", }, -); - -# the file with vmMain function MUST be the first one of the list -@FILES = qw( - ui_main.c - ui_atoms.c - ui_gameinfo.c - ui_players.c - ui_util.c - ui_shared.c - ../game/bg_misc.c - ../game/q_math.c - ../game/q_shared.c - ); -$FILESREF = \@FILES; - -if ($NO_SO eq 0) -{ - Program $env 'uii386.so', @$FILESREF, 'ui_syscalls.c'; - Install $env $INSTALL_DIR, 'uii386.so'; -} -if ($NO_VM eq 0) -{ - Depends $vm_env 'ui.qvm', '#qvmtools/q3lcc'; - Depends $vm_env 'ui.qvm', '#qvmtools/q3asm'; - Program $vm_env 'ui.qvm', @$FILESREF, '../game/bg_lib.c', 'ui_syscalls.asm'; - Install $vm_env $INSTALL_DIR . '/vm', 'ui.qvm'; -} diff --git a/code/ui/compile.bat b/code/ui/compile.bat deleted file mode 100644 index 64308bb..0000000 --- a/code/ui/compile.bat +++ /dev/null @@ -1,2 +0,0 @@ -lcc -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1 - diff --git a/code/ui/keycodes.h b/code/ui/keycodes.h deleted file mode 100644 index 8f58482..0000000 --- a/code/ui/keycodes.h +++ /dev/null @@ -1,163 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// -#ifndef __KEYCODES_H__ -#define __KEYCODES_H__ - -// -// these are the key numbers that should be passed to KeyEvent -// - -// normal keys should be passed as lowercased ascii - -typedef enum { - K_TAB = 9, - K_ENTER = 13, - K_ESCAPE = 27, - K_SPACE = 32, - - K_BACKSPACE = 127, - - K_COMMAND = 128, - K_CAPSLOCK, - K_POWER, - K_PAUSE, - - K_UPARROW, - K_DOWNARROW, - K_LEFTARROW, - K_RIGHTARROW, - - K_ALT, - K_CTRL, - K_SHIFT, - K_INS, - K_DEL, - K_PGDN, - K_PGUP, - K_HOME, - K_END, - - K_F1, - K_F2, - K_F3, - K_F4, - K_F5, - K_F6, - K_F7, - K_F8, - K_F9, - K_F10, - K_F11, - K_F12, - K_F13, - K_F14, - K_F15, - - K_KP_HOME, - K_KP_UPARROW, - K_KP_PGUP, - K_KP_LEFTARROW, - K_KP_5, - K_KP_RIGHTARROW, - K_KP_END, - K_KP_DOWNARROW, - K_KP_PGDN, - K_KP_ENTER, - K_KP_INS, - K_KP_DEL, - K_KP_SLASH, - K_KP_MINUS, - K_KP_PLUS, - K_KP_NUMLOCK, - K_KP_STAR, - K_KP_EQUALS, - - K_MOUSE1, - K_MOUSE2, - K_MOUSE3, - K_MOUSE4, - K_MOUSE5, - - K_MWHEELDOWN, - K_MWHEELUP, - - K_JOY1, - K_JOY2, - K_JOY3, - K_JOY4, - K_JOY5, - K_JOY6, - K_JOY7, - K_JOY8, - K_JOY9, - K_JOY10, - K_JOY11, - K_JOY12, - K_JOY13, - K_JOY14, - K_JOY15, - K_JOY16, - K_JOY17, - K_JOY18, - K_JOY19, - K_JOY20, - K_JOY21, - K_JOY22, - K_JOY23, - K_JOY24, - K_JOY25, - K_JOY26, - K_JOY27, - K_JOY28, - K_JOY29, - K_JOY30, - K_JOY31, - K_JOY32, - - K_AUX1, - K_AUX2, - K_AUX3, - K_AUX4, - K_AUX5, - K_AUX6, - K_AUX7, - K_AUX8, - K_AUX9, - K_AUX10, - K_AUX11, - K_AUX12, - K_AUX13, - K_AUX14, - K_AUX15, - K_AUX16, - - K_LAST_KEY // this had better be <256! -} keyNum_t; - - -// The menu code needs to get both key and char events, but -// to avoid duplicating the paths, the char events are just -// distinguished by or'ing in K_CHAR_FLAG (ugly) -#define K_CHAR_FLAG 1024 - -#endif diff --git a/code/ui/ui.bat b/code/ui/ui.bat deleted file mode 100644 index dab6130..0000000 --- a/code/ui/ui.bat +++ /dev/null @@ -1,33 +0,0 @@ -rem make sure we have a safe environement -set LIBRARY= -set INCLUDE= - -mkdir vm -cd vm - -set cc=lcc -DMISSIONPACK -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1 - -%cc% ../ui_main.c -@if errorlevel 1 goto quit -%cc% ../../game/bg_misc.c -@if errorlevel 1 goto quit -%cc% ../../game/bg_lib.c -@if errorlevel 1 goto quit -%cc% ../../game/q_math.c -@if errorlevel 1 goto quit -%cc% ../../game/q_shared.c -@if errorlevel 1 goto quit -%cc% ../ui_atoms.c -@if errorlevel 1 goto quit -%cc% ../ui_players.c -@if errorlevel 1 goto quit -%cc% ../ui_util.c -@if errorlevel 1 goto quit -%cc% ../ui_shared.c -@if errorlevel 1 goto quit -%cc% ../ui_gameinfo.c -@if errorlevel 1 goto quit - -q3asm -f ../ui -:quit -cd .. diff --git a/code/ui/ui.def b/code/ui/ui.def deleted file mode 100644 index 2ee748e..0000000 --- a/code/ui/ui.def +++ /dev/null @@ -1,3 +0,0 @@ -EXPORTS - vmMain - dllEntry diff --git a/code/ui/ui.q3asm b/code/ui/ui.q3asm deleted file mode 100644 index c663c0c..0000000 --- a/code/ui/ui.q3asm +++ /dev/null @@ -1,12 +0,0 @@ --o "\quake3\missionpack\vm\ui" -ui_main -..\ui_syscalls -ui_atoms -ui_players -ui_util -ui_shared -ui_gameinfo -bg_misc -bg_lib -q_math -q_shared diff --git a/code/ui/ui.vcproj b/code/ui/ui.vcproj deleted file mode 100644 index 1bd745f..0000000 --- a/code/ui/ui.vcproj +++ /dev/null @@ -1,1008 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/ui/ui_atoms.c b/code/ui/ui_atoms.c deleted file mode 100644 index ad42531..0000000 --- a/code/ui/ui_atoms.c +++ /dev/null @@ -1,520 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// -/********************************************************************** - UI_ATOMS.C - - User interface building blocks and support functions. -**********************************************************************/ -#include "ui_local.h" - -qboolean m_entersound; // after a frame, so caching won't disrupt the sound - -// these are here so the functions in q_shared.c can link -#ifndef UI_HARD_LINKED - -void QDECL Com_Error( int level, const char *error, ... ) { - va_list argptr; - char text[1024]; - - va_start (argptr, error); - vsprintf (text, error, argptr); - va_end (argptr); - - trap_Error( va("%s", text) ); -} - -void QDECL Com_Printf( const char *msg, ... ) { - va_list argptr; - char text[1024]; - - va_start (argptr, msg); - vsprintf (text, msg, argptr); - va_end (argptr); - - trap_Print( va("%s", text) ); -} - -#endif - -qboolean newUI = qfalse; - - -/* -================= -UI_ClampCvar -================= -*/ -float UI_ClampCvar( float min, float max, float value ) -{ - if ( value < min ) return min; - if ( value > max ) return max; - return value; -} - -/* -================= -UI_StartDemoLoop -================= -*/ -void UI_StartDemoLoop( void ) { - trap_Cmd_ExecuteText( EXEC_APPEND, "d1\n" ); -} - - -#ifndef MISSIONPACK // bk001206 -static void NeedCDAction( qboolean result ) { - if ( !result ) { - trap_Cmd_ExecuteText( EXEC_APPEND, "quit\n" ); - } -} -#endif // MISSIONPACK - -#ifndef MISSIONPACK // bk001206 -static void NeedCDKeyAction( qboolean result ) { - if ( !result ) { - trap_Cmd_ExecuteText( EXEC_APPEND, "quit\n" ); - } -} -#endif // MISSIONPACK - -char *UI_Argv( int arg ) { - static char buffer[MAX_STRING_CHARS]; - - trap_Argv( arg, buffer, sizeof( buffer ) ); - - return buffer; -} - - -char *UI_Cvar_VariableString( const char *var_name ) { - static char buffer[MAX_STRING_CHARS]; - - trap_Cvar_VariableStringBuffer( var_name, buffer, sizeof( buffer ) ); - - return buffer; -} - - - -void UI_SetBestScores(postGameInfo_t *newInfo, qboolean postGame) { - trap_Cvar_Set("ui_scoreAccuracy", va("%i%%", newInfo->accuracy)); - trap_Cvar_Set("ui_scoreImpressives", va("%i", newInfo->impressives)); - trap_Cvar_Set("ui_scoreExcellents", va("%i", newInfo->excellents)); - trap_Cvar_Set("ui_scoreDefends", va("%i", newInfo->defends)); - trap_Cvar_Set("ui_scoreAssists", va("%i", newInfo->assists)); - trap_Cvar_Set("ui_scoreGauntlets", va("%i", newInfo->gauntlets)); - trap_Cvar_Set("ui_scoreScore", va("%i", newInfo->score)); - trap_Cvar_Set("ui_scorePerfect", va("%i", newInfo->perfects)); - trap_Cvar_Set("ui_scoreTeam", va("%i to %i", newInfo->redScore, newInfo->blueScore)); - trap_Cvar_Set("ui_scoreBase", va("%i", newInfo->baseScore)); - trap_Cvar_Set("ui_scoreTimeBonus", va("%i", newInfo->timeBonus)); - trap_Cvar_Set("ui_scoreSkillBonus", va("%i", newInfo->skillBonus)); - trap_Cvar_Set("ui_scoreShutoutBonus", va("%i", newInfo->shutoutBonus)); - trap_Cvar_Set("ui_scoreTime", va("%02i:%02i", newInfo->time / 60, newInfo->time % 60)); - trap_Cvar_Set("ui_scoreCaptures", va("%i", newInfo->captures)); - if (postGame) { - trap_Cvar_Set("ui_scoreAccuracy2", va("%i%%", newInfo->accuracy)); - trap_Cvar_Set("ui_scoreImpressives2", va("%i", newInfo->impressives)); - trap_Cvar_Set("ui_scoreExcellents2", va("%i", newInfo->excellents)); - trap_Cvar_Set("ui_scoreDefends2", va("%i", newInfo->defends)); - trap_Cvar_Set("ui_scoreAssists2", va("%i", newInfo->assists)); - trap_Cvar_Set("ui_scoreGauntlets2", va("%i", newInfo->gauntlets)); - trap_Cvar_Set("ui_scoreScore2", va("%i", newInfo->score)); - trap_Cvar_Set("ui_scorePerfect2", va("%i", newInfo->perfects)); - trap_Cvar_Set("ui_scoreTeam2", va("%i to %i", newInfo->redScore, newInfo->blueScore)); - trap_Cvar_Set("ui_scoreBase2", va("%i", newInfo->baseScore)); - trap_Cvar_Set("ui_scoreTimeBonus2", va("%i", newInfo->timeBonus)); - trap_Cvar_Set("ui_scoreSkillBonus2", va("%i", newInfo->skillBonus)); - trap_Cvar_Set("ui_scoreShutoutBonus2", va("%i", newInfo->shutoutBonus)); - trap_Cvar_Set("ui_scoreTime2", va("%02i:%02i", newInfo->time / 60, newInfo->time % 60)); - trap_Cvar_Set("ui_scoreCaptures2", va("%i", newInfo->captures)); - } -} - -void UI_LoadBestScores(const char *map, int game) { - char fileName[MAX_QPATH]; - fileHandle_t f; - postGameInfo_t newInfo; - memset(&newInfo, 0, sizeof(postGameInfo_t)); - Com_sprintf(fileName, MAX_QPATH, "games/%s_%i.game", map, game); - if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { - int size = 0; - trap_FS_Read(&size, sizeof(int), f); - if (size == sizeof(postGameInfo_t)) { - trap_FS_Read(&newInfo, sizeof(postGameInfo_t), f); - } - trap_FS_FCloseFile(f); - } - UI_SetBestScores(&newInfo, qfalse); - - Com_sprintf(fileName, MAX_QPATH, "demos/%s_%d.dm_%d", map, game, (int)trap_Cvar_VariableValue("protocol")); - uiInfo.demoAvailable = qfalse; - if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { - uiInfo.demoAvailable = qtrue; - trap_FS_FCloseFile(f); - } -} - -/* -=============== -UI_ClearScores -=============== -*/ -void UI_ClearScores() { - char gameList[4096]; - char *gameFile; - int i, len, count, size; - fileHandle_t f; - postGameInfo_t newInfo; - - count = trap_FS_GetFileList( "games", "game", gameList, sizeof(gameList) ); - - size = sizeof(postGameInfo_t); - memset(&newInfo, 0, size); - - if (count > 0) { - gameFile = gameList; - for ( i = 0; i < count; i++ ) { - len = strlen(gameFile); - if (trap_FS_FOpenFile(va("games/%s",gameFile), &f, FS_WRITE) >= 0) { - trap_FS_Write(&size, sizeof(int), f); - trap_FS_Write(&newInfo, size, f); - trap_FS_FCloseFile(f); - } - gameFile += len + 1; - } - } - - UI_SetBestScores(&newInfo, qfalse); - -} - - - -static void UI_Cache_f() { - Display_CacheAll(); -} - -/* -======================= -UI_CalcPostGameStats -======================= -*/ -static void UI_CalcPostGameStats() { - char map[MAX_QPATH]; - char fileName[MAX_QPATH]; - char info[MAX_INFO_STRING]; - fileHandle_t f; - int size, game, time, adjustedTime; - postGameInfo_t oldInfo; - postGameInfo_t newInfo; - qboolean newHigh = qfalse; - - trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ); - Q_strncpyz( map, Info_ValueForKey( info, "mapname" ), sizeof(map) ); - game = atoi(Info_ValueForKey(info, "g_gametype")); - - // compose file name - Com_sprintf(fileName, MAX_QPATH, "games/%s_%i.game", map, game); - // see if we have one already - memset(&oldInfo, 0, sizeof(postGameInfo_t)); - if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { - // if so load it - size = 0; - trap_FS_Read(&size, sizeof(int), f); - if (size == sizeof(postGameInfo_t)) { - trap_FS_Read(&oldInfo, sizeof(postGameInfo_t), f); - } - trap_FS_FCloseFile(f); - } - - newInfo.accuracy = atoi(UI_Argv(3)); - newInfo.impressives = atoi(UI_Argv(4)); - newInfo.excellents = atoi(UI_Argv(5)); - newInfo.defends = atoi(UI_Argv(6)); - newInfo.assists = atoi(UI_Argv(7)); - newInfo.gauntlets = atoi(UI_Argv(8)); - newInfo.baseScore = atoi(UI_Argv(9)); - newInfo.perfects = atoi(UI_Argv(10)); - newInfo.redScore = atoi(UI_Argv(11)); - newInfo.blueScore = atoi(UI_Argv(12)); - time = atoi(UI_Argv(13)); - newInfo.captures = atoi(UI_Argv(14)); - - newInfo.time = (time - trap_Cvar_VariableValue("ui_matchStartTime")) / 1000; - adjustedTime = uiInfo.mapList[ui_currentMap.integer].timeToBeat[game]; - if (newInfo.time < adjustedTime) { - newInfo.timeBonus = (adjustedTime - newInfo.time) * 10; - } else { - newInfo.timeBonus = 0; - } - - if (newInfo.redScore > newInfo.blueScore && newInfo.blueScore <= 0) { - newInfo.shutoutBonus = 100; - } else { - newInfo.shutoutBonus = 0; - } - - newInfo.skillBonus = trap_Cvar_VariableValue("g_spSkill"); - if (newInfo.skillBonus <= 0) { - newInfo.skillBonus = 1; - } - newInfo.score = newInfo.baseScore + newInfo.shutoutBonus + newInfo.timeBonus; - newInfo.score *= newInfo.skillBonus; - - // see if the score is higher for this one - newHigh = (newInfo.redScore > newInfo.blueScore && newInfo.score > oldInfo.score); - - if (newHigh) { - // if so write out the new one - uiInfo.newHighScoreTime = uiInfo.uiDC.realTime + 20000; - if (trap_FS_FOpenFile(fileName, &f, FS_WRITE) >= 0) { - size = sizeof(postGameInfo_t); - trap_FS_Write(&size, sizeof(int), f); - trap_FS_Write(&newInfo, sizeof(postGameInfo_t), f); - trap_FS_FCloseFile(f); - } - } - - if (newInfo.time < oldInfo.time) { - uiInfo.newBestTime = uiInfo.uiDC.realTime + 20000; - } - - // put back all the ui overrides - trap_Cvar_Set("capturelimit", UI_Cvar_VariableString("ui_saveCaptureLimit")); - trap_Cvar_Set("fraglimit", UI_Cvar_VariableString("ui_saveFragLimit")); - trap_Cvar_Set("cg_drawTimer", UI_Cvar_VariableString("ui_drawTimer")); - trap_Cvar_Set("g_doWarmup", UI_Cvar_VariableString("ui_doWarmup")); - trap_Cvar_Set("g_Warmup", UI_Cvar_VariableString("ui_Warmup")); - trap_Cvar_Set("sv_pure", UI_Cvar_VariableString("ui_pure")); - trap_Cvar_Set("g_friendlyFire", UI_Cvar_VariableString("ui_friendlyFire")); - - UI_SetBestScores(&newInfo, qtrue); - UI_ShowPostGame(newHigh); - - -} - - -/* -================= -UI_ConsoleCommand -================= -*/ -qboolean UI_ConsoleCommand( int realTime ) { - char *cmd; - - uiInfo.uiDC.frameTime = realTime - uiInfo.uiDC.realTime; - uiInfo.uiDC.realTime = realTime; - - cmd = UI_Argv( 0 ); - - // ensure minimum menu data is available - //Menu_Cache(); - - if ( Q_stricmp (cmd, "ui_test") == 0 ) { - UI_ShowPostGame(qtrue); - } - - if ( Q_stricmp (cmd, "ui_report") == 0 ) { - UI_Report(); - return qtrue; - } - - if ( Q_stricmp (cmd, "ui_load") == 0 ) { - UI_Load(); - return qtrue; - } - - if ( Q_stricmp (cmd, "remapShader") == 0 ) { - if (trap_Argc() == 4) { - char shader1[MAX_QPATH]; - char shader2[MAX_QPATH]; - Q_strncpyz(shader1, UI_Argv(1), sizeof(shader1)); - Q_strncpyz(shader2, UI_Argv(2), sizeof(shader2)); - trap_R_RemapShader(shader1, shader2, UI_Argv(3)); - return qtrue; - } - } - - if ( Q_stricmp (cmd, "postgame") == 0 ) { - UI_CalcPostGameStats(); - return qtrue; - } - - if ( Q_stricmp (cmd, "ui_cache") == 0 ) { - UI_Cache_f(); - return qtrue; - } - - if ( Q_stricmp (cmd, "ui_teamOrders") == 0 ) { - //UI_TeamOrdersMenu_f(); - return qtrue; - } - - - if ( Q_stricmp (cmd, "ui_cdkey") == 0 ) { - //UI_CDKeyMenu_f(); - return qtrue; - } - - return qfalse; -} - -/* -================= -UI_Shutdown -================= -*/ -void UI_Shutdown( void ) { -} - -/* -================ -UI_AdjustFrom640 - -Adjusted for resolution and screen aspect ratio -================ -*/ -void UI_AdjustFrom640( float *x, float *y, float *w, float *h ) { - // expect valid pointers -#if 0 - *x = *x * uiInfo.uiDC.scale + uiInfo.uiDC.bias; - *y *= uiInfo.uiDC.scale; - *w *= uiInfo.uiDC.scale; - *h *= uiInfo.uiDC.scale; -#endif - - *x *= uiInfo.uiDC.xscale; - *y *= uiInfo.uiDC.yscale; - *w *= uiInfo.uiDC.xscale; - *h *= uiInfo.uiDC.yscale; - -} - -void UI_DrawNamedPic( float x, float y, float width, float height, const char *picname ) { - qhandle_t hShader; - - hShader = trap_R_RegisterShaderNoMip( picname ); - UI_AdjustFrom640( &x, &y, &width, &height ); - trap_R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, hShader ); -} - -void UI_DrawHandlePic( float x, float y, float w, float h, qhandle_t hShader ) { - float s0; - float s1; - float t0; - float t1; - - if( w < 0 ) { // flip about vertical - w = -w; - s0 = 1; - s1 = 0; - } - else { - s0 = 0; - s1 = 1; - } - - if( h < 0 ) { // flip about horizontal - h = -h; - t0 = 1; - t1 = 0; - } - else { - t0 = 0; - t1 = 1; - } - - UI_AdjustFrom640( &x, &y, &w, &h ); - trap_R_DrawStretchPic( x, y, w, h, s0, t0, s1, t1, hShader ); -} - -/* -================ -UI_FillRect - -Coordinates are 640*480 virtual values -================= -*/ -void UI_FillRect( float x, float y, float width, float height, const float *color ) { - trap_R_SetColor( color ); - - UI_AdjustFrom640( &x, &y, &width, &height ); - trap_R_DrawStretchPic( x, y, width, height, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); - - trap_R_SetColor( NULL ); -} - -void UI_DrawSides(float x, float y, float w, float h) { - UI_AdjustFrom640( &x, &y, &w, &h ); - trap_R_DrawStretchPic( x, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); - trap_R_DrawStretchPic( x + w - 1, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); -} - -void UI_DrawTopBottom(float x, float y, float w, float h) { - UI_AdjustFrom640( &x, &y, &w, &h ); - trap_R_DrawStretchPic( x, y, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); - trap_R_DrawStretchPic( x, y + h - 1, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); -} -/* -================ -UI_DrawRect - -Coordinates are 640*480 virtual values -================= -*/ -void UI_DrawRect( float x, float y, float width, float height, const float *color ) { - trap_R_SetColor( color ); - - UI_DrawTopBottom(x, y, width, height); - UI_DrawSides(x, y, width, height); - - trap_R_SetColor( NULL ); -} - -void UI_SetColor( const float *rgba ) { - trap_R_SetColor( rgba ); -} - -void UI_UpdateScreen( void ) { - trap_UpdateScreen(); -} - - -void UI_DrawTextBox (int x, int y, int width, int lines) -{ - UI_FillRect( x + BIGCHAR_WIDTH/2, y + BIGCHAR_HEIGHT/2, ( width + 1 ) * BIGCHAR_WIDTH, ( lines + 1 ) * BIGCHAR_HEIGHT, colorBlack ); - UI_DrawRect( x + BIGCHAR_WIDTH/2, y + BIGCHAR_HEIGHT/2, ( width + 1 ) * BIGCHAR_WIDTH, ( lines + 1 ) * BIGCHAR_HEIGHT, colorWhite ); -} - -qboolean UI_CursorInRect (int x, int y, int width, int height) -{ - if (uiInfo.uiDC.cursorx < x || - uiInfo.uiDC.cursory < y || - uiInfo.uiDC.cursorx > x+width || - uiInfo.uiDC.cursory > y+height) - return qfalse; - - return qtrue; -} diff --git a/code/ui/ui_gameinfo.c b/code/ui/ui_gameinfo.c deleted file mode 100644 index 47b2a87..0000000 --- a/code/ui/ui_gameinfo.c +++ /dev/null @@ -1,324 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// -// -// gameinfo.c -// - -#include "ui_local.h" - - -// -// arena and bot info -// - - -int ui_numBots; -static char *ui_botInfos[MAX_BOTS]; - -static int ui_numArenas; -static char *ui_arenaInfos[MAX_ARENAS]; - -#ifndef MISSIONPACK // bk001206 -static int ui_numSinglePlayerArenas; -static int ui_numSpecialSinglePlayerArenas; -#endif - -/* -=============== -UI_ParseInfos -=============== -*/ -int UI_ParseInfos( char *buf, int max, char *infos[] ) { - char *token; - int count; - char key[MAX_TOKEN_CHARS]; - char info[MAX_INFO_STRING]; - - count = 0; - - while ( 1 ) { - token = COM_Parse( &buf ); - if ( !token[0] ) { - break; - } - if ( strcmp( token, "{" ) ) { - Com_Printf( "Missing { in info file\n" ); - break; - } - - if ( count == max ) { - Com_Printf( "Max infos exceeded\n" ); - break; - } - - info[0] = '\0'; - while ( 1 ) { - token = COM_ParseExt( &buf, qtrue ); - if ( !token[0] ) { - Com_Printf( "Unexpected end of info file\n" ); - break; - } - if ( !strcmp( token, "}" ) ) { - break; - } - Q_strncpyz( key, token, sizeof( key ) ); - - token = COM_ParseExt( &buf, qfalse ); - if ( !token[0] ) { - strcpy( token, "" ); - } - Info_SetValueForKey( info, key, token ); - } - //NOTE: extra space for arena number - infos[count] = UI_Alloc(strlen(info) + strlen("\\num\\") + strlen(va("%d", MAX_ARENAS)) + 1); - if (infos[count]) { - strcpy(infos[count], info); - count++; - } - } - return count; -} - -/* -=============== -UI_LoadArenasFromFile -=============== -*/ -static void UI_LoadArenasFromFile( char *filename ) { - int len; - fileHandle_t f; - char buf[MAX_ARENAS_TEXT]; - - len = trap_FS_FOpenFile( filename, &f, FS_READ ); - if ( !f ) { - trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) ); - return; - } - if ( len >= MAX_ARENAS_TEXT ) { - trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, MAX_ARENAS_TEXT ) ); - trap_FS_FCloseFile( f ); - return; - } - - trap_FS_Read( buf, len, f ); - buf[len] = 0; - trap_FS_FCloseFile( f ); - - ui_numArenas += UI_ParseInfos( buf, MAX_ARENAS - ui_numArenas, &ui_arenaInfos[ui_numArenas] ); -} - -/* -=============== -UI_LoadArenas -=============== -*/ -void UI_LoadArenas( void ) { - int numdirs; - vmCvar_t arenasFile; - char filename[128]; - char dirlist[1024]; - char* dirptr; - int i, n; - int dirlen; - char *type; - - ui_numArenas = 0; - uiInfo.mapCount = 0; - - trap_Cvar_Register( &arenasFile, "g_arenasFile", "", CVAR_INIT|CVAR_ROM ); - if( *arenasFile.string ) { - UI_LoadArenasFromFile(arenasFile.string); - } - else { - UI_LoadArenasFromFile("scripts/arenas.txt"); - } - - // get all arenas from .arena files - numdirs = trap_FS_GetFileList("scripts", ".arena", dirlist, 1024 ); - dirptr = dirlist; - for (i = 0; i < numdirs; i++, dirptr += dirlen+1) { - dirlen = strlen(dirptr); - strcpy(filename, "scripts/"); - strcat(filename, dirptr); - UI_LoadArenasFromFile(filename); - } - trap_Print( va( "%i arenas parsed\n", ui_numArenas ) ); - if (UI_OutOfMemory()) { - trap_Print(S_COLOR_YELLOW"WARNING: not anough memory in pool to load all arenas\n"); - } - - for( n = 0; n < ui_numArenas; n++ ) { - // determine type - - uiInfo.mapList[uiInfo.mapCount].cinematic = -1; - uiInfo.mapList[uiInfo.mapCount].mapLoadName = String_Alloc(Info_ValueForKey(ui_arenaInfos[n], "map")); - uiInfo.mapList[uiInfo.mapCount].mapName = String_Alloc(Info_ValueForKey(ui_arenaInfos[n], "longname")); - uiInfo.mapList[uiInfo.mapCount].levelShot = -1; - uiInfo.mapList[uiInfo.mapCount].imageName = String_Alloc(va("levelshots/%s", uiInfo.mapList[uiInfo.mapCount].mapLoadName)); - uiInfo.mapList[uiInfo.mapCount].typeBits = 0; - - type = Info_ValueForKey( ui_arenaInfos[n], "type" ); - // if no type specified, it will be treated as "ffa" - if( *type ) { - if( strstr( type, "ffa" ) ) { - uiInfo.mapList[uiInfo.mapCount].typeBits |= (1 << GT_FFA); - } - if( strstr( type, "tourney" ) ) { - uiInfo.mapList[uiInfo.mapCount].typeBits |= (1 << GT_TOURNAMENT); - } - if( strstr( type, "ctf" ) ) { - uiInfo.mapList[uiInfo.mapCount].typeBits |= (1 << GT_CTF); - } - if( strstr( type, "oneflag" ) ) { - uiInfo.mapList[uiInfo.mapCount].typeBits |= (1 << GT_1FCTF); - } - if( strstr( type, "overload" ) ) { - uiInfo.mapList[uiInfo.mapCount].typeBits |= (1 << GT_OBELISK); - } - if( strstr( type, "harvester" ) ) { - uiInfo.mapList[uiInfo.mapCount].typeBits |= (1 << GT_HARVESTER); - } - } else { - uiInfo.mapList[uiInfo.mapCount].typeBits |= (1 << GT_FFA); - } - - uiInfo.mapCount++; - if (uiInfo.mapCount >= MAX_MAPS) { - break; - } - } -} - - -/* -=============== -UI_LoadBotsFromFile -=============== -*/ -static void UI_LoadBotsFromFile( char *filename ) { - int len; - fileHandle_t f; - char buf[MAX_BOTS_TEXT]; - - len = trap_FS_FOpenFile( filename, &f, FS_READ ); - if ( !f ) { - trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) ); - return; - } - if ( len >= MAX_BOTS_TEXT ) { - trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, MAX_BOTS_TEXT ) ); - trap_FS_FCloseFile( f ); - return; - } - - trap_FS_Read( buf, len, f ); - buf[len] = 0; - trap_FS_FCloseFile( f ); - - COM_Compress(buf); - - ui_numBots += UI_ParseInfos( buf, MAX_BOTS - ui_numBots, &ui_botInfos[ui_numBots] ); -} - -/* -=============== -UI_LoadBots -=============== -*/ -void UI_LoadBots( void ) { - vmCvar_t botsFile; - int numdirs; - char filename[128]; - char dirlist[1024]; - char* dirptr; - int i; - int dirlen; - - ui_numBots = 0; - - trap_Cvar_Register( &botsFile, "g_botsFile", "", CVAR_INIT|CVAR_ROM ); - if( *botsFile.string ) { - UI_LoadBotsFromFile(botsFile.string); - } - else { - UI_LoadBotsFromFile("scripts/bots.txt"); - } - - // get all bots from .bot files - numdirs = trap_FS_GetFileList("scripts", ".bot", dirlist, 1024 ); - dirptr = dirlist; - for (i = 0; i < numdirs; i++, dirptr += dirlen+1) { - dirlen = strlen(dirptr); - strcpy(filename, "scripts/"); - strcat(filename, dirptr); - UI_LoadBotsFromFile(filename); - } - trap_Print( va( "%i bots parsed\n", ui_numBots ) ); -} - - -/* -=============== -UI_GetBotInfoByNumber -=============== -*/ -char *UI_GetBotInfoByNumber( int num ) { - if( num < 0 || num >= ui_numBots ) { - trap_Print( va( S_COLOR_RED "Invalid bot number: %i\n", num ) ); - return NULL; - } - return ui_botInfos[num]; -} - - -/* -=============== -UI_GetBotInfoByName -=============== -*/ -char *UI_GetBotInfoByName( const char *name ) { - int n; - char *value; - - for ( n = 0; n < ui_numBots ; n++ ) { - value = Info_ValueForKey( ui_botInfos[n], "name" ); - if ( !Q_stricmp( value, name ) ) { - return ui_botInfos[n]; - } - } - - return NULL; -} - -int UI_GetNumBots() { - return ui_numBots; -} - - -char *UI_GetBotNameByNumber( int num ) { - char *info = UI_GetBotInfoByNumber(num); - if (info) { - return Info_ValueForKey( info, "name" ); - } - return "Sarge"; -} diff --git a/code/ui/ui_local.h b/code/ui/ui_local.h deleted file mode 100644 index a7b5a5e..0000000 --- a/code/ui/ui_local.h +++ /dev/null @@ -1,1136 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// -#ifndef __UI_LOCAL_H__ -#define __UI_LOCAL_H__ - -#include "../game/q_shared.h" -#include "../cgame/tr_types.h" -#include "ui_public.h" -#include "keycodes.h" -#include "../game/bg_public.h" -#include "ui_shared.h" - -// global display context - -extern vmCvar_t ui_ffa_fraglimit; -extern vmCvar_t ui_ffa_timelimit; - -extern vmCvar_t ui_tourney_fraglimit; -extern vmCvar_t ui_tourney_timelimit; - -extern vmCvar_t ui_team_fraglimit; -extern vmCvar_t ui_team_timelimit; -extern vmCvar_t ui_team_friendly; - -extern vmCvar_t ui_ctf_capturelimit; -extern vmCvar_t ui_ctf_timelimit; -extern vmCvar_t ui_ctf_friendly; - -extern vmCvar_t ui_arenasFile; -extern vmCvar_t ui_botsFile; -extern vmCvar_t ui_spScores1; -extern vmCvar_t ui_spScores2; -extern vmCvar_t ui_spScores3; -extern vmCvar_t ui_spScores4; -extern vmCvar_t ui_spScores5; -extern vmCvar_t ui_spAwards; -extern vmCvar_t ui_spVideos; -extern vmCvar_t ui_spSkill; - -extern vmCvar_t ui_spSelection; - -extern vmCvar_t ui_browserMaster; -extern vmCvar_t ui_browserGameType; -extern vmCvar_t ui_browserSortKey; -extern vmCvar_t ui_browserShowFull; -extern vmCvar_t ui_browserShowEmpty; - -extern vmCvar_t ui_brassTime; -extern vmCvar_t ui_drawCrosshair; -extern vmCvar_t ui_drawCrosshairNames; -extern vmCvar_t ui_marks; - -extern vmCvar_t ui_server1; -extern vmCvar_t ui_server2; -extern vmCvar_t ui_server3; -extern vmCvar_t ui_server4; -extern vmCvar_t ui_server5; -extern vmCvar_t ui_server6; -extern vmCvar_t ui_server7; -extern vmCvar_t ui_server8; -extern vmCvar_t ui_server9; -extern vmCvar_t ui_server10; -extern vmCvar_t ui_server11; -extern vmCvar_t ui_server12; -extern vmCvar_t ui_server13; -extern vmCvar_t ui_server14; -extern vmCvar_t ui_server15; -extern vmCvar_t ui_server16; - -extern vmCvar_t ui_cdkey; -extern vmCvar_t ui_cdkeychecked; - -extern vmCvar_t ui_captureLimit; -extern vmCvar_t ui_fragLimit; -extern vmCvar_t ui_gameType; -extern vmCvar_t ui_netGameType; -extern vmCvar_t ui_actualNetGameType; -extern vmCvar_t ui_joinGameType; -extern vmCvar_t ui_netSource; -extern vmCvar_t ui_serverFilterType; -extern vmCvar_t ui_dedicated; -extern vmCvar_t ui_opponentName; -extern vmCvar_t ui_menuFiles; -extern vmCvar_t ui_currentTier; -extern vmCvar_t ui_currentMap; -extern vmCvar_t ui_currentNetMap; -extern vmCvar_t ui_mapIndex; -extern vmCvar_t ui_currentOpponent; -extern vmCvar_t ui_selectedPlayer; -extern vmCvar_t ui_selectedPlayerName; -extern vmCvar_t ui_lastServerRefresh_0; -extern vmCvar_t ui_lastServerRefresh_1; -extern vmCvar_t ui_lastServerRefresh_2; -extern vmCvar_t ui_lastServerRefresh_3; -extern vmCvar_t ui_singlePlayerActive; -extern vmCvar_t ui_scoreAccuracy; -extern vmCvar_t ui_scoreImpressives; -extern vmCvar_t ui_scoreExcellents; -extern vmCvar_t ui_scoreDefends; -extern vmCvar_t ui_scoreAssists; -extern vmCvar_t ui_scoreGauntlets; -extern vmCvar_t ui_scoreScore; -extern vmCvar_t ui_scorePerfect; -extern vmCvar_t ui_scoreTeam; -extern vmCvar_t ui_scoreBase; -extern vmCvar_t ui_scoreTimeBonus; -extern vmCvar_t ui_scoreSkillBonus; -extern vmCvar_t ui_scoreShutoutBonus; -extern vmCvar_t ui_scoreTime; -extern vmCvar_t ui_smallFont; -extern vmCvar_t ui_bigFont; -extern vmCvar_t ui_serverStatusTimeOut; - - - -// -// ui_qmenu.c -// - -#define RCOLUMN_OFFSET ( BIGCHAR_WIDTH ) -#define LCOLUMN_OFFSET (-BIGCHAR_WIDTH ) - -#define SLIDER_RANGE 10 -#define MAX_EDIT_LINE 256 - -#define MAX_MENUDEPTH 8 -#define MAX_MENUITEMS 96 - -#define MTYPE_NULL 0 -#define MTYPE_SLIDER 1 -#define MTYPE_ACTION 2 -#define MTYPE_SPINCONTROL 3 -#define MTYPE_FIELD 4 -#define MTYPE_RADIOBUTTON 5 -#define MTYPE_BITMAP 6 -#define MTYPE_TEXT 7 -#define MTYPE_SCROLLLIST 8 -#define MTYPE_PTEXT 9 -#define MTYPE_BTEXT 10 - -#define QMF_BLINK 0x00000001 -#define QMF_SMALLFONT 0x00000002 -#define QMF_LEFT_JUSTIFY 0x00000004 -#define QMF_CENTER_JUSTIFY 0x00000008 -#define QMF_RIGHT_JUSTIFY 0x00000010 -#define QMF_NUMBERSONLY 0x00000020 // edit field is only numbers -#define QMF_HIGHLIGHT 0x00000040 -#define QMF_HIGHLIGHT_IF_FOCUS 0x00000080 // steady focus -#define QMF_PULSEIFFOCUS 0x00000100 // pulse if focus -#define QMF_HASMOUSEFOCUS 0x00000200 -#define QMF_NOONOFFTEXT 0x00000400 -#define QMF_MOUSEONLY 0x00000800 // only mouse input allowed -#define QMF_HIDDEN 0x00001000 // skips drawing -#define QMF_GRAYED 0x00002000 // grays and disables -#define QMF_INACTIVE 0x00004000 // disables any input -#define QMF_NODEFAULTINIT 0x00008000 // skip default initialization -#define QMF_OWNERDRAW 0x00010000 -#define QMF_PULSE 0x00020000 -#define QMF_LOWERCASE 0x00040000 // edit field is all lower case -#define QMF_UPPERCASE 0x00080000 // edit field is all upper case -#define QMF_SILENT 0x00100000 - -// callback notifications -#define QM_GOTFOCUS 1 -#define QM_LOSTFOCUS 2 -#define QM_ACTIVATED 3 - -typedef struct _tag_menuframework -{ - int cursor; - int cursor_prev; - - int nitems; - void *items[MAX_MENUITEMS]; - - void (*draw) (void); - sfxHandle_t (*key) (int key); - - qboolean wrapAround; - qboolean fullscreen; - qboolean showlogo; -} menuframework_s; - -typedef struct -{ - int type; - const char *name; - int id; - int x, y; - int left; - int top; - int right; - int bottom; - menuframework_s *parent; - int menuPosition; - unsigned flags; - - void (*callback)( void *self, int event ); - void (*statusbar)( void *self ); - void (*ownerdraw)( void *self ); -} menucommon_s; - -typedef struct { - int cursor; - int scroll; - int widthInChars; - char buffer[MAX_EDIT_LINE]; - int maxchars; -} mfield_t; - -typedef struct -{ - menucommon_s generic; - mfield_t field; -} menufield_s; - -typedef struct -{ - menucommon_s generic; - - float minvalue; - float maxvalue; - float curvalue; - - float range; -} menuslider_s; - -typedef struct -{ - menucommon_s generic; - - int oldvalue; - int curvalue; - int numitems; - int top; - - const char **itemnames; - - int width; - int height; - int columns; - int seperation; -} menulist_s; - -typedef struct -{ - menucommon_s generic; -} menuaction_s; - -typedef struct -{ - menucommon_s generic; - int curvalue; -} menuradiobutton_s; - -typedef struct -{ - menucommon_s generic; - char* focuspic; - char* errorpic; - qhandle_t shader; - qhandle_t focusshader; - int width; - int height; - float* focuscolor; -} menubitmap_s; - -typedef struct -{ - menucommon_s generic; - char* string; - int style; - float* color; -} menutext_s; - -extern void Menu_Cache( void ); -extern void Menu_Focus( menucommon_s *m ); -extern void Menu_AddItem( menuframework_s *menu, void *item ); -extern void Menu_AdjustCursor( menuframework_s *menu, int dir ); -extern void Menu_Draw( menuframework_s *menu ); -extern void *Menu_ItemAtCursor( menuframework_s *m ); -extern sfxHandle_t Menu_ActivateItem( menuframework_s *s, menucommon_s* item ); -extern void Menu_SetCursor( menuframework_s *s, int cursor ); -extern void Menu_SetCursorToItem( menuframework_s *m, void* ptr ); -extern sfxHandle_t Menu_DefaultKey( menuframework_s *s, int key ); -extern void Bitmap_Init( menubitmap_s *b ); -extern void Bitmap_Draw( menubitmap_s *b ); -extern void ScrollList_Draw( menulist_s *l ); -extern sfxHandle_t ScrollList_Key( menulist_s *l, int key ); -extern sfxHandle_t menu_in_sound; -extern sfxHandle_t menu_move_sound; -extern sfxHandle_t menu_out_sound; -extern sfxHandle_t menu_buzz_sound; -extern sfxHandle_t menu_null_sound; -extern sfxHandle_t weaponChangeSound; -extern vec4_t menu_text_color; -extern vec4_t menu_grayed_color; -extern vec4_t menu_dark_color; -extern vec4_t menu_highlight_color; -extern vec4_t menu_red_color; -extern vec4_t menu_black_color; -extern vec4_t menu_dim_color; -extern vec4_t color_black; -extern vec4_t color_white; -extern vec4_t color_yellow; -extern vec4_t color_blue; -extern vec4_t color_orange; -extern vec4_t color_red; -extern vec4_t color_dim; -extern vec4_t name_color; -extern vec4_t list_color; -extern vec4_t listbar_color; -extern vec4_t text_color_disabled; -extern vec4_t text_color_normal; -extern vec4_t text_color_highlight; - -extern char *ui_medalNames[]; -extern char *ui_medalPicNames[]; -extern char *ui_medalSounds[]; - -// -// ui_mfield.c -// -extern void MField_Clear( mfield_t *edit ); -extern void MField_KeyDownEvent( mfield_t *edit, int key ); -extern void MField_CharEvent( mfield_t *edit, int ch ); -extern void MField_Draw( mfield_t *edit, int x, int y, int style, vec4_t color ); -extern void MenuField_Init( menufield_s* m ); -extern void MenuField_Draw( menufield_s *f ); -extern sfxHandle_t MenuField_Key( menufield_s* m, int* key ); - -// -// ui_main.c -// -void UI_Report(); -void UI_Load(); -void UI_LoadMenus(const char *menuFile, qboolean reset); -void _UI_SetActiveMenu( uiMenuCommand_t menu ); -int UI_AdjustTimeByGame(int time); -void UI_ShowPostGame(qboolean newHigh); -void UI_ClearScores(); -void UI_LoadArenas(void); - -// -// ui_menu.c -// -extern void MainMenu_Cache( void ); -extern void UI_MainMenu(void); -extern void UI_RegisterCvars( void ); -extern void UI_UpdateCvars( void ); - -// -// ui_credits.c -// -extern void UI_CreditMenu( void ); - -// -// ui_ingame.c -// -extern void InGame_Cache( void ); -extern void UI_InGameMenu(void); - -// -// ui_confirm.c -// -extern void ConfirmMenu_Cache( void ); -extern void UI_ConfirmMenu( const char *question, void (*draw)( void ), void (*action)( qboolean result ) ); - -// -// ui_setup.c -// -extern void UI_SetupMenu_Cache( void ); -extern void UI_SetupMenu(void); - -// -// ui_team.c -// -extern void UI_TeamMainMenu( void ); -extern void TeamMain_Cache( void ); - -// -// ui_connect.c -// -extern void UI_DrawConnectScreen( qboolean overlay ); - -// -// ui_controls2.c -// -extern void UI_ControlsMenu( void ); -extern void Controls_Cache( void ); - -// -// ui_demo2.c -// -extern void UI_DemosMenu( void ); -extern void Demos_Cache( void ); - -// -// ui_cinematics.c -// -extern void UI_CinematicsMenu( void ); -extern void UI_CinematicsMenu_f( void ); -extern void UI_CinematicsMenu_Cache( void ); - -// -// ui_mods.c -// -extern void UI_ModsMenu( void ); -extern void UI_ModsMenu_Cache( void ); - -// -// ui_cdkey.c -// -extern void UI_CDKeyMenu( void ); -extern void UI_CDKeyMenu_Cache( void ); -extern void UI_CDKeyMenu_f( void ); - -// -// ui_playermodel.c -// -extern void UI_PlayerModelMenu( void ); -extern void PlayerModel_Cache( void ); - -// -// ui_playersettings.c -// -extern void UI_PlayerSettingsMenu( void ); -extern void PlayerSettings_Cache( void ); - -// -// ui_preferences.c -// -extern void UI_PreferencesMenu( void ); -extern void Preferences_Cache( void ); - -// -// ui_specifyleague.c -// -extern void UI_SpecifyLeagueMenu( void ); -extern void SpecifyLeague_Cache( void ); - -// -// ui_specifyserver.c -// -extern void UI_SpecifyServerMenu( void ); -extern void SpecifyServer_Cache( void ); - -// -// ui_servers2.c -// -#define MAX_FAVORITESERVERS 16 - -extern void UI_ArenaServersMenu( void ); -extern void ArenaServers_Cache( void ); - -// -// ui_startserver.c -// -extern void UI_StartServerMenu( qboolean multiplayer ); -extern void StartServer_Cache( void ); -extern void ServerOptions_Cache( void ); -extern void UI_BotSelectMenu( char *bot ); -extern void UI_BotSelectMenu_Cache( void ); - -// -// ui_serverinfo.c -// -extern void UI_ServerInfoMenu( void ); -extern void ServerInfo_Cache( void ); - -// -// ui_video.c -// -extern void UI_GraphicsOptionsMenu( void ); -extern void GraphicsOptions_Cache( void ); -extern void DriverInfo_Cache( void ); - -// -// ui_players.c -// - -//FIXME ripped from cg_local.h -typedef struct { - int oldFrame; - int oldFrameTime; // time when ->oldFrame was exactly on - - int frame; - int frameTime; // time when ->frame will be exactly on - - float backlerp; - - float yawAngle; - qboolean yawing; - float pitchAngle; - qboolean pitching; - - int animationNumber; // may include ANIM_TOGGLEBIT - animation_t *animation; - int animationTime; // time when the first frame of the animation will be exact -} lerpFrame_t; - -typedef struct { - // model info - qhandle_t legsModel; - qhandle_t legsSkin; - lerpFrame_t legs; - - qhandle_t torsoModel; - qhandle_t torsoSkin; - lerpFrame_t torso; - - qhandle_t headModel; - qhandle_t headSkin; - - animation_t animations[MAX_TOTALANIMATIONS]; - - qhandle_t weaponModel; - qhandle_t barrelModel; - qhandle_t flashModel; - vec3_t flashDlightColor; - int muzzleFlashTime; - - // currently in use drawing parms - vec3_t viewAngles; - vec3_t moveAngles; - weapon_t currentWeapon; - int legsAnim; - int torsoAnim; - - // animation vars - weapon_t weapon; - weapon_t lastWeapon; - weapon_t pendingWeapon; - int weaponTimer; - int pendingLegsAnim; - int torsoAnimationTimer; - - int pendingTorsoAnim; - int legsAnimationTimer; - - qboolean chat; - qboolean newModel; - - qboolean barrelSpinning; - float barrelAngle; - int barrelTime; - - int realWeapon; -} playerInfo_t; - -void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int time ); -void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model, const char *headmodel, char *teamName ); -void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, qboolean chat ); -qboolean UI_RegisterClientModelname( playerInfo_t *pi, const char *modelSkinName , const char *headName, const char *teamName); - -// -// ui_atoms.c -// -// this is only used in the old ui, the new ui has it's own version -typedef struct { - int frametime; - int realtime; - int cursorx; - int cursory; - glconfig_t glconfig; - qboolean debug; - qhandle_t whiteShader; - qhandle_t menuBackShader; - qhandle_t menuBackShader2; - qhandle_t menuBackNoLogoShader; - qhandle_t charset; - qhandle_t charsetProp; - qhandle_t charsetPropGlow; - qhandle_t charsetPropB; - qhandle_t cursor; - qhandle_t rb_on; - qhandle_t rb_off; - float scale; - float bias; - qboolean demoversion; - qboolean firstdraw; -} uiStatic_t; - - -// new ui stuff -#define UI_NUMFX 7 -#define MAX_HEADS 64 -#define MAX_ALIASES 64 -#define MAX_HEADNAME 32 -#define MAX_TEAMS 64 -#define MAX_GAMETYPES 16 -#define MAX_MAPS 128 -#define MAX_SPMAPS 16 -#define PLAYERS_PER_TEAM 5 -#define MAX_PINGREQUESTS 32 -#define MAX_ADDRESSLENGTH 64 -#define MAX_HOSTNAMELENGTH 22 -#define MAX_MAPNAMELENGTH 16 -#define MAX_STATUSLENGTH 64 -#define MAX_LISTBOXWIDTH 59 -#define UI_FONT_THRESHOLD 0.1 -#define MAX_DISPLAY_SERVERS 2048 -#define MAX_SERVERSTATUS_LINES 128 -#define MAX_SERVERSTATUS_TEXT 1024 -#define MAX_FOUNDPLAYER_SERVERS 16 -#define TEAM_MEMBERS 5 -#define GAMES_ALL 0 -#define GAMES_FFA 1 -#define GAMES_TEAMPLAY 2 -#define GAMES_TOURNEY 3 -#define GAMES_CTF 4 -#define MAPS_PER_TIER 3 -#define MAX_TIERS 16 -#define MAX_MODS 64 -#define MAX_DEMOS 256 -#define MAX_MOVIES 256 -#define MAX_PLAYERMODELS 256 - - -typedef struct { - const char *name; - const char *imageName; - qhandle_t headImage; - const char *base; - qboolean active; - int reference; -} characterInfo; - -typedef struct { - const char *name; - const char *ai; - const char *action; -} aliasInfo; - -typedef struct { - const char *teamName; - const char *imageName; - const char *teamMembers[TEAM_MEMBERS]; - qhandle_t teamIcon; - qhandle_t teamIcon_Metal; - qhandle_t teamIcon_Name; - int cinematic; -} teamInfo; - -typedef struct { - const char *gameType; - int gtEnum; -} gameTypeInfo; - -typedef struct { - const char *mapName; - const char *mapLoadName; - const char *imageName; - const char *opponentName; - int teamMembers; - int typeBits; - int cinematic; - int timeToBeat[MAX_GAMETYPES]; - qhandle_t levelShot; - qboolean active; -} mapInfo; - -typedef struct { - const char *tierName; - const char *maps[MAPS_PER_TIER]; - int gameTypes[MAPS_PER_TIER]; - qhandle_t mapHandles[MAPS_PER_TIER]; -} tierInfo; - -typedef struct serverFilter_s { - const char *description; - const char *basedir; -} serverFilter_t; - -typedef struct { - char adrstr[MAX_ADDRESSLENGTH]; - int start; -} pinglist_t; - - -typedef struct serverStatus_s { - pinglist_t pingList[MAX_PINGREQUESTS]; - int numqueriedservers; - int currentping; - int nextpingtime; - int maxservers; - int refreshtime; - int numServers; - int sortKey; - int sortDir; - int lastCount; - qboolean refreshActive; - int currentServer; - int displayServers[MAX_DISPLAY_SERVERS]; - int numDisplayServers; - int numPlayersOnServers; - int nextDisplayRefresh; - int nextSortTime; - qhandle_t currentServerPreview; - int currentServerCinematic; - int motdLen; - int motdWidth; - int motdPaintX; - int motdPaintX2; - int motdOffset; - int motdTime; - char motd[MAX_STRING_CHARS]; -} serverStatus_t; - - -typedef struct { - char adrstr[MAX_ADDRESSLENGTH]; - char name[MAX_ADDRESSLENGTH]; - int startTime; - int serverNum; - qboolean valid; -} pendingServer_t; - -typedef struct { - int num; - pendingServer_t server[MAX_SERVERSTATUSREQUESTS]; -} pendingServerStatus_t; - -typedef struct { - char address[MAX_ADDRESSLENGTH]; - char *lines[MAX_SERVERSTATUS_LINES][4]; - char text[MAX_SERVERSTATUS_TEXT]; - char pings[MAX_CLIENTS * 3]; - int numLines; -} serverStatusInfo_t; - -typedef struct { - const char *modName; - const char *modDescr; -} modInfo_t; - - -typedef struct { - displayContextDef_t uiDC; - int newHighScoreTime; - int newBestTime; - int showPostGameTime; - qboolean newHighScore; - qboolean demoAvailable; - qboolean soundHighScore; - - int characterCount; - int botIndex; - characterInfo characterList[MAX_HEADS]; - - int aliasCount; - aliasInfo aliasList[MAX_ALIASES]; - - int teamCount; - teamInfo teamList[MAX_TEAMS]; - - int numGameTypes; - gameTypeInfo gameTypes[MAX_GAMETYPES]; - - int numJoinGameTypes; - gameTypeInfo joinGameTypes[MAX_GAMETYPES]; - - int redBlue; - int playerCount; - int myTeamCount; - int teamIndex; - int playerRefresh; - int playerIndex; - int playerNumber; - qboolean teamLeader; - char playerNames[MAX_CLIENTS][MAX_NAME_LENGTH]; - char teamNames[MAX_CLIENTS][MAX_NAME_LENGTH]; - int teamClientNums[MAX_CLIENTS]; - - int mapCount; - mapInfo mapList[MAX_MAPS]; - - - int tierCount; - tierInfo tierList[MAX_TIERS]; - - int skillIndex; - - modInfo_t modList[MAX_MODS]; - int modCount; - int modIndex; - - const char *demoList[MAX_DEMOS]; - int demoCount; - int demoIndex; - - const char *movieList[MAX_MOVIES]; - int movieCount; - int movieIndex; - int previewMovie; - - serverStatus_t serverStatus; - - // for the showing the status of a server - char serverStatusAddress[MAX_ADDRESSLENGTH]; - serverStatusInfo_t serverStatusInfo; - int nextServerStatusRefresh; - - // to retrieve the status of server to find a player - pendingServerStatus_t pendingServerStatus; - char findPlayerName[MAX_STRING_CHARS]; - char foundPlayerServerAddresses[MAX_FOUNDPLAYER_SERVERS][MAX_ADDRESSLENGTH]; - char foundPlayerServerNames[MAX_FOUNDPLAYER_SERVERS][MAX_ADDRESSLENGTH]; - int currentFoundPlayerServer; - int numFoundPlayerServers; - int nextFindPlayerRefresh; - - int currentCrosshair; - int startPostGameTime; - sfxHandle_t newHighScoreSound; - - int q3HeadCount; - char q3HeadNames[MAX_PLAYERMODELS][64]; - qhandle_t q3HeadIcons[MAX_PLAYERMODELS]; - int q3SelectedHead; - - int effectsColor; - - qboolean inGameLoad; - -} uiInfo_t; - -extern uiInfo_t uiInfo; - - -extern void UI_Init( void ); -extern void UI_Shutdown( void ); -extern void UI_KeyEvent( int key ); -extern void UI_MouseEvent( int dx, int dy ); -extern void UI_Refresh( int realtime ); -extern qboolean UI_ConsoleCommand( int realTime ); -extern float UI_ClampCvar( float min, float max, float value ); -extern void UI_DrawNamedPic( float x, float y, float width, float height, const char *picname ); -extern void UI_DrawHandlePic( float x, float y, float w, float h, qhandle_t hShader ); -extern void UI_FillRect( float x, float y, float width, float height, const float *color ); -extern void UI_DrawRect( float x, float y, float width, float height, const float *color ); -extern void UI_DrawTopBottom(float x, float y, float w, float h); -extern void UI_DrawSides(float x, float y, float w, float h); -extern void UI_UpdateScreen( void ); -extern void UI_SetColor( const float *rgba ); -extern void UI_LerpColor(vec4_t a, vec4_t b, vec4_t c, float t); -extern void UI_DrawBannerString( int x, int y, const char* str, int style, vec4_t color ); -extern float UI_ProportionalSizeScale( int style ); -extern void UI_DrawProportionalString( int x, int y, const char* str, int style, vec4_t color ); -extern int UI_ProportionalStringWidth( const char* str ); -extern void UI_DrawString( int x, int y, const char* str, int style, vec4_t color ); -extern void UI_DrawChar( int x, int y, int ch, int style, vec4_t color ); -extern qboolean UI_CursorInRect (int x, int y, int width, int height); -extern void UI_AdjustFrom640( float *x, float *y, float *w, float *h ); -extern void UI_DrawTextBox (int x, int y, int width, int lines); -extern qboolean UI_IsFullscreen( void ); -extern void UI_SetActiveMenu( uiMenuCommand_t menu ); -extern void UI_PushMenu ( menuframework_s *menu ); -extern void UI_PopMenu (void); -extern void UI_ForceMenuOff (void); -extern char *UI_Argv( int arg ); -extern char *UI_Cvar_VariableString( const char *var_name ); -extern void UI_Refresh( int time ); -extern void UI_KeyEvent( int key ); -extern void UI_StartDemoLoop( void ); -extern qboolean m_entersound; -void UI_LoadBestScores(const char *map, int game); -extern uiStatic_t uis; - -// -// ui_spLevel.c -// -void UI_SPLevelMenu_Cache( void ); -void UI_SPLevelMenu( void ); -void UI_SPLevelMenu_f( void ); -void UI_SPLevelMenu_ReInit( void ); - -// -// ui_spArena.c -// -void UI_SPArena_Start( const char *arenaInfo ); - -// -// ui_spPostgame.c -// -void UI_SPPostgameMenu_Cache( void ); -void UI_SPPostgameMenu_f( void ); - -// -// ui_spSkill.c -// -void UI_SPSkillMenu( const char *arenaInfo ); -void UI_SPSkillMenu_Cache( void ); - -// -// ui_syscalls.c -// -void trap_Print( const char *string ); -void trap_Error( const char *string ); -int trap_Milliseconds( void ); -void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags ); -void trap_Cvar_Update( vmCvar_t *vmCvar ); -void trap_Cvar_Set( const char *var_name, const char *value ); -float trap_Cvar_VariableValue( const char *var_name ); -void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ); -void trap_Cvar_SetValue( const char *var_name, float value ); -void trap_Cvar_Reset( const char *name ); -void trap_Cvar_Create( const char *var_name, const char *var_value, int flags ); -void trap_Cvar_InfoStringBuffer( int bit, char *buffer, int bufsize ); -int trap_Argc( void ); -void trap_Argv( int n, char *buffer, int bufferLength ); -void trap_Cmd_ExecuteText( int exec_when, const char *text ); // don't use EXEC_NOW! -int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode ); -void trap_FS_Read( void *buffer, int len, fileHandle_t f ); -void trap_FS_Write( const void *buffer, int len, fileHandle_t f ); -void trap_FS_FCloseFile( fileHandle_t f ); -int trap_FS_GetFileList( const char *path, const char *extension, char *listbuf, int bufsize ); -int trap_FS_Seek( fileHandle_t f, long offset, int origin ); // fsOrigin_t -qhandle_t trap_R_RegisterModel( const char *name ); -qhandle_t trap_R_RegisterSkin( const char *name ); -qhandle_t trap_R_RegisterShaderNoMip( const char *name ); -void trap_R_ClearScene( void ); -void trap_R_AddRefEntityToScene( const refEntity_t *re ); -void trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts ); -void trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b ); -void trap_R_RenderScene( const refdef_t *fd ); -void trap_R_SetColor( const float *rgba ); -void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ); -void trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs ); -void trap_UpdateScreen( void ); -int trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName ); -void trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum ); -sfxHandle_t trap_S_RegisterSound( const char *sample, qboolean compressed ); -void trap_Key_KeynumToStringBuf( int keynum, char *buf, int buflen ); -void trap_Key_GetBindingBuf( int keynum, char *buf, int buflen ); -void trap_Key_SetBinding( int keynum, const char *binding ); -qboolean trap_Key_IsDown( int keynum ); -qboolean trap_Key_GetOverstrikeMode( void ); -void trap_Key_SetOverstrikeMode( qboolean state ); -void trap_Key_ClearStates( void ); -int trap_Key_GetCatcher( void ); -void trap_Key_SetCatcher( int catcher ); -void trap_GetClipboardData( char *buf, int bufsize ); -void trap_GetClientState( uiClientState_t *state ); -void trap_GetGlconfig( glconfig_t *glconfig ); -int trap_GetConfigString( int index, char* buff, int buffsize ); -int trap_LAN_GetServerCount( int source ); -void trap_LAN_GetServerAddressString( int source, int n, char *buf, int buflen ); -void trap_LAN_GetServerInfo( int source, int n, char *buf, int buflen ); -int trap_LAN_GetServerPing( int source, int n ); -int trap_LAN_GetPingQueueCount( void ); -void trap_LAN_ClearPing( int n ); -void trap_LAN_GetPing( int n, char *buf, int buflen, int *pingtime ); -void trap_LAN_GetPingInfo( int n, char *buf, int buflen ); -void trap_LAN_LoadCachedServers(); -void trap_LAN_SaveCachedServers(); -void trap_LAN_MarkServerVisible(int source, int n, qboolean visible); -int trap_LAN_ServerIsVisible( int source, int n); -qboolean trap_LAN_UpdateVisiblePings( int source ); -int trap_LAN_AddServer(int source, const char *name, const char *addr); -void trap_LAN_RemoveServer(int source, const char *addr); -void trap_LAN_ResetPings(int n); -int trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int maxLen ); -int trap_LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int s2 ); -int trap_MemoryRemaining( void ); -void trap_GetCDKey( char *buf, int buflen ); -void trap_SetCDKey( char *buf ); -void trap_R_RegisterFont(const char *pFontname, int pointSize, fontInfo_t *font); -void trap_S_StopBackgroundTrack( void ); -void trap_S_StartBackgroundTrack( const char *intro, const char *loop); -int trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits); -e_status trap_CIN_StopCinematic(int handle); -e_status trap_CIN_RunCinematic (int handle); -void trap_CIN_DrawCinematic (int handle); -void trap_CIN_SetExtents (int handle, int x, int y, int w, int h); -int trap_RealTime(qtime_t *qtime); -void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ); -qboolean trap_VerifyCDKey( const char *key, const char *chksum); - -void trap_SetPbClStatus( int status ); - -// -// ui_addbots.c -// -void UI_AddBots_Cache( void ); -void UI_AddBotsMenu( void ); - -// -// ui_removebots.c -// -void UI_RemoveBots_Cache( void ); -void UI_RemoveBotsMenu( void ); - -// -// ui_teamorders.c -// -extern void UI_TeamOrdersMenu( void ); -extern void UI_TeamOrdersMenu_f( void ); -extern void UI_TeamOrdersMenu_Cache( void ); - -// -// ui_loadconfig.c -// -void UI_LoadConfig_Cache( void ); -void UI_LoadConfigMenu( void ); - -// -// ui_saveconfig.c -// -void UI_SaveConfigMenu_Cache( void ); -void UI_SaveConfigMenu( void ); - -// -// ui_display.c -// -void UI_DisplayOptionsMenu_Cache( void ); -void UI_DisplayOptionsMenu( void ); - -// -// ui_sound.c -// -void UI_SoundOptionsMenu_Cache( void ); -void UI_SoundOptionsMenu( void ); - -// -// ui_network.c -// -void UI_NetworkOptionsMenu_Cache( void ); -void UI_NetworkOptionsMenu( void ); - -// -// ui_gameinfo.c -// -typedef enum { - AWARD_ACCURACY, - AWARD_IMPRESSIVE, - AWARD_EXCELLENT, - AWARD_GAUNTLET, - AWARD_FRAGS, - AWARD_PERFECT -} awardType_t; - -const char *UI_GetArenaInfoByNumber( int num ); -const char *UI_GetArenaInfoByMap( const char *map ); -const char *UI_GetSpecialArenaInfo( const char *tag ); -int UI_GetNumArenas( void ); -int UI_GetNumSPArenas( void ); -int UI_GetNumSPTiers( void ); - -char *UI_GetBotInfoByNumber( int num ); -char *UI_GetBotInfoByName( const char *name ); -int UI_GetNumBots( void ); -void UI_LoadBots( void ); -char *UI_GetBotNameByNumber( int num ); - -void UI_GetBestScore( int level, int *score, int *skill ); -void UI_SetBestScore( int level, int score ); -int UI_TierCompleted( int levelWon ); -qboolean UI_ShowTierVideo( int tier ); -qboolean UI_CanShowTierVideo( int tier ); -int UI_GetCurrentGame( void ); -void UI_NewGame( void ); -void UI_LogAwardData( int award, int data ); -int UI_GetAwardLevel( int award ); - -void UI_SPUnlock_f( void ); -void UI_SPUnlockMedals_f( void ); - -void UI_InitGameinfo( void ); - -// -// ui_login.c -// -void Login_Cache( void ); -void UI_LoginMenu( void ); - -// -// ui_signup.c -// -void Signup_Cache( void ); -void UI_SignupMenu( void ); - -// -// ui_rankstatus.c -// -void RankStatus_Cache( void ); -void UI_RankStatusMenu( void ); - - -// new ui - -#define ASSET_BACKGROUND "uiBackground" - -// for tracking sp game info in Team Arena -typedef struct postGameInfo_s { - int score; - int redScore; - int blueScore; - int perfects; - int accuracy; - int impressives; - int excellents; - int defends; - int assists; - int gauntlets; - int captures; - int time; - int timeBonus; - int shutoutBonus; - int skillBonus; - int baseScore; -} postGameInfo_t; - - - -#endif diff --git a/code/ui/ui_main.c b/code/ui/ui_main.c deleted file mode 100644 index a117962..0000000 --- a/code/ui/ui_main.c +++ /dev/null @@ -1,5997 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// -/* -======================================================================= - -USER INTERFACE MAIN - -======================================================================= -*/ - -// use this to get a demo build without an explicit demo build, i.e. to get the demo ui files to build -//#define PRE_RELEASE_TADEMO - -#include "ui_local.h" - -uiInfo_t uiInfo; - -static const char *MonthAbbrev[] = { - "Jan","Feb","Mar", - "Apr","May","Jun", - "Jul","Aug","Sep", - "Oct","Nov","Dec" -}; - - -static const char *skillLevels[] = { - "I Can Win", - "Bring It On", - "Hurt Me Plenty", - "Hardcore", - "Nightmare" -}; - -static const int numSkillLevels = sizeof(skillLevels) / sizeof(const char*); - - -static const char *netSources[] = { - "Local", - "Mplayer", - "Internet", - "Favorites" -}; -static const int numNetSources = sizeof(netSources) / sizeof(const char*); - -static const serverFilter_t serverFilters[] = { - {"All", "" }, - {"Quake 3 Arena", "" }, - {"Team Arena", "missionpack" }, - {"Rocket Arena", "arena" }, - {"Alliance", "alliance20" }, - {"Weapons Factory Arena", "wfa" }, - {"OSP", "osp" }, -}; - -static const char *teamArenaGameTypes[] = { - "FFA", - "TOURNAMENT", - "SP", - "TEAM DM", - "CTF", - "1FCTF", - "OVERLOAD", - "HARVESTER", - "TEAMTOURNAMENT" -}; - -static int const numTeamArenaGameTypes = sizeof(teamArenaGameTypes) / sizeof(const char*); - - -static const char *teamArenaGameNames[] = { - "Free For All", - "Tournament", - "Single Player", - "Team Deathmatch", - "Capture the Flag", - "One Flag CTF", - "Overload", - "Harvester", - "Team Tournament", -}; - -static int const numTeamArenaGameNames = sizeof(teamArenaGameNames) / sizeof(const char*); - - -static const int numServerFilters = sizeof(serverFilters) / sizeof(serverFilter_t); - -static const char *sortKeys[] = { - "Server Name", - "Map Name", - "Open Player Spots", - "Game Type", - "Ping Time" -}; -static const int numSortKeys = sizeof(sortKeys) / sizeof(const char*); - -static char* netnames[] = { - "???", - "UDP", - "IPX", - NULL -}; - -#ifndef MISSIONPACK // bk001206 -static char quake3worldMessage[] = "Visit www.quake3world.com - News, Community, Events, Files"; -#endif - -static int gamecodetoui[] = {4,2,3,0,5,1,6}; -static int uitogamecode[] = {4,6,2,3,1,5,7}; - - -static void UI_StartServerRefresh(qboolean full); -static void UI_StopServerRefresh( void ); -static void UI_DoServerRefresh( void ); -static void UI_FeederSelection(float feederID, int index); -static void UI_BuildServerDisplayList(qboolean force); -static void UI_BuildServerStatus(qboolean force); -static void UI_BuildFindPlayerList(qboolean force); -static int QDECL UI_ServersQsortCompare( const void *arg1, const void *arg2 ); -static int UI_MapCountByGameType(qboolean singlePlayer); -static int UI_HeadCountByTeam( void ); -static void UI_ParseGameInfo(const char *teamFile); -static void UI_ParseTeamInfo(const char *teamFile); -static const char *UI_SelectedMap(int index, int *actual); -static const char *UI_SelectedHead(int index, int *actual); -static int UI_GetIndexFromSelection(int actual); - -int ProcessNewUI( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6 ); - -/* -================ -vmMain - -This is the only way control passes into the module. -This must be the very first function compiled into the .qvm file -================ -*/ -vmCvar_t ui_new; -vmCvar_t ui_debug; -vmCvar_t ui_initialized; -vmCvar_t ui_teamArenaFirstRun; - -void _UI_Init( qboolean ); -void _UI_Shutdown( void ); -void _UI_KeyEvent( int key, qboolean down ); -void _UI_MouseEvent( int dx, int dy ); -void _UI_Refresh( int realtime ); -qboolean _UI_IsFullscreen( void ); -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 UI_GETAPIVERSION: - return UI_API_VERSION; - - case UI_INIT: - _UI_Init(arg0); - return 0; - - case UI_SHUTDOWN: - _UI_Shutdown(); - return 0; - - case UI_KEY_EVENT: - _UI_KeyEvent( arg0, arg1 ); - return 0; - - case UI_MOUSE_EVENT: - _UI_MouseEvent( arg0, arg1 ); - return 0; - - case UI_REFRESH: - _UI_Refresh( arg0 ); - return 0; - - case UI_IS_FULLSCREEN: - return _UI_IsFullscreen(); - - case UI_SET_ACTIVE_MENU: - _UI_SetActiveMenu( arg0 ); - return 0; - - case UI_CONSOLE_COMMAND: - return UI_ConsoleCommand(arg0); - - case UI_DRAW_CONNECT_SCREEN: - UI_DrawConnectScreen( arg0 ); - return 0; - case UI_HASUNIQUECDKEY: // mod authors need to observe this - return qtrue; // bk010117 - change this to qfalse for mods! - - } - - return -1; -} - - - -void AssetCache() { - int n; - //if (Assets.textFont == NULL) { - //} - //Assets.background = trap_R_RegisterShaderNoMip( ASSET_BACKGROUND ); - //Com_Printf("Menu Size: %i bytes\n", sizeof(Menus)); - uiInfo.uiDC.Assets.gradientBar = trap_R_RegisterShaderNoMip( ASSET_GRADIENTBAR ); - uiInfo.uiDC.Assets.fxBasePic = trap_R_RegisterShaderNoMip( ART_FX_BASE ); - uiInfo.uiDC.Assets.fxPic[0] = trap_R_RegisterShaderNoMip( ART_FX_RED ); - uiInfo.uiDC.Assets.fxPic[1] = trap_R_RegisterShaderNoMip( ART_FX_YELLOW ); - uiInfo.uiDC.Assets.fxPic[2] = trap_R_RegisterShaderNoMip( ART_FX_GREEN ); - uiInfo.uiDC.Assets.fxPic[3] = trap_R_RegisterShaderNoMip( ART_FX_TEAL ); - uiInfo.uiDC.Assets.fxPic[4] = trap_R_RegisterShaderNoMip( ART_FX_BLUE ); - uiInfo.uiDC.Assets.fxPic[5] = trap_R_RegisterShaderNoMip( ART_FX_CYAN ); - uiInfo.uiDC.Assets.fxPic[6] = trap_R_RegisterShaderNoMip( ART_FX_WHITE ); - uiInfo.uiDC.Assets.scrollBar = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR ); - uiInfo.uiDC.Assets.scrollBarArrowDown = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWDOWN ); - uiInfo.uiDC.Assets.scrollBarArrowUp = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWUP ); - uiInfo.uiDC.Assets.scrollBarArrowLeft = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWLEFT ); - uiInfo.uiDC.Assets.scrollBarArrowRight = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWRIGHT ); - uiInfo.uiDC.Assets.scrollBarThumb = trap_R_RegisterShaderNoMip( ASSET_SCROLL_THUMB ); - uiInfo.uiDC.Assets.sliderBar = trap_R_RegisterShaderNoMip( ASSET_SLIDER_BAR ); - uiInfo.uiDC.Assets.sliderThumb = trap_R_RegisterShaderNoMip( ASSET_SLIDER_THUMB ); - - for( n = 0; n < NUM_CROSSHAIRS; n++ ) { - uiInfo.uiDC.Assets.crosshairShader[n] = trap_R_RegisterShaderNoMip( va("gfx/2d/crosshair%c", 'a' + n ) ); - } - - uiInfo.newHighScoreSound = trap_S_RegisterSound("sound/feedback/voc_newhighscore.wav", qfalse); -} - -void _UI_DrawSides(float x, float y, float w, float h, float size) { - UI_AdjustFrom640( &x, &y, &w, &h ); - size *= uiInfo.uiDC.xscale; - trap_R_DrawStretchPic( x, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); - trap_R_DrawStretchPic( x + w - size, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); -} - -void _UI_DrawTopBottom(float x, float y, float w, float h, float size) { - UI_AdjustFrom640( &x, &y, &w, &h ); - size *= uiInfo.uiDC.yscale; - trap_R_DrawStretchPic( x, y, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); - trap_R_DrawStretchPic( x, y + h - size, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); -} -/* -================ -UI_DrawRect - -Coordinates are 640*480 virtual values -================= -*/ -void _UI_DrawRect( float x, float y, float width, float height, float size, const float *color ) { - trap_R_SetColor( color ); - - _UI_DrawTopBottom(x, y, width, height, size); - _UI_DrawSides(x, y, width, height, size); - - trap_R_SetColor( NULL ); -} - -int Text_Width(const char *text, float scale, int limit) { - int count,len; - float out; - glyphInfo_t *glyph; - float useScale; - const char *s = text; - fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; - if (scale <= ui_smallFont.value) { - font = &uiInfo.uiDC.Assets.smallFont; - } else if (scale >= ui_bigFont.value) { - font = &uiInfo.uiDC.Assets.bigFont; - } - useScale = scale * font->glyphScale; - out = 0; - if (text) { - len = strlen(text); - if (limit > 0 && len > limit) { - len = limit; - } - count = 0; - while (s && *s && count < len) { - if ( Q_IsColorString(s) ) { - s += 2; - continue; - } else { - glyph = &font->glyphs[(int)*s]; - out += glyph->xSkip; - s++; - count++; - } - } - } - return out * useScale; -} - -int Text_Height(const char *text, float scale, int limit) { - int len, count; - float max; - glyphInfo_t *glyph; - float useScale; - const char *s = text; // bk001206 - unsigned - fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; - if (scale <= ui_smallFont.value) { - font = &uiInfo.uiDC.Assets.smallFont; - } else if (scale >= ui_bigFont.value) { - font = &uiInfo.uiDC.Assets.bigFont; - } - useScale = scale * font->glyphScale; - max = 0; - if (text) { - len = strlen(text); - if (limit > 0 && len > limit) { - len = limit; - } - count = 0; - while (s && *s && count < len) { - if ( Q_IsColorString(s) ) { - s += 2; - continue; - } else { - glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build - if (max < glyph->height) { - max = glyph->height; - } - s++; - count++; - } - } - } - return max * useScale; -} - -void Text_PaintChar(float x, float y, float width, float height, float scale, float s, float t, float s2, float t2, qhandle_t hShader) { - float w, h; - w = width * scale; - h = height * scale; - UI_AdjustFrom640( &x, &y, &w, &h ); - trap_R_DrawStretchPic( x, y, w, h, s, t, s2, t2, hShader ); -} - -void Text_Paint(float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style) { - int len, count; - vec4_t newColor; - glyphInfo_t *glyph; - float useScale; - fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; - if (scale <= ui_smallFont.value) { - font = &uiInfo.uiDC.Assets.smallFont; - } else if (scale >= ui_bigFont.value) { - font = &uiInfo.uiDC.Assets.bigFont; - } - useScale = scale * font->glyphScale; - if (text) { - const char *s = text; // bk001206 - unsigned - trap_R_SetColor( color ); - memcpy(&newColor[0], &color[0], sizeof(vec4_t)); - len = strlen(text); - if (limit > 0 && len > limit) { - len = limit; - } - count = 0; - while (s && *s && count < len) { - glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build - //int yadj = Assets.textFont.glyphs[text[i]].bottom + Assets.textFont.glyphs[text[i]].top; - //float yadj = scale * (Assets.textFont.glyphs[text[i]].imageHeight - Assets.textFont.glyphs[text[i]].height); - if ( Q_IsColorString( s ) ) { - memcpy( newColor, g_color_table[ColorIndex(*(s+1))], sizeof( newColor ) ); - newColor[3] = color[3]; - trap_R_SetColor( newColor ); - s += 2; - continue; - } else { - float yadj = useScale * glyph->top; - if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) { - int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2; - colorBlack[3] = newColor[3]; - trap_R_SetColor( colorBlack ); - Text_PaintChar(x + ofs, y - yadj + ofs, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph); - trap_R_SetColor( newColor ); - colorBlack[3] = 1.0; - } - Text_PaintChar(x, y - yadj, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph); - - x += (glyph->xSkip * useScale) + adjust; - s++; - count++; - } - } - trap_R_SetColor( NULL ); - } -} - -void Text_PaintWithCursor(float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor, int limit, int style) { - int len, count; - vec4_t newColor; - glyphInfo_t *glyph, *glyph2; - float yadj; - float useScale; - fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; - if (scale <= ui_smallFont.value) { - font = &uiInfo.uiDC.Assets.smallFont; - } else if (scale >= ui_bigFont.value) { - font = &uiInfo.uiDC.Assets.bigFont; - } - useScale = scale * font->glyphScale; - if (text) { - const char *s = text; // bk001206 - unsigned - trap_R_SetColor( color ); - memcpy(&newColor[0], &color[0], sizeof(vec4_t)); - len = strlen(text); - if (limit > 0 && len > limit) { - len = limit; - } - count = 0; - glyph2 = &font->glyphs[ (int) cursor]; // bk001206 - possible signed char - while (s && *s && count < len) { - glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build - //int yadj = Assets.textFont.glyphs[text[i]].bottom + Assets.textFont.glyphs[text[i]].top; - //float yadj = scale * (Assets.textFont.glyphs[text[i]].imageHeight - Assets.textFont.glyphs[text[i]].height); - if ( Q_IsColorString( s ) ) { - memcpy( newColor, g_color_table[ColorIndex(*(s+1))], sizeof( newColor ) ); - newColor[3] = color[3]; - trap_R_SetColor( newColor ); - s += 2; - continue; - } else { - yadj = useScale * glyph->top; - if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) { - int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2; - colorBlack[3] = newColor[3]; - trap_R_SetColor( colorBlack ); - Text_PaintChar(x + ofs, y - yadj + ofs, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph); - colorBlack[3] = 1.0; - trap_R_SetColor( newColor ); - } - Text_PaintChar(x, y - yadj, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph); - - yadj = useScale * glyph2->top; - if (count == cursorPos && !((uiInfo.uiDC.realTime/BLINK_DIVISOR) & 1)) { - Text_PaintChar(x, y - yadj, - glyph2->imageWidth, - glyph2->imageHeight, - useScale, - glyph2->s, - glyph2->t, - glyph2->s2, - glyph2->t2, - glyph2->glyph); - } - - x += (glyph->xSkip * useScale); - s++; - count++; - } - } - // need to paint cursor at end of text - if (cursorPos == len && !((uiInfo.uiDC.realTime/BLINK_DIVISOR) & 1)) { - yadj = useScale * glyph2->top; - Text_PaintChar(x, y - yadj, - glyph2->imageWidth, - glyph2->imageHeight, - useScale, - glyph2->s, - glyph2->t, - glyph2->s2, - glyph2->t2, - glyph2->glyph); - - } - - trap_R_SetColor( NULL ); - } -} - - -static void Text_Paint_Limit(float *maxX, float x, float y, float scale, vec4_t color, const char* text, float adjust, int limit) { - int len, count; - vec4_t newColor; - glyphInfo_t *glyph; - if (text) { - const char *s = text; // bk001206 - unsigned - float max = *maxX; - float useScale; - fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; - if (scale <= ui_smallFont.value) { - font = &uiInfo.uiDC.Assets.smallFont; - } else if (scale > ui_bigFont.value) { - font = &uiInfo.uiDC.Assets.bigFont; - } - useScale = scale * font->glyphScale; - trap_R_SetColor( color ); - len = strlen(text); - if (limit > 0 && len > limit) { - len = limit; - } - count = 0; - while (s && *s && count < len) { - glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build - if ( Q_IsColorString( s ) ) { - memcpy( newColor, g_color_table[ColorIndex(*(s+1))], sizeof( newColor ) ); - newColor[3] = color[3]; - trap_R_SetColor( newColor ); - s += 2; - continue; - } else { - float yadj = useScale * glyph->top; - if (Text_Width(s, useScale, 1) + x > max) { - *maxX = 0; - break; - } - Text_PaintChar(x, y - yadj, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph); - x += (glyph->xSkip * useScale) + adjust; - *maxX = x; - count++; - s++; - } - } - trap_R_SetColor( NULL ); - } - -} - - -void UI_ShowPostGame(qboolean newHigh) { - trap_Cvar_Set ("cg_cameraOrbit", "0"); - trap_Cvar_Set("cg_thirdPerson", "0"); - trap_Cvar_Set( "sv_killserver", "1" ); - uiInfo.soundHighScore = newHigh; - _UI_SetActiveMenu(UIMENU_POSTGAME); -} -/* -================= -_UI_Refresh -================= -*/ - -void UI_DrawCenteredPic(qhandle_t image, int w, int h) { - int x, y; - x = (SCREEN_WIDTH - w) / 2; - y = (SCREEN_HEIGHT - h) / 2; - UI_DrawHandlePic(x, y, w, h, image); -} - -int frameCount = 0; -int startTime; - -#define UI_FPS_FRAMES 4 -void _UI_Refresh( int realtime ) -{ - static int index; - static int previousTimes[UI_FPS_FRAMES]; - - //if ( !( trap_Key_GetCatcher() & KEYCATCH_UI ) ) { - // return; - //} - - uiInfo.uiDC.frameTime = realtime - uiInfo.uiDC.realTime; - uiInfo.uiDC.realTime = realtime; - - previousTimes[index % UI_FPS_FRAMES] = uiInfo.uiDC.frameTime; - index++; - if ( index > UI_FPS_FRAMES ) { - int i, total; - // average multiple frames together to smooth changes out a bit - total = 0; - for ( i = 0 ; i < UI_FPS_FRAMES ; i++ ) { - total += previousTimes[i]; - } - if ( !total ) { - total = 1; - } - uiInfo.uiDC.FPS = 1000 * UI_FPS_FRAMES / total; - } - - - - UI_UpdateCvars(); - - if (Menu_Count() > 0) { - // paint all the menus - Menu_PaintAll(); - // refresh server browser list - UI_DoServerRefresh(); - // refresh server status - UI_BuildServerStatus(qfalse); - // refresh find player list - UI_BuildFindPlayerList(qfalse); - } - - // draw cursor - UI_SetColor( NULL ); - if (Menu_Count() > 0) { - UI_DrawHandlePic( uiInfo.uiDC.cursorx-16, uiInfo.uiDC.cursory-16, 32, 32, uiInfo.uiDC.Assets.cursor); - } - -#ifndef NDEBUG - if (uiInfo.uiDC.debug) - { - // cursor coordinates - //FIXME - //UI_DrawString( 0, 0, va("(%d,%d)",uis.cursorx,uis.cursory), UI_LEFT|UI_SMALLFONT, colorRed ); - } -#endif - -} - -/* -================= -_UI_Shutdown -================= -*/ -void _UI_Shutdown( void ) { - trap_LAN_SaveCachedServers(); -} - -char *defaultMenu = NULL; - -char *GetMenuBuffer(const char *filename) { - int len; - fileHandle_t f; - static char buf[MAX_MENUFILE]; - - len = trap_FS_FOpenFile( filename, &f, FS_READ ); - if ( !f ) { - trap_Print( va( S_COLOR_RED "menu file not found: %s, using default\n", filename ) ); - return defaultMenu; - } - if ( len >= MAX_MENUFILE ) { - trap_Print( va( S_COLOR_RED "menu file too large: %s is %i, max allowed is %i", filename, len, MAX_MENUFILE ) ); - trap_FS_FCloseFile( f ); - return defaultMenu; - } - - trap_FS_Read( buf, len, f ); - buf[len] = 0; - trap_FS_FCloseFile( f ); - //COM_Compress(buf); - return buf; - -} - -qboolean Asset_Parse(int handle) { - pc_token_t token; - const char *tempStr; - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - if (Q_stricmp(token.string, "{") != 0) { - return qfalse; - } - - while ( 1 ) { - - memset(&token, 0, sizeof(pc_token_t)); - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - - if (Q_stricmp(token.string, "}") == 0) { - return qtrue; - } - - // font - if (Q_stricmp(token.string, "font") == 0) { - int pointSize; - if (!PC_String_Parse(handle, &tempStr) || !PC_Int_Parse(handle,&pointSize)) { - return qfalse; - } - trap_R_RegisterFont(tempStr, pointSize, &uiInfo.uiDC.Assets.textFont); - uiInfo.uiDC.Assets.fontRegistered = qtrue; - continue; - } - - if (Q_stricmp(token.string, "smallFont") == 0) { - int pointSize; - if (!PC_String_Parse(handle, &tempStr) || !PC_Int_Parse(handle,&pointSize)) { - return qfalse; - } - trap_R_RegisterFont(tempStr, pointSize, &uiInfo.uiDC.Assets.smallFont); - continue; - } - - if (Q_stricmp(token.string, "bigFont") == 0) { - int pointSize; - if (!PC_String_Parse(handle, &tempStr) || !PC_Int_Parse(handle,&pointSize)) { - return qfalse; - } - trap_R_RegisterFont(tempStr, pointSize, &uiInfo.uiDC.Assets.bigFont); - continue; - } - - - // gradientbar - if (Q_stricmp(token.string, "gradientbar") == 0) { - if (!PC_String_Parse(handle, &tempStr)) { - return qfalse; - } - uiInfo.uiDC.Assets.gradientBar = trap_R_RegisterShaderNoMip(tempStr); - continue; - } - - // enterMenuSound - if (Q_stricmp(token.string, "menuEnterSound") == 0) { - if (!PC_String_Parse(handle, &tempStr)) { - return qfalse; - } - uiInfo.uiDC.Assets.menuEnterSound = trap_S_RegisterSound( tempStr, qfalse ); - continue; - } - - // exitMenuSound - if (Q_stricmp(token.string, "menuExitSound") == 0) { - if (!PC_String_Parse(handle, &tempStr)) { - return qfalse; - } - uiInfo.uiDC.Assets.menuExitSound = trap_S_RegisterSound( tempStr, qfalse ); - continue; - } - - // itemFocusSound - if (Q_stricmp(token.string, "itemFocusSound") == 0) { - if (!PC_String_Parse(handle, &tempStr)) { - return qfalse; - } - uiInfo.uiDC.Assets.itemFocusSound = trap_S_RegisterSound( tempStr, qfalse ); - continue; - } - - // menuBuzzSound - if (Q_stricmp(token.string, "menuBuzzSound") == 0) { - if (!PC_String_Parse(handle, &tempStr)) { - return qfalse; - } - uiInfo.uiDC.Assets.menuBuzzSound = trap_S_RegisterSound( tempStr, qfalse ); - continue; - } - - if (Q_stricmp(token.string, "cursor") == 0) { - if (!PC_String_Parse(handle, &uiInfo.uiDC.Assets.cursorStr)) { - return qfalse; - } - uiInfo.uiDC.Assets.cursor = trap_R_RegisterShaderNoMip( uiInfo.uiDC.Assets.cursorStr); - continue; - } - - if (Q_stricmp(token.string, "fadeClamp") == 0) { - if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.fadeClamp)) { - return qfalse; - } - continue; - } - - if (Q_stricmp(token.string, "fadeCycle") == 0) { - if (!PC_Int_Parse(handle, &uiInfo.uiDC.Assets.fadeCycle)) { - return qfalse; - } - continue; - } - - if (Q_stricmp(token.string, "fadeAmount") == 0) { - if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.fadeAmount)) { - return qfalse; - } - continue; - } - - if (Q_stricmp(token.string, "shadowX") == 0) { - if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.shadowX)) { - return qfalse; - } - continue; - } - - if (Q_stricmp(token.string, "shadowY") == 0) { - if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.shadowY)) { - return qfalse; - } - continue; - } - - if (Q_stricmp(token.string, "shadowColor") == 0) { - if (!PC_Color_Parse(handle, &uiInfo.uiDC.Assets.shadowColor)) { - return qfalse; - } - uiInfo.uiDC.Assets.shadowFadeClamp = uiInfo.uiDC.Assets.shadowColor[3]; - continue; - } - - } - return qfalse; -} - -void Font_Report() { - int i; - Com_Printf("Font Info\n"); - Com_Printf("=========\n"); - for ( i = 32; i < 96; i++) { - Com_Printf("Glyph handle %i: %i\n", i, uiInfo.uiDC.Assets.textFont.glyphs[i].glyph); - } -} - -void UI_Report() { - String_Report(); - //Font_Report(); - -} - -void UI_ParseMenu(const char *menuFile) { - int handle; - pc_token_t token; - - Com_Printf("Parsing menu file:%s\n", menuFile); - - handle = trap_PC_LoadSource(menuFile); - if (!handle) { - return; - } - - while ( 1 ) { - memset(&token, 0, sizeof(pc_token_t)); - if (!trap_PC_ReadToken( handle, &token )) { - break; - } - - //if ( Q_stricmp( token, "{" ) ) { - // Com_Printf( "Missing { in menu file\n" ); - // break; - //} - - //if ( menuCount == MAX_MENUS ) { - // Com_Printf( "Too many menus!\n" ); - // break; - //} - - if ( token.string[0] == '}' ) { - break; - } - - if (Q_stricmp(token.string, "assetGlobalDef") == 0) { - if (Asset_Parse(handle)) { - continue; - } else { - break; - } - } - - if (Q_stricmp(token.string, "menudef") == 0) { - // start a new menu - Menu_New(handle); - } - } - trap_PC_FreeSource(handle); -} - -qboolean Load_Menu(int handle) { - pc_token_t token; - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - if (token.string[0] != '{') { - return qfalse; - } - - while ( 1 ) { - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - - if ( token.string[0] == 0 ) { - return qfalse; - } - - if ( token.string[0] == '}' ) { - return qtrue; - } - - UI_ParseMenu(token.string); - } - return qfalse; -} - -void UI_LoadMenus(const char *menuFile, qboolean reset) { - pc_token_t token; - int handle; - int start; - - start = trap_Milliseconds(); - - handle = trap_PC_LoadSource( menuFile ); - if (!handle) { - trap_Error( va( S_COLOR_YELLOW "menu file not found: %s, using default\n", menuFile ) ); - handle = trap_PC_LoadSource( "ui/menus.txt" ); - if (!handle) { - trap_Error( va( S_COLOR_RED "default menu file not found: ui/menus.txt, unable to continue!\n", menuFile ) ); - } - } - - ui_new.integer = 1; - - if (reset) { - Menu_Reset(); - } - - while ( 1 ) { - if (!trap_PC_ReadToken(handle, &token)) - break; - if( token.string[0] == 0 || token.string[0] == '}') { - break; - } - - if ( token.string[0] == '}' ) { - break; - } - - if (Q_stricmp(token.string, "loadmenu") == 0) { - if (Load_Menu(handle)) { - continue; - } else { - break; - } - } - } - - Com_Printf("UI menu load time = %d milli seconds\n", trap_Milliseconds() - start); - - trap_PC_FreeSource( handle ); -} - -void UI_Load() { - char lastName[1024]; - menuDef_t *menu = Menu_GetFocused(); - char *menuSet = UI_Cvar_VariableString("ui_menuFiles"); - if (menu && menu->window.name) { - strcpy(lastName, menu->window.name); - } - if (menuSet == NULL || menuSet[0] == '\0') { - menuSet = "ui/menus.txt"; - } - - String_Init(); - -#ifdef PRE_RELEASE_TADEMO - UI_ParseGameInfo("demogameinfo.txt"); -#else - UI_ParseGameInfo("gameinfo.txt"); - UI_LoadArenas(); -#endif - - UI_LoadMenus(menuSet, qtrue); - Menus_CloseAll(); - Menus_ActivateByName(lastName); - -} - -static const char *handicapValues[] = {"None","95","90","85","80","75","70","65","60","55","50","45","40","35","30","25","20","15","10","5",NULL}; -#ifndef MISSIONPACK // bk001206 -static int numHandicaps = sizeof(handicapValues) / sizeof(const char*); -#endif - -static void UI_DrawHandicap(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - int i, h; - - h = Com_Clamp( 5, 100, trap_Cvar_VariableValue("handicap") ); - i = 20 - h / 5; - - Text_Paint(rect->x, rect->y, scale, color, handicapValues[i], 0, 0, textStyle); -} - -static void UI_DrawClanName(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - Text_Paint(rect->x, rect->y, scale, color, UI_Cvar_VariableString("ui_teamName"), 0, 0, textStyle); -} - - -static void UI_SetCapFragLimits(qboolean uiVars) { - int cap = 5; - int frag = 10; - if (uiInfo.gameTypes[ui_gameType.integer].gtEnum == GT_OBELISK) { - cap = 4; - } else if (uiInfo.gameTypes[ui_gameType.integer].gtEnum == GT_HARVESTER) { - cap = 15; - } - if (uiVars) { - trap_Cvar_Set("ui_captureLimit", va("%d", cap)); - trap_Cvar_Set("ui_fragLimit", va("%d", frag)); - } else { - trap_Cvar_Set("capturelimit", va("%d", cap)); - trap_Cvar_Set("fraglimit", va("%d", frag)); - } -} -// ui_gameType assumes gametype 0 is -1 ALL and will not show -static void UI_DrawGameType(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[ui_gameType.integer].gameType, 0, 0, textStyle); -} - -static void UI_DrawNetGameType(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - if (ui_netGameType.integer < 0 || ui_netGameType.integer > uiInfo.numGameTypes) { - trap_Cvar_Set("ui_netGameType", "0"); - trap_Cvar_Set("ui_actualNetGameType", "0"); - } - Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[ui_netGameType.integer].gameType , 0, 0, textStyle); -} - -static void UI_DrawJoinGameType(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - if (ui_joinGameType.integer < 0 || ui_joinGameType.integer > uiInfo.numJoinGameTypes) { - trap_Cvar_Set("ui_joinGameType", "0"); - } - Text_Paint(rect->x, rect->y, scale, color, uiInfo.joinGameTypes[ui_joinGameType.integer].gameType , 0, 0, textStyle); -} - - - -static int UI_TeamIndexFromName(const char *name) { - int i; - - if (name && *name) { - for (i = 0; i < uiInfo.teamCount; i++) { - if (Q_stricmp(name, uiInfo.teamList[i].teamName) == 0) { - return i; - } - } - } - - return 0; - -} - -static void UI_DrawClanLogo(rectDef_t *rect, float scale, vec4_t color) { - int i; - i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - if (i >= 0 && i < uiInfo.teamCount) { - trap_R_SetColor( color ); - - if (uiInfo.teamList[i].teamIcon == -1) { - uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName); - uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName)); - uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName)); - } - - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon); - trap_R_SetColor(NULL); - } -} - -static void UI_DrawClanCinematic(rectDef_t *rect, float scale, vec4_t color) { - int i; - i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - if (i >= 0 && i < uiInfo.teamCount) { - - if (uiInfo.teamList[i].cinematic >= -2) { - if (uiInfo.teamList[i].cinematic == -1) { - uiInfo.teamList[i].cinematic = trap_CIN_PlayCinematic(va("%s.roq", uiInfo.teamList[i].imageName), 0, 0, 0, 0, (CIN_loop | CIN_silent) ); - } - if (uiInfo.teamList[i].cinematic >= 0) { - trap_CIN_RunCinematic(uiInfo.teamList[i].cinematic); - trap_CIN_SetExtents(uiInfo.teamList[i].cinematic, rect->x, rect->y, rect->w, rect->h); - trap_CIN_DrawCinematic(uiInfo.teamList[i].cinematic); - } else { - trap_R_SetColor( color ); - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon_Metal); - trap_R_SetColor(NULL); - uiInfo.teamList[i].cinematic = -2; - } - } else { - trap_R_SetColor( color ); - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon); - trap_R_SetColor(NULL); - } - } - -} - -static void UI_DrawPreviewCinematic(rectDef_t *rect, float scale, vec4_t color) { - if (uiInfo.previewMovie > -2) { - uiInfo.previewMovie = trap_CIN_PlayCinematic(va("%s.roq", uiInfo.movieList[uiInfo.movieIndex]), 0, 0, 0, 0, (CIN_loop | CIN_silent) ); - if (uiInfo.previewMovie >= 0) { - trap_CIN_RunCinematic(uiInfo.previewMovie); - trap_CIN_SetExtents(uiInfo.previewMovie, rect->x, rect->y, rect->w, rect->h); - trap_CIN_DrawCinematic(uiInfo.previewMovie); - } else { - uiInfo.previewMovie = -2; - } - } - -} - - - -static void UI_DrawSkill(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - int i; - i = trap_Cvar_VariableValue( "g_spSkill" ); - if (i < 1 || i > numSkillLevels) { - i = 1; - } - Text_Paint(rect->x, rect->y, scale, color, skillLevels[i-1],0, 0, textStyle); -} - - -static void UI_DrawTeamName(rectDef_t *rect, float scale, vec4_t color, qboolean blue, int textStyle) { - int i; - i = UI_TeamIndexFromName(UI_Cvar_VariableString((blue) ? "ui_blueTeam" : "ui_redTeam")); - if (i >= 0 && i < uiInfo.teamCount) { - Text_Paint(rect->x, rect->y, scale, color, va("%s: %s", (blue) ? "Blue" : "Red", uiInfo.teamList[i].teamName),0, 0, textStyle); - } -} - -static void UI_DrawTeamMember(rectDef_t *rect, float scale, vec4_t color, qboolean blue, int num, int textStyle) { - // 0 - None - // 1 - Human - // 2..NumCharacters - Bot - int value = trap_Cvar_VariableValue(va(blue ? "ui_blueteam%i" : "ui_redteam%i", num)); - const char *text; - if (value <= 0) { - text = "Closed"; - } else if (value == 1) { - text = "Human"; - } else { - value -= 2; - - if (ui_actualNetGameType.integer >= GT_TEAM) { - if (value >= uiInfo.characterCount) { - value = 0; - } - text = uiInfo.characterList[value].name; - } else { - if (value >= UI_GetNumBots()) { - value = 0; - } - text = UI_GetBotNameByNumber(value); - } - } - Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle); -} - -static void UI_DrawEffects(rectDef_t *rect, float scale, vec4_t color) { - UI_DrawHandlePic( rect->x, rect->y - 14, 128, 8, uiInfo.uiDC.Assets.fxBasePic ); - UI_DrawHandlePic( rect->x + uiInfo.effectsColor * 16 + 8, rect->y - 16, 16, 12, uiInfo.uiDC.Assets.fxPic[uiInfo.effectsColor] ); -} - -static void UI_DrawMapPreview(rectDef_t *rect, float scale, vec4_t color, qboolean net) { - int map = (net) ? ui_currentNetMap.integer : ui_currentMap.integer; - if (map < 0 || map > uiInfo.mapCount) { - if (net) { - ui_currentNetMap.integer = 0; - trap_Cvar_Set("ui_currentNetMap", "0"); - } else { - ui_currentMap.integer = 0; - trap_Cvar_Set("ui_currentMap", "0"); - } - map = 0; - } - - if (uiInfo.mapList[map].levelShot == -1) { - uiInfo.mapList[map].levelShot = trap_R_RegisterShaderNoMip(uiInfo.mapList[map].imageName); - } - - if (uiInfo.mapList[map].levelShot > 0) { - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.mapList[map].levelShot); - } else { - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, trap_R_RegisterShaderNoMip("menu/art/unknownmap")); - } -} - - -static void UI_DrawMapTimeToBeat(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - int minutes, seconds, time; - if (ui_currentMap.integer < 0 || ui_currentMap.integer > uiInfo.mapCount) { - ui_currentMap.integer = 0; - trap_Cvar_Set("ui_currentMap", "0"); - } - - time = uiInfo.mapList[ui_currentMap.integer].timeToBeat[uiInfo.gameTypes[ui_gameType.integer].gtEnum]; - - minutes = time / 60; - seconds = time % 60; - - Text_Paint(rect->x, rect->y, scale, color, va("%02i:%02i", minutes, seconds), 0, 0, textStyle); -} - - - -static void UI_DrawMapCinematic(rectDef_t *rect, float scale, vec4_t color, qboolean net) { - - int map = (net) ? ui_currentNetMap.integer : ui_currentMap.integer; - if (map < 0 || map > uiInfo.mapCount) { - if (net) { - ui_currentNetMap.integer = 0; - trap_Cvar_Set("ui_currentNetMap", "0"); - } else { - ui_currentMap.integer = 0; - trap_Cvar_Set("ui_currentMap", "0"); - } - map = 0; - } - - if (uiInfo.mapList[map].cinematic >= -1) { - if (uiInfo.mapList[map].cinematic == -1) { - uiInfo.mapList[map].cinematic = trap_CIN_PlayCinematic(va("%s.roq", uiInfo.mapList[map].mapLoadName), 0, 0, 0, 0, (CIN_loop | CIN_silent) ); - } - if (uiInfo.mapList[map].cinematic >= 0) { - trap_CIN_RunCinematic(uiInfo.mapList[map].cinematic); - trap_CIN_SetExtents(uiInfo.mapList[map].cinematic, rect->x, rect->y, rect->w, rect->h); - trap_CIN_DrawCinematic(uiInfo.mapList[map].cinematic); - } else { - uiInfo.mapList[map].cinematic = -2; - } - } else { - UI_DrawMapPreview(rect, scale, color, net); - } -} - - - -static qboolean updateModel = qtrue; -static qboolean q3Model = qfalse; - -static void UI_DrawPlayerModel(rectDef_t *rect) { - static playerInfo_t info; - char model[MAX_QPATH]; - char team[256]; - char head[256]; - vec3_t viewangles; - vec3_t moveangles; - - if (trap_Cvar_VariableValue("ui_Q3Model")) { - strcpy(model, UI_Cvar_VariableString("model")); - strcpy(head, UI_Cvar_VariableString("headmodel")); - if (!q3Model) { - q3Model = qtrue; - updateModel = qtrue; - } - team[0] = '\0'; - } else { - - strcpy(team, UI_Cvar_VariableString("ui_teamName")); - strcpy(model, UI_Cvar_VariableString("team_model")); - strcpy(head, UI_Cvar_VariableString("team_headmodel")); - if (q3Model) { - q3Model = qfalse; - updateModel = qtrue; - } - } - if (updateModel) { - memset( &info, 0, sizeof(playerInfo_t) ); - viewangles[YAW] = 180 - 10; - viewangles[PITCH] = 0; - viewangles[ROLL] = 0; - VectorClear( moveangles ); - UI_PlayerInfo_SetModel( &info, model, head, team); - UI_PlayerInfo_SetInfo( &info, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse ); -// UI_RegisterClientModelname( &info, model, head, team); - updateModel = qfalse; - } - - UI_DrawPlayer( rect->x, rect->y, rect->w, rect->h, &info, uiInfo.uiDC.realTime / 2); - -} - -static void UI_DrawNetSource(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - if (ui_netSource.integer < 0 || ui_netSource.integer > numNetSources) { - ui_netSource.integer = 0; - } - Text_Paint(rect->x, rect->y, scale, color, va("Source: %s", netSources[ui_netSource.integer]), 0, 0, textStyle); -} - -static void UI_DrawNetMapPreview(rectDef_t *rect, float scale, vec4_t color) { - - if (uiInfo.serverStatus.currentServerPreview > 0) { - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.serverStatus.currentServerPreview); - } else { - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, trap_R_RegisterShaderNoMip("menu/art/unknownmap")); - } -} - -static void UI_DrawNetMapCinematic(rectDef_t *rect, float scale, vec4_t color) { - if (ui_currentNetMap.integer < 0 || ui_currentNetMap.integer > uiInfo.mapCount) { - ui_currentNetMap.integer = 0; - trap_Cvar_Set("ui_currentNetMap", "0"); - } - - if (uiInfo.serverStatus.currentServerCinematic >= 0) { - trap_CIN_RunCinematic(uiInfo.serverStatus.currentServerCinematic); - trap_CIN_SetExtents(uiInfo.serverStatus.currentServerCinematic, rect->x, rect->y, rect->w, rect->h); - trap_CIN_DrawCinematic(uiInfo.serverStatus.currentServerCinematic); - } else { - UI_DrawNetMapPreview(rect, scale, color); - } -} - - - -static void UI_DrawNetFilter(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - if (ui_serverFilterType.integer < 0 || ui_serverFilterType.integer > numServerFilters) { - ui_serverFilterType.integer = 0; - } - Text_Paint(rect->x, rect->y, scale, color, va("Filter: %s", serverFilters[ui_serverFilterType.integer].description), 0, 0, textStyle); -} - - -static void UI_DrawTier(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - int i; - i = trap_Cvar_VariableValue( "ui_currentTier" ); - if (i < 0 || i >= uiInfo.tierCount) { - i = 0; - } - Text_Paint(rect->x, rect->y, scale, color, va("Tier: %s", uiInfo.tierList[i].tierName),0, 0, textStyle); -} - -static void UI_DrawTierMap(rectDef_t *rect, int index) { - int i; - i = trap_Cvar_VariableValue( "ui_currentTier" ); - if (i < 0 || i >= uiInfo.tierCount) { - i = 0; - } - - if (uiInfo.tierList[i].mapHandles[index] == -1) { - uiInfo.tierList[i].mapHandles[index] = trap_R_RegisterShaderNoMip(va("levelshots/%s", uiInfo.tierList[i].maps[index])); - } - - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.tierList[i].mapHandles[index]); -} - -static const char *UI_EnglishMapName(const char *map) { - int i; - for (i = 0; i < uiInfo.mapCount; i++) { - if (Q_stricmp(map, uiInfo.mapList[i].mapLoadName) == 0) { - return uiInfo.mapList[i].mapName; - } - } - return ""; -} - -static void UI_DrawTierMapName(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - int i, j; - i = trap_Cvar_VariableValue( "ui_currentTier" ); - if (i < 0 || i >= uiInfo.tierCount) { - i = 0; - } - j = trap_Cvar_VariableValue("ui_currentMap"); - if (j < 0 || j > MAPS_PER_TIER) { - j = 0; - } - - Text_Paint(rect->x, rect->y, scale, color, UI_EnglishMapName(uiInfo.tierList[i].maps[j]), 0, 0, textStyle); -} - -static void UI_DrawTierGameType(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - int i, j; - i = trap_Cvar_VariableValue( "ui_currentTier" ); - if (i < 0 || i >= uiInfo.tierCount) { - i = 0; - } - j = trap_Cvar_VariableValue("ui_currentMap"); - if (j < 0 || j > MAPS_PER_TIER) { - j = 0; - } - - Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[uiInfo.tierList[i].gameTypes[j]].gameType , 0, 0, textStyle); -} - - -#ifndef MISSIONPACK // bk001206 -static const char *UI_OpponentLeaderName() { - int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName")); - return uiInfo.teamList[i].teamMembers[0]; -} -#endif - -static const char *UI_AIFromName(const char *name) { - int j; - for (j = 0; j < uiInfo.aliasCount; j++) { - if (Q_stricmp(uiInfo.aliasList[j].name, name) == 0) { - return uiInfo.aliasList[j].ai; - } - } - return "James"; -} - -#ifndef MISSIONPACK // bk001206 -static const int UI_AIIndex(const char *name) { - int j; - for (j = 0; j < uiInfo.characterCount; j++) { - if (Q_stricmp(name, uiInfo.characterList[j].name) == 0) { - return j; - } - } - return 0; -} -#endif - -#ifndef MISSIONPACK // bk001206 -static const int UI_AIIndexFromName(const char *name) { - int j; - for (j = 0; j < uiInfo.aliasCount; j++) { - if (Q_stricmp(uiInfo.aliasList[j].name, name) == 0) { - return UI_AIIndex(uiInfo.aliasList[j].ai); - } - } - return 0; -} -#endif - - -#ifndef MISSIONPACK // bk001206 -static const char *UI_OpponentLeaderHead() { - const char *leader = UI_OpponentLeaderName(); - return UI_AIFromName(leader); -} -#endif - -#ifndef MISSIONPACK // bk001206 -static const char *UI_OpponentLeaderModel() { - int i; - const char *head = UI_OpponentLeaderHead(); - for (i = 0; i < uiInfo.characterCount; i++) { - if (Q_stricmp(head, uiInfo.characterList[i].name) == 0) { - return uiInfo.characterList[i].base; - } - } - return "James"; -} -#endif - - -static qboolean updateOpponentModel = qtrue; -static void UI_DrawOpponent(rectDef_t *rect) { - static playerInfo_t info2; - char model[MAX_QPATH]; - char headmodel[MAX_QPATH]; - char team[256]; - vec3_t viewangles; - vec3_t moveangles; - - if (updateOpponentModel) { - - strcpy(model, UI_Cvar_VariableString("ui_opponentModel")); - strcpy(headmodel, UI_Cvar_VariableString("ui_opponentModel")); - team[0] = '\0'; - - memset( &info2, 0, sizeof(playerInfo_t) ); - viewangles[YAW] = 180 - 10; - viewangles[PITCH] = 0; - viewangles[ROLL] = 0; - VectorClear( moveangles ); - UI_PlayerInfo_SetModel( &info2, model, headmodel, ""); - UI_PlayerInfo_SetInfo( &info2, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse ); - UI_RegisterClientModelname( &info2, model, headmodel, team); - updateOpponentModel = qfalse; - } - - UI_DrawPlayer( rect->x, rect->y, rect->w, rect->h, &info2, uiInfo.uiDC.realTime / 2); - -} - -static void UI_NextOpponent() { - int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName")); - int j = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - i++; - if (i >= uiInfo.teamCount) { - i = 0; - } - if (i == j) { - i++; - if ( i >= uiInfo.teamCount) { - i = 0; - } - } - trap_Cvar_Set( "ui_opponentName", uiInfo.teamList[i].teamName ); -} - -static void UI_PriorOpponent() { - int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName")); - int j = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - i--; - if (i < 0) { - i = uiInfo.teamCount - 1; - } - if (i == j) { - i--; - if ( i < 0) { - i = uiInfo.teamCount - 1; - } - } - trap_Cvar_Set( "ui_opponentName", uiInfo.teamList[i].teamName ); -} - -static void UI_DrawPlayerLogo(rectDef_t *rect, vec3_t color) { - int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - - if (uiInfo.teamList[i].teamIcon == -1) { - uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName); - uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName)); - uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName)); - } - - trap_R_SetColor( color ); - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon ); - trap_R_SetColor( NULL ); -} - -static void UI_DrawPlayerLogoMetal(rectDef_t *rect, vec3_t color) { - int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - if (uiInfo.teamList[i].teamIcon == -1) { - uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName); - uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName)); - uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName)); - } - - trap_R_SetColor( color ); - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon_Metal ); - trap_R_SetColor( NULL ); -} - -static void UI_DrawPlayerLogoName(rectDef_t *rect, vec3_t color) { - int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - if (uiInfo.teamList[i].teamIcon == -1) { - uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName); - uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName)); - uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName)); - } - - trap_R_SetColor( color ); - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon_Name ); - trap_R_SetColor( NULL ); -} - -static void UI_DrawOpponentLogo(rectDef_t *rect, vec3_t color) { - int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName")); - if (uiInfo.teamList[i].teamIcon == -1) { - uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName); - uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName)); - uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName)); - } - - trap_R_SetColor( color ); - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon ); - trap_R_SetColor( NULL ); -} - -static void UI_DrawOpponentLogoMetal(rectDef_t *rect, vec3_t color) { - int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName")); - if (uiInfo.teamList[i].teamIcon == -1) { - uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName); - uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName)); - uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName)); - } - - trap_R_SetColor( color ); - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon_Metal ); - trap_R_SetColor( NULL ); -} - -static void UI_DrawOpponentLogoName(rectDef_t *rect, vec3_t color) { - int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName")); - if (uiInfo.teamList[i].teamIcon == -1) { - uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName); - uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName)); - uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName)); - } - - trap_R_SetColor( color ); - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon_Name ); - trap_R_SetColor( NULL ); -} - -static void UI_DrawAllMapsSelection(rectDef_t *rect, float scale, vec4_t color, int textStyle, qboolean net) { - int map = (net) ? ui_currentNetMap.integer : ui_currentMap.integer; - if (map >= 0 && map < uiInfo.mapCount) { - Text_Paint(rect->x, rect->y, scale, color, uiInfo.mapList[map].mapName, 0, 0, textStyle); - } -} - -static void UI_DrawOpponentName(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - Text_Paint(rect->x, rect->y, scale, color, UI_Cvar_VariableString("ui_opponentName"), 0, 0, textStyle); -} - - -static int UI_OwnerDrawWidth(int ownerDraw, float scale) { - int i, h, value; - const char *text; - const char *s = NULL; - - switch (ownerDraw) { - case UI_HANDICAP: - h = Com_Clamp( 5, 100, trap_Cvar_VariableValue("handicap") ); - i = 20 - h / 5; - s = handicapValues[i]; - break; - case UI_CLANNAME: - s = UI_Cvar_VariableString("ui_teamName"); - break; - case UI_GAMETYPE: - s = uiInfo.gameTypes[ui_gameType.integer].gameType; - break; - case UI_SKILL: - i = trap_Cvar_VariableValue( "g_spSkill" ); - if (i < 1 || i > numSkillLevels) { - i = 1; - } - s = skillLevels[i-1]; - break; - case UI_BLUETEAMNAME: - i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_blueTeam")); - if (i >= 0 && i < uiInfo.teamCount) { - s = va("%s: %s", "Blue", uiInfo.teamList[i].teamName); - } - break; - case UI_REDTEAMNAME: - i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_redTeam")); - if (i >= 0 && i < uiInfo.teamCount) { - s = va("%s: %s", "Red", uiInfo.teamList[i].teamName); - } - break; - case UI_BLUETEAM1: - case UI_BLUETEAM2: - case UI_BLUETEAM3: - case UI_BLUETEAM4: - case UI_BLUETEAM5: - value = trap_Cvar_VariableValue(va("ui_blueteam%i", ownerDraw-UI_BLUETEAM1 + 1)); - if (value <= 0) { - text = "Closed"; - } else if (value == 1) { - text = "Human"; - } else { - value -= 2; - if (value >= uiInfo.aliasCount) { - value = 0; - } - text = uiInfo.aliasList[value].name; - } - s = va("%i. %s", ownerDraw-UI_BLUETEAM1 + 1, text); - break; - case UI_REDTEAM1: - case UI_REDTEAM2: - case UI_REDTEAM3: - case UI_REDTEAM4: - case UI_REDTEAM5: - value = trap_Cvar_VariableValue(va("ui_redteam%i", ownerDraw-UI_REDTEAM1 + 1)); - if (value <= 0) { - text = "Closed"; - } else if (value == 1) { - text = "Human"; - } else { - value -= 2; - if (value >= uiInfo.aliasCount) { - value = 0; - } - text = uiInfo.aliasList[value].name; - } - s = va("%i. %s", ownerDraw-UI_REDTEAM1 + 1, text); - break; - case UI_NETSOURCE: - if (ui_netSource.integer < 0 || ui_netSource.integer > uiInfo.numJoinGameTypes) { - ui_netSource.integer = 0; - } - s = va("Source: %s", netSources[ui_netSource.integer]); - break; - case UI_NETFILTER: - if (ui_serverFilterType.integer < 0 || ui_serverFilterType.integer > numServerFilters) { - ui_serverFilterType.integer = 0; - } - s = va("Filter: %s", serverFilters[ui_serverFilterType.integer].description ); - break; - case UI_TIER: - break; - case UI_TIER_MAPNAME: - break; - case UI_TIER_GAMETYPE: - break; - case UI_ALLMAPS_SELECTION: - break; - case UI_OPPONENT_NAME: - break; - case UI_KEYBINDSTATUS: - if (Display_KeyBindPending()) { - s = "Waiting for new key... Press ESCAPE to cancel"; - } else { - s = "Press ENTER or CLICK to change, Press BACKSPACE to clear"; - } - break; - case UI_SERVERREFRESHDATE: - s = UI_Cvar_VariableString(va("ui_lastServerRefresh_%i", ui_netSource.integer)); - break; - default: - break; - } - - if (s) { - return Text_Width(s, scale, 0); - } - return 0; -} - -static void UI_DrawBotName(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - int value = uiInfo.botIndex; - int game = trap_Cvar_VariableValue("g_gametype"); - const char *text = ""; - if (game >= GT_TEAM) { - if (value >= uiInfo.characterCount) { - value = 0; - } - text = uiInfo.characterList[value].name; - } else { - if (value >= UI_GetNumBots()) { - value = 0; - } - text = UI_GetBotNameByNumber(value); - } - Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle); -} - -static void UI_DrawBotSkill(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - if (uiInfo.skillIndex >= 0 && uiInfo.skillIndex < numSkillLevels) { - Text_Paint(rect->x, rect->y, scale, color, skillLevels[uiInfo.skillIndex], 0, 0, textStyle); - } -} - -static void UI_DrawRedBlue(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - Text_Paint(rect->x, rect->y, scale, color, (uiInfo.redBlue == 0) ? "Red" : "Blue", 0, 0, textStyle); -} - -static void UI_DrawCrosshair(rectDef_t *rect, float scale, vec4_t color) { - trap_R_SetColor( color ); - if (uiInfo.currentCrosshair < 0 || uiInfo.currentCrosshair >= NUM_CROSSHAIRS) { - uiInfo.currentCrosshair = 0; - } - UI_DrawHandlePic( rect->x, rect->y - rect->h, rect->w, rect->h, uiInfo.uiDC.Assets.crosshairShader[uiInfo.currentCrosshair]); - trap_R_SetColor( NULL ); -} - -/* -=============== -UI_BuildPlayerList -=============== -*/ -static void UI_BuildPlayerList() { - uiClientState_t cs; - int n, count, team, team2, playerTeamNumber; - char info[MAX_INFO_STRING]; - - trap_GetClientState( &cs ); - trap_GetConfigString( CS_PLAYERS + cs.clientNum, info, MAX_INFO_STRING ); - uiInfo.playerNumber = cs.clientNum; - uiInfo.teamLeader = atoi(Info_ValueForKey(info, "tl")); - team = atoi(Info_ValueForKey(info, "t")); - trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ); - count = atoi( Info_ValueForKey( info, "sv_maxclients" ) ); - uiInfo.playerCount = 0; - uiInfo.myTeamCount = 0; - playerTeamNumber = 0; - for( n = 0; n < count; n++ ) { - trap_GetConfigString( CS_PLAYERS + n, info, MAX_INFO_STRING ); - - if (info[0]) { - Q_strncpyz( uiInfo.playerNames[uiInfo.playerCount], Info_ValueForKey( info, "n" ), MAX_NAME_LENGTH ); - Q_CleanStr( uiInfo.playerNames[uiInfo.playerCount] ); - uiInfo.playerCount++; - team2 = atoi(Info_ValueForKey(info, "t")); - if (team2 == team) { - Q_strncpyz( uiInfo.teamNames[uiInfo.myTeamCount], Info_ValueForKey( info, "n" ), MAX_NAME_LENGTH ); - Q_CleanStr( uiInfo.teamNames[uiInfo.myTeamCount] ); - uiInfo.teamClientNums[uiInfo.myTeamCount] = n; - if (uiInfo.playerNumber == n) { - playerTeamNumber = uiInfo.myTeamCount; - } - uiInfo.myTeamCount++; - } - } - } - - if (!uiInfo.teamLeader) { - trap_Cvar_Set("cg_selectedPlayer", va("%d", playerTeamNumber)); - } - - n = trap_Cvar_VariableValue("cg_selectedPlayer"); - if (n < 0 || n > uiInfo.myTeamCount) { - n = 0; - } - if (n < uiInfo.myTeamCount) { - trap_Cvar_Set("cg_selectedPlayerName", uiInfo.teamNames[n]); - } -} - - -static void UI_DrawSelectedPlayer(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - if (uiInfo.uiDC.realTime > uiInfo.playerRefresh) { - uiInfo.playerRefresh = uiInfo.uiDC.realTime + 3000; - UI_BuildPlayerList(); - } - Text_Paint(rect->x, rect->y, scale, color, (uiInfo.teamLeader) ? UI_Cvar_VariableString("cg_selectedPlayerName") : UI_Cvar_VariableString("name") , 0, 0, textStyle); -} - -static void UI_DrawServerRefreshDate(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - if (uiInfo.serverStatus.refreshActive) { - vec4_t lowLight, newColor; - lowLight[0] = 0.8 * color[0]; - lowLight[1] = 0.8 * color[1]; - lowLight[2] = 0.8 * color[2]; - lowLight[3] = 0.8 * color[3]; - LerpColor(color,lowLight,newColor,0.5+0.5*sin(uiInfo.uiDC.realTime / PULSE_DIVISOR)); - Text_Paint(rect->x, rect->y, scale, newColor, va("Getting info for %d servers (ESC to cancel)", trap_LAN_GetServerCount(ui_netSource.integer)), 0, 0, textStyle); - } else { - char buff[64]; - Q_strncpyz(buff, UI_Cvar_VariableString(va("ui_lastServerRefresh_%i", ui_netSource.integer)), 64); - Text_Paint(rect->x, rect->y, scale, color, va("Refresh Time: %s", buff), 0, 0, textStyle); - } -} - -static void UI_DrawServerMOTD(rectDef_t *rect, float scale, vec4_t color) { - if (uiInfo.serverStatus.motdLen) { - float maxX; - - if (uiInfo.serverStatus.motdWidth == -1) { - uiInfo.serverStatus.motdWidth = 0; - uiInfo.serverStatus.motdPaintX = rect->x + 1; - uiInfo.serverStatus.motdPaintX2 = -1; - } - - if (uiInfo.serverStatus.motdOffset > uiInfo.serverStatus.motdLen) { - uiInfo.serverStatus.motdOffset = 0; - uiInfo.serverStatus.motdPaintX = rect->x + 1; - uiInfo.serverStatus.motdPaintX2 = -1; - } - - if (uiInfo.uiDC.realTime > uiInfo.serverStatus.motdTime) { - uiInfo.serverStatus.motdTime = uiInfo.uiDC.realTime + 10; - if (uiInfo.serverStatus.motdPaintX <= rect->x + 2) { - if (uiInfo.serverStatus.motdOffset < uiInfo.serverStatus.motdLen) { - uiInfo.serverStatus.motdPaintX += Text_Width(&uiInfo.serverStatus.motd[uiInfo.serverStatus.motdOffset], scale, 1) - 1; - uiInfo.serverStatus.motdOffset++; - } else { - uiInfo.serverStatus.motdOffset = 0; - if (uiInfo.serverStatus.motdPaintX2 >= 0) { - uiInfo.serverStatus.motdPaintX = uiInfo.serverStatus.motdPaintX2; - } else { - uiInfo.serverStatus.motdPaintX = rect->x + rect->w - 2; - } - uiInfo.serverStatus.motdPaintX2 = -1; - } - } else { - //serverStatus.motdPaintX--; - uiInfo.serverStatus.motdPaintX -= 2; - if (uiInfo.serverStatus.motdPaintX2 >= 0) { - //serverStatus.motdPaintX2--; - uiInfo.serverStatus.motdPaintX2 -= 2; - } - } - } - - maxX = rect->x + rect->w - 2; - Text_Paint_Limit(&maxX, uiInfo.serverStatus.motdPaintX, rect->y + rect->h - 3, scale, color, &uiInfo.serverStatus.motd[uiInfo.serverStatus.motdOffset], 0, 0); - if (uiInfo.serverStatus.motdPaintX2 >= 0) { - float maxX2 = rect->x + rect->w - 2; - Text_Paint_Limit(&maxX2, uiInfo.serverStatus.motdPaintX2, rect->y + rect->h - 3, scale, color, uiInfo.serverStatus.motd, 0, uiInfo.serverStatus.motdOffset); - } - if (uiInfo.serverStatus.motdOffset && maxX > 0) { - // if we have an offset ( we are skipping the first part of the string ) and we fit the string - if (uiInfo.serverStatus.motdPaintX2 == -1) { - uiInfo.serverStatus.motdPaintX2 = rect->x + rect->w - 2; - } - } else { - uiInfo.serverStatus.motdPaintX2 = -1; - } - - } -} - -static void UI_DrawKeyBindStatus(rectDef_t *rect, float scale, vec4_t color, int textStyle) { -// int ofs = 0; TTimo: unused - if (Display_KeyBindPending()) { - Text_Paint(rect->x, rect->y, scale, color, "Waiting for new key... Press ESCAPE to cancel", 0, 0, textStyle); - } else { - Text_Paint(rect->x, rect->y, scale, color, "Press ENTER or CLICK to change, Press BACKSPACE to clear", 0, 0, textStyle); - } -} - -static void UI_DrawGLInfo(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - char * eptr; - char buff[1024]; - const char *lines[64]; - int y, numLines, i; - - Text_Paint(rect->x + 2, rect->y, scale, color, va("VENDOR: %s", uiInfo.uiDC.glconfig.vendor_string), 0, 30, textStyle); - Text_Paint(rect->x + 2, rect->y + 15, scale, color, va("VERSION: %s: %s", uiInfo.uiDC.glconfig.version_string,uiInfo.uiDC.glconfig.renderer_string), 0, 30, textStyle); - Text_Paint(rect->x + 2, rect->y + 30, scale, color, va ("PIXELFORMAT: color(%d-bits) Z(%d-bits) stencil(%d-bits)", uiInfo.uiDC.glconfig.colorBits, uiInfo.uiDC.glconfig.depthBits, uiInfo.uiDC.glconfig.stencilBits), 0, 30, textStyle); - - // build null terminated extension strings - // TTimo: https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=399 - // in TA this was not directly crashing, but displaying a nasty broken shader right in the middle - // brought down the string size to 1024, there's not much that can be shown on the screen anyway - Q_strncpyz(buff, uiInfo.uiDC.glconfig.extensions_string, 1024); - eptr = buff; - y = rect->y + 45; - numLines = 0; - while ( y < rect->y + rect->h && *eptr ) - { - while ( *eptr && *eptr == ' ' ) - *eptr++ = '\0'; - - // track start of valid string - if (*eptr && *eptr != ' ') { - lines[numLines++] = eptr; - } - - while ( *eptr && *eptr != ' ' ) - eptr++; - } - - i = 0; - while (i < numLines) { - Text_Paint(rect->x + 2, y, scale, color, lines[i++], 0, 20, textStyle); - if (i < numLines) { - Text_Paint(rect->x + rect->w / 2, y, scale, color, lines[i++], 0, 20, textStyle); - } - y += 10; - if (y > rect->y + rect->h - 11) { - break; - } - } - - -} - -// FIXME: table drive -// -static void UI_OwnerDraw(float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, int ownerDrawFlags, int align, float special, float scale, vec4_t color, qhandle_t shader, int textStyle) { - rectDef_t rect; - - rect.x = x + text_x; - rect.y = y + text_y; - rect.w = w; - rect.h = h; - - switch (ownerDraw) { - case UI_HANDICAP: - UI_DrawHandicap(&rect, scale, color, textStyle); - break; - case UI_EFFECTS: - UI_DrawEffects(&rect, scale, color); - break; - case UI_PLAYERMODEL: - UI_DrawPlayerModel(&rect); - break; - case UI_CLANNAME: - UI_DrawClanName(&rect, scale, color, textStyle); - break; - case UI_CLANLOGO: - UI_DrawClanLogo(&rect, scale, color); - break; - case UI_CLANCINEMATIC: - UI_DrawClanCinematic(&rect, scale, color); - break; - case UI_PREVIEWCINEMATIC: - UI_DrawPreviewCinematic(&rect, scale, color); - break; - case UI_GAMETYPE: - UI_DrawGameType(&rect, scale, color, textStyle); - break; - case UI_NETGAMETYPE: - UI_DrawNetGameType(&rect, scale, color, textStyle); - break; - case UI_JOINGAMETYPE: - UI_DrawJoinGameType(&rect, scale, color, textStyle); - break; - case UI_MAPPREVIEW: - UI_DrawMapPreview(&rect, scale, color, qtrue); - break; - case UI_MAP_TIMETOBEAT: - UI_DrawMapTimeToBeat(&rect, scale, color, textStyle); - break; - case UI_MAPCINEMATIC: - UI_DrawMapCinematic(&rect, scale, color, qfalse); - break; - case UI_STARTMAPCINEMATIC: - UI_DrawMapCinematic(&rect, scale, color, qtrue); - break; - case UI_SKILL: - UI_DrawSkill(&rect, scale, color, textStyle); - break; - case UI_BLUETEAMNAME: - UI_DrawTeamName(&rect, scale, color, qtrue, textStyle); - break; - case UI_REDTEAMNAME: - UI_DrawTeamName(&rect, scale, color, qfalse, textStyle); - break; - case UI_BLUETEAM1: - case UI_BLUETEAM2: - case UI_BLUETEAM3: - case UI_BLUETEAM4: - case UI_BLUETEAM5: - UI_DrawTeamMember(&rect, scale, color, qtrue, ownerDraw - UI_BLUETEAM1 + 1, textStyle); - break; - case UI_REDTEAM1: - case UI_REDTEAM2: - case UI_REDTEAM3: - case UI_REDTEAM4: - case UI_REDTEAM5: - UI_DrawTeamMember(&rect, scale, color, qfalse, ownerDraw - UI_REDTEAM1 + 1, textStyle); - break; - case UI_NETSOURCE: - UI_DrawNetSource(&rect, scale, color, textStyle); - break; - case UI_NETMAPPREVIEW: - UI_DrawNetMapPreview(&rect, scale, color); - break; - case UI_NETMAPCINEMATIC: - UI_DrawNetMapCinematic(&rect, scale, color); - break; - case UI_NETFILTER: - UI_DrawNetFilter(&rect, scale, color, textStyle); - break; - case UI_TIER: - UI_DrawTier(&rect, scale, color, textStyle); - break; - case UI_OPPONENTMODEL: - UI_DrawOpponent(&rect); - break; - case UI_TIERMAP1: - UI_DrawTierMap(&rect, 0); - break; - case UI_TIERMAP2: - UI_DrawTierMap(&rect, 1); - break; - case UI_TIERMAP3: - UI_DrawTierMap(&rect, 2); - break; - case UI_PLAYERLOGO: - UI_DrawPlayerLogo(&rect, color); - break; - case UI_PLAYERLOGO_METAL: - UI_DrawPlayerLogoMetal(&rect, color); - break; - case UI_PLAYERLOGO_NAME: - UI_DrawPlayerLogoName(&rect, color); - break; - case UI_OPPONENTLOGO: - UI_DrawOpponentLogo(&rect, color); - break; - case UI_OPPONENTLOGO_METAL: - UI_DrawOpponentLogoMetal(&rect, color); - break; - case UI_OPPONENTLOGO_NAME: - UI_DrawOpponentLogoName(&rect, color); - break; - case UI_TIER_MAPNAME: - UI_DrawTierMapName(&rect, scale, color, textStyle); - break; - case UI_TIER_GAMETYPE: - UI_DrawTierGameType(&rect, scale, color, textStyle); - break; - case UI_ALLMAPS_SELECTION: - UI_DrawAllMapsSelection(&rect, scale, color, textStyle, qtrue); - break; - case UI_MAPS_SELECTION: - UI_DrawAllMapsSelection(&rect, scale, color, textStyle, qfalse); - break; - case UI_OPPONENT_NAME: - UI_DrawOpponentName(&rect, scale, color, textStyle); - break; - case UI_BOTNAME: - UI_DrawBotName(&rect, scale, color, textStyle); - break; - case UI_BOTSKILL: - UI_DrawBotSkill(&rect, scale, color, textStyle); - break; - case UI_REDBLUE: - UI_DrawRedBlue(&rect, scale, color, textStyle); - break; - case UI_CROSSHAIR: - UI_DrawCrosshair(&rect, scale, color); - break; - case UI_SELECTEDPLAYER: - UI_DrawSelectedPlayer(&rect, scale, color, textStyle); - break; - case UI_SERVERREFRESHDATE: - UI_DrawServerRefreshDate(&rect, scale, color, textStyle); - break; - case UI_SERVERMOTD: - UI_DrawServerMOTD(&rect, scale, color); - break; - case UI_GLINFO: - UI_DrawGLInfo(&rect,scale, color, textStyle); - break; - case UI_KEYBINDSTATUS: - UI_DrawKeyBindStatus(&rect,scale, color, textStyle); - break; - default: - break; - } - -} - -static qboolean UI_OwnerDrawVisible(int flags) { - qboolean vis = qtrue; - - while (flags) { - - if (flags & UI_SHOW_FFA) { - if (trap_Cvar_VariableValue("g_gametype") != GT_FFA) { - vis = qfalse; - } - flags &= ~UI_SHOW_FFA; - } - - if (flags & UI_SHOW_NOTFFA) { - if (trap_Cvar_VariableValue("g_gametype") == GT_FFA) { - vis = qfalse; - } - flags &= ~UI_SHOW_NOTFFA; - } - - if (flags & UI_SHOW_LEADER) { - // these need to show when this client can give orders to a player or a group - if (!uiInfo.teamLeader) { - vis = qfalse; - } else { - // if showing yourself - if (ui_selectedPlayer.integer < uiInfo.myTeamCount && uiInfo.teamClientNums[ui_selectedPlayer.integer] == uiInfo.playerNumber) { - vis = qfalse; - } - } - flags &= ~UI_SHOW_LEADER; - } - if (flags & UI_SHOW_NOTLEADER) { - // these need to show when this client is assigning their own status or they are NOT the leader - if (uiInfo.teamLeader) { - // if not showing yourself - if (!(ui_selectedPlayer.integer < uiInfo.myTeamCount && uiInfo.teamClientNums[ui_selectedPlayer.integer] == uiInfo.playerNumber)) { - vis = qfalse; - } - // these need to show when this client can give orders to a player or a group - } - flags &= ~UI_SHOW_NOTLEADER; - } - if (flags & UI_SHOW_FAVORITESERVERS) { - // this assumes you only put this type of display flag on something showing in the proper context - if (ui_netSource.integer != AS_FAVORITES) { - vis = qfalse; - } - flags &= ~UI_SHOW_FAVORITESERVERS; - } - if (flags & UI_SHOW_NOTFAVORITESERVERS) { - // this assumes you only put this type of display flag on something showing in the proper context - if (ui_netSource.integer == AS_FAVORITES) { - vis = qfalse; - } - flags &= ~UI_SHOW_NOTFAVORITESERVERS; - } - if (flags & UI_SHOW_ANYTEAMGAME) { - if (uiInfo.gameTypes[ui_gameType.integer].gtEnum <= GT_TEAM ) { - vis = qfalse; - } - flags &= ~UI_SHOW_ANYTEAMGAME; - } - if (flags & UI_SHOW_ANYNONTEAMGAME) { - if (uiInfo.gameTypes[ui_gameType.integer].gtEnum > GT_TEAM ) { - vis = qfalse; - } - flags &= ~UI_SHOW_ANYNONTEAMGAME; - } - if (flags & UI_SHOW_NETANYTEAMGAME) { - if (uiInfo.gameTypes[ui_netGameType.integer].gtEnum <= GT_TEAM ) { - vis = qfalse; - } - flags &= ~UI_SHOW_NETANYTEAMGAME; - } - if (flags & UI_SHOW_NETANYNONTEAMGAME) { - if (uiInfo.gameTypes[ui_netGameType.integer].gtEnum > GT_TEAM ) { - vis = qfalse; - } - flags &= ~UI_SHOW_NETANYNONTEAMGAME; - } - if (flags & UI_SHOW_NEWHIGHSCORE) { - if (uiInfo.newHighScoreTime < uiInfo.uiDC.realTime) { - vis = qfalse; - } else { - if (uiInfo.soundHighScore) { - if (trap_Cvar_VariableValue("sv_killserver") == 0) { - // wait on server to go down before playing sound - trap_S_StartLocalSound(uiInfo.newHighScoreSound, CHAN_ANNOUNCER); - uiInfo.soundHighScore = qfalse; - } - } - } - flags &= ~UI_SHOW_NEWHIGHSCORE; - } - if (flags & UI_SHOW_NEWBESTTIME) { - if (uiInfo.newBestTime < uiInfo.uiDC.realTime) { - vis = qfalse; - } - flags &= ~UI_SHOW_NEWBESTTIME; - } - if (flags & UI_SHOW_DEMOAVAILABLE) { - if (!uiInfo.demoAvailable) { - vis = qfalse; - } - flags &= ~UI_SHOW_DEMOAVAILABLE; - } else { - flags = 0; - } - } - return vis; -} - -static qboolean UI_Handicap_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - int h; - h = Com_Clamp( 5, 100, trap_Cvar_VariableValue("handicap") ); - if (key == K_MOUSE2) { - h -= 5; - } else { - h += 5; - } - if (h > 100) { - h = 5; - } else if (h < 0) { - h = 100; - } - trap_Cvar_Set( "handicap", va( "%i", h) ); - return qtrue; - } - return qfalse; -} - -static qboolean UI_Effects_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - - if (key == K_MOUSE2) { - uiInfo.effectsColor--; - } else { - uiInfo.effectsColor++; - } - - if( uiInfo.effectsColor > 6 ) { - uiInfo.effectsColor = 0; - } else if (uiInfo.effectsColor < 0) { - uiInfo.effectsColor = 6; - } - - trap_Cvar_SetValue( "color1", uitogamecode[uiInfo.effectsColor] ); - return qtrue; - } - return qfalse; -} - -static qboolean UI_ClanName_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - int i; - i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - if (uiInfo.teamList[i].cinematic >= 0) { - trap_CIN_StopCinematic(uiInfo.teamList[i].cinematic); - uiInfo.teamList[i].cinematic = -1; - } - if (key == K_MOUSE2) { - i--; - } else { - i++; - } - if (i >= uiInfo.teamCount) { - i = 0; - } else if (i < 0) { - i = uiInfo.teamCount - 1; - } - trap_Cvar_Set( "ui_teamName", uiInfo.teamList[i].teamName); - UI_HeadCountByTeam(); - UI_FeederSelection(FEEDER_HEADS, 0); - updateModel = qtrue; - return qtrue; - } - return qfalse; -} - -static qboolean UI_GameType_HandleKey(int flags, float *special, int key, qboolean resetMap) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - int oldCount = UI_MapCountByGameType(qtrue); - - // hard coded mess here - if (key == K_MOUSE2) { - ui_gameType.integer--; - if (ui_gameType.integer == 2) { - ui_gameType.integer = 1; - } else if (ui_gameType.integer < 2) { - ui_gameType.integer = uiInfo.numGameTypes - 1; - } - } else { - ui_gameType.integer++; - if (ui_gameType.integer >= uiInfo.numGameTypes) { - ui_gameType.integer = 1; - } else if (ui_gameType.integer == 2) { - ui_gameType.integer = 3; - } - } - - if (uiInfo.gameTypes[ui_gameType.integer].gtEnum == GT_TOURNAMENT) { - trap_Cvar_Set("ui_Q3Model", "1"); - } else { - trap_Cvar_Set("ui_Q3Model", "0"); - } - - trap_Cvar_Set("ui_gameType", va("%d", ui_gameType.integer)); - UI_SetCapFragLimits(qtrue); - UI_LoadBestScores(uiInfo.mapList[ui_currentMap.integer].mapLoadName, uiInfo.gameTypes[ui_gameType.integer].gtEnum); - if (resetMap && oldCount != UI_MapCountByGameType(qtrue)) { - trap_Cvar_Set( "ui_currentMap", "0"); - Menu_SetFeederSelection(NULL, FEEDER_MAPS, 0, NULL); - } - return qtrue; - } - return qfalse; -} - -static qboolean UI_NetGameType_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - - if (key == K_MOUSE2) { - ui_netGameType.integer--; - } else { - ui_netGameType.integer++; - } - - if (ui_netGameType.integer < 0) { - ui_netGameType.integer = uiInfo.numGameTypes - 1; - } else if (ui_netGameType.integer >= uiInfo.numGameTypes) { - ui_netGameType.integer = 0; - } - - trap_Cvar_Set( "ui_netGameType", va("%d", ui_netGameType.integer)); - trap_Cvar_Set( "ui_actualnetGameType", va("%d", uiInfo.gameTypes[ui_netGameType.integer].gtEnum)); - trap_Cvar_Set( "ui_currentNetMap", "0"); - UI_MapCountByGameType(qfalse); - Menu_SetFeederSelection(NULL, FEEDER_ALLMAPS, 0, NULL); - return qtrue; - } - return qfalse; -} - -static qboolean UI_JoinGameType_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - - if (key == K_MOUSE2) { - ui_joinGameType.integer--; - } else { - ui_joinGameType.integer++; - } - - if (ui_joinGameType.integer < 0) { - ui_joinGameType.integer = uiInfo.numJoinGameTypes - 1; - } else if (ui_joinGameType.integer >= uiInfo.numJoinGameTypes) { - ui_joinGameType.integer = 0; - } - - trap_Cvar_Set( "ui_joinGameType", va("%d", ui_joinGameType.integer)); - UI_BuildServerDisplayList(qtrue); - return qtrue; - } - return qfalse; -} - - - -static qboolean UI_Skill_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - int i = trap_Cvar_VariableValue( "g_spSkill" ); - - if (key == K_MOUSE2) { - i--; - } else { - i++; - } - - if (i < 1) { - i = numSkillLevels; - } else if (i > numSkillLevels) { - i = 1; - } - - trap_Cvar_Set("g_spSkill", va("%i", i)); - return qtrue; - } - return qfalse; -} - -static qboolean UI_TeamName_HandleKey(int flags, float *special, int key, qboolean blue) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - int i; - i = UI_TeamIndexFromName(UI_Cvar_VariableString((blue) ? "ui_blueTeam" : "ui_redTeam")); - - if (key == K_MOUSE2) { - i--; - } else { - i++; - } - - if (i >= uiInfo.teamCount) { - i = 0; - } else if (i < 0) { - i = uiInfo.teamCount - 1; - } - - trap_Cvar_Set( (blue) ? "ui_blueTeam" : "ui_redTeam", uiInfo.teamList[i].teamName); - - return qtrue; - } - return qfalse; -} - -static qboolean UI_TeamMember_HandleKey(int flags, float *special, int key, qboolean blue, int num) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - // 0 - None - // 1 - Human - // 2..NumCharacters - Bot - char *cvar = va(blue ? "ui_blueteam%i" : "ui_redteam%i", num); - int value = trap_Cvar_VariableValue(cvar); - - if (key == K_MOUSE2) { - value--; - } else { - value++; - } - - if (ui_actualNetGameType.integer >= GT_TEAM) { - if (value >= uiInfo.characterCount + 2) { - value = 0; - } else if (value < 0) { - value = uiInfo.characterCount + 2 - 1; - } - } else { - if (value >= UI_GetNumBots() + 2) { - value = 0; - } else if (value < 0) { - value = UI_GetNumBots() + 2 - 1; - } - } - - trap_Cvar_Set(cvar, va("%i", value)); - return qtrue; - } - return qfalse; -} - -static qboolean UI_NetSource_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - - if (key == K_MOUSE2) { - ui_netSource.integer--; - if (ui_netSource.integer == AS_MPLAYER) - ui_netSource.integer--; - } else { - ui_netSource.integer++; - if (ui_netSource.integer == AS_MPLAYER) - ui_netSource.integer++; - } - - if (ui_netSource.integer >= numNetSources) { - ui_netSource.integer = 0; - } else if (ui_netSource.integer < 0) { - ui_netSource.integer = numNetSources - 1; - } - - UI_BuildServerDisplayList(qtrue); - if (ui_netSource.integer != AS_GLOBAL) { - UI_StartServerRefresh(qtrue); - } - trap_Cvar_Set( "ui_netSource", va("%d", ui_netSource.integer)); - return qtrue; - } - return qfalse; -} - -static qboolean UI_NetFilter_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - - if (key == K_MOUSE2) { - ui_serverFilterType.integer--; - } else { - ui_serverFilterType.integer++; - } - - if (ui_serverFilterType.integer >= numServerFilters) { - ui_serverFilterType.integer = 0; - } else if (ui_serverFilterType.integer < 0) { - ui_serverFilterType.integer = numServerFilters - 1; - } - UI_BuildServerDisplayList(qtrue); - return qtrue; - } - return qfalse; -} - -static qboolean UI_OpponentName_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - if (key == K_MOUSE2) { - UI_PriorOpponent(); - } else { - UI_NextOpponent(); - } - return qtrue; - } - return qfalse; -} - -static qboolean UI_BotName_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - int game = trap_Cvar_VariableValue("g_gametype"); - int value = uiInfo.botIndex; - - if (key == K_MOUSE2) { - value--; - } else { - value++; - } - - if (game >= GT_TEAM) { - if (value >= uiInfo.characterCount + 2) { - value = 0; - } else if (value < 0) { - value = uiInfo.characterCount + 2 - 1; - } - } else { - if (value >= UI_GetNumBots() + 2) { - value = 0; - } else if (value < 0) { - value = UI_GetNumBots() + 2 - 1; - } - } - uiInfo.botIndex = value; - return qtrue; - } - return qfalse; -} - -static qboolean UI_BotSkill_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - if (key == K_MOUSE2) { - uiInfo.skillIndex--; - } else { - uiInfo.skillIndex++; - } - if (uiInfo.skillIndex >= numSkillLevels) { - uiInfo.skillIndex = 0; - } else if (uiInfo.skillIndex < 0) { - uiInfo.skillIndex = numSkillLevels-1; - } - return qtrue; - } - return qfalse; -} - -static qboolean UI_RedBlue_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - uiInfo.redBlue ^= 1; - return qtrue; - } - return qfalse; -} - -static qboolean UI_Crosshair_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - if (key == K_MOUSE2) { - uiInfo.currentCrosshair--; - } else { - uiInfo.currentCrosshair++; - } - - if (uiInfo.currentCrosshair >= NUM_CROSSHAIRS) { - uiInfo.currentCrosshair = 0; - } else if (uiInfo.currentCrosshair < 0) { - uiInfo.currentCrosshair = NUM_CROSSHAIRS - 1; - } - trap_Cvar_Set("cg_drawCrosshair", va("%d", uiInfo.currentCrosshair)); - return qtrue; - } - return qfalse; -} - - - -static qboolean UI_SelectedPlayer_HandleKey(int flags, float *special, int key) { - if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) { - int selected; - - UI_BuildPlayerList(); - if (!uiInfo.teamLeader) { - return qfalse; - } - selected = trap_Cvar_VariableValue("cg_selectedPlayer"); - - if (key == K_MOUSE2) { - selected--; - } else { - selected++; - } - - if (selected > uiInfo.myTeamCount) { - selected = 0; - } else if (selected < 0) { - selected = uiInfo.myTeamCount; - } - - if (selected == uiInfo.myTeamCount) { - trap_Cvar_Set( "cg_selectedPlayerName", "Everyone"); - } else { - trap_Cvar_Set( "cg_selectedPlayerName", uiInfo.teamNames[selected]); - } - trap_Cvar_Set( "cg_selectedPlayer", va("%d", selected)); - } - return qfalse; -} - - -static qboolean UI_OwnerDrawHandleKey(int ownerDraw, int flags, float *special, int key) { - switch (ownerDraw) { - case UI_HANDICAP: - return UI_Handicap_HandleKey(flags, special, key); - break; - case UI_EFFECTS: - return UI_Effects_HandleKey(flags, special, key); - break; - case UI_CLANNAME: - return UI_ClanName_HandleKey(flags, special, key); - break; - case UI_GAMETYPE: - return UI_GameType_HandleKey(flags, special, key, qtrue); - break; - case UI_NETGAMETYPE: - return UI_NetGameType_HandleKey(flags, special, key); - break; - case UI_JOINGAMETYPE: - return UI_JoinGameType_HandleKey(flags, special, key); - break; - case UI_SKILL: - return UI_Skill_HandleKey(flags, special, key); - break; - case UI_BLUETEAMNAME: - return UI_TeamName_HandleKey(flags, special, key, qtrue); - break; - case UI_REDTEAMNAME: - return UI_TeamName_HandleKey(flags, special, key, qfalse); - break; - case UI_BLUETEAM1: - case UI_BLUETEAM2: - case UI_BLUETEAM3: - case UI_BLUETEAM4: - case UI_BLUETEAM5: - UI_TeamMember_HandleKey(flags, special, key, qtrue, ownerDraw - UI_BLUETEAM1 + 1); - break; - case UI_REDTEAM1: - case UI_REDTEAM2: - case UI_REDTEAM3: - case UI_REDTEAM4: - case UI_REDTEAM5: - UI_TeamMember_HandleKey(flags, special, key, qfalse, ownerDraw - UI_REDTEAM1 + 1); - break; - case UI_NETSOURCE: - UI_NetSource_HandleKey(flags, special, key); - break; - case UI_NETFILTER: - UI_NetFilter_HandleKey(flags, special, key); - break; - case UI_OPPONENT_NAME: - UI_OpponentName_HandleKey(flags, special, key); - break; - case UI_BOTNAME: - return UI_BotName_HandleKey(flags, special, key); - break; - case UI_BOTSKILL: - return UI_BotSkill_HandleKey(flags, special, key); - break; - case UI_REDBLUE: - UI_RedBlue_HandleKey(flags, special, key); - break; - case UI_CROSSHAIR: - UI_Crosshair_HandleKey(flags, special, key); - break; - case UI_SELECTEDPLAYER: - UI_SelectedPlayer_HandleKey(flags, special, key); - break; - default: - break; - } - - return qfalse; -} - - -static float UI_GetValue(int ownerDraw) { - return 0; -} - -/* -================= -UI_ServersQsortCompare -================= -*/ -static int QDECL UI_ServersQsortCompare( const void *arg1, const void *arg2 ) { - return trap_LAN_CompareServers( ui_netSource.integer, uiInfo.serverStatus.sortKey, uiInfo.serverStatus.sortDir, *(int*)arg1, *(int*)arg2); -} - - -/* -================= -UI_ServersSort -================= -*/ -void UI_ServersSort(int column, qboolean force) { - - if ( !force ) { - if ( uiInfo.serverStatus.sortKey == column ) { - return; - } - } - - uiInfo.serverStatus.sortKey = column; - qsort( &uiInfo.serverStatus.displayServers[0], uiInfo.serverStatus.numDisplayServers, sizeof(int), UI_ServersQsortCompare); -} - -/* -static void UI_StartSinglePlayer() { - int i,j, k, skill; - char buff[1024]; - i = trap_Cvar_VariableValue( "ui_currentTier" ); - if (i < 0 || i >= tierCount) { - i = 0; - } - j = trap_Cvar_VariableValue("ui_currentMap"); - if (j < 0 || j > MAPS_PER_TIER) { - j = 0; - } - - trap_Cvar_SetValue( "singleplayer", 1 ); - trap_Cvar_SetValue( "g_gametype", Com_Clamp( 0, 7, tierList[i].gameTypes[j] ) ); - trap_Cmd_ExecuteText( EXEC_APPEND, va( "wait ; wait ; map %s\n", tierList[i].maps[j] ) ); - skill = trap_Cvar_VariableValue( "g_spSkill" ); - - if (j == MAPS_PER_TIER-1) { - k = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName")); - Com_sprintf( buff, sizeof(buff), "wait ; addbot %s %i %s 250 %s\n", UI_AIFromName(teamList[k].teamMembers[0]), skill, "", teamList[k].teamMembers[0]); - } else { - k = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName")); - for (i = 0; i < PLAYERS_PER_TEAM; i++) { - Com_sprintf( buff, sizeof(buff), "wait ; addbot %s %i %s 250 %s\n", UI_AIFromName(teamList[k].teamMembers[i]), skill, "Blue", teamList[k].teamMembers[i]); - trap_Cmd_ExecuteText( EXEC_APPEND, buff ); - } - - k = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - for (i = 1; i < PLAYERS_PER_TEAM; i++) { - Com_sprintf( buff, sizeof(buff), "wait ; addbot %s %i %s 250 %s\n", UI_AIFromName(teamList[k].teamMembers[i]), skill, "Red", teamList[k].teamMembers[i]); - trap_Cmd_ExecuteText( EXEC_APPEND, buff ); - } - trap_Cmd_ExecuteText( EXEC_APPEND, "wait 5; team Red\n" ); - } - - -} -*/ - -/* -=============== -UI_LoadMods -=============== -*/ -static void UI_LoadMods() { - int numdirs; - char dirlist[2048]; - char *dirptr; - char *descptr; - int i; - int dirlen; - - uiInfo.modCount = 0; - numdirs = trap_FS_GetFileList( "$modlist", "", dirlist, sizeof(dirlist) ); - dirptr = dirlist; - for( i = 0; i < numdirs; i++ ) { - dirlen = strlen( dirptr ) + 1; - descptr = dirptr + dirlen; - uiInfo.modList[uiInfo.modCount].modName = String_Alloc(dirptr); - uiInfo.modList[uiInfo.modCount].modDescr = String_Alloc(descptr); - dirptr += dirlen + strlen(descptr) + 1; - uiInfo.modCount++; - if (uiInfo.modCount >= MAX_MODS) { - break; - } - } - -} - - -/* -=============== -UI_LoadTeams -=============== -*/ -static void UI_LoadTeams() { - char teamList[4096]; - char *teamName; - int i, len, count; - - count = trap_FS_GetFileList( "", "team", teamList, 4096 ); - - if (count) { - teamName = teamList; - for ( i = 0; i < count; i++ ) { - len = strlen( teamName ); - UI_ParseTeamInfo(teamName); - teamName += len + 1; - } - } - -} - - -/* -=============== -UI_LoadMovies -=============== -*/ -static void UI_LoadMovies() { - char movielist[4096]; - char *moviename; - int i, len; - - uiInfo.movieCount = trap_FS_GetFileList( "video", "roq", movielist, 4096 ); - - if (uiInfo.movieCount) { - if (uiInfo.movieCount > MAX_MOVIES) { - uiInfo.movieCount = MAX_MOVIES; - } - moviename = movielist; - for ( i = 0; i < uiInfo.movieCount; i++ ) { - len = strlen( moviename ); - if (!Q_stricmp(moviename + len - 4,".roq")) { - moviename[len-4] = '\0'; - } - Q_strupr(moviename); - uiInfo.movieList[i] = String_Alloc(moviename); - moviename += len + 1; - } - } - -} - - - -/* -=============== -UI_LoadDemos -=============== -*/ -static void UI_LoadDemos() { - char demolist[4096]; - char demoExt[32]; - char *demoname; - int i, len; - - Com_sprintf(demoExt, sizeof(demoExt), "dm_%d", (int)trap_Cvar_VariableValue("protocol")); - - uiInfo.demoCount = trap_FS_GetFileList( "demos", demoExt, demolist, 4096 ); - - Com_sprintf(demoExt, sizeof(demoExt), ".dm_%d", (int)trap_Cvar_VariableValue("protocol")); - - if (uiInfo.demoCount) { - if (uiInfo.demoCount > MAX_DEMOS) { - uiInfo.demoCount = MAX_DEMOS; - } - demoname = demolist; - for ( i = 0; i < uiInfo.demoCount; i++ ) { - len = strlen( demoname ); - if (!Q_stricmp(demoname + len - strlen(demoExt), demoExt)) { - demoname[len-strlen(demoExt)] = '\0'; - } - Q_strupr(demoname); - uiInfo.demoList[i] = String_Alloc(demoname); - demoname += len + 1; - } - } - -} - - -static qboolean UI_SetNextMap(int actual, int index) { - int i; - for (i = actual + 1; i < uiInfo.mapCount; i++) { - if (uiInfo.mapList[i].active) { - Menu_SetFeederSelection(NULL, FEEDER_MAPS, index + 1, "skirmish"); - return qtrue; - } - } - return qfalse; -} - - -static void UI_StartSkirmish(qboolean next) { - int i, k, g, delay, temp; - float skill; - char buff[MAX_STRING_CHARS]; - - if (next) { - int actual; - int index = trap_Cvar_VariableValue("ui_mapIndex"); - UI_MapCountByGameType(qtrue); - UI_SelectedMap(index, &actual); - if (UI_SetNextMap(actual, index)) { - } else { - UI_GameType_HandleKey(0, 0, K_MOUSE1, qfalse); - UI_MapCountByGameType(qtrue); - Menu_SetFeederSelection(NULL, FEEDER_MAPS, 0, "skirmish"); - } - } - - g = uiInfo.gameTypes[ui_gameType.integer].gtEnum; - trap_Cvar_SetValue( "g_gametype", g ); - trap_Cmd_ExecuteText( EXEC_APPEND, va( "wait ; wait ; map %s\n", uiInfo.mapList[ui_currentMap.integer].mapLoadName) ); - skill = trap_Cvar_VariableValue( "g_spSkill" ); - trap_Cvar_Set("ui_scoreMap", uiInfo.mapList[ui_currentMap.integer].mapName); - - k = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName")); - - trap_Cvar_Set("ui_singlePlayerActive", "1"); - - // set up sp overrides, will be replaced on postgame - temp = trap_Cvar_VariableValue( "capturelimit" ); - trap_Cvar_Set("ui_saveCaptureLimit", va("%i", temp)); - temp = trap_Cvar_VariableValue( "fraglimit" ); - trap_Cvar_Set("ui_saveFragLimit", va("%i", temp)); - - UI_SetCapFragLimits(qfalse); - - temp = trap_Cvar_VariableValue( "cg_drawTimer" ); - trap_Cvar_Set("ui_drawTimer", va("%i", temp)); - temp = trap_Cvar_VariableValue( "g_doWarmup" ); - trap_Cvar_Set("ui_doWarmup", va("%i", temp)); - temp = trap_Cvar_VariableValue( "g_friendlyFire" ); - trap_Cvar_Set("ui_friendlyFire", va("%i", temp)); - temp = trap_Cvar_VariableValue( "sv_maxClients" ); - trap_Cvar_Set("ui_maxClients", va("%i", temp)); - temp = trap_Cvar_VariableValue( "g_warmup" ); - trap_Cvar_Set("ui_Warmup", va("%i", temp)); - temp = trap_Cvar_VariableValue( "sv_pure" ); - trap_Cvar_Set("ui_pure", va("%i", temp)); - - trap_Cvar_Set("cg_cameraOrbit", "0"); - trap_Cvar_Set("cg_thirdPerson", "0"); - trap_Cvar_Set("cg_drawTimer", "1"); - trap_Cvar_Set("g_doWarmup", "1"); - trap_Cvar_Set("g_warmup", "15"); - trap_Cvar_Set("sv_pure", "0"); - trap_Cvar_Set("g_friendlyFire", "0"); - trap_Cvar_Set("g_redTeam", UI_Cvar_VariableString("ui_teamName")); - trap_Cvar_Set("g_blueTeam", UI_Cvar_VariableString("ui_opponentName")); - - if (trap_Cvar_VariableValue("ui_recordSPDemo")) { - Com_sprintf(buff, MAX_STRING_CHARS, "%s_%i", uiInfo.mapList[ui_currentMap.integer].mapLoadName, g); - trap_Cvar_Set("ui_recordSPDemoName", buff); - } - - delay = 500; - - if (g == GT_TOURNAMENT) { - trap_Cvar_Set("sv_maxClients", "2"); - Com_sprintf( buff, sizeof(buff), "wait ; addbot %s %f "", %i \n", uiInfo.mapList[ui_currentMap.integer].opponentName, skill, delay); - trap_Cmd_ExecuteText( EXEC_APPEND, buff ); - } else { - temp = uiInfo.mapList[ui_currentMap.integer].teamMembers * 2; - trap_Cvar_Set("sv_maxClients", va("%d", temp)); - for (i =0; i < uiInfo.mapList[ui_currentMap.integer].teamMembers; i++) { - Com_sprintf( buff, sizeof(buff), "addbot %s %f %s %i %s\n", UI_AIFromName(uiInfo.teamList[k].teamMembers[i]), skill, (g == GT_FFA) ? "" : "Blue", delay, uiInfo.teamList[k].teamMembers[i]); - trap_Cmd_ExecuteText( EXEC_APPEND, buff ); - delay += 500; - } - k = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - for (i =0; i < uiInfo.mapList[ui_currentMap.integer].teamMembers-1; i++) { - Com_sprintf( buff, sizeof(buff), "addbot %s %f %s %i %s\n", UI_AIFromName(uiInfo.teamList[k].teamMembers[i]), skill, (g == GT_FFA) ? "" : "Red", delay, uiInfo.teamList[k].teamMembers[i]); - trap_Cmd_ExecuteText( EXEC_APPEND, buff ); - delay += 500; - } - } - if (g >= GT_TEAM ) { - trap_Cmd_ExecuteText( EXEC_APPEND, "wait 5; team Red\n" ); - } -} - -static void UI_Update(const char *name) { - int val = trap_Cvar_VariableValue(name); - - if (Q_stricmp(name, "ui_SetName") == 0) { - trap_Cvar_Set( "name", UI_Cvar_VariableString("ui_Name")); - } else if (Q_stricmp(name, "ui_setRate") == 0) { - float rate = trap_Cvar_VariableValue("rate"); - if (rate >= 5000) { - trap_Cvar_Set("cl_maxpackets", "30"); - trap_Cvar_Set("cl_packetdup", "1"); - } else if (rate >= 4000) { - trap_Cvar_Set("cl_maxpackets", "15"); - trap_Cvar_Set("cl_packetdup", "2"); // favor less prediction errors when there's packet loss - } else { - trap_Cvar_Set("cl_maxpackets", "15"); - trap_Cvar_Set("cl_packetdup", "1"); // favor lower bandwidth - } - } else if (Q_stricmp(name, "ui_GetName") == 0) { - trap_Cvar_Set( "ui_Name", UI_Cvar_VariableString("name")); - } else if (Q_stricmp(name, "r_colorbits") == 0) { - switch (val) { - case 0: - trap_Cvar_SetValue( "r_depthbits", 0 ); - trap_Cvar_SetValue( "r_stencilbits", 0 ); - break; - case 16: - trap_Cvar_SetValue( "r_depthbits", 16 ); - trap_Cvar_SetValue( "r_stencilbits", 0 ); - break; - case 32: - trap_Cvar_SetValue( "r_depthbits", 24 ); - break; - } - } else if (Q_stricmp(name, "r_lodbias") == 0) { - switch (val) { - case 0: - trap_Cvar_SetValue( "r_subdivisions", 4 ); - break; - case 1: - trap_Cvar_SetValue( "r_subdivisions", 12 ); - break; - case 2: - trap_Cvar_SetValue( "r_subdivisions", 20 ); - break; - } - } else if (Q_stricmp(name, "ui_glCustom") == 0) { - switch (val) { - case 0: // high quality - trap_Cvar_SetValue( "r_fullScreen", 1 ); - trap_Cvar_SetValue( "r_subdivisions", 4 ); - trap_Cvar_SetValue( "r_vertexlight", 0 ); - trap_Cvar_SetValue( "r_lodbias", 0 ); - trap_Cvar_SetValue( "r_colorbits", 32 ); - trap_Cvar_SetValue( "r_depthbits", 24 ); - trap_Cvar_SetValue( "r_picmip", 0 ); - trap_Cvar_SetValue( "r_mode", 4 ); - trap_Cvar_SetValue( "r_texturebits", 32 ); - trap_Cvar_SetValue( "r_fastSky", 0 ); - trap_Cvar_SetValue( "r_inGameVideo", 1 ); - trap_Cvar_SetValue( "cg_shadows", 1 ); - trap_Cvar_SetValue( "cg_brassTime", 2500 ); - trap_Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_LINEAR" ); - break; - case 1: // normal - trap_Cvar_SetValue( "r_fullScreen", 1 ); - trap_Cvar_SetValue( "r_subdivisions", 12 ); - trap_Cvar_SetValue( "r_vertexlight", 0 ); - trap_Cvar_SetValue( "r_lodbias", 0 ); - trap_Cvar_SetValue( "r_colorbits", 0 ); - trap_Cvar_SetValue( "r_depthbits", 24 ); - trap_Cvar_SetValue( "r_picmip", 1 ); - trap_Cvar_SetValue( "r_mode", 3 ); - trap_Cvar_SetValue( "r_texturebits", 0 ); - trap_Cvar_SetValue( "r_fastSky", 0 ); - trap_Cvar_SetValue( "r_inGameVideo", 1 ); - trap_Cvar_SetValue( "cg_brassTime", 2500 ); - trap_Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_LINEAR" ); - trap_Cvar_SetValue( "cg_shadows", 0 ); - break; - case 2: // fast - trap_Cvar_SetValue( "r_fullScreen", 1 ); - trap_Cvar_SetValue( "r_subdivisions", 8 ); - trap_Cvar_SetValue( "r_vertexlight", 0 ); - trap_Cvar_SetValue( "r_lodbias", 1 ); - trap_Cvar_SetValue( "r_colorbits", 0 ); - trap_Cvar_SetValue( "r_depthbits", 0 ); - trap_Cvar_SetValue( "r_picmip", 1 ); - trap_Cvar_SetValue( "r_mode", 3 ); - trap_Cvar_SetValue( "r_texturebits", 0 ); - trap_Cvar_SetValue( "cg_shadows", 0 ); - trap_Cvar_SetValue( "r_fastSky", 1 ); - trap_Cvar_SetValue( "r_inGameVideo", 0 ); - trap_Cvar_SetValue( "cg_brassTime", 0 ); - trap_Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_NEAREST" ); - break; - case 3: // fastest - trap_Cvar_SetValue( "r_fullScreen", 1 ); - trap_Cvar_SetValue( "r_subdivisions", 20 ); - trap_Cvar_SetValue( "r_vertexlight", 1 ); - trap_Cvar_SetValue( "r_lodbias", 2 ); - trap_Cvar_SetValue( "r_colorbits", 16 ); - trap_Cvar_SetValue( "r_depthbits", 16 ); - trap_Cvar_SetValue( "r_mode", 3 ); - trap_Cvar_SetValue( "r_picmip", 2 ); - trap_Cvar_SetValue( "r_texturebits", 16 ); - trap_Cvar_SetValue( "cg_shadows", 0 ); - trap_Cvar_SetValue( "cg_brassTime", 0 ); - trap_Cvar_SetValue( "r_fastSky", 1 ); - trap_Cvar_SetValue( "r_inGameVideo", 0 ); - trap_Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_NEAREST" ); - break; - } - } else if (Q_stricmp(name, "ui_mousePitch") == 0) { - if (val == 0) { - trap_Cvar_SetValue( "m_pitch", 0.022f ); - } else { - trap_Cvar_SetValue( "m_pitch", -0.022f ); - } - } -} - -static void UI_RunMenuScript(char **args) { - const char *name, *name2; - char buff[1024]; - - if (String_Parse(args, &name)) { - if (Q_stricmp(name, "StartServer") == 0) { - int i, clients, oldclients; - float skill; - trap_Cvar_Set("cg_thirdPerson", "0"); - trap_Cvar_Set("cg_cameraOrbit", "0"); - trap_Cvar_Set("ui_singlePlayerActive", "0"); - trap_Cvar_SetValue( "dedicated", Com_Clamp( 0, 2, ui_dedicated.integer ) ); - trap_Cvar_SetValue( "g_gametype", Com_Clamp( 0, 8, uiInfo.gameTypes[ui_netGameType.integer].gtEnum ) ); - trap_Cvar_Set("g_redTeam", UI_Cvar_VariableString("ui_teamName")); - trap_Cvar_Set("g_blueTeam", UI_Cvar_VariableString("ui_opponentName")); - trap_Cmd_ExecuteText( EXEC_APPEND, va( "wait ; wait ; map %s\n", uiInfo.mapList[ui_currentNetMap.integer].mapLoadName ) ); - skill = trap_Cvar_VariableValue( "g_spSkill" ); - // set max clients based on spots - oldclients = trap_Cvar_VariableValue( "sv_maxClients" ); - clients = 0; - for (i = 0; i < PLAYERS_PER_TEAM; i++) { - int bot = trap_Cvar_VariableValue( va("ui_blueteam%i", i+1)); - if (bot >= 0) { - clients++; - } - bot = trap_Cvar_VariableValue( va("ui_redteam%i", i+1)); - if (bot >= 0) { - clients++; - } - } - if (clients == 0) { - clients = 8; - } - - if (oldclients > clients) { - clients = oldclients; - } - - trap_Cvar_Set("sv_maxClients", va("%d",clients)); - - for (i = 0; i < PLAYERS_PER_TEAM; i++) { - int bot = trap_Cvar_VariableValue( va("ui_blueteam%i", i+1)); - if (bot > 1) { - if (ui_actualNetGameType.integer >= GT_TEAM) { - Com_sprintf( buff, sizeof(buff), "addbot %s %f %s\n", uiInfo.characterList[bot-2].name, skill, "Blue"); - } else { - Com_sprintf( buff, sizeof(buff), "addbot %s %f \n", UI_GetBotNameByNumber(bot-2), skill); - } - trap_Cmd_ExecuteText( EXEC_APPEND, buff ); - } - bot = trap_Cvar_VariableValue( va("ui_redteam%i", i+1)); - if (bot > 1) { - if (ui_actualNetGameType.integer >= GT_TEAM) { - Com_sprintf( buff, sizeof(buff), "addbot %s %f %s\n", uiInfo.characterList[bot-2].name, skill, "Red"); - } else { - Com_sprintf( buff, sizeof(buff), "addbot %s %f \n", UI_GetBotNameByNumber(bot-2), skill); - } - trap_Cmd_ExecuteText( EXEC_APPEND, buff ); - } - } - } else if (Q_stricmp(name, "updateSPMenu") == 0) { - UI_SetCapFragLimits(qtrue); - UI_MapCountByGameType(qtrue); - ui_mapIndex.integer = UI_GetIndexFromSelection(ui_currentMap.integer); - trap_Cvar_Set("ui_mapIndex", va("%d", ui_mapIndex.integer)); - Menu_SetFeederSelection(NULL, FEEDER_MAPS, ui_mapIndex.integer, "skirmish"); - UI_GameType_HandleKey(0, 0, K_MOUSE1, qfalse); - UI_GameType_HandleKey(0, 0, K_MOUSE2, qfalse); - } else if (Q_stricmp(name, "resetDefaults") == 0) { - trap_Cmd_ExecuteText( EXEC_APPEND, "exec default.cfg\n"); - trap_Cmd_ExecuteText( EXEC_APPEND, "cvar_restart\n"); - Controls_SetDefaults(); - trap_Cvar_Set("com_introPlayed", "1" ); - trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart\n" ); - } else if (Q_stricmp(name, "getCDKey") == 0) { - char out[17]; - trap_GetCDKey(buff, 17); - trap_Cvar_Set("cdkey1", ""); - trap_Cvar_Set("cdkey2", ""); - trap_Cvar_Set("cdkey3", ""); - trap_Cvar_Set("cdkey4", ""); - if (strlen(buff) == CDKEY_LEN) { - Q_strncpyz(out, buff, 5); - trap_Cvar_Set("cdkey1", out); - Q_strncpyz(out, buff + 4, 5); - trap_Cvar_Set("cdkey2", out); - Q_strncpyz(out, buff + 8, 5); - trap_Cvar_Set("cdkey3", out); - Q_strncpyz(out, buff + 12, 5); - trap_Cvar_Set("cdkey4", out); - } - - } else if (Q_stricmp(name, "verifyCDKey") == 0) { - buff[0] = '\0'; - Q_strcat(buff, 1024, UI_Cvar_VariableString("cdkey1")); - Q_strcat(buff, 1024, UI_Cvar_VariableString("cdkey2")); - Q_strcat(buff, 1024, UI_Cvar_VariableString("cdkey3")); - Q_strcat(buff, 1024, UI_Cvar_VariableString("cdkey4")); - trap_Cvar_Set("cdkey", buff); - if (trap_VerifyCDKey(buff, UI_Cvar_VariableString("cdkeychecksum"))) { - trap_Cvar_Set("ui_cdkeyvalid", "CD Key Appears to be valid."); - trap_SetCDKey(buff); - } else { - trap_Cvar_Set("ui_cdkeyvalid", "CD Key does not appear to be valid."); - } - } else if (Q_stricmp(name, "loadArenas") == 0) { - UI_LoadArenas(); - UI_MapCountByGameType(qfalse); - Menu_SetFeederSelection(NULL, FEEDER_ALLMAPS, 0, "createserver"); - } else if (Q_stricmp(name, "saveControls") == 0) { - Controls_SetConfig(qtrue); - } else if (Q_stricmp(name, "loadControls") == 0) { - Controls_GetConfig(); - } else if (Q_stricmp(name, "clearError") == 0) { - trap_Cvar_Set("com_errorMessage", ""); - } else if (Q_stricmp(name, "loadGameInfo") == 0) { -#ifdef PRE_RELEASE_TADEMO - UI_ParseGameInfo("demogameinfo.txt"); -#else - UI_ParseGameInfo("gameinfo.txt"); -#endif - UI_LoadBestScores(uiInfo.mapList[ui_currentMap.integer].mapLoadName, uiInfo.gameTypes[ui_gameType.integer].gtEnum); - } else if (Q_stricmp(name, "resetScores") == 0) { - UI_ClearScores(); - } else if (Q_stricmp(name, "RefreshServers") == 0) { - UI_StartServerRefresh(qtrue); - UI_BuildServerDisplayList(qtrue); - } else if (Q_stricmp(name, "RefreshFilter") == 0) { - UI_StartServerRefresh(qfalse); - UI_BuildServerDisplayList(qtrue); - } else if (Q_stricmp(name, "RunSPDemo") == 0) { - if (uiInfo.demoAvailable) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("demo %s_%i\n", uiInfo.mapList[ui_currentMap.integer].mapLoadName, uiInfo.gameTypes[ui_gameType.integer].gtEnum)); - } - } else if (Q_stricmp(name, "LoadDemos") == 0) { - UI_LoadDemos(); - } else if (Q_stricmp(name, "LoadMovies") == 0) { - UI_LoadMovies(); - } else if (Q_stricmp(name, "LoadMods") == 0) { - UI_LoadMods(); - } else if (Q_stricmp(name, "playMovie") == 0) { - if (uiInfo.previewMovie >= 0) { - trap_CIN_StopCinematic(uiInfo.previewMovie); - } - trap_Cmd_ExecuteText( EXEC_APPEND, va("cinematic %s.roq 2\n", uiInfo.movieList[uiInfo.movieIndex])); - } else if (Q_stricmp(name, "RunMod") == 0) { - trap_Cvar_Set( "fs_game", uiInfo.modList[uiInfo.modIndex].modName); - trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" ); - } else if (Q_stricmp(name, "RunDemo") == 0) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("demo %s\n", uiInfo.demoList[uiInfo.demoIndex])); - } else if (Q_stricmp(name, "Quake3") == 0) { - trap_Cvar_Set( "fs_game", ""); - trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" ); - } else if (Q_stricmp(name, "closeJoin") == 0) { - if (uiInfo.serverStatus.refreshActive) { - UI_StopServerRefresh(); - uiInfo.serverStatus.nextDisplayRefresh = 0; - uiInfo.nextServerStatusRefresh = 0; - uiInfo.nextFindPlayerRefresh = 0; - UI_BuildServerDisplayList(qtrue); - } else { - Menus_CloseByName("joinserver"); - Menus_OpenByName("main"); - } - } else if (Q_stricmp(name, "StopRefresh") == 0) { - UI_StopServerRefresh(); - uiInfo.serverStatus.nextDisplayRefresh = 0; - uiInfo.nextServerStatusRefresh = 0; - uiInfo.nextFindPlayerRefresh = 0; - } else if (Q_stricmp(name, "UpdateFilter") == 0) { - if (ui_netSource.integer == AS_LOCAL) { - UI_StartServerRefresh(qtrue); - } - UI_BuildServerDisplayList(qtrue); - UI_FeederSelection(FEEDER_SERVERS, 0); - } else if (Q_stricmp(name, "ServerStatus") == 0) { - trap_LAN_GetServerAddressString(ui_netSource.integer, uiInfo.serverStatus.displayServers[uiInfo.serverStatus.currentServer], uiInfo.serverStatusAddress, sizeof(uiInfo.serverStatusAddress)); - UI_BuildServerStatus(qtrue); - } else if (Q_stricmp(name, "FoundPlayerServerStatus") == 0) { - Q_strncpyz(uiInfo.serverStatusAddress, uiInfo.foundPlayerServerAddresses[uiInfo.currentFoundPlayerServer], sizeof(uiInfo.serverStatusAddress)); - UI_BuildServerStatus(qtrue); - Menu_SetFeederSelection(NULL, FEEDER_FINDPLAYER, 0, NULL); - } else if (Q_stricmp(name, "FindPlayer") == 0) { - UI_BuildFindPlayerList(qtrue); - // clear the displayed server status info - uiInfo.serverStatusInfo.numLines = 0; - Menu_SetFeederSelection(NULL, FEEDER_FINDPLAYER, 0, NULL); - } else if (Q_stricmp(name, "JoinServer") == 0) { - trap_Cvar_Set("cg_thirdPerson", "0"); - trap_Cvar_Set("cg_cameraOrbit", "0"); - trap_Cvar_Set("ui_singlePlayerActive", "0"); - if (uiInfo.serverStatus.currentServer >= 0 && uiInfo.serverStatus.currentServer < uiInfo.serverStatus.numDisplayServers) { - trap_LAN_GetServerAddressString(ui_netSource.integer, uiInfo.serverStatus.displayServers[uiInfo.serverStatus.currentServer], buff, 1024); - trap_Cmd_ExecuteText( EXEC_APPEND, va( "connect %s\n", buff ) ); - } - } else if (Q_stricmp(name, "FoundPlayerJoinServer") == 0) { - trap_Cvar_Set("ui_singlePlayerActive", "0"); - if (uiInfo.currentFoundPlayerServer >= 0 && uiInfo.currentFoundPlayerServer < uiInfo.numFoundPlayerServers) { - trap_Cmd_ExecuteText( EXEC_APPEND, va( "connect %s\n", uiInfo.foundPlayerServerAddresses[uiInfo.currentFoundPlayerServer] ) ); - } - } else if (Q_stricmp(name, "Quit") == 0) { - trap_Cvar_Set("ui_singlePlayerActive", "0"); - trap_Cmd_ExecuteText( EXEC_NOW, "quit"); - } else if (Q_stricmp(name, "Controls") == 0) { - trap_Cvar_Set( "cl_paused", "1" ); - trap_Key_SetCatcher( KEYCATCH_UI ); - Menus_CloseAll(); - Menus_ActivateByName("setup_menu2"); - } else if (Q_stricmp(name, "Leave") == 0) { - trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect\n" ); - trap_Key_SetCatcher( KEYCATCH_UI ); - Menus_CloseAll(); - Menus_ActivateByName("main"); - } else if (Q_stricmp(name, "ServerSort") == 0) { - int sortColumn; - if (Int_Parse(args, &sortColumn)) { - // if same column we're already sorting on then flip the direction - if (sortColumn == uiInfo.serverStatus.sortKey) { - uiInfo.serverStatus.sortDir = !uiInfo.serverStatus.sortDir; - } - // make sure we sort again - UI_ServersSort(sortColumn, qtrue); - } - } else if (Q_stricmp(name, "nextSkirmish") == 0) { - UI_StartSkirmish(qtrue); - } else if (Q_stricmp(name, "SkirmishStart") == 0) { - UI_StartSkirmish(qfalse); - } else if (Q_stricmp(name, "closeingame") == 0) { - trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI ); - trap_Key_ClearStates(); - trap_Cvar_Set( "cl_paused", "0" ); - Menus_CloseAll(); - } else if (Q_stricmp(name, "voteMap") == 0) { - if (ui_currentNetMap.integer >=0 && ui_currentNetMap.integer < uiInfo.mapCount) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("callvote map %s\n",uiInfo.mapList[ui_currentNetMap.integer].mapLoadName) ); - } - } else if (Q_stricmp(name, "voteKick") == 0) { - if (uiInfo.playerIndex >= 0 && uiInfo.playerIndex < uiInfo.playerCount) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("callvote kick %s\n",uiInfo.playerNames[uiInfo.playerIndex]) ); - } - } else if (Q_stricmp(name, "voteGame") == 0) { - if (ui_netGameType.integer >= 0 && ui_netGameType.integer < uiInfo.numGameTypes) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("callvote g_gametype %i\n",uiInfo.gameTypes[ui_netGameType.integer].gtEnum) ); - } - } else if (Q_stricmp(name, "voteLeader") == 0) { - if (uiInfo.teamIndex >= 0 && uiInfo.teamIndex < uiInfo.myTeamCount) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("callteamvote leader %s\n",uiInfo.teamNames[uiInfo.teamIndex]) ); - } - } else if (Q_stricmp(name, "addBot") == 0) { - if (trap_Cvar_VariableValue("g_gametype") >= GT_TEAM) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("addbot %s %i %s\n", uiInfo.characterList[uiInfo.botIndex].name, uiInfo.skillIndex+1, (uiInfo.redBlue == 0) ? "Red" : "Blue") ); - } else { - trap_Cmd_ExecuteText( EXEC_APPEND, va("addbot %s %i %s\n", UI_GetBotNameByNumber(uiInfo.botIndex), uiInfo.skillIndex+1, (uiInfo.redBlue == 0) ? "Red" : "Blue") ); - } - } else if (Q_stricmp(name, "addFavorite") == 0) { - if (ui_netSource.integer != AS_FAVORITES) { - char name[MAX_NAME_LENGTH]; - char addr[MAX_NAME_LENGTH]; - int res; - - trap_LAN_GetServerInfo(ui_netSource.integer, uiInfo.serverStatus.displayServers[uiInfo.serverStatus.currentServer], buff, MAX_STRING_CHARS); - name[0] = addr[0] = '\0'; - Q_strncpyz(name, Info_ValueForKey(buff, "hostname"), MAX_NAME_LENGTH); - Q_strncpyz(addr, Info_ValueForKey(buff, "addr"), MAX_NAME_LENGTH); - if (strlen(name) > 0 && strlen(addr) > 0) { - res = trap_LAN_AddServer(AS_FAVORITES, name, addr); - if (res == 0) { - // server already in the list - Com_Printf("Favorite already in list\n"); - } - else if (res == -1) { - // list full - Com_Printf("Favorite list full\n"); - } - else { - // successfully added - Com_Printf("Added favorite server %s\n", addr); - } - } - } - } else if (Q_stricmp(name, "deleteFavorite") == 0) { - if (ui_netSource.integer == AS_FAVORITES) { - char addr[MAX_NAME_LENGTH]; - trap_LAN_GetServerInfo(ui_netSource.integer, uiInfo.serverStatus.displayServers[uiInfo.serverStatus.currentServer], buff, MAX_STRING_CHARS); - addr[0] = '\0'; - Q_strncpyz(addr, Info_ValueForKey(buff, "addr"), MAX_NAME_LENGTH); - if (strlen(addr) > 0) { - trap_LAN_RemoveServer(AS_FAVORITES, addr); - } - } - } else if (Q_stricmp(name, "createFavorite") == 0) { - if (ui_netSource.integer == AS_FAVORITES) { - char name[MAX_NAME_LENGTH]; - char addr[MAX_NAME_LENGTH]; - int res; - - name[0] = addr[0] = '\0'; - Q_strncpyz(name, UI_Cvar_VariableString("ui_favoriteName"), MAX_NAME_LENGTH); - Q_strncpyz(addr, UI_Cvar_VariableString("ui_favoriteAddress"), MAX_NAME_LENGTH); - if (strlen(name) > 0 && strlen(addr) > 0) { - res = trap_LAN_AddServer(AS_FAVORITES, name, addr); - if (res == 0) { - // server already in the list - Com_Printf("Favorite already in list\n"); - } - else if (res == -1) { - // list full - Com_Printf("Favorite list full\n"); - } - else { - // successfully added - Com_Printf("Added favorite server %s\n", addr); - } - } - } - } else if (Q_stricmp(name, "orders") == 0) { - const char *orders; - if (String_Parse(args, &orders)) { - int selectedPlayer = trap_Cvar_VariableValue("cg_selectedPlayer"); - if (selectedPlayer < uiInfo.myTeamCount) { - strcpy(buff, orders); - trap_Cmd_ExecuteText( EXEC_APPEND, va(buff, uiInfo.teamClientNums[selectedPlayer]) ); - trap_Cmd_ExecuteText( EXEC_APPEND, "\n" ); - } else { - int i; - for (i = 0; i < uiInfo.myTeamCount; i++) { - if (Q_stricmp(UI_Cvar_VariableString("name"), uiInfo.teamNames[i]) == 0) { - continue; - } - strcpy(buff, orders); - trap_Cmd_ExecuteText( EXEC_APPEND, va(buff, uiInfo.teamNames[i]) ); - trap_Cmd_ExecuteText( EXEC_APPEND, "\n" ); - } - } - trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI ); - trap_Key_ClearStates(); - trap_Cvar_Set( "cl_paused", "0" ); - Menus_CloseAll(); - } - } else if (Q_stricmp(name, "voiceOrdersTeam") == 0) { - const char *orders; - if (String_Parse(args, &orders)) { - int selectedPlayer = trap_Cvar_VariableValue("cg_selectedPlayer"); - if (selectedPlayer == uiInfo.myTeamCount) { - trap_Cmd_ExecuteText( EXEC_APPEND, orders ); - trap_Cmd_ExecuteText( EXEC_APPEND, "\n" ); - } - trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI ); - trap_Key_ClearStates(); - trap_Cvar_Set( "cl_paused", "0" ); - Menus_CloseAll(); - } - } else if (Q_stricmp(name, "voiceOrders") == 0) { - const char *orders; - if (String_Parse(args, &orders)) { - int selectedPlayer = trap_Cvar_VariableValue("cg_selectedPlayer"); - if (selectedPlayer < uiInfo.myTeamCount) { - strcpy(buff, orders); - trap_Cmd_ExecuteText( EXEC_APPEND, va(buff, uiInfo.teamClientNums[selectedPlayer]) ); - trap_Cmd_ExecuteText( EXEC_APPEND, "\n" ); - } - trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI ); - trap_Key_ClearStates(); - trap_Cvar_Set( "cl_paused", "0" ); - Menus_CloseAll(); - } - } else if (Q_stricmp(name, "glCustom") == 0) { - trap_Cvar_Set("ui_glCustom", "4"); - } else if (Q_stricmp(name, "update") == 0) { - if (String_Parse(args, &name2)) { - UI_Update(name2); - } - } else if (Q_stricmp(name, "setPbClStatus") == 0) { - int stat; - if ( Int_Parse( args, &stat ) ) - trap_SetPbClStatus( stat ); - } - else { - Com_Printf("unknown UI script %s\n", name); - } - } -} - -static void UI_GetTeamColor(vec4_t *color) { -} - -/* -================== -UI_MapCountByGameType -================== -*/ -static int UI_MapCountByGameType(qboolean singlePlayer) { - int i, c, game; - c = 0; - game = singlePlayer ? uiInfo.gameTypes[ui_gameType.integer].gtEnum : uiInfo.gameTypes[ui_netGameType.integer].gtEnum; - if (game == GT_SINGLE_PLAYER) { - game++; - } - if (game == GT_TEAM) { - game = GT_FFA; - } - - for (i = 0; i < uiInfo.mapCount; i++) { - uiInfo.mapList[i].active = qfalse; - if ( uiInfo.mapList[i].typeBits & (1 << game)) { - if (singlePlayer) { - if (!(uiInfo.mapList[i].typeBits & (1 << GT_SINGLE_PLAYER))) { - continue; - } - } - c++; - uiInfo.mapList[i].active = qtrue; - } - } - return c; -} - -qboolean UI_hasSkinForBase(const char *base, const char *team) { - char test[1024]; - - Com_sprintf( test, sizeof( test ), "models/players/%s/%s/lower_default.skin", base, team ); - - if (trap_FS_FOpenFile(test, 0, FS_READ)) { - return qtrue; - } - Com_sprintf( test, sizeof( test ), "models/players/characters/%s/%s/lower_default.skin", base, team ); - - if (trap_FS_FOpenFile(test, 0, FS_READ)) { - return qtrue; - } - return qfalse; -} - -/* -================== -UI_MapCountByTeam -================== -*/ -static int UI_HeadCountByTeam() { - static int init = 0; - int i, j, k, c, tIndex; - - c = 0; - if (!init) { - for (i = 0; i < uiInfo.characterCount; i++) { - uiInfo.characterList[i].reference = 0; - for (j = 0; j < uiInfo.teamCount; j++) { - if (UI_hasSkinForBase(uiInfo.characterList[i].base, uiInfo.teamList[j].teamName)) { - uiInfo.characterList[i].reference |= (1< uiInfo.serverStatus.numDisplayServers ) { - return; - } - // - uiInfo.serverStatus.numDisplayServers++; - for (i = uiInfo.serverStatus.numDisplayServers; i > position; i--) { - uiInfo.serverStatus.displayServers[i] = uiInfo.serverStatus.displayServers[i-1]; - } - uiInfo.serverStatus.displayServers[position] = num; -} - -/* -================== -UI_RemoveServerFromDisplayList -================== -*/ -static void UI_RemoveServerFromDisplayList(int num) { - int i, j; - - for (i = 0; i < uiInfo.serverStatus.numDisplayServers; i++) { - if (uiInfo.serverStatus.displayServers[i] == num) { - uiInfo.serverStatus.numDisplayServers--; - for (j = i; j < uiInfo.serverStatus.numDisplayServers; j++) { - uiInfo.serverStatus.displayServers[j] = uiInfo.serverStatus.displayServers[j+1]; - } - return; - } - } -} - -/* -================== -UI_BinaryServerInsertion -================== -*/ -static void UI_BinaryServerInsertion(int num) { - int mid, offset, res, len; - - // use binary search to insert server - len = uiInfo.serverStatus.numDisplayServers; - mid = len; - offset = 0; - res = 0; - while(mid > 0) { - mid = len >> 1; - // - res = trap_LAN_CompareServers( ui_netSource.integer, uiInfo.serverStatus.sortKey, - uiInfo.serverStatus.sortDir, num, uiInfo.serverStatus.displayServers[offset+mid]); - // if equal - if (res == 0) { - UI_InsertServerIntoDisplayList(num, offset+mid); - return; - } - // if larger - else if (res == 1) { - offset += mid; - len -= mid; - } - // if smaller - else { - len -= mid; - } - } - if (res == 1) { - offset++; - } - UI_InsertServerIntoDisplayList(num, offset); -} - -/* -================== -UI_BuildServerDisplayList -================== -*/ -static void UI_BuildServerDisplayList(qboolean force) { - int i, count, clients, maxClients, ping, game, len, visible; - char info[MAX_STRING_CHARS]; -// qboolean startRefresh = qtrue; TTimo: unused - static int numinvisible; - - if (!(force || uiInfo.uiDC.realTime > uiInfo.serverStatus.nextDisplayRefresh)) { - return; - } - // if we shouldn't reset - if ( force == 2 ) { - force = 0; - } - - // do motd updates here too - trap_Cvar_VariableStringBuffer( "cl_motdString", uiInfo.serverStatus.motd, sizeof(uiInfo.serverStatus.motd) ); - len = strlen(uiInfo.serverStatus.motd); - if (len == 0) { - strcpy(uiInfo.serverStatus.motd, "Welcome to Team Arena!"); - len = strlen(uiInfo.serverStatus.motd); - } - if (len != uiInfo.serverStatus.motdLen) { - uiInfo.serverStatus.motdLen = len; - uiInfo.serverStatus.motdWidth = -1; - } - - if (force) { - numinvisible = 0; - // clear number of displayed servers - uiInfo.serverStatus.numDisplayServers = 0; - uiInfo.serverStatus.numPlayersOnServers = 0; - // set list box index to zero - Menu_SetFeederSelection(NULL, FEEDER_SERVERS, 0, NULL); - // mark all servers as visible so we store ping updates for them - trap_LAN_MarkServerVisible(ui_netSource.integer, -1, qtrue); - } - - // get the server count (comes from the master) - count = trap_LAN_GetServerCount(ui_netSource.integer); - if (count == -1 || (ui_netSource.integer == AS_LOCAL && count == 0) ) { - // still waiting on a response from the master - uiInfo.serverStatus.numDisplayServers = 0; - uiInfo.serverStatus.numPlayersOnServers = 0; - uiInfo.serverStatus.nextDisplayRefresh = uiInfo.uiDC.realTime + 500; - return; - } - - visible = qfalse; - for (i = 0; i < count; i++) { - // if we already got info for this server - if (!trap_LAN_ServerIsVisible(ui_netSource.integer, i)) { - continue; - } - visible = qtrue; - // get the ping for this server - ping = trap_LAN_GetServerPing(ui_netSource.integer, i); - if (ping > 0 || ui_netSource.integer == AS_FAVORITES) { - - trap_LAN_GetServerInfo(ui_netSource.integer, i, info, MAX_STRING_CHARS); - - clients = atoi(Info_ValueForKey(info, "clients")); - uiInfo.serverStatus.numPlayersOnServers += clients; - - if (ui_browserShowEmpty.integer == 0) { - if (clients == 0) { - trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse); - continue; - } - } - - if (ui_browserShowFull.integer == 0) { - maxClients = atoi(Info_ValueForKey(info, "sv_maxclients")); - if (clients == maxClients) { - trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse); - continue; - } - } - - if (uiInfo.joinGameTypes[ui_joinGameType.integer].gtEnum != -1) { - game = atoi(Info_ValueForKey(info, "gametype")); - if (game != uiInfo.joinGameTypes[ui_joinGameType.integer].gtEnum) { - trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse); - continue; - } - } - - if (ui_serverFilterType.integer > 0) { - if (Q_stricmp(Info_ValueForKey(info, "game"), serverFilters[ui_serverFilterType.integer].basedir) != 0) { - trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse); - continue; - } - } - // make sure we never add a favorite server twice - if (ui_netSource.integer == AS_FAVORITES) { - UI_RemoveServerFromDisplayList(i); - } - // insert the server into the list - UI_BinaryServerInsertion(i); - // done with this server - if (ping > 0) { - trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse); - numinvisible++; - } - } - } - - uiInfo.serverStatus.refreshtime = uiInfo.uiDC.realTime; - - // if there were no servers visible for ping updates - if (!visible) { -// UI_StopServerRefresh(); -// uiInfo.serverStatus.nextDisplayRefresh = 0; - } -} - -typedef struct -{ - char *name, *altName; -} serverStatusCvar_t; - -serverStatusCvar_t serverStatusCvars[] = { - {"sv_hostname", "Name"}, - {"Address", ""}, - {"gamename", "Game name"}, - {"g_gametype", "Game type"}, - {"mapname", "Map"}, - {"version", ""}, - {"protocol", ""}, - {"timelimit", ""}, - {"fraglimit", ""}, - {NULL, NULL} -}; - -/* -================== -UI_SortServerStatusInfo -================== -*/ -static void UI_SortServerStatusInfo( serverStatusInfo_t *info ) { - int i, j, index; - char *tmp1, *tmp2; - - // FIXME: if "gamename" == "baseq3" or "missionpack" then - // replace the gametype number by FFA, CTF etc. - // - index = 0; - for (i = 0; serverStatusCvars[i].name; i++) { - for (j = 0; j < info->numLines; j++) { - if ( !info->lines[j][1] || info->lines[j][1][0] ) { - continue; - } - if ( !Q_stricmp(serverStatusCvars[i].name, info->lines[j][0]) ) { - // swap lines - tmp1 = info->lines[index][0]; - tmp2 = info->lines[index][3]; - info->lines[index][0] = info->lines[j][0]; - info->lines[index][3] = info->lines[j][3]; - info->lines[j][0] = tmp1; - info->lines[j][3] = tmp2; - // - if ( strlen(serverStatusCvars[i].altName) ) { - info->lines[index][0] = serverStatusCvars[i].altName; - } - index++; - } - } - } -} - -/* -================== -UI_GetServerStatusInfo -================== -*/ -static int UI_GetServerStatusInfo( const char *serverAddress, serverStatusInfo_t *info ) { - char *p, *score, *ping, *name; - int i, len; - - if (!info) { - trap_LAN_ServerStatus( serverAddress, NULL, 0); - return qfalse; - } - memset(info, 0, sizeof(*info)); - if ( trap_LAN_ServerStatus( serverAddress, info->text, sizeof(info->text)) ) { - Q_strncpyz(info->address, serverAddress, sizeof(info->address)); - p = info->text; - info->numLines = 0; - info->lines[info->numLines][0] = "Address"; - info->lines[info->numLines][1] = ""; - info->lines[info->numLines][2] = ""; - info->lines[info->numLines][3] = info->address; - info->numLines++; - // get the cvars - while (p && *p) { - p = strchr(p, '\\'); - if (!p) break; - *p++ = '\0'; - if (*p == '\\') - break; - info->lines[info->numLines][0] = p; - info->lines[info->numLines][1] = ""; - info->lines[info->numLines][2] = ""; - p = strchr(p, '\\'); - if (!p) break; - *p++ = '\0'; - info->lines[info->numLines][3] = p; - - info->numLines++; - if (info->numLines >= MAX_SERVERSTATUS_LINES) - break; - } - // get the player list - if (info->numLines < MAX_SERVERSTATUS_LINES-3) { - // empty line - info->lines[info->numLines][0] = ""; - info->lines[info->numLines][1] = ""; - info->lines[info->numLines][2] = ""; - info->lines[info->numLines][3] = ""; - info->numLines++; - // header - info->lines[info->numLines][0] = "num"; - info->lines[info->numLines][1] = "score"; - info->lines[info->numLines][2] = "ping"; - info->lines[info->numLines][3] = "name"; - info->numLines++; - // parse players - i = 0; - len = 0; - while (p && *p) { - if (*p == '\\') - *p++ = '\0'; - if (!p) - break; - score = p; - p = strchr(p, ' '); - if (!p) - break; - *p++ = '\0'; - ping = p; - p = strchr(p, ' '); - if (!p) - break; - *p++ = '\0'; - name = p; - Com_sprintf(&info->pings[len], sizeof(info->pings)-len, "%d", i); - info->lines[info->numLines][0] = &info->pings[len]; - len += strlen(&info->pings[len]) + 1; - info->lines[info->numLines][1] = score; - info->lines[info->numLines][2] = ping; - info->lines[info->numLines][3] = name; - info->numLines++; - if (info->numLines >= MAX_SERVERSTATUS_LINES) - break; - p = strchr(p, '\\'); - if (!p) - break; - *p++ = '\0'; - // - i++; - } - } - UI_SortServerStatusInfo( info ); - return qtrue; - } - return qfalse; -} - -/* -================== -stristr -================== -*/ -static char *stristr(char *str, char *charset) { - int i; - - while(*str) { - for (i = 0; charset[i] && str[i]; i++) { - if (toupper(charset[i]) != toupper(str[i])) break; - } - if (!charset[i]) return str; - str++; - } - return NULL; -} - -/* -================== -UI_BuildFindPlayerList -================== -*/ -static void UI_BuildFindPlayerList(qboolean force) { - static int numFound, numTimeOuts; - int i, j, resend; - serverStatusInfo_t info; - char name[MAX_NAME_LENGTH+2]; - char infoString[MAX_STRING_CHARS]; - - if (!force) { - if (!uiInfo.nextFindPlayerRefresh || uiInfo.nextFindPlayerRefresh > uiInfo.uiDC.realTime) { - return; - } - } - else { - memset(&uiInfo.pendingServerStatus, 0, sizeof(uiInfo.pendingServerStatus)); - uiInfo.numFoundPlayerServers = 0; - uiInfo.currentFoundPlayerServer = 0; - trap_Cvar_VariableStringBuffer( "ui_findPlayer", uiInfo.findPlayerName, sizeof(uiInfo.findPlayerName)); - Q_CleanStr(uiInfo.findPlayerName); - // should have a string of some length - if (!strlen(uiInfo.findPlayerName)) { - uiInfo.nextFindPlayerRefresh = 0; - return; - } - // set resend time - resend = ui_serverStatusTimeOut.integer / 2 - 10; - if (resend < 50) { - resend = 50; - } - trap_Cvar_Set("cl_serverStatusResendTime", va("%d", resend)); - // reset all server status requests - trap_LAN_ServerStatus( NULL, NULL, 0); - // - uiInfo.numFoundPlayerServers = 1; - Com_sprintf(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1], - sizeof(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1]), - "searching %d...", uiInfo.pendingServerStatus.num); - numFound = 0; - numTimeOuts++; - } - for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) { - // if this pending server is valid - if (uiInfo.pendingServerStatus.server[i].valid) { - // try to get the server status for this server - if (UI_GetServerStatusInfo( uiInfo.pendingServerStatus.server[i].adrstr, &info ) ) { - // - numFound++; - // parse through the server status lines - for (j = 0; j < info.numLines; j++) { - // should have ping info - if ( !info.lines[j][2] || !info.lines[j][2][0] ) { - continue; - } - // clean string first - Q_strncpyz(name, info.lines[j][3], sizeof(name)); - Q_CleanStr(name); - // if the player name is a substring - if (stristr(name, uiInfo.findPlayerName)) { - // add to found server list if we have space (always leave space for a line with the number found) - if (uiInfo.numFoundPlayerServers < MAX_FOUNDPLAYER_SERVERS-1) { - // - Q_strncpyz(uiInfo.foundPlayerServerAddresses[uiInfo.numFoundPlayerServers-1], - uiInfo.pendingServerStatus.server[i].adrstr, - sizeof(uiInfo.foundPlayerServerAddresses[0])); - Q_strncpyz(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1], - uiInfo.pendingServerStatus.server[i].name, - sizeof(uiInfo.foundPlayerServerNames[0])); - uiInfo.numFoundPlayerServers++; - } - else { - // can't add any more so we're done - uiInfo.pendingServerStatus.num = uiInfo.serverStatus.numDisplayServers; - } - } - } - Com_sprintf(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1], - sizeof(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1]), - "searching %d/%d...", uiInfo.pendingServerStatus.num, numFound); - // retrieved the server status so reuse this spot - uiInfo.pendingServerStatus.server[i].valid = qfalse; - } - } - // if empty pending slot or timed out - if (!uiInfo.pendingServerStatus.server[i].valid || - uiInfo.pendingServerStatus.server[i].startTime < uiInfo.uiDC.realTime - ui_serverStatusTimeOut.integer) { - if (uiInfo.pendingServerStatus.server[i].valid) { - numTimeOuts++; - } - // reset server status request for this address - UI_GetServerStatusInfo( uiInfo.pendingServerStatus.server[i].adrstr, NULL ); - // reuse pending slot - uiInfo.pendingServerStatus.server[i].valid = qfalse; - // if we didn't try to get the status of all servers in the main browser yet - if (uiInfo.pendingServerStatus.num < uiInfo.serverStatus.numDisplayServers) { - uiInfo.pendingServerStatus.server[i].startTime = uiInfo.uiDC.realTime; - trap_LAN_GetServerAddressString(ui_netSource.integer, uiInfo.serverStatus.displayServers[uiInfo.pendingServerStatus.num], - uiInfo.pendingServerStatus.server[i].adrstr, sizeof(uiInfo.pendingServerStatus.server[i].adrstr)); - trap_LAN_GetServerInfo(ui_netSource.integer, uiInfo.serverStatus.displayServers[uiInfo.pendingServerStatus.num], infoString, sizeof(infoString)); - Q_strncpyz(uiInfo.pendingServerStatus.server[i].name, Info_ValueForKey(infoString, "hostname"), sizeof(uiInfo.pendingServerStatus.server[0].name)); - uiInfo.pendingServerStatus.server[i].valid = qtrue; - uiInfo.pendingServerStatus.num++; - Com_sprintf(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1], - sizeof(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1]), - "searching %d/%d...", uiInfo.pendingServerStatus.num, numFound); - } - } - } - for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) { - if (uiInfo.pendingServerStatus.server[i].valid) { - break; - } - } - // if still trying to retrieve server status info - if (i < MAX_SERVERSTATUSREQUESTS) { - uiInfo.nextFindPlayerRefresh = uiInfo.uiDC.realTime + 25; - } - else { - // add a line that shows the number of servers found - if (!uiInfo.numFoundPlayerServers) { - Com_sprintf(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1], sizeof(uiInfo.foundPlayerServerAddresses[0]), "no servers found"); - } - else { - Com_sprintf(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1], sizeof(uiInfo.foundPlayerServerAddresses[0]), - "%d server%s found with player %s", uiInfo.numFoundPlayerServers-1, - uiInfo.numFoundPlayerServers == 2 ? "":"s", uiInfo.findPlayerName); - } - uiInfo.nextFindPlayerRefresh = 0; - // show the server status info for the selected server - UI_FeederSelection(FEEDER_FINDPLAYER, uiInfo.currentFoundPlayerServer); - } -} - -/* -================== -UI_BuildServerStatus -================== -*/ -static void UI_BuildServerStatus(qboolean force) { - - if (uiInfo.nextFindPlayerRefresh) { - return; - } - if (!force) { - if (!uiInfo.nextServerStatusRefresh || uiInfo.nextServerStatusRefresh > uiInfo.uiDC.realTime) { - return; - } - } - else { - Menu_SetFeederSelection(NULL, FEEDER_SERVERSTATUS, 0, NULL); - uiInfo.serverStatusInfo.numLines = 0; - // reset all server status requests - trap_LAN_ServerStatus( NULL, NULL, 0); - } - if (uiInfo.serverStatus.currentServer < 0 || uiInfo.serverStatus.currentServer > uiInfo.serverStatus.numDisplayServers || uiInfo.serverStatus.numDisplayServers == 0) { - return; - } - if (UI_GetServerStatusInfo( uiInfo.serverStatusAddress, &uiInfo.serverStatusInfo ) ) { - uiInfo.nextServerStatusRefresh = 0; - UI_GetServerStatusInfo( uiInfo.serverStatusAddress, NULL ); - } - else { - uiInfo.nextServerStatusRefresh = uiInfo.uiDC.realTime + 500; - } -} - -/* -================== -UI_FeederCount -================== -*/ -static int UI_FeederCount(float feederID) { - if (feederID == FEEDER_HEADS) { - return UI_HeadCountByTeam(); - } else if (feederID == FEEDER_Q3HEADS) { - return uiInfo.q3HeadCount; - } else if (feederID == FEEDER_CINEMATICS) { - return uiInfo.movieCount; - } else if (feederID == FEEDER_MAPS || feederID == FEEDER_ALLMAPS) { - return UI_MapCountByGameType(feederID == FEEDER_MAPS ? qtrue : qfalse); - } else if (feederID == FEEDER_SERVERS) { - return uiInfo.serverStatus.numDisplayServers; - } else if (feederID == FEEDER_SERVERSTATUS) { - return uiInfo.serverStatusInfo.numLines; - } else if (feederID == FEEDER_FINDPLAYER) { - return uiInfo.numFoundPlayerServers; - } else if (feederID == FEEDER_PLAYER_LIST) { - if (uiInfo.uiDC.realTime > uiInfo.playerRefresh) { - uiInfo.playerRefresh = uiInfo.uiDC.realTime + 3000; - UI_BuildPlayerList(); - } - return uiInfo.playerCount; - } else if (feederID == FEEDER_TEAM_LIST) { - if (uiInfo.uiDC.realTime > uiInfo.playerRefresh) { - uiInfo.playerRefresh = uiInfo.uiDC.realTime + 3000; - UI_BuildPlayerList(); - } - return uiInfo.myTeamCount; - } else if (feederID == FEEDER_MODS) { - return uiInfo.modCount; - } else if (feederID == FEEDER_DEMOS) { - return uiInfo.demoCount; - } - return 0; -} - -static const char *UI_SelectedMap(int index, int *actual) { - int i, c; - c = 0; - *actual = 0; - for (i = 0; i < uiInfo.mapCount; i++) { - if (uiInfo.mapList[i].active) { - if (c == index) { - *actual = i; - return uiInfo.mapList[i].mapName; - } else { - c++; - } - } - } - return ""; -} - -static const char *UI_SelectedHead(int index, int *actual) { - int i, c; - c = 0; - *actual = 0; - for (i = 0; i < uiInfo.characterCount; i++) { - if (uiInfo.characterList[i].active) { - if (c == index) { - *actual = i; - return uiInfo.characterList[i].name; - } else { - c++; - } - } - } - return ""; -} - -static int UI_GetIndexFromSelection(int actual) { - int i, c; - c = 0; - for (i = 0; i < uiInfo.mapCount; i++) { - if (uiInfo.mapList[i].active) { - if (i == actual) { - return c; - } - c++; - } - } - return 0; -} - -static void UI_UpdatePendingPings() { - trap_LAN_ResetPings(ui_netSource.integer); - uiInfo.serverStatus.refreshActive = qtrue; - uiInfo.serverStatus.refreshtime = uiInfo.uiDC.realTime + 1000; - -} - -static const char *UI_FeederItemText(float feederID, int index, int column, qhandle_t *handle) { - static char info[MAX_STRING_CHARS]; - static char hostname[1024]; - static char clientBuff[32]; - static int lastColumn = -1; - static int lastTime = 0; - *handle = -1; - if (feederID == FEEDER_HEADS) { - int actual; - return UI_SelectedHead(index, &actual); - } else if (feederID == FEEDER_Q3HEADS) { - if (index >= 0 && index < uiInfo.q3HeadCount) { - return uiInfo.q3HeadNames[index]; - } - } else if (feederID == FEEDER_MAPS || feederID == FEEDER_ALLMAPS) { - int actual; - return UI_SelectedMap(index, &actual); - } else if (feederID == FEEDER_SERVERS) { - if (index >= 0 && index < uiInfo.serverStatus.numDisplayServers) { - int ping, game, punkbuster; - if (lastColumn != column || lastTime > uiInfo.uiDC.realTime + 5000) { - trap_LAN_GetServerInfo(ui_netSource.integer, uiInfo.serverStatus.displayServers[index], info, MAX_STRING_CHARS); - lastColumn = column; - lastTime = uiInfo.uiDC.realTime; - } - ping = atoi(Info_ValueForKey(info, "ping")); - if (ping == -1) { - // if we ever see a ping that is out of date, do a server refresh - // UI_UpdatePendingPings(); - } - switch (column) { - case SORT_HOST : - if (ping <= 0) { - return Info_ValueForKey(info, "addr"); - } else { - if ( ui_netSource.integer == AS_LOCAL ) { - Com_sprintf( hostname, sizeof(hostname), "%s [%s]", - Info_ValueForKey(info, "hostname"), - netnames[atoi(Info_ValueForKey(info, "nettype"))] ); - return hostname; - } - else { - Com_sprintf( hostname, sizeof(hostname), "%s", Info_ValueForKey(info, "hostname")); - return hostname; - } - } - case SORT_MAP : return Info_ValueForKey(info, "mapname"); - case SORT_CLIENTS : - Com_sprintf( clientBuff, sizeof(clientBuff), "%s (%s)", Info_ValueForKey(info, "clients"), Info_ValueForKey(info, "sv_maxclients")); - return clientBuff; - case SORT_GAME : - game = atoi(Info_ValueForKey(info, "gametype")); - if (game >= 0 && game < numTeamArenaGameTypes) { - return teamArenaGameTypes[game]; - } else { - return "Unknown"; - } - case SORT_PING : - if (ping <= 0) { - return "..."; - } else { - return Info_ValueForKey(info, "ping"); - } - case SORT_PUNKBUSTER: - punkbuster = atoi(Info_ValueForKey(info, "punkbuster")); - if ( punkbuster ) { - return "Yes"; - } else { - return "No"; - } - } - } - } else if (feederID == FEEDER_SERVERSTATUS) { - if ( index >= 0 && index < uiInfo.serverStatusInfo.numLines ) { - if ( column >= 0 && column < 4 ) { - return uiInfo.serverStatusInfo.lines[index][column]; - } - } - } else if (feederID == FEEDER_FINDPLAYER) { - if ( index >= 0 && index < uiInfo.numFoundPlayerServers ) { - //return uiInfo.foundPlayerServerAddresses[index]; - return uiInfo.foundPlayerServerNames[index]; - } - } else if (feederID == FEEDER_PLAYER_LIST) { - if (index >= 0 && index < uiInfo.playerCount) { - return uiInfo.playerNames[index]; - } - } else if (feederID == FEEDER_TEAM_LIST) { - if (index >= 0 && index < uiInfo.myTeamCount) { - return uiInfo.teamNames[index]; - } - } else if (feederID == FEEDER_MODS) { - if (index >= 0 && index < uiInfo.modCount) { - if (uiInfo.modList[index].modDescr && *uiInfo.modList[index].modDescr) { - return uiInfo.modList[index].modDescr; - } else { - return uiInfo.modList[index].modName; - } - } - } else if (feederID == FEEDER_CINEMATICS) { - if (index >= 0 && index < uiInfo.movieCount) { - return uiInfo.movieList[index]; - } - } else if (feederID == FEEDER_DEMOS) { - if (index >= 0 && index < uiInfo.demoCount) { - return uiInfo.demoList[index]; - } - } - return ""; -} - - -static qhandle_t UI_FeederItemImage(float feederID, int index) { - if (feederID == FEEDER_HEADS) { - int actual; - UI_SelectedHead(index, &actual); - index = actual; - if (index >= 0 && index < uiInfo.characterCount) { - if (uiInfo.characterList[index].headImage == -1) { - uiInfo.characterList[index].headImage = trap_R_RegisterShaderNoMip(uiInfo.characterList[index].imageName); - } - return uiInfo.characterList[index].headImage; - } - } else if (feederID == FEEDER_Q3HEADS) { - if (index >= 0 && index < uiInfo.q3HeadCount) { - return uiInfo.q3HeadIcons[index]; - } - } else if (feederID == FEEDER_ALLMAPS || feederID == FEEDER_MAPS) { - int actual; - UI_SelectedMap(index, &actual); - index = actual; - if (index >= 0 && index < uiInfo.mapCount) { - if (uiInfo.mapList[index].levelShot == -1) { - uiInfo.mapList[index].levelShot = trap_R_RegisterShaderNoMip(uiInfo.mapList[index].imageName); - } - return uiInfo.mapList[index].levelShot; - } - } - return 0; -} - -static void UI_FeederSelection(float feederID, int index) { - static char info[MAX_STRING_CHARS]; - if (feederID == FEEDER_HEADS) { - int actual; - UI_SelectedHead(index, &actual); - index = actual; - if (index >= 0 && index < uiInfo.characterCount) { - trap_Cvar_Set( "team_model", va("%s", uiInfo.characterList[index].base)); - trap_Cvar_Set( "team_headmodel", va("*%s", uiInfo.characterList[index].name)); - updateModel = qtrue; - } - } else if (feederID == FEEDER_Q3HEADS) { - if (index >= 0 && index < uiInfo.q3HeadCount) { - trap_Cvar_Set( "model", uiInfo.q3HeadNames[index]); - trap_Cvar_Set( "headmodel", uiInfo.q3HeadNames[index]); - updateModel = qtrue; - } - } else if (feederID == FEEDER_MAPS || feederID == FEEDER_ALLMAPS) { - int actual, map; - map = (feederID == FEEDER_ALLMAPS) ? ui_currentNetMap.integer : ui_currentMap.integer; - if (uiInfo.mapList[map].cinematic >= 0) { - trap_CIN_StopCinematic(uiInfo.mapList[map].cinematic); - uiInfo.mapList[map].cinematic = -1; - } - UI_SelectedMap(index, &actual); - trap_Cvar_Set("ui_mapIndex", va("%d", index)); - ui_mapIndex.integer = index; - - if (feederID == FEEDER_MAPS) { - ui_currentMap.integer = actual; - trap_Cvar_Set("ui_currentMap", va("%d", actual)); - uiInfo.mapList[ui_currentMap.integer].cinematic = trap_CIN_PlayCinematic(va("%s.roq", uiInfo.mapList[ui_currentMap.integer].mapLoadName), 0, 0, 0, 0, (CIN_loop | CIN_silent) ); - UI_LoadBestScores(uiInfo.mapList[ui_currentMap.integer].mapLoadName, uiInfo.gameTypes[ui_gameType.integer].gtEnum); - trap_Cvar_Set("ui_opponentModel", uiInfo.mapList[ui_currentMap.integer].opponentName); - updateOpponentModel = qtrue; - } else { - ui_currentNetMap.integer = actual; - trap_Cvar_Set("ui_currentNetMap", va("%d", actual)); - uiInfo.mapList[ui_currentNetMap.integer].cinematic = trap_CIN_PlayCinematic(va("%s.roq", uiInfo.mapList[ui_currentNetMap.integer].mapLoadName), 0, 0, 0, 0, (CIN_loop | CIN_silent) ); - } - - } else if (feederID == FEEDER_SERVERS) { - const char *mapName = NULL; - uiInfo.serverStatus.currentServer = index; - trap_LAN_GetServerInfo(ui_netSource.integer, uiInfo.serverStatus.displayServers[index], info, MAX_STRING_CHARS); - uiInfo.serverStatus.currentServerPreview = trap_R_RegisterShaderNoMip(va("levelshots/%s", Info_ValueForKey(info, "mapname"))); - if (uiInfo.serverStatus.currentServerCinematic >= 0) { - trap_CIN_StopCinematic(uiInfo.serverStatus.currentServerCinematic); - uiInfo.serverStatus.currentServerCinematic = -1; - } - mapName = Info_ValueForKey(info, "mapname"); - if (mapName && *mapName) { - uiInfo.serverStatus.currentServerCinematic = trap_CIN_PlayCinematic(va("%s.roq", mapName), 0, 0, 0, 0, (CIN_loop | CIN_silent) ); - } - } else if (feederID == FEEDER_SERVERSTATUS) { - // - } else if (feederID == FEEDER_FINDPLAYER) { - uiInfo.currentFoundPlayerServer = index; - // - if ( index < uiInfo.numFoundPlayerServers-1) { - // build a new server status for this server - Q_strncpyz(uiInfo.serverStatusAddress, uiInfo.foundPlayerServerAddresses[uiInfo.currentFoundPlayerServer], sizeof(uiInfo.serverStatusAddress)); - Menu_SetFeederSelection(NULL, FEEDER_SERVERSTATUS, 0, NULL); - UI_BuildServerStatus(qtrue); - } - } else if (feederID == FEEDER_PLAYER_LIST) { - uiInfo.playerIndex = index; - } else if (feederID == FEEDER_TEAM_LIST) { - uiInfo.teamIndex = index; - } else if (feederID == FEEDER_MODS) { - uiInfo.modIndex = index; - } else if (feederID == FEEDER_CINEMATICS) { - uiInfo.movieIndex = index; - if (uiInfo.previewMovie >= 0) { - trap_CIN_StopCinematic(uiInfo.previewMovie); - } - uiInfo.previewMovie = -1; - } else if (feederID == FEEDER_DEMOS) { - uiInfo.demoIndex = index; - } -} - -static qboolean Team_Parse(char **p) { - char *token; - const char *tempStr; - int i; - - token = COM_ParseExt(p, qtrue); - - if (token[0] != '{') { - return qfalse; - } - - while ( 1 ) { - - token = COM_ParseExt(p, qtrue); - - if (Q_stricmp(token, "}") == 0) { - return qtrue; - } - - if ( !token || token[0] == 0 ) { - return qfalse; - } - - if (token[0] == '{') { - // seven tokens per line, team name and icon, and 5 team member names - if (!String_Parse(p, &uiInfo.teamList[uiInfo.teamCount].teamName) || !String_Parse(p, &tempStr)) { - return qfalse; - } - - - uiInfo.teamList[uiInfo.teamCount].imageName = tempStr; - uiInfo.teamList[uiInfo.teamCount].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[uiInfo.teamCount].imageName); - uiInfo.teamList[uiInfo.teamCount].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[uiInfo.teamCount].imageName)); - uiInfo.teamList[uiInfo.teamCount].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[uiInfo.teamCount].imageName)); - - uiInfo.teamList[uiInfo.teamCount].cinematic = -1; - - for (i = 0; i < TEAM_MEMBERS; i++) { - uiInfo.teamList[uiInfo.teamCount].teamMembers[i] = NULL; - if (!String_Parse(p, &uiInfo.teamList[uiInfo.teamCount].teamMembers[i])) { - return qfalse; - } - } - - Com_Printf("Loaded team %s with team icon %s.\n", uiInfo.teamList[uiInfo.teamCount].teamName, tempStr); - if (uiInfo.teamCount < MAX_TEAMS) { - uiInfo.teamCount++; - } else { - Com_Printf("Too many teams, last team replaced!\n"); - } - token = COM_ParseExt(p, qtrue); - if (token[0] != '}') { - return qfalse; - } - } - } - - return qfalse; -} - -static qboolean Character_Parse(char **p) { - char *token; - const char *tempStr; - - token = COM_ParseExt(p, qtrue); - - if (token[0] != '{') { - return qfalse; - } - - - while ( 1 ) { - token = COM_ParseExt(p, qtrue); - - if (Q_stricmp(token, "}") == 0) { - return qtrue; - } - - if ( !token || token[0] == 0 ) { - return qfalse; - } - - if (token[0] == '{') { - // two tokens per line, character name and sex - if (!String_Parse(p, &uiInfo.characterList[uiInfo.characterCount].name) || !String_Parse(p, &tempStr)) { - return qfalse; - } - - uiInfo.characterList[uiInfo.characterCount].headImage = -1; - uiInfo.characterList[uiInfo.characterCount].imageName = String_Alloc(va("models/players/heads/%s/icon_default.tga", uiInfo.characterList[uiInfo.characterCount].name)); - - if (tempStr && (!Q_stricmp(tempStr, "female"))) { - uiInfo.characterList[uiInfo.characterCount].base = String_Alloc(va("Janet")); - } else if (tempStr && (!Q_stricmp(tempStr, "male"))) { - uiInfo.characterList[uiInfo.characterCount].base = String_Alloc(va("James")); - } else { - uiInfo.characterList[uiInfo.characterCount].base = String_Alloc(va("%s",tempStr)); - } - - Com_Printf("Loaded %s character %s.\n", uiInfo.characterList[uiInfo.characterCount].base, uiInfo.characterList[uiInfo.characterCount].name); - if (uiInfo.characterCount < MAX_HEADS) { - uiInfo.characterCount++; - } else { - Com_Printf("Too many characters, last character replaced!\n"); - } - - token = COM_ParseExt(p, qtrue); - if (token[0] != '}') { - return qfalse; - } - } - } - - return qfalse; -} - - -static qboolean Alias_Parse(char **p) { - char *token; - - token = COM_ParseExt(p, qtrue); - - if (token[0] != '{') { - return qfalse; - } - - while ( 1 ) { - token = COM_ParseExt(p, qtrue); - - if (Q_stricmp(token, "}") == 0) { - return qtrue; - } - - if ( !token || token[0] == 0 ) { - return qfalse; - } - - if (token[0] == '{') { - // three tokens per line, character name, bot alias, and preferred action a - all purpose, d - defense, o - offense - if (!String_Parse(p, &uiInfo.aliasList[uiInfo.aliasCount].name) || !String_Parse(p, &uiInfo.aliasList[uiInfo.aliasCount].ai) || !String_Parse(p, &uiInfo.aliasList[uiInfo.aliasCount].action)) { - return qfalse; - } - - Com_Printf("Loaded character alias %s using character ai %s.\n", uiInfo.aliasList[uiInfo.aliasCount].name, uiInfo.aliasList[uiInfo.aliasCount].ai); - if (uiInfo.aliasCount < MAX_ALIASES) { - uiInfo.aliasCount++; - } else { - Com_Printf("Too many aliases, last alias replaced!\n"); - } - - token = COM_ParseExt(p, qtrue); - if (token[0] != '}') { - return qfalse; - } - } - } - - return qfalse; -} - - - -// mode -// 0 - high level parsing -// 1 - team parsing -// 2 - character parsing -static void UI_ParseTeamInfo(const char *teamFile) { - char *token; - char *p; - char *buff = NULL; - //static int mode = 0; TTimo: unused - - buff = GetMenuBuffer(teamFile); - if (!buff) { - return; - } - - p = buff; - - while ( 1 ) { - token = COM_ParseExt( &p, qtrue ); - if( !token || token[0] == 0 || token[0] == '}') { - break; - } - - if ( Q_stricmp( token, "}" ) == 0 ) { - break; - } - - if (Q_stricmp(token, "teams") == 0) { - - if (Team_Parse(&p)) { - continue; - } else { - break; - } - } - - if (Q_stricmp(token, "characters") == 0) { - Character_Parse(&p); - } - - if (Q_stricmp(token, "aliases") == 0) { - Alias_Parse(&p); - } - - } - -} - - -static qboolean GameType_Parse(char **p, qboolean join) { - char *token; - - token = COM_ParseExt(p, qtrue); - - if (token[0] != '{') { - return qfalse; - } - - if (join) { - uiInfo.numJoinGameTypes = 0; - } else { - uiInfo.numGameTypes = 0; - } - - while ( 1 ) { - token = COM_ParseExt(p, qtrue); - - if (Q_stricmp(token, "}") == 0) { - return qtrue; - } - - if ( !token || token[0] == 0 ) { - return qfalse; - } - - if (token[0] == '{') { - // two tokens per line, character name and sex - if (join) { - if (!String_Parse(p, &uiInfo.joinGameTypes[uiInfo.numJoinGameTypes].gameType) || !Int_Parse(p, &uiInfo.joinGameTypes[uiInfo.numJoinGameTypes].gtEnum)) { - return qfalse; - } - } else { - if (!String_Parse(p, &uiInfo.gameTypes[uiInfo.numGameTypes].gameType) || !Int_Parse(p, &uiInfo.gameTypes[uiInfo.numGameTypes].gtEnum)) { - return qfalse; - } - } - - if (join) { - if (uiInfo.numJoinGameTypes < MAX_GAMETYPES) { - uiInfo.numJoinGameTypes++; - } else { - Com_Printf("Too many net game types, last one replace!\n"); - } - } else { - if (uiInfo.numGameTypes < MAX_GAMETYPES) { - uiInfo.numGameTypes++; - } else { - Com_Printf("Too many game types, last one replace!\n"); - } - } - - token = COM_ParseExt(p, qtrue); - if (token[0] != '}') { - return qfalse; - } - } - } - return qfalse; -} - -static qboolean MapList_Parse(char **p) { - char *token; - - token = COM_ParseExt(p, qtrue); - - if (token[0] != '{') { - return qfalse; - } - - uiInfo.mapCount = 0; - - while ( 1 ) { - token = COM_ParseExt(p, qtrue); - - if (Q_stricmp(token, "}") == 0) { - return qtrue; - } - - if ( !token || token[0] == 0 ) { - return qfalse; - } - - if (token[0] == '{') { - if (!String_Parse(p, &uiInfo.mapList[uiInfo.mapCount].mapName) || !String_Parse(p, &uiInfo.mapList[uiInfo.mapCount].mapLoadName) - ||!Int_Parse(p, &uiInfo.mapList[uiInfo.mapCount].teamMembers) ) { - return qfalse; - } - - if (!String_Parse(p, &uiInfo.mapList[uiInfo.mapCount].opponentName)) { - return qfalse; - } - - uiInfo.mapList[uiInfo.mapCount].typeBits = 0; - - while (1) { - token = COM_ParseExt(p, qtrue); - if (token[0] >= '0' && token[0] <= '9') { - uiInfo.mapList[uiInfo.mapCount].typeBits |= (1 << (token[0] - 0x030)); - if (!Int_Parse(p, &uiInfo.mapList[uiInfo.mapCount].timeToBeat[token[0] - 0x30])) { - return qfalse; - } - } else { - break; - } - } - - //mapList[mapCount].imageName = String_Alloc(va("levelshots/%s", mapList[mapCount].mapLoadName)); - //if (uiInfo.mapCount == 0) { - // only load the first cinematic, selection loads the others - // uiInfo.mapList[uiInfo.mapCount].cinematic = trap_CIN_PlayCinematic(va("%s.roq",uiInfo.mapList[uiInfo.mapCount].mapLoadName), qfalse, qfalse, qtrue, 0, 0, 0, 0); - //} - uiInfo.mapList[uiInfo.mapCount].cinematic = -1; - uiInfo.mapList[uiInfo.mapCount].levelShot = trap_R_RegisterShaderNoMip(va("levelshots/%s_small", uiInfo.mapList[uiInfo.mapCount].mapLoadName)); - - if (uiInfo.mapCount < MAX_MAPS) { - uiInfo.mapCount++; - } else { - Com_Printf("Too many maps, last one replaced!\n"); - } - } - } - return qfalse; -} - -static void UI_ParseGameInfo(const char *teamFile) { - char *token; - char *p; - char *buff = NULL; - //int mode = 0; TTimo: unused - - buff = GetMenuBuffer(teamFile); - if (!buff) { - return; - } - - p = buff; - - while ( 1 ) { - token = COM_ParseExt( &p, qtrue ); - if( !token || token[0] == 0 || token[0] == '}') { - break; - } - - if ( Q_stricmp( token, "}" ) == 0 ) { - break; - } - - if (Q_stricmp(token, "gametypes") == 0) { - - if (GameType_Parse(&p, qfalse)) { - continue; - } else { - break; - } - } - - if (Q_stricmp(token, "joingametypes") == 0) { - - if (GameType_Parse(&p, qtrue)) { - continue; - } else { - break; - } - } - - if (Q_stricmp(token, "maps") == 0) { - // start a new menu - MapList_Parse(&p); - } - - } -} - -static void UI_Pause(qboolean b) { - if (b) { - // pause the game and set the ui keycatcher - trap_Cvar_Set( "cl_paused", "1" ); - trap_Key_SetCatcher( KEYCATCH_UI ); - } else { - // unpause the game and clear the ui keycatcher - trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI ); - trap_Key_ClearStates(); - trap_Cvar_Set( "cl_paused", "0" ); - } -} - -#ifndef MISSIONPACK // bk001206 -static int UI_OwnerDraw_Width(int ownerDraw) { - // bk001205 - LCC missing return value - return 0; -} -#endif - -static int UI_PlayCinematic(const char *name, float x, float y, float w, float h) { - return trap_CIN_PlayCinematic(name, x, y, w, h, (CIN_loop | CIN_silent)); -} - -static void UI_StopCinematic(int handle) { - if (handle >= 0) { - trap_CIN_StopCinematic(handle); - } else { - handle = abs(handle); - if (handle == UI_MAPCINEMATIC) { - if (uiInfo.mapList[ui_currentMap.integer].cinematic >= 0) { - trap_CIN_StopCinematic(uiInfo.mapList[ui_currentMap.integer].cinematic); - uiInfo.mapList[ui_currentMap.integer].cinematic = -1; - } - } else if (handle == UI_NETMAPCINEMATIC) { - if (uiInfo.serverStatus.currentServerCinematic >= 0) { - trap_CIN_StopCinematic(uiInfo.serverStatus.currentServerCinematic); - uiInfo.serverStatus.currentServerCinematic = -1; - } - } else if (handle == UI_CLANCINEMATIC) { - int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName")); - if (i >= 0 && i < uiInfo.teamCount) { - if (uiInfo.teamList[i].cinematic >= 0) { - trap_CIN_StopCinematic(uiInfo.teamList[i].cinematic); - uiInfo.teamList[i].cinematic = -1; - } - } - } - } -} - -static void UI_DrawCinematic(int handle, float x, float y, float w, float h) { - trap_CIN_SetExtents(handle, x, y, w, h); - trap_CIN_DrawCinematic(handle); -} - -static void UI_RunCinematicFrame(int handle) { - trap_CIN_RunCinematic(handle); -} - - - -/* -================= -PlayerModel_BuildList -================= -*/ -static void UI_BuildQ3Model_List( void ) -{ - int numdirs; - int numfiles; - char dirlist[2048]; - char filelist[2048]; - char skinname[64]; - char scratch[256]; - char* dirptr; - char* fileptr; - int i; - int j, k, dirty; - int dirlen; - int filelen; - - uiInfo.q3HeadCount = 0; - - // iterate directory of all player models - numdirs = trap_FS_GetFileList("models/players", "/", dirlist, 2048 ); - dirptr = dirlist; - for (i=0; i uiInfo.uiDC.glconfig.vidHeight * 640 ) { - // wide screen - uiInfo.uiDC.bias = 0.5 * ( uiInfo.uiDC.glconfig.vidWidth - ( uiInfo.uiDC.glconfig.vidHeight * (640.0/480.0) ) ); - } - else { - // no wide screen - uiInfo.uiDC.bias = 0; - } - - - //UI_Load(); - uiInfo.uiDC.registerShaderNoMip = &trap_R_RegisterShaderNoMip; - uiInfo.uiDC.setColor = &UI_SetColor; - uiInfo.uiDC.drawHandlePic = &UI_DrawHandlePic; - uiInfo.uiDC.drawStretchPic = &trap_R_DrawStretchPic; - uiInfo.uiDC.drawText = &Text_Paint; - uiInfo.uiDC.textWidth = &Text_Width; - uiInfo.uiDC.textHeight = &Text_Height; - uiInfo.uiDC.registerModel = &trap_R_RegisterModel; - uiInfo.uiDC.modelBounds = &trap_R_ModelBounds; - uiInfo.uiDC.fillRect = &UI_FillRect; - uiInfo.uiDC.drawRect = &_UI_DrawRect; - uiInfo.uiDC.drawSides = &_UI_DrawSides; - uiInfo.uiDC.drawTopBottom = &_UI_DrawTopBottom; - uiInfo.uiDC.clearScene = &trap_R_ClearScene; - uiInfo.uiDC.drawSides = &_UI_DrawSides; - uiInfo.uiDC.addRefEntityToScene = &trap_R_AddRefEntityToScene; - uiInfo.uiDC.renderScene = &trap_R_RenderScene; - uiInfo.uiDC.registerFont = &trap_R_RegisterFont; - uiInfo.uiDC.ownerDrawItem = &UI_OwnerDraw; - uiInfo.uiDC.getValue = &UI_GetValue; - uiInfo.uiDC.ownerDrawVisible = &UI_OwnerDrawVisible; - uiInfo.uiDC.runScript = &UI_RunMenuScript; - uiInfo.uiDC.getTeamColor = &UI_GetTeamColor; - uiInfo.uiDC.setCVar = trap_Cvar_Set; - uiInfo.uiDC.getCVarString = trap_Cvar_VariableStringBuffer; - uiInfo.uiDC.getCVarValue = trap_Cvar_VariableValue; - uiInfo.uiDC.drawTextWithCursor = &Text_PaintWithCursor; - uiInfo.uiDC.setOverstrikeMode = &trap_Key_SetOverstrikeMode; - uiInfo.uiDC.getOverstrikeMode = &trap_Key_GetOverstrikeMode; - uiInfo.uiDC.startLocalSound = &trap_S_StartLocalSound; - uiInfo.uiDC.ownerDrawHandleKey = &UI_OwnerDrawHandleKey; - uiInfo.uiDC.feederCount = &UI_FeederCount; - uiInfo.uiDC.feederItemImage = &UI_FeederItemImage; - uiInfo.uiDC.feederItemText = &UI_FeederItemText; - uiInfo.uiDC.feederSelection = &UI_FeederSelection; - uiInfo.uiDC.setBinding = &trap_Key_SetBinding; - uiInfo.uiDC.getBindingBuf = &trap_Key_GetBindingBuf; - uiInfo.uiDC.keynumToStringBuf = &trap_Key_KeynumToStringBuf; - uiInfo.uiDC.executeText = &trap_Cmd_ExecuteText; - uiInfo.uiDC.Error = &Com_Error; - uiInfo.uiDC.Print = &Com_Printf; - uiInfo.uiDC.Pause = &UI_Pause; - uiInfo.uiDC.ownerDrawWidth = &UI_OwnerDrawWidth; - uiInfo.uiDC.registerSound = &trap_S_RegisterSound; - uiInfo.uiDC.startBackgroundTrack = &trap_S_StartBackgroundTrack; - uiInfo.uiDC.stopBackgroundTrack = &trap_S_StopBackgroundTrack; - uiInfo.uiDC.playCinematic = &UI_PlayCinematic; - uiInfo.uiDC.stopCinematic = &UI_StopCinematic; - uiInfo.uiDC.drawCinematic = &UI_DrawCinematic; - uiInfo.uiDC.runCinematicFrame = &UI_RunCinematicFrame; - - Init_Display(&uiInfo.uiDC); - - String_Init(); - - uiInfo.uiDC.cursor = trap_R_RegisterShaderNoMip( "menu/art/3_cursor2" ); - uiInfo.uiDC.whiteShader = trap_R_RegisterShaderNoMip( "white" ); - - AssetCache(); - - start = trap_Milliseconds(); - - uiInfo.teamCount = 0; - uiInfo.characterCount = 0; - uiInfo.aliasCount = 0; - -#ifdef PRE_RELEASE_TADEMO - UI_ParseTeamInfo("demoteaminfo.txt"); - UI_ParseGameInfo("demogameinfo.txt"); -#else - UI_ParseTeamInfo("teaminfo.txt"); - UI_LoadTeams(); - UI_ParseGameInfo("gameinfo.txt"); -#endif - - menuSet = UI_Cvar_VariableString("ui_menuFiles"); - if (menuSet == NULL || menuSet[0] == '\0') { - menuSet = "ui/menus.txt"; - } - -#if 0 - if (uiInfo.inGameLoad) { - UI_LoadMenus("ui/ingame.txt", qtrue); - } else { // bk010222: left this: UI_LoadMenus(menuSet, qtrue); - } -#else - UI_LoadMenus(menuSet, qtrue); - UI_LoadMenus("ui/ingame.txt", qfalse); -#endif - - Menus_CloseAll(); - - trap_LAN_LoadCachedServers(); - UI_LoadBestScores(uiInfo.mapList[ui_currentMap.integer].mapLoadName, uiInfo.gameTypes[ui_gameType.integer].gtEnum); - - UI_BuildQ3Model_List(); - UI_LoadBots(); - - // sets defaults for ui temp cvars - uiInfo.effectsColor = gamecodetoui[(int)trap_Cvar_VariableValue("color1")-1]; - uiInfo.currentCrosshair = (int)trap_Cvar_VariableValue("cg_drawCrosshair"); - trap_Cvar_Set("ui_mousePitch", (trap_Cvar_VariableValue("m_pitch") >= 0) ? "0" : "1"); - - uiInfo.serverStatus.currentServerCinematic = -1; - uiInfo.previewMovie = -1; - - if (trap_Cvar_VariableValue("ui_TeamArenaFirstRun") == 0) { - trap_Cvar_Set("s_volume", "0.8"); - trap_Cvar_Set("s_musicvolume", "0.5"); - trap_Cvar_Set("ui_TeamArenaFirstRun", "1"); - } - - trap_Cvar_Register(NULL, "debug_protocol", "", 0 ); - - trap_Cvar_Set("ui_actualNetGameType", va("%d", ui_netGameType.integer)); -} - - -/* -================= -UI_KeyEvent -================= -*/ -void _UI_KeyEvent( int key, qboolean down ) { - - if (Menu_Count() > 0) { - menuDef_t *menu = Menu_GetFocused(); - if (menu) { - if (key == K_ESCAPE && down && !Menus_AnyFullScreenVisible()) { - Menus_CloseAll(); - } else { - Menu_HandleKey(menu, key, down ); - } - } else { - trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI ); - trap_Key_ClearStates(); - trap_Cvar_Set( "cl_paused", "0" ); - } - } - - //if ((s > 0) && (s != menu_null_sound)) { - // trap_S_StartLocalSound( s, CHAN_LOCAL_SOUND ); - //} -} - -/* -================= -UI_MouseEvent -================= -*/ -void _UI_MouseEvent( int dx, int dy ) -{ - // update mouse screen position - uiInfo.uiDC.cursorx += dx; - if (uiInfo.uiDC.cursorx < 0) - uiInfo.uiDC.cursorx = 0; - else if (uiInfo.uiDC.cursorx > SCREEN_WIDTH) - uiInfo.uiDC.cursorx = SCREEN_WIDTH; - - uiInfo.uiDC.cursory += dy; - if (uiInfo.uiDC.cursory < 0) - uiInfo.uiDC.cursory = 0; - else if (uiInfo.uiDC.cursory > SCREEN_HEIGHT) - uiInfo.uiDC.cursory = SCREEN_HEIGHT; - - if (Menu_Count() > 0) { - //menuDef_t *menu = Menu_GetFocused(); - //Menu_HandleMouseMove(menu, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory); - Display_MouseMove(NULL, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory); - } - -} - -void UI_LoadNonIngame() { - const char *menuSet = UI_Cvar_VariableString("ui_menuFiles"); - if (menuSet == NULL || menuSet[0] == '\0') { - menuSet = "ui/menus.txt"; - } - UI_LoadMenus(menuSet, qfalse); - uiInfo.inGameLoad = qfalse; -} - -void _UI_SetActiveMenu( uiMenuCommand_t menu ) { - char buf[256]; - - // this should be the ONLY way the menu system is brought up - // enusure minumum menu data is cached - if (Menu_Count() > 0) { - vec3_t v; - v[0] = v[1] = v[2] = 0; - switch ( menu ) { - case UIMENU_NONE: - trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI ); - trap_Key_ClearStates(); - trap_Cvar_Set( "cl_paused", "0" ); - Menus_CloseAll(); - - return; - case UIMENU_MAIN: - //trap_Cvar_Set( "sv_killserver", "1" ); - trap_Key_SetCatcher( KEYCATCH_UI ); - //trap_S_StartLocalSound( trap_S_RegisterSound("sound/misc/menu_background.wav", qfalse) , CHAN_LOCAL_SOUND ); - //trap_S_StartBackgroundTrack("sound/misc/menu_background.wav", NULL); - if (uiInfo.inGameLoad) { - UI_LoadNonIngame(); - } - Menus_CloseAll(); - Menus_ActivateByName("main"); - trap_Cvar_VariableStringBuffer("com_errorMessage", buf, sizeof(buf)); - if (strlen(buf)) { - if (!ui_singlePlayerActive.integer) { - Menus_ActivateByName("error_popmenu"); - } else { - trap_Cvar_Set("com_errorMessage", ""); - } - } - return; - case UIMENU_TEAM: - trap_Key_SetCatcher( KEYCATCH_UI ); - Menus_ActivateByName("team"); - return; - case UIMENU_NEED_CD: - // no cd check in TA - //trap_Key_SetCatcher( KEYCATCH_UI ); - //Menus_ActivateByName("needcd"); - //UI_ConfirmMenu( "Insert the CD", NULL, NeedCDAction ); - return; - case UIMENU_BAD_CD_KEY: - // no cd check in TA - //trap_Key_SetCatcher( KEYCATCH_UI ); - //Menus_ActivateByName("badcd"); - //UI_ConfirmMenu( "Bad CD Key", NULL, NeedCDKeyAction ); - return; - case UIMENU_POSTGAME: - //trap_Cvar_Set( "sv_killserver", "1" ); - trap_Key_SetCatcher( KEYCATCH_UI ); - if (uiInfo.inGameLoad) { - UI_LoadNonIngame(); - } - Menus_CloseAll(); - Menus_ActivateByName("endofgame"); - //UI_ConfirmMenu( "Bad CD Key", NULL, NeedCDKeyAction ); - return; - case UIMENU_INGAME: - trap_Cvar_Set( "cl_paused", "1" ); - trap_Key_SetCatcher( KEYCATCH_UI ); - UI_BuildPlayerList(); - Menus_CloseAll(); - Menus_ActivateByName("ingame"); - return; - } - } -} - -qboolean _UI_IsFullscreen( void ) { - return Menus_AnyFullScreenVisible(); -} - - - -static connstate_t lastConnState; -static char lastLoadingText[MAX_INFO_VALUE]; - -static void UI_ReadableSize ( char *buf, int bufsize, int value ) -{ - if (value > 1024*1024*1024 ) { // gigs - Com_sprintf( buf, bufsize, "%d", value / (1024*1024*1024) ); - Com_sprintf( buf+strlen(buf), bufsize-strlen(buf), ".%02d GB", - (value % (1024*1024*1024))*100 / (1024*1024*1024) ); - } else if (value > 1024*1024 ) { // megs - Com_sprintf( buf, bufsize, "%d", value / (1024*1024) ); - Com_sprintf( buf+strlen(buf), bufsize-strlen(buf), ".%02d MB", - (value % (1024*1024))*100 / (1024*1024) ); - } else if (value > 1024 ) { // kilos - Com_sprintf( buf, bufsize, "%d KB", value / 1024 ); - } else { // bytes - Com_sprintf( buf, bufsize, "%d bytes", value ); - } -} - -// Assumes time is in msec -static void UI_PrintTime ( char *buf, int bufsize, int time ) { - time /= 1000; // change to seconds - - if (time > 3600) { // in the hours range - Com_sprintf( buf, bufsize, "%d hr %d min", time / 3600, (time % 3600) / 60 ); - } else if (time > 60) { // mins - Com_sprintf( buf, bufsize, "%d min %d sec", time / 60, time % 60 ); - } else { // secs - Com_sprintf( buf, bufsize, "%d sec", time ); - } -} - -void Text_PaintCenter(float x, float y, float scale, vec4_t color, const char *text, float adjust) { - int len = Text_Width(text, scale, 0); - Text_Paint(x - len / 2, y, scale, color, text, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE); -} - -void Text_PaintCenter_AutoWrapped(float x, float y, float xmax, float ystep, float scale, vec4_t color, const char *str, float adjust) { - int width; - char *s1,*s2,*s3; - char c_bcp; - char buf[1024]; - - if (!str || str[0]=='\0') - return; - - Q_strncpyz(buf, str, sizeof(buf)); - s1 = s2 = s3 = buf; - - while (1) { - do { - s3++; - } while (*s3!=' ' && *s3!='\0'); - c_bcp = *s3; - *s3 = '\0'; - width = Text_Width(s1, scale, 0); - *s3 = c_bcp; - if (width > xmax) { - if (s1==s2) - { - // fuck, don't have a clean cut, we'll overflow - s2 = s3; - } - *s2 = '\0'; - Text_PaintCenter(x, y, scale, color, s1, adjust); - y += ystep; - if (c_bcp == '\0') - { - // that was the last word - // we could start a new loop, but that wouldn't be much use - // even if the word is too long, we would overflow it (see above) - // so just print it now if needed - s2++; - if (*s2 != '\0') // if we are printing an overflowing line we have s2 == s3 - Text_PaintCenter(x, y, scale, color, s2, adjust); - break; - } - s2++; - s1 = s2; - s3 = s2; - } - else - { - s2 = s3; - if (c_bcp == '\0') // we reached the end - { - Text_PaintCenter(x, y, scale, color, s1, adjust); - break; - } - } - } -} - -static void UI_DisplayDownloadInfo( const char *downloadName, float centerPoint, float yStart, float scale ) { - static char dlText[] = "Downloading:"; - static char etaText[] = "Estimated time left:"; - static char xferText[] = "Transfer rate:"; - - int downloadSize, downloadCount, downloadTime; - char dlSizeBuf[64], totalSizeBuf[64], xferRateBuf[64], dlTimeBuf[64]; - int xferRate; - int leftWidth; - const char *s; - - downloadSize = trap_Cvar_VariableValue( "cl_downloadSize" ); - downloadCount = trap_Cvar_VariableValue( "cl_downloadCount" ); - downloadTime = trap_Cvar_VariableValue( "cl_downloadTime" ); - - leftWidth = 320; - - UI_SetColor(colorWhite); - Text_PaintCenter(centerPoint, yStart + 112, scale, colorWhite, dlText, 0); - Text_PaintCenter(centerPoint, yStart + 192, scale, colorWhite, etaText, 0); - Text_PaintCenter(centerPoint, yStart + 248, scale, colorWhite, xferText, 0); - - if (downloadSize > 0) { - s = va( "%s (%d%%)", downloadName, downloadCount * 100 / downloadSize ); - } else { - s = downloadName; - } - - Text_PaintCenter(centerPoint, yStart+136, scale, colorWhite, s, 0); - - UI_ReadableSize( dlSizeBuf, sizeof dlSizeBuf, downloadCount ); - UI_ReadableSize( totalSizeBuf, sizeof totalSizeBuf, downloadSize ); - - if (downloadCount < 4096 || !downloadTime) { - Text_PaintCenter(leftWidth, yStart+216, scale, colorWhite, "estimating", 0); - Text_PaintCenter(leftWidth, yStart+160, scale, colorWhite, va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), 0); - } else { - if ((uiInfo.uiDC.realTime - downloadTime) / 1000) { - xferRate = downloadCount / ((uiInfo.uiDC.realTime - downloadTime) / 1000); - } else { - xferRate = 0; - } - UI_ReadableSize( xferRateBuf, sizeof xferRateBuf, xferRate ); - - // Extrapolate estimated completion time - if (downloadSize && xferRate) { - int n = downloadSize / xferRate; // estimated time for entire d/l in secs - - // We do it in K (/1024) because we'd overflow around 4MB - UI_PrintTime ( dlTimeBuf, sizeof dlTimeBuf, - (n - (((downloadCount/1024) * n) / (downloadSize/1024))) * 1000); - - Text_PaintCenter(leftWidth, yStart+216, scale, colorWhite, dlTimeBuf, 0); - Text_PaintCenter(leftWidth, yStart+160, scale, colorWhite, va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), 0); - } else { - Text_PaintCenter(leftWidth, yStart+216, scale, colorWhite, "estimating", 0); - if (downloadSize) { - Text_PaintCenter(leftWidth, yStart+160, scale, colorWhite, va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), 0); - } else { - Text_PaintCenter(leftWidth, yStart+160, scale, colorWhite, va("(%s copied)", dlSizeBuf), 0); - } - } - - if (xferRate) { - Text_PaintCenter(leftWidth, yStart+272, scale, colorWhite, va("%s/Sec", xferRateBuf), 0); - } - } -} - -/* -======================== -UI_DrawConnectScreen - -This will also be overlaid on the cgame info screen during loading -to prevent it from blinking away too rapidly on local or lan games. -======================== -*/ -void UI_DrawConnectScreen( qboolean overlay ) { - char *s; - uiClientState_t cstate; - char info[MAX_INFO_VALUE]; - char text[256]; - float centerPoint, yStart, scale; - - menuDef_t *menu = Menus_FindByName("Connect"); - - - if ( !overlay && menu ) { - Menu_Paint(menu, qtrue); - } - - if (!overlay) { - centerPoint = 320; - yStart = 130; - scale = 0.5f; - } else { - centerPoint = 320; - yStart = 32; - scale = 0.6f; - return; - } - - // see what information we should display - trap_GetClientState( &cstate ); - - info[0] = '\0'; - if( trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ) ) { - Text_PaintCenter(centerPoint, yStart, scale, colorWhite, va( "Loading %s", Info_ValueForKey( info, "mapname" )), 0); - } - - if (!Q_stricmp(cstate.servername,"localhost")) { - Text_PaintCenter(centerPoint, yStart + 48, scale, colorWhite, va("Starting up..."), ITEM_TEXTSTYLE_SHADOWEDMORE); - } else { - strcpy(text, va("Connecting to %s", cstate.servername)); - Text_PaintCenter(centerPoint, yStart + 48, scale, colorWhite,text , ITEM_TEXTSTYLE_SHADOWEDMORE); - } - - // display global MOTD at bottom - Text_PaintCenter(centerPoint, 600, scale, colorWhite, Info_ValueForKey( cstate.updateInfoString, "motd" ), 0); - // print any server info (server full, bad version, etc) - if ( cstate.connState < CA_CONNECTED ) { - Text_PaintCenter_AutoWrapped(centerPoint, yStart + 176, 630, 20, scale, colorWhite, cstate.messageString, 0); - } - - if ( lastConnState > cstate.connState ) { - lastLoadingText[0] = '\0'; - } - lastConnState = cstate.connState; - - switch ( cstate.connState ) { - case CA_CONNECTING: - s = va("Awaiting connection...%i", cstate.connectPacketCount); - break; - case CA_CHALLENGING: - s = va("Awaiting challenge...%i", cstate.connectPacketCount); - break; - case CA_CONNECTED: { - char downloadName[MAX_INFO_VALUE]; - - trap_Cvar_VariableStringBuffer( "cl_downloadName", downloadName, sizeof(downloadName) ); - if (*downloadName) { - UI_DisplayDownloadInfo( downloadName, centerPoint, yStart, scale ); - return; - } - } - s = "Awaiting gamestate..."; - break; - case CA_LOADING: - return; - case CA_PRIMED: - return; - default: - return; - } - - - if (Q_stricmp(cstate.servername,"localhost")) { - Text_PaintCenter(centerPoint, yStart + 80, scale, colorWhite, s, 0); - } - - // password required / connection rejected information goes here -} - - -/* -================ -cvars -================ -*/ - -typedef struct { - vmCvar_t *vmCvar; - char *cvarName; - char *defaultString; - int cvarFlags; -} cvarTable_t; - -vmCvar_t ui_ffa_fraglimit; -vmCvar_t ui_ffa_timelimit; - -vmCvar_t ui_tourney_fraglimit; -vmCvar_t ui_tourney_timelimit; - -vmCvar_t ui_team_fraglimit; -vmCvar_t ui_team_timelimit; -vmCvar_t ui_team_friendly; - -vmCvar_t ui_ctf_capturelimit; -vmCvar_t ui_ctf_timelimit; -vmCvar_t ui_ctf_friendly; - -vmCvar_t ui_arenasFile; -vmCvar_t ui_botsFile; -vmCvar_t ui_spScores1; -vmCvar_t ui_spScores2; -vmCvar_t ui_spScores3; -vmCvar_t ui_spScores4; -vmCvar_t ui_spScores5; -vmCvar_t ui_spAwards; -vmCvar_t ui_spVideos; -vmCvar_t ui_spSkill; - -vmCvar_t ui_spSelection; - -vmCvar_t ui_browserMaster; -vmCvar_t ui_browserGameType; -vmCvar_t ui_browserSortKey; -vmCvar_t ui_browserShowFull; -vmCvar_t ui_browserShowEmpty; - -vmCvar_t ui_brassTime; -vmCvar_t ui_drawCrosshair; -vmCvar_t ui_drawCrosshairNames; -vmCvar_t ui_marks; - -vmCvar_t ui_server1; -vmCvar_t ui_server2; -vmCvar_t ui_server3; -vmCvar_t ui_server4; -vmCvar_t ui_server5; -vmCvar_t ui_server6; -vmCvar_t ui_server7; -vmCvar_t ui_server8; -vmCvar_t ui_server9; -vmCvar_t ui_server10; -vmCvar_t ui_server11; -vmCvar_t ui_server12; -vmCvar_t ui_server13; -vmCvar_t ui_server14; -vmCvar_t ui_server15; -vmCvar_t ui_server16; - -vmCvar_t ui_cdkeychecked; - -vmCvar_t ui_redteam; -vmCvar_t ui_redteam1; -vmCvar_t ui_redteam2; -vmCvar_t ui_redteam3; -vmCvar_t ui_redteam4; -vmCvar_t ui_redteam5; -vmCvar_t ui_blueteam; -vmCvar_t ui_blueteam1; -vmCvar_t ui_blueteam2; -vmCvar_t ui_blueteam3; -vmCvar_t ui_blueteam4; -vmCvar_t ui_blueteam5; -vmCvar_t ui_teamName; -vmCvar_t ui_dedicated; -vmCvar_t ui_gameType; -vmCvar_t ui_netGameType; -vmCvar_t ui_actualNetGameType; -vmCvar_t ui_joinGameType; -vmCvar_t ui_netSource; -vmCvar_t ui_serverFilterType; -vmCvar_t ui_opponentName; -vmCvar_t ui_menuFiles; -vmCvar_t ui_currentTier; -vmCvar_t ui_currentMap; -vmCvar_t ui_currentNetMap; -vmCvar_t ui_mapIndex; -vmCvar_t ui_currentOpponent; -vmCvar_t ui_selectedPlayer; -vmCvar_t ui_selectedPlayerName; -vmCvar_t ui_lastServerRefresh_0; -vmCvar_t ui_lastServerRefresh_1; -vmCvar_t ui_lastServerRefresh_2; -vmCvar_t ui_lastServerRefresh_3; -vmCvar_t ui_singlePlayerActive; -vmCvar_t ui_scoreAccuracy; -vmCvar_t ui_scoreImpressives; -vmCvar_t ui_scoreExcellents; -vmCvar_t ui_scoreCaptures; -vmCvar_t ui_scoreDefends; -vmCvar_t ui_scoreAssists; -vmCvar_t ui_scoreGauntlets; -vmCvar_t ui_scoreScore; -vmCvar_t ui_scorePerfect; -vmCvar_t ui_scoreTeam; -vmCvar_t ui_scoreBase; -vmCvar_t ui_scoreTimeBonus; -vmCvar_t ui_scoreSkillBonus; -vmCvar_t ui_scoreShutoutBonus; -vmCvar_t ui_scoreTime; -vmCvar_t ui_captureLimit; -vmCvar_t ui_fragLimit; -vmCvar_t ui_smallFont; -vmCvar_t ui_bigFont; -vmCvar_t ui_findPlayer; -vmCvar_t ui_Q3Model; -vmCvar_t ui_hudFiles; -vmCvar_t ui_recordSPDemo; -vmCvar_t ui_realCaptureLimit; -vmCvar_t ui_realWarmUp; -vmCvar_t ui_serverStatusTimeOut; - - -// bk001129 - made static to avoid aliasing -static cvarTable_t cvarTable[] = { - { &ui_ffa_fraglimit, "ui_ffa_fraglimit", "20", CVAR_ARCHIVE }, - { &ui_ffa_timelimit, "ui_ffa_timelimit", "0", CVAR_ARCHIVE }, - - { &ui_tourney_fraglimit, "ui_tourney_fraglimit", "0", CVAR_ARCHIVE }, - { &ui_tourney_timelimit, "ui_tourney_timelimit", "15", CVAR_ARCHIVE }, - - { &ui_team_fraglimit, "ui_team_fraglimit", "0", CVAR_ARCHIVE }, - { &ui_team_timelimit, "ui_team_timelimit", "20", CVAR_ARCHIVE }, - { &ui_team_friendly, "ui_team_friendly", "1", CVAR_ARCHIVE }, - - { &ui_ctf_capturelimit, "ui_ctf_capturelimit", "8", CVAR_ARCHIVE }, - { &ui_ctf_timelimit, "ui_ctf_timelimit", "30", CVAR_ARCHIVE }, - { &ui_ctf_friendly, "ui_ctf_friendly", "0", CVAR_ARCHIVE }, - - { &ui_arenasFile, "g_arenasFile", "", CVAR_INIT|CVAR_ROM }, - { &ui_botsFile, "g_botsFile", "", CVAR_INIT|CVAR_ROM }, - { &ui_spScores1, "g_spScores1", "", CVAR_ARCHIVE | CVAR_ROM }, - { &ui_spScores2, "g_spScores2", "", CVAR_ARCHIVE | CVAR_ROM }, - { &ui_spScores3, "g_spScores3", "", CVAR_ARCHIVE | CVAR_ROM }, - { &ui_spScores4, "g_spScores4", "", CVAR_ARCHIVE | CVAR_ROM }, - { &ui_spScores5, "g_spScores5", "", CVAR_ARCHIVE | CVAR_ROM }, - { &ui_spAwards, "g_spAwards", "", CVAR_ARCHIVE | CVAR_ROM }, - { &ui_spVideos, "g_spVideos", "", CVAR_ARCHIVE | CVAR_ROM }, - { &ui_spSkill, "g_spSkill", "2", CVAR_ARCHIVE }, - - { &ui_spSelection, "ui_spSelection", "", CVAR_ROM }, - - { &ui_browserMaster, "ui_browserMaster", "0", CVAR_ARCHIVE }, - { &ui_browserGameType, "ui_browserGameType", "0", CVAR_ARCHIVE }, - { &ui_browserSortKey, "ui_browserSortKey", "4", CVAR_ARCHIVE }, - { &ui_browserShowFull, "ui_browserShowFull", "1", CVAR_ARCHIVE }, - { &ui_browserShowEmpty, "ui_browserShowEmpty", "1", CVAR_ARCHIVE }, - - { &ui_brassTime, "cg_brassTime", "2500", CVAR_ARCHIVE }, - { &ui_drawCrosshair, "cg_drawCrosshair", "4", CVAR_ARCHIVE }, - { &ui_drawCrosshairNames, "cg_drawCrosshairNames", "1", CVAR_ARCHIVE }, - { &ui_marks, "cg_marks", "1", CVAR_ARCHIVE }, - - { &ui_server1, "server1", "", CVAR_ARCHIVE }, - { &ui_server2, "server2", "", CVAR_ARCHIVE }, - { &ui_server3, "server3", "", CVAR_ARCHIVE }, - { &ui_server4, "server4", "", CVAR_ARCHIVE }, - { &ui_server5, "server5", "", CVAR_ARCHIVE }, - { &ui_server6, "server6", "", CVAR_ARCHIVE }, - { &ui_server7, "server7", "", CVAR_ARCHIVE }, - { &ui_server8, "server8", "", CVAR_ARCHIVE }, - { &ui_server9, "server9", "", CVAR_ARCHIVE }, - { &ui_server10, "server10", "", CVAR_ARCHIVE }, - { &ui_server11, "server11", "", CVAR_ARCHIVE }, - { &ui_server12, "server12", "", CVAR_ARCHIVE }, - { &ui_server13, "server13", "", CVAR_ARCHIVE }, - { &ui_server14, "server14", "", CVAR_ARCHIVE }, - { &ui_server15, "server15", "", CVAR_ARCHIVE }, - { &ui_server16, "server16", "", CVAR_ARCHIVE }, - { &ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM }, - { &ui_new, "ui_new", "0", CVAR_TEMP }, - { &ui_debug, "ui_debug", "0", CVAR_TEMP }, - { &ui_initialized, "ui_initialized", "0", CVAR_TEMP }, - { &ui_teamName, "ui_teamName", "Pagans", CVAR_ARCHIVE }, - { &ui_opponentName, "ui_opponentName", "Stroggs", CVAR_ARCHIVE }, - { &ui_redteam, "ui_redteam", "Pagans", CVAR_ARCHIVE }, - { &ui_blueteam, "ui_blueteam", "Stroggs", CVAR_ARCHIVE }, - { &ui_dedicated, "ui_dedicated", "0", CVAR_ARCHIVE }, - { &ui_gameType, "ui_gametype", "3", CVAR_ARCHIVE }, - { &ui_joinGameType, "ui_joinGametype", "0", CVAR_ARCHIVE }, - { &ui_netGameType, "ui_netGametype", "3", CVAR_ARCHIVE }, - { &ui_actualNetGameType, "ui_actualNetGametype", "3", CVAR_ARCHIVE }, - { &ui_redteam1, "ui_redteam1", "0", CVAR_ARCHIVE }, - { &ui_redteam2, "ui_redteam2", "0", CVAR_ARCHIVE }, - { &ui_redteam3, "ui_redteam3", "0", CVAR_ARCHIVE }, - { &ui_redteam4, "ui_redteam4", "0", CVAR_ARCHIVE }, - { &ui_redteam5, "ui_redteam5", "0", CVAR_ARCHIVE }, - { &ui_blueteam1, "ui_blueteam1", "0", CVAR_ARCHIVE }, - { &ui_blueteam2, "ui_blueteam2", "0", CVAR_ARCHIVE }, - { &ui_blueteam3, "ui_blueteam3", "0", CVAR_ARCHIVE }, - { &ui_blueteam4, "ui_blueteam4", "0", CVAR_ARCHIVE }, - { &ui_blueteam5, "ui_blueteam5", "0", CVAR_ARCHIVE }, - { &ui_netSource, "ui_netSource", "0", CVAR_ARCHIVE }, - { &ui_menuFiles, "ui_menuFiles", "ui/menus.txt", CVAR_ARCHIVE }, - { &ui_currentTier, "ui_currentTier", "0", CVAR_ARCHIVE }, - { &ui_currentMap, "ui_currentMap", "0", CVAR_ARCHIVE }, - { &ui_currentNetMap, "ui_currentNetMap", "0", CVAR_ARCHIVE }, - { &ui_mapIndex, "ui_mapIndex", "0", CVAR_ARCHIVE }, - { &ui_currentOpponent, "ui_currentOpponent", "0", CVAR_ARCHIVE }, - { &ui_selectedPlayer, "cg_selectedPlayer", "0", CVAR_ARCHIVE}, - { &ui_selectedPlayerName, "cg_selectedPlayerName", "", CVAR_ARCHIVE}, - { &ui_lastServerRefresh_0, "ui_lastServerRefresh_0", "", CVAR_ARCHIVE}, - { &ui_lastServerRefresh_1, "ui_lastServerRefresh_1", "", CVAR_ARCHIVE}, - { &ui_lastServerRefresh_2, "ui_lastServerRefresh_2", "", CVAR_ARCHIVE}, - { &ui_lastServerRefresh_3, "ui_lastServerRefresh_3", "", CVAR_ARCHIVE}, - { &ui_singlePlayerActive, "ui_singlePlayerActive", "0", 0}, - { &ui_scoreAccuracy, "ui_scoreAccuracy", "0", CVAR_ARCHIVE}, - { &ui_scoreImpressives, "ui_scoreImpressives", "0", CVAR_ARCHIVE}, - { &ui_scoreExcellents, "ui_scoreExcellents", "0", CVAR_ARCHIVE}, - { &ui_scoreCaptures, "ui_scoreCaptures", "0", CVAR_ARCHIVE}, - { &ui_scoreDefends, "ui_scoreDefends", "0", CVAR_ARCHIVE}, - { &ui_scoreAssists, "ui_scoreAssists", "0", CVAR_ARCHIVE}, - { &ui_scoreGauntlets, "ui_scoreGauntlets", "0",CVAR_ARCHIVE}, - { &ui_scoreScore, "ui_scoreScore", "0", CVAR_ARCHIVE}, - { &ui_scorePerfect, "ui_scorePerfect", "0", CVAR_ARCHIVE}, - { &ui_scoreTeam, "ui_scoreTeam", "0 to 0", CVAR_ARCHIVE}, - { &ui_scoreBase, "ui_scoreBase", "0", CVAR_ARCHIVE}, - { &ui_scoreTime, "ui_scoreTime", "00:00", CVAR_ARCHIVE}, - { &ui_scoreTimeBonus, "ui_scoreTimeBonus", "0", CVAR_ARCHIVE}, - { &ui_scoreSkillBonus, "ui_scoreSkillBonus", "0", CVAR_ARCHIVE}, - { &ui_scoreShutoutBonus, "ui_scoreShutoutBonus", "0", CVAR_ARCHIVE}, - { &ui_fragLimit, "ui_fragLimit", "10", 0}, - { &ui_captureLimit, "ui_captureLimit", "5", 0}, - { &ui_smallFont, "ui_smallFont", "0.25", CVAR_ARCHIVE}, - { &ui_bigFont, "ui_bigFont", "0.4", CVAR_ARCHIVE}, - { &ui_findPlayer, "ui_findPlayer", "Sarge", CVAR_ARCHIVE}, - { &ui_Q3Model, "ui_q3model", "0", CVAR_ARCHIVE}, - { &ui_hudFiles, "cg_hudFiles", "ui/hud.txt", CVAR_ARCHIVE}, - { &ui_recordSPDemo, "ui_recordSPDemo", "0", CVAR_ARCHIVE}, - { &ui_teamArenaFirstRun, "ui_teamArenaFirstRun", "0", CVAR_ARCHIVE}, - { &ui_realWarmUp, "g_warmup", "20", CVAR_ARCHIVE}, - { &ui_realCaptureLimit, "capturelimit", "8", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART}, - { &ui_serverStatusTimeOut, "ui_serverStatusTimeOut", "7000", CVAR_ARCHIVE}, - -}; - -// bk001129 - made static to avoid aliasing -static int cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0]); - - -/* -================= -UI_RegisterCvars -================= -*/ -void UI_RegisterCvars( void ) { - int i; - cvarTable_t *cv; - - for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) { - trap_Cvar_Register( cv->vmCvar, cv->cvarName, cv->defaultString, cv->cvarFlags ); - } -} - -/* -================= -UI_UpdateCvars -================= -*/ -void UI_UpdateCvars( void ) { - int i; - cvarTable_t *cv; - - for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) { - trap_Cvar_Update( cv->vmCvar ); - } -} - - -/* -================= -ArenaServers_StopRefresh -================= -*/ -static void UI_StopServerRefresh( void ) -{ - int count; - - if (!uiInfo.serverStatus.refreshActive) { - // not currently refreshing - return; - } - uiInfo.serverStatus.refreshActive = qfalse; - Com_Printf("%d servers listed in browser with %d players.\n", - uiInfo.serverStatus.numDisplayServers, - uiInfo.serverStatus.numPlayersOnServers); - count = trap_LAN_GetServerCount(ui_netSource.integer); - if (count - uiInfo.serverStatus.numDisplayServers > 0) { - Com_Printf("%d servers not listed due to packet loss or pings higher than %d\n", - count - uiInfo.serverStatus.numDisplayServers, - (int) trap_Cvar_VariableValue("cl_maxPing")); - } - -} - -/* -================= -ArenaServers_MaxPing -================= -*/ -#ifndef MISSIONPACK // bk001206 -static int ArenaServers_MaxPing( void ) { - int maxPing; - - maxPing = (int)trap_Cvar_VariableValue( "cl_maxPing" ); - if( maxPing < 100 ) { - maxPing = 100; - } - return maxPing; -} -#endif - -/* -================= -UI_DoServerRefresh -================= -*/ -static void UI_DoServerRefresh( void ) -{ - qboolean wait = qfalse; - - if (!uiInfo.serverStatus.refreshActive) { - return; - } - if (ui_netSource.integer != AS_FAVORITES) { - if (ui_netSource.integer == AS_LOCAL) { - if (!trap_LAN_GetServerCount(ui_netSource.integer)) { - wait = qtrue; - } - } else { - if (trap_LAN_GetServerCount(ui_netSource.integer) < 0) { - wait = qtrue; - } - } - } - - if (uiInfo.uiDC.realTime < uiInfo.serverStatus.refreshtime) { - if (wait) { - return; - } - } - - // if still trying to retrieve pings - if (trap_LAN_UpdateVisiblePings(ui_netSource.integer)) { - uiInfo.serverStatus.refreshtime = uiInfo.uiDC.realTime + 1000; - } else if (!wait) { - // get the last servers in the list - UI_BuildServerDisplayList(2); - // stop the refresh - UI_StopServerRefresh(); - } - // - UI_BuildServerDisplayList(qfalse); -} - -/* -================= -UI_StartServerRefresh -================= -*/ -static void UI_StartServerRefresh(qboolean full) -{ - int i; - char *ptr; - - qtime_t q; - trap_RealTime(&q); - trap_Cvar_Set( va("ui_lastServerRefresh_%i", ui_netSource.integer), va("%s-%i, %i at %i:%i", MonthAbbrev[q.tm_mon],q.tm_mday, 1900+q.tm_year,q.tm_hour,q.tm_min)); - - if (!full) { - UI_UpdatePendingPings(); - return; - } - - uiInfo.serverStatus.refreshActive = qtrue; - uiInfo.serverStatus.nextDisplayRefresh = uiInfo.uiDC.realTime + 1000; - // clear number of displayed servers - uiInfo.serverStatus.numDisplayServers = 0; - uiInfo.serverStatus.numPlayersOnServers = 0; - // mark all servers as visible so we store ping updates for them - trap_LAN_MarkServerVisible(ui_netSource.integer, -1, qtrue); - // reset all the pings - trap_LAN_ResetPings(ui_netSource.integer); - // - if( ui_netSource.integer == AS_LOCAL ) { - trap_Cmd_ExecuteText( EXEC_NOW, "localservers\n" ); - uiInfo.serverStatus.refreshtime = uiInfo.uiDC.realTime + 1000; - return; - } - - uiInfo.serverStatus.refreshtime = uiInfo.uiDC.realTime + 5000; - if( ui_netSource.integer == AS_GLOBAL || ui_netSource.integer == AS_MPLAYER ) { - if( ui_netSource.integer == AS_GLOBAL ) { - i = 0; - } - else { - i = 1; - } - - ptr = UI_Cvar_VariableString("debug_protocol"); - if (strlen(ptr)) { - trap_Cmd_ExecuteText( EXEC_NOW, va( "globalservers %d %s full empty\n", i, ptr)); - } - else { - trap_Cmd_ExecuteText( EXEC_NOW, va( "globalservers %d %d full empty\n", i, (int)trap_Cvar_VariableValue( "protocol" ) ) ); - } - } -} - diff --git a/code/ui/ui_players.c b/code/ui/ui_players.c deleted file mode 100644 index b774815..0000000 --- a/code/ui/ui_players.c +++ /dev/null @@ -1,1378 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// -// ui_players.c - -#include "ui_local.h" - - -#define UI_TIMER_GESTURE 2300 -#define UI_TIMER_JUMP 1000 -#define UI_TIMER_LAND 130 -#define UI_TIMER_WEAPON_SWITCH 300 -#define UI_TIMER_ATTACK 500 -#define UI_TIMER_MUZZLE_FLASH 20 -#define UI_TIMER_WEAPON_DELAY 250 - -#define JUMP_HEIGHT 56 - -#define SWINGSPEED 0.3f - -#define SPIN_SPEED 0.9f -#define COAST_TIME 1000 - - -static int dp_realtime; -static float jumpHeight; -sfxHandle_t weaponChangeSound; - - -/* -=============== -UI_PlayerInfo_SetWeapon -=============== -*/ -static void UI_PlayerInfo_SetWeapon( playerInfo_t *pi, weapon_t weaponNum ) { - gitem_t * item; - char path[MAX_QPATH]; - - pi->currentWeapon = weaponNum; -tryagain: - pi->realWeapon = weaponNum; - pi->weaponModel = 0; - pi->barrelModel = 0; - pi->flashModel = 0; - - if ( weaponNum == WP_NONE ) { - return; - } - - for ( item = bg_itemlist + 1; item->classname ; item++ ) { - if ( item->giType != IT_WEAPON ) { - continue; - } - if ( item->giTag == weaponNum ) { - break; - } - } - - if ( item->classname ) { - pi->weaponModel = trap_R_RegisterModel( item->world_model[0] ); - } - - if( pi->weaponModel == 0 ) { - if( weaponNum == WP_MACHINEGUN ) { - weaponNum = WP_NONE; - goto tryagain; - } - weaponNum = WP_MACHINEGUN; - goto tryagain; - } - - if ( weaponNum == WP_MACHINEGUN || weaponNum == WP_GAUNTLET || weaponNum == WP_BFG ) { - strcpy( path, item->world_model[0] ); - COM_StripExtension( path, path ); - strcat( path, "_barrel.md3" ); - pi->barrelModel = trap_R_RegisterModel( path ); - } - - strcpy( path, item->world_model[0] ); - COM_StripExtension( path, path ); - strcat( path, "_flash.md3" ); - pi->flashModel = trap_R_RegisterModel( path ); - - switch( weaponNum ) { - case WP_GAUNTLET: - MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); - break; - - case WP_MACHINEGUN: - MAKERGB( pi->flashDlightColor, 1, 1, 0 ); - break; - - case WP_SHOTGUN: - MAKERGB( pi->flashDlightColor, 1, 1, 0 ); - break; - - case WP_GRENADE_LAUNCHER: - MAKERGB( pi->flashDlightColor, 1, 0.7f, 0.5f ); - break; - - case WP_ROCKET_LAUNCHER: - MAKERGB( pi->flashDlightColor, 1, 0.75f, 0 ); - break; - - case WP_LIGHTNING: - MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); - break; - - case WP_RAILGUN: - MAKERGB( pi->flashDlightColor, 1, 0.5f, 0 ); - break; - - case WP_PLASMAGUN: - MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); - break; - - case WP_BFG: - MAKERGB( pi->flashDlightColor, 1, 0.7f, 1 ); - break; - - case WP_GRAPPLING_HOOK: - MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); - break; - - default: - MAKERGB( pi->flashDlightColor, 1, 1, 1 ); - break; - } -} - - -/* -=============== -UI_ForceLegsAnim -=============== -*/ -static void UI_ForceLegsAnim( playerInfo_t *pi, int anim ) { - pi->legsAnim = ( ( pi->legsAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | anim; - - if ( anim == LEGS_JUMP ) { - pi->legsAnimationTimer = UI_TIMER_JUMP; - } -} - - -/* -=============== -UI_SetLegsAnim -=============== -*/ -static void UI_SetLegsAnim( playerInfo_t *pi, int anim ) { - if ( pi->pendingLegsAnim ) { - anim = pi->pendingLegsAnim; - pi->pendingLegsAnim = 0; - } - UI_ForceLegsAnim( pi, anim ); -} - - -/* -=============== -UI_ForceTorsoAnim -=============== -*/ -static void UI_ForceTorsoAnim( playerInfo_t *pi, int anim ) { - pi->torsoAnim = ( ( pi->torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | anim; - - if ( anim == TORSO_GESTURE ) { - pi->torsoAnimationTimer = UI_TIMER_GESTURE; - } - - if ( anim == TORSO_ATTACK || anim == TORSO_ATTACK2 ) { - pi->torsoAnimationTimer = UI_TIMER_ATTACK; - } -} - - -/* -=============== -UI_SetTorsoAnim -=============== -*/ -static void UI_SetTorsoAnim( playerInfo_t *pi, int anim ) { - if ( pi->pendingTorsoAnim ) { - anim = pi->pendingTorsoAnim; - pi->pendingTorsoAnim = 0; - } - - UI_ForceTorsoAnim( pi, anim ); -} - - -/* -=============== -UI_TorsoSequencing -=============== -*/ -static void UI_TorsoSequencing( playerInfo_t *pi ) { - int currentAnim; - - currentAnim = pi->torsoAnim & ~ANIM_TOGGLEBIT; - - if ( pi->weapon != pi->currentWeapon ) { - if ( currentAnim != TORSO_DROP ) { - pi->torsoAnimationTimer = UI_TIMER_WEAPON_SWITCH; - UI_ForceTorsoAnim( pi, TORSO_DROP ); - } - } - - if ( pi->torsoAnimationTimer > 0 ) { - return; - } - - if( currentAnim == TORSO_GESTURE ) { - UI_SetTorsoAnim( pi, TORSO_STAND ); - return; - } - - if( currentAnim == TORSO_ATTACK || currentAnim == TORSO_ATTACK2 ) { - UI_SetTorsoAnim( pi, TORSO_STAND ); - return; - } - - if ( currentAnim == TORSO_DROP ) { - UI_PlayerInfo_SetWeapon( pi, pi->weapon ); - pi->torsoAnimationTimer = UI_TIMER_WEAPON_SWITCH; - UI_ForceTorsoAnim( pi, TORSO_RAISE ); - return; - } - - if ( currentAnim == TORSO_RAISE ) { - UI_SetTorsoAnim( pi, TORSO_STAND ); - return; - } -} - - -/* -=============== -UI_LegsSequencing -=============== -*/ -static void UI_LegsSequencing( playerInfo_t *pi ) { - int currentAnim; - - currentAnim = pi->legsAnim & ~ANIM_TOGGLEBIT; - - if ( pi->legsAnimationTimer > 0 ) { - if ( currentAnim == LEGS_JUMP ) { - jumpHeight = JUMP_HEIGHT * sin( M_PI * ( UI_TIMER_JUMP - pi->legsAnimationTimer ) / UI_TIMER_JUMP ); - } - return; - } - - if ( currentAnim == LEGS_JUMP ) { - UI_ForceLegsAnim( pi, LEGS_LAND ); - pi->legsAnimationTimer = UI_TIMER_LAND; - jumpHeight = 0; - return; - } - - if ( currentAnim == LEGS_LAND ) { - UI_SetLegsAnim( pi, LEGS_IDLE ); - return; - } -} - - -/* -====================== -UI_PositionEntityOnTag -====================== -*/ -static void UI_PositionEntityOnTag( refEntity_t *entity, const refEntity_t *parent, - clipHandle_t parentModel, char *tagName ) { - int i; - orientation_t lerped; - - // lerp the tag - trap_CM_LerpTag( &lerped, parentModel, parent->oldframe, parent->frame, - 1.0 - parent->backlerp, tagName ); - - // FIXME: allow origin offsets along tag? - VectorCopy( parent->origin, entity->origin ); - for ( i = 0 ; i < 3 ; i++ ) { - VectorMA( entity->origin, lerped.origin[i], parent->axis[i], entity->origin ); - } - - // cast away const because of compiler problems - MatrixMultiply( lerped.axis, ((refEntity_t*)parent)->axis, entity->axis ); - entity->backlerp = parent->backlerp; -} - - -/* -====================== -UI_PositionRotatedEntityOnTag -====================== -*/ -static void UI_PositionRotatedEntityOnTag( refEntity_t *entity, const refEntity_t *parent, - clipHandle_t parentModel, char *tagName ) { - int i; - orientation_t lerped; - vec3_t tempAxis[3]; - - // lerp the tag - trap_CM_LerpTag( &lerped, parentModel, parent->oldframe, parent->frame, - 1.0 - parent->backlerp, tagName ); - - // FIXME: allow origin offsets along tag? - VectorCopy( parent->origin, entity->origin ); - for ( i = 0 ; i < 3 ; i++ ) { - VectorMA( entity->origin, lerped.origin[i], parent->axis[i], entity->origin ); - } - - // cast away const because of compiler problems - MatrixMultiply( entity->axis, ((refEntity_t *)parent)->axis, tempAxis ); - MatrixMultiply( lerped.axis, tempAxis, entity->axis ); -} - - -/* -=============== -UI_SetLerpFrameAnimation -=============== -*/ -static void UI_SetLerpFrameAnimation( playerInfo_t *ci, lerpFrame_t *lf, int newAnimation ) { - animation_t *anim; - - lf->animationNumber = newAnimation; - newAnimation &= ~ANIM_TOGGLEBIT; - - if ( newAnimation < 0 || newAnimation >= MAX_ANIMATIONS ) { - trap_Error( va("Bad animation number: %i", newAnimation) ); - } - - anim = &ci->animations[ newAnimation ]; - - lf->animation = anim; - lf->animationTime = lf->frameTime + anim->initialLerp; -} - - -/* -=============== -UI_RunLerpFrame -=============== -*/ -static void UI_RunLerpFrame( playerInfo_t *ci, lerpFrame_t *lf, int newAnimation ) { - int f; - animation_t *anim; - - // see if the animation sequence is switching - if ( newAnimation != lf->animationNumber || !lf->animation ) { - UI_SetLerpFrameAnimation( ci, lf, newAnimation ); - } - - // if we have passed the current frame, move it to - // oldFrame and calculate a new frame - if ( dp_realtime >= lf->frameTime ) { - lf->oldFrame = lf->frame; - lf->oldFrameTime = lf->frameTime; - - // get the next frame based on the animation - anim = lf->animation; - if ( dp_realtime < lf->animationTime ) { - lf->frameTime = lf->animationTime; // initial lerp - } else { - lf->frameTime = lf->oldFrameTime + anim->frameLerp; - } - f = ( lf->frameTime - lf->animationTime ) / anim->frameLerp; - if ( f >= anim->numFrames ) { - f -= anim->numFrames; - if ( anim->loopFrames ) { - f %= anim->loopFrames; - f += anim->numFrames - anim->loopFrames; - } else { - f = anim->numFrames - 1; - // the animation is stuck at the end, so it - // can immediately transition to another sequence - lf->frameTime = dp_realtime; - } - } - lf->frame = anim->firstFrame + f; - if ( dp_realtime > lf->frameTime ) { - lf->frameTime = dp_realtime; - } - } - - if ( lf->frameTime > dp_realtime + 200 ) { - lf->frameTime = dp_realtime; - } - - if ( lf->oldFrameTime > dp_realtime ) { - lf->oldFrameTime = dp_realtime; - } - // calculate current lerp value - if ( lf->frameTime == lf->oldFrameTime ) { - lf->backlerp = 0; - } else { - lf->backlerp = 1.0 - (float)( dp_realtime - lf->oldFrameTime ) / ( lf->frameTime - lf->oldFrameTime ); - } -} - - -/* -=============== -UI_PlayerAnimation -=============== -*/ -static void UI_PlayerAnimation( playerInfo_t *pi, int *legsOld, int *legs, float *legsBackLerp, - int *torsoOld, int *torso, float *torsoBackLerp ) { - - // legs animation - pi->legsAnimationTimer -= uiInfo.uiDC.frameTime; - if ( pi->legsAnimationTimer < 0 ) { - pi->legsAnimationTimer = 0; - } - - UI_LegsSequencing( pi ); - - if ( pi->legs.yawing && ( pi->legsAnim & ~ANIM_TOGGLEBIT ) == LEGS_IDLE ) { - UI_RunLerpFrame( pi, &pi->legs, LEGS_TURN ); - } else { - UI_RunLerpFrame( pi, &pi->legs, pi->legsAnim ); - } - *legsOld = pi->legs.oldFrame; - *legs = pi->legs.frame; - *legsBackLerp = pi->legs.backlerp; - - // torso animation - pi->torsoAnimationTimer -= uiInfo.uiDC.frameTime; - if ( pi->torsoAnimationTimer < 0 ) { - pi->torsoAnimationTimer = 0; - } - - UI_TorsoSequencing( pi ); - - UI_RunLerpFrame( pi, &pi->torso, pi->torsoAnim ); - *torsoOld = pi->torso.oldFrame; - *torso = pi->torso.frame; - *torsoBackLerp = pi->torso.backlerp; -} - - -/* -================== -UI_SwingAngles -================== -*/ -static void UI_SwingAngles( float destination, float swingTolerance, float clampTolerance, - float speed, float *angle, qboolean *swinging ) { - float swing; - float move; - float scale; - - if ( !*swinging ) { - // see if a swing should be started - swing = AngleSubtract( *angle, destination ); - if ( swing > swingTolerance || swing < -swingTolerance ) { - *swinging = qtrue; - } - } - - if ( !*swinging ) { - return; - } - - // modify the speed depending on the delta - // so it doesn't seem so linear - swing = AngleSubtract( destination, *angle ); - scale = fabs( swing ); - if ( scale < swingTolerance * 0.5 ) { - scale = 0.5; - } else if ( scale < swingTolerance ) { - scale = 1.0; - } else { - scale = 2.0; - } - - // swing towards the destination angle - if ( swing >= 0 ) { - move = uiInfo.uiDC.frameTime * scale * speed; - if ( move >= swing ) { - move = swing; - *swinging = qfalse; - } - *angle = AngleMod( *angle + move ); - } else if ( swing < 0 ) { - move = uiInfo.uiDC.frameTime * scale * -speed; - if ( move <= swing ) { - move = swing; - *swinging = qfalse; - } - *angle = AngleMod( *angle + move ); - } - - // clamp to no more than tolerance - swing = AngleSubtract( destination, *angle ); - if ( swing > clampTolerance ) { - *angle = AngleMod( destination - (clampTolerance - 1) ); - } else if ( swing < -clampTolerance ) { - *angle = AngleMod( destination + (clampTolerance - 1) ); - } -} - - -/* -====================== -UI_MovedirAdjustment -====================== -*/ -static float UI_MovedirAdjustment( playerInfo_t *pi ) { - vec3_t relativeAngles; - vec3_t moveVector; - - VectorSubtract( pi->viewAngles, pi->moveAngles, relativeAngles ); - AngleVectors( relativeAngles, moveVector, NULL, NULL ); - if ( Q_fabs( moveVector[0] ) < 0.01 ) { - moveVector[0] = 0.0; - } - if ( Q_fabs( moveVector[1] ) < 0.01 ) { - moveVector[1] = 0.0; - } - - if ( moveVector[1] == 0 && moveVector[0] > 0 ) { - return 0; - } - if ( moveVector[1] < 0 && moveVector[0] > 0 ) { - return 22; - } - if ( moveVector[1] < 0 && moveVector[0] == 0 ) { - return 45; - } - if ( moveVector[1] < 0 && moveVector[0] < 0 ) { - return -22; - } - if ( moveVector[1] == 0 && moveVector[0] < 0 ) { - return 0; - } - if ( moveVector[1] > 0 && moveVector[0] < 0 ) { - return 22; - } - if ( moveVector[1] > 0 && moveVector[0] == 0 ) { - return -45; - } - - return -22; -} - - -/* -=============== -UI_PlayerAngles -=============== -*/ -static void UI_PlayerAngles( playerInfo_t *pi, vec3_t legs[3], vec3_t torso[3], vec3_t head[3] ) { - vec3_t legsAngles, torsoAngles, headAngles; - float dest; - float adjust; - - VectorCopy( pi->viewAngles, headAngles ); - headAngles[YAW] = AngleMod( headAngles[YAW] ); - VectorClear( legsAngles ); - VectorClear( torsoAngles ); - - // --------- yaw ------------- - - // allow yaw to drift a bit - if ( ( pi->legsAnim & ~ANIM_TOGGLEBIT ) != LEGS_IDLE - || ( pi->torsoAnim & ~ANIM_TOGGLEBIT ) != TORSO_STAND ) { - // if not standing still, always point all in the same direction - pi->torso.yawing = qtrue; // always center - pi->torso.pitching = qtrue; // always center - pi->legs.yawing = qtrue; // always center - } - - // adjust legs for movement dir - adjust = UI_MovedirAdjustment( pi ); - legsAngles[YAW] = headAngles[YAW] + adjust; - torsoAngles[YAW] = headAngles[YAW] + 0.25 * adjust; - - - // torso - UI_SwingAngles( torsoAngles[YAW], 25, 90, SWINGSPEED, &pi->torso.yawAngle, &pi->torso.yawing ); - UI_SwingAngles( legsAngles[YAW], 40, 90, SWINGSPEED, &pi->legs.yawAngle, &pi->legs.yawing ); - - torsoAngles[YAW] = pi->torso.yawAngle; - legsAngles[YAW] = pi->legs.yawAngle; - - // --------- pitch ------------- - - // only show a fraction of the pitch angle in the torso - if ( headAngles[PITCH] > 180 ) { - dest = (-360 + headAngles[PITCH]) * 0.75; - } else { - dest = headAngles[PITCH] * 0.75; - } - UI_SwingAngles( dest, 15, 30, 0.1f, &pi->torso.pitchAngle, &pi->torso.pitching ); - torsoAngles[PITCH] = pi->torso.pitchAngle; - - // pull the angles back out of the hierarchial chain - AnglesSubtract( headAngles, torsoAngles, headAngles ); - AnglesSubtract( torsoAngles, legsAngles, torsoAngles ); - AnglesToAxis( legsAngles, legs ); - AnglesToAxis( torsoAngles, torso ); - AnglesToAxis( headAngles, head ); -} - - -/* -=============== -UI_PlayerFloatSprite -=============== -*/ -static void UI_PlayerFloatSprite( playerInfo_t *pi, vec3_t origin, qhandle_t shader ) { - refEntity_t ent; - - memset( &ent, 0, sizeof( ent ) ); - VectorCopy( origin, ent.origin ); - ent.origin[2] += 48; - ent.reType = RT_SPRITE; - ent.customShader = shader; - ent.radius = 10; - ent.renderfx = 0; - trap_R_AddRefEntityToScene( &ent ); -} - - -/* -====================== -UI_MachinegunSpinAngle -====================== -*/ -float UI_MachinegunSpinAngle( playerInfo_t *pi ) { - int delta; - float angle; - float speed; - int torsoAnim; - - delta = dp_realtime - pi->barrelTime; - if ( pi->barrelSpinning ) { - angle = pi->barrelAngle + delta * SPIN_SPEED; - } else { - if ( delta > COAST_TIME ) { - delta = COAST_TIME; - } - - speed = 0.5 * ( SPIN_SPEED + (float)( COAST_TIME - delta ) / COAST_TIME ); - angle = pi->barrelAngle + delta * speed; - } - - torsoAnim = pi->torsoAnim & ~ANIM_TOGGLEBIT; - if( torsoAnim == TORSO_ATTACK2 ) { - torsoAnim = TORSO_ATTACK; - } - if ( pi->barrelSpinning == !(torsoAnim == TORSO_ATTACK) ) { - pi->barrelTime = dp_realtime; - pi->barrelAngle = AngleMod( angle ); - pi->barrelSpinning = !!(torsoAnim == TORSO_ATTACK); - } - - return angle; -} - - -/* -=============== -UI_DrawPlayer -=============== -*/ -void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int time ) { - refdef_t refdef; - refEntity_t legs; - refEntity_t torso; - refEntity_t head; - refEntity_t gun; - refEntity_t barrel; - refEntity_t flash; - vec3_t origin; - int renderfx; - vec3_t mins = {-16, -16, -24}; - vec3_t maxs = {16, 16, 32}; - float len; - float xx; - - if ( !pi->legsModel || !pi->torsoModel || !pi->headModel || !pi->animations[0].numFrames ) { - return; - } - - // this allows the ui to cache the player model on the main menu - if (w == 0 || h == 0) { - return; - } - - dp_realtime = time; - - if ( pi->pendingWeapon != -1 && dp_realtime > pi->weaponTimer ) { - pi->weapon = pi->pendingWeapon; - pi->lastWeapon = pi->pendingWeapon; - pi->pendingWeapon = -1; - pi->weaponTimer = 0; - if( pi->currentWeapon != pi->weapon ) { - trap_S_StartLocalSound( weaponChangeSound, CHAN_LOCAL ); - } - } - - UI_AdjustFrom640( &x, &y, &w, &h ); - - y -= jumpHeight; - - memset( &refdef, 0, sizeof( refdef ) ); - memset( &legs, 0, sizeof(legs) ); - memset( &torso, 0, sizeof(torso) ); - memset( &head, 0, sizeof(head) ); - - refdef.rdflags = RDF_NOWORLDMODEL; - - AxisClear( refdef.viewaxis ); - - refdef.x = x; - refdef.y = y; - refdef.width = w; - refdef.height = h; - - refdef.fov_x = (int)((float)refdef.width / 640.0f * 90.0f); - xx = refdef.width / tan( refdef.fov_x / 360 * M_PI ); - refdef.fov_y = atan2( refdef.height, xx ); - refdef.fov_y *= ( 360 / (float)M_PI ); - - // calculate distance so the player nearly fills the box - len = 0.7 * ( maxs[2] - mins[2] ); - origin[0] = len / tan( DEG2RAD(refdef.fov_x) * 0.5 ); - origin[1] = 0.5 * ( mins[1] + maxs[1] ); - origin[2] = -0.5 * ( mins[2] + maxs[2] ); - - refdef.time = dp_realtime; - - trap_R_ClearScene(); - - // get the rotation information - UI_PlayerAngles( pi, legs.axis, torso.axis, head.axis ); - - // get the animation state (after rotation, to allow feet shuffle) - UI_PlayerAnimation( pi, &legs.oldframe, &legs.frame, &legs.backlerp, - &torso.oldframe, &torso.frame, &torso.backlerp ); - - renderfx = RF_LIGHTING_ORIGIN | RF_NOSHADOW; - - // - // add the legs - // - legs.hModel = pi->legsModel; - legs.customSkin = pi->legsSkin; - - VectorCopy( origin, legs.origin ); - - VectorCopy( origin, legs.lightingOrigin ); - legs.renderfx = renderfx; - VectorCopy (legs.origin, legs.oldorigin); - - trap_R_AddRefEntityToScene( &legs ); - - if (!legs.hModel) { - return; - } - - // - // add the torso - // - torso.hModel = pi->torsoModel; - if (!torso.hModel) { - return; - } - - torso.customSkin = pi->torsoSkin; - - VectorCopy( origin, torso.lightingOrigin ); - - UI_PositionRotatedEntityOnTag( &torso, &legs, pi->legsModel, "tag_torso"); - - torso.renderfx = renderfx; - - trap_R_AddRefEntityToScene( &torso ); - - // - // add the head - // - head.hModel = pi->headModel; - if (!head.hModel) { - return; - } - head.customSkin = pi->headSkin; - - VectorCopy( origin, head.lightingOrigin ); - - UI_PositionRotatedEntityOnTag( &head, &torso, pi->torsoModel, "tag_head"); - - head.renderfx = renderfx; - - trap_R_AddRefEntityToScene( &head ); - - // - // add the gun - // - if ( pi->currentWeapon != WP_NONE ) { - memset( &gun, 0, sizeof(gun) ); - gun.hModel = pi->weaponModel; - VectorCopy( origin, gun.lightingOrigin ); - UI_PositionEntityOnTag( &gun, &torso, pi->torsoModel, "tag_weapon"); - gun.renderfx = renderfx; - trap_R_AddRefEntityToScene( &gun ); - } - - // - // add the spinning barrel - // - if ( pi->realWeapon == WP_MACHINEGUN || pi->realWeapon == WP_GAUNTLET || pi->realWeapon == WP_BFG ) { - vec3_t angles; - - memset( &barrel, 0, sizeof(barrel) ); - VectorCopy( origin, barrel.lightingOrigin ); - barrel.renderfx = renderfx; - - barrel.hModel = pi->barrelModel; - angles[YAW] = 0; - angles[PITCH] = 0; - angles[ROLL] = UI_MachinegunSpinAngle( pi ); - if( pi->realWeapon == WP_GAUNTLET || pi->realWeapon == WP_BFG ) { - angles[PITCH] = angles[ROLL]; - angles[ROLL] = 0; - } - AnglesToAxis( angles, barrel.axis ); - - UI_PositionRotatedEntityOnTag( &barrel, &gun, pi->weaponModel, "tag_barrel"); - - trap_R_AddRefEntityToScene( &barrel ); - } - - // - // add muzzle flash - // - if ( dp_realtime <= pi->muzzleFlashTime ) { - if ( pi->flashModel ) { - memset( &flash, 0, sizeof(flash) ); - flash.hModel = pi->flashModel; - VectorCopy( origin, flash.lightingOrigin ); - UI_PositionEntityOnTag( &flash, &gun, pi->weaponModel, "tag_flash"); - flash.renderfx = renderfx; - trap_R_AddRefEntityToScene( &flash ); - } - - // make a dlight for the flash - if ( pi->flashDlightColor[0] || pi->flashDlightColor[1] || pi->flashDlightColor[2] ) { - trap_R_AddLightToScene( flash.origin, 200 + (rand()&31), pi->flashDlightColor[0], - pi->flashDlightColor[1], pi->flashDlightColor[2] ); - } - } - - // - // add the chat icon - // - if ( pi->chat ) { - UI_PlayerFloatSprite( pi, origin, trap_R_RegisterShaderNoMip( "sprites/balloon3" ) ); - } - - // - // add an accent light - // - origin[0] -= 100; // + = behind, - = in front - origin[1] += 100; // + = left, - = right - origin[2] += 100; // + = above, - = below - trap_R_AddLightToScene( origin, 500, 1.0, 1.0, 1.0 ); - - origin[0] -= 100; - origin[1] -= 100; - origin[2] -= 100; - trap_R_AddLightToScene( origin, 500, 1.0, 0.0, 0.0 ); - - trap_R_RenderScene( &refdef ); -} - -/* -========================== -UI_FileExists -========================== -*/ -static qboolean UI_FileExists(const char *filename) { - int len; - - len = trap_FS_FOpenFile( filename, 0, FS_READ ); - if (len>0) { - return qtrue; - } - return qfalse; -} - -/* -========================== -UI_FindClientHeadFile -========================== -*/ -static qboolean UI_FindClientHeadFile( char *filename, int length, const char *teamName, const char *headModelName, const char *headSkinName, const char *base, const char *ext ) { - char *team, *headsFolder; - int i; - - team = "default"; - - if ( headModelName[0] == '*' ) { - headsFolder = "heads/"; - headModelName++; - } - else { - headsFolder = ""; - } - while(1) { - for ( i = 0; i < 2; i++ ) { - if ( i == 0 && teamName && *teamName ) { - Com_sprintf( filename, length, "models/players/%s%s/%s/%s%s_%s.%s", headsFolder, headModelName, headSkinName, teamName, base, team, ext ); - } - else { - Com_sprintf( filename, length, "models/players/%s%s/%s/%s_%s.%s", headsFolder, headModelName, headSkinName, base, team, ext ); - } - if ( UI_FileExists( filename ) ) { - return qtrue; - } - if ( i == 0 && teamName && *teamName ) { - Com_sprintf( filename, length, "models/players/%s%s/%s%s_%s.%s", headsFolder, headModelName, teamName, base, headSkinName, ext ); - } - else { - Com_sprintf( filename, length, "models/players/%s%s/%s_%s.%s", headsFolder, headModelName, base, headSkinName, ext ); - } - if ( UI_FileExists( filename ) ) { - return qtrue; - } - if ( !teamName || !*teamName ) { - break; - } - } - // if tried the heads folder first - if ( headsFolder[0] ) { - break; - } - headsFolder = "heads/"; - } - - return qfalse; -} - -/* -========================== -UI_RegisterClientSkin -========================== -*/ -static qboolean UI_RegisterClientSkin( playerInfo_t *pi, const char *modelName, const char *skinName, const char *headModelName, const char *headSkinName , const char *teamName) { - char filename[MAX_QPATH*2]; - - if (teamName && *teamName) { - Com_sprintf( filename, sizeof( filename ), "models/players/%s/%s/lower_%s.skin", modelName, teamName, skinName ); - } else { - Com_sprintf( filename, sizeof( filename ), "models/players/%s/lower_%s.skin", modelName, skinName ); - } - pi->legsSkin = trap_R_RegisterSkin( filename ); - if (!pi->legsSkin) { - if (teamName && *teamName) { - Com_sprintf( filename, sizeof( filename ), "models/players/characters/%s/%s/lower_%s.skin", modelName, teamName, skinName ); - } else { - Com_sprintf( filename, sizeof( filename ), "models/players/characters/%s/lower_%s.skin", modelName, skinName ); - } - pi->legsSkin = trap_R_RegisterSkin( filename ); - } - - if (teamName && *teamName) { - Com_sprintf( filename, sizeof( filename ), "models/players/%s/%s/upper_%s.skin", modelName, teamName, skinName ); - } else { - Com_sprintf( filename, sizeof( filename ), "models/players/%s/upper_%s.skin", modelName, skinName ); - } - pi->torsoSkin = trap_R_RegisterSkin( filename ); - if (!pi->torsoSkin) { - if (teamName && *teamName) { - Com_sprintf( filename, sizeof( filename ), "models/players/characters/%s/%s/upper_%s.skin", modelName, teamName, skinName ); - } else { - Com_sprintf( filename, sizeof( filename ), "models/players/characters/%s/upper_%s.skin", modelName, skinName ); - } - pi->torsoSkin = trap_R_RegisterSkin( filename ); - } - - if ( UI_FindClientHeadFile( filename, sizeof(filename), teamName, headModelName, headSkinName, "head", "skin" ) ) { - pi->headSkin = trap_R_RegisterSkin( filename ); - } - - if ( !pi->legsSkin || !pi->torsoSkin || !pi->headSkin ) { - return qfalse; - } - - return qtrue; -} - - -/* -====================== -UI_ParseAnimationFile -====================== -*/ -static qboolean UI_ParseAnimationFile( const char *filename, animation_t *animations ) { - char *text_p, *prev; - int len; - int i; - char *token; - float fps; - int skip; - char text[20000]; - fileHandle_t f; - - memset( animations, 0, sizeof( animation_t ) * MAX_ANIMATIONS ); - - // load the file - len = trap_FS_FOpenFile( filename, &f, FS_READ ); - if ( len <= 0 ) { - return qfalse; - } - if ( len >= ( sizeof( text ) - 1 ) ) { - Com_Printf( "File %s too long\n", filename ); - return qfalse; - } - trap_FS_Read( text, len, f ); - text[len] = 0; - trap_FS_FCloseFile( f ); - - COM_Compress(text); - - // parse the text - text_p = text; - skip = 0; // quite the compiler warning - - // read optional parameters - while ( 1 ) { - prev = text_p; // so we can unget - token = COM_Parse( &text_p ); - if ( !token ) { - break; - } - if ( !Q_stricmp( token, "footsteps" ) ) { - token = COM_Parse( &text_p ); - if ( !token ) { - break; - } - continue; - } else if ( !Q_stricmp( token, "headoffset" ) ) { - for ( i = 0 ; i < 3 ; i++ ) { - token = COM_Parse( &text_p ); - if ( !token ) { - break; - } - } - continue; - } else if ( !Q_stricmp( token, "sex" ) ) { - token = COM_Parse( &text_p ); - if ( !token ) { - break; - } - continue; - } - - // if it is a number, start parsing animations - if ( token[0] >= '0' && token[0] <= '9' ) { - text_p = prev; // unget the token - break; - } - - Com_Printf( "unknown token '%s' is %s\n", token, filename ); - } - - // read information for each frame - for ( i = 0 ; i < MAX_ANIMATIONS ; i++ ) { - - token = COM_Parse( &text_p ); - if ( !token ) { - break; - } - animations[i].firstFrame = atoi( token ); - // leg only frames are adjusted to not count the upper body only frames - if ( i == LEGS_WALKCR ) { - skip = animations[LEGS_WALKCR].firstFrame - animations[TORSO_GESTURE].firstFrame; - } - if ( i >= LEGS_WALKCR ) { - animations[i].firstFrame -= skip; - } - - token = COM_Parse( &text_p ); - if ( !token ) { - break; - } - animations[i].numFrames = atoi( token ); - - token = COM_Parse( &text_p ); - if ( !token ) { - break; - } - animations[i].loopFrames = atoi( token ); - - token = COM_Parse( &text_p ); - if ( !token ) { - break; - } - fps = atof( token ); - if ( fps == 0 ) { - fps = 1; - } - animations[i].frameLerp = 1000 / fps; - animations[i].initialLerp = 1000 / fps; - } - - if ( i != MAX_ANIMATIONS ) { - Com_Printf( "Error parsing animation file: %s", filename ); - return qfalse; - } - - return qtrue; -} - -/* -========================== -UI_RegisterClientModelname -========================== -*/ -qboolean UI_RegisterClientModelname( playerInfo_t *pi, const char *modelSkinName, const char *headModelSkinName, const char *teamName ) { - char modelName[MAX_QPATH]; - char skinName[MAX_QPATH]; - char headModelName[MAX_QPATH]; - char headSkinName[MAX_QPATH]; - char filename[MAX_QPATH]; - char *slash; - - pi->torsoModel = 0; - pi->headModel = 0; - - if ( !modelSkinName[0] ) { - return qfalse; - } - - Q_strncpyz( modelName, modelSkinName, sizeof( modelName ) ); - - slash = strchr( modelName, '/' ); - if ( !slash ) { - // modelName did not include a skin name - Q_strncpyz( skinName, "default", sizeof( skinName ) ); - } else { - Q_strncpyz( skinName, slash + 1, sizeof( skinName ) ); - *slash = '\0'; - } - - Q_strncpyz( headModelName, headModelSkinName, sizeof( headModelName ) ); - slash = strchr( headModelName, '/' ); - if ( !slash ) { - // modelName did not include a skin name - Q_strncpyz( headSkinName, "default", sizeof( skinName ) ); - } else { - Q_strncpyz( headSkinName, slash + 1, sizeof( skinName ) ); - *slash = '\0'; - } - - // load cmodels before models so filecache works - - Com_sprintf( filename, sizeof( filename ), "models/players/%s/lower.md3", modelName ); - pi->legsModel = trap_R_RegisterModel( filename ); - if ( !pi->legsModel ) { - Com_sprintf( filename, sizeof( filename ), "models/players/characters/%s/lower.md3", modelName ); - pi->legsModel = trap_R_RegisterModel( filename ); - if ( !pi->legsModel ) { - Com_Printf( "Failed to load model file %s\n", filename ); - return qfalse; - } - } - - Com_sprintf( filename, sizeof( filename ), "models/players/%s/upper.md3", modelName ); - pi->torsoModel = trap_R_RegisterModel( filename ); - if ( !pi->torsoModel ) { - Com_sprintf( filename, sizeof( filename ), "models/players/characters/%s/upper.md3", modelName ); - pi->torsoModel = trap_R_RegisterModel( filename ); - if ( !pi->torsoModel ) { - Com_Printf( "Failed to load model file %s\n", filename ); - return qfalse; - } - } - - if (headModelName && headModelName[0] == '*' ) { - Com_sprintf( filename, sizeof( filename ), "models/players/heads/%s/%s.md3", &headModelName[1], &headModelName[1] ); - } - else { - Com_sprintf( filename, sizeof( filename ), "models/players/%s/head.md3", headModelName ); - } - pi->headModel = trap_R_RegisterModel( filename ); - if ( !pi->headModel && headModelName[0] != '*') { - Com_sprintf( filename, sizeof( filename ), "models/players/heads/%s/%s.md3", headModelName, headModelName ); - pi->headModel = trap_R_RegisterModel( filename ); - } - - if (!pi->headModel) { - Com_Printf( "Failed to load model file %s\n", filename ); - return qfalse; - } - - // if any skins failed to load, fall back to default - if ( !UI_RegisterClientSkin( pi, modelName, skinName, headModelName, headSkinName, teamName) ) { - if ( !UI_RegisterClientSkin( pi, modelName, "default", headModelName, "default", teamName ) ) { - Com_Printf( "Failed to load skin file: %s : %s\n", modelName, skinName ); - return qfalse; - } - } - - // load the animations - Com_sprintf( filename, sizeof( filename ), "models/players/%s/animation.cfg", modelName ); - if ( !UI_ParseAnimationFile( filename, pi->animations ) ) { - Com_sprintf( filename, sizeof( filename ), "models/players/characters/%s/animation.cfg", modelName ); - if ( !UI_ParseAnimationFile( filename, pi->animations ) ) { - Com_Printf( "Failed to load animation file %s\n", filename ); - return qfalse; - } - } - - return qtrue; -} - - -/* -=============== -UI_PlayerInfo_SetModel -=============== -*/ -void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model, const char *headmodel, char *teamName ) { - memset( pi, 0, sizeof(*pi) ); - UI_RegisterClientModelname( pi, model, headmodel, teamName ); - pi->weapon = WP_MACHINEGUN; - pi->currentWeapon = pi->weapon; - pi->lastWeapon = pi->weapon; - pi->pendingWeapon = -1; - pi->weaponTimer = 0; - pi->chat = qfalse; - pi->newModel = qtrue; - UI_PlayerInfo_SetWeapon( pi, pi->weapon ); -} - - -/* -=============== -UI_PlayerInfo_SetInfo -=============== -*/ -void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNumber, qboolean chat ) { - int currentAnim; - weapon_t weaponNum; - - pi->chat = chat; - - // view angles - VectorCopy( viewAngles, pi->viewAngles ); - - // move angles - VectorCopy( moveAngles, pi->moveAngles ); - - if ( pi->newModel ) { - pi->newModel = qfalse; - - jumpHeight = 0; - pi->pendingLegsAnim = 0; - UI_ForceLegsAnim( pi, legsAnim ); - pi->legs.yawAngle = viewAngles[YAW]; - pi->legs.yawing = qfalse; - - pi->pendingTorsoAnim = 0; - UI_ForceTorsoAnim( pi, torsoAnim ); - pi->torso.yawAngle = viewAngles[YAW]; - pi->torso.yawing = qfalse; - - if ( weaponNumber != -1 ) { - pi->weapon = weaponNumber; - pi->currentWeapon = weaponNumber; - pi->lastWeapon = weaponNumber; - pi->pendingWeapon = -1; - pi->weaponTimer = 0; - UI_PlayerInfo_SetWeapon( pi, pi->weapon ); - } - - return; - } - - // weapon - if ( weaponNumber == -1 ) { - pi->pendingWeapon = -1; - pi->weaponTimer = 0; - } - else if ( weaponNumber != WP_NONE ) { - pi->pendingWeapon = weaponNumber; - pi->weaponTimer = dp_realtime + UI_TIMER_WEAPON_DELAY; - } - weaponNum = pi->lastWeapon; - pi->weapon = weaponNum; - - if ( torsoAnim == BOTH_DEATH1 || legsAnim == BOTH_DEATH1 ) { - torsoAnim = legsAnim = BOTH_DEATH1; - pi->weapon = pi->currentWeapon = WP_NONE; - UI_PlayerInfo_SetWeapon( pi, pi->weapon ); - - jumpHeight = 0; - pi->pendingLegsAnim = 0; - UI_ForceLegsAnim( pi, legsAnim ); - - pi->pendingTorsoAnim = 0; - UI_ForceTorsoAnim( pi, torsoAnim ); - - return; - } - - // leg animation - currentAnim = pi->legsAnim & ~ANIM_TOGGLEBIT; - if ( legsAnim != LEGS_JUMP && ( currentAnim == LEGS_JUMP || currentAnim == LEGS_LAND ) ) { - pi->pendingLegsAnim = legsAnim; - } - else if ( legsAnim != currentAnim ) { - jumpHeight = 0; - pi->pendingLegsAnim = 0; - UI_ForceLegsAnim( pi, legsAnim ); - } - - // torso animation - if ( torsoAnim == TORSO_STAND || torsoAnim == TORSO_STAND2 ) { - if ( weaponNum == WP_NONE || weaponNum == WP_GAUNTLET ) { - torsoAnim = TORSO_STAND2; - } - else { - torsoAnim = TORSO_STAND; - } - } - - if ( torsoAnim == TORSO_ATTACK || torsoAnim == TORSO_ATTACK2 ) { - if ( weaponNum == WP_NONE || weaponNum == WP_GAUNTLET ) { - torsoAnim = TORSO_ATTACK2; - } - else { - torsoAnim = TORSO_ATTACK; - } - pi->muzzleFlashTime = dp_realtime + UI_TIMER_MUZZLE_FLASH; - //FIXME play firing sound here - } - - currentAnim = pi->torsoAnim & ~ANIM_TOGGLEBIT; - - if ( weaponNum != pi->currentWeapon || currentAnim == TORSO_RAISE || currentAnim == TORSO_DROP ) { - pi->pendingTorsoAnim = torsoAnim; - } - else if ( ( currentAnim == TORSO_GESTURE || currentAnim == TORSO_ATTACK ) && ( torsoAnim != currentAnim ) ) { - pi->pendingTorsoAnim = torsoAnim; - } - else if ( torsoAnim != currentAnim ) { - pi->pendingTorsoAnim = 0; - UI_ForceTorsoAnim( pi, torsoAnim ); - } -} diff --git a/code/ui/ui_shared.c b/code/ui/ui_shared.c deleted file mode 100644 index 95d93d8..0000000 --- a/code/ui/ui_shared.c +++ /dev/null @@ -1,5785 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// -// string allocation/managment - -#include "ui_shared.h" - -#define SCROLL_TIME_START 500 -#define SCROLL_TIME_ADJUST 150 -#define SCROLL_TIME_ADJUSTOFFSET 40 -#define SCROLL_TIME_FLOOR 20 - -typedef struct scrollInfo_s { - int nextScrollTime; - int nextAdjustTime; - int adjustValue; - int scrollKey; - float xStart; - float yStart; - itemDef_t *item; - qboolean scrollDir; -} scrollInfo_t; - -static scrollInfo_t scrollInfo; - -static void (*captureFunc) (void *p) = NULL; -static void *captureData = NULL; -static itemDef_t *itemCapture = NULL; // item that has the mouse captured ( if any ) - -displayContextDef_t *DC = NULL; - -static qboolean g_waitingForKey = qfalse; -static qboolean g_editingField = qfalse; - -static itemDef_t *g_bindItem = NULL; -static itemDef_t *g_editItem = NULL; - -menuDef_t Menus[MAX_MENUS]; // defined menus -int menuCount = 0; // how many - -menuDef_t *menuStack[MAX_OPEN_MENUS]; -int openMenuCount = 0; - -static qboolean debugMode = qfalse; - -#define DOUBLE_CLICK_DELAY 300 -static int lastListBoxClickTime = 0; - -void Item_RunScript(itemDef_t *item, const char *s); -void Item_SetupKeywordHash(void); -void Menu_SetupKeywordHash(void); -int BindingIDFromName(const char *name); -qboolean Item_Bind_HandleKey(itemDef_t *item, int key, qboolean down); -itemDef_t *Menu_SetPrevCursorItem(menuDef_t *menu); -itemDef_t *Menu_SetNextCursorItem(menuDef_t *menu); -static qboolean Menu_OverActiveItem(menuDef_t *menu, float x, float y); - -#ifdef CGAME -#define MEM_POOL_SIZE 128 * 1024 -#else -#define MEM_POOL_SIZE 1024 * 1024 -#endif - -static char memoryPool[MEM_POOL_SIZE]; -static int allocPoint, outOfMemory; - - -/* -=============== -UI_Alloc -=============== -*/ -void *UI_Alloc( int size ) { - char *p; - - if ( allocPoint + size > MEM_POOL_SIZE ) { - outOfMemory = qtrue; - if (DC->Print) { - DC->Print("UI_Alloc: Failure. Out of memory!\n"); - } - //DC->trap_Print(S_COLOR_YELLOW"WARNING: UI Out of Memory!\n"); - return NULL; - } - - p = &memoryPool[allocPoint]; - - allocPoint += ( size + 15 ) & ~15; - - return p; -} - -/* -=============== -UI_InitMemory -=============== -*/ -void UI_InitMemory( void ) { - allocPoint = 0; - outOfMemory = qfalse; -} - -qboolean UI_OutOfMemory() { - return outOfMemory; -} - - - - - -#define HASH_TABLE_SIZE 2048 -/* -================ -return a hash value for the string -================ -*/ -static long hashForString(const char *str) { - int i; - long hash; - char letter; - - hash = 0; - i = 0; - while (str[i] != '\0') { - letter = tolower(str[i]); - hash+=(long)(letter)*(i+119); - i++; - } - hash &= (HASH_TABLE_SIZE-1); - return hash; -} - -typedef struct stringDef_s { - struct stringDef_s *next; - const char *str; -} stringDef_t; - -static int strPoolIndex = 0; -static char strPool[STRING_POOL_SIZE]; - -static int strHandleCount = 0; -static stringDef_t *strHandle[HASH_TABLE_SIZE]; - - -const char *String_Alloc(const char *p) { - int len; - long hash; - stringDef_t *str, *last; - static const char *staticNULL = ""; - - if (p == NULL) { - return NULL; - } - - if (*p == 0) { - return staticNULL; - } - - hash = hashForString(p); - - str = strHandle[hash]; - while (str) { - if (strcmp(p, str->str) == 0) { - return str->str; - } - str = str->next; - } - - len = strlen(p); - if (len + strPoolIndex + 1 < STRING_POOL_SIZE) { - int ph = strPoolIndex; - strcpy(&strPool[strPoolIndex], p); - strPoolIndex += len + 1; - - str = strHandle[hash]; - last = str; - while (str && str->next) { - last = str; - str = str->next; - } - - str = UI_Alloc(sizeof(stringDef_t)); - str->next = NULL; - str->str = &strPool[ph]; - if (last) { - last->next = str; - } else { - strHandle[hash] = str; - } - return &strPool[ph]; - } - return NULL; -} - -void String_Report() { - float f; - Com_Printf("Memory/String Pool Info\n"); - Com_Printf("----------------\n"); - f = strPoolIndex; - f /= STRING_POOL_SIZE; - f *= 100; - Com_Printf("String Pool is %.1f%% full, %i bytes out of %i used.\n", f, strPoolIndex, STRING_POOL_SIZE); - f = allocPoint; - f /= MEM_POOL_SIZE; - f *= 100; - Com_Printf("Memory Pool is %.1f%% full, %i bytes out of %i used.\n", f, allocPoint, MEM_POOL_SIZE); -} - -/* -================= -String_Init -================= -*/ -void String_Init() { - int i; - for (i = 0; i < HASH_TABLE_SIZE; i++) { - strHandle[i] = 0; - } - strHandleCount = 0; - strPoolIndex = 0; - menuCount = 0; - openMenuCount = 0; - UI_InitMemory(); - Item_SetupKeywordHash(); - Menu_SetupKeywordHash(); - if (DC && DC->getBindingBuf) { - Controls_GetConfig(); - } -} - -/* -================= -PC_SourceWarning -================= -*/ -void PC_SourceWarning(int handle, char *format, ...) { - int line; - char filename[128]; - va_list argptr; - static char string[4096]; - - va_start (argptr, format); - vsprintf (string, format, argptr); - va_end (argptr); - - filename[0] = '\0'; - line = 0; - trap_PC_SourceFileAndLine(handle, filename, &line); - - Com_Printf(S_COLOR_YELLOW "WARNING: %s, line %d: %s\n", filename, line, string); -} - -/* -================= -PC_SourceError -================= -*/ -void PC_SourceError(int handle, char *format, ...) { - int line; - char filename[128]; - va_list argptr; - static char string[4096]; - - va_start (argptr, format); - vsprintf (string, format, argptr); - va_end (argptr); - - filename[0] = '\0'; - line = 0; - trap_PC_SourceFileAndLine(handle, filename, &line); - - Com_Printf(S_COLOR_RED "ERROR: %s, line %d: %s\n", filename, line, string); -} - -/* -================= -LerpColor -================= -*/ -void LerpColor(vec4_t a, vec4_t b, vec4_t c, float t) -{ - int i; - - // lerp and clamp each component - for (i=0; i<4; i++) - { - c[i] = a[i] + t*(b[i]-a[i]); - if (c[i] < 0) - c[i] = 0; - else if (c[i] > 1.0) - c[i] = 1.0; - } -} - -/* -================= -Float_Parse -================= -*/ -qboolean Float_Parse(char **p, float *f) { - char *token; - token = COM_ParseExt(p, qfalse); - if (token && token[0] != 0) { - *f = atof(token); - return qtrue; - } else { - return qfalse; - } -} - -/* -================= -PC_Float_Parse -================= -*/ -qboolean PC_Float_Parse(int handle, float *f) { - pc_token_t token; - int negative = qfalse; - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - if (token.string[0] == '-') { - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - negative = qtrue; - } - if (token.type != TT_NUMBER) { - PC_SourceError(handle, "expected float but found %s\n", token.string); - return qfalse; - } - if (negative) - *f = -token.floatvalue; - else - *f = token.floatvalue; - return qtrue; -} - -/* -================= -Color_Parse -================= -*/ -qboolean Color_Parse(char **p, vec4_t *c) { - int i; - float f; - - for (i = 0; i < 4; i++) { - if (!Float_Parse(p, &f)) { - return qfalse; - } - (*c)[i] = f; - } - return qtrue; -} - -/* -================= -PC_Color_Parse -================= -*/ -qboolean PC_Color_Parse(int handle, vec4_t *c) { - int i; - float f; - - for (i = 0; i < 4; i++) { - if (!PC_Float_Parse(handle, &f)) { - return qfalse; - } - (*c)[i] = f; - } - return qtrue; -} - -/* -================= -Int_Parse -================= -*/ -qboolean Int_Parse(char **p, int *i) { - char *token; - token = COM_ParseExt(p, qfalse); - - if (token && token[0] != 0) { - *i = atoi(token); - return qtrue; - } else { - return qfalse; - } -} - -/* -================= -PC_Int_Parse -================= -*/ -qboolean PC_Int_Parse(int handle, int *i) { - pc_token_t token; - int negative = qfalse; - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - if (token.string[0] == '-') { - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - negative = qtrue; - } - if (token.type != TT_NUMBER) { - PC_SourceError(handle, "expected integer but found %s\n", token.string); - return qfalse; - } - *i = token.intvalue; - if (negative) - *i = - *i; - return qtrue; -} - -/* -================= -Rect_Parse -================= -*/ -qboolean Rect_Parse(char **p, rectDef_t *r) { - if (Float_Parse(p, &r->x)) { - if (Float_Parse(p, &r->y)) { - if (Float_Parse(p, &r->w)) { - if (Float_Parse(p, &r->h)) { - return qtrue; - } - } - } - } - return qfalse; -} - -/* -================= -PC_Rect_Parse -================= -*/ -qboolean PC_Rect_Parse(int handle, rectDef_t *r) { - if (PC_Float_Parse(handle, &r->x)) { - if (PC_Float_Parse(handle, &r->y)) { - if (PC_Float_Parse(handle, &r->w)) { - if (PC_Float_Parse(handle, &r->h)) { - return qtrue; - } - } - } - } - return qfalse; -} - -/* -================= -String_Parse -================= -*/ -qboolean String_Parse(char **p, const char **out) { - char *token; - - token = COM_ParseExt(p, qfalse); - if (token && token[0] != 0) { - *(out) = String_Alloc(token); - return qtrue; - } - return qfalse; -} - -/* -================= -PC_String_Parse -================= -*/ -qboolean PC_String_Parse(int handle, const char **out) { - pc_token_t token; - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - - *(out) = String_Alloc(token.string); - return qtrue; -} - -/* -================= -PC_Script_Parse -================= -*/ -qboolean PC_Script_Parse(int handle, const char **out) { - char script[1024]; - pc_token_t token; - - memset(script, 0, sizeof(script)); - // scripts start with { and have ; separated command lists.. commands are command, arg.. - // basically we want everything between the { } as it will be interpreted at run time - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - if (Q_stricmp(token.string, "{") != 0) { - return qfalse; - } - - while ( 1 ) { - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - - if (Q_stricmp(token.string, "}") == 0) { - *out = String_Alloc(script); - return qtrue; - } - - if (token.string[1] != '\0') { - Q_strcat(script, 1024, va("\"%s\"", token.string)); - } else { - Q_strcat(script, 1024, token.string); - } - Q_strcat(script, 1024, " "); - } - return qfalse; // bk001105 - LCC missing return value -} - -// display, window, menu, item code -// - -/* -================== -Init_Display - -Initializes the display with a structure to all the drawing routines - ================== -*/ -void Init_Display(displayContextDef_t *dc) { - DC = dc; -} - - - -// type and style painting - -void GradientBar_Paint(rectDef_t *rect, vec4_t color) { - // gradient bar takes two paints - DC->setColor( color ); - DC->drawHandlePic(rect->x, rect->y, rect->w, rect->h, DC->Assets.gradientBar); - DC->setColor( NULL ); -} - - -/* -================== -Window_Init - -Initializes a window structure ( windowDef_t ) with defaults - -================== -*/ -void Window_Init(Window *w) { - memset(w, 0, sizeof(windowDef_t)); - w->borderSize = 1; - w->foreColor[0] = w->foreColor[1] = w->foreColor[2] = w->foreColor[3] = 1.0; - w->cinematic = -1; -} - -void Fade(int *flags, float *f, float clamp, int *nextTime, int offsetTime, qboolean bFlags, float fadeAmount) { - if (*flags & (WINDOW_FADINGOUT | WINDOW_FADINGIN)) { - if (DC->realTime > *nextTime) { - *nextTime = DC->realTime + offsetTime; - if (*flags & WINDOW_FADINGOUT) { - *f -= fadeAmount; - if (bFlags && *f <= 0.0) { - *flags &= ~(WINDOW_FADINGOUT | WINDOW_VISIBLE); - } - } else { - *f += fadeAmount; - if (*f >= clamp) { - *f = clamp; - if (bFlags) { - *flags &= ~WINDOW_FADINGIN; - } - } - } - } - } -} - - - -void Window_Paint(Window *w, float fadeAmount, float fadeClamp, float fadeCycle) { - //float bordersize = 0; - vec4_t color; - rectDef_t fillRect = w->rect; - - - if (debugMode) { - color[0] = color[1] = color[2] = color[3] = 1; - DC->drawRect(w->rect.x, w->rect.y, w->rect.w, w->rect.h, 1, color); - } - - if (w == NULL || (w->style == 0 && w->border == 0)) { - return; - } - - if (w->border != 0) { - fillRect.x += w->borderSize; - fillRect.y += w->borderSize; - fillRect.w -= w->borderSize + 1; - fillRect.h -= w->borderSize + 1; - } - - if (w->style == WINDOW_STYLE_FILLED) { - // box, but possible a shader that needs filled - if (w->background) { - Fade(&w->flags, &w->backColor[3], fadeClamp, &w->nextTime, fadeCycle, qtrue, fadeAmount); - DC->setColor(w->backColor); - DC->drawHandlePic(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background); - DC->setColor(NULL); - } else { - DC->fillRect(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->backColor); - } - } else if (w->style == WINDOW_STYLE_GRADIENT) { - GradientBar_Paint(&fillRect, w->backColor); - // gradient bar - } else if (w->style == WINDOW_STYLE_SHADER) { - if (w->flags & WINDOW_FORECOLORSET) { - DC->setColor(w->foreColor); - } - DC->drawHandlePic(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background); - DC->setColor(NULL); - } else if (w->style == WINDOW_STYLE_TEAMCOLOR) { - if (DC->getTeamColor) { - DC->getTeamColor(&color); - DC->fillRect(fillRect.x, fillRect.y, fillRect.w, fillRect.h, color); - } - } else if (w->style == WINDOW_STYLE_CINEMATIC) { - if (w->cinematic == -1) { - w->cinematic = DC->playCinematic(w->cinematicName, fillRect.x, fillRect.y, fillRect.w, fillRect.h); - if (w->cinematic == -1) { - w->cinematic = -2; - } - } - if (w->cinematic >= 0) { - DC->runCinematicFrame(w->cinematic); - DC->drawCinematic(w->cinematic, fillRect.x, fillRect.y, fillRect.w, fillRect.h); - } - } - - if (w->border == WINDOW_BORDER_FULL) { - // full - // HACK HACK HACK - if (w->style == WINDOW_STYLE_TEAMCOLOR) { - if (color[0] > 0) { - // red - color[0] = 1; - color[1] = color[2] = .5; - - } else { - color[2] = 1; - color[0] = color[1] = .5; - } - color[3] = 1; - DC->drawRect(w->rect.x, w->rect.y, w->rect.w, w->rect.h, w->borderSize, color); - } else { - DC->drawRect(w->rect.x, w->rect.y, w->rect.w, w->rect.h, w->borderSize, w->borderColor); - } - } else if (w->border == WINDOW_BORDER_HORZ) { - // top/bottom - DC->setColor(w->borderColor); - DC->drawTopBottom(w->rect.x, w->rect.y, w->rect.w, w->rect.h, w->borderSize); - DC->setColor( NULL ); - } else if (w->border == WINDOW_BORDER_VERT) { - // left right - DC->setColor(w->borderColor); - DC->drawSides(w->rect.x, w->rect.y, w->rect.w, w->rect.h, w->borderSize); - DC->setColor( NULL ); - } else if (w->border == WINDOW_BORDER_KCGRADIENT) { - // this is just two gradient bars along each horz edge - rectDef_t r = w->rect; - r.h = w->borderSize; - GradientBar_Paint(&r, w->borderColor); - r.y = w->rect.y + w->rect.h - 1; - GradientBar_Paint(&r, w->borderColor); - } - -} - - -void Item_SetScreenCoords(itemDef_t *item, float x, float y) { - - if (item == NULL) { - return; - } - - if (item->window.border != 0) { - x += item->window.borderSize; - y += item->window.borderSize; - } - - item->window.rect.x = x + item->window.rectClient.x; - item->window.rect.y = y + item->window.rectClient.y; - item->window.rect.w = item->window.rectClient.w; - item->window.rect.h = item->window.rectClient.h; - - // force the text rects to recompute - item->textRect.w = 0; - item->textRect.h = 0; -} - -// FIXME: consolidate this with nearby stuff -void Item_UpdatePosition(itemDef_t *item) { - float x, y; - menuDef_t *menu; - - if (item == NULL || item->parent == NULL) { - return; - } - - menu = item->parent; - - x = menu->window.rect.x; - y = menu->window.rect.y; - - if (menu->window.border != 0) { - x += menu->window.borderSize; - y += menu->window.borderSize; - } - - Item_SetScreenCoords(item, x, y); - -} - -// menus -void Menu_UpdatePosition(menuDef_t *menu) { - int i; - float x, y; - - if (menu == NULL) { - return; - } - - x = menu->window.rect.x; - y = menu->window.rect.y; - if (menu->window.border != 0) { - x += menu->window.borderSize; - y += menu->window.borderSize; - } - - for (i = 0; i < menu->itemCount; i++) { - Item_SetScreenCoords(menu->items[i], x, y); - } -} - -void Menu_PostParse(menuDef_t *menu) { - if (menu == NULL) { - return; - } - if (menu->fullScreen) { - menu->window.rect.x = 0; - menu->window.rect.y = 0; - menu->window.rect.w = 640; - menu->window.rect.h = 480; - } - Menu_UpdatePosition(menu); -} - -itemDef_t *Menu_ClearFocus(menuDef_t *menu) { - int i; - itemDef_t *ret = NULL; - - if (menu == NULL) { - return NULL; - } - - for (i = 0; i < menu->itemCount; i++) { - if (menu->items[i]->window.flags & WINDOW_HASFOCUS) { - ret = menu->items[i]; - } - menu->items[i]->window.flags &= ~WINDOW_HASFOCUS; - if (menu->items[i]->leaveFocus) { - Item_RunScript(menu->items[i], menu->items[i]->leaveFocus); - } - } - - return ret; -} - -qboolean IsVisible(int flags) { - return (flags & WINDOW_VISIBLE && !(flags & WINDOW_FADINGOUT)); -} - -qboolean Rect_ContainsPoint(rectDef_t *rect, float x, float y) { - if (rect) { - if (x > rect->x && x < rect->x + rect->w && y > rect->y && y < rect->y + rect->h) { - return qtrue; - } - } - return qfalse; -} - -int Menu_ItemsMatchingGroup(menuDef_t *menu, const char *name) { - int i; - int count = 0; - for (i = 0; i < menu->itemCount; i++) { - if (Q_stricmp(menu->items[i]->window.name, name) == 0 || (menu->items[i]->window.group && Q_stricmp(menu->items[i]->window.group, name) == 0)) { - count++; - } - } - return count; -} - -itemDef_t *Menu_GetMatchingItemByNumber(menuDef_t *menu, int index, const char *name) { - int i; - int count = 0; - for (i = 0; i < menu->itemCount; i++) { - if (Q_stricmp(menu->items[i]->window.name, name) == 0 || (menu->items[i]->window.group && Q_stricmp(menu->items[i]->window.group, name) == 0)) { - if (count == index) { - return menu->items[i]; - } - count++; - } - } - return NULL; -} - - - -void Script_SetColor(itemDef_t *item, char **args) { - const char *name; - int i; - float f; - vec4_t *out; - // expecting type of color to set and 4 args for the color - if (String_Parse(args, &name)) { - out = NULL; - if (Q_stricmp(name, "backcolor") == 0) { - out = &item->window.backColor; - item->window.flags |= WINDOW_BACKCOLORSET; - } else if (Q_stricmp(name, "forecolor") == 0) { - out = &item->window.foreColor; - item->window.flags |= WINDOW_FORECOLORSET; - } else if (Q_stricmp(name, "bordercolor") == 0) { - out = &item->window.borderColor; - } - - if (out) { - for (i = 0; i < 4; i++) { - if (!Float_Parse(args, &f)) { - return; - } - (*out)[i] = f; - } - } - } -} - -void Script_SetAsset(itemDef_t *item, char **args) { - const char *name; - // expecting name to set asset to - if (String_Parse(args, &name)) { - // check for a model - if (item->type == ITEM_TYPE_MODEL) { - } - } -} - -void Script_SetBackground(itemDef_t *item, char **args) { - const char *name; - // expecting name to set asset to - if (String_Parse(args, &name)) { - item->window.background = DC->registerShaderNoMip(name); - } -} - - - - -itemDef_t *Menu_FindItemByName(menuDef_t *menu, const char *p) { - int i; - if (menu == NULL || p == NULL) { - return NULL; - } - - for (i = 0; i < menu->itemCount; i++) { - if (Q_stricmp(p, menu->items[i]->window.name) == 0) { - return menu->items[i]; - } - } - - return NULL; -} - -void Script_SetTeamColor(itemDef_t *item, char **args) { - if (DC->getTeamColor) { - int i; - vec4_t color; - DC->getTeamColor(&color); - for (i = 0; i < 4; i++) { - item->window.backColor[i] = color[i]; - } - } -} - -void Script_SetItemColor(itemDef_t *item, char **args) { - const char *itemname; - const char *name; - vec4_t color; - int i; - vec4_t *out; - // expecting type of color to set and 4 args for the color - if (String_Parse(args, &itemname) && String_Parse(args, &name)) { - itemDef_t *item2; - int j; - int count = Menu_ItemsMatchingGroup(item->parent, itemname); - - if (!Color_Parse(args, &color)) { - return; - } - - for (j = 0; j < count; j++) { - item2 = Menu_GetMatchingItemByNumber(item->parent, j, itemname); - if (item2 != NULL) { - out = NULL; - if (Q_stricmp(name, "backcolor") == 0) { - out = &item2->window.backColor; - } else if (Q_stricmp(name, "forecolor") == 0) { - out = &item2->window.foreColor; - item2->window.flags |= WINDOW_FORECOLORSET; - } else if (Q_stricmp(name, "bordercolor") == 0) { - out = &item2->window.borderColor; - } - - if (out) { - for (i = 0; i < 4; i++) { - (*out)[i] = color[i]; - } - } - } - } - } -} - - -void Menu_ShowItemByName(menuDef_t *menu, const char *p, qboolean bShow) { - itemDef_t *item; - int i; - int count = Menu_ItemsMatchingGroup(menu, p); - for (i = 0; i < count; i++) { - item = Menu_GetMatchingItemByNumber(menu, i, p); - if (item != NULL) { - if (bShow) { - item->window.flags |= WINDOW_VISIBLE; - } else { - item->window.flags &= ~WINDOW_VISIBLE; - // stop cinematics playing in the window - if (item->window.cinematic >= 0) { - DC->stopCinematic(item->window.cinematic); - item->window.cinematic = -1; - } - } - } - } -} - -void Menu_FadeItemByName(menuDef_t *menu, const char *p, qboolean fadeOut) { - itemDef_t *item; - int i; - int count = Menu_ItemsMatchingGroup(menu, p); - for (i = 0; i < count; i++) { - item = Menu_GetMatchingItemByNumber(menu, i, p); - if (item != NULL) { - if (fadeOut) { - item->window.flags |= (WINDOW_FADINGOUT | WINDOW_VISIBLE); - item->window.flags &= ~WINDOW_FADINGIN; - } else { - item->window.flags |= (WINDOW_VISIBLE | WINDOW_FADINGIN); - item->window.flags &= ~WINDOW_FADINGOUT; - } - } - } -} - -menuDef_t *Menus_FindByName(const char *p) { - int i; - for (i = 0; i < menuCount; i++) { - if (Q_stricmp(Menus[i].window.name, p) == 0) { - return &Menus[i]; - } - } - return NULL; -} - -void Menus_ShowByName(const char *p) { - menuDef_t *menu = Menus_FindByName(p); - if (menu) { - Menus_Activate(menu); - } -} - -void Menus_OpenByName(const char *p) { - Menus_ActivateByName(p); -} - -static void Menu_RunCloseScript(menuDef_t *menu) { - if (menu && menu->window.flags & WINDOW_VISIBLE && menu->onClose) { - itemDef_t item; - item.parent = menu; - Item_RunScript(&item, menu->onClose); - } -} - -void Menus_CloseByName(const char *p) { - menuDef_t *menu = Menus_FindByName(p); - if (menu != NULL) { - Menu_RunCloseScript(menu); - menu->window.flags &= ~(WINDOW_VISIBLE | WINDOW_HASFOCUS); - } -} - -void Menus_CloseAll() { - int i; - for (i = 0; i < menuCount; i++) { - Menu_RunCloseScript(&Menus[i]); - Menus[i].window.flags &= ~(WINDOW_HASFOCUS | WINDOW_VISIBLE); - } -} - - -void Script_Show(itemDef_t *item, char **args) { - const char *name; - if (String_Parse(args, &name)) { - Menu_ShowItemByName(item->parent, name, qtrue); - } -} - -void Script_Hide(itemDef_t *item, char **args) { - const char *name; - if (String_Parse(args, &name)) { - Menu_ShowItemByName(item->parent, name, qfalse); - } -} - -void Script_FadeIn(itemDef_t *item, char **args) { - const char *name; - if (String_Parse(args, &name)) { - Menu_FadeItemByName(item->parent, name, qfalse); - } -} - -void Script_FadeOut(itemDef_t *item, char **args) { - const char *name; - if (String_Parse(args, &name)) { - Menu_FadeItemByName(item->parent, name, qtrue); - } -} - - - -void Script_Open(itemDef_t *item, char **args) { - const char *name; - if (String_Parse(args, &name)) { - Menus_OpenByName(name); - } -} - -void Script_ConditionalOpen(itemDef_t *item, char **args) { - const char *cvar; - const char *name1; - const char *name2; - float val; - - if ( String_Parse(args, &cvar) && String_Parse(args, &name1) && String_Parse(args, &name2) ) { - val = DC->getCVarValue( cvar ); - if ( val == 0.f ) { - Menus_OpenByName(name2); - } else { - Menus_OpenByName(name1); - } - } -} - -void Script_Close(itemDef_t *item, char **args) { - const char *name; - if (String_Parse(args, &name)) { - Menus_CloseByName(name); - } -} - -void Menu_TransitionItemByName(menuDef_t *menu, const char *p, rectDef_t rectFrom, rectDef_t rectTo, int time, float amt) { - itemDef_t *item; - int i; - int count = Menu_ItemsMatchingGroup(menu, p); - for (i = 0; i < count; i++) { - item = Menu_GetMatchingItemByNumber(menu, i, p); - if (item != NULL) { - item->window.flags |= (WINDOW_INTRANSITION | WINDOW_VISIBLE); - item->window.offsetTime = time; - memcpy(&item->window.rectClient, &rectFrom, sizeof(rectDef_t)); - memcpy(&item->window.rectEffects, &rectTo, sizeof(rectDef_t)); - item->window.rectEffects2.x = abs(rectTo.x - rectFrom.x) / amt; - item->window.rectEffects2.y = abs(rectTo.y - rectFrom.y) / amt; - item->window.rectEffects2.w = abs(rectTo.w - rectFrom.w) / amt; - item->window.rectEffects2.h = abs(rectTo.h - rectFrom.h) / amt; - Item_UpdatePosition(item); - } - } -} - - -void Script_Transition(itemDef_t *item, char **args) { - const char *name; - rectDef_t rectFrom, rectTo; - int time; - float amt; - - if (String_Parse(args, &name)) { - if ( Rect_Parse(args, &rectFrom) && Rect_Parse(args, &rectTo) && Int_Parse(args, &time) && Float_Parse(args, &amt)) { - Menu_TransitionItemByName(item->parent, name, rectFrom, rectTo, time, amt); - } - } -} - - -void Menu_OrbitItemByName(menuDef_t *menu, const char *p, float x, float y, float cx, float cy, int time) { - itemDef_t *item; - int i; - int count = Menu_ItemsMatchingGroup(menu, p); - for (i = 0; i < count; i++) { - item = Menu_GetMatchingItemByNumber(menu, i, p); - if (item != NULL) { - item->window.flags |= (WINDOW_ORBITING | WINDOW_VISIBLE); - item->window.offsetTime = time; - item->window.rectEffects.x = cx; - item->window.rectEffects.y = cy; - item->window.rectClient.x = x; - item->window.rectClient.y = y; - Item_UpdatePosition(item); - } - } -} - - -void Script_Orbit(itemDef_t *item, char **args) { - const char *name; - float cx, cy, x, y; - int time; - - if (String_Parse(args, &name)) { - if ( Float_Parse(args, &x) && Float_Parse(args, &y) && Float_Parse(args, &cx) && Float_Parse(args, &cy) && Int_Parse(args, &time) ) { - Menu_OrbitItemByName(item->parent, name, x, y, cx, cy, time); - } - } -} - - - -void Script_SetFocus(itemDef_t *item, char **args) { - const char *name; - itemDef_t *focusItem; - - if (String_Parse(args, &name)) { - focusItem = Menu_FindItemByName(item->parent, name); - if (focusItem && !(focusItem->window.flags & WINDOW_DECORATION) && !(focusItem->window.flags & WINDOW_HASFOCUS)) { - Menu_ClearFocus(item->parent); - focusItem->window.flags |= WINDOW_HASFOCUS; - if (focusItem->onFocus) { - Item_RunScript(focusItem, focusItem->onFocus); - } - if (DC->Assets.itemFocusSound) { - DC->startLocalSound( DC->Assets.itemFocusSound, CHAN_LOCAL_SOUND ); - } - } - } -} - -void Script_SetPlayerModel(itemDef_t *item, char **args) { - const char *name; - if (String_Parse(args, &name)) { - DC->setCVar("team_model", name); - } -} - -void Script_SetPlayerHead(itemDef_t *item, char **args) { - const char *name; - if (String_Parse(args, &name)) { - DC->setCVar("team_headmodel", name); - } -} - -void Script_SetCvar(itemDef_t *item, char **args) { - const char *cvar, *val; - if (String_Parse(args, &cvar) && String_Parse(args, &val)) { - DC->setCVar(cvar, val); - } - -} - -void Script_Exec(itemDef_t *item, char **args) { - const char *val; - if (String_Parse(args, &val)) { - DC->executeText(EXEC_APPEND, va("%s ; ", val)); - } -} - -void Script_Play(itemDef_t *item, char **args) { - const char *val; - if (String_Parse(args, &val)) { - DC->startLocalSound(DC->registerSound(val, qfalse), CHAN_LOCAL_SOUND); - } -} - -void Script_playLooped(itemDef_t *item, char **args) { - const char *val; - if (String_Parse(args, &val)) { - DC->stopBackgroundTrack(); - DC->startBackgroundTrack(val, val); - } -} - - -commandDef_t commandList[] = -{ - {"fadein", &Script_FadeIn}, // group/name - {"fadeout", &Script_FadeOut}, // group/name - {"show", &Script_Show}, // group/name - {"hide", &Script_Hide}, // group/name - {"setcolor", &Script_SetColor}, // works on this - {"open", &Script_Open}, // menu - {"conditionalopen", &Script_ConditionalOpen}, // menu - {"close", &Script_Close}, // menu - {"setasset", &Script_SetAsset}, // works on this - {"setbackground", &Script_SetBackground}, // works on this - {"setitemcolor", &Script_SetItemColor}, // group/name - {"setteamcolor", &Script_SetTeamColor}, // sets this background color to team color - {"setfocus", &Script_SetFocus}, // sets this background color to team color - {"setplayermodel", &Script_SetPlayerModel}, // sets this background color to team color - {"setplayerhead", &Script_SetPlayerHead}, // sets this background color to team color - {"transition", &Script_Transition}, // group/name - {"setcvar", &Script_SetCvar}, // group/name - {"exec", &Script_Exec}, // group/name - {"play", &Script_Play}, // group/name - {"playlooped", &Script_playLooped}, // group/name - {"orbit", &Script_Orbit} // group/name -}; - -int scriptCommandCount = sizeof(commandList) / sizeof(commandDef_t); - - -void Item_RunScript(itemDef_t *item, const char *s) { - char script[1024], *p; - int i; - qboolean bRan; - memset(script, 0, sizeof(script)); - if (item && s && s[0]) { - Q_strcat(script, 1024, s); - p = script; - while (1) { - const char *command; - // expect command then arguments, ; ends command, NULL ends script - if (!String_Parse(&p, &command)) { - return; - } - - if (command[0] == ';' && command[1] == '\0') { - continue; - } - - bRan = qfalse; - for (i = 0; i < scriptCommandCount; i++) { - if (Q_stricmp(command, commandList[i].name) == 0) { - (commandList[i].handler(item, &p)); - bRan = qtrue; - break; - } - } - // not in our auto list, pass to handler - if (!bRan) { - DC->runScript(&p); - } - } - } -} - - -qboolean Item_EnableShowViaCvar(itemDef_t *item, int flag) { - char script[1024], *p; - memset(script, 0, sizeof(script)); - if (item && item->enableCvar && *item->enableCvar && item->cvarTest && *item->cvarTest) { - char buff[1024]; - DC->getCVarString(item->cvarTest, buff, sizeof(buff)); - - Q_strcat(script, 1024, item->enableCvar); - p = script; - while (1) { - const char *val; - // expect value then ; or NULL, NULL ends list - if (!String_Parse(&p, &val)) { - return (item->cvarFlags & flag) ? qfalse : qtrue; - } - - if (val[0] == ';' && val[1] == '\0') { - continue; - } - - // enable it if any of the values are true - if (item->cvarFlags & flag) { - if (Q_stricmp(buff, val) == 0) { - return qtrue; - } - } else { - // disable it if any of the values are true - if (Q_stricmp(buff, val) == 0) { - return qfalse; - } - } - - } - return (item->cvarFlags & flag) ? qfalse : qtrue; - } - return qtrue; -} - - -// will optionaly set focus to this item -qboolean Item_SetFocus(itemDef_t *item, float x, float y) { - int i; - itemDef_t *oldFocus; - sfxHandle_t *sfx = &DC->Assets.itemFocusSound; - qboolean playSound = qfalse; - menuDef_t *parent; // bk001206: = (menuDef_t*)item->parent; - // sanity check, non-null, not a decoration and does not already have the focus - if (item == NULL || item->window.flags & WINDOW_DECORATION || item->window.flags & WINDOW_HASFOCUS || !(item->window.flags & WINDOW_VISIBLE)) { - return qfalse; - } - - // bk001206 - this can be NULL. - parent = (menuDef_t*)item->parent; - - // items can be enabled and disabled based on cvars - if (item->cvarFlags & (CVAR_ENABLE | CVAR_DISABLE) && !Item_EnableShowViaCvar(item, CVAR_ENABLE)) { - return qfalse; - } - - if (item->cvarFlags & (CVAR_SHOW | CVAR_HIDE) && !Item_EnableShowViaCvar(item, CVAR_SHOW)) { - return qfalse; - } - - oldFocus = Menu_ClearFocus(item->parent); - - if (item->type == ITEM_TYPE_TEXT) { - rectDef_t r; - r = item->textRect; - r.y -= r.h; - if (Rect_ContainsPoint(&r, x, y)) { - item->window.flags |= WINDOW_HASFOCUS; - if (item->focusSound) { - sfx = &item->focusSound; - } - playSound = qtrue; - } else { - if (oldFocus) { - oldFocus->window.flags |= WINDOW_HASFOCUS; - if (oldFocus->onFocus) { - Item_RunScript(oldFocus, oldFocus->onFocus); - } - } - } - } else { - item->window.flags |= WINDOW_HASFOCUS; - if (item->onFocus) { - Item_RunScript(item, item->onFocus); - } - if (item->focusSound) { - sfx = &item->focusSound; - } - playSound = qtrue; - } - - if (playSound && sfx) { - DC->startLocalSound( *sfx, CHAN_LOCAL_SOUND ); - } - - for (i = 0; i < parent->itemCount; i++) { - if (parent->items[i] == item) { - parent->cursorItem = i; - break; - } - } - - return qtrue; -} - -int Item_ListBox_MaxScroll(itemDef_t *item) { - listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData; - int count = DC->feederCount(item->special); - int max; - - if (item->window.flags & WINDOW_HORIZONTAL) { - max = count - (item->window.rect.w / listPtr->elementWidth) + 1; - } - else { - max = count - (item->window.rect.h / listPtr->elementHeight) + 1; - } - if (max < 0) { - return 0; - } - return max; -} - -int Item_ListBox_ThumbPosition(itemDef_t *item) { - float max, pos, size; - listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData; - - max = Item_ListBox_MaxScroll(item); - if (item->window.flags & WINDOW_HORIZONTAL) { - size = item->window.rect.w - (SCROLLBAR_SIZE * 2) - 2; - if (max > 0) { - pos = (size-SCROLLBAR_SIZE) / (float) max; - } else { - pos = 0; - } - pos *= listPtr->startPos; - return item->window.rect.x + 1 + SCROLLBAR_SIZE + pos; - } - else { - size = item->window.rect.h - (SCROLLBAR_SIZE * 2) - 2; - if (max > 0) { - pos = (size-SCROLLBAR_SIZE) / (float) max; - } else { - pos = 0; - } - pos *= listPtr->startPos; - return item->window.rect.y + 1 + SCROLLBAR_SIZE + pos; - } -} - -int Item_ListBox_ThumbDrawPosition(itemDef_t *item) { - int min, max; - - if (itemCapture == item) { - if (item->window.flags & WINDOW_HORIZONTAL) { - min = item->window.rect.x + SCROLLBAR_SIZE + 1; - max = item->window.rect.x + item->window.rect.w - 2*SCROLLBAR_SIZE - 1; - if (DC->cursorx >= min + SCROLLBAR_SIZE/2 && DC->cursorx <= max + SCROLLBAR_SIZE/2) { - return DC->cursorx - SCROLLBAR_SIZE/2; - } - else { - return Item_ListBox_ThumbPosition(item); - } - } - else { - min = item->window.rect.y + SCROLLBAR_SIZE + 1; - max = item->window.rect.y + item->window.rect.h - 2*SCROLLBAR_SIZE - 1; - if (DC->cursory >= min + SCROLLBAR_SIZE/2 && DC->cursory <= max + SCROLLBAR_SIZE/2) { - return DC->cursory - SCROLLBAR_SIZE/2; - } - else { - return Item_ListBox_ThumbPosition(item); - } - } - } - else { - return Item_ListBox_ThumbPosition(item); - } -} - -float Item_Slider_ThumbPosition(itemDef_t *item) { - float value, range, x; - editFieldDef_t *editDef = item->typeData; - - if (item->text) { - x = item->textRect.x + item->textRect.w + 8; - } else { - x = item->window.rect.x; - } - - if (editDef == NULL && item->cvar) { - return x; - } - - value = DC->getCVarValue(item->cvar); - - if (value < editDef->minVal) { - value = editDef->minVal; - } else if (value > editDef->maxVal) { - value = editDef->maxVal; - } - - range = editDef->maxVal - editDef->minVal; - value -= editDef->minVal; - value /= range; - //value /= (editDef->maxVal - editDef->minVal); - value *= SLIDER_WIDTH; - x += value; - // vm fuckage - //x = x + (((float)value / editDef->maxVal) * SLIDER_WIDTH); - return x; -} - -int Item_Slider_OverSlider(itemDef_t *item, float x, float y) { - rectDef_t r; - - r.x = Item_Slider_ThumbPosition(item) - (SLIDER_THUMB_WIDTH / 2); - r.y = item->window.rect.y - 2; - r.w = SLIDER_THUMB_WIDTH; - r.h = SLIDER_THUMB_HEIGHT; - - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_THUMB; - } - return 0; -} - -int Item_ListBox_OverLB(itemDef_t *item, float x, float y) { - rectDef_t r; - listBoxDef_t *listPtr; - int thumbstart; - int count; - - count = DC->feederCount(item->special); - listPtr = (listBoxDef_t*)item->typeData; - if (item->window.flags & WINDOW_HORIZONTAL) { - // check if on left arrow - r.x = item->window.rect.x; - r.y = item->window.rect.y + item->window.rect.h - SCROLLBAR_SIZE; - r.h = r.w = SCROLLBAR_SIZE; - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_LEFTARROW; - } - // check if on right arrow - r.x = item->window.rect.x + item->window.rect.w - SCROLLBAR_SIZE; - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_RIGHTARROW; - } - // check if on thumb - thumbstart = Item_ListBox_ThumbPosition(item); - r.x = thumbstart; - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_THUMB; - } - r.x = item->window.rect.x + SCROLLBAR_SIZE; - r.w = thumbstart - r.x; - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_PGUP; - } - r.x = thumbstart + SCROLLBAR_SIZE; - r.w = item->window.rect.x + item->window.rect.w - SCROLLBAR_SIZE; - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_PGDN; - } - } else { - r.x = item->window.rect.x + item->window.rect.w - SCROLLBAR_SIZE; - r.y = item->window.rect.y; - r.h = r.w = SCROLLBAR_SIZE; - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_LEFTARROW; - } - r.y = item->window.rect.y + item->window.rect.h - SCROLLBAR_SIZE; - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_RIGHTARROW; - } - thumbstart = Item_ListBox_ThumbPosition(item); - r.y = thumbstart; - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_THUMB; - } - r.y = item->window.rect.y + SCROLLBAR_SIZE; - r.h = thumbstart - r.y; - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_PGUP; - } - r.y = thumbstart + SCROLLBAR_SIZE; - r.h = item->window.rect.y + item->window.rect.h - SCROLLBAR_SIZE; - if (Rect_ContainsPoint(&r, x, y)) { - return WINDOW_LB_PGDN; - } - } - return 0; -} - - -void Item_ListBox_MouseEnter(itemDef_t *item, float x, float y) -{ - rectDef_t r; - listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData; - - item->window.flags &= ~(WINDOW_LB_LEFTARROW | WINDOW_LB_RIGHTARROW | WINDOW_LB_THUMB | WINDOW_LB_PGUP | WINDOW_LB_PGDN); - item->window.flags |= Item_ListBox_OverLB(item, x, y); - - if (item->window.flags & WINDOW_HORIZONTAL) { - if (!(item->window.flags & (WINDOW_LB_LEFTARROW | WINDOW_LB_RIGHTARROW | WINDOW_LB_THUMB | WINDOW_LB_PGUP | WINDOW_LB_PGDN))) { - // check for selection hit as we have exausted buttons and thumb - if (listPtr->elementStyle == LISTBOX_IMAGE) { - r.x = item->window.rect.x; - r.y = item->window.rect.y; - r.h = item->window.rect.h - SCROLLBAR_SIZE; - r.w = item->window.rect.w - listPtr->drawPadding; - if (Rect_ContainsPoint(&r, x, y)) { - listPtr->cursorPos = (int)((x - r.x) / listPtr->elementWidth) + listPtr->startPos; - if (listPtr->cursorPos >= listPtr->endPos) { - listPtr->cursorPos = listPtr->endPos; - } - } - } else { - // text hit.. - } - } - } else if (!(item->window.flags & (WINDOW_LB_LEFTARROW | WINDOW_LB_RIGHTARROW | WINDOW_LB_THUMB | WINDOW_LB_PGUP | WINDOW_LB_PGDN))) { - r.x = item->window.rect.x; - r.y = item->window.rect.y; - r.w = item->window.rect.w - SCROLLBAR_SIZE; - r.h = item->window.rect.h - listPtr->drawPadding; - if (Rect_ContainsPoint(&r, x, y)) { - listPtr->cursorPos = (int)((y - 2 - r.y) / listPtr->elementHeight) + listPtr->startPos; - if (listPtr->cursorPos > listPtr->endPos) { - listPtr->cursorPos = listPtr->endPos; - } - } - } -} - -void Item_MouseEnter(itemDef_t *item, float x, float y) { - rectDef_t r; - if (item) { - r = item->textRect; - r.y -= r.h; - // in the text rect? - - // items can be enabled and disabled based on cvars - if (item->cvarFlags & (CVAR_ENABLE | CVAR_DISABLE) && !Item_EnableShowViaCvar(item, CVAR_ENABLE)) { - return; - } - - if (item->cvarFlags & (CVAR_SHOW | CVAR_HIDE) && !Item_EnableShowViaCvar(item, CVAR_SHOW)) { - return; - } - - if (Rect_ContainsPoint(&r, x, y)) { - if (!(item->window.flags & WINDOW_MOUSEOVERTEXT)) { - Item_RunScript(item, item->mouseEnterText); - item->window.flags |= WINDOW_MOUSEOVERTEXT; - } - if (!(item->window.flags & WINDOW_MOUSEOVER)) { - Item_RunScript(item, item->mouseEnter); - item->window.flags |= WINDOW_MOUSEOVER; - } - - } else { - // not in the text rect - if (item->window.flags & WINDOW_MOUSEOVERTEXT) { - // if we were - Item_RunScript(item, item->mouseExitText); - item->window.flags &= ~WINDOW_MOUSEOVERTEXT; - } - if (!(item->window.flags & WINDOW_MOUSEOVER)) { - Item_RunScript(item, item->mouseEnter); - item->window.flags |= WINDOW_MOUSEOVER; - } - - if (item->type == ITEM_TYPE_LISTBOX) { - Item_ListBox_MouseEnter(item, x, y); - } - } - } -} - -void Item_MouseLeave(itemDef_t *item) { - if (item) { - if (item->window.flags & WINDOW_MOUSEOVERTEXT) { - Item_RunScript(item, item->mouseExitText); - item->window.flags &= ~WINDOW_MOUSEOVERTEXT; - } - Item_RunScript(item, item->mouseExit); - item->window.flags &= ~(WINDOW_LB_RIGHTARROW | WINDOW_LB_LEFTARROW); - } -} - -itemDef_t *Menu_HitTest(menuDef_t *menu, float x, float y) { - int i; - for (i = 0; i < menu->itemCount; i++) { - if (Rect_ContainsPoint(&menu->items[i]->window.rect, x, y)) { - return menu->items[i]; - } - } - return NULL; -} - -void Item_SetMouseOver(itemDef_t *item, qboolean focus) { - if (item) { - if (focus) { - item->window.flags |= WINDOW_MOUSEOVER; - } else { - item->window.flags &= ~WINDOW_MOUSEOVER; - } - } -} - - -qboolean Item_OwnerDraw_HandleKey(itemDef_t *item, int key) { - if (item && DC->ownerDrawHandleKey) { - return DC->ownerDrawHandleKey(item->window.ownerDraw, item->window.ownerDrawFlags, &item->special, key); - } - return qfalse; -} - -qboolean Item_ListBox_HandleKey(itemDef_t *item, int key, qboolean down, qboolean force) { - listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData; - int count = DC->feederCount(item->special); - int max, viewmax; - - if (force || (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory) && item->window.flags & WINDOW_HASFOCUS)) { - max = Item_ListBox_MaxScroll(item); - if (item->window.flags & WINDOW_HORIZONTAL) { - viewmax = (item->window.rect.w / listPtr->elementWidth); - if ( key == K_LEFTARROW || key == K_KP_LEFTARROW ) - { - if (!listPtr->notselectable) { - listPtr->cursorPos--; - if (listPtr->cursorPos < 0) { - listPtr->cursorPos = 0; - } - if (listPtr->cursorPos < listPtr->startPos) { - listPtr->startPos = listPtr->cursorPos; - } - if (listPtr->cursorPos >= listPtr->startPos + viewmax) { - listPtr->startPos = listPtr->cursorPos - viewmax + 1; - } - item->cursorPos = listPtr->cursorPos; - DC->feederSelection(item->special, item->cursorPos); - } - else { - listPtr->startPos--; - if (listPtr->startPos < 0) - listPtr->startPos = 0; - } - return qtrue; - } - if ( key == K_RIGHTARROW || key == K_KP_RIGHTARROW ) - { - if (!listPtr->notselectable) { - listPtr->cursorPos++; - if (listPtr->cursorPos < listPtr->startPos) { - listPtr->startPos = listPtr->cursorPos; - } - if (listPtr->cursorPos >= count) { - listPtr->cursorPos = count-1; - } - if (listPtr->cursorPos >= listPtr->startPos + viewmax) { - listPtr->startPos = listPtr->cursorPos - viewmax + 1; - } - item->cursorPos = listPtr->cursorPos; - DC->feederSelection(item->special, item->cursorPos); - } - else { - listPtr->startPos++; - if (listPtr->startPos >= count) - listPtr->startPos = count-1; - } - return qtrue; - } - } - else { - viewmax = (item->window.rect.h / listPtr->elementHeight); - if ( key == K_UPARROW || key == K_KP_UPARROW ) - { - if (!listPtr->notselectable) { - listPtr->cursorPos--; - if (listPtr->cursorPos < 0) { - listPtr->cursorPos = 0; - } - if (listPtr->cursorPos < listPtr->startPos) { - listPtr->startPos = listPtr->cursorPos; - } - if (listPtr->cursorPos >= listPtr->startPos + viewmax) { - listPtr->startPos = listPtr->cursorPos - viewmax + 1; - } - item->cursorPos = listPtr->cursorPos; - DC->feederSelection(item->special, item->cursorPos); - } - else { - listPtr->startPos--; - if (listPtr->startPos < 0) - listPtr->startPos = 0; - } - return qtrue; - } - if ( key == K_DOWNARROW || key == K_KP_DOWNARROW ) - { - if (!listPtr->notselectable) { - listPtr->cursorPos++; - if (listPtr->cursorPos < listPtr->startPos) { - listPtr->startPos = listPtr->cursorPos; - } - if (listPtr->cursorPos >= count) { - listPtr->cursorPos = count-1; - } - if (listPtr->cursorPos >= listPtr->startPos + viewmax) { - listPtr->startPos = listPtr->cursorPos - viewmax + 1; - } - item->cursorPos = listPtr->cursorPos; - DC->feederSelection(item->special, item->cursorPos); - } - else { - listPtr->startPos++; - if (listPtr->startPos > max) - listPtr->startPos = max; - } - return qtrue; - } - } - // mouse hit - if (key == K_MOUSE1 || key == K_MOUSE2) { - if (item->window.flags & WINDOW_LB_LEFTARROW) { - listPtr->startPos--; - if (listPtr->startPos < 0) { - listPtr->startPos = 0; - } - } else if (item->window.flags & WINDOW_LB_RIGHTARROW) { - // one down - listPtr->startPos++; - if (listPtr->startPos > max) { - listPtr->startPos = max; - } - } else if (item->window.flags & WINDOW_LB_PGUP) { - // page up - listPtr->startPos -= viewmax; - if (listPtr->startPos < 0) { - listPtr->startPos = 0; - } - } else if (item->window.flags & WINDOW_LB_PGDN) { - // page down - listPtr->startPos += viewmax; - if (listPtr->startPos > max) { - listPtr->startPos = max; - } - } else if (item->window.flags & WINDOW_LB_THUMB) { - // Display_SetCaptureItem(item); - } else { - // select an item - if (DC->realTime < lastListBoxClickTime && listPtr->doubleClick) { - Item_RunScript(item, listPtr->doubleClick); - } - lastListBoxClickTime = DC->realTime + DOUBLE_CLICK_DELAY; - if (item->cursorPos != listPtr->cursorPos) { - item->cursorPos = listPtr->cursorPos; - DC->feederSelection(item->special, item->cursorPos); - } - } - return qtrue; - } - if ( key == K_HOME || key == K_KP_HOME) { - // home - listPtr->startPos = 0; - return qtrue; - } - if ( key == K_END || key == K_KP_END) { - // end - listPtr->startPos = max; - return qtrue; - } - if (key == K_PGUP || key == K_KP_PGUP ) { - // page up - if (!listPtr->notselectable) { - listPtr->cursorPos -= viewmax; - if (listPtr->cursorPos < 0) { - listPtr->cursorPos = 0; - } - if (listPtr->cursorPos < listPtr->startPos) { - listPtr->startPos = listPtr->cursorPos; - } - if (listPtr->cursorPos >= listPtr->startPos + viewmax) { - listPtr->startPos = listPtr->cursorPos - viewmax + 1; - } - item->cursorPos = listPtr->cursorPos; - DC->feederSelection(item->special, item->cursorPos); - } - else { - listPtr->startPos -= viewmax; - if (listPtr->startPos < 0) { - listPtr->startPos = 0; - } - } - return qtrue; - } - if ( key == K_PGDN || key == K_KP_PGDN ) { - // page down - if (!listPtr->notselectable) { - listPtr->cursorPos += viewmax; - if (listPtr->cursorPos < listPtr->startPos) { - listPtr->startPos = listPtr->cursorPos; - } - if (listPtr->cursorPos >= count) { - listPtr->cursorPos = count-1; - } - if (listPtr->cursorPos >= listPtr->startPos + viewmax) { - listPtr->startPos = listPtr->cursorPos - viewmax + 1; - } - item->cursorPos = listPtr->cursorPos; - DC->feederSelection(item->special, item->cursorPos); - } - else { - listPtr->startPos += viewmax; - if (listPtr->startPos > max) { - listPtr->startPos = max; - } - } - return qtrue; - } - } - return qfalse; -} - -qboolean Item_YesNo_HandleKey(itemDef_t *item, int key) { - - if (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory) && item->window.flags & WINDOW_HASFOCUS && item->cvar) { - if (key == K_MOUSE1 || key == K_ENTER || key == K_MOUSE2 || key == K_MOUSE3) { - DC->setCVar(item->cvar, va("%i", !DC->getCVarValue(item->cvar))); - return qtrue; - } - } - - return qfalse; - -} - -int Item_Multi_CountSettings(itemDef_t *item) { - multiDef_t *multiPtr = (multiDef_t*)item->typeData; - if (multiPtr == NULL) { - return 0; - } - return multiPtr->count; -} - -int Item_Multi_FindCvarByValue(itemDef_t *item) { - char buff[1024]; - float value = 0; - int i; - multiDef_t *multiPtr = (multiDef_t*)item->typeData; - if (multiPtr) { - if (multiPtr->strDef) { - DC->getCVarString(item->cvar, buff, sizeof(buff)); - } else { - value = DC->getCVarValue(item->cvar); - } - for (i = 0; i < multiPtr->count; i++) { - if (multiPtr->strDef) { - if (Q_stricmp(buff, multiPtr->cvarStr[i]) == 0) { - return i; - } - } else { - if (multiPtr->cvarValue[i] == value) { - return i; - } - } - } - } - return 0; -} - -const char *Item_Multi_Setting(itemDef_t *item) { - char buff[1024]; - float value = 0; - int i; - multiDef_t *multiPtr = (multiDef_t*)item->typeData; - if (multiPtr) { - if (multiPtr->strDef) { - DC->getCVarString(item->cvar, buff, sizeof(buff)); - } else { - value = DC->getCVarValue(item->cvar); - } - for (i = 0; i < multiPtr->count; i++) { - if (multiPtr->strDef) { - if (Q_stricmp(buff, multiPtr->cvarStr[i]) == 0) { - return multiPtr->cvarList[i]; - } - } else { - if (multiPtr->cvarValue[i] == value) { - return multiPtr->cvarList[i]; - } - } - } - } - return ""; -} - -qboolean Item_Multi_HandleKey(itemDef_t *item, int key) { - multiDef_t *multiPtr = (multiDef_t*)item->typeData; - if (multiPtr) { - if (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory) && item->window.flags & WINDOW_HASFOCUS && item->cvar) { - if (key == K_MOUSE1 || key == K_ENTER || key == K_MOUSE2 || key == K_MOUSE3) { - int current = Item_Multi_FindCvarByValue(item) + 1; - int max = Item_Multi_CountSettings(item); - if ( current < 0 || current >= max ) { - current = 0; - } - if (multiPtr->strDef) { - DC->setCVar(item->cvar, multiPtr->cvarStr[current]); - } else { - float value = multiPtr->cvarValue[current]; - if (((float)((int) value)) == value) { - DC->setCVar(item->cvar, va("%i", (int) value )); - } - else { - DC->setCVar(item->cvar, va("%f", value )); - } - } - return qtrue; - } - } - } - return qfalse; -} - -qboolean Item_TextField_HandleKey(itemDef_t *item, int key) { - char buff[1024]; - int len; - itemDef_t *newItem = NULL; - editFieldDef_t *editPtr = (editFieldDef_t*)item->typeData; - - if (item->cvar) { - - memset(buff, 0, sizeof(buff)); - DC->getCVarString(item->cvar, buff, sizeof(buff)); - len = strlen(buff); - if (editPtr->maxChars && len > editPtr->maxChars) { - len = editPtr->maxChars; - } - if ( key & K_CHAR_FLAG ) { - key &= ~K_CHAR_FLAG; - - - if (key == 'h' - 'a' + 1 ) { // ctrl-h is backspace - if ( item->cursorPos > 0 ) { - memmove( &buff[item->cursorPos - 1], &buff[item->cursorPos], len + 1 - item->cursorPos); - item->cursorPos--; - if (item->cursorPos < editPtr->paintOffset) { - editPtr->paintOffset--; - } - } - DC->setCVar(item->cvar, buff); - return qtrue; - } - - - // - // ignore any non printable chars - // - if ( key < 32 || !item->cvar) { - return qtrue; - } - - if (item->type == ITEM_TYPE_NUMERICFIELD) { - if (key < '0' || key > '9') { - return qfalse; - } - } - - if (!DC->getOverstrikeMode()) { - if (( len == MAX_EDITFIELD - 1 ) || (editPtr->maxChars && len >= editPtr->maxChars)) { - return qtrue; - } - memmove( &buff[item->cursorPos + 1], &buff[item->cursorPos], len + 1 - item->cursorPos ); - } else { - if (editPtr->maxChars && item->cursorPos >= editPtr->maxChars) { - return qtrue; - } - } - - buff[item->cursorPos] = key; - - DC->setCVar(item->cvar, buff); - - if (item->cursorPos < len + 1) { - item->cursorPos++; - if (editPtr->maxPaintChars && item->cursorPos > editPtr->maxPaintChars) { - editPtr->paintOffset++; - } - } - - } else { - - if ( key == K_DEL || key == K_KP_DEL ) { - if ( item->cursorPos < len ) { - memmove( buff + item->cursorPos, buff + item->cursorPos + 1, len - item->cursorPos); - DC->setCVar(item->cvar, buff); - } - return qtrue; - } - - if ( key == K_RIGHTARROW || key == K_KP_RIGHTARROW ) - { - if (editPtr->maxPaintChars && item->cursorPos >= editPtr->maxPaintChars && item->cursorPos < len) { - item->cursorPos++; - editPtr->paintOffset++; - return qtrue; - } - if (item->cursorPos < len) { - item->cursorPos++; - } - return qtrue; - } - - if ( key == K_LEFTARROW || key == K_KP_LEFTARROW ) - { - if ( item->cursorPos > 0 ) { - item->cursorPos--; - } - if (item->cursorPos < editPtr->paintOffset) { - editPtr->paintOffset--; - } - return qtrue; - } - - if ( key == K_HOME || key == K_KP_HOME) {// || ( tolower(key) == 'a' && trap_Key_IsDown( K_CTRL ) ) ) { - item->cursorPos = 0; - editPtr->paintOffset = 0; - return qtrue; - } - - if ( key == K_END || key == K_KP_END) {// ( tolower(key) == 'e' && trap_Key_IsDown( K_CTRL ) ) ) { - item->cursorPos = len; - if(item->cursorPos > editPtr->maxPaintChars) { - editPtr->paintOffset = len - editPtr->maxPaintChars; - } - return qtrue; - } - - if ( key == K_INS || key == K_KP_INS ) { - DC->setOverstrikeMode(!DC->getOverstrikeMode()); - return qtrue; - } - } - - if (key == K_TAB || key == K_DOWNARROW || key == K_KP_DOWNARROW) { - newItem = Menu_SetNextCursorItem(item->parent); - if (newItem && (newItem->type == ITEM_TYPE_EDITFIELD || newItem->type == ITEM_TYPE_NUMERICFIELD)) { - g_editItem = newItem; - } - } - - if (key == K_UPARROW || key == K_KP_UPARROW) { - newItem = Menu_SetPrevCursorItem(item->parent); - if (newItem && (newItem->type == ITEM_TYPE_EDITFIELD || newItem->type == ITEM_TYPE_NUMERICFIELD)) { - g_editItem = newItem; - } - } - - if ( key == K_ENTER || key == K_KP_ENTER || key == K_ESCAPE) { - return qfalse; - } - - return qtrue; - } - return qfalse; - -} - -static void Scroll_ListBox_AutoFunc(void *p) { - scrollInfo_t *si = (scrollInfo_t*)p; - if (DC->realTime > si->nextScrollTime) { - // need to scroll which is done by simulating a click to the item - // this is done a bit sideways as the autoscroll "knows" that the item is a listbox - // so it calls it directly - Item_ListBox_HandleKey(si->item, si->scrollKey, qtrue, qfalse); - si->nextScrollTime = DC->realTime + si->adjustValue; - } - - if (DC->realTime > si->nextAdjustTime) { - si->nextAdjustTime = DC->realTime + SCROLL_TIME_ADJUST; - if (si->adjustValue > SCROLL_TIME_FLOOR) { - si->adjustValue -= SCROLL_TIME_ADJUSTOFFSET; - } - } -} - -static void Scroll_ListBox_ThumbFunc(void *p) { - scrollInfo_t *si = (scrollInfo_t*)p; - rectDef_t r; - int pos, max; - - listBoxDef_t *listPtr = (listBoxDef_t*)si->item->typeData; - if (si->item->window.flags & WINDOW_HORIZONTAL) { - if (DC->cursorx == si->xStart) { - return; - } - r.x = si->item->window.rect.x + SCROLLBAR_SIZE + 1; - r.y = si->item->window.rect.y + si->item->window.rect.h - SCROLLBAR_SIZE - 1; - r.h = SCROLLBAR_SIZE; - r.w = si->item->window.rect.w - (SCROLLBAR_SIZE*2) - 2; - max = Item_ListBox_MaxScroll(si->item); - // - pos = (DC->cursorx - r.x - SCROLLBAR_SIZE/2) * max / (r.w - SCROLLBAR_SIZE); - if (pos < 0) { - pos = 0; - } - else if (pos > max) { - pos = max; - } - listPtr->startPos = pos; - si->xStart = DC->cursorx; - } - else if (DC->cursory != si->yStart) { - - r.x = si->item->window.rect.x + si->item->window.rect.w - SCROLLBAR_SIZE - 1; - r.y = si->item->window.rect.y + SCROLLBAR_SIZE + 1; - r.h = si->item->window.rect.h - (SCROLLBAR_SIZE*2) - 2; - r.w = SCROLLBAR_SIZE; - max = Item_ListBox_MaxScroll(si->item); - // - pos = (DC->cursory - r.y - SCROLLBAR_SIZE/2) * max / (r.h - SCROLLBAR_SIZE); - if (pos < 0) { - pos = 0; - } - else if (pos > max) { - pos = max; - } - listPtr->startPos = pos; - si->yStart = DC->cursory; - } - - if (DC->realTime > si->nextScrollTime) { - // need to scroll which is done by simulating a click to the item - // this is done a bit sideways as the autoscroll "knows" that the item is a listbox - // so it calls it directly - Item_ListBox_HandleKey(si->item, si->scrollKey, qtrue, qfalse); - si->nextScrollTime = DC->realTime + si->adjustValue; - } - - if (DC->realTime > si->nextAdjustTime) { - si->nextAdjustTime = DC->realTime + SCROLL_TIME_ADJUST; - if (si->adjustValue > SCROLL_TIME_FLOOR) { - si->adjustValue -= SCROLL_TIME_ADJUSTOFFSET; - } - } -} - -static void Scroll_Slider_ThumbFunc(void *p) { - float x, value, cursorx; - scrollInfo_t *si = (scrollInfo_t*)p; - editFieldDef_t *editDef = si->item->typeData; - - if (si->item->text) { - x = si->item->textRect.x + si->item->textRect.w + 8; - } else { - x = si->item->window.rect.x; - } - - cursorx = DC->cursorx; - - if (cursorx < x) { - cursorx = x; - } else if (cursorx > x + SLIDER_WIDTH) { - cursorx = x + SLIDER_WIDTH; - } - value = cursorx - x; - value /= SLIDER_WIDTH; - value *= (editDef->maxVal - editDef->minVal); - value += editDef->minVal; - DC->setCVar(si->item->cvar, va("%f", value)); -} - -void Item_StartCapture(itemDef_t *item, int key) { - int flags; - switch (item->type) { - case ITEM_TYPE_EDITFIELD: - case ITEM_TYPE_NUMERICFIELD: - - case ITEM_TYPE_LISTBOX: - { - flags = Item_ListBox_OverLB(item, DC->cursorx, DC->cursory); - if (flags & (WINDOW_LB_LEFTARROW | WINDOW_LB_RIGHTARROW)) { - scrollInfo.nextScrollTime = DC->realTime + SCROLL_TIME_START; - scrollInfo.nextAdjustTime = DC->realTime + SCROLL_TIME_ADJUST; - scrollInfo.adjustValue = SCROLL_TIME_START; - scrollInfo.scrollKey = key; - scrollInfo.scrollDir = (flags & WINDOW_LB_LEFTARROW) ? qtrue : qfalse; - scrollInfo.item = item; - captureData = &scrollInfo; - captureFunc = &Scroll_ListBox_AutoFunc; - itemCapture = item; - } else if (flags & WINDOW_LB_THUMB) { - scrollInfo.scrollKey = key; - scrollInfo.item = item; - scrollInfo.xStart = DC->cursorx; - scrollInfo.yStart = DC->cursory; - captureData = &scrollInfo; - captureFunc = &Scroll_ListBox_ThumbFunc; - itemCapture = item; - } - break; - } - case ITEM_TYPE_SLIDER: - { - flags = Item_Slider_OverSlider(item, DC->cursorx, DC->cursory); - if (flags & WINDOW_LB_THUMB) { - scrollInfo.scrollKey = key; - scrollInfo.item = item; - scrollInfo.xStart = DC->cursorx; - scrollInfo.yStart = DC->cursory; - captureData = &scrollInfo; - captureFunc = &Scroll_Slider_ThumbFunc; - itemCapture = item; - } - break; - } - } -} - -void Item_StopCapture(itemDef_t *item) { - -} - -qboolean Item_Slider_HandleKey(itemDef_t *item, int key, qboolean down) { - float x, value, width, work; - - //DC->Print("slider handle key\n"); - if (item->window.flags & WINDOW_HASFOCUS && item->cvar && Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory)) { - if (key == K_MOUSE1 || key == K_ENTER || key == K_MOUSE2 || key == K_MOUSE3) { - editFieldDef_t *editDef = item->typeData; - if (editDef) { - rectDef_t testRect; - width = SLIDER_WIDTH; - if (item->text) { - x = item->textRect.x + item->textRect.w + 8; - } else { - x = item->window.rect.x; - } - - testRect = item->window.rect; - testRect.x = x; - value = (float)SLIDER_THUMB_WIDTH / 2; - testRect.x -= value; - //DC->Print("slider x: %f\n", testRect.x); - testRect.w = (SLIDER_WIDTH + (float)SLIDER_THUMB_WIDTH / 2); - //DC->Print("slider w: %f\n", testRect.w); - if (Rect_ContainsPoint(&testRect, DC->cursorx, DC->cursory)) { - work = DC->cursorx - x; - value = work / width; - value *= (editDef->maxVal - editDef->minVal); - // vm fuckage - // value = (((float)(DC->cursorx - x)/ SLIDER_WIDTH) * (editDef->maxVal - editDef->minVal)); - value += editDef->minVal; - DC->setCVar(item->cvar, va("%f", value)); - return qtrue; - } - } - } - } - DC->Print("slider handle key exit\n"); - return qfalse; -} - - -qboolean Item_HandleKey(itemDef_t *item, int key, qboolean down) { - - if (itemCapture) { - Item_StopCapture(itemCapture); - itemCapture = NULL; - captureFunc = NULL; - captureData = NULL; - } else { - // bk001206 - parentheses - if ( down && ( key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3 ) ) { - Item_StartCapture(item, key); - } - } - - if (!down) { - return qfalse; - } - - switch (item->type) { - case ITEM_TYPE_BUTTON: - return qfalse; - break; - case ITEM_TYPE_RADIOBUTTON: - return qfalse; - break; - case ITEM_TYPE_CHECKBOX: - return qfalse; - break; - case ITEM_TYPE_EDITFIELD: - case ITEM_TYPE_NUMERICFIELD: - //return Item_TextField_HandleKey(item, key); - return qfalse; - break; - case ITEM_TYPE_COMBO: - return qfalse; - break; - case ITEM_TYPE_LISTBOX: - return Item_ListBox_HandleKey(item, key, down, qfalse); - break; - case ITEM_TYPE_YESNO: - return Item_YesNo_HandleKey(item, key); - break; - case ITEM_TYPE_MULTI: - return Item_Multi_HandleKey(item, key); - break; - case ITEM_TYPE_OWNERDRAW: - return Item_OwnerDraw_HandleKey(item, key); - break; - case ITEM_TYPE_BIND: - return Item_Bind_HandleKey(item, key, down); - break; - case ITEM_TYPE_SLIDER: - return Item_Slider_HandleKey(item, key, down); - break; - //case ITEM_TYPE_IMAGE: - // Item_Image_Paint(item); - // break; - default: - return qfalse; - break; - } - - //return qfalse; -} - -void Item_Action(itemDef_t *item) { - if (item) { - Item_RunScript(item, item->action); - } -} - -itemDef_t *Menu_SetPrevCursorItem(menuDef_t *menu) { - qboolean wrapped = qfalse; - int oldCursor = menu->cursorItem; - - if (menu->cursorItem < 0) { - menu->cursorItem = menu->itemCount-1; - wrapped = qtrue; - } - - while (menu->cursorItem > -1) { - - menu->cursorItem--; - if (menu->cursorItem < 0 && !wrapped) { - wrapped = qtrue; - menu->cursorItem = menu->itemCount -1; - } - - if (Item_SetFocus(menu->items[menu->cursorItem], DC->cursorx, DC->cursory)) { - Menu_HandleMouseMove(menu, menu->items[menu->cursorItem]->window.rect.x + 1, menu->items[menu->cursorItem]->window.rect.y + 1); - return menu->items[menu->cursorItem]; - } - } - menu->cursorItem = oldCursor; - return NULL; - -} - -itemDef_t *Menu_SetNextCursorItem(menuDef_t *menu) { - - qboolean wrapped = qfalse; - int oldCursor = menu->cursorItem; - - - if (menu->cursorItem == -1) { - menu->cursorItem = 0; - wrapped = qtrue; - } - - while (menu->cursorItem < menu->itemCount) { - - menu->cursorItem++; - if (menu->cursorItem >= menu->itemCount && !wrapped) { - wrapped = qtrue; - menu->cursorItem = 0; - } - if (Item_SetFocus(menu->items[menu->cursorItem], DC->cursorx, DC->cursory)) { - Menu_HandleMouseMove(menu, menu->items[menu->cursorItem]->window.rect.x + 1, menu->items[menu->cursorItem]->window.rect.y + 1); - return menu->items[menu->cursorItem]; - } - - } - - menu->cursorItem = oldCursor; - return NULL; -} - -static void Window_CloseCinematic(windowDef_t *window) { - if (window->style == WINDOW_STYLE_CINEMATIC && window->cinematic >= 0) { - DC->stopCinematic(window->cinematic); - window->cinematic = -1; - } -} - -static void Menu_CloseCinematics(menuDef_t *menu) { - if (menu) { - int i; - Window_CloseCinematic(&menu->window); - for (i = 0; i < menu->itemCount; i++) { - Window_CloseCinematic(&menu->items[i]->window); - if (menu->items[i]->type == ITEM_TYPE_OWNERDRAW) { - DC->stopCinematic(0-menu->items[i]->window.ownerDraw); - } - } - } -} - -static void Display_CloseCinematics() { - int i; - for (i = 0; i < menuCount; i++) { - Menu_CloseCinematics(&Menus[i]); - } -} - -void Menus_Activate(menuDef_t *menu) { - menu->window.flags |= (WINDOW_HASFOCUS | WINDOW_VISIBLE); - if (menu->onOpen) { - itemDef_t item; - item.parent = menu; - Item_RunScript(&item, menu->onOpen); - } - - if (menu->soundName && *menu->soundName) { -// DC->stopBackgroundTrack(); // you don't want to do this since it will reset s_rawend - DC->startBackgroundTrack(menu->soundName, menu->soundName); - } - - Display_CloseCinematics(); - -} - -int Display_VisibleMenuCount() { - int i, count; - count = 0; - for (i = 0; i < menuCount; i++) { - if (Menus[i].window.flags & (WINDOW_FORCED | WINDOW_VISIBLE)) { - count++; - } - } - return count; -} - -void Menus_HandleOOBClick(menuDef_t *menu, int key, qboolean down) { - if (menu) { - int i; - // basically the behaviour we are looking for is if there are windows in the stack.. see if - // the cursor is within any of them.. if not close them otherwise activate them and pass the - // key on.. force a mouse move to activate focus and script stuff - if (down && menu->window.flags & WINDOW_OOB_CLICK) { - Menu_RunCloseScript(menu); - menu->window.flags &= ~(WINDOW_HASFOCUS | WINDOW_VISIBLE); - } - - for (i = 0; i < menuCount; i++) { - if (Menu_OverActiveItem(&Menus[i], DC->cursorx, DC->cursory)) { - Menu_RunCloseScript(menu); - menu->window.flags &= ~(WINDOW_HASFOCUS | WINDOW_VISIBLE); - Menus_Activate(&Menus[i]); - Menu_HandleMouseMove(&Menus[i], DC->cursorx, DC->cursory); - Menu_HandleKey(&Menus[i], key, down); - } - } - - if (Display_VisibleMenuCount() == 0) { - if (DC->Pause) { - DC->Pause(qfalse); - } - } - Display_CloseCinematics(); - } -} - -static rectDef_t *Item_CorrectedTextRect(itemDef_t *item) { - static rectDef_t rect; - memset(&rect, 0, sizeof(rectDef_t)); - if (item) { - rect = item->textRect; - if (rect.w) { - rect.y -= rect.h; - } - } - return ▭ -} - -void Menu_HandleKey(menuDef_t *menu, int key, qboolean down) { - int i; - itemDef_t *item = NULL; - qboolean inHandler = qfalse; - - if (inHandler) { - return; - } - - inHandler = qtrue; - if (g_waitingForKey && down) { - Item_Bind_HandleKey(g_bindItem, key, down); - inHandler = qfalse; - return; - } - - if (g_editingField && down) { - if (!Item_TextField_HandleKey(g_editItem, key)) { - g_editingField = qfalse; - g_editItem = NULL; - inHandler = qfalse; - return; - } else if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3) { - g_editingField = qfalse; - g_editItem = NULL; - Display_MouseMove(NULL, DC->cursorx, DC->cursory); - } else if (key == K_TAB || key == K_UPARROW || key == K_DOWNARROW) { - return; - } - } - - if (menu == NULL) { - inHandler = qfalse; - return; - } - - // see if the mouse is within the window bounds and if so is this a mouse click - if (down && !(menu->window.flags & WINDOW_POPUP) && !Rect_ContainsPoint(&menu->window.rect, DC->cursorx, DC->cursory)) { - static qboolean inHandleKey = qfalse; - // bk001206 - parentheses - if (!inHandleKey && ( key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3 ) ) { - inHandleKey = qtrue; - Menus_HandleOOBClick(menu, key, down); - inHandleKey = qfalse; - inHandler = qfalse; - return; - } - } - - // get the item with focus - for (i = 0; i < menu->itemCount; i++) { - if (menu->items[i]->window.flags & WINDOW_HASFOCUS) { - item = menu->items[i]; - } - } - - if (item != NULL) { - if (Item_HandleKey(item, key, down)) { - Item_Action(item); - inHandler = qfalse; - return; - } - } - - if (!down) { - inHandler = qfalse; - return; - } - - // default handling - switch ( key ) { - - case K_F11: - if (DC->getCVarValue("developer")) { - debugMode ^= 1; - } - break; - - case K_F12: - if (DC->getCVarValue("developer")) { - DC->executeText(EXEC_APPEND, "screenshot\n"); - } - break; - case K_KP_UPARROW: - case K_UPARROW: - Menu_SetPrevCursorItem(menu); - break; - - case K_ESCAPE: - if (!g_waitingForKey && menu->onESC) { - itemDef_t it; - it.parent = menu; - Item_RunScript(&it, menu->onESC); - } - break; - case K_TAB: - case K_KP_DOWNARROW: - case K_DOWNARROW: - Menu_SetNextCursorItem(menu); - break; - - case K_MOUSE1: - case K_MOUSE2: - if (item) { - if (item->type == ITEM_TYPE_TEXT) { - if (Rect_ContainsPoint(Item_CorrectedTextRect(item), DC->cursorx, DC->cursory)) { - Item_Action(item); - } - } else if (item->type == ITEM_TYPE_EDITFIELD || item->type == ITEM_TYPE_NUMERICFIELD) { - if (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory)) { - item->cursorPos = 0; - g_editingField = qtrue; - g_editItem = item; - DC->setOverstrikeMode(qtrue); - } - } else { - if (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory)) { - Item_Action(item); - } - } - } - break; - - case K_JOY1: - case K_JOY2: - case K_JOY3: - case K_JOY4: - case K_AUX1: - case K_AUX2: - case K_AUX3: - case K_AUX4: - case K_AUX5: - case K_AUX6: - case K_AUX7: - case K_AUX8: - case K_AUX9: - case K_AUX10: - case K_AUX11: - case K_AUX12: - case K_AUX13: - case K_AUX14: - case K_AUX15: - case K_AUX16: - break; - case K_KP_ENTER: - case K_ENTER: - if (item) { - if (item->type == ITEM_TYPE_EDITFIELD || item->type == ITEM_TYPE_NUMERICFIELD) { - item->cursorPos = 0; - g_editingField = qtrue; - g_editItem = item; - DC->setOverstrikeMode(qtrue); - } else { - Item_Action(item); - } - } - break; - } - inHandler = qfalse; -} - -void ToWindowCoords(float *x, float *y, windowDef_t *window) { - if (window->border != 0) { - *x += window->borderSize; - *y += window->borderSize; - } - *x += window->rect.x; - *y += window->rect.y; -} - -void Rect_ToWindowCoords(rectDef_t *rect, windowDef_t *window) { - ToWindowCoords(&rect->x, &rect->y, window); -} - -void Item_SetTextExtents(itemDef_t *item, int *width, int *height, const char *text) { - const char *textPtr = (text) ? text : item->text; - - if (textPtr == NULL ) { - return; - } - - *width = item->textRect.w; - *height = item->textRect.h; - - // keeps us from computing the widths and heights more than once - if (*width == 0 || (item->type == ITEM_TYPE_OWNERDRAW && item->textalignment == ITEM_ALIGN_CENTER)) { - int originalWidth = DC->textWidth(item->text, item->textscale, 0); - - if (item->type == ITEM_TYPE_OWNERDRAW && (item->textalignment == ITEM_ALIGN_CENTER || item->textalignment == ITEM_ALIGN_RIGHT)) { - originalWidth += DC->ownerDrawWidth(item->window.ownerDraw, item->textscale); - } else if (item->type == ITEM_TYPE_EDITFIELD && item->textalignment == ITEM_ALIGN_CENTER && item->cvar) { - char buff[256]; - DC->getCVarString(item->cvar, buff, 256); - originalWidth += DC->textWidth(buff, item->textscale, 0); - } - - *width = DC->textWidth(textPtr, item->textscale, 0); - *height = DC->textHeight(textPtr, item->textscale, 0); - item->textRect.w = *width; - item->textRect.h = *height; - item->textRect.x = item->textalignx; - item->textRect.y = item->textaligny; - if (item->textalignment == ITEM_ALIGN_RIGHT) { - item->textRect.x = item->textalignx - originalWidth; - } else if (item->textalignment == ITEM_ALIGN_CENTER) { - item->textRect.x = item->textalignx - originalWidth / 2; - } - - ToWindowCoords(&item->textRect.x, &item->textRect.y, &item->window); - } -} - -void Item_TextColor(itemDef_t *item, vec4_t *newColor) { - vec4_t lowLight; - menuDef_t *parent = (menuDef_t*)item->parent; - - Fade(&item->window.flags, &item->window.foreColor[3], parent->fadeClamp, &item->window.nextTime, parent->fadeCycle, qtrue, parent->fadeAmount); - - if (item->window.flags & WINDOW_HASFOCUS) { - lowLight[0] = 0.8 * parent->focusColor[0]; - lowLight[1] = 0.8 * parent->focusColor[1]; - lowLight[2] = 0.8 * parent->focusColor[2]; - lowLight[3] = 0.8 * parent->focusColor[3]; - LerpColor(parent->focusColor,lowLight,*newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR)); - } else if (item->textStyle == ITEM_TEXTSTYLE_BLINK && !((DC->realTime/BLINK_DIVISOR) & 1)) { - lowLight[0] = 0.8 * item->window.foreColor[0]; - lowLight[1] = 0.8 * item->window.foreColor[1]; - lowLight[2] = 0.8 * item->window.foreColor[2]; - lowLight[3] = 0.8 * item->window.foreColor[3]; - LerpColor(item->window.foreColor,lowLight,*newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR)); - } else { - memcpy(newColor, &item->window.foreColor, sizeof(vec4_t)); - // items can be enabled and disabled based on cvars - } - - if (item->enableCvar && *item->enableCvar && item->cvarTest && *item->cvarTest) { - if (item->cvarFlags & (CVAR_ENABLE | CVAR_DISABLE) && !Item_EnableShowViaCvar(item, CVAR_ENABLE)) { - memcpy(newColor, &parent->disableColor, sizeof(vec4_t)); - } - } -} - -void Item_Text_AutoWrapped_Paint(itemDef_t *item) { - char text[1024]; - const char *p, *textPtr, *newLinePtr; - char buff[1024]; - int width, height, len, textWidth, newLine, newLineWidth; - float y; - vec4_t color; - - textWidth = 0; - newLinePtr = NULL; - - if (item->text == NULL) { - if (item->cvar == NULL) { - return; - } - else { - DC->getCVarString(item->cvar, text, sizeof(text)); - textPtr = text; - } - } - else { - textPtr = item->text; - } - if (*textPtr == '\0') { - return; - } - Item_TextColor(item, &color); - Item_SetTextExtents(item, &width, &height, textPtr); - - y = item->textaligny; - len = 0; - buff[0] = '\0'; - newLine = 0; - newLineWidth = 0; - p = textPtr; - while (p) { - if (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\0') { - newLine = len; - newLinePtr = p+1; - newLineWidth = textWidth; - } - textWidth = DC->textWidth(buff, item->textscale, 0); - if ( (newLine && textWidth > item->window.rect.w) || *p == '\n' || *p == '\0') { - if (len) { - if (item->textalignment == ITEM_ALIGN_LEFT) { - item->textRect.x = item->textalignx; - } else if (item->textalignment == ITEM_ALIGN_RIGHT) { - item->textRect.x = item->textalignx - newLineWidth; - } else if (item->textalignment == ITEM_ALIGN_CENTER) { - item->textRect.x = item->textalignx - newLineWidth / 2; - } - item->textRect.y = y; - ToWindowCoords(&item->textRect.x, &item->textRect.y, &item->window); - // - buff[newLine] = '\0'; - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, color, buff, 0, 0, item->textStyle); - } - if (*p == '\0') { - break; - } - // - y += height + 5; - p = newLinePtr; - len = 0; - newLine = 0; - newLineWidth = 0; - continue; - } - buff[len++] = *p++; - buff[len] = '\0'; - } -} - -void Item_Text_Wrapped_Paint(itemDef_t *item) { - char text[1024]; - const char *p, *start, *textPtr; - char buff[1024]; - int width, height; - float x, y; - vec4_t color; - - // now paint the text and/or any optional images - // default to left - - if (item->text == NULL) { - if (item->cvar == NULL) { - return; - } - else { - DC->getCVarString(item->cvar, text, sizeof(text)); - textPtr = text; - } - } - else { - textPtr = item->text; - } - if (*textPtr == '\0') { - return; - } - - Item_TextColor(item, &color); - Item_SetTextExtents(item, &width, &height, textPtr); - - x = item->textRect.x; - y = item->textRect.y; - start = textPtr; - p = strchr(textPtr, '\r'); - while (p && *p) { - strncpy(buff, start, p-start+1); - buff[p-start] = '\0'; - DC->drawText(x, y, item->textscale, color, buff, 0, 0, item->textStyle); - y += height + 5; - start += p - start + 1; - p = strchr(p+1, '\r'); - } - DC->drawText(x, y, item->textscale, color, start, 0, 0, item->textStyle); -} - -void Item_Text_Paint(itemDef_t *item) { - char text[1024]; - const char *textPtr; - int height, width; - vec4_t color; - - if (item->window.flags & WINDOW_WRAPPED) { - Item_Text_Wrapped_Paint(item); - return; - } - if (item->window.flags & WINDOW_AUTOWRAPPED) { - Item_Text_AutoWrapped_Paint(item); - return; - } - - if (item->text == NULL) { - if (item->cvar == NULL) { - return; - } - else { - DC->getCVarString(item->cvar, text, sizeof(text)); - textPtr = text; - } - } - else { - textPtr = item->text; - } - - // this needs to go here as it sets extents for cvar types as well - Item_SetTextExtents(item, &width, &height, textPtr); - - if (*textPtr == '\0') { - return; - } - - - Item_TextColor(item, &color); - - //FIXME: this is a fucking mess -/* - adjust = 0; - if (item->textStyle == ITEM_TEXTSTYLE_OUTLINED || item->textStyle == ITEM_TEXTSTYLE_OUTLINESHADOWED) { - adjust = 0.5; - } - - if (item->textStyle == ITEM_TEXTSTYLE_SHADOWED || item->textStyle == ITEM_TEXTSTYLE_OUTLINESHADOWED) { - Fade(&item->window.flags, &DC->Assets.shadowColor[3], DC->Assets.fadeClamp, &item->window.nextTime, DC->Assets.fadeCycle, qfalse); - DC->drawText(item->textRect.x + DC->Assets.shadowX, item->textRect.y + DC->Assets.shadowY, item->textscale, DC->Assets.shadowColor, textPtr, adjust); - } -*/ - - -// if (item->textStyle == ITEM_TEXTSTYLE_OUTLINED || item->textStyle == ITEM_TEXTSTYLE_OUTLINESHADOWED) { -// Fade(&item->window.flags, &item->window.outlineColor[3], DC->Assets.fadeClamp, &item->window.nextTime, DC->Assets.fadeCycle, qfalse); -// /* -// Text_Paint(item->textRect.x-1, item->textRect.y-1, item->textscale, item->window.foreColor, textPtr, adjust); -// Text_Paint(item->textRect.x, item->textRect.y-1, item->textscale, item->window.foreColor, textPtr, adjust); -// Text_Paint(item->textRect.x+1, item->textRect.y-1, item->textscale, item->window.foreColor, textPtr, adjust); -// Text_Paint(item->textRect.x-1, item->textRect.y, item->textscale, item->window.foreColor, textPtr, adjust); -// Text_Paint(item->textRect.x+1, item->textRect.y, item->textscale, item->window.foreColor, textPtr, adjust); -// Text_Paint(item->textRect.x-1, item->textRect.y+1, item->textscale, item->window.foreColor, textPtr, adjust); -// Text_Paint(item->textRect.x, item->textRect.y+1, item->textscale, item->window.foreColor, textPtr, adjust); -// Text_Paint(item->textRect.x+1, item->textRect.y+1, item->textscale, item->window.foreColor, textPtr, adjust); -// */ -// DC->drawText(item->textRect.x - 1, item->textRect.y + 1, item->textscale * 1.02, item->window.outlineColor, textPtr, adjust); -// } - - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, color, textPtr, 0, 0, item->textStyle); -} - - - -//float trap_Cvar_VariableValue( const char *var_name ); -//void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ); - -void Item_TextField_Paint(itemDef_t *item) { - char buff[1024]; - vec4_t newColor, lowLight; - int offset; - menuDef_t *parent = (menuDef_t*)item->parent; - editFieldDef_t *editPtr = (editFieldDef_t*)item->typeData; - - Item_Text_Paint(item); - - buff[0] = '\0'; - - if (item->cvar) { - DC->getCVarString(item->cvar, buff, sizeof(buff)); - } - - parent = (menuDef_t*)item->parent; - - if (item->window.flags & WINDOW_HASFOCUS) { - lowLight[0] = 0.8 * parent->focusColor[0]; - lowLight[1] = 0.8 * parent->focusColor[1]; - lowLight[2] = 0.8 * parent->focusColor[2]; - lowLight[3] = 0.8 * parent->focusColor[3]; - LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR)); - } else { - memcpy(&newColor, &item->window.foreColor, sizeof(vec4_t)); - } - - offset = (item->text && *item->text) ? 8 : 0; - if (item->window.flags & WINDOW_HASFOCUS && g_editingField) { - char cursor = DC->getOverstrikeMode() ? '_' : '|'; - DC->drawTextWithCursor(item->textRect.x + item->textRect.w + offset, item->textRect.y, item->textscale, newColor, buff + editPtr->paintOffset, item->cursorPos - editPtr->paintOffset , cursor, editPtr->maxPaintChars, item->textStyle); - } else { - DC->drawText(item->textRect.x + item->textRect.w + offset, item->textRect.y, item->textscale, newColor, buff + editPtr->paintOffset, 0, editPtr->maxPaintChars, item->textStyle); - } - -} - -void Item_YesNo_Paint(itemDef_t *item) { - vec4_t newColor, lowLight; - float value; - menuDef_t *parent = (menuDef_t*)item->parent; - - value = (item->cvar) ? DC->getCVarValue(item->cvar) : 0; - - if (item->window.flags & WINDOW_HASFOCUS) { - lowLight[0] = 0.8 * parent->focusColor[0]; - lowLight[1] = 0.8 * parent->focusColor[1]; - lowLight[2] = 0.8 * parent->focusColor[2]; - lowLight[3] = 0.8 * parent->focusColor[3]; - LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR)); - } else { - memcpy(&newColor, &item->window.foreColor, sizeof(vec4_t)); - } - - if (item->text) { - Item_Text_Paint(item); - DC->drawText(item->textRect.x + item->textRect.w + 8, item->textRect.y, item->textscale, newColor, (value != 0) ? "Yes" : "No", 0, 0, item->textStyle); - } else { - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, newColor, (value != 0) ? "Yes" : "No", 0, 0, item->textStyle); - } -} - -void Item_Multi_Paint(itemDef_t *item) { - vec4_t newColor, lowLight; - const char *text = ""; - menuDef_t *parent = (menuDef_t*)item->parent; - - if (item->window.flags & WINDOW_HASFOCUS) { - lowLight[0] = 0.8 * parent->focusColor[0]; - lowLight[1] = 0.8 * parent->focusColor[1]; - lowLight[2] = 0.8 * parent->focusColor[2]; - lowLight[3] = 0.8 * parent->focusColor[3]; - LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR)); - } else { - memcpy(&newColor, &item->window.foreColor, sizeof(vec4_t)); - } - - text = Item_Multi_Setting(item); - - if (item->text) { - Item_Text_Paint(item); - DC->drawText(item->textRect.x + item->textRect.w + 8, item->textRect.y, item->textscale, newColor, text, 0, 0, item->textStyle); - } else { - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, newColor, text, 0, 0, item->textStyle); - } -} - - -typedef struct { - char *command; - int id; - int defaultbind1; - int defaultbind2; - int bind1; - int bind2; -} bind_t; - -typedef struct -{ - char* name; - float defaultvalue; - float value; -} configcvar_t; - - -static bind_t g_bindings[] = -{ - {"+scores", K_TAB, -1, -1, -1}, - {"+button2", K_ENTER, -1, -1, -1}, - {"+speed", K_SHIFT, -1, -1, -1}, - {"+forward", K_UPARROW, -1, -1, -1}, - {"+back", K_DOWNARROW, -1, -1, -1}, - {"+moveleft", ',', -1, -1, -1}, - {"+moveright", '.', -1, -1, -1}, - {"+moveup", K_SPACE, -1, -1, -1}, - {"+movedown", 'c', -1, -1, -1}, - {"+left", K_LEFTARROW, -1, -1, -1}, - {"+right", K_RIGHTARROW, -1, -1, -1}, - {"+strafe", K_ALT, -1, -1, -1}, - {"+lookup", K_PGDN, -1, -1, -1}, - {"+lookdown", K_DEL, -1, -1, -1}, - {"+mlook", '/', -1, -1, -1}, - {"centerview", K_END, -1, -1, -1}, - {"+zoom", -1, -1, -1, -1}, - {"weapon 1", '1', -1, -1, -1}, - {"weapon 2", '2', -1, -1, -1}, - {"weapon 3", '3', -1, -1, -1}, - {"weapon 4", '4', -1, -1, -1}, - {"weapon 5", '5', -1, -1, -1}, - {"weapon 6", '6', -1, -1, -1}, - {"weapon 7", '7', -1, -1, -1}, - {"weapon 8", '8', -1, -1, -1}, - {"weapon 9", '9', -1, -1, -1}, - {"weapon 10", '0', -1, -1, -1}, - {"weapon 11", -1, -1, -1, -1}, - {"weapon 12", -1, -1, -1, -1}, - {"weapon 13", -1, -1, -1, -1}, - {"+attack", K_CTRL, -1, -1, -1}, - {"weapprev", '[', -1, -1, -1}, - {"weapnext", ']', -1, -1, -1}, - {"+button3", K_MOUSE3, -1, -1, -1}, - {"+button4", K_MOUSE4, -1, -1, -1}, - {"prevTeamMember", 'w', -1, -1, -1}, - {"nextTeamMember", 'r', -1, -1, -1}, - {"nextOrder", 't', -1, -1, -1}, - {"confirmOrder", 'y', -1, -1, -1}, - {"denyOrder", 'n', -1, -1, -1}, - {"taskOffense", 'o', -1, -1, -1}, - {"taskDefense", 'd', -1, -1, -1}, - {"taskPatrol", 'p', -1, -1, -1}, - {"taskCamp", 'c', -1, -1, -1}, - {"taskFollow", 'f', -1, -1, -1}, - {"taskRetrieve", 'v', -1, -1, -1}, - {"taskEscort", 'e', -1, -1, -1}, - {"taskOwnFlag", 'i', -1, -1, -1}, - {"taskSuicide", 'k', -1, -1, -1}, - {"tauntKillInsult", K_F1, -1, -1, -1}, - {"tauntPraise", K_F2, -1, -1, -1}, - {"tauntTaunt", K_F3, -1, -1, -1}, - {"tauntDeathInsult", K_F4, -1, -1, -1}, - {"tauntGauntlet", K_F5, -1, -1, -1}, - {"scoresUp", K_KP_PGUP, -1, -1, -1}, - {"scoresDown", K_KP_PGDN, -1, -1, -1}, - // bk001205 - this one below was: '-1' - {"messagemode", -1, -1, -1, -1}, - {"messagemode2", -1, -1, -1, -1}, - {"messagemode3", -1, -1, -1, -1}, - {"messagemode4", -1, -1, -1, -1} -}; - - -static const int g_bindCount = sizeof(g_bindings) / sizeof(bind_t); - -#ifndef MISSIONPACK // bk001206 -static configcvar_t g_configcvars[] = -{ - {"cl_run", 0, 0}, - {"m_pitch", 0, 0}, - {"cg_autoswitch", 0, 0}, - {"sensitivity", 0, 0}, - {"in_joystick", 0, 0}, - {"joy_threshold", 0, 0}, - {"m_filter", 0, 0}, - {"cl_freelook", 0, 0}, - {NULL, 0, 0} -}; -#endif - -/* -================= -Controls_GetKeyAssignment -================= -*/ -static void Controls_GetKeyAssignment (char *command, int *twokeys) -{ - int count; - int j; - char b[256]; - - twokeys[0] = twokeys[1] = -1; - count = 0; - - for ( j = 0; j < 256; j++ ) - { - DC->getBindingBuf( j, b, 256 ); - if ( *b == 0 ) { - continue; - } - if ( !Q_stricmp( b, command ) ) { - twokeys[count] = j; - count++; - if (count == 2) { - break; - } - } - } -} - -/* -================= -Controls_GetConfig -================= -*/ -void Controls_GetConfig( void ) -{ - int i; - int twokeys[2]; - - // iterate each command, get its numeric binding - for (i=0; i < g_bindCount; i++) - { - - Controls_GetKeyAssignment(g_bindings[i].command, twokeys); - - g_bindings[i].bind1 = twokeys[0]; - g_bindings[i].bind2 = twokeys[1]; - } - - //s_controls.invertmouse.curvalue = DC->getCVarValue( "m_pitch" ) < 0; - //s_controls.smoothmouse.curvalue = UI_ClampCvar( 0, 1, Controls_GetCvarValue( "m_filter" ) ); - //s_controls.alwaysrun.curvalue = UI_ClampCvar( 0, 1, Controls_GetCvarValue( "cl_run" ) ); - //s_controls.autoswitch.curvalue = UI_ClampCvar( 0, 1, Controls_GetCvarValue( "cg_autoswitch" ) ); - //s_controls.sensitivity.curvalue = UI_ClampCvar( 2, 30, Controls_GetCvarValue( "sensitivity" ) ); - //s_controls.joyenable.curvalue = UI_ClampCvar( 0, 1, Controls_GetCvarValue( "in_joystick" ) ); - //s_controls.joythreshold.curvalue = UI_ClampCvar( 0.05, 0.75, Controls_GetCvarValue( "joy_threshold" ) ); - //s_controls.freelook.curvalue = UI_ClampCvar( 0, 1, Controls_GetCvarValue( "cl_freelook" ) ); -} - -/* -================= -Controls_SetConfig -================= -*/ -void Controls_SetConfig(qboolean restart) -{ - int i; - - // iterate each command, get its numeric binding - for (i=0; i < g_bindCount; i++) - { - - if (g_bindings[i].bind1 != -1) - { - DC->setBinding( g_bindings[i].bind1, g_bindings[i].command ); - - if (g_bindings[i].bind2 != -1) - DC->setBinding( g_bindings[i].bind2, g_bindings[i].command ); - } - } - - //if ( s_controls.invertmouse.curvalue ) - // DC->setCVar("m_pitch", va("%f),-fabs( DC->getCVarValue( "m_pitch" ) ) ); - //else - // trap_Cvar_SetValue( "m_pitch", fabs( trap_Cvar_VariableValue( "m_pitch" ) ) ); - - //trap_Cvar_SetValue( "m_filter", s_controls.smoothmouse.curvalue ); - //trap_Cvar_SetValue( "cl_run", s_controls.alwaysrun.curvalue ); - //trap_Cvar_SetValue( "cg_autoswitch", s_controls.autoswitch.curvalue ); - //trap_Cvar_SetValue( "sensitivity", s_controls.sensitivity.curvalue ); - //trap_Cvar_SetValue( "in_joystick", s_controls.joyenable.curvalue ); - //trap_Cvar_SetValue( "joy_threshold", s_controls.joythreshold.curvalue ); - //trap_Cvar_SetValue( "cl_freelook", s_controls.freelook.curvalue ); - DC->executeText(EXEC_APPEND, "in_restart\n"); - //trap_Cmd_ExecuteText( EXEC_APPEND, "in_restart\n" ); -} - -/* -================= -Controls_SetDefaults -================= -*/ -void Controls_SetDefaults( void ) -{ - int i; - - // iterate each command, set its default binding - for (i=0; i < g_bindCount; i++) - { - g_bindings[i].bind1 = g_bindings[i].defaultbind1; - g_bindings[i].bind2 = g_bindings[i].defaultbind2; - } - - //s_controls.invertmouse.curvalue = Controls_GetCvarDefault( "m_pitch" ) < 0; - //s_controls.smoothmouse.curvalue = Controls_GetCvarDefault( "m_filter" ); - //s_controls.alwaysrun.curvalue = Controls_GetCvarDefault( "cl_run" ); - //s_controls.autoswitch.curvalue = Controls_GetCvarDefault( "cg_autoswitch" ); - //s_controls.sensitivity.curvalue = Controls_GetCvarDefault( "sensitivity" ); - //s_controls.joyenable.curvalue = Controls_GetCvarDefault( "in_joystick" ); - //s_controls.joythreshold.curvalue = Controls_GetCvarDefault( "joy_threshold" ); - //s_controls.freelook.curvalue = Controls_GetCvarDefault( "cl_freelook" ); -} - -int BindingIDFromName(const char *name) { - int i; - for (i=0; i < g_bindCount; i++) - { - if (Q_stricmp(name, g_bindings[i].command) == 0) { - return i; - } - } - return -1; -} - -char g_nameBind1[32]; -char g_nameBind2[32]; - -void BindingFromName(const char *cvar) { - int i, b1, b2; - - // iterate each command, set its default binding - for (i=0; i < g_bindCount; i++) - { - if (Q_stricmp(cvar, g_bindings[i].command) == 0) { - b1 = g_bindings[i].bind1; - if (b1 == -1) { - break; - } - DC->keynumToStringBuf( b1, g_nameBind1, 32 ); - Q_strupr(g_nameBind1); - - b2 = g_bindings[i].bind2; - if (b2 != -1) - { - DC->keynumToStringBuf( b2, g_nameBind2, 32 ); - Q_strupr(g_nameBind2); - strcat( g_nameBind1, " or " ); - strcat( g_nameBind1, g_nameBind2 ); - } - return; - } - } - strcpy(g_nameBind1, "???"); -} - -void Item_Slider_Paint(itemDef_t *item) { - vec4_t newColor, lowLight; - float x, y, value; - menuDef_t *parent = (menuDef_t*)item->parent; - - value = (item->cvar) ? DC->getCVarValue(item->cvar) : 0; - - if (item->window.flags & WINDOW_HASFOCUS) { - lowLight[0] = 0.8 * parent->focusColor[0]; - lowLight[1] = 0.8 * parent->focusColor[1]; - lowLight[2] = 0.8 * parent->focusColor[2]; - lowLight[3] = 0.8 * parent->focusColor[3]; - LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR)); - } else { - memcpy(&newColor, &item->window.foreColor, sizeof(vec4_t)); - } - - y = item->window.rect.y; - if (item->text) { - Item_Text_Paint(item); - x = item->textRect.x + item->textRect.w + 8; - } else { - x = item->window.rect.x; - } - DC->setColor(newColor); - DC->drawHandlePic( x, y, SLIDER_WIDTH, SLIDER_HEIGHT, DC->Assets.sliderBar ); - - x = Item_Slider_ThumbPosition(item); - DC->drawHandlePic( x - (SLIDER_THUMB_WIDTH / 2), y - 2, SLIDER_THUMB_WIDTH, SLIDER_THUMB_HEIGHT, DC->Assets.sliderThumb ); - -} - -void Item_Bind_Paint(itemDef_t *item) { - vec4_t newColor, lowLight; - float value; - int maxChars = 0; - menuDef_t *parent = (menuDef_t*)item->parent; - editFieldDef_t *editPtr = (editFieldDef_t*)item->typeData; - if (editPtr) { - maxChars = editPtr->maxPaintChars; - } - - value = (item->cvar) ? DC->getCVarValue(item->cvar) : 0; - - if (item->window.flags & WINDOW_HASFOCUS) { - if (g_bindItem == item) { - lowLight[0] = 0.8f * 1.0f; - lowLight[1] = 0.8f * 0.0f; - lowLight[2] = 0.8f * 0.0f; - lowLight[3] = 0.8f * 1.0f; - } else { - lowLight[0] = 0.8f * parent->focusColor[0]; - lowLight[1] = 0.8f * parent->focusColor[1]; - lowLight[2] = 0.8f * parent->focusColor[2]; - lowLight[3] = 0.8f * parent->focusColor[3]; - } - LerpColor(parent->focusColor,lowLight,newColor,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR)); - } else { - memcpy(&newColor, &item->window.foreColor, sizeof(vec4_t)); - } - - if (item->text) { - Item_Text_Paint(item); - BindingFromName(item->cvar); - DC->drawText(item->textRect.x + item->textRect.w + 8, item->textRect.y, item->textscale, newColor, g_nameBind1, 0, maxChars, item->textStyle); - } else { - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, newColor, (value != 0) ? "FIXME" : "FIXME", 0, maxChars, item->textStyle); - } -} - -qboolean Display_KeyBindPending() { - return g_waitingForKey; -} - -qboolean Item_Bind_HandleKey(itemDef_t *item, int key, qboolean down) { - int id; - int i; - - if (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory) && !g_waitingForKey) - { - if (down && (key == K_MOUSE1 || key == K_ENTER)) { - g_waitingForKey = qtrue; - g_bindItem = item; - } - return qtrue; - } - else - { - if (!g_waitingForKey || g_bindItem == NULL) { - return qtrue; - } - - if (key & K_CHAR_FLAG) { - return qtrue; - } - - switch (key) - { - case K_ESCAPE: - g_waitingForKey = qfalse; - return qtrue; - - case K_BACKSPACE: - id = BindingIDFromName(item->cvar); - if (id != -1) { - g_bindings[id].bind1 = -1; - g_bindings[id].bind2 = -1; - } - Controls_SetConfig(qtrue); - g_waitingForKey = qfalse; - g_bindItem = NULL; - return qtrue; - - case '`': - return qtrue; - } - } - - if (key != -1) - { - - for (i=0; i < g_bindCount; i++) - { - - if (g_bindings[i].bind2 == key) { - g_bindings[i].bind2 = -1; - } - - if (g_bindings[i].bind1 == key) - { - g_bindings[i].bind1 = g_bindings[i].bind2; - g_bindings[i].bind2 = -1; - } - } - } - - - id = BindingIDFromName(item->cvar); - - if (id != -1) { - if (key == -1) { - if( g_bindings[id].bind1 != -1 ) { - DC->setBinding( g_bindings[id].bind1, "" ); - g_bindings[id].bind1 = -1; - } - if( g_bindings[id].bind2 != -1 ) { - DC->setBinding( g_bindings[id].bind2, "" ); - g_bindings[id].bind2 = -1; - } - } - else if (g_bindings[id].bind1 == -1) { - g_bindings[id].bind1 = key; - } - else if (g_bindings[id].bind1 != key && g_bindings[id].bind2 == -1) { - g_bindings[id].bind2 = key; - } - else { - DC->setBinding( g_bindings[id].bind1, "" ); - DC->setBinding( g_bindings[id].bind2, "" ); - g_bindings[id].bind1 = key; - g_bindings[id].bind2 = -1; - } - } - - Controls_SetConfig(qtrue); - g_waitingForKey = qfalse; - - return qtrue; -} - - - -void AdjustFrom640(float *x, float *y, float *w, float *h) { - //*x = *x * DC->scale + DC->bias; - *x *= DC->xscale; - *y *= DC->yscale; - *w *= DC->xscale; - *h *= DC->yscale; -} - -void Item_Model_Paint(itemDef_t *item) { - float x, y, w, h; - refdef_t refdef; - refEntity_t ent; - vec3_t mins, maxs, origin; - vec3_t angles; - modelDef_t *modelPtr = (modelDef_t*)item->typeData; - - if (modelPtr == NULL) { - return; - } - - // setup the refdef - memset( &refdef, 0, sizeof( refdef ) ); - refdef.rdflags = RDF_NOWORLDMODEL; - AxisClear( refdef.viewaxis ); - x = item->window.rect.x+1; - y = item->window.rect.y+1; - w = item->window.rect.w-2; - h = item->window.rect.h-2; - - AdjustFrom640( &x, &y, &w, &h ); - - refdef.x = x; - refdef.y = y; - refdef.width = w; - refdef.height = h; - - DC->modelBounds( item->asset, mins, maxs ); - - origin[2] = -0.5 * ( mins[2] + maxs[2] ); - origin[1] = 0.5 * ( mins[1] + maxs[1] ); - - // calculate distance so the model nearly fills the box - if (qtrue) { - float len = 0.5 * ( maxs[2] - mins[2] ); - origin[0] = len / 0.268; // len / tan( fov/2 ) - //origin[0] = len / tan(w/2); - } else { - origin[0] = item->textscale; - } - refdef.fov_x = (modelPtr->fov_x) ? modelPtr->fov_x : w; - refdef.fov_y = (modelPtr->fov_y) ? modelPtr->fov_y : h; - - //refdef.fov_x = (int)((float)refdef.width / 640.0f * 90.0f); - //xx = refdef.width / tan( refdef.fov_x / 360 * M_PI ); - //refdef.fov_y = atan2( refdef.height, xx ); - //refdef.fov_y *= ( 360 / M_PI ); - - DC->clearScene(); - - refdef.time = DC->realTime; - - // add the model - - memset( &ent, 0, sizeof(ent) ); - - //adjust = 5.0 * sin( (float)uis.realtime / 500 ); - //adjust = 360 % (int)((float)uis.realtime / 1000); - //VectorSet( angles, 0, 0, 1 ); - - // use item storage to track - if (modelPtr->rotationSpeed) { - if (DC->realTime > item->window.nextTime) { - item->window.nextTime = DC->realTime + modelPtr->rotationSpeed; - modelPtr->angle = (int)(modelPtr->angle + 1) % 360; - } - } - VectorSet( angles, 0, modelPtr->angle, 0 ); - AnglesToAxis( angles, ent.axis ); - - ent.hModel = item->asset; - VectorCopy( origin, ent.origin ); - VectorCopy( origin, ent.lightingOrigin ); - ent.renderfx = RF_LIGHTING_ORIGIN | RF_NOSHADOW; - VectorCopy( ent.origin, ent.oldorigin ); - - DC->addRefEntityToScene( &ent ); - DC->renderScene( &refdef ); - -} - - -void Item_Image_Paint(itemDef_t *item) { - if (item == NULL) { - return; - } - DC->drawHandlePic(item->window.rect.x+1, item->window.rect.y+1, item->window.rect.w-2, item->window.rect.h-2, item->asset); -} - -void Item_ListBox_Paint(itemDef_t *item) { - float x, y, size, count, i, thumb; - qhandle_t image; - qhandle_t optionalImage; - listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData; - - // the listbox is horizontal or vertical and has a fixed size scroll bar going either direction - // elements are enumerated from the DC and either text or image handles are acquired from the DC as well - // textscale is used to size the text, textalignx and textaligny are used to size image elements - // there is no clipping available so only the last completely visible item is painted - count = DC->feederCount(item->special); - // default is vertical if horizontal flag is not here - if (item->window.flags & WINDOW_HORIZONTAL) { - // draw scrollbar in bottom of the window - // bar - x = item->window.rect.x + 1; - y = item->window.rect.y + item->window.rect.h - SCROLLBAR_SIZE - 1; - DC->drawHandlePic(x, y, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarArrowLeft); - x += SCROLLBAR_SIZE - 1; - size = item->window.rect.w - (SCROLLBAR_SIZE * 2); - DC->drawHandlePic(x, y, size+1, SCROLLBAR_SIZE, DC->Assets.scrollBar); - x += size - 1; - DC->drawHandlePic(x, y, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarArrowRight); - // thumb - thumb = Item_ListBox_ThumbDrawPosition(item);//Item_ListBox_ThumbPosition(item); - if (thumb > x - SCROLLBAR_SIZE - 1) { - thumb = x - SCROLLBAR_SIZE - 1; - } - DC->drawHandlePic(thumb, y, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarThumb); - // - listPtr->endPos = listPtr->startPos; - size = item->window.rect.w - 2; - // items - // size contains max available space - if (listPtr->elementStyle == LISTBOX_IMAGE) { - // fit = 0; - x = item->window.rect.x + 1; - y = item->window.rect.y + 1; - for (i = listPtr->startPos; i < count; i++) { - // always draw at least one - // which may overdraw the box if it is too small for the element - image = DC->feederItemImage(item->special, i); - if (image) { - DC->drawHandlePic(x+1, y+1, listPtr->elementWidth - 2, listPtr->elementHeight - 2, image); - } - - if (i == item->cursorPos) { - DC->drawRect(x, y, listPtr->elementWidth-1, listPtr->elementHeight-1, item->window.borderSize, item->window.borderColor); - } - - size -= listPtr->elementWidth; - if (size < listPtr->elementWidth) { - listPtr->drawPadding = size; //listPtr->elementWidth - size; - break; - } - x += listPtr->elementWidth; - listPtr->endPos++; - // fit++; - } - } else { - // - } - } else { - // draw scrollbar to right side of the window - x = item->window.rect.x + item->window.rect.w - SCROLLBAR_SIZE - 1; - y = item->window.rect.y + 1; - DC->drawHandlePic(x, y, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarArrowUp); - y += SCROLLBAR_SIZE - 1; - - listPtr->endPos = listPtr->startPos; - size = item->window.rect.h - (SCROLLBAR_SIZE * 2); - DC->drawHandlePic(x, y, SCROLLBAR_SIZE, size+1, DC->Assets.scrollBar); - y += size - 1; - DC->drawHandlePic(x, y, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarArrowDown); - // thumb - thumb = Item_ListBox_ThumbDrawPosition(item);//Item_ListBox_ThumbPosition(item); - if (thumb > y - SCROLLBAR_SIZE - 1) { - thumb = y - SCROLLBAR_SIZE - 1; - } - DC->drawHandlePic(x, thumb, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarThumb); - - // adjust size for item painting - size = item->window.rect.h - 2; - if (listPtr->elementStyle == LISTBOX_IMAGE) { - // fit = 0; - x = item->window.rect.x + 1; - y = item->window.rect.y + 1; - for (i = listPtr->startPos; i < count; i++) { - // always draw at least one - // which may overdraw the box if it is too small for the element - image = DC->feederItemImage(item->special, i); - if (image) { - DC->drawHandlePic(x+1, y+1, listPtr->elementWidth - 2, listPtr->elementHeight - 2, image); - } - - if (i == item->cursorPos) { - DC->drawRect(x, y, listPtr->elementWidth - 1, listPtr->elementHeight - 1, item->window.borderSize, item->window.borderColor); - } - - listPtr->endPos++; - size -= listPtr->elementWidth; - if (size < listPtr->elementHeight) { - listPtr->drawPadding = listPtr->elementHeight - size; - break; - } - y += listPtr->elementHeight; - // fit++; - } - } else { - x = item->window.rect.x + 1; - y = item->window.rect.y + 1; - for (i = listPtr->startPos; i < count; i++) { - const char *text; - // always draw at least one - // which may overdraw the box if it is too small for the element - - if (listPtr->numColumns > 0) { - int j; - for (j = 0; j < listPtr->numColumns; j++) { - text = DC->feederItemText(item->special, i, j, &optionalImage); - if (optionalImage >= 0) { - DC->drawHandlePic(x + 4 + listPtr->columnInfo[j].pos, y - 1 + listPtr->elementHeight / 2, listPtr->columnInfo[j].width, listPtr->columnInfo[j].width, optionalImage); - } else if (text) { - DC->drawText(x + 4 + listPtr->columnInfo[j].pos, y + listPtr->elementHeight, item->textscale, item->window.foreColor, text, 0, listPtr->columnInfo[j].maxChars, item->textStyle); - } - } - } else { - text = DC->feederItemText(item->special, i, 0, &optionalImage); - if (optionalImage >= 0) { - //DC->drawHandlePic(x + 4 + listPtr->elementHeight, y, listPtr->columnInfo[j].width, listPtr->columnInfo[j].width, optionalImage); - } else if (text) { - DC->drawText(x + 4, y + listPtr->elementHeight, item->textscale, item->window.foreColor, text, 0, 0, item->textStyle); - } - } - - if (i == item->cursorPos) { - DC->fillRect(x + 2, y + 2, item->window.rect.w - SCROLLBAR_SIZE - 4, listPtr->elementHeight, item->window.outlineColor); - } - - size -= listPtr->elementHeight; - if (size < listPtr->elementHeight) { - listPtr->drawPadding = listPtr->elementHeight - size; - break; - } - listPtr->endPos++; - y += listPtr->elementHeight; - // fit++; - } - } - } -} - - -void Item_OwnerDraw_Paint(itemDef_t *item) { - menuDef_t *parent; - - if (item == NULL) { - return; - } - parent = (menuDef_t*)item->parent; - - if (DC->ownerDrawItem) { - vec4_t color, lowLight; - menuDef_t *parent = (menuDef_t*)item->parent; - Fade(&item->window.flags, &item->window.foreColor[3], parent->fadeClamp, &item->window.nextTime, parent->fadeCycle, qtrue, parent->fadeAmount); - memcpy(&color, &item->window.foreColor, sizeof(color)); - if (item->numColors > 0 && DC->getValue) { - // if the value is within one of the ranges then set color to that, otherwise leave at default - int i; - float f = DC->getValue(item->window.ownerDraw); - for (i = 0; i < item->numColors; i++) { - if (f >= item->colorRanges[i].low && f <= item->colorRanges[i].high) { - memcpy(&color, &item->colorRanges[i].color, sizeof(color)); - break; - } - } - } - - if (item->window.flags & WINDOW_HASFOCUS) { - lowLight[0] = 0.8 * parent->focusColor[0]; - lowLight[1] = 0.8 * parent->focusColor[1]; - lowLight[2] = 0.8 * parent->focusColor[2]; - lowLight[3] = 0.8 * parent->focusColor[3]; - LerpColor(parent->focusColor,lowLight,color,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR)); - } else if (item->textStyle == ITEM_TEXTSTYLE_BLINK && !((DC->realTime/BLINK_DIVISOR) & 1)) { - lowLight[0] = 0.8 * item->window.foreColor[0]; - lowLight[1] = 0.8 * item->window.foreColor[1]; - lowLight[2] = 0.8 * item->window.foreColor[2]; - lowLight[3] = 0.8 * item->window.foreColor[3]; - LerpColor(item->window.foreColor,lowLight,color,0.5+0.5*sin(DC->realTime / PULSE_DIVISOR)); - } - - if (item->cvarFlags & (CVAR_ENABLE | CVAR_DISABLE) && !Item_EnableShowViaCvar(item, CVAR_ENABLE)) { - memcpy(color, parent->disableColor, sizeof(vec4_t)); // bk001207 - FIXME: Com_Memcpy - } - - if (item->text) { - Item_Text_Paint(item); - if (item->text[0]) { - // +8 is an offset kludge to properly align owner draw items that have text combined with them - DC->ownerDrawItem(item->textRect.x + item->textRect.w + 8, item->window.rect.y, item->window.rect.w, item->window.rect.h, 0, item->textaligny, item->window.ownerDraw, item->window.ownerDrawFlags, item->alignment, item->special, item->textscale, color, item->window.background, item->textStyle ); - } else { - DC->ownerDrawItem(item->textRect.x + item->textRect.w, item->window.rect.y, item->window.rect.w, item->window.rect.h, 0, item->textaligny, item->window.ownerDraw, item->window.ownerDrawFlags, item->alignment, item->special, item->textscale, color, item->window.background, item->textStyle ); - } - } else { - DC->ownerDrawItem(item->window.rect.x, item->window.rect.y, item->window.rect.w, item->window.rect.h, item->textalignx, item->textaligny, item->window.ownerDraw, item->window.ownerDrawFlags, item->alignment, item->special, item->textscale, color, item->window.background, item->textStyle ); - } - } -} - - -void Item_Paint(itemDef_t *item) { - vec4_t red; - menuDef_t *parent = (menuDef_t*)item->parent; - red[0] = red[3] = 1; - red[1] = red[2] = 0; - - if (item == NULL) { - return; - } - - if (item->window.flags & WINDOW_ORBITING) { - if (DC->realTime > item->window.nextTime) { - float rx, ry, a, c, s, w, h; - - item->window.nextTime = DC->realTime + item->window.offsetTime; - // translate - w = item->window.rectClient.w / 2; - h = item->window.rectClient.h / 2; - rx = item->window.rectClient.x + w - item->window.rectEffects.x; - ry = item->window.rectClient.y + h - item->window.rectEffects.y; - a = 3 * M_PI / 180; - c = cos(a); - s = sin(a); - item->window.rectClient.x = (rx * c - ry * s) + item->window.rectEffects.x - w; - item->window.rectClient.y = (rx * s + ry * c) + item->window.rectEffects.y - h; - Item_UpdatePosition(item); - - } - } - - - if (item->window.flags & WINDOW_INTRANSITION) { - if (DC->realTime > item->window.nextTime) { - int done = 0; - item->window.nextTime = DC->realTime + item->window.offsetTime; - // transition the x,y - if (item->window.rectClient.x == item->window.rectEffects.x) { - done++; - } else { - if (item->window.rectClient.x < item->window.rectEffects.x) { - item->window.rectClient.x += item->window.rectEffects2.x; - if (item->window.rectClient.x > item->window.rectEffects.x) { - item->window.rectClient.x = item->window.rectEffects.x; - done++; - } - } else { - item->window.rectClient.x -= item->window.rectEffects2.x; - if (item->window.rectClient.x < item->window.rectEffects.x) { - item->window.rectClient.x = item->window.rectEffects.x; - done++; - } - } - } - if (item->window.rectClient.y == item->window.rectEffects.y) { - done++; - } else { - if (item->window.rectClient.y < item->window.rectEffects.y) { - item->window.rectClient.y += item->window.rectEffects2.y; - if (item->window.rectClient.y > item->window.rectEffects.y) { - item->window.rectClient.y = item->window.rectEffects.y; - done++; - } - } else { - item->window.rectClient.y -= item->window.rectEffects2.y; - if (item->window.rectClient.y < item->window.rectEffects.y) { - item->window.rectClient.y = item->window.rectEffects.y; - done++; - } - } - } - if (item->window.rectClient.w == item->window.rectEffects.w) { - done++; - } else { - if (item->window.rectClient.w < item->window.rectEffects.w) { - item->window.rectClient.w += item->window.rectEffects2.w; - if (item->window.rectClient.w > item->window.rectEffects.w) { - item->window.rectClient.w = item->window.rectEffects.w; - done++; - } - } else { - item->window.rectClient.w -= item->window.rectEffects2.w; - if (item->window.rectClient.w < item->window.rectEffects.w) { - item->window.rectClient.w = item->window.rectEffects.w; - done++; - } - } - } - if (item->window.rectClient.h == item->window.rectEffects.h) { - done++; - } else { - if (item->window.rectClient.h < item->window.rectEffects.h) { - item->window.rectClient.h += item->window.rectEffects2.h; - if (item->window.rectClient.h > item->window.rectEffects.h) { - item->window.rectClient.h = item->window.rectEffects.h; - done++; - } - } else { - item->window.rectClient.h -= item->window.rectEffects2.h; - if (item->window.rectClient.h < item->window.rectEffects.h) { - item->window.rectClient.h = item->window.rectEffects.h; - done++; - } - } - } - - Item_UpdatePosition(item); - - if (done == 4) { - item->window.flags &= ~WINDOW_INTRANSITION; - } - - } - } - - if (item->window.ownerDrawFlags && DC->ownerDrawVisible) { - if (!DC->ownerDrawVisible(item->window.ownerDrawFlags)) { - item->window.flags &= ~WINDOW_VISIBLE; - } else { - item->window.flags |= WINDOW_VISIBLE; - } - } - - if (item->cvarFlags & (CVAR_SHOW | CVAR_HIDE)) { - if (!Item_EnableShowViaCvar(item, CVAR_SHOW)) { - return; - } - } - - if (item->window.flags & WINDOW_TIMEDVISIBLE) { - - } - - if (!(item->window.flags & WINDOW_VISIBLE)) { - return; - } - - // paint the rect first.. - Window_Paint(&item->window, parent->fadeAmount , parent->fadeClamp, parent->fadeCycle); - - if (debugMode) { - vec4_t color; - rectDef_t *r = Item_CorrectedTextRect(item); - color[1] = color[3] = 1; - color[0] = color[2] = 0; - DC->drawRect(r->x, r->y, r->w, r->h, 1, color); - } - - //DC->drawRect(item->window.rect.x, item->window.rect.y, item->window.rect.w, item->window.rect.h, 1, red); - - switch (item->type) { - case ITEM_TYPE_OWNERDRAW: - Item_OwnerDraw_Paint(item); - break; - case ITEM_TYPE_TEXT: - case ITEM_TYPE_BUTTON: - Item_Text_Paint(item); - break; - case ITEM_TYPE_RADIOBUTTON: - break; - case ITEM_TYPE_CHECKBOX: - break; - case ITEM_TYPE_EDITFIELD: - case ITEM_TYPE_NUMERICFIELD: - Item_TextField_Paint(item); - break; - case ITEM_TYPE_COMBO: - break; - case ITEM_TYPE_LISTBOX: - Item_ListBox_Paint(item); - break; - //case ITEM_TYPE_IMAGE: - // Item_Image_Paint(item); - // break; - case ITEM_TYPE_MODEL: - Item_Model_Paint(item); - break; - case ITEM_TYPE_YESNO: - Item_YesNo_Paint(item); - break; - case ITEM_TYPE_MULTI: - Item_Multi_Paint(item); - break; - case ITEM_TYPE_BIND: - Item_Bind_Paint(item); - break; - case ITEM_TYPE_SLIDER: - Item_Slider_Paint(item); - break; - default: - break; - } - -} - -void Menu_Init(menuDef_t *menu) { - memset(menu, 0, sizeof(menuDef_t)); - menu->cursorItem = -1; - menu->fadeAmount = DC->Assets.fadeAmount; - menu->fadeClamp = DC->Assets.fadeClamp; - menu->fadeCycle = DC->Assets.fadeCycle; - Window_Init(&menu->window); -} - -itemDef_t *Menu_GetFocusedItem(menuDef_t *menu) { - int i; - if (menu) { - for (i = 0; i < menu->itemCount; i++) { - if (menu->items[i]->window.flags & WINDOW_HASFOCUS) { - return menu->items[i]; - } - } - } - return NULL; -} - -menuDef_t *Menu_GetFocused() { - int i; - for (i = 0; i < menuCount; i++) { - if (Menus[i].window.flags & WINDOW_HASFOCUS && Menus[i].window.flags & WINDOW_VISIBLE) { - return &Menus[i]; - } - } - return NULL; -} - -void Menu_ScrollFeeder(menuDef_t *menu, int feeder, qboolean down) { - if (menu) { - int i; - for (i = 0; i < menu->itemCount; i++) { - if (menu->items[i]->special == feeder) { - Item_ListBox_HandleKey(menu->items[i], (down) ? K_DOWNARROW : K_UPARROW, qtrue, qtrue); - return; - } - } - } -} - - - -void Menu_SetFeederSelection(menuDef_t *menu, int feeder, int index, const char *name) { - if (menu == NULL) { - if (name == NULL) { - menu = Menu_GetFocused(); - } else { - menu = Menus_FindByName(name); - } - } - - if (menu) { - int i; - for (i = 0; i < menu->itemCount; i++) { - if (menu->items[i]->special == feeder) { - if (index == 0) { - listBoxDef_t *listPtr = (listBoxDef_t*)menu->items[i]->typeData; - listPtr->cursorPos = 0; - listPtr->startPos = 0; - } - menu->items[i]->cursorPos = index; - DC->feederSelection(menu->items[i]->special, menu->items[i]->cursorPos); - return; - } - } - } -} - -qboolean Menus_AnyFullScreenVisible() { - int i; - for (i = 0; i < menuCount; i++) { - if (Menus[i].window.flags & WINDOW_VISIBLE && Menus[i].fullScreen) { - return qtrue; - } - } - return qfalse; -} - -menuDef_t *Menus_ActivateByName(const char *p) { - int i; - menuDef_t *m = NULL; - menuDef_t *focus = Menu_GetFocused(); - for (i = 0; i < menuCount; i++) { - if (Q_stricmp(Menus[i].window.name, p) == 0) { - m = &Menus[i]; - Menus_Activate(m); - if (openMenuCount < MAX_OPEN_MENUS && focus != NULL) { - menuStack[openMenuCount++] = focus; - } - } else { - Menus[i].window.flags &= ~WINDOW_HASFOCUS; - } - } - Display_CloseCinematics(); - return m; -} - - -void Item_Init(itemDef_t *item) { - memset(item, 0, sizeof(itemDef_t)); - item->textscale = 0.55f; - Window_Init(&item->window); -} - -void Menu_HandleMouseMove(menuDef_t *menu, float x, float y) { - int i, pass; - qboolean focusSet = qfalse; - - itemDef_t *overItem; - if (menu == NULL) { - return; - } - - if (!(menu->window.flags & (WINDOW_VISIBLE | WINDOW_FORCED))) { - return; - } - - if (itemCapture) { - //Item_MouseMove(itemCapture, x, y); - return; - } - - if (g_waitingForKey || g_editingField) { - return; - } - - // FIXME: this is the whole issue of focus vs. mouse over.. - // need a better overall solution as i don't like going through everything twice - for (pass = 0; pass < 2; pass++) { - for (i = 0; i < menu->itemCount; i++) { - // turn off focus each item - // menu->items[i].window.flags &= ~WINDOW_HASFOCUS; - - if (!(menu->items[i]->window.flags & (WINDOW_VISIBLE | WINDOW_FORCED))) { - continue; - } - - // items can be enabled and disabled based on cvars - if (menu->items[i]->cvarFlags & (CVAR_ENABLE | CVAR_DISABLE) && !Item_EnableShowViaCvar(menu->items[i], CVAR_ENABLE)) { - continue; - } - - if (menu->items[i]->cvarFlags & (CVAR_SHOW | CVAR_HIDE) && !Item_EnableShowViaCvar(menu->items[i], CVAR_SHOW)) { - continue; - } - - - - if (Rect_ContainsPoint(&menu->items[i]->window.rect, x, y)) { - if (pass == 1) { - overItem = menu->items[i]; - if (overItem->type == ITEM_TYPE_TEXT && overItem->text) { - if (!Rect_ContainsPoint(Item_CorrectedTextRect(overItem), x, y)) { - continue; - } - } - // if we are over an item - if (IsVisible(overItem->window.flags)) { - // different one - Item_MouseEnter(overItem, x, y); - // Item_SetMouseOver(overItem, qtrue); - - // if item is not a decoration see if it can take focus - if (!focusSet) { - focusSet = Item_SetFocus(overItem, x, y); - } - } - } - } else if (menu->items[i]->window.flags & WINDOW_MOUSEOVER) { - Item_MouseLeave(menu->items[i]); - Item_SetMouseOver(menu->items[i], qfalse); - } - } - } - -} - -void Menu_Paint(menuDef_t *menu, qboolean forcePaint) { - int i; - - if (menu == NULL) { - return; - } - - if (!(menu->window.flags & WINDOW_VISIBLE) && !forcePaint) { - return; - } - - if (menu->window.ownerDrawFlags && DC->ownerDrawVisible && !DC->ownerDrawVisible(menu->window.ownerDrawFlags)) { - return; - } - - if (forcePaint) { - menu->window.flags |= WINDOW_FORCED; - } - - // draw the background if necessary - if (menu->fullScreen) { - // implies a background shader - // FIXME: make sure we have a default shader if fullscreen is set with no background - DC->drawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, menu->window.background ); - } else if (menu->window.background) { - // this allows a background shader without being full screen - //UI_DrawHandlePic(menu->window.rect.x, menu->window.rect.y, menu->window.rect.w, menu->window.rect.h, menu->backgroundShader); - } - - // paint the background and or border - Window_Paint(&menu->window, menu->fadeAmount, menu->fadeClamp, menu->fadeCycle ); - - for (i = 0; i < menu->itemCount; i++) { - Item_Paint(menu->items[i]); - } - - if (debugMode) { - vec4_t color; - color[0] = color[2] = color[3] = 1; - color[1] = 0; - DC->drawRect(menu->window.rect.x, menu->window.rect.y, menu->window.rect.w, menu->window.rect.h, 1, color); - } -} - -/* -=============== -Item_ValidateTypeData -=============== -*/ -void Item_ValidateTypeData(itemDef_t *item) { - if (item->typeData) { - return; - } - - if (item->type == ITEM_TYPE_LISTBOX) { - item->typeData = UI_Alloc(sizeof(listBoxDef_t)); - memset(item->typeData, 0, sizeof(listBoxDef_t)); - } else if (item->type == ITEM_TYPE_EDITFIELD || item->type == ITEM_TYPE_NUMERICFIELD || item->type == ITEM_TYPE_YESNO || item->type == ITEM_TYPE_BIND || item->type == ITEM_TYPE_SLIDER || item->type == ITEM_TYPE_TEXT) { - item->typeData = UI_Alloc(sizeof(editFieldDef_t)); - memset(item->typeData, 0, sizeof(editFieldDef_t)); - if (item->type == ITEM_TYPE_EDITFIELD) { - if (!((editFieldDef_t *) item->typeData)->maxPaintChars) { - ((editFieldDef_t *) item->typeData)->maxPaintChars = MAX_EDITFIELD; - } - } - } else if (item->type == ITEM_TYPE_MULTI) { - item->typeData = UI_Alloc(sizeof(multiDef_t)); - } else if (item->type == ITEM_TYPE_MODEL) { - item->typeData = UI_Alloc(sizeof(modelDef_t)); - } -} - -/* -=============== -Keyword Hash -=============== -*/ - -#define KEYWORDHASH_SIZE 512 - -typedef struct keywordHash_s -{ - char *keyword; - qboolean (*func)(itemDef_t *item, int handle); - struct keywordHash_s *next; -} keywordHash_t; - -int KeywordHash_Key(char *keyword) { - int register hash, i; - - hash = 0; - for (i = 0; keyword[i] != '\0'; i++) { - if (keyword[i] >= 'A' && keyword[i] <= 'Z') - hash += (keyword[i] + ('a' - 'A')) * (119 + i); - else - hash += keyword[i] * (119 + i); - } - hash = (hash ^ (hash >> 10) ^ (hash >> 20)) & (KEYWORDHASH_SIZE-1); - return hash; -} - -void KeywordHash_Add(keywordHash_t *table[], keywordHash_t *key) { - int hash; - - hash = KeywordHash_Key(key->keyword); -/* - if (table[hash]) { - int collision = qtrue; - } -*/ - key->next = table[hash]; - table[hash] = key; -} - -keywordHash_t *KeywordHash_Find(keywordHash_t *table[], char *keyword) -{ - keywordHash_t *key; - int hash; - - hash = KeywordHash_Key(keyword); - for (key = table[hash]; key; key = key->next) { - if (!Q_stricmp(key->keyword, keyword)) - return key; - } - return NULL; -} - -/* -=============== -Item Keyword Parse functions -=============== -*/ - -// name -qboolean ItemParse_name( itemDef_t *item, int handle ) { - if (!PC_String_Parse(handle, &item->window.name)) { - return qfalse; - } - return qtrue; -} - -// name -qboolean ItemParse_focusSound( itemDef_t *item, int handle ) { - const char *temp; - if (!PC_String_Parse(handle, &temp)) { - return qfalse; - } - item->focusSound = DC->registerSound(temp, qfalse); - return qtrue; -} - - -// text -qboolean ItemParse_text( itemDef_t *item, int handle ) { - if (!PC_String_Parse(handle, &item->text)) { - return qfalse; - } - return qtrue; -} - -// group -qboolean ItemParse_group( itemDef_t *item, int handle ) { - if (!PC_String_Parse(handle, &item->window.group)) { - return qfalse; - } - return qtrue; -} - -// asset_model -qboolean ItemParse_asset_model( itemDef_t *item, int handle ) { - const char *temp; - modelDef_t *modelPtr; - Item_ValidateTypeData(item); - modelPtr = (modelDef_t*)item->typeData; - - if (!PC_String_Parse(handle, &temp)) { - return qfalse; - } - item->asset = DC->registerModel(temp); - modelPtr->angle = rand() % 360; - return qtrue; -} - -// asset_shader -qboolean ItemParse_asset_shader( itemDef_t *item, int handle ) { - const char *temp; - - if (!PC_String_Parse(handle, &temp)) { - return qfalse; - } - item->asset = DC->registerShaderNoMip(temp); - return qtrue; -} - -// model_origin -qboolean ItemParse_model_origin( itemDef_t *item, int handle ) { - modelDef_t *modelPtr; - Item_ValidateTypeData(item); - modelPtr = (modelDef_t*)item->typeData; - - if (PC_Float_Parse(handle, &modelPtr->origin[0])) { - if (PC_Float_Parse(handle, &modelPtr->origin[1])) { - if (PC_Float_Parse(handle, &modelPtr->origin[2])) { - return qtrue; - } - } - } - return qfalse; -} - -// model_fovx -qboolean ItemParse_model_fovx( itemDef_t *item, int handle ) { - modelDef_t *modelPtr; - Item_ValidateTypeData(item); - modelPtr = (modelDef_t*)item->typeData; - - if (!PC_Float_Parse(handle, &modelPtr->fov_x)) { - return qfalse; - } - return qtrue; -} - -// model_fovy -qboolean ItemParse_model_fovy( itemDef_t *item, int handle ) { - modelDef_t *modelPtr; - Item_ValidateTypeData(item); - modelPtr = (modelDef_t*)item->typeData; - - if (!PC_Float_Parse(handle, &modelPtr->fov_y)) { - return qfalse; - } - return qtrue; -} - -// model_rotation -qboolean ItemParse_model_rotation( itemDef_t *item, int handle ) { - modelDef_t *modelPtr; - Item_ValidateTypeData(item); - modelPtr = (modelDef_t*)item->typeData; - - if (!PC_Int_Parse(handle, &modelPtr->rotationSpeed)) { - return qfalse; - } - return qtrue; -} - -// model_angle -qboolean ItemParse_model_angle( itemDef_t *item, int handle ) { - modelDef_t *modelPtr; - Item_ValidateTypeData(item); - modelPtr = (modelDef_t*)item->typeData; - - if (!PC_Int_Parse(handle, &modelPtr->angle)) { - return qfalse; - } - return qtrue; -} - -// rect -qboolean ItemParse_rect( itemDef_t *item, int handle ) { - if (!PC_Rect_Parse(handle, &item->window.rectClient)) { - return qfalse; - } - return qtrue; -} - -// style -qboolean ItemParse_style( itemDef_t *item, int handle ) { - if (!PC_Int_Parse(handle, &item->window.style)) { - return qfalse; - } - return qtrue; -} - -// decoration -qboolean ItemParse_decoration( itemDef_t *item, int handle ) { - item->window.flags |= WINDOW_DECORATION; - return qtrue; -} - -// notselectable -qboolean ItemParse_notselectable( itemDef_t *item, int handle ) { - listBoxDef_t *listPtr; - Item_ValidateTypeData(item); - listPtr = (listBoxDef_t*)item->typeData; - if (item->type == ITEM_TYPE_LISTBOX && listPtr) { - listPtr->notselectable = qtrue; - } - return qtrue; -} - -// manually wrapped -qboolean ItemParse_wrapped( itemDef_t *item, int handle ) { - item->window.flags |= WINDOW_WRAPPED; - return qtrue; -} - -// auto wrapped -qboolean ItemParse_autowrapped( itemDef_t *item, int handle ) { - item->window.flags |= WINDOW_AUTOWRAPPED; - return qtrue; -} - - -// horizontalscroll -qboolean ItemParse_horizontalscroll( itemDef_t *item, int handle ) { - item->window.flags |= WINDOW_HORIZONTAL; - return qtrue; -} - -// type -qboolean ItemParse_type( itemDef_t *item, int handle ) { - if (!PC_Int_Parse(handle, &item->type)) { - return qfalse; - } - Item_ValidateTypeData(item); - return qtrue; -} - -// elementwidth, used for listbox image elements -// uses textalignx for storage -qboolean ItemParse_elementwidth( itemDef_t *item, int handle ) { - listBoxDef_t *listPtr; - - Item_ValidateTypeData(item); - listPtr = (listBoxDef_t*)item->typeData; - if (!PC_Float_Parse(handle, &listPtr->elementWidth)) { - return qfalse; - } - return qtrue; -} - -// elementheight, used for listbox image elements -// uses textaligny for storage -qboolean ItemParse_elementheight( itemDef_t *item, int handle ) { - listBoxDef_t *listPtr; - - Item_ValidateTypeData(item); - listPtr = (listBoxDef_t*)item->typeData; - if (!PC_Float_Parse(handle, &listPtr->elementHeight)) { - return qfalse; - } - return qtrue; -} - -// feeder -qboolean ItemParse_feeder( itemDef_t *item, int handle ) { - if (!PC_Float_Parse(handle, &item->special)) { - return qfalse; - } - return qtrue; -} - -// elementtype, used to specify what type of elements a listbox contains -// uses textstyle for storage -qboolean ItemParse_elementtype( itemDef_t *item, int handle ) { - listBoxDef_t *listPtr; - - Item_ValidateTypeData(item); - if (!item->typeData) - return qfalse; - listPtr = (listBoxDef_t*)item->typeData; - if (!PC_Int_Parse(handle, &listPtr->elementStyle)) { - return qfalse; - } - return qtrue; -} - -// columns sets a number of columns and an x pos and width per.. -qboolean ItemParse_columns( itemDef_t *item, int handle ) { - int num, i; - listBoxDef_t *listPtr; - - Item_ValidateTypeData(item); - if (!item->typeData) - return qfalse; - listPtr = (listBoxDef_t*)item->typeData; - if (PC_Int_Parse(handle, &num)) { - if (num > MAX_LB_COLUMNS) { - num = MAX_LB_COLUMNS; - } - listPtr->numColumns = num; - for (i = 0; i < num; i++) { - int pos, width, maxChars; - - if (PC_Int_Parse(handle, &pos) && PC_Int_Parse(handle, &width) && PC_Int_Parse(handle, &maxChars)) { - listPtr->columnInfo[i].pos = pos; - listPtr->columnInfo[i].width = width; - listPtr->columnInfo[i].maxChars = maxChars; - } else { - return qfalse; - } - } - } else { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_border( itemDef_t *item, int handle ) { - if (!PC_Int_Parse(handle, &item->window.border)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_bordersize( itemDef_t *item, int handle ) { - if (!PC_Float_Parse(handle, &item->window.borderSize)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_visible( itemDef_t *item, int handle ) { - int i; - - if (!PC_Int_Parse(handle, &i)) { - return qfalse; - } - if (i) { - item->window.flags |= WINDOW_VISIBLE; - } - return qtrue; -} - -qboolean ItemParse_ownerdraw( itemDef_t *item, int handle ) { - if (!PC_Int_Parse(handle, &item->window.ownerDraw)) { - return qfalse; - } - item->type = ITEM_TYPE_OWNERDRAW; - return qtrue; -} - -qboolean ItemParse_align( itemDef_t *item, int handle ) { - if (!PC_Int_Parse(handle, &item->alignment)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_textalign( itemDef_t *item, int handle ) { - if (!PC_Int_Parse(handle, &item->textalignment)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_textalignx( itemDef_t *item, int handle ) { - if (!PC_Float_Parse(handle, &item->textalignx)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_textaligny( itemDef_t *item, int handle ) { - if (!PC_Float_Parse(handle, &item->textaligny)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_textscale( itemDef_t *item, int handle ) { - if (!PC_Float_Parse(handle, &item->textscale)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_textstyle( itemDef_t *item, int handle ) { - if (!PC_Int_Parse(handle, &item->textStyle)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_backcolor( itemDef_t *item, int handle ) { - int i; - float f; - - for (i = 0; i < 4; i++) { - if (!PC_Float_Parse(handle, &f)) { - return qfalse; - } - item->window.backColor[i] = f; - } - return qtrue; -} - -qboolean ItemParse_forecolor( itemDef_t *item, int handle ) { - int i; - float f; - - for (i = 0; i < 4; i++) { - if (!PC_Float_Parse(handle, &f)) { - return qfalse; - } - item->window.foreColor[i] = f; - item->window.flags |= WINDOW_FORECOLORSET; - } - return qtrue; -} - -qboolean ItemParse_bordercolor( itemDef_t *item, int handle ) { - int i; - float f; - - for (i = 0; i < 4; i++) { - if (!PC_Float_Parse(handle, &f)) { - return qfalse; - } - item->window.borderColor[i] = f; - } - return qtrue; -} - -qboolean ItemParse_outlinecolor( itemDef_t *item, int handle ) { - if (!PC_Color_Parse(handle, &item->window.outlineColor)){ - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_background( itemDef_t *item, int handle ) { - const char *temp; - - if (!PC_String_Parse(handle, &temp)) { - return qfalse; - } - item->window.background = DC->registerShaderNoMip(temp); - return qtrue; -} - -qboolean ItemParse_cinematic( itemDef_t *item, int handle ) { - if (!PC_String_Parse(handle, &item->window.cinematicName)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_doubleClick( itemDef_t *item, int handle ) { - listBoxDef_t *listPtr; - - Item_ValidateTypeData(item); - if (!item->typeData) { - return qfalse; - } - - listPtr = (listBoxDef_t*)item->typeData; - - if (!PC_Script_Parse(handle, &listPtr->doubleClick)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_onFocus( itemDef_t *item, int handle ) { - if (!PC_Script_Parse(handle, &item->onFocus)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_leaveFocus( itemDef_t *item, int handle ) { - if (!PC_Script_Parse(handle, &item->leaveFocus)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_mouseEnter( itemDef_t *item, int handle ) { - if (!PC_Script_Parse(handle, &item->mouseEnter)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_mouseExit( itemDef_t *item, int handle ) { - if (!PC_Script_Parse(handle, &item->mouseExit)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_mouseEnterText( itemDef_t *item, int handle ) { - if (!PC_Script_Parse(handle, &item->mouseEnterText)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_mouseExitText( itemDef_t *item, int handle ) { - if (!PC_Script_Parse(handle, &item->mouseExitText)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_action( itemDef_t *item, int handle ) { - if (!PC_Script_Parse(handle, &item->action)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_special( itemDef_t *item, int handle ) { - if (!PC_Float_Parse(handle, &item->special)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_cvarTest( itemDef_t *item, int handle ) { - if (!PC_String_Parse(handle, &item->cvarTest)) { - return qfalse; - } - return qtrue; -} - -qboolean ItemParse_cvar( itemDef_t *item, int handle ) { - editFieldDef_t *editPtr; - - Item_ValidateTypeData(item); - if (!PC_String_Parse(handle, &item->cvar)) { - return qfalse; - } - if (item->typeData) { - editPtr = (editFieldDef_t*)item->typeData; - editPtr->minVal = -1; - editPtr->maxVal = -1; - editPtr->defVal = -1; - } - return qtrue; -} - -qboolean ItemParse_maxChars( itemDef_t *item, int handle ) { - editFieldDef_t *editPtr; - int maxChars; - - Item_ValidateTypeData(item); - if (!item->typeData) - return qfalse; - - if (!PC_Int_Parse(handle, &maxChars)) { - return qfalse; - } - editPtr = (editFieldDef_t*)item->typeData; - editPtr->maxChars = maxChars; - return qtrue; -} - -qboolean ItemParse_maxPaintChars( itemDef_t *item, int handle ) { - editFieldDef_t *editPtr; - int maxChars; - - Item_ValidateTypeData(item); - if (!item->typeData) - return qfalse; - - if (!PC_Int_Parse(handle, &maxChars)) { - return qfalse; - } - editPtr = (editFieldDef_t*)item->typeData; - editPtr->maxPaintChars = maxChars; - return qtrue; -} - - - -qboolean ItemParse_cvarFloat( itemDef_t *item, int handle ) { - editFieldDef_t *editPtr; - - Item_ValidateTypeData(item); - if (!item->typeData) - return qfalse; - editPtr = (editFieldDef_t*)item->typeData; - if (PC_String_Parse(handle, &item->cvar) && - PC_Float_Parse(handle, &editPtr->defVal) && - PC_Float_Parse(handle, &editPtr->minVal) && - PC_Float_Parse(handle, &editPtr->maxVal)) { - return qtrue; - } - return qfalse; -} - -qboolean ItemParse_cvarStrList( itemDef_t *item, int handle ) { - pc_token_t token; - multiDef_t *multiPtr; - int pass; - - Item_ValidateTypeData(item); - if (!item->typeData) - return qfalse; - multiPtr = (multiDef_t*)item->typeData; - multiPtr->count = 0; - multiPtr->strDef = qtrue; - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - if (*token.string != '{') { - return qfalse; - } - - pass = 0; - while ( 1 ) { - if (!trap_PC_ReadToken(handle, &token)) { - PC_SourceError(handle, "end of file inside menu item\n"); - return qfalse; - } - - if (*token.string == '}') { - return qtrue; - } - - if (*token.string == ',' || *token.string == ';') { - continue; - } - - if (pass == 0) { - multiPtr->cvarList[multiPtr->count] = String_Alloc(token.string); - pass = 1; - } else { - multiPtr->cvarStr[multiPtr->count] = String_Alloc(token.string); - pass = 0; - multiPtr->count++; - if (multiPtr->count >= MAX_MULTI_CVARS) { - return qfalse; - } - } - - } - return qfalse; // bk001205 - LCC missing return value -} - -qboolean ItemParse_cvarFloatList( itemDef_t *item, int handle ) { - pc_token_t token; - multiDef_t *multiPtr; - - Item_ValidateTypeData(item); - if (!item->typeData) - return qfalse; - multiPtr = (multiDef_t*)item->typeData; - multiPtr->count = 0; - multiPtr->strDef = qfalse; - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - if (*token.string != '{') { - return qfalse; - } - - while ( 1 ) { - if (!trap_PC_ReadToken(handle, &token)) { - PC_SourceError(handle, "end of file inside menu item\n"); - return qfalse; - } - - if (*token.string == '}') { - return qtrue; - } - - if (*token.string == ',' || *token.string == ';') { - continue; - } - - multiPtr->cvarList[multiPtr->count] = String_Alloc(token.string); - if (!PC_Float_Parse(handle, &multiPtr->cvarValue[multiPtr->count])) { - return qfalse; - } - - multiPtr->count++; - if (multiPtr->count >= MAX_MULTI_CVARS) { - return qfalse; - } - - } - return qfalse; // bk001205 - LCC missing return value -} - - - -qboolean ItemParse_addColorRange( itemDef_t *item, int handle ) { - colorRangeDef_t color; - - if (PC_Float_Parse(handle, &color.low) && - PC_Float_Parse(handle, &color.high) && - PC_Color_Parse(handle, &color.color) ) { - if (item->numColors < MAX_COLOR_RANGES) { - memcpy(&item->colorRanges[item->numColors], &color, sizeof(color)); - item->numColors++; - } - return qtrue; - } - return qfalse; -} - -qboolean ItemParse_ownerdrawFlag( itemDef_t *item, int handle ) { - int i; - if (!PC_Int_Parse(handle, &i)) { - return qfalse; - } - item->window.ownerDrawFlags |= i; - return qtrue; -} - -qboolean ItemParse_enableCvar( itemDef_t *item, int handle ) { - if (PC_Script_Parse(handle, &item->enableCvar)) { - item->cvarFlags = CVAR_ENABLE; - return qtrue; - } - return qfalse; -} - -qboolean ItemParse_disableCvar( itemDef_t *item, int handle ) { - if (PC_Script_Parse(handle, &item->enableCvar)) { - item->cvarFlags = CVAR_DISABLE; - return qtrue; - } - return qfalse; -} - -qboolean ItemParse_showCvar( itemDef_t *item, int handle ) { - if (PC_Script_Parse(handle, &item->enableCvar)) { - item->cvarFlags = CVAR_SHOW; - return qtrue; - } - return qfalse; -} - -qboolean ItemParse_hideCvar( itemDef_t *item, int handle ) { - if (PC_Script_Parse(handle, &item->enableCvar)) { - item->cvarFlags = CVAR_HIDE; - return qtrue; - } - return qfalse; -} - - -keywordHash_t itemParseKeywords[] = { - {"name", ItemParse_name, NULL}, - {"text", ItemParse_text, NULL}, - {"group", ItemParse_group, NULL}, - {"asset_model", ItemParse_asset_model, NULL}, - {"asset_shader", ItemParse_asset_shader, NULL}, - {"model_origin", ItemParse_model_origin, NULL}, - {"model_fovx", ItemParse_model_fovx, NULL}, - {"model_fovy", ItemParse_model_fovy, NULL}, - {"model_rotation", ItemParse_model_rotation, NULL}, - {"model_angle", ItemParse_model_angle, NULL}, - {"rect", ItemParse_rect, NULL}, - {"style", ItemParse_style, NULL}, - {"decoration", ItemParse_decoration, NULL}, - {"notselectable", ItemParse_notselectable, NULL}, - {"wrapped", ItemParse_wrapped, NULL}, - {"autowrapped", ItemParse_autowrapped, NULL}, - {"horizontalscroll", ItemParse_horizontalscroll, NULL}, - {"type", ItemParse_type, NULL}, - {"elementwidth", ItemParse_elementwidth, NULL}, - {"elementheight", ItemParse_elementheight, NULL}, - {"feeder", ItemParse_feeder, NULL}, - {"elementtype", ItemParse_elementtype, NULL}, - {"columns", ItemParse_columns, NULL}, - {"border", ItemParse_border, NULL}, - {"bordersize", ItemParse_bordersize, NULL}, - {"visible", ItemParse_visible, NULL}, - {"ownerdraw", ItemParse_ownerdraw, NULL}, - {"align", ItemParse_align, NULL}, - {"textalign", ItemParse_textalign, NULL}, - {"textalignx", ItemParse_textalignx, NULL}, - {"textaligny", ItemParse_textaligny, NULL}, - {"textscale", ItemParse_textscale, NULL}, - {"textstyle", ItemParse_textstyle, NULL}, - {"backcolor", ItemParse_backcolor, NULL}, - {"forecolor", ItemParse_forecolor, NULL}, - {"bordercolor", ItemParse_bordercolor, NULL}, - {"outlinecolor", ItemParse_outlinecolor, NULL}, - {"background", ItemParse_background, NULL}, - {"onFocus", ItemParse_onFocus, NULL}, - {"leaveFocus", ItemParse_leaveFocus, NULL}, - {"mouseEnter", ItemParse_mouseEnter, NULL}, - {"mouseExit", ItemParse_mouseExit, NULL}, - {"mouseEnterText", ItemParse_mouseEnterText, NULL}, - {"mouseExitText", ItemParse_mouseExitText, NULL}, - {"action", ItemParse_action, NULL}, - {"special", ItemParse_special, NULL}, - {"cvar", ItemParse_cvar, NULL}, - {"maxChars", ItemParse_maxChars, NULL}, - {"maxPaintChars", ItemParse_maxPaintChars, NULL}, - {"focusSound", ItemParse_focusSound, NULL}, - {"cvarFloat", ItemParse_cvarFloat, NULL}, - {"cvarStrList", ItemParse_cvarStrList, NULL}, - {"cvarFloatList", ItemParse_cvarFloatList, NULL}, - {"addColorRange", ItemParse_addColorRange, NULL}, - {"ownerdrawFlag", ItemParse_ownerdrawFlag, NULL}, - {"enableCvar", ItemParse_enableCvar, NULL}, - {"cvarTest", ItemParse_cvarTest, NULL}, - {"disableCvar", ItemParse_disableCvar, NULL}, - {"showCvar", ItemParse_showCvar, NULL}, - {"hideCvar", ItemParse_hideCvar, NULL}, - {"cinematic", ItemParse_cinematic, NULL}, - {"doubleclick", ItemParse_doubleClick, NULL}, - {NULL, NULL, NULL} -}; - -keywordHash_t *itemParseKeywordHash[KEYWORDHASH_SIZE]; - -/* -=============== -Item_SetupKeywordHash -=============== -*/ -void Item_SetupKeywordHash(void) { - int i; - - memset(itemParseKeywordHash, 0, sizeof(itemParseKeywordHash)); - for (i = 0; itemParseKeywords[i].keyword; i++) { - KeywordHash_Add(itemParseKeywordHash, &itemParseKeywords[i]); - } -} - -/* -=============== -Item_Parse -=============== -*/ -qboolean Item_Parse(int handle, itemDef_t *item) { - pc_token_t token; - keywordHash_t *key; - - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - if (*token.string != '{') { - return qfalse; - } - while ( 1 ) { - if (!trap_PC_ReadToken(handle, &token)) { - PC_SourceError(handle, "end of file inside menu item\n"); - return qfalse; - } - - if (*token.string == '}') { - return qtrue; - } - - key = KeywordHash_Find(itemParseKeywordHash, token.string); - if (!key) { - PC_SourceError(handle, "unknown menu item keyword %s", token.string); - continue; - } - if ( !key->func(item, handle) ) { - PC_SourceError(handle, "couldn't parse menu item keyword %s", token.string); - return qfalse; - } - } - return qfalse; // bk001205 - LCC missing return value -} - - -// Item_InitControls -// init's special control types -void Item_InitControls(itemDef_t *item) { - if (item == NULL) { - return; - } - if (item->type == ITEM_TYPE_LISTBOX) { - listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData; - item->cursorPos = 0; - if (listPtr) { - listPtr->cursorPos = 0; - listPtr->startPos = 0; - listPtr->endPos = 0; - listPtr->cursorPos = 0; - } - } -} - -/* -=============== -Menu Keyword Parse functions -=============== -*/ - -qboolean MenuParse_font( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_String_Parse(handle, &menu->font)) { - return qfalse; - } - if (!DC->Assets.fontRegistered) { - DC->registerFont(menu->font, 48, &DC->Assets.textFont); - DC->Assets.fontRegistered = qtrue; - } - return qtrue; -} - -qboolean MenuParse_name( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_String_Parse(handle, &menu->window.name)) { - return qfalse; - } - if (Q_stricmp(menu->window.name, "main") == 0) { - // default main as having focus - //menu->window.flags |= WINDOW_HASFOCUS; - } - return qtrue; -} - -qboolean MenuParse_fullscreen( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_Int_Parse(handle, (int*) &menu->fullScreen)) { // bk001206 - cast qboolean - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_rect( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_Rect_Parse(handle, &menu->window.rect)) { - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_style( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_Int_Parse(handle, &menu->window.style)) { - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_visible( itemDef_t *item, int handle ) { - int i; - menuDef_t *menu = (menuDef_t*)item; - - if (!PC_Int_Parse(handle, &i)) { - return qfalse; - } - if (i) { - menu->window.flags |= WINDOW_VISIBLE; - } - return qtrue; -} - -qboolean MenuParse_onOpen( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_Script_Parse(handle, &menu->onOpen)) { - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_onClose( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_Script_Parse(handle, &menu->onClose)) { - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_onESC( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_Script_Parse(handle, &menu->onESC)) { - return qfalse; - } - return qtrue; -} - - - -qboolean MenuParse_border( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_Int_Parse(handle, &menu->window.border)) { - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_borderSize( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_Float_Parse(handle, &menu->window.borderSize)) { - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_backcolor( itemDef_t *item, int handle ) { - int i; - float f; - menuDef_t *menu = (menuDef_t*)item; - - for (i = 0; i < 4; i++) { - if (!PC_Float_Parse(handle, &f)) { - return qfalse; - } - menu->window.backColor[i] = f; - } - return qtrue; -} - -qboolean MenuParse_forecolor( itemDef_t *item, int handle ) { - int i; - float f; - menuDef_t *menu = (menuDef_t*)item; - - for (i = 0; i < 4; i++) { - if (!PC_Float_Parse(handle, &f)) { - return qfalse; - } - menu->window.foreColor[i] = f; - menu->window.flags |= WINDOW_FORECOLORSET; - } - return qtrue; -} - -qboolean MenuParse_bordercolor( itemDef_t *item, int handle ) { - int i; - float f; - menuDef_t *menu = (menuDef_t*)item; - - for (i = 0; i < 4; i++) { - if (!PC_Float_Parse(handle, &f)) { - return qfalse; - } - menu->window.borderColor[i] = f; - } - return qtrue; -} - -qboolean MenuParse_focuscolor( itemDef_t *item, int handle ) { - int i; - float f; - menuDef_t *menu = (menuDef_t*)item; - - for (i = 0; i < 4; i++) { - if (!PC_Float_Parse(handle, &f)) { - return qfalse; - } - menu->focusColor[i] = f; - } - return qtrue; -} - -qboolean MenuParse_disablecolor( itemDef_t *item, int handle ) { - int i; - float f; - menuDef_t *menu = (menuDef_t*)item; - for (i = 0; i < 4; i++) { - if (!PC_Float_Parse(handle, &f)) { - return qfalse; - } - menu->disableColor[i] = f; - } - return qtrue; -} - - -qboolean MenuParse_outlinecolor( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (!PC_Color_Parse(handle, &menu->window.outlineColor)){ - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_background( itemDef_t *item, int handle ) { - const char *buff; - menuDef_t *menu = (menuDef_t*)item; - - if (!PC_String_Parse(handle, &buff)) { - return qfalse; - } - menu->window.background = DC->registerShaderNoMip(buff); - return qtrue; -} - -qboolean MenuParse_cinematic( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - - if (!PC_String_Parse(handle, &menu->window.cinematicName)) { - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_ownerdrawFlag( itemDef_t *item, int handle ) { - int i; - menuDef_t *menu = (menuDef_t*)item; - - if (!PC_Int_Parse(handle, &i)) { - return qfalse; - } - menu->window.ownerDrawFlags |= i; - return qtrue; -} - -qboolean MenuParse_ownerdraw( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - - if (!PC_Int_Parse(handle, &menu->window.ownerDraw)) { - return qfalse; - } - return qtrue; -} - - -// decoration -qboolean MenuParse_popup( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - menu->window.flags |= WINDOW_POPUP; - return qtrue; -} - - -qboolean MenuParse_outOfBounds( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - - menu->window.flags |= WINDOW_OOB_CLICK; - return qtrue; -} - -qboolean MenuParse_soundLoop( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - - if (!PC_String_Parse(handle, &menu->soundName)) { - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_fadeClamp( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - - if (!PC_Float_Parse(handle, &menu->fadeClamp)) { - return qfalse; - } - return qtrue; -} - -qboolean MenuParse_fadeAmount( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - - if (!PC_Float_Parse(handle, &menu->fadeAmount)) { - return qfalse; - } - return qtrue; -} - - -qboolean MenuParse_fadeCycle( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - - if (!PC_Int_Parse(handle, &menu->fadeCycle)) { - return qfalse; - } - return qtrue; -} - - -qboolean MenuParse_itemDef( itemDef_t *item, int handle ) { - menuDef_t *menu = (menuDef_t*)item; - if (menu->itemCount < MAX_MENUITEMS) { - menu->items[menu->itemCount] = UI_Alloc(sizeof(itemDef_t)); - Item_Init(menu->items[menu->itemCount]); - if (!Item_Parse(handle, menu->items[menu->itemCount])) { - return qfalse; - } - Item_InitControls(menu->items[menu->itemCount]); - menu->items[menu->itemCount++]->parent = menu; - } - return qtrue; -} - -keywordHash_t menuParseKeywords[] = { - {"font", MenuParse_font, NULL}, - {"name", MenuParse_name, NULL}, - {"fullscreen", MenuParse_fullscreen, NULL}, - {"rect", MenuParse_rect, NULL}, - {"style", MenuParse_style, NULL}, - {"visible", MenuParse_visible, NULL}, - {"onOpen", MenuParse_onOpen, NULL}, - {"onClose", MenuParse_onClose, NULL}, - {"onESC", MenuParse_onESC, NULL}, - {"border", MenuParse_border, NULL}, - {"borderSize", MenuParse_borderSize, NULL}, - {"backcolor", MenuParse_backcolor, NULL}, - {"forecolor", MenuParse_forecolor, NULL}, - {"bordercolor", MenuParse_bordercolor, NULL}, - {"focuscolor", MenuParse_focuscolor, NULL}, - {"disablecolor", MenuParse_disablecolor, NULL}, - {"outlinecolor", MenuParse_outlinecolor, NULL}, - {"background", MenuParse_background, NULL}, - {"ownerdraw", MenuParse_ownerdraw, NULL}, - {"ownerdrawFlag", MenuParse_ownerdrawFlag, NULL}, - {"outOfBoundsClick", MenuParse_outOfBounds, NULL}, - {"soundLoop", MenuParse_soundLoop, NULL}, - {"itemDef", MenuParse_itemDef, NULL}, - {"cinematic", MenuParse_cinematic, NULL}, - {"popup", MenuParse_popup, NULL}, - {"fadeClamp", MenuParse_fadeClamp, NULL}, - {"fadeCycle", MenuParse_fadeCycle, NULL}, - {"fadeAmount", MenuParse_fadeAmount, NULL}, - {NULL, NULL, NULL} -}; - -keywordHash_t *menuParseKeywordHash[KEYWORDHASH_SIZE]; - -/* -=============== -Menu_SetupKeywordHash -=============== -*/ -void Menu_SetupKeywordHash(void) { - int i; - - memset(menuParseKeywordHash, 0, sizeof(menuParseKeywordHash)); - for (i = 0; menuParseKeywords[i].keyword; i++) { - KeywordHash_Add(menuParseKeywordHash, &menuParseKeywords[i]); - } -} - -/* -=============== -Menu_Parse -=============== -*/ -qboolean Menu_Parse(int handle, menuDef_t *menu) { - pc_token_t token; - keywordHash_t *key; - - if (!trap_PC_ReadToken(handle, &token)) - return qfalse; - if (*token.string != '{') { - return qfalse; - } - - while ( 1 ) { - - memset(&token, 0, sizeof(pc_token_t)); - if (!trap_PC_ReadToken(handle, &token)) { - PC_SourceError(handle, "end of file inside menu\n"); - return qfalse; - } - - if (*token.string == '}') { - return qtrue; - } - - key = KeywordHash_Find(menuParseKeywordHash, token.string); - if (!key) { - PC_SourceError(handle, "unknown menu keyword %s", token.string); - continue; - } - if ( !key->func((itemDef_t*)menu, handle) ) { - PC_SourceError(handle, "couldn't parse menu keyword %s", token.string); - return qfalse; - } - } - return qfalse; // bk001205 - LCC missing return value -} - -/* -=============== -Menu_New -=============== -*/ -void Menu_New(int handle) { - menuDef_t *menu = &Menus[menuCount]; - - if (menuCount < MAX_MENUS) { - Menu_Init(menu); - if (Menu_Parse(handle, menu)) { - Menu_PostParse(menu); - menuCount++; - } - } -} - -int Menu_Count() { - return menuCount; -} - -void Menu_PaintAll() { - int i; - if (captureFunc) { - captureFunc(captureData); - } - - for (i = 0; i < Menu_Count(); i++) { - Menu_Paint(&Menus[i], qfalse); - } - - if (debugMode) { - vec4_t v = {1, 1, 1, 1}; - DC->drawText(5, 25, .5, v, va("fps: %f", DC->FPS), 0, 0, 0); - } -} - -void Menu_Reset() { - menuCount = 0; -} - -displayContextDef_t *Display_GetContext() { - return DC; -} - -#ifndef MISSIONPACK // bk001206 -static float captureX; -static float captureY; -#endif - -void *Display_CaptureItem(int x, int y) { - int i; - - for (i = 0; i < menuCount; i++) { - // turn off focus each item - // menu->items[i].window.flags &= ~WINDOW_HASFOCUS; - if (Rect_ContainsPoint(&Menus[i].window.rect, x, y)) { - return &Menus[i]; - } - } - return NULL; -} - - -// FIXME: -qboolean Display_MouseMove(void *p, int x, int y) { - int i; - menuDef_t *menu = p; - - if (menu == NULL) { - menu = Menu_GetFocused(); - if (menu) { - if (menu->window.flags & WINDOW_POPUP) { - Menu_HandleMouseMove(menu, x, y); - return qtrue; - } - } - for (i = 0; i < menuCount; i++) { - Menu_HandleMouseMove(&Menus[i], x, y); - } - } else { - menu->window.rect.x += x; - menu->window.rect.y += y; - Menu_UpdatePosition(menu); - } - return qtrue; - -} - -int Display_CursorType(int x, int y) { - int i; - for (i = 0; i < menuCount; i++) { - rectDef_t r2; - r2.x = Menus[i].window.rect.x - 3; - r2.y = Menus[i].window.rect.y - 3; - r2.w = r2.h = 7; - if (Rect_ContainsPoint(&r2, x, y)) { - return CURSOR_SIZER; - } - } - return CURSOR_ARROW; -} - - -void Display_HandleKey(int key, qboolean down, int x, int y) { - menuDef_t *menu = Display_CaptureItem(x, y); - if (menu == NULL) { - menu = Menu_GetFocused(); - } - if (menu) { - Menu_HandleKey(menu, key, down ); - } -} - -static void Window_CacheContents(windowDef_t *window) { - if (window) { - if (window->cinematicName) { - int cin = DC->playCinematic(window->cinematicName, 0, 0, 0, 0); - DC->stopCinematic(cin); - } - } -} - - -static void Item_CacheContents(itemDef_t *item) { - if (item) { - Window_CacheContents(&item->window); - } - -} - -static void Menu_CacheContents(menuDef_t *menu) { - if (menu) { - int i; - Window_CacheContents(&menu->window); - for (i = 0; i < menu->itemCount; i++) { - Item_CacheContents(menu->items[i]); - } - - if (menu->soundName && *menu->soundName) { - DC->registerSound(menu->soundName, qfalse); - } - } - -} - -void Display_CacheAll() { - int i; - for (i = 0; i < menuCount; i++) { - Menu_CacheContents(&Menus[i]); - } -} - - -static qboolean Menu_OverActiveItem(menuDef_t *menu, float x, float y) { - if (menu && menu->window.flags & (WINDOW_VISIBLE | WINDOW_FORCED)) { - if (Rect_ContainsPoint(&menu->window.rect, x, y)) { - int i; - for (i = 0; i < menu->itemCount; i++) { - // turn off focus each item - // menu->items[i].window.flags &= ~WINDOW_HASFOCUS; - - if (!(menu->items[i]->window.flags & (WINDOW_VISIBLE | WINDOW_FORCED))) { - continue; - } - - if (menu->items[i]->window.flags & WINDOW_DECORATION) { - continue; - } - - if (Rect_ContainsPoint(&menu->items[i]->window.rect, x, y)) { - itemDef_t *overItem = menu->items[i]; - if (overItem->type == ITEM_TYPE_TEXT && overItem->text) { - if (Rect_ContainsPoint(Item_CorrectedTextRect(overItem), x, y)) { - return qtrue; - } else { - continue; - } - } else { - return qtrue; - } - } - } - - } - } - return qfalse; -} - diff --git a/code/ui/ui_shared.h b/code/ui/ui_shared.h deleted file mode 100644 index b4e1d0d..0000000 --- a/code/ui/ui_shared.h +++ /dev/null @@ -1,450 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -#ifndef __UI_SHARED_H -#define __UI_SHARED_H - - -#include "../game/q_shared.h" -#include "../cgame/tr_types.h" -#include "keycodes.h" - -#include "../../ui/menudef.h" - -#define MAX_MENUNAME 32 -#define MAX_ITEMTEXT 64 -#define MAX_ITEMACTION 64 -#define MAX_MENUDEFFILE 4096 -#define MAX_MENUFILE 32768 -#define MAX_MENUS 64 -#define MAX_MENUITEMS 96 -#define MAX_COLOR_RANGES 10 -#define MAX_OPEN_MENUS 16 - -#define WINDOW_MOUSEOVER 0x00000001 // mouse is over it, non exclusive -#define WINDOW_HASFOCUS 0x00000002 // has cursor focus, exclusive -#define WINDOW_VISIBLE 0x00000004 // is visible -#define WINDOW_GREY 0x00000008 // is visible but grey ( non-active ) -#define WINDOW_DECORATION 0x00000010 // for decoration only, no mouse, keyboard, etc.. -#define WINDOW_FADINGOUT 0x00000020 // fading out, non-active -#define WINDOW_FADINGIN 0x00000040 // fading in -#define WINDOW_MOUSEOVERTEXT 0x00000080 // mouse is over it, non exclusive -#define WINDOW_INTRANSITION 0x00000100 // window is in transition -#define WINDOW_FORECOLORSET 0x00000200 // forecolor was explicitly set ( used to color alpha images or not ) -#define WINDOW_HORIZONTAL 0x00000400 // for list boxes and sliders, vertical is default this is set of horizontal -#define WINDOW_LB_LEFTARROW 0x00000800 // mouse is over left/up arrow -#define WINDOW_LB_RIGHTARROW 0x00001000 // mouse is over right/down arrow -#define WINDOW_LB_THUMB 0x00002000 // mouse is over thumb -#define WINDOW_LB_PGUP 0x00004000 // mouse is over page up -#define WINDOW_LB_PGDN 0x00008000 // mouse is over page down -#define WINDOW_ORBITING 0x00010000 // item is in orbit -#define WINDOW_OOB_CLICK 0x00020000 // close on out of bounds click -#define WINDOW_WRAPPED 0x00040000 // manually wrap text -#define WINDOW_AUTOWRAPPED 0x00080000 // auto wrap text -#define WINDOW_FORCED 0x00100000 // forced open -#define WINDOW_POPUP 0x00200000 // popup -#define WINDOW_BACKCOLORSET 0x00400000 // backcolor was explicitly set -#define WINDOW_TIMEDVISIBLE 0x00800000 // visibility timing ( NOT implemented ) - - -// CGAME cursor type bits -#define CURSOR_NONE 0x00000001 -#define CURSOR_ARROW 0x00000002 -#define CURSOR_SIZER 0x00000004 - -#ifdef CGAME -#define STRING_POOL_SIZE 128*1024 -#else -#define STRING_POOL_SIZE 384*1024 -#endif -#define MAX_STRING_HANDLES 4096 - -#define MAX_SCRIPT_ARGS 12 -#define MAX_EDITFIELD 256 - -#define ART_FX_BASE "menu/art/fx_base" -#define ART_FX_BLUE "menu/art/fx_blue" -#define ART_FX_CYAN "menu/art/fx_cyan" -#define ART_FX_GREEN "menu/art/fx_grn" -#define ART_FX_RED "menu/art/fx_red" -#define ART_FX_TEAL "menu/art/fx_teal" -#define ART_FX_WHITE "menu/art/fx_white" -#define ART_FX_YELLOW "menu/art/fx_yel" - -#define ASSET_GRADIENTBAR "ui/assets/gradientbar2.tga" -#define ASSET_SCROLLBAR "ui/assets/scrollbar.tga" -#define ASSET_SCROLLBAR_ARROWDOWN "ui/assets/scrollbar_arrow_dwn_a.tga" -#define ASSET_SCROLLBAR_ARROWUP "ui/assets/scrollbar_arrow_up_a.tga" -#define ASSET_SCROLLBAR_ARROWLEFT "ui/assets/scrollbar_arrow_left.tga" -#define ASSET_SCROLLBAR_ARROWRIGHT "ui/assets/scrollbar_arrow_right.tga" -#define ASSET_SCROLL_THUMB "ui/assets/scrollbar_thumb.tga" -#define ASSET_SLIDER_BAR "ui/assets/slider2.tga" -#define ASSET_SLIDER_THUMB "ui/assets/sliderbutt_1.tga" -#define SCROLLBAR_SIZE 16.0 -#define SLIDER_WIDTH 96.0 -#define SLIDER_HEIGHT 16.0 -#define SLIDER_THUMB_WIDTH 12.0 -#define SLIDER_THUMB_HEIGHT 20.0 -#define NUM_CROSSHAIRS 10 - -typedef struct { - const char *command; - const char *args[MAX_SCRIPT_ARGS]; -} scriptDef_t; - - -typedef struct { - float x; // horiz position - float y; // vert position - float w; // width - float h; // height; -} rectDef_t; - -typedef rectDef_t Rectangle; - -// FIXME: do something to separate text vs window stuff -typedef struct { - Rectangle rect; // client coord rectangle - Rectangle rectClient; // screen coord rectangle - const char *name; // - const char *group; // if it belongs to a group - const char *cinematicName; // cinematic name - int cinematic; // cinematic handle - int style; // - int border; // - int ownerDraw; // ownerDraw style - int ownerDrawFlags; // show flags for ownerdraw items - float borderSize; // - int flags; // visible, focus, mouseover, cursor - Rectangle rectEffects; // for various effects - Rectangle rectEffects2; // for various effects - int offsetTime; // time based value for various effects - int nextTime; // time next effect should cycle - vec4_t foreColor; // text color - vec4_t backColor; // border color - vec4_t borderColor; // border color - vec4_t outlineColor; // border color - qhandle_t background; // background asset -} windowDef_t; - -typedef windowDef_t Window; - -typedef struct { - vec4_t color; - float low; - float high; -} colorRangeDef_t; - -// FIXME: combine flags into bitfields to save space -// FIXME: consolidate all of the common stuff in one structure for menus and items -// THINKABOUTME: is there any compelling reason not to have items contain items -// and do away with a menu per say.. major issue is not being able to dynamically allocate -// and destroy stuff.. Another point to consider is adding an alloc free call for vm's and have -// the engine just allocate the pool for it based on a cvar -// many of the vars are re-used for different item types, as such they are not always named appropriately -// the benefits of c++ in DOOM will greatly help crap like this -// FIXME: need to put a type ptr that points to specific type info per type -// -#define MAX_LB_COLUMNS 16 - -typedef struct columnInfo_s { - int pos; - int width; - int maxChars; -} columnInfo_t; - -typedef struct listBoxDef_s { - int startPos; - int endPos; - int drawPadding; - int cursorPos; - float elementWidth; - float elementHeight; - int elementStyle; - int numColumns; - columnInfo_t columnInfo[MAX_LB_COLUMNS]; - const char *doubleClick; - qboolean notselectable; -} listBoxDef_t; - -typedef struct editFieldDef_s { - float minVal; // edit field limits - float maxVal; // - float defVal; // - float range; // - int maxChars; // for edit fields - int maxPaintChars; // for edit fields - int paintOffset; // -} editFieldDef_t; - -#define MAX_MULTI_CVARS 32 - -typedef struct multiDef_s { - const char *cvarList[MAX_MULTI_CVARS]; - const char *cvarStr[MAX_MULTI_CVARS]; - float cvarValue[MAX_MULTI_CVARS]; - int count; - qboolean strDef; -} multiDef_t; - -typedef struct modelDef_s { - int angle; - vec3_t origin; - float fov_x; - float fov_y; - int rotationSpeed; -} modelDef_t; - -#define CVAR_ENABLE 0x00000001 -#define CVAR_DISABLE 0x00000002 -#define CVAR_SHOW 0x00000004 -#define CVAR_HIDE 0x00000008 - -typedef struct itemDef_s { - Window window; // common positional, border, style, layout info - Rectangle textRect; // rectangle the text ( if any ) consumes - int type; // text, button, radiobutton, checkbox, textfield, listbox, combo - int alignment; // left center right - int textalignment; // ( optional ) alignment for text within rect based on text width - float textalignx; // ( optional ) text alignment x coord - float textaligny; // ( optional ) text alignment x coord - float textscale; // scale percentage from 72pts - int textStyle; // ( optional ) style, normal and shadowed are it for now - const char *text; // display text - void *parent; // menu owner - qhandle_t asset; // handle to asset - const char *mouseEnterText; // mouse enter script - const char *mouseExitText; // mouse exit script - const char *mouseEnter; // mouse enter script - const char *mouseExit; // mouse exit script - const char *action; // select script - const char *onFocus; // select script - const char *leaveFocus; // select script - const char *cvar; // associated cvar - const char *cvarTest; // associated cvar for enable actions - const char *enableCvar; // enable, disable, show, or hide based on value, this can contain a list - int cvarFlags; // what type of action to take on cvarenables - sfxHandle_t focusSound; - int numColors; // number of color ranges - colorRangeDef_t colorRanges[MAX_COLOR_RANGES]; - float special; // used for feeder id's etc.. diff per type - int cursorPos; // cursor position in characters - void *typeData; // type specific data ptr's -} itemDef_t; - -typedef struct { - Window window; - const char *font; // font - qboolean fullScreen; // covers entire screen - int itemCount; // number of items; - int fontIndex; // - int cursorItem; // which item as the cursor - int fadeCycle; // - float fadeClamp; // - float fadeAmount; // - const char *onOpen; // run when the menu is first opened - const char *onClose; // run when the menu is closed - const char *onESC; // run when the menu is closed - const char *soundName; // background loop sound for menu - - vec4_t focusColor; // focus color for items - vec4_t disableColor; // focus color for items - itemDef_t *items[MAX_MENUITEMS]; // items this menu contains -} menuDef_t; - -typedef struct { - const char *fontStr; - const char *cursorStr; - const char *gradientStr; - fontInfo_t textFont; - fontInfo_t smallFont; - fontInfo_t bigFont; - qhandle_t cursor; - qhandle_t gradientBar; - qhandle_t scrollBarArrowUp; - qhandle_t scrollBarArrowDown; - qhandle_t scrollBarArrowLeft; - qhandle_t scrollBarArrowRight; - qhandle_t scrollBar; - qhandle_t scrollBarThumb; - qhandle_t buttonMiddle; - qhandle_t buttonInside; - qhandle_t solidBox; - qhandle_t sliderBar; - qhandle_t sliderThumb; - sfxHandle_t menuEnterSound; - sfxHandle_t menuExitSound; - sfxHandle_t menuBuzzSound; - sfxHandle_t itemFocusSound; - float fadeClamp; - int fadeCycle; - float fadeAmount; - float shadowX; - float shadowY; - vec4_t shadowColor; - float shadowFadeClamp; - qboolean fontRegistered; - - // player settings - qhandle_t fxBasePic; - qhandle_t fxPic[7]; - qhandle_t crosshairShader[NUM_CROSSHAIRS]; - -} cachedAssets_t; - -typedef struct { - const char *name; - void (*handler) (itemDef_t *item, char** args); -} commandDef_t; - -typedef struct { - qhandle_t (*registerShaderNoMip) (const char *p); - void (*setColor) (const vec4_t v); - void (*drawHandlePic) (float x, float y, float w, float h, qhandle_t asset); - void (*drawStretchPic) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ); - void (*drawText) (float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style ); - int (*textWidth) (const char *text, float scale, int limit); - int (*textHeight) (const char *text, float scale, int limit); - qhandle_t (*registerModel) (const char *p); - void (*modelBounds) (qhandle_t model, vec3_t min, vec3_t max); - void (*fillRect) ( float x, float y, float w, float h, const vec4_t color); - void (*drawRect) ( float x, float y, float w, float h, float size, const vec4_t color); - void (*drawSides) (float x, float y, float w, float h, float size); - void (*drawTopBottom) (float x, float y, float w, float h, float size); - void (*clearScene) (); - void (*addRefEntityToScene) (const refEntity_t *re ); - void (*renderScene) ( const refdef_t *fd ); - void (*registerFont) (const char *pFontname, int pointSize, fontInfo_t *font); - void (*ownerDrawItem) (float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, int ownerDrawFlags, int align, float special, float scale, vec4_t color, qhandle_t shader, int textStyle); - float (*getValue) (int ownerDraw); - qboolean (*ownerDrawVisible) (int flags); - void (*runScript)(char **p); - void (*getTeamColor)(vec4_t *color); - void (*getCVarString)(const char *cvar, char *buffer, int bufsize); - float (*getCVarValue)(const char *cvar); - void (*setCVar)(const char *cvar, const char *value); - void (*drawTextWithCursor)(float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor, int limit, int style); - void (*setOverstrikeMode)(qboolean b); - qboolean (*getOverstrikeMode)(); - void (*startLocalSound)( sfxHandle_t sfx, int channelNum ); - qboolean (*ownerDrawHandleKey)(int ownerDraw, int flags, float *special, int key); - int (*feederCount)(float feederID); - const char *(*feederItemText)(float feederID, int index, int column, qhandle_t *handle); - qhandle_t (*feederItemImage)(float feederID, int index); - void (*feederSelection)(float feederID, int index); - void (*keynumToStringBuf)( int keynum, char *buf, int buflen ); - void (*getBindingBuf)( int keynum, char *buf, int buflen ); - void (*setBinding)( int keynum, const char *binding ); - void (*executeText)(int exec_when, const char *text ); - void (*Error)(int level, const char *error, ...); - void (*Print)(const char *msg, ...); - void (*Pause)(qboolean b); - int (*ownerDrawWidth)(int ownerDraw, float scale); - sfxHandle_t (*registerSound)(const char *name, qboolean compressed); - void (*startBackgroundTrack)( const char *intro, const char *loop); - void (*stopBackgroundTrack)(); - int (*playCinematic)(const char *name, float x, float y, float w, float h); - void (*stopCinematic)(int handle); - void (*drawCinematic)(int handle, float x, float y, float w, float h); - void (*runCinematicFrame)(int handle); - - float yscale; - float xscale; - float bias; - int realTime; - int frameTime; - int cursorx; - int cursory; - qboolean debug; - - cachedAssets_t Assets; - - glconfig_t glconfig; - qhandle_t whiteShader; - qhandle_t gradientImage; - qhandle_t cursor; - float FPS; - -} displayContextDef_t; - -const char *String_Alloc(const char *p); -void String_Init(); -void String_Report(); -void Init_Display(displayContextDef_t *dc); -void Display_ExpandMacros(char * buff); -void Menu_Init(menuDef_t *menu); -void Item_Init(itemDef_t *item); -void Menu_PostParse(menuDef_t *menu); -menuDef_t *Menu_GetFocused(); -void Menu_HandleKey(menuDef_t *menu, int key, qboolean down); -void Menu_HandleMouseMove(menuDef_t *menu, float x, float y); -void Menu_ScrollFeeder(menuDef_t *menu, int feeder, qboolean down); -qboolean Float_Parse(char **p, float *f); -qboolean Color_Parse(char **p, vec4_t *c); -qboolean Int_Parse(char **p, int *i); -qboolean Rect_Parse(char **p, rectDef_t *r); -qboolean String_Parse(char **p, const char **out); -qboolean Script_Parse(char **p, const char **out); -qboolean PC_Float_Parse(int handle, float *f); -qboolean PC_Color_Parse(int handle, vec4_t *c); -qboolean PC_Int_Parse(int handle, int *i); -qboolean PC_Rect_Parse(int handle, rectDef_t *r); -qboolean PC_String_Parse(int handle, const char **out); -qboolean PC_Script_Parse(int handle, const char **out); -int Menu_Count(); -void Menu_New(int handle); -void Menu_PaintAll(); -menuDef_t *Menus_ActivateByName(const char *p); -void Menu_Reset(); -qboolean Menus_AnyFullScreenVisible(); -void Menus_Activate(menuDef_t *menu); - -displayContextDef_t *Display_GetContext(); -void *Display_CaptureItem(int x, int y); -qboolean Display_MouseMove(void *p, int x, int y); -int Display_CursorType(int x, int y); -qboolean Display_KeyBindPending(); -void Menus_OpenByName(const char *p); -menuDef_t *Menus_FindByName(const char *p); -void Menus_ShowByName(const char *p); -void Menus_CloseByName(const char *p); -void Display_HandleKey(int key, qboolean down, int x, int y); -void LerpColor(vec4_t a, vec4_t b, vec4_t c, float t); -void Menus_CloseAll(); -void Menu_Paint(menuDef_t *menu, qboolean forcePaint); -void Menu_SetFeederSelection(menuDef_t *menu, int feeder, int index, const char *name); -void Display_CacheAll(); - -void *UI_Alloc( int size ); -void UI_InitMemory( void ); -qboolean UI_OutOfMemory(); - -void Controls_GetConfig( void ); -void Controls_SetConfig(qboolean restart); -void Controls_SetDefaults( void ); - -int trap_PC_AddGlobalDefine( char *define ); -int trap_PC_LoadSource( const char *filename ); -int trap_PC_FreeSource( int handle ); -int trap_PC_ReadToken( int handle, pc_token_t *pc_token ); -int trap_PC_SourceFileAndLine( int handle, char *filename, int *line ); - -#endif diff --git a/code/ui/ui_util.c b/code/ui/ui_util.c deleted file mode 100644 index e0bb1e0..0000000 --- a/code/ui/ui_util.c +++ /dev/null @@ -1,29 +0,0 @@ -/* -=========================================================================== -Copyright (C) 1999-2005 Id Software, Inc. - -This file is part of Quake III Arena source code. - -Quake III Arena source code is free software; you can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, -or (at your option) any later version. - -Quake III Arena source code is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Foobar; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================== -*/ -// ui_util.c -// -// origin: rad -// new ui support stuff -// -// memory, string alloc - - diff --git a/code/unix/ChangeLog b/code/unix/ChangeLog deleted file mode 100644 index 5a5592b..0000000 --- a/code/unix/ChangeLog +++ /dev/null @@ -1,2981 +0,0 @@ -TODO: the Mac port seems stable, but outputs a bunch of warnings.. - -2004-05-22 -- updated the xcode project from Apple's version - now with the latest vm_ppc code - -2004-05-21 Timothee Besset -- fixed the Linux build to compile again on sid (glext.h and gcc3 warnings) -- 2 weeks ago, hacked up the source to compile on panther / xcode 1.1 - several cleanups were needed, and VM support seems broke (hangs or crashes) -- got altivec optimisations from Apple (Kenneth Dyke) - merged back in -- looks like with the new code merge the VM support is back in and working - -2003-09-15 Timothee Besset -- import Q3 java master code, cleanups on monster - -2003-08-31 Timothee Besset -+ loki_setup hell - https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=626 - http://zerowing.idsoftware.com/linux/q3a/index.html#glibc - text mode installer in loki_setup image built on Mandrake 7.2 crashes on some glibc 2.3 systems such as RH9 etc. - need to move to a different version of the installer, and update old installers to keep them still 'installing' - moving to build the setup binaries on Debian Woody systems (glibc 2.2, text mode installer will no longer work on 2.1 systems) - hacked together a new setup, using setup tree from RTCW. would need a complete revamp if a new full setup with new binaries is needed - -2003-07-17 Timothee Besset - + new cvsreport, testing per-module config - -2003-01-19 Timothee Besset - + building on both gcc 2.x and 3.x - added conf modules to check gcc version - ccache support - -2003-01-13 Timothee Besset - + tweaking around for gcc 3.x build - edit Conscript to change the compiler - -2002-12-16 Timothee Besset - + added pbEmit class to auth code, emit CD keys to local PB master - -2002-11-14 Timothee Besset - + up to latest makeself.sh - + add both quake3.x86 and quake3-smp.x86 to setup - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=573 - console setup crash / glibc 2.3 (Debian Sid) - investigated, put together a workaround - -2002-11-5 Timothee Besset - + Linux building both smp and non-smp again. Will have to put both in setup - + added in_subframe to toggle X subframe event handling - + reworked the timing code to be more reliable - + cleaned up dgamouse/in_mouse code, removed unnecessary dgamouse var - + made the mouse grabbing an in_nograb cvar, no longer a compile time option - in_nograb 1 force in_dgamouse 0 and r_fullscreen 0 (any of those two will b0rk) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=565 - mouse issues on Suze 8.1 - related to subframe event timing - added code chunk to detect broken X timing and disable subframe - + tweaked the subframe/X bug workaround to be less paranoid - -2002-10-28 Timothee Besset - + no longer blocking demo recording if g_synchronous clients != 0 - only sending out a warning (everyone does g_sync 1 ; record ; g_sync 0) - -2002-10-21 Timothee Besset - + building final mod sdk setups (added lcc bins, added link to q3asm-turbo in readme) - -2002-10-8 Timothee Besset - + quickfix cl_maxpackets > 125 brings back to 100 - -1.32 release --- - -2002-10-7 Timothee Besset - + made the 'demo' command case-insensitive on extension match (it was confused by demo FOUR.DM_68) - + mouse wheel scrolling with in_mouse 1 + window mode was not working, fixed (DI didn't catch) - + removing on-the-fly pk3 build from Linux setup, using the finalized ones now - added 'pk3' option to cons for toggle of pk3 building - -2002-10-5 Timothee Besset - + updated win32 mod sdk (in win32/mod-sdk-setup) - added q3asm and lcc source - updated the .bat to build VMs - -2002-10-3 Timothee Besset - + linux mod sdk, wrote the bulk of the scripts - -2002-9-30 Timothee Besset - + ATVI Quake 3 1.32 Patch #9 - rolling back to the way it was before, leaving 1v1 force vote exploit, the fix was worse than the bug - from comment on bug #9 in tracker: - - actually the fix is worse than the original bug - - after the fix, voting when you are alone on the server was no longer working - it was kinda intended in the fix, that you would have to be at least two to pass a vote .. but - it is an oversight. - - calling a vote in a 1v1 game against a bot fails immediately - (calling a vote in any situation where there's only 1 live player fails) - - Say a server's running some lame custom map that you have but a friend doesn't. You can't go - on the server and change it to the map you want to play, so he ends up having to auto-dl it at - 8K a second just so you can switch from it. - - This particular 2 clients, vote / quit exploit would involve too many changes to fix properly. - I am reverting back to the old version, and leaving as WNF - -2002-9-29 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=50 - added Wheel support to the DirectInput code IN_DIMouse (in_mouse 1) - tweaked the Wheel mouse reading for in_mouse -1 (old win32 input code) - handle correctly when zDelta is > 120 - provide a in_logitechbug cvar to handle buggy Logitech MouseWare driver sending wheel events twice - -2002-9-26 Timothee Besset - + ATVI Quake 3 1.32 Patch #38 - adding trap_SetPbClStatus, reliably checks for PB presence before enabling PB in UI - -2002-9-25 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=551 - SVF_CLIENTMASK, fixed a typo - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=555 - pushed cl_maxpackets upper limit to 125 (from 100) per CPMA Arqon's request - -2002-9-24 Timothee Besset - + ATVI Quake 3 1.32 Patch #33 - PB reporting sv_paused cvar hacked, fixed SV_CheckPaused to use a Cvar_Set - + ATVI Quake 3 1.32 Patch #24 - added [skipnotify] from RTCW, use to display in the console only, but not on client screen - (also fixes pb_msgprefix and pb_sv_msgprefix) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=553 - using correct error message if listen server starting as cl_punkbuster 0 sv_punkbuster 1 - + ATVI Quake 3 1.32 Patch #35 - text auto wrap in UI code was eating the last word if it was wrapping - fixed in Q3 and TA UI (this bug could have affected the server print message also) - + some updates to the win32 cons post-build process - -2002-9-21 Timothee Besset - + adding bspc cons build script - -2002-9-19 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=552 - disconnect reason is transmitted in the disconnect command and processed into com_errorMessage - (similar to RTCW behaviour) - added UI for com_errorMessage cvar in baseq3/, if client is kicked/dropped/disconnected for whatever reason - (this is already functional in TA) - + ATVI Quake 3 1.32 Patch #9 - failing vote if there's only one voting client (fixes exploit on 2-player server where one player votes then disconnects, forcing vote to pass) - + ATVI Quake 3 1.32 Patch #5 - removed the userInfoChanged message (was a debugging leftover) - + ATVI Quake 3 1.32 Patch #18 - rcon was not properly fixed yet, this only showed up for PB commands - changed the rcon parsing again to be more reliable - -2002-9-18 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=549 - the demo command has a list of compatible protocols, it will loop through 66 67 68 - you can do '/demo four' and it will try four.dm_66 four.dm_67 four.dm_68 - or you can explicitely give a '/demo demoname.dm_??' - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=551 - added SVF_CLIENTMASK (0x00000002), works only with <= 32 players - set bitmask of players to which send entity - -2002-9-17 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=550 - rcon bug fix - + some scons updates for win32 (post build) - + 1.32rc2 - -2002-9-06 Timothee Besset - + updated completely the setup system: - fixed cons stuff to build setup with cons -- release setup - working from new setup codebase with some custom patches: - https://bugzilla.icculus.org/show_bug.cgi?id=52 - https://bugzilla.icculus.org/show_bug.cgi?id=53 - checked that BSD support was still in (brandelfing and symlinks) .. will have to get tester feedback - bumped version to 1.32rc1 - TODO: update the windows .VCT (standalone setup and auto-update) - -2002-9-04 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=543 - backport from RTCW 1.4 code - rcon commands where sent after being tokenized and rebuilt - that was breaking any quoting, for instance 'rcon g_motd "hooka pooka"' - added Cmd_Cmd() to retrieve the un-tokenized command and transmit as is on both ends - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=542 - b0rked text wrapping in connect screen - was a missing sizeScale in q3_ui/, and a bad param in ui/ - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=540 - backport fix to pk3 reordering, happens when clearing the references, bad order from connection may break stuff - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=527 - TA ui/, quickfix to netSource (mod stuff, doesn't affect TA) - + cleaned up broken old DO_WIN32 stuff in cons scripts - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=526 - typo in models2.shader - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=443 - Linux client: sub-frame timing of key/mouse events - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=453 - added mousewheel support: wheel to scroll, ctrl+wheel to scroll faster, shift+wheel to scroll history - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=545 - bumped server count to 4096 - + keep around: __asm__ __volatile__ ("int $0x03"); - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=516 - moved screenshots to backend with a new RC_SCREENSHOT render command - fixes the r_smp 1 garbled screenshots - -2002-8-29 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=539 - new VM code from Raven's Sof2 - + cons / qvmtools build system fixes - + had to get a new qe3.ico again (resource compiler error) - http://vasin.hypermart.net/eei.htm - + updated, basic testing on win32, merging back in trunk - + merged bug-539 branch back into trunk, officialize the new VM code - -2002-8-26 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=472 - linux client: handle ctrl+space situations (could leave space locked on + space not working with ctrl on) - + update the build system, build q3lcc and q3asm etc. on demand - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=62 - fixed invisible players/entities - -2002-8-23 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=536 - fixing donedl being ignored after autodl if map_restart'ed (propagate from RTCW) - ignoring multiple map_restart (propagated from RTCW) - + reworked the server 'client text ignored' message to only trigger when there's actually a message that doesn't get to the game VM - -2002-8-18 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=528 - ydnar: reorg bits in the drawsurf sort index, push MAX_SHADERS to 2^12 - + commented out some debug stuff in java auth server - + added FAQ item with Linux & BSD patch to handle broadcast on multiple interfaces - -2002-8-15 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=534 - fixing rcon being broken on NT/XP with > 23 days uptime (or so) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=525 - changed the rcon buffer size to avoid overflows and dropping part of the message - -2002-8-14 Timothee Besset - + hacked in some experimental win32 stuff to the cons files - (win32 recognition and pk3 installs .. very very experimental but I needed it for win32 dev) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=521 - ui/ and q3_ui/ : added text auto wrapping in the connection screen drawing (server message) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=531 - removed the MPlayer stuff from the server browsers - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=505 - enabled back the ignore if protocol is != (fixes Wolf servers showing in browser) - -2002-8-10 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=500 - propagated IP banning fix from RTCW - -2002-8-08 Timothee Besset - + propagate additional sv_lanForceRate fix from RTCW - -2002-8-07 Timothee Besset - + added trap_FS_Seek - -2002-8-05 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=50 - fixed the DI mouse init procedure - -2002-8-05 Timothee Besset - + removed sv_allowanonymous, was dummy and polluting the serverinfo - (sv_allowanonymous was designed to flag wether server was public or not, but that's replaced by g_needpass) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=514 - sv_strictAuth (default 1): server variable to control wether strict CDKEY auth should be performed - this is required if you want reliable cl_guid on the server - extended the getIpAuthorize (server->auth message) syntax - sending the fs_game at all times (default 'baseq3'), dummy sv_allowAnonymous 0, strict auth flag - NOTE: 1.31 server on baseq3 sends a getIpAuthorize packet like: - processing packet: getIpAuthorize -1230824753 217.128.77.195 0 - the auth server will mistakenly read fs_game as '0' - + TAGGED the master / auth source as pre-1_32 - will need to go back to this to comment out all my debugging crap - -2002-8-04 Timothee Besset - + cleaned master server stuff, client was prompting master.quake3arena.com, - server was sending heartbeats to master3.idsoftware.com - both point to 192.246.40.56, unified to master.quake3arena.com - the MPlayer master, master.quake3world.com doesn't exist anymore, switched it to master.quake3arena.com - -2002-8-02 Timothee Besset - + added auth server source, reorganized - + auth server name / master key optionally set on command line for master and auth servers - + auth and master config in build system - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=524 - changed default GL driver from libGL.so to libGL.so.1 - see LSB 1.2 spec: http://www.linuxbase.org/spec/refspecs/LSB_1.2.0/gLSB/libgl.html - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=480 - applying the 'no cp command' experimental fix for beta phase - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=462 - backported from RTCW, fix to packet fragmenting emission - FIXME: there is some verbose code that we have to take out in the final version (grep for #462) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=475 - backported from RTCW, don't get dropped if the server changes map while connecting (ignore outdated cp) - + PROTOCOL BUMPED TO 68 - -2002-8-01 Timothee Besset - + Linux: dedicated build was not setting up signal handler like the full client does - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=522 - SplashDamage bugfix, now clearing client gentity before GAME_INIT call (instead of after) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=498 - fixed NET_AdrToString to print the port as unsigned int (for ports > 1^^15, was showing negative) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=501 - maintain IP in userinfo sent to game - + checking in master server source - -2002-7-31 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=513 - https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=506 - porting fix from RTCW codebase. client re-orders it's pk3s to scan in the same order than the server - this eliminates several 'Invalid .PK3 file referenced' situations (caused by client not referencing the same thing as server) - + fixed border remnants in ta ui - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=517 - ERR_DROP if PB client off / server on conflict when starting local server - + quickfix to q3 ui / punkbuster detect in server browser - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=458 - code fix, no more taunt spam - + cons install of PB .so files - + correct MOD_KAMIKAZE and MOD_JUICED in TA games.log - -2002-7-29 Timothee Besset - + q3 ui: completed confirmation prompts and messages (added UI_ConfirmMenu_Style & UI_Message) - + ta ui: backported 'conditionalopen' from RTCW (conditionalopen ) - + ta ui: confirmation prompt for punkbuster enable/disable etc. - + added the win32 DLLs to pb/win32/ - -2002-7-28 Timothee Besset - + ta ui: sv_punkbuster in StartServer menu - + ta ui: added cl_punkbuster in server browser - + view filters are in a modal dialog - + new files: filter.menu menus.txt (pak3.pk3 updated) - + fix broken link in Linux FAQ - -2002-7-27 Timothee Besset - + ta ui: PB display in the browser, in it's additional tab, with sorting - -2002-7-26 Timothee Besset - + PB UI: for baseq3/ AND missionpack/ - q3_ui: Punkbuster: Enable/Disable in server broswer (cl_punkbuster) - q3_ui: PB logo, PB Yes/No in browser (TODO: validate this to be working) - q3_ui: added sv_punkbuster toggle in start server menu - + automated building of the new PK3s, unix/Conscript-pk3 - -2002-7-25 Timothee Besset - + added PB build scripts on Linux, fixed the Linux build - -2002-7-12 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=511 - fixing re.SetColor crash for widescreen displays (q3dm11) - was calling to the renderer while not registered - -2002-6-19 Timothee Besset - + r_roundImagesDown 0 + map q3dm16 -> tr_image.c ResampleTexture crash - buffer overflow because of resample to 2048x.. - xian_q3dm12_leftwall4fin.jpg 1152x384 - bumped one buffer byte p1[1024] -> byte p1[2048], added a safe check - -2002-6-14 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=493 - propagate a renderer fix from RTCW. fixes a one-frame visual glitch when mod code - registers a shader after drawsurfaces are generated but before the frame is rendered - -2002-6-12 Timothee Besset - + added cons and pcons to unix/, updated the build script - -2002-5-24 Timothee Besset - towards a new Q3 release? - some bug fixes require protocol change, or mod code/mod interface change to be fixed properly - this is a biz decision, dunno yet if we are going to want a new protocol (probably not) - -> have to create a branch for the 1.31b, i.e. backwards compatible with 1.31 'Stable-1_31' - and put the 1.32 specific / protocol changes on trunk - no telling what will go in SOS in the end .. probably 1.32 - -2002-5-5 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=491 - adding a sv_lanForceRate (defaults to 1) to turn on/off server forcing rate of LAN clients - (only affects LAN dedicated clients - dedicated 1, default behaviour forces LAN clients to 99999 rate) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=470 - fixing potential overflows with cl_cdkey (propagated from RTCW) - + cons-based build system (imported from Wolf, was partly written for mod tools release already) - building with SMP on by default - + better #ifdef SMP handling ('disabled at compile time' message) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=494 - Q_vsnprintf for vsprintf calls in the core - not putting this in game code as we'd need a vsnprintf implementation in bg_lib.c - -2002-4-5 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=462 - taking out the fix which was found broken and incomplete - -2002-8-4 Timothee Besset - + adding NO_MOUSEGRAB define (select in the Makefile) - -2002-2-4 Timothee Besset - + applying Gareth's SMP patch - + count number of CPUs (Sys_ProcessorCount in unix_shared.c), default r_smp appropriately - + bumping version to 1.32 - + if XInitThreads fails, set r_smp to zero - -2002-28-2 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=462 - send potential remaining fragmented packets before sending a gamestate - -2002-26-2 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=455 - removed old libMesaVoodooGL.so loading code - Voodoo cards should use XF4/DRI, that load code was outdated and confusing people with broken OpenGL - -2002-16-1 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=441 - adding brandelf calls to the setup building process so that our binaries run on BSD - -2002-1-1 Timothee Besset - + updated FAQ with BSD info (bug #441) - + FAQ update on CLIENT_UNKNOWN_TO_AUTH - + FAQ update for proper strace usage - -2001-12-12 Timothee Besset - + Q3 1.31 point release - updating build_setup.sh to new pk3 files - (baseq3/pak7.pk3 missionpack/pak2.pk3) - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=395 - adding quake3.xpm icon, and modified the setup accordingly to put symlinks - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=390 - ignoring SIGTTIN SIGTTOU - -2001-06-12 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=402 - bug with full scene - -2001-04-12 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=398 - cg_bobup cheat protect - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=399 - fixed Setup > System > Driver info crash - + checked in code/spank.sh script, perform checksuming - -2001-18-09 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=371 - propagating sound code fixes from Wolf to Q3 - -2001-11-08 Timothee Besset - + setup script was still broken, damn shell expansion - the exit code for Q3 was always zero instead of $? - propagating the fix to Wolf - -2001-11-04 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=382 - modified challenge code for motd to be truly random - -2001-10-31 Timothee Besset - Moved updated q3asm and lcc source at the toplevel, MissionPack/q3asm - and MissionPack/lcc - -2001-10-29 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=381 - build system is now functional - -2001-10-21 Timothee Besset - + updated Sys_LoadDll code on linux to search in the following order: - #1 current directory - #2 fs_homepath - #3 fs_basepath - this was needed to make mod developement easier - -2001-10-09 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=51 - the code to buffer the redirection was in there but disabled? (Com_Printf) - enabled it back - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=52 - connection issues / userinfo - client side fix, instead of sending 'connect ' packet - we now send 'connect ""' - -2001-10-08 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=371 - added a PROT_READ to the mmap call - this was needed to go around a bug in glibc i586 i686, memset doing read access - since the audio_fd is opened O_RDWD this is harmless to Q3 - -2001-10-07 Timothee Besset - + updating from SOS - S_WriteLinearBlastStereo16 C/asm is back in snd_mix.c (Graeme) - r_showtris r_shownormal cheat protections - + Sys_LoadDll changes: - removing -debug search when loading native dlls - changing the fatal aborts when not finding native from release only to debug only (was a misfeature) - used to search in cd_path which is bogus, now searching in pwd if basepath fails - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=275 - fixed r_fullbright not being cheat protected / was a CVAR_LATCHED|CVAR_CHEAT issue - -2001-09-06 Timothee Besset - + updated from SOS, some changes to qcommon/unzip.c (statics) - -2001-08-27 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=3 - Added some code in CL_InitDownloads to use FS_ComparePaks and print out information about server-referenced paks that are missing on the client. It is a first step, allows to get precise information about what can cause a connection to fail (typically when the user is sent back to the main screen). - -2001-08-22 Timothee Besset - + https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=86 - fixed sound bug (with Graeme hints) - -2001-08-20 Timothee Besset - + made sure Sys_Printf doesn't get into an endless loop if logfile is on - fixed qconsole.log issues, +set logfile 1 +set fs_debug 1 was crashing (any OS) - fixed logfile 1 / ttycon 1 issue, didn't exit properly (same endless looping) - also fixes an issue reported by q3f team - + changed rcon commands from Com_DPrintf to Com_Printf so that they show up in the console - (with IP information) - -2001-08-19 Timothee Besset - + fixed https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=91 - (autodownload toggle in q3 ui) - + fixed https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=76 - g_password issue - + fixed https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=93 - cheat protecting r_lodCurveError - + wontfix https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=92 - -2001-08-18 Timothee Besset - + more fixes to the 7-button mouse code (linux only) - + updated faq about gamma slider - + added "servers don't show up in ingame browser" to faq - + added Alt+Enter toggle for fullscreen/windowed (linux) - -2001-08-16 Timothee Besset - reconfiguring CVS repository to give access to Gareth - + testin gareth's access - -2001-08-03 Timothee Besset - * https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=85 - fixes in the setup code for older bash versions - -2001-08-02 Timothee Besset - * commented out assembly implementation of S_WriteLinearBlastStereo16, using modified C implementation from Zaphod - need to check performance: https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=88 - * finished const declarations in CG_Trace calls, was needed in pmove_t declaration and some other functions - cgame/cg_local.h : CG_trace trap_CM_BoxTrace - game/bg_public.h : using const in pmove_t trace functions prototypes - (fixes gcc warnings: assignment from incompatible pointer type) - -2001-07-26 Timothee Besset - * https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=78 - mapped K_MOUSE4 K_MOUSE5 - -2001-07-23 Timothee Besset - * https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=5 - more fixes, handling meta characters and various kinds of backspace - -2001-07-22 Timothee Besset - * https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=5 - after testing feedback, fixed more stuff: - better backspace, works with putty and potentially more terminals - * https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=51 - band aid fix to rcon status, incresed MAX_PUSHED_EVENTS from 256 to 1024 - (adds 28kb of mem requirements) - -2001-07-21 Timothee Besset - * https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=2 - using XF86 Gamma extension to set the gamma in game from the menus - (previous behaviour was to set /r_gamma and restart, renderer relying on s_gammatable) - restoring initial gamma on GLimp_ShutDown - -2001-07-19 Timothee Besset - * https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=5 - first usable version of dedicated console - added history and completion functionality - ready for some testing - still some TODOs and FIXMEs: - keep the currently edited line when going back from history exploration - edit the current line with cursor, insert mode etc. - -2001-07-18 Timothee Besset - * starting TAB completion and history for the dedicated server (tty console) - removed Sys_ConsoleOutput (unused) - removing bogus nostdout variable - cleanup of a big chunk of code that Bernd commented out and scheduled for deletion - moved completion code from client/cl_keys.c stuff into qcommon/common.c, Field_CompleteCommand(field_t*) - -2001-07-13 Timothee Besset - * fixed https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=8 - screenshots overwrites - * fixed https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=31 - DOUBLE SIGNAL FAULT - -2001-07-11 Timothee Besset - * fix for french keybards / console toggle / bound to XK_twosuperior - -2001-07-10 Timothee Besset - * https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=19 - cleanup of the keyboard code, adding com_developer message in case XLookupString would fail - -2001-07-10 Timothee Besset - * https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=33 - using our custom handlers for X errors, should make things more robust - (X docs say some X errors are not fatal, but the default X handler exits the app anyway) - -2001-07-08 Timothee Besset - * https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=19 - keyboard state issues, fixed the sticking with ctrl key (thks relnev) - -2001-07-07 Timothee Besset - * closing https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=13 - the fixes to bug #9 solved this one too - * checking in to SOS - -2001-07-05 Timothee Besset - * work on https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=9 - filesystem code changes: - updated the documentation in files.c to the current system - added correct fs_homepath fs_basepath fs_cdpath scanning to FS_SV_FOpenFileRead - (fixes description.txt not found, and probably a few other linux issues) - -2001-06-29 Timothee Besset - * fixed setup issues (graphical/console) - https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=6 - -2001-06-26 Timothee Besset - * bug tracker is online at https://zerowing.idsoftware.com/bugzilla - authentication, use login: bugs password: b00gies - for now, using it as the linux bug tracker, possible use for more OSes and programs if anyone is interested. - * tweaked the graphical setup to send to bugs@idsoftware.com on errors instead of support@lokigames.com - -2001-06-19 Timothee Besset - * fixed generated launch script /usr/local/bin/quake3, exit $* should be exit - -2001-06-18 Timothee Besset - * rebuilt 1.29f setups, released as 1.29f-beta1 'Q3 1.29f linux-i386 Jun 19 2001' - -2001-06-10 Timothee Besset - * rebuilt against PR source, packaged 1.29b setups - -2001-05-25 Timothee Besset - * graphical setup, based on Loki's setup tool (GPL) - -2001-05-22 Timothee Besset - * changed fs_basepath to fs_homepath, according to Graeme's changes (probably missed this change?) - this fixes the q3key prompting at each game startup - -2001-05-20 Timothee Besset - * rebuilding 1.28b, various fixes on linux build: - - SetProgramPath was renamed to Sys_SetDefaultCDPath in unix_shared.c - updated unix_main.c accordingly - - some prototypes in qgl.h are guarded by #ifndef GL_VERSION_1_2 (ARB extentions) - those prototypes are needed by linux_glimp for importing functions and casting, added a #ifdef __linux__ - (not a clean solution) - - game/q_shared.h - little endian / big endian functions have been added - gcc generates warnings about functions being unused .. inlined them - - cgame/cg_marks.c - // TTimo - // gcc warning: might be used uninitialized - float sInc = 0.0; - float s = 0.0; - -2001-05-15 Timothee Besset - * fixes to linux Makefile for bspc 2.1h - * various updates to 1.28b on linux - -2001-05-09 Timothee Besset - - * R. Duffy reverted game/bg_pmove.c PM_CheckDuck, was a merging screup on my side - * updated setup to 1.27z, removed the .so from the setup distribution (they were in 1.27g because of issues) - FIXME: gotta get pk3's first - -2001-05-04 Timothee Besset - - * fixes to gcc, building RC for 1.27s - -2001-05-01 Timothee Besset - - * added qcommon/huffman.c to the Makefile - * gcc -Wall: - commenting out - CL_Netchan_Encode CL_Netchan_Decode (cl_net_chan.c) - Netchan_ScramblePacket Netchan_UnScramblePacket (net_chan.c) - SV_Netchan_Encode SV_Netchan_Decode (sv_net_chan.c) - -2001-04-26 Timothee Besset - - * fixed dedicated server crash when entering the VM_COMPILED qagame on a mod (some statics lacked initialization) - -2001-04-25 Timothee Besset - - * added $(Q3POBJ) to clean target (cleanup of platform-dependent objects) - * more make clean improvements - -2001-04-23 Timothee Besset - - * cleanup the mod selection code, remove duplicates - * some issues with release builds, my main developement box doesn't build stable binaries with release settings - removing -fomit-frame-pointer seems to fix (there's probably a performance hit) - see OMIT-FRAME-POINTER.txt - -2001-04-13 Timothee Besset - - * checked in a first set of merged files - -2001-04-06 Timothee Besset - - * merged back the core linux parts to make 1.27g linux build from the Source Safe tree again - -2001-02-27 Bernd Kreimeier - - * CVS: tag with changes as of today - cvs tag id1-27j-loki01027 - - * code/qcommon/msg.c: numFields loop (SOS). - * code/qcommon/files.c: ue Q_stricmp (SOS uses stricmp, was strcmp). - * code/game/q_shared.h (Q3_VERSION): 1.27j. Also - MAX_STRING_TOKENS upped from 256 to 1024 (SOS). - - * code/server/sv_snapshot.c (SV_AddEntitiesVisibleFromPoint): see below. - * code/game/g_public.h (SVF_NOTSINGLECLIENT): added (SOS). - - * code/server/sv_ccmds.c: see below. - * code/game/g_main.c: g_gametype cvar now userinfo (SOS). - - * code/game/g_active.c (SendPendingPredictableEvents): new (SOS). - * code/game/bg_misc.c: new SOS (sos010227) - - * SOS: new update sos010227. - -2001-02-22 Bernd Kreimeier - - * CVS: now in sync with last SOS and cleanup up - cvs tag id1-27i-loki01022 - - * code/ui/ui_shared.c: below. - * code/ui/ui_main.c: leftover code! - * code/server/sv_world.c: below. - * code/server/sv_snapshot.c: below. - * code/server/sv_init.c: below. - * code/server/sv_game.c: below. - * code/server/sv_client.c: below. - * code/server/sv_ccmds.c: below. - * code/server/sv_bot.c: below. - * code/server/server.h: below. - * code/renderer/tr_surface.c: below. - * code/renderer/tr_shader.c: changed assert to early return. - * code/renderer/tr_shade_calc.c: below. - * code/renderer/tr_shade.c: below. - * code/renderer/tr_scene.c: below. - * code/renderer/tr_mesh.c: below. - * code/renderer/tr_local.h: below. - * code/qcommon/vm_x86.c: cleanup. - * code/qcommon/vm.c: below. - * code/qcommon/unzip.c: below. - * code/qcommon/qcommon.h: below. - * code/qcommon/files.c: below. - * code/qcommon/cvar.c: cleanup. - -2001-02-21 Bernd Kreimeier - - * code/qcommon/common.c: cleanup. - * code/qcommon/cm_trace.c: cleanup. - * code/qcommon/cm_patch.c: cleanup. - * code/qcommon/cm_public.h: cleanup. - * code/game/q_shared.h: cleanup. - * code/game/q_shared.c: cleanup. - * code/game/q_math.c: cleanup. - * code/game/g_syscalls.asm: changed (once more) floor,ceil etc. - * code/game/g_spawn.c: cleanup. - * code/game/g_session.c: cleanup. - * code/game/g_cmds.c: cleanup. - * code/game/g_client.c: cleanup. - * code/game/g_arenas.c: cleanup. - * code/game/bg_slidemove.c: cleanup. - * code/game/bg_pmove.c (PM_CheckDuck): old call to trace? - * code/game/bg_misc.c: cleanup. - * code/game/be_aas.h: dead code. - * code/game/ai_dmq3.c: cleanup. One clear/copy switched? - * code/game/ai_dmnet.c: more //*/. Why oh why not DEBUG.... - - * code/client/snd_mix.c: below. - * code/client/snd_dma.c: below. - * code/client/keys.h: cleanup. - TODO: #error in q3_ui/keycodes.h ? - - * code/client/client.h: cleanup. - * code/client/cl_main.c: misplaced bracket. Cleanup. - * code/client/cl_keys.c: below. - * code/client/cl_cin.c: below. - * code/client/cl_cgame.c: cleanup. - TODO: define assert for Win32 or guard my assertions. - - * code/cgame/cg_syscalls.c: below. - * code/cgame/cg_servercmds.c: below. - * code/cgame/cg_players.c: cleanup. - - * code/cgame/cg_newdraw.c: remember to diff against cg_newDraw.c - in SOS (mixed case). - TODO: get id to use cg_newdraw.c, and to remove cg_newDraw.c/cpp. - - * code/cgame/cg_main.c: below. - * code/cgame/cg_local.h: below. - * code/cgame/cg_event.c: below. - * code/cgame/cg_drawtools.c: below. - * code/cgame/cg_draw.c: cleanup. - * code/cgame/cg_consolecmds.c: dead code. - * code/bspc/qbsp.h: below. - * code/bspc/l_poly.c: below. - * code/bspc/l_math.c: cleanup. - * code/bspc/bspc.c: cleanup. - * code/bspc/be_aas_bspc.c: cleanup. - * code/bspc/aas_map.c: kept comments - merge loss at their end? - * code/bspc/aas_file.c: cleanup. - - * code/botlib/be_interface.c: this file is plain impossible. There - are layers of code made dead with /* */ and the resurrected by - //* or // /* or variations of this. I reverted to exact mirror - image of SOS to be sure - short of removing it's too easy to mistake - live code for dead one. - Later: have to change 5 occurences to avoid gcc complaints about - nested comment tokens. - TODO: somebody please get rid of the cruft in here. - - * code/botlib/be_ai_move.c: redundant typedef. - * code/botlib/be_ai_chat.c: assertions on signed string index. - Note: this is not in my ChangeLog - ouch. - TODO: use gcc -fsigned-char on all platsforms to enforce Win32 - TODO behavior (PPC has a default unsigned char, Intel has not). - * code/botlib/be_aas_sample.c (AAS_TraceClientBBox): one code block - was placed in different location, and one FPE hack not used. I would - expect that divide by zero will still occur here. - - * code/botlib/be_aas_reach.c: below. - * code/botlib/be_aas_cluster.c: cleanup. - * CVS: the last tag (below) marks the version with a lot of history - and additional comments. I am now bringing the codebase in sync with - SOS as of yesterday, cleaning out comments, dead code and other - differences to minimize a diff - in a valiant if futile attempt to - roll back changes into the id codebase. - Note: I ignore the $SOS$ - these are unfortunate but will change - in the same awkward way at their end. - Note: I stick to #if 0 instead of C comments around dead code id - kept (nested comments issue). The commentary is changed to sosYYMMDD - and includes the token DEAD. - -2001-02-20 Bernd Kreimeier - - * CVS: update, then tag current version as - cvs tag id1-27i-loki010219 - - * SOS: patched up to sos010219. - - * code/qcommon/cm_trace.c (CM_Trace): fabs on sphere offsets (SOS). - * code/game/bg_slidemove.c (PM_StepSlideMove): stepSize vs. STEPSIZE (SOS). - * code/game/bg_pmove.c (PM_CheckDuck): fix in stand up check (SOS). - * code/bspc/bspc.c (main): -capsule (SOS). - * code/bspc/qbsp.h: below (SOS). - * code/bspc/be_aas_bspc.c (capsule_collision): added (SOS). - * code/bspc/aas_map.c (CapsuleOriginDistanceFromPlane): added and used (SOS). - * code/bspc/aas_file.c (AAS_WriteAASFile): removed diagnostics recently - added. No matter how long you wait, they'll always get you ;-). - * code/botlib/be_aas_cluster.c: enabled LogWrites, different flood (SOS). - - * SOS: patching up to snapshot sos010219. - Note: For brevity, I use as marker sosYYMMDD now instead of bkYYMMDD, to - distinguish from changes not in SOS. - - * CVS: tagged current version before patching up with SOS. - cvs tag id1-27i-loki010216-bsd - -2001-02-16 Bernd Kreimeier - - * code/server/sv_init.c: DLL_ONLY sets sv_pure to 0 and ROM. - TODO: determine good sv_pure policy for DLL-only servers. - - * code/renderer/tr_shade_calc.c: my_ftol implementation (BSD). - - * code/unix/Makefile: FreeBSD sections. - TODO: include target-specific Make-freebsd etc., - include a Make-local not in CVS for build preferences, - and generally clean up this mess. - * code/unix/unix_glw.h: guard #error - * code/unix/linux_snd.c: soundcard.h location (BSD). - * code/unix/linux_glimp.c: guard system headers. - Later: added Joystick stubs. - Note: linux_ etc. prefixes start to loose meaning as we - re-use most of this on UNIXes anyway. I didn't use Raf's - freebsd_joystick.c but instead put generic stubs here. - TODO: introduce generic -DNO_JOYSTICK flag. - * code/renderer/tr_local.h: my_ftol guard. - * code/renderer/qgl.h: FreeBSD guards. - * code/qcommon/vm_x86.c: sys/types include on FreeBSD. - * code/qcommon/md4.c: Win32 pragma guard. - * code/qcommon/common.c: Com_Memcpy/Memset external. - * code/game/q_shared.h: added FreeBSD defines. - * code/game/q_math.c (BoxOnPlaneSide): FreeBSD conditional. - TODO: check whether we have/need the assembly version anyway. - * code/client/snd_mix.c: use C fallback on FreeBSD. - Note: all of the above changes from the original port by Rafael Barrero. - - * CVS: tagged current version before merging FreeBSD related changes. - cvs tag id1-27i-loki010215-ppc - -2001-02-15 Bernd Kreimeier - - * code/unix/Makefile: BSD related changes. - * code/cgame/cg_draw.c: hacked phone jack rendering check for Debug. - TODO: finish Debug, fix CG_DrawDisconnect !!! - - * code/unix/vm_x86.c: error on compile attempts. Fight redundancy! - * code/qcommon/vm_x86.c (VM_CallCompiled): dummy for linkage on PPC. - Note: DLL_ONLY is the global Makefile option for DLL-only builts. - Currently only executed on Linux. - * code/unix/unix_main.c: *ppc postfix for DLLs. Ignored the changes - to redundant code (have to remove the unused Un/LoadDll/API calls). - * code/server/sv_game.c (VMA): changed macro (see below). PPC. - * code/qcommon/vm.c (VM_DllSyscall): see lengthy commentary by Ryan. - The existing VM code makes certain assumptions about the layout of - varargs on the stack, which fall apart with call conventions that - don't even put all parameters on the stack (gcc on PPC, register-rich). - Using a dedicated memory area as our own stack. This should actually - be the default behavior. - Later: make vm_* cvars INIT/ROM for DLL_ONLY target. - - * code/qcommon/common.c: PPC change (from Ryan Gordon). - -2001-02-07 Bernd Kreimeier - - * code/unix/unix_main.c: disabled FPE for debug for the time - being (that is, until I can figure out - Program received signal SIGFPE, Arithmetic exception. - RB_BeginSurface (shader=0x449572e0, fogNum=0) at ..//renderer/tr_shade.c:307 - 307 tess.shaderTime = backEnd.refdef.floatTime - tess.shader->timeOffset; - without any NaN's involved. - TODO: unmask other FPE's selectively (see Mike's Tribes2, no getenv though). - -2001-02-06 Bernd Kreimeier - - * SOS: up to date with todays snapshot. - Note: got the date wrong, comment used was bk010205. Duh. - - * code/server/sv_snapshot.c (SV_UpdateServerCommandsToClient): below. - * code/server/sv_main.c (SV_ReplacePendingServerCommands): new (SOS). - * code/server/server.h: reliableSent (SOS). - - * code/renderer/tr_shade.c (ProjectDlightTexture): see below. - * code/renderer/tr_scene.c: see below. - * code/renderer/tr_public.h: see below (SOS). - * code/renderer/tr_local.h: additive light support (SOS). - - * code/qcommon/cm_trace.c (CM_Trace): new tw.sphere.use branch (SOS). - - * code/game/g_spawn.c: notta, notq3a entities (SOS). - * code/game/ai_dmq3.c: MAX_ACTIVATEAREAS search (SOS). - - * code/client/cl_cgame.c: see below. - * code/cgame/cg_syscalls.c (trap_R_AddAdditiveLightToScene): below. - * code/cgame/cg_syscalls.asm: see below (trap_R_AddAdditiveLightToScene). - * code/cgame/cg_public.h: CG_R_ADDADDITIVELIGHTTOSCENE (SOS). - - * code/bspc/l_math.c: new VectorLengthSquared, removed rotate/matrix (SOS). - * code/bspc/bspc.c (BSPC_VERSION): was 2.1e, now? - * code/bspc/be_aas_bspc.c (BotImport_Trace): CM_BoxTrace sig. (SOS). - * code/bspc/aas_file.c (AAS_WriteAASFile): SOS. - * code/botlib/be_aas_sample.c (AAS_DeAllocAASLink): SOS. - - * code/unix/unix_main.c (Sys_LoadDll): do not load from installdir - in NDEBUG (confusing relic from old Makefile). Postfix -debug.so - for debug binaries to let both builds coexist. - - * code/unix/Makefile: updated install targets and VERSION. - - * Win32: build from SOS snapshot. - Note: Unix CR/LF in *.dsw/*.dsp fucks up MSVC++. - -2001-02-02 Bernd Kreimeier - - * SOS: all changes up to today. - - * code/server/sv_init.c (SV_TouchCGame): added. Also memset - on reallocated client data (SOS). - * code/qcommon/qcommon.h: see below. - * code/qcommon/cvar.c (Cvar_SetLatched): new (SOS). - * code/qcommon/cm_trace.c: more sphere test fixes (SOS). - Note: SOS encryption key expired and updated by MrElusive. - - * code/qcommon/cm_patch.c (CM_TraceThroughPatchCollide): - fix from MrElusive, fall through curved corner floors (q3dm17). - Later: also in SOS (so is shadow FPE fix). - - * Win32: can't get an unadulterated SOS snapshot to build. - First, fix CR/LF back again (Linux client converts all). - find . -name '*.ds*' -print - alias dos2unix='recode ibmpc..lat1' - alias unix2dos='recode lat1..ibmpc' - Next, find a *.dws that works? Nope, no cigar. - -2001-02-01 Bernd Kreimeier - - * Win32: have to update dsp/dsw/etc. files in CVS, too. - - * CVS: tag previous version before update - cvs tag id1-27h-loki010131-beta3 - - * code/game/q_math.c (Q_rsqrt): guard, #ifndef __linux__ - for assert (for Win32 build). - TODO: assert replacement for Win32? - * code/q3_ui/ui_qmenu.c: see below. - * code/q3_ui/ui_players.c: see below. - * code/q3_ui/ui_controls2.c: float const with f postfix - Note: Win32 C4305 warning. Somebody at id has been doing - a lot of these recently as well... - - * code/cgame/cg_players.c (CG_PlayerShadow): applied fix by - MrElusive, removed FPE hack (player shadows on zero mormals). - Prolly in this evenings' CVS. - - * code/server/sv_game.c: new signatures (capsule again). - * code/server/server.h: new signatures (SV_Trace,ClipToEntity). - * code/server/sv_bot.c: new signatures (above). - * code/qcommon/cm_trace.c: a truckload of changes. Math - code added before moved upwards. Capsule traces added all - over the place, old box traces moved in conditional - branches, functions renamed and wrapped. Eliminated some - of the previous' versions deadcode to keep diffs smaller. - TODO: once a point release is out and reasonably bug - TODO free, remove // bkYYMMDD annotations where SOS related. - - * code/qcommon/cm_public.h: new signatures in prototypes. - * code/qcommon/cm_patch.c: dead code re-enabled, new - sections (conditional branches for spheres) added to - several trace functions. - * code/qcommon/cm_local.h (CAPSULE_MODEL_HANDLE): added. - * code/qcommon/cm_load.c (CM_TempBoxModel): capsules. - - * code/game/q_shared.h (Q3_VERSION): 1.27i now (new QVM traps). - - * code/game/g_syscalls.asm: see below. - * code/game/g_public.h (SVF_CAPSULE): added (SOS). Also - G_ entry poiints for capsule traces. - - * code/client/cl_cgame.c: see below. - * code/cgame/cg_syscalls.c: see below. - * code/cgame/cg_syscalls.asm: see below. - * code/cgame/cg_public.h: new capsule trace code (SOS). - -2001-01-31 Bernd Kreimeier - - * Win32: test compile (WinCVS, MSVC++). Have to guard isnan. - Note: too much shit going on.... - -2001-01-30 Bernd Kreimeier - - * CVS: update for patching up (pre-1.27i). - - * SOS: new changes (new collision detection primitives). - Now Version 1.27i. - TODO: start testing using DLL's (QVM code is out of sync). - -2001-01-25 Bernd Kreimeier - - * SOS: caught up till today (below). - * code/qcommon/cm_trace.c: new functions added: RotatePoint, - TransposeMatrix, CreateRotationMatrix (SOS). - (CM_TransformedBoxTrace): new rotation code used here. - - * code/q3_ui/ui_demo2.c: sizeof(extension). SOS. - * code/game/g_cmds.c (G_SayTo): CON_CONNECTED. - * code/game/ai_main.c: HOOK added (SOS). - * code/botlib/be_aas_move.c (AAS_HorizontalVelocityForJump): - correct fix for FPE occuring (SOS). - * code/game/ai_dmq3.c: initmove.viewoffset (SOS). - - * code/game/q_math.c: guard asser/isnan with Q3_VM (q3asm). - TODO: define Com_Error based assert macro? NDEBUG? - -2001-01-24 Bernd Kreimeier - - * code/server/sv_ccmds.c (SV_MapRestart_f): some debug. - TODO: map_restart 0 disconnects external client in 1.27h? - - * code/renderer/tr_image.c (LoadTGA): added some commentary - and dead code based on fixes from GtkRadiant (Leonardo found - flipped TGA's). - -2001-01-23 Bernd Kreimeier - - * BETA3: finished testing, ready to upload to id FTP. - Later: neither the FreeBSD beta not the Linux Beta3 - uloaded. Beta2 not yet released, and clients get - disconnected with Beta2 and Beta3 on SV_MapRestart_f. - -2001-01-22 Bernd Kreimeier - - * code/client/cl_main.c (CL_InitDownloads): undid yesterday (SOS). - * code/botlib/be_aas_sample.c (AAS_DeAllocAASLink): guard print (SOS). - * code/server/sv_client.c (SV_DirectConnect): VM_Call disconnect (SOS). - * code/qcommon/files.c (FS_ListFilteredFiles): trailing slashes (SOS). - * code/game/g_cmds.c (SetTeam): print change (SOS). - Note: the above plus VectorClear(v1) (below) are todays SOS changes. - - * code/cgame/cg_players.c (CG_PlayerShadow): ignore bogus - (all zero) planes. This caused FPE in ProjectPointOnPlane. - TODO: why does trace return zero normal planes? - Note: gdb seems totally at loss with vec3_t arrays.... - - * code/botlib/be_aas_sample.c (AAS_TraceAreas): FPE. - NaN in uninitialized v1 that wasn't supposed to be referred - to in this branch. - - * code/botlib/be_aas_move.c (AAS_HorizontalVelocityForJump): - FPE divide by zero (zero zvel, zero t) for jump estimates. - - * code/client/cl_main.c (CL_Frame):1856. uivm==NULL on - client after server crashed. - TODO: check that uivm always non-NULL for client. - TODO: do setenv(FX_NO_SIGNALS) to avoid exit errors... - - * code/unix/linux_glimp.c (GLW_SetMode): added "Indirect" - Mesa token to software rendering detection. Reworded error - output and added drivername. - TODO: measure framerate instead? - -2001-01-21 Bernd Kreimeier - - * SOS: caught up with changes up until today. - - * code/server/sv_init.c (SV_SetConfigstring): gentity != NULL - - * code/server/sv_client.c: connect to "{all bots" server. - * code/renderer/tr_init.c: JPEG extension on screenshots - * code/qcommon/files.c: modes based on mods, fs_basegame - - * code/q3_ui/ui_demo2.c: dm3 extension (demo names, protocol). - - * code/game/g_client.c: savedEvents[] removed. - * code/game/bg_misc.c: event sequence fixes. - * code/client/snd_dma.c (S_StopBackgroundTrack): different use. - * code/client/cl_main.c: demo file handling changed (names). - Also CL_InitDownloads: always next download. - - * code/cgame/cg_servercmds.c: cg_thirdPerson. - * code/cgame/cg_weapons.c: see below. - Also CG_ShotgunPattern: different call (seed parameter). - - * code/cgame/cg_main.c: see below. - * code/cgame/cg_local.h: new cg_noProjectileTrail Cvar. - * code/cgame/cg_effects.c (CG_BubbleTrail): early out (above). - - * code/bspc/l_poly.c (BOGUS_RANGE): increased. - * code/bspc/bspc.c: applied patch up to "2.1e" - -2001-01-18 Bernd Kreimeier - - * code/ui/ui_main.c: below. - * code/q3_ui/ui_main.c: UI_HASUNIQUECDKEY comment. - Note: mods have to return qfalse. See Bug #2890 in Fenris. - -2001-01-17 Bernd Kreimeier - - * BETA2: finished testing, uploaded to id's FTP for release. - -2001-01-16 Bernd Kreimeier - - * CVS: checking in preparation for Beta2. - cvs tag id1-27h-loki010116-beta2 - - * SOS: new bspc "2.1e". No change on 1.27h. - - * TEST: patch-up seems to work fine. No new files have been added - to the linkage (i.e. the ft2/ files now added), so we might not be - feature complete. - - * code/game/g_active.c (ClientThink_real): id MISSIONPACK - conditional in addition to the ones I added earlier. - * code/qcommon/files.c: REJECT. Linux hack for userdir threw it off. - * code/qcommon/unzip.c: REJECT. CRC-32 section removed. - Later: unused tempB - - * code/q3_ui/ui_syscalls.asm: REJECT. Start/StopBackgroundTrack. - * code/ui/ui_syscalls.asm: REJECT. syscalls ids from 1.27h - as of SOS (floor/ceil - will this ever get straightened out) - * code/win32/win_input.c: REJECT. g_pMouse edit. - * ui/menus.txt: REJECT. Replaced with 1.27h version. - Note: some more due to $SOS$. - - * ui/: new scripts. - cinematicmenu.menu, demo_quit.menu, ingame.txt, serverinfo_old.menu - vid_restart.menu - - * code/ft2/ttconfig.h: below. - * code/ft2/sfconfig.h: below. - * code/ft2/pstables.h: below. - * code/ft2/psnames.c: below. - * code/ft2/psdriver.h/c: below. - * code/ft2/keys.h: below. - * code/ft2/ftbbox.c: new in 1.27h - - * code/cgame/cg_newdraw.c: beware: cg_newDraw.c gets lost in diff easily. - - * code/cgame/cg_rankings.c: file removed from SOS. - -2001-01-15 Bernd Kreimeier - - * Patch-up: patching up from RC4 to 1.27h current. - No changes since 010112 snapshot. - ln -s sos010112/ work - diff -urbB sos001204-rc4/ work > work.diff - ln -s cvs-1.27g/ work - patch -p0 < work.diff > work.patch - find cvs1.27g/ -name '*.rej' -print - - * SOS: adding the remaining SOS snapshots to CVS. - cvs import Quake3_sos sos001211 pr1-27g-win32-001211 - Note: at this point id warned about repository corruption. - Watch out for the syscall stuff in particular. - cvs import Quake3_sos sos010104 pr1-27g-win32-010104 - cvs import Quake3_sos sos010108 pr1-27h-win32-010108 - cvs import Quake3_sos sos010110 pr1-27h-win32-010110 - cvs import Quake3_sos sos010112 pr1-27h-win32-010112 - Note: the first 1.27h might be the public (server only) - beta released, the second one was post release. Beware - of source files added and removed (botlib headers, FT2). - Note: why so late? Don't ask... - -2001-01-08 Bernd Kreimeier - - * SOS: id's working up to 1.27h (server side fix for - Guard exploit seems to force earlier release). Updating - CVS (most of the changes are debug code put in and - then disabled, plus some fixes as below). Next patching - up to current SOS. - -2001-01-07 Bernd Kreimeier - - * Makefile: need to rework this for multiple platforms. - We also need null/null_vm.c for platforms where we don't - have JIT (assembly emit). - -2001-01-04 Bernd Kreimeier - - * code/q3_ui/ui_connect.c (UI_DisplayDownloadInfo): time - information for current (vs. start of download) is wrong, - thus negative 1 "estimated time", as well as transfer - rate just negative downloadSize. Not fixed. - - * code/unix/unix_main.c (Sys_ParseArgs): added. - Note: for support/us, to identify builts. This is only - a skeleton right now - if I ever feel the need to support - more than "-v" and "--version" I'll have to flesh this out. - - * code/unix/linux_glimp.c (signal_handler): see below. - * code/unix/unix_main.c (Sys_Exit): added an abstraction - layer for exit/_exit/assert/raise issues. - Note: need both a better debug/backtrace handling, and - have to find a way to determine why/where the alleged - startup/exit errors happen... - -2001-01-03 Bernd Kreimeier - - * code/game/g_mem.c (G_Alloc): ERR_DROP initiated by - addbot commands for large sv_maxclients, allegedly - caused segfaults in 1.17. Not reproducible. - TODO: recover more gracefully from failure to add bot? - - * code/renderer/tr_light.c (R_LightForPoint): Tim Angus - reports a crashbug with nolight maps. Also assertion in - R_SetupEntityLightingGrid, might want conditional there. - DONE: fixed crash on LightForPoint for nolight maps. - - * code/qcommon/qcommon.h: NUM_SERVER_PORTS. A feature - request to increase this, or make it more flexible - otherwise (Fenris). - TODO: id decision on more flexible NUM_SERVER_PORTS. - -2001-01-02 Bernd Kreimeier - - * code/unix/snapvector.nasm: fixed FPU bit (the current - one had reserved bits off, behavior should not change). - * code/qcommon/vm_x86.c: fixed symbols (below). - * code/unix/ftol.nasm: FPU bits weren't correct (duh). - DONE: shoot-though floor (q3dm5) - DONE: cursor-in-rect off (TA/Player model selection) - Note: in gdb, "disassemble " is your friend. - - * code/cgame/cg_public.h: CG_MEMSET is set to 100. In - cg_syscalls.asm it's 101. If I change it I get Bad trap 100 - from the cgame VM code, so the 1.27g "official" VM code - uses it. - - * code/unix/linux_common.c: have to fall back to C, the - current assembly is buggy... - * code/unix/Makefile (linux_common.o): added. - Later: also for dedicated. Less portable this way. - TODO: C_ONLY for dedicated on non-i386 only? - - * code/qcommon/common.c: do not use memcpy/memset under Linux. - * code/unix/linux_common.c: added Andrew's assembly port. - TODO: C_ONLY for Com_Memset/Memcpy? Conditionals are fubared. - - * code/qcommon/vm.c (VM_Init): use Win32 defaults (do not - use DLL's by default). This exposes DLL rounding errors - (damage through floors), and we don't want DLL's used by - default anyway. - TODO: why vm_ui default of 1? - - * code/botlib/l_precomp.c (SourceWarning): removed assert. - - * code/game/bg_lib.c (acos): defined, but we don't actually - use it except where the cg_syscalls.asm trap is used. - - * code/game/g_public.h: missing lots of trap tokens. - * code/game/g_syscalls.c: missing lots of traps. - * code/game/g_syscalls.asm: more inconsistent hooks, were: - equ floor -111 - equ ceil -112 - equ testPrintInt -113 - equ testPrintFloat -114 - now changed to match cg_syscalls. - Note: fixed this in UI earlier, how did this slip through - the diffs against SOS? - - * code/game/g_syscalls.c: no acos hook. - * code/cgame/cg_syscalls.c: no acos hook. - * code/cgame/cg_syscalls.asm: has acos hook as -112 - Note: report from Tim Angus. The acos function is in bg_lib.c - which is linked only into ui (not q3_ui). That means we are - using libc acos right now? - Note: QVM traps are negative? - - * BSD/Irix: tagged current CVS (not all of the below) as - cvs tag id1-27g-loki010102-bsd1 - for BSD work (Rafael Barrero). Also be used for Irix update. - -2001-01-01 Bernd Kreimeier - - * SOS: adding the remaining SOS snapshots to CVS. - cvs import Quake3_sos sos001201-rc3 pr1-27f-win32-001201-rc3 - cvs import Quake3_sos sos001202 pr1-27f-win32-001202 - cvs import Quake3_sos sos001204 pr1-27g-win32-001204-rc4 - This is the codebase to which the Linux branch has been patched - up. I can't verify whether this is identical to the RC4 codebase - as the tag doesn't work (but can check against the ZIP file..) - cvs import Quake3_sos sos001211 pr1-27g-win32-001211 - The above snapshot contains a (post-release?) fix to ui_syscalls - in ui/ and q3_ui/. This change has been used in Linux (Beta1 and - above). At this point, id discouraged further use of SOS due to - repository corruption on their end. No further snapshots were - taken since. - - * Fenris: since the release of the Beta1 bugs have been - maintained at http://fenris.lokigames.com/. I am going to - list issues here as they get fixed. - -2000-12-21 Bernd Kreimeier - - * code/renderer/tr_font.c: graceful silence with old mods? - * code/botlib/l_precomp.c (SourceWarning): graceful exit if old mod? - -2000-12-20 Bernd Kreimeier - - * code/server/sv_ccmds.c (SV_MapRestart_f): see below. - * code/qcommon/vm.c: currentVM is 0x0 in VM_ArgPtr. - In VM_Call, oldVM was NULL - made conditional the - reset of currentVM to oldVM. - -2000-12-18 Bernd Kreimeier - - * BETA1: closed Linux beta release. Stripped debug - and release binaries, DLL's, and pak4.pk3. CVS checkin, - will be tagged as - cvs tag id1-27g-loki001218-beta1 - Later: id added a pak5.pk3 to the Win32 point release, - added this to the BETA1 best. - - * code/qcommon/vm_x86.c: C37F. - * code/unix/snapvector.nasm: C37F. - Note: short of any real evidence, I gamble and use max. - precision (as well as default Linux precision, but NOT - Win32 precision). It seems that precision change is not - really an issue (despite Graeme's claim that the cursor - in the menu was/is off). I also pick the roundiung behavior - that is seemingly used by ANSI and gcc (but possibly not - Win32 _ftol depending on build). - -2000-12-15 Bernd Kreimeier - - * code/unix/Makefile: added snapvector.o - * code/unix/unix_shared.c: #if 0'ed the old snapvector code. - * code/unix/snapvector.nasm (Sys_SnapVectorCW): two new - assembly functions from AndrewH that explicitely set the - FPU control word to convert vec3_t, to ensure cross-platform - behavior for both DLL and QVM. - - * code/unix/ftol.nasm (Q_ftolC37F): for globals. - - * code/unix/unix_main.c: took out global FPU manipulation. - For clarity this should be VM only. - * code/qcommon/vm_x86.c: added prototypes for the ftol - library. To select a specific behavior for the entire VM, - set ftolPtr accordingly. - Later: the GCC ftol function of course affect the stack - (there is no "declspec naked"). The problem seems to be - that the VM never handles the stack in a way compatible - to regular gcc C functions. For some odd reason _ftol seems - to do the right thing under Win32. All 4 control words - implemented at the moment work just fine with the menus. - - * code/unix/ftol.nasm: added a small library of "safe" qftol - variations that explicitely set the control word to the - relevant (4) possibilities. - -2000-12-13 Bernd Kreimeier - - * code/qcommon/vm_x86.c: an entire day spent trying to nail - the ftol issues. It breaks down like this: id used to use - an unsafe (no setting FPU control word) fistp. That seemingly - caused subtle physics bugs which nobody cared about in 1.17. - They then changed the UI code, and ran into the UI bugs: - menu entries shifted to the right, fonts vanishing. Then - they switched to using _ftol. Then they had to reproduce - the old behavior for the physics code due to public outrage. - My original port used a simple (long)float cast, which gcc - seemingly compiles to code that does OR 0C00 on whatever - current control word (precision unchanged). This breaks the - menus. If I use the unprotected fistp instead, which should - (Linux 037F default) use "nearest/even", then my menus are - correct. That would mean Win32 _ftol in id's compile does - the same, only that would require /qifist or some equivalent - compile flag, which I can't find. Two disassemblies of _ftol - I got from others showed OR 0C00 as part of the default (ANSI) - behavior. - -2000-12-13 Bernd Kreimeier - - * code/game/bg_pmove.c (PmoveSingle): trap_SnapVector. - The one true and single call to snap velocity. - Note: bspc/map.c:void SnapVector(vec3_t normal) - qcommon/cm_patch.c:void CM_SnapVector(vec3_t normal) - game/q_shared.h: #define SnapVector(v) {v[0]=((int)(v[0]));... - - * code/client/cl_cgame.c: CG_SNAPVECTOR. - * code/server/sv_game.c: G_SNAPVECTOR. - Note: these go through trap_SnapVector in syscalls. - - * code/unix/unix_shared.c (Sys_SnapVector): sticking to - old Linux version for now... - * code/win32/win_shared.c (Sys_SnapVector): changed. - Note: Graeme points out this was changed to fix ftol - artifacts? - TODO: calculate errors for various ftol variants... - - * code/qcommon/vm_x86.c: both the old fistp code (1.17) - and the new qftol function apparatently work. Using the - ftol.nasm code for now. - - * code/unix/Makefile: DO_NASM and ftol.o. - - * code/unix/ftol.nasm (qftol): created from Mike's SoF - replacements, with Andrew's help to satify the VM - stack/call requirements. - TODO: use Q_ftol herein to replace myftol elsewhere. - - * code/unix/unix_main.c (Sys_ConfigureFPU): SIGFPE. - TODO: divide by zero in botlib. Disable this for now. - Note: we can't introduce calculation differences between - versions, so fixing these will have to wait. - - * code/qcommon/vm_x86.c: two new lines in Win32 branch - missing from Linux assembly in AsmCall: - mov eax, dword ptr [edi] - and eax, [callMask] - Added, doesn't seem to affect UI etc. bugs. - Later: no FTOL_PTR, use fistp non-IEEE assembly as in old - version. This seems to work for Q3 and TA, while qftol - (simple cast) does not - for Win32 Graeme says the reverse - is true. - - * code/qcommon/vm_x86_old.c: used the old cvs-1.17 version. - Two fixes (Hunk_Alloc, Com_Memcpy), and it works: - +set vm_game 2 +set vm_ui 2 +set vm_cgame 2 - UI, cgame and game w/o apparent problems. - -2000-12-12 Bernd Kreimeier - - * code/unix/Makefile: cleanup of redundant flags. - Removed bogus MALLOC_CHECK (note to self: export MALLOC_CHECK_=2). - Also DO_SHLIB_CC on all UI DLL's. - Added and removed DEBUG_VM flag. - TODO: figure out whether Zoid did UI this way intentionally. - Note: this seemingly fixed the botimport problem, although - most of the changes were just redundant CFLAGS removed. Given - our wanker toolchain, should have been more paranoid. All - DLL's can now be used w/o apparent problems. - - * code/server/sv_main.c: gvm init. - * code/server/sv_game.c: gvm assertions. - * code/unix/unix_main.c (Sys_LoadDll): print vmMain - Note: top no avail. There is some odd ld/gdb problem here - that prevents examining globals and obfuscates part of - the stack between VM_Call and lower level code, through - G_InitGame. This is not just DLL's being loaded and unloaded. - Wromg flags during build? The vmCvar for "bot_developer" - ends up overlapping global botimport in memory, which - thus zero-fills part of the function pointer table. - - * code/server/sv_bot.c (SV_BotInitBotLib): this (by way of - GetBotLibAPI) is responsible for setting botimport, which, - if using the game DLL, is not properly set up. Called in - SV_Init(). - - * code/game/q_shared.c: Q_strncpyz does zero padding (duh). - Note: calls strncpy, which does a zero fill up to destsize. - If destsize exceeds memory size, zero padding will overwrite - adjacent memory. Suspicion was this happend to botimport. - - * code/qcommon/cvar.c: possible problem in Q_strncpyz call. - - * code/botlib/be_ai_weap.c (weaponinfo_fields): made this static. - Note: it seems that the "number" string got replaced by - p def.fields[0] - {name = 0x40000000 "\177ELF\001\001\001", offset = 2, type = 50, .. - Memory corruption? - - * code/game/inv.h (WEAPONINDEX_GAUNTLET): defined here. - * botfiles/weapons.c (Gauntlet): the baseq3/qagamei386.so parser - breaks here: - number WEAPONINDEX_GAUNTLET - * code/botlib/l_precomp.c (SourceWarning): added assertion to - trap botlib parsing problem.. - - * RC1: for beta test. Using my own vm/ui.qvm files in this case. - TODO: Setup with nouninstall. - TODO: fix game DLL/ botlib setup problem (so all DLL's work) - TODO: SIGFPE - TODO: profile? - - * code/unix/Makefile (ai_vcmd.o): added to game DLL linkage. - How the fuck did this happen? - DONE: "qagamei386.so: undefined symbol: BotVoiceChat_Defend" - - * TEST: +set vm_ui 2 (vm_x86, not interpreter). Breaks! - Further: qagame had undefined, but seemingly gets reloaded - second try (I hate the Linux linker). - * TODO: never reload fail DLL, abort engine - - -2000-12-11 Bernd Kreimeier - - * TEST: recompile QVM/DLL and executable to test new UI code. - The UI QVMs from the paks still do not work. - - * SOS: changes in UI code! - * code/q3_ui/ui_public.h: this file is deprecated - Note: e.g. it does not contain the background track calls. - * code/ui/ui_public.h: the uiImport_t enum here determines - the values. - * code/ui/ui_syscalls.asm: same as q3_ui now, were: - equ floor -111 - equ ceil -112 - * code/q3_ui/ui_syscalls.asm: these are now switched, were: - equ trap_S_StartBackgroundTrack -63 - equ trap_S_StopBackgroundTrack -64 - The new values match the ui/ equivalent. Also, floor (-108) - and ceil (-109) are different in ui/. - - * CVS: going to check in this snapshot and tag it as - cvs tag id1-27g-loki001209-rc4 - Presumed equivalent to SOS tag "1.27g RC4" (master). As I can't - obtain the tagged code using SOS (neither Win32 nor Linux client) - I can only guess. - - * TEST: use my own VM code, ion baseq3/vm/*.qvm and missionpack/vm/. - This works - in other words, the menu bug seems in the UI code, and - is fixed in my codebase. - - * TEST: make release. - Note: I can postpone DLL specific problems. Bad performance is not - as important as outright bugs. Thus the UI QVM issue is the only - one that stops me from creating an RC. - TODO: Q3 UI QVM code from pak file does not work (neither does TA). - TODO: sound with video playback still awful. Threaded sound, I guess. - TODO: ERROR: couldn't open demos/DEMO002.dm3.dm_48 (same demo001.dm3.dm_48) - - TODO: do not show Q3 demos in TA menu? - TODO: new demos for Q3? Or at least error message? - - * code/game/bg_lib.c: itrinsics excluded by Q3_VM (another -O - compile). Uninitialized variable. - * code/unix/Makefile: -O for uninit on patched code. Also shortcuts. - TODO: DC_ONLY seems an obsolete flag, used in Makefiles, not source. - - * TEST: +set sv_pure 0 +set vm_game 1 +set vm_cgame 1 +set vm_ui 0 - Turns out that the pak0.pk3 UI QVM code is seemingly broken in TA - and Q3, but my UI DLL is not. In reverse, the QVM game/cgame for - Q3 seems to work quite well (including bots). The TA game/cgame - also works, including botlib init. - TODO: BotLib Init using game DLL gives: - TODO: Error: file weapons.c, line 38: unknown structure field number - TODO: Fatal: couldn't load the weapon config - TODO: Error: BotLoadMap: bot library used before being setup - - * TEST: checked the rc4winstlr.zip CD tree against - my test install. baseq3/pak4.pl3 and missionpack/pak0.pk3 - are identical, but I finally recognized that there was - a missionpack/pak1.pk3 not in the final install - left over - from an earlier update from id. Doesn't seem to affect the - DLL based runs at all. - Note: I still do not have the final CD snapshot Robert - promised me mid last week, they haven't even fixed the - FTP account they took down. Communication with id is as - abyssmal as ever. - -2000-12-08 Bernd Kreimeier - - * TEST: running with RC4 data files. - TODO: "bot library used before setup" (Q3+TA) - TODO: Q3 old mods wreak havoc (graceful bounce) - TODO: supress "FreeType code not available" in renderer - TODO: can't move in Q3 - TODO: items flicker in Q3 - TODO: no decals in Q3 - TODO: VM UI code still broken (Q3+TA) - TODO: sound code is awful - TODO: video playback inferior to earlier builds - - * code/q3_ui/ui_local.h: prototype trap_VerifyCDKey(..) - * code/game/g_active.c ( StuckInOtherClient): TA only. - * code/cgame/cg_draw.c: 4x unbalanced `#endif' - from patch? - * code/null/null_client.c (CL_CDKeyValidate): dummy added. - * code/qcommon/common.c: Q_acos missing, changed conditionals - - * code/qcommon/vm_x86.c: unreacheable _asm instruction that - gcc doesn't quite like... #if 0'ed for now - TODO: understand _asm { mov eax,[ebx] }, fix it for gcc - - * TEST: compile... - - * code/ui/ui_main.c: full REJECT. Manual merge. - Note: preserved debug_protocol lines, who knows what it's good for. - - * code/qcommon/files.c: REJECT. SafeMode, demo server FS_Restart. - - * code/client/snd_mem.c: REJECT: $SOS$. - * code/client/snd_dma.c: REJECT: $SOS$. - * code/client/cl_cin.c: REJECT. com_timescale, $SOS$. - - * code/cgame/cg_draw.c: REJECT. Lots, but virtually all either - float postfix (on some, not all places), or #ifndef MISSIONPACK - that I had already put in during -Werror (conditional unused). - - * code/cgame/cg_consolecmds.c: REJECT. id commented unused code - that I had #if 0'ed earlier. - - * code/game/: three REJECT for $SOS$. - * code/botlib/: lots REJECT for $SOS$. - - * Patch: patching up from demo source. - ln -s sos001204-rc4 work - diff -urbB sos001122-demo/ work > work.diff - ln -s cvs-1.27b/ work - patch -p0 < work.diff > work.patch - find cvs1.27b/ -name '*.rej' -print - - * CVS: going to check in this snapshot and tag it as - cvs tag id1-27b-loki001208-demo - Then patching up to RC4, as of sos001204-rc4 (no changes since, - should be equivalent to SOS tag "1.27g RC4" (raduffy), i.e. master. - - * TEST: installed demota/ from Win32 distribution. Binary - fails claiming "Corrupted pak0.pk3". Abandoned. - Note: a Linux demo for Q3TA has no priority. Most important is - the Q3A point release in time for Q3TA hitting shelves, followed - by testing for Q3TA. The source is in CVS and tagged (see above) - in case a demo matching the released files has to be provided - later. - - -2000-12-07 Bernd Kreimeier - - * TEST: compile and link - succeeds. - - * code/ui/ui_main.c: UI_StopServerRefresh now uaws. - New unused variables. - - * code/unix/unix_main.c: added Sys_LowPhysicalMemory() stub. - TODO: write Linux equivalent to GlobalMemoryStatus. - - * code/qcommon/common.c: Com_Memset/Com_Memcpy. Neither assembly - nor C versions included if not on Win32 i386. - TODO: using/porting assembly? - - * code/qcommon/files.c: unused variable. - TODO: fs_scrambledProductId unused if 0 for now. - Note: -DFS_MISSING for id's pak cleanup, not used. - - * TEST: compile and link - fails. - - * code/macosx/Client/Makefile.postamble: empty ORIG. - * code/macosx/Client/Makefile.preamble: ORIG. $(BOTLIB_OBJS) added. - - * code/server/sv_client.c: ORIG. Com_Memset. - * code/renderer/tr_shader.c: ORIG. Com_Memset, CIN_Shader. - * code/qcommon/vm_x86.c: ORIG. Com_Memcpy. - * code/qcommon/unzip.c: REJECT. Com_Memcpy, $SOS$. - * code/qcommon/qcommon.h: ORIG. PROTOCOL 47, plus Sys_LowPhysicalMemory. - * code/qcommon/md4.c: Com_Memset,Com_Memcpy (ORIG). - * code/qcommon/files.c (Sys_ConcatenateFileList): REJECT. - Our additons threw it off, plus $SOS$. - * code/qcommon/common.c: they fixed same unused variables (REJECT). - - * code/ui/ui_shared.c: additions (ORIG). - * code/ui/ui_gameinfo.c: COM_Compress added (ORIG). - * code/ui/ui_atoms.c: print statements removed (ORIG). - * code/ui/ui_main.c (UI_DoServerRefresh): REJECT on comment edit... - - * code/game/g_cmds.c (Cmd_VoiceTaunt_f): logic changed heavily. ORIG. - * code/game/q_shared.h: Q3_VERSION "Q3 Team Arena Demo 1.27b" - plus Com_Memset, Com_Memcpy, CIN_shader, COM_Compress. - * code/game/g_main.c: Cvar change only - * code/game/ai_dmq3.c: $SOS$. - - * code/client/snd_mix.c: Com_Memset - * code/client/client.h: additions (ORIG). - * code/client/snd_mem.c: see below. - * code/client/snd_dma.c: $SOS$ (CVS keyword). - - * code/client/cl_cin.c: they removed unused (REJECT). - * code/cgame/cg_servercmds.c: ORIG. compress, noTaunt etc. - * code/cgame/cg_main.c: ORIG. Conditonal branch, COM_Compress. - * code/cgame/cg_consolecmds.c: ORIG. Cvar values changed. - * code/cgame/cg_draw.c (CG_DrawTeamBackground): ORIG. - no reject but *.orig file created. I just mark spots were - code changed after verifying the patch succeeded. - - * code/cgame/cg_event.c: fixed reject (REJECT). - * code/botlib/: all *.rej here due to SOS/CVS $Keyword$. - TODO: preserve SOS comments/rev history somehow. - - * Patch: patching up to demo source. - ln -s sos001122-demo work - diff -urbB sos001119/ work > work.diff - ln -s cvs-1.26/ work - patch -p0 < work.diff > work.patch - find cvs1.26/ -name '*.rej' -print - - * CVS: going to check in this snapshot and tag it as - cvs tag id1-26w-loki001207 - to prepare for upgrading to RC4. I have already made - many more changes than I wanted to w/o getting any - closer to pinpointing the problem, I might as well - patch up to id's more current sources. - - * code/botlib/be_interface.c: initialize by memset. Turns - out that this fails in Export_BotLibSetup on BotSetupWeaponAI - loading "weapons.c" (from the pak, presumably) with an unknown - structure field number. Mismatch of datafiles vs. source again. - - TODO: id replaced memsets in later source. - TODO: have memsets on all exports and imports. - - * SOS: RC4 source should be tagged "1.27g RC4" (raduffy). - Unfortunately the Linux client doesn't care a bit. Show - History does work if from/to date differ by at least a - day, and it shows the tag on code/ (only that subtree), - but recursive get aborts halfway. - Manual: http://www.sourcegear.com/SOS/Doc/ - -2000-12-06 Bernd Kreimeier - - * TEST: accepting missing shaders now. No bots, but I can - actually enter the game and play (more than can be said for - classic Q3 right now). - TODO: Error: BotStartFrame: bot library used before being setup - - * code/renderer/tr_shader.c: took out assertion for now... - * TEST: now missiopack/cgame loads - TODO: tr_shader.c:2275: R_FindShaderByName: failed - TODO: searches ui/assets/3_cursor2.TGA, has ui/assets/3_cursor3.tga - - * code/unix/Makefile (MPCGOBJ): ui_shared.o (duh). - DONE: /cgamei386.so: undefined symbol: PC_Float_Parse - - * code/botlib/be_ai_goal.c: initialize campspots etc. This - might or might not fix this one (didn't get back to gdb due - to mouse-only navigation). - DONE: 0x80d1d5b in BotFreeInfoEntities () at be_ai_goal.c:447 - - * TEST: this time with missionpack/cgame loading... noy - TODO: TA menu blocked after end of intro movie - TODO: console in_mouse 1 doesn't grap pointer even on vid_start? - - * code/cgame/cg_newdraw.c: -Werror. - * code/unix/Makefile (MPCGOBJ): cg_newdraw.o was missing (duh). - DONE: missionpack/cgamei386.so: undefined symbol: CG_OwnerDrawVisible" - - * code/ui/ui_shared.c:1309 assign after bail on NULL. - DONE: segfault in Item_SetFocus (item=0x0, x=0, y=0) - - * TEST: new set of DLL's (this time hopefully correct). - All baseq3/ DLL's load, as does the missionpack/ UI DLL. - The menus now work in both (TA seems mouse-only on everything - but "Quit"). Segfault on delayed TA "Quit" (stack fubared): - #5 0x809fc28 in VM_Call (vm=0x88408a0, callnum=3) at ..//qcommon/vm.c:617 - #6 0x805aafc in CL_KeyEvent (key=9, down=qtrue, time=128644) cl_keys.c:1194 - TODO: TA menu's w/o mouse? - TODO: Win32 goes submenus but does not unfold - TODO: Linux does not go submenus - - * code/ui/ui_main.c: see below. - TODO: LCC gets fits - operands of = have illegal types - TODO: 'pointer to const unsigned char' and 'pointer to const char' - * code/ui/ui_shared.c: see below. - * code/ui/ui_gameinfo.c: see below. - * code/ui/ui_atoms.c: see below. - * code/game/g_bot.c: more cruft. - * code/cgame/cg_draw.c: loads of functions modified for - MISSIONPACK that aren't used at all for MISSIONPACK anymore. - Development relics. - - * code/cgame/cg_consolecmds.c: -Werror. - Note: due to Makefile error never ever compiled... - - * code/unix/Makefile: fixed various dependency errors - for game and ui library. - TODO: create a new Makefile with patsubst and rules. - TODO: why C_ONLY in the i386 dedicated server? - - * code/unix/unix_main.c: use dlerror() excessively. - Littered more unused DLL related functions with assert(0). - TODO: clean up Sys_Load/UnloadDll (a real mess) - TODO: remove Zoid code cruft (unused per-DLL functions) - - * code/game/bg_misc.c: changed G_Printf for Com_Printf. - This was undefined in baseq3/uii386.so preventing loading. - - * TEST: +set sv_pure 0 +set vm_game 0 +set vm_cgame 0 +set vm_ui 0 - Note: so far I used only the game DLL.. duh. - UI DLL fails to load: missing G_Printf. - - * code/unix/Makefile: -DMALLOC_CHECK in addition to - the -DZONE_DEBUG I have used since switching to calloc. - Using MALLOC_CHECK=1 for now, might use 2 if something - comes up. - - * code/renderer/tr_init.c (GL_SetDefaultState): it does get - called, but does not show up in the log. - - * TEST: tried executing a script - get bounced. - TODO: is there any way to jump into a map? - TODO: cl_cinematics 0 (supress all fullscreen RoQ) - Next: used r_logfile 200 in Win32 (RC4) and Linux. - There is a buckload of setup code seemingly not done - at all in Linux? Either that, or logging is enabled - with a delay in Linux. - - * code/unix/linux_glimp.c: fixed autorepeat (H2/Fakk2 way). - -2000-12-05 Bernd Kreimeier - - * code/renderer/tr_mesh.c: added assert there. - * TEST: menus and in-game drawing are just as they were with - the initial SOS001119 port. In addition: - R_AddMD3Surfaces: no such frame 0 to -2147483477 - for 'models/players/xaero/upper.md3' - R_AddMD3Surfaces: no such frame -2147483477 to 171 - R_AddMD3Surfaces: no such frame 171 to -2147483498 - ad nauseam (used as my player model). - Triggered: haveing a trRefEntity_t *) 0x41dbbd00 with - frame = -2147483477. Might be a red herring (PRINT_DEVELOPER), - ignore for now. - - * code/ui/ui_main.c: missing return. - * code/ui/ui_shared.c: excess byte in initializer (which gcc - did not caught, but LCC did). Also LCC complains about - missing returns, but gcc doesn't (neither says unreacheable - code though). If necessary (MsVC?) guard with Q3_VM. - - * code/q3_ui/ui_ingame.c: see below. - * code/q3_ui/ui_atoms.c: voidfunc_f. LCC warns about conversion - from `pointer to void' to `pointer to void function(void)' - being compiler dependent. Casting NULL. Guess what, doesn't fix - it either. - TODO: do not use these cursed scripts to generate VM code, - we do not have proper rules for LCC/q3asm, thus the files never - get updated. - - * code/unix/Makefile: for paranoia's sake recreated the 1.17 - compile for the UI DLL (where only q_shared/math were actually - compiled as DO_SHLIB_CC. - Later: switched to different gcc. - - * STATIC: remaining problems are vmMain (same entry point for all - DLL's), could use cgMain, uiMain and gMain here for HARD_LINKED. - Note: I don't think id has used this in ages. - Plus all the collisions in *_syscalls.c, which simply can't be - fixed cheaply. None is the superset of 2 others, neither seems - w/o overlap to others. Full stop. - - * code/botlib/be_aas_move.c: see below. - * code/game/ai_dmq3.c: VEC_UP/DOWN, MOVEDIR_UP/DOWN now static. - See also game/g_utils.c for existing static duplicates. - - * code/game/q_shared.h: #define stricmp strcasecmp - * code/unix/Makefile: no mo' -Dstricmp=strcasecmp, see q_shared.h - Also: no mo' -I/usr/include/glide, no FX - TODO: are we building against system GL headers? ../Mesa/? - - * code/q3_ui/ui_atoms.c: comment on duplication - * code/cgame/cg_drawtools.c: use UI/CGAME_HARD_LINKED on UI duplicates - TODO: does this UI_ code in cg_drawtools/ui_atoms belong into ui_shared? - - * code/unix/Makefile: use -DQ3_STATIC - * code/game/q_shared.h (*_HARD_LINKED): trigger on Q3_STATIC - Later: collision between UI and CGAME is still there. This fixed - the Com_Error, Com_Printf issues though - - * code/unix/Makefile ($(B)/q3static/ai_vcmd.o): this file was - missing, hence undefined symbol. - ($(B)/baseq3/game/ai_vcmd.o): same here. - ($(B)/missionpack/game/ai_vcmd.o): same here. - - * STATIC: cg_syscalls.c, g_syscalls.c and ui_syscalls.c alias. - Multiply defined symbols: - Com_Error, Com_Printf - VEC_UP, VEC_DOWN - MOVEDIR_UP, MOVEDIR_DOWN - vmMain - dllEntry - PASSFLOAT - trap_Error - trap_Milliseconds - trap_Argc - trap_Argv - trap_FS_FOpenFile - trap_FS_Read - trap_FS_Write - trap_FS_FCloseFile - trap_FS_GetFileList - trap_R_RegisterModel - trap_R_RegisterSkin - trap_R_RegisterFont - trap_R_RegisterShaderNoMip - trap_R_ClearScene - trap_R_AddRefEntityToScene - trap_R_AddPolyToScene - trap_R_AddLightToScene - trap_R_RenderScene - trap_R_SetColor - trap_R_DrawStretchPic - trap_R_ModelBounds - trap_UpdateScree - trap_S_StartLocalSound - trap_S_RegisterSound - trap_Key_IsDown - trap_Key_GetCatcher - trap_Key_SetCatcher - trap_GetGlconfig - trap_PC_AddGlobalDefine - trap_PC_LoadSource - trap_PC_FreeSource - trap_PC_FreeSource - trap_PC_ReadToken - trap_PC_SourceFileAndLine - trap_S_StopBackgroundTrack - trap_S_StartBackgroundTrack - trap_RealTime - trap_CIN_PlayCinematic - trap_CIN_StopCinematic - trap_CIN_RunCinematic - trap_CIN_DrawCinematic - trap_CIN_SetExtents - trap_MemoryRemaining - trap_SendConsoleCommand - trap_Cvar_Register - trap_Cvar_Update - trap_Cvar_Set - trap_Cvar_VariableValue - trap_Cvar_VariableStringBuffer - trap_RealTime - trap_SnapVector // used in game/bg_*.c, needs conditional - More aliasing between ui_atoms.c and cg_drawtools.c: - UI_DrawBannerString - UI_ProportionalStringWidth - UI_ProportionalSizeScale - Undefined symbol: ai_team.o: In function `FindHumanTeamLeader': - ai_team.c:1899: undefined reference to `BotVoiceChat_Defend' - Note: - - * code/game/g_main.c: unused. - * code/game/g_arenas.c: unused. - * code/game/ai_team.c: init. - * code/game/ai_dmnet.c: /* in comment (odd). - Note: why do these come up now but not earlier? - TODO: the make dependencies might target wrong files. - - * code/unix/Makefile (TARGETS): added q3static. - Note: this is baseq3/ - - * TEST: +set r_logfile 100. It seems that the addition of - code (add an assertion etc.) changes the behavio of the binary. - The intro cinematics code seems to suffer first - didn't play, - then played, then (another assert added) doesn't play. Watch - out for (missionpack): - UI_CIN_PlayCinematic - SCR_PlayCinematic( mpintro.roq ) - trFMV::play(), playing mpintro.roq - Also fails to exit cleanly: break gives - #0 0x401919ee in __select () - #1 0x400bbcb8 in __DTOR_END__ () - #2 0x4004baa1 in _XSend () - #3 0x452b009f in GLXRenderFlush () - #4 0x804ce0c in _XRead () - #5 0x40680813 in ?? () - Stack is corrupted. - Note: ~/.q3a/gl.log - TODO: write per-frame files (see Heretic2) - TODO: add Heretic2 QGL (more detail) - - * code/unix/linux_qgl.c (QGL_EnableLogging): fixed countdown - (i.e. propagated changes from win32/, see Fakk2). - - * code/unix/linux_glimp.c: fixed QGL_EnableLogging argument - to avoid cast error (always qfalse). - - * code/unix/Makefile (DEBUG_CFLAGS): use ZONE_DEBUG. - - * code/qcommon/common.c: replaced malloc with calloc calls. - - * code/q3_ui/ui_local.h: have to use ui/ui_public.h - * code/cgame/cg_servercmds.c: requires ../ui/menudef.h - - * code/cgame/cg_consolecmds.c: ui/ui_shared.h is unique. - * code/q3_ui/ui_public.h: make sure this won't be compiled. - * code/client/client.h: we have to include ui/ui_public.h. - Note: id is obviously maintaing only the ui/ headers, so the - headers in q3_ui/ are deprecated. - - * code/renderer/tr_shader.c: added assertions (see Ryan's Fakk2 - problems with missing shaders). - - * code/game/g_cmds.c: below. - * code/game/ai_vcmd.c: below. - * code/game/ai_team.c: below. - * code/game/ai_dmnet.c: below. - * code/game/ai_dmq3.c: below. - * code/game/ai_chat.c: below. - * code/game/ai_cmd.c: ../../ui/menudef.h (new Q3TA script directory). - - * code/cgame/cg_newdraw.c: make sure it won't compile w/o MISSIONPACK. - - * code/cgame/cg_servercmds.c: below. - * code/cgame/cg_event.c: below. - * code/cgame/cg_consolecmds.c: below. - * code/client/keys.h: below. - * code/client/client.h: below. - * code/q3_ui/ui_local.h: include from ../q3_ui/ not ../ui/. - Note: id seems to intentionally use the header from the new ui/. - - * Makefile: checked -I$(UIDIR), there is no such. That means all - files include directly, which means all (including Q3) are using - the new ui/ headers. - -2000-12-04 Bernd Kreimeier - - * RC4: released as 362101115 Dec 4 11:40 TA_Q3A_RC4.zip - - * TEST: the corrupted menu problem is back :-(. Looks like I am in - for a static link next. - - * code/unix/Makefile (clean2): fixed (not all new OBJ covered). - * code/q3_ui/ui_teamorders.c: -Werror. - * code/q3_ui/ui_team.c: -Werror. - * code/q3_ui/ui_qmenu.c (Bitmap_Draw): -Werror. - * code/q3_ui/ui_mods.c (UI_Mods_LoadModsFromFile): unused. -Werror. - * code/q3_ui/ui_controls2.c: -Werror. - * code/q3_ui/ui_atoms.c: -Werror - * code/null/null_client.c: -Werror. - * code/unix/linux_joystick.c: -Werror. - * code/unix/linux_glimp.c: -Werror. - * code/unix/linux_qgl.c: -Werror. - * code/unix/unix_shared.c: -Werror. - * code/unix/unix_net.c: -Werror. - * code/unix/linux_local.h: added missing prototypes. - * code/unix/unix_main.c: -Werror. Includes linux_local.h - * code/jpeg-6/jdmainct.c: see below. - * code/jpeg-6/jcmainct.c: variables called "main" (*moan*) - * code/jpeg-6/jcdctmgr.c (forward_DCT): -Werror. - * code/botlib/l_script.c (PS_ReadLiteral): -Werror - * code/botlib/l_precomp.c (PC_AddBuiltinDefines): -Werror. - * code/botlib/be_interface.c: -Werror. - * code/botlib/be_aas_reach.c: -Werror - * code/botlib/be_aas_cluster.c: -Werror - * code/game/be_aas.h: -Werror. - Note: MrElusive accumulates a lot of code history in nested comments, - which gcc doesn't like at all. #if 0'ed to avoid. - * code/qcommon/vm_interpreted.c: -Werror. - * code/qcommon/unzip.c: -Werror. - * code/cgame/cg_servercmds.c: -Werror. - * code/cgame/cg_main.c: -Werror. - * code/cgame/cg_drawtools.c: -Werror. - * code/game/bg_misc.c: -Werror. - * code/game/be_ai_move.h (bot_avoidspot_s): added. - * code/botlib/be_ai_move.c: removed typedef struct bot_avoidspot_s - * code/client/snd_mix.c: -Werror. - * code/qcommon/md4.c: -Werror. - * code/qcommon/common.c: -Werror. - * code/client/cl_keys.c: -Werror. - * code/client/cl_cin.c: -Werror, init local variables. - * code/unix/Makefile: -Werror. need -O for -Wall for uninitialized - Note: the above is the list of files that got touched during a pass - with -g -O -Werror -Wall flags (in the hope of finding uninitialized - memory and ambiguous statements). Most of the above are simply - unused variables (or even code). - - TEST: RC3 data files, but DLL's. - TODO: TA gets stuck in initial sound, doesn't play cinematics (sometimes) - TODO: Q3 intro movie looses sound after Sarge gets teleported - TODO: Q3 ingame renders world, weapon, muzzleflash, hud, can shoot, - TODO: but no movement, hud background is fubared. - - * code/cgame/cg_main.c: cg_singlePlayerActive - - * code/q3_ui/ui_login.c: doesn't seem to be used? - * code/game/g_rankings.c (G_RankRunFrame): doesn't seem to be used. - * code/q3_ui/ui.sh: disabled this. - * code/q3_ui/q3_ui.sh: changed include path to ../q3_ui/ (duh). - - * code/game/game.sh: changed include path to ../q3_ui/ which - is not in the Win32 batch file. - * code/cgame/cg_rankings.c: this does not seem to be included. - * code/cgame/cgame_ta.sh: added -DCGAME. Also added cg_syscalls.c - to build (also missing in Win32). - - * code/cgame/cgame.sh: added -DCGAME (see cgame.bat). Also - changed include path to ../q3_ui/ which is not in the Win32 - batch file. Also added cg_syscalls.c to build (missing in - Win32). - -2000-12-01 Bernd Kreimeier - - * RC3: released as of sos001201 / Q3 1.27f - - * code/unix/Makefile: more fixes with clean build. The - changes made fix the menu rendering for Q3 but not TA. - Ingame graphics still broken. - - * code/game/game_ta.sh: created. Use game_ta.q3asm here. - * code/game/game.sh: no -DMISSIONPACK - * code/game/game_ta.q3asm: CR/LF, /. - - * code/cgame/cgame_ta.sh: created. Use cgame_ta.q3asm here. - * code/cgame/cgame.sh: no -DMISSIONPACK. No cg_newdraw, ui_shared. - * code/cgame/cgame.q3asm: No cg_newdraw, ui_shared. - CR/LF, /, cg_newDraw, and the output path/name. - - * code/q3_ui/q3_ui.q3asm: output to ui not q3_ui... - - * code/cgame/cg_event.c: cg_singlePlayerActive used here. - TODO: guard by MISSIONPACK - * code/cgame/cg_local.h: named q3print_t enum. Cvar - cg_singlePlayerActive for both Q3 and TA. - - - * code/unix/Makefile: cleanly separate B/baseq3/ and - B/missionpack/ subtrees during build. While new and old - UI are in separate directories, the cgame/ and game/ - are shared, with conditional -DMISSIONPACK compile - and different files includeds (cd_draw, cg_newdraw). - That means twice the number of targets (3 DLL's, 3 QVM's, - times two), and different build rules. - TODO: carefully check Win32 build for (other) conditionals - TODO: carefully check Win32 build for link lists - - * CVS: ui/, code/ui, botfiles/ and subdirectories are added. - The code/macosx/ directory turned out to be a real pain that - had to be edited manually, throwing out CVS/ directories in - the tree that had been created by SOS as they are in id's - repository: - code/macosx/Client/CVS - code/macosx/Client/PBUserInfo/CVS - code/macosx/Client/Quake3.nib/CVS - code/macosx/Common/CVS - code/macosx/DedicatedServer/CVS - code/macosx/DedicatedServer/PBUserInfo/CVS - Now tagged - cvs tag id1-26y-loki001119 - TODO: there are several new files not yet linked? - - * ChangeLog: merged the Changelog from the bk00119 working - branch (initial Q3TA port) based on sos001119 snapshot. Also - merged the source tree with cvs-1.17. - In the ChangeLog below *** MISSIONPACK *** indicates work - that was done on the branch (code-sos/ prefix in files). - The cvs update of this will be tagged with - cvs tag id1-26y-loki001119 - Use this tag to hunt for possible Linux fixes that got lost - (i.e. got dropped by id since id000516 and were thus not in - sos001119, but did not show in diff id000516 cvs1-17). - New directories in CVS: botfiles/, ui/. - Missing from SOS/Missionpack: SDK directories. - common, lcc, libs, q3asm, q3data, q3map, q3radiant. - - - * ssreport.txt: below. - Note: watch for files called "ssreport.txt", that's id ChangeLog. - * ui/ui_syscalls.asm: below. - * q3_ui/ui_syscalls.asm: below. - * game/g_syscalls.asm: below. - * cgame/cg_syscalls.asm: below. - * bspc/linux-i386.mak: below. - * bspc/lcc.mak: below. - * botlib/linux-i386.mak: below. - * botlib/lcc.mak: below. - * A3D/a3d_console_variables.txt: CR/LF issue (minimize diffs). - - * CVS: the checked bk001119 work copy of the sos001119 initial - checkout (completed with everything in the SOS "Missionpack" - tree, i.e. botfiles/ and botfiles.* added), copied over the - cvs-1.17 checkout. - Note: in these cases, BEWARE ui -> q3_ui/ links, and different - ChangeLogs. Also "make clean" helps. - - * unix/unix_net.c: below. - * unix/unix_main.c: below. - * unix/matha.s: below. - * unix/linux_qgl.c: below. - * unix/linux_glimp.c: see also linux_joystick.c. - * server/sv_client.c: below. - * renderer/tr_surface.c: below. - * renderer/qgl.h: below. - * qcommon/qcommon.h: below. - * qcommon/files.c: below. - * qcommon/common.c: below. - * q3_ui/ui_demo2.c: below. - * mac/mac_net.c: below. - * mac/mac_glimp2.c: below. - * game/surfaceflags.h: below. - * game/bg_lib.c: checked against id00516/cvs-1.17a diff. - * bspc/bspc.c: TH_AASToTetrahedrons call removed since id000516. - Note: our final compare of id000516 against cvs-1.17a, making sure - that all these differences are in bk001119 (initial Q3TA port). - If id branched the Q3TA base off before id000516 we might be screwed. - Note: I do not diff against bk000520, which had some minor changes - against id000516 (check VectorArrayNormalize, OTConfiguration), which - seem consistent with me taking a pre-id000516 source snapshot for that - working branch. - -2000-11-30 Bernd Kreimeier - - * TEST: compiled using the symbolic link ui/ -> q3_ui/. - Had to undo one CVS change, regarding - code/cgame/cg_syscalls.asm - code/game/g_syscalls.asm - code/q3_ui/ui_syscalls.asm - These files are neither generated by Win32 cgame.bat - nor cgame.sh (etc.), thus seemingly maintained by hand. - cvs tag pr1-17-loki001130b - should be used if somebody needs this 1.17 snapshot - (which, remember, is post-release, with additional fixes). - Later: - cvs tag pr1-17-loki001130c - includes the full ChangeLog (duh). - - * CVS: up until cvs-1.17-001130, code/ui/ contained the - Q3 code for the UI QVM/DLL. In Q3TA, this code has been - moved to code/q3_ui/, while at the same time the new - (scripting driven) UI code for Q3TA was maintained in - code/ui/. To preserve the history of code/ui/, it has been - renamed to q3/ui/ in the CVSROOT. - Note: this will BREAK all cvs-1.17 and before checkouts. - To compile earlier versions, move or link q3_ui/ to ui/. - The code has been tagged - cvs tag pr1-17-loki001130 - after the change. - DONE: remove code/*/vm/*.asm from CVSROOT - Note: this includes code/*/*.asm files (from *_syscalls.c). - These were originally tracked in CVS, but if we need - comparison of q3asm output or QVM files we can rely - on the Win32 and Linux SDK now. These files have been - physically removed from CVS now, followed by - cvs tag pr1-17-loki001130a - -2000-11-30 Bernd Kreimeier *** MISSIONPACK *** - - * RC2: new ZIP file (another 360M for convenience). - - * SOS: new CVS module, Quake3_sos. This will be used to track - the unchanged SOS checkouts from id. As their repository - is read-only, and there is no estimate on when changes might - be backpropagated there, I will track their changes in a - separate module, and update our local Quake3 module - accordingly. This is effectively "tracking 3rd party" - w/o import and half-automated, forced mergers - in other - words, we now branch starting with our post-1.17 changes, - for the benefit of moving at all. - Baseline is a slightly changed PR-1.17 id000516 source dump - (essentially ui/ moved to q3_ui for continuity, and CR/LF etc.). - cvs import Quake3_sos id000516 pr1-17-win32 - cvs import Quake3_sos sos001119 pr1-26-win32 - cvs import Quake3_sos sos001120 pr1-26-win32-001120 - cvs import Quake3_sos sos001121 pr1-26-win32-001121 - cvs import Quake3_sos sos001122 pr1-26-win32-001122 - cvs import Quake3_sos sos001122-demo pr1-26-win32-demo - This is about the 1.26w Team Arena Win32 demo release, give or - take a couple of lines. Has Q3_VERSION "Q3 Team Arena Demo 1.27b". - cvs import Quake3_sos sos001123 pr1-26-win32-001123 - cvs import Quake3_sos sos001126 pr1-26-win32-001126 - Now track id versions (see code/game/q_shared.h:Q3_VERSION) - cvs import Quake3_sos sos001128 pr1-27c-win32-001128 - With 1.27d they switched from Demo to full version (RC1). - cvs import Quake3_sos sos001129 pr1-27d-win32-001129 - cvs import Quake3_sos sos001130a pr1-27d-win32-001130a - Now switched to 1.27e. This import is done from the SOS - working directory. - cvs import Quake3_sos sos001130b pr1-27e-win32-001130b - Note: SoS created rwx attributes which are luckily fixed - automagically during import. It is also seemingly incapable - to compare files, and leave files that have not changed the - hell alone. I can't do cvs update due to the $..$ tags in - the original files (which CVS can't be told to ignore), - so I have to do import (creating a load of vendor tagged - branches), but at least cvsweb and cvs get the revisions - right. - - * code-sos/unix/Makefile: added linux_joystick - * code-sos/unix/linux_local.h: match mac/ and win32/, for prototypes. - - * code-sos/unix/linux_joystick.c: new file, code from linux_glimp.c - Note: decided to separate this, as (a) we might edit/extend - a lot, (b), it's not in the id tree, (c) it's not GL, (d) - there might be even more oddball devices. Anything that - cuts down on diffs. - - * code-sos/unix/linux_glimp.c (Q_stristr): const return (cvs1.17). - Also (XLateKey): added more keyboard mappings (ASCII on - upper row digits) (cvs1.17). Added in the minimal joystick - hooks (cvars, function calls). Fixed joystick cvar naming - to match win32 (kept joystick_threshold). - TODO: joystick stubs for dedicated? - - * CVS: I have to move up to 1.27d (data, Win32 networking). - With exception of linux_glimp.c (mostly joystick code), - all cvs1.17 changes should now be in the work snapshot - based on the first sos001119 we got from id. There are - also some additional changes in there already, thus I'll - move the (buggy) 1.26 snapshot into CVS before adding even - more differences. - - -2000-11-29 Bernd Kreimeier *** MISSIONPACK *** - - * RC1: TeamArena_Q3A_RC1.zip. Source has moved from - Q3VERSION "Q3 Team Arena Demo 1.27c" to "Q3 1.27d" now. - - * code-sos/qcommon/common.c: added Com_InitPushEvent(). Also - increased MAX_PUSHED_EVENTS to 256. - Note: this is another case of buffer memory not zero'ed. - Com_EventLoop, fixed evTime to evType in debug print. - - * TEST: baseq3/ - +set sv_pure 0 +set vm_game 0 +set in_mouse 0 +set developer 2 - TODO: Team Arena in menu leads to RE_Shutdown(1) and locks - TODO: can't play game - TODO: shaders can't load *.tga, *.jpg files are there - TODO: DO_CC linking for DLL's, DO_SHLIB_CC only for export? - TODO: ERROR: Bad player movement angle - TODO: Warning: cvar "..." given initial values: "..." and "..." - TODO: TA demo ERROR: CL_ParseServerMessage: Illegible server message - TODO: WARNING: Com_PushEvent overflow - - * code-sos/qcommon/files.c: add NULL filter for our Sys_ListFiles calls. - * unix/unix_shared.c (Sys_ListFiles): signature has changed, - additional Sys_ListFiles argument now. - - * code-sos/unix/unix_net.c (Sys_GetPacket): see below (readcount=0). - * code-sos/unix/unix_main.c: see below (Mike's and my changes to DLL - loading, my event buffer clear fixes). - * code-sos/unix/linux_qgl.c (QGL_Init): see below (__FX__ guards). - TODO: abstract WGL/GLX and end unfortunate QGL duplication. - TODO: spice up QGL with Linux H2 full version. - * code-sos/q3_ui/ui_demo2.c: fix on demo names - no Q_strupr(demoname). - Note: in CVS this fix is in ui/ui_demo2.c. CVS is screwed by - id choosing the old name for new directory... - TODO: manual intervention on "ui goes q3_ui" in CVSROOT? - * renderer/qgl.h: see below (__FX__ guards). - * qcommon/files.c: migrated in the 1.17cvs changes against the - id000516 code dump, i.e. the (not marked - boo hiss) mkv changes. - Note: all the above is based on a diff of the last id code dump - pre-1.17 against our CVS, with those fixes now migrated into the - sos1.26 snapshot. - TODO: move in joystick code. - TODO: replace XAutoRepeatOn/Off with filter (focus). - TODO: DGA 2.0 and such. - - * code-sos/game/q_shared.c: valid compare for NULL strings - * code-sos/unix/unix_main.c: QRTLD, and now using RTLD_NOW. - Note: it is a bad idea to load game DLL's that are missing symbols. - - * code-sos/ui/ui_main.c: see below. - * code-sos/game/g_main.c: see below. - * code-sos/q3_ui/ui_main.c: see below. - * code-sos/cgame/cg_main.c: made cvarTable and cvarTableSize static. This resolved - a segfault related to traversing the UI table during Init. - Note: there is a segfault related to this variable being out of bounds. - Different struct size in global variables possible aliasing between the - DLL's. - - * code-sos/unix/unix_main.c (Sys_Error): assert(0), no exit in debug. - * code-sos/game/q_shared.c: now aborts on NULL destination. Also DPrintf's - on bogus excess copies. - TODO: make all those string functions safe, at least assert. - * code-sos/server/sv_init.c: comment in SV_Init - // init the botlib here because we need the pre-compiler in the UI - Called in qcommon/common.c:Com_Init, were CL_Init is called afterwards... - * code-sos/server/sv_bot.c: the botlib_import is filled here. - * code-sos/unix/unix_main.c (Sys_GetBotLibAPI): RTLD_NOW. Which is for naught, - as this code is not used and has never been used. assert(0) - - * code-sos/botlib/be_interface.c: botimport supposed to be set here. - * code-sos/botlib/l_memory.c: segfault with q3_ui/ DLL. - #1 0x80e23ec in GetMemory (size=35) at ..//botlib/l_memory.c:331 - 331 ptr = botimport.GetMemory(size + sizeof(unsigned long int)); - as botimport is completely NULL'ed. - - * code-sos/q3_ui/q3_ui.sh: created from ui/ui.sh 1.17 - - * code-sos/q3_ui/q3_ui.q3asm: unfubared (CR/LF, / path). - - * code-sos/unix/Makefile: added q3_ui/ make targets (basically - ui/ targets from CVS 1.17 Makefile for starters). - - * code-sos/q3_ui/: this is the old UI code, which does not use - ../ui/menus.txt (see ui/ui_main.c). In other words, - the code in ui/ now has to be compiled or qvm'ed - for missionpack/, but to create the necessary DLL or - QVM modules for baseq3/ we need to use q3_ui/. - - -2000-11-27 Bernd Kreimeier *** MISSIONPACK *** - - * code-sos/game/bg_lib.c: ld problem with a custom "tan(..)" - TODO: loooking forward to SIGFPE on this code base. - - * code-sos/ui/ui_util.c: this file is empty. - - * code-sos/ui/ui.sh: new files: - ui_shared.c - ui_util.c - Replaced by the /ui/*.menu files: - q3lcc: can't find `../ui_cdkey.c' - q3lcc: can't find `../ui_ingame.c' - etc. - - * code-sos/cgame/cgame.q3asm: added cg_newdraw entry. - Also added ui_shared entry. - * cgame/cgame.sh: added cg_newdraw.c entry. - Also added ../ui/ui_shared.c entry. - - * code-sos/cgame/cg_newdraw.c: renamed (was cg_newDraw.c mixed case). - Note: the infidels have taken over. - - * cgame/cgame.sh: added -DMISSIONPACK. - Note: w/o, q3lcc complains - ../cg_event.c:204: undeclared identifier `cg_singlePlayerActive' - ../cg_event.c:204: left operand of . has incompatible type `int' - which indicates that this source does not compile w/o MISSIONPACK - anymore. The baseq3/pak4.pk3 file in the Q3TA snapshot archives - are dated - 284464 11-10-00 14:02 vm/cgame.qvm - 463940 11-14-00 14:47 vm/qagame.qvm - 271596 11-14-00 14:48 vm/ui.qvm - the code dump is from 11-19. - Note: Make does not abort on q3lcc complains - - * code-sos/game/game.sh: also added ai_vcmd.c entry. - - * code-sos/ui/ui.q3asm: fubared (below). In addition, this is - the only one to have a - -o "/tmp/quake3/missionpack/vm/ui" - line in it. Given that the other 2 QVM modules are - also dependend on -DMISSIONPACK, this seems a real mess. - For now using the same path as the other 3. - * code-sos/cgame/cgame.q3asm: below. - * code-sos/game/game.q3asm: fubared. Fixed CR/LF and \ in paths - again (read by q3asm called by game.sh called by make). - * unix/Makefile: updated fpor DLL/QVM. - Note: also shell scripts to use q3lcc not lcc. - - -2000-11-27 Bernd Kreimeier - - * code/unix/Makefile: now expects a run/ directory - relative (between this, the Loki standards, and the - utility code in the same repository, it's ever so - slightly less dorky). - TODO: fix broken copyfiles target etc.pp. - - * code/game/bg_lib.c: turns out the changes I - undid 001120 were affecting original Zoid - Linux port related defines, which break VM - compile. Mike fixed those (which I unfixed - when referring to the latest id code that does - not contain these patches). However, they - duplicate ANSI libc symbols, so the guards might - be wrong. The symbols are missing when compiling - for VM, so I now use the existing lcc -DQ3_VM - flag: - //#if !defined ( _MSC_VER ) && ! defined ( __linux__ ) - #if defined ( Q3_VM ) - This will break DLL compile on non-ANSI platforms, - which will have to be added to the conditional then. - - * code/ui/ui.sh: below. - * code/game/game.sh: below. - * code/cgame/cgame.sh: Linux SDK installs q3lcc to - avoid collisions with regular lcc pre-installs. The - scripts fail with "lcc not found", but do not abort - the Makefile. - Note: now that VM code gets actually built, there - are errors: - g_main:648 ERROR: symbol vsprintf undefined - bg_pmove:1221 ERROR: symbol abs undefined - q_math:4309 ERROR: symbol fabs undefined - q_shared:2801 ERROR: symbol tolower undefined - q_shared:2862 ERROR: symbol toupper undefined - ai_dmq3:208 ERROR: symbol atoi undefined - ai_cmd:4951 ERROR: symbol sscanf undefined - - -2000-11-20 Bernd Kreimeier - - * TEST: test compile of pr-1.17+cvs fixes segfaults due - to new baseq3/pak4.pk3 - Note: to self ... 1.17 is not compatible with new files. - Checking into CVS next. - - * code/: changes applied by us that are not in id's code base - affect q_shared.c (NULL in Q_stricmp), files.c (FIXME fs_cdpath, - Sys_ConcatenateFileList, ui_demo2.c (demo no tolower on linux). - In unix/ linux_glimp.c (joystick code), qgl.h, linux_qgl.c (__FX__), - unix_main.c (dlopen bug and event buffers), unix_net.c (readcount), - matha.s (assembly warning). - - * code/server/sv_client.c (SV_WriteDownloadToClient): - No effective change on FS_SV_FOpenFileRead call, they reworked - autodownload some more seemingly. - - * code/renderer/tr_surface.c: VectorArrayNormalize - - * code/qcommon/qcommon.h: see below. - * code/qcommon/files.c: Com_ReadConfigs removed. - * code/qcommon/common.c: removed Com_ReadConfigs, - textual replacement of body in Com_Init. - - * code/mac/mac_net.c: not applied (undone by id) - OTConfiguration *config <> OTConfigurationRef config - - * code/mac/mac_glimp2.c: r_colorbits->integer > 16 - * code/game/surfaceflags.h (CONTENTS_BOTCLIP): added. - - * code/game/q_shared.h: not applied (undone by id) - #if defined(ppc) || defined(__ppc) || defined(__ppc__) - #define idppc 1 - #else - #define idppc 0 - #endif - - * code/game/q_math.c: added another CPP line to guard - BoxOnPlaneSide, removed WIN32 guard. - TODO: this could be broken code guarded in all current - compiles... - - * code/game/bg_lib.c: left Q#_VM guard for typedef cmp_t - Added !defined( __linux__ ) for tolower and atoi. - Note: the changes above relate to the very last code update - from id prior to the 6 month blackout, which were not in - CVS when Michael made his updates. Needed to establish the - baseline for the new patch. Source dump 1.17.00520, against - SOS 1.26w-001119 version. - -2000-11-20 Bernd Kreimeier *** MISSIONPACK *** - - * TEST: running against the data up to TeamArena_Q3A_001109.zip - Hunk_Clear: reset the hunk ok - Program received signal SIGBUS, Bus error. - "q3dm2", killBots==qtrue - #0 CM_ClearMap () at ..//qcommon/cm_load.c:644 - #1 0x80884a7 in SV_Map_f () at ..//server/sv_ccmds.c:159 - #2 0x8072579 in Cmd_ExecuteString (text=0xbffff4b0 "spmap q3dm2") at ..//qcommon/cmd.c:591 - #3 0x8071dfe in Cbuf_Execute () at ..//qcommon/cmd.c:190 - #4 0x80763f7 in Com_Frame () at ..//qcommon/common.c:2547 - #5 0x8130d6b in main (argc=13, argv=0xbffff984) at ..//unix/unix_main.c:953 - #6 0x40100cb3 in __libc_start_main (main=0x8130bc4
    - Not reproducible (screen stayed black). - - * TEST: +set developer 1, same for Win32 and Linux: - Can't find gfx/misc/flare.tga - Can't find gfx/misc/sun.tga - Can't find gfx/misc/console02.tga - Can't find vm/ui.map - Can't find textures/sfx/logo512.tga - Can't find gfx/colors/black.tga - Can't find models/mapobjects/banner/banner5_2.md3 - Can't find models/mapobjects/banner/banner5_1.md3 - Can't find textures/sfx/firegorre2.tga - Can't find textures/sfx/bolts.tga - Can't find menu/art/unknownmap.tga - - * Q3TA: after nearly 6 months, a code update from id. SOS access - even. Got it to compile, link and start, but its currently broken - (menu doesn't render in full, can't get into game etc.). Need - a baseline 1.17 to diff against. Last code dump was May 16, with - bspc code updated May 19. Checking working directory of bk000520 - against CVS next (Mike's fixes never made it into id's codebase - or a post 1.17 release, neither did my fixes as released in the - point release version 1.17). - -2000-11-19 Bernd Kreimeier *** MISSIONPACK *** - - * TEST: Win32 install as tested with 1.26w. quake3.x86 (Q3A game) - Warning: cvar "r_uifullscreen" given initial values: "1" and "0" - Warning: cvar "r_inGameVideo" given initial values: "1" and "0" - ^3WARNING: sound/feedback/hit.wav is a 8 bit wav file - (on windows, sound/weapons/weapon_hover.wav is missing...) - Menu only partially displayed in TA and baseq3 play, menu itself - seems to work. Freetype? - WARNING: Com_PushEvent overflow - - * code-sos/game/game.sh: not in SOS, moved in from CVS snapshot. - - * code-sos/qcommon/common.c: conditional DEDICATED to get rid off - CL_ShutdownCGame/CL_ShutdownUI/CIN_CloseAllVideos. - Same for UI_usesUniqueCDKey: dedicated server does not - write CD key file. - TODO: check whether there is an unneeded "read CD key" - for dedicated server. - - * code-sos/null/null_client.c (CL_ShutdownAll): added dummy. - - * code-sos/unix/Makefile: server/sv_net_chan.o for dedicated server. - - * code-sos/null/null_snddma.c: fixed S_RegisterSound signature. - - * code-sos/client/snd_mix.c: snd_p, snd_linear_count, snd_out - can't be static, as used by unix/snd_mixa.s. - - * code-sos/unix/Makefile: added to the executable target: - renderer/tr_font.c - client/cl_net_chan.c - server/sv_net_chan.c - Also added a lot of jc*.c files to build, to fix unresolved - symbol errors. - TODO: is there unused jpeg-6/jd*.o code linked in now? - - * code-sos/ft2/smooth.c: includes ftgrays.c, ftsmooth.c - - * code-sos/ft2/truetype.c: ttdriver.c, ttpload.c, ttgload.c, ttobjs.c. - Also (see ftoption.h) TT_CONFIG_OPTION_BYTECODE_INTERPRETER ttinterp.c - - * code-sos/ft2/sfnt.c: includes ttload.c, ttcmap.c, sfobjs.c, - sfdriver.c. lso (see ftoption.h) - TT_CONFIG_OPTION_EMBEDDED_BITMAPS ttsbit.c - TT_CONFIG_OPTION_POSTSCRIPT_NAMES ttpost.c - - * code-sos/ft2/ftbase.c: includes ftcalc.c, ftobjs.c, ftstream.c, - ftlist.c, ftoutln.c, ftextend.c, ftnames.c. - - * code-sos/ft2/autohint.c: includes ahangles.c, ahglyph.c, ahglobal.c, - ahhint.c, ahmodule.c. - - * code-sos/unix/Makefile: added ft2/ to client objects, took out - ftraster.c/ftrend1.c (see below), added -DFT_FLAT_COMPILE. - * ft2/ftsmooth.c: -DFT_FLAT_COMPILE required. - * ft2/raster1.c: -DFT_FLAT_COMPILE required. - Note: this includes ftraster.c/ftrend1.c. - - * code-sos/qcommon/vm_x86.c: _ftol is missing, ftolPtr only defined - for Win32, but used in generic code. Workaround for now. - TODO: find good Linux ftol, or use old solution. - - * SoS checkout. chown -R a+w * recode ibmpc:lat1 */*.h */*.c - -2000-06-30 Michael Vance - - * misc: Spoke with Leonardo about qvm mess. - - * ui/ui.sh: Created to build much like the ui.bat script. - - * ui/ui.q3asm: Use linux style paths. - - * game/game.sh: Created to build much like the game.bat script. - - * game/game.q3asm: Use linux style paths. - - * cgame/cgame.sh: Created to build much like the cgame.bat script. - - * cgame/cgame.q3asm: Use linux systel paths. - - * unix/Makefile: Use the new .sh scripts to build the QVM files. - - * lcc/etc/linux.c: Build .asm files instead of .s files. - - * misc: QVMs now load properly, with minor glitches that should - hopefully be solvable. The new build scripts conflict with the - .asm files already in CVS, as the generated byte code is slightly - different in some cases. - -2000-06-29 Michael Vance - - * lcc/makefile: Tweaked to automatically include the system - compiler's header location. Added an install directory. - - * lcc/custom.mk: Added a build directory. - - * lcc/etc/linux.c: Numerous small tweaks to make compiling the VM - code a much simpler task. - - * q3asm/Makefile: Created. - - * q3asm/q3asm.c: Fixed uninitialized variable in - HashString(). Fixed off by one in argument parsing. - - * misc: Had Brian remove the Xmd.h include from glx.h so that we can - build Quake3 on XFree86 4.0 systems. - - * wine: Attempted to build with lcc.exe and q3asm.exe using wine, - also did not work. This is in contrast to MikeP's .qvms, which - seem to work. - -2000-06-28 Michael Vance - - * common/files.c: Fixed Mods menu behaviour. - - * unix/linux_qgl.c: Guarded references to fxMesa. - - * renderer/qgl.h: Guarded references to fxMesa. - - * ui/ui_demo2.c: Don't convert filename to uppercase. - -2000-05-07 Bernd Kreimeier - - * common/cmdlib.c: windowism, not guarded. Added WIN32 around "ATOM a". - - * q3map/Makefile: Linux Makefile. - - * q3map/Makefile.irix: "makefile" in original code, Irix-only Makefile. - Just fixed some redundant TAB that GNU make despises about as much as I - despise GNU Make, and changed to a relative path. - -2000-05-01 Bernd Kreimeier - - * q3radiant/: updated with Q3Radiant198b3-src.zip. - Tagged (globally) as q3radiant-198b3. - Kept the old files - 3DFXCamWnd.h - 3DFXCamWnd.cpp - MainFrm2.cpp - New files - Shaders.h - misc/ (contributed special TGA resources, don't relly belong) - Removed: - pName - Changed filenames to previous case: - UNNAMED.MAP -> unnamed.map - RES/BMP0002.BMP -> RES/bmp00002.bmp - Changed: - changelog.txt -> ChangeLog - -2000-04-28 Bernd Kreimeier - - * CVS: bk000425 modified sources. This replaces the unix/ directory - which is not yet in id's SourceSafe. Two check-ins, due to minor - changes in an attempt to nail the Voodoo3 related crashes (driver - problems, not a Q3 issue). Undid some of the QFL changes for PI - and the log bug fix - put back in (TODO). Also includes: - * Quake3/code/botlib/be_aas_sample.c: single file update from Robert. - - * CVS: id000423 code dumps (two of them). Applying Loki patches. - Tagged for the final version (all patches). - - * CVS: id000422 code dump. This did not include the 1.16n fixes - used for Linux, and was the first dump for the 1.17 security fix - release. - Note: forgot to check in the ft2/ headers themselves, but they - are not used in the current codebase anyway. Are added in next - dump. Also there is use of CVS/CVS-like $Keyword$ patterns in - some files, and between their revisions and ours we fuck this up. - Also, id ZIP files create write protected sources, have to do - chmod -R a+w Quake3/ to work and overwrite files. - - * CVS: bk000315 modified source. This version was the 1.16n release. - Note: the changes applied here are not in the subsequent code dumps - of id. If you want to compile the Linux version as released you - have to use bk-tagged versions until the patches are merged in by - Robert Duffy. - - * CVS: id000314 engine code dump, same procedure as below, tag. - Note: this version added vm/ sudirectories with assembly files - for cgame, game, ui. CVS tag id000314. - - * CVS: id000304 engine code dump. Now there is a problem, as CVS - was used in the Mac sources. Do - find . -name 'CVS' -exec rm -r {} \; - before cvs update, then tagged: - cvs -d /loki/cvsroot/ tag id000304 Quake3/ - - * CVS: checked in a source snapshot of the id00303 engine code - and the id0003029 tools code. The tool sources are not fully in - sync, and we have only partial source from earlier engine revisions. - The engine source marks where Loki took over from Dave Kirsch. - This snapshot (with all temporary and bogus files) is imported - and tagged using: - cvs -d /loki/cvsroot import Quake3 id000303 initial - - Modules: - code: the Q3 engine code, including a jpeg-6/ copy - common: code shared by tools - libs: code shared by tools, inlcuding a jpeg6/ copy - q3asm: VM bytecode assembly - q3data: misc. Q3 data conversions - q3map: BSP builder - q3radiant: Win32 editor, as is - lcc: C compiler for q3asm - - The sources have not been cleaned up, and binary files have not been - removed. The Q3Radiant code base might exhibit mixed case asmbiguities - in the future, and future source dumps might come from SourceForge - instead. - -2000-04-25 Bernd Kreimeier - - * q3code.id000425/unix/Makefile: relative path, relocatable. - Note: first code merge with id, finally :-). - -2000-04-24 Bernd Kreimeier - - * q3code.bk000422/unix/matha.s: in C(BoxOnPlaneSide) - the following line triggers assembler warning: - "missing prefix `*' in absolute indirect address, maybe misassembled!" - jmp Ljmptab(,%eax,4) - - - * q3code.bk000422/unix/Makefile (MOUNT_DIR): rember to change. - TODO: fix this bloody Makefile to be relocatable, damnit. - - * q3code.bk000422/cgame/cg_event.c: applied JCash fix again - (see EV_EVENT_BITS below). Send e-mail to verify. - - * q3code.bk000422/renderer/tr_image.c: "../jpeg-6/jpeglib.h" again. - - * q3code.bk000422/: created from the id dump of today, lacking - all but one of my changes (sigh). Swapped unix/ competely, takes - care of 90%. Submitted all changes again to Robert... - -2000-04-19 Bernd Kreimeier - - * q3code.bk000315/unix/linux_glimp.c (GLimp_EndFrame): - QGL_EnableLogging( r_logFile->value ) doesn't work? - - * q3code.bk000315/unix/linux_qgl.c: GLimp_LogNewFrame() is - obsolete. QGL_EnableLogging was out of sync with Win32 and - did not support the new framecounter decrement logic. - -2000-04-03 Bernd Kreimeier - - * q3code.bk000315/server/sv_snapshot.c: svs.nextSnapshotEntities - is a signed integer unconditionally incremented, which gets - negative and causes a segfaulting indexing an array. Added reset - to counter. Might fail if snapshot numbers are supposed to - monotonically increase. - -2000-04-02 Bernd Kreimeier - - * q3code.bk000315/client/cl_parse.c (CL_ParseServerMessage): - assert(0) on Illegible message (remember to +set in_mouse 0). - TODO: have to add a dump message function, it's unreadable. - - * botlib/be_ai_goal.c (InitLevelItemHeap): loop counter -2 - left -2 with uninitialized next, and -1 disconnected. Removed - redundant memset. There is an item alloc leak I suspect, as - max_levelitems 1024 merely delayed the overflow error. - -2000-04-01 Bernd Kreimeier - - * botlib/be_ai_goal.c (InitLevelItemHeap): still segfaults. - Not memsetting the entire item heap. As items are cleared - on return, that leaves only memory corruption? - Later: upped max_levelitems from 256 to 1024 - Later: client dies on connect: - Error: CL_ParseServerMessage: Illegible server message 255 - - -2000-03-31 Bernd Kreimeier - - * botlib/be_ai_goal.c: initializing global vars. - Segfault in AllocLevelItem () - at /home/bk/Games/Quake3/q3code/botlib/be_ai_goal.c:364 - I suspect that the initial freelevelitems setting is at - the end of the list and eventually exposed. - - * cgame/cg_event.c: according to Johmn Cash: - itemNum = (es->event & ~EV_EVENT_BITS) - EV_USE_ITEM0 - Quote: "This causes itemNum to be invalid about half the time, - preventing any client side effect tied to the item from occurring." - -2000-03-06 Bernd Kreimeier - - * qcommon/common.c: set pushEvent buffer and indices - to zero in Com_Init(). - - * q3code/qcommon/qcommon.h: made SE_NONE (and for paranoia - also NA_BOT) explicitely set to zero. - -2000-02-27 Bernd Kreimeier - - * unix/Makefile: added dmalloc in an attempt to get on - the Z_Free bug. Futile. Despite stripping dmalloc debug - token down to essentials, I get a (seemingly bogus or - unrelated): - debug-malloc library: dumping program, fatal error - Error: possibly bad .c filename pointer (err 24) - - -2000-02-26 Bernd Kreimeier - - * qcommon/common.c: various debug builts to isolate the - Z_Free bug. It reproducibly happens on some machines - with SE_PACKET, but the packets themselves look - thoroughly corrupted. - -2000-02-21 Bernd Kreimeier - - * qcommon/common.c (Com_EventLoop): possible problem - here, pointer does not get cleared. - - * unix/linux_glimp.c (InitSig): no signal handler. - * common/common.c: dump in Com_Error for debug. - -2000-02-17 Bernd Kreimeier - - * q3code: new dump from Zoid. Repeat tr_image.c fix. - - * unix/Makefile: added client/snd_adpcm.c (linkage errors). - Later: added entire JPDIR and rules, for tr_image.c. - Later: had to fix fules for game/ai_*.c files. - Later: removed ui/ui_quit.o (n/a) - Later: took out -mpentiumpro -march=pentiumpro - - * renderer/tr_image.c: windowism in #include path (see below). - #include "..\jpeg-6\jpeglib.h" - -1999-12-27 Bernd Kreimeier - - * Alpha: tried a dedicated server compile. Segfaults in - ../qcommon/files.c:1682, a paksort function doing pointer - fiddling. - - * Makefile.alpha: created. - Note: want to take the SDL/Setup autoconf ASAP. - - * unix/unix_main.c: fixed __axp__ to __alpha__, guarded - _FPU_SETCW. - - * qcommon/vm_alpha.c: dummy, created. - * qcommon/vm_null.c: dummy, created. - -1999-12-04 Bernd Kreimeier - - * renderer/tr_image.c: windowism in #include path. - #include "..\jpeg-6\jpeglib.h" - - * Revision 1.11: from Zoid by e-mail. - Note: threw away my playground copy, starting with the - ZIP file. Zoid's using CVS now, but we can't remote - access it. Thus did the - "find . -name 'CVS' -exec rm -rf {} \;" - and then track it as 3rd party source by - - - * ChangeLog: created. Now starting to track Q3A source. - ---------- q3code log --------------------------------------------- diff --git a/code/unix/Cons_gcc.pm b/code/unix/Cons_gcc.pm deleted file mode 100644 index 41df3fd..0000000 --- a/code/unix/Cons_gcc.pm +++ /dev/null @@ -1,47 +0,0 @@ -# -# Some utilities to handle gcc compiler setup -# - -package Cons_gcc; - -# pass the compiler name -# returns an array, first element is 2 for 2.x 3 for 3.x, then full version, then machine info -sub get_gcc_version -{ - my @ret; - my ($CC) = @_; - my $version=`$CC --version | head -1`; - chop($version); - my $machine=`$CC -dumpmachine`; - chop($machine); - if($version =~ '2\.[0-9]*\.[0-9]*') - { - push @ret, '2'; - } else { - push @ret, '3'; - } - push @ret, $version; - push @ret, $machine; - return @ret; -} - -# http://ccache.samba.org/ -# check ccache existence and path -# returns an array, first element 0 / 1, then path -sub get_ccache -{ - my @ret; - $ccache_path=`which ccache`; - chop($ccache_path); - if(-x $ccache_path) - { - push @ret, '1'; - push @ret, $ccache_path; - return @ret; - } - push @ret, '0'; - return @ret; -} - -# close package -1; diff --git a/code/unix/Conscript-client b/code/unix/Conscript-client deleted file mode 100644 index 59173af..0000000 --- a/code/unix/Conscript-client +++ /dev/null @@ -1,265 +0,0 @@ -# full client build script - -Import qw( BASE_CFLAGS BASE_LDFLAGS INSTALL_DIR BUILD_DIR TARGETNAME CC CXX LINK ); - -# splines -$env_splines = new cons( - CC => $CC, - CXX => $CXX, - LINK => $LINK, - ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} } - ); - -@SPLINES_FILES = qw( - ../splines/math_angles.cpp - ../splines/math_matrix.cpp - ../splines/math_quaternion.cpp - ../splines/math_vector.cpp - ../splines/q_parse.cpp - ../splines/q_shared.cpp - ../splines/splines.cpp - ../splines/util_str.cpp - ); -$SPLINES_FILESREF = \@SPLINES_FILES; - -Library $env_splines 'splines', @$SPLINES_FILESREF; - -# botlib -# FIXME TTimo -# we already deal with botlib on dedicated target -# the compilation options are a bit different but we could certainly rely on -# the same Conscript and make things cleaner - -$env_botlib = new cons( - CC => $CC, - CXX => $CXX, - LINK => $LINK, - ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }, - CFLAGS => $BASE_CFLAGS . '-DBOTLIB ' -); - -@BOTLIB_FILES = qw( - ../botlib/be_aas_bspq3.c - ../botlib/be_aas_cluster.c - ../botlib/be_aas_debug.c - ../botlib/be_aas_entity.c - ../botlib/be_aas_file.c - ../botlib/be_aas_main.c - ../botlib/be_aas_move.c - ../botlib/be_aas_optimize.c - ../botlib/be_aas_reach.c - ../botlib/be_aas_route.c - ../botlib/be_aas_routealt.c - ../botlib/be_aas_sample.c - ../botlib/be_ai_char.c - ../botlib/be_ai_chat.c - ../botlib/be_ai_gen.c - ../botlib/be_ai_goal.c - ../botlib/be_ai_move.c - ../botlib/be_ai_weap.c - ../botlib/be_ai_weight.c - ../botlib/be_ea.c - ../botlib/be_interface.c - ../botlib/l_crc.c - ../botlib/l_libvar.c - ../botlib/l_log.c - ../botlib/l_memory.c - ../botlib/l_precomp.c - ../botlib/l_script.c - ../botlib/l_struct.c -); -$BOTLIB_REF = \@BOTLIB_FILES; - -Library $env_botlib 'botlib', @$BOTLIB_REF; - -# jpeg -# NOTE TTimo we might need this one on other targets -$env_jpeglib = new cons( - CC => $CC, - CXX => $CXX, - LINK => $LINK, - ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }, - CFLAGS => $BASE_CFLAGS - ); - -@JPEGLIB_FILES = qw( - ../jpeg-6/jcapimin.c - ../jpeg-6/jchuff.c - ../jpeg-6/jcinit.c - ../jpeg-6/jccoefct.c - ../jpeg-6/jccolor.c - ../jpeg-6/jfdctflt.c - ../jpeg-6/jcdctmgr.c - ../jpeg-6/jcphuff.c - ../jpeg-6/jcmainct.c - ../jpeg-6/jcmarker.c - ../jpeg-6/jcmaster.c - ../jpeg-6/jcomapi.c - ../jpeg-6/jcparam.c - ../jpeg-6/jcprepct.c - ../jpeg-6/jcsample.c - ../jpeg-6/jdapimin.c - ../jpeg-6/jdapistd.c - ../jpeg-6/jdatasrc.c - ../jpeg-6/jdcoefct.c - ../jpeg-6/jdcolor.c - ../jpeg-6/jddctmgr.c - ../jpeg-6/jdhuff.c - ../jpeg-6/jdinput.c - ../jpeg-6/jdmainct.c - ../jpeg-6/jdmarker.c - ../jpeg-6/jdmaster.c - ../jpeg-6/jdpostct.c - ../jpeg-6/jdsample.c - ../jpeg-6/jdtrans.c - ../jpeg-6/jerror.c - ../jpeg-6/jidctflt.c - ../jpeg-6/jmemmgr.c - ../jpeg-6/jmemnobs.c - ../jpeg-6/jutils.c - ); -$JPEGLIB_REF = \@JPEGLIB_FILES; - -Library $env_jpeglib 'jpeglib', @$JPEGLIB_REF; - -# NOTE TTimo this requires patched cons version to work (see unix/cons) -%nasm_hash = new cons()->copy( - CC => 'nasm', - CCCOM => '%CC -f elf -o %> %<' -); -$nasm_hash{SUFMAP}{'.nasm'} = 'build::command::cc'; -$nasm_env = new cons(%nasm_hash); - -Library $nasm_env 'asmlib', 'ftol.nasm', 'snapvector.nasm'; - -# compiling files with inlined assembly -$env_inlined = new cons( - CFLAGS => '-DELF -x assembler-with-cpp' - ); - -Library $env_inlined 'inlinelib', '../unix/matha.s', '../unix/snd_mixa.s'; - -# putting it all together - -$env = new cons( - CC => $CC, - CXX => $CXX, - LINK => $LINK, - ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }, - CFLAGS => $BASE_CFLAGS, - LIBS => ' ' . $BUILD_DIR . '/unix/splines.a ' - . $BUILD_DIR . '/unix/botlib.a ' - . $BUILD_DIR . '/unix/jpeglib.a ' - . $BUILD_DIR . '/unix/asmlib.a ' - . $BUILD_DIR . '/unix/inlinelib.a ' - . $BASE_LDFLAGS - . '-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -ldl -lm' -); - -@RENDERER_FILES = qw( - ../renderer/tr_animation.c - ../renderer/tr_backend.c - ../renderer/tr_bsp.c - ../renderer/tr_cmds.c - ../renderer/tr_curve.c - ../renderer/tr_flares.c - ../renderer/tr_font.c - ../renderer/tr_image.c - ../renderer/tr_init.c - ../renderer/tr_light.c - ../renderer/tr_main.c - ../renderer/tr_marks.c - ../renderer/tr_mesh.c - ../renderer/tr_model.c - ../renderer/tr_noise.c - ../renderer/tr_scene.c - ../renderer/tr_shade.c - ../renderer/tr_shade_calc.c - ../renderer/tr_shader.c - ../renderer/tr_shadows.c - ../renderer/tr_sky.c - ../renderer/tr_surface.c - ../renderer/tr_world.c - ); -$RENDERER_REF = \@RENDERER_FILES; - -@CLIENT_FILES = qw( - ../client/cl_cgame.c - ../client/cl_cin.c - ../client/cl_console.c - ../client/cl_input.c - ../client/cl_keys.c - ../client/cl_main.c - ../client/cl_net_chan.c - ../client/cl_parse.c - ../client/cl_scrn.c - ../client/cl_ui.c - ); -$CLIENT_REF = \@CLIENT_FILES; - -@COMMON_FILES = qw( - ../qcommon/cm_load.c - ../qcommon/cm_patch.c - ../qcommon/cm_polylib.c - ../qcommon/cm_test.c - ../qcommon/cm_trace.c - ../qcommon/cmd.c - ../qcommon/common.c - ../qcommon/cvar.c - ../qcommon/files.c - ../qcommon/md4.c - ../qcommon/msg.c - ../qcommon/net_chan.c - ../qcommon/huffman.c - ../qcommon/unzip.c - ); -$COMMON_REF = \@COMMON_FILES; - -@SOUND_FILES = qw( - ../client/snd_adpcm.c - ../client/snd_dma.c - ../client/snd_mem.c - ../client/snd_mix.c - ../client/snd_wavelet.c - ); -$SOUND_REF = \@SOUND_FILES; - -@UNIX_FILES = qw( - ../unix/unix_main.c - ../unix/unix_net.c - ../unix/unix_shared.c - ../unix/linux_common.c - ../unix/linux_qgl.c - ../unix/linux_glimp.c - ../unix/linux_joystick.c - ../unix/linux_snd.c - ../unix/linux_signals.c - ); -$UNIX_REF = \@UNIX_FILES; - -@SERVER_FILES = qw( - ../server/sv_bot.c - ../server/sv_ccmds.c - ../server/sv_client.c - ../server/sv_game.c - ../server/sv_init.c - ../server/sv_main.c - ../server/sv_net_chan.c - ../server/sv_snapshot.c - ../server/sv_world.c - ); -$SERVER_REF = \@SERVER_FILES; - -# FIXME TTimo vm_.c -@VM_FILES = qw( - ../qcommon/vm.c - ../qcommon/vm_x86.c - ../qcommon/vm_interpreted.c - ); -$VM_REF = \@VM_FILES; - -# FIXME: import the CPU string to build the name of the target -Program $env $TARGETNAME, '../game/q_shared.c', '../game/q_math.c', - @$RENDERER_REF, @$CLIENT_REF, @$COMMON_REF, @$SOUND_REF, - @$UNIX_REF, @$SERVER_REF, @$VM_REF; -Install $env $INSTALL_DIR, $TARGETNAME; diff --git a/code/unix/Conscript-dedicated b/code/unix/Conscript-dedicated deleted file mode 100644 index 0c64f23..0000000 --- a/code/unix/Conscript-dedicated +++ /dev/null @@ -1,115 +0,0 @@ -# dedicated server build script - -Import qw( BASE_CFLAGS BUILD_DIR INSTALL_DIR CC CXX LINK ); - -$DEDICATED_NAME = 'linuxq3ded'; - -$env_botlib = new cons( - CC => $CC, - CXX => $CXX, - LINK => $LINK, - ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }, - CFLAGS => $BASE_CFLAGS . '-DBOTLIB ' -); - -@BOTLIB_FILES = qw( - ../botlib/be_aas_bspq3.c - ../botlib/be_aas_cluster.c - ../botlib/be_aas_debug.c - ../botlib/be_aas_entity.c - ../botlib/be_aas_file.c - ../botlib/be_aas_main.c - ../botlib/be_aas_move.c - ../botlib/be_aas_optimize.c - ../botlib/be_aas_reach.c - ../botlib/be_aas_route.c - ../botlib/be_aas_routealt.c - ../botlib/be_aas_sample.c - ../botlib/be_ai_char.c - ../botlib/be_ai_chat.c - ../botlib/be_ai_gen.c - ../botlib/be_ai_goal.c - ../botlib/be_ai_move.c - ../botlib/be_ai_weap.c - ../botlib/be_ai_weight.c - ../botlib/be_ea.c - ../botlib/be_interface.c - ../botlib/l_crc.c - ../botlib/l_libvar.c - ../botlib/l_log.c - ../botlib/l_memory.c - ../botlib/l_precomp.c - ../botlib/l_script.c - ../botlib/l_struct.c -); -$BOTLIB_REF = \@BOTLIB_FILES; - -Library $env_botlib 'botlib', @$BOTLIB_REF; - -# NOTE TTimo this requires patched cons version to work (see unix/cons) -%nasm_hash = new cons()->copy( - CC => 'nasm', - CCCOM => '%CC -f elf -o %> %<' -); -$nasm_hash{SUFMAP}{'.nasm'} = 'build::command::cc'; -$nasm_env = new cons(%nasm_hash); - -Library $nasm_env 'asmlib', 'ftol.nasm', 'snapvector.nasm'; - -$env = new cons( - CC => $CC, - CXX => $CXX, - LINK => $LINK, - ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }, - # FIXME TTimo I'm not sure about what C_ONLY is for - CFLAGS => $BASE_CFLAGS . '-DC_ONLY', - LDFLAGS => '-ldl -lm', - LIBS => ' ' - . $BUILD_DIR . '/unix/botlib.a ' - . $BUILD_DIR . '/unix/asmlib.a ' -); - -# list the files for the dedicated server -@FILES = qw( - ../null/null_client.c - ../null/null_input.c - ../null/null_snddma.c - ../server/sv_bot.c - ../server/sv_ccmds.c - ../server/sv_client.c - ../server/sv_game.c - ../server/sv_init.c - ../server/sv_main.c - ../server/sv_net_chan.c - ../server/sv_snapshot.c - ../server/sv_world.c - ../qcommon/cm_load.c - ../qcommon/cm_patch.c - ../qcommon/cm_polylib.c - ../qcommon/cm_test.c - ../qcommon/cm_trace.c - ../qcommon/cmd.c - ../qcommon/common.c - ../qcommon/cvar.c - ../qcommon/files.c - ../qcommon/huffman.c - ../qcommon/md4.c - ../qcommon/msg.c - ../qcommon/net_chan.c - ../qcommon/unzip.c - ../qcommon/vm.c - ../qcommon/vm_interpreted.c - ../game/q_math.c - ../game/q_shared.c - ../unix/linux_common.c - ../unix/unix_main.c - ../unix/unix_net.c - ../unix/unix_shared.c - ../unix/linux_signals.c - ); -$FILESREF = \@FILES; - -# DEDICATED_NAME is imported, holds the name of the target -# wolfded.x86 usually -Program $env $DEDICATED_NAME, '../qcommon/vm_x86.c', @$FILESREF; -Install $env $INSTALL_DIR, $DEDICATED_NAME; diff --git a/code/unix/Conscript-pk3 b/code/unix/Conscript-pk3 deleted file mode 100644 index 9232ae4..0000000 --- a/code/unix/Conscript-pk3 +++ /dev/null @@ -1,135 +0,0 @@ -# build pk3 on the fly - -Import qw( INSTALL_DIR BUILD_DIR CONFIG_DIR CC CXX LINK ); - -use Data::Dumper; - -$env = new cons(); # the env on which we will be working for all pk3s (NOTE: maybe we need several ctually) - -$hcf_do_exec = 1; -sub do_command($) -{ - printf("@_[0]\n"); - if ($hcf_do_exec) - { - system("@_[0]"); - } -} - -sub build_pk3 { - - sub launch { - #print "In launch\n"; - $Data::Dumper::Indent = 2; - #print Dumper(@_); - $tmpdir = "/tmp/pk3-builder$$"; - do_command("rm -rf $tmpdir"); - - ($target, $sets) = @_; - $base=`basename $target`; chomp($base); - $dirname=`dirname $target`; chomp($dirname); - - foreach (@{$sets}) - { - ($sourcepath, $destpath, $file) = @{$_}; - #print "source: $sourcepath dest: $destpath file: $file\n"; - do_command("mkdir -p $tmpdir/$destpath"); - if ($sourcepath =~ /#.*/) - { - #print "$sourcepath is absolute\n"; - $sourcepath =~ s/#//; - if (ref($file)) - { - foreach(@{$file}) - { - do_command("cp $sourcepath/$_ $tmpdir/$destpath/$_"); - } - } - else - { - do_command("cp $sourcepath/$file $tmpdir/$destpath/$file"); - } - } - else - { - #print "$sourcepath in linked dir\n"; - if (ref($file)) - { - foreach(@{$file}) - { - do_command("cp $BUILD_DIR/$sourcepath/$_ $tmpdir/$destpath/$_"); - } - } - else - { - do_command("cp $BUILD_DIR/$sourcepath/$file $tmpdir/$destpath/$file"); - } - } - } - - do_command("cd $tmpdir ; zip -r $base *"); - do_command("mkdir -p $BUILD_DIR/$dirname"); - do_command("cp $tmpdir/$base $BUILD_DIR/$target"); - do_command("rm -rf $tmpdir"); - - return 1; - } - - # extract the parameters - ($target, $sets) = @_; - - $base=`basename $target`; chomp($base); - $dirname=`dirname $target`; chomp($dirname); - - # the build command is stored and called later on by cons - # this makes it impossible to have several build_pk3 working together - # there is probably a cleaner solution than this hack, but this works - $target_uniquename="target_$base"; - $target_uniquename=~s/\.//g; - eval("\$$target_uniquename=\$target"); - $sets_uniquename="sets_$base"; - $sets_uniquename=~s/\.//g; - eval("\$$sets_uniquename=\$sets"); - #print "name: $target_uniquename after the hack: $target_pak8pk3"; - - # don't pass @{@_} .. since this will be called during the process - $command = "[perl] &launch( \$$target_uniquename, [ \@{\$$sets_uniquename} ] )"; - #print "$command\n"; - - foreach(@{$sets}) - { - ($sourcepath, $destpath, $file) = @{$_}; - if (ref($file)) - { - foreach(@{$file}) - { - Depends $env $target, $sourcepath . '/' . $_; - } - } - else - { - Depends $env $target, $sourcepath . '/' . $file; - } - } - Command $env $target, $command; - Install $env $INSTALL_DIR . "/$dirname", $target; -} - -# quick rundown on the syntax: -# , [ , , ... ] -# where : [ , , , , .. ] - -build_pk3('baseq3/pak8.pk3', - [ [ '#../../../media/Q3Media-1.32/baseq3/menu/art', 'menu/art', 'pblogo.tga' ], - [ '../Q3/q3_ui/q3_ui', 'vm', 'ui.qvm' ], - [ '../Q3/cgame/cgame', 'vm', 'cgame.qvm' ], - [ '../Q3/game/game', 'vm', 'qagame.qvm' ] ] -); - -build_pk3('missionpack/pak3.pk3', - [ [ '#../ui', 'ui', [ 'createserver.menu', 'joinserver.menu', 'filter.menu', 'punkbuster.menu', 'menus.txt' ] ], - [ '../TA/ui/ui', 'vm', 'ui.qvm' ], - [ '../TA/cgame/cgame', 'vm', 'cgame.qvm' ], - [ '../TA/game/game', 'vm', 'qagame.qvm' ], - [ '#../../../media/Q3Media-1.32/missionpack/scripts', 'scripts', 'models2.shader' ] ] -); diff --git a/code/unix/Conscript-sdk b/code/unix/Conscript-sdk deleted file mode 100644 index d545013..0000000 --- a/code/unix/Conscript-sdk +++ /dev/null @@ -1,122 +0,0 @@ -# sdk - -Import qw( SDK_NAME Q3_VER CC CXX LINK ); - -# http://www.devdaily.com/perl/edu/articles/pl010005/pl010005.shtml -#----------------------------( promptUser )-----------------------------# -# # -# FUNCTION: promptUser # -# # -# PURPOSE: Prompt the user for some type of input, and return the # -# input back to the calling program. # -# # -# ARGS: $promptString - what you want to prompt the user with # -# $defaultValue - (optional) a default value for the prompt # -# # -#-------------------------------------------------------------------------# - -sub promptUser { - - #-------------------------------------------------------------------# - # two possible input arguments - $promptString, and $defaultValue # - # make the input arguments local variables. # - #-------------------------------------------------------------------# - - local($promptString,$defaultValue) = @_; - - #-------------------------------------------------------------------# - # if there is a default value, use the first print statement; if # - # no default is provided, print the second string. # - #-------------------------------------------------------------------# - - if ($defaultValue) { - print $promptString, "[", $defaultValue, "]: "; - } else { - print $promptString, ": "; - } - - $| = 1; # force a flush after our print - $_ = ; # get the input from STDIN (presumably the keyboard) - - - #------------------------------------------------------------------# - # remove the newline character from the end of the input the user # - # gave us. # - #------------------------------------------------------------------# - - chomp; - - #-----------------------------------------------------------------# - # if we had a $default value, and the user gave us input, then # - # return the input; if we had a default, and they gave us no # - # no input, return the $defaultValue. # - # # - # if we did not have a default value, then just return whatever # - # the user gave us. if they just hit the key, # - # the calling routine will have to deal with that. # - #-----------------------------------------------------------------# - - if ("$defaultValue") { - return $_ ? $_ : $defaultValue; # return $_ if it has a value - } else { - return $_; - } -} - -sub launch { - - print("Building MOD SDK (version $Q3_VER)\n"); - print("Before building the mod sdk, your CVS tree must be completely clean!\nIf there are some temporary files and binaries in the tree, they can get included in the distribution and cause problems.\n"); - $ok = &promptUser("Ready to build mod sdk [y/n]? "); - if ($ok ne 'y') - { - print("aborting\n"); - return 0; - } - # create the dirs: - $RAW_DATA = "mod-sdk-$Q3_VER"; - system("rm -rf $RAW_DATA ; mkdir -p $RAW_DATA/code"); - # actual code - system("cp -R cgame game q3_ui ui $RAW_DATA/code"); - # UI stuff - system("cp -R ../ui $RAW_DATA"); - # tools - system("cp -R ../lcc ../q3asm $RAW_DATA"); - # build scripts - system("cp Construct $RAW_DATA/code"); - system("mkdir $RAW_DATA/code/unix ; cp unix/cons unix/pcons-2.3.1 unix/Conscript-pk3 $RAW_DATA/code/unix"); - system("cp unix/mod-sdk-data/Makefile $RAW_DATA/code/"); - # cleanup some stuff - system("find $RAW_DATA -name CVS -exec rm -rf {} \\; 2>/dev/null"); - # test that the build works just fine - $host=`hostname`; chomp($host); - if ($host ne 'antares') - { - system("rm -rf /tmp/$RAW_DATA ; cp -R $RAW_DATA /tmp"); - system("cd /tmp/$RAW_DATA/code ; make"); - if ($? ne 0) - { - printf("ERROR: test build failed\n"); - return 0; - } - printf("build test successful\n"); - } - # make a setup out of this - system("cp -R unix/setup/setup.sh unix/setup/setup.data $RAW_DATA"); - # TODO: splash! - system("cp unix/mod-sdk-data/setup.xml unix/mod-sdk-data/config.sh unix/mod-sdk-data/postinstall.sh $RAW_DATA/setup.data"); - # mod-sdk-data/Q3A_EULA.txt is a copy of stuff that is usually in $Q3SETUPMEDIA .. can't be arsed - system("cp unix/mod-sdk-data/Q3A_EULA.txt $RAW_DATA"); - # I love those dirty hacks - system("cd $RAW_DATA/setup.data/bin ; ln -s Linux FreeBSD ; ln -s Linux OpenBSD ; ln -s Linux NetBSD"); - # cleanup some stuff - system("find $RAW_DATA -name CVS -exec rm -rf {} \\; 2>/dev/null"); - # weeee - system("unix/mod-sdk-data/makeself/makeself.sh $RAW_DATA $SDK_NAME \"Quake III Arena mod SDK\" ./setup.sh $Q3_VER"); - return 1; -} - -print("in Conscript-sdk\n"); - -$env = new cons(); -Command $env "$SDK_NAME", "[perl] &launch()"; diff --git a/code/unix/Conscript-setup b/code/unix/Conscript-setup deleted file mode 100644 index 513d951..0000000 --- a/code/unix/Conscript-setup +++ /dev/null @@ -1,33 +0,0 @@ -# setup - -Import qw( INSTALL_BASEDIR ); - -$env = new cons( - # add this path so setup script finds brandelf - ENV => { PATH => $ENV{PATH} . ":" . $ENV{HOME} . "./usr/bin", }, -); - -sub launch { - # need to get the correct version (i.e. from SP source) - $version = `cat game/q_shared.h | grep Q3_VERSION`; - chomp $version; - $version =~ s/.*Q3\ (.*)\"/$1/; - print("version: $version\n"); - system("cd unix ; ./build_setup.sh $version"); - - return 1; -} - -# no dependency to PB, we get it directly from the tree and not in install/ -Depends $env "$INSTALL_BASEDIR/foo", - "$INSTALL_BASEDIR/linuxq3ded", - "$INSTALL_BASEDIR/linuxquake3-smp", - "$INSTALL_BASEDIR/linuxquake3"; - # during developement phase, we generate and copy the pk3 on the fly - # then those should move to the media tree -# those have been finalized and moved to the media tree -# "$INSTALL_BASEDIR/baseq3/pak8.pk3", -# "$INSTALL_BASEDIR/missionpack/pak3.pk3"; - - -Command $env "$INSTALL_BASEDIR/foo", "[perl] &launch()"; diff --git a/code/unix/LinuxSupport/CHANGES-1.32.txt b/code/unix/LinuxSupport/CHANGES-1.32.txt deleted file mode 100644 index 0208b82..0000000 --- a/code/unix/LinuxSupport/CHANGES-1.32.txt +++ /dev/null @@ -1,150 +0,0 @@ -CHANGES 1.32 - -11/13/2002 - 1.32b - -Update to the Linux client, fixing a number of issues: - - -- Text mode install broken on glibc 2.3 (Debian Sid) -http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=165358 -Current Debian Sid's glibc package break backwards compatibility -with binaries compiled on older glibc and statically linked. -This will cause the text mode setup to segfault. - -For now you can either: - - find a solution to run the graphical gtk-based setup - - roll back to glibc 2.2 - - use an updated setup binary: - run the linux setup once, with the --keep option - (this will exand all the files to setup.tmp/) - get this updated setup file: - http://zerowing.idsoftware.com/linux/165358/setup - replace setup.tmp/setup.data/bin/Linux/x86/setup by the new one - cd to setup.tmp/ and run setup.sh - - -- Current NVidia drivers don't officially support glibc 2.3 systems -This affects Debian Sid in particular, causing crashes during vid_restart -The issue is related to the SMP build depending upon libpthreads -1.32b has both SMP and non-SMP binary. Use quake3-smp to launch -the SMP version if you want to use it. - - -- SMP and non-SMP builds: -Default quake3 shortcut will spawn a non-SMP build. Use quake3-smp -for an SMP-enabled run. From the feedback we got after the 1.32 release, -the SMP support as designed in the Quake III Arena technology isn't so -much relevant anymore. It was designed for much lower CPU frequencies -and lower AGP throughputs. Modern systems won't benefit from SMP. Since -it didn't make much sense to remove the SMP binary, we have both now. - - -- Fixing broken mouse on Suse: -Starting with XFree 4.2, the event timestamps returned by the X server -are no longer matching gettimeofday. And there is currently no API in X -to provide easy synchronisation. 1.32 introduced improved event timing -by correcting event time with X server event timestamp (sub-frame timing). -This worked fine with XFree 4.1, and no longer does. 1.32b adds a safe -check to work again with XFree 4.2, but basically the input timing is -back to 1.31 quality. - -Some new cvars related to the mouse control: -in_dgamouse - not new, but be sure to have it set to 1 on any recent system -in_subframe - completely disables sub-frame timing. If XFree 4.2 - in_subframe 1 won't hurt, but it won't do anything either. -in_nograb - for mod developers. Set to 1 and run windowed, Q3 won't be - grabbing your mouse pointer (useful for debug breaks) - - -8/26/2002 - -General: - -- new network protocol, 68 - -- network code: - improved fragmented messages handling - map change while client loads map no longer causes an 'Invalid .PK3' error - map_restart while client loads map no longer causes a reload - fixing donedl being ignored after autodl if map_restart'ed -- the demo command has a list of compatible protocols, it will loop through 66 67 68 - you can do '/demo four' and it will try four.dm_66 four.dm_67 four.dm_68 - or you can explicitely give a '/demo demoname.dm_??' - -- added mousewheel support in the console: - wheel to scroll, ctrl+wheel to scroll faster, shift+wheel to scroll history - -- UI in baseq3/ and missionpack/ for PunkBuster configuration - punkbuster server in server creation dialog (sv_punkbuster) - punkbuster client in server browser (cl_punkbuster) - added PB Yes/No to the browsers -- removed obsolete MPlayer UI stuff -- bumped server browser to handle up to 4096 servers - -- IP maintained in userinfo -- cl_guid in userinfo (as part of PB integration) -- printing ports as unsigned ints, no longer printing negative port numbers -- cleaned up the legacy IP banning code - use * for IP pattern matching now instead of 0 (fixes some confusion) - ex: 192.246.12.* - made it safe from overflowing and crashing - NOTE: using PunkBuster's banning system is advised instead though -- rcon: some fixes to the buffering to avoid overflowing and dropping parts of the message -- rcon: now supports quoting /rcon g_motd "foo bar" -- added SVF_CLIENTMASK (0x00000002), works only with <= 32 players - set bitmask of players to which send entity -- pushed cl_maxpackets upper limit to 125 -- added [skipnotify] from RTCW, use to display in the console only, but not on client screen - (also fixes pb_msgprefix and pb_sv_msgprefix) - -- new cvar sv_lanForceRate (defaults 1): - forces LAN clients to the maximum rate instead of accepting client setting - (1 is the default behaviour, backward compatible) - -- new cvar sv_strictAuth (defaults 1): - server side variable to control wether strict CDKEY auth should be performed with the auth server - this is required if you want reliable cl_guid for the server (for users tracking) - -- filesystem: - client re-orders it's pk3s according to the order given by server - (fixes some 'Invalid .PK3 files referenced' situations - -- fixed invisible entities/players bug (thanks goes to Rick Johnson / Raven for this one!) -- update x86 VM code (better and safer optimisations) (Richk Johnson / Raven too) -- clearing client gentity before GAME_INIT call -- failing vote if there's only one voting client (fixes exploit on 2-player server where one player votes then disconnects, forcing vote to pass) - -- added trap_FS_Seek - -- renderer fix: - if client game code registers a shader after drawsurfaces are generated but before frame is rendered - had a one-frame visual glitch (shader indexes messed up) -- renderer fix: - r_roundImagesDown 0 + map q3dm1 -> crash (buffer overflow fix) -- renderer fix: - fixed a crash in widescreen displays (q3dm11) -- renderer fix: - MAX_SHADERS up to 2^12 -- renderer fix: - moved screenshot from frontend to backend, fixes broken r_smp 1 screenshots - -- TA fixes: - MOD_KAMIKAZE MOD_JUICED logging properly to games.log - fixed bot taunt spamming -- fixed typo in scripts/models2.shader (shader error Ursula head) - -Win32 specific: - -- fixed the DirectInput mouse init procedure -- rcon: - fixed rcon not working on NT/2000/XP workstations that have a long uptime - -Linux specific: - -- no longer trying to load libMesaVoodooGL.so - obsolete code, was confusing when trying to setup correct OpenGL acceleration -- SMP support in the renderer. Detects CPU count, r_smp 1 default if available. (thanks to Gareth Hughes for contributing this) -- changed default GL driver from libGL.so to libGL.so.1 - see LSB 1.2 spec: http://www.linuxbase.org/spec/refspecs/LSB_1.2.0/gLSB/libgl.html -- Handle Ctrl and Space key together correctly (Ctrl was disabling Space) -- sub-frame timing of input events (key/mouse) (input timing quality now equivalent to win32) diff --git a/code/unix/LinuxSupport/INSTALL b/code/unix/LinuxSupport/INSTALL deleted file mode 100644 index d654d17..0000000 --- a/code/unix/LinuxSupport/INSTALL +++ /dev/null @@ -1,52 +0,0 @@ - Quake III Arena - Quake III: Team Arena - Installation instructions - ------ - -What you need: - -- retail CD-ROM of Quake III Arena for Windows or linux -- optionally, retail CD-ROM of Quake III: Team Arena -- a computer running linux (kernel >= 2.2 glibc >= 2.1) -- running the client requires X11 and 3D hardware acceleration with OpenGL - -Installation: - -If you have the retail CD-ROM of Quake III Arena for linux: -- install Quake III Arena from the CD-ROM -- run the Point Release installer -(to buy Quake III Arena for linux online, try http://www.tuxgames.com/) - -If you have the retail CD-ROM of Quake III Arena for Windows: -- run the Point Release installer first -- now you need to copy the main pak files from the CD-ROM - or from your win32 partition. Namely, you need to copy baseq3/pak0.pk3 - and for Team Arena, missionpack/pak0.pk3 - see below for more instructions on how to copy the files: - -WARNING: Those instructions are provided as a reference, -depending on your distribution the CD-ROM might not have the same -mount point. Please refer to your linux documentation for additional -information. - -- open a root shell and cd to the default installation path: - cd /usr/local/games/quake3 -- mount the Quake III Arena CD-ROM and install the game content - cp /mnt/cdrom/Quake3/baseq3/pak0.pk3 /usr/local/games/quake3/baseq3 -- optionally, mount the Quake III: Team Arena CD-ROM - cp /mnt/cdrom/Setup/missionpack/pak0.pk3 /usr/local/games/quake3/missionpack - -NOTES: -- If you are running Quake III Arena and Quake III: Team Arena on a - Windows partition, you can save some space by symlinking the game - assets to their windows installation: - ln -s /win/quake3/baseq3/pak0.pk3 /usr/local/games/quake3/baseq3/pak0.pk3 - ln -s /win/quake3/missionpack/pak0.pk3 /usr/local/games/quake3/missionpack/pak0.pk3 - (Windows partition is mounted as /win and Quake III Arena installation is C:\quake3) - -Getting Help: - -- consult the FAQ in Help/Q3A_FAQ.html -- head over to the Quake3World forums http://www.quake3world.com/forums -- consult the list of known issues and tips at - http://zerowing.idsoftware.com/linux diff --git a/code/unix/LinuxSupport/index.html b/code/unix/LinuxSupport/index.html deleted file mode 100644 index e87ef29..0000000 --- a/code/unix/LinuxSupport/index.html +++ /dev/null @@ -1,283 +0,0 @@ - - Linux Quake III Arena Known issues - - -Linux Quake III Arena Known issues
    -Known issues and frequently asked questions - 1.32b
    -
    -TTimo
    -Changes history
    -2004.2.20 Last update
    -2001.6.18 Initial version -

    -Current topics - -
    Installation instructions -
    -
    -

    Linux Quake III Arena is using a graphical installer -(based on Loki software's Setup Graphic Installer -). However, since it's a Point Release, you need a retail CD-ROM of Quake -III Arena to perform a complete installation (and optionally your Quake III: -Team Arena CD-ROM). This process is documented in the INSTALLfile -(this file is also in the setups, it's default location is /usr/local/games/quake3/INSTALL -.. you can run the PR setup and read it to finish the installation afterwards).

    -What do I do with a .x86.run file? -
    -
    -

    Those are setup files, meant to be executed. They -come with graphical installation UI or console installation, depending on -what's available on your system. You may need to chmod +x file.x86.run -to make them executable.

    -The setup crashes with Segmentation fault "$setup" "$@" 2>/dev/null -

    This is happening on glibc 2.3 systems such as RedHat 9 and Suze. The text mode installer will crash. If you can do a graphical installation, make sure you have Gtk1 installed and avoid the text installer altogether. -If you are doing a remote installation (such as a dedicated server through ssh), you need to use a newer text mode installer. Run the installer with --keep to extract the files -(look for a setup* directory in the current directory for the extracted setup). -Then replace setup.data/bin/Linux/x86/setup by this newer version. Run setup.sh at top level and things should work fine.

    -

    -Update: Turns out this solution is working for RTCW and ET, but not for Q3 (because the last q3 setup uses an older version of the installer). Will update a specific solution for Q3 'soon'. -

    -Installation on -BSD
    -
    -

    The linux binaries will run fine on the BSD family (FreeBSD, -NetBSD and OpenBSD) with the linux binary compatibility software. However -if you are getting the error message ELF binary type "0" not known -while installing or trying to run the binaries, that means you need to run -brandelf on the files.

    -

    If it's a setup problem, proceed with the following steps: -

    -
    ./linuxq3apoint-1.31.x86.run --keep
    brandelf -t Linux setup.tmp/setup.data/bin/FreeBSD/x86/setup
    cd setup.tmp
    sh ./setup.sh
    -

    The --keep option will extract the files and leave them -somewhere below your current directory. Depending on the game (Q3 or RTCW) -and the setup version, your mileage may vary (setup.tmp or another directory).

    -

    The game binaries might need to be brandelf'ed too, with -a command such as

    -
    brandelf -t Linux /usr/local/games/quake3/quake3.x86
    -CLIENT_UNKNOWN_TO_AUTH -
    -
    -

    Graeme Devine recently updated his .plan with very -complete information about CLIENT_UNKNOWN_TO_AUTH errors.

    -

    -See some additional information from the gameadmins.com mailing list: -

    -
    If the server you are playing on and the auth server don't see you as the
    -same IP (for instance you are trying to play on a public internet server
    -that's on your LAN, and your internet access is using NAT), then it won't
    -work.
    -
    -It used to work in 1.31, and it doesn't in 1.32. PunkBuster requires
    -reliable auth of the players. What you can do:
    -
    -- run a server with sv_strictauth 0 and you'll be able to join your
    -server. This will be the same behaviour as 1.31
    -
    -- connect to a server on the internet before you connect to your local
    -server (this will trigger your IP into the cache of the auth server for
    -15mn and let you in to your local server).
    -
    -- setup two NATs, one for your client one for your server and make sure
    -your server and Id's auth see the same IP. (this one ain't for network
    -setup newbies)
    -
    -Sys_Error: Couldn't load default.cfg / Sys_Error: -FS_FreeFile( NULL )
    -

    If you get one of these errors after installing Quake III Arena or Return -To Castle Wolfenstein, it means that the engine didn't find all the required -.pk3 files. Either you didn't copy them, or you copied them to the wrong -place. Check the INSTALL instructions for the game for more details, make -sure they are in baseq3/ for quake3 (missionpack/ for TA files) and main/ -for Return To Castle Wolfenstein.

    -I get ./setup.sh {: ==: binary -operator expected when running the setup?
    -
    -

    This is a known issue to 1.29h setups and prior. -It happens on systems with bash version < 2.*. There are several solutions:
    -- Upgrade bash to something more recent and run the setup again - Run the -setup with the --keep option. It will fail but it will leave a setup-full -directory. You can then copy the files manually from that dir. - Once you -used the --keep option above, you can edit setup.sh and replace occurences -of == by =. Then run setup.sh and the installer will execute.

    -The game doesn't -start, I have performance problems, etc.
    -

    The first thing to do is to check on the forums and various FAQs (this -one, but there are others. See the links). The Quake3World -forums have a great search function.

    -

    Before reporting the problem to me -make sure it's an issue with the game, and not an issue with your OS/OpenGL/sound -configuration. Common OS issues are listed in this FAQ. You should make sure -you have OpenGL configured correctly (by checking if gearsis running -for instance, and how well it runs). And see if non-Id linux games are running -fine too.

    -

    When you are going to report a bug, first make sure you are using the -latest version of the game. Include the game version in your report.

    -

    Include general information about your OS:
    -

    -
      -
    • Motherboard brand, CPU type, RAM
    • -
    • distribution name and version
    • -
    • kernel / OS info (from uname -a)
    • -
    • libc version (ls -l /lib/libc.so.*)
      - please specify if you can if the libc is your distribution's standard -version, or if you compiled yourself, and what binary target was used (x86, -or AMD, i686 etc.)
    • -
    -

    If it's a problem with the client, send the output of glxinfo.

    -

    If you have an nvidia board, send the output of cat /proc/nv/card0 -

    -

    Send output of the run:
    -run the game with +set developer 1 option, and send the output. You -can do something like quake3 +set developer 1 &>q3run.log.

    -

    If it's a crash, you can send a backtrace of the game running through -gdb.

    -

    You can also send a log of the game running with strace:

    -
    cd /usr/local/games/quake3
    strace -o ~/strace.log ./quake3.x86
    -

    NOTE: please avoid sending me the strace of /usr/local/games/quake3/quake3, -which is a shell script wrapper and probably no interest to your problem. -

    -Aureal sound drivers
    -
    -

    It seems that some versions of the Aureal sound drivers -don't work right with Q3. Last I heard, a kernel upgrade to 2.4.17 + Aureal -1.1.3, and/or using the old 1.1.1 drivers from Aureal's websitefixed -the problem.

    -

    If you need to know more about this, have a look at this Q3W forum thread.

    -The sound doesn't work / sound crashes
    -

    The first thing to check is that it is actually a sound related. Run -the game with +set s_initsound 0 and see what happens. All problems -reported so far about sound turned out to be OS/drivers. Listed below:

    -

    On some Mandrake distributions:
    -Check if you are running the enlightenment sound daemon (esd). With ps -aux | grep esdfor instance. It is a multiplexer for /dev/dsp, and might -block use of /dev/dsp by Quake III Arena. You can disable esd with esdctl -stop (as root).

    -

    Mandrake 8's default -sound drivers seem broken, installing the Alsa drivers or the - http://www.opensound.com drivers -fixes the problem.

    -

    Some beta Alsa drivers -have been reported to crash with Q3. Non-beta ones are fine.

    -

    VIA chipset and AC97 driver:
    -This combination is known to have various issues. They have been fixed in -recent drivers (thanks to Arne Schmitz for the heads up):
    -

    -
    http://sourceforge.net/projects/gkernel has got the up to date version of 
    the AC97 kernel driver. The current version can be found here:

    http://prdownloads.sourceforge.net/gkernel/via82cxxx-1.1.15.tar.gz

    It has working mmap sound, so Q3 shouldn't be a problem any more.
    -(thanks to Arne Schmitz for the heads up)

    - -Where can I report bugs and discuss about linux Quake III -Arena?
    -
    -

    Reports bugs to bugs@idsoftware.com. If you are pretty -sure this is a linux-only issue, you can shorten the loop by emailing ttimo@idsoftware.com directly.

    -

    You will find the discussion forums for linux Quake III Arena on -Quake3World forums. There is for sure a lot of other places to talk about -linux Quake III Arena, but this is the one we read regularly to track bugs -and common issues.

    -The *.so files are not in the setups? -(cgamei386.so qagamei386.so uii386.so)
    -
    -

    If you still have baseq3/*.so and missionpack/*.so -files, then those come from the earlier 1.27g beta installation and you should -REMOVE them. They were provided in 1.27g to go around a bug in the VM code, -which made win32 VMs incompatible with linux. This problem has been fixed -and the two files are no longer required.

    -

    If you are upgrading from 1.27g, it is likely that your -q3config.cfg files are set to use the native libraries (*.so files) -instead of the bytecode. Run quake3 with the following options to set things -right:
    -quake3 +set vm_game 2 +set vm_cgame 2 +set vm_ui 2

    -I get Sys_Error: -Sys_LoadDll(..) failed dlopen() completely!when running quake3?
    -
    -

    Try running quake3 with the following options:
    -quake3 +set vm_game 2 +set vm_cgame 2 +set vm_ui 2
    -You should also read the
    above answer.

    -I have an AMD CPU and a kernel 2.4.*, -Quake III Arena is slowing down to a complete stop after a while?
    -

    It seems the 3DNow! copy routines have issues with the southbridge chip -in the KT133A, this results in performances degrading while playing for a -while. Re-compile your kernel without 3DNow! instructions to avoid the problem, -and wait for newer kernels with better support for 3DNow! / KT133A.

    -How do I set up the gamma correction?
    -

    Starting with 1.29h, you can set the gamma correction with the brightness -slider in the graphical menu (under setup). On some older systems which don't -have the appropriate XFree86 extensions, you might have to set r_gamma -manually from the console, and issue a vid_restart command.

    -Servers don't show up in the ingame -browser -

    The reason for this has not been clearly identified yet, seems to be related -to upgrade from older versions. Deleting ~/.q3a/baseq3/q3config.cfg fixes -the problem (you will have to reconfigure your bindings)

    -Detected an attempt to write across -stack boundary -

    If Quake III Arena exits with the error "Detected an attempt to write -across stack boundary", this probably means that you are running libsafe -on this system. Quake III Arena is compiled with some options that confuse -libsafe, you should disable it before running. See this page for more details. -

    -libMesaVoodooGL.so -

    The GL driver for Voodoo cards (libMesaVoodoGL.so) used to be distributed -in older Q3 setups. This is no longer the case. If you have this .so -in your Quake III Arena directory (/usr/local/games/quake3), you should -remove it. Any recent/decent linux distribution should support your Voodoo -card out of the box, otherwise it is recommended that you setup XFree 4.* -and the correct DRI infrastructure for it.

    -Running a LAN dedicated server with -multiple network interfaces -

    A LAN dedicated server will use the net_ip cvar to identify the -NIC it is going to use (default is "localhost"). As it only opens one socket, -it is not possible to have a server broadcast it's packets on all the NICs. -This can be a problem if the server is serving games for a LAN and runs several -NICs to access the various sub networks.
    -

    -

    The following Linux kernel patch (2.4.19) was provided by Rogier Mulhujzen -and John Tobin, it will force broadcasts to be emitted on all interfaces:
    -udp_wide_broadcast.patch
    -udp_wide_README.txt
    -The equivalent patch for FreeBSD -is available too.
    -

    -Setup and execution on 64 bits CPUs
    -

    If you are running Linux on a 64 bit CPU (such as AMD's Opteron), and if your system is backwards compatible so that it can execute 32 bits x86 binaries, then the regular Quake III Arena binaries should work (your mileage may vary).

    -

    It's likely that the installer scripts will get confused though, and will refuse to install giving you an error: "This installation doesn't support glibc-2.1 on Linux / unknown". You will have to extract the game files manually by passing --keep on the command line when running the setup script. Once the files are unpacked, you will need to copy them manually to /usr/local/games. You probably want to have a working installation to refer to while doing this. This also applies to RTCW and ET

    -Links
    -

    The Linux Gamer's -faq is a very good resource for general Linux Gaming topics.

    -

    Also at icculus.org, -the old -Q3 FAQ from Loki Software.

    -

    Quake3World's -linux FAQ

    -
    - diff --git a/code/unix/LinuxSupport/udp_wide_README.txt b/code/unix/LinuxSupport/udp_wide_README.txt deleted file mode 100644 index ecd0b98..0000000 --- a/code/unix/LinuxSupport/udp_wide_README.txt +++ /dev/null @@ -1,20 +0,0 @@ -UDP Wide Broadcast Patch for Kernel 2.4.19 - -Main purpose is to allow Quake 3 servers, and all games powered by the -engine, to be visible in the server browser when the servers are being run on -aliased IP addresses and multiple NICs using the +set net_ip option. - -To apply the patch run "patch -p1 < udp_wide_broadcast.patch" from your -source directory and recompile. - -Add "echo "1" > /proc/sys/net/ipv4/udp_wide_broadcast" to one of your startup -scripts, i.e./etc/rc.d/rc.local, and run thousands of servers from your -computer. - - -Patch by: -Rogier Mulhujzen -John Tobin - -A patch with the same functionality for FreeBSD is available from -http://www.bsdchicks.com/patches diff --git a/code/unix/LinuxSupport/udp_wide_broadcast.patch b/code/unix/LinuxSupport/udp_wide_broadcast.patch deleted file mode 100644 index 2f1092e..0000000 --- a/code/unix/LinuxSupport/udp_wide_broadcast.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- linux/include/linux/sysctl.h.orig 2002-08-17 19:52:27.000000000 -0500 -+++ linux/include/linux/sysctl.h 2002-08-17 19:53:00.000000000 -0500 -@@ -291,7 +291,8 @@ - NET_IPV4_NONLOCAL_BIND=88, - NET_IPV4_ICMP_RATELIMIT=89, - NET_IPV4_ICMP_RATEMASK=90, -- NET_TCP_TW_REUSE=91 -+ NET_TCP_TW_REUSE=91, -+ NET_UDP_WIDE_BROADCAST=92 - }; - - enum { ---- linux-modified/net/ipv4/sysctl_net_ipv4.c.orig 2002-08-17 19:48:19.000000000 -0500 -+++ linux-modified/net/ipv4/sysctl_net_ipv4.c 2002-08-17 19:52:03.000000000 -0500 -@@ -45,6 +45,9 @@ - extern int inet_peer_gc_mintime; - extern int inet_peer_gc_maxtime; - -+/* From udp.c */ -+extern int sysctl_udp_wide_broadcast; -+ - #ifdef CONFIG_SYSCTL - static int tcp_retr1_max = 255; - static int ip_local_port_range_min[] = { 1, 1 }; -@@ -221,6 +224,8 @@ - &sysctl_icmp_ratemask, sizeof(int), 0644, NULL, &proc_dointvec}, - {NET_TCP_TW_REUSE, "tcp_tw_reuse", - &sysctl_tcp_tw_reuse, sizeof(int), 0644, NULL, &proc_dointvec}, -+ {NET_UDP_WIDE_BROADCAST, "udp_wide_broadcast", -+ &sysctl_udp_wide_broadcast, sizeof(int), 0644, NULL, &proc_dointvec}, - {0} - }; - ---- linux-modified/net/ipv4/udp.c.orig 2002-08-17 19:40:59.000000000 -0500 -+++ linux-modified/net/ipv4/udp.c 2002-08-17 23:37:47.000000000 -0500 -@@ -94,6 +94,8 @@ - #include - #include - -+int sysctl_udp_wide_broadcast = 0; -+ - /* - * Snmp MIB for the UDP layer - */ -@@ -272,9 +274,10 @@ - if ((s->num != hnum) || - (s->daddr && s->daddr!=rmt_addr) || - (s->dport != rmt_port && s->dport != 0) || -- (s->rcv_saddr && s->rcv_saddr != loc_addr) || -- (s->bound_dev_if && s->bound_dev_if != dif)) -+ !(sysctl_udp_wide_broadcast || !(s->rcv_saddr && s->rcv_saddr != loc_addr)) || -+ (s->bound_dev_if && s->bound_dev_if != dif)) { - continue; -+ } - break; - } - return s; diff --git a/code/unix/Makefile b/code/unix/Makefile deleted file mode 100644 index 0595cd4..0000000 --- a/code/unix/Makefile +++ /dev/null @@ -1,2119 +0,0 @@ -# -# Quake3 Unix Makefile -# -# Currently build for the following: -# Linux i386 (full client) -# Linux Alpha (dedicated server only) (TTimo: dropped) -# FreeBSD i386 (dedicated server only) (TTimo: maybe worth updating) -# SGI IRIX (full client) (TTimo: who's in charge - dropped otherwise) -# Linux PPC (full client) (TTimo: dropped) -# -# Nov '98 by Zoid -# -# Loki Hacking by Bernd Kreimeier -# and a little more by Ryan C. Gordon. -# and a little more by Rafael Barrero -# -# GNU Make required -# - -PLATFORM=$(shell uname|tr A-Z a-z) -PLATFORM_RELEASE=$(shell uname -r) - -### -### These paths are where you probably want to change things -### - -# Where we are building from (where the source code should be!) -MOUNT_DIR=../ - -# Where we are building to, libMesaVoodooGL.so.3.3 should be here, etc. -# the demo pk3 file should be here in demoq3/pak0.pk3 or baseq3/pak0.pk3 -BDIR=$(MOUNT_DIR)/../run - - -# Build name -# BUILD_NAME=$(BUILD_NAME) -BUILD_NAME=quake3.x86 - - - -############################################################################# -## -## You shouldn't have to touch anything below here -## -############################################################################# - -BASEQ3_DIR=$(BDIR)/baseq3 - -BD=debug$(ARCH)$(GLIBC) -BR=release$(ARCH)$(GLIBC) -CDIR=$(MOUNT_DIR)/client -SDIR=$(MOUNT_DIR)/server -RDIR=$(MOUNT_DIR)/renderer -CMDIR=$(MOUNT_DIR)/qcommon -UDIR=$(MOUNT_DIR)/unix -GDIR=$(MOUNT_DIR)/game -CGDIR=$(MOUNT_DIR)/cgame -BAIDIR=$(GDIR) -BLIBDIR=$(MOUNT_DIR)/botlib -NDIR=$(MOUNT_DIR)/null -UIDIR=$(MOUNT_DIR)/ui -Q3UIDIR=$(MOUNT_DIR)/q3_ui -FTDIR=$(MOUNT_DIR)/ft2 -JPDIR=$(MOUNT_DIR)/jpeg-6 -SPLNDIR=$(MOUNT_DIR)/splines - -# extract version info -VERSION=$(shell ./extract_ver.pl) -RPM_RELEASE=1 - -# NOTE: used by dcp rcp targets, not referenced -#TESTDIR=/home/timo/Id/Quake3-loki/run - -############################################################################# -# SETUP AND BUILD -- LINUX -############################################################################# - -## Defaults -DLL_ONLY=false -# bk010215 - TODO - add all defaults / kill Ryan - - -ifeq ($(PLATFORM),linux) - - ifneq (,$(findstring libc6,$(shell if [ -e /lib/libc.so.6* ];then echo libc6;fi))) - GLIBC=-glibc - else - GLIBC= - endif #libc6 test - - ifneq (,$(findstring alpha,$(shell uname -m))) - ARCH=axp - RPMARCH=alpha - VENDOR=dec - else - ifneq (,$(findstring ppc,$(shell uname -m))) - #used for linux builds - MESADIR=/usr/src/DRI-CVS/xc/xc/ - ARCH=ppc - RPMARCH=ppc - VENDOR=unknown - DLL_ONLY=true - else #default to i386 - MESADIR=../Mesa/ - ARCH=i386 - RPMARCH=i386 - VENDOR=unknown - DLL_ONLY=false - endif - endif - - # bk001205: no mo' -I/usr/include/glide, no FX - # bk001205: no mo' -Dstricmp=strcasecmp, see q_shared.h - BASE_CFLAGS = -pipe -fsigned-char - # rcg010216: DLL_ONLY for PPC - ifeq ($(strip $(DLL_ONLY)),true) - BASE_CFLAGS += -DDLL_ONLY - endif - - - #GL_CFLAGS = -I$(MESADIR)/include -I/usr/X11R6/include - GL_CFAGS = -I/usr/X11R6/include - - # bk001204 - need -O for -Wall for uninitialized - # bk001205 - took out -O to get assertions (NDEBUG) - # bk001206 - MALLOC_CHECK in addition to ZONE_DEBUG - # TTimo 03/30/2001 temporary took out -Werror for initial merge - DEBUG_CFLAGS = $(BASE_CFLAGS) -g -Wall -Werror - DEBUG_CFLAGS += -DNO_MOUSEGRAB - DEBUG_CFLAGS += -O -# DEBUG_CFLAGS=$(BASE_CFLAGS) -g -Wall -O - ifeq ($(ARCH),axp) - CC=pgcc - RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations - else - ifeq ($(ARCH),ppc) - NEWPGCC=/loki/global/ppc/bin/gcc - CC=$(NEWPGCC) - RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -fomit-frame-pointer -pipe -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce - else - #NEWPGCC=/usr/local/gcc-2.95.2/bin/gcc # bk001205 - #NEWPGCC=/loki/global/x86/bin/gcc - NEWPGCC=/usr/bin/gcc - CC=$(shell if [ -f $(NEWPGCC) ]; then echo $(NEWPGCC); else echo pgcc; fi ) - CXX=/usr/bin/g++ -# TTimo: legacy RELEASE_CFLAGS -# NOTE: the -fomit-frame-pointer option leads to an unstable binary on my test box if it was built on the main box -# but building on the Mdk 7.2 baseline seems to work - RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -fomit-frame-pointer -pipe -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce -# TTimo: use this for building on P3 gcc 2.95.3 libc2.2 for all targets (experimental! -fomit-fram-pointer removed) -# RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -pipe -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce - endif - endif - - LIBEXT=a - - SHLIBEXT=so - SHLIBCFLAGS=-fPIC - SHLIBLDFLAGS=-shared $(LDFLAGS) - - ARFLAGS=ar rv - RANLIB=ranlib - - THREAD_LDFLAGS=-lpthread - LDFLAGS=-ldl -lm - GLLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm - - ifeq ($(ARCH),axp) - TARGETS=\ - $(B)/$(PLATFORM)q3ded - else - TARGETS=\ - $(B)/$(PLATFORM)quake3 \ - $(B)/$(PLATFORM)quake3-smp \ - $(B)/$(PLATFORM)q3ded \ - $(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) \ - $(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) \ - $(B)/baseq3/ui$(ARCH).$(SHLIBEXT) \ - $(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) \ - $(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) \ - $(B)/missionpack/ui$(ARCH).$(SHLIBEXT) \ -# $(B)/baseq3/vm/qagame.qvm \ -# $(B)/baseq3/vm/cgame.qvm \ -# $(B)/baseq3/vm/ui.qvm \ -# $(B)/missionpack/vm/qagame.qvm \ -# $(B)/missionpack/vm/cgame.qvm \ -# $(B)/missionpack/vm/ui.qvm - endif - -## $(B)/$(PLATFORM)q3static \ - -else # ifeq Linux - -############################################################################# -# SETUP AND BUILD -- FREEBSD -############################################################################# - -ifeq ($(PLATFORM),freebsd) - -GLIBC= #libc is irrelevant - -ifneq (,$(findstring alpha,$(shell uname -m))) -ARCH=axp -RPMARCH=alpha -VENDOR=dec -else #default to i386 -ARCH=i386 -RPMARCH=i386 -VENDOR=unknown -endif #alpha test - - -BASE_CFLAGS = -pipe - -GL_CFLAGS = -I$(MESADIR)/include -I/usr/X11R6/include - -DEBUG_CFLAGS=$(BASE_CFLAGS) -g -Wall -Werror -ifeq ($(ARCH),axp) -CC=pgcc -RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -else -#NEWPGCC=/loki/global/x86/bin/gcc # raistlin012301 -#NEWPGCC=/usr/local/gcc-2.95.2/bin/gcc -NEWPGCC=/home/raistllin/src/gcc/build/install/bin/gcc -CC=$(shell if [ -f $(NEWPGCC) ]; then echo $(NEWPGCC); else echo pgcc; fi ) -RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -fomit-frame-pointer -pipe -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing - fstrength-reduce -endif - -LIBEXT=a - -SHLIBEXT=so -SHLIBCFLAGS=-fPIC -SHLIBLDFLAGS=-shared $(LDFLAGS) - -ARFLAGS=ar rv -RANLIB=ranlib - -THREAD_LDFLAGS=-lpthread -# don't need -ldl (FreeBSD) -LDFLAGS=-lm -#GLLDFLAGS=-L/usr/X11R6/lib -L$(MESADIR)/lib -lGL -lX11 -lXext -lXxf86dga -lXxf86vm -#GLLDFLAGS=-L/usr/X11/lib -lGL -lX11 -lXext -lm -GLLDFLAGS=-L/usr/X11R6/lib -lGL -lX11 -lXext -lXxf86dga -lXxf86vm - -ifeq ($(ARCH),axp) -TARGETS=\ - $(B)/$(PLATFORM)q3ded -else -TARGETS=\ - $(B)/$(PLATFORM)quake3 \ - $(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) \ - $(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) \ - $(B)/baseq3/ui$(ARCH).$(SHLIBEXT) \ - $(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) \ - $(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) \ - $(B)/missionpack/ui$(ARCH).$(SHLIBEXT) -endif - -else # ifeq freebsd - -############################################################################# -# SETUP AND BUILD -- IRIX -############################################################################# - -ifeq ($(PLATFORM),irix) - -ARCH=mips #default to MIPS -VENDOR=sgi -GLIBC= #libc is irrelevant - -CC=cc -BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 -mips3 \ - -nostdinc -I. -I$(ROOT)/usr/include -RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 -DEBUG_CFLAGS=$(BASE_CFLAGS) -g - -LIBEXT=a - -SHLIBEXT=so -SHLIBCFLAGS= -SHLIBLDFLAGS=-shared - -ARFLAGS=ar rv -RANLIB=ranlib - -LDFLAGS=-ldl -lm -GLLDFLAGS=-L/usr/X11/lib -lGL -lX11 -lXext -lm - -TARGETS=$(B)/sgiquake3 \ - $(B)/q3ded - -else # ifeq IRIX - -############################################################################# -# SETUP AND BUILD -- GENERIC -############################################################################# - -#CC=egcs -#BASE_CFLAGS=-Dstricmp=strcasecmp -#DEBUG_CFLAGS=$(BASE_CFLAGS) -g -#RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 - -LIBEXT=a - -SHLIBEXT=so -SHLIBCFLAGS=-fPIC -SHLIBLDFLAGS=-shared - -ARFLAGS=ar rv -RANLIB=ranlib - -ifeq ($(PLATFORM),freebsd) -LDFLAGS=-lm -else -LDFLAGS=-ldl -lm -endif # ifeq freebsd - -TARGETS=\ - $(B)/$(PLATFORM)q3ded - -endif #Linux -endif #FreeBSD -endif #IRIX - -DO_CC=$(CC) $(CFLAGS) -o $@ -c $< -DO_CXX=$(CXX) $(CFLAGS) -o $@ -c $< -DO_SMP_CC=$(CC) $(CFLAGS) -DSMP -o $@ -c $< -DO_BOT_CC=$(CC) $(CFLAGS) -DBOTLIB -o $@ -c $< # $(SHLIBCFLAGS) # bk001212 -DO_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) -o $@ -c $< -DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< -DO_SHLIB_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< -DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< -DO_NASM=nasm -f elf -o $@ $< -DO_DED_CC=$(CC) -DDEDICATED -DC_ONLY $(CFLAGS) -o $@ -c $< - -#DO_LCC=$(LCC) -o $@ -S -Wf-target=bytecode -Wf-g -DQ3_VM -I$(CGDIR) -I$(GDIR) -I$(UIDIR) $< - -#### DEFAULT TARGET -default:build_debug - -debug: build_debug -release: build_release - -build_debug: - $(MAKE) targets B=$(BD) CFLAGS="$(DEBUG_CFLAGS)" - -build_release: - $(MAKE) targets B=$(BR) CFLAGS="$(RELEASE_CFLAGS)" - -#Build both debug and release builds -all:build_debug build_release - -targets:makedirs $(TARGETS) - -makedirs: - @if [ ! -d $(B) ];then mkdir $(B);fi - @if [ ! -d $(B)/client ];then mkdir $(B)/client;fi - @if [ ! -d $(B)/ded ];then mkdir $(B)/ded;fi - @if [ ! -d $(B)/ref ];then mkdir $(B)/ref;fi - @if [ ! -d $(B)/ft2 ];then mkdir $(B)/ft2;fi - @if [ ! -d $(B)/baseq3 ];then mkdir $(B)/baseq3;fi - @if [ ! -d $(B)/baseq3/cgame ];then mkdir $(B)/baseq3/cgame;fi - @if [ ! -d $(B)/baseq3/game ];then mkdir $(B)/baseq3/game;fi - @if [ ! -d $(B)/baseq3/ui ];then mkdir $(B)/baseq3/ui;fi - @if [ ! -d $(B)/baseq3/vm ];then mkdir $(B)/baseq3/vm;fi - @if [ ! -d $(B)/missionpack ];then mkdir $(B)/missionpack;fi - @if [ ! -d $(B)/missionpack/cgame ];then mkdir $(B)/missionpack/cgame;fi - @if [ ! -d $(B)/missionpack/game ];then mkdir $(B)/missionpack/game;fi - @if [ ! -d $(B)/missionpack/ui ];then mkdir $(B)/missionpack/ui;fi - @if [ ! -d $(B)/missionpack/vm ];then mkdir $(B)/missionpack/vm;fi - @if [ ! -d $(B)/q3static ];then mkdir $(B)/q3static;fi - -############################################################################# -# CLIENT/SERVER -############################################################################# - -Q3OBJ = \ - $(B)/client/cl_cgame.o \ - $(B)/client/cl_cin.o \ - $(B)/client/cl_console.o \ - $(B)/client/cl_input.o \ - $(B)/client/cl_keys.o \ - $(B)/client/cl_main.o \ - $(B)/client/cl_net_chan.o \ - $(B)/client/cl_parse.o \ - $(B)/client/cl_scrn.o \ - $(B)/client/cl_ui.o \ - \ - $(B)/client/cm_load.o \ - $(B)/client/cm_patch.o \ - $(B)/client/cm_polylib.o \ - $(B)/client/cm_test.o \ - $(B)/client/cm_trace.o \ - \ - $(B)/client/cmd.o \ - $(B)/client/common.o \ - $(B)/client/cvar.o \ - $(B)/client/files.o \ - $(B)/client/md4.o \ - $(B)/client/msg.o \ - $(B)/client/net_chan.o \ - $(B)/client/huffman.o \ - \ - $(B)/client/snd_adpcm.o \ - $(B)/client/snd_dma.o \ - $(B)/client/snd_mem.o \ - $(B)/client/snd_mix.o \ - $(B)/client/snd_wavelet.o \ - \ - $(B)/client/sv_bot.o \ - $(B)/client/sv_ccmds.o \ - $(B)/client/sv_client.o \ - $(B)/client/sv_game.o \ - $(B)/client/sv_init.o \ - $(B)/client/sv_main.o \ - $(B)/client/sv_net_chan.o \ - $(B)/client/sv_snapshot.o \ - $(B)/client/sv_world.o \ - \ - $(B)/client/q_math.o \ - $(B)/client/q_shared.o \ - \ - $(B)/client/unzip.o \ - $(B)/client/vm.o \ - $(B)/client/vm_interpreted.o \ - \ - $(B)/client/be_aas_bspq3.o \ - $(B)/client/be_aas_cluster.o \ - $(B)/client/be_aas_debug.o \ - $(B)/client/be_aas_entity.o \ - $(B)/client/be_aas_file.o \ - $(B)/client/be_aas_main.o \ - $(B)/client/be_aas_move.o \ - $(B)/client/be_aas_optimize.o \ - $(B)/client/be_aas_reach.o \ - $(B)/client/be_aas_route.o \ - $(B)/client/be_aas_routealt.o \ - $(B)/client/be_aas_sample.o \ - $(B)/client/be_ai_char.o \ - $(B)/client/be_ai_chat.o \ - $(B)/client/be_ai_gen.o \ - $(B)/client/be_ai_goal.o \ - $(B)/client/be_ai_move.o \ - $(B)/client/be_ai_weap.o \ - $(B)/client/be_ai_weight.o \ - $(B)/client/be_ea.o \ - $(B)/client/be_interface.o \ - $(B)/client/l_crc.o \ - $(B)/client/l_libvar.o \ - $(B)/client/l_log.o \ - $(B)/client/l_memory.o \ - $(B)/client/l_precomp.o \ - $(B)/client/l_script.o \ - $(B)/client/l_struct.o \ - \ - $(B)/client/jcapimin.o \ - $(B)/client/jchuff.o \ - $(B)/client/jcinit.o \ - $(B)/client/jccoefct.o \ - $(B)/client/jccolor.o \ - $(B)/client/jfdctflt.o \ - $(B)/client/jcdctmgr.o \ - $(B)/client/jcphuff.o \ - $(B)/client/jcmainct.o \ - $(B)/client/jcmarker.o \ - $(B)/client/jcmaster.o \ - $(B)/client/jcomapi.o \ - $(B)/client/jcparam.o \ - $(B)/client/jcprepct.o \ - $(B)/client/jcsample.o \ - $(B)/client/jdapimin.o \ - $(B)/client/jdapistd.o \ - $(B)/client/jdatasrc.o \ - $(B)/client/jdcoefct.o \ - $(B)/client/jdcolor.o \ - $(B)/client/jddctmgr.o \ - $(B)/client/jdhuff.o \ - $(B)/client/jdinput.o \ - $(B)/client/jdmainct.o \ - $(B)/client/jdmarker.o \ - $(B)/client/jdmaster.o \ - $(B)/client/jdpostct.o \ - $(B)/client/jdsample.o \ - $(B)/client/jdtrans.o \ - $(B)/client/jerror.o \ - $(B)/client/jidctflt.o \ - $(B)/client/jmemmgr.o \ - $(B)/client/jmemnobs.o \ - $(B)/client/jutils.o \ - \ - $(B)/client/tr_animation.o \ - $(B)/client/tr_backend.o \ - $(B)/client/tr_bsp.o \ - $(B)/client/tr_cmds.o \ - $(B)/client/tr_curve.o \ - $(B)/client/tr_flares.o \ - $(B)/client/tr_font.o \ - $(B)/client/tr_image.o \ - $(B)/client/tr_init.o \ - $(B)/client/tr_light.o \ - $(B)/client/tr_main.o \ - $(B)/client/tr_marks.o \ - $(B)/client/tr_mesh.o \ - $(B)/client/tr_model.o \ - $(B)/client/tr_noise.o \ - $(B)/client/tr_scene.o \ - $(B)/client/tr_shade.o \ - $(B)/client/tr_shade_calc.o \ - $(B)/client/tr_shader.o \ - $(B)/client/tr_shadows.o \ - $(B)/client/tr_sky.o \ - $(B)/client/tr_surface.o \ - $(B)/client/tr_world.o \ - \ - $(B)/client/unix_main.o \ - $(B)/client/unix_net.o \ - $(B)/client/unix_shared.o \ - \ - $(B)/client/ahoptim.o \ - $(B)/client/autohint.o \ - $(B)/client/ftbase.o \ - $(B)/client/ftdebug.o \ - $(B)/client/ftglyph.o \ - $(B)/client/ftinit.o \ - $(B)/client/ftmm.o \ - $(B)/client/ftsystem.o \ - $(B)/client/raster1.o \ - $(B)/client/sfnt.o \ - $(B)/client/sfobjs.o \ - $(B)/client/smooth.o \ - $(B)/client/truetype.o -# \ -# $(B)/client/q_parse.o \ -# $(B)/client/math_quaternion.o \ -# $(B)/client/util_str.o \ -# $(B)/client/math_angles.o \ -# $(B)/client/math_vector.o \ -# $(B)/client/splines.o \ -# $(B)/client/math_matrix.o - -# $(B)/client/q_shared.o \ - - ifeq ($(ARCH),i386) - Q3OBJ += $(B)/client/vm_x86.o - endif - - ifeq ($(ARCH),ppc) - ifeq ($(DLL_ONLY),false) - Q3OBJ += $(B)/client/vm_ppc.o - endif - endif - -# $(B)/client/jctrans.o \ - -#platform specific objects -ifeq ($(PLATFORM),freebsd) - Q3POBJ=\ - $(B)/client/linux_common.o \ - $(B)/client/linux_qgl.o \ - $(B)/client/linux_glimp.o \ - $(B)/client/linux_snd.o \ - $(B)/client/snd_mixa.o \ - $(B)/client/matha.o \ - $(B)/client/ftol.o \ - $(B)/client/snapvector.o -else -ifeq ($(PLATFORM),irix) - Q3POBJ=\ - $(B)/client/irix_qgl.o \ - $(B)/client/irix_glimp.o \ - $(B)/client/irix_snd.o -else -ifeq ($(PLATFORM),linux) -ifeq ($(ARCH),axp) - Q3POBJ= -else - Q3POBJ=\ - $(B)/client/linux_common.o \ - $(B)/client/linux_qgl.o \ - $(B)/client/linux_glimp.o \ - $(B)/client/linux_joystick.o \ - $(B)/client/linux_snd.o \ - $(B)/client/snd_mixa.o \ - $(B)/client/matha.o \ - - Q3POBJ_SMP=\ - $(B)/client/linux_common.o \ - $(B)/client/linux_qgl.o \ - $(B)/client/linux_glimp_smp.o \ - $(B)/client/linux_joystick.o \ - $(B)/client/linux_snd.o \ - $(B)/client/snd_mixa.o \ - $(B)/client/matha.o - - ifeq ($(ARCH),i386) - Q3POBJ += $(B)/client/ftol.o $(B)/client/snapvector.o - Q3POBJ_SMP += $(B)/client/ftol.o $(B)/client/snapvector.o - endif - -endif -endif #Linux -endif #FreeBSD -endif #IRIX - -$(B)/$(PLATFORM)quake3 : $(Q3OBJ) $(Q3POBJ) - $(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(GLLDFLAGS) $(LDFLAGS) -# TTimo: splines code requires C++ linking, but splines have not been officially included in the codebase -# $(CXX) -o $@ $(Q3OBJ) $(Q3POBJ) $(GLLDFLAGS) $(LDFLAGS) - -$(B)/$(PLATFORM)quake3-smp : $(Q3OBJ) $(Q3POBJ_SMP) - $(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(GLLDFLAGS) \ - $(THREAD_LDFLAGS) $(LDFLAGS) - -$(B)/client/cl_cgame.o : $(CDIR)/cl_cgame.c; $(DO_CC) -$(B)/client/cl_cin.o : $(CDIR)/cl_cin.c; $(DO_CC) -$(B)/client/cl_console.o : $(CDIR)/cl_console.c; $(DO_CC) -$(B)/client/cl_input.o : $(CDIR)/cl_input.c; $(DO_CC) -$(B)/client/cl_keys.o : $(CDIR)/cl_keys.c; $(DO_CC) -$(B)/client/cl_main.o : $(CDIR)/cl_main.c; $(DO_CC) -$(B)/client/cl_net_chan.o : $(CDIR)/cl_net_chan.c; $(DO_CC) -$(B)/client/cl_parse.o : $(CDIR)/cl_parse.c; $(DO_CC) -$(B)/client/cl_scrn.o : $(CDIR)/cl_scrn.c; $(DO_CC) -$(B)/client/cl_ui.o : $(CDIR)/cl_ui.c; $(DO_CC) -$(B)/client/snd_adpcm.o : $(CDIR)/snd_adpcm.c; $(DO_CC) -$(B)/client/snd_dma.o : $(CDIR)/snd_dma.c; $(DO_CC) -$(B)/client/snd_mem.o : $(CDIR)/snd_mem.c; $(DO_CC) -$(B)/client/snd_mix.o : $(CDIR)/snd_mix.c; $(DO_CC) -$(B)/client/snd_wavelet.o : $(CDIR)/snd_wavelet.c; $(DO_CC) -$(B)/client/sv_bot.o : $(SDIR)/sv_bot.c; $(DO_CC) -$(B)/client/sv_client.o : $(SDIR)/sv_client.c; $(DO_CC) -$(B)/client/sv_ccmds.o : $(SDIR)/sv_ccmds.c; $(DO_CC) -$(B)/client/sv_game.o : $(SDIR)/sv_game.c; $(DO_CC) -$(B)/client/sv_init.o : $(SDIR)/sv_init.c; $(DO_CC) -$(B)/client/sv_main.o : $(SDIR)/sv_main.c; $(DO_CC) -$(B)/client/sv_net_chan.o : $(SDIR)/sv_net_chan.c; $(DO_CC) -$(B)/client/sv_snapshot.o : $(SDIR)/sv_snapshot.c; $(DO_CC) -$(B)/client/sv_world.o : $(SDIR)/sv_world.c; $(DO_CC) -$(B)/client/cm_trace.o : $(CMDIR)/cm_trace.c; $(DO_CC) -$(B)/client/cm_load.o : $(CMDIR)/cm_load.c; $(DO_CC) -$(B)/client/cm_test.o : $(CMDIR)/cm_test.c; $(DO_CC) -$(B)/client/cm_patch.o : $(CMDIR)/cm_patch.c; $(DO_CC) -$(B)/client/cm_polylib.o : $(CMDIR)/cm_polylib.c; $(DO_CC) -$(B)/client/cmd.o : $(CMDIR)/cmd.c; $(DO_CC) -$(B)/client/common.o : $(CMDIR)/common.c; $(DO_CC) -$(B)/client/cvar.o : $(CMDIR)/cvar.c; $(DO_CC) -$(B)/client/files.o : $(CMDIR)/files.c; $(DO_CC) -$(B)/client/md4.o : $(CMDIR)/md4.c; $(DO_CC) -$(B)/client/msg.o : $(CMDIR)/msg.c; $(DO_CC) -$(B)/client/net_chan.o : $(CMDIR)/net_chan.c; $(DO_CC) -$(B)/client/huffman.o : $(CMDIR)/huffman.c; $(DO_CC) -$(B)/client/q_shared.o : $(GDIR)/q_shared.c; $(DO_CC) -$(B)/client/q_math.o : $(GDIR)/q_math.c; $(DO_CC) - -$(B)/client/be_aas_bspq3.o : $(BLIBDIR)/be_aas_bspq3.c; $(DO_BOT_CC) -$(B)/client/be_aas_cluster.o : $(BLIBDIR)/be_aas_cluster.c; $(DO_BOT_CC) -$(B)/client/be_aas_debug.o : $(BLIBDIR)/be_aas_debug.c; $(DO_BOT_CC) -$(B)/client/be_aas_entity.o : $(BLIBDIR)/be_aas_entity.c; $(DO_BOT_CC) -$(B)/client/be_aas_file.o : $(BLIBDIR)/be_aas_file.c; $(DO_BOT_CC) -$(B)/client/be_aas_main.o : $(BLIBDIR)/be_aas_main.c; $(DO_BOT_CC) -$(B)/client/be_aas_move.o : $(BLIBDIR)/be_aas_move.c; $(DO_BOT_CC) -$(B)/client/be_aas_optimize.o : $(BLIBDIR)/be_aas_optimize.c; $(DO_BOT_CC) -$(B)/client/be_aas_reach.o : $(BLIBDIR)/be_aas_reach.c; $(DO_BOT_CC) -$(B)/client/be_aas_route.o : $(BLIBDIR)/be_aas_route.c; $(DO_BOT_CC) -$(B)/client/be_aas_routealt.o : $(BLIBDIR)/be_aas_routealt.c; $(DO_BOT_CC) -$(B)/client/be_aas_sample.o : $(BLIBDIR)/be_aas_sample.c; $(DO_BOT_CC) -$(B)/client/be_ai_char.o : $(BLIBDIR)/be_ai_char.c; $(DO_BOT_CC) -$(B)/client/be_ai_chat.o : $(BLIBDIR)/be_ai_chat.c; $(DO_BOT_CC) -$(B)/client/be_ai_gen.o : $(BLIBDIR)/be_ai_gen.c; $(DO_BOT_CC) -$(B)/client/be_ai_goal.o : $(BLIBDIR)/be_ai_goal.c; $(DO_BOT_CC) -$(B)/client/be_ai_move.o : $(BLIBDIR)/be_ai_move.c; $(DO_BOT_CC) -$(B)/client/be_ai_weap.o : $(BLIBDIR)/be_ai_weap.c; $(DO_BOT_CC) -$(B)/client/be_ai_weight.o : $(BLIBDIR)/be_ai_weight.c; $(DO_BOT_CC) -$(B)/client/be_ea.o : $(BLIBDIR)/be_ea.c; $(DO_BOT_CC) -$(B)/client/be_interface.o : $(BLIBDIR)/be_interface.c; $(DO_BOT_CC) -$(B)/client/l_crc.o : $(BLIBDIR)/l_crc.c; $(DO_BOT_CC) -$(B)/client/l_libvar.o : $(BLIBDIR)/l_libvar.c; $(DO_BOT_CC) -$(B)/client/l_log.o : $(BLIBDIR)/l_log.c; $(DO_BOT_CC) -$(B)/client/l_memory.o : $(BLIBDIR)/l_memory.c; $(DO_BOT_CC) -$(B)/client/l_precomp.o : $(BLIBDIR)/l_precomp.c; $(DO_BOT_CC) -$(B)/client/l_script.o : $(BLIBDIR)/l_script.c; $(DO_BOT_CC) -$(B)/client/l_struct.o : $(BLIBDIR)/l_struct.c; $(DO_BOT_CC) - -$(B)/client/jcapimin.o : $(JPDIR)/jcapimin.c; $(DO_CC) -$(B)/client/jchuff.o : $(JPDIR)/jchuff.c; $(DO_CC) -$(B)/client/jcinit.o : $(JPDIR)/jcinit.c; $(DO_CC) -$(B)/client/jccoefct.o : $(JPDIR)/jccoefct.c; $(DO_CC) -$(B)/client/jccolor.o : $(JPDIR)/jccolor.c; $(DO_CC) -$(B)/client/jfdctflt.o : $(JPDIR)/jfdctflt.c; $(DO_CC) -$(B)/client/jcdctmgr.o : $(JPDIR)/jcdctmgr.c; $(DO_CC) -$(B)/client/jcmainct.o : $(JPDIR)/jcmainct.c; $(DO_CC) -$(B)/client/jcmarker.o : $(JPDIR)/jcmarker.c; $(DO_CC) -$(B)/client/jcmaster.o : $(JPDIR)/jcmaster.c; $(DO_CC) -$(B)/client/jcomapi.o : $(JPDIR)/jcomapi.c; $(DO_CC) -$(B)/client/jcparam.o : $(JPDIR)/jcparam.c; $(DO_CC) -$(B)/client/jcprepct.o : $(JPDIR)/jcprepct.c; $(DO_CC) -$(B)/client/jcsample.o : $(JPDIR)/jcsample.c; $(DO_CC) - -$(B)/client/jdapimin.o : $(JPDIR)/jdapimin.c; $(DO_CC) -$(B)/client/jdapistd.o : $(JPDIR)/jdapistd.c; $(DO_CC) -$(B)/client/jdatasrc.o : $(JPDIR)/jdatasrc.c; $(DO_CC) -$(B)/client/jdcoefct.o : $(JPDIR)/jdcoefct.c; $(DO_CC) -$(B)/client/jdcolor.o : $(JPDIR)/jdcolor.c; $(DO_CC) -$(B)/client/jcphuff.o : $(JPDIR)/jcphuff.c; $(DO_CC) -$(B)/client/jddctmgr.o : $(JPDIR)/jddctmgr.c; $(DO_CC) -$(B)/client/jdhuff.o : $(JPDIR)/jdhuff.c; $(DO_CC) -$(B)/client/jdinput.o : $(JPDIR)/jdinput.c; $(DO_CC) -$(B)/client/jdmainct.o : $(JPDIR)/jdmainct.c; $(DO_CC) -$(B)/client/jdmarker.o : $(JPDIR)/jdmarker.c; $(DO_CC) -$(B)/client/jdmaster.o : $(JPDIR)/jdmaster.c; $(DO_CC) -$(B)/client/jdpostct.o : $(JPDIR)/jdpostct.c; $(DO_CC) -$(B)/client/jdsample.o : $(JPDIR)/jdsample.c; $(DO_CC) -$(B)/client/jdtrans.o : $(JPDIR)/jdtrans.c; $(DO_CC) -$(B)/client/jerror.o : $(JPDIR)/jerror.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/jidctflt.o : $(JPDIR)/jidctflt.c; $(DO_CC) -$(B)/client/jmemmgr.o : $(JPDIR)/jmemmgr.c; $(DO_CC) -$(B)/client/jmemnobs.o : $(JPDIR)/jmemnobs.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/jutils.o : $(JPDIR)/jutils.c; $(DO_CC) - -$(B)/client/tr_bsp.o : $(RDIR)/tr_bsp.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_animation.o : $(RDIR)/tr_animation.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_backend.o : $(RDIR)/tr_backend.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_cmds.o : $(RDIR)/tr_cmds.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_curve.o : $(RDIR)/tr_curve.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_flares.o : $(RDIR)/tr_flares.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_font.o : $(RDIR)/tr_font.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_image.o : $(RDIR)/tr_image.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_init.o : $(RDIR)/tr_init.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_light.o : $(RDIR)/tr_light.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_main.o : $(RDIR)/tr_main.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_marks.o : $(RDIR)/tr_marks.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_mesh.o : $(RDIR)/tr_mesh.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_model.o : $(RDIR)/tr_model.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_noise.o : $(RDIR)/tr_noise.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_scene.o : $(RDIR)/tr_scene.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_shade.o : $(RDIR)/tr_shade.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_shader.o : $(RDIR)/tr_shader.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_shade_calc.o : $(RDIR)/tr_shade_calc.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_shadows.o : $(RDIR)/tr_shadows.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_sky.o : $(RDIR)/tr_sky.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_smp.o : $(RDIR)/tr_smp.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_stripify.o : $(RDIR)/tr_stripify.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_subdivide.o : $(RDIR)/tr_subdivide.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_surface.o : $(RDIR)/tr_surface.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_world.o : $(RDIR)/tr_world.c; $(DO_CC) $(GL_CFLAGS) - -$(B)/client/unix_qgl.o : $(UDIR)/unix_qgl.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/unix_main.o : $(UDIR)/unix_main.c; $(DO_CC) -$(B)/client/unix_net.o : $(UDIR)/unix_net.c; $(DO_CC) -$(B)/client/unix_shared.o : $(UDIR)/unix_shared.c; $(DO_CC) -$(B)/client/irix_glimp.o : $(UDIR)/irix_glimp.c; $(DO_CC) -$(B)/client/irix_glimp_smp.o : $(UDIR)/irix_glimp.c; $(DO_SMP_CC) -$(B)/client/irix_snd.o : $(UDIR)/irix_snd.c; $(DO_CC) -$(B)/client/irix_input.o : $(UDIR)/irix_input.c; $(DO_CC) -$(B)/client/linux_common.o : $(UDIR)/linux_common.c; $(DO_CC) -$(B)/client/linux_glimp.o : $(UDIR)/linux_glimp.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/linux_glimp_smp.o : $(UDIR)/linux_glimp.c; $(DO_SMP_CC) $(GL_CFLAGS) -$(B)/client/linux_joystick.o : $(UDIR)/linux_joystick.c; $(DO_CC) -$(B)/client/linux_qgl.o : $(UDIR)/linux_qgl.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/linux_input.o : $(UDIR)/linux_input.c; $(DO_CC) -$(B)/client/linux_snd.o : $(UDIR)/linux_snd.c; $(DO_CC) -$(B)/client/snd_mixa.o : $(UDIR)/snd_mixa.s; $(DO_AS) -$(B)/client/matha.o : $(UDIR)/matha.s; $(DO_AS) - -ifeq ($(ARCH),i386) -$(B)/client/ftol.o : $(UDIR)/ftol.nasm; $(DO_NASM) -$(B)/client/snapvector.o : $(UDIR)/snapvector.nasm; $(DO_NASM) -$(B)/client/vm_x86.o : $(CMDIR)/vm_x86.c; $(DO_CC) -endif - -ifeq ($(ARCH),ppc) -ifeq ($(DLL_ONLY),false) -$(B)/client/vm_ppc.o : $(CMDIR)/vm_ppc.c; $(DO_CC) -endif -endif - -$(B)/client/unzip.o : $(CMDIR)/unzip.c; $(DO_CC) -$(B)/client/vm.o : $(CMDIR)/vm.c; $(DO_CC) -$(B)/client/vm_interpreted.o : $(CMDIR)/vm_interpreted.c; $(DO_CC) - -$(B)/client/ahoptim.o : $(FTDIR)/ahoptim.c; $(DO_CC) -$(B)/client/autohint.o : $(FTDIR)/autohint.c; $(DO_CC) -$(B)/client/ftbase.o : $(FTDIR)/ftbase.c; $(DO_CC) -$(B)/client/ftdebug.o : $(FTDIR)/ftdebug.c; $(DO_CC) -$(B)/client/ftglyph.o : $(FTDIR)/ftglyph.c; $(DO_CC) -$(B)/client/ftinit.o : $(FTDIR)/ftinit.c; $(DO_CC) -$(B)/client/ftmm.o : $(FTDIR)/ftmm.c; $(DO_CC) -$(B)/client/ftsystem.o : $(FTDIR)/ftsystem.c; $(DO_CC) -$(B)/client/raster1.o : $(FTDIR)/raster1.c; $(DO_CC) -DFT_FLAT_COMPILE -$(B)/client/sfnt.o : $(FTDIR)/sfnt.c; $(DO_CC) -$(B)/client/sfobjs.o : $(FTDIR)/sfobjs.c; $(DO_CC) -$(B)/client/smooth.o : $(FTDIR)/smooth.c; $(DO_CC) -DFT_FLAT_COMPILE -$(B)/client/truetype.o : $(FTDIR)/truetype.c; $(DO_CC) - -# TTimo: took out splines code -#$(B)/client/q_parse.o : $(SPLNDIR)/q_parse.cpp; $(DO_CXX) -#$(B)/client/math_quaternion.o : $(SPLNDIR)/math_quaternion.cpp; $(DO_CXX) -# TTimo: ignored -#$(B)/client/q_shared.o : $(SPLNDIR)/q_shared.cpp; $(DO_CXX) -#$(B)/client/util_str.o : $(SPLNDIR)/util_str.cpp; $(DO_CXX) -#$(B)/client/math_angles.o : $(SPLNDIR)/math_angles.cpp; $(DO_CXX) -#$(B)/client/math_vector.o : $(SPLNDIR)/math_vector.cpp; $(DO_CXX) -#$(B)/client/splines.o : $(SPLNDIR)/splines.cpp; $(DO_CXX) -#$(B)/client/math_matrix.o : $(SPLNDIR)/math_matrix.cpp; $(DO_CXX) - -## Included by raster1.c -# $(B)/client/ftraster.o : $(FTDIR)/ftraster.c; $(DO_CC) -# $(B)/client/ftrend1.o : $(FTDIR)/ftrend1.c; $(DO_CC) - -## Included by autohint.c -# $(B)/client/ahangles.o : $(FTDIR)/ahangles.c; $(DO_CC) -# $(B)/client/ahglyph.o : $(FTDIR)/ahglyph.c; $(DO_CC) -# $(B)/client/ahglobal.o : $(FTDIR)/ahglobal.c; $(DO_CC) -# $(B)/client/ahhint.o : $(FTDIR)/ahhint.c; $(DO_CC) -# $(B)/client/ahmodule.o : $(FTDIR)/ahmodule.c; $(DO_CC) - -## Included by ftcalc.c -# $(B)/client/ftcalc.o : $(FTDIR)/ftcalc.c; $(DO_CC) -# $(B)/client/ftobjs.o : $(FTDIR)/ftobjs.c; $(DO_CC) -# $(B)/client/ftstream.o : $(FTDIR)/ftstream.c; $(DO_CC) -# $(B)/client/ftlist.o : $(FTDIR)/ftlist.c; $(DO_CC) -# $(B)/client/ftoutln.o : $(FTDIR)/ftoutln.c; $(DO_CC) -# $(B)/client/ftextend.o : $(FTDIR)/ftextend.c; $(DO_CC) -# $(B)/client/ftnames.o : $(FTDIR)/ftnames.c; $(DO_CC) - -## Included by sfnt.c -# $(B)/client/ttload.o : $(FTDIR)/ttload.c; $(DO_CC) -# $(B)/client/ttcmap.o : $(FTDIR)/ttcmap.c; $(DO_CC) -# $(B)/client/sfobjs.o : $(FTDIR)/sfobjs.c; $(DO_CC) -# $(B)/client/sfdriver.o : $(FTDIR)/sfdriver.c; $(DO_CC) -## Unused in sfnt.c -# $(B)/client/ttpost.o : $(FTDIR)/ttpost.c; $(DO_CC) -# $(B)/client/ttsbit.o : $(FTDIR)/ttsbit.c; $(DO_CC) - -## Included by truetype.c -# $(B)/client/ttdriver.o : $(FTDIR)/ttdriver.c; $(DO_CC) -# $(B)/client/ttgload.o : $(FTDIR)/ttgload.c; $(DO_CC) -# $(B)/client/ttobjs.o : $(FTDIR)/ttobjs.c; $(DO_CC) -# $(B)/client/ttpload.o : $(FTDIR)/ttpload.c; $(DO_CC) -## Unused in truetype.c -# $(B)/client/ttinterp.o : $(FTDIR)/ttinterp.c; $(DO_CC) - -## Included by smooth.c -# $(B)/client/ftsmooth.o : $(FTDIR)/ftsmooth.c; $(DO_CC) -DFT_FLAT_COMPILE -# $(B)/client/ftgrays.o : $(FTDIR)/ftgrays.c; $(DO_CC) - -############################################################################# -# DEDICATED SERVER -############################################################################# - -Q3DOBJ = \ - $(B)/ded/sv_bot.o \ - $(B)/ded/sv_client.o \ - $(B)/ded/sv_ccmds.o \ - $(B)/ded/sv_game.o \ - $(B)/ded/sv_init.o \ - $(B)/ded/sv_main.o \ - $(B)/ded/sv_net_chan.o \ - $(B)/ded/sv_snapshot.o \ - $(B)/ded/sv_world.o \ - \ - $(B)/ded/cm_load.o \ - $(B)/ded/cm_patch.o \ - $(B)/ded/cm_polylib.o \ - $(B)/ded/cm_test.o \ - $(B)/ded/cm_trace.o \ - $(B)/ded/cmd.o \ - $(B)/ded/common.o \ - $(B)/ded/cvar.o \ - $(B)/ded/files.o \ - $(B)/ded/md4.o \ - $(B)/ded/msg.o \ - $(B)/ded/net_chan.o \ - $(B)/ded/huffman.o \ - \ - $(B)/ded/q_math.o \ - $(B)/ded/q_shared.o \ - \ - $(B)/ded/unzip.o \ - $(B)/ded/vm.o \ - $(B)/ded/vm_interpreted.o \ - \ - $(B)/ded/be_aas_bspq3.o \ - $(B)/ded/be_aas_cluster.o \ - $(B)/ded/be_aas_debug.o \ - $(B)/ded/be_aas_entity.o \ - $(B)/ded/be_aas_file.o \ - $(B)/ded/be_aas_main.o \ - $(B)/ded/be_aas_move.o \ - $(B)/ded/be_aas_optimize.o \ - $(B)/ded/be_aas_reach.o \ - $(B)/ded/be_aas_route.o \ - $(B)/ded/be_aas_routealt.o \ - $(B)/ded/be_aas_sample.o \ - $(B)/ded/be_ai_char.o \ - $(B)/ded/be_ai_chat.o \ - $(B)/ded/be_ai_gen.o \ - $(B)/ded/be_ai_goal.o \ - $(B)/ded/be_ai_move.o \ - $(B)/ded/be_ai_weap.o \ - $(B)/ded/be_ai_weight.o \ - $(B)/ded/be_ea.o \ - $(B)/ded/be_interface.o \ - $(B)/ded/l_crc.o \ - $(B)/ded/l_libvar.o \ - $(B)/ded/l_log.o \ - $(B)/ded/l_memory.o \ - $(B)/ded/l_precomp.o \ - $(B)/ded/l_script.o \ - $(B)/ded/l_struct.o \ - \ - $(B)/ded/linux_common.o \ - $(B)/ded/unix_main.o \ - $(B)/ded/unix_net.o \ - $(B)/ded/unix_shared.o \ - \ - $(B)/ded/null_client.o \ - $(B)/ded/null_input.o \ - $(B)/ded/null_snddma.o - -ifeq ($(ARCH),i386) - Q3DOBJ += $(B)/ded/vm_x86.o $(B)/ded/ftol.o $(B)/ded/snapvector.o -endif - -ifeq ($(ARCH),ppc) - ifeq ($(DLL_ONLY),false) - Q3DOBJ += $(B)/ded/vm_ppc.o - endif -endif - -$(B)/$(PLATFORM)q3ded : $(Q3DOBJ) - $(CC) -o $@ $(Q3DOBJ) $(LDFLAGS) - -$(B)/ded/sv_bot.o : $(SDIR)/sv_bot.c; $(DO_DED_CC) -$(B)/ded/sv_client.o : $(SDIR)/sv_client.c; $(DO_DED_CC) -$(B)/ded/sv_ccmds.o : $(SDIR)/sv_ccmds.c; $(DO_DED_CC) -$(B)/ded/sv_game.o : $(SDIR)/sv_game.c; $(DO_DED_CC) -$(B)/ded/sv_init.o : $(SDIR)/sv_init.c; $(DO_DED_CC) -$(B)/ded/sv_main.o : $(SDIR)/sv_main.c; $(DO_DED_CC) -$(B)/ded/sv_net_chan.o : $(SDIR)/sv_net_chan.c; $(DO_DED_CC) -$(B)/ded/sv_snapshot.o : $(SDIR)/sv_snapshot.c; $(DO_DED_CC) -$(B)/ded/sv_world.o : $(SDIR)/sv_world.c; $(DO_DED_CC) -$(B)/ded/cm_load.o : $(CMDIR)/cm_load.c; $(DO_DED_CC) -$(B)/ded/cm_polylib.o : $(CMDIR)/cm_polylib.c; $(DO_DED_CC) -$(B)/ded/cm_test.o : $(CMDIR)/cm_test.c; $(DO_DED_CC) -$(B)/ded/cm_trace.o : $(CMDIR)/cm_trace.c; $(DO_DED_CC) -$(B)/ded/cm_patch.o : $(CMDIR)/cm_patch.c; $(DO_DED_CC) -$(B)/ded/cmd.o : $(CMDIR)/cmd.c; $(DO_DED_CC) -$(B)/ded/common.o : $(CMDIR)/common.c; $(DO_DED_CC) -$(B)/ded/cvar.o : $(CMDIR)/cvar.c; $(DO_DED_CC) -$(B)/ded/files.o : $(CMDIR)/files.c; $(DO_DED_CC) -$(B)/ded/md4.o : $(CMDIR)/md4.c; $(DO_DED_CC) -$(B)/ded/msg.o : $(CMDIR)/msg.c; $(DO_DED_CC) -$(B)/ded/net_chan.o : $(CMDIR)/net_chan.c; $(DO_DED_CC) -$(B)/ded/huffman.o : $(CMDIR)/huffman.c; $(DO_DED_CC) -$(B)/ded/q_shared.o : $(GDIR)/q_shared.c; $(DO_DED_CC) -$(B)/ded/q_math.o : $(GDIR)/q_math.c; $(DO_DED_CC) - -$(B)/ded/be_aas_bspq3.o : $(BLIBDIR)/be_aas_bspq3.c; $(DO_BOT_CC) -$(B)/ded/be_aas_cluster.o : $(BLIBDIR)/be_aas_cluster.c; $(DO_BOT_CC) -$(B)/ded/be_aas_debug.o : $(BLIBDIR)/be_aas_debug.c; $(DO_BOT_CC) -$(B)/ded/be_aas_entity.o : $(BLIBDIR)/be_aas_entity.c; $(DO_BOT_CC) -$(B)/ded/be_aas_file.o : $(BLIBDIR)/be_aas_file.c; $(DO_BOT_CC) -$(B)/ded/be_aas_main.o : $(BLIBDIR)/be_aas_main.c; $(DO_BOT_CC) -$(B)/ded/be_aas_move.o : $(BLIBDIR)/be_aas_move.c; $(DO_BOT_CC) -$(B)/ded/be_aas_optimize.o : $(BLIBDIR)/be_aas_optimize.c; $(DO_BOT_CC) -$(B)/ded/be_aas_reach.o : $(BLIBDIR)/be_aas_reach.c; $(DO_BOT_CC) -$(B)/ded/be_aas_route.o : $(BLIBDIR)/be_aas_route.c; $(DO_BOT_CC) -$(B)/ded/be_aas_routealt.o : $(BLIBDIR)/be_aas_routealt.c; $(DO_BOT_CC) -$(B)/ded/be_aas_sample.o : $(BLIBDIR)/be_aas_sample.c; $(DO_BOT_CC) -$(B)/ded/be_ai_char.o : $(BLIBDIR)/be_ai_char.c; $(DO_BOT_CC) -$(B)/ded/be_ai_chat.o : $(BLIBDIR)/be_ai_chat.c; $(DO_BOT_CC) -$(B)/ded/be_ai_gen.o : $(BLIBDIR)/be_ai_gen.c; $(DO_BOT_CC) -$(B)/ded/be_ai_goal.o : $(BLIBDIR)/be_ai_goal.c; $(DO_BOT_CC) -$(B)/ded/be_ai_move.o : $(BLIBDIR)/be_ai_move.c; $(DO_BOT_CC) -$(B)/ded/be_ai_weap.o : $(BLIBDIR)/be_ai_weap.c; $(DO_BOT_CC) -$(B)/ded/be_ai_weight.o : $(BLIBDIR)/be_ai_weight.c; $(DO_BOT_CC) -$(B)/ded/be_ea.o : $(BLIBDIR)/be_ea.c; $(DO_BOT_CC) -$(B)/ded/be_interface.o : $(BLIBDIR)/be_interface.c; $(DO_BOT_CC) -$(B)/ded/l_crc.o : $(BLIBDIR)/l_crc.c; $(DO_BOT_CC) -$(B)/ded/l_libvar.o : $(BLIBDIR)/l_libvar.c; $(DO_BOT_CC) -$(B)/ded/l_log.o : $(BLIBDIR)/l_log.c; $(DO_BOT_CC) -$(B)/ded/l_memory.o : $(BLIBDIR)/l_memory.c; $(DO_BOT_CC) -$(B)/ded/l_precomp.o : $(BLIBDIR)/l_precomp.c; $(DO_BOT_CC) -$(B)/ded/l_script.o : $(BLIBDIR)/l_script.c; $(DO_BOT_CC) -$(B)/ded/l_struct.o : $(BLIBDIR)/l_struct.c; $(DO_BOT_CC) - -$(B)/ded/linux_common.o : $(UDIR)/linux_common.c; $(DO_CC) -$(B)/ded/unix_main.o : $(UDIR)/unix_main.c; $(DO_DED_CC) -$(B)/ded/unix_net.o : $(UDIR)/unix_net.c; $(DO_DED_CC) -$(B)/ded/unix_shared.o : $(UDIR)/unix_shared.c; $(DO_DED_CC) -$(B)/ded/null_client.o : $(NDIR)/null_client.c; $(DO_DED_CC) -$(B)/ded/null_input.o : $(NDIR)/null_input.c; $(DO_DED_CC) -$(B)/ded/null_snddma.o : $(NDIR)/null_snddma.c; $(DO_DED_CC) -$(B)/ded/unzip.o : $(CMDIR)/unzip.c; $(DO_DED_CC) -$(B)/ded/vm.o : $(CMDIR)/vm.c; $(DO_DED_CC) -$(B)/ded/vm_interpreted.o : $(CMDIR)/vm_interpreted.c; $(DO_DED_CC) - -ifeq ($(ARCH),i386) -$(B)/ded/vm_x86.o : $(CMDIR)/vm_x86.c; $(DO_DED_CC) -$(B)/ded/ftol.o : $(UDIR)/ftol.nasm; $(DO_NASM) -$(B)/ded/snapvector.o : $(UDIR)/snapvector.nasm; $(DO_NASM) -endif - -ifeq ($(ARCH),ppc) -ifeq ($(DLL_ONLY),false) -$(B)/ded/vm_ppc.o : $(CMDIR)/vm_ppc.c; $(DO_DED_CC) -endif -endif - - -############################################################################# -## QVM -############################################################################# - -$(B)/baseq3/vm/cgame.qvm: - cd $(CGDIR) && ./cgame.sh - mv /tmp/quake3/baseq3/vm/cgame.qvm $@ - -$(B)/baseq3/vm/ui.qvm: - cd $(Q3UIDIR) && ./q3_ui.sh - mv /tmp/quake3/baseq3/vm/ui.qvm $@ - -$(B)/baseq3/vm/qagame.qvm: - cd $(GDIR) && ./game.sh - mv /tmp/quake3/baseq3/vm/qagame.qvm $@ - -$(B)/missionpack/vm/cgame.qvm: - cd $(CGDIR) && ./cgame_ta.sh - mv /tmp/quake3/missionpack/vm/cgame.qvm $@ - -$(B)/missionpack/vm/qagame.qvm: - cd $(GDIR) && ./game_ta.sh - mv /tmp/quake3/missionpack/vm/qagame.qvm $@ - -$(B)/missionpack/vm/ui.qvm: - cd $(UIDIR) && ./ui.sh - mv /tmp/quake3/missionpack/vm/ui.qvm $@ - - - -############################################################################# -## BASEQ3 CGAME -############################################################################# - -Q3CGOBJ = \ - $(B)/baseq3/cgame/bg_misc.o \ - $(B)/baseq3/cgame/bg_pmove.o \ - $(B)/baseq3/cgame/bg_slidemove.o \ - $(B)/baseq3/cgame/cg_consolecmds.o \ - $(B)/baseq3/cgame/cg_draw.o \ - $(B)/baseq3/cgame/cg_drawtools.o \ - $(B)/baseq3/cgame/cg_effects.o \ - $(B)/baseq3/cgame/cg_ents.o \ - $(B)/baseq3/cgame/cg_event.o \ - $(B)/baseq3/cgame/cg_info.o \ - $(B)/baseq3/cgame/cg_localents.o \ - $(B)/baseq3/cgame/cg_main.o \ - $(B)/baseq3/cgame/cg_marks.o \ - $(B)/baseq3/cgame/cg_players.o \ - $(B)/baseq3/cgame/cg_playerstate.o \ - $(B)/baseq3/cgame/cg_predict.o \ - $(B)/baseq3/cgame/cg_scoreboard.o \ - $(B)/baseq3/cgame/cg_servercmds.o \ - $(B)/baseq3/cgame/cg_snapshot.o \ - $(B)/baseq3/cgame/cg_syscalls.o \ - $(B)/baseq3/cgame/cg_view.o \ - $(B)/baseq3/cgame/cg_weapons.o \ - $(B)/baseq3/cgame/q_math.o \ - $(B)/baseq3/cgame/q_shared.o - -$(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) : $(Q3CGOBJ) - $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) - -$(B)/baseq3/cgame/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/bg_pmove.o : $(GDIR)/bg_pmove.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/bg_slidemove.o : $(GDIR)/bg_slidemove.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_consolecmds.o : $(CGDIR)/cg_consolecmds.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_draw.o : $(CGDIR)/cg_draw.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_drawtools.o : $(CGDIR)/cg_drawtools.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_effects.o : $(CGDIR)/cg_effects.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_ents.o : $(CGDIR)/cg_ents.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_event.o : $(CGDIR)/cg_event.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_info.o : $(CGDIR)/cg_info.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_localents.o : $(CGDIR)/cg_localents.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_main.o : $(CGDIR)/cg_main.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_marks.o : $(CGDIR)/cg_marks.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_players.o : $(CGDIR)/cg_players.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_playerstate.o : $(CGDIR)/cg_playerstate.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_predict.o : $(CGDIR)/cg_predict.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_scoreboard.o : $(CGDIR)/cg_scoreboard.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_servercmds.o : $(CGDIR)/cg_servercmds.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_snapshot.o : $(CGDIR)/cg_snapshot.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_syscalls.o : $(CGDIR)/cg_syscalls.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_view.o : $(CGDIR)/cg_view.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/cg_weapons.o : $(CGDIR)/cg_weapons.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/q_math.o : $(GDIR)/q_math.c; $(DO_SHLIB_CC) -$(B)/baseq3/cgame/q_shared.o : $(GDIR)/q_shared.c; $(DO_SHLIB_CC) - -############################################################################# -## MISSIONPACK CGAME -############################################################################# - -MPCGOBJ = \ - $(B)/missionpack/cgame/bg_misc.o \ - $(B)/missionpack/cgame/bg_pmove.o \ - $(B)/missionpack/cgame/bg_slidemove.o \ - $(B)/missionpack/cgame/cg_consolecmds.o \ - $(B)/missionpack/cgame/cg_newdraw.o \ - $(B)/missionpack/cgame/cg_draw.o \ - $(B)/missionpack/cgame/cg_drawtools.o \ - $(B)/missionpack/cgame/cg_effects.o \ - $(B)/missionpack/cgame/cg_ents.o \ - $(B)/missionpack/cgame/cg_event.o \ - $(B)/missionpack/cgame/cg_info.o \ - $(B)/missionpack/cgame/cg_localents.o \ - $(B)/missionpack/cgame/cg_main.o \ - $(B)/missionpack/cgame/cg_marks.o \ - $(B)/missionpack/cgame/cg_players.o \ - $(B)/missionpack/cgame/cg_playerstate.o \ - $(B)/missionpack/cgame/cg_predict.o \ - $(B)/missionpack/cgame/cg_scoreboard.o \ - $(B)/missionpack/cgame/cg_servercmds.o \ - $(B)/missionpack/cgame/cg_snapshot.o \ - $(B)/missionpack/cgame/cg_syscalls.o \ - $(B)/missionpack/cgame/cg_view.o \ - $(B)/missionpack/cgame/cg_weapons.o \ - $(B)/missionpack/cgame/q_math.o \ - $(B)/missionpack/cgame/q_shared.o \ - $(B)/missionpack/cgame/ui_shared.o - -$(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) : $(MPCGOBJ) - $(CC) $(SHLIBLDFLAGS) -o $@ $(MPCGOBJ) - -$(B)/missionpack/cgame/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/bg_pmove.o : $(GDIR)/bg_pmove.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/bg_slidemove.o : $(GDIR)/bg_slidemove.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_consolecmds.o : $(CGDIR)/cg_consolecmds.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_newdraw.o : $(CGDIR)/cg_newdraw.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_draw.o : $(CGDIR)/cg_draw.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_drawtools.o : $(CGDIR)/cg_drawtools.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_effects.o : $(CGDIR)/cg_effects.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_ents.o : $(CGDIR)/cg_ents.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_event.o : $(CGDIR)/cg_event.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_info.o : $(CGDIR)/cg_info.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_localents.o : $(CGDIR)/cg_localents.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_main.o : $(CGDIR)/cg_main.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_marks.o : $(CGDIR)/cg_marks.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_players.o : $(CGDIR)/cg_players.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_playerstate.o : $(CGDIR)/cg_playerstate.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_predict.o : $(CGDIR)/cg_predict.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_scoreboard.o : $(CGDIR)/cg_scoreboard.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_servercmds.o : $(CGDIR)/cg_servercmds.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_snapshot.o : $(CGDIR)/cg_snapshot.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_syscalls.o : $(CGDIR)/cg_syscalls.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_view.o : $(CGDIR)/cg_view.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/cg_weapons.o : $(CGDIR)/cg_weapons.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/q_math.o : $(GDIR)/q_math.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/q_shared.o : $(GDIR)/q_shared.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/cgame/ui_shared.o : $(UIDIR)/ui_shared.c; $(DO_SHLIB_CC) -DMISSIONPACK - - - -############################################################################# -## BASEQ3 GAME -############################################################################# - -Q3GOBJ = \ - $(B)/baseq3/game/ai_chat.o \ - $(B)/baseq3/game/ai_cmd.o \ - $(B)/baseq3/game/ai_dmnet.o \ - $(B)/baseq3/game/ai_dmq3.o \ - $(B)/baseq3/game/ai_main.o \ - $(B)/baseq3/game/ai_team.o \ - $(B)/baseq3/game/ai_vcmd.o \ - $(B)/baseq3/game/bg_misc.o \ - $(B)/baseq3/game/bg_pmove.o \ - $(B)/baseq3/game/bg_slidemove.o \ - $(B)/baseq3/game/g_active.o \ - $(B)/baseq3/game/g_arenas.o \ - $(B)/baseq3/game/g_bot.o \ - $(B)/baseq3/game/g_client.o \ - $(B)/baseq3/game/g_cmds.o \ - $(B)/baseq3/game/g_combat.o \ - $(B)/baseq3/game/g_items.o \ - $(B)/baseq3/game/g_main.o \ - $(B)/baseq3/game/g_mem.o \ - $(B)/baseq3/game/g_misc.o \ - $(B)/baseq3/game/g_missile.o \ - $(B)/baseq3/game/g_mover.o \ - $(B)/baseq3/game/g_session.o \ - $(B)/baseq3/game/g_spawn.o \ - $(B)/baseq3/game/g_svcmds.o \ - $(B)/baseq3/game/g_syscalls.o \ - $(B)/baseq3/game/g_target.o \ - $(B)/baseq3/game/g_team.o \ - $(B)/baseq3/game/g_trigger.o \ - $(B)/baseq3/game/g_utils.o \ - $(B)/baseq3/game/g_weapon.o \ - \ - $(B)/baseq3/game/q_math.o \ - $(B)/baseq3/game/q_shared.o - -$(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) : $(Q3GOBJ) - $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) - -$(B)/baseq3/game/ai_chat.o : $(GDIR)/ai_chat.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/ai_cmd.o : $(GDIR)/ai_cmd.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/ai_dmnet.o : $(GDIR)/ai_dmnet.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/ai_dmq3.o : $(GDIR)/ai_dmq3.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/ai_main.o : $(GDIR)/ai_main.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/ai_team.o : $(GDIR)/ai_team.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/ai_vcmd.o : $(GDIR)/ai_vcmd.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/bg_pmove.o : $(GDIR)/bg_pmove.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/bg_slidemove.o : $(GDIR)/bg_slidemove.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_active.o : $(GDIR)/g_active.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_arenas.o : $(GDIR)/g_arenas.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_bot.o : $(GDIR)/g_bot.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_client.o : $(GDIR)/g_client.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_cmds.o : $(GDIR)/g_cmds.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_combat.o : $(GDIR)/g_combat.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_items.o : $(GDIR)/g_items.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_main.o : $(GDIR)/g_main.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_mem.o : $(GDIR)/g_mem.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_misc.o : $(GDIR)/g_misc.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_missile.o : $(GDIR)/g_missile.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_mover.o : $(GDIR)/g_mover.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_session.o : $(GDIR)/g_session.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_spawn.o : $(GDIR)/g_spawn.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_svcmds.o : $(GDIR)/g_svcmds.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_syscalls.o : $(GDIR)/g_syscalls.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_target.o : $(GDIR)/g_target.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_team.o : $(GDIR)/g_team.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_trigger.o : $(GDIR)/g_trigger.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_utils.o : $(GDIR)/g_utils.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/g_weapon.o : $(GDIR)/g_weapon.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/q_math.o : $(GDIR)/q_math.c; $(DO_SHLIB_CC) -$(B)/baseq3/game/q_shared.o : $(GDIR)/q_shared.c; $(DO_SHLIB_CC) - - -############################################################################# -## MISSIONPACK GAME -############################################################################# - -MPGOBJ = \ - $(B)/missionpack/game/ai_chat.o \ - $(B)/missionpack/game/ai_cmd.o \ - $(B)/missionpack/game/ai_dmnet.o \ - $(B)/missionpack/game/ai_dmq3.o \ - $(B)/missionpack/game/ai_main.o \ - $(B)/missionpack/game/ai_team.o \ - $(B)/missionpack/game/ai_vcmd.o \ - $(B)/missionpack/game/bg_misc.o \ - $(B)/missionpack/game/bg_pmove.o \ - $(B)/missionpack/game/bg_slidemove.o \ - $(B)/missionpack/game/g_active.o \ - $(B)/missionpack/game/g_arenas.o \ - $(B)/missionpack/game/g_bot.o \ - $(B)/missionpack/game/g_client.o \ - $(B)/missionpack/game/g_cmds.o \ - $(B)/missionpack/game/g_combat.o \ - $(B)/missionpack/game/g_items.o \ - $(B)/missionpack/game/g_main.o \ - $(B)/missionpack/game/g_mem.o \ - $(B)/missionpack/game/g_misc.o \ - $(B)/missionpack/game/g_missile.o \ - $(B)/missionpack/game/g_mover.o \ - $(B)/missionpack/game/g_session.o \ - $(B)/missionpack/game/g_spawn.o \ - $(B)/missionpack/game/g_svcmds.o \ - $(B)/missionpack/game/g_syscalls.o \ - $(B)/missionpack/game/g_target.o \ - $(B)/missionpack/game/g_team.o \ - $(B)/missionpack/game/g_trigger.o \ - $(B)/missionpack/game/g_utils.o \ - $(B)/missionpack/game/g_weapon.o \ - \ - $(B)/missionpack/game/q_math.o \ - $(B)/missionpack/game/q_shared.o - -$(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) : $(MPGOBJ) - $(CC) $(SHLIBLDFLAGS) -o $@ $(MPGOBJ) - -$(B)/missionpack/game/ai_chat.o : $(GDIR)/ai_chat.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/ai_cmd.o : $(GDIR)/ai_cmd.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/ai_dmnet.o : $(GDIR)/ai_dmnet.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/ai_dmq3.o : $(GDIR)/ai_dmq3.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/ai_main.o : $(GDIR)/ai_main.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/ai_team.o : $(GDIR)/ai_team.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/ai_vcmd.o : $(GDIR)/ai_vcmd.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/bg_pmove.o : $(GDIR)/bg_pmove.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/bg_slidemove.o : $(GDIR)/bg_slidemove.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_active.o : $(GDIR)/g_active.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_arenas.o : $(GDIR)/g_arenas.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_bot.o : $(GDIR)/g_bot.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_client.o : $(GDIR)/g_client.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_cmds.o : $(GDIR)/g_cmds.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_combat.o : $(GDIR)/g_combat.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_items.o : $(GDIR)/g_items.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_main.o : $(GDIR)/g_main.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_mem.o : $(GDIR)/g_mem.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_misc.o : $(GDIR)/g_misc.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_missile.o : $(GDIR)/g_missile.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_mover.o : $(GDIR)/g_mover.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_session.o : $(GDIR)/g_session.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_spawn.o : $(GDIR)/g_spawn.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_svcmds.o : $(GDIR)/g_svcmds.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_syscalls.o : $(GDIR)/g_syscalls.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_target.o : $(GDIR)/g_target.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_team.o : $(GDIR)/g_team.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_trigger.o : $(GDIR)/g_trigger.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_utils.o : $(GDIR)/g_utils.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/g_weapon.o : $(GDIR)/g_weapon.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/q_math.o : $(GDIR)/q_math.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/game/q_shared.o : $(GDIR)/q_shared.c; $(DO_SHLIB_CC) -DMISSIONPACK - - - -############################################################################# -## BASEQ3 UI -############################################################################# - -Q3UIOBJ = \ - $(B)/baseq3/ui/bg_misc.o \ - $(B)/baseq3/ui/ui_addbots.o \ - $(B)/baseq3/ui/ui_atoms.o \ - $(B)/baseq3/ui/ui_cdkey.o \ - $(B)/baseq3/ui/ui_cinematics.o \ - $(B)/baseq3/ui/ui_confirm.o \ - $(B)/baseq3/ui/ui_connect.o \ - $(B)/baseq3/ui/ui_controls2.o \ - $(B)/baseq3/ui/ui_credits.o \ - $(B)/baseq3/ui/ui_demo2.o \ - $(B)/baseq3/ui/ui_display.o \ - $(B)/baseq3/ui/ui_gameinfo.o \ - $(B)/baseq3/ui/ui_ingame.o \ - $(B)/baseq3/ui/ui_loadconfig.o \ - $(B)/baseq3/ui/ui_main.o \ - $(B)/baseq3/ui/ui_menu.o \ - $(B)/baseq3/ui/ui_mfield.o \ - $(B)/baseq3/ui/ui_mods.o \ - $(B)/baseq3/ui/ui_network.o \ - $(B)/baseq3/ui/ui_options.o \ - $(B)/baseq3/ui/ui_playermodel.o \ - $(B)/baseq3/ui/ui_players.o \ - $(B)/baseq3/ui/ui_playersettings.o \ - $(B)/baseq3/ui/ui_preferences.o \ - $(B)/baseq3/ui/ui_qmenu.o \ - $(B)/baseq3/ui/ui_removebots.o \ - $(B)/baseq3/ui/ui_saveconfig.o \ - $(B)/baseq3/ui/ui_serverinfo.o \ - $(B)/baseq3/ui/ui_servers2.o \ - $(B)/baseq3/ui/ui_setup.o \ - $(B)/baseq3/ui/ui_sound.o \ - $(B)/baseq3/ui/ui_sparena.o \ - $(B)/baseq3/ui/ui_specifyserver.o \ - $(B)/baseq3/ui/ui_splevel.o \ - $(B)/baseq3/ui/ui_sppostgame.o \ - $(B)/baseq3/ui/ui_spskill.o \ - $(B)/baseq3/ui/ui_startserver.o \ - $(B)/baseq3/ui/ui_syscalls.o \ - $(B)/baseq3/ui/ui_team.o \ - $(B)/baseq3/ui/ui_teamorders.o \ - $(B)/baseq3/ui/ui_video.o \ - \ - $(B)/baseq3/ui/q_math.o \ - $(B)/baseq3/ui/q_shared.o - -$(B)/baseq3/ui$(ARCH).$(SHLIBEXT) : $(Q3UIOBJ) - $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) - -$(B)/baseq3/ui/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_addbots.o : $(Q3UIDIR)/ui_addbots.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_atoms.o : $(Q3UIDIR)/ui_atoms.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_cinematics.o : $(Q3UIDIR)/ui_cinematics.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_cdkey.o : $(Q3UIDIR)/ui_cdkey.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_confirm.o : $(Q3UIDIR)/ui_confirm.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_connect.o : $(Q3UIDIR)/ui_connect.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_controls2.o : $(Q3UIDIR)/ui_controls2.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_credits.o : $(Q3UIDIR)/ui_credits.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_demo2.o : $(Q3UIDIR)/ui_demo2.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_display.o : $(Q3UIDIR)/ui_display.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_gameinfo.o : $(Q3UIDIR)/ui_gameinfo.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_ingame.o : $(Q3UIDIR)/ui_ingame.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_loadconfig.o : $(Q3UIDIR)/ui_loadconfig.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_main.o : $(Q3UIDIR)/ui_main.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_menu.o : $(Q3UIDIR)/ui_menu.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_mfield.o : $(Q3UIDIR)/ui_mfield.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_mods.o : $(Q3UIDIR)/ui_mods.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_network.o : $(Q3UIDIR)/ui_network.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_options.o : $(Q3UIDIR)/ui_options.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_playermodel.o : $(Q3UIDIR)/ui_playermodel.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_players.o : $(Q3UIDIR)/ui_players.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_playersettings.o : $(Q3UIDIR)/ui_playersettings.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_preferences.o : $(Q3UIDIR)/ui_preferences.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_qmenu.o : $(Q3UIDIR)/ui_qmenu.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_quit.o : $(Q3UIDIR)/ui_quit.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_removebots.o : $(Q3UIDIR)/ui_removebots.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_saveconfig.o : $(Q3UIDIR)/ui_saveconfig.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_serverinfo.o : $(Q3UIDIR)/ui_serverinfo.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_servers2.o : $(Q3UIDIR)/ui_servers2.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_setup.o : $(Q3UIDIR)/ui_setup.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_sound.o : $(Q3UIDIR)/ui_sound.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_sparena.o : $(Q3UIDIR)/ui_sparena.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_specifyserver.o : $(Q3UIDIR)/ui_specifyserver.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_splevel.o : $(Q3UIDIR)/ui_splevel.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_sppostgame.o : $(Q3UIDIR)/ui_sppostgame.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_spskill.o : $(Q3UIDIR)/ui_spskill.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_startserver.o : $(Q3UIDIR)/ui_startserver.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_team.o : $(Q3UIDIR)/ui_team.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_teamorders.o : $(Q3UIDIR)/ui_teamorders.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_syscalls.o : $(Q3UIDIR)/ui_syscalls.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_video.o : $(Q3UIDIR)/ui_video.c; $(DO_SHLIB_CC) - -# bk001205 - these wre the only SHLIB compiles in 1.17 -$(B)/baseq3/ui/q_math.o : $(GDIR)/q_math.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/q_shared.o : $(GDIR)/q_shared.c; $(DO_SHLIB_CC) - - - -############################################################################# -## MISSIONPACK UI -############################################################################# - -MPUIOBJ = \ - $(B)/missionpack/ui/ui_atoms.o \ - $(B)/missionpack/ui/ui_gameinfo.o \ - $(B)/missionpack/ui/ui_main.o \ - $(B)/missionpack/ui/ui_players.o \ - $(B)/missionpack/ui/ui_syscalls.o \ - $(B)/missionpack/ui/ui_util.o \ - $(B)/missionpack/ui/ui_shared.o \ - \ - $(B)/missionpack/ui/bg_misc.o \ - \ - $(B)/missionpack/ui/q_math.o \ - $(B)/missionpack/ui/q_shared.o -# $(B)/missionpack/ui/ui_atoms.o \ -# $(B)/missionpack/ui/ui_gameinfo.o \ -# $(B)/missionpack/ui/ui_main.o \ -# $(B)/missionpack/ui/ui_players.o \ -# $(B)/missionpack/ui/ui_syscalls.o \ -# $(B)/missionpack/ui/ui_util.o \ -# $(B)/missionpack/ui/ui_shared.o \ -# \ -# $(B)/missionpack/ui/bg_misc.o \ -# $(B)/missionpack/ui/bg_lib.o \ -# \ -# $(B)/missionpack/ui/q_math.o \ -# $(B)/missionpack/ui/q_shared.o - -$(B)/missionpack/ui$(ARCH).$(SHLIBEXT) : $(MPUIOBJ) - $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(MPUIOBJ) - -$(B)/missionpack/ui/ui_atoms.o : $(UIDIR)/ui_atoms.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/ui/ui_gameinfo.o : $(UIDIR)/ui_gameinfo.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/ui/ui_main.o : $(UIDIR)/ui_main.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/ui/ui_players.o : $(UIDIR)/ui_players.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/ui/ui_syscalls.o : $(UIDIR)/ui_syscalls.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/ui/ui_util.o : $(UIDIR)/ui_util.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/ui/ui_shared.o : $(UIDIR)/ui_shared.c; $(DO_SHLIB_CC) -DMISSIONPACK - -$(B)/missionpack/ui/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/ui/bg_lib.o : $(GDIR)/bg_lib.c; $(DO_SHLIB_CC) -DMISSIONPACK - -$(B)/missionpack/ui/q_math.o : $(GDIR)/q_math.c; $(DO_SHLIB_CC) -DMISSIONPACK -$(B)/missionpack/ui/q_shared.o : $(GDIR)/q_shared.c; $(DO_SHLIB_CC) -DMISSIONPACK - - - - - -############################################################################# -## Q3 STATIC (DEBUG) BUILD -############################################################################# - -Q3SOBJ = \ - $(B)/q3static/cl_cgame.o \ - $(B)/q3static/cl_cin.o \ - $(B)/q3static/cl_console.o \ - $(B)/q3static/cl_input.o \ - $(B)/q3static/cl_keys.o \ - $(B)/q3static/cl_main.o \ - $(B)/q3static/cl_net_chan.o \ - $(B)/q3static/cl_parse.o \ - $(B)/q3static/cl_scrn.o \ - $(B)/q3static/cl_ui.o \ - \ - $(B)/q3static/cm_load.o \ - $(B)/q3static/cm_patch.o \ - $(B)/q3static/cm_polylib.o \ - $(B)/q3static/cm_test.o \ - $(B)/q3static/cm_trace.o \ - \ - $(B)/q3static/cmd.o \ - $(B)/q3static/common.o \ - $(B)/q3static/cvar.o \ - $(B)/q3static/files.o \ - $(B)/q3static/md4.o \ - $(B)/q3static/msg.o \ - $(B)/q3static/net_chan.o \ - \ - $(B)/q3static/snd_adpcm.o \ - $(B)/q3static/snd_dma.o \ - $(B)/q3static/snd_mem.o \ - $(B)/q3static/snd_mix.o \ - $(B)/q3static/snd_wavelet.o \ - \ - $(B)/q3static/sv_bot.o \ - $(B)/q3static/sv_ccmds.o \ - $(B)/q3static/sv_client.o \ - $(B)/q3static/sv_game.o \ - $(B)/q3static/sv_init.o \ - $(B)/q3static/sv_main.o \ - $(B)/q3static/sv_net_chan.o \ - $(B)/q3static/sv_snapshot.o \ - $(B)/q3static/sv_world.o \ - \ - $(B)/q3static/unzip.o \ - $(B)/q3static/vm.o \ - $(B)/q3static/vm_interpreted.o \ - \ - $(B)/q3static/be_aas_bspq3.o \ - $(B)/q3static/be_aas_cluster.o \ - $(B)/q3static/be_aas_debug.o \ - $(B)/q3static/be_aas_entity.o \ - $(B)/q3static/be_aas_file.o \ - $(B)/q3static/be_aas_main.o \ - $(B)/q3static/be_aas_move.o \ - $(B)/q3static/be_aas_optimize.o \ - $(B)/q3static/be_aas_reach.o \ - $(B)/q3static/be_aas_route.o \ - $(B)/q3static/be_aas_routealt.o \ - $(B)/q3static/be_aas_sample.o \ - $(B)/q3static/be_ai_char.o \ - $(B)/q3static/be_ai_chat.o \ - $(B)/q3static/be_ai_gen.o \ - $(B)/q3static/be_ai_goal.o \ - $(B)/q3static/be_ai_move.o \ - $(B)/q3static/be_ai_weap.o \ - $(B)/q3static/be_ai_weight.o \ - $(B)/q3static/be_ea.o \ - $(B)/q3static/be_interface.o \ - $(B)/q3static/l_crc.o \ - $(B)/q3static/l_libvar.o \ - $(B)/q3static/l_log.o \ - $(B)/q3static/l_memory.o \ - $(B)/q3static/l_precomp.o \ - $(B)/q3static/l_script.o \ - $(B)/q3static/l_struct.o \ - \ - $(B)/q3static/jcapimin.o \ - $(B)/q3static/jchuff.o \ - $(B)/q3static/jcinit.o \ - $(B)/q3static/jccoefct.o \ - $(B)/q3static/jccolor.o \ - $(B)/q3static/jfdctflt.o \ - $(B)/q3static/jcdctmgr.o \ - $(B)/q3static/jcphuff.o \ - $(B)/q3static/jcmainct.o \ - $(B)/q3static/jcmarker.o \ - $(B)/q3static/jcmaster.o \ - $(B)/q3static/jcomapi.o \ - $(B)/q3static/jcparam.o \ - $(B)/q3static/jcprepct.o \ - $(B)/q3static/jcsample.o \ - $(B)/q3static/jdapimin.o \ - $(B)/q3static/jdapistd.o \ - $(B)/q3static/jdatasrc.o \ - $(B)/q3static/jdcoefct.o \ - $(B)/q3static/jdcolor.o \ - $(B)/q3static/jddctmgr.o \ - $(B)/q3static/jdhuff.o \ - $(B)/q3static/jdinput.o \ - $(B)/q3static/jdmainct.o \ - $(B)/q3static/jdmarker.o \ - $(B)/q3static/jdmaster.o \ - $(B)/q3static/jdpostct.o \ - $(B)/q3static/jdsample.o \ - $(B)/q3static/jdtrans.o \ - $(B)/q3static/jerror.o \ - $(B)/q3static/jidctflt.o \ - $(B)/q3static/jmemmgr.o \ - $(B)/q3static/jmemnobs.o \ - $(B)/q3static/jutils.o \ - \ - $(B)/q3static/tr_animation.o \ - $(B)/q3static/tr_backend.o \ - $(B)/q3static/tr_bsp.o \ - $(B)/q3static/tr_cmds.o \ - $(B)/q3static/tr_curve.o \ - $(B)/q3static/tr_flares.o \ - $(B)/q3static/tr_font.o \ - $(B)/q3static/tr_image.o \ - $(B)/q3static/tr_init.o \ - $(B)/q3static/tr_light.o \ - $(B)/q3static/tr_main.o \ - $(B)/q3static/tr_marks.o \ - $(B)/q3static/tr_mesh.o \ - $(B)/q3static/tr_model.o \ - $(B)/q3static/tr_noise.o \ - $(B)/q3static/tr_scene.o \ - $(B)/q3static/tr_shade.o \ - $(B)/q3static/tr_shade_calc.o \ - $(B)/q3static/tr_shader.o \ - $(B)/q3static/tr_shadows.o \ - $(B)/q3static/tr_sky.o \ - $(B)/q3static/tr_surface.o \ - $(B)/q3static/tr_world.o \ - \ - $(B)/q3static/unix_main.o \ - $(B)/q3static/unix_net.o \ - $(B)/q3static/unix_shared.o \ - \ - $(B)/q3static/ahoptim.o \ - $(B)/q3static/autohint.o \ - $(B)/q3static/ftbase.o \ - $(B)/q3static/ftdebug.o \ - $(B)/q3static/ftglyph.o \ - $(B)/q3static/ftinit.o \ - $(B)/q3static/ftmm.o \ - $(B)/q3static/ftsystem.o \ - $(B)/q3static/raster1.o \ - $(B)/q3static/sfnt.o \ - $(B)/q3static/sfobjs.o \ - $(B)/q3static/smooth.o \ - $(B)/q3static/truetype.o \ - \ - $(B)/q3static/linux_qgl.o \ - $(B)/q3static/linux_glimp.o \ - $(B)/q3static/linux_joystick.o \ - $(B)/q3static/linux_snd.o \ - $(B)/q3static/snd_mixa.o \ - $(B)/q3static/matha.o - -ifeq ($(ARCH),i386) - Q3SOBJ += $(B)/q3static/vm_x86.o -endif - -ifeq ($(ARCH),ppc) - ifeq ($(DLL_ONLY),false) - Q3SOBJ += $(B)/q3static/vm_ppc.o - endif -endif - - -$(B)/q3static/cl_cgame.o : $(CDIR)/cl_cgame.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cl_cin.o : $(CDIR)/cl_cin.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cl_console.o : $(CDIR)/cl_console.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cl_input.o : $(CDIR)/cl_input.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cl_keys.o : $(CDIR)/cl_keys.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cl_main.o : $(CDIR)/cl_main.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cl_net_chan.o : $(CDIR)/cl_net_chan.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cl_parse.o : $(CDIR)/cl_parse.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cl_scrn.o : $(CDIR)/cl_scrn.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cl_ui.o : $(CDIR)/cl_ui.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/snd_adpcm.o : $(CDIR)/snd_adpcm.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/snd_dma.o : $(CDIR)/snd_dma.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/snd_mem.o : $(CDIR)/snd_mem.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/snd_mix.o : $(CDIR)/snd_mix.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/snd_wavelet.o : $(CDIR)/snd_wavelet.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/sv_bot.o : $(SDIR)/sv_bot.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/sv_client.o : $(SDIR)/sv_client.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/sv_ccmds.o : $(SDIR)/sv_ccmds.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/sv_game.o : $(SDIR)/sv_game.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/sv_init.o : $(SDIR)/sv_init.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/sv_main.o : $(SDIR)/sv_main.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/sv_net_chan.o : $(SDIR)/sv_net_chan.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/sv_snapshot.o : $(SDIR)/sv_snapshot.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/sv_world.o : $(SDIR)/sv_world.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cm_trace.o : $(CMDIR)/cm_trace.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cm_load.o : $(CMDIR)/cm_load.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cm_test.o : $(CMDIR)/cm_test.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cm_patch.o : $(CMDIR)/cm_patch.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cm_polylib.o : $(CMDIR)/cm_polylib.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cmd.o : $(CMDIR)/cmd.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/common.o : $(CMDIR)/common.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cvar.o : $(CMDIR)/cvar.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/files.o : $(CMDIR)/files.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/md4.o : $(CMDIR)/md4.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/msg.o : $(CMDIR)/msg.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/net_chan.o : $(CMDIR)/net_chan.c; $(DO_CC) -DQ3_STATIC - -$(B)/q3static/be_aas_bspq3.o : $(BLIBDIR)/be_aas_bspq3.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_cluster.o : $(BLIBDIR)/be_aas_cluster.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_debug.o : $(BLIBDIR)/be_aas_debug.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_entity.o : $(BLIBDIR)/be_aas_entity.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_file.o : $(BLIBDIR)/be_aas_file.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_main.o : $(BLIBDIR)/be_aas_main.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_move.o : $(BLIBDIR)/be_aas_move.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_optimize.o : $(BLIBDIR)/be_aas_optimize.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_reach.o : $(BLIBDIR)/be_aas_reach.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_route.o : $(BLIBDIR)/be_aas_route.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_routealt.o : $(BLIBDIR)/be_aas_routealt.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_aas_sample.o : $(BLIBDIR)/be_aas_sample.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_ai_char.o : $(BLIBDIR)/be_ai_char.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_ai_chat.o : $(BLIBDIR)/be_ai_chat.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_ai_gen.o : $(BLIBDIR)/be_ai_gen.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_ai_goal.o : $(BLIBDIR)/be_ai_goal.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_ai_move.o : $(BLIBDIR)/be_ai_move.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_ai_weap.o : $(BLIBDIR)/be_ai_weap.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_ai_weight.o : $(BLIBDIR)/be_ai_weight.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_ea.o : $(BLIBDIR)/be_ea.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/be_interface.o : $(BLIBDIR)/be_interface.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/l_crc.o : $(BLIBDIR)/l_crc.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/l_libvar.o : $(BLIBDIR)/l_libvar.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/l_log.o : $(BLIBDIR)/l_log.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/l_memory.o : $(BLIBDIR)/l_memory.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/l_precomp.o : $(BLIBDIR)/l_precomp.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/l_script.o : $(BLIBDIR)/l_script.c; $(DO_BOT_CC) -DQ3_STATIC -$(B)/q3static/l_struct.o : $(BLIBDIR)/l_struct.c; $(DO_BOT_CC) -DQ3_STATIC - -$(B)/q3static/jcapimin.o : $(JPDIR)/jcapimin.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jchuff.o : $(JPDIR)/jchuff.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jcinit.o : $(JPDIR)/jcinit.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jccoefct.o : $(JPDIR)/jccoefct.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jccolor.o : $(JPDIR)/jccolor.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jfdctflt.o : $(JPDIR)/jfdctflt.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jcdctmgr.o : $(JPDIR)/jcdctmgr.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jcmainct.o : $(JPDIR)/jcmainct.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jcmarker.o : $(JPDIR)/jcmarker.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jcmaster.o : $(JPDIR)/jcmaster.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jcomapi.o : $(JPDIR)/jcomapi.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jcparam.o : $(JPDIR)/jcparam.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jcprepct.o : $(JPDIR)/jcprepct.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jcsample.o : $(JPDIR)/jcsample.c; $(DO_CC) -DQ3_STATIC - -$(B)/q3static/jdapimin.o : $(JPDIR)/jdapimin.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdapistd.o : $(JPDIR)/jdapistd.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdatasrc.o : $(JPDIR)/jdatasrc.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdcoefct.o : $(JPDIR)/jdcoefct.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdcolor.o : $(JPDIR)/jdcolor.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jcphuff.o : $(JPDIR)/jcphuff.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jddctmgr.o : $(JPDIR)/jddctmgr.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdhuff.o : $(JPDIR)/jdhuff.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdinput.o : $(JPDIR)/jdinput.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdmainct.o : $(JPDIR)/jdmainct.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdmarker.o : $(JPDIR)/jdmarker.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdmaster.o : $(JPDIR)/jdmaster.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdpostct.o : $(JPDIR)/jdpostct.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdsample.o : $(JPDIR)/jdsample.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jdtrans.o : $(JPDIR)/jdtrans.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jerror.o : $(JPDIR)/jerror.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jidctflt.o : $(JPDIR)/jidctflt.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jmemmgr.o : $(JPDIR)/jmemmgr.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jmemnobs.o : $(JPDIR)/jmemnobs.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/jutils.o : $(JPDIR)/jutils.c; $(DO_CC) -DQ3_STATIC - -$(B)/q3static/tr_bsp.o : $(RDIR)/tr_bsp.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_animation.o : $(RDIR)/tr_animation.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_backend.o : $(RDIR)/tr_backend.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_cmds.o : $(RDIR)/tr_cmds.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_curve.o : $(RDIR)/tr_curve.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_flares.o : $(RDIR)/tr_flares.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_font.o : $(RDIR)/tr_font.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_image.o : $(RDIR)/tr_image.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_init.o : $(RDIR)/tr_init.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_light.o : $(RDIR)/tr_light.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_main.o : $(RDIR)/tr_main.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_marks.o : $(RDIR)/tr_marks.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_mesh.o : $(RDIR)/tr_mesh.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_model.o : $(RDIR)/tr_model.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_noise.o : $(RDIR)/tr_noise.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_scene.o : $(RDIR)/tr_scene.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_shade.o : $(RDIR)/tr_shade.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_shader.o : $(RDIR)/tr_shader.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_shade_calc.o : $(RDIR)/tr_shade_calc.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_shadows.o : $(RDIR)/tr_shadows.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_sky.o : $(RDIR)/tr_sky.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_smp.o : $(RDIR)/tr_smp.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_stripify.o : $(RDIR)/tr_stripify.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_subdivide.o : $(RDIR)/tr_subdivide.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_surface.o : $(RDIR)/tr_surface.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/tr_world.o : $(RDIR)/tr_world.c; $(DO_CC) -DQ3_STATIC - -$(B)/q3static/unix_qgl.o : $(UDIR)/unix_qgl.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/unix_main.o : $(UDIR)/unix_main.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/unix_net.o : $(UDIR)/unix_net.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/unix_shared.o : $(UDIR)/unix_shared.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/linux_glimp.o : $(UDIR)/linux_glimp.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/linux_joystick.o : $(UDIR)/linux_joystick.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/linux_qgl.o : $(UDIR)/linux_qgl.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/linux_input.o : $(UDIR)/linux_input.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/linux_snd.o : $(UDIR)/linux_snd.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/snd_mixa.o : $(UDIR)/snd_mixa.s; $(DO_AS) -$(B)/q3static/matha.o : $(UDIR)/matha.s; $(DO_AS) -$(B)/q3static/unzip.o : $(CMDIR)/unzip.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/vm.o : $(CMDIR)/vm.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/vm_interpreted.o : $(CMDIR)/vm_interpreted.c; $(DO_CC) -DQ3_STATIC - -ifeq ($(ARCH),i386) - $(B)/q3static/vm_x86.o : $(CMDIR)/vm_x86.c; $(DO_CC) -DQ3_STATIC -endif - -ifeq ($(ARCH),ppc) -ifeq ($(DLL_ONLY),false) -$(B)/q3static/vm_ppc.o : $(CMDIR)/vm_ppc.c; $(DO_CC) -DQ3_STATIC -endif -endif - -$(B)/q3static/ahoptim.o : $(FTDIR)/ahoptim.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/autohint.o : $(FTDIR)/autohint.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ftbase.o : $(FTDIR)/ftbase.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ftdebug.o : $(FTDIR)/ftdebug.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ftglyph.o : $(FTDIR)/ftglyph.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ftinit.o : $(FTDIR)/ftinit.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ftmm.o : $(FTDIR)/ftmm.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ftsystem.o : $(FTDIR)/ftsystem.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/raster1.o : $(FTDIR)/raster1.c; $(DO_CC) -DQ3_STATIC -DFT_FLAT_COMPILE -$(B)/q3static/sfnt.o : $(FTDIR)/sfnt.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/sfobjs.o : $(FTDIR)/sfobjs.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/smooth.o : $(FTDIR)/smooth.c; $(DO_CC) -DQ3_STATIC -DFT_FLAT_COMPILE -$(B)/q3static/truetype.o : $(FTDIR)/truetype.c; $(DO_CC) -DQ3_STATIC - -## add BASEQ3 CGAME -Q3SOBJ += \ - $(B)/q3static/cg_consolecmds.o \ - $(B)/q3static/cg_draw.o \ - $(B)/q3static/cg_drawtools.o \ - $(B)/q3static/cg_effects.o \ - $(B)/q3static/cg_ents.o \ - $(B)/q3static/cg_event.o \ - $(B)/q3static/cg_info.o \ - $(B)/q3static/cg_localents.o \ - $(B)/q3static/cg_main.o \ - $(B)/q3static/cg_marks.o \ - $(B)/q3static/cg_players.o \ - $(B)/q3static/cg_playerstate.o \ - $(B)/q3static/cg_predict.o \ - $(B)/q3static/cg_scoreboard.o \ - $(B)/q3static/cg_servercmds.o \ - $(B)/q3static/cg_snapshot.o \ - $(B)/q3static/cg_syscalls.o \ - $(B)/q3static/cg_view.o \ - $(B)/q3static/cg_weapons.o - -$(B)/q3static/cg_consolecmds.o : $(CGDIR)/cg_consolecmds.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_draw.o : $(CGDIR)/cg_draw.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_drawtools.o : $(CGDIR)/cg_drawtools.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_effects.o : $(CGDIR)/cg_effects.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_ents.o : $(CGDIR)/cg_ents.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_event.o : $(CGDIR)/cg_event.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_info.o : $(CGDIR)/cg_info.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_localents.o : $(CGDIR)/cg_localents.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_main.o : $(CGDIR)/cg_main.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_marks.o : $(CGDIR)/cg_marks.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_players.o : $(CGDIR)/cg_players.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_playerstate.o : $(CGDIR)/cg_playerstate.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_predict.o : $(CGDIR)/cg_predict.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_scoreboard.o : $(CGDIR)/cg_scoreboard.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_servercmds.o : $(CGDIR)/cg_servercmds.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_snapshot.o : $(CGDIR)/cg_snapshot.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_syscalls.o : $(CGDIR)/cg_syscalls.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_view.o : $(CGDIR)/cg_view.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/cg_weapons.o : $(CGDIR)/cg_weapons.c; $(DO_CC) -DQ3_STATIC - -## add BASEQ3 GAME -Q3SOBJ += \ - $(B)/q3static/ai_chat.o \ - $(B)/q3static/ai_cmd.o \ - $(B)/q3static/ai_dmnet.o \ - $(B)/q3static/ai_dmq3.o \ - $(B)/q3static/ai_main.o \ - $(B)/q3static/ai_team.o \ - $(B)/q3static/ai_vcmd.o \ - $(B)/q3static/g_active.o \ - $(B)/q3static/g_arenas.o \ - $(B)/q3static/g_bot.o \ - $(B)/q3static/g_client.o \ - $(B)/q3static/g_cmds.o \ - $(B)/q3static/g_combat.o \ - $(B)/q3static/g_items.o \ - $(B)/q3static/g_main.o \ - $(B)/q3static/g_mem.o \ - $(B)/q3static/g_misc.o \ - $(B)/q3static/g_missile.o \ - $(B)/q3static/g_mover.o \ - $(B)/q3static/g_session.o \ - $(B)/q3static/g_spawn.o \ - $(B)/q3static/g_svcmds.o \ - $(B)/q3static/g_target.o \ - $(B)/q3static/g_team.o \ - $(B)/q3static/g_trigger.o \ - $(B)/q3static/g_utils.o \ - $(B)/q3static/g_weapon.o \ - \ - $(B)/q3static/g_syscalls.o - -$(B)/q3static/ai_chat.o : $(GDIR)/ai_chat.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ai_cmd.o : $(GDIR)/ai_cmd.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ai_dmnet.o : $(GDIR)/ai_dmnet.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ai_dmq3.o : $(GDIR)/ai_dmq3.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ai_main.o : $(GDIR)/ai_main.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ai_team.o : $(GDIR)/ai_team.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ai_vcmd.o : $(GDIR)/ai_vcmd.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_active.o : $(GDIR)/g_active.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_arenas.o : $(GDIR)/g_arenas.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_bot.o : $(GDIR)/g_bot.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_client.o : $(GDIR)/g_client.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_cmds.o : $(GDIR)/g_cmds.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_combat.o : $(GDIR)/g_combat.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_items.o : $(GDIR)/g_items.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_main.o : $(GDIR)/g_main.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_mem.o : $(GDIR)/g_mem.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_misc.o : $(GDIR)/g_misc.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_missile.o : $(GDIR)/g_missile.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_mover.o : $(GDIR)/g_mover.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_session.o : $(GDIR)/g_session.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_spawn.o : $(GDIR)/g_spawn.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_svcmds.o : $(GDIR)/g_svcmds.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_syscalls.o : $(GDIR)/g_syscalls.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_target.o : $(GDIR)/g_target.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_team.o : $(GDIR)/g_team.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_trigger.o : $(GDIR)/g_trigger.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_utils.o : $(GDIR)/g_utils.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/g_weapon.o : $(GDIR)/g_weapon.c; $(DO_CC) -DQ3_STATIC - -## add BASEQ3 UI -Q3SOBJ += \ - $(B)/q3static/ui_addbots.o \ - $(B)/q3static/ui_atoms.o \ - $(B)/q3static/ui_cdkey.o \ - $(B)/q3static/ui_cinematics.o \ - $(B)/q3static/ui_confirm.o \ - $(B)/q3static/ui_connect.o \ - $(B)/q3static/ui_controls2.o \ - $(B)/q3static/ui_credits.o \ - $(B)/q3static/ui_demo2.o \ - $(B)/q3static/ui_display.o \ - $(B)/q3static/ui_gameinfo.o \ - $(B)/q3static/ui_ingame.o \ - $(B)/q3static/ui_loadconfig.o \ - $(B)/q3static/ui_main.o \ - $(B)/q3static/ui_menu.o \ - $(B)/q3static/ui_mfield.o \ - $(B)/q3static/ui_mods.o \ - $(B)/q3static/ui_network.o \ - $(B)/q3static/ui_options.o \ - $(B)/q3static/ui_playermodel.o \ - $(B)/q3static/ui_players.o \ - $(B)/q3static/ui_playersettings.o \ - $(B)/q3static/ui_preferences.o \ - $(B)/q3static/ui_qmenu.o \ - $(B)/q3static/ui_removebots.o \ - $(B)/q3static/ui_saveconfig.o \ - $(B)/q3static/ui_serverinfo.o \ - $(B)/q3static/ui_servers2.o \ - $(B)/q3static/ui_setup.o \ - $(B)/q3static/ui_sound.o \ - $(B)/q3static/ui_sparena.o \ - $(B)/q3static/ui_specifyserver.o \ - $(B)/q3static/ui_splevel.o \ - $(B)/q3static/ui_sppostgame.o \ - $(B)/q3static/ui_spskill.o \ - $(B)/q3static/ui_startserver.o \ - $(B)/q3static/ui_team.o \ - $(B)/q3static/ui_teamorders.o \ - $(B)/q3static/ui_video.o \ - \ - $(B)/q3static/ui_syscalls.o - -$(B)/q3static/ui_addbots.o : $(Q3UIDIR)/ui_addbots.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_atoms.o : $(Q3UIDIR)/ui_atoms.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_cinematics.o : $(Q3UIDIR)/ui_cinematics.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_cdkey.o : $(Q3UIDIR)/ui_cdkey.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_confirm.o : $(Q3UIDIR)/ui_confirm.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_connect.o : $(Q3UIDIR)/ui_connect.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_controls2.o : $(Q3UIDIR)/ui_controls2.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_credits.o : $(Q3UIDIR)/ui_credits.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_demo2.o : $(Q3UIDIR)/ui_demo2.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_display.o : $(Q3UIDIR)/ui_display.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_gameinfo.o : $(Q3UIDIR)/ui_gameinfo.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_ingame.o : $(Q3UIDIR)/ui_ingame.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_loadconfig.o : $(Q3UIDIR)/ui_loadconfig.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_main.o : $(Q3UIDIR)/ui_main.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_menu.o : $(Q3UIDIR)/ui_menu.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_mfield.o : $(Q3UIDIR)/ui_mfield.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_mods.o : $(Q3UIDIR)/ui_mods.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_network.o : $(Q3UIDIR)/ui_network.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_options.o : $(Q3UIDIR)/ui_options.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_playermodel.o : $(Q3UIDIR)/ui_playermodel.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_players.o : $(Q3UIDIR)/ui_players.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_playersettings.o : $(Q3UIDIR)/ui_playersettings.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_preferences.o : $(Q3UIDIR)/ui_preferences.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_qmenu.o : $(Q3UIDIR)/ui_qmenu.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_quit.o : $(Q3UIDIR)/ui_quit.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_removebots.o : $(Q3UIDIR)/ui_removebots.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_saveconfig.o : $(Q3UIDIR)/ui_saveconfig.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_serverinfo.o : $(Q3UIDIR)/ui_serverinfo.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_servers2.o : $(Q3UIDIR)/ui_servers2.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_setup.o : $(Q3UIDIR)/ui_setup.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_sound.o : $(Q3UIDIR)/ui_sound.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_sparena.o : $(Q3UIDIR)/ui_sparena.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_specifyserver.o : $(Q3UIDIR)/ui_specifyserver.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_splevel.o : $(Q3UIDIR)/ui_splevel.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_sppostgame.o : $(Q3UIDIR)/ui_sppostgame.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_spskill.o : $(Q3UIDIR)/ui_spskill.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_startserver.o : $(Q3UIDIR)/ui_startserver.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_team.o : $(Q3UIDIR)/ui_team.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_teamorders.o : $(Q3UIDIR)/ui_teamorders.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_syscalls.o : $(Q3UIDIR)/ui_syscalls.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/ui_video.o : $(Q3UIDIR)/ui_video.c; $(DO_CC) -DQ3_STATIC - - -## add shared files -Q3SOBJ += \ - $(B)/q3static/bg_misc.o \ - $(B)/q3static/bg_pmove.o \ - $(B)/q3static/bg_slidemove.o \ - $(B)/q3static/q_math.o \ - $(B)/q3static/q_shared.o - -## shared files -$(B)/q3static/q_math.o : $(GDIR)/q_math.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/q_shared.o : $(GDIR)/q_shared.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/bg_pmove.o : $(GDIR)/bg_pmove.c; $(DO_CC) -DQ3_STATIC -$(B)/q3static/bg_slidemove.o : $(GDIR)/bg_slidemove.c; $(DO_CC) -DQ3_STATIC - - - -$(B)/$(PLATFORM)q3static : $(Q3SOBJ) - $(CC) $(CFLAGS) -o $@ $(Q3SOBJ) $(GLLDFLAGS) $(LDFLAGS) - - -############################################################################# -# RPM -############################################################################# - -TMPDIR=/var/tmp -TARDIR=$(TMPDIR)/$(BUILD_NAME) -TARFILE = $(BUILD_NAME)-$(VERSION)-$(RPM_RELEASE).$(ARCH).tar - -tar: - if [ ! -d archives ];then mkdir archives;chmod 755 archives;fi - $(MAKE) copyfiles COPYDIR=$(TARDIR) - cd $(TARDIR); tar cvf $(TARFILE) * && gzip -9 $(TARFILE) - mv $(TARDIR)/$(TARFILE).gz archives/. - rm -rf $(TARDIR) - -# Make RPMs. You need to be root to make this work -RPMROOT=/usr/src/redhat -RPM = rpm -RPMFLAGS = -bb -INSTALLDIR = /usr/local/games/$(BUILD_NAME) -RPMDIR = $(TMPDIR)/$(BUILD_NAME)-$(VERSION) -DESTDIR= $(RPMDIR)/$(INSTALLDIR) - -rpm: $(BUILD_NAME).spec - touch $(RPMROOT)/SOURCES/$(BUILD_NAME)-$(VERSION).tar.gz - if [ ! -d archives ];then mkdir archives;fi - $(MAKE) copyfiles COPYDIR=$(DESTDIR) - cp $(UDIR)/quake3.gif $(RPMROOT)/SOURCES/. - cp $(BUILD_NAME).spec $(RPMROOT)/SPECS/. - cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) $(BUILD_NAME).spec - rm -rf $(RPMDIR) - mv $(RPMROOT)/RPMS/$(RPMARCH)/$(BUILD_NAME)-$(VERSION)-$(RPM_RELEASE).$(RPMARCH).rpm archives/$(BUILD_NAME)-$(VERSION)-$(RPM_RELEASE).$(RPMARCH).rpm - -copyfiles: - -mkdirhier $(COPYDIR) - cp $(BR)/linuxquake3 $(COPYDIR)/quake3.x86 - strip $(COPYDIR)/quake3.x86 - chmod 755 $(COPYDIR)/quake3.x86 - cp $(BR)/linuxq3ded $(COPYDIR)/q3ded - strip $(COPYDIR)/q3ded - chmod 755 $(COPYDIR)/q3ded - cp $(BDIR)/libMesaVoodooGL.so.3.2 $(COPYDIR)/. - chmod 755 $(COPYDIR)/libMesaVoodooGL.so.3.2 - ( cd $(COPYDIR); ln -s libMesaVoodooGL.so.3.2 libMesaVoodooGL.so ) - cp $(BDIR)/Quake_III_Arena_FAQ.html $(COPYDIR)/. - chmod 644 $(COPYDIR)/Quake_III_Arena_FAQ.html - mkdir $(COPYDIR)/baseq3 - cp $(BASEQ3_DIR)/pak2.pk3 $(COPYDIR)/baseq3/. - chmod 644 $(COPYDIR)/baseq3/pak2.pk3 - -$(BUILD_NAME).spec : $(UDIR)/$(BUILD_NAME).spec.sh Makefile - sh $< $(VERSION) $(RPM_RELEASE) $(ARCH) $(INSTALLDIR) > $@ - -############################################################################# -# MISC -############################################################################# - -# TTimo: FIXME: doesn't clean the binary and .so - -clean:clean-debug clean-release - -clean2: clean-bins - rm -f $(Q3OBJ) $(Q3POBJ) $(Q3POBJ_SMP) $(Q3DOBJ) $(MPGOBJ) $(Q3GOBJ) $(Q3CGOBJ) $(MPCGOBJ) $(Q3UIOBJ) $(MPUIOBJ) - rm -f $(CGDIR)/vm/*.asm - rm -f $(GDIR)/vm/*.asm - rm -f $(UIDIR)/vm/*.asm - rm -f $(Q3UIDIR)/vm/*.asm - -# TTimo: linuxq3ded linuxquake3 linuxquake3-smp .. hardcoded the names .. maybe not such a good thing -# FIXME: also, removing the *.so is crappy .. I just want to avoid rm -rf debugi386-glibc to save the symlinks to pk3's for testing -clean-bins: - if [ -d $(B) ];then (find $(B) -name '*.so' -exec rm {} \;)fi - rm -f $(B)/linuxq3ded - rm -f $(B)/linuxquake3 - rm -f $(B)/linuxquake3-smp - rm -f $(B)/baseq3/vm/cgame.qvm - rm -f $(B)/baseq3/vm/ui.qvm - rm -f $(B)/baseq3/vm/qagame.qvm - rm -f $(B)/missionpack/vm/cgame.qvm - rm -f $(B)/missionpack/vm/qagame.qvm - rm -f $(B)/missionpack/vm/ui.qvm - -clean-debug: - $(MAKE) clean2 B=$(BD) CFLAGS="$(DEBUG_CFLAGS)" - -clean-release: - $(MAKE) clean2 B=$(BR) CFLAGS="$(DEBUG_CFLAGS)" - -# TTimo: for the setups it's easier to shell out to a script - -setup: release - ./build_setup.sh $(VERSION) - diff --git a/code/unix/Makefile.Game b/code/unix/Makefile.Game deleted file mode 100644 index 8f460ec..0000000 --- a/code/unix/Makefile.Game +++ /dev/null @@ -1,285 +0,0 @@ -# -# Quake3 Unix Game Makefile -# -# GNU Make required -# - -### -### These paths are where you probably want to change things -### - -#The main Quake3 directory -BDIR=.. - -#This is the game dir -GAMEDIR=baseq3 - -#Where the source is, assumed to be same directory as this Makefile -SRCDIR=. - -#Location of binaries -BINDIR=../bin -LCC=$(BINDIR)/lcc # -lccdir=$(BINDIR)/ -Q3ASM=$(BINDIR)/q3asm - - -############################################################################# -## -## You shouldn't have to touch anything below here -## -############################################################################# - -GDIR=$(SRCDIR)/game -CGDIR=$(SRCDIR)/cgame -UIDIR=$(SRCDIR)/ui - -LCCFLAGS=-DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\cgame -I..\game -I..\ui - -DO_LCC=$(LCC) $(LCCFLAGS) -o $@ -c $< - -TARGETS=\ - $(BDIR)/$(GAMEDIR)/vm/cgame.qvm \ - $(BDIR)/$(GAMEDIR)/vm/qagame.qvm \ - $(BDIR)/$(GAMEDIR)/vm/ui.qvm - -default: makedir $(TARGETS) - -makedir: - @-mkdir $(GDIR)/vm - @-mkdir $(CGDIR)/vm - @-mkdir $(UIDIR)/vm - -############################################################################# -# GAME VM -############################################################################# - -##NOTE: g_main must be first. Control passes to first function in the vm - -GVMASM = \ - $(GDIR)/vm/g_main.asm \ - $(GDIR)/vm/bg_misc.asm \ - $(GDIR)/vm/bg_lib.asm \ - $(GDIR)/vm/bg_pmove.asm \ - $(GDIR)/vm/bg_slidemove.asm \ - $(GDIR)/vm/q_math.asm \ - $(GDIR)/vm/q_shared.asm \ - $(GDIR)/vm/ai_dmnet.asm \ - $(GDIR)/vm/ai_dmq3.asm \ - $(GDIR)/vm/ai_team.asm \ - $(GDIR)/vm/ai_main.asm \ - $(GDIR)/vm/ai_chat.asm \ - $(GDIR)/vm/ai_cmd.asm \ - $(GDIR)/vm/g_active.asm \ - $(GDIR)/vm/g_arenas.asm \ - $(GDIR)/vm/g_bot.asm \ - $(GDIR)/vm/g_client.asm \ - $(GDIR)/vm/g_cmds.asm \ - $(GDIR)/vm/g_combat.asm \ - $(GDIR)/vm/g_items.asm \ - $(GDIR)/vm/g_mem.asm \ - $(GDIR)/vm/g_misc.asm \ - $(GDIR)/vm/g_missile.asm \ - $(GDIR)/vm/g_mover.asm \ - $(GDIR)/vm/g_session.asm \ - $(GDIR)/vm/g_spawn.asm \ - $(GDIR)/vm/g_svcmds.asm \ - $(GDIR)/vm/g_target.asm \ - $(GDIR)/vm/g_team.asm \ - $(GDIR)/vm/g_trigger.asm \ - $(GDIR)/vm/g_utils.asm \ - $(GDIR)/vm/g_weapon.asm - -$(BDIR)/$(GAMEDIR)/vm/qagame.qvm : $(GVMASM) - $(Q3ASM) -o $@ $(GVMASM) $(SRCDIR)/game/g_syscalls.asm - -$(GDIR)/vm/ai_chat.asm : $(GDIR)/ai_chat.c; $(DO_LCC) -$(GDIR)/vm/ai_cmd.asm : $(GDIR)/ai_cmd.c; $(DO_LCC) -$(GDIR)/vm/ai_dmnet.asm : $(GDIR)/ai_dmnet.c; $(DO_LCC) -$(GDIR)/vm/ai_dmq3.asm : $(GDIR)/ai_dmq3.c; $(DO_LCC) -$(GDIR)/vm/ai_main.asm : $(GDIR)/ai_main.c; $(DO_LCC) -$(GDIR)/vm/ai_team.asm : $(GDIR)/ai_team.c; $(DO_LCC) -$(GDIR)/vm/bg_lib.asm : $(GDIR)/bg_lib.c; $(DO_LCC) -$(GDIR)/vm/bg_misc.asm : $(GDIR)/bg_misc.c; $(DO_LCC) -$(GDIR)/vm/bg_pmove.asm : $(GDIR)/bg_pmove.c; $(DO_LCC) -$(GDIR)/vm/bg_slidemove.asm : $(GDIR)/bg_slidemove.c; $(DO_LCC) -$(GDIR)/vm/g_active.asm : $(GDIR)/g_active.c; $(DO_LCC) -$(GDIR)/vm/g_arenas.asm : $(GDIR)/g_arenas.c; $(DO_LCC) -$(GDIR)/vm/g_bot.asm : $(GDIR)/g_bot.c; $(DO_LCC) -$(GDIR)/vm/g_client.asm : $(GDIR)/g_client.c; $(DO_LCC) -$(GDIR)/vm/g_cmds.asm : $(GDIR)/g_cmds.c; $(DO_LCC) -$(GDIR)/vm/g_combat.asm : $(GDIR)/g_combat.c; $(DO_LCC) -$(GDIR)/vm/g_items.asm : $(GDIR)/g_items.c; $(DO_LCC) -$(GDIR)/vm/g_main.asm : $(GDIR)/g_main.c; $(DO_LCC) -$(GDIR)/vm/g_mem.asm : $(GDIR)/g_mem.c; $(DO_LCC) -$(GDIR)/vm/g_misc.asm : $(GDIR)/g_misc.c; $(DO_LCC) -$(GDIR)/vm/g_missile.asm : $(GDIR)/g_missile.c; $(DO_LCC) -$(GDIR)/vm/g_mover.asm : $(GDIR)/g_mover.c; $(DO_LCC) -$(GDIR)/vm/g_session.asm : $(GDIR)/g_session.c; $(DO_LCC) -$(GDIR)/vm/g_spawn.asm : $(GDIR)/g_spawn.c; $(DO_LCC) -$(GDIR)/vm/g_svcmds.asm : $(GDIR)/g_svcmds.c; $(DO_LCC) -$(GDIR)/vm/g_target.asm : $(GDIR)/g_target.c; $(DO_LCC) -$(GDIR)/vm/g_team.asm : $(GDIR)/g_team.c; $(DO_LCC) -$(GDIR)/vm/g_trigger.asm : $(GDIR)/g_trigger.c; $(DO_LCC) -$(GDIR)/vm/g_utils.asm : $(GDIR)/g_utils.c; $(DO_LCC) -$(GDIR)/vm/g_weapon.asm : $(GDIR)/g_weapon.c; $(DO_LCC) -$(GDIR)/vm/q_math.asm : $(GDIR)/q_math.c; $(DO_LCC) -$(GDIR)/vm/q_shared.asm : $(GDIR)/q_shared.c; $(DO_LCC) - -$(BDIR)/$(GAMEDIR)/vm/cgame.qvm : - echo cgame.qvm disabled - -$(BDIR)/$(GAMEDIR)/vm/ui.qvm : - echo ui.qvm disabled - -############################################################################# -# CGAME -############################################################################# - -CGOBJ = \ - $(SRCDIR)/cgame/bg_lib.o \ - $(SRCDIR)/cgame/bg_misc.o \ - $(SRCDIR)/cgame/bg_pmove.o \ - $(SRCDIR)/cgame/bg_slidemove.o \ - $(SRCDIR)/cgame/cg_consolecmds.o \ - $(SRCDIR)/cgame/cg_draw.o \ - $(SRCDIR)/cgame/cg_drawtools.o \ - $(SRCDIR)/cgame/cg_effects.o \ - $(SRCDIR)/cgame/cg_ents.o \ - $(SRCDIR)/cgame/cg_event.o \ - $(SRCDIR)/cgame/cg_info.o \ - $(SRCDIR)/cgame/cg_localents.o \ - $(SRCDIR)/cgame/cg_main.o \ - $(SRCDIR)/cgame/cg_marks.o \ - $(SRCDIR)/cgame/cg_players.o \ - $(SRCDIR)/cgame/cg_playerstate.o \ - $(SRCDIR)/cgame/cg_predict.o \ - $(SRCDIR)/cgame/cg_scoreboard.o \ - $(SRCDIR)/cgame/cg_servercmds.o \ - $(SRCDIR)/cgame/cg_snapshot.o \ - $(SRCDIR)/cgame/cg_view.o \ - $(SRCDIR)/cgame/cg_weapons.o \ - $(SRCDIR)/cgame/q_math.o \ - $(SRCDIR)/cgame/q_shared.o - -$(SRCDIR)/cgame$(ARCH).$(SHLIBEXT) : $(CGOBJ) - $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(CGOBJ) - -$(SRCDIR)/cgame/bg_lib.o : $(GDIR)/bg_lib.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/bg_pmove.o : $(GDIR)/bg_pmove.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/bg_slidemove.o : $(GDIR)/bg_slidemove.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_consolecmds.o : $(CGDIR)/cg_consolecmds.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_draw.o : $(CGDIR)/cg_draw.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_drawtools.o : $(CGDIR)/cg_drawtools.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_effects.o : $(CGDIR)/cg_effects.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_ents.o : $(CGDIR)/cg_ents.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_event.o : $(CGDIR)/cg_event.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_info.o : $(CGDIR)/cg_info.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_localents.o : $(CGDIR)/cg_localents.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_main.o : $(CGDIR)/cg_main.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_marks.o : $(CGDIR)/cg_marks.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_players.o : $(CGDIR)/cg_players.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_playerstate.o : $(CGDIR)/cg_playerstate.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_predict.o : $(CGDIR)/cg_predict.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_scoreboard.o : $(CGDIR)/cg_scoreboard.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_servercmds.o : $(CGDIR)/cg_servercmds.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_snapshot.o : $(CGDIR)/cg_snapshot.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_view.o : $(CGDIR)/cg_view.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/cg_weapons.o : $(CGDIR)/cg_weapons.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/q_math.o : $(GDIR)/q_math.c; $(DO_SHLIB_CC) -$(SRCDIR)/cgame/q_shared.o : $(GDIR)/q_shared.c; $(DO_SHLIB_CC) - -############################################################################# -# UI -############################################################################# - -UIOBJ = \ - $(SRCDIR)/ui/bg_lib.o \ - $(SRCDIR)/ui/bg_misc.o \ - $(SRCDIR)/ui/ui_addbots.o \ - $(SRCDIR)/ui/ui_atoms.o \ - $(SRCDIR)/ui/ui_cinematics.o \ - $(SRCDIR)/ui/ui_confirm.o \ - $(SRCDIR)/ui/ui_connect.o \ - $(SRCDIR)/ui/ui_controls2.o \ - $(SRCDIR)/ui/ui_credits.o \ - $(SRCDIR)/ui/ui_demo2.o \ - $(SRCDIR)/ui/ui_display.o \ - $(SRCDIR)/ui/ui_gameinfo.o \ - $(SRCDIR)/ui/ui_ingame.o \ - $(SRCDIR)/ui/ui_loadconfig.o \ - $(SRCDIR)/ui/ui_main.o \ - $(SRCDIR)/ui/ui_menu.o \ - $(SRCDIR)/ui/ui_mfield.o \ - $(SRCDIR)/ui/ui_network.o \ - $(SRCDIR)/ui/ui_playermodel.o \ - $(SRCDIR)/ui/ui_players.o \ - $(SRCDIR)/ui/ui_playersettings.o \ - $(SRCDIR)/ui/ui_preferences.o \ - $(SRCDIR)/ui/ui_qmenu.o \ - $(SRCDIR)/ui/ui_saveconfig.o \ - $(SRCDIR)/ui/ui_serverinfo.o \ - $(SRCDIR)/ui/ui_servers2.o \ - $(SRCDIR)/ui/ui_setup.o \ - $(SRCDIR)/ui/ui_sound.o \ - $(SRCDIR)/ui/ui_sparena.o \ - $(SRCDIR)/ui/ui_specifyserver.o \ - $(SRCDIR)/ui/ui_splevel.o \ - $(SRCDIR)/ui/ui_sppostgame.o \ - $(SRCDIR)/ui/ui_spskill.o \ - $(SRCDIR)/ui/ui_startserver.o \ - $(SRCDIR)/ui/ui_team.o \ - $(SRCDIR)/ui/ui_video.o \ - \ - $(SRCDIR)/ui/q_math.o \ - $(SRCDIR)/ui/q_shared.o - -$(SRCDIR)/ui$(ARCH).$(SHLIBEXT) : $(UIOBJ) - $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(UIOBJ) - -$(SRCDIR)/ui/bg_lib.o : $(GDIR)/bg_lib.c; $(DO_CC) -$(SRCDIR)/ui/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_CC) -$(SRCDIR)/ui/ui_addbots.o : $(UIDIR)/ui_addbots.c; $(DO_CC) -$(SRCDIR)/ui/ui_atoms.o : $(UIDIR)/ui_atoms.c; $(DO_CC) -$(SRCDIR)/ui/ui_cinematics.o : $(UIDIR)/ui_cinematics.c; $(DO_CC) -$(SRCDIR)/ui/ui_confirm.o : $(UIDIR)/ui_confirm.c; $(DO_CC) -$(SRCDIR)/ui/ui_connect.o : $(UIDIR)/ui_connect.c; $(DO_CC) -$(SRCDIR)/ui/ui_controls2.o : $(UIDIR)/ui_controls2.c; $(DO_CC) -$(SRCDIR)/ui/ui_credits.o : $(UIDIR)/ui_credits.c; $(DO_CC) -$(SRCDIR)/ui/ui_demo2.o : $(UIDIR)/ui_demo2.c; $(DO_CC) -$(SRCDIR)/ui/ui_display.o : $(UIDIR)/ui_display.c; $(DO_CC) -$(SRCDIR)/ui/ui_gameinfo.o : $(UIDIR)/ui_gameinfo.c; $(DO_CC) -$(SRCDIR)/ui/ui_ingame.o : $(UIDIR)/ui_ingame.c; $(DO_CC) -$(SRCDIR)/ui/ui_loadconfig.o : $(UIDIR)/ui_loadconfig.c; $(DO_CC) -$(SRCDIR)/ui/ui_main.o : $(UIDIR)/ui_main.c; $(DO_CC) -$(SRCDIR)/ui/ui_menu.o : $(UIDIR)/ui_menu.c; $(DO_CC) -$(SRCDIR)/ui/ui_mfield.o : $(UIDIR)/ui_mfield.c; $(DO_CC) -$(SRCDIR)/ui/ui_network.o : $(UIDIR)/ui_network.c; $(DO_CC) -$(SRCDIR)/ui/ui_playermodel.o : $(UIDIR)/ui_playermodel.c; $(DO_CC) -$(SRCDIR)/ui/ui_players.o : $(UIDIR)/ui_players.c; $(DO_CC) -$(SRCDIR)/ui/ui_playersettings.o : $(UIDIR)/ui_playersettings.c; $(DO_CC) -$(SRCDIR)/ui/ui_preferences.o : $(UIDIR)/ui_preferences.c; $(DO_CC) -$(SRCDIR)/ui/ui_qmenu.o : $(UIDIR)/ui_qmenu.c; $(DO_CC) -$(SRCDIR)/ui/ui_quit.o : $(UIDIR)/ui_quit.c; $(DO_CC) -$(SRCDIR)/ui/ui_saveconfig.o : $(UIDIR)/ui_saveconfig.c; $(DO_CC) -$(SRCDIR)/ui/ui_serverinfo.o : $(UIDIR)/ui_serverinfo.c; $(DO_CC) -$(SRCDIR)/ui/ui_servers2.o : $(UIDIR)/ui_servers2.c; $(DO_CC) -$(SRCDIR)/ui/ui_setup.o : $(UIDIR)/ui_setup.c; $(DO_CC) -$(SRCDIR)/ui/ui_sound.o : $(UIDIR)/ui_sound.c; $(DO_CC) -$(SRCDIR)/ui/ui_sparena.o : $(UIDIR)/ui_sparena.c; $(DO_CC) -$(SRCDIR)/ui/ui_specifyserver.o : $(UIDIR)/ui_specifyserver.c; $(DO_CC) -$(SRCDIR)/ui/ui_splevel.o : $(UIDIR)/ui_splevel.c; $(DO_CC) -$(SRCDIR)/ui/ui_sppostgame.o : $(UIDIR)/ui_sppostgame.c; $(DO_CC) -$(SRCDIR)/ui/ui_spskill.o : $(UIDIR)/ui_spskill.c; $(DO_CC) -$(SRCDIR)/ui/ui_startserver.o : $(UIDIR)/ui_startserver.c; $(DO_CC) -$(SRCDIR)/ui/ui_team.o : $(UIDIR)/ui_team.c; $(DO_CC) -$(SRCDIR)/ui/ui_video.o : $(UIDIR)/ui_video.c; $(DO_CC) -$(SRCDIR)/ui/q_math.o : $(GDIR)/q_math.c; $(DO_SHLIB_CC) -$(SRCDIR)/ui/q_shared.o : $(GDIR)/q_shared.c; $(DO_SHLIB_CC) - -############################################################################# -# MISC -############################################################################# - -clean: - rm -f $(GVMASM) diff --git a/code/unix/Quake3.kdelnk b/code/unix/Quake3.kdelnk deleted file mode 100644 index 62a5f0e..0000000 --- a/code/unix/Quake3.kdelnk +++ /dev/null @@ -1,12 +0,0 @@ -# KDE Config File -[KDE Desktop Entry] -Name=Quake3 -Name[C]=Quake3 -MimeType= -Exec=/usr/local/games/quake3/linuxquake3 -Comment=Quake3: Arena by id Software -Icon=quake3.xpm -TerminalOptions= -Path= -Type=Application -Terminal=0 diff --git a/code/unix/README.EULA b/code/unix/README.EULA deleted file mode 100644 index 97c54a2..0000000 --- a/code/unix/README.EULA +++ /dev/null @@ -1,184 +0,0 @@ - LIMITED COMPATIBILITY TESTING AND RECREATIONAL - USE SOFTWARE TEST LICENSE AGREEMENT - -This Limited Compatibility Testing and Recreational Use Software Test -License Agreement (the "Agreement") is a legal agreement between you, the -end-user, and Id Software, Inc. ("ID"). BY CONTINUING THE INSTALLATION -OF THIS TEST VERSION OF THE GAME PROGRAM ENTITLED QUAKE III: ARENA (THE -"SOFTWARE"), BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING -THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, COMPUTER RAM OR OTHER STORAGE, -YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS AGREEMENT. - -1. Grant of License. Subject to the terms and provisions of this -Agreement, ID grants to you the non-exclusive limited right to use this -Software only in executable or object code form and only for the purpose -of testing the compatibility of your computer system with the Software -and for non-commercial, recreational purposes. The term "Software" -includes all elements of the Software such as data files and screen -displays. You are not receiving any ownership or proprietary right, -title or interest in or to the Software or the copyright, trademarks, or -other rights related thereto. For purposes of this section, "use" means -loading the Software into RAM and/or onto computer hard drive, as well -as installation of the Software on a hard disk or other storage device. -You agree that the Software will not be shipped, transferred or exported -into any country in violation of the U.S. Export Administration Act (or -any other law governing such matters) by you or anyone at your direction -and that you will not utilize and will not authorize anyone to utilize, -in any other manner, the Software in violation of any applicable law. -The Software may not be downloaded or otherwise exported or reexported -into (or to a national or resident of) any country to which the U.S. has -embargoed goods or to anyone or into any country who/which are prohibited, -by applicable law, from receiving such property. - -2. Prohibitions. You, either directly or indirectly, shall not do -any of the following acts: - -a. rent the Software; - -b. sell the Software; - -c. lease or lend the Software; - -d. offer the Software on a "pay-per-play" basis; - -e. distribute the Software (except by electronic means, as permitted -by section 3. hereinbelow) by any means, including, but not limited to -direct mail, retail, mail order or other means; - -f. in any other manner and through any medium whatsoever commercially -exploit the Software or use the Software for any commercial purpose; - -g. disassemble, reverse engineer, disassemble, decompile, modify -or alter the Software; - -h. translate the Software; - -i. reproduce or copy the Software (except as permitted by section -3. hereinbelow); - -j. publicly display the Software; - -k. prepare or develop derivative works based upon the Software; - -l. remove or alter any legal notices, such as trademark and copyright -notices, affixed on or within the Software; or - -m. create or develop extra or add-on levels for the Software. - -3. Permitted Electronic Distribution and Copying. So long as this -Agreement accompanies the Software at all times, ID grants to you the -limited right to distribute, free of charge, and by electronic means -only, the Software. Anyone who receives the Software shall be limited to -all the terms and conditions of this Agreement. You may make only the -following copies of the Software: (i) you may download the Software -from the Internet and onto your computer hard drive; (ii) you may copy -the Software from your computer hard drive into your computer RAM; and -(iii) you may make one (1) "back up" or archival copy of the Software -on one (1) hard disk. - -4. Copyright. The Software and all copyrights, trademarks and all -other conceivable intellectual property rights related to the Software -are owned by ID and are protected by United States copyright laws, -international treaty provisions and all applicable law, such as the -Lanham Act. You must treat the Software like any other copyrighted -material, as required by 17 U.S.C., ¤101 et seq. and other applicable law. -You agree to use your best efforts to see that any user of the Software -licensed hereunder complies with this Agreement. You agree that you -are receiving a copy of the Software by license only and not by sale and -that the "first sale" doctrine of 17 U.S.C. ¤109 does not apply to your -receipt or use of the Software. - -5. NO WARRANTIES. ID DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO -THE SOFTWARE. ID DOES NOT WARRANT THAT THE OPERATION OF THE SOFTWARE -WILL BE UNINTERRUPTED OR ERROR FREE OR THAT THE SOFTWARE WILL MEET YOUR -SPECIFIC REQUIREMENTS. ADDITIONAL STATEMENTS SUCH AS PRESENTATIONS, -WHETHER ORAL OR WRITTEN, DO NOT CONSTITUTE WARRANTIES BY ID AND SHOULD -NOT BE RELIED UPON. - -6. Governing Law, Venue and Liability Limitation. This Agreement -shall be construed in accordance with and governed by the applicable laws -of the State of Texas and applicable United States federal law. Copyright -and other proprietary matters will be governed by United States laws and -international treaties. Exclusive venue for all litigation regarding -this Agreement shall be in Dallas County, Texas and you agree to submit to -the jurisdiction of the courts in Dallas, Texas for any such litigation. -IN ANY CASE, NEITHER ID NOR ID'S OFFICERS, EMPLOYEES, DIRECTORS, AGENTS, -LICENSEES, SUBLICENSEES, SUCCESSORS OR ASSIGNS SHALL BE LIABLE FOR LOSS OF -DATA, LOSS OF PROFITS, LOST SAVINGS, SPECIAL, INCIDENTAL, CONSEQUENTIAL, -INDIRECT, PUNITIVE OR OTHER SIMILAR DAMAGES ARISING FROM BREACH OF -WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, STRICT PRODUCT LIABILITY, -OR OTHER LEGAL THEORY EVEN IF ID OR ITS AGENT HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES OR EVEN IF SUCH DAMAGES ARE FORESEEABLE, -OR LIABLE FOR ANY CLAIM BY ANY OTHER PARTY. Some jurisdictions do not -allow the exclusion or limitation of incidental or consequential damages, -so the above limitation or exclusion may not apply to you. - -7. U.S. Government Restricted Rights. To the extent applicable, -the United States Government shall only have those rights to use the -Software as expressly stated and expressly limited and restricted in -this Agreement, as provided in 48 C.F.R. ¤¤ 227.7202-1 through 227.7204, -inclusive. - -8. General Provisions. A copy of all notices or other correspondence -which you send to ID shall also be sent by you to ID's counsel: - -D. Wade Cloud, Jr. -HIERSCHE, MARTENS, HAYWARD, DRAKELEY & URBACH, P.C. -15303 Dallas Parkway, Suite 700 -Dallas, TX 75248 -(972) 701-7000 -Facsimile: (972) 701-8765 - -Neither this Agreement nor any part or portion hereof shall be assigned -or sublicensed by you. ID may assign its rights under this Agreement -in ID's sole discretion. Should any provision of this Agreement -be held to be void, invalid, unenforceable or illegal by a court, -the validity and enforceability of the other provisions shall not be -affected thereby. If any provision is determined to be unenforceable, -you agree to a modification of such provision to provide for enforcement -of the provision's intent, to the extent permitted by applicable law. -Failure of ID to enforce any provision of this Agreement shall not -constitute or be construed as a waiver of such provision or of the right -to enforce such provision. If you fail to comply with any term of this -Agreement, YOUR LICENSE IS AUTOMATICALLY TERMINATED, WITHOUT NOTICE AND -ID MAY PURSUE ALL RELIEF AND REMEDIES AGAINST YOU WHICH ARE AVAILABLE -UNDER APPLICABLE LAW AND/OR THIS AGREEMENT. You agree that in the event -of litigation relating to this Agreement, the prevailing litigant shall -be entitled to recover the prevailing litigant's attorneys' fees and -expenses and costs of court in addition to all other relief available -under this Agreement and/or applicable law. In the event this Agreement -is terminated, you shall have no right to use the Software, in any manner -and you shall immediately destroy all copies of the Software in your -possession, custody or control. You agree that your unauthorized use -of any ID property, whether in whole or in part, would immediately and -irreparably damage ID such that ID could not be adequately compensated -by an award of monetary damages, and in the event of such threatened -or actual unauthorized use ID shall be entitled to an injunctive order -appropriately restraining and/or prohibiting such unauthorized use -without the necessity of ID posting bond or other security. - -YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, YOU UNDERSTAND THIS -AGREEMENT, AND UNDERSTAND THAT BY CONTINUING THE INSTALLATION OF THE -SOFTWARE, BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING -THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE OR RAM, YOU AGREE TO BE BOUND -BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU FURTHER AGREE THAT, -EXCEPT FOR WRITTEN SEPARATE AGREEMENTS BETWEEN ID AND YOU, THIS AGREEMENT -IS A COMPLETE AND EXCLUSIVE STATEMENT OF THE RIGHTS AND LIABILITIES OF -THE PARTIES HERETO. THIS AGREEMENT SUPERSEDES ALL PRIOR ORAL AGREEMENTS, -PROPOSALS OR UNDERSTANDINGS, AND ANY OTHER COMMUNICATIONS BETWEEN ID -AND YOU RELATING TO THE SUBJECT MATTER OF THIS AGREEMENT. - - - -April 23, 1999 5:11 p.m. - - - - - -LIMITED COMPATIBILITY TESTING AND RECREATIONAL USE SOFTWARE -TEST LICENSE AGREEMENT Page 4 -3406.0586\C:\DWC\DOC\2082.DOC - diff --git a/code/unix/README.Linux b/code/unix/README.Linux deleted file mode 100644 index 05822e6..0000000 --- a/code/unix/README.Linux +++ /dev/null @@ -1,352 +0,0 @@ -+----------------------------------------+ -| Q3Test | -| The Official Quake 3: Arena TEST | -| Linux version | -| Revision 1.08 | -| Released Aug 3, 1999 | -| Copyright (C) 1999 id Software, inc. | -+----------------------------------------+ -| Documentation: Paul Jaquays | -| Dave Kirsch | -+----------------------------------------+ - -Outline: - -1. Introduction -2. Bug Reporting -3. Installing Q3Test -4. Running Q3Test. Operating Instructions -5. Known Issues - -================== -== Section 1. == -== INTRODUCTION == -================== - -This is the Linux version of the test. - -Before proceeding onward, please read the README.EULA file. This is -the End User License Agreement. It's the agreement between you and id -regarding this test. Read it. Understand that the acts of loading or -running the software, or placing it on your computer hard drive, RAM, -or other storage, you are agreeing to be bound by the terms of the End -User License Agreement. So it's best to know what you are agreeing to. - -The operating instructions for the test are included in the -separate "README.Q3Test" file. For the most part, the game functions -are the same across all platforms. Differences will be noted when necessary. - -+----------------+ -| THIS IS A TEST | -+----------------+ - -We want to set the record straight from the outset. This is neither a -demo nor an ALPHA version of the final game and should not be expected -to behave as such. Q3Test is a test of Quake3: Arena's network technology -and graphics compatibility. While many of the game features that you will -see in this test are in a highly polished state, do not confuse this with -being anything other than what it is intended to be: a test. By running -this test openly on the Internet and on a multitude of local networks, -we hope to expose problems that could not otherwise be discovered on the -limited number of in-house systems and computer. That's why we need your -assistance for this test. - -Furthermore, it is anticipated that there may be revisions and additions -made to the test that will make it incompatible with earlier versions. - -+---------------------+ -| SYSTEM REQUIREMENTS | -+---------------------+ - -There is no software-only version of the game. If your computer is not -hardware accelerated with a game compatible graphics card, you will NOT be -able to run Q3Test. Currently, 3DFX based cards are the only -tested compatible cards. If your computer does not meet the -minimum requirements, you are unlikely to be able to run a satisfactory -game experience. - -A glibc compatible Linux installation is required. An easy to determine -if you have glibc support is to type this: - - ls -l /lib/libc* - -If you get a report of libc6 (you may also have libc5), you have a -glibc based system. - -The Linux version requires a supported hardware 3D acceleration card. The -following are currently supported: - - o 3Dfx Voodoo Graphics based cards - o 3Dfx Voodoo2 based cards - -Other cards of similar make and model may work, but are not supported. - -Other X11 OpenGL libraries may work with a supported hardware -accelerator, but have not been extensively tested. Performance on -untested OpenGL configurations may not produce acceptable game -speed. - -For 3Dfx based products, Linux Q3Test is distributed with a version of Mesa -3-D specifically compiled for Voodoo support. You must have 3Dfx Linux Glide -drivers installed however. These drivers are available from: - - http://glide.xxedgexx.com/3DfxRPMS.html - -Make sure that you download and install the glibc versions of the drivers -(found at the bottom of the page). - -Mirrors for this site are can be found at: - - http://glide.mirrors.sonic.net - http://glide.samiam.org - -Please follow the installation instructions presented there for adding the -correct drivers for your 3D-acceleration card. Note that there are two ways -to install the 3DFX drivers-one with support for a /dev/3dfx device that -does not require root permissions in order to use the card. If you choose to -not use the /dev/3dfx method, you will have to run Q3Test as the root user. - -NOTE: Linux Q3Test will try to load "libGL.so" before using 3Dfx drivers. -This can cause problems if you have a software or third party OpenGL driver -installed. You can specifically target the included 3Dfx based Mesa driver -by using the following command line: - - ./linuxquake3 +set r_glDriver libMesaVoodooGL.so.3.1 - -For 3DFX users, you may disable the vertical sync refresh. This can improve -proformance at the cost of some visual tearing of the image. Entering the -following command into your shell before running Q3Test will turn off -the vertical sync: - - export FX_GLIDE_SWAPINTERVAL=0 - -Then run Linux Q3Test from the same command line normally. - -+-----------+ -| X11 Setup | -+-----------+ - -Linux Q3Test requires X11 to run. There is no console-based version as in -previous id products such as GLQuake and Quake2. XFree86 version 3.2 or -later is required. - -There are two ways that mouse input is handled under XFree86: - - o By default, Q3Test will attempt to use DGA mouse handling. DGA - support features direct reading of the mouse motion and provides - more accurate control while playing the game. By default this - support is enabled, but can be disabled by adding "+set - in_dgamouse 0" to the command line at startup. - o The non-DGA method of mouse input uses pointer grabbing and warps - the pointer to the middle of the window on each mouse update. On - systems with a slow frame rate and a lot of mouse user input, the - motion can get "clipped" to the window boundaries. This method of - input is more compatible however. - -Q3Test uses the XFree86 VidModeExtension facilities if available to provide -fullscreen play. This does not apply to 3Dfx passthrough based cards, since -the passthrough cable takes over the video display upon activation anyway. - -When configuring your X11 server, make sure that you include lower -resolution modes such as 640x480 and 800x600. Q3Test will auto-switch to -these modes using the VidModeExtension if you select fullscreen from the -graphics options menu. If the lower resolution modes are not listed in the -XFree86 configuration file, Q3Test will be unable to switch to the desired -resolution for fullscreen play. - -+-------------------------+ -| Sound Support and Setup | -+-------------------------+ - -Q3Test uses the /dev/dsp sound device for sound support under Linux. This is -the default device provided by the sound drivers included with the Linux -kernel. Please note that at the time of this writing, PCI based sound cards -such as the SoundBlaster Live and Diamond Monster MX series were not -supported. They may be supported in the future. Check -http://www.opensound.com/ for support in the future. - -If you do not run Q3Test as root (recommended), you may need to make sure -the permissions for the /dev/dsp device are read and write by the user -running Q3Test. The cheap and easy way to make this happen is to do "chmod -o+rw /dev/dsp" as root. For the more security conscious, a special sound -group could be created and Q3Test could be made setgid to the sound group to -access the device. - -Q3Test uses mmap() to map the sound buffers on /dev/dsp directly in order to -provide responsive sound needs. Sound cards must be able to support this -feature in order to work. SoundBlaster 16, AWE32 and AWE64 cards are known -to work. - -+----------------------+ -| WHAT'S IN THIS TEST? | -+----------------------+ - -We have included three maps with this test version of Quake3: Arena. They -are q3test1, q3test2, and q3tourney. - -q3test1 for 4-8 players on Internet or LAN play Best with 6 players -q3test2 for 3-8 players Primarily for LAN play Best with 3 players -q3tourney is the tournament map - -=================== -== Section 2. == -== BUG REPORTING == -=================== - -What we would like from our testers are emails with descriptions of -problems that are encountered, particularly those involving video or -network bugs. Do NOT send reports to individual id employees. All bug -reports should go to the following e-mail address: - -q3feedback@idsoftware.com - -In your subject line, please describe the system the game is being played -on (Mac, Linux, Win32) and the type of problem you are reporting: video, -network, sound or game. Example Subject Line: "Mac/video problem" or -"Linux/network connection problem." - -In the body of your letter (no attached files please), briefly list and -describe the problems. Detailed descriptions of problems are good, but -remember that brevity is best. Please do NOT send screen shots unless -they are the ONLY way to show a problem. - -While we realize that you may have comments and suggestions regarding -specific game play features, please refrain from submitting such along -with bug reports. Comments on game play can be made on the official -Quake 3: Arena message board at: - -http://www.quake3arena.com - -======================== -== Section 3. == -== INSTALLING Q3TEST == -======================== - -After you have installed the needed hardware drivers for your 3D -acceleration and sound hardware, you need to install the Q3Test package. - -Q3Test is available as a Red Hat RPM file or as a tar file. To install the -RPM file, enter the following when logged in as the root user: - -rpm -Uvh q3test-1.00-glibc-1.i386.rpm - -The rpm installs the game and data files in /usr/local/games/q3test. - -[ Note: If you have not installed (or do not wish to install) the Linux -glide drivers, you may get an error message about not having libglide2x.so -installed. This can be ignored and installation can be forced by adding -the --nodeps option to the rpm command line as follows: -rpm --nodeps -Uvh q3test-1.00-glibc-1.i386.rpm ] - -If you are going to install the tar version, make a directory for -installation, untar the file as follows: - -tar xzvf q3test-1.00-glibc-i386.tar.gz - -This will untar the files into a q3test subdirectory under the current -directory. - -==================== -== Section 4. == -== RUNNING Q3TEST == -==================== - -It is recommended that you do not run Q3Test using the root account or with -root privileges. There are two exceptions to this: - - o If you are using a 3Dfx based accelerator card and do not install - the /dev/3dfx configuration option. (You will have to run as root - in order to access the card). - o If you do not have access to the /dev/dsp device and do not wish - to change the mode of the device so that non-root accounts can - access it. - -You will have to be running under X11 or have the DISPLAY variable pointed -to a OpenGL glX capable X Server. - -By default, Q3Test tries to find the following OpenGL libraries in this -order: - - o libGL.so.1 - o libMesaVoodooGL.so.3.1 - -You can override the library name by entering, "+set r_glDriver " -on the command line. This may be needed if you are using a non-standard set -up and have a different name for the OpenGL shared library. - -If everything proceeds successfully, you should have a Q3Test window on your -desktop with a menu displayed (3DFX owners will get a full screen view). If -you want to use full screen, go to the System Configuration, Graphics -Options, Fullscreen, change the value to Yes, and hit enter to apply it. - -If you intend to connect to the Internet to play Q3Test, make certain -that your net connection is open and working first. - -====================== -== Section 5. == -== KNOWN ISSUES == -====================== - -Q. My mouse is erratic. My player is constantly looking up or down and -I can't seem to move him. - -A. This happens with two issues. Some versions of XFree86 have a bug in -DGA mouse handling that confuses Q3Test. You can try turning off DGA mouse -support by entering "+set in_dgamouse 0" on the command line when you -start Q3Test. This problem can also occur after a restart of the video -system (such as after a graphic setting change). This is because some -sort of event occurred to jam up the mouse. Restarting the video system -another time and not moving the mouse during the restart should clear it. - - -Q. When I do a video restart (for example, selecting Apply in the Graphics -Options menu), Q3Test exits with a Sig11. - -A. This is a driver related problem. -On 3DFX hardware that is using the /dev/3dfx device and you are NOT running -as root, it seems that the restart doesn't clear some sort of permission. -Running Q3Test as root will fix this problem. - - -Q. Performance is so slow I can't play! The frame rate looks like one -frame per second! - -A. Most of the current drivers for Linux do not support hardware -acceleration at any bit depth other than 15 or 16 bit color. Make sure -that you specify 16 bit color when you run your X11 Server, such as: - - startx -- -bpp 16 - - -Q. I have a Voodoo3. When I start the game, I send up at a low resolution -version of my desktop. - -A. The current Voodoo3 X11 Servers have problems with DGA Mouse support. -This is a known driver issue and will be fixed in newer revisions of the -Voodoo3 X11 Server. Run the game with the following to disable it: - ./linuxquake3 +set in_dgamouse 0 - - -Q. I'm running Gnome with Englightenment and sound doesn't work. - -A. If you are using the Enlightenment Sound Daemon (esd), it will not release -the sound hardware for Quake3 Test's usage. You can disable it before running -the test as follows: - esdctl off # turn it off - start q3test the normal way - esdctl on # turn it back on - - -Q. I try to run Q3Test, but sound doesn't work. The console says "Can't -open /dev/dsp. /dev/dsp: Can't allocate memory." - -A. This can happen if the vmware kernel modules are loaded. You can unload -them by typing when logged as root: - /etc/rc.d/init.d/vmware stop -Assuming you are using a RedHat system. - - -Q. I was playing Q3Test and suddenly it quit and reported a signal error. - -A. This is probably a bug. Please report it. - diff --git a/code/unix/README.Q3Test b/code/unix/README.Q3Test deleted file mode 100644 index 65ddef2..0000000 --- a/code/unix/README.Q3Test +++ /dev/null @@ -1,306 +0,0 @@ -+----------------------------------------+ -| Q3Test | -| The Official Quake 3: Arena TEST | -| Operating Instructions Readme | -| Revision 2.1 | -| Released Friday July 16th, 1999 | -| Copyright (C) 1999 id Software, inc. | -+----------------------------------------+ -| Documentation: Paul Jaquays | -+----------------------------------------+ - -This game is not yet rated by the ESRB. It contains animated -violence and blood. A rating for mature audiences 17+ is -anticipated. - -1. Introduction -2. Operating Instructions -3. Status Readouts -4. Player Actions -5. The Arena Environment -6. The Game Console -7. Problem Icons - -================== -== Section 1. == -== INTRODUCTION == -================== - - These instructions for game play should work with the versions of the game that are targeted at different platforms. - - Before proceeding onward, click on the EULA_Readme file icon. This is the End User License Agreement. It's the agreement between you and id regarding this test. Read it. Understand that the acts of loading or running the software, or placing it on your computer hard drive, RAM, or other storage, you are agreeing to be bound by the terms of the End User License Agreement. So it's best to know what you are agreeing to. - - If you agree to the conditions of the End User License Agreement, install the game on your computer's hard drive. - If you are using the Win32 version, open the readme file included for GLSetup. This application will load the most recent versions of the GL drivers needed to play Quake3: Arena. - - The platform-specific instructions for the test are included in a separate Readme file. Refer to the appropriate Readme for your hardware. - -+----------------+ -| THIS IS A TEST | -+----------------+ - We want to set the record straight from the outset. This is neither a demo nor an ALPHA version of the final game and should not be expected to behave as such. Q3Test is a test of Quake3: Arena's network technology and graphics compatibility. While many of the game features that you will see in this test are in a highly polished state, do not confuse this with being anything other than what it is intended to be: a test. By running this test openly on the Internet and on a multitude of local networks, we hope to expose problems that could not otherwise be discovered on the limited number of in-house systems and computers we have available. That's why we need your assistance for this test. - - Furthermore, it is anticipated that there may be ongoing revisions and additions made to the test that will make it incompatible with earlier versions. - -============================ -== Section 2. == -== OPERATING INSTRUCTIONS == -============================ - - When you start Q3Test, the game does not automatically load a map. Instead it displays the Main Menu screen. At this point (or at any time during the game) you may adjust and customize the video and audio settings on your computer, change details regarding your game character, and if desired, change the default controls to ones more to your liking. - -At any time during the game, press the Escape key to bring up the Main menu and superimpose it over the game screen. Use the up and down arrow keys to navigate the menu, and press the Enter key to select a function. Press Escape to return to the main level menu (and set any selected choices). Each Main menu function brings up a list of secondary menu items. If you have problems using the secondary menu selections, please refer to the message banner at the bottom of the screen for technical details. - -If a menu selection appears in gray, you cannot select or modify it. Choosing some options in the CONTROL CUSTOMIZATION and GRAPHICS OPTIONS menus will disallow other options. This is because they are either unnecessary (as is the case with MOUSE LOOK if you select the FREE LOOK option), or are not supported (as is the case with COLOR DEPTH if you chose the VOODOO OPENGL). - -+-----------+ -| MAIN MENU | -+-----------+ -The first three Main Menu options, SEARCH FOR LAN GAME, CONNECT TO NETWORK GAME and START NETWORK GAME are only available if the player is not currently connected to an ongoing game. - -SEARCH FOR LAN GAME: -If your computer is on a Local Area Network (LAN), this will show any currently active Q3Test servers on the network, along with the number of players currently in the game and the maximum number of players that can be in that game. - -Example: idserver q3test1 1/8 - -This indicates that the server on the LAN called "idserver" is currently playing the map "q3test1" and has one player in it out of the possible 8 that can be in the game at one time. - -Use the up/down arrow keys to select a server and hit ENTER to command your computer to connect to that game. - -CONNECT TO NETWORK GAME: - SERVER: If your computer is connected to the Internet, you can enter the IP address of a server and hit ENTER to attempt to make a connection to that server. For server id's Q3Test server listings, go to http://www.quake3arena.com or check with your favorite 3D gaming web sites for other servers. - RATE: Set the type of network connection you are using. Choices are: "<=28.8K", "33.6K", "56K", "ISDN", and "LAN/cable/xDSL". - -START NETWORK GAME: -To start a network game, whether on a LAN or over the Internet, select this option. The secondary menu screen has the following options: - -START: Launches the game using the parameters currently set on this menu. -MAP: This gives access to the list of maps located in the Quake3/Baseq3/Maps directory/folder. For the purposes of this test, there are only two maps. Use the left and right arrow keys to toggle between the two maps. -DEDICATED: This is either "no", "dedicated LAN," or "dedicated Internet." -A dedicated server (set to YES) runs the game, but does not display a graphic version of the game on the screen of the computer running the game. The default value for this is no. This means that you are running the server and participating as a player at the same time. -TIME LIMIT: entering a non-zero number here sets a time limit (in minutes) for the game duration. If the game has not ended because a frag limit has been set, then it will end when time runs out. -FRAG LIMIT: Entering a non-zero number here sets the number of "frags" or "kills" needed to win the game. If the game has not ended because a time limit has been set, then it will end when one player in the game reaches this number of frags. -MAX PLAYERS: This is the total number of players that may be in the game at any one time. -HOSTNAME: This is the name of the server. In the LAN example above, the hostname is "idserver." - -CUSTOMIZE PLAYER: -Allows the player to change information about his in-game persona. - -NAME: This is the player's name as it will appear on-screen during the game. It may be up to 33 characters long. - -SKIN: Visor is the only model in the test. Two skins (red and blue) are available for the model. Use the left and right arrow keys to select one. - -EFFECTS COLOR: You can choose an identifying color for your rail gun projectile trails. Use the left and right arrow keys to select a color. - -HANDICAP: Better players can choose to handicap themselves to balance a match against players of less skill by limiting the maximum amount of health and armor that they can have during the game. Use the left and right arrows to select a value from 25 to 100 points. Certain items and power ups will temporarily raise this value, but will then count down to the preset value. The default is 100. - -CUSTOMIZE CONTROLS: -Allows the player to change the assignment of game controls to other keyboard and mouse buttons. When you visit this menu for the first time, the default assignments for all controls are shown. To change an assignment, use the up/down arrow keys to select a game function. Press ENTER to activate the change process. Press the keyboard key or mouse input that you want to use for that function. Up to two keys/buttons may be assigned to each game function in this manner by repeating the process. If you inadvertently use a key assigned to another function, three question marks ("???") appear next to the function that previously used that key. - -ALWAYS RUN: setting this to YES causes your player to move faster, but make more noise as he moves. The RUN/WALK key allows the player to switch between fast/noisy and slow/silent movement modes. -FREELOOK: If YES, then you may look freely in all directions as if you were moving only your head by moving the mouse around. If this is Set to NO you must bind a key to mouse look. -INVERT MOUSE: Selecting YES inverts the up and down view movement directions. -MOUSE SPEED: This is set on the menu with a slide control. The faster your mouse speed, the greater the on-screen response to small movements of the mouse. Mouse speed can also be adjusted from the console. Bring the console down and type in "sensitivity". The game will respond by printing "sensitivity" is: "__" (the blank indicating the number value currently assigned to mouse speed) default is "5". Use the up arrow key to display sensitivity on the console again, enter a different number value and hit enter. Higher numbers are more sensitive. Lower numbers are less sensitive. - -SYSTEM CONFIGURATION: -EFFECTS VOLUME: Use the slide control to adjust game sound playback volume to your liking. -SOUND QUALITY: Select either Low (16 bit sound running at 11 megahertz) or High (32 bit sound running at 22 megahertz). -BRIGHTNESS: First, try running the game with the brightness set to 1.0 (the default level used by the designer when making the map). If the map is too dark to see in dimly lighted areas or too light in sunny areas, use this slide control to compensate for differences in the way some monitors and video cards draw the game world. Remember that the arenas are supposed to be dark and foreboding places. - -GRAPHICS OPTIONS: -This drops you down into another menu layer. The controls here are designed to help you optimize graphics and or/enhance the game's playability on your system. When you are satisfied with your selections, you must move the cursor to the bottom of the screen to the APPLY option to activate them. Pressing Escape to return to the SYSTEM CONFIGURATION MENU does not activate changes in the graphics settings. Changing anything on this menu will cause the game to restart the video. - -GRAPHICS MODE: This is a global setting for the display of the game's screen graphics. The settings are HIGH QUALITY, NORMAL, FAST, FASTEST, and CUSTOM. Selecting one of these choices affects most of the other settings on this page. If you make any adjustments to other settings on this page, the graphics mode changes to CUSTOM. -DRIVER: Consult the platform specific readme for the drivers that will work with your platform. -VIDEO MODE: This is the screen resolution size. Smaller resolutions can improve performance speed on slower machines. -COLOR DEPTH: Determines whether you are using 16-bit textures or 32-bit textures. Default means you run with the color depth currently set for your computer's desktop. -FULLSCREEN: A YES selection allows you to choose to run with the test filling the entire screen. A NO selection will run the game in a window. If run in a window, COLOR DEPTH is disabled because you are limited to whatever has been selected for the desktop. -LIGHTING: Allows you to chose either a LIGHTMAP or VERTEX lighting. Using the LIGHTMAP is recommended for best appearance. VERTEX lighting may improve game performance, but at a cost to appearance. -GEOMETRIC DETAIL: Lets you adjust the number subdivisions used to define curves in the arena on both world geometry and items, weapons and characters. HIGH is the normal setting. LOW greatly reduces curve complexity. -SCREEN SIZE: The slide control changes the amount of screen area devoted to display of the game. Reducing screen size can improve performance. -TEXTURE DETAIL: This sliding control allows you to adjust the level of detail displayed. Unless you have an extremely fast computer, the normal setting gives the best balance of detail vs. game speed. -TEXTURE QUALITY: This determines whether you wish to use 32-bit textures, 16-bit textures, or compressed textures. Many of the game's special effects will appear at their best only when defined by 32-bit textures. -OPENGL EXTENSIONS: Allows you to enable or disable OPENGL extensions. -DRIVER INFORMATION: Brings up a display of information regarding the drivers currently operating in your machine. It is not interactive. Hit ESC to return to the previous menu. - - -PREFERENCES: Hitting ENTER here will drop you into another menu that allows you to adjust other game features. -CROSSHAIR: choose one of four options, none, cross, dot, or angle. -MARKS ON WALLS: Enable or Disable weapons scars and blood smears. Disabling this feature may improve performance. -DYNAMIC LIGHTS: Enable or Disable lights that move through the world (such as light generated by weapon projectile trails). Disabling this feature may improve performance. -LIGHT FLARES: Enable or DISABLE glowing light halos around lights. Disabling this feature may improve performance. -IDENTIFY TARGET: Enable or Disable the ability to see the name of your foe when you put your crosshair on him (does not function if target is in fog). -SKY: Set the sky for either HIGH SPEED or HIGH QUALITY. - -RESET DEFAULTS: Restore all game settings and controls to their default value by reloading the default configuration. - -APPLY: You must select this and hit ENTER to lock in your choices. Doing so will restart the game video. - -SCREENSHOT: -Makes a targa file screen shot of what is currently in view on the screen. Look for it in the Screenshot folder within your Quake 3/Baseq3/screenshots folder. - -LEAVE ARENA: -This disconnects you from the arena you are currently playing, but does not quit you out of the game. From here you can connect to other servers or start your own. You can also leave an arena by typing "disconnect" on the command line of the console. - -QUIT GAME: -Returns you to the desktop. - - -====================== -== Section 6. == -== STATUS READOUTS == -====================== - - Your player status is shown as numbers and icons floating in your view at the bottom of the screen. There is an indicator for your ammo (far left) including the type of ammo currently in use, current health (left-center), your character portrait (center), armor (center-right), and Frag Count (far right). The digital timer in the upper right shows the amount of time you have been in this arena. When you have a one-use item in your inventory (such as the personal teleporter), its icon will appear on the right side of your display. When you are fragged, the character portrait and name of the foe who killed you appears in the upper right corner of the display. When you change weapons, icons representing the ammo of the weapons in your inventory will appear above your character portrait. If you have a weapon, but no ammunition for it, a negation symbol will be superimposed over the ammo icon. - -+----------------------------+ -| INTERPRETING THE LAGOMETER | -+----------------------------+ - The Lagometer is the graph in the lower right corner of the status display. It is a test function and not a part of regular game play. The upper graph (blue/yellow) slides one pixel for every rendered frame. Blue lines below the baseline mean that the frame is interpolating between two valid snapshots. Yellow lines above the baseline mean the frame is extrapolating beyond the latest valid time. The length of the line is proportional to the time. -The lower graph (green/yellow/red) slides one pixel for every received snapshot. By default, snapshots come 20 times a second, so if you are running >20 fps, the top graph will move faster, and vice versa. A red bar means the snapshot was dropped by the network. Green and yellow bars are properly received snapshots, with the height of the bar proportional to the ping. A yellow bar indicates that the previous snapshot was intentionally suppressed to stay under the rate limit. -The upper graph indicates the consistency of your connection. Ideally, you should always have blue bars of only a pixel or two in height. If you are commonly getting big triangles of yellow on the graph, your connection is inconsistent. - In a heavy firefight, it is normal for modem players to see yellow bars in the bottom graph, which should return to green when the action quiets down. If you are getting several red bars visible, you may want to look for a server that drops less packets. - There are a few tuning variables for people trying to optimize their connection: The most important one is "rate", which is what the connection speed option in the menu sets. We are fairly conservative with the values we set for the given modem speeds: 2500 for 28.8, 3000 for 33, and 3500 for 56k. You may actually be connecting faster than that, and modem compression may be buying you something, so you might get a better play experience by increasing the values slightly. If you connect at 50000 bps, try a rate of 5000, etc. Quake 3 errs on the conservative side, because too low of a rate will only make the movement of other things in the world choppy, while too high of a rate can cause huge amounts of lag. - Note that the optimal rate will be somewhat lower than a rate for QW or Q2, because Quake 3 now includes the UDP packet header length in the bandwidth estimate. You can ask for a different number of snapshots by changing the "snaps" variable, but there isn't a lot of benefit to that. Dedicated servers run at 40hz, so stick to divisors of that: 40, 20 (default), 10. A "snaps" of 40 will usually just cause you to hit your rate limit a lot faster. It may be useful for tuning rate, if nothing else. - You can adjust the local timing point with "cg_timenudge ", which effectively adds local lag to try to make sure you interpolate instead of extrapolate. If you really want to play on a server that is dropping a ton of packets, a timenudge of 100 or so might make the game smoother. - -===================== -== Section 7. == -== PLAYER ACTIONS == -===================== - - The descriptions below are based on the preset default configurations for the game controls. If you have played first person shooting games previously (such as Quake or Quake 2), you may want to reconfigure the controls to match your preferences. - -+----------+ -| ACTIONS | -+----------+ -WALKING: Use the four arrow keys or the mouse to walk around. To walk steadily forward, hold down the "forward" key (the up arrow or center button on a 3-button mouse). Turn left or right with the left or right arrow keys, or by sliding your mouse in the desired direction. - -RUNNING: To run, simply hold down the left Shift key to increase your -Speed (unless you have selected "Always Run", in which case it reverts you to a walk. If you prefer to always run during the game, open the Main menu, then the Customize Controls menu, and select Always Run. - -SHOOTING: Tap the Ctrl key or the left mouse button to fire. Hold the -fire key down to keep firing. - -LOOKING UP AND DOWN: The letters A and Z allow you to look up and down, -respectively. Start walking forward and your line of vision will -automatically readjust to the center position. You may also choose to -select Free Look under the Controls menu which will allow you to move the -mouse around as if it was your head movement. - -SWIMMING: While underwater, aim yourself in the direction you wish to go -and press the forward key to go in that direction. Unfortunately, as in -real life, you may lose your bearings while underwater. Use the jump key, -(default is the Space Bar), to kick straight up towards the surface. Once on -the surface, tread water by holding down the jump key. To get out of the -drink, swim toward the shore and you can either jump up onto the land or -walk straight out if it is shallow enough. There is always a way out of -water, but you may have to submerge even deeper in order to find it. - -CROUCHING: Press and hold down the C key to duck and move forward to "duck walk." When you release the C key, you will return to an upright position. It is also possible to avoid rockets in this manner. - -JUMPING: Tap the space bar to jump. You jump farther if you're moving -forward at the time. - -STRAFING: Hold down the ALT key and the left or right arrow key and you will side-step in that particular direction. This is perfect for avoiding incoming weapon attacks. - -PICKING UP OBJECTS: To pick up items, weapons, and power-ups, simply walk -over them. The weapon cross-hair will pulse larger briefly to indicate you have acquired a new weapon or supply. If you are unable to pick something up, it means you already have the maximum amount possible for that object. - -TALKING: To communicate with other players, press the T key -and type in your message. Press Enter when finished and your words will -appear at the top of the screen. You can also enter communications on the command line of the console. - -ATTACKING: Point your weapon at an opponent and press the fire button. Default fire keys are the left mouse and the control key). If a weapon runs out of ammo, it switches to the next available weapon with ammo the next time you fire it. If you have no ammo at all, you fight with the gauntlet. - -+--------+ -| DYING: | -+--------+ - When you die, the weapon you were using (except for the gauntlet and the machine gun), and any active power ups drop where you died. Armor, ammo and one-use items like the teleporter are lost. To respawn into the game, press the fire key. When you re-enter the game you are once again armed with only your starting equipment. - -=========================== -== Section 8. == -== THE ARENA ENVIRONMENT == -=========================== - -+-----------------------+ -| RAPID TRANSIT DEVICES | -+-----------------------+ -TELEPORTERS: These devices instantaneously move you to a pre-selected destination. - -PORTALS: These are devices that generate holes in space through which you can see your ultimate destination and move to it like walking through a doorway. - -JUMP PADS: Jump pads throw you upwards to land on higher portions of the arena. You have some "air" control over your final landing point. - -ACCELERATION PADS: Acceleration pads turn you into a human cannon ball, launching you to distant locations in the arena. As with the jump pads, you have some "air" control over your final landing point. - -+-----------------------+ -| ENVIRONMENTAL HAZARDS | -+-----------------------+ -LAVA: Walking on lava is not instantly fatal, but even with good armor protection, it can be a relatively quick (and noisy) doom. - -THE VOID: Falling off into the infinite blackness of the void is a near inescapable death. - -+--------------+ -| TEST ARSENAL | -+--------------+ -MACHINE GUN: This is your default weapon. It's an instant hit attack and reasonably accurate even at long range. It uses bullets. - -GAUNTLET: This is either your weapon of last resort when you're out of ammo or a cool tool to humiliate other players. When it hits, it does damage and knocks a foe back. It does not require ammunition, but you have to be in direct contact with a foe and activating (firing) it to cause injury and knockback. - -SHOTGUN: This uses shells for ammunition. The spread of the shotgun blast makes it deadly in close combat, but not the best choice for long-range attacks. - -ROCKET LAUNCHER: The rocket launcher delivers heavy fire power to your target, but travels slower compared to other attacks. Be careful when you use this weapon in close combat. - -PLASMA GUN: Powered by Energy cells, this rapid-fire weapon delivers deadly gouts of glowing energy quickly and accurately. - -RAIL GUN: The Rail Gun fires depleted uranium slugs at super high velocities. It hits instantly and can pass through the bodies of multiple opponents. But be warned, it recharges slowly and can be a liability in close combat. Take note of the distinctive trail of atmospheric disturbance -caused by the projectile. The color of the rail gun's trail can be changed under the CUSTOMIZE PLAYER menu on the EFFECTS COLOR line. - -LIGHTNING GUN: Zap them! - -+------------------+ -| COMBAT SUPPLIES: | -+------------------+ -Pick up these helpful items whenever possible. Some items take effect when -picked up, others you must activate during play. - -AMMO: With the exception of the gauntlet, each weapon has a corresponding ammo type. The color of the ammo boxes corresponds with the color of the graphic weapon icons displayed briefly in your heads up display. Each ammo type has a maximum you can carry. - -ARMOR: There are three armor types: Green armor shards, yellow combat armor and red body armor. Collecting them increases your armor protection. The red armor and the green armor shards can increase your total armor protection above the maximum for short duration. The points "decay" back to the normal maximum value. - -HEALTH: There are three types of standard health kits: small (green), medium (yellow) and large (red) encased in crystalline shells. The green health can increase your total health value above the maximum. Like armor, it "decays" back to your maximum possible health value. - -QUAD DAMAGE: The quad temporarily multiplies all your weapon's strengths. - -MEGA HEALTH: This blue health power up provides a temporary but significant boost to your health, taking it above your maximum level. Like armor, it "decays" back to your maximum possible health value. - -PERSONAL TELEPORTER: Grab this single-use power up and use it to escape from dangerous situations. Activating it immediately teleports you to one of the arena's spawn spots. - -======================= -== Section 9. == -== THE GAME CONSOLE == -======================= - - The game console (or just the console) is a pull down window shade that shows recent game information, including the text of conversations and recently executed game commands. The bottom line of the console is the command line. While playing Q3test, you can enter into console mode by pressing the tilde (~) key and exit by pressing it again. The console is where you enter all the commands to change the game state. - - For example, one console command is "map " which will load a map -and start it up. Starting up a map actually starts a local Server and a Client. For the purposes of this test, most of the console commands will be executed to optimize graphics. Pressing the up and down arrows in the console will change to the last command entered. You can backspace over the command and enter new values if you'd like. There is also a command-completion function. Type in the first few letters of a command. By pressing the TAB key, you can have the console automatically finish the name of the command for you. - - When you are in console mode (or when you have selected to "talk" by typing in words to appear on the screen), a blue "voice balloon" will appear over your head. Common game courtesy is to NOT shoot players who are in this mode. - -======================= -== Section 10. == -== PROBLEM ICONS == -======================= - -Q3Test has a Problem Icon that you may see on your screen from time to time. When you are disconnected from a Quake Server or the network packet flow is disturbed, you will see a Network Disconnect icon above the spot where your frag count is displayed. Other players will see it displayed over your character's head (similar to the way the talk balloon is displayed). If you are not immediately reconnected to the server, you will need to disconnect (leave arena) and attempt to reconnect with the server by either using the menu commands or by typing "connect" in the console command line. - NOTE: Courteous players will refrain from getting cheap points by fragging lagged out opponents. - -======================= -== Section 11. == -== MESSAGE OF THE DAY == -======================= - -When Quake 3 Arena starts a map up, it sends the GL_RENDERER string to the Message Of The Day server at id. This responds back with a message of the day to the client. If you wish to switch this option off, set CL_MOTD to 0 (+set CL_MOTD 0 from the command line). - diff --git a/code/unix/build_setup.sh b/code/unix/build_setup.sh deleted file mode 100644 index 0d54687..0000000 --- a/code/unix/build_setup.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/bash -# Build various setups.. - -# inputs: -# directory with the common media -Q3SETUPMEDIA=/home/timo/Id/Q3SetupMedia/quake3 -# directory with binaries tree -Q3BINARIES=../install -# version: $1 -VERSION=$1 -# temporary directory used to prepare the files -# NOTE: this dir is erased before a new setup is built -TMPDIR=setup.tmp - -# location of the setup dir (for graphical installer and makeself) -SETUPDIR=setup - -# cp setup phase -# we need to copy the symlinked files, and not the symlinks themselves -# on antares this is forced with a cp -L -# on spoutnik, -L is not recognized, and dereference is the default behaviour -# we need a robust way of checking -TESTFILE=/tmp/foo$$ -touch $TESTFILE -# see if option is supported -cp -L $TESTFILE $TESTFILE.cp 2>/dev/null -if [ $? -eq 1 ] -then - # option not supported, should be on by default - echo "cp doesn't have -L option" - unset CPOPT -else - # option supported, use it - echo "cp supports -L option" - CPOPT="-L" -fi -rm $TESTFILE - - -# graphical installer (based on Loki Software's Setup tool) -build_installer () -{ -TMPDIR=setup.tmp - -rm -rf $TMPDIR -mkdir $TMPDIR - -# copy base setup files -cp $CPOPT -R $SETUPDIR/setup.sh $SETUPDIR/setup.data $TMPDIR - -# copy media files -cp $CPOPT -R $Q3SETUPMEDIA/* $TMPDIR - -# remove CVS entries -find $TMPDIR -name CVS | xargs rm -rf - -# copy binaries -mkdir -p $TMPDIR/bin/x86 -# smp -cp $CPOPT $Q3BINARIES/linuxquake3-smp $TMPDIR/bin/x86/quake3-smp.x86 -strip $TMPDIR/bin/x86/quake3-smp.x86 -brandelf -t Linux $TMPDIR/bin/x86/quake3-smp.x86 -# old school -cp $CPOPT $Q3BINARIES/linuxquake3 $TMPDIR/bin/x86/quake3.x86 -strip $TMPDIR/bin/x86/quake3.x86 -brandelf -t Linux $TMPDIR/bin/x86/quake3.x86 -# ded -cp $CPOPT $Q3BINARIES/linuxq3ded $TMPDIR/bin/x86/q3ded -strip $TMPDIR/bin/x86/q3ded -brandelf -t Linux $TMPDIR/bin/x86/q3ded - -# PB files -mkdir -p $TMPDIR/pb/htm -cp $CPOPT ../pb/linux/*.so $TMPDIR/pb -cp $CPOPT ../pb/htm/*.htm $TMPDIR/pb/htm - -# Linux FAQ -mkdir -p $TMPDIR/Docs/LinuxFAQ -cp $CPOPT LinuxSupport/* $TMPDIR/Docs/LinuxFAQ - -# generated .qvm pk3 files -mkdir -p $TMPDIR/baseq3 -mkdir -p $TMPDIR/missionpack -# not needed now -#cp $CPOPT $Q3BINARIES/baseq3/pak8.pk3 $TMPDIR/baseq3/ -#cp $CPOPT $Q3BINARIES/missionpack/pak3.pk3 $TMPDIR/missionpack/ - -# menu shortcut to the game -# FIXME current setup doesn't have a way to set symlinks on arbitrary things -# so we use a dummy quake3 script (which will be overwritten by postinstall.sh) -echo -e "#!/bin/sh\necho \"If you read this, then the setup script failed miserably.\nPlease report to ttimo@idsoftware.com\n\"" > $TMPDIR/bin/x86/quake3 -echo -e "#!/bin/sh\necho \"If you read this, then the setup script failed miserably.\nPlease report to ttimo@idsoftware.com\n\"" > $TMPDIR/bin/x86/quake3-smp -# create the auto-extractible archive -# first step: on FreeBSD we would default to Linux binaries .. use a symlink -( -cd $TMPDIR/setup.data/bin -ln -s Linux FreeBSD -ln -s Linux NetBSD -ln -s Linux OpenBSD -) -# NOTE: we used to pass the $VERSION, but it doesn't seem very usefull -./$SETUPDIR/makeself/makeself.sh $TMPDIR linuxq3apoint-$VERSION.x86.run "Quake III Arena Point Release $VERSION " ./setup.sh - -chmod a+rx linuxq3apoint-$VERSION.x86.run - -#rm -rf $TMPDIR -} - -check_brandelf() -{ - # make sure brandelf is installed to avoid any problem when building the setups - BRAND=`which brandelf`; - if [ -n "$BRAND" ] && [ -x "$BRAND" ] - then - echo "brandelf is present: $BRAND" - else - echo "brandelf not found" - exit - fi -} - -# safe checks -check_brandelf - -build_installer diff --git a/code/unix/cons b/code/unix/cons deleted file mode 100644 index e4f36eb..0000000 --- a/code/unix/cons +++ /dev/null @@ -1,6828 +0,0 @@ -#!/usr/bin/env perl - -# NOTE: Cons intentionally does not use the "perl -w" option or -# "use strict." Because Cons "configuration files" are actually -# Perl scripts, enabling those restrictions here would force them -# on every user's config files, wanted or not. Would users write -# "better" Construct and Conscript files if we forced "use strict" -# on them? Probably. But we want people to use Cons to get work -# done, not force everyone to become a Perl guru to use it, so we -# don't insist. -# -# That said, Cons' code is both "perl -w" and "use strict" clean. -# Regression tests keep the code honest by checking for warnings -# and "use strict" failures. - -use vars qw( $CVS_id $CVS_ver $ver_num $ver_rev $version ); - -$CVS_id = 'Id'; -$CVS_ver = (split(/\s+/, $CVS_id))[2]; - -$ver_num = "2.3"; -$ver_rev = ".1"; - -$version = "This is Cons $ver_num$ver_rev ($CVS_id)\n"; - -# Cons: A Software Construction Tool. -# Copyright (c) 1996-2001 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -require 5.003; -# See the NOTE above about why Cons doesn't "use strict". -use integer; -use Cwd; -use File::Copy; - -use vars qw( $_WIN32 $_a $_exe $_o $_so ); - -#------------------------------------------------------------------ -# Determine if running on win32 platform - either Windows NT or 95 -#------------------------------------------------------------------ - -use vars qw( $PATH_SEPARATOR $iswin32 $_WIN32 $usage $indent @targets ); - -BEGIN { - use Config; - - # if the version is 5.003, we can check $^O - if ($] < 5.003) { - eval("require Win32"); - $_WIN32 = (!$@); - } else { - $_WIN32 = ($^O eq "MSWin32") ? 1 : 0; - } - - # Fetch the PATH separator from Config; - # provide our old defaults in case it's not set. - $PATH_SEPARATOR = $Config{path_sep}; - $PATH_SEPARATOR = $_WIN32 ? ';' : ':' if ! defined $PATH_SEPARATOR; - - # Fetch file suffixes from Config, - # accomodating differences in the Config variables - # used by different Perl versions. - $_exe = $Config{_exe}; - $_exe = $Config{exe_ext} if ! defined $_exe; - $_exe = $_WIN32 ? '.exe' : '' if ! defined $_exe; - $_o = $Config{_o}; - $_o = $Config{obj_ext} if ! defined $_o; - $_o = $_WIN32 ? '.obj' : '.o' if ! defined $_o; - $_a = $Config{_a}; - $_a = $Config{lib_ext} if ! defined $_a; - $_a = $_WIN32 ? '.lib' : '.a' if ! defined $_a; - $_so = ".$Config{so}"; - $_so = $_WIN32 ? '.dll' : '.so' if ! defined $_so; -} - -# Flush stdout each time. -$| = 1; - -# Seed random number generator. -srand(time . $$); # this works better than time ^ $$ in perlfunc manpage. - -$usage = q( -Usage: cons -- - -Arguments can be any of the following, in any order: - - Build the specified targets. If is a directory - recursively build everything within that directory. - - + Limit the cons scripts considered to just those that - match . Multiple + arguments are accepted. - - = Sets to value in the ARG hash passed to the - top-level Construct file. - - -cc Show command that would have been executed, when - retrieving from cache. No indication that the file - has been retrieved is given; this is useful for - generating build logs that can be compared with - real build logs. - - -cd Disable all caching. Do not retrieve from cache nor - flush to cache. - - -cr Build dependencies in random order. This is useful when - building multiple similar trees with caching enabled. - - -cs Synchronize existing build targets that are found to be - up-to-date with cache. This is useful if caching has - been disabled with -cc or just recently enabled with - UseCache. - - -d Enable dependency debugging. - - -f Use the specified file instead of "Construct" (but first - change to containing directory of ). - - -h Show a help message local to the current build if - one such is defined, and exit. - - -k Keep going as far as possible after errors. - - -o Read override file . - - -p Show construction products in specified trees. - -pa Show construction products and associated actions. - -pw Show products and where they are defined. - - -q Be quiet; multiple -q flags increase quietness level: - 1: quiet about Installing and Removing targets - 2: quiet about build commands, up-to-date targets - - -r Remove construction products associated with - - -R Search for files in . Multiple -R - directories are searched in the order specified. - - -S Use package sig:: to calculate file signatures. - Currently supported values are "md5" for MD5 - signatures (the default) and "md5::debug" for MD5 - signature debug information. - - -t Traverse up the directory hierarchy looking for a - Construct file, if none exists in the current directory. - (Targets will be modified to be relative to the - Construct file.) - - -v Show cons version and continue processing. - -V Show cons version and exit. - - -wf Write all filenames considered into . - - -x Show this message and exit. - - - Please report any suggestions through the cons-discuss@gnu.org mailing - list. - - To subscribe, send mail to cons-discuss-request@gnu.org with body - 'subscribe'. - - If you find a bug, please report it through the bug-cons@gnu.org - mailing list. - - Information about CONS can be obtained from the official cons web site - http://www.dsmit.com/cons/ or its mirrors (listed there). - - The cons maintainers can be contacted by email at cons-maintainers@gnu.org - - User documentation of cons is contained in cons and can be obtained - by doing 'perldoc /path/to/cons'. - -); - -# Simplify program name, if it is a path. -{ - my ($vol, $dir, $file) = File::Spec->splitpath(File::Spec->canonpath($0)); - $0 = $file; -} - -# Default parameters. -$param::topfile = 'Construct'; # Top-level construction file. -$param::install = 1; # Show installations -$param::build = 1; # Build targets -### $param::show = 1; # Show building of targets. -$param::sigpro = 'md5'; # Signature protocol. -$param::depfile = ''; # Write all deps out to this file -$param::salt = ''; # Salt derived file signatures with this. -$param::sourcesig = ['*' => 'content'];# Source file signature calculation -$param::rep_sig_times_ok = 1; # Repository .consign times are in sync - # w/files. -$param::conscript_chdir = 0; # Change dir to Conscript directory -$param::quiet = 0; # should we show the command being executed. - -@param::defaults = (); - -# -$indent = ''; - -# Display a command while executing or otherwise. This -# should be called by command builder action methods. -sub showcom { - print($indent . $_[0] . "\n") if ($param::quiet < 2); -} - -# Default environment. -# This contains only the completely platform-independent information -# we can figure out. Platform-specific information (UNIX, Win32) -# gets added below. -@param::base = ( - 'SIGNATURE' => [ '*' => 'build' ], - 'SUFEXE' => $_exe, # '' on UNIX systems - 'SUFLIB' => $_a, # '.a' on UNIX systems - 'SUFLIBS' => "$_so:$_a", # '.so:.a' on UNIX - 'SUFOBJ' => $_o, # '.o' on UNIX systems - 'SUFMAP' => { - '.c' => 'build::command::cc', - '.s' => 'build::command::cc', - '.S' => 'build::command::cc', - '.C' => 'build::command::cxx', - '.cc' => 'build::command::cxx', - '.cxx'=> 'build::command::cxx', - '.cpp'=> 'build::command::cxx', - '.c++'=> 'build::command::cxx', - '.C++'=> 'build::command::cxx', - }, - 'PERL' => $^X, -); - -%param::rulesets = - ( - # Defaults for Win32. - # Defined for VC++ 6.0 by Greg Spencer - # Your mileage may vary. - 'msvc' => [ - 'CC' => 'cl', - 'CFLAGS' => '/nologo', - 'CCCOM' => '%CC %CFLAGS %_IFLAGS /c %< /Fo%>', - 'CXX' => '%CC', - 'CXXFLAGS' => '%CFLAGS', - 'CXXCOM' => '%CXX %CXXFLAGS %_IFLAGS /c %< /Fo%>', - 'INCDIRPREFIX' => '/I', - 'INCDIRSUFFIX' => '', - 'LINK' => 'link', - 'LINKCOM' => '%LINK %LDFLAGS /out:%> %< %_LDIRS %LIBS', - 'LINKMODULECOM' => '%LD /r /o %> %<', - 'LIBDIRPREFIX' => '/LIBPATH:', - 'LIBDIRSUFFIX' => '', - 'AR' => 'lib', - 'ARFLAGS' => '/nologo ', - 'ARCOM' => "%AR %ARFLAGS /out:%> %<", - 'RANLIB' => '', - 'LD' => 'link', - 'LDFLAGS' => '/nologo ', - 'PREFLIB' => '', - ], - # Defaults for a typical (?) UNIX platform. - # Your mileage may vary. - 'unix' => [ - 'CC' => 'cc', - 'CFLAGS' => '', - 'CCCOM' => '%CC %CFLAGS %_IFLAGS -c %< -o %>', - 'CXX' => '%CC', - 'CXXFLAGS' => '%CFLAGS', - 'CXXCOM' => '%CXX %CXXFLAGS %_IFLAGS -c %< -o %>', - 'INCDIRPREFIX' => '-I', - 'INCDIRSUFFIX' => '', - 'LINK' => '%CXX', - 'LINKCOM' => '%LINK %LDFLAGS -o %> %< %_LDIRS %LIBS', - 'LINKMODULECOM' => '%LD -r -o %> %<', - 'LIBDIRPREFIX' => '-L', - 'LIBDIRSUFFIX' => '', - 'AR' => 'ar', - 'ARFLAGS' => 'r', # rs? - 'ARCOM' => ['%AR %ARFLAGS %> %<', '%RANLIB %>'], - 'RANLIB' => 'ranlib', - 'AS' => 'as', - 'ASFLAGS' => '', - 'ASCOM' => '%AS %ASFLAGS %< -o %>', - 'LD' => 'ld', - 'LDFLAGS' => '', - 'PREFLIB' => 'lib', - 'ENV' => { 'PATH' => '/bin:/usr/bin' }, - ], - ); - -# Set the rules based on the platform. -script::DefaultRules(script::RuleSet($_WIN32 ? 'msvc' : 'unix')); - -# Handle command line arguments. -while (@ARGV) { - $_ = shift @ARGV; - last if /^--$/; # Argument passing to Construct. - &option, next if s/^-//; - push (@param::include, $_), next if s/^\+//; - &equate, next if /=/; - push (@targets, $_), next; -} - -sub option { - my %opt = ( - 'cc' => sub { $param::cachecom = 1; }, - 'cd' => sub { $param::cachedisable = 1; }, - 'cr' => sub { $param::random = 1; }, - 'cs' => sub { $param::cachesync = 1; }, - 'd' => sub { $param::depends = 1; }, - 'h' => sub { $param::localhelp = 1; }, - 'k' => sub { $param::kflag = 1; }, - 'p' => sub { $param::pflag = 1; - $param::build = 0; }, - 'pa' => sub { $param::pflag = 1; - $param::aflag = 1; - $indent = "... "; - $param::build = 0; }, - 'pw' => sub { $param::pflag = 1; - $param::wflag = 1; - $param::build = 0; }, - 'q' => sub { $param::quiet++; }, - 'r' => sub { $param::rflag = 1; - $param::build = 0; }, - 't' => sub { $param::traverse = 1; }, - 'v' => sub { print($version); }, - 'V' => sub { print($version), exit(0); }, - 'x' => sub { print($usage), exit 0; }, - ); - - my %opt_arg = ( - 'f' => sub { $param::topfile = $_[0]; }, - 'o' => sub { $param::overfile = $_[0]; }, - 'R' => sub { script::Repository($_[0]); }, - 'S' => sub { $param::sigpro = $_[0]; }, - 'wf' => sub { $param::depfile = $_[0]; }, - ); - - if (defined $opt{$_}) { - &{$opt{$_}}(); - return; - } - while ($_) { - $_ =~ m/(.)(.*)/; - if (defined $opt{$1}) { - &{$opt{$1}}(); - $_ = $2; - next; - } - if (defined $opt_arg{$1}) { - if (! $2) { - $_ = shift @ARGV; - die("$0: -$1 option requires an argument.\n") if ! $_; - } - &{$opt_arg{$1}}($2 || $_); - return; - } - $_ =~ m/(..)(.*)/; - if (defined $opt_arg{$1}) { - if (! $2) { - $_ = shift @ARGV; - die("$0: -$1 option requires an argument.\n") if ! $_; - } - &{$opt_arg{$1}}($2 || $_); - return; - } - if ($_) { - die qq($0: unrecognized option "-$_". Use -x for a usage message.\n); - } - } -} - -# Process an equate argument (var=val). -sub equate { - my($var, $val) = /([^=]*)=(.*)/; - $script::ARG{$var} = $val; -} - -# Define file signature protocol. -'sig'->select($param::sigpro); - -# Cleanup after an interrupt. -$SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub { - $SIG{PIPE} = $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = 'IGNORE'; - $SIG{HUP} = $SIG{INT} if ! $main::_WIN32; - warn("\n$0: killed\n"); - # Call this first, to make sure that this processing - # occurs even if a child process does not die (and we - # hang on the wait). - sig::hash::END(); - wait(); - exit(1); -}; -$SIG{HUP} = $SIG{INT} if ! $main::_WIN32; - -# Cleanup after a broken pipe (someone piped our stdout?) -$SIG{PIPE} = sub { - $SIG{PIPE} = $SIG{HUP} = $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = 'IGNORE'; - warn("\n$0: broken pipe\n"); - sig::hash::END(); - wait(); - exit(1); -}; - -if ($param::depfile) { - open (main::DEPFILE, ">".$param::depfile) || - die ("$0: couldn't open $param::depfile ($!)\n"); -} - -# If the supplied top-level Conscript file is not in the -# current directory, then change to that directory. -{ - my ($vol, $dir, $file) = - File::Spec->splitpath(File::Spec->canonpath($param::topfile)); - if ($vol || $dir) { - my($cd) = File::Spec->catpath($vol, $dir, undef); - chdir($cd) || die("$0: couldn't change to directory $cd ($!)\n"); - $param::topfile = $file; - } -} - -# Walk up the directory hierarchy looking for a Conscript file (if -t set). -my($target_top); -my(@targetdir) = (); -if ($param::traverse && ! -f $param::topfile) { - my($vol, $dirs, $file) = File::Spec->splitpath(cwd()); - my(@dirs) = (File::Spec->splitdir($dirs), $file); - while (! -f File::Spec->catpath($vol, File::Spec->catdir(@dirs), - $param::topfile)) { - die("$0: unable to find $param::topfile.\n") if ! @dirs; - unshift(@targetdir, pop(@dirs)); - } - my($cwd) = File::Spec->catpath($vol, File::Spec->catdir(@dirs), ''); - print "$0: Entering directory `$cwd'\n"; - chdir($cwd); - @targets = map {File::Spec->catdir(@targetdir, $_)} @targets; -} - -# Set up $dir::top and $dir::cwd, now that we are in the right directory. -dir::init(); - -# -if (@targetdir) { - $target_top = $dir::top->lookupdir(File::Spec->catdir(@targetdir)); -} - -# Now handle override file. -package override; -if ($param::overfile) { - my($ov) = $param::overfile; - die qq($0: can\'t read override file "$ov" ($!)\n) if ! -f $ov; #' - do $ov; - if ($@) { - chop($@); - die qq($0: errors in override file "$ov" ($@)\n); - } -} - -# Provide this to user to setup override patterns. -sub Override { - my($re, @env) = @_; - return if $param::overrides{$re}; # if identical, first will win. - $param::overrides = 1; - $param::overrides{$re} = \@env; - push(@param::overrides, $re); -} - -package main; - -use vars qw( %priority $errors ); - -# Check script inclusion regexps -my $re; -for $re (@param::include) { - if (! defined eval {"" =~ /$re/}) { - my($err) = $@; - $err =~ s/in regexp at .*$//; - die("$0: error in regexp $err"); - } -} - -# Read the top-level construct file and its included scripts. -doscripts($param::topfile); - -# Status priorities. This lets us aggregate status for directories -# and print an appropriate message (at the top-level). -%priority = - ('none' => 1, 'handled' => 2, 'built' => 3, 'unknown' => 4, 'errors' => 5); - -# If no targets were specified, supply default targets (if any). -@targets = @param::default_targets if ! @targets; - -$errors = 0; - -# Build the supplied target patterns. -my $tgt; -for $tgt (map($dir::top->lookup($_), @targets)) { - if ($target_top && ! $tgt->is_under($target_top)) { - # A -t option was used, and this target is not underneath - # the directory where we were invoked via -t. - # If the target is a directory and the -t directory - # is underneath it, then build the -t directory. - if (ref $tgt ne "dir" || ! $target_top->is_under($tgt)) { - next; - } - $tgt = $target_top; - } - buildtoptarget($tgt); -} - -exit 0 + ($errors != 0); - -sub buildtoptarget { - my($tgt) = @_; - return if ! $tgt; - my($status) = buildtarget($tgt); - if ($status ne 'built') { - my($path) = $tgt->path; - if ($status eq "errors") { - print qq($0: "$path" not remade because of errors.\n); - $errors++; - } elsif ($status eq "handled") { - print qq($0: "$path" is up-to-date.\n) if ($param::quiet < 2); - } elsif ($status eq "unknown") { - # cons error already reported. - $errors++; - } elsif ($status eq "none") { - # search for targets that may be linked to the given path. - my @linked = dir::linked_targets($tgt) if $target_top; - if (@linked) { - my @names = map($_->path, @linked); - print "Linked targets: @names\n" if ($param::quiet < 1); - map(buildtoptarget($_), @linked); - } else { - print qq($0: nothing to be built in "$path".\n) - if $param::build && ($param::quiet < 2); - } - } else { - print qq($0: don\'t know how to construct "$path".\n); #' - $errors++; - } - } -} - -# Build the supplied target directory or files. Return aggregated status. -sub buildtarget { - my($tgt) = @_; - if (ref($tgt) eq "dir") { - my($result) = "none"; - my($priority) = $priority{$result}; - if (exists $tgt->{member}) { - my($members) = $tgt->{member}; - my $entry; - for $entry (sort keys %$members) { - next if $entry eq $dir::CURDIR || $entry eq $dir::UPDIR; - my($tgt) = $members->{$entry}; - next if ref($tgt) ne "dir" && !exists($tgt->{builder}); - my($stat) = buildtarget($members->{$entry}); - my($pri) = $priority{$stat}; - if ($pri > $priority) { - $priority = $pri; - $result = $stat; - } - } - } - return $result; - } - if ($param::depends) { - my($path) = $tgt->path; - if ($tgt->{builder}) { - my(@dep) = (@{$tgt->{dep}}, @{$tgt->{sources}}); - my($dep) = join(' ',map($_->path, @dep)); - print("Target $path: $dep\n"); - } else { - print("Target $path: not a derived file\n"); - } - } - if ($param::build) { - return build $tgt; - } elsif ($param::pflag || $param::wflag || $param::aflag) { - if ($tgt->{builder}) { - if ($param::wflag) { - print qq(${\$tgt->path}: $tgt->{script}\n); - } elsif ($param::pflag) { - print qq(${\$tgt->path}:\n) if $param::aflag; - print qq(${\$tgt->path}\n) if !$param::aflag; - } - if ($param::aflag) { - $tgt->{builder}->action($tgt); - } - } - } elsif ($param::rflag && $tgt->{builder}) { - my($path) = $tgt->path; - if (-f $path) { - if (unlink($path)) { - print("Removed $path\n") if ($param::quiet < 1); - } else { - warn("$0: couldn't remove $path\n"); - } - } - } - - return "none"; -} - -package NameSpace; - -# Return a hash that maps the name of symbols in a namespace to an -# array of refs for all types for which the name has a defined value. -# A list of symbols may be specified; default is all symbols in the -# name space. -sub save { - my $package = shift; - my(%namerefs, $var, $type); - no strict 'refs'; - @_ = keys %{$package."::"} if ! @_; - foreach $var (@_) { - $namerefs{$var} = []; - my $fqvar = $package."::".$var; - # If the scalar for this variable name doesn't already - # exist, *foo{SCALAR} will autovivify the reference - # instead of returning undef, so unlike the other types, - # we have to dereference to find out if it exists. - push(@{$namerefs{$var}}, *{$fqvar}{SCALAR}) - if defined ${*{$fqvar}{SCALAR}}; - foreach $type (qw(ARRAY HASH CODE IO)) { - push(@{$namerefs{$var}}, *{$fqvar}{$type}) - if defined *{$fqvar}{$type}; - } - } - return \%namerefs; -} - -# Remove the specified symbols from the namespace. -# Default is to remove all. -sub remove { - my $package = shift; - my(%namerefs, $var); - no strict 'refs'; - @_ = keys %{$package."::"} if ! @_; - foreach $var (@_) { - delete ${$package."::"}{$var}; - } -} - -# Restore values to symbols specified in a hash as returned -# by NameSpace::save. -sub restore { - my($package, $namerefs) = @_; - my($var, $ref); - no strict 'refs'; - foreach $var (keys %$namerefs) { - my $fqvar = $package."::".$var; - foreach $ref (@{$namerefs->{$var}}) { - *{$fqvar} = $ref; - } - } -} - -# Support for "building" scripts, importing and exporting variables. -# With the exception of the top-level routine here (invoked from the -# main package by cons), these are all invoked by user scripts. -package script; - -use vars qw( $ARG $caller_dir_path %special_var ); - -BEGIN { - # We can't Export or Import the following variables because Perl always - # treats them as part of the "main::" package (see perlvar(1)). - %special_var = map {$_ => 1} qw(ENV INC ARGV ARGVOUT SIG - STDIN STDOUT STDERR); -} - -# This is called from main to interpret/run the top-level Construct -# file, passed in as the single argument. -sub main::doscripts { - my($script) = @_; - Build($script); - # Now set up the includes/excludes (after the Construct file is read). - $param::include = join('|', @param::include); - - # Save the original variable names from the script package. - # These will stay intact, but any other "script::" variables - # defined in a Conscript file will get saved, deleted, - # and (when necessary) restored. - my(%orig_script_var) = map {$_ => 1} keys %script::; - $caller_dir_path = undef; - my $cwd = Cwd::cwd(); - my(@scripts) = pop(@priv::scripts); - while ($priv::self = shift(@scripts)) { - my($path) = $priv::self->{script}->rsrcpath; - if (-f $path) { - $dir::cwd = $priv::self->{script}->{dir}; - # Handle chdir to the Conscript file directory, if necessary. - my ($vol, $dir, $file); - if ($param::conscript_chdir) { - ($vol, $dir, $file) = - File::Spec->splitpath(File::Spec->canonpath($path)); - if ($vol ne '' || $dir ne '') { - $caller_dir_path = File::Spec->catpath($vol, $dir, undef); - chdir($caller_dir_path) || - die "Could not chdir to $caller_dir_path: $!\n"; - } - } else { - $file = $path; - } - # Actually process the Conscript file. - do $file; - # Save any variables defined by the Conscript file - # so we can restore them later, if needed; - # then delete them from the script:: namespace. - my(@del) = grep(! $orig_script_var{$_}, keys %script::); - if (@del) { - $priv::self->{script}->{pkgvars} = NameSpace::save('script', - @del); - NameSpace::remove('script', @del); - } - if ($caller_dir_path) { - chdir($cwd); - $caller_dir_path = undef; - } - if ($@) { - chomp($@); - my $err = ($@ =~ /\n/ms) ? ":\n$@" : " ($@)"; - print qq($0: error in file "$path"$err\n); - $run::errors++; - } else { - # Only process subsidiary scripts if no errors in parent. - unshift(@scripts, @priv::scripts); - } - undef @priv::scripts; - } else { - my $where = ''; - my $cref = $priv::self->{script}->creator; - if (defined $cref) { - my($_foo, $script, $line, $sub) = @$cref; - $where = " ($sub in $script, line $line)"; - } - warn qq(Ignoring missing script "$path"$where); - } - } - die("$0: script errors encountered: construction aborted\n") - if $run::errors; -} - -# Return caller info about the method being invoked. -# This is everything from the Perl "caller" builtin function, -# including which Construct/Conscript file, line number, -# subroutine name, etc. -sub caller_info { - my($lev) = 1; - my(@frame); - do { - @frame = caller ++$lev; - if (defined($frame[3]) && $frame[3] eq '(eval)') { - @frame = caller --$lev; - if ($caller_dir_path) { - $frame[1] = File::Spec->catfile($caller_dir_path, $frame[1]); - } - return @frame; - } - } while ($frame[3]); - return; -} - -# Link a directory to another. This simply means set up the *source* -# for the directory to be the other directory. -sub Link { - dir::link(@_); -} - -# Add directories to the repository search path for files. -# Strip our current directory from the list so Repository -# (or -R options) can be used from within the repository. -sub Repository { - my($my_dir) = Cwd::cwd(); - my $dir; - foreach $dir (@_) { - # The following more direct call isn't available in - # Cwd.pm until some time after 5.003... - # my($d) = Cwd::abs_path($dir); - chdir($dir); - my($d) = Cwd::cwd(); - chdir($my_dir); - # - next if ! $d || ! -d $d || $d eq $my_dir; - # We know we can get away with passing undef to lookupdir - # as the directory because $dir is an absolute path. - push(@param::rpath, dir::lookupdir(undef, $dir)); - push @INC, $d; - } -} - -# Return the list of Repository directories specified. -sub Repository_List { - map($_->path, @param::rpath); -} - -# Specify whether the .consign signature times in repository files are, -# in fact, consistent with the times on the files themselves. -sub Repository_Sig_Times_OK { - $param::rep_sig_times_ok = shift; -} - -sub SourceSignature { - $param::sourcesig = [@_]; -} - -# Specify whether we should chdir to the containing directories -# of Conscript files. -sub Conscript_chdir { - $param::conscript_chdir = shift; -} - -# Specify files/targets that must be present and built locally, -# even if they exist already-built in a Repository. -sub Local { - my(@files) = map($dir::cwd->lookupfile($_), @_); - map($_->local(1), @files); -} - -# Export variables to any scripts invoked from this one. -sub Export { - my(@illegal) = grep($special_var{$_}, @_); - if (@illegal) { - die qq($0: cannot Export special Perl variables: @illegal\n); - } - @{$priv::self->{exports}} = grep(! defined $special_var{$_}, @_); -} - -# Import variables from the export list of the caller -# of the current script. -sub Import { - my(@illegal) = grep($special_var{$_}, @_); - if (@illegal) { - die qq($0: cannot Import special Perl variables: @illegal\n); - } - my($parent) = $priv::self->{parent}; - my($imports) = $priv::self->{imports}; - @{$priv::self->{exports}} = keys %$imports; - my($var); - foreach $var (grep(! defined $special_var{$_}, @_)) { - if (!exists $imports->{$var}) { - my($path) = $parent->{script}->path; - die qq($0: variable "$var" not exported by file "$path"\n); - } - if (!defined $imports->{$var}) { - my $path = $parent->{script}->path; - my $err = "$0: variable \"$var\" exported but not " . - "defined by file \"$path\"\n"; - die $err; - } - ${"script::$var"} = $imports->{$var}; - } -} - -# Build an inferior script. That is, arrange to read and execute -# the specified script, passing to it any exported variables from -# the current script. -sub Build { - my(@files) = map($dir::cwd->lookupfile($_), @_); - my(%imports) = map {$_ => ${"script::$_"}} @{$priv::self->{exports}}; - my $file; - for $file (@files) { - next if $param::include && $file->path !~ /$param::include/o; - my($self) = {'script' => $file, - 'parent' => $priv::self, - 'imports' => \%imports}; - bless $self; # may want to bless into class of parent in future - push(@priv::scripts, $self); - } -} - -# Set up regexps dependencies to ignore. Should only be called once. -sub Ignore { - die("Ignore called more than once\n") if $param::ignore; - $param::ignore = join("|", map("($_)", @_)) if @_; -} - -# Specification of default targets. -sub Default { - push(@param::default_targets, map($dir::cwd->lookup($_)->path, @_)); -} - -# Local Help. Should only be called once. -sub Help { - if ($param::localhelp) { - print "@_\n"; - exit 2; - } -} - -# For windows platforms which use unix tool sets, the msvc defaults may -# not be useful. Also, in the future, other platforms (Mac?) may have the -# same problem. -sub RuleSet { - my $style = shift; - my @rulesets = sort keys %param::rulesets; - die "Unknown style for rules: $style.\n" . - "Supported rules are: (" . join(" ", @rulesets) . ")" - unless eval(join("||", map("\$style eq '$_'", @rulesets))); - return @param::base, @{$param::rulesets{$style}}; -} - -sub DefaultRules { - @param::defaults = (); - push @param::defaults, @_; -} - -# Return the build name(s) of a file or file list. -sub FilePath { - wantarray - ? map($dir::cwd->lookupfile($_)->path, @_) - : $dir::cwd->lookupfile($_[0])->path; -} - -# Return the build name(s) of a directory or directory list. -sub DirPath { - wantarray - ? map($dir::cwd->lookupdir($_)->path, @_) - : $dir::cwd->lookupdir($_[0])->path; -} - -# Split the search path provided into components. Look each up -# relative to the current directory. -# The usual path separator problems abound; for now we'll use : -sub SplitPath { - my($dirs) = @_; - if (ref($dirs) ne "ARRAY") { - $dirs = [ split(/$main::PATH_SEPARATOR/o, $dirs) ]; - } - map { DirPath($_) } @$dirs; -} - -# Return true if the supplied path is available as a source file -# or is buildable (by rules seen to-date in the build). -sub ConsPath { - my($path) = @_; - my($file) = $dir::cwd->lookup($path); - return $file->accessible; -} - -# Return the source path of the supplied path. -sub SourcePath { - wantarray - ? map($dir::cwd->lookupfile($_)->rsrcpath, @_) - : $dir::cwd->lookupfile($_[0])->rsrcpath; -} - -# Search up the tree for the specified cache directory, starting with -# the current directory. Returns undef if not found, 1 otherwise. -# If the directory is found, then caching is enabled. The directory -# must be readable and writable. If the argument "mixtargets" is provided, -# then targets may be mixed in the cache (two targets may share the same -# cache file--not recommended). -sub UseCache($@) { - my($dir, @args) = @_; - # NOTE: it's important to process arguments here regardless of whether - # the cache is disabled temporarily, since the mixtargets option affects - # the salt for derived signatures. - for (@args) { - if ($_ eq "mixtargets") { - # When mixtargets is enabled, we salt the target signatures. - # This is done purely to avoid a scenario whereby if - # mixtargets is turned on or off after doing builds, and - # if cache synchronization with -cs is used, then - # cache files may be shared in the cache itself (linked - # under more than one name in the cache). This is not bad, - # per se, but simply would mean that a cache cleaning algorithm - # that looked for a link count of 1 would never find those - # particular files; they would always appear to be in use. - $param::salt = 'M' . $param::salt; - $param::mixtargets = 1; - } else { - die qq($0: UseCache unrecognized option "$_"\n); - } - } - if ($param::cachedisable) { - warn("Note: caching disabled by -cd flag\n"); - return 1; - } - my($depth) = 15; - while ($depth-- && ! -d $dir) { - $dir = File::Spec->catdir($dir::UPDIR, $dir); - } - if (-d $dir) { - $param::cache = $dir; - return 1; - } - return undef; -} - -# Salt the signature generator. The salt (a number of string) is added -# into the signature of each derived file. Changing the salt will -# force recompilation of all derived files. -sub Salt($) { - # We append the value, so that UseCache and Salt may be used - # in either order without changing the signature calculation. - $param::salt .= $_[0]; -} - -# Mark files (or directories) to not be removed before building. -sub Precious { - map($_->{precious} = 1, map($dir::cwd->lookup($_), @_)); -} - - -# These methods are callable from Conscript files, via a cons -# object. Procs beginning with _ are intended for internal use. -package cons; - -use vars qw( %envcache ); - -# This is passed the name of the base environment to instantiate. -# Overrides to the base environment may also be passed in -# as key/value pairs. -sub new { - my($package) = shift; - my ($env) = {@param::defaults, @_}; - @{$env->{_envcopy}} = %$env; # Note: we never change PATH - $env->{_cwd} = $dir::cwd; # Save directory of environment for - bless $env, $package; # any deferred name interpretation. -} - -# Clone an environment. -# Note that the working directory will be the initial directory -# of the original environment. -sub clone { - my($env) = shift; - my $clone = {@{$env->{_envcopy}}, @_}; - @{$clone->{_envcopy}} = %$clone; # Note: we never change PATH - $clone->{_cwd} = $env->{_cwd}; - bless $clone, ref $env; -} - -# Create a flattened hash representing the environment. -# It also contains a copy of the PATH, so that the path -# may be modified if it is converted back to a hash. -sub copy { - my($env) = shift; - (@{$env->{_envcopy}}, 'ENV' => {%{$env->{ENV}}}, @_) -} - -# Resolve which environment to actually use for a given -# target. This is just used for simple overrides. -sub _resolve { - return $_[0] if !$param::overrides; - my($env, $tgt) = @_; - my($path) = $tgt->path; - my $re; - for $re (@param::overrides) { - next if $path !~ /$re/; - # Found one. Return a combination of the original environment - # and the override. - my($ovr) = $param::overrides{$re}; - return $envcache{$env,$re} if $envcache{$env,$re}; - my($newenv) = {@{$env->{_envcopy}}, @$ovr}; - @{$newenv->{_envcopy}} = %$env; - $newenv->{_cwd} = $env->{_cwd}; - return $envcache{$env,$re} = bless $newenv, ref $env; - } - return $env; -} - -# Substitute construction environment variables into a string. -# Internal function/method. -sub _subst { - my($env, $str) = @_; - if (! defined $str) { - return undef; - } elsif (ref($str) eq "ARRAY") { - return [ map($env->_subst($_), @$str) ]; - } else { - # % expansion. %% gets converted to % later, so expand any - # %keyword construction that doesn't have a % in front of it, - # modulo multiple %% pairs in between. - # In Perl 5.005 and later, we could actually do this in one regex - # using a conditional expression as follows, - # while ($str =~ s/($pre)\%(\{)?([_a-zA-Z]\w*)(?(2)\})/"$1". - # $env->{$3}/ge) {} - # The following two-step approach is backwards-compatible - # to (at least) Perl5.003. - my $pre = '^|[^\%](?:\%\%)*'; - while (($str =~ s/($pre)\%([_a-zA-Z]\w*)/$1.($env->{$2}||'')/ge) || - ($str =~ s/($pre)\%\{([_a-zA-Z]\w*)\}/$1.($env->{$2}||'')/ge)) { - } - return $str; - } -} - -sub AfterBuild { - my($env) = shift; - my($perl_eval_str) = pop(@_); - my $file; - for $file (map($dir::cwd->lookup($_), @_)) { - $file->{after_build_func} = $perl_eval_str; - } -} - -sub Install { - my($env) = shift; - my($tgtdir) = $dir::cwd->lookupdir($env->_subst(shift)); - my $file; - for $file (map($dir::cwd->lookupfile($env->_subst($_)), @_)) { - my($tgt) = $tgtdir->lookupfile($file->{entry}); - $tgt->bind(find build::install($env), $file); - } -} - -sub InstallAs { - my $env = shift; - my $tgt = shift; - my $src = shift; - my @sources = (); - my @targets = (); - - if (ref $tgt) { - die "InstallAs: Source is a file and target is a list!\n" - if (!ref($src)); - @sources = @$src; - @targets = @$tgt; - } elsif (ref $src) { - die "InstallAs: Target is a file and source is a list!\n"; - } else { - push @sources, $src; - push @targets, $tgt; - } - - if ($#sources != $#targets) { - my $tn = $#targets+1; - my $sn = $#sources+1; - die "InstallAs: Source file list ($sn) and target file list ($tn) " . - "are inconsistent in length!\n"; - } else { - foreach (0..$#sources) { - my $tfile = $dir::cwd->lookupfile($env->_subst($targets[$_])); - my $sfile = $dir::cwd->lookupfile($env->_subst($sources[$_])); - $tfile->bind(find build::install($env), $sfile); - } - } -} - -# Installation in a local build directory, -# copying from the repository if it's already built there. -# Functionally equivalent to: -# Install $env $dir, $file; -# Local "$dir/$file"; -sub Install_Local { - my($env) = shift; - my($tgtdir) = $dir::cwd->lookupdir($env->_subst(shift)); - my $file; - for $file (map($dir::cwd->lookupfile($env->_subst($_)), @_)) { - my($tgt) = $tgtdir->lookupfile($file->{entry}); - $tgt->bind(find build::install($env), $file); - $tgt->local(1); - } -} - -sub Objects { - my($env) = shift; - map($dir::cwd->relpath($_), $env->_Objects(@_)); -} - -# Called with multiple source file references (or object files). -# Returns corresponding object files references. -sub _Objects { - my($env) = shift; - my($suffix) = $env->{SUFOBJ}; - map($env->_Object($_, $_->{dir}->lookupfile($_->base_suf($suffix))), - map { ref $_ ? $_ : $dir::cwd->lookupfile($env->_subst($_)) } - grep(defined $_, @_)); -} - -# Called with an object and source reference. If no object reference -# is supplied, then the object file is determined implicitly from the -# source file's extension. Sets up the appropriate rules for creating -# the object from the source. Returns the object reference. -sub _Object { - my($env, $src, $obj) = @_; - return $obj if $src eq $obj; # don't need to build self from self. - my($objenv) = $env->_resolve($obj); - my($suffix) = $src->suffix; - - my($builder) = $env->{SUFMAP}{$suffix}; - - if ($builder) { - $obj->bind((find $builder($objenv)), $src); - } else { - die("don't know how to construct ${\$obj->path} from " . - "${\$src->path}.\n"); - } - $obj -} - -sub Program { - my($env) = shift; - my($tgt) = $dir::cwd->lookupfile(file::addsuffix($env->_subst(shift), - $env->{SUFEXE})); - my($progenv) = $env->_resolve($tgt); - $tgt->bind(find build::command::link($progenv, $progenv->{LINKCOM}), - $env->_Objects(@_)); -} - -sub Module { - my($env) = shift; - my($tgt) = $dir::cwd->lookupfile($env->_subst(shift)); - my($modenv) = $env->_resolve($tgt); - my($com) = pop(@_); - $tgt->bind(find build::command::link($modenv, $com), $env->_Objects(@_)); -} - -sub LinkedModule { - my($env) = shift; - my($tgt) = $dir::cwd->lookupfile($env->_subst(shift)); - my($progenv) = $env->_resolve($tgt); - $tgt->bind(find build::command::linkedmodule - ($progenv, $progenv->{LINKMODULECOM}), - $env->_Objects(@_)); -} - -sub Library { - my($env) = shift; - my($lib) = $dir::cwd->lookupfile(file::addsuffix($env->_subst(shift), - $env->{SUFLIB})); - my($libenv) = $env->_resolve($lib); - $lib->bind(find build::command::library($libenv), $env->_Objects(@_)); -} - -# Simple derivation: you provide target, source(s), command. -# Special variables substitute into the rule. -# Target may be a reference, in which case it is taken -# to be a multiple target (all targets built at once). -sub Command { - my($env) = shift; - my($tgt) = $env->_subst(shift); - my($builder) = find build::command::user($env, pop(@_), 'script'); - my(@sources) = map($dir::cwd->lookupfile($env->_subst($_)), @_); - if (ref($tgt)) { - # A multi-target command. - my(@tgts) = map($dir::cwd->lookupfile($_), @$tgt); - die("empty target list in multi-target command\n") if !@tgts; - $env = $env->_resolve($tgts[0]); - my($multi) = build::multiple->new($builder, \@tgts); - for $tgt (@tgts) { - $tgt->bind($multi, @sources); - } - } else { - $tgt = $dir::cwd->lookupfile($tgt); - $env = $env->_resolve($tgt); - $tgt->bind($builder, @sources); - } -} - -sub Depends { - my($env) = shift; - my($tgt) = $env->_subst(shift); - my(@deps) = map($dir::cwd->lookup($env->_subst($_)), @_); - if (! ref($tgt)) { - $tgt = [ $tgt ]; - } - my($t); - foreach $t (map($dir::cwd->lookupfile($_), @$tgt)) { - push(@{$t->{dep}}, @deps); - } -} - -# Setup a quick scanner for the specified input file, for the -# associated environment. Any use of the input file will cause the -# scanner to be invoked, once only. The scanner sees just one line at -# a time of the file, and is expected to return a list of -# dependencies. -sub QuickScan { - my($env, $code, $file, $path) = @_; - $dir::cwd->lookup($env->_subst($file))->{'srcscan',$env} = - find scan::quickscan($code, $env, $env->_subst($path)); -} - -# Generic builder module. Just a few default methods. Every derivable -# file must have a builder object of some sort attached. Usually -# builder objects are shared. -package build; - -use vars qw( %builder ); - -# Every builder must now have at least an associated environment, -# so we can find its sigarray and calculate the proper signature. -sub find { - my($class, $env) = @_; - $builder{$env} || do { - my $self = { env => $env }; - $builder{$env} = bless $self, $class; - } -} - -# Null signature for dynamic includes. -sub includes { () } - -# Null signature for build script. -sub scriptsig { () } - -# Not compatible with any other builder, by default. -sub compatible { 0 } - - -# Builder module for the Install command. -package build::install; - -use vars qw( @ISA ); - -BEGIN { @ISA = qw(build) } - -# Caching not supported for Install: generally install is trivial anyway, -# and we don't want to clutter the cache. -sub cachin { undef } -sub cachout { } - -# Do the installation. -sub action { - my($self, $tgt) = @_; - my($src) = $tgt->{sources}[0]; - main::showcom("Install ${\$src->rpath} as ${\$tgt->path}") - if ($param::install && $param::quiet < 1); - return unless $param::build; - futil::install($src->rpath, $tgt); - return 1; -} - - -# Builder module for generic UNIX commands. -package build::command; - -use vars qw( @ISA %com ); - -BEGIN { @ISA = qw(build) } - -sub find { - my($class, $env, $cmd, $package) = @_; - my($act) = action::new($env, $cmd); - $package ||= ''; - $com{$env,$act,$package} || do { - my $self = { env => $env, act => $act, 'package' => $package }; - $com{$env,$act,$package} = bless $self, $class; - } -} - -# Default cache in function. -sub cachin { - my($self, $tgt, $sig) = @_; - if (cache::in($tgt, $sig)) { - if ($param::cachecom) { - $self->{act}->show($self->{env}, $tgt); - } else { - printf("Retrieved %s from cache\n", $tgt->path) - if ($param::quiet < 1); - } - return 1; - } - return undef; -} - -# Default cache out function. -sub cachout { - my($self, $tgt, $sig) = @_; - cache::out($tgt, $sig); -} - -# Build the target using the previously specified commands. -sub action { - my($self, $tgt) = @_; - $self->{act}->execute($self->{env}, $tgt, $self->{'package'}); -} - -# Return script signature. -sub scriptsig { - $_[0]->{act}->scriptsig -} - - -# Create a linked module. -package build::command::link; - -use vars qw( @ISA ); - -BEGIN { @ISA = qw(build::command) } - -# Find an appropriate linker. -sub find { - my($class, $env, $command) = @_; - if (!exists $env->{_LDIRS}) { - my($ldirs) = ''; - my($wd) = $env->{_cwd}; - my($pdirs) = $env->{LIBPATH}; - if (! defined $pdirs) { - $pdirs = [ ]; - } elsif (ref($pdirs) ne 'ARRAY') { - $pdirs = [ split(/$main::PATH_SEPARATOR/o, $pdirs) ]; - } - my($dir, $dpath); - for $dir (map($wd->lookupdir($env->_subst($_)), @$pdirs)) { - $dpath = $dir->path; - # Add the (presumably local) directory to the -L flags - # if we're not using repositories, the directory exists, - # or it's Linked to a source directory (that is, it *will* - # exist by the time the link occurs). - $ldirs .= " ".$env->{LIBDIRPREFIX}.$dpath.$env->{LIBDIRSUFFIX} - if ! @param::rpath || -d $dpath || $dir->is_linked; - next if File::Spec->file_name_is_absolute($dpath); - if (@param::rpath) { - my $d; - if ($dpath eq $dir::CURDIR) { - foreach $d (map($_->path, @param::rpath)) { - $ldirs .= " " . $env->{LIBDIRPREFIX} . - $d . $env->{LIBDIRSUFFIX}; - } - } else { - my($rpath); - foreach $d (map($_->path, @param::rpath)) { - $rpath = File::Spec->catfile($d, $dpath); - $ldirs .= " ". $env->{LIBDIRPREFIX} . - $rpath . $env->{LIBDIRSUFFIX} if -d $rpath; - } - } - } - } - $env->{_LDIRS} = "%($ldirs%)"; - } - - # Introduce a new magic _LIBS symbol which allows to use the - # Unix-style -lNAME syntax for Win32 only. -lNAME will be replaced - # with %{PREFLIB}NAME%{SUFLIB}. 1998-06-18 - - if ($main::_WIN32 && !exists $env->{_LIBS}) { - my $libs; - my $name; - for $name (split(' ', $env->_subst($env->{LIBS} || ''))) { - if ($name =~ /^-l(.*)/) { - $name = "$env->{PREFLIB}$1$env->{SUFLIB}"; - } - $libs .= ' ' . $name; - } - $env->{_LIBS} = $libs ? "%($libs%)" : ''; - } - bless find build::command($env, $command); -} - -# Called from file::build. Make sure any libraries needed by the -# environment are built, and return the collected signatures -# of the libraries in the path. -sub includes { - return $_[0]->{'bsig'} if exists $_[0]->{'bsig'}; - my($self, $tgt) = @_; - my($env) = $self->{env}; - my($ewd) = $env->{_cwd}; - my $ldirs = $env->{LIBPATH}; - if (! defined $ldirs) { - $ldirs = [ ]; - } elsif (ref($ldirs) ne 'ARRAY') { - $ldirs = [ split(/$main::PATH_SEPARATOR/o, $ldirs) ]; - } - my @lpath = map($ewd->lookupdir($_), @$ldirs); - my(@sigs); - my(@names); - - # Pass %LIBS symbol through %-substituition - # 1998-06-18 - @names = split(' ', $env->_subst($env->{LIBS} || '')); - my $name; - for $name (@names) { - my ($lpath, @allnames); - if ($name =~ /^-l(.*)/) { - # -l style names are looked up on LIBPATH, using all - # possible lib suffixes in the same search order the - # linker uses (according to SUFLIBS). - # Recognize new PREFLIB symbol, which should be 'lib' on - # Unix, and empty on Win32. TODO: What about shared - # library suffixes? 1998-05-13 - @allnames = map("$env->{PREFLIB}$1$_", - split(/:/, $env->{SUFLIBS})); - $lpath = \@lpath; - } else { - @allnames = ($name); - # On Win32, all library names are looked up in LIBPATH - # 1998-05-13 - if ($main::_WIN32) { - $lpath = [$dir::top, @lpath]; - } - else { - $lpath = [$dir::top]; - } - } - my $dir; - DIR: for $dir (@$lpath) { - my $n; - for $n (@allnames) { - my($lib) = $dir->lookup_accessible($n); - if ($lib) { - last DIR if $lib->ignore; - if ((build $lib) eq 'errors') { - $tgt->{status} = 'errors'; - return undef; - } - push(@sigs, 'sig'->signature($lib)); - last DIR; - } - } - } - } - $self->{'bsig'} = 'sig'->collect(@sigs); -} - -# Always compatible with other such builders, so the user -# can define a single program or module from multiple places. -sub compatible { - my($self, $other) = @_; - ref($other) eq "build::command::link"; -} - -# Link a program. -package build::command::linkedmodule; - -use vars qw( @ISA ); - -BEGIN { @ISA = qw(build::command) } - -# Always compatible with other such builders, so the user -# can define a single linked module from multiple places. -sub compatible { - my($self, $other) = @_; - ref($other) eq "build::command::linkedmodule"; -} - -# Builder for a C module -package build::command::cc; - -use vars qw( @ISA ); - -BEGIN { @ISA = qw(build::command) } - -sub find { - $_[1]->{_cc} || do { - my($class, $env) = @_; - my($cpppath) = $env->_subst($env->{CPPPATH}); - my($cscanner) = find scan::cpp($env->{_cwd}, $cpppath); - $env->{_IFLAGS} = "%(" . $cscanner->iflags($env) . "%)"; - my($self) = find build::command($env, $env->{CCCOM}); - $self->{scanner} = $cscanner; - bless $env->{_cc} = $self; - } -} - -# Invoke the associated C scanner to get signature of included files. -sub includes { - my($self, $tgt) = @_; - $self->{scanner}->includes($tgt, $tgt->{sources}[0]); -} - -# Builder for a C++ module -package build::command::cxx; - -use vars qw( @ISA ); - -BEGIN { @ISA = qw(build::command) } - -sub find { - $_[1]->{_cxx} || do { - my($class, $env) = @_; - my($cpppath) = $env->_subst($env->{CPPPATH}); - my($cscanner) = find scan::cpp($env->{_cwd}, $cpppath); - $env->{_IFLAGS} = "%(" . $cscanner->iflags($env) . "%)"; - my($self) = find build::command($env, $env->{CXXCOM}); - $self->{scanner} = $cscanner; - bless $env->{_cxx} = $self; - } -} - -# Invoke the associated C scanner to get signature of included files. -sub includes { - my($self, $tgt) = @_; - $self->{scanner}->includes($tgt, $tgt->{sources}[0]); -} - -# Builder for a user command (cons::Command). We assume that a user -# command might be built and implement the appropriate dependencies on -# the command itself (actually, just on the first word of the command -# line). -package build::command::user; - -use vars qw( @ISA ); - -BEGIN { @ISA = qw(build::command) } - -sub includes { - my($self, $tgt) = @_; - my($sig) = ''; - - # Check for any quick scanners attached to source files. - my $dep; - for $dep (@{$tgt->{dep}}, @{$tgt->{sources}}) { - my($scanner) = $dep->{'srcscan',$self->{env}}; - if ($scanner) { - $sig .= $scanner->includes($tgt, $dep); - } - } - - # XXX Optimize this to not use ignored paths. - if (! exists $self->{_comsig}) { - my($env) = $self->{env}; - $self->{_comsig} = ''; - my($com, $dir); - com: - for $com ($self->{act}->commands) { - my($pdirs) = $env->{ENV}->{PATH}; - if (! defined $pdirs) { - $pdirs = [ ]; - } elsif (ref($pdirs) ne 'ARRAY') { - $pdirs = [ split(/$main::PATH_SEPARATOR/o, $pdirs) ]; - } - for $dir (map($dir::top->lookupdir($_), @$pdirs)) { - my($prog) = $dir->lookup_accessible($com); - if ($prog) { # XXX Not checking execute permission. - if ((build $prog) eq 'errors') { - $tgt->{status} = 'errors'; - return $sig; - } - next com if $prog->ignore; - $self->{_comsig} .= 'sig'->signature($prog); - next com; - } - } - } - } - - return $self->{_comsig} . $sig -} - - -# Builder for a library module (archive). -# We assume that a user command might be built and implement the -# appropriate dependencies on the command itself. -package build::command::library; - -use vars qw( @ISA ); - -BEGIN { @ISA = qw(build::command) } - -sub find { - my($class, $env) = @_; - bless find build::command($env, $env->{ARCOM}) -} - -# Always compatible with other library builders, so the user -# can define a single library from multiple places. -sub compatible { - my($self, $other) = @_; - ref($other) eq "build::command::library"; -} - -# A multi-target builder. -# This allows multiple targets to be associated with a single build -# script, without forcing all the code to be aware of multiple targets. -package build::multiple; - -sub new { - my($class, $builder, $tgts) = @_; - bless { 'builder' => $builder, 'env' => $builder->{env}, 'tgts' => $tgts }; -} - -sub scriptsig { - my($self, $tgt) = @_; - $self->{builder}->scriptsig($tgt); -} - -sub includes { - my($self, $tgt) = @_; - $self->{builder}->includes($tgt); -} - -sub compatible { - my($self, $tgt) = @_; - $self->{builder}->compatible($tgt); -} - -sub cachin { - my($self, $tgt, $sig) = @_; - $self->{builder}->cachin($tgt, $sig); -} - -sub cachout { - my($self, $tgt, $sig) = @_; - $self->{builder}->cachout($tgt, $sig); -} - -sub action { - my($self, $invoked_tgt) = @_; - return $self->{built} if exists $self->{built}; - - # Make sure all targets in the group are unlinked before building any. - my($tgts) = $self->{tgts}; - my $tgt; - for $tgt (@$tgts) { - futil::mkdir($tgt->{dir}); - unlink($tgt->path) if ! $tgt->precious; - } - - # Now do the action to build all the targets. For consistency - # we always call the action on the first target, just so that - # $> is deterministic. - $self->{built} = $self->{builder}->action($tgts->[0]); - - # Now "build" all the other targets (except for the one - # we were called with). This guarantees that the signature - # of each target is updated appropriately. We force the - # targets to be built even if they have been previously - # considered and found to be OK; the only effect this - # has is to make sure that signature files are updated - # correctly. - for $tgt (@$tgts) { - if ($tgt ne $invoked_tgt) { - delete $tgt->{status}; - 'sig'->invalidate($tgt); - build $tgt; - } - } - - # Status of action. - $self->{built}; -} - -package action; - -sub new { - my($env, $act) = @_; - if (ref($act) eq 'CODE') { - return action::perl->new($act); - } else { - return action::command->new($env, $act); - } -} - -package action::command; - -use vars qw( @ISA %cmd %_varopts $_varletters ); - -BEGIN { - @ISA = $main::_WIN32 ? 'action::command::win32' : 'action::command::unix'; - - # Internal hash for processing variable options. - # f: return file part - # d: return directory part - # F: return file part, but strip any suffix - # b: return full path, but strip any suffix (a.k.a. return basename) - # s: return only the suffix (or an empty string, if no suffix is there) - # a: return the absolute path to the file - # S: return the absolute path to a Linked source file - %_varopts = ( - 'f' => sub { return $_[0]->{entry}; }, - 'd' => sub { return $_[0]->{dir}->path; }, - 'F' => sub { my $subst = $_[0]->{entry}; - $subst =~ s/\.[^\.]+$//; - return $subst; }, - 'b' => sub { my $subst = $_[0]->path; - $subst =~ s/\.[^\.]+$//; - return $subst; }, - 's' => sub { my $subst = $_[0]->{entry}; - $subst =~ m/(\.[^\.]+)$/; - return $1; }, - 'a' => sub { my $path = $_[0]->path; - if (! File::Spec->file_name_is_absolute($path)) { - $path = File::Spec->catfile(Cwd::cwd(), $path); - } - return $path; }, - 'S' => sub { my $path = $_[0]->srcpath; - if (! File::Spec->file_name_is_absolute($path)) { - my $cwd = File::Spec->canonpath(Cwd::cwd()); - $path = File::Spec->catfile($cwd, $path); - } - return $path; }, - ); - - $_varletters = join('', keys %_varopts); -} - -# Internal routine for processing variable options. -# Options are specified in hash in the BEGIN block above. -# no option: return path to file (relative to top, -# or absolute if it's outside) -sub _variant { - my($opt, $file) = @_; - $opt = '' if ! defined $opt; - if (defined $_varopts{$opt}) { - return &{$_varopts{$opt}}($file); - } - return $file->path; -} - -sub new { - my($class, $env, $cmd) = @_; - $cmd = $env->_subst($cmd); - $cmd{$env,$cmd} || do { - # Remove unwanted bits from signature -- those bracketed by %( ... %) - my $sigs = $cmd; - my $sig = ''; - if (ref($sigs) eq 'ARRAY') { - # This is an array of commands.. - my $f; - foreach $f (@$sigs) { - $sig .= _strip($f); - } - } else { - $sig = _strip($sigs); - } - my $self = { cmd => $cmd, cmdsig => 'sig'->cmdsig($sig) }; - $cmd{$env,$cmd} = bless $self, $class; - } -} - -sub _strip { - my $sig = shift; - $sig =~ s/^\@\s*//mg; - while ($sig =~ s/%\(([^%]|%[^\(])*?%\)//g) { } - $sig; -} - -sub scriptsig { - $_[0]->{cmdsig}; -} - -# Return an array of all the commands (first word on each line). -sub commands { - my($self) = @_; - my(@cmds) = (); - my $com; - my $cmd = $self->{'cmd'}; - my @allcoms; - - push @allcoms, ref $cmd ? @{$cmd} : split(/\n/, $cmd); - - for $com (@allcoms) { - $com =~ s/^\s*//; - $com =~ s/\s.*//; - next if ! $com; # blank line - push @cmds, $com; - } - @cmds; -} - -# For the signature of a basic command, we don't bother -# including the command itself. This is not strictly correct, -# and if we wanted to be rigorous, we might want to insist -# that the command was checked for all the basic commands -# like gcc, etc. For this reason we don't have an includes -# method. - -# Call this to get the command line script: an array of -# fully substituted commands. -sub getcoms { - my($self, $env, $tgt) = @_; - my(@coms); - my $com; - my @allcoms = (); - my $cmd = $self->{'cmd'}; - - push @allcoms, ref $cmd ? @{$cmd} : split(/\n/, $cmd); - - for $com (@allcoms) { - my(@src) = (undef, @{$tgt->{sources}}); - my(@src1) = @src; - - next if $com =~ /^\s*$/; - - # NOTE: we used to have a more elegant s//.../e solution - # for the items below, but this caused a bus error... - - # Remove %( and %) -- those are only used to bracket parts - # of the command that we don't depend on. - $com =~ s/%[()]//g; - - # Deal with %n, n=1,9 and variants. - while ($com =~ /%([1-9])(:([$_varletters]?))?/o) { - my($match) = $&; - my($src) = $src1[$1]; - my($subst) = _variant($3, $src1[$1]->rfile); - undef $src[$1]; - $com =~ s/$match/$subst/; - } - - # Deal with %0 aka %> and variants. - while ($com =~ /%[0>](:([$_varletters]?))?/o) { - my($match) = $&; - my($subst) = _variant($2, $tgt); - $com =~ s/$match/$subst/; - } - - # Deal with %< (all sources except %n's already used) - while ($com =~ /%<(:([$_varletters]?))?/o) { - my($match) = $&; - my @list = (); - foreach (@src) { - push(@list, _variant($2, $_->rfile)) if $_; - } - my($subst) = join(' ', @list); - $com =~ s/$match/$subst/; - } - - # Deal with %[ %]. - $com =~ s{%\[(.*?)%\]}{ - my($func, @args) = grep { $_ ne '' } split(/\s+/, $1); - die("$0: \"$func\" is not defined.\n") - unless ($env->{$func}); - &{$env->{$func}}(@args); - }gex; - - # Convert left-over %% into %. - $com =~ s/%%/%/g; - - # White space cleanup. XXX NO WAY FOR USER TO HAVE QUOTED SPACES - $com = join(' ', split(' ', $com)); - next if $com =~ /^:/ && $com !~ /^:\S/; - push(@coms, $com); - } - @coms -} - -# Build the target using the previously specified commands. -sub execute { - my($self, $env, $tgt, $package) = @_; - - if ($param::build) { - futil::mkdir($tgt->{dir}); - unlink($tgt->path) if ! $tgt->precious; - } - - # Set environment. - map(delete $ENV{$_}, keys %ENV); - %ENV = %{$env->{ENV}}; - - # Handle multi-line commands. - my $com; - for $com ($self->getcoms($env, $tgt)) { - if ($com !~ s/^\@\s*//) { - main::showcom($com); - } - next if ! $param::build; - - if ($com =~ /^\[perl\]\s*/) { - my $perlcmd = $'; - my $status; - { - # Restore the script package variables that were defined - # in the Conscript file that defined this [perl] build, - # so the code executes with the expected variables. - # Then actually execute (eval) the [perl] command to build - # the target, followed by cleaning up the name space - # by deleting the package variables we just restored. - my($pkgvars) = $tgt->{conscript}->{pkgvars}; - NameSpace::restore($package, $pkgvars) if $pkgvars; - $status = eval "package $package; $perlcmd"; - NameSpace::remove($package, keys %$pkgvars) if $pkgvars; - } - if (!defined($status)) { - warn "$0: *** Error during perl command eval: $@.\n"; - return undef; - } elsif ($status == 0) { - warn "$0: *** Perl command returned $status " - . "(this indicates an error).\n"; - return undef; - } - next; - } - if (! $self->do_command($com, $tgt->path)) { - return undef; - } - } - - # success. - return 1; -} - -sub show { - my($self, $env, $tgt) = @_; - my $com; - for $com ($self->getcoms($env, $tgt)) { - if ($com !~ /^\@\s*/) { - main::showcom($com); - } - } -} - -package action::command::unix; - -sub do_command { - my($class, $com, $path) = @_; - my($pid) = fork(); - die("$0: unable to fork child process ($!)\n") if !defined $pid; - if (!$pid) { - # This is the child. We eval the command to suppress -w - # warnings about not reaching the statements afterwards. - eval 'exec($com)'; - $com =~ s/\s.*//; - die qq($0: failed to execute "$com" ($!). ) - . qq(Is this an executable on path "$ENV{PATH}"?\n); - } - for (;;) { - do {} until wait() == $pid; - my ($b0, $b1) = ($? & 0xFF, $? >> 8); - # Don't actually see 0177 on stopped process; is this necessary? - next if $b0 == 0177; # process stopped; we can wait. - if ($b0) { - my($core, $sig) = ($b0 & 0200, $b0 & 0177); - my($coremsg) = $core ? "; core dumped" : ""; - $com =~ s/\s.*//; - my $err = "$0: *** \[$path\] $com terminated by signal " . - "$sig$coremsg\n"; - warn $err; - return undef; - } - if ($b1) { - warn qq($0: *** [$path] Error $b1\n); # trying to be like make. - return undef; - } - last; - } - return 1; -} - -package action::command::win32; - -sub do_command { - my($class, $com, $path) = @_; - system($com); - if ($?) { - my ($b0, $b1) = ($? & 0xFF, $? >> 8); - my $err = $b1 || $?; - my $warn = qq($0: *** [$path] Error $err); - $warn .= " (executable not found in path?)" if $b1 == 0xFF; - warn "$warn\n"; - return undef; - } - return 1; -} - -package action::perl; - -# THIS IS AN EXPERIMENTAL PACKAGE. It's entirely possible that the -# interface may change as this gets completed, so use at your own risk. -# -# There are (at least) two issues that need to be solved before blessing -# this as a real, fully-supported feature: -# -# -- We need to calculate a signature value for a Perl code ref, in -# order to rebuild the target if there's a change to the Perl code -# used to generate it. -# -# This is not straightforward. A B::Deparse package exists that -# decompiles a coderef into text. It's reportedly not completely -# reliable for closures; it misses which variables are global, and -# the values of private lexicals. Nevertheless, it'd probably -# be perfect for our purposes, except that it wasn't added until -# some time between Perl 5.00502 and 5.00554, and doesn't seem to -# really work until Perl 5.6.0, so by relying on it, we'd lose -# support for Perl versions back to 5.003*. -# -# -- Ideally, a code ref should be able to use something like -# $env->_subst to fetch values from the construction environment -# to modify its behavior without having to cut-and-paste code. -# (Actually, since we pass the environment to the executed code -# ref, there's no reason you can't do this with the code as it -# stands today.) But this REALLY complicates the signature -# calculation, because now the actual signature would depend not -# just on the code contents, but on the construction variables (or -# maybe just the environment). -# -# A potentially valid workaround would be to use the contents of the -# Conscript file in which the code reference is defined as the code -# ref's signature. This has the drawback of causing a recompilation of -# the target file even in response to unrelated changes in the Conscript -# file, but it would ensure correct builds without having to solve the -# messy issues of generating a signature directly from a code ref. -# -# Nevertheless, this seemed a useful enough skeleton of a feature that -# it made sense to release it in hopes that some practical experience -# will encourage someone to figure out how to solve the signature -# issues. Or maybe we'll discover these aren't big issues in practice -# and end up blessing it as is. - -use vars qw( %code ); - -sub new { - my($class, $cref) = @_; - $code{$cref} || do { - my $sig = ''; - # Generating a code signature using B::Deparse doesn't really - # work for us until Perl 5.6.0. Here's the code in case - # someone wants to use it. - #use B::Deparse; - #my $deparse = B::Deparse->new(); - #my $body = $deparse->coderef2text($cref); - #$sig = $body; # should be an MD5 sig - my($self) = { cref => $cref, crefsig => $sig }; - $code{$cref} = bless $self, $class; - } -} - -sub scriptsig { - $_[0]->{crefsig} -} - -sub execute { - my($self, $env, $tgt) = @_; - if ($param::build) { - futil::mkdir($tgt->{dir}); - unlink($tgt->path) if ! $tgt->precious; - my($cref) = $self->{cref}; - &$cref($env, $tgt->path, map($_->rpath, @{$tgt->{sources}})); - } -} - -sub commands { - return (); -} - - -# Generic scanning module. -package scan; - -# Returns the signature of files included by the specified files on -# behalf of the associated target. Any errors in handling the included -# files are propagated to the target on whose behalf this processing -# is being done. Signatures are cached for each unique file/scanner -# pair. -sub includes { - my($self, $tgt, @files) = @_; - my(%files, $file); - my($inc) = $self->{includes} || ($self->{includes} = {}); - while ($file = pop @files) { - next if exists $files{$file}; - if ($inc->{$file}) { - push(@files, @{$inc->{$file}}); - $files{$file} = 'sig'->signature($file->rfile); - } else { - if ((build $file) eq 'errors') { - $tgt->{status} = 'errors'; # tgt inherits build status - return (); - } - $files{$file} = 'sig'->signature($file->rfile); - my(@includes) = $self->scan($file); - $inc->{$file} = \@includes; - push(@files, @includes); - } - } - 'sig'->collect(sort values %files) -} - - -# A simple scanner. This is used by the QuickScanfunction, to setup -# one-time target and environment-independent scanning for a source -# file. Only used for commands run by the Command method. -package scan::quickscan; - -use vars qw( @ISA %scanner ); - -BEGIN { @ISA = qw(scan) } - -sub find { - my($class, $code, $env, $pdirs) = @_; - if (! defined $pdirs) { - $pdirs = [ ] ; - } elsif (ref($pdirs) ne 'ARRAY') { - $pdirs = [ split(/$main::PATH_SEPARATOR/o, $pdirs) ]; - } - my(@path) = map { $dir::cwd->lookupdir($_) } @$pdirs; - my($spath) = "@path"; - $scanner{$code,$env,$spath} || do { - my($self) = { code => $code, env => $env, path => \@path }; - $scanner{$code,$env,$spath} = bless $self; - } -} - -# Scan the specified file for included file names. -sub scan { - my($self, $file) = @_; - my($code) = $self->{code}; - my(@includes); - # File should have been built by now. If not, we'll ignore it. - return () unless open(SCAN, $file->rpath); - while() { - push(@includes, grep($_ ne '', &$code)); - } - close(SCAN); - my($wd) = $file->{dir}; - my(@files); - my $name; - for $name (@includes) { - my $dir; - for $dir ($file->{dir}, @{$self->{path}}) { - my($include) = $dir->lookup_accessible($name); - if ($include) { - push(@files, $include) unless $include->ignore; - last; - } - } - } - @files -} - - -# CPP (C preprocessor) scanning module -package scan::cpp; - -use vars qw( @ISA %scanner ); - -BEGIN { @ISA = qw(scan) } - -# For this constructor, provide the include path argument (colon -# separated). Each path is taken relative to the provided directory. - -# Note: a particular scanning object is assumed to always return the -# same result for the same input. This is why the search path is a -# parameter to the constructor for a CPP scanning object. We go to -# some pains to make sure that we return the same scanner object -# for the same path: otherwise we will unecessarily scan files. -sub find { - my($class, $dir, $pdirs) = @_; - if (! defined $pdirs) { - $pdirs = [ ]; - } elsif (ref($pdirs) ne 'ARRAY') { - $pdirs = [ split(/$main::PATH_SEPARATOR/o, $pdirs) ]; - } - my @path = map($dir->lookupdir($_), @$pdirs); - my($spath) = "@path"; - $scanner{$spath} || do { - my($self) = {'path' => \@path}; - $scanner{$spath} = bless $self; - } -} - -# Scan the specified file for include lines. -sub scan { - my($self, $file) = @_; - my($angles, $quotes); - - if (exists $file->{angles}) { - $angles = $file->{angles}; - $quotes = $file->{quotes}; - } else { - my(@anglenames, @quotenames); - return () unless open(SCAN, $file->rpath); - while () { - next unless /^\s*#/; - if (/^\s*#\s*include\s*([<"])(.*?)[>"]/) { - if ($1 eq "<") { - push(@anglenames, $2); - } else { - push(@quotenames, $2); - } - } - } - close(SCAN); - $angles = $file->{angles} = \@anglenames; - $quotes = $file->{quotes} = \@quotenames; - } - - - my(@shortpath) = @{$self->{path}}; # path for <> style includes - my(@longpath) = ($file->{dir}, @shortpath); # path for "" style includes - - my(@includes); - - my $name; - for $name (@$angles) { - my $dir; - for $dir (@shortpath) { - my($include) = $dir->lookup_accessible($name); - if ($include) { - push(@includes, $include) unless $include->ignore; - last; - } - } - } - - for $name (@$quotes) { - my $dir; - for $dir(@longpath) { - my($include) = $dir->lookup_accessible($name); - if ($include) { - push(@includes, $include) unless $include->ignore; - last; - } - } - } - - return @includes -} - -# Return the include flags that would be used for a C Compile. -sub iflags { - my($self, $env) = @_; - my($iflags) = ''; - my($dir, $dpath); - for $dir (@{$self->{path}}) { - $dpath = $dir->path; - # Add the (presumably local) directory to the -I flags - # if we're not using repositories, the directory exists, - # or it's Linked to a source directory (that is, it *will* - # exist by the time the compilation occurs). - $iflags .= " ".$env->{INCDIRPREFIX}.$dpath.$env->{INCDIRSUFFIX} - if ! @param::rpath || -d $dpath || $dir->is_linked; - next if File::Spec->file_name_is_absolute($dpath); - if (@param::rpath) { - my $d; - if ($dpath eq $dir::CURDIR) { - foreach $d (map($_->path, @param::rpath)) { - $iflags .= " ".$env->{INCDIRPREFIX}.$d.$env->{INCDIRSUFFIX}; - } - } else { - my($rpath); - foreach $d (map($_->path, @param::rpath)) { - $rpath = File::Spec->catfile($d, $dpath); - $iflags .= " ".$env->{INCDIRPREFIX}.$rpath.$env->{INCDIRSUFFIX} - if -d $rpath; - } - } - } - } - $iflags -} - -package File::Spec; - -use vars qw( $_SEP $_MATCH_SEP $_MATCH_VOL ); - -# Cons is migrating to using File::Spec for portable path name -# manipulation. This is the right long-term direction, but there are -# some problems with making the transition: -# -# For multi-volume support, we need to use newer interfaces -# (splitpath, catpath, splitdir) that are only available in -# File::Spec 0.8. -# -# File::Spec 0.8 doesn't work with Perl 5.00[34] due to -# regular expression incompatibilities (use of \z). -# -# Forcing people to use a new version of a module is painful -# because (in the workplace) their administrators aren't -# always going to agree to install it everywhere. -# -# As a middle ground, we provide our own versions of all the File::Spec -# methods we use, supporting both UNIX and Win32. Some of these methods -# are home brew, some are cut-and-pasted from the real File::Spec methods. -# This way, we're not reinventing the whole wheel, at least. -# -# We can (and should) get rid of this class whenever 5.00[34] and -# versions of File::Spec prior to 0.9 (?) have faded sufficiently. -# We also may need to revisit whenever someone first wants to use -# Cons on some platform other than UNIX or Win32. - -BEGIN { - if ($main::_WIN32) { - $_SEP = '\\'; - $_MATCH_SEP = "[\Q/$_SEP\E]"; - $_MATCH_VOL = "([a-z]:)?$_MATCH_SEP"; - } else { - $_SEP = '/'; - $_MATCH_SEP = "\Q$_SEP\E"; - $_MATCH_VOL = $_MATCH_SEP; - } -} - -sub canonpath { - my ($self, $path) = @_; - if ($main::_WIN32) { - $path =~ s/^([a-z]:)/\u$1/s; - $path =~ s|/|\\|g; - $path =~ s|([^\\])\\+|$1\\|g; # xx////xx -> xx/xx - $path =~ s|(\\\.)+\\|\\|g; # xx/././xx -> xx/xx - $path =~ s|^(\.\\)+||s unless $path eq ".\\"; # ./xx -> xx - $path =~ s|\\$|| - unless $path =~ m#^([A-Z]:)?\\$#s; # xx/ -> xx - } else { - $path =~ s|/+|/|g unless($^O eq 'cygwin'); # xx////xx -> xx/xx - $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx - $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx - $path =~ s|^/(\.\./)+|/|s; # /../../xx -> xx - $path =~ s|/$|| unless $path eq "/"; # xx/ -> xx - } - return $path; -} - -sub catdir { - my $self = shift; - my @args = @_; - foreach (@args) { - # append a slash to each argument unless it has one there - $_ .= $_SEP if $_ eq '' || substr($_,-1) ne $_SEP; - } - return $self->canonpath(join('', @args)); -} - -sub catfile { - my $self = shift; - my $file = pop @_; - return $file unless @_; - my $dir = $self->catdir(@_); - $dir .= $_SEP unless substr($dir,-1) eq $_SEP; - $file = '' if ! defined($file); - return $dir.$file; -} - -sub catpath { - my $path = $_[1] . $_[0]->catfile(@_[2..$#_]); - $path =~ s/(.)$_MATCH_SEP*$/$1/; - $path; -} - -sub curdir { - '.' -} - -sub file_name_is_absolute { - my ($self, $file) = @_; - return scalar($file =~ m{^$_MATCH_VOL}is); -} - -sub splitdir { - my @dirs = split(/$_MATCH_SEP/, $_[1], -1); - push(@dirs, '') if $dirs[$#dirs]; - @dirs; -} - -sub splitpath { - my ($self, $path) = @_; - my $vol = ''; - my $sep = $_SEP; - if ($main::_WIN32) { - if ($path =~ s#^([A-Za-z]:|(?:\\\\|//)[^\\/]+[\\/][^\\/]+)([\\/])#$2#) { - $vol = $1; - $sep = $2; - } - } - my(@path) = split(/$_MATCH_SEP/, $path, -1); - my $file = pop @path; - my $dirs = join($sep, @path, ''); - return ($vol, $dirs, $file); -} - -sub updir { - '..' -} - -sub case_tolerant { - return $main::_WIN32; -} - -# Directory and file handling. Files/dirs are represented by objects. -# Other packages are welcome to add component-specific attributes. -package dir; - -use vars qw( $SEPARATOR $MATCH_SEPARATOR $CURDIR $UPDIR - $cwd_vol %root $top $cwd ); - -BEGIN { - # A portable way of determing our directory separator. - $SEPARATOR = File::Spec->catdir('', ''); - # A fast-path regular expression to match a directory separator - # anywhere in a path name. - if ($SEPARATOR eq '/') { - $MATCH_SEPARATOR = "\Q$SEPARATOR\E"; - } else { - $MATCH_SEPARATOR = "[\Q/$SEPARATOR\E]"; - } - # Cache these values so we don't have to make a method call - # every time we need them. - $CURDIR = File::Spec->curdir; # '.' on UNIX - $UPDIR = File::Spec->updir; # '..' on UNIX - # - $cwd_vol = ''; -} - -# Annotate a node (file or directory) with info about the -# method that created it. -sub creator { - my($self, @frame) = @_; - $self->{'creator'} = \@frame if @frame; - $self->{'creator'}; -} - -# Handle a file|dir type exception. We only die if we find we were -# invoked by something in a Conscript/Construct file, because -# dependencies created directly by Cons' analysis shouldn't cause -# an error. -sub _type_exception { - my($e) = @_; - my($line, $sub); - (undef, undef, $line, $sub) = script::caller_info; - if (defined $line) { - my $err = "\"${\$e->path}\" already in use as a " . ref($e) . " before $sub on line $line"; - if ($e->{'creator'}) { - my $script; - (undef, $script, $line, $sub) = @{$e->{'creator'}}; - $err = "\t" . $err . ",\n\t\tdefined by $sub in $script, line $line"; - } - $err .= "\n"; - die $err; - } -} - -# This wraps up all the common File::Spec logic that we use for parsing -# directory separators in a path and turning it into individual -# subdirectories that we must create, as well as creation of root -# nodes for any new file system volumes we find. File::Spec doesn't have -# intuitively obvious interfaces, so this is heavily commented. -# -# Note: This is NOT an object or class method; -# it's just a utility subroutine. -sub _parse_path { - my($dir, $path) = @_; - - # Convert all slashes to the native directory separator. - # This allows Construct files to always be written with good - # old POSIX path names, regardless of what we're running on. - $path = File::Spec->canonpath($path); - - # File::Spec doesn't understand the Cons convention of - # an initial '#' for top-relative files. Strip it. - my($toprel) = $path =~ s/^#//; - - # Let File::Spec do the heavy lifting of parsing the path name. - my($vol, $directories, $entry) = File::Spec->splitpath($path); - my @dirs = File::Spec->splitdir($directories); - - # If there was a file entry on the end of the path, then the - # last @dirs element is '' and we don't need it. If there - # wasn't a file entry on the end (File::Spec->splitpath() knew - # the last component was a directory), then the last @dirs - # element becomes the entry we want to look up. - my($e) = pop @dirs; - $entry = $e if $entry eq ''; - - if (File::Spec->file_name_is_absolute($path)) { - # An absolute path name. If no volume was supplied, - # use the volume of our current directory. - $vol = $cwd_vol if $vol eq ''; - $vol = uc($vol) if File::Spec->case_tolerant; - if (! defined $root{$vol}) { - # This is our first time looking up a path name - # on this volume, so create a root node for it. - # (On UNIX systems, $vol is always '', so '/' - # always maps to the $root{''} node.) - $root{$vol} = {path => $vol.$SEPARATOR, - prefix => $vol.$SEPARATOR, - srcpath => $vol.$SEPARATOR, - 'exists' => 1 }; - $root{$vol}->{'srcdir'} = $root{$vol}; - bless $root{$vol}; - } - # We're at the top, so strip the blank entry from the front of - # the @dirs array since the initial '/' it represents will now - # be supplied by the root node we return. - shift @dirs; - $dir = $root{$vol}; - } elsif ($toprel) { - $dir = $dir::top; - } - ($dir, \@dirs, $entry); -} - -# Common subroutine for creating directory nodes. -sub _create_dirs { - my ($dir, @dirs) = @_; - my $e; - foreach $e (@dirs) { - my $d = $dir->{member}->{$e}; - if (! defined $d) { - bless $d = { 'entry' => $e, 'dir' => $dir, }, 'dir'; - $d->creator(script::caller_info); - $d->{member}->{$dir::CURDIR} = $d; - $d->{member}->{$dir::UPDIR} = $dir; - $dir->{member}->{$e} = $d; - } elsif (ref $d eq 'entry') { - bless $d, 'dir'; - $d->{member}->{$dir::CURDIR} = $d; - $d->{member}->{$dir::UPDIR} = $dir; - } elsif (ref $d eq 'file') { - # This clause is to supply backwards compatibility, - # with a warning, for anyone that's used FilePath - # to refer to a directory. After people have using - # 1.8 have had time to adjust (sometime in version - # 1.9 or later), we should remove this entire clause. - my($script, $line, $sub); - (undef, $script, $line, $sub) = @{$d->{'creator'}}; - if ($sub eq 'script::FilePath') { - print STDERR "$0: Warning: $sub used to refer to a directory\n" - . "\tat line $line of $script. Use DirPath instead.\n"; - bless $d, 'dir'; - } else { - _type_exception($d); - } - } elsif (ref $d ne 'dir') { - _type_exception($d); - } - $dir = $d; - } - $dir; -} - -# Look up an entry in a directory. This method is for when we don't -# care whether a file or directory is returned, so if the entry already -# exists, it will simply be returned. If not, we create it as a -# generic "entry" which can be later turned into a file or directory -# by a more-specific lookup. -# -# The file entry may be specified as relative, absolute (starts with /), -# or top-relative (starts with #). -sub lookup { - my($dir, $entry) = @_; - - if ($entry !~ m#$MATCH_SEPARATOR#o) { - # Fast path: simple entry name in a known directory. - if ($entry =~ s/^#//) { - # Top-relative names begin with #. - $dir = $dir::top; - } elsif ($entry =~ s/^!//) { - $dir = $dir::cwd->srcdir; - } - } else { - my $dirsref; - ($dir, $dirsref, $entry) = _parse_path($dir, $entry); - $dir = _create_dirs($dir, @$dirsref) if @$dirsref; - return if ! defined $dir; - return $dir if $entry eq ''; - } - - my $e = $dir->{member}->{$entry}; - if (! defined $e) { - bless $e = { 'entry' => $entry, 'dir' => $dir, }, 'entry'; - $e->creator(script::caller_info); - $dir->{member}->{$entry} = $e; - } - - $e; -} - -# Look up a file entry in a directory. -# -# The file entry may be specified as relative, absolute (starts with /), -# or top-relative (starts with #). -sub lookupfile { - my($dir, $entry) = @_; - - if ($entry !~ m#$MATCH_SEPARATOR#o) { - # Fast path: simple entry name in a known directory. - if ($entry =~ s/^#//) { - # Top-relative names begin with #. - $dir = $dir::top; - } elsif ($entry =~ s/^!//) { - $dir = $dir::cwd->srcdir; - } - } else { - my $dirsref; - ($dir, $dirsref, $entry) = _parse_path($dir, $entry); - $dir = _create_dirs($dir, @$dirsref) if @$dirsref; - return undef if $entry eq ''; - } - - my $f = $dir->{member}->{$entry}; - if (! defined $f) { - bless $f = { 'entry' => $entry, 'dir' => $dir, }, 'file'; - $f->creator(script::caller_info); - $dir->{member}->{$entry} = $f; - } elsif (ref $f eq 'entry') { - bless $f, 'file'; - } elsif (ref $f ne 'file') { - _type_exception($f); - } - - $f; -} - -# Look up a (sub-)directory entry in a directory. -# -# The (sub-)directory entry may be specified as relative, absolute -# (starts with /), or top-relative (starts with #). -sub lookupdir { - my($dir, $entry) = @_; - - my $dirsref; - if ($entry !~ m#$MATCH_SEPARATOR#o) { - # Fast path: simple entry name in a known directory. - if ($entry =~ s/^#//) { - # Top-relative names begin with #. - $dir = $dir::top; - } elsif ($entry =~ s/^!//) { - $dir = $dir::cwd->srcdir; - } - } else { - ($dir, $dirsref, $entry) = _parse_path($dir, $entry); - } - push(@$dirsref, $entry) if $entry ne ''; - _create_dirs($dir, @$dirsref); -} - -# Look up a file entry and return it if it's accessible. -sub lookup_accessible { - my $file = $_[0]->lookupfile($_[1]); - return ($file && $file->accessible) ? $file : undef; -} - -# Return the parent directory without doing a lookupdir, -# which would create a parent if it doesn't already exist. -# A return value of undef (! $dir->up) indicates a root directory. -sub up { - $_[0]->{member}->{$dir::UPDIR}; -} - -# Return whether this is an entry somewhere underneath the -# specified directory. -sub is_under { - my $dir = $_[0]; - while ($dir) { - return 1 if $_[1] == $dir; - $dir = $dir->up; - } - return undef; -} - -# Return the relative path from the calling directory ($_[1]) -# to the object. If the object is not under the directory, then -# we return it as a top-relative or absolute path name. -sub relpath { - my ($dir, $obj) = @_; - my @dirs; - my $o = $obj; - while ($o) { - if ($dir == $o) { - if (@dirs < 2) { - return $dirs[0] || ''; - } else { - return File::Spec->catdir(@dirs); - } - } - unshift(@dirs, $o->{entry}); - $o = $o->up; - } - # The object was not underneath the specified directory. - # Use the node's cached path, which is either top-relative - # (in which case we append '#' to the beginning) or - # absolute. - my $p = $obj->path; - $p = '#' . $p if ! File::Spec->file_name_is_absolute($p); - return $p; -} - -# Return the path of the directory (file paths implemented -# separately, below). -sub path { - $_[0]->{path} || - ($_[0]->{path} = $_[0]->{dir}->prefix . $_[0]->{entry}); -} - -# Return the pathname as a prefix to be concatenated with an entry. -sub prefix { - return $_[0]->{prefix} if exists $_[0]->{prefix}; - $_[0]->{prefix} = $_[0]->path . $SEPARATOR; -} - -# Return the related source path prefix. -sub srcprefix { - return $_[0]->{srcprefix} if exists $_[0]->{srcprefix}; - my($srcdir) = $_[0]->srcdir; - $srcdir->{srcprefix} = $srcdir eq $_[0] ? $srcdir->prefix - : $srcdir->srcprefix; -} - -# Return the related source directory. -sub srcdir { - $_[0]->{'srcdir'} || - ($_[0]->{'srcdir'} = $_[0]->{dir}->srcdir->lookupdir($_[0]->{entry})) -} - -# Return if the directory is linked to a separate source directory. -sub is_linked { - return $_[0]->{is_linked} if defined $_[0]->{is_linked}; - $_[0]->{is_linked} = $_[0]->path ne $_[0]->srcdir->path; -} - -sub link { - my(@paths) = @_; - my($srcdir) = $dir::cwd->lookupdir(pop @paths)->srcdir; - map($dir::cwd->lookupdir($_)->{'srcdir'} = $srcdir, @paths); - - # make a reverse lookup for the link. - $srcdir->{links} = [] if ! $srcdir->{links}; - push @{$srcdir->{links}}, @paths; -} - -use vars qw( @tail ); # TODO: Why global ???? - -sub linked_targets { - my $tgt = shift; - my @targets = (); - my $dir; - if (ref $tgt eq 'dir') { - $dir = $tgt; - } else { - push @tail, $tgt; - $dir = $tgt->{dir}; - } - while ($dir) { - if (defined $dir->{links} && @{$dir->{links}}) { - push @targets, - map(File::Spec->catdir($_, @tail), @{$dir->{links}}); - #print STDERR "Found Link: ${\$dir->path} -> @{\$dir->{links}}\n"; - } - unshift @tail, $dir->{entry}; - $dir = $dir->up; - } - - return map($dir::top->lookupdir($_), @targets); -} - -sub accessible { - my $path = $_[0]->path; - my $err = "$0: you have attempted to use path \"$path\" both as a file " . - "and as a directory!\n"; - die $err; -} - -sub init { - my $path = Cwd::cwd(); - - # We know we can get away with passing undef to lookupdir - # as the directory because $dir is an absolute path. - $top = lookupdir(undef, $path); - $top->{'path'} = $top->{srcpath} = $dir::CURDIR; - $top->{'prefix'} = ''; - $top->{'srcdir'} = $top; - - $cwd = $top; - - ($cwd_vol, undef, undef) = File::Spec->splitpath($path); - $cwd_vol = '' if ! defined $cwd_vol; - $cwd_vol = uc($cwd_vol) if File::Spec->case_tolerant; -} - -package file; - -use vars qw( @ISA $level ); - -BEGIN { @ISA = qw(dir); $level = 0 } - -# Return the pathname of the file. -# Define this separately from dir::path because we don't want to -# cache all file pathnames (just directory pathnames). -sub path { - $_[0]->{dir}->prefix . $_[0]->{entry} -} - -# Return the related source file path. -sub srcpath { - $_[0]->{dir}->srcprefix . $_[0]->{entry} -} - -# Return if the file is (should be) linked to a separate source file. -sub is_linked { - $_[0]->{dir}->is_linked -} - -# Repository file search. If the local file exists, that wins. -# Otherwise, return the first existing same-named file under a -# Repository directory. If there isn't anything with the same name -# under a Repository directory, return the local file name anyway -# so that some higher layer can try to construct it. -sub rfile { - return $_[0]->{rfile} if exists $_[0]->{rfile}; - my($self) = @_; - my($rfile) = $self; - if (@param::rpath) { - my($path) = $self->path; - if (! File::Spec->file_name_is_absolute($path) && ! -f $path) { - my($dir); - foreach $dir (@param::rpath) { - my($t) = $dir->prefix . $path; - if (-f $t) { - $rfile = $_[0]->lookupfile($t); - $rfile->{'lfile'} = $self; - last; - } - } - } - } - $self->{rfile} = $rfile; -} - -# Returns the local file for a repository file; -# returns self if it's already a local file. -sub lfile { - $_[0]->{'lfile'} || $_[0] -} - -# returns the "precious" status of this file. -sub precious { - return $_[0]->{precious}; -} - -# "Erase" reference to a Repository file, -# making this a completely local file object -# by pointing it back to itself. -sub no_rfile { - $_[0]->{'rfile'} = $_[0]; -} - -# Return a path to the first existing file under a Repository directory, -# implicitly returning the current file's path if there isn't a -# same-named file under a Repository directory. -sub rpath { - $_[0]->{rpath} || - ($_[0]->{rpath} = $_[0]->rfile->path) -} - -# Return a path to the first linked srcpath file under a Repositoy -# directory, implicitly returning the current file's srcpath if there -# isn't a same-named file under a Repository directory. -sub rsrcpath { - return $_[0]->{rsrcpath} if exists $_[0]->{rsrcpath}; - my($self) = @_; - my($path) = $self->{rsrcpath} = $self->srcpath; - if (@param::rpath && ! File::Spec->file_name_is_absolute($path) && ! -f $path) { - my($dir); - foreach $dir (@param::rpath) { - my($t) = $dir->prefix . $path; - if (-f $t) { - $self->{rsrcpath} = $t; - last; - } - } - } - $self->{rsrcpath}; -} - -# Return if a same-named file source file exists. -# This handles the interaction of Link and Repository logic. -# As a side effect, it will link a source file from its Linked -# directory (preferably local, but maybe in a repository) -# into a build directory from its proper Linked directory. -sub source_exists { - return $_[0]->{source_exists} if defined $_[0]->{source_exists}; - my($self) = @_; - my($path) = $self->path; - my($mtime, $ctime) = (stat($path))[9,10]; - if ($self->is_linked) { - # Linked directory, local logic. - my($srcpath) = $self->srcpath; - my($src_mtime, $src_ctime) = (stat($srcpath))[9,10]; - if ($src_mtime) { - if (! $mtime || $src_mtime != $mtime || $src_ctime != $ctime) { - futil::install($srcpath, $self); - } - return $self->{source_exists} = 1; - } - # Linked directory, repository logic. - if (@param::rpath) { - if ($self != $self->rfile) { - return $self->{source_exists} = 1; - } - my($rsrcpath) = $self->rsrcpath; - if ($path ne $rsrcpath) { - my($rsrc_mtime, $rsrc_ctime) = (stat($rsrcpath))[9,10]; - if ($rsrc_mtime) { - if (! $mtime || $rsrc_mtime != $mtime - || $rsrc_ctime != $ctime) { - futil::install($rsrcpath, $self); - } - return $self->{source_exists} = 1; - } - } - } - # There was no source file in any Linked directory - # under any Repository. If there's one in the local - # build directory, it no longer belongs there. - if ($mtime) { - unlink($path) || die("$0: couldn't unlink $path ($!)\n"); - } - return $self->{source_exists} = ''; - } else { - if ($mtime) { - return $self->{source_exists} = 1; - } - if (@param::rpath && $self != $self->rfile) { - return $self->{source_exists} = 1; - } - return $self->{source_exists} = ''; - } -} - -# Return if a same-named derived file exists under a Repository directory. -sub derived_exists { - $_[0]->{derived_exists} || - ($_[0]->{derived_exists} = ($_[0] != $_[0]->rfile)); -} - -# Return if this file is somewhere under a Repository directory. -sub is_on_rpath { - defined $_[0]->{'lfile'}; -} - -sub local { - my($self, $arg) = @_; - if (defined $arg) { - $self->{'local'} = $arg; - } - $self->{'local'}; -} - -# Return the entry name of the specified file with the specified -# suffix appended. Leave it untouched if the suffix is already there. -# Differs from the addsuffix function, below, in that this strips -# the existing suffix (if any) before appending the desired one. -sub base_suf { - my($entry) = $_[0]->{entry}; - if ($entry !~ m/$_[1]$/) { - $entry =~ s/\.[^\.]*$//; - $entry .= $_[1]; - } - $entry; -} - -# Return the suffix of the file; everything including and to the -# right of the last dot. -sub suffix { - my @pieces = split(/\./, $_[0]->{entry}); - my $suffix = pop(@pieces); - return ".$suffix"; -} - -# Called as a simple function file::addsuffix(name, suffix) -sub addsuffix { - my($name, $suffix) = @_; - - if ($suffix && substr($name, -length($suffix)) ne $suffix) { - return $name .= $suffix; - } - $name; -} - -# Return true if the file is (or will be) accessible. -# That is, if we can build it, or if it is already present. -sub accessible { - (exists $_[0]->{builder}) || ($_[0]->source_exists); -} - -# Return true if the file should be ignored for the purpose -# of computing dependency information (should not be considered -# as a dependency and, further, should not be scanned for -# dependencies). -sub ignore { - return 0 if !$param::ignore; - return $_[0]->{ignore} if exists $_[0]->{ignore}; - $_[0]->{ignore} = $_[0]->path =~ /$param::ignore/o; -} - -# Build the file, if necessary. -sub build { - return $_[0]->{status} if $_[0]->{status}; - my($status) = &file::_build; - if ($_[0]->{after_build_func}) { - my($pkgvars) = $_[0]->{conscript}->{pkgvars}; - NameSpace::restore('script', $pkgvars) if $pkgvars; - eval("package script; " . $_[0]->{after_build_func}); - print "Error running AfterBuild for ${\$_[0]->path}: $@\n" if ($@); - NameSpace::remove('script', keys %$pkgvars) if $pkgvars; - } - return $status; -} - -sub _build { - my($self) = @_; - print main::DEPFILE $self->path, "\n" if $param::depfile; - print((' ' x $level), "Checking ", $self->path, "\n") if $param::depends; - if (!exists $self->{builder}) { - # We don't know how to build the file. This is OK, if - # the file is present as a source file, under either the - # local tree or a Repository. - if ($self->source_exists) { - return $self->{status} = 'handled'; - } else { - my($name) = $self->path; - print("$0: don't know how to construct \"$name\"\n"); - exit(1) unless $param::kflag; - return $self->{status} = 'errors'; # xxx used to be 'unknown' - } - } - - # An associated build object exists, so we know how to build - # the file. We first compute the signature of the file, based - # on its dependendencies, then only rebuild the file if the - # signature has changed. - my($builder) = $self->{builder}; - $level += 2; - - my(@deps) = (@{$self->{dep}}, @{$self->{sources}}); - my($rdeps) = \@deps; - - if ($param::random) { - # If requested, build in a random order, instead of the - # order that the dependencies were listed. - my(%rdeps); - map { $rdeps{$_,'*' x int(rand 10)} = $_ } @deps; - $rdeps = [values(%rdeps)]; - } - - $self->{status} = ''; - - my $dep; - for $dep (@$rdeps) { - if ((build $dep) eq 'errors') { - # Propagate dependent errors to target. - # but try to build all dependents regardless of errors. - $self->{status} = 'errors'; - } - } - - # If any dependents had errors, then we abort. - if ($self->{status} eq 'errors') { - $level -= 2; - return 'errors'; - } - - # Compute the final signature of the file, based on - # the static dependencies (in order), dynamic dependencies, - # output path name, and (non-substituted) build script. - my($sig) = 'sig'->collect(map('sig'->signature($_->rfile), @deps), - $builder->includes($self), - $builder->scriptsig); - - # May have gotten errors during computation of dynamic - # dependency signature, above. - $level -= 2; - return 'errors' if $self->{status} eq 'errors'; - - if (@param::rpath && $self->derived_exists) { - # There is no local file of this name, but there is one - # under a Repository directory. - - if ('sig'->current($self->rfile, $sig)) { - # The Repository copy is current (its signature matches - # our calculated signature). - if ($self->local) { - # ...but they want a local copy, so provide it. - main::showcom("Local copy of ${\$self->path} from " . - "${\$self->rpath}"); - futil::install($self->rpath, $self); - 'sig'->bsig($self, $sig); - } - return $self->{status} = 'handled'; - } - - # The signatures don't match, implicitly because something - # on which we depend exists locally. Get rid of the reference - # to the Repository file; we'll build this (and anything that - # depends on it) locally. - $self->no_rfile; - } - - # Then check for currency. - if (! 'sig'->current($self, $sig)) { - # We have to build/derive the file. - print((' ' x $level), "Rebuilding ", $self->path, ": out of date.\n") - if $param::depends; - # First check to see if the built file is cached. - if ($builder->cachin($self, $sig)) { - 'sig'->bsig($self, $sig); - return $self->{status} = 'built'; - } elsif ($builder->action($self)) { - $builder->cachout($self, $sig); - 'sig'->bsig($self, $sig); - return $self->{status} = 'built'; - } else { - die("$0: errors constructing ${\$self->path}\n") - unless $param::kflag; - return $self->{status} = 'errors'; - } - } else { - # Push this out to the cache if we've been asked to (-C option). - # Don't normally do this because it slows us down. - # In a fully built system, no accesses to the cache directory - # are required to check any files. This is a win if cache is - # heavily shared. Enabling this option puts the directory in the - # loop. Useful only when you wish to recreate a cache from a build. - if ($param::cachesync) { - $builder->cachout($self, $sig); - 'sig'->bsig($self, $sig); - } - return $self->{status} = 'handled'; - } -} - -# Bind an action to a file, with the specified sources. No return value. -sub bind { - my($self, $builder, @sources) = @_; - if ($self->{builder} && !$self->{builder}->compatible($builder)) { - # Even if not "compatible", we can still check to see if the - # derivation is identical. It should be identical if the builder is - # the same and the sources are the same. - if ("$self->{builder} @{$self->{sources}}" ne "$builder @sources") { - $main::errors++; - my($_foo1, $script1, $line1, $sub1) = @{$self->creator}; - my($_foo2, $script2, $line2, $sub2) = script::caller_info; - my $err = "\t${\$self->path}\n" . - "\tbuilt (at least) two different ways:\n" . - "\t\t$script1, line $line1: $sub1\n" . - "\t\t$script2, line $line2: $sub2\n"; - die $err; - } - return; - } - if ($param::wflag) { - my($script, $line, $sub); - (undef, $script, $line, $sub) = script::caller_info; - $self->{script} = '' if ! defined $self->{script}; - $self->{script} .= "; " if $self->{script}; - $self->{script} .= qq($sub in "$script", line $line); - } - $self->{builder} = $builder; - push(@{$self->{sources}}, @sources); - @{$self->{dep}} = () if ! defined $self->{dep}; - $self->{conscript} = $priv::self->{script}; -} - -sub is_under { - $_[0]->{dir}->is_under($_[1]); -} - -sub relpath { - my $dirpath = $_[0]->relpath($_[1]->{dir}); - if (! $dirpath) { - return $_[1]->{entry}; - } else { - File::Spec->catfile($dirpath, $_[1]->{entry}); - } -} - -# Return the signature array for this file. -# This probably belongs in its own "sigarray" package, -# which would make it easier to optimize performance. -sub sigarray { - if ($_[0]->{sigaref}) { - return @{$_[0]->{sigaref}}; - } - my $self = shift; - # glob2pat based on The Perl Cookbook, p. 180. - sub glob2pat { - my $globstr = shift; - my %patmap = ( - '*' => '.*', - '?' => '.', - '[' => '[', - ']' => ']', - '/' => "\Q$dir::SEPARATOR", # Cons-specific modification - ); - $globstr =~ s{(.)} { $patmap{$1} || "\Q$1" }ge; - return '^' . $globstr . '$'; - } - my @sigarray; - my $default; - my $builder = $self->lfile->{builder}; - if (! $builder) { - @sigarray = @$param::sourcesig; - $default = [qw(content)]; - } else { - if ($builder->{env} && $builder->{env}->{SIGNATURE}) { - @sigarray = @{$builder->{env}->{SIGNATURE}}; - } else { - my $class = ref $builder; - my $path = $self->path; - warn qq($0: Warning: Builder package $class did not record\n) . - qq(\tthe calling environment for '$path'.\n) . - qq(\tUnable to use any %SIGNATURE construction variable\n) . - qq(\tfor signature configuration.\n); - } - $default = [qw(build)]; - } - my $path = $self->path; - while (@sigarray) { - my($glob, $aref) = splice(@sigarray, 0, 2); - my $re = glob2pat($glob); - if ($path =~ /$re/) { - $aref = [split(/\s+/, $aref)] if ! ref $aref; - $self->{sigaref} = $aref; - return @$aref; - } - } - $self->{sigaref} = $default; - return @{$self->{sigaref}} -} - -# Decide if this file's signature should be the content or build signature. -sub sigtype { - if ($_[0]->{sigtype}) { - return $_[0]->{sigtype}; - } - my $self = shift; - my @sigarray = $self->sigarray; - my $sigtype; - if (grep($_ eq "build", @sigarray)) { - $sigtype = 'bsig'; - } elsif (grep($_ =~ /content$/, @sigarray)) { - $sigtype = 'csig'; - } - return $self->{sigtype} = $sigtype; -} - -# Return whether this file is configured to use stored -# signature values from the .consign file. -sub stored { - if (! defined $_[0]->{stored}) { - $_[0]->{stored} = grep($_ eq "stored-content", $_[0]->sigarray); - } - return $_[0]->{stored}; -} - -# Generic entry (file or directory) handling. -# This is an empty subclass for nodes that haven't -# quite decided whether they're files or dirs. -# Use file methods until someone blesses them one way or the other. -package entry; - -use vars qw( @ISA ); - -BEGIN { @ISA = qw(file) } - -# File utilities -package futil; - -# Install one file as another. -# Links them if possible (hard link), otherwise copies. -# Don't ask why, but the source is a path, the tgt is a file obj. -sub install { - my($sp, $tgt) = @_; - my($tp) = $tgt->path; - return 1 if $tp eq $sp; - return 1 if eval { link($sp, $tp) }; - unlink($tp); - if (! futil::mkdir($tgt->{dir})) { - return undef; - } - return 1 if eval { link($sp, $tp) }; - futil::copy($sp, $tp); -} - -# Copy one file to another. Arguments are actual file names. -# Returns undef on failure. Preserves mtime and mode. -sub copy { - my ($sp, $tp) = @_; - my ($mode, $length, $atime, $mtime) = (stat($sp))[2,7,8,9]; - - # Use Perl standard library module for file copying, which handles - # binary copies. 1998-06-18 - if (! File::Copy::copy($sp, $tp)) { - warn qq($0: can\'t install "$sp" to "$tp" ($!)\n); #' - return undef; - } - # The file has been created, so try both the chmod and utime, - # first making sure the copy is writable (because permissions - # affect the ability to modify file times on some operating - # systems), and then changing permissions back if necessary. - my $ret = 1; - my $wmode = $mode | 0700; - if (! chmod $wmode, $tp) { - warn qq($0: can\'t set mode $wmode on file "$tp" ($!)\n); #' - $ret = undef; - } - if (! utime $atime, $mtime, $tp) { - warn qq($0: can\'t set modification time for file "$tp" ($!)\n); #' - $ret = undef; - } - if ($mode != $wmode && ! chmod $mode, $tp) { - warn qq($0: can\'t set mode $mode on file "$tp" ($!)\n); #' - $ret = undef; - } - return $ret; -} - -# Ensure that the specified directory exists. -# Aborts on failure. -sub mkdir { - return 1 if $_[0]->{'exists'}; - if (! futil::mkdir($_[0]->{dir})) { # Recursively make parent. - return undef; - } - my($path) = $_[0]->path; - if (!-d $path && !mkdir($path, 0777)) { - warn qq($0: can't create directory $path ($!).\n); #' - return undef; - } - $_[0]->{'exists'} = 1; -} - - -# Signature package. -package sig::hash; - -use vars qw( $called ); - -sub init { - my($dir) = @_; - my($consign) = $dir->prefix . ".consign"; - my($dhash) = $dir->{consign} = {}; - if (-f $consign) { - open(CONSIGN, $consign) || die("$0: can't open $consign ($!)\n"); - while() { - chop; - my ($file, $sig) = split(/:/,$_); - $dhash->{$file} = $sig; - } - close(CONSIGN); - } - $dhash -} - -# Read the hash entry for a particular file. -sub in { - my($dir) = $_[0]->{dir}; - ($dir->{consign} || init($dir))->{$_[0]->{entry}} -} - -# Write the hash entry for a particular file. -sub out { - my($file, $sig) = @_; - my($dir) = $file->{dir}; - ($dir->{consign} || init($dir))->{$file->{entry}} = $sig; - $sig::hash::dirty{$dir} = $dir; -} - -# Eliminate the hash entry for a particular file. -sub clear { - my($file) = @_; - my($dir) = $file->{dir}; - delete $dir->{consign}->{$file->{entry}} if $dir->{consign}; - $sig::hash::dirty{$dir} = $dir; -} - -# Flush hash entries. Called at end or via ^C interrupt. -sub END { - return if $called++; # May be called twice. - close(CONSIGN); # in case this came in via ^C. - my $dir; - for $dir (values %sig::hash::dirty) { - my($consign) = $dir->prefix . ".consign"; - my($constemp) = $consign . ".$$"; - if (! open(CONSIGN, ">$constemp")) { - die("$0: can't create $constemp ($!)\n"); - } - my($entry, $sig); - while (($entry, $sig) = each %{$dir->{consign}}) { - if (! print CONSIGN "$entry:$sig\n") { - die("$0: error writing to $constemp ($!)\n"); - } - } - close(CONSIGN); - if (! rename($constemp, $consign)) { - if (futil::copy($constemp, $consign)) { - unlink($constemp); - } else { - die("$0: couldn't rename or copy $constemp to $consign " . - "($!)\n"); - } - } - } -} - - -# Derived file caching. -package cache; - -# Find a file in the cache. Return non-null if the file is in the cache. -sub in { - return undef unless $param::cache; - my($file, $sig) = @_; - # Add the path to the signature, to make it unique. - $sig = 'sig'->collect($sig, $file->path) unless $param::mixtargets; - my($dir) = substr($sig, 0, 1); - my($cp) = File::Spec->catfile($param::cache, $dir, $sig); - return -f $cp && futil::install($cp, $file); -} - -# Try to flush a file to the cache, if not already there. -# If it doesn't make it out, due to an error, then that doesn't -# really matter. -sub out { - return unless $param::cache; - my($file, $sig) = @_; - # Add the path to the signature, to make it unique. - $sig = 'sig'->collect($sig, $file->path) unless $param::mixtargets; - my($dir) = substr($sig, 0, 1); - my($sp) = $file->path; - my($cp) = File::Spec->catfile($param::cache, $dir, $sig); - my($cdir) = File::Spec->catfile($param::cache, $dir); - if (! -d $cdir) { - mkdir($cdir, 0777) || - die("$0: can't create cache directory $cdir ($!).\n"); - } elsif (-f $cp) { - # Already cached: try to use that instead, to save space. - # This can happen if the -cs option is used on a previously - # uncached build, or if two builds occur simultaneously. - my($lp) = ".$sig"; - unlink($lp); - return if ! eval { link($cp, $lp) }; - rename($lp, $sp); - # Unix98 says, "If the old argument and the new argument both - # [refer] to the same existing file, the rename() function - # returns successfully and performs no other action." So, if - # $lp and $sp are links (i.e., $cp and $sp are links), $lp is - # left, and we must unlink it ourselves. If the rename failed - # for any reason, it is also good form to unlink the temporary - # $lp. Otherwise $lp no longer exists and, barring some race, - # the unlink fails silently. - unlink($lp); - return; - } - - return if eval { link($sp, $cp) }; - return if ! -f $sp; # if nothing to cache. - if (futil::copy($sp, "$cp.new")) { - rename("$cp.new", $cp); - } -} - - -# Generic signature handling package. -# This handles the higher-layer distinction between content and build -# signatures, relying on an underlying calculation package like -# "sig::md5"" to provide the signature values themselves. -package sig; - -use vars qw( @ISA ); - -# Select the underlying package to be used for signature calculation. -# We play a few namespace games here. Specifically, we append -# "sig::" to the beginning of the subclass we're passed. Then, -# if the package ends in "::debug", we actually subclass the -# "sig::debug" package and as a wrapper around the underlying -# (e.g.) "sig::md5" package that's doing the real calculation. -sub select { - my($package, $subclass) = @_; - my $p = $package . "::" . $subclass; - my $sigpkg = $p; - if ($p =~ /(.*)::debug$/) { - $sigpkg = $1; - $p = 'sig::debug'; - } - @ISA = ($p); - $p->init($sigpkg); -}; - -# Set or return the build signature of a file. -# This is computed elsewhere and passed in to us. -sub bsig { - my($self, $file, $sig) = @_; - if (defined $sig) { - $file->{'bsig'} = $sig; - $self->set($file); - } elsif (! defined $file->{'bsig'}) { - $file->{'bsig'} = ''; - } - $file->{'bsig'} -} - -# Determine the content signature of a file. -# This also sets the .consign entry unless the file is in a -# repository; we don't write into repositories, only read from them. -sub csig { - my($self, $file) = @_; - if (! $file->{'csig'}) { - $file->{'csig'} = $self->srcsig($file->path); - $self->set($file) if ! $file->is_on_rpath; - } - $_[1]->{'csig'} -} - -# Determine the current signature of an already-existing or -# non-existant file. Unless a specific signature type (bsig -# or csig) is requested, this consults the file's signature -# array to decide whether to return content or build signature, -# and whether to use a cached value from a .consign file. -sub signature { - my($self, $file, $sigtype) = @_; - $sigtype = $file->sigtype if ! $sigtype; - #open(TTY, ">/dev/tty"); - #print TTY $file->path, ": $sigtype\n"; - #close(TTY); - my($path) = $file->path; - my($time) = (stat($path))[9]; - if ($time) { - if ($file->{$sigtype}) { - return $file->{$sigtype}; - } - if ($file->is_on_rpath || $file->stored) { - if ('sig'->fetch($file) && $file->{$sigtype}) { - if ($file->{'sigtime'} == $time || - ! $param::rep_sig_times_ok - && $file->is_on_rpath) { - return $file->{$sigtype}; - } - } - $file->{$sigtype} = undef; - } - if ($file->is_on_rpath || ! File::Spec->file_name_is_absolute($path)) { - my $sig = ''; - if ($sigtype eq 'bsig') { $sig = $self->bsig($file); } - elsif ($sigtype eq 'csig') { $sig = $self->csig($file); } - return $sig; - } - # This file is not in a repository or under the local directory - # structure. In the canonical case, it's a utility that will be - # executed by a command. Historically, Cons has returned the - # name of the command concatenated with the modification time. - # Note that this is *not* the path ("cc" not "/bin/cc"), so it - # would lose in the unlikely event that a different copy of the - # utility was used that happened to have the same modification - # time (due to living in a different directory on the PATH, for - # example). The obvious "fix" of using the path like so, however: - # return $path . $time; - # is wrong. In a multi-machine build environment, different - # systems may have the same utility in different locations (due - # to different NFS mount points, for example), which would - # cause a lot of unnecessary builds if we used the full path. - # A better solution to strengthen this signature would be to - # also concatenate the size of the file, but that would cause - # unnecessary rebuilds when coming from .consign files that used - # the old scheme. All of which is to merely explain why we're - # leaving this as it has been, but documenting it here in case - # there's reason to change it in the future. - return $file->{entry} . $time; - } - return $file->{$sigtype} = ''; -} - -sub bsignature { - my($self, $file) = @_; - my($path) = $file->path; - my($time) = (stat($path))[9]; - if ($time) { - if ($file->{'bsig'}) { - return $file->{'bsig'}; - } - if ('sig'->fetch($file, 'bsig') && $file->{'bsig'}) { - if ($file->{'sigtime'} == $time || - ! $param::rep_sig_times_ok - && $file->is_on_rpath) { - return $file->{'bsig'}; - } - } - if ($file->is_on_rpath || ! File::Spec->file_name_is_absolute($path)) { - return $self->bsig($file); - } - return $path . $time; - } - return $file->{'bsig'} = ''; -} - -# Invalidate a file's signature, also clearing its .consign entry. -sub invalidate { - my($self, $file) = @_; - delete $file->{'sigtime'}; - delete $file->{'bsig'}; - delete $file->{'csig'}; - sig::hash::clear($file); -} - -# Store the signature for a file. -sub set { - my($self, $file) = @_; - my $sig = (stat($file->path))[9]; - $sig .= " " . ($file->{'bsig'} || '-'); - $sig .= " " . $file->{'csig'} if $file->{'csig'}; - sig::hash::out($file, $sig); -} - -# Fetch the signature(s) for a file. -# Returns whether there was a signature to fetch. -sub fetch { - my($self, $file, @kw) = @_; - @kw = ('bsig', 'csig') if ! @kw; - my $sig = sig::hash::in($file) || ''; - my($sigtime, $bsig, $csig) = split(/ /, $sig); - $file->{'sigtime'} = $sigtime; - $file->{'bsig'} = $bsig || '' if grep($_ eq 'bsig', @kw); - $file->{'csig'} = $csig || '' if grep($_ eq 'csig', @kw); - $file->{'bsig'} = '' if $file->{'bsig'} eq '-'; - return $sig ne ''; -} - -# MD5-based signature package. -package sig::md5; - -use vars qw( $md5 ); - -# Initialize MD5 signature calculation by finding an appropriate -# module and creating the proper object. -sub init { - my $self = shift; - my @md5_modules = qw(Digest::MD5 MD5 Digest::Perl::MD5); - # We used to find the right module more simply, using $_ as the - # loop iterator and just doing: - # - # eval "use $_"; - # $module = $_, $last if ! $@; - # - # in the loop. Empirically, though, this doesn't pass back the - # right value in $module on some ActiveState versions. (Maybe - # it's something to do with the eval in a for loop, I dunno.) - # Work around it by using $_ to pass the value out of the loop, - # which seems to work everywhere. - my $module; - for $module (@md5_modules) { - eval "use $module"; - $_ = $module, last if ! $@; - } - $module = $_; - die "Cannot find any MD5 module from: @md5_modules" if $@; - - $md5 = new $module; -} - -# Is the provided signature equal to the signature of the current -# instantiation of the target (and does the target exist)? -sub current { - my($self, $file, $sig, $sigtype) = @_; - $self->bsignature($file) eq $sig; -} - -# Return an aggregate signature for a list of signature values. -sub collect { - my($self, @sigs) = @_; - # The following sequence is faster than calling the hex interface. - $md5->reset(); - $md5->add(join('', $param::salt, @sigs)); - unpack("H*", $md5->digest()); -} - -# Directly compute a file signature as the MD5 checksum of the -# bytes in the file. -sub srcsig { - my($self, $path) = @_; - $md5->reset(); - open(FILE, $path) || return ''; - binmode(FILE); - $md5->addfile(\*FILE); - close(FILE); - unpack("H*", $md5->digest()); -} - -# Compute the signature of a command string. -# For MD5, this is just the string itself, since MD5 will condense -# the string contents into the ultimate signature. Other signature -# schemes may need to figure this out differently. -sub cmdsig { - my($self, $sig) = @_; - return $sig -} - -# Generic debug package for signature calculation. -# Because of the way we're called by sig::select() and then use -# the specified value to set up @ISA, this package is essentially a -# factory that creates packages like sig::md5::debug, etc., on the fly. -package sig::debug; - -use vars qw( @ISA $sigpkg $outfh ); - -local *FH; - -sub init { - my $self = shift; - $sigpkg = shift; - @ISA = ($sigpkg); - $sigpkg->init(); - my $file = $ENV{CONS_SIG_DEBUG}; - if ($file) { - if (! open(FH, ">$file")) { - die "Cannot open $file: $!"; - } - $outfh = \*FH; - } else { - $outfh = \*STDOUT; - } -} - -sub current { - my($self, $file, $sig, $sigtype) = @_; - my $fsig = $self->bsignature($file); - my $sub = "${sigpkg}::current"; - my $sep = "\n" . ' ' x (length($sub) + 1 - 3); - print $outfh "$sub(|$fsig|${sep}eq |$sig|)\n"; - return $fsig eq $sig; -} - -sub collect { - my($self, @sigs) = @_; - my $sig = $sigpkg->collect(@sigs); - my $sub = "${sigpkg}::collect"; - my $sep = ",\n" . ' ' x (length($sub) + 1); - my $buf = join($sep, @sigs); - $buf = $param::salt . $sep . $buf if $param::salt; - print $outfh "$sub($buf)\n\t=> |$sig|\n"; - return $sig; -} - -sub srcsig { - my($self, $path) = @_; - my $sig = $sigpkg->srcsig($path); - print $outfh "${sigpkg}::srcsig($path)\n\t=> |$sig|\n"; - return $sig; -} - -__END__; - -=head1 NAME - -Cons - A Software Construction System - -=head1 DESCRIPTION - -A guide and reference for version 2.3.1 - -Copyright (c) 1996-2001 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. - -=head1 Introduction - -B is a system for constructing, primarily, software, but is quite -different from previous software construction systems. Cons was designed -from the ground up to deal easily with the construction of software spread -over multiple source directories. Cons makes it easy to create build scripts -that are simple, understandable and maintainable. Cons ensures that complex -software is easily and accurately reproducible. - -Cons uses a number of techniques to accomplish all of this. Construction -scripts are just Perl scripts, making them both easy to comprehend and very -flexible. Global scoping of variables is replaced with an import/export -mechanism for sharing information between scripts, significantly improving -the readability and maintainability of each script. B are introduced: these are Perl objects that capture the -information required for controlling the build process. Multiple -environments are used when different semantics are required for generating -products in the build tree. Cons implements automatic dependency analysis -and uses this to globally sequence the entire build. Variant builds are -easily produced from a single source tree. Intelligent build subsetting is -possible, when working on localized changes. Overrides can be setup to -easily override build instructions without modifying any scripts. MD5 -cryptographic B are associated with derived files, and are used -to accurately determine whether a given file needs to be rebuilt. - -While offering all of the above, and more, Cons remains simple and easy to -use. This will, hopefully, become clear as you read the remainder of this -document. - - -=head1 Why Cons? Why not Make? - -Cons is a B replacement. In the following paragraphs, we look at a few -of the undesirable characteristics of make--and typical build environments -based on make--that motivated the development of Cons. - -=head2 Build complexity - -Traditional make-based systems of any size tend to become quite complex. The -original make utility and its derivatives have contributed to this tendency -in a number of ways. Make is not good at dealing with systems that are -spread over multiple directories. Various work-arounds are used to overcome -this difficulty; the usual choice is for make to invoke itself recursively -for each sub-directory of a build. This leads to complicated code, in which -it is often unclear how a variable is set, or what effect the setting of a -variable will have on the build as a whole. The make scripting language has -gradually been extended to provide more possibilities, but these have -largely served to clutter an already overextended language. Often, builds -are done in multiple passes in order to provide appropriate products from -one directory to another directory. This represents a further increase in -build complexity. - - -=head2 Build reproducibility - -The bane of all makes has always been the correct handling of -dependencies. Most often, an attempt is made to do a reasonable job of -dependencies within a single directory, but no serious attempt is made to do -the job between directories. Even when dependencies are working correctly, -make's reliance on a simple time stamp comparison to determine whether a -file is out of date with respect to its dependents is not, in general, -adequate for determining when a file should be rederived. If an external -library, for example, is rebuilt and then ``snapped'' into place, the -timestamps on its newly created files may well be earlier than the last -local build, since it was built before it became visible. - - -=head2 Variant builds - -Make provides only limited facilities for handling variant builds. With the -proliferation of hardware platforms and the need for debuggable -vs. optimized code, the ability to easily create these variants is -essential. More importantly, if variants are created, it is important to -either be able to separate the variants or to be able to reproduce the -original or variant at will. With make it is very difficult to separate the -builds into multiple build directories, separate from the source. And if -this technique isn't used, it's also virtually impossible to guarantee at -any given time which variant is present in the tree, without resorting to a -complete rebuild. - - -=head2 Repositories - -Make provides only limited support for building software from code that -exists in a central repository directory structure. The VPATH feature of -GNU make (and some other make implementations) is intended to provide this, -but doesn't work as expected: it changes the path of target file to the -VPATH name too early in its analysis, and therefore searches for all -dependencies in the VPATH directory. To ensure correct development builds, -it is important to be able to create a file in a local build directory and -have any files in a code repository (a VPATH directory, in make terms) that -depend on the local file get rebuilt properly. This isn't possible with -VPATH, without coding a lot of complex repository knowledge directly into -the makefiles. - - -=head1 Keeping it simple - -A few of the difficulties with make have been cited above. In this and -subsequent sections, we shall introduce Cons and show how these issues are -addressed. - -=head2 Perl scripts - -Cons is Perl-based. That is, Cons scripts--F and F -files, the equivalent to F or F--are all written in -Perl. This provides an immediate benefit: the language for writing scripts -is a familiar one. Even if you don't happen to be a Perl programmer, it -helps to know that Perl is basically just a simple declarative language, -with a well-defined flow of control, and familiar semantics. It has -variables that behave basically the way you would expect them to, -subroutines, flow of control, and so on. There is no special syntax -introduced for Cons. The use of Perl as a scripting language simplifies -the task of expressing the appropriate solution to the often complex -requirements of a build. - - -=head2 Hello, World! - -To ground the following discussion, here's how you could build the B C application with Cons: - - - - $env = new cons(); - Program $env 'hello', 'hello.c'; - -If you install this script in a directory, naming the script F, -and create the F source file in the same directory, then you can -type C to build the application: - - - - % cons hello - cc -c hello.c -o hello.o - cc -o hello hello.o - - -=head2 Construction environments - -A key simplification of Cons is the idea of a B. A -construction environment is an B characterized by a set of key/value -pairs and a set of B. In order to tell Cons how to build something, -you invoke the appropriate method via an appropriate construction -environment. Consider the following example: - - - - $env = new cons( - CC => 'gcc', - LIBS => 'libworld.a' - ); - - Program $env 'hello', 'hello.c'; - -In this case, rather than using the default construction environment, as is, -we have overridden the value of C so that the GNU C Compiler equivalent -is used, instead. Since this version of B requires a library, -F, we have specified that any program linked in this environment -should be linked with that library. If the library exists already, well and -good, but if not, then we'll also have to include the statement: - - - - Library $env 'libworld', 'world.c'; - -Now if you type C, the library will be built before the program -is linked, and, of course, C will be used to compile both modules: - - - - % cons hello - gcc -c hello.c -o hello.o - gcc -c world.c -o world.o - ar r libworld.a world.o - ar: creating libworld.a - ranlib libworld.a - gcc -o hello hello.o libworld.a - - -=head2 Automatic and complete dependency analysis - -With Cons, dependencies are handled automatically. Continuing the previous -example, note that when we modify F, F is recompiled, -F recreated, and F relinked: - - - - % vi world.c - [EDIT] - % cons hello - gcc -c world.c -o world.o - ar r libworld.a world.o - ar: creating libworld.a - ranlib libworld.a - gcc -o hello hello.o libworld.a - -This is a relatively simple example: Cons ``knows'' F depends upon -F, because the dependency is explicitly set up by the C -method. It also knows that F depends upon F and that -F depends upon F, all for similar reasons. - -Now it turns out that F also includes the interface definition -file, F: - - - - % emacs world.h - [EDIT] - % cons hello - gcc -c hello.c -o hello.o - gcc -o hello hello.o libworld.a - -How does Cons know that F includes F, and that F -must therefore be recompiled? For now, suffice it to say that when -considering whether or not F is up-to-date, Cons invokes a scanner -for its dependency, F. This scanner enumerates the files included -by F to come up with a list of further dependencies, beyond those -made explicit by the Cons script. This process is recursive: any files -included by included files will also be scanned. - -Isn't this expensive? The answer is--it depends. If you do a full build of a -large system, the scanning time is insignificant. If you do a rebuild of a -large system, then Cons will spend a fair amount of time thinking about it -before it decides that nothing has to be done (although not necessarily more -time than make!). The good news is that Cons makes it very easy to -intelligently subset your build, when you are working on localized changes. - - -=head2 Automatic global build sequencing - -Because Cons does full and accurate dependency analysis, and does this -globally, for the entire build, Cons is able to use this information to take -full control of the B of the build. This sequencing is evident -in the above examples, and is equivalent to what you would expect for make, -given a full set of dependencies. With Cons, this extends trivially to -larger, multi-directory builds. As a result, all of the complexity involved -in making sure that a build is organized correctly--including multi-pass -hierarchical builds--is eliminated. We'll discuss this further in the next -sections. - -=head1 Building large trees--still just as simple - - -=head2 A hierarchy of build scripts - -A larger build, in Cons, is organized by creating a hierarchy of B. At the top of the tree is a script called F. The rest -of the scripts, by convention, are each called F. These scripts -are connected together, very simply, by the C, C, and -C commands. - - -=head2 The Build command - -The C command takes a list of F file names, and arranges -for them to be included in the build. For example: - - Build qw( - drivers/display/Conscript - drivers/mouse/Conscript - parser/Conscript - utilities/Conscript - ); - -This is a simple two-level hierarchy of build scripts: all the subsidiary -F files are mentioned in the top-level F file. Notice -that not all directories in the tree necessarily have build scripts -associated with them. - -This could also be written as a multi-level script. For example, the -F file might contain this command: - - Build qw( - parser/Conscript - drivers/Conscript - utilities/Conscript - ); - -and the F file in the F directory might contain this: - - Build qw( - display/Conscript - mouse/Conscript - ); - -Experience has shown that the former model is a little easier to understand, -since the whole construction tree is laid out in front of you, at the -top-level. Hybrid schemes are also possible. A separately maintained -component that needs to be incorporated into a build tree, for example, -might hook into the build tree in one place, but define its own construction -hierarchy. - -By default, Cons does not change its working directory to the directory -containing a subsidiary F file it is including. This behavior -can be enabled for a build by specifying, in the top-level F -file: - - Conscript_chdir 1; - -When enabled, Cons will change to the subsidiary F file's -containing directory while reading in that file, and then change back -to the top-level directory once the file has been processed. - -It is expected that this behavior will become the default in some future -version of Cons. To prepare for this transition, builds that expect -Cons to remain at the top of the build while it reads in a subsidiary -F file should explicitly disable this feature as follows: - - Conscript_chdir 0; - - -=head2 Relative, top-relative, and absolute file names - -You may have noticed that the file names specified to the Build command are -relative to the location of the script it is invoked from. This is generally -true for other filename arguments to other commands, too, although we might -as well mention here that if you begin a file name with a hash mark, ``#'', -then that file is interpreted relative to the top-level directory (where the -F file resides). And, not surprisingly, if you begin it with ``/'', -then it is considered to be an absolute pathname. This is true even on -systems which use a back slash rather than a forward slash to name absolute -paths. - -(There is another file prefix, ``!'', that is interpreted specially by -Cons. See discussion of the C command, below, for details.) - - -=head2 Using modules in build scripts - -You may pull modules into each F file using the normal Perl -C or C statements: - - use English; - require My::Module; - -Each C or C only affects the one F file in which -it appears. To use a module in multiple F files, you must -put a C or C statement in each one that needs the module. - - -=head2 Scope of variables - -The top-level F file and all F files begin life in -a common, separate Perl package. B controls the symbol table for -the package so that, the symbol table for each script is empty, except -for the F file, which gets some of the command line arguments. -All of the variables that are set or used, therefore, are set by the -script itself--not by some external script. - -Variables can be explicitly B by a script from its parent -script. To import a variable, it must have been B by the parent -and initialized (otherwise an error will occur). - - -=head2 The Export command - -The C command is used as in the following example: - - $env = new cons(); - $INCLUDE = "#export/include"; - $LIB = "#export/lib"; - Export qw( env INCLUDE LIB ); - Build qw( util/Conscript ); - -The values of the simple variables mentioned in the C list will be -squirreled away by any subsequent C commands. The C command -will only export Perl B variables, that is, variables whose name -begins with C<$>. Other variables, objects, etc. can be exported by -reference--but all scripts will refer to the same object, and this object -should be considered to be read-only by the subsidiary scripts and by the -original exporting script. It's acceptable, however, to assign a new value -to the exported scalar variable--that won't change the underlying variable -referenced. This sequence, for example, is OK: - - $env = new cons(); - Export qw( env INCLUDE LIB ); - Build qw( util/Conscript ); - $env = new cons(CFLAGS => '-O'); - Build qw( other/Conscript ); - -It doesn't matter whether the variable is set before or after the C -command. The important thing is the value of the variable at the time the -C command is executed. This is what gets squirreled away. Any -subsequent C commands, by the way, invalidate the first: you must -mention all the variables you wish to export on each C command. - - -=head2 The Import command - -Variables exported by the C command can be imported into subsidiary -scripts by the C command. The subsidiary script always imports -variables directly from the superior script. Consider this example: - - Import qw( env INCLUDE ); - -This is only legal if the parent script exported both C<$env> and -C<$INCLUDE>. It also must have given each of these variables values. It is -OK for the subsidiary script to only import a subset of the exported -variables (in this example, C<$LIB>, which was exported by the previous -example, is not imported). - -All the imported variables are automatically re-exported, so the sequence: - - Import qw ( env INCLUDE ); - Build qw ( beneath-me/Conscript ); - -will supply both C<$env> and C<$INCLUDE> to the subsidiary file. If only -C<$env> is to be exported, then the following will suffice: - - Import qw ( env INCLUDE ); - Export qw ( env ); - Build qw ( beneath-me/Conscript ); - -Needless to say, the variables may be modified locally before invoking -C on the subsidiary script. - - -=head2 Build script evaluation order - -The only constraint on the ordering of build scripts is that superior -scripts are evaluated before their inferior scripts. The top-level -F file, for instance, is evaluated first, followed by any -inferior scripts. This is all you really need to know about the evaluation -order, since order is generally irrelevant. Consider the following C -command: - - Build qw( - drivers/display/Conscript - drivers/mouse/Conscript - parser/Conscript - utilities/Conscript - ); - -We've chosen to put the script names in alphabetical order, simply because -that's the most convenient for maintenance purposes. Changing the order will -make no difference to the build. - - -=head1 A Model for sharing files - - -=head2 Some simple conventions - -In any complex software system, a method for sharing build products needs to -be established. We propose a simple set of conventions which are trivial to -implement with Cons, but very effective. - -The basic rule is to require that all build products which need to be shared -between directories are shared via an intermediate directory. We have -typically called this F, and, in a C environment, provided -conventional sub-directories of this directory, such as F, F, -F, etc. - -These directories are defined by the top-level F file. A simple -F file for a B application, organized using -multiple directories, might look like this: - - # Construct file for Hello, World! - - # Where to put all our shared products. - $EXPORT = '#export'; - - Export qw( CONS INCLUDE LIB BIN ); - - # Standard directories for sharing products. - $INCLUDE = "$EXPORT/include"; - $LIB = "$EXPORT/lib"; - $BIN = "$EXPORT/bin"; - - # A standard construction environment. - $CONS = new cons ( - CPPPATH => $INCLUDE, # Include path for C Compilations - LIBPATH => $LIB, # Library path for linking programs - LIBS => '-lworld', # List of standard libraries - ); - - Build qw( - hello/Conscript - world/Conscript - ); - -The F directory's F file looks like this: - - # Conscript file for directory world - Import qw( CONS INCLUDE LIB ); - - # Install the products of this directory - Install $CONS $LIB, 'libworld.a'; - Install $CONS $INCLUDE, 'world.h'; - - # Internal products - Library $CONS 'libworld.a', 'world.c'; - -and the F directory's F file looks like this: - - # Conscript file for directory hello - Import qw( CONS BIN ); - - # Exported products - Install $CONS $BIN, 'hello'; - - # Internal products - Program $CONS 'hello', 'hello.c'; - -To construct a B program with this directory structure, go to -the top-level directory, and invoke C with the appropriate -arguments. In the following example, we tell Cons to build the directory -F. To build a directory, Cons recursively builds all known products -within that directory (only if they need rebuilding, of course). If any of -those products depend upon other products in other directories, then those -will be built, too. - - % cons export - Install world/world.h as export/include/world.h - cc -Iexport/include -c hello/hello.c -o hello/hello.o - cc -Iexport/include -c world/world.c -o world/world.o - ar r world/libworld.a world/world.o - ar: creating world/libworld.a - ranlib world/libworld.a - Install world/libworld.a as export/lib/libworld.a - cc -o hello/hello hello/hello.o -Lexport/lib -lworld - Install hello/hello as export/bin/hello - - -=head2 Clean, understandable, location-independent scripts - -You'll note that the two F files are very clean and -to-the-point. They simply specify products of the directory and how to build -those products. The build instructions are minimal: they specify which -construction environment to use, the name of the product, and the name of -the inputs. Note also that the scripts are location-independent: if you wish -to reorganize your source tree, you are free to do so: you only have to -change the F file (in this example), to specify the new locations -of the F files. The use of an export tree makes this goal easy. - -Note, too, how Cons takes care of little details for you. All the F -directories, for example, were made automatically. And the installed files -were really hard-linked into the respective export directories, to save -space and time. This attention to detail saves considerable work, and makes -it even easier to produce simple, maintainable scripts. - - -=head1 Separating source and build trees - -It's often desirable to keep any derived files from the build completely -separate from the source files. This makes it much easier to keep track of -just what is a source file, and also makes it simpler to handle B -builds, especially if you want the variant builds to co-exist. - - -=head2 Separating build and source directories using the Link command - -Cons provides a simple mechanism that handles all of these requirements. The -C command is invoked as in this example: - - Link 'build' => 'src'; - -The specified directories are ``linked'' to the specified source -directory. Let's suppose that you setup a source directory, F, with the -sub-directories F and F below it, as in the previous -example. You could then substitute for the original build lines the -following: - - Build qw( - build/world/Conscript - build/hello/Conscript - ); - -Notice that you treat the F file as if it existed in the build -directory. Now if you type the same command as before, you will get the -following results: - - % cons export - Install build/world/world.h as export/include/world.h - cc -Iexport/include -c build/hello/hello.c -o build/hello/hello.o - cc -Iexport/include -c build/world/world.c -o build/world/world.o - ar r build/world/libworld.a build/world/world.o - ar: creating build/world/libworld.a - ranlib build/world/libworld.a - Install build/world/libworld.a as export/lib/libworld.a - cc -o build/hello/hello build/hello/hello.o -Lexport/lib -lworld - Install build/hello/hello as export/bin/hello - -Again, Cons has taken care of the details for you. In particular, you will -notice that all the builds are done using source files and object files from -the build directory. For example, F is compiled from -F, and F is installed from -F. This is accomplished on most systems by the simple -expedient of ``hard'' linking the required files from each source directory -into the appropriate build directory. - -The links are maintained correctly by Cons, no matter what you do to the -source directory. If you modify a source file, your editor may do this ``in -place'' or it may rename it first and create a new file. In the latter case, -any hard link will be lost. Cons will detect this condition the next time -the source file is needed, and will relink it appropriately. - -You'll also notice, by the way, that B changes were required to the -underlying F files. And we can go further, as we shall see in the -next section. - -=head2 Explicit references to the source directory - -When using the C command on some operating systems or with some -tool chains, it's sometimes useful to have a command actually use -the path name to the source directory, not the build directory. For -example, on systems that must copy, not "hard link," the F and -F copies of C files, using the F path of a file -name might make an editor aware that a syntax error must be fixed in the -source directory, not the build directory. - -You can tell Cons that you want to use the "source path" for a file by -preceding the file name with a ``!'' (exclamation point). For example, -if we add a ``!'' to the beginning of a source file: - - Program $env "foo", "!foo.c"; # Notice initial ! on foo.c - -Cons will compile the target as follows: - - cc -c src/foo.c -o build/foo.o - cc -o build/foo build/foo.o - -Notice that Cons has compiled the program from the the F -source file. Without the initial ``!'', Cons would have compiled the -program using the F path name. - - - -=head1 Variant builds - - -=head2 Hello, World! for baNaNa and peAcH OS's - -Variant builds require just another simple extension. Let's take as an -example a requirement to allow builds for both the baNaNa and peAcH -operating systems. In this case, we are using a distributed file system, -such as NFS to access the particular system, and only one or the other of -the systems has to be compiled for any given invocation of C. Here's -one way we could set up the F file for our B -application: - - # Construct file for Hello, World! - - die qq(OS must be specified) unless $OS = $ARG{OS}; - die qq(OS must be "peach" or "banana") - if $OS ne "peach" && $OS ne "banana"; - - # Where to put all our shared products. - $EXPORT = "#export/$OS"; - - Export qw( CONS INCLUDE LIB BIN ); - - # Standard directories for sharing products. - $INCLUDE = "$EXPORT/include"; - $LIB = "$EXPORT/lib"; - $BIN = "$EXPORT/bin"; - - # A standard construction environment. - $CONS = new cons ( - CPPPATH => $INCLUDE, # Include path for C Compilations - LIBPATH => $LIB, # Library path for linking programs - LIBS => '-lworld', # List of standard libraries - ); - - # $BUILD is where we will derive everything. - $BUILD = "#build/$OS"; - - # Tell cons where the source files for $BUILD are. - Link $BUILD => 'src'; - - Build ( - "$BUILD/hello/Conscript", - "$BUILD/world/Conscript", - ); - -Now if we login to a peAcH system, we can build our B -application for that platform: - - % cons export OS=peach - Install build/peach/world/world.h as export/peach/include/world.h - cc -Iexport/peach/include -c build/peach/hello/hello.c -o build/peach/hello/hello.o - cc -Iexport/peach/include -c build/peach/world/world.c -o build/peach/world/world.o - ar r build/peach/world/libworld.a build/peach/world/world.o - ar: creating build/peach/world/libworld.a - ranlib build/peach/world/libworld.a - Install build/peach/world/libworld.a as export/peach/lib/libworld.a - cc -o build/peach/hello/hello build/peach/hello/hello.o -Lexport/peach/lib -lworld - Install build/peach/hello/hello as export/peach/bin/hello - - -=head2 Variations on a theme - -Other variations of this model are possible. For example, you might decide -that you want to separate out your include files into platform dependent and -platform independent files. In this case, you'd have to define an -alternative to C<$INCLUDE> for platform-dependent files. Most F -files, generating purely platform-independent include files, would not have -to change. - -You might also want to be able to compile your whole system with debugging -or profiling, for example, enabled. You could do this with appropriate -command line options, such as C. This would then be translated -into the appropriate platform-specific requirements to enable debugging -(this might include turning off optimization, for example). You could -optionally vary the name space for these different types of systems, but, as -we'll see in the next section, it's not B to do this, since Cons -is pretty smart about rebuilding things when you change options. - - -=head1 Signatures - -Cons uses file B to decide if a derived file is out-of-date -and needs rebuilding. In essence, if the contents of a file change, -or the manner in which the file is built changes, the file's signature -changes as well. This allows Cons to decide with certainty when a file -needs rebuilding, because Cons can detect, quickly and reliably, whether -any of its dependency files have been changed. - - -=head2 MD5 content and build signatures - -Cons uses the B (B) algorithm to compute file -signatures. The MD5 algorithm computes a strong cryptographic checksum -for any given input string. Cons can, based on configuration, use two -different MD5 signatures for a given file: - -The B of a file is an MD5 checksum of the file's -contents. Consequently, when the contents of a file change, its content -signature changes as well. - -The B of a file is a combined MD5 checksum of: - -=over 4 - -the signatures of all the input files used to build the file - -the signatures of all dependency files discovered by source scanners -(for example, C<.h> files) - -the signatures of all dependency files specified explicitly via the -C method) - -the command-line string used to build the file - -=back - -The build signature is, in effect, a digest of all the dependency -information for the specified file. Consequently, a file's build -signature changes whenever any part of its dependency information -changes: a new file is added, the contents of a file on which it depends -change, there's a change to the command line used to build the file (or -any of its dependency files), etc. - -For example, in the previous section, the build signature of the -F file will include: - -=over 4 - -the signature of the F file - -the signatures of any header files that Cons detects are included, -directly or indirectly, by F - -the text of the actual command line was used to generate F - -=back - -Similarly, the build signature of the F file will include -all the signatures of its constituents (and hence, transitively, the -signatures of B constituents), as well as the command line that -created the file. - -Note that there is no need for a derived file to depend upon any -particular F or F file. If changes to these files -affect a file, then this will be automatically reflected in its build -signature, since relevant parts of the command line are included in the -signature. Unrelated F or F changes will have no -effect. - - -=head2 Storing signatures in .consign files - -Before Cons exits, it stores the calculated signatures for all of the -files it built or examined in F<.consign> files, one per directory. -Cons uses this stored information on later invocations to decide if -derived files need to be rebuilt. - -After the previous example was compiled, the F<.consign> file in the -F directory looked like this: - - world.h:985533370 - d181712f2fdc07c1f05d97b16bfad904 - world.o:985533372 2a0f71e0766927c0532977b0d2158981 - world.c:985533370 - c712f77189307907f4189b5a7ab62ff3 - libworld.a:985533374 69e568fc5241d7d25be86d581e1fb6aa - -After the file name and colon, the first number is a timestamp of the -file's modification time (on UNIX systems, this is typically the number -of seconds since January 1st, 1970). The second value is the build -signature of the file (or ``-'' in the case of files with no build -signature--that is, source files). The third value, if any, is the -content signature of the file. - - -=head2 Using build signatures to decide when to rebuild files - -When Cons is deciding whether to build or rebuild a derived file, it -first computes the file's current build signature. If the file doesn't -exist, it must obviously be built. - -If, however, the file already exists, Cons next compares the -modification timestamp of the file against the timestamp value in -the F<.consign> file. If the timestamps match, Cons compares the -newly-computed build signature against the build signature in the -F<.consign> file. If the timestamps do not match or the build -signatures do not match, the derived file is rebuilt. - -After the file is built or rebuilt, Cons arranges to store the -newly-computed build signature in the F<.consign> file when it exits. - - -=head2 Signature example - -The use of these signatures is an extremely simple, efficient, and -effective method of improving--dramatically--the reproducibility of a -system. - -We'll demonstrate this with a simple example: - - # Simple "Hello, World!" Construct file - $CFLAGS = '-g' if $ARG{DEBUG} eq 'on'; - $CONS = new cons(CFLAGS => $CFLAGS); - Program $CONS 'hello', 'hello.c'; - -Notice how Cons recompiles at the appropriate times: - - % cons hello - cc -c hello.c -o hello.o - cc -o hello hello.o - % cons hello - cons: "hello" is up-to-date. - % cons DEBUG=on hello - cc -g -c hello.c -o hello.o - cc -o hello hello.o - % cons DEBUG=on hello - cons: "hello" is up-to-date. - % cons hello - cc -c hello.c -o hello.o - cc -o hello hello.o - - -=head2 Source-file signature configuration - -Cons provides a C method that allows you to configure -how the signature should be calculated for any source file when its -signature is being used to decide if a dependent file is up-to-date. -The arguments to the C method consist of one or more -pairs of strings: - - SourceSignature 'auto/*.c' => 'content', - '*' => 'stored-content'; - -The first string in each pair is a pattern to match against derived file -path names. The pattern is a file-globbing pattern, not a Perl regular -expression; the pattern <*.l> will match all Lex source files. The C<*> -wildcard will match across directory separators; the pattern C -would match all C source files in any subdirectory underneath the C -subdirectory. - -The second string in each pair contains one of the following keywords to -specify how signatures should be calculated for source files that match -the pattern. The available keywords are: - -=over 4 - -=item content - -Use the content signature of the source file when calculating signatures -of files that depend on it. This guarantees correct calculation of the -file's signature for all builds, by telling Cons to read the contents of -a source file to calculate its content signature each time it is run. - -=item stored-content - -Use the source file's content signature as stored in the F<.consign> -file, provided the file's timestamp matches the cached timestamp value -in the F<.consign> file. This optimizes performance, with the slight -risk of an incorrect build if a source file's contents have been changed -so quickly after its previous update that the timestamp still matches -the stored timestamp in the F<.consign> file even though the contents -have changed. - -=back - -The Cons default behavior of always calculating a source file's -signature from the file's contents is equivalent to specifying: - - SourceSignature '*' => 'content'; - -The C<*> will match all source files. The C keyword -specifies that Cons will read the contents of a source file to calculate -its signature each time it is run. - -A useful global performance optimization is: - - SourceSignature '*' => 'stored-content'; - -This specifies that Cons will use pre-computed content signatures -from F<.consign> files, when available, rather than re-calculating a -signature from the the source file's contents each time Cons is run. In -practice, this is safe for most build situations, and only a problem -when source files are changed automatically (by scripts, for example). -The Cons default, however, errs on the side of guaranteeing a correct -build in all situations. - -Cons tries to match source file path names against the patterns in the -order they are specified in the C arguments: - - SourceSignature '/usr/repository/objects/*' => 'stored-content', - '/usr/repository/*' => 'content', - '*.y' => 'content', - '*' => 'stored-content'; - -In this example, all source files under the F -directory will use F<.consign> file content signatures, source files -anywhere else underneath F will not use F<.consign> -signature values, all Yacc source files (C<*.y>) anywhere else will not -use F<.consign> signature values, and any other source file will use -F<.consign> signature values. - - -=head2 Derived-file signature configuration - -Cons provides a C construction variable that allows you to -configure how signatures are calculated for any derived file when its -signature is being used to decide if a dependent file is up-to-date. -The value of the C construction variable is a Perl array -reference that holds one or more pairs of strings, like the arguments to -the C method. - -The first string in each pair is a pattern to match against derived file -path names. The pattern is a file-globbing pattern, not a Perl regular -expression; the pattern `*.obj' will match all (Win32) object files. -The C<*> wildcard will match across directory separators; the pattern -`foo/*.a' would match all (UNIX) library archives in any subdirectory -underneath the foo subdirectory. - -The second string in each pair contains one of the following keywords -to specify how signatures should be calculated for derived files that -match the pattern. The available keywords are the same as for the -C method, with an additional keyword: - -=over 4 - -=item build - -Use the build signature of the derived file when calculating signatures -of files that depend on it. This guarantees correct builds by forcing -Cons to rebuild any and all files that depend on the derived file. - -=item content - -Use the content signature of the derived file when calculating signatures -of files that depend on it. This guarantees correct calculation of the -file's signature for all builds, by telling Cons to read the contents of -a derived file to calculate its content signature each time it is run. - -=item stored-content - -Use the derived file's content signature as stored in the F<.consign> -file, provided the file's timestamp matches the cached timestamp value -in the F<.consign> file. This optimizes performance, with the slight -risk of an incorrect build if a derived file's contents have been -changed so quickly after a Cons build that the file's timestamp still -matches the stored timestamp in the F<.consign> file. - -=back - -The Cons default behavior (as previously described) for using -derived-file signatures is equivalent to: - - $env = new cons(SIGNATURE => ['*' => 'build']); - -The C<*> will match all derived files. The C keyword specifies -that all derived files' build signatures will be used when calculating -whether a dependent file is up-to-date. - -A useful alternative default C configuration for many sites: - - $env = new cons(SIGNATURE => ['*' => 'content']); - -In this configuration, derived files have their signatures calculated -from the file contents. This adds slightly to Cons' workload, but has -the useful effect of "stopping" further rebuilds if a derived file is -rebuilt to exactly the same file contents as before, which usually -outweighs the additional computation Cons must perform. - -For example, changing a comment in a C file and recompiling should -generate the exact same object file (assuming the compiler doesn't -insert a timestamp in the object file's header). In that case, -specifying C or C for the signature calculation -will cause Cons to recognize that the object file did not actually -change as a result of being rebuilt, and libraries or programs that -include the object file will not be rebuilt. When C is -specified, however, Cons will only "know" that the object file was -rebuilt, and proceed to rebuild any additional files that include the -object file. - -Note that Cons tries to match derived file path names against the -patterns in the order they are specified in the C array -reference: - - $env = new cons(SIGNATURE => ['foo/*.o' => 'build', - '*.o' => 'content', - '*.a' => 'stored-content', - '*' => 'content']); - -In this example, all object files underneath the F subdirectory -will use build signatures, all other object files (including object -files underneath other subdirectories!) will use F<.consign> file -content signatures, libraries will use F<.consign> file build -signatures, and all other derived files will use content signatures. - - -=head2 Debugging signature calculation - -Cons provides a C<-S> option that can be used to specify what internal -Perl package Cons should use to calculate signatures. The default Cons -behavior is equivalent to specifying C<-S md5> on the command line. - -The only other package (currently) available is an C -package that prints out detailed information about the MD5 signature -calculations performed by Cons: - - % cons -S md5::debug hello - sig::md5::srcsig(hello.c) - => |52d891204c62fe93ecb95281e1571938| - sig::md5::collect(52d891204c62fe93ecb95281e1571938) - => |fb0660af4002c40461a2f01fbb5ffd03| - sig::md5::collect(52d891204c62fe93ecb95281e1571938, - fb0660af4002c40461a2f01fbb5ffd03, - cc -c %< -o %>) - => |f7128da6c3fe3c377dc22ade70647b39| - sig::md5::current(|| - eq |f7128da6c3fe3c377dc22ade70647b39|) - cc -c hello.c -o hello.o - sig::md5::collect() - => |d41d8cd98f00b204e9800998ecf8427e| - sig::md5::collect(f7128da6c3fe3c377dc22ade70647b39, - d41d8cd98f00b204e9800998ecf8427e, - cc -o %> %< ) - => |a0bdce7fd09e0350e7efbbdb043a00b0| - sig::md5::current(|| - eq |a0bdce7fd09e0350e7efbbdb043a00b0|) - cc -o hello, hello.o - - -=head1 Code Repositories - -Many software development organizations will have one or more central -repository directory trees containing the current source code for one or -more projects, as well as the derived object files, libraries, and -executables. In order to reduce unnecessary recompilation, it is useful to -use files from the repository to build development software--assuming, of -course, that no newer dependency file exists in the local build tree. - - -=head2 Repository - -Cons provides a mechanism to specify a list of code repositories that will -be searched, in-order, for source files and derived files not found in the -local build directory tree. - -The following lines in a F file will instruct Cons to look first -under the F directory and then under the -F directory: - - Repository qw ( - /usr/experiment/repository - /usr/product/repository - ); - -The repository directories specified may contain source files, derived files -(objects, libraries and executables), or both. If there is no local file -(source or derived) under the directory in which Cons is executed, then the -first copy of a same-named file found under a repository directory will be -used to build any local derived files. - -Cons maintains one global list of repositories directories. Cons will -eliminate the current directory, and any non-existent directories, from the -list. - - -=head2 Finding the Construct file in a Repository - -Cons will also search for F and F files in the -repository tree or trees. This leads to a chicken-and-egg situation, -though: how do you look in a repository tree for a F file if the -F file tells you where the repository is? To get around this, -repositories may be specified via C<-R> options on the command line: - - % cons -R /usr/experiment/repository -R /usr/product/repository . - -Any repository directories specified in the F or F -files will be appended to the repository directories specified by -command-line C<-R> options. - -=head2 Repository source files - -If the source code (include the F file) for the library version -of the I C application is in a repository (with no derived -files), Cons will use the repository source files to create the local object -files and executable file: - - % cons -R /usr/src_only/repository hello - gcc -c /usr/src_only/repository/hello.c -o hello.o - gcc -c /usr/src_only/repository/world.c -o world.o - ar r libworld.a world.o - ar: creating libworld.a - ranlib libworld.a - gcc -o hello hello.o libworld.a - -Creating a local source file will cause Cons to rebuild the appropriate -derived file or files: - - % pico world.c - [EDIT] - % cons -R /usr/src_only/repository hello - gcc -c world.c -o world.o - ar r libworld.a world.o - ar: creating libworld.a - ranlib libworld.a - gcc -o hello hello.o libworld.a - -And removing the local source file will cause Cons to revert back to -building the derived files from the repository source: - - % rm world.c - % cons -R /usr/src_only/repository hello - gcc -c /usr/src_only/repository/world.c -o world.o - ar r libworld.a world.o - ar: creating libworld.a - ranlib libworld.a - gcc -o hello hello.o libworld.a - - -=head2 Repository derived files - -If a repository tree contains derived files (usually object files, -libraries, or executables), Cons will perform its normal signature -calculation to decide whether the repository file is up-to-date or a derived -file must be built locally. This means that, in order to ensure correct -signature calculation, a repository tree must also contain the F<.consign> -files that were created by Cons when generating the derived files. - -This would usually be accomplished by building the software in the -repository (or, alternatively, in a build directory, and then copying the -result to the repository): - - % cd /usr/all/repository - % cons hello - gcc -c hello.c -o hello.o - gcc -c world.c -o world.o - ar r libworld.a world.o - ar: creating libworld.a - ranlib libworld.a - gcc -o hello hello.o libworld.a - -(This is safe even if the F file lists the F -directory in a C command because Cons will remove the current -directory from the repository list.) - -Now if we want to build a copy of the application with our own F -file, we only need to create the one necessary source file, and use the -C<-R> option to have Cons use other files from the repository: - - % mkdir $HOME/build1 - % cd $HOME/build1 - % ed hello.c - [EDIT] - % cons -R /usr/all/repository hello - gcc -c hello.c -o hello.o - gcc -o hello hello.o /usr/all/repository/libworld.a - -Notice that Cons has not bothered to recreate a local F library -(or recompile the F module), but instead uses the already-compiled -version from the repository. - -Because the MD5 signatures that Cons puts in the F<.consign> file contain -timestamps for the derived files, the signature timestamps must match the -file timestamps for a signature to be considered valid. - -Some software systems may alter the timestamps on repository files (by -copying them, e.g.), in which case Cons will, by default, assume the -repository signatures are invalid and rebuild files unnecessarily. This -behavior may be altered by specifying: - - Repository_Sig_Times_OK 0; - -This tells Cons to ignore timestamps when deciding whether a signature is -valid. (Note that avoiding this sanity check means there must be proper -control over the repository tree to ensure that the derived files cannot be -modified without updating the F<.consign> signature.) - - -=head2 Local copies of files - -If the repository tree contains the complete results of a build, and we try -to build from the repository without any files in our local tree, something -moderately surprising happens: - - % mkdir $HOME/build2 - % cd $HOME/build2 - % cons -R /usr/all/repository hello - cons: "hello" is up-to-date. - -Why does Cons say that the F program is up-to-date when there is no -F program in the local build directory? Because the repository (not -the local directory) contains the up-to-date F program, and Cons -correctly determines that nothing needs to be done to rebuild this -up-to-date copy of the file. - -There are, however, many times in which it is appropriate to ensure that a -local copy of a file always exists. A packaging or testing script, for -example, may assume that certain generated files exist locally. Instead of -making these subsidiary scripts aware of the repository directory, the -C command may be added to a F or F file to -specify that a certain file or files must appear in the local build -directory: - - Local qw( - hello - ); - -Then, if we re-run the same command, Cons will make a local copy of the -program from the repository copy (telling you that it is doing so): - - % cons -R /usr/all/repository hello - Local copy of hello from /usr/all/repository/hello - cons: "hello" is up-to-date. - -Notice that, because the act of making the local copy is not considered a -"build" of the F file, Cons still reports that it is up-to-date. - -Creating local copies is most useful for files that are being installed into -an intermediate directory (for sharing with other directories) via the -C command. Accompanying the C command for a file with a -companion C command is so common that Cons provides a -C command as a convenient way to do both: - - Install_Local $env, '#export', 'hello'; - -is exactly equivalent to: - - Install $env '#export', 'hello'; - Local '#export/hello'; - -Both the C and C commands update the local F<.consign> -file with the appropriate file signatures, so that future builds are -performed correctly. - - -=head2 Repository dependency analysis - -Due to its built-in scanning, Cons will search the specified repository -trees for included F<.h> files. Unless the compiler also knows about the -repository trees, though, it will be unable to find F<.h> files that only -exist in a repository. If, for example, the F file includes the -F file in its current directory: - - % cons -R /usr/all/repository hello - gcc -c /usr/all/repository/hello.c -o hello.o - /usr/all/repository/hello.c:1: hello.h: No such file or directory - -Solving this problem forces some requirements onto the way construction -environments are defined and onto the way the C C<#include> preprocessor -directive is used to include files. - -In order to inform the compiler about the repository trees, Cons will add -appropriate C<-I> flags to the compilation commands. This means that the -C variable in the construction environment must explicitly specify -all subdirectories which are to be searched for included files, including the -current directory. Consequently, we can fix the above example by changing -the environment creation in the F file as follows: - - $env = new cons( - CC => 'gcc', - CPPPATH => '.', - LIBS => 'libworld.a', - ); - -Due to the definition of the C variable, this yields, when we -re-execute the command: - - % cons -R /usr/all/repository hello - gcc -c -I. -I/usr/all/repository /usr/all/repository/hello.c -o hello.o - gcc -o hello hello.o /usr/all/repository/libworld.a - -The order of the C<-I> flags replicates, for the C preprocessor, the same -repository-directory search path that Cons uses for its own dependency -analysis. If there are multiple repositories and multiple C -directories, Cons will append the repository directories to the beginning of -each C directory, rapidly multiplying the number of C<-I> flags. -As an extreme example, a F file containing: - - Repository qw( - /u1 - /u2 - ); - - $env = new cons( - CPPPATH => 'a:b:c', - ); - -Would yield a compilation command of: - - cc -Ia -I/u1/a -I/u2/a -Ib -I/u1/b -I/u2/b -Ic -I/u1/c -I/u2/c -c hello.c -o hello.o - -In order to shorten the command lines as much as possible, Cons will -remove C<-I> flags for any directories, locally or in the repositories, -which do not actually exist. (Note that the C<-I> flags are not included -in the MD5 signature calculation for the target file, so the target will -not be recompiled if the compilation command changes due to a directory -coming into existence.) - -Because Cons relies on the compiler's C<-I> flags to communicate the -order in which repository directories must be searched, Cons' handling -of repository directories is fundamentally incompatible with using -double-quotes on the C<#include> directives in any C source code that -you plan to modify: - - #include "file.h" /* DON'T USE DOUBLE-QUOTES LIKE THIS */ - -This is because most C preprocessors, when faced with such a directive, will -always first search the directory containing the source file. This -undermines the elaborate C<-I> options that Cons constructs to make the -preprocessor conform to its preferred search path. - -Consequently, when using repository trees in Cons, B use -angle-brackets for included files in any C source (.c or .h) files that -you plan to modify locally: - - #include /* USE ANGLE-BRACKETS INSTEAD */ - -Code that will not change can still safely use double quotes on #include -lines. - - -=head2 Repository_List - -Cons provides a C command to return a list of all -repository directories in their current search order. This can be used for -debugging, or to do more complex Perl stuff: - - @list = Repository_List; - print join(' ', @list), "\n"; - - -=head2 Repository interaction with other Cons features - -Cons' handling of repository trees interacts correctly with other Cons -features--which is to say, it generally does what you would expect. - -Most notably, repository trees interact correctly, and rather powerfully, -with the 'Link' command. A repository tree may contain one or more -subdirectories for version builds established via C to a source -subdirectory. Cons will search for derived files in the appropriate build -subdirectories under the repository tree. - - -=head1 Default targets - -Until now, we've demonstrated invoking Cons with an explicit target -to build: - - % cons hello - -Normally, Cons does not build anything unless a target is specified, -but specifying '.' (the current directory) will build everything: - - % cons # does not build anything - - % cons . # builds everything under the top-level directory - -Adding the C method to any F or F file will add -the specified targets to a list of default targets. Cons will build -these defaults if there are no targets specified on the command line. -So adding the following line to the top-level F file will mimic -Make's typical behavior of building everything by default: - - Default '.'; - -The following would add the F and F commands (in the -same directory as the F or F file) to the default list: - - Default qw( - hello - goodbye - ); - -The C method may be used more than once to add targets to the -default list. - -=head1 Selective builds - -Cons provides two methods for reducing the size of given build. The first is -by specifying targets on the command line, and the second is a method for -pruning the build tree. We'll consider target specification first. - - -=head2 Selective targeting - -Like make, Cons allows the specification of ``targets'' on the command -line. Cons targets may be either files or directories. When a directory is -specified, this is simply a short-hand notation for every derivable -product--that Cons knows about--in the specified directory and below. For -example: - - % cons build/hello/hello.o - -means build F and everything that F might need. This is -from a previous version of the B program in which F -depended upon F. If that file is not up-to-date -(because someone modified F, then it will be rebuilt, -even though it is in a directory remote from F. - -In this example: - - % cons build - -Everything in the F directory is built, if necessary. Again, this may -cause more files to be built. In particular, both F -and F are required by the F directory, -and so they will be built if they are out-of-date. - -If we do, instead: - - % cons export - -then only the files that should be installed in the export directory will be -rebuilt, if necessary, and then installed there. Note that C -might build files that C doesn't build, and vice-versa. - - -=head2 No ``special'' targets - -With Cons, make-style ``special'' targets are not required. The simplest -analog with Cons is to use special F directories, instead. Let's -suppose, for example, that you have a whole series of unit tests that are -associated with your code. The tests live in the source directory near the -code. Normally, however, you don't want to build these tests. One solution -is to provide all the build instructions for creating the tests, and then to -install the tests into a separate part of the tree. If we install the tests -in a top-level directory called F, then: - - % cons tests - -will build all the tests. - - % cons export - -will build the production version of the system (but not the tests), and: - - % cons build - -should probably be avoided (since it will compile tests unnecessarily). - -If you want to build just a single test, then you could explicitly name the -test (in either the F directory or the F directory). You could -also aggregate the tests into a convenient hierarchy within the tests -directory. This hierarchy need not necessarily match the source hierarchy, -in much the same manner that the include hierarchy probably doesn't match -the source hierarchy (the include hierarchy is unlikely to be more than two -levels deep, for C programs). - -If you want to build absolutely everything in the tree (subject to whatever -options you select), you can use: - - % cons . - -This is not particularly efficient, since it will redundantly walk all the -trees, including the source tree. The source tree, of course, may have -buildable objects in it--nothing stops you from doing this, even if you -normally build in a separate build tree. - - -=head1 Build Pruning - -In conjunction with target selection, B can be used to reduce -the scope of the build. In the previous peAcH and baNaNa example, we have -already seen how script-driven build pruning can be used to make only half -of the potential build available for any given invocation of C. Cons -also provides, as a convenience, a command line convention that allows you -to specify which F files actually get ``built''--that is, -incorporated into the build tree. For example: - - % cons build +world - -The C<+> argument introduces a Perl regular expression. This must, of -course, be quoted at the shell level if there are any shell meta-characters -within the expression. The expression is matched against each F -file which has been mentioned in a C statement, and only those -scripts with matching names are actually incorporated into the build -tree. Multiple such arguments are allowed, in which case a match against any -of them is sufficient to cause a script to be included. - -In the example, above, the F program will not be built, since Cons -will have no knowledge of the script F. The F -archive will be built, however, if need be. - -There are a couple of uses for build pruning via the command line. Perhaps -the most useful is the ability to make local changes, and then, with -sufficient knowledge of the consequences of those changes, restrict the size -of the build tree in order to speed up the rebuild time. A second use for -build pruning is to actively prevent the recompilation of certain files that -you know will recompile due to, for example, a modified header file. You may -know that either the changes to the header file are immaterial, or that the -changes may be safely ignored for most of the tree, for testing -purposes.With Cons, the view is that it is pragmatic to admit this type of -behavior, with the understanding that on the next full build everything that -needs to be rebuilt will be. There is no equivalent to a ``make touch'' -command, to mark files as permanently up-to-date. So any risk that is -incurred by build pruning is mitigated. For release quality work, obviously, -we recommend that you do not use build pruning (it's perfectly OK to use -during integration, however, for checking compilation, etc. Just be sure to -do an unconstrained build before committing the integration). - - -=head1 Temporary overrides - -Cons provides a very simple mechanism for overriding aspects of a build. The -essence is that you write an override file containing one or more -C commands, and you specify this on the command line, when you run -C: - - % cons -o over export - -will build the F directory, with all derived files subject to the -overrides present in the F file. If you leave out the C<-o> option, -then everything necessary to remove all overrides will be rebuilt. - - -=head2 Overriding environment variables - -The override file can contain two types of overrides. The first is incoming -environment variables. These are normally accessible by the F -file from the C<%ENV> hash variable. These can trivially be overridden in -the override file by setting the appropriate elements of C<%ENV> (these -could also be overridden in the user's environment, of course). - - -=head2 The Override command - -The second type of override is accomplished with the C command, -which looks like this: - - Override , => , => , ...; - -The regular expression I is matched against every derived file that -is a candidate for the build. If the derived file matches, then the -variable/value pairs are used to override the values in the construction -environment associated with the derived file. - -Let's suppose that we have a construction environment like this: - - $CONS = new cons( - COPT => '', - CDBG => '-g', - CFLAGS => '%COPT %CDBG', - ); - -Then if we have an override file F containing this command: - - Override '\.o$', COPT => '-O', CDBG => ''; - -then any C invocation with C<-o over> that creates F<.o> files via -this environment will cause them to be compiled with C<-O >and no C<-g>. The -override could, of course, be restricted to a single directory by the -appropriate selection of a regular expression. - -Here's the original version of the Hello, World! program, built with this -environment. Note that Cons rebuilds the appropriate pieces when the -override is applied or removed: - - % cons hello - cc -g -c hello.c -o hello.o - cc -o hello hello.o - % cons -o over hello - cc -O -c hello.c -o hello.o - cc -o hello hello.o - % cons -o over hello - cons: "hello" is up-to-date. - % cons hello - cc -g -c hello.c -o hello.o - cc -o hello hello.o - -It's important that the C command only be used for temporary, -on-the-fly overrides necessary for development because the overrides are not -platform independent and because they rely too much on intimate knowledge of -the workings of the scripts. For temporary use, however, they are exactly -what you want. - -Note that it is still useful to provide, say, the ability to create a fully -optimized version of a system for production use--from the F and -F files. This way you can tailor the optimized system to the -platform. Where optimizer trade-offs need to be made (particular files may -not be compiled with full optimization, for example), then these can be -recorded for posterity (and reproducibility) directly in the scripts. - - -=head1 More on construction environments - -As previously mentioned, a B is an object that -has a set of keyword/value pairs and a set of methods, and which is used -to tell Cons how target files should be built. This section describes -how Cons uses and expands construction environment values to control its -build behavior. - -=head2 Construction variable expansion - -Construction variables from a construction environment are expanded -by preceding the keyword with a C<%> (percent sign): - - Construction variables: - XYZZY => 'abracadabra', - - The string: "The magic word is: %XYZZY!" - expands to: "The magic word is: abracadabra!" - -A construction variable name may be surrounded by C<{> and C<}> (curly -braces), which are stripped as part of the expansion. This can -sometimes be necessary to separate a variable expansion from trailing -alphanumeric characters: - - Construction variables: - OPT => 'value1', - OPTION => 'value2', - - The string: "%OPT %{OPT}ION %OPTION %{OPTION}" - expands to: "value1 value1ION value2 value2" - -Construction variable expansion is recursive--that is, a string -containing C<%->expansions after substitution will be re-expanded until -no further substitutions can be made: - - Construction variables: - STRING => 'The result is: %FOO', - FOO => '%BAR', - BAR => 'final value', - - The string: "The string says: %STRING" - expands to: "The string says: The result is: final value" - -If a construction variable is not defined in an environment, then the -null string is substituted: - - Construction variables: - FOO => 'value1', - BAR => 'value2', - - The string: "%FOO <%NO_VARIABLE> %BAR" - expands to: "value1 <> value2" - -A doubled C<%%> will be replaced by a single C<%>: - - The string: "Here is a percent sign: %%" - expands to: "Here is a percent sign: %" - -=head2 Default construction variables - -When you specify no arguments when creating a new construction -environment: - - $env = new cons(); - -Cons creates a reference to a new, default construction -environment. This contains a number of construction variables and some -methods. At the present writing, the default construction variables on a -UNIX system are: - - CC => 'cc', - CFLAGS => '', - CCCOM => '%CC %CFLAGS %_IFLAGS -c %< -o %>', - CXX => '%CC', - CXXFLAGS => '%CFLAGS', - CXXCOM => '%CXX %CXXFLAGS %_IFLAGS -c %< -o %>', - INCDIRPREFIX => '-I', - INCDIRSUFFIX => '', - LINK => '%CXX', - LINKCOM => '%LINK %LDFLAGS -o %> %< %_LDIRS %LIBS', - LINKMODULECOM => '%LD -r -o %> %<', - LIBDIRPREFIX => '-L', - LIBDIRSUFFIX => '', - AR => 'ar', - ARFLAGS => 'r', - ARCOM => ['%AR %ARFLAGS %> %<', '%RANLIB %>'], - RANLIB => 'ranlib', - AS => 'as', - ASFLAGS => '', - ASCOM => '%AS %ASFLAGS %< -o %>', - LD => 'ld', - LDFLAGS => '', - PREFLIB => 'lib', - SUFLIB => '.a', - SUFLIBS => '.so:.a', - SUFOBJ => '.o', - SIGNATURE => [ '*' => 'build' ], - ENV => { 'PATH' => '/bin:/usr/bin' }, - - -And on a Win32 system (Windows NT), the default construction variables -are (unless the default rule style is set using the B -method): - - CC => 'cl', - CFLAGS => '/nologo', - CCCOM => '%CC %CFLAGS %_IFLAGS /c %< /Fo%>', - CXXCOM => '%CXX %CXXFLAGS %_IFLAGS /c %< /Fo%>', - INCDIRPREFIX => '/I', - INCDIRSUFFIX => '', - LINK => 'link', - LINKCOM => '%LINK %LDFLAGS /out:%> %< %_LDIRS %LIBS', - LINKMODULECOM => '%LD /r /o %> %<', - LIBDIRPREFIX => '/LIBPATH:', - LIBDIRSUFFIX => '', - AR => 'lib', - ARFLAGS => '/nologo ', - ARCOM => "%AR %ARFLAGS /out:%> %<", - RANLIB => '', - LD => 'link', - LDFLAGS => '/nologo ', - PREFLIB => '', - SUFEXE => '.exe', - SUFLIB => '.lib', - SUFLIBS => '.dll:.lib', - SUFOBJ => '.obj', - SIGNATURE => [ '*' => 'build' ], - -These variables are used by the various methods associated with the -environment. In particular, any method that ultimately invokes an external -command will substitute these variables into the final command, as -appropriate. For example, the C method takes a number of source -files and arranges to derive, if necessary, the corresponding object -files: - - Objects $env 'foo.c', 'bar.c'; - -This will arrange to produce, if necessary, F and F. The -command invoked is simply C<%CCCOM>, which expands, through substitution, -to the appropriate external command required to build each object. The -substitution rules will be discussed in detail in the next section. - -The construction variables are also used for other purposes. For example, -C is used to specify a colon-separated path of include -directories. These are intended to be passed to the C preprocessor and are -also used by the C-file scanning machinery to determine the dependencies -involved in a C Compilation. - -Variables beginning with underscore are created by various methods, -and should normally be considered ``internal'' variables. For example, -when a method is called which calls for the creation of an object from -a C source, the variable C<_IFLAGS> is created: this corresponds to the -C<-I> switches required by the C compiler to represent the directories -specified by C. - -Note that, for any particular environment, the value of a variable is set -once, and then never reset (to change a variable, you must create a new -environment. Methods are provided for copying existing environments for this -purpose). Some internal variables, such as C<_IFLAGS> are created on demand, -but once set, they remain fixed for the life of the environment. - -The C, C, and C variables all supply a place -for passing options to the compiler, loader, and archiver, respectively. - -The C and C variables specify option -strings to be appended to the beginning and end, respectively, of each -include directory so that the compiler knows where to find F<.h> files. -Similarly, the C and C variables specify the -option string to be appended to the beginning of and end, respectively, -of each directory that the linker should search for libraries. - -Another variable, C, is used to determine the system environment during -the execution of an external command. By default, the only environment -variable that is set is C, which is the execution path for a UNIX -command. For the utmost reproducibility, you should really arrange to set -your own execution path, in your top-level F file (or perhaps by -importing an appropriate construction package with the Perl C -command). The default variables are intended to get you off the ground. - -=head2 Expanding variables in construction commands - -Within a construction command, construction variables will be expanded -according to the rules described above. In addition to normal variable -expansion from the construction environment, construction commands also -expand the following pseudo-variables to insert the specific input and -output files in the command line that will be executed: - -=over 10 - -=item %> - -The target file name. In a multi-target command, this expands to the -first target mentioned.) - -=item %0 - -Same as C<%E>. - -=item %1, %2, ..., %9 - -These refer to the first through ninth input file, respectively. - -=item %E - -The full set of input file names. If any of these have been used -anywhere else in the current command line (via C<%1>, C<%2>, etc.), then -those will be deleted from the list provided by C<%E>. Consider the -following command found in a F file in the F directory: - - Command $env 'tgt', qw(foo bar baz), qq( - echo %< -i %1 > %> - echo %< -i %2 >> %> - echo %< -i %3 >> %> - ); - -If F needed to be updated, then this would result in the execution of -the following commands, assuming that no remapping has been established for -the F directory: - - echo test/bar test/baz -i test/foo > test/tgt - echo test/foo test/baz -i test/bar >> test/tgt - echo test/foo test/bar -i test/baz >> test/tgt - -=back - -Any of the above pseudo-variables may be followed immediately by one of -the following suffixes to select a portion of the expanded path name: - - :a the absolute path to the file name - :b the directory plus the file name stripped of any suffix - :d the directory - :f the file name - :s the file name suffix - :F the file name stripped of any suffix - :S the absolute path path to a Linked source file - -Continuing with the above example, C<%E:f> would expand to C, -and C<%E:d> would expand to C. - -There are additional C<%> elements which affect the command line(s): - -=over 10 - -=item %[ %] - -It is possible to programmatically rewrite part of the command by -enclosing part of it between C<%[> and C<%]>. This will call the -construction variable named as the first word enclosed in the brackets -as a Perl code reference; the results of this call will be used to -replace the contents of the brackets in the command line. For example, -given an existing input file named F: - - @keywords = qw(foo bar baz); - $env = new cons(X_COMMA => sub { join(",", @_) }); - Command $env 'tgt', 'tgt.in', qq( - echo '# Keywords: %[X_COMMA @keywords %]' > %> - cat %< >> %> - ); - -This will execute: - - echo '# Keywords: foo,bar,baz' > tgt - cat tgt.in >> tgt - -=item %( %) - -Cons includes the text of the command line in the MD5 signature for a -build, so that targets get rebuilt if you change the command line (to -add or remove an option, for example). Command-line text in between -C<%(> and C<%)>, however, will be ignored for MD5 signature calculation. - -Internally, Cons uses C<%(> and C<%)> around include and library -directory options (C<-I> and C<-L> on UNIX systems, C and -C on Windows NT) to avoid rebuilds just because the directory -list changes. Rebuilds occur only if the changed directory list causes -any included I to change, and a changed include file is detected -by the MD5 signature calculation on the actual file contents. - -=back - -=head2 Expanding construction variables in file names - -Cons expands construction variables in the source and target file names -passed to the various construction methods according to the expansion -rules described above: - - $env = new cons( - DESTDIR => 'programs', - SRCDIR => 'src', - ); - Program $env '%DESTDIR/hello', '%SRCDIR/hello.c'; - -This allows for flexible configuration, through the construction -environment, of directory names, suffixes, etc. - - -=head1 Build actions - -Cons supports several types of B that can be performed -to construct one or more target files. Usually, a build action is -a construction command--that is, a command-line string that invokes -an external command. Cons can also execute Perl code embedded in a -command-line string, and even supports an experimental ability to build -a target file by executing a Perl code reference directly. - -A build action is usually specified as the value of a construction -variable: - - $env = new cons( - CCCOM => '%CC %CFLAGS %_IFLAGS -c %< -o %>', - LINKCOM => '[perl] &link_executable("%>", "%<")', - ARCOM => sub { my($env, $target, @sources) = @_; - # code to create an archive - } - ); - -A build action may be associated directly with one or more target files -via the C method; see below. - -=head2 Construction commands - -A construction command goes through expansion of construction variables -and C<%-> pseudo-variables, as described above, to create the actual -command line that Cons will execute to generate the target file or -files. - -After substitution occurs, strings of white space are converted into -single blanks, and leading and trailing white space is eliminated. It -is therefore currently not possible to introduce variable length white -space in strings passed into a command. - -If a multi-line command string is provided, the commands are executed -sequentially. If any of the commands fails, then none of the rest are -executed, and the target is not marked as updated, i.e. a new signature is -not stored for the target. - -Normally, if all the commands succeed, and return a zero status (or whatever -platform-specific indication of success is required), then a new signature -is stored for the target. If a command erroneously reports success even -after a failure, then Cons will assume that the target file created by that -command is accurate and up-to-date. - -The first word of each command string, after expansion, is assumed to be an -executable command looked up on the C environment variable (which is, -in turn, specified by the C construction variable). If this command is -found on the path, then the target will depend upon it: the command will -therefore be automatically built, as necessary. It's possible to write -multi-part commands to some shells, separated by semi-colons. Only the first -command word will be depended upon, however, so if you write your command -strings this way, you must either explicitly set up a dependency (with the -C method), or be sure that the command you are using is a system -command which is expected to be available. If it isn't available, you will, -of course, get an error. - -Cons normally prints a command before executing it. This behavior is -suppressed if the first character of the command is C<@>. Note that -you may need to separate the C<@> from the command name or escape it to -prevent C<@cmd> from looking like an array to Perl quote operators that -perform interpolation: - - # The first command line is incorrect, - # because "@cp" looks like an array - # to the Perl qq// function. - # Use the second form instead. - Command $env 'foo', 'foo.in', qq( - @cp %< tempfile - @ cp tempfile %> - ); - -If there are shell meta characters anywhere in the expanded command line, -such as C>, C>, quotes, or semi-colon, then the command -will actually be executed by invoking a shell. This means that a command -such as: - - cd foo - -alone will typically fail, since there is no command C on the path. But -the command string: - - cd $<:d; tar cf $>:f $<:f - -when expanded will still contain the shell meta character semi-colon, and a -shell will be invoked to interpret the command. Since C is interpreted -by this sub-shell, the command will execute as expected. - -=head2 Perl expressions - -If any command (even one within a multi-line command) begins with -C<[perl]>, the remainder of that command line will be evaluated by the -running Perl instead of being forked by the shell. If an error occurs -in parsing the Perl code, or if the Perl expression returns 0 or undef, -the command will be considered to have failed. For example, here is a -simple command which creates a file C directly from Perl: - - $env = new cons(); - Command $env 'foo', - qq([perl] open(FOO,'>foo');print FOO "hi\\n"; close(FOO); 1); - -Note that when the command is executed, you are in the same package as -when the F or F file was read, so you can call -Perl functions you've defined in the same F or F -file in which the C appears: - - $env = new cons(); - sub create_file { - my $file = shift; - open(FILE, ">$file"); - print FILE "hi\n"; - close(FILE); - return 1; - } - Command $env 'foo', "[perl] &create_file('%>')"; - -The Perl string will be used to generate the signature for the derived -file, so if you change the string, the file will be rebuilt. The contents -of any subroutines you call, however, are not part of the signature, -so if you modify a called subroutine such as C above, -the target will I be rebuilt. Caveat user. - -=head2 Perl code references [EXPERIMENTAL] - -Cons supports the ability to create a derived file by directly executing -a Perl code reference. This feature is considered EXPERIMENTAL and -subject to change in the future. - -A code reference may either be a named subroutine referenced by the -usual C<\&> syntax: - - sub build_output { - my($env, $target, @sources) = @_; - print "build_output building $target\n"; - open(OUT, ">$target"); - foreach $src (@sources) { - if (! open(IN, "<$src")) { - print STDERR "cannot open '$src': $!\n"; - return undef; - } - print OUT, ; - } - close(OUT); - return 1; - } - Command $env 'output', \&build_output; - -or the code reference may be an anonymous subroutine: - - Command $env 'output', sub { - my($env, $target, @sources) = @_; - print "building $target\n"; - open(FILE, ">$target"); - print FILE "hello\n"; - close(FILE); - return 1; - }; - -To build the target file, the referenced subroutine is passed, in order: -the construction environment used to generate the target; the path -name of the target itself; and the path names of all the source files -necessary to build the target file. - -The code reference is expected to generate the target file, of course, -but may manipulate the source and target files in any way it chooses. -The code reference must return a false value (C or C<0>) if -the build of the file failed. Any true value indicates a successful -build of the target. - -Building target files using code references is considered EXPERIMENTAL -due to the following current limitations: - -=over 4 - -Cons does I print anything to indicate the code reference is being -called to build the file. The only way to give the user any indication -is to have the code reference explicitly print some sort of "building" -message, as in the above examples. - -Cons does not generate any signatures for code references, so if the -code in the reference changes, the target will I be rebuilt. - -Cons has no public method to allow a code reference to extract -construction variables. This would be good to allow generalization of -code references based on the current construction environment, but would -also complicate the problem of generating meaningful signatures for code -references. - -=back - -Support for building targets via code references has been released in -this version to encourage experimentation and the seeking of possible -solutions to the above limitations. - - -=head1 Default construction methods - -The list of default construction methods includes the following: - - -=head2 The C constructor - -The C method is a Perl object constructor. That is, it is not invoked -via a reference to an existing construction environment B, but, -rather statically, using the name of the Perl B where the -constructor is defined. The method is invoked like this: - - $env = new cons(); - -The environment you get back is blessed into the package C, which -means that it will have associated with it the default methods described -below. Individual construction variables can be overridden by providing -name/value pairs in an override list. Note that to override any command -environment variable (i.e. anything under C), you will have to override -all of them. You can get around this difficulty by using the C method -on an existing construction environment. - - -=head2 The C method - -The C method creates a clone of an existing construction environment, -and can be called as in the following example: - - $env2 = $env1->clone(); - -You can provide overrides in the usual manner to create a different -environment from the original. If you just want a new name for the same -environment (which may be helpful when exporting environments to existing -components), you can just use simple assignment. - - -=head2 The C method - -The C method extracts the externally defined construction variables -from an environment and returns them as a list of name/value -pairs. Overrides can also be provided, in which case, the overridden values -will be returned, as appropriate. The returned list can be assigned to a -hash, as shown in the prototype, below, but it can also be manipulated in -other ways: - - %env = $env1->copy(); - -The value of C, which is itself a hash, is also copied to a new hash, -so this may be changed without fear of affecting the original -environment. So, for example, if you really want to override just the -C variable in the default environment, you could do the following: - - %cons = new cons()->copy(); - $cons{ENV}{PATH} = ""; - $cons = new cons(%cons); - -This will leave anything else that might be in the default execution -environment undisturbed. - - -=head2 The C method - -The C method arranges for the specified files to be installed in -the specified directory. The installation is optimized: the file is not -copied if it can be linked. If this is not the desired behavior, you will -need to use a different method to install the file. It is called as follows: - - Install $env , ; - -Note that, while the files to be installed may be arbitrarily named, -only the last component of each name is used for the installed target -name. So, for example, if you arrange to install F in F, -this will create a F file in the F directory (not F). - - -=head2 The C method - -The C method arranges for the specified source file(s) to be -installed as the specified target file(s). Multiple files should be -specified as a file list. The installation is optimized: the file is not -copied if it can be linked. If this is not the desired behavior, you will -need to use a different method to install the file. It is called as follows: - -C works in two ways: - -Single file install: - - InstallAs $env TgtFile, SrcFile; - -Multiple file install: - - InstallAs $env ['tgt1', 'tgt2'], ['src1', 'src2']; - -Or, even as: - - @srcs = qw(src1 src2 src3); - @tgts = qw(tgt1 tgt2 tgt3); - InstallAs $env [@tgts], [@srcs]; - -Both the target and the sources lists should be of the same length. - -=head2 The C method - -The C method asks cons not to delete the specified file or -list of files before building them again. It is invoked as: - - Precious ; - -This is especially useful for allowing incremental updates to libraries -or debug information files which are updated rather than rebuilt anew each -time. Cons will still delete the files when the C<-r> flag is specified. - -=head2 The C method - -The C method evaluates the specified perl string after -building the given file or files (or finding that they are up to date). -The eval will happen once per specified file. C is called -as follows: - - AfterBuild $env 'foo.o', qq(print "foo.o is up to date!\n"); - -The perl string is evaluated in the C