remove yaze_py
This commit is contained in:
@@ -1,49 +0,0 @@
|
|||||||
#include <boost/python.hpp>
|
|
||||||
|
|
||||||
#include "incl/extension.h"
|
|
||||||
#include "incl/overworld.h"
|
|
||||||
#include "incl/snes_color.h"
|
|
||||||
#include "yaze.h"
|
|
||||||
|
|
||||||
BOOST_PYTHON_MODULE(yaze_py) {
|
|
||||||
using namespace boost::python;
|
|
||||||
|
|
||||||
class_<z3_rom>("z3_rom")
|
|
||||||
.def_readonly("filename", &z3_rom::filename)
|
|
||||||
.def_readonly("data", &z3_rom::data)
|
|
||||||
.def_readonly("size", &z3_rom::size)
|
|
||||||
.def_readonly("impl", &z3_rom::impl);
|
|
||||||
|
|
||||||
class_<snes_color>("snes_color")
|
|
||||||
.def_readonly("red", &snes_color::red)
|
|
||||||
.def_readonly("green", &snes_color::green)
|
|
||||||
.def_readonly("blue", &snes_color::blue);
|
|
||||||
|
|
||||||
class_<snes_palette>("snes_palette")
|
|
||||||
.def_readonly("id", &snes_palette::id)
|
|
||||||
.def_readonly("size", &snes_palette::size)
|
|
||||||
.def_readonly("colors", &snes_palette::colors);
|
|
||||||
|
|
||||||
class_<yaze_flags>("yaze_flags")
|
|
||||||
.def_readwrite("debug", &yaze_flags::debug)
|
|
||||||
.def_readwrite("rom_filename", &yaze_flags::rom_filename)
|
|
||||||
.def_readwrite("rom", &yaze_flags::rom);
|
|
||||||
|
|
||||||
class_<yaze_project>("yaze_project")
|
|
||||||
.def_readonly("filename", &yaze_project::filepath);
|
|
||||||
|
|
||||||
class_<yaze_editor_context>("yaze_editor_context")
|
|
||||||
.def_readonly("project", &yaze_editor_context::project);
|
|
||||||
|
|
||||||
class_<yaze_extension>("yaze_extension")
|
|
||||||
.def_readonly("name", &yaze_extension::name)
|
|
||||||
.def_readonly("version", &yaze_extension::version);
|
|
||||||
|
|
||||||
// Functions that return raw pointers need to be managed by Python's garbage
|
|
||||||
// collector
|
|
||||||
def("yaze_load_rom", &yaze_load_rom,
|
|
||||||
return_value_policy<manage_new_object>());
|
|
||||||
def("yaze_unload_rom", &yaze_unload_rom); // No need to manage memory here
|
|
||||||
def("yaze_get_color_from_paletteset", &yaze_get_color_from_paletteset);
|
|
||||||
def("yaze_check_version", &yaze_check_version);
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
find_package(PythonLibs 3.11 REQUIRED)
|
|
||||||
find_package(Boost COMPONENTS python3 REQUIRED)
|
|
||||||
|
|
||||||
# target x86_64 for module
|
|
||||||
add_library(
|
|
||||||
yaze_py MODULE
|
|
||||||
py/yaze_py.cc
|
|
||||||
yaze.cc
|
|
||||||
app/rom.cc
|
|
||||||
app/core/labeling.cc
|
|
||||||
app/zelda3/overworld/overworld_map.cc
|
|
||||||
app/zelda3/overworld/overworld.cc
|
|
||||||
app/zelda3/sprite/sprite.cc
|
|
||||||
app/editor/utils/gfx_context.cc
|
|
||||||
${YAZE_APP_GFX_SRC}
|
|
||||||
${IMGUI_PATH}/imgui.cpp
|
|
||||||
${IMGUI_PATH}/imgui_demo.cpp
|
|
||||||
${IMGUI_PATH}/imgui_draw.cpp
|
|
||||||
${IMGUI_PATH}/imgui_widgets.cpp
|
|
||||||
${IMGUI_PATH}/misc/cpp/imgui_stdlib.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
set(PYTHON_HEADERS /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers)
|
|
||||||
elseif(LINUX)
|
|
||||||
set(PYTHON_HEADERS /usr/include/python3.8)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_include_directories(
|
|
||||||
yaze_py PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/
|
|
||||||
lib/
|
|
||||||
app/
|
|
||||||
${SDL_INCLUDE_DIR}
|
|
||||||
${PYTHON_HEADERS}
|
|
||||||
${Boost_INCLUDE_DIRS}
|
|
||||||
${PYTHON_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(
|
|
||||||
yaze_py PUBLIC
|
|
||||||
${SDL_TARGETS}
|
|
||||||
${ABSL_TARGETS}
|
|
||||||
${PYTHON_LIBRARIES}
|
|
||||||
${PNG_LIBRARIES}
|
|
||||||
Boost::python3
|
|
||||||
ImGui
|
|
||||||
ImGuiTestEngine
|
|
||||||
)
|
|
||||||
Reference in New Issue
Block a user