Fixed console and made commands typed there work
This commit is contained in:
@@ -18,7 +18,7 @@ bind togglelights l
|
|||||||
bind togglefps p
|
bind togglefps p
|
||||||
bind toggleconsole ~
|
bind toggleconsole ~
|
||||||
bind toggleconsole `
|
bind toggleconsole `
|
||||||
bind toggleconsole i
|
bind toggleconsole z
|
||||||
bind togglemouselook m
|
bind togglemouselook m
|
||||||
bind quickmouselook y
|
bind quickmouselook y
|
||||||
set turnspeed 0.02
|
set turnspeed 0.02
|
||||||
@@ -33,4 +33,4 @@ map intro.map
|
|||||||
set maxfps 60
|
set maxfps 60
|
||||||
set rollleft w
|
set rollleft w
|
||||||
set rollright e
|
set rollright e
|
||||||
set sound 1
|
set sound false
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ class ControlSchemeClass
|
|||||||
public:
|
public:
|
||||||
void LoadDefaultControlScheme();
|
void LoadDefaultControlScheme();
|
||||||
void ClearControlScheme();
|
void ClearControlScheme();
|
||||||
|
void Unbind(uint8);
|
||||||
|
|
||||||
list<uint8> forward;
|
list<uint8> forward;
|
||||||
list<uint8> backward;
|
list<uint8> backward;
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
void LoadGLTextures();
|
void LoadGLTextures();
|
||||||
void Render();
|
void Render();
|
||||||
void UnloadMap();
|
void UnloadMap();
|
||||||
|
void UpdateConsole(char);
|
||||||
uint32 FPS();
|
uint32 FPS();
|
||||||
void ParseCmds(LPSTR);
|
void ParseCmds(LPSTR);
|
||||||
|
|
||||||
|
|||||||
@@ -179,28 +179,29 @@ void list<ItemType>::Remove(ItemType target)
|
|||||||
if(head != NULL)
|
if(head != NULL)
|
||||||
{
|
{
|
||||||
listNode<ItemType>* temp = head;
|
listNode<ItemType>* temp = head;
|
||||||
tail->next = head;
|
listNode<ItemType>* temp2 = head;
|
||||||
|
|
||||||
while(temp->next != NULL && temp->data != target)
|
while(temp->next != NULL && temp->data != target)
|
||||||
{
|
{
|
||||||
tail->next = temp;
|
temp2 = temp;
|
||||||
temp = temp->next;
|
temp = temp->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(temp->data == target)
|
if(temp->data == target)
|
||||||
{
|
{
|
||||||
if(tail->next != head)
|
if(temp != head)
|
||||||
{
|
{
|
||||||
tail->next->next = temp->next;
|
temp2->next = temp->next;
|
||||||
delete temp;
|
delete temp;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if(tail == head)
|
||||||
|
tail = NULL;
|
||||||
head = head->next;
|
head = head->next;
|
||||||
delete tail->next;
|
delete temp2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tail->next = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ static bool keys[256]; // Array for which keys are down now
|
|||||||
static bool keys2[256]; // Array for which keys are were down already
|
static bool keys2[256]; // Array for which keys are were down already
|
||||||
static bool active=true; // Is window active flag
|
static bool active=true; // Is window active flag
|
||||||
static bool fullscreen=true; // Is window fullscreen flag
|
static bool fullscreen=true; // Is window fullscreen flag
|
||||||
static bool showConsole = false;// Do we need to draw the console
|
//static bool showConsole = false;// Do we need to draw the console
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//static SCREEN g_Screen = {800,600,16,1,"OpenArena"};
|
//static SCREEN g_Screen = {800,600,16,1,"OpenArena"};
|
||||||
|
|||||||
2
oa.sln
2
oa.sln
@@ -1,4 +1,4 @@
|
|||||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
Microsoft Visual Studio Solution File, Format Version 7.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
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="7.10"
|
Version="7.0"
|
||||||
Name="oa"
|
Name="oa"
|
||||||
ProjectGUID="{6F5D0FF6-A032-4356-932E-865B601E0DD4}"
|
ProjectGUID="{6F5D0FF6-A032-4356-932E-865B601E0DD4}"
|
||||||
SccProjectName=""
|
SccProjectName=""
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
<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"
|
||||||
@@ -147,6 +147,9 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath=".\src\bmp.cpp">
|
RelativePath=".\src\bmp.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="src\camera.cpp">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\ctrls.cpp">
|
RelativePath=".\src\ctrls.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Module: ctrls.cpp
|
// Module: ctrls.cpp
|
||||||
// Author: Tom Hicks
|
// Author: Tom Hicks
|
||||||
// Creation: 09-01-2003
|
// Creation: 09-01-2003
|
||||||
// LastEdit: 10-09-2003
|
// LastEdit: 10-20-2003
|
||||||
// Editors: Tom Hicks
|
// Editors: Tom Hicks
|
||||||
//
|
//
|
||||||
// Purpose:
|
// Purpose:
|
||||||
@@ -12,7 +12,11 @@
|
|||||||
// Summary of Methods:
|
// Summary of Methods:
|
||||||
// ControlSchemeClass
|
// ControlSchemeClass
|
||||||
// void LoadDefaultControlScheme();
|
// void LoadDefaultControlScheme();
|
||||||
|
// -Loads the default control scheme
|
||||||
// void ClearControlScheme();
|
// void ClearControlScheme();
|
||||||
|
// -Clears the control scheme
|
||||||
|
// void Unbind(uint8 key);
|
||||||
|
// -Removes key from all control lists.
|
||||||
//
|
//
|
||||||
// Summary of Properties:
|
// Summary of Properties:
|
||||||
// ControlSchemeClass
|
// ControlSchemeClass
|
||||||
@@ -110,3 +114,24 @@ void ControlSchemeClass::ClearControlScheme()
|
|||||||
weaponPrev.Clear();
|
weaponPrev.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ControlSchemeClass::Unbind(uint8 key)
|
||||||
|
{
|
||||||
|
backward.Remove(key);
|
||||||
|
firePrimary.Remove(key);
|
||||||
|
fireSecondary.Remove(key);
|
||||||
|
forward.Remove(key);
|
||||||
|
lookDown.Remove(key);
|
||||||
|
lookUp.Remove(key);
|
||||||
|
lookRight.Remove(key);
|
||||||
|
lookLeft.Remove(key);
|
||||||
|
moveDown.Remove(key);
|
||||||
|
moveUp.Remove(key);
|
||||||
|
moveRight.Remove(key);
|
||||||
|
quickMouseLook.Remove(key);
|
||||||
|
toggleConsole.Remove(key);
|
||||||
|
toggleFPS.Remove(key);
|
||||||
|
toggleLights.Remove(key);
|
||||||
|
toggleMouseLook.Remove(key);
|
||||||
|
weaponNext.Remove(key);
|
||||||
|
weaponPrev.Remove(key);
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
// Module: level.cpp
|
// Module: level.cpp
|
||||||
// Author: Tom Hicks
|
// Author: Tom Hicks
|
||||||
// Creation: 09-01-2003
|
// Creation: 09-01-2003
|
||||||
// LastEdit: 10-09-2003
|
// LastEdit: 10-20-2003
|
||||||
// Editors: Tom Hicks
|
// Editors: Tom Hicks
|
||||||
//
|
//
|
||||||
// Purpose:
|
// Purpose:
|
||||||
@@ -32,12 +32,12 @@ using namespace std;
|
|||||||
|
|
||||||
LEVEL::LEVEL()
|
LEVEL::LEVEL()
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
consoleHistory[0] = "hello0";
|
consoleHistory[0] = "hello0";
|
||||||
consoleHistory[1] = "hello1";
|
consoleHistory[1] = "hello1";
|
||||||
consoleHistory[MAX_CONSOLE_HISTORY_LINES-2] = "hello3";
|
consoleHistory[MAX_CONSOLE_HISTORY_LINES-2] = "hello3";
|
||||||
consoleHistory[MAX_CONSOLE_HISTORY_LINES-1] = "hello4";
|
consoleHistory[MAX_CONSOLE_HISTORY_LINES-1] = "hello4";
|
||||||
|
*/
|
||||||
textureNames = NULL;
|
textureNames = NULL;
|
||||||
numTextures = 0;
|
numTextures = 0;
|
||||||
|
|
||||||
@@ -80,9 +80,6 @@ LEVEL::~LEVEL()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool LEVEL::LoadMap(string mapname)
|
bool LEVEL::LoadMap(string mapname)
|
||||||
{
|
{
|
||||||
ifstream input;
|
ifstream input;
|
||||||
@@ -284,20 +281,6 @@ void LEVEL::Render()
|
|||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
/**/
|
|
||||||
|
|
||||||
/*
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 1);
|
|
||||||
glBegin(GL_TRIANGLES);
|
|
||||||
glTexCoord2f(0,0);
|
|
||||||
glVertex3f(-10, -10,-5);
|
|
||||||
glTexCoord2f(0,2);
|
|
||||||
glVertex3f(-10,10,-5);
|
|
||||||
glTexCoord2f(2,0);
|
|
||||||
glVertex3f(10,-10,-5);
|
|
||||||
glEnd();
|
|
||||||
/**/
|
|
||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
//Draw HUD
|
//Draw HUD
|
||||||
@@ -464,7 +447,7 @@ void LEVEL::Execute(string cmd)
|
|||||||
uint32 i=0xFFFFFFFF;
|
uint32 i=0xFFFFFFFF;
|
||||||
while(word(cmd, ++i) != "")
|
while(word(cmd, ++i) != "")
|
||||||
{
|
{
|
||||||
command = word(cmd, i);
|
command = tolower(word(cmd, i));
|
||||||
|
|
||||||
if(command == "set")
|
if(command == "set")
|
||||||
{
|
{
|
||||||
@@ -588,6 +571,19 @@ void LEVEL::Execute(string cmd)
|
|||||||
{
|
{
|
||||||
nextLevel = word(cmd, ++i);
|
nextLevel = word(cmd, ++i);
|
||||||
}
|
}
|
||||||
|
else if(command == "unbind")
|
||||||
|
{
|
||||||
|
command = tolower(word(cmd, ++i));
|
||||||
|
|
||||||
|
if(command == "all")
|
||||||
|
{
|
||||||
|
defaultPlayer[0].controls.ClearControlScheme();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defaultPlayer[0].controls.Unbind(KeyName(command));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -949,3 +945,29 @@ void LEVEL::Print(int x, int y, const char* str, unsigned int set)
|
|||||||
{
|
{
|
||||||
glFont.Print(x,y,str, set);
|
glFont.Print(x,y,str, set);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LEVEL::UpdateConsole(char newChar)
|
||||||
|
{
|
||||||
|
if(newChar == '\n')
|
||||||
|
{
|
||||||
|
Execute(tolower(consoleHistory[0]));
|
||||||
|
for (int i=MAX_CONSOLE_HISTORY_LINES - 1; i>0; i--)
|
||||||
|
{
|
||||||
|
consoleHistory[i] = consoleHistory[i-1];
|
||||||
|
}
|
||||||
|
consoleHistory[0] = "";
|
||||||
|
}
|
||||||
|
else if(newChar == VK_BACK)
|
||||||
|
{
|
||||||
|
consoleHistory[0] = Left(consoleHistory[0], consoleHistory[0].length()-1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
consoleHistory[0] = consoleHistory[0] + newChar;
|
||||||
|
/*
|
||||||
|
char errmsg[256];
|
||||||
|
sprintf(errmsg, "Unhangled keypress: %d", newChar);
|
||||||
|
MessageBox(NULL, errmsg, "Balls", MB_OK);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
123
src/main.cpp
123
src/main.cpp
@@ -1,33 +1,56 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Author: Tom Hicks
|
|
||||||
// Module: main.cpp
|
// Module: main.cpp
|
||||||
// Purpose: This is an implementation of the openarena SDK.
|
// Author: Tom Hicks
|
||||||
|
// Creation: 09-01-2003
|
||||||
|
// LastEdit: 10-20-2003
|
||||||
|
// Editors: Tom Hicks
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
// Purpose:
|
||||||
|
// To implement the OpenArena SDK.
|
||||||
|
//
|
||||||
|
// Summary of Methods:
|
||||||
|
// Global
|
||||||
|
// -InitControls()
|
||||||
|
// Loads the defaultPlayer's configuration.
|
||||||
|
// -InitGL()
|
||||||
|
// Initializes OpenGL and is responsible for loading textures.
|
||||||
|
// -ResizeGLScene(GLsizei width, GLsizei height)
|
||||||
|
// Resizes the viewport to the current size of the visible area of the window specified by width and height.
|
||||||
|
// -KillGLWindow()
|
||||||
|
// Closes the window.
|
||||||
|
// -CreateGLWindow(string title, int width, int height, int bits, bool fullscreenflag)
|
||||||
|
// Creates the window with the specified parameters.
|
||||||
|
// -WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||||
|
// Main procedure.
|
||||||
|
// -WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
// Window Procedure for the OpenGL window.
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////
|
|
||||||
//include necessary header files
|
//include necessary header files
|
||||||
#include "../include/main.h"
|
#include "../include/main.h"
|
||||||
|
|
||||||
|
|
||||||
//link necessary libraries
|
//link necessary libraries
|
||||||
#pragma comment(lib, "opengl32.lib")
|
#pragma comment(lib, "opengl32.lib")
|
||||||
#pragma comment(lib, "glu32.lib")
|
#pragma comment(lib, "glu32.lib")
|
||||||
#pragma comment(lib, "glaux.lib")
|
#pragma comment(lib, "glaux.lib")
|
||||||
#pragma comment(lib, "winmm.lib")
|
#pragma comment(lib, "winmm.lib")
|
||||||
|
|
||||||
|
//Ensure CDS_FULLSCREEN is defined
|
||||||
#ifndef CDS_FULLSCREEN
|
#ifndef CDS_FULLSCREEN
|
||||||
#define CDS_FULLSCREEN 4
|
#define CDS_FULLSCREEN 4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
void InitControls();
|
void InitControls();
|
||||||
|
int InitGL(GLvoid);
|
||||||
|
void ReSizeGLScene(GLsizei width, GLsizei height);
|
||||||
|
bool CreateGLWindow(string title, int width, int height, int bits, bool fullscreenflag);
|
||||||
|
void KillGLWindow();
|
||||||
|
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow);
|
||||||
|
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Function Definitions
|
// Function Definitions
|
||||||
@@ -89,7 +112,7 @@ int InitGL(GLvoid)
|
|||||||
// Post:
|
// Post:
|
||||||
//
|
//
|
||||||
|
|
||||||
GLvoid ReSizeGLScene(GLsizei width, GLsizei height)
|
void ReSizeGLScene(GLsizei width, GLsizei height)
|
||||||
{
|
{
|
||||||
if (height==0)
|
if (height==0)
|
||||||
height=1;
|
height=1;
|
||||||
@@ -103,7 +126,7 @@ GLvoid ReSizeGLScene(GLsizei width, GLsizei height)
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
}
|
}
|
||||||
|
|
||||||
GLvoid KillGLWindow(GLvoid)
|
void KillGLWindow()
|
||||||
{
|
{
|
||||||
if (g_Screen.fullscreen)
|
if (g_Screen.fullscreen)
|
||||||
{
|
{
|
||||||
@@ -275,7 +298,7 @@ bool CreateGLWindow(string title, int width, int height, int bits, bool fullscre
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK WndProc( HWND hWnd,
|
LRESULT CALLBACK WndProc(HWND hWnd,
|
||||||
UINT uMsg,
|
UINT uMsg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
@@ -311,10 +334,48 @@ LRESULT CALLBACK WndProc( HWND hWnd,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
|
{
|
||||||
|
if(level.showConsole)
|
||||||
|
{
|
||||||
|
level.defaultPlayer[0].controls.toggleConsole.FirstPosition();
|
||||||
|
if(wParam == level.defaultPlayer[0].controls.toggleConsole.Retrieve())
|
||||||
|
{
|
||||||
|
level.showConsole = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while(level.defaultPlayer[0].controls.toggleConsole.NextPosition() && level.showConsole)
|
||||||
|
{
|
||||||
|
if(level.defaultPlayer[0].controls.toggleConsole.Retrieve() == wParam)
|
||||||
|
{
|
||||||
|
level.showConsole = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(wParam == VK_RETURN)
|
||||||
|
{
|
||||||
|
level.UpdateConsole('\n');
|
||||||
|
}
|
||||||
|
else if(wParam == VK_SPACE)
|
||||||
|
{
|
||||||
|
level.UpdateConsole(' ');
|
||||||
|
}
|
||||||
|
else if(wParam == VK_BACK)
|
||||||
|
{
|
||||||
|
level.UpdateConsole(VK_BACK);
|
||||||
|
}
|
||||||
|
else if(isalpha(uint8(wParam)))
|
||||||
|
{
|
||||||
|
level.UpdateConsole(wParam);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
keys[wParam] = true;
|
keys[wParam] = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
case WM_KEYUP:
|
case WM_KEYUP:
|
||||||
{
|
{
|
||||||
keys[wParam] = false;
|
keys[wParam] = false;
|
||||||
@@ -424,11 +485,14 @@ int WINAPI WinMain( HINSTANCE hInstance,
|
|||||||
{
|
{
|
||||||
level.defaultPlayer[0].camera.Update();
|
level.defaultPlayer[0].camera.Update();
|
||||||
|
|
||||||
if(fullscreen)
|
if(level.showConsole)
|
||||||
{
|
{
|
||||||
level.screen.fullscreen = true;
|
if(keys['I'] && !keys2['I'])
|
||||||
|
level.showConsole = false;
|
||||||
|
//level.UpdateConsole('\n');
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (level.mlook)
|
if (level.mlook)
|
||||||
{
|
{
|
||||||
level.defaultPlayer[0].camera.SetViewByMouse(g_Screen);
|
level.defaultPlayer[0].camera.SetViewByMouse(g_Screen);
|
||||||
@@ -662,31 +726,27 @@ int WINAPI WinMain( HINSTANCE hInstance,
|
|||||||
|
|
||||||
//////////
|
//////////
|
||||||
//Toggle Console
|
//Toggle Console
|
||||||
//if(!level.defaultPlayer[0].controls.toggleConsole.IsEmpty())
|
if(!level.defaultPlayer[0].controls.toggleConsole.IsEmpty())
|
||||||
if(keys['I'])
|
|
||||||
keys['I'] = true;
|
|
||||||
|
|
||||||
if(!level.defaultPlayer->controls.toggleConsole.IsEmpty())
|
|
||||||
{
|
{
|
||||||
level.defaultPlayer->controls.toggleConsole.FirstPosition();
|
level.defaultPlayer[0].controls.toggleConsole.FirstPosition();
|
||||||
if(keys[level.defaultPlayer->controls.toggleConsole.Retrieve()])
|
if(keys[level.defaultPlayer[0].controls.toggleConsole.Retrieve()])
|
||||||
{
|
{
|
||||||
if(!keys2[level.defaultPlayer->controls.toggleConsole.Retrieve()])
|
if(!keys2[level.defaultPlayer[0].controls.toggleConsole.Retrieve()])
|
||||||
{
|
{
|
||||||
level.showConsole = !level.showConsole;
|
level.showConsole = !level.showConsole;
|
||||||
keys2[level.defaultPlayer->controls.toggleConsole.Retrieve()] = true;
|
keys2[level.defaultPlayer[0].controls.toggleConsole.Retrieve()] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while(level.defaultPlayer->controls.toggleConsole.NextPosition() && (keys[level.defaultPlayer->controls.toggleConsole.Retrieve()] != true));
|
while(level.defaultPlayer[0].controls.toggleConsole.NextPosition() && (keys[level.defaultPlayer[0].controls.toggleConsole.Retrieve()] != true));
|
||||||
{
|
{
|
||||||
if(keys[level.defaultPlayer->controls.toggleConsole.Retrieve()])
|
if(keys[level.defaultPlayer[0].controls.toggleConsole.Retrieve()])
|
||||||
{
|
{
|
||||||
if(!keys2[level.defaultPlayer->controls.toggleConsole.Retrieve()])
|
if(!keys2[level.defaultPlayer[0].controls.toggleConsole.Retrieve()])
|
||||||
{
|
{
|
||||||
level.showConsole = !level.showConsole;
|
level.showConsole = !level.showConsole;
|
||||||
keys2[level.defaultPlayer->controls.toggleConsole.Retrieve()] = true;
|
keys2[level.defaultPlayer[0].controls.toggleConsole.Retrieve()] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -719,9 +779,10 @@ int WINAPI WinMain( HINSTANCE hInstance,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//level.Render();
|
||||||
|
}
|
||||||
level.Render();
|
level.Render();
|
||||||
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ string word(string str, uint32 wordNum)
|
|||||||
{
|
{
|
||||||
if(wordNum < 1)
|
if(wordNum < 1)
|
||||||
{
|
{
|
||||||
while (!isspace(str[++length]) && length <= maxLength);
|
while (!isspace(str[++length]) && length < maxLength);
|
||||||
|
|
||||||
return str.substr(start, length);
|
return str.substr(start, length);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user