diff --git a/source/g3d_viewer/main.cpp b/source/g3d_viewer/main.cpp index 356d8868..c89fd0af 100644 --- a/source/g3d_viewer/main.cpp +++ b/source/g3d_viewer/main.cpp @@ -448,7 +448,7 @@ MainWindow::MainWindow( std::pair > unitToLoad, std::auto_ptr wstr(Ansi2WideString(appPath.c_str())); wstring launchApp = wstring(wstr.get()) + L" \"%1\""; - DWORD len = launchApp.length() + 1; + DWORD len = (DWORD)launchApp.length() + 1; RegSetValueEx(keyHandle, NULL, 0, REG_SZ, (PBYTE)launchApp.c_str(), len); RegCloseKey(keyHandle); @@ -456,7 +456,7 @@ MainWindow::MainWindow( std::pair > unitToLoad, RegCreateKeyEx(HKEY_CURRENT_USER,subKey.c_str(),0, NULL, 0, KEY_ALL_ACCESS, NULL, &keyHandle, &dwDisposition); //Set the value. launchApp = L"megaglest.g3d"; - len = launchApp.length() + 1; + len = (DWORD)launchApp.length() + 1; RegSetValueEx(keyHandle, NULL, 0, REG_SZ, (PBYTE)launchApp.c_str(), len); RegCloseKey(keyHandle); diff --git a/source/glest_game/ai/path_finder.cpp b/source/glest_game/ai/path_finder.cpp index 07731df3..93314d0d 100644 --- a/source/glest_game/ai/path_finder.cpp +++ b/source/glest_game/ai/path_finder.cpp @@ -1663,9 +1663,22 @@ void PathFinder::loadGame(const XmlNode *rootNode) { // Vec2i pos; curNode->pos = Vec2i::strToVec2(nodePoolNode->getAttribute("pos")->getValue()); // Node *next; - curNode->next = &factionState.nodePool[nodePoolNode->getAttribute("next")->getIntValue()]; + int nextNode = nodePoolNode->getAttribute("next")->getIntValue(); + if(nextNode >= 0) { + curNode->next = &factionState.nodePool[nextNode]; + } + else { + curNode->next = NULL; + } + // Node *prev; - curNode->prev = &factionState.nodePool[nodePoolNode->getAttribute("prev")->getIntValue()]; + int prevNode = nodePoolNode->getAttribute("prev")->getIntValue(); + if(prevNode >= 0) { + curNode->prev = &factionState.nodePool[prevNode]; + } + else { + curNode->prev = NULL; + } // float heuristic; curNode->heuristic = nodePoolNode->getAttribute("heuristic")->getFloatValue(); // bool exploredCell; diff --git a/source/glest_game/graphics/particle_type.cpp b/source/glest_game/graphics/particle_type.cpp index 841643aa..b8253cce 100644 --- a/source/glest_game/graphics/particle_type.cpp +++ b/source/glest_game/graphics/particle_type.cpp @@ -260,7 +260,7 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d if(particleSystemNode->hasChild("child-particles")) { const XmlNode *childrenNode= particleSystemNode->getChild("child-particles"); if(childrenNode->getAttribute("value")->getBoolValue()) { - for(int i = 0; i < childrenNode->getChildCount(); ++i) { + for(unsigned int i = 0; i < childrenNode->getChildCount(); ++i) { const XmlNode *particleFileNode= childrenNode->getChild("particle-file",i); string path= particleFileNode->getAttribute("path")->getRestrictedValue(); UnitParticleSystemType *unitParticleSystemType= new UnitParticleSystemType(); diff --git a/source/glest_game/graphics/unit_particle_type.cpp b/source/glest_game/graphics/unit_particle_type.cpp index 7cb480d8..e389039d 100644 --- a/source/glest_game/graphics/unit_particle_type.cpp +++ b/source/glest_game/graphics/unit_particle_type.cpp @@ -101,7 +101,7 @@ void UnitParticleSystemType::load(const XmlNode *particleSystemNode, const strin minRadius = 0; } if((minRadius == 0) && (shape == UnitParticleSystem::sConical)) { - minRadius = 0.001; // fudge it so we aren't generating particles that are exactly centred + minRadius = 0.001f; // fudge it so we aren't generating particles that are exactly centred if(minRadius > radius) radius = minRadius; } @@ -175,7 +175,7 @@ void UnitParticleSystemType::load(const XmlNode *particleSystemNode, const strin const float delay_secs = delayNode->getAttribute("value")->getFloatValue(); if(delay_secs < 0) throw runtime_error("particle effect delay cannot be negative"); - delay = delay_secs * GameConstants::updateFps; + delay = (int)delay_secs * GameConstants::updateFps; } else{ delay= 0; } @@ -186,7 +186,7 @@ void UnitParticleSystemType::load(const XmlNode *particleSystemNode, const strin const float lifetime_secs = lifetimeNode->getAttribute("value")->getFloatValue(); if(lifetime_secs < 0 && lifetime_secs != -1) throw runtime_error("particle effect lifetime cannot be negative (-1 means inherited from parent particle)"); - lifetime = lifetime_secs * GameConstants::updateFps; + lifetime = (int)lifetime_secs * GameConstants::updateFps; } else{ lifetime= -1; //default } diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp index 26c7107e..55bc4a19 100644 --- a/source/glest_map_editor/main.cpp +++ b/source/glest_map_editor/main.cpp @@ -1455,7 +1455,7 @@ bool SimpleDialog::show(const string &title, bool wide) { vector texts; for (Values::iterator it = values.begin(); it != values.end(); ++it) { - int helptextpos = it->second.find_first_of('|'); + size_t helptextpos = it->second.find_first_of('|'); sizer->Add(new wxStaticText(this, -1, ToUnicode(it->first)), 0, wxALL, 5); wxTextCtrl *text = new wxTextCtrl(this, -1, ToUnicode(it->second.substr(0,helptextpos))); if(wide) text->SetMinSize( wxSize((text->GetSize().GetWidth())*4, text->GetSize().GetHeight())); // 4 time as wide as default diff --git a/source/shared_lib/include/graphics/gl/opengl.h b/source/shared_lib/include/graphics/gl/opengl.h index 87f453cc..0ca8dfbf 100644 --- a/source/shared_lib/include/graphics/gl/opengl.h +++ b/source/shared_lib/include/graphics/gl/opengl.h @@ -52,6 +52,12 @@ void checkGlExtension(const char *extensionName); void inline _assertGl(const char *file, int line, GLenum *forceErrorNumber = NULL) { GLenum error = (forceErrorNumber != NULL ? *forceErrorNumber : glGetError()); if(error != GL_NO_ERROR) { +#ifdef _DEBUG + if(error == GL_INVALID_ENUM) { + return; + } +#endif + //if(error != GL_INVALID_ENUM) { const char *errorString= reinterpret_cast(gluErrorString(error)); char szBuf[4096]=""; diff --git a/source/tools/glexemel/g2xml.c b/source/tools/glexemel/g2xml.c index 1505a22c..66dc8d90 100644 --- a/source/tools/glexemel/g2xml.c +++ b/source/tools/glexemel/g2xml.c @@ -133,7 +133,7 @@ int g3d2xml(FILE *infile, FILE *outfile) uint8 textureName[NAMESIZE]; float32 *fdata; uint32 *idata; - int ii, jj, kk; + unsigned int ii, jj, kk; /* read in the FileHeader */ nBytes = sizeof(struct FileHeader);