1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-12-25 06:05:45 +00:00

Restore & correct collision radius rendering. Enabled toggling the debug console on Mac.

Collision rendering is now mapped to Ctrl+Shift+Return instead of capslock.
Also fixed one float->int truncation in script interface,
and removed useless debug message when particle effect "" was supposed
to be spawned (but does never exist).
This commit is contained in:
fgenesis 2012-05-05 17:00:46 +02:00
parent 5cef84ad9d
commit 1350876b3d
3 changed files with 13 additions and 11 deletions

View file

@ -1981,7 +1981,8 @@ void DSQ::setInputMode(InputMode mode)
void DSQ::toggleRenderCollisionShapes() void DSQ::toggleRenderCollisionShapes()
{ {
RenderObject::renderCollisionShape = !RenderObject::renderCollisionShape; if (core->getCtrlState() && core->getShiftState())
RenderObject::renderCollisionShape = !RenderObject::renderCollisionShape;
} }
void DSQ::takeScreenshot() void DSQ::takeScreenshot()
@ -4137,13 +4138,11 @@ void DSQ::bindInput()
#endif #endif
if (isDeveloperKeys()) if (isDeveloperKeys())
{ {
#if defined(BBGE_BUILD_WINDOWS) || defined(BBGE_BUILD_UNIX)
addAction(MakeFunctionEvent(DSQ, instantQuit), KEY_Q, 1);
#ifdef AQUARIA_BUILD_CONSOLE #ifdef AQUARIA_BUILD_CONSOLE
addAction(MakeFunctionEvent(DSQ, toggleConsole), KEY_TILDE, 0); addAction(MakeFunctionEvent(DSQ, toggleConsole), KEY_TILDE, 0);
#endif #endif
#endif addAction(MakeFunctionEvent(DSQ, instantQuit), KEY_Q, 1);
addAction(MakeFunctionEvent(DSQ, toggleRenderCollisionShapes), KEY_CAPSLOCK, 0); addAction(MakeFunctionEvent(DSQ, toggleRenderCollisionShapes), KEY_RETURN, 0);
} }
addAction(MakeFunctionEvent(DSQ, debugMenu), KEY_BACKSPACE, 0); addAction(MakeFunctionEvent(DSQ, debugMenu), KEY_BACKSPACE, 0);
#if BBGE_BUILD_SDL #if BBGE_BUILD_SDL
@ -4879,6 +4878,8 @@ std::string DSQ::getSaveDirectory()
ParticleEffect *DSQ::spawnParticleEffect(const std::string &name, Vector position, float rotz, float t, int layer, float follow) ParticleEffect *DSQ::spawnParticleEffect(const std::string &name, Vector position, float rotz, float t, int layer, float follow)
{ {
if (name.empty())
return NULL;
if (t!=0) if (t!=0)
{ {
PECue p(name, position, rotz, t); PECue p(name, position, rotz, t);

View file

@ -5672,7 +5672,7 @@ luaFunc(entity_pullEntities)
if (e) if (e)
{ {
Vector pos(lua_tonumber(L, 2), lua_tonumber(L, 3)); Vector pos(lua_tonumber(L, 2), lua_tonumber(L, 3));
int range = lua_tonumber(L, 4); float range = lua_tonumber(L, 4);
float len = lua_tonumber(L, 5); float len = lua_tonumber(L, 5);
float dt = lua_tonumber(L, 6); float dt = lua_tonumber(L, 6);
FOR_ENTITIES(i) FOR_ENTITIES(i)

View file

@ -965,13 +965,15 @@ void RenderObject::renderCollision()
} }
else if (collideRadius > 0) else if (collideRadius > 0)
{ {
/*
glPushMatrix(); glPushMatrix();
glLoadIdentity();
core->setupRenderPositionAndScale();
glBindTexture(GL_TEXTURE_2D, 0); glBindTexture(GL_TEXTURE_2D, 0);
//glScalef(-scale.x, -scale.y, 0); glTranslatef(position.x+offset.x, position.y+offset.y, 0);
glTranslatef(-offset.x, -offset.y,0); //glScalef(scale.x, scale.y, 0);
glTranslatef(internalOffset.x, internalOffset.y, 0);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glTranslatef(collidePosition.x, collidePosition.y,0); //glTranslatef(collidePosition.x, collidePosition.y,0);
//glEnable(GL_ALPHA_TEST); //glEnable(GL_ALPHA_TEST);
//glAlphaFunc(GL_GREATER, 0); //glAlphaFunc(GL_GREATER, 0);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@ -980,7 +982,6 @@ void RenderObject::renderCollision()
glDisable(GL_BLEND); glDisable(GL_BLEND);
glTranslatef(offset.x, offset.y,0); glTranslatef(offset.x, offset.y,0);
glPopMatrix(); glPopMatrix();
*/
} }
} }