diff --git a/src/ZE_ZClient.cpp b/src/ZE_ZClient.cpp index b41d73d..a948550 100755 --- a/src/ZE_ZClient.cpp +++ b/src/ZE_ZClient.cpp @@ -13,7 +13,7 @@ File: ZE_ZClient.cpp
Description: Implementation source file for core ZEngine TCP Client Object.
Author(s): James Turk
-$Id: ZE_ZClient.cpp,v 1.3 2003/03/15 03:27:19 cozman Exp $
+$Id: ZE_ZClient.cpp,v 1.4 2003/04/08 03:30:50 cozman Exp $
\file ZE_ZClient.cpp \brief Source file for ZClient. @@ -31,7 +31,7 @@ namespace ZE string num2dotted4(unsigned int num) { vector ip; - int d=256*256*256; + int d=16777216; //256*256*256 int m; while(d > 0) diff --git a/src/ZE_ZConfigFile.cpp b/src/ZE_ZConfigFile.cpp index ae33396..53f6111 100644 --- a/src/ZE_ZConfigFile.cpp +++ b/src/ZE_ZConfigFile.cpp @@ -13,7 +13,7 @@ File: ZE_ZConfigFile.cpp
Description: Implementation source file for ZConfigFile, the ZEngine INI-Style Config File.
Author(s): James Turk
-$Id: ZE_ZConfigFile.cpp,v 1.6 2003/02/10 04:02:38 cozman Exp $
+$Id: ZE_ZConfigFile.cpp,v 1.7 2003/04/08 03:30:50 cozman Exp $
\file ZE_ZConfigFile.cpp \brief Source file for ZConfigFile. @@ -32,7 +32,7 @@ string ZConfigFile::CleanString(string str) const bool inQuotes = false; //cycle through, only copy spaces and if a character is uppercase, convert it to lowercase - for(string::size_type i = 0; i < str.length(); i++) + for(string::size_type i = 0; i < str.length(); ++i) { if(!isspace(str[i]) || inQuotes) { @@ -52,7 +52,7 @@ bool ZConfigFile::Exists(string sec) const sec = CleanString(sec); - for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); secIter++) + for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); ++secIter) { if(CleanString((*secIter).section) == sec) return true; @@ -68,11 +68,11 @@ bool ZConfigFile::Exists(string sec, string var) const sec = CleanString(sec); var = CleanString(var); - for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); secIter++) + for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); ++secIter) { if(CleanString((*secIter).section) == sec) { - for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); varIter++) + for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); ++varIter) { if(CleanString((*varIter).var) == var) return true; @@ -90,14 +90,14 @@ void ZConfigFile::SetVariable(string sec, string var, string val) if(Exists(CleanString(sec))) { sec = CleanString(sec); - for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); secIter++) + for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); ++secIter) { if(CleanString((*secIter).section) == sec) //if this is the section { if(Exists(sec,var)) { var = CleanString(var); - for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); varIter++) + for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); ++varIter) { if(CleanString((*varIter).var) == var) //if this is the variable { @@ -136,13 +136,13 @@ string ZConfigFile::GetVariable(string sec, string var, string defVal) const if(Exists(sec)) { - for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); secIter++) + for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); ++secIter) { if(CleanString((*secIter).section) == sec) //if this is the section { if(Exists(sec,var)) { - for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); varIter++) + for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); ++varIter) { if(CleanString((*varIter).var) == var) //if this is the variable return (*varIter).val; //return now @@ -324,7 +324,7 @@ void ZConfigFile::Flush() if(cfile) { //iteration through sections - for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); secIter++) + for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); ++secIter) { //ensure that section is valid secName = CleanString((*secIter).section); @@ -333,7 +333,7 @@ void ZConfigFile::Flush() cfile << (*secIter).section << endl; //write out raw section title //for each variable in section, write out variable=value - for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); varIter++) + for(varIter = (*secIter).varList.begin(); varIter != (*secIter).varList.end(); ++varIter) { if(CleanString((*varIter).var).length()) //ensures that variable is valid cfile << (*varIter).var << '=' << (*varIter).val << endl; diff --git a/src/ZE_ZEngine.cpp b/src/ZE_ZEngine.cpp index 449e88d..f48836b 100644 --- a/src/ZE_ZEngine.cpp +++ b/src/ZE_ZEngine.cpp @@ -13,7 +13,7 @@ File: ZE_ZEngine.cpp
Description: Implementation source file for ZEngine library main singleton class.
Author(s): James Turk
-$Id: ZE_ZEngine.cpp,v 1.33 2003/03/17 19:04:47 cozman Exp $
+$Id: ZE_ZEngine.cpp,v 1.34 2003/04/08 03:30:50 cozman Exp $
\file ZE_ZEngine.cpp \brief Central source file for ZEngine. @@ -49,7 +49,7 @@ ZEngine::ZEngine() mMouseX = mMouseY = 0; mMouseB = 0; - for(int k = 0; k < SDLK_LAST; k++) + for(int k = 0; k < SDLK_LAST; ++k) mKeyPress[k] = false; mUnpauseOnActive = mPaused = false; diff --git a/src/ZE_ZImage.cpp b/src/ZE_ZImage.cpp index 031fde9..06bf021 100644 --- a/src/ZE_ZImage.cpp +++ b/src/ZE_ZImage.cpp @@ -13,7 +13,7 @@ File: ZE_ZImage.cpp
Description: Implementation source file for core ZEngine Image or Texture Object.
Author(s): James Turk, Gamer Tazar
-$Id: ZE_ZImage.cpp,v 1.28 2003/03/17 03:56:19 cozman Exp $
+$Id: ZE_ZImage.cpp,v 1.29 2003/04/08 03:30:50 cozman Exp $
\file ZE_ZImage.cpp \brief Source file for ZImage. @@ -149,6 +149,7 @@ void ZImage::Attach(SDL_Surface *surface) rTexMaxX = coord[2]; rTexMaxY = coord[3]; rImage = surface; + rEngine->WriteLog(FormatStr("Attached %d with ID %d",this,rTexID)); } else rEngine->ReportError(ZERR_NOIMAGE,"Attach"); @@ -164,7 +165,10 @@ void ZImage::Reload() void ZImage::Release() { if(glIsTexture(rTexID)) + { + rEngine->WriteLog(FormatStr("Releasing %d with ID %d",this,rTexID)); glDeleteTextures(1,&rTexID); + } rTexMinX = rTexMinY = rTexMaxX = rTexMaxY = 0.0f; rTexID = rWidth = rHeight = 0; FreeImage(rImage); @@ -226,10 +230,11 @@ void ZImage::Resize(unsigned int width, unsigned int height) void ZImage::Bind() const { - if(!rTexID) - rEngine->ReportError(ZERR_NOIMAGE,"Bind"); - else + if(rTexID) glBindTexture(GL_TEXTURE_2D, rTexID); + else + rEngine->ReportError(ZERR_NOIMAGE,"Bind"); + } void ZImage::Draw(int x, int y) const diff --git a/src/ZE_ZServer.cpp b/src/ZE_ZServer.cpp index 8d1ebad..3acdcba 100755 --- a/src/ZE_ZServer.cpp +++ b/src/ZE_ZServer.cpp @@ -13,7 +13,7 @@ File: ZE_ZServer.cpp
Description: Implementation source file for core ZEngine TCP Server Object.
Author(s): James Turk
-$Id: ZE_ZServer.cpp,v 1.3 2003/03/15 03:27:19 cozman Exp $
+$Id: ZE_ZServer.cpp,v 1.4 2003/04/08 03:30:50 cozman Exp $
\file ZE_ZServer.cpp \brief Source file for ZServer. @@ -70,7 +70,7 @@ bool ZServer::Start(int maxClients, Uint16 port) else if(rVerbose) rEngine->WriteLog(FormatStr("ZServer: Created server with %d available sockets.",rMaxClients)); - for(int i=0; i < rMaxClients; i++) + for(int i=0; i < rMaxClients; ++i) rClientSockets[i] = NULL; if(SDLNet_ResolveHost(&ip,NULL,port) < 0) //try to resolve the host @@ -103,7 +103,7 @@ void ZServer::Stop() } if(rClientSockets) { - for(int i=0; i < rMaxClients; i++) + for(int i=0; i < rMaxClients; ++i) { if(rClientSockets[i]) { @@ -130,7 +130,7 @@ void ZServer::CheckSockets() if(SDLNet_SocketReady(rSocket)) //new client { - for(count=0; count < rMaxClients; count++) //find first open socket + for(count=0; count < rMaxClients; ++count) //find first open socket { if(!rClientSockets[count]) break; @@ -150,7 +150,7 @@ void ZServer::CheckSockets() } //check all sockets for activity// - for(int i=0; i < rMaxClients; i++) + for(int i=0; i < rMaxClients; ++i) { if(SDLNet_SocketReady(rClientSockets[i])) //incoming message { @@ -164,7 +164,7 @@ void ZServer::CheckSockets() size = result; if(rVerbose) rEngine->WriteLog("ZServer: Mirroring data: "); - for(int j=0; j < rMaxClients; j++) + for(int j=0; j < rMaxClients; ++j) { if(rClientSockets[j] && i != j) //send to open sockets that aren't the same { @@ -181,10 +181,10 @@ int ZServer::Clients() { int numClients=0; - for(int i=0; i < rMaxClients; i++) + for(int i=0; i < rMaxClients; ++i) { if(rClientSockets[i]) - numClients++; + ++numClients; } return numClients; diff --git a/src/external/SDLGL_Util.cpp b/src/external/SDLGL_Util.cpp index 7ce651a..8c1d523 100755 --- a/src/external/SDLGL_Util.cpp +++ b/src/external/SDLGL_Util.cpp @@ -8,8 +8,9 @@ int power_of_two(int input) { int value = 1; - while ( value < input ) { - value <<= 1; + while(value < input) + { + value <<= 1; } return value; }