check spr and dat signatures

This commit is contained in:
Eduardo Bart 2012-01-06 18:28:57 -02:00
parent f41e1e75cd
commit aca082f228
5 changed files with 22 additions and 5 deletions

View File

@ -31,10 +31,6 @@ end
function Client.init() function Client.init()
setupWindow() setupWindow()
if not g_sprites.isLoaded() or not g_thingsType.isLoaded() then
fatal("spr and dat files are not loaded, are them missing?")
end
end end
function Client.terminate() function Client.terminate()

@ -1 +1 @@
Subproject commit 81e6ef44c73edc5037512cdee3b2f75a23331521 Subproject commit 981d77dd293a29deeb3f411602c0816ff295edcf

View File

@ -50,6 +50,21 @@ bool luavalue_cast(int index, int& i)
return true; return true;
} }
// uint
void push_luavalue(uint v)
{
push_luavalue((double)v);
}
bool luavalue_cast(int index, uint& v)
{
double d;
bool ret = luavalue_cast(index, d);
v = (uint32)d;
return ret;
}
// double // double
void push_luavalue(double d) void push_luavalue(double d)
{ {

View File

@ -36,6 +36,10 @@ bool luavalue_cast(int index, bool& b);
void push_luavalue(int i); void push_luavalue(int i);
bool luavalue_cast(int index, int& i); bool luavalue_cast(int index, int& i);
// uint
void push_luavalue(uint v);
bool luavalue_cast(int index, uint& v);
// double // double
void push_luavalue(double d); void push_luavalue(double d);
bool luavalue_cast(int index, double& d); bool luavalue_cast(int index, double& d);

View File

@ -47,10 +47,12 @@ void OTClient::registerLuaFunctions()
g_lua.registerStaticClass("g_thingsType"); g_lua.registerStaticClass("g_thingsType");
g_lua.bindClassStaticFunction("g_thingsType", "load", std::bind(&ThingsType::load, &g_thingsType, _1)); g_lua.bindClassStaticFunction("g_thingsType", "load", std::bind(&ThingsType::load, &g_thingsType, _1));
g_lua.bindClassStaticFunction("g_thingsType", "isLoaded", std::bind(&ThingsType::isLoaded, &g_thingsType)); g_lua.bindClassStaticFunction("g_thingsType", "isLoaded", std::bind(&ThingsType::isLoaded, &g_thingsType));
g_lua.bindClassStaticFunction("g_thingsType", "getSignature", std::bind(&ThingsType::getSignature, &g_thingsType));
g_lua.registerStaticClass("g_sprites"); g_lua.registerStaticClass("g_sprites");
g_lua.bindClassStaticFunction("g_sprites", "load", std::bind(&SpriteManager::load, &g_sprites, _1)); g_lua.bindClassStaticFunction("g_sprites", "load", std::bind(&SpriteManager::load, &g_sprites, _1));
g_lua.bindClassStaticFunction("g_sprites", "isLoaded", std::bind(&SpriteManager::isLoaded, &g_sprites)); g_lua.bindClassStaticFunction("g_sprites", "isLoaded", std::bind(&SpriteManager::isLoaded, &g_sprites));
g_lua.bindClassStaticFunction("g_sprites", "getSignature", std::bind(&SpriteManager::getSignature, &g_sprites));
g_lua.bindGlobalFunction("exit", std::bind(&Application::exit, g_app)); g_lua.bindGlobalFunction("exit", std::bind(&Application::exit, g_app));
g_lua.bindGlobalFunction("getOufitColor", Outfit::getColor); g_lua.bindGlobalFunction("getOufitColor", Outfit::getColor);