Added some console functions (map_load, map_save, config_load, config_save, exec)

Added Bind method to the ControlSchemeClass
This commit is contained in:
2003-10-20 15:22:05 -04:00
parent 1685e64676
commit b512f5dd90
24 changed files with 894 additions and 645 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,30 +1,30 @@
bind forward up bind forward up
bind backward down bind backward down
bind forward mouse1 bind forward mouse1
bind backward mouse2 bind backward mouse2
bind lookleft left bind lookleft left
bind lookright right bind lookright right
bind lookup pageup bind lookup pageup
bind lookdown pagedown bind lookdown pagedown
bind moveleft s bind moveleft s
bind moveright d bind moveright d
bind moveup space bind moveup space
bind movedown a bind movedown a
bind fireprimary f bind fireprimary f
bind firesecondary g bind firesecondary g
bind weapnext t bind weapnext t
bind weapprev r bind weapprev r
bind togglelights l bind togglelights l
bind togglefps p bind togglefps p
bind toggleconsole ` bind toggleconsole `
bind togglemouselook null bind togglemouselook null
bind quickmouselook null bind quickmouselook null
set turnspeed 1.0 set turnspeed 1.0
//set movespeed 0.2 //set movespeed 0.2
set fullscreen 0 set fullscreen 0
set mousespeed 5 set mousespeed 5
set mouselook 1 set mouselook 1
set screenwidth 1024 set screenwidth 1024
set screenheight 768 set screenheight 768
set colordepth 32 set colordepth 32
set maxfps 500 set maxfps 500

View File

@@ -1,36 +1,36 @@
bind forward up bind forward up
bind backward down bind backward down
bind forward mouse1 bind forward mouse1
bind backward mouse2 bind backward mouse2
bind lookleft left bind lookleft left
bind lookright right bind lookright right
bind lookup pageup bind lookup pageup
bind lookdown pagedown bind lookdown pagedown
bind moveleft s bind moveleft s
bind moveright d bind moveright d
bind moveup space bind moveup space
bind movedown a bind movedown a
bind fireprimary f bind fireprimary f
bind firesecondary g bind firesecondary g
bind weapnext t bind weapnext t
bind weapprev r bind weapprev r
bind togglelights l bind togglelights l
bind togglefps p bind togglefps p
bind toggleconsole ~ bind toggleconsole ~
bind toggleconsole ` bind toggleconsole `
bind toggleconsole z bind toggleconsole z
bind togglemouselook m bind togglemouselook m
bind quickmouselook y bind quickmouselook y
set turnspeed 0.02 set turnspeed 0.02
set movespeed 0.2 set movespeed 0.2
set mousespeed 5 set mousespeed 5
set mouselook 1 set mouselook 1
set screenwidth 800 set screenwidth 800
set screenheight 600 set screenheight 600
set colordepth 16 set colordepth 16
set fullscreen 0 set fullscreen 0
map intro.map map intro.map
set maxfps 60 set maxfps 60
set rollleft w set rollleft w
set rollright e set rollright e
set sound false set sound false

View File

@@ -1,16 +1,16 @@
1 1
1 1
0 0
-10 -10 -5 0 0 -10 -10 -5 0 0
-10 10 -5 0 1 -10 10 -5 0 1
10 -10 -5 1 0 10 -10 -5 1 0
0 0 1 0 0 1
3 3
groundc.tga groundc.tga
moonc.tga moonc.tga
nightSkyc.tga nightSkyc.tga
bgm1.mp3 bgm1.mp3

View File

@@ -1,14 +1,14 @@
1 1
1 1
0 0
-10 -10 -5 0 0 -10 -10 -5 0 0
-10 10 -5 0 1 -10 10 -5 0 1
10 -10 -5 1 0 10 -10 -5 1 0
0 0 1 0 0 1
3 3
groundc.tga groundc.tga
moonc.tga moonc.tga
nightSkyc.tga nightSkyc.tga
bgm1.mp3 bgm1.mp3

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 22 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 22 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
bass.dll

Binary file not shown.

View File

@@ -3,12 +3,19 @@
#include "list.h" #include "list.h"
#include <windows.h> #include <windows.h>
enum {CTRLS_FORWARD, CTRLS_BACKWARD, CTRLS_LOOKLEFT, CTRLS_LOOKRIGHT, CTRLS_LOOKUP,
CTRLS_LOOKDOWN, CTRLS_MOVELEFT, CTRLS_MOVERIGHT, CTRLS_MOVEUP, CTRLS_MOVEDOWN,
CTRLS_ROLLLEFT, CTRLS_ROLLRIGHT, CTRLS_FIREPRIMARY, CTRLS_FIRESECONDARY,
CTRLS_WEAPONNEXT, CTRLS_WEAPONPREV, CTRLS_TOGGLE_LIGHTS, CTRLS_TOGGLE_FPS,
CTRLS_TOGGLE_CONSOLE, CTRLS_TOGGLE_MOUSELOOK, CTRLS_QUICKMOUSELOOK};
class ControlSchemeClass class ControlSchemeClass
{ {
public: public:
void LoadDefaultControlScheme(); void LoadDefaultControlScheme();
void ClearControlScheme(); void ClearControlScheme();
void Unbind(uint8); void Unbind(uint8);
bool Bind(uint32, uint8);
list<uint8> forward; list<uint8> forward;
list<uint8> backward; list<uint8> backward;

Binary file not shown.

BIN
oa.ncb

Binary file not shown.

316
oa.nsi
View File

@@ -1,159 +1,159 @@
; example2.nsi ; example2.nsi
; ;
; This script is based on example1.nsi, but it remember the directory, ; This script is based on example1.nsi, but it remember the directory,
; has uninstall support and (optionally) installs start menu shortcuts. ; has uninstall support and (optionally) installs start menu shortcuts.
; ;
; It will install makensisw.exe into a directory that the user selects, ; It will install makensisw.exe into a directory that the user selects,
;-------------------------------- ;--------------------------------
; The name of the installer ; The name of the installer
Name "OpenArena" Name "OpenArena"
; The installer icon ; The installer icon
Icon "${NSISDIR}\contrib\Icons\setup.ico" Icon "${NSISDIR}\contrib\Icons\setup.ico"
; The file to write ; The file to write
OutFile "OpenArena-0.1.0-alpha.exe" OutFile "OpenArena-0.1.0-alpha.exe"
; The default installation directory ; The default installation directory
InstallDir "$PROGRAMFILES\HHPS\OpenArena-0.1.0-alpha" InstallDir "$PROGRAMFILES\HHPS\OpenArena-0.1.0-alpha"
; Registry key to check for directory (so if you install again, it will ; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically) ; overwrite the old one automatically)
InstallDirRegKey HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha "Install_Dir" InstallDirRegKey HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha "Install_Dir"
; The text to prompt the user to enter a directory ; The text to prompt the user to enter a directory
ComponentText "This will install OpenArena on your computer. Select which options you want installed." ComponentText "This will install OpenArena on your computer. Select which options you want installed."
; The text to prompt the user to enter a directory ; The text to prompt the user to enter a directory
DirText "Choose a directory to install in to:" DirText "Choose a directory to install in to:"
;-------------------------------- ;--------------------------------
; The stuff to install ; The stuff to install
Section "Base (required)" Section "Base (required)"
SectionIn RO SectionIn RO
; Set output path to the installation directory. ; Set output path to the installation directory.
SetOutPath $INSTDIR SetOutPath $INSTDIR
; Put file there ; Put file there
File ".\bass.dll" File ".\bass.dll"
File ".\license.txt" File ".\license.txt"
File ".\OpenArena User's Manual.doc" File ".\OpenArena User's Manual.doc"
File ".\OpenArena User's Manual.html" File ".\OpenArena User's Manual.html"
SetOutPath $INSTDIR\OpenArena SetOutPath $INSTDIR\OpenArena
File ".\bass.dll" File ".\bass.dll"
; Write the installation path into the registry ; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha "Install_Dir" "$INSTDIR" WriteRegStr HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows ; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenArena v0.1.0-alpha" "DisplayName" "OpenArena v0.1.0-alpha (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenArena v0.1.0-alpha" "DisplayName" "OpenArena v0.1.0-alpha (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenArena v0.1.0-alpha" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenArena v0.1.0-alpha" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteUninstaller "uninstall.exe" WriteUninstaller "uninstall.exe"
CreateDirectory "$SMPROGRAMS\HHPS\OpenArena" CreateDirectory "$SMPROGRAMS\HHPS\OpenArena"
SetOutPath $INSTDIR\OpenArena SetOutPath $INSTDIR\OpenArena
CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\Readme v0.1.0-alpha.lnk" "$INSTDIR\OpenArena User's Manual.html" CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\Readme v0.1.0-alpha.lnk" "$INSTDIR\OpenArena User's Manual.html"
SectionEnd SectionEnd
; optional section (can be disabled by the user) ; optional section (can be disabled by the user)
Section "SDK" Section "SDK"
SetOutPath $INSTDIR SetOutPath $INSTDIR
File ".\oa.sln" File ".\oa.sln"
File ".\oa.vcproj" File ".\oa.vcproj"
File ".\oa.ncb" File ".\oa.ncb"
File ".\oa.suo" File ".\oa.suo"
File ".\heading.txt" File ".\heading.txt"
SetOutPath $INSTDIR\include SetOutPath $INSTDIR\include
File ".\include\*.h" File ".\include\*.h"
SetOutPath $INSTDIR\lib SetOutPath $INSTDIR\lib
File ".\lib\*.lib" File ".\lib\*.lib"
SetOutPath $INSTDIR\src SetOutPath $INSTDIR\src
File ".\src\*.cpp" File ".\src\*.cpp"
SetOutPath $INSTDIR\OpenArena\oa\config SetOutPath $INSTDIR\OpenArena\oa\config
File ".\OpenArena\oa\config\my.cfg" File ".\OpenArena\oa\config\my.cfg"
CreateDirectory $INSTDIR\OpenArena\oa\maps CreateDirectory $INSTDIR\OpenArena\oa\maps
CreateDirectory $INSTDIR\OpenArena\oa\music\bgm CreateDirectory $INSTDIR\OpenArena\oa\music\bgm
CreateDirectory $INSTDIR\OpenArena\oa\textures\menu CreateDirectory $INSTDIR\OpenArena\oa\textures\menu
SetOutPath $INSTDIR\OpenArena SetOutPath $INSTDIR\OpenArena
CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\OpenArena SDK v0.1.0-alpha.lnk" "$INSTDIR\oa.sln" CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\OpenArena SDK v0.1.0-alpha.lnk" "$INSTDIR\oa.sln"
SectionEnd SectionEnd
Section "Media" Section "Media"
SetOutPath $INSTDIR\OpenArena SetOutPath $INSTDIR\OpenArena
File ".\OpenArena\oa.exe" File ".\OpenArena\oa.exe"
SetOutPath $INSTDIR\OpenArena\oa\config SetOutPath $INSTDIR\OpenArena\oa\config
File ".\OpenArena\oa\config\my.cfg" File ".\OpenArena\oa\config\my.cfg"
SetOutPath $INSTDIR\OpenArena\oa\maps SetOutPath $INSTDIR\OpenArena\oa\maps
File ".\OpenArena\oa\maps\intro.map" File ".\OpenArena\oa\maps\intro.map"
File ".\OpenArena\oa\maps\oamap1.map" File ".\OpenArena\oa\maps\oamap1.map"
SetOutPath $INSTDIR\OpenArena\oa\music\bgm SetOutPath $INSTDIR\OpenArena\oa\music\bgm
File ".\OpenArena\oa\music\bgm\*.mp3" File ".\OpenArena\oa\music\bgm\*.mp3"
SetOutPath $INSTDIR\OpenArena\oa\textures SetOutPath $INSTDIR\OpenArena\oa\textures
File ".\OpenArena\oa\textures\*.tga" File ".\OpenArena\oa\textures\*.tga"
File ".\OpenArena\oa\textures\*.bmp" File ".\OpenArena\oa\textures\*.bmp"
SetOutPath $INSTDIR\OpenArena\oa\textures\menu SetOutPath $INSTDIR\OpenArena\oa\textures\menu
File ".\OpenArena\oa\textures\menu\*.bmp" File ".\OpenArena\oa\textures\menu\*.bmp"
File ".\OpenArena\oa\textures\menu\*.tga" File ".\OpenArena\oa\textures\menu\*.tga"
SetOutPath $INSTDIR\OpenArena SetOutPath $INSTDIR\OpenArena
CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\OpenArena v0.1.0-alpha.lnk" "$INSTDIR\OpenArena\oa.exe" CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\OpenArena v0.1.0-alpha.lnk" "$INSTDIR\OpenArena\oa.exe"
SectionEnd SectionEnd
;-------------------------------- ;--------------------------------
; Uninstaller ; Uninstaller
UninstallText "This will uninstall example2. Hit next to continue." UninstallText "This will uninstall example2. Hit next to continue."
; Uninstall section ; Uninstall section
Section "Uninstall" Section "Uninstall"
; remove registry keys ; remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenArena v0.1.0-alpha" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenArena v0.1.0-alpha"
DeleteRegKey HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha DeleteRegKey HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha
; remove files and uninstaller ; remove files and uninstaller
Delete /REBOOTOK $INSTDIR\OpenArena\*.* Delete /REBOOTOK $INSTDIR\OpenArena\*.*
Delete /REBOOTOK $INSTDIR\include\*.* Delete /REBOOTOK $INSTDIR\include\*.*
Delete /REBOOTOK $INSTDIR\lib\*.* Delete /REBOOTOK $INSTDIR\lib\*.*
Delete /REBOOTOK $INSTDIR\src\*.* Delete /REBOOTOK $INSTDIR\src\*.*
Delete /REBOOTOK $INSTDIR\bass.dll Delete /REBOOTOK $INSTDIR\bass.dll
Delete /REBOOTOK $INSTDIR\heading.txt Delete /REBOOTOK $INSTDIR\heading.txt
Delete /REBOOTOK $INSTDIR\license.txt Delete /REBOOTOK $INSTDIR\license.txt
Delete /REBOOTOK $INSTDIR\oa.ncb Delete /REBOOTOK $INSTDIR\oa.ncb
Delete /REBOOTOK $INSTDIR\oa.sln Delete /REBOOTOK $INSTDIR\oa.sln
Delete /REBOOTOK $INSTDIR\oa.sou Delete /REBOOTOK $INSTDIR\oa.sou
Delete /REBOOTOK $INSTDIR\oa.vcproj Delete /REBOOTOK $INSTDIR\oa.vcproj
Delete /REBOOTOK "$INSTDIR\OpenArena User's Manual.doc" Delete /REBOOTOK "$INSTDIR\OpenArena User's Manual.doc"
Delete /REBOOTOK "$INSTDIR\OpenArena User's Manual.html" Delete /REBOOTOK "$INSTDIR\OpenArena User's Manual.html"
Delete /REBOOTOK $INSTDIR\uninstall.exe Delete /REBOOTOK $INSTDIR\uninstall.exe
; remove shortcuts, if any ; remove shortcuts, if any
Delete /REBOOTOK "$SMPROGRAMS\HHPS\OpenArena\Readme v0.1.0-alpha.lnk" Delete /REBOOTOK "$SMPROGRAMS\HHPS\OpenArena\Readme v0.1.0-alpha.lnk"
Delete /REBOOTOK "$SMPROGRAMS\HHPS\OpenArena\OpenArena SDK v0.1.0-alpha.lnk" Delete /REBOOTOK "$SMPROGRAMS\HHPS\OpenArena\OpenArena SDK v0.1.0-alpha.lnk"
Delete /REBOOTOK "$SMPROGRAMS\HHPS\OpenArena\OpenArena v0.1.0-alpha.lnk" Delete /REBOOTOK "$SMPROGRAMS\HHPS\OpenArena\OpenArena v0.1.0-alpha.lnk"
; remove directories used ; remove directories used
RMDIR /r $INSTDIR\include RMDIR /r $INSTDIR\include
RMDIR /r $INSTDIR\lib RMDIR /r $INSTDIR\lib
RMDIR /r $INSTDIR\OpenArena RMDIR /r $INSTDIR\OpenArena
RMDIR /r $INSTDIR\src RMDIR /r $INSTDIR\src
RMDIR /r "$INSTDIR" RMDIR /r "$INSTDIR"
SectionEnd SectionEnd

42
oa.sln
View File

@@ -1,21 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 7.00 Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oa", "oa.vcproj", "{6F5D0FF6-A032-4356-932E-865B601E0DD4}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oa", "oa.vcproj", "{6F5D0FF6-A032-4356-932E-865B601E0DD4}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug Debug = Debug
Release = Release Release = Release
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(ProjectConfiguration) = postSolution
{6F5D0FF6-A032-4356-932E-865B601E0DD4}.Debug.ActiveCfg = Debug|Win32 {6F5D0FF6-A032-4356-932E-865B601E0DD4}.Debug.ActiveCfg = Debug|Win32
{6F5D0FF6-A032-4356-932E-865B601E0DD4}.Debug.Build.0 = Debug|Win32 {6F5D0FF6-A032-4356-932E-865B601E0DD4}.Debug.Build.0 = Debug|Win32
{6F5D0FF6-A032-4356-932E-865B601E0DD4}.Release.ActiveCfg = Release|Win32 {6F5D0FF6-A032-4356-932E-865B601E0DD4}.Release.ActiveCfg = Release|Win32
{6F5D0FF6-A032-4356-932E-865B601E0DD4}.Release.Build.0 = Release|Win32 {6F5D0FF6-A032-4356-932E-865B601E0DD4}.Release.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

BIN
oa.suo

Binary file not shown.

656
oa.vcproj
View File

@@ -1,328 +1,328 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.0" Version="7.10"
Name="oa" Name="oa"
ProjectGUID="{6F5D0FF6-A032-4356-932E-865B601E0DD4}" ProjectGUID="{6F5D0FF6-A032-4356-932E-865B601E0DD4}"
SccProjectName="" SccProjectName=""
SccLocalPath=""> SccLocalPath="">
<Platforms> <Platforms>
<Platform <Platform
Name="Win32"/> Name="Win32"/>
</Platforms> </Platforms>
<Configurations> <Configurations>
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
OutputDirectory=".\OpenArena" OutputDirectory=".\OpenArena"
IntermediateDirectory=".\Release" IntermediateDirectory=".\Release"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE" ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\include" AdditionalIncludeDirectories="..\include"
PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="4" RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/oa.pch" PrecompiledHeaderFile=".\Release/oa.pch"
AssemblerListingLocation=".\" AssemblerListingLocation=".\"
ObjectFile=".\" ObjectFile=".\"
ProgramDataBaseFileName=".\" ProgramDataBaseFileName=".\"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="TRUE"/> SuppressStartupBanner="TRUE"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386" AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odbc32.lib odbccp32.lib" AdditionalDependencies="odbc32.lib odbccp32.lib"
OutputFile=".\OpenArena\oa.exe" OutputFile=".\OpenArena\oa.exe"
Version="0.1.0-alpha" Version="0.1.0-alpha"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=".\lib" AdditionalLibraryDirectories=".\lib"
ProgramDatabaseFile=".\Release/oa.pdb" ProgramDatabaseFile=".\Release/oa.pdb"
SubSystem="2"/> SubSystem="2"/>
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG" PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE" MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
TargetEnvironment="1" TargetEnvironment="1"
TypeLibraryName=".\Release/oa.tlb"/> TypeLibraryName=".\Release/oa.tlb"/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCPostBuildEventTool"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG" PreprocessorDefinitions="NDEBUG"
Culture="1033"/> Culture="1033"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool <Tool
Name="VCManagedWrapperGeneratorTool"/> Name="VCManagedWrapperGeneratorTool"/>
<Tool <Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
OutputDirectory=".\Debug" OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug" IntermediateDirectory=".\Debug"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE" ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="5" RuntimeLibrary="5"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/oa.pch" PrecompiledHeaderFile=".\Debug/oa.pch"
AssemblerListingLocation=".\Debug/" AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/" ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/" ProgramDataBaseFileName=".\Debug/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
DebugInformationFormat="4"/> DebugInformationFormat="4"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386" AdditionalOptions="/MACHINE:I386"
OutputFile=".\Debug\oa.exe" OutputFile=".\Debug\oa.exe"
LinkIncremental="2" LinkIncremental="2"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=".\lib" AdditionalLibraryDirectories=".\lib"
GenerateDebugInformation="TRUE" GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/oa.pdb" ProgramDatabaseFile=".\Debug/oa.pdb"
SubSystem="2"/> SubSystem="2"/>
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG" PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE" MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
TargetEnvironment="1" TargetEnvironment="1"
TypeLibraryName=".\Debug/oa.tlb"/> TypeLibraryName=".\Debug/oa.tlb"/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCPostBuildEventTool"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG" PreprocessorDefinitions="_DEBUG"
Culture="1033"/> Culture="1033"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool <Tool
Name="VCManagedWrapperGeneratorTool"/> Name="VCManagedWrapperGeneratorTool"/>
<Tool <Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
<Files> <Files>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File <File
RelativePath=".\src\bmp.cpp"> RelativePath=".\src\bmp.cpp">
</File> </File>
<File <File
RelativePath="src\camera.cpp"> RelativePath="src\camera.cpp">
</File> </File>
<File <File
RelativePath=".\src\ctrls.cpp"> RelativePath=".\src\ctrls.cpp">
</File> </File>
<File <File
RelativePath=".\src\Level.cpp"> RelativePath=".\src\Level.cpp">
</File> </File>
<File <File
RelativePath=".\src\Main.cpp"> RelativePath=".\src\Main.cpp">
</File> </File>
<File <File
RelativePath=".\src\mygl.cpp"> RelativePath=".\src\mygl.cpp">
</File> </File>
<File <File
RelativePath=".\src\myglFont.cpp"> RelativePath=".\src\myglFont.cpp">
</File> </File>
<File <File
RelativePath=".\src\myglTexture.cpp"> RelativePath=".\src\myglTexture.cpp">
</File> </File>
<File <File
RelativePath=".\src\Player.cpp"> RelativePath=".\src\Player.cpp">
</File> </File>
<File <File
RelativePath=".\src\strmanip.cpp"> RelativePath=".\src\strmanip.cpp">
</File> </File>
<File <File
RelativePath=".\src\tga.cpp"> RelativePath=".\src\tga.cpp">
</File> </File>
<File <File
RelativePath=".\src\vector.cpp"> RelativePath=".\src\vector.cpp">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter="h;hpp;hxx;hm;inl"> Filter="h;hpp;hxx;hm;inl">
<File <File
RelativePath=".\Include\bass.h"> RelativePath=".\Include\bass.h">
</File> </File>
<File <File
RelativePath=".\Include\bmp.h"> RelativePath=".\Include\bmp.h">
</File> </File>
<File <File
RelativePath=".\Include\camera.h"> RelativePath=".\Include\camera.h">
</File> </File>
<File <File
RelativePath=".\Include\critter.h"> RelativePath=".\Include\critter.h">
</File> </File>
<File <File
RelativePath=".\Include\ctrls.h"> RelativePath=".\Include\ctrls.h">
</File> </File>
<File <File
RelativePath=".\Include\datatypes.h"> RelativePath=".\Include\datatypes.h">
</File> </File>
<File <File
RelativePath=".\Include\entities.h"> RelativePath=".\Include\entities.h">
</File> </File>
<File <File
RelativePath=".\Include\entity.h"> RelativePath=".\Include\entity.h">
</File> </File>
<File <File
RelativePath=".\Include\geometry.h"> RelativePath=".\Include\geometry.h">
</File> </File>
<File <File
RelativePath=".\Include\Level.h"> RelativePath=".\Include\Level.h">
</File> </File>
<File <File
RelativePath=".\Include\list.h"> RelativePath=".\Include\list.h">
</File> </File>
<File <File
RelativePath=".\Include\Main.h"> RelativePath=".\Include\Main.h">
</File> </File>
<File <File
RelativePath=".\Include\mydefs.h"> RelativePath=".\Include\mydefs.h">
</File> </File>
<File <File
RelativePath=".\Include\mygl.h"> RelativePath=".\Include\mygl.h">
</File> </File>
<File <File
RelativePath=".\Include\myglTexture.h"> RelativePath=".\Include\myglTexture.h">
</File> </File>
<File <File
RelativePath=".\Include\opengl.h"> RelativePath=".\Include\opengl.h">
</File> </File>
<File <File
RelativePath=".\Include\Player.h"> RelativePath=".\Include\Player.h">
</File> </File>
<File <File
RelativePath=".\Include\screen.h"> RelativePath=".\Include\screen.h">
</File> </File>
<File <File
RelativePath=".\Include\strmanip.h"> RelativePath=".\Include\strmanip.h">
</File> </File>
<File <File
RelativePath=".\Include\texture.h"> RelativePath=".\Include\texture.h">
</File> </File>
<File <File
RelativePath=".\Include\tga.h"> RelativePath=".\Include\tga.h">
</File> </File>
<File <File
RelativePath=".\Include\vector.h"> RelativePath=".\Include\vector.h">
</File> </File>
<File <File
RelativePath=".\Include\WorldDefs.h"> RelativePath=".\Include\WorldDefs.h">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="oa" Name="oa"
Filter=""> Filter="">
<Filter <Filter
Name="maps" Name="maps"
Filter=".map, .lit"> Filter=".map, .lit">
<File <File
RelativePath=".\OpenArena\oa\maps\intro.map"> RelativePath=".\OpenArena\oa\maps\intro.map">
</File> </File>
<File <File
RelativePath=".\OpenArena\oa\maps\oamap1.map"> RelativePath=".\OpenArena\oa\maps\oamap1.map">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="textures" Name="textures"
Filter=".bmp, .jpg, .tga, .png"> Filter=".bmp, .jpg, .tga, .png">
<File <File
RelativePath="OpenArena\oa\textures\groundc.tga"> RelativePath="OpenArena\oa\textures\groundc.tga">
</File> </File>
<File <File
RelativePath="OpenArena\oa\textures\moonc.tga"> RelativePath="OpenArena\oa\textures\moonc.tga">
</File> </File>
<File <File
RelativePath="OpenArena\oa\textures\nightSkyc.tga"> RelativePath="OpenArena\oa\textures\nightSkyc.tga">
</File> </File>
<File <File
RelativePath=".\OpenArena\oa\textures\test.bmp"> RelativePath=".\OpenArena\oa\textures\test.bmp">
</File> </File>
<Filter <Filter
Name="menu" Name="menu"
Filter=""> Filter="">
<File <File
RelativePath="OpenArena\oa\textures\menu\font.bmp"> RelativePath="OpenArena\oa\textures\menu\font.bmp">
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
<Filter <Filter
Name="config" Name="config"
Filter=".cfg"> Filter=".cfg">
<File <File
RelativePath="OpenArena\oa\config\G2k.cfg"> RelativePath="OpenArena\oa\config\G2k.cfg">
</File> </File>
<File <File
RelativePath="OpenArena\oa\config\My.cfg"> RelativePath="OpenArena\oa\config\My.cfg">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="music" Name="music"
Filter=""> Filter="">
<Filter <Filter
Name="bgm" Name="bgm"
Filter=""> Filter="">
<File <File
RelativePath="OpenArena\oa\music\bgm\bgm1.mp3"> RelativePath="OpenArena\oa\music\bgm\bgm1.mp3">
</File> </File>
<File <File
RelativePath="OpenArena\oa\music\bgm\bgm2.mp3"> RelativePath="OpenArena\oa\music\bgm\bgm2.mp3">
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
</Filter> </Filter>
<Filter <Filter
Name="Resource Files" Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter> </Filter>
<File <File
RelativePath=".\heading.txt"> RelativePath=".\heading.txt">
</File> </File>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>
</VisualStudioProject> </VisualStudioProject>

View File

@@ -134,4 +134,139 @@ void ControlSchemeClass::Unbind(uint8 key)
toggleMouseLook.Remove(key); toggleMouseLook.Remove(key);
weaponNext.Remove(key); weaponNext.Remove(key);
weaponPrev.Remove(key); weaponPrev.Remove(key);
}
bool ControlSchemeClass::Bind(uint32 action, uint8 key)
{
switch(action)
{
case CTRLS_FORWARD:
{
Unbind(key);
forward.Insert(key);
return true;
}
case CTRLS_BACKWARD:
{
Unbind(key);
backward.Insert(key);
return true;
}
case CTRLS_LOOKLEFT:
{
Unbind(key);
lookLeft.Insert(key);
return true;
}
case CTRLS_LOOKRIGHT:
{
Unbind(key);
lookRight.Insert(key);
return true;
}
case CTRLS_LOOKUP:
{
Unbind(key);
lookUp.Insert(key);
return true;
}
case CTRLS_LOOKDOWN:
{
Unbind(key);
lookDown.Insert(key);
return true;
}
case CTRLS_MOVELEFT:
{
Unbind(key);
moveLeft.Insert(key);
return true;
}
case CTRLS_MOVERIGHT:
{
Unbind(key);
moveRight.Insert(key);
return true;
}
case CTRLS_MOVEUP:
{
Unbind(key);
moveUp.Insert(key);
return true;
}
case CTRLS_MOVEDOWN:
{
Unbind(key);
moveDown.Insert(key);
return true;
}
case CTRLS_ROLLLEFT:
{
Unbind(key);
rollLeft.Insert(key);
return true;
}
case CTRLS_ROLLRIGHT:
{
Unbind(key);
rollRight.Insert(key);
return true;
}
case CTRLS_FIREPRIMARY:
{
Unbind(key);
firePrimary.Insert(key);
return true;
}
case CTRLS_FIRESECONDARY:
{
Unbind(key);
fireSecondary.Insert(key);
return true;
}
case CTRLS_WEAPONNEXT:
{
Unbind(key);
weaponNext.Insert(key);
return true;
}
case CTRLS_WEAPONPREV:
{
Unbind(key);
weaponPrev.Insert(key);
return true;
}
case CTRLS_TOGGLE_LIGHTS:
{
Unbind(key);
toggleLights.Insert(key);
return true;
}
case CTRLS_TOGGLE_FPS:
{
Unbind(key);
toggleFPS.Insert(key);
return true;
}
case CTRLS_TOGGLE_CONSOLE:
{
Unbind(key);
toggleConsole.Insert(key);
return true;
}
case CTRLS_TOGGLE_MOUSELOOK:
{
Unbind(key);
toggleMouseLook.Insert(key);
return true;
}
case CTRLS_QUICKMOUSELOOK:
{
Unbind(key);
quickMouseLook.Insert(key);
return true;
}
default:
return false;
}
} }

View File

@@ -492,84 +492,86 @@ void LEVEL::Execute(string cmd)
if(command == "forward") if(command == "forward")
{ {
defaultPlayer->controls.forward.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_FORWARD, KeyName(word(cmd, ++i)));
} }
else if(command == "backward") else if(command == "backward")
{ {
defaultPlayer->controls.backward.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_BACKWARD, KeyName(word(cmd, ++i)));
} }
else if(command == "lookleft") else if(command == "lookleft")
{ {
defaultPlayer->controls.lookLeft.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_LOOKLEFT, KeyName(word(cmd, ++i)));
} }
else if(command == "lookright") else if(command == "lookright")
{ {
defaultPlayer->controls.lookRight.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_LOOKRIGHT, KeyName(word(cmd, ++i)));
} }
else if(command == "lookup") else if(command == "lookup")
{ {
defaultPlayer->controls.lookUp.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_LOOKUP, KeyName(word(cmd, ++i)));
} }
else if(command == "lookdown") else if(command == "lookdown")
{ {
defaultPlayer->controls.lookDown.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_LOOKDOWN, KeyName(word(cmd, ++i)));
} }
else if(command == "moveup") else if(command == "moveup")
{ {
defaultPlayer->controls.moveUp.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_MOVEUP, KeyName(word(cmd, ++i)));
} }
else if(command == "movedown") else if(command == "movedown")
{ {
defaultPlayer->controls.moveDown.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_MOVEDOWN, KeyName(word(cmd, ++i)));
} }
else if(command == "moveleft") else if(command == "moveleft")
{ {
defaultPlayer[0].controls.moveLeft.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_MOVELEFT, KeyName(word(cmd, ++i)));
} }
else if(command == "moveright") else if(command == "moveright")
{ {
defaultPlayer[0].controls.moveRight.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_MOVERIGHT, KeyName(word(cmd, ++i)));
} }
else if(command == "fireprimary") else if(command == "fireprimary")
{ {
defaultPlayer->controls.firePrimary.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_FIREPRIMARY, KeyName(word(cmd, ++i)));
} }
else if(command == "firesecondary") else if(command == "firesecondary")
{ {
defaultPlayer->controls.fireSecondary.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_FIRESECONDARY, KeyName(word(cmd, ++i)));
} }
else if(command == "weapnext") else if(command == "weapnext")
{ {
defaultPlayer->controls.weaponNext.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_WEAPONNEXT, KeyName(word(cmd, ++i)));
} }
else if(command == "weapprev") else if(command == "weapprev")
{ {
defaultPlayer->controls.weaponPrev.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_WEAPONPREV, KeyName(word(cmd, ++i)));
} }
else if(command == "togglelights" || command == "togglelighting") else if(command == "togglelights" || command == "togglelighting")
{ {
defaultPlayer->controls.toggleLights.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_LIGHTS, KeyName(word(cmd, ++i)));
} }
else if(command == "togglefps") else if(command == "togglefps")
{ {
defaultPlayer->controls.toggleFPS.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_FPS, KeyName(word(cmd, ++i)));
} }
else if(command == "toggleconsole") else if(command == "toggleconsole")
{ {
defaultPlayer->controls.toggleConsole.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_CONSOLE, KeyName(word(cmd, ++i)));
} }
else if(command == "togglemouselook") else if(command == "togglemouselook")
{ {
defaultPlayer->controls.toggleMouseLook.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_MOUSELOOK, KeyName(word(cmd, ++i)));
} }
else if(command == "quickmouselook") else if(command == "quickmouselook")
{ {
defaultPlayer->controls.quickMouseLook.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_QUICKMOUSELOOK, KeyName(word(cmd, ++i)));
} }
} }
else if(command == "map") else if(command == "map" || command == "map_load")
{ {
nextLevel = word(cmd, ++i); nextLevel = word(cmd, ++i);
UnloadMap();
LoadMap();
} }
else if(command == "unbind") else if(command == "unbind")
{ {
@@ -584,6 +586,54 @@ void LEVEL::Execute(string cmd)
defaultPlayer[0].controls.Unbind(KeyName(command)); defaultPlayer[0].controls.Unbind(KeyName(command));
} }
} }
else if(command == "exec" || command == "config_load")
{
command = tolower(word(cmd, ++i));
LoadConfig(command);
}
else if(command == "map_save")
{
command = tolower(word(cmd, ++i));
SaveMap(command);
}
else if(command == "config_save")
{
command = tolower(word(cmd, ++i));
SaveConfig(command);
}
/*
else if(command == "map_add_triangle")
{
if(triangles != NULL)
{
TRIANGLE* temp = triangles;
triangles = new TRIANGLE[numTriangles + 1];
for(int i=0; i<numTriangles; i++)
{
triangles[i] = temp[i];
}
triangles[numTriangles].texID = 0;
for(int i=0; i<3; i++)
{
triangles[numTriangles].vertecies[i].x = 0;
triangles[numTriangles].vertecies[i].y = 0;
triangles[numTriangles].vertecies[i].z = 0;
triangles[numTriangles].texCoords[i].x = 0;
triangles[numTriangles].texCoords[i].y = 0;
}
numTriangles++;
}
else
{
}
}
*/
} }
} }
@@ -628,77 +678,116 @@ void LEVEL::ParseCmds(LPSTR lpCmdLine)
if(command == "forward") if(command == "forward")
{ {
defaultPlayer->controls.forward.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_FORWARD, KeyName(word(cmd, ++i)));
} }
else if(command == "backward") else if(command == "backward")
{ {
defaultPlayer->controls.backward.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_BACKWARD, KeyName(word(cmd, ++i)));
} }
else if(command == "lookleft") else if(command == "lookleft")
{ {
defaultPlayer->controls.lookLeft.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_LOOKLEFT, KeyName(word(cmd, ++i)));
} }
else if(command == "lookright") else if(command == "lookright")
{ {
defaultPlayer->controls.lookRight.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_LOOKRIGHT, KeyName(word(cmd, ++i)));
} }
else if(command == "lookup") else if(command == "lookup")
{ {
defaultPlayer->controls.lookUp.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_LOOKUP, KeyName(word(cmd, ++i)));
} }
else if(command == "lookdown") else if(command == "lookdown")
{ {
defaultPlayer->controls.lookDown.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_LOOKDOWN, KeyName(word(cmd, ++i)));
} }
else if(command == "moveup") else if(command == "moveup")
{ {
defaultPlayer->controls.moveUp.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_MOVEUP, KeyName(word(cmd, ++i)));
} }
else if(command == "movedown") else if(command == "movedown")
{ {
defaultPlayer->controls.moveDown.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_MOVEDOWN, KeyName(word(cmd, ++i)));
}
else if(command == "moveleft")
{
defaultPlayer[0].controls.Bind(CTRLS_MOVELEFT, KeyName(word(cmd, ++i)));
}
else if(command == "moveright")
{
defaultPlayer[0].controls.Bind(CTRLS_MOVERIGHT, KeyName(word(cmd, ++i)));
} }
else if(command == "fireprimary") else if(command == "fireprimary")
{ {
defaultPlayer->controls.firePrimary.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_FIREPRIMARY, KeyName(word(cmd, ++i)));
} }
else if(command == "firesecondary") else if(command == "firesecondary")
{ {
defaultPlayer->controls.fireSecondary.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_FIRESECONDARY, KeyName(word(cmd, ++i)));
} }
else if(command == "weapnext") else if(command == "weapnext")
{ {
defaultPlayer->controls.weaponNext.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_WEAPONNEXT, KeyName(word(cmd, ++i)));
} }
else if(command == "weapprev") else if(command == "weapprev")
{ {
defaultPlayer->controls.weaponPrev.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_WEAPONPREV, KeyName(word(cmd, ++i)));
} }
else if(command == "togglelights" || command == "togglelighting") else if(command == "togglelights" || command == "togglelighting")
{ {
defaultPlayer->controls.toggleLights.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_LIGHTS, KeyName(word(cmd, ++i)));
} }
else if(command == "togglefps") else if(command == "togglefps")
{ {
defaultPlayer->controls.toggleFPS.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_FPS, KeyName(word(cmd, ++i)));
} }
else if(command == "toggleconsole") else if(command == "toggleconsole")
{ {
defaultPlayer->controls.toggleConsole.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_CONSOLE, KeyName(word(cmd, ++i)));
} }
else if(command == "togglemouselook") else if(command == "togglemouselook")
{ {
defaultPlayer->controls.toggleMouseLook.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_MOUSELOOK, KeyName(word(cmd, ++i)));
} }
else if(command == "quickmouselook") else if(command == "quickmouselook")
{ {
defaultPlayer->controls.quickMouseLook.Insert(KeyName(word(cmd, ++i))); defaultPlayer[0].controls.Bind(CTRLS_QUICKMOUSELOOK, KeyName(word(cmd, ++i)));
} }
} }
else if(command == "+map") else if(command == "+map" || command == "+map_load")
{ {
nextLevel = word(cmd, ++i); nextLevel = word(cmd, ++i);
UnloadMap();
LoadMap();
} }
else if(command == "+unbind")
{
command = tolower(word(cmd, ++i));
if(command == "all")
{
defaultPlayer[0].controls.ClearControlScheme();
}
else
{
defaultPlayer[0].controls.Unbind(KeyName(command));
}
}
else if(command == "+exec" || command == "+config_load")
{
command = tolower(word(cmd, ++i));
LoadConfig(command);
}
else if(command == "+map_save")
{
command = tolower(word(cmd, ++i));
SaveMap(command);
}
else if(command == "+config_save")
{
command = tolower(word(cmd, ++i));
SaveConfig(command);
}
} }
} }

View File

@@ -357,6 +357,10 @@ LRESULT CALLBACK WndProc(HWND hWnd,
{ {
level.UpdateConsole('\n'); level.UpdateConsole('\n');
} }
if(wParam == VK_SHIFT)
{
keys[VK_SHIFT] = true;
}
else if(wParam == VK_SPACE) else if(wParam == VK_SPACE)
{ {
level.UpdateConsole(' '); level.UpdateConsole(' ');
@@ -366,15 +370,27 @@ LRESULT CALLBACK WndProc(HWND hWnd,
level.UpdateConsole(VK_BACK); level.UpdateConsole(VK_BACK);
} }
else if(isalpha(uint8(wParam))) else if(isalpha(uint8(wParam)))
{
if(keys[VK_SHIFT])
{
level.UpdateConsole(wParam);
}
else
{
level.UpdateConsole(tolower(wParam));
}
}
else if(isdigit(uint8(wParam)))
{ {
level.UpdateConsole(wParam); level.UpdateConsole(wParam);
} }
} }
else else
{ {
keys[wParam] = true; keys[wParam] = true;
return 0;
} }
return 0;
} }
case WM_KEYUP: case WM_KEYUP:
{ {
@@ -382,6 +398,8 @@ LRESULT CALLBACK WndProc(HWND hWnd,
keys2[wParam] = false; keys2[wParam] = false;
return 0; return 0;
} }
case WM_SYSKEYDOWN:
break;
case WM_SIZE: case WM_SIZE:
{ {
ReSizeGLScene(LOWORD(lParam),HIWORD(lParam)); ReSizeGLScene(LOWORD(lParam),HIWORD(lParam));
@@ -447,10 +465,10 @@ int WINAPI WinMain( HINSTANCE hInstance,
level.glFont.SetScreenDimensions(g_Screen.width*2, g_Screen.height*2); level.glFont.SetScreenDimensions(g_Screen.width*2, g_Screen.height*2);
//level.glFont.BuildFont("oa\\textures\\menu\\font.bmp");//(level.gamedir + "\\textures\\menu\\font.bmp").c_str()); //level.glFont.BuildFont("oa\\textures\\menu\\font.bmp");//(level.gamedir + "\\textures\\menu\\font.bmp").c_str());
if (level.nextLevel != "") if (level.nextLevel == "")
level.LoadMap(); {
else
level.LoadMap("intro.map"); level.LoadMap("intro.map");
}
if (!CreateGLWindow(g_Screen.name, g_Screen.width, g_Screen.height, g_Screen.bpp, g_Screen.fullscreen)) if (!CreateGLWindow(g_Screen.name, g_Screen.width, g_Screen.height, g_Screen.bpp, g_Screen.fullscreen))
{ {
@@ -781,7 +799,7 @@ int WINAPI WinMain( HINSTANCE hInstance,
} }
//level.Render(); //level.Render();
} }
level.Render(); level.Render();
// //
} }
} }

BIN
vc70.idb

Binary file not shown.