mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-05 10:16:54 +08:00
[cocos2dx] Fixed Windows build of example
This commit is contained in:
parent
54de3b2b5e
commit
f93486e11b
@ -36,6 +36,7 @@ The Spine cocos2d-x example works on Windows and Mac OS X.
|
|||||||
5. Click `Browse Source` and select the directory `spine-runtimes`
|
5. Click `Browse Source` and select the directory `spine-runtimes`
|
||||||
6. Click `Browse Build` and select the `spine-runtimes/spine-cocos2dx/build` directory. You can create the `build` folder directly in the file dialog via `New Folder`.
|
6. Click `Browse Build` and select the `spine-runtimes/spine-cocos2dx/build` directory. You can create the `build` folder directly in the file dialog via `New Folder`.
|
||||||
7. Click `Configure`. This will download the cocos2d-x dependency and wire it up with the example source code in `spine-runtimes/spine-cocos2dx/example`. The download is 400mb, so get yourself a cup of tea.
|
7. Click `Configure`. This will download the cocos2d-x dependency and wire it up with the example source code in `spine-runtimes/spine-cocos2dx/example`. The download is 400mb, so get yourself a cup of tea.
|
||||||
|
7. Open the file `spine-cocos2dx\example\cocos2d\cocos\2d\cocos2dx.props` and remove the `libSpine.lib` entry from the `<AdditionalDependencies>` tag.
|
||||||
8. Open the `spine-runtimes/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.sln` file in Visual Studio 2015. Visual Studio may ask you to install the Windows XP/7 SDK, which you should install.
|
8. Open the `spine-runtimes/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.sln` file in Visual Studio 2015. Visual Studio may ask you to install the Windows XP/7 SDK, which you should install.
|
||||||
9. Expand the cocos2d_libs sub project and delete the `editor-support/spine` group. This will remove the outdated Spine cocos2d-x runtime shipped by cocos2d-x from your build.
|
9. Expand the cocos2d_libs sub project and delete the `editor-support/spine` group. This will remove the outdated Spine cocos2d-x runtime shipped by cocos2d-x from your build.
|
||||||
9. Expand `References` of the cocos2d_libs sub project, and remove the entry for `libSpine`, which should be marked with an error.
|
9. Expand `References` of the cocos2d_libs sub project, and remove the entry for `libSpine`, which should be marked with an error.
|
||||||
|
|||||||
@ -2,9 +2,7 @@
|
|||||||
#include "AppDelegate.h"
|
#include "AppDelegate.h"
|
||||||
#include "cocos2d.h"
|
#include "cocos2d.h"
|
||||||
|
|
||||||
USING_NS_CC;
|
int wWinMain(HINSTANCE hInstance,
|
||||||
|
|
||||||
int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|
||||||
HINSTANCE hPrevInstance,
|
HINSTANCE hPrevInstance,
|
||||||
LPTSTR lpCmdLine,
|
LPTSTR lpCmdLine,
|
||||||
int nCmdShow)
|
int nCmdShow)
|
||||||
@ -14,5 +12,5 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||||||
|
|
||||||
// create the application instance
|
// create the application instance
|
||||||
AppDelegate app;
|
AppDelegate app;
|
||||||
return Application::getInstance()->run();
|
return cocos2d::Application::getInstance()->run();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -155,6 +155,7 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y
|
|||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\Bone.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\Bone.c" />
|
||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\BoneData.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\BoneData.c" />
|
||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\BoundingBoxAttachment.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\BoundingBoxAttachment.c" />
|
||||||
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\Color.c" />
|
||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\Event.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\Event.c" />
|
||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\EventData.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\EventData.c" />
|
||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\extension.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\extension.c" />
|
||||||
@ -165,6 +166,7 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y
|
|||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\PathAttachment.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\PathAttachment.c" />
|
||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\PathConstraint.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\PathConstraint.c" />
|
||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\PathConstraintData.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\PathConstraintData.c" />
|
||||||
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\PointAttachment.c" />
|
||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\RegionAttachment.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\RegionAttachment.c" />
|
||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\Skeleton.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\Skeleton.c" />
|
||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\SkeletonBinary.c" />
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\SkeletonBinary.c" />
|
||||||
@ -182,6 +184,7 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y
|
|||||||
<ClCompile Include="..\..\src\spine\SkeletonAnimation.cpp" />
|
<ClCompile Include="..\..\src\spine\SkeletonAnimation.cpp" />
|
||||||
<ClCompile Include="..\..\src\spine\SkeletonBatch.cpp" />
|
<ClCompile Include="..\..\src\spine\SkeletonBatch.cpp" />
|
||||||
<ClCompile Include="..\..\src\spine\SkeletonRenderer.cpp" />
|
<ClCompile Include="..\..\src\spine\SkeletonRenderer.cpp" />
|
||||||
|
<ClCompile Include="..\..\src\spine\SkeletonTwoColorBatch.cpp" />
|
||||||
<ClCompile Include="..\..\src\spine\spine-cocos2dx.cpp" />
|
<ClCompile Include="..\..\src\spine\spine-cocos2dx.cpp" />
|
||||||
<ClCompile Include="..\Classes\AppDelegate.cpp" />
|
<ClCompile Include="..\Classes\AppDelegate.cpp" />
|
||||||
<ClCompile Include="..\Classes\BatchingExample.cpp" />
|
<ClCompile Include="..\Classes\BatchingExample.cpp" />
|
||||||
|
|||||||
@ -156,6 +156,15 @@
|
|||||||
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\VertexAttachment.c">
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\VertexAttachment.c">
|
||||||
<Filter>spine</Filter>
|
<Filter>spine</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\Color.c">
|
||||||
|
<Filter>spine</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\spine-c\spine-c\src\spine\PointAttachment.c">
|
||||||
|
<Filter>spine</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\spine\SkeletonTwoColorBatch.cpp">
|
||||||
|
<Filter>spine-cocos2dx</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="main.h">
|
<ClInclude Include="main.h">
|
||||||
|
|||||||
@ -28,7 +28,6 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#include <spine/SkeletonTwoColorBatch.h>
|
#include <spine/SkeletonTwoColorBatch.h>
|
||||||
#include "external/xxhash/xxhash.h"
|
|
||||||
#include <spine/extension.h>
|
#include <spine/extension.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -85,8 +84,7 @@ void TwoColorTrianglesCommand::generateMaterialID() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int glProgram = (int)_glProgram->getProgram();
|
int glProgram = (int)_glProgram->getProgram();
|
||||||
int intArray[4] = { glProgram, (int)_textureID, (int)_blendType.src, (int)_blendType.dst};
|
_materialID = glProgram + (int)_textureID + (int)_blendType.src + (int)_blendType.dst;
|
||||||
_materialID = XXH32((const void*)intArray, sizeof(intArray), 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user