Add code, unknown original date

This commit is contained in:
2026-05-18 12:41:53 -04:00
commit 7fddc22283
2373 changed files with 3420614 additions and 0 deletions

119
code/ui/.svn/all-wcprops Executable file
View File

@@ -0,0 +1,119 @@
K 25
svn:wc:ra_dav:version-url
V 45
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui
END
ui.vcproj
K 25
svn:wc:ra_dav:version-url
V 55
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui.vcproj
END
ui.bat
K 25
svn:wc:ra_dav:version-url
V 52
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui.bat
END
ui_shared.c
K 25
svn:wc:ra_dav:version-url
V 57
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_shared.c
END
ui_shared.h
K 25
svn:wc:ra_dav:version-url
V 57
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_shared.h
END
ui_util.c
K 25
svn:wc:ra_dav:version-url
V 55
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_util.c
END
keycodes.h
K 25
svn:wc:ra_dav:version-url
V 56
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/keycodes.h
END
ui_players.c
K 25
svn:wc:ra_dav:version-url
V 58
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_players.c
END
compile.bat
K 25
svn:wc:ra_dav:version-url
V 57
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/compile.bat
END
ui.q3asm
K 25
svn:wc:ra_dav:version-url
V 54
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui.q3asm
END
ui_public.h
K 25
svn:wc:ra_dav:version-url
V 57
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_public.h
END
ui_atoms.c
K 25
svn:wc:ra_dav:version-url
V 56
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_atoms.c
END
ui_main.c
K 25
svn:wc:ra_dav:version-url
V 55
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_main.c
END
ui.dsp
K 25
svn:wc:ra_dav:version-url
V 52
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui.dsp
END
ui_gameinfo.c
K 25
svn:wc:ra_dav:version-url
V 59
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_gameinfo.c
END
Conscript
K 25
svn:wc:ra_dav:version-url
V 55
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/Conscript
END
ui_syscalls.asm
K 25
svn:wc:ra_dav:version-url
V 61
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_syscalls.asm
END
ui.def
K 25
svn:wc:ra_dav:version-url
V 52
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui.def
END
ui_syscalls.c
K 25
svn:wc:ra_dav:version-url
V 59
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_syscalls.c
END
ui_local.h
K 25
svn:wc:ra_dav:version-url
V 56
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/ui_local.h
END

677
code/ui/.svn/entries Executable file
View File

@@ -0,0 +1,677 @@
10
dir
44
https://127.0.0.1/svn/aklabs/trunk/hypermod/code/ui
https://127.0.0.1/svn/aklabs
2007-05-26T21:34:02.309037Z
9
andrew
eb184899-6090-47d4-a65b-558f62f6ea1c
ui.vcproj
file
2010-02-05T03:38:29.635748Z
6e6594b352b21a9aa62496c79df4ae61
2007-05-26T21:34:02.309037Z
9
andrew
has-props
12300
ui.bat
file
2010-02-05T03:38:29.635748Z
ba15a2606c8f0c51aa491010879f0337
2007-05-26T21:34:02.309037Z
9
andrew
has-props
625
ui_shared.c
file
2010-02-05T03:38:29.666998Z
af54a69f4cd674a2494a8b69aa5756a6
2007-05-26T21:34:02.309037Z
9
andrew
has-props
148626
ui_shared.h
file
2010-02-05T03:38:29.745123Z
24011bf61bc4fc296e59926e7a7a43b1
2007-05-26T21:34:02.309037Z
9
andrew
has-props
16488
ui_util.c
file
2010-02-05T03:38:29.760748Z
b7e006661ae1637db267af87db0add3d
2007-05-26T21:34:02.309037Z
9
andrew
has-props
85
CVS
dir
keycodes.h
file
2010-02-05T03:38:29.760748Z
bab3bdf0b31e50949b89d5e2bfa90e83
2007-05-26T21:34:02.309037Z
9
andrew
has-props
1657
ui_players.c
file
2010-02-05T03:38:29.791998Z
e8b22a2989144008bf4423cd4c7ce02b
2007-05-26T21:34:02.309037Z
9
andrew
has-props
33558
compile.bat
file
2010-02-05T03:38:29.791998Z
6e7599b0aeecf347063733efa67dcb5c
2007-05-26T21:34:02.309037Z
9
andrew
has-props
75
ui.q3asm
file
2010-02-05T03:38:29.807623Z
d7c5e64b0b4812370af6a1ec4b46f34f
2007-05-26T21:34:02.309037Z
9
andrew
has-props
135
ui_public.h
file
2010-02-05T03:38:29.823248Z
70f0139b78358244f408d068ef67417e
2007-05-26T21:34:02.309037Z
9
andrew
has-props
3396
ui_atoms.c
file
2010-02-05T03:38:29.807623Z
4f3f70803f3b7aa5eaf043dccc1c1da5
2007-05-26T21:34:02.309037Z
9
andrew
has-props
13194
ui_main.c
file
2010-02-05T03:38:29.838873Z
2b887352e8cd287e4c66cbf346cfe1be
2007-05-26T21:34:02.309037Z
9
andrew
has-props
180146
ui.dsp
file
2010-02-05T03:38:29.823248Z
3cb11bbc123dfe68778d84b0f2a6a28c
2007-05-26T21:34:02.309037Z
9
andrew
has-props
15663
ui_gameinfo.c
file
2010-02-05T03:38:29.838873Z
ed7e0712b7e49ce3fc7030a3f43ba70f
2007-05-26T21:34:02.309037Z
9
andrew
has-props
6778
Conscript
file
2010-02-05T03:38:29.854498Z
e2ed69adf1ba62e69d0eaf825010c327
2007-05-26T21:34:02.309037Z
9
andrew
has-props
1721
ui_syscalls.asm
file
2010-02-05T03:38:29.854498Z
7513aa808dfacfcbee39ef20b04358bb
2007-05-26T21:34:02.309037Z
9
andrew
has-props
3092
ui.def
file
2010-02-05T03:38:29.870123Z
79d50412532073c2ccab7aec152672b8
2007-05-26T21:34:02.309037Z
9
andrew
has-props
26
ui_syscalls.c
file
2010-02-05T03:38:29.870123Z
1e5f96b1407762dcc3b043cea66f1527
2007-05-26T21:34:02.309037Z
9
andrew
has-props
10744
ui_local.h
file
2010-02-05T03:38:29.932623Z
c550aaab57b2a842402f4b82a34abe02
2007-05-26T21:34:02.309037Z
9
andrew
has-props
28907

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View File

@@ -0,0 +1,59 @@
# 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 );
$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 => 'gcc',
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';
}

View File

@@ -0,0 +1,2 @@
lcc -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1

View File

@@ -0,0 +1,143 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
#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

View File

@@ -0,0 +1,29 @@
mkdir vm
cd vm
set cc=lcc -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 ..

View File

@@ -0,0 +1,3 @@
EXPORTS
vmMain
dllEntry

View File

@@ -0,0 +1,641 @@
# Microsoft Developer Studio Project File - Name="ui" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=ui - Win32 Debug TA
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "ui.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "ui.mak" CFG="ui - Win32 Debug TA"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ui - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "ui - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "ui - Win32 Release TA" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "ui - Win32 Debug TA" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "ui - Win32 vector" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/MissionPack/code/ui", AOBAAAAA"
# PROP Scc_LocalPath "."
CPP=snCl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "ui - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=snBsc.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=snLink.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 /nologo /base:"0x40000000" /dll /map /machine:I386 /out:"../Release/uix86_new.dll"
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ui___Win32_Debug"
# PROP BASE Intermediate_Dir "ui___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=snBsc.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=snLink.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /base:"0x40000000" /dll /pdb:"../Debug/ui.pdb" /map /debug /machine:I386 /out:"../Debug/uix86_new.dll" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ui___Win32_Release_TA"
# PROP BASE Intermediate_Dir "ui___Win32_Release_TA"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release_TA"
# PROP Intermediate_Dir "Release_TA"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=snBsc.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=snLink.exe
# ADD BASE LINK32 /nologo /base:"0x40000000" /dll /map /machine:I386 /out:"../Release/uix86.dll"
# ADD LINK32 /nologo /base:"0x40000000" /dll /map /machine:I386 /out:"../Release_TA/uix86.dll"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ui___Win32_Debug_TA"
# PROP BASE Intermediate_Dir "ui___Win32_Debug_TA"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug_TA"
# PROP Intermediate_Dir "Debug_TA"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /FR /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /D "MISSIONPACK" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=snBsc.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=snLink.exe
# ADD BASE LINK32 /nologo /base:"0x40000000" /dll /pdb:"../Debug/ui.pdb" /map /debug /machine:I386 /out:"../Debug/uix86_new.dll" /pdbtype:sept
# SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 /nologo /base:"0x40000000" /dll /pdb:"../Debug/ui.pdb" /map /debug /machine:I386 /out:"../Debug_TA/uix86.dll" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "ui - Win32 vector"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ui___Win32_vector"
# PROP BASE Intermediate_Dir "ui___Win32_vector"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ui___Win32_vector"
# PROP Intermediate_Dir "ui___Win32_vector"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=snBsc.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=snLink.exe
# ADD BASE LINK32 /nologo /base:"0x40000000" /dll /map /machine:I386 /out:"../Release_TA/uix86.dll"
# ADD LINK32 /nologo /base:"0x40000000" /dll /map /machine:I386 /out:"../Release_TA/uix86.dll"
!ENDIF
# Begin Target
# Name "ui - Win32 Release"
# Name "ui - Win32 Debug"
# Name "ui - Win32 Release TA"
# Name "ui - Win32 Debug TA"
# Name "ui - Win32 vector"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\game\bg_lib.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
# PROP BASE Exclude_From_Build 1
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
# PROP BASE Exclude_From_Build 1
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 vector"
# PROP BASE Exclude_From_Build 1
# PROP Exclude_From_Build 1
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\game\bg_misc.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\game\q_math.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\game\q_shared.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui.def
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_atoms.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_gameinfo.c
!IF "$(CFG)" == "ui - Win32 Release"
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_main.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_players.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_shared.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_syscalls.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_util.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\game\bg_public.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\keycodes.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\ui\menudef.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\game\q_shared.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\game\surfaceflags.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\cgame\tr_types.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_local.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_public.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_shared.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,12 @@
-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

View File

@@ -0,0 +1,481 @@
<?xml version="1.0"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="ui"
SccProjectName="&quot;$/MissionPack/code/ui&quot;, AOBAAAAA"
SccAuxPath="\\Purgatory\Purgatory\idSourceControl"
SccLocalPath="."
SccProvider="MSSCCI:SourceSafe">
<Build>
<Settings>
<Platform
Name="Win32"/>
<Configuration
Name="Release TA|Win32"
IntermediateDirectory=".\Release_TA"
OutputDirectory=".\Release_TA"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCBscMakeTool"
SuppressStartupMessage="TRUE"
OutputFile=".\Release_TA/ui.bsc"/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
Defines="WIN32;NDEBUG;_WINDOWS;_USRDLL;UI_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="4"
PackageFunctions="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release_TA/ui.pch"
AsmListingLocation=".\Release_TA/"
ObjectFile=".\Release_TA/"
ProgramDataBaseFileName=".\Release_TA/"
WarnLevel="3"
SuppressStartupMessage="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalInputs="odbc32.lib odbccp32.lib"
OutputFile="../Release_TA/uix86.dll"
LinkIncremental="1"
SuppressStartupMessage="TRUE"
ModuleDefinitionFile=".\ui.def"
ProgramDatabaseFile=".\Release_TA/uix86.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Release_TA/uix86.map"
BaseAddress="0x40000000"
ImportLibrary=".\Release_TA/uix86.lib"/>
<Tool
Name="VCMIDLTool"
Defines="NDEBUG"
MkTypLibCompatibility="TRUE"
SuppressStartupMessage="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release_TA/ui.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Defines="NDEBUG"
Culture="1033"/>
<Tool
Name="VCSDLTool"/>
</Configuration>
<Configuration
Name="Debug TA|Win32"
IntermediateDirectory=".\Debug_TA"
OutputDirectory=".\Debug_TA"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCBscMakeTool"
SuppressStartupMessage="TRUE"
OutputFile=".\Debug_TA/ui.bsc"/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="1"
Defines="WIN32;_DEBUG;_WINDOWS;_USRDLL;UI_EXPORTS;MISSIONPACK"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug_TA/ui.pch"
AsmListingLocation=".\Debug_TA/"
ObjectFile=".\Debug_TA/"
ProgramDataBaseFileName=".\Debug_TA/"
BrowseInformation="1"
WarnLevel="3"
SuppressStartupMessage="TRUE"
DebugInformation="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalInputs="odbc32.lib odbccp32.lib"
OutputFile="../Debug_TA/uix86.dll"
LinkIncremental="2"
SuppressStartupMessage="TRUE"
ModuleDefinitionFile=".\ui.def"
GenerateDebug="TRUE"
ProgramDatabaseFile="../Debug/ui.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Debug_TA/uix86.map"
BaseAddress="0x40000000"
ImportLibrary=".\Debug_TA/uix86.lib"/>
<Tool
Name="VCMIDLTool"
Defines="_DEBUG"
MkTypLibCompatibility="TRUE"
SuppressStartupMessage="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug_TA/ui.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Defines="_DEBUG"
Culture="1033"/>
<Tool
Name="VCSDLTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
IntermediateDirectory=".\Release"
OutputDirectory=".\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCBscMakeTool"
SuppressStartupMessage="TRUE"
OutputFile=".\Release/ui.bsc"/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
Defines="WIN32;NDEBUG;_WINDOWS;_USRDLL;UI_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="4"
PackageFunctions="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/ui.pch"
AsmListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarnLevel="3"
SuppressStartupMessage="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalInputs="odbc32.lib odbccp32.lib"
OutputFile="../Release/uix86_new.dll"
LinkIncremental="1"
SuppressStartupMessage="TRUE"
ProgramDatabaseFile=".\Release/uix86_new.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Release/uix86_new.map"
BaseAddress="0x40000000"
ImportLibrary=".\Release/uix86_new.lib"/>
<Tool
Name="VCMIDLTool"
Defines="NDEBUG"
MkTypLibCompatibility="TRUE"
SuppressStartupMessage="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/ui.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Defines="NDEBUG"
Culture="1033"/>
<Tool
Name="VCSDLTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
IntermediateDirectory=".\Debug"
OutputDirectory=".\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCBscMakeTool"
SuppressStartupMessage="TRUE"
OutputFile=".\Debug/ui.bsc"/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="1"
Defines="WIN32;_DEBUG;_WINDOWS;_USRDLL;UI_EXPORTS"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/ui.pch"
AsmListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarnLevel="3"
SuppressStartupMessage="TRUE"
DebugInformation="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalInputs="odbc32.lib odbccp32.lib"
OutputFile="../Debug/uix86.dll"
LinkIncremental="2"
SuppressStartupMessage="TRUE"
GenerateDebug="TRUE"
ProgramDatabaseFile="../Debug/ui.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Debug/uix86_new.map"
BaseAddress="0x40000000"
ImportLibrary=".\Debug/uix86_new.lib"/>
<Tool
Name="VCMIDLTool"
Defines="_DEBUG"
MkTypLibCompatibility="TRUE"
SuppressStartupMessage="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/ui.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Defines="_DEBUG"
Culture="1033"/>
<Tool
Name="VCSDLTool"/>
</Configuration>
</Settings>
</Build>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\game\bg_lib.c">
<FileConfiguration
Name="Release TA|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug TA|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="..\game\bg_misc.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="..\game\q_math.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="..\game\q_shared.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui.def">
</File>
<File
RelativePath=".\ui_atoms.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_gameinfo.c">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_main.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_players.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_shared.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_syscalls.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_util.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\game\bg_public.h">
</File>
<File
RelativePath=".\keycodes.h">
</File>
<File
RelativePath="..\..\ui\menudef.h">
</File>
<File
RelativePath="..\game\q_shared.h">
</File>
<File
RelativePath="..\game\surfaceflags.h">
</File>
<File
RelativePath="..\cgame\tr_types.h">
</File>
<File
RelativePath=".\ui_local.h">
</File>
<File
RelativePath=".\ui_public.h">
</File>
<File
RelativePath=".\ui_shared.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,500 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
/**********************************************************************
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;
}

View File

@@ -0,0 +1,304 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
//
// 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, "<NULL>" );
}
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";
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,171 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
#ifndef __UI_PUBLIC_H__
#define __UI_PUBLIC_H__
#define UI_API_VERSION 6
typedef struct {
connstate_t connState;
int connectPacketCount;
int clientNum;
char servername[MAX_STRING_CHARS];
char updateInfoString[MAX_STRING_CHARS];
char messageString[MAX_STRING_CHARS];
} uiClientState_t;
typedef enum {
UI_ERROR,
UI_PRINT,
UI_MILLISECONDS,
UI_CVAR_SET,
UI_CVAR_VARIABLEVALUE,
UI_CVAR_VARIABLESTRINGBUFFER,
UI_CVAR_SETVALUE,
UI_CVAR_RESET,
UI_CVAR_CREATE,
UI_CVAR_INFOSTRINGBUFFER,
UI_ARGC,
UI_ARGV,
UI_CMD_EXECUTETEXT,
UI_FS_FOPENFILE,
UI_FS_READ,
UI_FS_WRITE,
UI_FS_FCLOSEFILE,
UI_FS_GETFILELIST,
UI_R_REGISTERMODEL,
UI_R_REGISTERSKIN,
UI_R_REGISTERSHADERNOMIP,
UI_R_CLEARSCENE,
UI_R_ADDREFENTITYTOSCENE,
UI_R_ADDPOLYTOSCENE,
UI_R_ADDLIGHTTOSCENE,
UI_R_RENDERSCENE,
UI_R_SETCOLOR,
UI_R_DRAWSTRETCHPIC,
UI_UPDATESCREEN,
UI_CM_LERPTAG,
UI_CM_LOADMODEL,
UI_S_REGISTERSOUND,
UI_S_STARTLOCALSOUND,
UI_KEY_KEYNUMTOSTRINGBUF,
UI_KEY_GETBINDINGBUF,
UI_KEY_SETBINDING,
UI_KEY_ISDOWN,
UI_KEY_GETOVERSTRIKEMODE,
UI_KEY_SETOVERSTRIKEMODE,
UI_KEY_CLEARSTATES,
UI_KEY_GETCATCHER,
UI_KEY_SETCATCHER,
UI_GETCLIPBOARDDATA,
UI_GETGLCONFIG,
UI_GETCLIENTSTATE,
UI_GETCONFIGSTRING,
UI_LAN_GETPINGQUEUECOUNT,
UI_LAN_CLEARPING,
UI_LAN_GETPING,
UI_LAN_GETPINGINFO,
UI_CVAR_REGISTER,
UI_CVAR_UPDATE,
UI_MEMORY_REMAINING,
UI_GET_CDKEY,
UI_SET_CDKEY,
UI_R_REGISTERFONT,
UI_R_MODELBOUNDS,
UI_PC_ADD_GLOBAL_DEFINE,
UI_PC_LOAD_SOURCE,
UI_PC_FREE_SOURCE,
UI_PC_READ_TOKEN,
UI_PC_SOURCE_FILE_AND_LINE,
UI_S_STOPBACKGROUNDTRACK,
UI_S_STARTBACKGROUNDTRACK,
UI_REAL_TIME,
UI_LAN_GETSERVERCOUNT,
UI_LAN_GETSERVERADDRESSSTRING,
UI_LAN_GETSERVERINFO,
UI_LAN_MARKSERVERVISIBLE,
UI_LAN_UPDATEVISIBLEPINGS,
UI_LAN_RESETPINGS,
UI_LAN_LOADCACHEDSERVERS,
UI_LAN_SAVECACHEDSERVERS,
UI_LAN_ADDSERVER,
UI_LAN_REMOVESERVER,
UI_CIN_PLAYCINEMATIC,
UI_CIN_STOPCINEMATIC,
UI_CIN_RUNCINEMATIC,
UI_CIN_DRAWCINEMATIC,
UI_CIN_SETEXTENTS,
UI_R_REMAP_SHADER,
UI_VERIFY_CDKEY,
UI_LAN_SERVERSTATUS,
UI_LAN_GETSERVERPING,
UI_LAN_SERVERISVISIBLE,
UI_LAN_COMPARESERVERS,
// 1.32
UI_FS_SEEK,
UI_SET_PBCLSTATUS,
UI_MEMSET = 100,
UI_MEMCPY,
UI_STRNCPY,
UI_SIN,
UI_COS,
UI_ATAN2,
UI_SQRT,
UI_FLOOR,
UI_CEIL
} uiImport_t;
typedef enum {
UIMENU_NONE,
UIMENU_MAIN,
UIMENU_INGAME,
UIMENU_NEED_CD,
UIMENU_BAD_CD_KEY,
UIMENU_TEAM,
UIMENU_POSTGAME
} uiMenuCommand_t;
#define SORT_HOST 0
#define SORT_MAP 1
#define SORT_CLIENTS 2
#define SORT_GAME 3
#define SORT_PING 4
#define SORT_PUNKBUSTER 5
typedef enum {
UI_GETAPIVERSION = 0, // system reserved
UI_INIT,
// void UI_Init( void );
UI_SHUTDOWN,
// void UI_Shutdown( void );
UI_KEY_EVENT,
// void UI_KeyEvent( int key );
UI_MOUSE_EVENT,
// void UI_MouseEvent( int dx, int dy );
UI_REFRESH,
// void UI_Refresh( int time );
UI_IS_FULLSCREEN,
// qboolean UI_IsFullscreen( void );
UI_SET_ACTIVE_MENU,
// void UI_SetActiveMenu( uiMenuCommand_t menu );
UI_CONSOLE_COMMAND,
// qboolean UI_ConsoleCommand( int realTime );
UI_DRAW_CONNECT_SCREEN,
// void UI_DrawConnectScreen( qboolean overlay );
UI_HASUNIQUECDKEY
// if !overlay, the background will be drawn, otherwise it will be
// overlayed over whatever the cgame has drawn.
// a GetClientState syscall will be made to get the current strings
} uiExport_t;
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,429 @@
#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

View File

@@ -0,0 +1,101 @@
code
equ trap_Error -1
equ trap_Print -2
equ trap_Milliseconds -3
equ trap_Cvar_Set -4
equ trap_Cvar_VariableValue -5
equ trap_Cvar_VariableStringBuffer -6
equ trap_Cvar_SetValue -7
equ trap_Cvar_Reset -8
equ trap_Cvar_Create -9
equ trap_Cvar_InfoStringBuffer -10
equ trap_Argc -11
equ trap_Argv -12
equ trap_Cmd_ExecuteText -13
equ trap_FS_FOpenFile -14
equ trap_FS_Read -15
equ trap_FS_Write -16
equ trap_FS_FCloseFile -17
equ trap_FS_GetFileList -18
equ trap_R_RegisterModel -19
equ trap_R_RegisterSkin -20
equ trap_R_RegisterShaderNoMip -21
equ trap_R_ClearScene -22
equ trap_R_AddRefEntityToScene -23
equ trap_R_AddPolyToScene -24
equ trap_R_AddLightToScene -25
equ trap_R_RenderScene -26
equ trap_R_SetColor -27
equ trap_R_DrawStretchPic -28
equ trap_UpdateScreen -29
equ trap_CM_LerpTag -30
equ trap_CM_LoadModel -31
equ trap_S_RegisterSound -32
equ trap_S_StartLocalSound -33
equ trap_Key_KeynumToStringBuf -34
equ trap_Key_GetBindingBuf -35
equ trap_Key_SetBinding -36
equ trap_Key_IsDown -37
equ trap_Key_GetOverstrikeMode -38
equ trap_Key_SetOverstrikeMode -39
equ trap_Key_ClearStates -40
equ trap_Key_GetCatcher -41
equ trap_Key_SetCatcher -42
equ trap_GetClipboardData -43
equ trap_GetGlconfig -44
equ trap_GetClientState -45
equ trap_GetConfigString -46
equ trap_LAN_GetPingQueueCount -47
equ trap_LAN_ClearPing -48
equ trap_LAN_GetPing -49
equ trap_LAN_GetPingInfo -50
equ trap_Cvar_Register -51
equ trap_Cvar_Update -52
equ trap_MemoryRemaining -53
equ trap_GetCDKey -54
equ trap_SetCDKey -55
equ trap_R_RegisterFont -56
equ trap_R_ModelBounds -57
equ trap_PC_AddGlobalDefine -58
equ trap_PC_LoadSource -59
equ trap_PC_FreeSource -60
equ trap_PC_ReadToken -61
equ trap_PC_SourceFileAndLine -62
equ trap_S_StopBackgroundTrack -63
equ trap_S_StartBackgroundTrack -64
equ trap_RealTime -65
equ trap_LAN_GetServerCount -66
equ trap_LAN_GetServerAddressString -67
equ trap_LAN_GetServerInfo -68
equ trap_LAN_MarkServerVisible -69
equ trap_LAN_UpdateVisiblePings -70
equ trap_LAN_ResetPings -71
equ trap_LAN_LoadCachedServers -72
equ trap_LAN_SaveCachedServers -73
equ trap_LAN_AddServer -74
equ trap_LAN_RemoveServer -75
equ trap_CIN_PlayCinematic -76
equ trap_CIN_StopCinematic -77
equ trap_CIN_RunCinematic -78
equ trap_CIN_DrawCinematic -79
equ trap_CIN_SetExtents -80
equ trap_R_RemapShader -81
equ trap_VerifyCDKey -82
equ trap_LAN_ServerStatus -83
equ trap_LAN_GetServerPing -84
equ trap_LAN_ServerIsVisible -85
equ trap_LAN_CompareServers -86
equ trap_FS_Seek -87
equ trap_SetPbClStatus -88
equ memset -101
equ memcpy -102
equ strncpy -103
equ sin -104
equ cos -105
equ atan2 -106
equ sqrt -107
equ floor -108
equ ceil -109

View File

@@ -0,0 +1,378 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
#include "ui_local.h"
// this file is only included when building a dll
// syscalls.asm is included instead when building a qvm
static int (QDECL *syscall)( int arg, ... ) = (int (QDECL *)( int, ...))-1;
void dllEntry( int (QDECL *syscallptr)( int arg,... ) ) {
syscall = syscallptr;
}
int PASSFLOAT( float x ) {
float floatTemp;
floatTemp = x;
return *(int *)&floatTemp;
}
void trap_Print( const char *string ) {
syscall( UI_PRINT, string );
}
void trap_Error( const char *string ) {
syscall( UI_ERROR, string );
}
int trap_Milliseconds( void ) {
return syscall( UI_MILLISECONDS );
}
void trap_Cvar_Register( vmCvar_t *cvar, const char *var_name, const char *value, int flags ) {
syscall( UI_CVAR_REGISTER, cvar, var_name, value, flags );
}
void trap_Cvar_Update( vmCvar_t *cvar ) {
syscall( UI_CVAR_UPDATE, cvar );
}
void trap_Cvar_Set( const char *var_name, const char *value ) {
syscall( UI_CVAR_SET, var_name, value );
}
float trap_Cvar_VariableValue( const char *var_name ) {
int temp;
temp = syscall( UI_CVAR_VARIABLEVALUE, var_name );
return (*(float*)&temp);
}
void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ) {
syscall( UI_CVAR_VARIABLESTRINGBUFFER, var_name, buffer, bufsize );
}
void trap_Cvar_SetValue( const char *var_name, float value ) {
syscall( UI_CVAR_SETVALUE, var_name, PASSFLOAT( value ) );
}
void trap_Cvar_Reset( const char *name ) {
syscall( UI_CVAR_RESET, name );
}
void trap_Cvar_Create( const char *var_name, const char *var_value, int flags ) {
syscall( UI_CVAR_CREATE, var_name, var_value, flags );
}
void trap_Cvar_InfoStringBuffer( int bit, char *buffer, int bufsize ) {
syscall( UI_CVAR_INFOSTRINGBUFFER, bit, buffer, bufsize );
}
int trap_Argc( void ) {
return syscall( UI_ARGC );
}
void trap_Argv( int n, char *buffer, int bufferLength ) {
syscall( UI_ARGV, n, buffer, bufferLength );
}
void trap_Cmd_ExecuteText( int exec_when, const char *text ) {
syscall( UI_CMD_EXECUTETEXT, exec_when, text );
}
int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode ) {
return syscall( UI_FS_FOPENFILE, qpath, f, mode );
}
void trap_FS_Read( void *buffer, int len, fileHandle_t f ) {
syscall( UI_FS_READ, buffer, len, f );
}
void trap_FS_Write( const void *buffer, int len, fileHandle_t f ) {
syscall( UI_FS_WRITE, buffer, len, f );
}
void trap_FS_FCloseFile( fileHandle_t f ) {
syscall( UI_FS_FCLOSEFILE, f );
}
int trap_FS_GetFileList( const char *path, const char *extension, char *listbuf, int bufsize ) {
return syscall( UI_FS_GETFILELIST, path, extension, listbuf, bufsize );
}
int trap_FS_Seek( fileHandle_t f, long offset, int origin ) {
return syscall( UI_FS_SEEK, f, offset, origin );
}
qhandle_t trap_R_RegisterModel( const char *name ) {
return syscall( UI_R_REGISTERMODEL, name );
}
qhandle_t trap_R_RegisterSkin( const char *name ) {
return syscall( UI_R_REGISTERSKIN, name );
}
void trap_R_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) {
syscall( UI_R_REGISTERFONT, fontName, pointSize, font );
}
qhandle_t trap_R_RegisterShaderNoMip( const char *name ) {
return syscall( UI_R_REGISTERSHADERNOMIP, name );
}
void trap_R_ClearScene( void ) {
syscall( UI_R_CLEARSCENE );
}
void trap_R_AddRefEntityToScene( const refEntity_t *re ) {
syscall( UI_R_ADDREFENTITYTOSCENE, re );
}
void trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts ) {
syscall( UI_R_ADDPOLYTOSCENE, hShader, numVerts, verts );
}
void trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b ) {
syscall( UI_R_ADDLIGHTTOSCENE, org, PASSFLOAT(intensity), PASSFLOAT(r), PASSFLOAT(g), PASSFLOAT(b) );
}
void trap_R_RenderScene( const refdef_t *fd ) {
syscall( UI_R_RENDERSCENE, fd );
}
void trap_R_SetColor( const float *rgba ) {
syscall( UI_R_SETCOLOR, rgba );
}
void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ) {
syscall( UI_R_DRAWSTRETCHPIC, PASSFLOAT(x), PASSFLOAT(y), PASSFLOAT(w), PASSFLOAT(h), PASSFLOAT(s1), PASSFLOAT(t1), PASSFLOAT(s2), PASSFLOAT(t2), hShader );
}
void trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs ) {
syscall( UI_R_MODELBOUNDS, model, mins, maxs );
}
void trap_UpdateScreen( void ) {
syscall( UI_UPDATESCREEN );
}
int trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName ) {
return syscall( UI_CM_LERPTAG, tag, mod, startFrame, endFrame, PASSFLOAT(frac), tagName );
}
void trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum ) {
syscall( UI_S_STARTLOCALSOUND, sfx, channelNum );
}
sfxHandle_t trap_S_RegisterSound( const char *sample, qboolean compressed ) {
return syscall( UI_S_REGISTERSOUND, sample, compressed );
}
void trap_Key_KeynumToStringBuf( int keynum, char *buf, int buflen ) {
syscall( UI_KEY_KEYNUMTOSTRINGBUF, keynum, buf, buflen );
}
void trap_Key_GetBindingBuf( int keynum, char *buf, int buflen ) {
syscall( UI_KEY_GETBINDINGBUF, keynum, buf, buflen );
}
void trap_Key_SetBinding( int keynum, const char *binding ) {
syscall( UI_KEY_SETBINDING, keynum, binding );
}
qboolean trap_Key_IsDown( int keynum ) {
return syscall( UI_KEY_ISDOWN, keynum );
}
qboolean trap_Key_GetOverstrikeMode( void ) {
return syscall( UI_KEY_GETOVERSTRIKEMODE );
}
void trap_Key_SetOverstrikeMode( qboolean state ) {
syscall( UI_KEY_SETOVERSTRIKEMODE, state );
}
void trap_Key_ClearStates( void ) {
syscall( UI_KEY_CLEARSTATES );
}
int trap_Key_GetCatcher( void ) {
return syscall( UI_KEY_GETCATCHER );
}
void trap_Key_SetCatcher( int catcher ) {
syscall( UI_KEY_SETCATCHER, catcher );
}
void trap_GetClipboardData( char *buf, int bufsize ) {
syscall( UI_GETCLIPBOARDDATA, buf, bufsize );
}
void trap_GetClientState( uiClientState_t *state ) {
syscall( UI_GETCLIENTSTATE, state );
}
void trap_GetGlconfig( glconfig_t *glconfig ) {
syscall( UI_GETGLCONFIG, glconfig );
}
int trap_GetConfigString( int index, char* buff, int buffsize ) {
return syscall( UI_GETCONFIGSTRING, index, buff, buffsize );
}
int trap_LAN_GetServerCount( int source ) {
return syscall( UI_LAN_GETSERVERCOUNT, source );
}
void trap_LAN_GetServerAddressString( int source, int n, char *buf, int buflen ) {
syscall( UI_LAN_GETSERVERADDRESSSTRING, source, n, buf, buflen );
}
void trap_LAN_GetServerInfo( int source, int n, char *buf, int buflen ) {
syscall( UI_LAN_GETSERVERINFO, source, n, buf, buflen );
}
int trap_LAN_GetServerPing( int source, int n ) {
return syscall( UI_LAN_GETSERVERPING, source, n );
}
int trap_LAN_GetPingQueueCount( void ) {
return syscall( UI_LAN_GETPINGQUEUECOUNT );
}
int trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int maxLen ) {
return syscall( UI_LAN_SERVERSTATUS, serverAddress, serverStatus, maxLen );
}
void trap_LAN_SaveCachedServers() {
syscall( UI_LAN_SAVECACHEDSERVERS );
}
void trap_LAN_LoadCachedServers() {
syscall( UI_LAN_LOADCACHEDSERVERS );
}
void trap_LAN_ResetPings(int n) {
syscall( UI_LAN_RESETPINGS, n );
}
void trap_LAN_ClearPing( int n ) {
syscall( UI_LAN_CLEARPING, n );
}
void trap_LAN_GetPing( int n, char *buf, int buflen, int *pingtime ) {
syscall( UI_LAN_GETPING, n, buf, buflen, pingtime );
}
void trap_LAN_GetPingInfo( int n, char *buf, int buflen ) {
syscall( UI_LAN_GETPINGINFO, n, buf, buflen );
}
void trap_LAN_MarkServerVisible( int source, int n, qboolean visible ) {
syscall( UI_LAN_MARKSERVERVISIBLE, source, n, visible );
}
int trap_LAN_ServerIsVisible( int source, int n) {
return syscall( UI_LAN_SERVERISVISIBLE, source, n );
}
qboolean trap_LAN_UpdateVisiblePings( int source ) {
return syscall( UI_LAN_UPDATEVISIBLEPINGS, source );
}
int trap_LAN_AddServer(int source, const char *name, const char *addr) {
return syscall( UI_LAN_ADDSERVER, source, name, addr );
}
void trap_LAN_RemoveServer(int source, const char *addr) {
syscall( UI_LAN_REMOVESERVER, source, addr );
}
int trap_LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int s2 ) {
return syscall( UI_LAN_COMPARESERVERS, source, sortKey, sortDir, s1, s2 );
}
int trap_MemoryRemaining( void ) {
return syscall( UI_MEMORY_REMAINING );
}
void trap_GetCDKey( char *buf, int buflen ) {
syscall( UI_GET_CDKEY, buf, buflen );
}
void trap_SetCDKey( char *buf ) {
syscall( UI_SET_CDKEY, buf );
}
int trap_PC_AddGlobalDefine( char *define ) {
return syscall( UI_PC_ADD_GLOBAL_DEFINE, define );
}
int trap_PC_LoadSource( const char *filename ) {
return syscall( UI_PC_LOAD_SOURCE, filename );
}
int trap_PC_FreeSource( int handle ) {
return syscall( UI_PC_FREE_SOURCE, handle );
}
int trap_PC_ReadToken( int handle, pc_token_t *pc_token ) {
return syscall( UI_PC_READ_TOKEN, handle, pc_token );
}
int trap_PC_SourceFileAndLine( int handle, char *filename, int *line ) {
return syscall( UI_PC_SOURCE_FILE_AND_LINE, handle, filename, line );
}
void trap_S_StopBackgroundTrack( void ) {
syscall( UI_S_STOPBACKGROUNDTRACK );
}
void trap_S_StartBackgroundTrack( const char *intro, const char *loop) {
syscall( UI_S_STARTBACKGROUNDTRACK, intro, loop );
}
int trap_RealTime(qtime_t *qtime) {
return syscall( UI_REAL_TIME, qtime );
}
// this returns a handle. arg0 is the name in the format "idlogo.roq", set arg1 to NULL, alteredstates to qfalse (do not alter gamestate)
int trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits) {
return syscall(UI_CIN_PLAYCINEMATIC, arg0, xpos, ypos, width, height, bits);
}
// stops playing the cinematic and ends it. should always return FMV_EOF
// cinematics must be stopped in reverse order of when they are started
e_status trap_CIN_StopCinematic(int handle) {
return syscall(UI_CIN_STOPCINEMATIC, handle);
}
// will run a frame of the cinematic but will not draw it. Will return FMV_EOF if the end of the cinematic has been reached.
e_status trap_CIN_RunCinematic (int handle) {
return syscall(UI_CIN_RUNCINEMATIC, handle);
}
// draws the current frame
void trap_CIN_DrawCinematic (int handle) {
syscall(UI_CIN_DRAWCINEMATIC, handle);
}
// allows you to resize the animation dynamically
void trap_CIN_SetExtents (int handle, int x, int y, int w, int h) {
syscall(UI_CIN_SETEXTENTS, handle, x, y, w, h);
}
void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ) {
syscall( UI_R_REMAP_SHADER, oldShader, newShader, timeOffset );
}
qboolean trap_VerifyCDKey( const char *key, const char *chksum) {
return syscall( UI_VERIFY_CDKEY, key, chksum);
}
void trap_SetPbClStatus( int status ) {
syscall( UI_SET_PBCLSTATUS, status );
}

View File

@@ -0,0 +1,8 @@
// ui_util.c
//
// origin: rad
// new ui support stuff
//
// memory, string alloc

23
code/ui/CVS/.svn/all-wcprops Executable file
View File

@@ -0,0 +1,23 @@
K 25
svn:wc:ra_dav:version-url
V 49
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/CVS
END
Repository
K 25
svn:wc:ra_dav:version-url
V 60
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/CVS/Repository
END
Root
K 25
svn:wc:ra_dav:version-url
V 54
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/CVS/Root
END
Entries
K 25
svn:wc:ra_dav:version-url
V 57
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/ui/CVS/Entries
END

130
code/ui/CVS/.svn/entries Executable file
View File

@@ -0,0 +1,130 @@
10
dir
44
https://127.0.0.1/svn/aklabs/trunk/hypermod/code/ui/CVS
https://127.0.0.1/svn/aklabs
2007-05-26T21:34:02.309037Z
9
andrew
eb184899-6090-47d4-a65b-558f62f6ea1c
Repository
file
2010-02-05T03:38:29.354498Z
1a001dae28760f2e63d769084df7b568
2007-05-26T21:34:02.309037Z
9
andrew
30
Root
file
2010-02-05T03:38:29.354498Z
7af14a164593104c1e7a07a572dd352a
2007-05-26T21:34:02.309037Z
9
andrew
24
Entries
file
2010-02-05T03:38:29.354498Z
495c5b36aa7333ad52ee9721e2ed5e5a
2007-05-26T21:34:02.309037Z
9
andrew
894

View File

@@ -0,0 +1,20 @@
/Conscript/1.1.1.1/Sat Dec 31 23:57:16 2005//
/compile.bat/1.1.1.1/Sat Dec 31 23:57:16 2005//
/keycodes.h/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui.bat/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui.def/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui.dsp/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui.q3asm/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui.vcproj/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_atoms.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_gameinfo.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_local.h/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_main.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_players.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_public.h/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_shared.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_shared.h/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_syscalls.asm/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_syscalls.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_util.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
D

View File

@@ -0,0 +1 @@
games/quake3/hypermod/code/ui

View File

@@ -0,0 +1 @@
andrew@gabbo:/home/cvsd

20
code/ui/CVS/Entries Executable file
View File

@@ -0,0 +1,20 @@
/Conscript/1.1.1.1/Sat Dec 31 23:57:16 2005//
/compile.bat/1.1.1.1/Sat Dec 31 23:57:16 2005//
/keycodes.h/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui.bat/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui.def/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui.dsp/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui.q3asm/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui.vcproj/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_atoms.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_gameinfo.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_local.h/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_main.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_players.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_public.h/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_shared.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_shared.h/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_syscalls.asm/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_syscalls.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
/ui_util.c/1.1.1.1/Sat Dec 31 23:57:16 2005//
D

1
code/ui/CVS/Repository Executable file
View File

@@ -0,0 +1 @@
games/quake3/hypermod/code/ui

1
code/ui/CVS/Root Executable file
View File

@@ -0,0 +1 @@
andrew@gabbo:/home/cvsd

59
code/ui/Conscript Executable file
View File

@@ -0,0 +1,59 @@
# 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 );
$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 => 'gcc',
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';
}

2
code/ui/compile.bat Executable file
View File

@@ -0,0 +1,2 @@
lcc -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1

143
code/ui/keycodes.h Executable file
View File

@@ -0,0 +1,143 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
#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

29
code/ui/ui.bat Executable file
View File

@@ -0,0 +1,29 @@
mkdir vm
cd vm
set cc=lcc -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 ..

3
code/ui/ui.def Executable file
View File

@@ -0,0 +1,3 @@
EXPORTS
vmMain
dllEntry

641
code/ui/ui.dsp Executable file
View File

@@ -0,0 +1,641 @@
# Microsoft Developer Studio Project File - Name="ui" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=ui - Win32 Debug TA
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "ui.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "ui.mak" CFG="ui - Win32 Debug TA"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ui - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "ui - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "ui - Win32 Release TA" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "ui - Win32 Debug TA" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "ui - Win32 vector" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/MissionPack/code/ui", AOBAAAAA"
# PROP Scc_LocalPath "."
CPP=snCl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "ui - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=snBsc.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=snLink.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 /nologo /base:"0x40000000" /dll /map /machine:I386 /out:"../Release/uix86_new.dll"
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ui___Win32_Debug"
# PROP BASE Intermediate_Dir "ui___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=snBsc.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=snLink.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /base:"0x40000000" /dll /pdb:"../Debug/ui.pdb" /map /debug /machine:I386 /out:"../Debug/uix86_new.dll" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ui___Win32_Release_TA"
# PROP BASE Intermediate_Dir "ui___Win32_Release_TA"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release_TA"
# PROP Intermediate_Dir "Release_TA"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=snBsc.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=snLink.exe
# ADD BASE LINK32 /nologo /base:"0x40000000" /dll /map /machine:I386 /out:"../Release/uix86.dll"
# ADD LINK32 /nologo /base:"0x40000000" /dll /map /machine:I386 /out:"../Release_TA/uix86.dll"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ui___Win32_Debug_TA"
# PROP BASE Intermediate_Dir "ui___Win32_Debug_TA"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug_TA"
# PROP Intermediate_Dir "Debug_TA"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /FR /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /D "MISSIONPACK" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=snBsc.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=snLink.exe
# ADD BASE LINK32 /nologo /base:"0x40000000" /dll /pdb:"../Debug/ui.pdb" /map /debug /machine:I386 /out:"../Debug/uix86_new.dll" /pdbtype:sept
# SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 /nologo /base:"0x40000000" /dll /pdb:"../Debug/ui.pdb" /map /debug /machine:I386 /out:"../Debug_TA/uix86.dll" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "ui - Win32 vector"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ui___Win32_vector"
# PROP BASE Intermediate_Dir "ui___Win32_vector"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ui___Win32_vector"
# PROP Intermediate_Dir "ui___Win32_vector"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=snBsc.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=snLink.exe
# ADD BASE LINK32 /nologo /base:"0x40000000" /dll /map /machine:I386 /out:"../Release_TA/uix86.dll"
# ADD LINK32 /nologo /base:"0x40000000" /dll /map /machine:I386 /out:"../Release_TA/uix86.dll"
!ENDIF
# Begin Target
# Name "ui - Win32 Release"
# Name "ui - Win32 Debug"
# Name "ui - Win32 Release TA"
# Name "ui - Win32 Debug TA"
# Name "ui - Win32 vector"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\game\bg_lib.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
# PROP BASE Exclude_From_Build 1
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
# PROP BASE Exclude_From_Build 1
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 vector"
# PROP BASE Exclude_From_Build 1
# PROP Exclude_From_Build 1
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\game\bg_misc.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\game\q_math.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\game\q_shared.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui.def
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_atoms.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_gameinfo.c
!IF "$(CFG)" == "ui - Win32 Release"
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_main.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_players.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_shared.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_syscalls.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_util.c
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\game\bg_public.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\keycodes.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\ui\menudef.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\game\q_shared.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\game\surfaceflags.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\cgame\tr_types.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_local.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_public.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ui_shared.h
!IF "$(CFG)" == "ui - Win32 Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "ui - Win32 Release TA"
!ELSEIF "$(CFG)" == "ui - Win32 Debug TA"
!ELSEIF "$(CFG)" == "ui - Win32 vector"
!ENDIF
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

12
code/ui/ui.q3asm Executable file
View File

@@ -0,0 +1,12 @@
-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

481
code/ui/ui.vcproj Executable file
View File

@@ -0,0 +1,481 @@
<?xml version="1.0"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="ui"
SccProjectName="&quot;$/MissionPack/code/ui&quot;, AOBAAAAA"
SccAuxPath="\\Purgatory\Purgatory\idSourceControl"
SccLocalPath="."
SccProvider="MSSCCI:SourceSafe">
<Build>
<Settings>
<Platform
Name="Win32"/>
<Configuration
Name="Release TA|Win32"
IntermediateDirectory=".\Release_TA"
OutputDirectory=".\Release_TA"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCBscMakeTool"
SuppressStartupMessage="TRUE"
OutputFile=".\Release_TA/ui.bsc"/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
Defines="WIN32;NDEBUG;_WINDOWS;_USRDLL;UI_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="4"
PackageFunctions="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release_TA/ui.pch"
AsmListingLocation=".\Release_TA/"
ObjectFile=".\Release_TA/"
ProgramDataBaseFileName=".\Release_TA/"
WarnLevel="3"
SuppressStartupMessage="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalInputs="odbc32.lib odbccp32.lib"
OutputFile="../Release_TA/uix86.dll"
LinkIncremental="1"
SuppressStartupMessage="TRUE"
ModuleDefinitionFile=".\ui.def"
ProgramDatabaseFile=".\Release_TA/uix86.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Release_TA/uix86.map"
BaseAddress="0x40000000"
ImportLibrary=".\Release_TA/uix86.lib"/>
<Tool
Name="VCMIDLTool"
Defines="NDEBUG"
MkTypLibCompatibility="TRUE"
SuppressStartupMessage="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release_TA/ui.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Defines="NDEBUG"
Culture="1033"/>
<Tool
Name="VCSDLTool"/>
</Configuration>
<Configuration
Name="Debug TA|Win32"
IntermediateDirectory=".\Debug_TA"
OutputDirectory=".\Debug_TA"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCBscMakeTool"
SuppressStartupMessage="TRUE"
OutputFile=".\Debug_TA/ui.bsc"/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="1"
Defines="WIN32;_DEBUG;_WINDOWS;_USRDLL;UI_EXPORTS;MISSIONPACK"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug_TA/ui.pch"
AsmListingLocation=".\Debug_TA/"
ObjectFile=".\Debug_TA/"
ProgramDataBaseFileName=".\Debug_TA/"
BrowseInformation="1"
WarnLevel="3"
SuppressStartupMessage="TRUE"
DebugInformation="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalInputs="odbc32.lib odbccp32.lib"
OutputFile="../Debug_TA/uix86.dll"
LinkIncremental="2"
SuppressStartupMessage="TRUE"
ModuleDefinitionFile=".\ui.def"
GenerateDebug="TRUE"
ProgramDatabaseFile="../Debug/ui.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Debug_TA/uix86.map"
BaseAddress="0x40000000"
ImportLibrary=".\Debug_TA/uix86.lib"/>
<Tool
Name="VCMIDLTool"
Defines="_DEBUG"
MkTypLibCompatibility="TRUE"
SuppressStartupMessage="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug_TA/ui.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Defines="_DEBUG"
Culture="1033"/>
<Tool
Name="VCSDLTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
IntermediateDirectory=".\Release"
OutputDirectory=".\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCBscMakeTool"
SuppressStartupMessage="TRUE"
OutputFile=".\Release/ui.bsc"/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
Defines="WIN32;NDEBUG;_WINDOWS;_USRDLL;UI_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="4"
PackageFunctions="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/ui.pch"
AsmListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarnLevel="3"
SuppressStartupMessage="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalInputs="odbc32.lib odbccp32.lib"
OutputFile="../Release/uix86_new.dll"
LinkIncremental="1"
SuppressStartupMessage="TRUE"
ProgramDatabaseFile=".\Release/uix86_new.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Release/uix86_new.map"
BaseAddress="0x40000000"
ImportLibrary=".\Release/uix86_new.lib"/>
<Tool
Name="VCMIDLTool"
Defines="NDEBUG"
MkTypLibCompatibility="TRUE"
SuppressStartupMessage="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/ui.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Defines="NDEBUG"
Culture="1033"/>
<Tool
Name="VCSDLTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
IntermediateDirectory=".\Debug"
OutputDirectory=".\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCBscMakeTool"
SuppressStartupMessage="TRUE"
OutputFile=".\Debug/ui.bsc"/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="1"
Defines="WIN32;_DEBUG;_WINDOWS;_USRDLL;UI_EXPORTS"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/ui.pch"
AsmListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarnLevel="3"
SuppressStartupMessage="TRUE"
DebugInformation="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalInputs="odbc32.lib odbccp32.lib"
OutputFile="../Debug/uix86.dll"
LinkIncremental="2"
SuppressStartupMessage="TRUE"
GenerateDebug="TRUE"
ProgramDatabaseFile="../Debug/ui.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Debug/uix86_new.map"
BaseAddress="0x40000000"
ImportLibrary=".\Debug/uix86_new.lib"/>
<Tool
Name="VCMIDLTool"
Defines="_DEBUG"
MkTypLibCompatibility="TRUE"
SuppressStartupMessage="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/ui.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Defines="_DEBUG"
Culture="1033"/>
<Tool
Name="VCSDLTool"/>
</Configuration>
</Settings>
</Build>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\game\bg_lib.c">
<FileConfiguration
Name="Release TA|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug TA|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="..\game\bg_misc.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="..\game\q_math.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="..\game\q_shared.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui.def">
</File>
<File
RelativePath=".\ui_atoms.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_gameinfo.c">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_main.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_players.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_shared.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_syscalls.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\ui_util.c">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\game\bg_public.h">
</File>
<File
RelativePath=".\keycodes.h">
</File>
<File
RelativePath="..\..\ui\menudef.h">
</File>
<File
RelativePath="..\game\q_shared.h">
</File>
<File
RelativePath="..\game\surfaceflags.h">
</File>
<File
RelativePath="..\cgame\tr_types.h">
</File>
<File
RelativePath=".\ui_local.h">
</File>
<File
RelativePath=".\ui_public.h">
</File>
<File
RelativePath=".\ui_shared.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

500
code/ui/ui_atoms.c Executable file
View File

@@ -0,0 +1,500 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
/**********************************************************************
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;
}

304
code/ui/ui_gameinfo.c Executable file
View File

@@ -0,0 +1,304 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
//
// 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, "<NULL>" );
}
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";
}

1116
code/ui/ui_local.h Executable file

File diff suppressed because it is too large Load Diff

5977
code/ui/ui_main.c Executable file

File diff suppressed because it is too large Load Diff

1358
code/ui/ui_players.c Executable file

File diff suppressed because it is too large Load Diff

171
code/ui/ui_public.h Executable file
View File

@@ -0,0 +1,171 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
#ifndef __UI_PUBLIC_H__
#define __UI_PUBLIC_H__
#define UI_API_VERSION 6
typedef struct {
connstate_t connState;
int connectPacketCount;
int clientNum;
char servername[MAX_STRING_CHARS];
char updateInfoString[MAX_STRING_CHARS];
char messageString[MAX_STRING_CHARS];
} uiClientState_t;
typedef enum {
UI_ERROR,
UI_PRINT,
UI_MILLISECONDS,
UI_CVAR_SET,
UI_CVAR_VARIABLEVALUE,
UI_CVAR_VARIABLESTRINGBUFFER,
UI_CVAR_SETVALUE,
UI_CVAR_RESET,
UI_CVAR_CREATE,
UI_CVAR_INFOSTRINGBUFFER,
UI_ARGC,
UI_ARGV,
UI_CMD_EXECUTETEXT,
UI_FS_FOPENFILE,
UI_FS_READ,
UI_FS_WRITE,
UI_FS_FCLOSEFILE,
UI_FS_GETFILELIST,
UI_R_REGISTERMODEL,
UI_R_REGISTERSKIN,
UI_R_REGISTERSHADERNOMIP,
UI_R_CLEARSCENE,
UI_R_ADDREFENTITYTOSCENE,
UI_R_ADDPOLYTOSCENE,
UI_R_ADDLIGHTTOSCENE,
UI_R_RENDERSCENE,
UI_R_SETCOLOR,
UI_R_DRAWSTRETCHPIC,
UI_UPDATESCREEN,
UI_CM_LERPTAG,
UI_CM_LOADMODEL,
UI_S_REGISTERSOUND,
UI_S_STARTLOCALSOUND,
UI_KEY_KEYNUMTOSTRINGBUF,
UI_KEY_GETBINDINGBUF,
UI_KEY_SETBINDING,
UI_KEY_ISDOWN,
UI_KEY_GETOVERSTRIKEMODE,
UI_KEY_SETOVERSTRIKEMODE,
UI_KEY_CLEARSTATES,
UI_KEY_GETCATCHER,
UI_KEY_SETCATCHER,
UI_GETCLIPBOARDDATA,
UI_GETGLCONFIG,
UI_GETCLIENTSTATE,
UI_GETCONFIGSTRING,
UI_LAN_GETPINGQUEUECOUNT,
UI_LAN_CLEARPING,
UI_LAN_GETPING,
UI_LAN_GETPINGINFO,
UI_CVAR_REGISTER,
UI_CVAR_UPDATE,
UI_MEMORY_REMAINING,
UI_GET_CDKEY,
UI_SET_CDKEY,
UI_R_REGISTERFONT,
UI_R_MODELBOUNDS,
UI_PC_ADD_GLOBAL_DEFINE,
UI_PC_LOAD_SOURCE,
UI_PC_FREE_SOURCE,
UI_PC_READ_TOKEN,
UI_PC_SOURCE_FILE_AND_LINE,
UI_S_STOPBACKGROUNDTRACK,
UI_S_STARTBACKGROUNDTRACK,
UI_REAL_TIME,
UI_LAN_GETSERVERCOUNT,
UI_LAN_GETSERVERADDRESSSTRING,
UI_LAN_GETSERVERINFO,
UI_LAN_MARKSERVERVISIBLE,
UI_LAN_UPDATEVISIBLEPINGS,
UI_LAN_RESETPINGS,
UI_LAN_LOADCACHEDSERVERS,
UI_LAN_SAVECACHEDSERVERS,
UI_LAN_ADDSERVER,
UI_LAN_REMOVESERVER,
UI_CIN_PLAYCINEMATIC,
UI_CIN_STOPCINEMATIC,
UI_CIN_RUNCINEMATIC,
UI_CIN_DRAWCINEMATIC,
UI_CIN_SETEXTENTS,
UI_R_REMAP_SHADER,
UI_VERIFY_CDKEY,
UI_LAN_SERVERSTATUS,
UI_LAN_GETSERVERPING,
UI_LAN_SERVERISVISIBLE,
UI_LAN_COMPARESERVERS,
// 1.32
UI_FS_SEEK,
UI_SET_PBCLSTATUS,
UI_MEMSET = 100,
UI_MEMCPY,
UI_STRNCPY,
UI_SIN,
UI_COS,
UI_ATAN2,
UI_SQRT,
UI_FLOOR,
UI_CEIL
} uiImport_t;
typedef enum {
UIMENU_NONE,
UIMENU_MAIN,
UIMENU_INGAME,
UIMENU_NEED_CD,
UIMENU_BAD_CD_KEY,
UIMENU_TEAM,
UIMENU_POSTGAME
} uiMenuCommand_t;
#define SORT_HOST 0
#define SORT_MAP 1
#define SORT_CLIENTS 2
#define SORT_GAME 3
#define SORT_PING 4
#define SORT_PUNKBUSTER 5
typedef enum {
UI_GETAPIVERSION = 0, // system reserved
UI_INIT,
// void UI_Init( void );
UI_SHUTDOWN,
// void UI_Shutdown( void );
UI_KEY_EVENT,
// void UI_KeyEvent( int key );
UI_MOUSE_EVENT,
// void UI_MouseEvent( int dx, int dy );
UI_REFRESH,
// void UI_Refresh( int time );
UI_IS_FULLSCREEN,
// qboolean UI_IsFullscreen( void );
UI_SET_ACTIVE_MENU,
// void UI_SetActiveMenu( uiMenuCommand_t menu );
UI_CONSOLE_COMMAND,
// qboolean UI_ConsoleCommand( int realTime );
UI_DRAW_CONNECT_SCREEN,
// void UI_DrawConnectScreen( qboolean overlay );
UI_HASUNIQUECDKEY
// if !overlay, the background will be drawn, otherwise it will be
// overlayed over whatever the cgame has drawn.
// a GetClientState syscall will be made to get the current strings
} uiExport_t;
#endif

5764
code/ui/ui_shared.c Executable file

File diff suppressed because it is too large Load Diff

429
code/ui/ui_shared.h Executable file
View File

@@ -0,0 +1,429 @@
#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

101
code/ui/ui_syscalls.asm Executable file
View File

@@ -0,0 +1,101 @@
code
equ trap_Error -1
equ trap_Print -2
equ trap_Milliseconds -3
equ trap_Cvar_Set -4
equ trap_Cvar_VariableValue -5
equ trap_Cvar_VariableStringBuffer -6
equ trap_Cvar_SetValue -7
equ trap_Cvar_Reset -8
equ trap_Cvar_Create -9
equ trap_Cvar_InfoStringBuffer -10
equ trap_Argc -11
equ trap_Argv -12
equ trap_Cmd_ExecuteText -13
equ trap_FS_FOpenFile -14
equ trap_FS_Read -15
equ trap_FS_Write -16
equ trap_FS_FCloseFile -17
equ trap_FS_GetFileList -18
equ trap_R_RegisterModel -19
equ trap_R_RegisterSkin -20
equ trap_R_RegisterShaderNoMip -21
equ trap_R_ClearScene -22
equ trap_R_AddRefEntityToScene -23
equ trap_R_AddPolyToScene -24
equ trap_R_AddLightToScene -25
equ trap_R_RenderScene -26
equ trap_R_SetColor -27
equ trap_R_DrawStretchPic -28
equ trap_UpdateScreen -29
equ trap_CM_LerpTag -30
equ trap_CM_LoadModel -31
equ trap_S_RegisterSound -32
equ trap_S_StartLocalSound -33
equ trap_Key_KeynumToStringBuf -34
equ trap_Key_GetBindingBuf -35
equ trap_Key_SetBinding -36
equ trap_Key_IsDown -37
equ trap_Key_GetOverstrikeMode -38
equ trap_Key_SetOverstrikeMode -39
equ trap_Key_ClearStates -40
equ trap_Key_GetCatcher -41
equ trap_Key_SetCatcher -42
equ trap_GetClipboardData -43
equ trap_GetGlconfig -44
equ trap_GetClientState -45
equ trap_GetConfigString -46
equ trap_LAN_GetPingQueueCount -47
equ trap_LAN_ClearPing -48
equ trap_LAN_GetPing -49
equ trap_LAN_GetPingInfo -50
equ trap_Cvar_Register -51
equ trap_Cvar_Update -52
equ trap_MemoryRemaining -53
equ trap_GetCDKey -54
equ trap_SetCDKey -55
equ trap_R_RegisterFont -56
equ trap_R_ModelBounds -57
equ trap_PC_AddGlobalDefine -58
equ trap_PC_LoadSource -59
equ trap_PC_FreeSource -60
equ trap_PC_ReadToken -61
equ trap_PC_SourceFileAndLine -62
equ trap_S_StopBackgroundTrack -63
equ trap_S_StartBackgroundTrack -64
equ trap_RealTime -65
equ trap_LAN_GetServerCount -66
equ trap_LAN_GetServerAddressString -67
equ trap_LAN_GetServerInfo -68
equ trap_LAN_MarkServerVisible -69
equ trap_LAN_UpdateVisiblePings -70
equ trap_LAN_ResetPings -71
equ trap_LAN_LoadCachedServers -72
equ trap_LAN_SaveCachedServers -73
equ trap_LAN_AddServer -74
equ trap_LAN_RemoveServer -75
equ trap_CIN_PlayCinematic -76
equ trap_CIN_StopCinematic -77
equ trap_CIN_RunCinematic -78
equ trap_CIN_DrawCinematic -79
equ trap_CIN_SetExtents -80
equ trap_R_RemapShader -81
equ trap_VerifyCDKey -82
equ trap_LAN_ServerStatus -83
equ trap_LAN_GetServerPing -84
equ trap_LAN_ServerIsVisible -85
equ trap_LAN_CompareServers -86
equ trap_FS_Seek -87
equ trap_SetPbClStatus -88
equ memset -101
equ memcpy -102
equ strncpy -103
equ sin -104
equ cos -105
equ atan2 -106
equ sqrt -107
equ floor -108
equ ceil -109

378
code/ui/ui_syscalls.c Executable file
View File

@@ -0,0 +1,378 @@
// Copyright (C) 1999-2000 Id Software, Inc.
//
#include "ui_local.h"
// this file is only included when building a dll
// syscalls.asm is included instead when building a qvm
static int (QDECL *syscall)( int arg, ... ) = (int (QDECL *)( int, ...))-1;
void dllEntry( int (QDECL *syscallptr)( int arg,... ) ) {
syscall = syscallptr;
}
int PASSFLOAT( float x ) {
float floatTemp;
floatTemp = x;
return *(int *)&floatTemp;
}
void trap_Print( const char *string ) {
syscall( UI_PRINT, string );
}
void trap_Error( const char *string ) {
syscall( UI_ERROR, string );
}
int trap_Milliseconds( void ) {
return syscall( UI_MILLISECONDS );
}
void trap_Cvar_Register( vmCvar_t *cvar, const char *var_name, const char *value, int flags ) {
syscall( UI_CVAR_REGISTER, cvar, var_name, value, flags );
}
void trap_Cvar_Update( vmCvar_t *cvar ) {
syscall( UI_CVAR_UPDATE, cvar );
}
void trap_Cvar_Set( const char *var_name, const char *value ) {
syscall( UI_CVAR_SET, var_name, value );
}
float trap_Cvar_VariableValue( const char *var_name ) {
int temp;
temp = syscall( UI_CVAR_VARIABLEVALUE, var_name );
return (*(float*)&temp);
}
void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ) {
syscall( UI_CVAR_VARIABLESTRINGBUFFER, var_name, buffer, bufsize );
}
void trap_Cvar_SetValue( const char *var_name, float value ) {
syscall( UI_CVAR_SETVALUE, var_name, PASSFLOAT( value ) );
}
void trap_Cvar_Reset( const char *name ) {
syscall( UI_CVAR_RESET, name );
}
void trap_Cvar_Create( const char *var_name, const char *var_value, int flags ) {
syscall( UI_CVAR_CREATE, var_name, var_value, flags );
}
void trap_Cvar_InfoStringBuffer( int bit, char *buffer, int bufsize ) {
syscall( UI_CVAR_INFOSTRINGBUFFER, bit, buffer, bufsize );
}
int trap_Argc( void ) {
return syscall( UI_ARGC );
}
void trap_Argv( int n, char *buffer, int bufferLength ) {
syscall( UI_ARGV, n, buffer, bufferLength );
}
void trap_Cmd_ExecuteText( int exec_when, const char *text ) {
syscall( UI_CMD_EXECUTETEXT, exec_when, text );
}
int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode ) {
return syscall( UI_FS_FOPENFILE, qpath, f, mode );
}
void trap_FS_Read( void *buffer, int len, fileHandle_t f ) {
syscall( UI_FS_READ, buffer, len, f );
}
void trap_FS_Write( const void *buffer, int len, fileHandle_t f ) {
syscall( UI_FS_WRITE, buffer, len, f );
}
void trap_FS_FCloseFile( fileHandle_t f ) {
syscall( UI_FS_FCLOSEFILE, f );
}
int trap_FS_GetFileList( const char *path, const char *extension, char *listbuf, int bufsize ) {
return syscall( UI_FS_GETFILELIST, path, extension, listbuf, bufsize );
}
int trap_FS_Seek( fileHandle_t f, long offset, int origin ) {
return syscall( UI_FS_SEEK, f, offset, origin );
}
qhandle_t trap_R_RegisterModel( const char *name ) {
return syscall( UI_R_REGISTERMODEL, name );
}
qhandle_t trap_R_RegisterSkin( const char *name ) {
return syscall( UI_R_REGISTERSKIN, name );
}
void trap_R_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) {
syscall( UI_R_REGISTERFONT, fontName, pointSize, font );
}
qhandle_t trap_R_RegisterShaderNoMip( const char *name ) {
return syscall( UI_R_REGISTERSHADERNOMIP, name );
}
void trap_R_ClearScene( void ) {
syscall( UI_R_CLEARSCENE );
}
void trap_R_AddRefEntityToScene( const refEntity_t *re ) {
syscall( UI_R_ADDREFENTITYTOSCENE, re );
}
void trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts ) {
syscall( UI_R_ADDPOLYTOSCENE, hShader, numVerts, verts );
}
void trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b ) {
syscall( UI_R_ADDLIGHTTOSCENE, org, PASSFLOAT(intensity), PASSFLOAT(r), PASSFLOAT(g), PASSFLOAT(b) );
}
void trap_R_RenderScene( const refdef_t *fd ) {
syscall( UI_R_RENDERSCENE, fd );
}
void trap_R_SetColor( const float *rgba ) {
syscall( UI_R_SETCOLOR, rgba );
}
void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ) {
syscall( UI_R_DRAWSTRETCHPIC, PASSFLOAT(x), PASSFLOAT(y), PASSFLOAT(w), PASSFLOAT(h), PASSFLOAT(s1), PASSFLOAT(t1), PASSFLOAT(s2), PASSFLOAT(t2), hShader );
}
void trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs ) {
syscall( UI_R_MODELBOUNDS, model, mins, maxs );
}
void trap_UpdateScreen( void ) {
syscall( UI_UPDATESCREEN );
}
int trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName ) {
return syscall( UI_CM_LERPTAG, tag, mod, startFrame, endFrame, PASSFLOAT(frac), tagName );
}
void trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum ) {
syscall( UI_S_STARTLOCALSOUND, sfx, channelNum );
}
sfxHandle_t trap_S_RegisterSound( const char *sample, qboolean compressed ) {
return syscall( UI_S_REGISTERSOUND, sample, compressed );
}
void trap_Key_KeynumToStringBuf( int keynum, char *buf, int buflen ) {
syscall( UI_KEY_KEYNUMTOSTRINGBUF, keynum, buf, buflen );
}
void trap_Key_GetBindingBuf( int keynum, char *buf, int buflen ) {
syscall( UI_KEY_GETBINDINGBUF, keynum, buf, buflen );
}
void trap_Key_SetBinding( int keynum, const char *binding ) {
syscall( UI_KEY_SETBINDING, keynum, binding );
}
qboolean trap_Key_IsDown( int keynum ) {
return syscall( UI_KEY_ISDOWN, keynum );
}
qboolean trap_Key_GetOverstrikeMode( void ) {
return syscall( UI_KEY_GETOVERSTRIKEMODE );
}
void trap_Key_SetOverstrikeMode( qboolean state ) {
syscall( UI_KEY_SETOVERSTRIKEMODE, state );
}
void trap_Key_ClearStates( void ) {
syscall( UI_KEY_CLEARSTATES );
}
int trap_Key_GetCatcher( void ) {
return syscall( UI_KEY_GETCATCHER );
}
void trap_Key_SetCatcher( int catcher ) {
syscall( UI_KEY_SETCATCHER, catcher );
}
void trap_GetClipboardData( char *buf, int bufsize ) {
syscall( UI_GETCLIPBOARDDATA, buf, bufsize );
}
void trap_GetClientState( uiClientState_t *state ) {
syscall( UI_GETCLIENTSTATE, state );
}
void trap_GetGlconfig( glconfig_t *glconfig ) {
syscall( UI_GETGLCONFIG, glconfig );
}
int trap_GetConfigString( int index, char* buff, int buffsize ) {
return syscall( UI_GETCONFIGSTRING, index, buff, buffsize );
}
int trap_LAN_GetServerCount( int source ) {
return syscall( UI_LAN_GETSERVERCOUNT, source );
}
void trap_LAN_GetServerAddressString( int source, int n, char *buf, int buflen ) {
syscall( UI_LAN_GETSERVERADDRESSSTRING, source, n, buf, buflen );
}
void trap_LAN_GetServerInfo( int source, int n, char *buf, int buflen ) {
syscall( UI_LAN_GETSERVERINFO, source, n, buf, buflen );
}
int trap_LAN_GetServerPing( int source, int n ) {
return syscall( UI_LAN_GETSERVERPING, source, n );
}
int trap_LAN_GetPingQueueCount( void ) {
return syscall( UI_LAN_GETPINGQUEUECOUNT );
}
int trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int maxLen ) {
return syscall( UI_LAN_SERVERSTATUS, serverAddress, serverStatus, maxLen );
}
void trap_LAN_SaveCachedServers() {
syscall( UI_LAN_SAVECACHEDSERVERS );
}
void trap_LAN_LoadCachedServers() {
syscall( UI_LAN_LOADCACHEDSERVERS );
}
void trap_LAN_ResetPings(int n) {
syscall( UI_LAN_RESETPINGS, n );
}
void trap_LAN_ClearPing( int n ) {
syscall( UI_LAN_CLEARPING, n );
}
void trap_LAN_GetPing( int n, char *buf, int buflen, int *pingtime ) {
syscall( UI_LAN_GETPING, n, buf, buflen, pingtime );
}
void trap_LAN_GetPingInfo( int n, char *buf, int buflen ) {
syscall( UI_LAN_GETPINGINFO, n, buf, buflen );
}
void trap_LAN_MarkServerVisible( int source, int n, qboolean visible ) {
syscall( UI_LAN_MARKSERVERVISIBLE, source, n, visible );
}
int trap_LAN_ServerIsVisible( int source, int n) {
return syscall( UI_LAN_SERVERISVISIBLE, source, n );
}
qboolean trap_LAN_UpdateVisiblePings( int source ) {
return syscall( UI_LAN_UPDATEVISIBLEPINGS, source );
}
int trap_LAN_AddServer(int source, const char *name, const char *addr) {
return syscall( UI_LAN_ADDSERVER, source, name, addr );
}
void trap_LAN_RemoveServer(int source, const char *addr) {
syscall( UI_LAN_REMOVESERVER, source, addr );
}
int trap_LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int s2 ) {
return syscall( UI_LAN_COMPARESERVERS, source, sortKey, sortDir, s1, s2 );
}
int trap_MemoryRemaining( void ) {
return syscall( UI_MEMORY_REMAINING );
}
void trap_GetCDKey( char *buf, int buflen ) {
syscall( UI_GET_CDKEY, buf, buflen );
}
void trap_SetCDKey( char *buf ) {
syscall( UI_SET_CDKEY, buf );
}
int trap_PC_AddGlobalDefine( char *define ) {
return syscall( UI_PC_ADD_GLOBAL_DEFINE, define );
}
int trap_PC_LoadSource( const char *filename ) {
return syscall( UI_PC_LOAD_SOURCE, filename );
}
int trap_PC_FreeSource( int handle ) {
return syscall( UI_PC_FREE_SOURCE, handle );
}
int trap_PC_ReadToken( int handle, pc_token_t *pc_token ) {
return syscall( UI_PC_READ_TOKEN, handle, pc_token );
}
int trap_PC_SourceFileAndLine( int handle, char *filename, int *line ) {
return syscall( UI_PC_SOURCE_FILE_AND_LINE, handle, filename, line );
}
void trap_S_StopBackgroundTrack( void ) {
syscall( UI_S_STOPBACKGROUNDTRACK );
}
void trap_S_StartBackgroundTrack( const char *intro, const char *loop) {
syscall( UI_S_STARTBACKGROUNDTRACK, intro, loop );
}
int trap_RealTime(qtime_t *qtime) {
return syscall( UI_REAL_TIME, qtime );
}
// this returns a handle. arg0 is the name in the format "idlogo.roq", set arg1 to NULL, alteredstates to qfalse (do not alter gamestate)
int trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits) {
return syscall(UI_CIN_PLAYCINEMATIC, arg0, xpos, ypos, width, height, bits);
}
// stops playing the cinematic and ends it. should always return FMV_EOF
// cinematics must be stopped in reverse order of when they are started
e_status trap_CIN_StopCinematic(int handle) {
return syscall(UI_CIN_STOPCINEMATIC, handle);
}
// will run a frame of the cinematic but will not draw it. Will return FMV_EOF if the end of the cinematic has been reached.
e_status trap_CIN_RunCinematic (int handle) {
return syscall(UI_CIN_RUNCINEMATIC, handle);
}
// draws the current frame
void trap_CIN_DrawCinematic (int handle) {
syscall(UI_CIN_DRAWCINEMATIC, handle);
}
// allows you to resize the animation dynamically
void trap_CIN_SetExtents (int handle, int x, int y, int w, int h) {
syscall(UI_CIN_SETEXTENTS, handle, x, y, w, h);
}
void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ) {
syscall( UI_R_REMAP_SHADER, oldShader, newShader, timeOffset );
}
qboolean trap_VerifyCDKey( const char *key, const char *chksum) {
return syscall( UI_VERIFY_CDKEY, key, chksum);
}
void trap_SetPbClStatus( int status ) {
syscall( UI_SET_PBCLSTATUS, status );
}

8
code/ui/ui_util.c Executable file
View File

@@ -0,0 +1,8 @@
// ui_util.c
//
// origin: rad
// new ui support stuff
//
// memory, string alloc