source revisions and clarifications

This commit is contained in:
James Turk 2003-06-16 07:45:03 +00:00
parent 97229de6e3
commit 52250ef9f9
5 changed files with 22 additions and 18 deletions

View File

@ -44,15 +44,11 @@
#endif #endif
#include "external/mt19937ar.h" #include "external/mt19937ar.h"
#include <string> #include <string> //used frequently
#include <vector> #include <queue> //used by ZEngine for ZErrors
#include <queue> #include <list> //used by ZConfigFile
#include <list> #include <fstream> //used by ZConfigFile
#include <fstream> #include <cctype> //used in parsing
#include <cstdio> #include <ctime> //used to seed the random generator
#include <cstdlib>
#include <cstdarg>
#include <cctype>
#include <ctime>
#endif //__ze_includes_h__ #endif //__ze_includes_h__

View File

@ -13,7 +13,7 @@
\brief Source file for ZClient. \brief Source file for ZClient.
Implementation file for ZClient, the TCP Client class for ZEngine. Implementation file for ZClient, the TCP Client class for ZEngine.
<br>$Id: ZE_ZClient.cpp,v 1.9 2003/06/11 05:51:15 cozman Exp $<br> <br>$Id: ZE_ZClient.cpp,v 1.10 2003/06/16 07:45:03 cozman Exp $<br>
\author James Turk \author James Turk
**/ **/
@ -26,7 +26,8 @@ namespace ZE
std::string num2dotted4(unsigned int num) std::string num2dotted4(unsigned int num)
{ {
vector<int> ip; int ip[4];
int index=0;
int d=16777216; //2^24 int d=16777216; //2^24
int m; int m;
@ -35,11 +36,12 @@ std::string num2dotted4(unsigned int num)
{ {
m = num/d; m = num/d;
num %= d; num %= d;
ip.push_back(m); ip[index] = m;
++index;
d /= 256; d /= 256;
} }
return FormatStr("%d.%d.%d.%d",ip[3],ip[2],ip[1],ip[0]); return FormatStr("%d.%d.%d.%d",ip[0],ip[1],ip[2],ip[3]);
} }
ZClient::ZClient(bool verbose) : ZClient::ZClient(bool verbose) :

View File

@ -13,7 +13,7 @@
\brief Source file for ZConfigFile. \brief Source file for ZConfigFile.
Implementation of ZConfigFile, the ZEngine INI-Style Config File. Implementation of ZConfigFile, the ZEngine INI-Style Config File.
<br>$Id: ZE_ZConfigFile.cpp,v 1.12 2003/06/11 05:51:15 cozman Exp $<br> <br>$Id: ZE_ZConfigFile.cpp,v 1.13 2003/06/16 07:45:03 cozman Exp $<br>
\author James Turk \author James Turk
**/ **/
@ -191,7 +191,7 @@ void ZConfigFile::Process(std::string filename)
//if std::string is bracketed it is a section, if it begins in a letter it is a variable //if std::string is bracketed it is a section, if it begins in a letter it is a variable
if(tmp[0] == '[' && tmp[tmp.length()-1] == ']') if(tmp[0] == '[' && tmp[tmp.length()-1] == ']')
section = str; section = str;
else if(isalpha(tmp[0])) else if(std::isalpha(tmp[0]))
{ {
var = str.substr(0,str.find('=')); //split the std::string at the equals sign var = str.substr(0,str.find('=')); //split the std::string at the equals sign
SetVariable(section,var,str.substr(str.find('=')+1,str.length()-var.length()-1)); SetVariable(section,var,str.substr(str.find('=')+1,str.length()-var.length()-1));

View File

@ -13,7 +13,7 @@
\brief Central source file for ZEngine. \brief Central source file for ZEngine.
Actual implementation of ZEngine singleton class, the core of ZEngine. Actual implementation of ZEngine singleton class, the core of ZEngine.
<br>$Id: ZE_ZEngine.cpp,v 1.46 2003/06/11 05:51:15 cozman Exp $<br> <br>$Id: ZE_ZEngine.cpp,v 1.47 2003/06/16 07:45:03 cozman Exp $<br>
\author James Turk \author James Turk
**/ **/
@ -43,7 +43,7 @@ ZEngine::ZEngine() :
ZError::CreateStringTable(); ZError::CreateStringTable();
SeedRandom(static_cast<unsigned long>(time(NULL))); SeedRandom(static_cast<unsigned long>(std::time(NULL)));
} }
ZEngine* ZEngine::GetInstance() ZEngine* ZEngine::GetInstance()

View File

@ -57,6 +57,9 @@
<File <File
RelativePath="..\src\external\SDLGL_Util.cpp"> RelativePath="..\src\external\SDLGL_Util.cpp">
</File> </File>
<File
RelativePath="..\src\VersionInfo.cpp">
</File>
<File <File
RelativePath="..\src\ZE_Utility.cpp"> RelativePath="..\src\ZE_Utility.cpp">
</File> </File>
@ -112,6 +115,9 @@
<File <File
RelativePath="..\include\external\SDLGL_Util.h"> RelativePath="..\include\external\SDLGL_Util.h">
</File> </File>
<File
RelativePath="..\include\VersionInfo.h">
</File>
<File <File
RelativePath="..\include\ZE_Defines.h"> RelativePath="..\include\ZE_Defines.h">
</File> </File>