cleaning up for merge
This commit is contained in:
parent
d7228172c4
commit
b114ec3085
5 changed files with 40 additions and 153 deletions
55
src/UI.h
55
src/UI.h
|
|
@ -8,8 +8,6 @@
|
|||
#include "PyCallable.h"
|
||||
#include "PyTexture.h"
|
||||
|
||||
using namespace mcrfpydef;
|
||||
|
||||
enum PyObjectsEnum : int
|
||||
{
|
||||
UIFRAME = 1,
|
||||
|
|
@ -1082,58 +1080,6 @@ static int PyUIDrawable_set_click(PyUIGridObject* self, PyObject* value, void* c
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* Begin PyTextureType defs
|
||||
*
|
||||
*/
|
||||
|
||||
/* // Definition moved to PyTexture.h
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
std::shared_ptr<PyTexture> data;
|
||||
} PyTextureObject;
|
||||
|
||||
|
||||
static int PyTexture_init(PyTextureObject* self, PyObject* args, PyObject* kwds)
|
||||
{
|
||||
//std::cout << "Init called\n";
|
||||
static const char* keywords[] = { "filename", "grid_size", "grid_width", "grid_height", nullptr };
|
||||
char* filename;
|
||||
int grid_size, grid_width, grid_height;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "siii", const_cast<char**>(keywords), &filename, &grid_size, &grid_width, &grid_height))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
//sf::Texture t = sf::Texture();
|
||||
//t.loadFromFile((std::string)filename);
|
||||
self->data = std::make_shared<PyTexture>(filename, grid_size, grid_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyTypeObject PyTextureType = {
|
||||
//PyVarObject_HEAD_INIT(NULL, 0)
|
||||
.tp_name = "mcrfpy.Texture",
|
||||
.tp_basicsize = sizeof(PyTextureObject),
|
||||
.tp_itemsize = 0,
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT,
|
||||
.tp_doc = PyDoc_STR("SFML Texture Object"),
|
||||
.tp_init = (initproc)PyTexture_init,
|
||||
.tp_new = [](PyTypeObject* type, PyObject* args, PyObject* kwds) -> PyObject*
|
||||
{
|
||||
PyTextureObject* self = (PyTextureObject*)type->tp_alloc(type, 0);
|
||||
return (PyObject*)self;
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* End PyTextureType defs
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* Begin template generation for PyUISpriteType
|
||||
|
|
@ -1218,7 +1164,6 @@ static int PyUIDrawable_set_click(PyUIGridObject* self, PyObject* value, void* c
|
|||
|
||||
static PyObject* PyUISprite_get_texture(PyUISpriteObject* self, void* closure)
|
||||
{
|
||||
std::cout << "Calling pyObject" << std::endl;
|
||||
return self->data->getTexture()->pyObject();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue