OpenGTA/lua_addon/lua_spritecache.cpp

27 lines
668 B
C++
Raw Permalink Normal View History

2015-12-03 00:37:37 +00:00
#include "lua_spritecache.h"
namespace OpenGTA {
namespace Script {
using namespace OpenGL;
int SpriteCache::getScale2x(lua_State *L) {
bool b = SpriteCacheHolder::Instance().getScale2x();
lua_pushboolean(L, b);
return 1;
}
int SpriteCache::setScale2x(lua_State *L) {
bool b = SpriteCacheHolder::Instance().getScale2x();
bool v = lua_toboolean(L, 1);
if (b != v)
SpriteCacheHolder::Instance().setScale2x(v);
return 0;
}
#define method(name) {#name, SpriteCache::name}
const luaL_reg SpriteCache::methods[] = {
method(setScale2x),
method(getScale2x),
{NULL, NULL}
};
}
}