From 232ce34d54f7050775da891d874030b0f3f4f237 Mon Sep 17 00:00:00 2001 From: John McCardle Date: Sat, 12 Aug 2023 10:57:53 -0400 Subject: [PATCH] Cleanup: remove references to DrawSprite API method (debug method to draw on SFML window for a single frame) --- src/McRFPy_API.cpp | 26 -------------------------- src/McRFPy_API.h | 3 --- 2 files changed, 29 deletions(-) diff --git a/src/McRFPy_API.cpp b/src/McRFPy_API.cpp index e759fdd..d5bfcf7 100644 --- a/src/McRFPy_API.cpp +++ b/src/McRFPy_API.cpp @@ -19,9 +19,6 @@ bool McRFPy_API::do_camfollow; EntityManager McRFPy_API::entities; static PyMethodDef mcrfpyMethods[] = { - {"drawSprite", McRFPy_API::_drawSprite, METH_VARARGS, - "Draw a sprite (index, x, y)"}, - {"createMenu", McRFPy_API::_createMenu, METH_VARARGS, "Create a new uimenu (name_str, x, y, w, h)"}, @@ -176,29 +173,6 @@ void McRFPy_API::setSpriteTexture(int ti) // functionality //void McRFPy_API:: -// functionality -void McRFPy_API::drawSprite(int tex_index, int grid_x, int grid_y) -{ - setSpriteTexture(tex_index); - sprite.setPosition( - sf::Vector2f(grid_x * texture_size, - grid_y * texture_size) - ); - game->getWindow().draw(sprite); -} - -// python connection -PyObject* McRFPy_API::_drawSprite(PyObject *self, PyObject *args) -{ - int ti, gx, gy; - if (!PyArg_ParseTuple(args, "iii", &ti, &gx, &gy)) return NULL; - drawSprite(ti, gx, gy); - - // return None correctly - Py_INCREF(Py_None); - return Py_None; -} - void McRFPy_API::api_init() { // build API exposure before python initialization diff --git a/src/McRFPy_API.h b/src/McRFPy_API.h index b9c07a5..03cd79c 100644 --- a/src/McRFPy_API.h +++ b/src/McRFPy_API.h @@ -136,9 +136,6 @@ public: //void spawnEntity(int tex_index, int grid_x, int grid_y, PyObject* script); - // test function, do not use in production - static void drawSprite(int tex_index, int grid_x, int grid_y); - static void executeScript(std::string); static void executePyString(std::string); };