Fixed smooth lines with love.graphics.origin() after love.graphics.scale

This commit is contained in:
Alex Szpakowski
2013-05-12 16:13:32 -03:00
parent e9d0204cdc
commit aa59761177
4 changed files with 37 additions and 34 deletions
+26 -24
View File
@@ -34,32 +34,34 @@ namespace
namespace love
{
void Module::registerInstance(Module *instance)
void Module::registerInstance(Module *instance)
{
if (instance == NULL)
throw Exception("Module instance is NULL");
std::string name(instance->getName());
std::map<std::string, Module*>::iterator it = registry.find(name);
if (registry.end() != it)
{
if (instance == NULL)
throw Exception("Module instance is NULL");
std::string name(instance->getName());
std::map<std::string, Module*>::iterator it = registry.find(name);
if (registry.end() != it)
{
if (it->second == instance)
return;
throw Exception("Module %s already registered!", instance->getName());
}
registry.insert(make_pair(name, instance));
if (it->second == instance)
return;
throw Exception("Module %s already registered!", instance->getName());
}
Module *Module::getInstance(const char *name)
{
std::map<std::string, Module*>::iterator it = registry.find(std::string(name));
registry.insert(make_pair(name, instance));
}
if (registry.end() == it)
return NULL;
Module *Module::getInstance(const char *name)
{
std::map<std::string, Module*>::iterator it = registry.find(std::string(name));
return it->second;
}
} // namespace love
if (registry.end() == it)
return NULL;
return it->second;
}
} // love
+2 -1
View File
@@ -78,7 +78,7 @@ static int w__eq(lua_State *L)
return 1;
}
Reference *luax_refif (lua_State *L, int type)
Reference *luax_refif(lua_State *L, int type)
{
Reference *r = 0;
@@ -538,6 +538,7 @@ StringMap<Type, TYPE_MAX_ENUM>::Entry typeEntries[] =
// The modules themselves. Only add abstracted modules here.
{"filesystem", MODULE_FILESYSTEM_ID},
{"graphics", MODULE_GRAPHICS_ID},
{"image", MODULE_IMAGE_ID},
{"sound", MODULE_SOUND_ID},
};