Added error reporting to the LEVEL::Execute Function
Added the LEVEL::ConsolePrint Function Added the quit command this can be used in a config file Fixed console to make it work more logically and allow for output
This commit is contained in:
@@ -32,6 +32,8 @@ const float piover180 = 0.0174532925f;
|
||||
const string DEFAULT_TEXTURE_NAME = "oa/textures/default.tga";
|
||||
const unsigned int MAX_CONSOLE_LINES = 30; //The max number of lines to be displayed in the console
|
||||
const unsigned int MAX_CONSOLE_HISTORY_LINES = MAX_CONSOLE_LINES + 20; //The max number of console lines to store in the history
|
||||
const unsigned int MAX_CONSOLE_OUTPUT_LINES = MAX_CONSOLE_LINES;
|
||||
const unsigned int MAX_OUTPUT_TEXT_LINES = 4; //The max number of output lines to be displayed on the screen
|
||||
|
||||
enum {GL_MY_TEXTURE_CONSOLEBACKGROUND=0, NUM_MENU_TEXTURES};
|
||||
|
||||
@@ -41,7 +43,7 @@ public:
|
||||
LEVEL();
|
||||
~LEVEL();
|
||||
bool LoadMap(string mapname);
|
||||
void LoadMap();
|
||||
bool LoadMap();
|
||||
void SaveMap(string mapname);
|
||||
bool LoadConfig(string cfgname);
|
||||
void LoadConfig();
|
||||
@@ -92,9 +94,9 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
void ConsolePrint(string);
|
||||
string consoleHistory[MAX_CONSOLE_HISTORY_LINES];
|
||||
|
||||
|
||||
|
||||
string consoleOutput[MAX_CONSOLE_OUTPUT_LINES];
|
||||
string outputText[MAX_OUTPUT_TEXT_LINES];
|
||||
};
|
||||
#endif
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
void FirstPosition();
|
||||
void LastPosition();
|
||||
void Clear();
|
||||
unsigned int Length();
|
||||
void operator=(const list<ItemType>&);
|
||||
ItemType operator[](LIST_ARRAY_INDEX_TYPE) const;
|
||||
ItemType& operator[](LIST_ARRAY_INDEX_TYPE);
|
||||
@@ -339,4 +340,24 @@ ItemType& list<ItemType>::operator[](LIST_ARRAY_INDEX_TYPE index)
|
||||
}
|
||||
}
|
||||
|
||||
template <class ItemType>
|
||||
unsigned int Length()
|
||||
{
|
||||
if (head == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int len = 1;
|
||||
listNode<ItemType> temp = head->next;
|
||||
while (temp != NULL)
|
||||
{
|
||||
temp = temp->next;
|
||||
len++
|
||||
}
|
||||
return len;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user