diff --git a/sources/graphics/Renderer2D.cpp b/sources/graphics/Renderer2D.cpp index 8cfeb355..7dc52aa0 100644 --- a/sources/graphics/Renderer2D.cpp +++ b/sources/graphics/Renderer2D.cpp @@ -895,13 +895,25 @@ namespace hpl { //MAYBE TODO: Fix so that the shadows from different edges share vertices // Add vertexes and indexes to the vertex batcher - mpLowLevelGraphics->AddVertexToBatch(&cVertex(vPointPos[0],ShadowColor)); - mpLowLevelGraphics->AddVertexToBatch(&cVertex(vPointPos[1],ShadowColor)); + { + cVertex v0(vPointPos[0],ShadowColor); + mpLowLevelGraphics->AddVertexToBatch(&v0); + + cVertex v1(vPointPos[1],ShadowColor); + mpLowLevelGraphics->AddVertexToBatch(&v1); + } + mpLowLevelGraphics->AddIndexToBatch(lFirstIndex); mpLowLevelGraphics->AddIndexToBatch(lFirstIndex+1); - mpLowLevelGraphics->AddVertexToBatch(&cVertex(vEndPos[0],ShadowColor)); - mpLowLevelGraphics->AddVertexToBatch(&cVertex(vEndPos[1],ShadowColor)); + { + cVertex v0(vEndPos[0],ShadowColor); + mpLowLevelGraphics->AddVertexToBatch(&v0); + + cVertex v1(vEndPos[1],ShadowColor); + mpLowLevelGraphics->AddVertexToBatch(&v1); + } + mpLowLevelGraphics->AddIndexToBatch(lFirstIndex+2); mpLowLevelGraphics->AddIndexToBatch(lFirstIndex+1); @@ -920,7 +932,8 @@ namespace hpl { //If we had an extra point one for triangle is needed. if(bExtraPos){ - mpLowLevelGraphics->AddVertexToBatch(&cVertex(vExtraPos,ShadowColor)); + cVertex v(vExtraPos,ShadowColor); + mpLowLevelGraphics->AddVertexToBatch(&v); mpLowLevelGraphics->AddIndexToBatch(lFirstIndex+3); mpLowLevelGraphics->AddIndexToBatch(lFirstIndex+2); diff --git a/sources/impl/LowLevelSystemSDL.cpp b/sources/impl/LowLevelSystemSDL.cpp index 7c28d567..2cbdce8d 100644 --- a/sources/impl/LowLevelSystemSDL.cpp +++ b/sources/impl/LowLevelSystemSDL.cpp @@ -62,6 +62,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLin return hplMain(lpCmdLine); } #else +#include // symlink int main(int argc, char *argv[]) { if(!std::setlocale(LC_CTYPE, "")) { diff --git a/sources/impl/scriptstring.cpp b/sources/impl/scriptstring.cpp index 2a1b6fab..09e88c8f 100644 --- a/sources/impl/scriptstring.cpp +++ b/sources/impl/scriptstring.cpp @@ -605,10 +605,15 @@ void RegisterScriptString_Native(asIScriptEngine *engine) // otherwise the library will not allow the use of object handles for this type r = engine->RegisterStringFactory("string@", asFUNCTION(StringFactory), asCALL_CDECL); assert( r >= 0 ); + struct operators + { + static bool equals(const string& a, const string& b) { return a == b; }; + }; + // Register the global operator overloads // Note: We can use std::string's methods directly because the // internal std::string is placed at the beginning of the class - r = engine->RegisterGlobalBehaviour(asBEHAVE_EQUAL, "bool f(const string &in, const string &in)", asFUNCTIONPR(operator==, (const string &, const string &), bool), asCALL_CDECL); assert( r >= 0 ); + r = engine->RegisterGlobalBehaviour(asBEHAVE_EQUAL, "bool f(const string &in, const string &in)", asFUNCTIONPR(operators::equals, (const string &, const string &), bool), asCALL_CDECL); assert( r >= 0 ); r = engine->RegisterGlobalBehaviour(asBEHAVE_NOTEQUAL, "bool f(const string &in, const string &in)", asFUNCTIONPR(operator!=, (const string &, const string &), bool), asCALL_CDECL); assert( r >= 0 ); r = engine->RegisterGlobalBehaviour(asBEHAVE_LEQUAL, "bool f(const string &in, const string &in)", asFUNCTIONPR(operator<=, (const string &, const string &), bool), asCALL_CDECL); assert( r >= 0 ); r = engine->RegisterGlobalBehaviour(asBEHAVE_GEQUAL, "bool f(const string &in, const string &in)", asFUNCTIONPR(operator>=, (const string &, const string &), bool), asCALL_CDECL); assert( r >= 0 ); diff --git a/sources/impl/stdstring.cpp b/sources/impl/stdstring.cpp index efdac29a..5a0894ec 100644 --- a/sources/impl/stdstring.cpp +++ b/sources/impl/stdstring.cpp @@ -158,8 +158,13 @@ void RegisterStdString(asIScriptEngine *engine) r = engine->RegisterObjectBehaviour("string", asBEHAVE_ASSIGNMENT, "string &f(string &in)", asMETHODPR(string, operator =, (const string&), string&), asCALL_THISCALL); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("string", asBEHAVE_ADD_ASSIGN, "string &f(string &in)", asMETHODPR(string, operator+=, (const string&), string&), asCALL_THISCALL); assert( r >= 0 ); + struct operators + { + static bool equals(const string& a, const string& b) { return a == b; } + }; + // Register the global operator overloads - r = engine->RegisterGlobalBehaviour(asBEHAVE_EQUAL, "bool f(string &in, string &in)", asFUNCTIONPR(operator==, (const string &, const string &), bool), asCALL_CDECL); assert( r >= 0 ); + r = engine->RegisterGlobalBehaviour(asBEHAVE_EQUAL, "bool f(string &in, string &in)", asFUNCTIONPR(operators::equals, (const string &, const string &), bool), asCALL_CDECL); assert( r >= 0 ); r = engine->RegisterGlobalBehaviour(asBEHAVE_NOTEQUAL, "bool f(string &in, string &in)", asFUNCTIONPR(operator!=, (const string &, const string &), bool), asCALL_CDECL); assert( r >= 0 ); r = engine->RegisterGlobalBehaviour(asBEHAVE_LEQUAL, "bool f(string &in, string &in)", asFUNCTIONPR(operator<=, (const string &, const string &), bool), asCALL_CDECL); assert( r >= 0 ); r = engine->RegisterGlobalBehaviour(asBEHAVE_GEQUAL, "bool f(string &in, string &in)", asFUNCTIONPR(operator>=, (const string &, const string &), bool), asCALL_CDECL); assert( r >= 0 ); diff --git a/sources/sound/SoundHandler.cpp b/sources/sound/SoundHandler.cpp index b7a2ffbf..5f0273dd 100644 --- a/sources/sound/SoundHandler.cpp +++ b/sources/sound/SoundHandler.cpp @@ -286,7 +286,7 @@ namespace hpl { iSoundData* pData = mpResources->GetSoundManager()->CreateSoundData(asFileName,true,abLoop); if(pData==NULL){ Error("Couldn't load stream '%s'\n",asFileName.c_str()); - return false; + return NULL; } iSoundChannel *pSound = pData->CreateChannel(256);