mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Fixed smooth lines with love.graphics.origin() after love.graphics.scale
This commit is contained in:
+26
-24
@@ -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
|
||||
|
||||
@@ -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},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user