Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
完善代码
Browse files Browse the repository at this point in the history
  • Loading branch information
twoone3l committed Jan 2, 2022
1 parent 58d877b commit fca883a
Show file tree
Hide file tree
Showing 13 changed files with 559 additions and 679 deletions.
8 changes: 4 additions & 4 deletions BDSpyrunner.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<PreprocessorDefinitions>NDEBUG;_AMD64_;_CONSOLE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<DisableSpecificWarnings>4996;4471;4499</DisableSpecificWarnings>
<DisableSpecificWarnings>4996;4471;4499;4244</DisableSpecificWarnings>
<UseFullPaths>false</UseFullPaths>
</ClCompile>
<Link>
Expand All @@ -64,13 +64,13 @@ copy $(OutputPath)$(ProjectName).pdb ..\BDS\plugins\$(ProjectName).pdb
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="mod.cpp" />
<ClCompile Include="mod\DataIO.cpp" />
<ClCompile Include="mod\Main.cpp" />
<ClCompile Include="mod\Module.cpp" />
<ClCompile Include="mod\Entity.cpp" />
<ClCompile Include="mod\Listener.cpp" />
<ClCompile Include="mod\NBT.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="mod\DataIO.h" />
<ClInclude Include="mod\Module.h" />
<ClInclude Include="mod\Event.h" />
<ClInclude Include="mod\NBT.h" />
Expand Down
10 changes: 5 additions & 5 deletions BDSpyrunner.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="mod.cpp">
<ClCompile Include="mod\Main.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="mod\Entity.cpp">
Expand All @@ -27,7 +27,10 @@
<ClCompile Include="mod\Module.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="mod\DataIO.cpp">
<ClCompile Include="mod\Listener.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="mod\NBT.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
Expand All @@ -53,9 +56,6 @@
<ClInclude Include="mod\NBT.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="mod\DataIO.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Library Include="lib\python37.lib">
Expand Down
4 changes: 1 addition & 3 deletions mod/CPython.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#pragma once
#define PY_SSIZE_T_CLEAN
#include "../include/Python.h"
#include <vector>
#include <string>
#include <Global.h>

#define Py_PARSE(format,...) if (!PyArg_ParseTuple(args, format ":" __FUNCTION__, __VA_ARGS__))return nullptr
#define Py_KERWORDS_LIST(...) static const char* kwlist[]{ __VA_ARGS__,nullptr }
#define Py_PARSE_WITH_KERWORDS(format,...) if (!PyArg_ParseTupleAndKeywords(args, kwds, format ":" __FUNCTION__, const_cast<char**>(kwlist), __VA_ARGS__))return nullptr

#define Py_RETURN_ERROR(str) return PyErr_SetString(PyExc_Exception, str), nullptr
#define Py_PRINT_REFCOUNT(obj) cout << "引用计数:" << obj->ob_refcnt << endl
#define Py_PRINT_REFCOUNT(obj) logger.info(#obj " 的引用计数 : {}", obj->ob_refcnt)

//#define Py_BEGIN_CALL\
// int _has_gil = PyGILState_Check();\
Expand Down
57 changes: 0 additions & 57 deletions mod/DataIO.cpp

This file was deleted.

48 changes: 0 additions & 48 deletions mod/DataIO.h

This file was deleted.

1 change: 0 additions & 1 deletion mod/Entity.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once
#include <string>
#include "CPython.h"
//Entity类型
extern PyTypeObject PyEntity_Type;
Expand Down
Loading

0 comments on commit fca883a

Please sign in to comment.