From 1be8ac5be4164c5d52475a54c985959c7fa41f3a Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Thu, 26 Sep 2013 00:48:48 -0300 Subject: [PATCH] Removed some unused functions and fixed up some wrap_ headers --- src/common/Variant.cpp | 2 +- src/common/runtime.cpp | 10 ---------- src/modules/graphics/opengl/Graphics.cpp | 16 ---------------- src/modules/graphics/opengl/Graphics.h | 3 --- src/modules/graphics/opengl/wrap_Graphics.h | 2 ++ src/modules/graphics/opengl/wrap_Image.h | 2 +- src/modules/graphics/opengl/wrap_Shader.h | 1 + src/modules/sound/lullaby/VorbisDecoder.cpp | 8 ++++---- src/modules/sound/wrap_SoundData.h | 15 +++++++-------- 9 files changed, 16 insertions(+), 43 deletions(-) diff --git a/src/common/Variant.cpp b/src/common/Variant.cpp index 64cdca009..b1aa939d8 100644 --- a/src/common/Variant.cpp +++ b/src/common/Variant.cpp @@ -26,7 +26,7 @@ namespace love extern StringMap types; -love::Type extractudatatype(lua_State *L, int idx) +static love::Type extractudatatype(lua_State *L, int idx) { Type t = INVALID_ID; if (!lua_isuserdata(L, idx)) diff --git a/src/common/runtime.cpp b/src/common/runtime.cpp index ef5c3ebc5..7f194d52e 100644 --- a/src/common/runtime.cpp +++ b/src/common/runtime.cpp @@ -533,16 +533,6 @@ int luax_pconvobj(lua_State *L, int idxs[], int n, const char *mod, const char * return ret; } -int luax_strtofile(lua_State *L, int idx) -{ - return luax_convobj(L, idx, "filesystem", "newFile"); -} - -int luax_filetodata(lua_State *L, int idx) -{ - return luax_convobj(L, idx, "filesystem", "read"); -} - int luax_insist(lua_State *L, int idx, const char *k) { // Convert to absolute index if necessary. diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 7c2548cde..2ed6d422c 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -242,22 +242,6 @@ int Graphics::getHeight() const return height; } -int Graphics::getRenderWidth() const -{ - if (Canvas::current) - return Canvas::current->getWidth(); - - return getWidth(); -} - -int Graphics::getRenderHeight() const -{ - if (Canvas::current) - return Canvas::current->getHeight(); - - return getHeight(); -} - bool Graphics::isCreated() const { return created; diff --git a/src/modules/graphics/opengl/Graphics.h b/src/modules/graphics/opengl/Graphics.h index c204494e5..298d7b7fc 100644 --- a/src/modules/graphics/opengl/Graphics.h +++ b/src/modules/graphics/opengl/Graphics.h @@ -461,9 +461,6 @@ public: private: - int getRenderWidth() const; - int getRenderHeight() const; - Font *currentFont; love::window::Window *currentWindow; diff --git a/src/modules/graphics/opengl/wrap_Graphics.h b/src/modules/graphics/opengl/wrap_Graphics.h index 5bc069bff..c414b9360 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.h +++ b/src/modules/graphics/opengl/wrap_Graphics.h @@ -48,6 +48,7 @@ int w_getDimensions(lua_State *L); int w_setScissor(lua_State *L); int w_getScissor(lua_State *L); int w_setStencil(lua_State *L); +int w_setInvertedStencil(lua_State *L); int w_getMaxImageSize(lua_State *L); int w_newImage(lua_State *L); int w_newGeometry(lua_State *L); @@ -99,6 +100,7 @@ int w_line(lua_State *L); int w_rectangle(lua_State *L); int w_circle(lua_State *L); int w_arc(lua_State *L); +int w_polygon(lua_State *L); int w_push(lua_State *L); int w_pop(lua_State *L); int w_rotate(lua_State *L); diff --git a/src/modules/graphics/opengl/wrap_Image.h b/src/modules/graphics/opengl/wrap_Image.h index 2735a31bc..2b1a680e5 100644 --- a/src/modules/graphics/opengl/wrap_Image.h +++ b/src/modules/graphics/opengl/wrap_Image.h @@ -37,7 +37,7 @@ int w_Image_getWidth(lua_State *L); int w_Image_getHeight(lua_State *L); int w_Image_getDimensions(lua_State *L); int w_Image_setFilter(lua_State *L); -int w_image_getFilter(lua_State *L); +int w_Image_getFilter(lua_State *L); int w_Image_setMipmapFilter(lua_State *L); int w_Image_getMipmapFilter(lua_State *L); int w_Image_setWrap(lua_State *L); diff --git a/src/modules/graphics/opengl/wrap_Shader.h b/src/modules/graphics/opengl/wrap_Shader.h index f48a62a00..af092c61b 100644 --- a/src/modules/graphics/opengl/wrap_Shader.h +++ b/src/modules/graphics/opengl/wrap_Shader.h @@ -37,6 +37,7 @@ int w_Shader_sendInt(lua_State *L); int w_Shader_sendFloat(lua_State *L); int w_Shader_sendMatrix(lua_State *L); int w_Shader_sendImage(lua_State *L); +int w_Shader_sendCanvas(lua_State *L); int w_Shader_send(lua_State *L); extern "C" int luaopen_shader(lua_State *L); diff --git a/src/modules/sound/lullaby/VorbisDecoder.cpp b/src/modules/sound/lullaby/VorbisDecoder.cpp index 81fe85d19..e30b80c89 100644 --- a/src/modules/sound/lullaby/VorbisDecoder.cpp +++ b/src/modules/sound/lullaby/VorbisDecoder.cpp @@ -34,13 +34,13 @@ namespace lullaby /** * CALLBACK FUNCTIONS **/ -int vorbisClose(void * /* ptr to the data that the vorbis files need*/) +static int vorbisClose(void * /* ptr to the data that the vorbis files need*/) { // Does nothing (handled elsewhere) return 1; } -size_t vorbisRead(void *ptr /* ptr to the data that the vorbis files need*/, +static size_t vorbisRead(void *ptr /* ptr to the data that the vorbis files need*/, size_t byteSize /* how big a byte is*/, size_t sizeToRead /* How much we can read*/, void *datasource /* this is a pointer to the data we passed into ov_open_callbacks (our SOggFile struct*/) @@ -72,7 +72,7 @@ size_t vorbisRead(void *ptr /* ptr to the data that the vorbis files need*/, return actualSizeToRead; } -int vorbisSeek(void *datasource /* ptr to the data that the vorbis files need*/, +static int vorbisSeek(void *datasource /* ptr to the data that the vorbis files need*/, ogg_int64_t offset /*offset from the point we wish to seek to*/, int whence /*where we want to seek to*/) { @@ -116,7 +116,7 @@ int vorbisSeek(void *datasource /* ptr to the data that the vorbis files need*/, return 0; } -long vorbisTell(void *datasource /* ptr to the data that the vorbis files need*/) +static long vorbisTell(void *datasource /* ptr to the data that the vorbis files need*/) { SOggFile *vorbisData; vorbisData = (SOggFile *) datasource; diff --git a/src/modules/sound/wrap_SoundData.h b/src/modules/sound/wrap_SoundData.h index 365cfa942..94c7f6522 100644 --- a/src/modules/sound/wrap_SoundData.h +++ b/src/modules/sound/wrap_SoundData.h @@ -31,14 +31,13 @@ namespace sound { SoundData *luax_checksounddata(lua_State *L, int idx); -int w_getSize(lua_State *L); -int w_getChannels(lua_State *L); -int w_getBitDepth(lua_State *L); -int w_getSampleRate(lua_State *L); -int w_getSampleCount(lua_State *L); -int w_getDuration(lua_State *L); -int w_setSample(lua_State *L); -int w_getSample(lua_State *L); +int w_SoundData_getChannels(lua_State *L); +int w_SoundData_getBitDepth(lua_State *L); +int w_SoundData_getSampleRate(lua_State *L); +int w_SoundData_getSampleCount(lua_State *L); +int w_SoundData_getDuration(lua_State *L); +int w_SoundData_setSample(lua_State *L); +int w_SoundData_getSample(lua_State *L); extern "C" int luaopen_sounddata(lua_State *L); } // sound