diff --git a/spine-cocos2dx/.gitignore b/spine-cocos2dx/.gitignore new file mode 100644 index 000000000..1a06a30c3 --- /dev/null +++ b/spine-cocos2dx/.gitignore @@ -0,0 +1,10 @@ +*Debug.win32* +*.sdf +*.opensdf +*.user +*.suo +cocos2dx +spine-cocos2dx/include/spine/* +spine-cocos2dx/include/json/* +spine-cocos2dx/src/spine/* +spine-cocos2dx/src/json/* \ No newline at end of file diff --git a/spine-cocos2dx/spine-cocos2dx.sln b/spine-cocos2dx/spine-cocos2dx.sln new file mode 100644 index 000000000..4c2c4e0a6 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Express 2012 for Windows Desktop +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "cocos2dx\proj.win32\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spine-cocos2dx", "spine-cocos2dx\proj.win32\spine-cocos2dx.vcxproj", "{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.ActiveCfg = Debug|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.Build.0 = Debug|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.ActiveCfg = Release|Win32 + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(DPCodeReviewSolutionGUID) = preSolution + DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} + EndGlobalSection + GlobalSection(DPCodeReviewSolutionGUID) = preSolution + DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} + EndGlobalSection +EndGlobal diff --git a/spine-cocos2dx/spine-cocos2dx/data/spineboy-skeleton.json b/spine-cocos2dx/spine-cocos2dx/data/spineboy-skeleton.json new file mode 100644 index 000000000..e6df6f99a --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/data/spineboy-skeleton.json @@ -0,0 +1,98 @@ +{ +"bones": [ + { "name": "root", "length": 0 }, + { "name": "hip", "parent": "root", "length": 0, "x": 0.64, "y": 114.41 }, + { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, + { "name": "left lower leg", "parent": "left upper leg", "length": 56.45, "x": 51.78, "y": 3.46, "rotation": -16.65 }, + { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 64.02, "y": -8.67, "rotation": 102.43 }, + { "name": "right upper leg", "parent": "hip", "length": 45.76, "x": -18.27, "rotation": -101.13 }, + { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 50.21, "y": 0.6, "rotation": -10.7 }, + { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, + { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 94.95 }, + { "name": "neck", "parent": "torso", "length": 18.38, "x": 83.64, "y": -1.78, "rotation": 0.9 }, + { "name": "head", "parent": "neck", "length": 68.28, "x": 19.09, "y": 6.97, "rotation": -8.94 }, + { "name": "right shoulder", "parent": "torso", "length": 49.95, "x": 81.9, "y": 6.79, "rotation": 130.6 }, + { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 49.95, "y": -0.12, "rotation": 40.12 }, + { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, + { "name": "left shoulder", "parent": "torso", "length": 44.19, "x": 78.96, "y": -15.75, "rotation": -156.96 }, + { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 44.19, "y": -0.01, "rotation": 28.16 }, + { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, + { "name": "pelvis", "parent": "hip", "length": 0, "x": 1.41, "y": -6.57 } +], +"slots": [ + { "name": "template", "bone": "root", "color": "ff898c86" }, + { "name": "left shoulder", "bone": "left shoulder", "attachment": "left-shoulder" }, + { "name": "left arm", "bone": "left arm", "attachment": "left-arm" }, + { "name": "left hand", "bone": "left hand", "attachment": "left-hand" }, + { "name": "left foot", "bone": "left foot", "attachment": "left-foot" }, + { "name": "left lower leg", "bone": "left lower leg", "attachment": "left-lower-leg" }, + { "name": "left upper leg", "bone": "left upper leg", "attachment": "left-upper-leg" }, + { "name": "pelvis", "bone": "pelvis", "attachment": "pelvis" }, + { "name": "right foot", "bone": "right foot", "attachment": "right-foot" }, + { "name": "right lower leg", "bone": "right lower leg", "attachment": "right-lower-leg" }, + { "name": "right upper leg", "bone": "right upper leg", "attachment": "right-upper-leg" }, + { "name": "torso", "bone": "torso", "attachment": "torso" }, + { "name": "neck", "bone": "neck", "attachment": "neck" }, + { "name": "head", "bone": "head", "attachment": "head" }, + { "name": "eyes", "bone": "head", "attachment": "eyes" }, + { "name": "right shoulder", "bone": "right shoulder", "attachment": "right-shoulder" }, + { "name": "right arm", "bone": "right arm", "attachment": "right-arm" }, + { "name": "right hand", "bone": "right hand", "attachment": "right-hand" } +], +"skins": { + "default": { + "left shoulder": { + "left-shoulder": { "x": 23.74, "y": 0.11, "rotation": 62.01, "width": 34, "height": 53 } + }, + "left arm": { + "left-arm": { "x": 15.11, "y": -0.44, "rotation": 33.84, "width": 35, "height": 29 } + }, + "left hand": { + "left-hand": { "x": 0.75, "y": 1.86, "rotation": 31.14, "width": 35, "height": 38 } + }, + "left foot": { + "left-foot": { "x": 24.35, "y": 8.88, "rotation": 3.32, "width": 65, "height": 30 } + }, + "left lower leg": { + "left-lower-leg": { "x": 24.55, "y": -1.92, "rotation": 105.75, "width": 49, "height": 64 } + }, + "left upper leg": { + "left-upper-leg": { "x": 26.12, "y": -1.85, "rotation": 89.09, "width": 33, "height": 67 } + }, + "pelvis": { + "pelvis": { "x": -4.83, "y": 10.62, "width": 63, "height": 47 } + }, + "right foot": { + "right-foot": { "x": 19.02, "y": 8.47, "rotation": 1.52, "width": 67, "height": 30 } + }, + "right lower leg": { + "right-lower-leg": { "x": 23.28, "y": -2.59, "rotation": 111.83, "width": 51, "height": 64 } + }, + "right upper leg": { + "right-upper-leg": { "x": 23.03, "y": 0.25, "rotation": 101.13, "width": 44, "height": 70 } + }, + "torso": { + "torso": { "x": 44.57, "y": -7.08, "rotation": -94.95, "width": 68, "height": 92 } + }, + "neck": { + "neck": { "x": 9.42, "y": -3.66, "rotation": -100.15, "width": 34, "height": 28 } + }, + "head": { + "head": { "x": 53.94, "y": -5.75, "rotation": -86.9, "width": 121, "height": 132 } + }, + "eyes": { + "eyes": { "x": 28.94, "y": -32.92, "rotation": -86.9, "width": 34, "height": 27 }, + "eyes-closed": { "x": 28.77, "y": -32.86, "rotation": -86.9, "width": 34, "height": 27 } + }, + "right shoulder": { + "right-shoulder": { "x": 25.86, "y": 0.03, "rotation": 134.44, "width": 52, "height": 51 } + }, + "right arm": { + "right-arm": { "x": 18.34, "y": -2.64, "rotation": 94.32, "width": 21, "height": 45 } + }, + "right hand": { + "right-hand": { "x": 6.82, "y": 1.25, "rotation": 91.96, "width": 32, "height": 32 } + } + } +} +} \ No newline at end of file diff --git a/spine-cocos2dx/spine-cocos2dx/data/spineboy-walk.json b/spine-cocos2dx/spine-cocos2dx/data/spineboy-walk.json new file mode 100644 index 000000000..b40e53a95 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/data/spineboy-walk.json @@ -0,0 +1,278 @@ +{ +"bones": { + "left upper leg": { + "rotate": [ + { "time": 0, "angle": -26.55 }, + { "time": 0.1333, "angle": -8.78 }, + { "time": 0.2666, "angle": 9.51 }, + { "time": 0.4, "angle": 30.74 }, + { "time": 0.5333, "angle": 25.33 }, + { "time": 0.6666, "angle": 26.11 }, + { "time": 0.8, "angle": -7.7 }, + { "time": 0.9333, "angle": -21.19 }, + { "time": 1.0666, "angle": -26.55 } + ], + "translate": [ + { "time": 0, "x": -3, "y": -2.25 }, + { "time": 0.4, "x": -2.18, "y": -2.25 }, + { "time": 1.0666, "x": -3, "y": -2.25 } + ] + }, + "right upper leg": { + "rotate": [ + { "time": 0, "angle": 42.45 }, + { "time": 0.1333, "angle": 52.1 }, + { "time": 0.2666, "angle": 5.96 }, + { "time": 0.5333, "angle": -16.93 }, + { "time": 0.6666, "angle": 1.89 }, + { + "time": 0.8, + "angle": 28.06, + "curve": [ 0.462, 0.11, 1, 1 ] + }, + { + "time": 0.9333, + "angle": 58.68, + "curve": [ 0.5, 0.02, 1, 1 ] + }, + { "time": 1.0666, "angle": 42.45 } + ], + "translate": [ + { "time": 0, "x": 8.11, "y": -2.36 }, + { "time": 0.1333, "x": 10.03, "y": -2.56 }, + { "time": 0.4, "x": 2.76, "y": -2.97 }, + { "time": 0.5333, "x": 2.76, "y": -2.81 }, + { "time": 0.9333, "x": 8.67, "y": -2.54 }, + { "time": 1.0666, "x": 8.11, "y": -2.36 } + ] + }, + "left lower leg": { + "rotate": [ + { "time": 0, "angle": -10.21 }, + { "time": 0.1333, "angle": -55.64 }, + { "time": 0.2666, "angle": -68.12 }, + { "time": 0.5333, "angle": 5.11 }, + { "time": 0.6666, "angle": -28.29 }, + { "time": 0.8, "angle": 4.08 }, + { "time": 0.9333, "angle": 3.53 }, + { "time": 1.0666, "angle": -10.21 } + ] + }, + "left foot": { + "rotate": [ + { "time": 0, "angle": -3.69 }, + { "time": 0.1333, "angle": -10.42 }, + { "time": 0.2666, "angle": -17.14 }, + { "time": 0.4, "angle": -2.83 }, + { "time": 0.5333, "angle": -3.87 }, + { "time": 0.6666, "angle": 2.78 }, + { "time": 0.8, "angle": 1.68 }, + { "time": 0.9333, "angle": -8.54 }, + { "time": 1.0666, "angle": -3.69 } + ] + }, + "right shoulder": { + "rotate": [ + { + "time": 0, + "angle": 20.89, + "curve": [ 0.264, 0, 0.75, 1 ] + }, + { + "time": 0.1333, + "angle": 3.72, + "curve": [ 0.272, 0, 0.841, 1 ] + }, + { "time": 0.6666, "angle": -278.28 }, + { "time": 1.0666, "angle": 20.89 } + ], + "translate": [ + { "time": 0, "x": -7.84, "y": 7.19 }, + { "time": 0.1333, "x": -6.36, "y": 6.42 }, + { "time": 0.6666, "x": -11.07, "y": 5.25 }, + { "time": 1.0666, "x": -7.84, "y": 7.19 } + ] + }, + "right arm": { + "rotate": [ + { + "time": 0, + "angle": -4.02, + "curve": [ 0.267, 0, 0.804, 0.99 ] + }, + { + "time": 0.1333, + "angle": -13.99, + "curve": [ 0.341, 0, 1, 1 ] + }, + { + "time": 0.6666, + "angle": 36.54, + "curve": [ 0.307, 0, 0.787, 0.99 ] + }, + { "time": 1.0666, "angle": -4.02 } + ] + }, + "right hand": { + "rotate": [ + { "time": 0, "angle": 22.92 }, + { "time": 0.4, "angle": -8.97 }, + { "time": 0.6666, "angle": 0.51 }, + { "time": 1.0666, "angle": 22.92 } + ] + }, + "left shoulder": { + "rotate": [ + { "time": 0, "angle": -1.47 }, + { "time": 0.1333, "angle": 13.6 }, + { "time": 0.6666, "angle": 280.74 }, + { "time": 1.0666, "angle": -1.47 } + ], + "translate": [ + { "time": 0, "x": -1.76, "y": 0.56 }, + { "time": 0.6666, "x": -2.47, "y": 8.14 }, + { "time": 1.0666, "x": -1.76, "y": 0.56 } + ] + }, + "left hand": { + "rotate": [ + { + "time": 0, + "angle": 11.58, + "curve": [ 0.169, 0.37, 0.632, 1.55 ] + }, + { + "time": 0.1333, + "angle": 28.13, + "curve": [ 0.692, 0, 0.692, 0.99 ] + }, + { + "time": 0.6666, + "angle": -27.42, + "curve": [ 0.117, 0.41, 0.738, 1.76 ] + }, + { "time": 0.8, "angle": -36.32 }, + { "time": 1.0666, "angle": 11.58 } + ] + }, + "left arm": { + "rotate": [ + { "time": 0, "angle": -8.27 }, + { "time": 0.1333, "angle": 18.43 }, + { "time": 0.6666, "angle": 0.88 }, + { "time": 1.0666, "angle": -8.27 } + ] + }, + "torso": { + "rotate": [ + { "time": 0, "angle": -10.28 }, + { + "time": 0.1333, + "angle": -15.38, + "curve": [ 0.545, 0, 1, 1 ] + }, + { + "time": 0.4, + "angle": -9.78, + "curve": [ 0.58, 0.17, 1, 1 ] + }, + { "time": 0.6666, "angle": -15.75 }, + { "time": 0.9333, "angle": -7.06 }, + { "time": 1.0666, "angle": -10.28 } + ], + "translate": [ + { "time": 0, "x": -3.67, "y": 1.68 }, + { "time": 0.1333, "x": -3.67, "y": 0.68 }, + { "time": 0.4, "x": -3.67, "y": 1.97 }, + { "time": 0.6666, "x": -3.67, "y": -0.14 }, + { "time": 1.0666, "x": -3.67, "y": 1.68 } + ] + }, + "right foot": { + "rotate": [ + { "time": 0, "angle": -5.25 }, + { "time": 0.2666, "angle": -4.08 }, + { "time": 0.4, "angle": -6.45 }, + { "time": 0.5333, "angle": -5.39 }, + { "time": 0.8, "angle": -11.68 }, + { "time": 0.9333, "angle": 0.46 }, + { "time": 1.0666, "angle": -5.25 } + ] + }, + "right lower leg": { + "rotate": [ + { "time": 0, "angle": -3.39 }, + { "time": 0.1333, "angle": -45.53 }, + { "time": 0.2666, "angle": -2.59 }, + { "time": 0.5333, "angle": -19.53 }, + { "time": 0.6666, "angle": -64.8 }, + { + "time": 0.8, + "angle": -82.56, + "curve": [ 0.557, 0.18, 1, 1 ] + }, + { "time": 1.0666, "angle": -3.39 } + ] + }, + "hip": { + "rotate": [ + { "time": 0, "angle": 0, "curve": "stepped" }, + { "time": 1.0666, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0 }, + { + "time": 0.1333, + "x": 0, + "y": -7.61, + "curve": [ 0.272, 0.86, 1, 1 ] + }, + { "time": 0.4, "x": 0, "y": 8.7 }, + { "time": 0.5333, "x": 0, "y": -0.41 }, + { + "time": 0.6666, + "x": 0, + "y": -7.05, + "curve": [ 0.235, 0.89, 1, 1 ] + }, + { "time": 0.8, "x": 0, "y": 2.92 }, + { "time": 0.9333, "x": 0, "y": 6.78 }, + { "time": 1.0666, "x": 0, "y": 0 } + ] + }, + "neck": { + "rotate": [ + { "time": 0, "angle": 3.6 }, + { "time": 0.1333, "angle": 17.49 }, + { "time": 0.2666, "angle": 6.1 }, + { "time": 0.4, "angle": 3.45 }, + { "time": 0.5333, "angle": 5.17 }, + { "time": 0.6666, "angle": 18.36 }, + { "time": 0.8, "angle": 6.09 }, + { "time": 0.9333, "angle": 2.28 }, + { "time": 1.0666, "angle": 3.6 } + ] + }, + "head": { + "rotate": [ + { + "time": 0, + "angle": 3.6, + "curve": [ 0, 0, 0.704, 1.61 ] + }, + { "time": 0.1666, "angle": -0.2 }, + { "time": 0.2666, "angle": 6.1 }, + { "time": 0.4, "angle": 3.45 }, + { + "time": 0.5333, + "angle": 5.17, + "curve": [ 0, 0, 0.704, 1.61 ] + }, + { "time": 0.7, "angle": 1.1 }, + { "time": 0.8, "angle": 6.09 }, + { "time": 0.9333, "angle": 2.28 }, + { "time": 1.0666, "angle": 3.6 } + ] + } +} +} \ No newline at end of file diff --git a/spine-cocos2dx/spine-cocos2dx/data/spineboy.atlas b/spine-cocos2dx/spine-cocos2dx/data/spineboy.atlas new file mode 100644 index 000000000..ac19de904 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/data/spineboy.atlas @@ -0,0 +1,166 @@ + +../data/spineboy.png +format: RGBA8888 +filter: Nearest,Nearest +repeat: none +head + rotate: false + xy: 1, 122 + size: 121, 132 + orig: 121, 132 + offset: 0, 0 + index: -1 +torso + rotate: false + xy: 1, 28 + size: 68, 92 + orig: 68, 92 + offset: 0, 0 + index: -1 +left-pant-bottom + rotate: false + xy: 1, 4 + size: 44, 22 + orig: 44, 22 + offset: 0, 0 + index: -1 +right-pant-bottom + rotate: false + xy: 47, 8 + size: 46, 18 + orig: 46, 18 + offset: 0, 0 + index: -1 +right-upper-leg + rotate: false + xy: 71, 50 + size: 44, 70 + orig: 44, 70 + offset: 0, 0 + index: -1 +pelvis + rotate: false + xy: 95, 1 + size: 63, 47 + orig: 63, 47 + offset: 0, 0 + index: -1 +left-upper-leg + rotate: false + xy: 117, 53 + size: 33, 67 + orig: 33, 67 + offset: 0, 0 + index: -1 +right-foot + rotate: false + xy: 160, 224 + size: 67, 30 + orig: 67, 30 + offset: 0, 0 + index: -1 +left-shoulder + rotate: false + xy: 124, 201 + size: 34, 53 + orig: 34, 53 + offset: 0, 0 + index: -1 +left-ankle + rotate: false + xy: 229, 222 + size: 25, 32 + orig: 25, 32 + offset: 0, 0 + index: -1 +left-foot + rotate: false + xy: 160, 192 + size: 65, 30 + orig: 65, 30 + offset: 0, 0 + index: -1 +neck + rotate: false + xy: 124, 171 + size: 34, 28 + orig: 34, 28 + offset: 0, 0 + index: -1 +right-arm + rotate: false + xy: 124, 124 + size: 21, 45 + orig: 21, 45 + offset: 0, 0 + index: -1 +right-ankle + rotate: false + xy: 227, 190 + size: 25, 30 + orig: 25, 30 + offset: 0, 0 + index: -1 +left-hand + rotate: false + xy: 147, 131 + size: 35, 38 + orig: 35, 38 + offset: 0, 0 + index: -1 +left-arm + rotate: false + xy: 184, 161 + size: 35, 29 + orig: 35, 29 + offset: 0, 0 + index: -1 +eyes-closed + rotate: false + xy: 221, 161 + size: 34, 27 + orig: 34, 27 + offset: 0, 0 + index: -1 +right-lower-leg + rotate: false + xy: 152, 65 + size: 51, 64 + orig: 51, 64 + offset: 0, 0 + index: -1 +right-foot-idle + rotate: false + xy: 184, 131 + size: 53, 28 + orig: 53, 28 + offset: 0, 0 + index: -1 +left-lower-leg + rotate: false + xy: 205, 65 + size: 49, 64 + orig: 49, 64 + offset: 0, 0 + index: -1 +right-shoulder + rotate: false + xy: 160, 12 + size: 52, 51 + orig: 52, 51 + offset: 0, 0 + index: -1 +eyes + rotate: false + xy: 214, 36 + size: 34, 27 + orig: 34, 27 + offset: 0, 0 + index: -1 +right-hand + rotate: false + xy: 214, 2 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 diff --git a/spine-cocos2dx/spine-cocos2dx/data/spineboy.png b/spine-cocos2dx/spine-cocos2dx/data/spineboy.png new file mode 100644 index 000000000..b8b493dfd Binary files /dev/null and b/spine-cocos2dx/spine-cocos2dx/data/spineboy.png differ diff --git a/spine-cocos2dx/spine-cocos2dx/example/AppDelegate.cpp b/spine-cocos2dx/spine-cocos2dx/example/AppDelegate.cpp new file mode 100644 index 000000000..dc5ae02d3 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/example/AppDelegate.cpp @@ -0,0 +1,39 @@ +#include "AppDelegate.h" + +#include +#include + +#include "ExampleScene.h" + +USING_NS_CC; +using namespace std; + +AppDelegate::AppDelegate() { +} + +AppDelegate::~AppDelegate() { +} + +bool AppDelegate::applicationDidFinishLaunching() { + CCDirector* director = CCDirector::sharedDirector(); + + CCEGLView* view = CCEGLView::sharedOpenGLView(); + director->setOpenGLView(view); + view->setViewName("Spine Example"); + view->setFrameSize(640, 480); + view->setDesignResolutionSize(640, 480, kResolutionNoBorder); + + director->setDisplayStats(true); + director->runWithScene(ExampleScene::scene()); + return true; +} + +void AppDelegate::applicationDidEnterBackground() { + CCDirector::sharedDirector()->stopAnimation(); + // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); +} + +void AppDelegate::applicationWillEnterForeground() { + CCDirector::sharedDirector()->startAnimation(); + // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); +} diff --git a/spine-cocos2dx/spine-cocos2dx/example/AppDelegate.h b/spine-cocos2dx/spine-cocos2dx/example/AppDelegate.h new file mode 100644 index 000000000..ae5de0b34 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/example/AppDelegate.h @@ -0,0 +1,16 @@ +#ifndef _APPDELEGATE_H_ +#define _APPDELEGATE_H_ + +#include "cocos2d.h" + +class AppDelegate : private cocos2d::CCApplication { +public: + AppDelegate(); + virtual ~AppDelegate(); + + virtual bool applicationDidFinishLaunching(); + virtual void applicationDidEnterBackground(); + virtual void applicationWillEnterForeground(); +}; + +#endif // _APPDELEGATE_H_ diff --git a/spine-cocos2dx/spine-cocos2dx/example/ExampleScene.cpp b/spine-cocos2dx/spine-cocos2dx/example/ExampleScene.cpp new file mode 100644 index 000000000..403d6ae91 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/example/ExampleScene.cpp @@ -0,0 +1,35 @@ +#include "ExampleScene.h" +#include +#include +#include + +using namespace cocos2d; +using namespace spine; +using namespace std; + +CCScene* ExampleScene::scene() { + CCScene *scene = CCScene::create(); + ExampleScene *layer = ExampleScene::create(); + scene->addChild(layer); + return scene; +} + +bool ExampleScene::init() { + if (!CCLayer::init()) return false; + + ifstream atlasFile("../data/spineboy.atlas"); + Atlas *atlas = new Atlas(atlasFile); + + SkeletonJson json(atlas); + SkeletonData *skeletonData = json.readSkeletonDataFile("../data/spineboy-skeleton.json"); + Animation *animation = json.readAnimationFile("../data/spineboy-walk.json", skeletonData); + + CCSkeleton* skeletonNode = new CCSkeleton(skeletonData); + skeletonNode->state->setAnimation(animation, true); + + CCSize winSize = CCDirector::sharedDirector()->getWinSize(); + skeletonNode->setPosition(ccp(winSize.width / 2, 20)); + addChild(skeletonNode); + + return true; +} diff --git a/spine-cocos2dx/spine-cocos2dx/example/ExampleScene.h b/spine-cocos2dx/spine-cocos2dx/example/ExampleScene.h new file mode 100644 index 000000000..d58040f6d --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/example/ExampleScene.h @@ -0,0 +1,15 @@ +#ifndef _EXAMPLESCENE_H_ +#define _EXAMPLESCENE_H_ + +#include "cocos2d.h" + +class ExampleScene : public cocos2d::CCLayer { +public: + static cocos2d::CCScene* scene(); + + virtual bool init(); + + CREATE_FUNC(ExampleScene); +}; + +#endif // SPINE_EXAMPLESCENE_H_ diff --git a/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/Atlas.h b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/Atlas.h new file mode 100644 index 000000000..b3c930f97 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/Atlas.h @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#ifndef SPINE_ATLAS_H_ +#define SPINE_ATLAS_H_ + +#include "cocos2d.h" +#include + +namespace spine { + +class AtlasPage: public BaseAtlasPage { +public: + ~AtlasPage (); + + cocos2d::CCTexture2D *texture; + cocos2d::CCTextureAtlas *atlas; +}; + +// + +class AtlasRegion: public BaseAtlasRegion { +public: + AtlasPage *page; +}; + +// + +class Atlas: public BaseAtlas { +public: + Atlas (std::ifstream &file); + Atlas (std::istream &input); + Atlas (const std::string &text); + Atlas (const char *begin, const char *end); + + AtlasRegion* findRegion (const std::string &name); + +private: + virtual BaseAtlasPage* newAtlasPage (const std::string &name); + virtual BaseAtlasRegion* newAtlasRegion (BaseAtlasPage* page); +}; + +} /* namespace spine */ +#endif /* SPINE_ATLAS_H_ */ diff --git a/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/AtlasAttachmentLoader.h b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/AtlasAttachmentLoader.h new file mode 100644 index 000000000..3257b0986 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/AtlasAttachmentLoader.h @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#ifndef SPINE_ATLASATTACHMENTLOADER_H_ +#define SPINE_ATLASATTACHMENTLOADER_H_ + +#include + +namespace spine { + +class Atlas; + +class AtlasAttachmentLoader: public BaseAttachmentLoader { +public: + Atlas *atlas; + + AtlasAttachmentLoader (Atlas *atlas); + + virtual Attachment* newAttachment (AttachmentType type, const std::string &name); +}; + +} /* namespace spine */ +#endif /* SPINE_ATLASATTACHMENTLOADER_H_ */ diff --git a/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/CCSkeleton.h b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/CCSkeleton.h new file mode 100644 index 000000000..15a62fff9 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/CCSkeleton.h @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#ifndef SPINE_CCSKELETON_H_ +#define SPINE_CCSKELETON_H_ + +#include "base_nodes/CCNode.h" + +namespace spine { + +class SkeletonData; +class Skeleton; +class AnimationState; +class AnimationStateData; + +class CCSkeleton: public cocos2d::CCNode { +public: + Skeleton *skeleton; + AnimationState *state; + + CCSkeleton (SkeletonData *skeletonData, AnimationStateData *stateData = 0); + virtual ~CCSkeleton (); + + virtual void update (float deltaTime); + virtual void draw (); +}; + +} /* namespace spine */ +#endif /* SPINE_CCSKELETON_H_ */ diff --git a/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/RegionAttachment.h b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/RegionAttachment.h new file mode 100644 index 000000000..ac87dd988 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/RegionAttachment.h @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#ifndef SPINE_REGIONATTACHMENT_H_ +#define SPINE_REGIONATTACHMENT_H_ + +#include "cocos2d.h" +#include + +namespace spine { + +class Bone; +class AtlasRegion; + +class RegionAttachment: public BaseRegionAttachment { +public: + cocos2d::ccV3F_C4B_T2F_Quad quad; + cocos2d::CCTextureAtlas *atlas; + + RegionAttachment (AtlasRegion *region); + + virtual void updateWorldVertices (Bone *bone); + virtual void draw (Slot *slot); +}; + +} /* namespace spine */ +#endif /* SPINE_REGIONATTACHMENT_H_ */ diff --git a/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/Skeleton.h b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/Skeleton.h new file mode 100644 index 000000000..89d83fb25 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/Skeleton.h @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#ifndef SPINE_SKELETON_H_ +#define SPINE_SKELETON_H_ + +#include "cocos2d.h" +#include + +namespace spine { + +class Skeleton: public BaseSkeleton { +private: + unsigned int quadCount; + +public: + cocos2d::CCTextureAtlas *atlas; // All region attachments must use the same texture. + + Skeleton (SkeletonData *skeletonData); + + void addQuad (cocos2d::CCTextureAtlas *atlas, cocos2d::ccV3F_C4B_T2F_Quad &quad); + virtual void draw (); +}; + +} /* namespace spine */ +#endif /* SPINE_SKELETON_H_ */ diff --git a/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/SkeletonJson.h b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/SkeletonJson.h new file mode 100644 index 000000000..23c5cdffe --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/SkeletonJson.h @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#ifndef SPINE_SKELETONJSON_H_ +#define SPINE_SKELETONJSON_H_ + +#include + +namespace spine { + +class Atlas; + +class SkeletonJson: public BaseSkeletonJson { +public: + SkeletonJson (Atlas *atlas); + /** The SkeletonJson owns the attachmentLoader. */ + SkeletonJson (BaseAttachmentLoader *attachmentLoader); +}; + +} /* namespace spine */ +#endif /* SPINE_SKELETONJSON_H_ */ diff --git a/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/spine.h b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/spine.h new file mode 100644 index 000000000..b0a830f18 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/include/spine-cocos2dx/spine.h @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#ifndef SPINE_SPINE_H_ +#define SPINE_SPINE_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#endif /* SF_SPINE_H_ */ diff --git a/spine-cocos2dx/spine-cocos2dx/proj.win32/main.cpp b/spine-cocos2dx/spine-cocos2dx/proj.win32/main.cpp new file mode 100644 index 000000000..33bb7dcfb --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/proj.win32/main.cpp @@ -0,0 +1,11 @@ +#include "main.h" +#include "../example/AppDelegate.h" + +USING_NS_CC; + +int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + AppDelegate app; + return CCApplication::sharedApplication()->run(); +} diff --git a/spine-cocos2dx/spine-cocos2dx/proj.win32/main.h b/spine-cocos2dx/spine-cocos2dx/proj.win32/main.h new file mode 100644 index 000000000..52a11adbc --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/proj.win32/main.h @@ -0,0 +1,11 @@ +#ifndef __MAIN_H__ +#define __MAIN_H__ + +#define WIN32_LEAN_AND_MEAN + +#include +#include + +#include "CCStdC.h" + +#endif // __MAIN_H__ diff --git a/spine-cocos2dx/spine-cocos2dx/proj.win32/spine-cocos2dx.vcxproj b/spine-cocos2dx/spine-cocos2dx/proj.win32/spine-cocos2dx.vcxproj new file mode 100644 index 000000000..083f98f69 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/proj.win32/spine-cocos2dx.vcxproj @@ -0,0 +1,201 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {B8BF9E81-35FD-4582-BA1C-B85FA365BABB} + spine + Win32Proj + spine-cocos2dx + + + + Application + Unicode + true + v100 + v110 + v110_xp + + + Application + Unicode + v100 + v110 + v110_xp + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + true + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + + Disabled + $(ProjectDir)..\..\cocos2dx;$(ProjectDir)..\..\cocos2dx\include;$(ProjectDir)..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\include;$(ProjectDir)..\..\..\spine-cpp\include;$(ProjectDir)..\..\..\spine-cpp\src;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + 4267;4251;4244;%(DisableSpecificWarnings) + + + opengl32.lib;glew32.lib;libcocos2d.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + $(OutDir);%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + + + false + + + + + + + + + MaxSpeed + true + $(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;..\Classes;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + 4267;4251;4244;%(DisableSpecificWarnings) + + + opengl32.lib;glew32.lib;libcocos2d.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + $(OutDir);%(AdditionalLibraryDirectories) + true + Windows + true + true + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} + + + + + + + + + + + \ No newline at end of file diff --git a/spine-cocos2dx/spine-cocos2dx/proj.win32/spine-cocos2dx.vcxproj.filters b/spine-cocos2dx/spine-cocos2dx/proj.win32/spine-cocos2dx.vcxproj.filters new file mode 100644 index 000000000..b40db0732 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/proj.win32/spine-cocos2dx.vcxproj.filters @@ -0,0 +1,224 @@ + + + + + {1b06b916-430b-4dc1-b260-c280a58e0d17} + + + {e7aa2d8d-104e-4c2c-a383-2709ccc2ebf5} + + + {c5903be8-3874-4598-afb8-502a53a1bbac} + + + {29fcfe1f-7289-4597-a8fc-82ab7431ba7d} + + + {79f098e3-3dd1-47bb-a0a7-1a861d7da7ee} + + + {036946b8-8d3d-448b-b494-10ee7bbdf1ea} + + + {44d6db46-e6b8-40ea-b950-8d75550614ce} + + + {373e4aa7-5d88-40c4-877d-431185461bfb} + + + {ef769de4-53ac-449d-92e6-e67ec8d7414e} + + + + + includes\spine-cocos2dx + + + includes\spine-cocos2dx + + + includes\spine-cocos2dx + + + includes\spine-cocos2dx + + + includes\spine-cocos2dx + + + includes\spine-cocos2dx + + + example + + + example + + + example + + + includes\spine-cocos2dx + + + includes\json + + + includes\json + + + includes\json + + + includes\json + + + includes\json + + + includes\json + + + includes\json + + + includes\json + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + includes\spine + + + src\json + + + + + src\spine-cocos2dx + + + src\spine-cocos2dx + + + src\spine-cocos2dx + + + src\spine-cocos2dx + + + src\spine-cocos2dx + + + example + + + example + + + example + + + src\spine-cocos2dx + + + src\json + + + src\json + + + src\json + + + src\spine + + + src\spine + + + src\spine + + + src\spine + + + src\spine + + + src\spine + + + src\spine + + + src\spine + + + src\spine + + + src\spine + + + src\spine + + + src\spine + + + src\spine + + + + + src\json + + + src\json + + + src\json + + + \ No newline at end of file diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/Atlas.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/Atlas.cpp new file mode 100644 index 000000000..1594f110e --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/Atlas.cpp @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#include + +USING_NS_CC; + +namespace spine { + +AtlasPage::~AtlasPage () { + CC_SAFE_RELEASE_NULL(texture); + CC_SAFE_RELEASE_NULL(atlas); +} + +// + +Atlas::Atlas (std::ifstream &file) { + load(file); +} + +Atlas::Atlas (std::istream &input) { + load(input); +} + +Atlas::Atlas (const std::string &text) { + load(text); +} + +Atlas::Atlas (const char *begin, const char *end) { + load(begin, end); +} + +BaseAtlasPage* Atlas::newAtlasPage (const std::string &name) { + AtlasPage *page = new AtlasPage(); + page->texture = CCTextureCache::sharedTextureCache()->addImage(name.c_str()); + page->atlas = CCTextureAtlas::createWithTexture(page->texture, 4); + page->atlas->retain(); + return page; +} + +BaseAtlasRegion* Atlas::newAtlasRegion (BaseAtlasPage* page) { + AtlasRegion *region = new AtlasRegion(); + region->page = reinterpret_cast(page); + return region; +} + +AtlasRegion* Atlas::findRegion (const std::string &name) { + return reinterpret_cast(BaseAtlas::findRegion(name)); +} + +} /* namespace spine */ diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/AtlasAttachmentLoader.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/AtlasAttachmentLoader.cpp new file mode 100644 index 000000000..185ad1430 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/AtlasAttachmentLoader.cpp @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#include +#include +#include +#include + +namespace spine { + +AtlasAttachmentLoader::AtlasAttachmentLoader (Atlas *atlas) : + atlas(atlas) { +} + +Attachment* AtlasAttachmentLoader::newAttachment (AttachmentType type, const std::string &name) { + switch (type) { + case region: { + AtlasRegion *region = atlas->findRegion(name); + if (!region) throw std::runtime_error("Atlas region not found: " + name); + return new RegionAttachment(region); + } + default: + throw std::runtime_error("Unknown attachment type: " + type); + } +} + +} /* namespace spine */ diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/CCSkeleton.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/CCSkeleton.cpp new file mode 100644 index 000000000..d66037875 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/CCSkeleton.cpp @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#include +#include +#include +#include +#include +#include + +using namespace spine; +USING_NS_CC; + +CCSkeleton::CCSkeleton (SkeletonData *skeletonData, AnimationStateData *stateData) { + if (!skeletonData) throw std::invalid_argument("skeletonData cannot be null."); + skeleton = new Skeleton(skeletonData); + state = new AnimationState(stateData); + + setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(kCCShader_PositionTextureColor)); + scheduleUpdate(); +} + +CCSkeleton::~CCSkeleton () { + delete skeleton; + delete state; +} + +void CCSkeleton::update (float deltaTime) { + skeleton->update(deltaTime); + state->update(deltaTime); + state->apply(skeleton); + skeleton->updateWorldTransform(); +} + +void CCSkeleton::draw () { + CC_NODE_DRAW_SETUP(); + glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA); + skeleton->draw(); +} diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/RegionAttachment.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/RegionAttachment.cpp new file mode 100644 index 000000000..9fa483d2f --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/RegionAttachment.cpp @@ -0,0 +1,111 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#include +#include +#include +#include +#include +#include + +USING_NS_CC; + +namespace spine { + +RegionAttachment::RegionAttachment (AtlasRegion *region) { + atlas = region->page->atlas; + const CCSize &size = region->page->texture->getContentSizeInPixels(); + float u = region->x / size.width; + float u2 = (region->x + region->width) / size.width; + float v = region->y / size.height; + float v2 = (region->y + region->height) / size.height; + if (region->rotate) { + quad.tl.texCoords.u = u; + quad.tl.texCoords.v = v2; + quad.tr.texCoords.u = u; + quad.tr.texCoords.v = v; + quad.br.texCoords.u = u2; + quad.br.texCoords.v = v; + quad.bl.texCoords.u = u2; + quad.bl.texCoords.v = v2; + } else { + quad.bl.texCoords.u = u; + quad.bl.texCoords.v = v2; + quad.tl.texCoords.u = u; + quad.tl.texCoords.v = v; + quad.tr.texCoords.u = u2; + quad.tr.texCoords.v = v; + quad.br.texCoords.u = u2; + quad.br.texCoords.v = v2; + } + + quad.bl.vertices.z = 0; + quad.tl.vertices.z = 0; + quad.tr.vertices.z = 0; + quad.br.vertices.z = 0; +} + +void RegionAttachment::draw (Slot *slot) { + Skeleton* skeleton = (Skeleton*)slot->skeleton; + + GLubyte r = skeleton->r * slot->r * 255; + GLubyte g = skeleton->g * slot->g * 255; + GLubyte b = skeleton->b * slot->b * 255; + GLubyte a = skeleton->a * slot->a * 255; + quad.bl.colors.r = r; + quad.bl.colors.g = g; + quad.bl.colors.b = b; + quad.bl.colors.a = a; + quad.tl.colors.r = r; + quad.tl.colors.g = g; + quad.tl.colors.b = b; + quad.tl.colors.a = a; + quad.tr.colors.r = r; + quad.tr.colors.g = g; + quad.tr.colors.b = b; + quad.tr.colors.a = a; + quad.br.colors.r = r; + quad.br.colors.g = g; + quad.br.colors.b = b; + quad.br.colors.a = a; + + updateWorldVertices(slot->bone); + + // cocos2dx doesn't handle batching for us, so we'll just force a single texture per skeleton. + skeleton->addQuad(atlas, quad); +} + +void RegionAttachment::updateWorldVertices (spine::Bone *bone) { + quad.bl.vertices.x = offset[0] * bone->m00 + offset[1] * bone->m01 + bone->worldX; + quad.bl.vertices.y = offset[0] * bone->m10 + offset[1] * bone->m11 + bone->worldY; + quad.tl.vertices.x = offset[2] * bone->m00 + offset[3] * bone->m01 + bone->worldX; + quad.tl.vertices.y = offset[2] * bone->m10 + offset[3] * bone->m11 + bone->worldY; + quad.tr.vertices.x = offset[4] * bone->m00 + offset[5] * bone->m01 + bone->worldX; + quad.tr.vertices.y = offset[4] * bone->m10 + offset[5] * bone->m11 + bone->worldY; + quad.br.vertices.x = offset[6] * bone->m00 + offset[7] * bone->m01 + bone->worldX; + quad.br.vertices.y = offset[6] * bone->m10 + offset[7] * bone->m11 + bone->worldY; +} + +} /* namespace spine */ diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/Skeleton.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/Skeleton.cpp new file mode 100644 index 000000000..490b8b1a5 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/Skeleton.cpp @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#include +#include +#include +#include +#include + +USING_NS_CC; + +namespace spine { + +Skeleton::Skeleton (SkeletonData *skeletonData) : + BaseSkeleton(skeletonData), + quadCount(0), + atlas(0) { +} + +void Skeleton::addQuad (cocos2d::CCTextureAtlas *atlas, cocos2d::ccV3F_C4B_T2F_Quad &quad) { + this->atlas = atlas; + if (atlas->getCapacity() <= quadCount) { + if (!atlas->resizeCapacity(atlas->getCapacity() * 2)) return; + } + atlas->updateQuad(&quad, quadCount++); +} + +void Skeleton::draw () { + quadCount = 0; + for (int i = 0, n = slots.size(); i < n; i++) + if (slots[i]->attachment) slots[i]->attachment->draw(slots[i]); + if (atlas) atlas->drawNumberOfQuads(quadCount); +} + +} /* namespace spine */ diff --git a/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/SkeletonJson.cpp b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/SkeletonJson.cpp new file mode 100644 index 000000000..6948fc8e2 --- /dev/null +++ b/spine-cocos2dx/spine-cocos2dx/src/spine-cocos2dx/SkeletonJson.cpp @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2013, Esoteric Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +#include +#include + +namespace spine { + +SkeletonJson::SkeletonJson (BaseAttachmentLoader *attachmentLoader) : + BaseSkeletonJson(attachmentLoader) { +} + +SkeletonJson::SkeletonJson (Atlas *atlas) : + BaseSkeletonJson(new AtlasAttachmentLoader(atlas)) { +} + +} /* namespace spine */