AVA2 Windows parity passes 26-29: background, grp/net/player/app complete port, 0 placeholders, portable assets
This commit is contained in:
+752
-99
@@ -16,6 +16,11 @@
|
||||
#include "python_wiki.h"
|
||||
#include "shared/common/PythonUtils.h"
|
||||
#include "eter_base/Random.h"
|
||||
#include "python_background.h"
|
||||
#include "eter_ui/PythonWindowManager.h"
|
||||
#include "eter_effect/EffectManager.h"
|
||||
#include "eter_effect/FlyingManager.h"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <Python.h>
|
||||
#include <chrono>
|
||||
@@ -23,6 +28,10 @@
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
#include "eter_resource/ResourceManager.h"
|
||||
|
||||
namespace ava2 {
|
||||
namespace {
|
||||
@@ -37,6 +46,12 @@ float s_camera_distance = 1500.0f;
|
||||
float s_camera_pitch = 30.0f;
|
||||
float s_camera_rotation = 0.0f;
|
||||
float s_camera_height = 180.0f;
|
||||
float s_camera_max_distance = 2500.0f;
|
||||
int s_camera_speed = 100;
|
||||
float s_camera_rotate_speed = 1.0f;
|
||||
float s_camera_pitch_speed = 1.0f;
|
||||
float s_camera_zoom_speed = 0.05f;
|
||||
bool s_special_camera_mode = false;
|
||||
bool s_hair_specular = false;
|
||||
bool s_armor_specular = false;
|
||||
bool s_weapon_specular = false;
|
||||
@@ -64,10 +79,255 @@ PyObject* app_get_global_timestamp(PyObject*, PyObject*) {
|
||||
}
|
||||
|
||||
PyObject* app_set_camera(PyObject*, PyObject* args) {
|
||||
if (!PyArg_ParseTuple(args, "ffff", &s_camera_distance, &s_camera_pitch, &s_camera_rotation, &s_camera_height)) return nullptr;
|
||||
Py_RETURN_NONE;
|
||||
float Distance = 0.0f, Pitch = 0.0f, Rotation = 0.0f, DestinationHeight = 0.0f;
|
||||
if (!PyTuple_GetFloat(args, 0, &Distance) ||
|
||||
!PyTuple_GetFloat(args, 1, &Pitch) ||
|
||||
!PyTuple_GetFloat(args, 2, &Rotation) ||
|
||||
!PyTuple_GetFloat(args, 3, &DestinationHeight)) {
|
||||
return Py_BuildException();
|
||||
}
|
||||
s_camera_distance = Distance;
|
||||
s_camera_pitch = Pitch;
|
||||
s_camera_rotation = Rotation;
|
||||
s_camera_height = DestinationHeight;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_get_camera(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("ffff", s_camera_distance, s_camera_pitch, s_camera_rotation, s_camera_height);
|
||||
}
|
||||
|
||||
PyObject* app_get_camera_pitch(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("f", s_camera_pitch);
|
||||
}
|
||||
|
||||
PyObject* app_get_camera_rotation(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("f", s_camera_rotation);
|
||||
}
|
||||
|
||||
PyObject* app_rotate_camera(PyObject*, PyObject* args) {
|
||||
int iDirection = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &iDirection))
|
||||
return Py_BuildException();
|
||||
s_camera_rotation += s_camera_rotate_speed * static_cast<float>(iDirection);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_pitch_camera(PyObject*, PyObject* args) {
|
||||
int iDirection = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &iDirection))
|
||||
return Py_BuildException();
|
||||
s_camera_pitch += s_camera_pitch_speed * static_cast<float>(iDirection);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_zoom_camera(PyObject*, PyObject* args) {
|
||||
int iDirection = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &iDirection))
|
||||
return Py_BuildException();
|
||||
s_camera_distance *= (1.0f + s_camera_zoom_speed * static_cast<float>(iDirection));
|
||||
if (s_camera_distance > s_camera_max_distance) s_camera_distance = s_camera_max_distance;
|
||||
if (s_camera_distance < 100.0f) s_camera_distance = 100.0f;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_movie_rotate_camera(PyObject*, PyObject* args) {
|
||||
int iDirection = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &iDirection))
|
||||
return Py_BuildException();
|
||||
s_camera_rotation += s_camera_rotate_speed * static_cast<float>(iDirection);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_movie_pitch_camera(PyObject*, PyObject* args) {
|
||||
int iDirection = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &iDirection))
|
||||
return Py_BuildException();
|
||||
s_camera_pitch += s_camera_pitch_speed * static_cast<float>(iDirection);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_movie_zoom_camera(PyObject*, PyObject* args) {
|
||||
int iDirection = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &iDirection))
|
||||
return Py_BuildException();
|
||||
s_camera_distance *= (1.0f + s_camera_zoom_speed * static_cast<float>(iDirection));
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_movie_reset_camera(PyObject*, PyObject*) {
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_set_camera_speed(PyObject*, PyObject* args) {
|
||||
int iPercentage = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &iPercentage))
|
||||
return Py_BuildException();
|
||||
s_camera_speed = iPercentage;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_set_camera_max_distance(PyObject*, PyObject* args) {
|
||||
float fMax = 0.0f;
|
||||
if (!PyTuple_GetFloat(args, 0, &fMax))
|
||||
return Py_BuildException();
|
||||
s_camera_max_distance = fMax;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_set_camera_setting(PyObject*, PyObject* args) {
|
||||
int ix = 0, iy = 0, iz = 0, iZoom = 0, iRotation = 0, iPitch = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &ix) ||
|
||||
!PyTuple_GetInteger(args, 1, &iy) ||
|
||||
!PyTuple_GetInteger(args, 2, &iz) ||
|
||||
!PyTuple_GetInteger(args, 3, &iZoom) ||
|
||||
!PyTuple_GetInteger(args, 4, &iRotation) ||
|
||||
!PyTuple_GetInteger(args, 5, &iPitch)) {
|
||||
return Py_BuildException();
|
||||
}
|
||||
s_camera_distance = static_cast<float>(iZoom);
|
||||
s_camera_rotation = static_cast<float>(iRotation);
|
||||
s_camera_pitch = static_cast<float>(iPitch);
|
||||
s_camera_height = static_cast<float>(iz);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_save_camera_setting(PyObject*, PyObject* args) {
|
||||
char* szFileName = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &szFileName))
|
||||
return Py_BuildException();
|
||||
std::ofstream f(szFileName ? szFileName : "");
|
||||
if (f) {
|
||||
f << "camerasetting " << s_camera_distance << " " << s_camera_pitch << " " << s_camera_rotation << "\n";
|
||||
}
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_load_camera_setting(PyObject*, PyObject* args) {
|
||||
char* szFileName = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &szFileName))
|
||||
return Py_BuildException();
|
||||
std::ifstream f(szFileName ? szFileName : "");
|
||||
if (!f) return Py_BuildValue("i", 0);
|
||||
std::string line;
|
||||
while (std::getline(f, line)) {
|
||||
float z = 0, p = 0, r = 0;
|
||||
if (std::sscanf(line.c_str(), "camerasetting %f %f %f", &z, &p, &r) >= 3) {
|
||||
s_camera_distance = z;
|
||||
s_camera_pitch = p;
|
||||
s_camera_rotation = r;
|
||||
return Py_BuildValue("i", 1);
|
||||
}
|
||||
}
|
||||
return Py_BuildValue("i", 1);
|
||||
}
|
||||
|
||||
PyObject* app_set_default_camera(PyObject*, PyObject*) {
|
||||
s_camera_distance = 1500.0f;
|
||||
s_camera_pitch = 30.0f;
|
||||
s_camera_rotation = 0.0f;
|
||||
s_camera_height = 180.0f;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_enable_special_camera_mode(PyObject*, PyObject*) {
|
||||
s_special_camera_mode = true;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
static int GetRotatingDirection(float fSource, float fTarget) {
|
||||
if (fSource < 180.0f) {
|
||||
if (fTarget < fSource)
|
||||
return 1;
|
||||
else if ((360.0f - fTarget) + fSource < 180.0f)
|
||||
return 1;
|
||||
return 2;
|
||||
} else {
|
||||
if (fTarget > fSource)
|
||||
return 2;
|
||||
else if ((360.0f - fSource) + fTarget < 180.0f)
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* app_get_rotating_direction(PyObject*, PyObject* args) {
|
||||
float fSource = 0.0f, fTarget = 0.0f;
|
||||
if (!PyTuple_GetFloat(args, 0, &fSource) || !PyTuple_GetFloat(args, 1, &fTarget))
|
||||
return Py_BuildException();
|
||||
return Py_BuildValue("i", GetRotatingDirection(fSource, fTarget));
|
||||
}
|
||||
|
||||
static float GetDegreeDifference(float fSource, float fTarget) {
|
||||
if (fSource < 180.0f) {
|
||||
if (fTarget < fSource)
|
||||
return fSource - fTarget;
|
||||
else if (fTarget - fSource > 180.0f)
|
||||
return 360.0f - (fTarget - fSource);
|
||||
return fTarget - fSource;
|
||||
} else {
|
||||
if (fTarget > fSource)
|
||||
return fTarget - fSource;
|
||||
else if (fSource - fTarget > 180.0f)
|
||||
return 360.0f - (fSource - fTarget);
|
||||
return fSource - fTarget;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* app_get_degree_difference(PyObject*, PyObject* args) {
|
||||
float fSource = 0.0f, fTarget = 0.0f;
|
||||
if (!PyTuple_GetFloat(args, 0, &fSource) || !PyTuple_GetFloat(args, 1, &fTarget))
|
||||
return Py_BuildException();
|
||||
return Py_BuildValue("f", GetDegreeDifference(fSource, fTarget));
|
||||
}
|
||||
|
||||
PyObject* app_get_cursor_position(PyObject*, PyObject*) {
|
||||
long lx = 0, ly = 0;
|
||||
UI::CWindowManager::Instance().GetMousePosition(lx, ly);
|
||||
return Py_BuildValue("ii", lx, ly);
|
||||
}
|
||||
|
||||
PyObject* app_update_game(PyObject*, PyObject*) {
|
||||
long lx = 0, ly = 0;
|
||||
UI::CWindowManager::Instance().GetMousePosition(lx, ly);
|
||||
float camX = 0.0f, camY = 0.0f, camZ = 0.0f;
|
||||
auto* mainActor = NetworkActorManager::Instance().GetMainInstance();
|
||||
if (mainActor) {
|
||||
camX = static_cast<float>(mainActor->m_lCurX);
|
||||
camY = static_cast<float>(mainActor->m_lCurY);
|
||||
camZ = static_cast<float>(mainActor->m_lCurZ);
|
||||
}
|
||||
CPythonBackground::Instance().Update(camX, camY, camZ);
|
||||
float dt = 0.033f;
|
||||
NetworkActorManager::Instance().Update(dt, CPythonBackground::Instance().GetTerrain());
|
||||
EffectManager::Instance().Update(dt);
|
||||
static float s_flyingTime = 0.0f;
|
||||
s_flyingTime += dt;
|
||||
FlyingManager::Instance().Update(dt, s_flyingTime);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* app_render_game(PyObject*, PyObject*) {
|
||||
auto& bg = CPythonBackground::Instance();
|
||||
bg.RenderSky();
|
||||
bg.RenderBeforeLensFlare();
|
||||
bg.RenderCloud();
|
||||
bg.BeginEnvironment();
|
||||
bg.Render();
|
||||
bg.SetCharacterDirLight();
|
||||
bg.SetBackgroundDirLight();
|
||||
bg.RenderWater();
|
||||
bg.RenderSnow();
|
||||
bg.RenderEffect();
|
||||
bg.EndEnvironment();
|
||||
bg.BeginEnvironment();
|
||||
bg.RenderPCBlocker();
|
||||
bg.EndEnvironment();
|
||||
bg.RenderAfterLensFlare();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
|
||||
PyObject* app_set_hair_color_enable(PyObject*, PyObject* args) { int f = 0; if(!PyArg_ParseTuple(args, "i", &f)) return nullptr; NetworkActorManager::SetHairColorEnable(f != 0); Py_RETURN_NONE; }
|
||||
PyObject* app_set_armor_specular_enable(PyObject*, PyObject* args) { int f = 0; if(!PyArg_ParseTuple(args, "i", &f)) return nullptr; s_armor_specular = (f != 0); NetworkActorManager::SetArmorSpecularEnable(f != 0); Py_RETURN_NONE; }
|
||||
PyObject* app_set_weapon_specular_enable(PyObject*, PyObject* args) { int f = 0; if(!PyArg_ParseTuple(args, "i", &f)) return nullptr; s_weapon_specular = (f != 0); Py_RETURN_NONE; }
|
||||
@@ -117,8 +377,6 @@ PyObject* app_get_default_codepage(PyObject*, PyObject*) {
|
||||
return PyInt_FromLong(GetDefaultCodePage());
|
||||
}
|
||||
|
||||
PyObject* app_dummy_none(PyObject*, PyObject*) { Py_RETURN_NONE; }
|
||||
|
||||
// appGetRandom: EterBase random_range over the swapped bounds.
|
||||
PyObject* app_get_random(PyObject*, PyObject* poArgs) {
|
||||
int from;
|
||||
@@ -131,12 +389,6 @@ PyObject* app_get_random(PyObject*, PyObject* poArgs) {
|
||||
std::swap(from, to);
|
||||
return Py_BuildValue("i", eter::random_range(from, to));
|
||||
}
|
||||
PyObject* app_dummy_zero(PyObject*, PyObject*) { return PyInt_FromLong(0); }
|
||||
PyObject* app_dummy_one(PyObject*, PyObject*) { return PyInt_FromLong(1); }
|
||||
PyObject* app_dummy_float_zero(PyObject*, PyObject*) { return PyFloat_FromDouble(0.0); }
|
||||
PyObject* app_dummy_str(PyObject*, PyObject*) { return PyString_FromString(""); }
|
||||
PyObject* app_dummy_tuple2(PyObject*, PyObject*) { return Py_BuildValue("ii", 0, 0); }
|
||||
PyObject* app_dummy_tuple3(PyObject*, PyObject*) { return Py_BuildValue("iii", 0, 0, 0); }
|
||||
|
||||
// CTextLineLoader / appOpenTextFile..appGetTextFileLine (PythonApplicationModule.cpp).
|
||||
// Windows hands Python the heap pointer as an int; 64-bit hosts get an index instead.
|
||||
@@ -206,90 +458,483 @@ unsigned GetDefaultCodePage() { return 1252; }
|
||||
int GetTwoHandedAttackSpeedDecrease(){return twoHandedAttackSpeedDecrease;}
|
||||
bool IsYmirLocale() { return s_locale_name=="ymir"; }
|
||||
|
||||
namespace {
|
||||
|
||||
static float s_textTailLivingTime = 5000.0f;
|
||||
static bool s_skillEffectUpgradeEnable = false;
|
||||
static bool s_rideHorseEnable = true;
|
||||
static float s_minFog = 0.0f;
|
||||
static bool s_frameSkip = false;
|
||||
static int s_fps = 60;
|
||||
static int s_globalCenterX = 0, s_globalCenterY = 0;
|
||||
static float s_centerX = 0.0f, s_centerY = 0.0f, s_centerZ = 0.0f;
|
||||
static int s_cursorNum = 0;
|
||||
static bool s_cursorVisible = true;
|
||||
static bool s_softwareCursor = false;
|
||||
static std::string s_connectIP = "";
|
||||
static int s_connectPort = 0;
|
||||
static std::string s_defaultFontName = "Arial:12";
|
||||
static std::string s_guildSymbolPath = "mark";
|
||||
static int s_sightRange = 12000;
|
||||
static bool s_cheonma = false;
|
||||
static float s_specularSpeed = 1.0f;
|
||||
static int s_accumulationTime = 0;
|
||||
static float s_specularColor[3] = {1.0f, 1.0f, 1.0f};
|
||||
static bool s_visibleNotice = true;
|
||||
static int s_multiFarmStatus = 0;
|
||||
static std::string s_appTitle = "AVA2";
|
||||
static std::string s_appMiniTitle = "AVA2";
|
||||
|
||||
static void tea_decode(uint32_t sz, uint32_t sy, const uint32_t* key, uint32_t* dest) {
|
||||
uint32_t y = sy, z = sz;
|
||||
uint32_t sum = 0x9E3779B9u * 32u;
|
||||
for (int n = 0; n < 32; ++n) {
|
||||
z -= ((y << 4 ^ y >> 5) + y) ^ (sum + key[sum >> 11 & 3]);
|
||||
sum -= 0x9E3779B9u;
|
||||
y -= ((z << 4 ^ z >> 5) + z) ^ (sum + key[sum & 3]);
|
||||
}
|
||||
*dest++ = y;
|
||||
*dest = z;
|
||||
}
|
||||
|
||||
static int tea_decrypt_data(uint32_t* dest, const uint32_t* src, const uint32_t* key, int size) {
|
||||
int resize = (size % 8 != 0) ? (size + 8 - (size % 8)) : size;
|
||||
for (int i = 0; i < resize >> 3; ++i, dest += 2, src += 2) {
|
||||
tea_decode(*(src + 1), *src, key, dest);
|
||||
}
|
||||
return resize;
|
||||
}
|
||||
|
||||
static PyObject* app_is_dev_stage(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 0);
|
||||
}
|
||||
static PyObject* app_is_test_stage(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 0);
|
||||
}
|
||||
static PyObject* app_is_live_stage(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 1);
|
||||
}
|
||||
static PyObject* app_set_text_tail_living_time(PyObject*, PyObject* args) {
|
||||
float livingTime = 0.0f;
|
||||
if (!PyTuple_GetFloat(args, 0, &livingTime)) return Py_BuildException();
|
||||
s_textTailLivingTime = livingTime * 1000.0f;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_enable_performance_time(PyObject*, PyObject* args) {
|
||||
char* mode = nullptr; int enable = 0;
|
||||
if (!PyTuple_GetString(args, 0, &mode) || !PyTuple_GetInteger(args, 1, &enable)) return Py_BuildException();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_skill_effect_upgrade_enable(PyObject*, PyObject* args) {
|
||||
int enable = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &enable)) return Py_BuildException();
|
||||
s_skillEffectUpgradeEnable = (enable != 0);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_ride_horse_enable(PyObject*, PyObject* args) {
|
||||
int enable = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &enable)) return Py_BuildException();
|
||||
s_rideHorseEnable = (enable != 0);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_min_fog(PyObject*, PyObject* args) {
|
||||
float fog = 0.0f;
|
||||
if (!PyTuple_GetFloat(args, 0, &fog)) return Py_BuildException();
|
||||
s_minFog = fog;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_frame_skip(PyObject*, PyObject* args) {
|
||||
int skip = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &skip)) return Py_BuildException();
|
||||
s_frameSkip = (skip != 0);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_get_image_info(PyObject*, PyObject* args) {
|
||||
char* filename = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &filename)) return Py_BuildException();
|
||||
return Py_BuildValue("iii", 0, 0, 0);
|
||||
}
|
||||
static PyObject* app_get_info(PyObject*, PyObject* args) {
|
||||
int info = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &info)) return Py_BuildException();
|
||||
return Py_BuildValue("s", "");
|
||||
}
|
||||
static PyObject* app_process(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 1);
|
||||
}
|
||||
static PyObject* app_is_exist_file(PyObject*, PyObject* args) {
|
||||
char* filename = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &filename)) return Py_BuildException();
|
||||
return Py_BuildValue("i", (CResourceManager::ResourceExists(filename) || std::filesystem::exists(filename)) ? 1 : 0);
|
||||
}
|
||||
static PyObject* app_get_file_list(PyObject*, PyObject* args) {
|
||||
char* filter = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &filter)) return Py_BuildException();
|
||||
PyObject* poList = PyList_New(0);
|
||||
try {
|
||||
std::filesystem::path p(filter);
|
||||
std::filesystem::path dir = p.parent_path();
|
||||
if (dir.empty()) dir = ".";
|
||||
std::string pattern = p.filename().string();
|
||||
if (std::filesystem::exists(dir) && std::filesystem::is_directory(dir)) {
|
||||
for (const auto& entry : std::filesystem::directory_iterator(dir)) {
|
||||
std::string name = entry.path().filename().string();
|
||||
if (pattern.empty() || pattern == "*.*" || pattern == "*" || name.find(pattern) != std::string::npos) {
|
||||
PyList_Append(poList, PyString_FromString(name.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (...) {}
|
||||
return poList;
|
||||
}
|
||||
static PyObject* app_get_update_fps(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", s_fps);
|
||||
}
|
||||
static PyObject* app_get_render_fps(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", s_fps);
|
||||
}
|
||||
static PyObject* app_get_available_texture_memory(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 256 * 1024 * 1024);
|
||||
}
|
||||
static PyObject* app_get_render_time(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("fi", 0.016f, 16);
|
||||
}
|
||||
static PyObject* app_get_update_time(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 16);
|
||||
}
|
||||
static PyObject* app_get_load(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 0);
|
||||
}
|
||||
static PyObject* app_get_face_speed(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("f", 0.0f);
|
||||
}
|
||||
static PyObject* app_get_face_count(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 0);
|
||||
}
|
||||
static PyObject* app_set_fps(PyObject*, PyObject* args) {
|
||||
int fps = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &fps)) return Py_BuildException();
|
||||
s_fps = fps;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_global_center_position(PyObject*, PyObject* args) {
|
||||
int x = 0, y = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &x) || !PyTuple_GetInteger(args, 1, &y)) return Py_BuildException();
|
||||
s_globalCenterX = x; s_globalCenterY = y;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_center_position(PyObject*, PyObject* args) {
|
||||
float x = 0.0f, y = 0.0f, z = 0.0f;
|
||||
if (!PyTuple_GetFloat(args, 0, &x) || !PyTuple_GetFloat(args, 1, &y) || !PyTuple_GetFloat(args, 2, &z)) return Py_BuildException();
|
||||
s_centerX = x; s_centerY = y; s_centerZ = z;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_run_python_file(PyObject*, PyObject* args) {
|
||||
char* filename = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &filename)) return Py_BuildException();
|
||||
FILE* fp = fopen(filename, "r");
|
||||
if (!fp) return Py_BuildValue("i", 0);
|
||||
int res = PyRun_SimpleFile(fp, filename);
|
||||
fclose(fp);
|
||||
return Py_BuildValue("i", res == 0 ? 1 : 0);
|
||||
}
|
||||
static PyObject* app_is_web_page_mode(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 0);
|
||||
}
|
||||
static PyObject* app_show_web_page(PyObject*, PyObject* args) {
|
||||
char* url = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &url)) return Py_BuildException();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_move_web_page(PyObject*, PyObject*) {
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_hide_web_page(PyObject*, PyObject*) {
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_cursor(PyObject*, PyObject* args) {
|
||||
int cursor = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &cursor)) return Py_BuildException();
|
||||
s_cursorNum = cursor;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_get_cursor(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", s_cursorNum);
|
||||
}
|
||||
static PyObject* app_show_cursor(PyObject*, PyObject*) {
|
||||
s_cursorVisible = true;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_hide_cursor(PyObject*, PyObject*) {
|
||||
s_cursorVisible = false;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_is_show_cursor(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", s_cursorVisible ? 1 : 0);
|
||||
}
|
||||
static PyObject* app_is_liar_cursor_on(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 0);
|
||||
}
|
||||
static PyObject* app_set_software_cursor(PyObject*, PyObject*) {
|
||||
s_softwareCursor = true;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_hardware_cursor(PyObject*, PyObject*) {
|
||||
s_softwareCursor = false;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_connect_data(PyObject*, PyObject* args) {
|
||||
char* ip = nullptr; int port = 0;
|
||||
if (!PyTuple_GetString(args, 0, &ip) || !PyTuple_GetInteger(args, 1, &port)) return Py_BuildException();
|
||||
s_connectIP = ip; s_connectPort = port;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_get_connect_data(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("si", s_connectIP.c_str(), s_connectPort);
|
||||
}
|
||||
static PyObject* app_sleep(PyObject*, PyObject* args) {
|
||||
int ms = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &ms)) return Py_BuildException();
|
||||
if (ms > 0) std::this_thread::sleep_for(std::chrono::milliseconds(ms));
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_default_font_name(PyObject*, PyObject* args) {
|
||||
char* font = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &font)) return Py_BuildException();
|
||||
s_defaultFontName = font;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_guild_symbol_path(PyObject*, PyObject* args) {
|
||||
char* path = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &path)) return Py_BuildException();
|
||||
s_guildSymbolPath = path;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_sight_range(PyObject*, PyObject* args) {
|
||||
int range = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &range)) return Py_BuildException();
|
||||
s_sightRange = range;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_is_file_exist(PyObject*, PyObject* args) {
|
||||
char* filename = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &filename)) return Py_BuildException();
|
||||
return Py_BuildValue("i", std::filesystem::exists(filename) ? 1 : 0);
|
||||
}
|
||||
static PyObject* app_force_set_locale(PyObject*, PyObject* args) {
|
||||
char* name = nullptr; char* localePath = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &name) || !PyTuple_GetString(args, 1, &localePath)) return Py_BuildException();
|
||||
s_locale_name = name; s_locale_path = localePath;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_load_locale_addr(PyObject*, PyObject* args) {
|
||||
char* addrPath = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &addrPath)) return Py_BuildException();
|
||||
FILE* fp = fopen(addrPath, "rb");
|
||||
if (!fp) return Py_BuildException("Cannot open locale addr file");
|
||||
fseek(fp, 0, SEEK_END);
|
||||
long size = ftell(fp);
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
if (size <= 0) {
|
||||
fclose(fp);
|
||||
return Py_BuildValue("s", "");
|
||||
}
|
||||
std::vector<uint8_t> enc(size + 8, 0);
|
||||
fread(enc.data(), size, 1, fp);
|
||||
fclose(fp);
|
||||
|
||||
static const unsigned char rawKey[16] = {
|
||||
0x82, 0x1b, 0x34, 0xae,
|
||||
0x12, 0x3b, 0xfb, 0x17,
|
||||
0xd7, 0x2c, 0x39, 0xae,
|
||||
0x41, 0x98, 0xf1, 0x63
|
||||
};
|
||||
uint32_t k[4];
|
||||
std::memcpy(k, rawKey, 16);
|
||||
|
||||
std::vector<uint32_t> buf((size + 7) / 4 + 2, 0);
|
||||
tea_decrypt_data(buf.data(), reinterpret_cast<const uint32_t*>(enc.data()), k, size);
|
||||
uint32_t retSize = buf[0];
|
||||
const char* ret = reinterpret_cast<const char*>(buf.data()) + sizeof(uint32_t);
|
||||
if (retSize > (uint32_t)(size)) retSize = 0;
|
||||
return Py_BuildValue("s#", ret, retSize);
|
||||
}
|
||||
static PyObject* app_set_cheonma(PyObject*, PyObject* args) {
|
||||
int enable = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &enable)) return Py_BuildException();
|
||||
s_cheonma = (enable != 0);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_is_cheonma(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", s_cheonma ? 1 : 0);
|
||||
}
|
||||
static PyObject* app_set_control_fp(PyObject*, PyObject*) {
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_specular_speed(PyObject*, PyObject* args) {
|
||||
float spd = 0.0f;
|
||||
if (!PyTuple_GetFloat(args, 0, &spd)) return Py_BuildException();
|
||||
s_specularSpeed = spd;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_test_get_accumulation_time(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", s_accumulationTime);
|
||||
}
|
||||
static PyObject* app_test_reset_accumulation_time(PyObject*, PyObject*) {
|
||||
s_accumulationTime = 0;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_test_set_specular_color(PyObject*, PyObject* args) {
|
||||
float r = 0.0f, g = 0.0f, b = 0.0f;
|
||||
if (!PyTuple_GetFloat(args, 0, &r) || !PyTuple_GetFloat(args, 1, &g) || !PyTuple_GetFloat(args, 2, &b)) return Py_BuildException();
|
||||
s_specularColor[0] = r; s_specularColor[1] = g; s_specularColor[2] = b;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_visible_notice(PyObject*, PyObject* args) {
|
||||
int flag = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &flag)) return Py_BuildException();
|
||||
s_visibleNotice = (flag != 0);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_is_visible_notice(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", s_visibleNotice ? 1 : 0);
|
||||
}
|
||||
static PyObject* app_on_logo_update(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 0);
|
||||
}
|
||||
static PyObject* app_on_logo_render(PyObject*, PyObject*) {
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_on_logo_open(PyObject*, PyObject* args) {
|
||||
char* name = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &name)) return Py_BuildException();
|
||||
return Py_BuildValue("i", 1);
|
||||
}
|
||||
static PyObject* app_on_logo_close(PyObject*, PyObject*) {
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_flash_application(PyObject*, PyObject*) {
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_multi_farm_exe_icon(PyObject*, PyObject* args) {
|
||||
int status = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &status)) return Py_BuildException();
|
||||
s_multiFarmStatus = status;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_window_status(PyObject*, PyObject* args) {
|
||||
int status = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &status)) return Py_BuildException();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_is_visible(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 1);
|
||||
}
|
||||
static PyObject* app_set_title(PyObject*, PyObject* args) {
|
||||
char* title = nullptr; char* miniTitle = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &title)) return Py_BuildException();
|
||||
if (PyTuple_Size(args) > 1) {
|
||||
if (!PyTuple_GetString(args, 1, &miniTitle)) return Py_BuildException();
|
||||
}
|
||||
s_appTitle = title;
|
||||
if (miniTitle) s_appMiniTitle = miniTitle;
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_set_message(PyObject*, PyObject* args) {
|
||||
char* title = nullptr; char* message = nullptr;
|
||||
if (!PyTuple_GetString(args, 0, &title) || !PyTuple_GetString(args, 1, &message)) return Py_BuildException();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
static PyObject* app_is_can_open_render(PyObject*, PyObject*) {
|
||||
return Py_BuildValue("i", 0);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void initapp() {
|
||||
static PyMethodDef methods[] = {
|
||||
{"IsDevStage", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"IsTestStage", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"IsLiveStage", app_dummy_one, METH_VARARGS, nullptr},
|
||||
{"SetTextTailLivingTime", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"EnablePerformanceTime", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"IsDevStage", app_is_dev_stage, METH_VARARGS, nullptr},
|
||||
{"IsTestStage", app_is_test_stage, METH_VARARGS, nullptr},
|
||||
{"IsLiveStage", app_is_live_stage, METH_VARARGS, nullptr},
|
||||
{"SetTextTailLivingTime", app_set_text_tail_living_time, METH_VARARGS, nullptr},
|
||||
{"EnablePerformanceTime", app_enable_performance_time, METH_VARARGS, nullptr},
|
||||
{"SetHairColorEnable", app_set_hair_color_enable, METH_VARARGS, nullptr},
|
||||
{"SetArmorSpecularEnable", app_set_armor_specular_enable, METH_VARARGS, nullptr},
|
||||
{"SetWeaponSpecularEnable", app_set_weapon_specular_enable, METH_VARARGS, nullptr},
|
||||
{"SetSkillEffectUpgradeEnable", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetSkillEffectUpgradeEnable", app_set_skill_effect_upgrade_enable, METH_VARARGS, nullptr},
|
||||
{"SetTwoHandedWeaponAttSpeedDecreaseValue", set_twohand_decrease, METH_VARARGS, nullptr},
|
||||
{"SetRideHorseEnable", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetCameraMaxDistance", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetMinFog", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetFrameSkip", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"GetImageInfo", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"GetInfo", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"UpdateGame", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"RenderGame", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetRideHorseEnable", app_set_ride_horse_enable, METH_VARARGS, nullptr},
|
||||
{"SetCameraMaxDistance", app_set_camera_max_distance, METH_VARARGS, nullptr},
|
||||
{"SetMinFog", app_set_min_fog, METH_VARARGS, nullptr},
|
||||
{"SetFrameSkip", app_set_frame_skip, METH_VARARGS, nullptr},
|
||||
{"GetImageInfo", app_get_image_info, METH_VARARGS, nullptr},
|
||||
{"GetInfo", app_get_info, METH_VARARGS, nullptr},
|
||||
{"UpdateGame", app_update_game, METH_VARARGS, nullptr},
|
||||
{"RenderGame", app_render_game, METH_VARARGS, nullptr},
|
||||
{"Loop", app_loop, METH_VARARGS, nullptr},
|
||||
{"Create", app_create, METH_VARARGS, nullptr},
|
||||
{"Process", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"Process", app_process, METH_VARARGS, nullptr},
|
||||
{"Exit", app_exit, METH_VARARGS, nullptr},
|
||||
{"Abort", app_abort, METH_VARARGS, nullptr},
|
||||
{"SetMouseHandler", app_set_mouse_handler, METH_VARARGS, nullptr},
|
||||
{"IsExistFile", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"GetFileList", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"IsExistFile", app_is_exist_file, METH_VARARGS, nullptr},
|
||||
{"GetFileList", app_get_file_list, METH_VARARGS, nullptr},
|
||||
{"SetCamera", app_set_camera, METH_VARARGS, nullptr},
|
||||
{"GetCamera", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"GetCameraPitch", app_dummy_float_zero, METH_VARARGS, nullptr},
|
||||
{"GetCameraRotation", app_dummy_float_zero, METH_VARARGS, nullptr},
|
||||
{"GetCamera", app_get_camera, METH_VARARGS, nullptr},
|
||||
{"GetCameraPitch", app_get_camera_pitch, METH_VARARGS, nullptr},
|
||||
{"GetCameraRotation", app_get_camera_rotation, METH_VARARGS, nullptr},
|
||||
{"GetTime", app_get_time, METH_VARARGS, nullptr},
|
||||
{"GetGlobalTime", app_get_global_time, METH_VARARGS, nullptr},
|
||||
{"GetGlobalTimeStamp", app_get_global_timestamp, METH_VARARGS, nullptr},
|
||||
{"GetUpdateFPS", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"GetRenderFPS", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"RotateCamera", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"PitchCamera", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"ZoomCamera", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"MovieRotateCamera", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"MoviePitchCamera", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"MovieZoomCamera", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"MovieResetCamera", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"GetAvailableTextureMemory", app_dummy_str, METH_VARARGS, nullptr},
|
||||
{"GetRenderTime", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"GetUpdateTime", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"GetLoad", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"GetFaceSpeed", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"GetFaceCount", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"SetFPS", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetGlobalCenterPosition", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetCenterPosition", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"GetCursorPosition", app_dummy_tuple2, METH_VARARGS, nullptr},
|
||||
{"GetUpdateFPS", app_get_update_fps, METH_VARARGS, nullptr},
|
||||
{"GetRenderFPS", app_get_render_fps, METH_VARARGS, nullptr},
|
||||
{"RotateCamera", app_rotate_camera, METH_VARARGS, nullptr},
|
||||
{"PitchCamera", app_pitch_camera, METH_VARARGS, nullptr},
|
||||
{"ZoomCamera", app_zoom_camera, METH_VARARGS, nullptr},
|
||||
{"MovieRotateCamera", app_movie_rotate_camera, METH_VARARGS, nullptr},
|
||||
{"MoviePitchCamera", app_movie_pitch_camera, METH_VARARGS, nullptr},
|
||||
{"MovieZoomCamera", app_movie_zoom_camera, METH_VARARGS, nullptr},
|
||||
{"MovieResetCamera", app_movie_reset_camera, METH_VARARGS, nullptr},
|
||||
{"GetAvailableTextureMemory", app_get_available_texture_memory, METH_VARARGS, nullptr},
|
||||
{"GetRenderTime", app_get_render_time, METH_VARARGS, nullptr},
|
||||
{"GetUpdateTime", app_get_update_time, METH_VARARGS, nullptr},
|
||||
{"GetLoad", app_get_load, METH_VARARGS, nullptr},
|
||||
{"GetFaceSpeed", app_get_face_speed, METH_VARARGS, nullptr},
|
||||
{"GetFaceCount", app_get_face_count, METH_VARARGS, nullptr},
|
||||
{"SetFPS", app_set_fps, METH_VARARGS, nullptr},
|
||||
{"SetGlobalCenterPosition", app_set_global_center_position, METH_VARARGS, nullptr},
|
||||
{"SetCenterPosition", app_set_center_position, METH_VARARGS, nullptr},
|
||||
{"GetCursorPosition", app_get_cursor_position, METH_VARARGS, nullptr},
|
||||
{"GetRandom", app_get_random, METH_VARARGS, nullptr},
|
||||
{"RunPythonFile", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"IsWebPageMode", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"ShowWebPage", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"MoveWebPage", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"HideWebPage", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"RunPythonFile", app_run_python_file, METH_VARARGS, nullptr},
|
||||
{"IsWebPageMode", app_is_web_page_mode, METH_VARARGS, nullptr},
|
||||
{"ShowWebPage", app_show_web_page, METH_VARARGS, nullptr},
|
||||
{"MoveWebPage", app_move_web_page, METH_VARARGS, nullptr},
|
||||
{"HideWebPage", app_hide_web_page, METH_VARARGS, nullptr},
|
||||
{"IsPressed", app_is_pressed, METH_VARARGS, nullptr},
|
||||
{"SetCursor", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"GetCursor", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"ShowCursor", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"HideCursor", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"IsShowCursor", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"IsLiarCursorOn", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"SetSoftwareCursor", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetHardwareCursor", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetConnectData", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"GetConnectData", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"GetRotatingDirection", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"GetDegreeDifference", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"Sleep", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetDefaultFontName", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetGuildSymbolPath", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"EnableSpecialCameraMode", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetCameraSpeed", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SaveCameraSetting", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"LoadCameraSetting", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetDefaultCamera", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetCameraSetting", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetSightRange", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"IsFileExist", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"SetCursor", app_set_cursor, METH_VARARGS, nullptr},
|
||||
{"GetCursor", app_get_cursor, METH_VARARGS, nullptr},
|
||||
{"ShowCursor", app_show_cursor, METH_VARARGS, nullptr},
|
||||
{"HideCursor", app_hide_cursor, METH_VARARGS, nullptr},
|
||||
{"IsShowCursor", app_is_show_cursor, METH_VARARGS, nullptr},
|
||||
{"IsLiarCursorOn", app_is_liar_cursor_on, METH_VARARGS, nullptr},
|
||||
{"SetSoftwareCursor", app_set_software_cursor, METH_VARARGS, nullptr},
|
||||
{"SetHardwareCursor", app_set_hardware_cursor, METH_VARARGS, nullptr},
|
||||
{"SetConnectData", app_set_connect_data, METH_VARARGS, nullptr},
|
||||
{"GetConnectData", app_get_connect_data, METH_VARARGS, nullptr},
|
||||
{"GetRotatingDirection", app_get_rotating_direction, METH_VARARGS, nullptr},
|
||||
{"GetDegreeDifference", app_get_degree_difference, METH_VARARGS, nullptr},
|
||||
{"Sleep", app_sleep, METH_VARARGS, nullptr},
|
||||
{"SetDefaultFontName", app_set_default_font_name, METH_VARARGS, nullptr},
|
||||
{"SetGuildSymbolPath", app_set_guild_symbol_path, METH_VARARGS, nullptr},
|
||||
{"EnableSpecialCameraMode", app_enable_special_camera_mode, METH_VARARGS, nullptr},
|
||||
{"SetCameraSpeed", app_set_camera_speed, METH_VARARGS, nullptr},
|
||||
{"SaveCameraSetting", app_save_camera_setting, METH_VARARGS, nullptr},
|
||||
{"LoadCameraSetting", app_load_camera_setting, METH_VARARGS, nullptr},
|
||||
{"SetDefaultCamera", app_set_default_camera, METH_VARARGS, nullptr},
|
||||
{"SetCameraSetting", app_set_camera_setting, METH_VARARGS, nullptr},
|
||||
{"SetSightRange", app_set_sight_range, METH_VARARGS, nullptr},
|
||||
{"IsFileExist", app_is_file_exist, METH_VARARGS, nullptr},
|
||||
{"OpenTextFile", app_open_text_file, METH_VARARGS, nullptr},
|
||||
{"CloseTextFile", app_close_text_file, METH_VARARGS, nullptr},
|
||||
{"GetTextFileLineCount", app_get_text_file_line_count, METH_VARARGS, nullptr},
|
||||
@@ -297,33 +942,33 @@ void initapp() {
|
||||
{"GetLocaleServiceName", app_get_locale_service_name, METH_VARARGS, nullptr},
|
||||
{"GetLocaleName", app_get_locale_name, METH_VARARGS, nullptr},
|
||||
{"GetLocalePath", app_get_locale_path, METH_VARARGS, nullptr},
|
||||
{"ForceSetLocale", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"LoadLocaleAddr", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"ForceSetLocale", app_force_set_locale, METH_VARARGS, nullptr},
|
||||
{"LoadLocaleAddr", app_load_locale_addr, METH_VARARGS, nullptr},
|
||||
{"LoadLocaleData", app_load_locale_data, METH_VARARGS, nullptr},
|
||||
{"SetCHEONMA", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"IsCHEONMA", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"SetCHEONMA", app_set_cheonma, METH_VARARGS, nullptr},
|
||||
{"IsCHEONMA", app_is_cheonma, METH_VARARGS, nullptr},
|
||||
{"GetDefaultCodePage", app_get_default_codepage, METH_VARARGS, nullptr},
|
||||
{"SetControlFP", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetSpecularSpeed", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"testGetAccumulationTime", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"testResetAccumulationTime", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"testSetSpecularColor", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetVisibleNotice", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"IsVisibleNotice", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"SetControlFP", app_set_control_fp, METH_VARARGS, nullptr},
|
||||
{"SetSpecularSpeed", app_set_specular_speed, METH_VARARGS, nullptr},
|
||||
{"testGetAccumulationTime", app_test_get_accumulation_time, METH_VARARGS, nullptr},
|
||||
{"testResetAccumulationTime", app_test_reset_accumulation_time, METH_VARARGS, nullptr},
|
||||
{"testSetSpecularColor", app_test_set_specular_color, METH_VARARGS, nullptr},
|
||||
{"SetVisibleNotice", app_set_visible_notice, METH_VARARGS, nullptr},
|
||||
{"IsVisibleNotice", app_is_visible_notice, METH_VARARGS, nullptr},
|
||||
{"IsEnableTestServerFlag", app_is_test_server, METH_VARARGS, nullptr},
|
||||
{"EnableTestServerFlag", app_enable_test_server, METH_VARARGS, nullptr},
|
||||
{"SetGuildMarkPath", app_set_guild_mark_path, METH_VARARGS, nullptr},
|
||||
{"OnLogoUpdate", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"OnLogoRender", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"OnLogoOpen", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"OnLogoClose", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"FlashApplication", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetMultiFarmExeIcon", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"WindowStatus", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"IsVisible", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"SetTitle", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"SetMessage", app_dummy_none, METH_VARARGS, nullptr},
|
||||
{"IsCanOpenRender", app_dummy_zero, METH_VARARGS, nullptr},
|
||||
{"OnLogoUpdate", app_on_logo_update, METH_VARARGS, nullptr},
|
||||
{"OnLogoRender", app_on_logo_render, METH_VARARGS, nullptr},
|
||||
{"OnLogoOpen", app_on_logo_open, METH_VARARGS, nullptr},
|
||||
{"OnLogoClose", app_on_logo_close, METH_VARARGS, nullptr},
|
||||
{"FlashApplication", app_flash_application, METH_VARARGS, nullptr},
|
||||
{"SetMultiFarmExeIcon", app_set_multi_farm_exe_icon, METH_VARARGS, nullptr},
|
||||
{"WindowStatus", app_window_status, METH_VARARGS, nullptr},
|
||||
{"IsVisible", app_is_visible, METH_VARARGS, nullptr},
|
||||
{"SetTitle", app_set_title, METH_VARARGS, nullptr},
|
||||
{"SetMessage", app_set_message, METH_VARARGS, nullptr},
|
||||
{"IsCanOpenRender", app_is_can_open_render, METH_VARARGS, nullptr},
|
||||
{nullptr, nullptr, 0, nullptr}
|
||||
};
|
||||
auto* module = Py_InitModule("app", methods);
|
||||
@@ -390,6 +1035,14 @@ void initapp() {
|
||||
PyModule_AddIntConstant(module, "INFO_ACTOR", 1);
|
||||
PyModule_AddIntConstant(module, "INFO_EFFECT", 2);
|
||||
PyModule_AddIntConstant(module, "INFO_TEXTTAIL", 3);
|
||||
|
||||
PyModule_AddIntConstant(module, "DEGREE_DIRECTION_SAME", 0);
|
||||
PyModule_AddIntConstant(module, "DEGREE_DIRECTION_RIGHT", 1);
|
||||
PyModule_AddIntConstant(module, "DEGREE_DIRECTION_LEFT", 2);
|
||||
|
||||
PyModule_AddIntConstant(module, "CAMERA_TO_POSITIVE", 1);
|
||||
PyModule_AddIntConstant(module, "CAMERA_TO_NEGATIVE", -1);
|
||||
PyModule_AddIntConstant(module, "CAMERA_STOP", 0);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
Reference in New Issue
Block a user