Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions sources/graphics/Renderer2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions sources/impl/LowLevelSystemSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLin
return hplMain(lpCmdLine);
}
#else
#include <unistd.h> // symlink
int main(int argc, char *argv[])
{
if(!std::setlocale(LC_CTYPE, "")) {
Expand Down
7 changes: 6 additions & 1 deletion sources/impl/scriptstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
7 changes: 6 additions & 1 deletion sources/impl/stdstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion sources/sound/SoundHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down