diff --git a/OpenArena User's Manual.doc b/OpenArena User's Manual.doc index 09ac164..3599f1b 100644 Binary files a/OpenArena User's Manual.doc and b/OpenArena User's Manual.doc differ diff --git a/OpenArena/bass.dll b/OpenArena/bass.dll index c08fd2d..66acf10 100644 Binary files a/OpenArena/bass.dll and b/OpenArena/bass.dll differ diff --git a/OpenArena/oa/config/G2k.cfg b/OpenArena/oa/config/G2k.cfg index 91d1556..6721d48 100644 --- a/OpenArena/oa/config/G2k.cfg +++ b/OpenArena/oa/config/G2k.cfg @@ -1,30 +1,30 @@ -bind forward up -bind backward down -bind forward mouse1 -bind backward mouse2 -bind lookleft left -bind lookright right -bind lookup pageup -bind lookdown pagedown -bind moveleft s -bind moveright d -bind moveup space -bind movedown a -bind fireprimary f -bind firesecondary g -bind weapnext t -bind weapprev r -bind togglelights l -bind togglefps p -bind toggleconsole ` -bind togglemouselook null -bind quickmouselook null -set turnspeed 1.0 -//set movespeed 0.2 -set fullscreen 0 -set mousespeed 5 -set mouselook 1 -set screenwidth 1024 -set screenheight 768 -set colordepth 32 +bind forward up +bind backward down +bind forward mouse1 +bind backward mouse2 +bind lookleft left +bind lookright right +bind lookup pageup +bind lookdown pagedown +bind moveleft s +bind moveright d +bind moveup space +bind movedown a +bind fireprimary f +bind firesecondary g +bind weapnext t +bind weapprev r +bind togglelights l +bind togglefps p +bind toggleconsole ` +bind togglemouselook null +bind quickmouselook null +set turnspeed 1.0 +//set movespeed 0.2 +set fullscreen 0 +set mousespeed 5 +set mouselook 1 +set screenwidth 1024 +set screenheight 768 +set colordepth 32 set maxfps 500 \ No newline at end of file diff --git a/OpenArena/oa/config/my.cfg b/OpenArena/oa/config/my.cfg index 9b32a81..4ba59d1 100644 --- a/OpenArena/oa/config/my.cfg +++ b/OpenArena/oa/config/my.cfg @@ -1,36 +1,36 @@ -bind forward up -bind backward down -bind forward mouse1 -bind backward mouse2 -bind lookleft left -bind lookright right -bind lookup pageup -bind lookdown pagedown -bind moveleft s -bind moveright d -bind moveup space -bind movedown a -bind fireprimary f -bind firesecondary g -bind weapnext t -bind weapprev r -bind togglelights l -bind togglefps p -bind toggleconsole ~ -bind toggleconsole ` -bind toggleconsole z -bind togglemouselook m -bind quickmouselook y -set turnspeed 0.02 -set movespeed 0.2 -set mousespeed 5 -set mouselook 1 -set screenwidth 800 -set screenheight 600 -set colordepth 16 -set fullscreen 0 -map intro.map -set maxfps 60 -set rollleft w -set rollright e -set sound false +bind forward up +bind backward down +bind forward mouse1 +bind backward mouse2 +bind lookleft left +bind lookright right +bind lookup pageup +bind lookdown pagedown +bind moveleft s +bind moveright d +bind moveup space +bind movedown a +bind fireprimary f +bind firesecondary g +bind weapnext t +bind weapprev r +bind togglelights l +bind togglefps p +bind toggleconsole ~ +bind toggleconsole ` +bind toggleconsole z +bind togglemouselook m +bind quickmouselook y +set turnspeed 0.02 +set movespeed 0.2 +set mousespeed 5 +set mouselook 1 +set screenwidth 800 +set screenheight 600 +set colordepth 16 +set fullscreen 0 +map intro.map +set maxfps 60 +set rollleft w +set rollright e +set sound false diff --git a/OpenArena/oa/maps/intro.map b/OpenArena/oa/maps/intro.map index 0455d6c..d2bcb65 100644 --- a/OpenArena/oa/maps/intro.map +++ b/OpenArena/oa/maps/intro.map @@ -1,16 +1,16 @@ -1 -1 - - -0 --10 -10 -5 0 0 --10 10 -5 0 1 -10 -10 -5 1 0 -0 0 1 - -3 -groundc.tga -moonc.tga -nightSkyc.tga - -bgm1.mp3 +1 +1 + + +0 +-10 -10 -5 0 0 +-10 10 -5 0 1 +10 -10 -5 1 0 +0 0 1 + +3 +groundc.tga +moonc.tga +nightSkyc.tga + +bgm1.mp3 diff --git a/OpenArena/oa/maps/oamap1.map b/OpenArena/oa/maps/oamap1.map index 608a753..eafdf11 100644 --- a/OpenArena/oa/maps/oamap1.map +++ b/OpenArena/oa/maps/oamap1.map @@ -1,14 +1,14 @@ -1 -1 - -0 --10 -10 -5 0 0 --10 10 -5 0 1 -10 -10 -5 1 0 -0 0 1 - -3 -groundc.tga -moonc.tga -nightSkyc.tga -bgm1.mp3 +1 +1 + +0 +-10 -10 -5 0 0 +-10 10 -5 0 1 +10 -10 -5 1 0 +0 0 1 + +3 +groundc.tga +moonc.tga +nightSkyc.tga +bgm1.mp3 diff --git a/OpenArena/oa/music/bgm/bgm1.mp3 b/OpenArena/oa/music/bgm/bgm1.mp3 index b6ac72c..16e5f7e 100644 Binary files a/OpenArena/oa/music/bgm/bgm1.mp3 and b/OpenArena/oa/music/bgm/bgm1.mp3 differ diff --git a/OpenArena/oa/music/bgm/bgm2.mp3 b/OpenArena/oa/music/bgm/bgm2.mp3 index b6e6ff6..ac88c21 100644 Binary files a/OpenArena/oa/music/bgm/bgm2.mp3 and b/OpenArena/oa/music/bgm/bgm2.mp3 differ diff --git a/OpenArena/oa/textures/Thumbs.db b/OpenArena/oa/textures/Thumbs.db index 2396f8c..3599f1b 100644 Binary files a/OpenArena/oa/textures/Thumbs.db and b/OpenArena/oa/textures/Thumbs.db differ diff --git a/OpenArena/oa/textures/default.tga b/OpenArena/oa/textures/default.tga index d39612a..f2a7890 100644 Binary files a/OpenArena/oa/textures/default.tga and b/OpenArena/oa/textures/default.tga differ diff --git a/OpenArena/oa/textures/groundc.tga b/OpenArena/oa/textures/groundc.tga index d39612a..f2a7890 100644 Binary files a/OpenArena/oa/textures/groundc.tga and b/OpenArena/oa/textures/groundc.tga differ diff --git a/OpenArena/oa/textures/menu/con_back.tga b/OpenArena/oa/textures/menu/con_back.tga index 71e7493..d83b406 100644 Binary files a/OpenArena/oa/textures/menu/con_back.tga and b/OpenArena/oa/textures/menu/con_back.tga differ diff --git a/bass.dll b/bass.dll index c08fd2d..66acf10 100644 Binary files a/bass.dll and b/bass.dll differ diff --git a/include/ctrls.h b/include/ctrls.h index 76e4a70..9c7e7c4 100644 --- a/include/ctrls.h +++ b/include/ctrls.h @@ -3,12 +3,19 @@ #include "list.h" #include +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 { public: void LoadDefaultControlScheme(); void ClearControlScheme(); void Unbind(uint8); + bool Bind(uint32, uint8); list forward; list backward; diff --git a/lib/bass.lib b/lib/bass.lib index c52241c..7cf959e 100644 Binary files a/lib/bass.lib and b/lib/bass.lib differ diff --git a/oa.ncb b/oa.ncb index 3cd8489..9057eba 100644 Binary files a/oa.ncb and b/oa.ncb differ diff --git a/oa.nsi b/oa.nsi index cbf181b..7bd4f51 100644 --- a/oa.nsi +++ b/oa.nsi @@ -1,159 +1,159 @@ -; example2.nsi -; -; This script is based on example1.nsi, but it remember the directory, -; has uninstall support and (optionally) installs start menu shortcuts. -; -; It will install makensisw.exe into a directory that the user selects, - -;-------------------------------- - -; The name of the installer -Name "OpenArena" - -; The installer icon -Icon "${NSISDIR}\contrib\Icons\setup.ico" - -; The file to write -OutFile "OpenArena-0.1.0-alpha.exe" - -; The default installation directory -InstallDir "$PROGRAMFILES\HHPS\OpenArena-0.1.0-alpha" - -; Registry key to check for directory (so if you install again, it will -; overwrite the old one automatically) -InstallDirRegKey HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha "Install_Dir" - -; The text to prompt the user to enter a directory -ComponentText "This will install OpenArena on your computer. Select which options you want installed." - -; The text to prompt the user to enter a directory -DirText "Choose a directory to install in to:" - -;-------------------------------- - -; The stuff to install -Section "Base (required)" - - SectionIn RO - - ; Set output path to the installation directory. - SetOutPath $INSTDIR - - ; Put file there - File ".\bass.dll" - File ".\license.txt" - File ".\OpenArena User's Manual.doc" - File ".\OpenArena User's Manual.html" - SetOutPath $INSTDIR\OpenArena - File ".\bass.dll" - - ; Write the installation path into the registry - WriteRegStr HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha "Install_Dir" "$INSTDIR" - - ; 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" "UninstallString" '"$INSTDIR\uninstall.exe"' - WriteUninstaller "uninstall.exe" - CreateDirectory "$SMPROGRAMS\HHPS\OpenArena" - SetOutPath $INSTDIR\OpenArena - CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\Readme v0.1.0-alpha.lnk" "$INSTDIR\OpenArena User's Manual.html" - - -SectionEnd - -; optional section (can be disabled by the user) -Section "SDK" - - SetOutPath $INSTDIR - File ".\oa.sln" - File ".\oa.vcproj" - File ".\oa.ncb" - File ".\oa.suo" - File ".\heading.txt" - SetOutPath $INSTDIR\include - File ".\include\*.h" - SetOutPath $INSTDIR\lib - File ".\lib\*.lib" - SetOutPath $INSTDIR\src - File ".\src\*.cpp" - SetOutPath $INSTDIR\OpenArena\oa\config - File ".\OpenArena\oa\config\my.cfg" - CreateDirectory $INSTDIR\OpenArena\oa\maps - CreateDirectory $INSTDIR\OpenArena\oa\music\bgm - CreateDirectory $INSTDIR\OpenArena\oa\textures\menu - SetOutPath $INSTDIR\OpenArena - - CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\OpenArena SDK v0.1.0-alpha.lnk" "$INSTDIR\oa.sln" - -SectionEnd - -Section "Media" - - SetOutPath $INSTDIR\OpenArena - File ".\OpenArena\oa.exe" - SetOutPath $INSTDIR\OpenArena\oa\config - File ".\OpenArena\oa\config\my.cfg" - SetOutPath $INSTDIR\OpenArena\oa\maps - File ".\OpenArena\oa\maps\intro.map" - File ".\OpenArena\oa\maps\oamap1.map" - SetOutPath $INSTDIR\OpenArena\oa\music\bgm - File ".\OpenArena\oa\music\bgm\*.mp3" - SetOutPath $INSTDIR\OpenArena\oa\textures - File ".\OpenArena\oa\textures\*.tga" - File ".\OpenArena\oa\textures\*.bmp" - SetOutPath $INSTDIR\OpenArena\oa\textures\menu - File ".\OpenArena\oa\textures\menu\*.bmp" - File ".\OpenArena\oa\textures\menu\*.tga" - - SetOutPath $INSTDIR\OpenArena - CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\OpenArena v0.1.0-alpha.lnk" "$INSTDIR\OpenArena\oa.exe" - - - -SectionEnd - -;-------------------------------- - -; Uninstaller - -UninstallText "This will uninstall example2. Hit next to continue." - -; Uninstall section - -Section "Uninstall" - - ; remove registry keys - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenArena v0.1.0-alpha" - DeleteRegKey HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha - - ; remove files and uninstaller - Delete /REBOOTOK $INSTDIR\OpenArena\*.* - Delete /REBOOTOK $INSTDIR\include\*.* - Delete /REBOOTOK $INSTDIR\lib\*.* - Delete /REBOOTOK $INSTDIR\src\*.* - Delete /REBOOTOK $INSTDIR\bass.dll - Delete /REBOOTOK $INSTDIR\heading.txt - Delete /REBOOTOK $INSTDIR\license.txt - Delete /REBOOTOK $INSTDIR\oa.ncb - Delete /REBOOTOK $INSTDIR\oa.sln - Delete /REBOOTOK $INSTDIR\oa.sou - Delete /REBOOTOK $INSTDIR\oa.vcproj - Delete /REBOOTOK "$INSTDIR\OpenArena User's Manual.doc" - Delete /REBOOTOK "$INSTDIR\OpenArena User's Manual.html" - Delete /REBOOTOK $INSTDIR\uninstall.exe - - ; remove shortcuts, if any - 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 v0.1.0-alpha.lnk" - - ; remove directories used - RMDIR /r $INSTDIR\include - RMDIR /r $INSTDIR\lib - RMDIR /r $INSTDIR\OpenArena - RMDIR /r $INSTDIR\src - RMDIR /r "$INSTDIR" - - - +; example2.nsi +; +; This script is based on example1.nsi, but it remember the directory, +; has uninstall support and (optionally) installs start menu shortcuts. +; +; It will install makensisw.exe into a directory that the user selects, + +;-------------------------------- + +; The name of the installer +Name "OpenArena" + +; The installer icon +Icon "${NSISDIR}\contrib\Icons\setup.ico" + +; The file to write +OutFile "OpenArena-0.1.0-alpha.exe" + +; The default installation directory +InstallDir "$PROGRAMFILES\HHPS\OpenArena-0.1.0-alpha" + +; Registry key to check for directory (so if you install again, it will +; overwrite the old one automatically) +InstallDirRegKey HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha "Install_Dir" + +; The text to prompt the user to enter a directory +ComponentText "This will install OpenArena on your computer. Select which options you want installed." + +; The text to prompt the user to enter a directory +DirText "Choose a directory to install in to:" + +;-------------------------------- + +; The stuff to install +Section "Base (required)" + + SectionIn RO + + ; Set output path to the installation directory. + SetOutPath $INSTDIR + + ; Put file there + File ".\bass.dll" + File ".\license.txt" + File ".\OpenArena User's Manual.doc" + File ".\OpenArena User's Manual.html" + SetOutPath $INSTDIR\OpenArena + File ".\bass.dll" + + ; Write the installation path into the registry + WriteRegStr HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha "Install_Dir" "$INSTDIR" + + ; 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" "UninstallString" '"$INSTDIR\uninstall.exe"' + WriteUninstaller "uninstall.exe" + CreateDirectory "$SMPROGRAMS\HHPS\OpenArena" + SetOutPath $INSTDIR\OpenArena + CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\Readme v0.1.0-alpha.lnk" "$INSTDIR\OpenArena User's Manual.html" + + +SectionEnd + +; optional section (can be disabled by the user) +Section "SDK" + + SetOutPath $INSTDIR + File ".\oa.sln" + File ".\oa.vcproj" + File ".\oa.ncb" + File ".\oa.suo" + File ".\heading.txt" + SetOutPath $INSTDIR\include + File ".\include\*.h" + SetOutPath $INSTDIR\lib + File ".\lib\*.lib" + SetOutPath $INSTDIR\src + File ".\src\*.cpp" + SetOutPath $INSTDIR\OpenArena\oa\config + File ".\OpenArena\oa\config\my.cfg" + CreateDirectory $INSTDIR\OpenArena\oa\maps + CreateDirectory $INSTDIR\OpenArena\oa\music\bgm + CreateDirectory $INSTDIR\OpenArena\oa\textures\menu + SetOutPath $INSTDIR\OpenArena + + CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\OpenArena SDK v0.1.0-alpha.lnk" "$INSTDIR\oa.sln" + +SectionEnd + +Section "Media" + + SetOutPath $INSTDIR\OpenArena + File ".\OpenArena\oa.exe" + SetOutPath $INSTDIR\OpenArena\oa\config + File ".\OpenArena\oa\config\my.cfg" + SetOutPath $INSTDIR\OpenArena\oa\maps + File ".\OpenArena\oa\maps\intro.map" + File ".\OpenArena\oa\maps\oamap1.map" + SetOutPath $INSTDIR\OpenArena\oa\music\bgm + File ".\OpenArena\oa\music\bgm\*.mp3" + SetOutPath $INSTDIR\OpenArena\oa\textures + File ".\OpenArena\oa\textures\*.tga" + File ".\OpenArena\oa\textures\*.bmp" + SetOutPath $INSTDIR\OpenArena\oa\textures\menu + File ".\OpenArena\oa\textures\menu\*.bmp" + File ".\OpenArena\oa\textures\menu\*.tga" + + SetOutPath $INSTDIR\OpenArena + CreateShortCut "$SMPROGRAMS\HHPS\OpenArena\OpenArena v0.1.0-alpha.lnk" "$INSTDIR\OpenArena\oa.exe" + + + +SectionEnd + +;-------------------------------- + +; Uninstaller + +UninstallText "This will uninstall example2. Hit next to continue." + +; Uninstall section + +Section "Uninstall" + + ; remove registry keys + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenArena v0.1.0-alpha" + DeleteRegKey HKLM SOFTWARE\HHPS\OpenArena-0.1.0-alpha + + ; remove files and uninstaller + Delete /REBOOTOK $INSTDIR\OpenArena\*.* + Delete /REBOOTOK $INSTDIR\include\*.* + Delete /REBOOTOK $INSTDIR\lib\*.* + Delete /REBOOTOK $INSTDIR\src\*.* + Delete /REBOOTOK $INSTDIR\bass.dll + Delete /REBOOTOK $INSTDIR\heading.txt + Delete /REBOOTOK $INSTDIR\license.txt + Delete /REBOOTOK $INSTDIR\oa.ncb + Delete /REBOOTOK $INSTDIR\oa.sln + Delete /REBOOTOK $INSTDIR\oa.sou + Delete /REBOOTOK $INSTDIR\oa.vcproj + Delete /REBOOTOK "$INSTDIR\OpenArena User's Manual.doc" + Delete /REBOOTOK "$INSTDIR\OpenArena User's Manual.html" + Delete /REBOOTOK $INSTDIR\uninstall.exe + + ; remove shortcuts, if any + 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 v0.1.0-alpha.lnk" + + ; remove directories used + RMDIR /r $INSTDIR\include + RMDIR /r $INSTDIR\lib + RMDIR /r $INSTDIR\OpenArena + RMDIR /r $INSTDIR\src + RMDIR /r "$INSTDIR" + + + SectionEnd \ No newline at end of file diff --git a/oa.sln b/oa.sln index 8fd5b8f..4adda6a 100644 --- a/oa.sln +++ b/oa.sln @@ -1,21 +1,21 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oa", "oa.vcproj", "{6F5D0FF6-A032-4356-932E-865B601E0DD4}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {6F5D0FF6-A032-4356-932E-865B601E0DD4}.Debug.ActiveCfg = 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.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oa", "oa.vcproj", "{6F5D0FF6-A032-4356-932E-865B601E0DD4}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {6F5D0FF6-A032-4356-932E-865B601E0DD4}.Debug.ActiveCfg = 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.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/oa.suo b/oa.suo index 8ef1518..3599f1b 100644 Binary files a/oa.suo and b/oa.suo differ diff --git a/oa.vcproj b/oa.vcproj index 9cd6c58..7632ff4 100644 --- a/oa.vcproj +++ b/oa.vcproj @@ -1,328 +1,328 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ctrls.cpp b/src/ctrls.cpp index 8a166e7..cb35ea3 100644 --- a/src/ctrls.cpp +++ b/src/ctrls.cpp @@ -134,4 +134,139 @@ void ControlSchemeClass::Unbind(uint8 key) toggleMouseLook.Remove(key); weaponNext.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; + } } \ No newline at end of file diff --git a/src/level.cpp b/src/level.cpp index 98b5b16..7804109 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -492,84 +492,86 @@ void LEVEL::Execute(string cmd) 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") { - defaultPlayer->controls.backward.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_BACKWARD, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.lookRight.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_LOOKRIGHT, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.lookDown.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_LOOKDOWN, KeyName(word(cmd, ++i))); } 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") { - 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.moveLeft.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_MOVELEFT, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.firePrimary.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_FIREPRIMARY, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.weaponNext.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_WEAPONNEXT, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.toggleLights.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_LIGHTS, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.toggleConsole.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_CONSOLE, KeyName(word(cmd, ++i))); } 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") { - 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); + UnloadMap(); + LoadMap(); } else if(command == "unbind") { @@ -584,6 +586,54 @@ void LEVEL::Execute(string cmd) 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; icontrols.forward.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_FORWARD, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.lookLeft.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_LOOKLEFT, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.lookUp.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_LOOKUP, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.moveUp.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_MOVEUP, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.firePrimary.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_FIREPRIMARY, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.weaponNext.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_WEAPONNEXT, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.toggleLights.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_LIGHTS, KeyName(word(cmd, ++i))); } 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") { - defaultPlayer->controls.toggleConsole.Insert(KeyName(word(cmd, ++i))); + defaultPlayer[0].controls.Bind(CTRLS_TOGGLE_CONSOLE, KeyName(word(cmd, ++i))); } 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") { - 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); + 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); + } + } } diff --git a/src/main.cpp b/src/main.cpp index f954c3d..8d50dd4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -357,6 +357,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, { level.UpdateConsole('\n'); } + if(wParam == VK_SHIFT) + { + keys[VK_SHIFT] = true; + } else if(wParam == VK_SPACE) { level.UpdateConsole(' '); @@ -366,15 +370,27 @@ LRESULT CALLBACK WndProc(HWND hWnd, level.UpdateConsole(VK_BACK); } 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); } + } else { keys[wParam] = true; - return 0; } + return 0; } case WM_KEYUP: { @@ -382,6 +398,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, keys2[wParam] = false; return 0; } + case WM_SYSKEYDOWN: + break; case WM_SIZE: { 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.BuildFont("oa\\textures\\menu\\font.bmp");//(level.gamedir + "\\textures\\menu\\font.bmp").c_str()); - if (level.nextLevel != "") - level.LoadMap(); - else + if (level.nextLevel == "") + { level.LoadMap("intro.map"); + } 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(); // } } diff --git a/vc70.idb b/vc70.idb index 2dddf5a..9057eba 100644 Binary files a/vc70.idb and b/vc70.idb differ