Browse Source

Update project with latest source file changes, fix input

Mike Lilligreen 11 years ago
parent
commit
ddacd9e837

+ 70 - 46
engine/compilers/emscripten/CMakeLists.txt

@@ -102,52 +102,52 @@ SET(T2D_SRCS
     ../../lib/ljpeg/jidctred.c
     ../../source/2d/scene/SceneRenderFactories.cpp
 	../../source/2d/scene/SceneRenderQueue.cpp
-	../../source/box2d/Collision/b2BroadPhase.cpp
-	../../source/box2d/Collision/b2CollideCircle.cpp
-	../../source/box2d/Collision/b2CollideEdge.cpp
-	../../source/box2d/Collision/b2CollidePolygon.cpp
-	../../source/box2d/Collision/b2Collision.cpp
-	../../source/box2d/Collision/b2Distance.cpp
-	../../source/box2d/Collision/b2DynamicTree.cpp
-	../../source/box2d/Collision/b2TimeOfImpact.cpp
-	../../source/box2d/Collision/Shapes/b2ChainShape.cpp
-	../../source/box2d/Collision/Shapes/b2CircleShape.cpp
-	../../source/box2d/Collision/Shapes/b2EdgeShape.cpp
-	../../source/box2d/Collision/Shapes/b2PolygonShape.cpp
-	../../source/box2d/Common/b2BlockAllocator.cpp
-	../../source/box2d/Common/b2Draw.cpp
-	../../source/box2d/Common/b2Math.cpp
-	../../source/box2d/Common/b2Settings.cpp
-	../../source/box2d/Common/b2StackAllocator.cpp
-	../../source/box2d/Common/b2Timer.cpp
-	../../source/box2d/Dynamics/b2Body.cpp
-	../../source/box2d/Dynamics/b2ContactManager.cpp
-	../../source/box2d/Dynamics/b2Fixture.cpp
-	../../source/box2d/Dynamics/b2Island.cpp
-	../../source/box2d/Dynamics/b2World.cpp
-	../../source/box2d/Dynamics/b2WorldCallbacks.cpp
-	../../source/box2d/Dynamics/Contacts/b2ChainAndCircleContact.cpp
-	../../source/box2d/Dynamics/Contacts/b2ChainAndPolygonContact.cpp
-	../../source/box2d/Dynamics/Contacts/b2CircleContact.cpp
-	../../source/box2d/Dynamics/Contacts/b2Contact.cpp
-	../../source/box2d/Dynamics/Contacts/b2ContactSolver.cpp
-	../../source/box2d/Dynamics/Contacts/b2EdgeAndCircleContact.cpp
-	../../source/box2d/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp
-	../../source/box2d/Dynamics/Contacts/b2PolygonAndCircleContact.cpp
-	../../source/box2d/Dynamics/Contacts/b2PolygonContact.cpp
-	../../source/box2d/Dynamics/Joints/b2DistanceJoint.cpp
-	../../source/box2d/Dynamics/Joints/b2FrictionJoint.cpp
-	../../source/box2d/Dynamics/Joints/b2GearJoint.cpp
-	../../source/box2d/Dynamics/Joints/b2Joint.cpp
-	../../source/box2d/Dynamics/Joints/b2MotorJoint.cpp
-	../../source/box2d/Dynamics/Joints/b2MouseJoint.cpp
-	../../source/box2d/Dynamics/Joints/b2PrismaticJoint.cpp
-	../../source/box2d/Dynamics/Joints/b2PulleyJoint.cpp
-	../../source/box2d/Dynamics/Joints/b2RevoluteJoint.cpp
-	../../source/box2d/Dynamics/Joints/b2RopeJoint.cpp
-	../../source/box2d/Dynamics/Joints/b2WeldJoint.cpp
-	../../source/box2d/Dynamics/Joints/b2WheelJoint.cpp
-	../../source/box2d/Rope/b2Rope.cpp
+	../../source/Box2D/Collision/b2BroadPhase.cpp
+	../../source/Box2D/Collision/b2CollideCircle.cpp
+	../../source/Box2D/Collision/b2CollideEdge.cpp
+	../../source/Box2D/Collision/b2CollidePolygon.cpp
+	../../source/Box2D/Collision/b2Collision.cpp
+	../../source/Box2D/Collision/b2Distance.cpp
+	../../source/Box2D/Collision/b2DynamicTree.cpp
+	../../source/Box2D/Collision/b2TimeOfImpact.cpp
+	../../source/Box2D/Collision/Shapes/b2ChainShape.cpp
+	../../source/Box2D/Collision/Shapes/b2CircleShape.cpp
+	../../source/Box2D/Collision/Shapes/b2EdgeShape.cpp
+	../../source/Box2D/Collision/Shapes/b2PolygonShape.cpp
+	../../source/Box2D/Common/b2BlockAllocator.cpp
+	../../source/Box2D/Common/b2Draw.cpp
+	../../source/Box2D/Common/b2Math.cpp
+	../../source/Box2D/Common/b2Settings.cpp
+	../../source/Box2D/Common/b2StackAllocator.cpp
+	../../source/Box2D/Common/b2Timer.cpp
+	../../source/Box2D/Dynamics/b2Body.cpp
+	../../source/Box2D/Dynamics/b2ContactManager.cpp
+	../../source/Box2D/Dynamics/b2Fixture.cpp
+	../../source/Box2D/Dynamics/b2Island.cpp
+	../../source/Box2D/Dynamics/b2World.cpp
+	../../source/Box2D/Dynamics/b2WorldCallbacks.cpp
+	../../source/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp
+	../../source/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp
+	../../source/Box2D/Dynamics/Contacts/b2CircleContact.cpp
+	../../source/Box2D/Dynamics/Contacts/b2Contact.cpp
+	../../source/Box2D/Dynamics/Contacts/b2ContactSolver.cpp
+	../../source/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp
+	../../source/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp
+	../../source/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp
+	../../source/Box2D/Dynamics/Contacts/b2PolygonContact.cpp
+	../../source/Box2D/Dynamics/Joints/b2DistanceJoint.cpp
+	../../source/Box2D/Dynamics/Joints/b2FrictionJoint.cpp
+	../../source/Box2D/Dynamics/Joints/b2GearJoint.cpp
+	../../source/Box2D/Dynamics/Joints/b2Joint.cpp
+	../../source/Box2D/Dynamics/Joints/b2MotorJoint.cpp
+	../../source/Box2D/Dynamics/Joints/b2MouseJoint.cpp
+	../../source/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp
+	../../source/Box2D/Dynamics/Joints/b2PulleyJoint.cpp
+	../../source/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp
+	../../source/Box2D/Dynamics/Joints/b2RopeJoint.cpp
+	../../source/Box2D/Dynamics/Joints/b2WeldJoint.cpp
+	../../source/Box2D/Dynamics/Joints/b2WheelJoint.cpp
+	../../source/Box2D/Rope/b2Rope.cpp
 	../../source/collection/nameTags.cpp
 	../../source/component/behaviors/behaviorComponent.cpp
 	../../source/component/behaviors/behaviorInstance.cpp
@@ -171,6 +171,7 @@ SET(T2D_SRCS
 	../../source/2d/assets/ParticleAssetEmitter.cc
 	../../source/2d/assets/ParticleAssetField.cc
 	../../source/2d/assets/ParticleAssetFieldCollection.cc
+	../../source/2d/assets/SkeletonAsset.cc
 	../../source/2d/controllers/AmbientForceController.cc
 	../../source/2d/controllers/BuoyancyController.cc
 	../../source/2d/controllers/core/GroupedSceneController.cc
@@ -205,6 +206,7 @@ SET(T2D_SRCS
 	../../source/2d/sceneobject/SceneObjectSet.cc
 	../../source/2d/sceneobject/Scroller.cc
 	../../source/2d/sceneobject/ShapeVector.cc
+	../../source/2d/sceneobject/Skeleton.cc
 	../../source/2d/sceneobject/Sprite.cc
 	../../source/2d/sceneobject/Trigger.cc
 	../../source/algorithm/crc.cc
@@ -435,6 +437,28 @@ SET(T2D_SRCS
 	../../source/sim/simObject.cc
 	../../source/sim/SimObjectList.cc
 	../../source/sim/simSet.cc
+	../../source/spine/Animation.c
+	../../source/spine/AnimationState.c
+	../../source/spine/AnimationStateData.c
+	../../source/spine/Atlas.c
+	../../source/spine/AtlasAttachmentLoader.c
+	../../source/spine/Attachment.c
+	../../source/spine/AttachmentLoader.c
+	../../source/spine/Bone.c
+	../../source/spine/BoneData.c
+	../../source/spine/BoundingBoxAttachment.c
+	../../source/spine/Event.c
+	../../source/spine/EventData.c
+	../../source/spine/extension.c
+	../../source/spine/Json.c
+	../../source/spine/RegionAttachment.c
+	../../source/spine/Skeleton.c
+	../../source/spine/SkeletonBounds.c
+	../../source/spine/SkeletonData.c
+	../../source/spine/SkeletonJson.c
+	../../source/spine/Skin.c
+	../../source/spine/Slot.c
+	../../source/spine/SlotData.c
 	../../source/string/findMatch.cc
 	../../source/string/stringBuffer.cc
 	../../source/string/stringStack.cc

+ 13 - 13
engine/source/platformEmscripten/EmscriptenInputManager.cpp

@@ -395,7 +395,7 @@ void UInputManager::resetKeyboardState()
          event.objType = SI_KEY;
          event.objInst = i;
          event.action = SI_BREAK;
-         event.fValue = 0.0;
+         event.fValues[0] = 0.0;
          Game->postEvent(event);
       }
    }
@@ -424,7 +424,7 @@ void UInputManager::resetMouseState()
          event.objType = SI_BUTTON;
          event.objInst = buttonID;
          event.action = SI_BREAK;
-         event.fValue = 0.0;
+         event.fValues[0] = 0.0;
          Game->postEvent(event);
       }
    }
@@ -525,13 +525,13 @@ void UInputManager::mouseMotionEvent(const SDL_Event& event)
       if (event.motion.xrel != 0)
       {
          ievent.objType = SI_XAXIS;
-         ievent.fValue = event.motion.xrel;
+         ievent.fValues[0] = event.motion.xrel;
          Game->postEvent(ievent);
       }
       if (event.motion.yrel != 0)
       {
          ievent.objType = SI_YAXIS;
-         ievent.fValue = event.motion.yrel; 
+         ievent.fValues[0] = event.motion.yrel; 
          Game->postEvent(ievent);
       }
 #ifdef LOG_INPUT
@@ -582,7 +582,7 @@ void UInputManager::joyButtonEvent(U8 deviceID, U8 buttonNum, bool pressed)
    ievent.objType = SI_BUTTON;
    ievent.objInst = objInst;
    ievent.action = action;
-   ievent.fValue = (action == SI_MAKE) ? 1.0 : 0.0;
+   ievent.fValues[0] = (action == SI_MAKE) ? 1.0 : 0.0;
 
    Game->postEvent(ievent);
 #ifdef LOG_INPUT
@@ -613,7 +613,7 @@ void UInputManager::joyHatEvent(U8 deviceID, U8 hatNum,
 
    // first break any positions that are no longer valid
    ievent.action = SI_BREAK;
-   ievent.fValue = 0.0;
+   ievent.fValues[0] = 0.0;
 
    if (prevHatState & SDL_HAT_UP && !(currHatState & SDL_HAT_UP))
    {
@@ -650,7 +650,7 @@ void UInputManager::joyHatEvent(U8 deviceID, U8 hatNum,
 
    // now do the make events
    ievent.action = SI_MAKE;
-   ievent.fValue = 1.0;
+   ievent.fValues[0] = 1.0;
 
    if (!(prevHatState & SDL_HAT_UP) && currHatState & SDL_HAT_UP)
    {
@@ -730,13 +730,13 @@ void UInputManager::joyAxisEvent(U8 deviceID, U8 axisNum, S16 axisValue)
    ievent.objType = axisInfo.type;
    ievent.objInst = 0;
    ievent.action = SI_MOVE;
-   ievent.fValue = scaledValue;
+   ievent.fValues[0] = scaledValue;
 
    Game->postEvent(ievent);
 
 #ifdef LOG_INPUT
       Input::log( "EVENT (Input): joystick axis %d moved: %.1f.\n",
-         axisNum, ievent.fValue);
+         axisNum, ievent.fValues[0]);
 #endif
 
 }
@@ -791,11 +791,11 @@ void UInputManager::mouseButtonEvent(const SDL_Event& event)
       ievent.objType = SI_ZAXIS;
       ievent.objInst = 0;
       ievent.action = SI_MOVE;
-      ievent.fValue = wheelDelta;
+      ievent.fValues[0] = wheelDelta;
 #ifdef LOG_INPUT
       Input::log( "EVENT (Input): mouse wheel moved %s: %.1f. MODS:%c%c%c\n",
          wheelDelta > 0 ? "up" : "down",
-         ievent.fValue,
+         ievent.fValues[0],
          ( mModifierKeys & SI_SHIFT ? 'S' : '.' ), 
          ( mModifierKeys & SI_CTRL ? 'C' : '.' ), 
          ( mModifierKeys & SI_ALT ? 'A' : '.' ));
@@ -810,7 +810,7 @@ void UInputManager::mouseButtonEvent(const SDL_Event& event)
       ievent.objType = SI_BUTTON;
       ievent.objInst = objInst;
       ievent.action = action;
-      ievent.fValue = (action == SI_MAKE) ? 1.0 : 0.0;
+      ievent.fValues[0] = (action == SI_MAKE) ? 1.0 : 0.0;
 #ifdef LOG_INPUT
       Input::log( "EVENT (Input): mouse button%d %s. MODS:%c%c%c\n",
          buttonID,
@@ -931,7 +931,7 @@ void UInputManager::keyEvent(const SDL_Event& event)
    if (action == SI_MAKE && mKeyboardState[ievent.objInst])
       action = SI_REPEAT;
    ievent.action = action;
-   ievent.fValue = (action == SI_MAKE || action == SI_REPEAT) ? 1.0 : 0.0;
+   ievent.fValues[0] = (action == SI_MAKE || action == SI_REPEAT) ? 1.0 : 0.0;
 
    processKeyEvent(ievent);
    Game->postEvent(ievent);