Browse Source

- set x,y to 0 for Vector2/Point in default ctor
- added default "debug" resources for Box9Sprite and Button
-

dmuratshin 10 years ago
parent
commit
d4cf1eeff1

+ 3 - 3
.hg_archival.txt

@@ -1,6 +1,6 @@
 repo: b6d71054df5712e643a0685bc3ba54b123db5729
 repo: b6d71054df5712e643a0685bc3ba54b123db5729
-node: 7841a7ab3ec8ecbdb26527726a05b70cff76a392
+node: ebaba1c87e20484a1efac6375e6ca8543baac20e
 branch: default
 branch: default
 latesttag: oldrender
 latesttag: oldrender
-latesttagdistance: 973
-changessincelatesttag: 1134
+latesttagdistance: 975
+changessincelatesttag: 1138

+ 0 - 3
oxygine/src/Actor.cpp

@@ -29,11 +29,8 @@ namespace oxygine
     }
     }
 
 
     Actor::Actor():
     Actor::Actor():
-        _pos(0, 0),
-        _size(0, 0),
         _extendedIsOn(0),
         _extendedIsOn(0),
         _zOrder(0),
         _zOrder(0),
-        _anchor(0, 0),
         _scale(1, 1),
         _scale(1, 1),
         _rotation(0),
         _rotation(0),
         _flags(flag_visible | flag_touchEnabled | flag_touchChildrenEnabled | flag_childrenRelative | flag_fastTransform),
         _flags(flag_visible | flag_touchEnabled | flag_touchChildrenEnabled | flag_childrenRelative | flag_fastTransform),

+ 1 - 1
oxygine/src/AnimationFrame.h

@@ -32,7 +32,7 @@ namespace oxygine
     class AnimationFrame
     class AnimationFrame
     {
     {
     public:
     public:
-        AnimationFrame() : _srcRect(0, 0, 1, 1), _destRect(0, 0, 1, 1), _frameSize(0, 0), _resAnim(0), _row(0), _column(0) {}
+        AnimationFrame() : _srcRect(0, 0, 1, 1), _destRect(0, 0, 1, 1), _resAnim(0), _row(0), _column(0) {}
 
 
         void init(ResAnim* rs, const Diffuse& df,
         void init(ResAnim* rs, const Diffuse& df,
                   const RectF& srcRect, const RectF& destRect, const Vector2& frame_size);
                   const RectF& srcRect, const RectF& destRect, const Vector2& frame_size);

+ 6 - 0
oxygine/src/Box9Sprite.cpp

@@ -5,6 +5,9 @@
 #include "Serialize.h"
 #include "Serialize.h"
 #include <sstream>
 #include <sstream>
 #include "STDRenderer.h"
 #include "STDRenderer.h"
+#include "DebugActor.h"
+#include "res/ResAnim.h"
+#include "res/resources.h"
 
 
 namespace oxygine
 namespace oxygine
 {
 {
@@ -38,6 +41,9 @@ namespace oxygine
         _guideX[1] = 0.0f;
         _guideX[1] = 0.0f;
         _guideY[0] = 0.0f;
         _guideY[0] = 0.0f;
         _guideY[1] = 0.0f;
         _guideY[1] = 0.0f;
+
+        if (DebugActor::resSystem)
+            setResAnim(DebugActor::resSystem->getResAnim("btn"));
     }
     }
 
 
     void Box9Sprite::setVerticalMode(StretchMode m)
     void Box9Sprite::setVerticalMode(StretchMode m)

+ 6 - 0
oxygine/src/Button.cpp

@@ -1,5 +1,8 @@
 #include "Button.h"
 #include "Button.h"
 #include "Stage.h"
 #include "Stage.h"
+#include "DebugActor.h"
+#include "res/ResAnim.h"
+#include "res/Resources.h"
 
 
 namespace oxygine
 namespace oxygine
 {
 {
@@ -19,6 +22,9 @@ namespace oxygine
         addEventListener(TouchEvent::OVER, ncb);
         addEventListener(TouchEvent::OVER, ncb);
         addEventListener(TouchEvent::OUT, ncb);
         addEventListener(TouchEvent::OUT, ncb);
         addEventListener(TouchEvent::CLICK, ncb);
         addEventListener(TouchEvent::CLICK, ncb);
+
+        if (DebugActor::resSystem)
+            setResAnim(DebugActor::resSystem->getResAnim("button"));
     }
     }
 
 
     Button::~Button()
     Button::~Button()

+ 0 - 2
oxygine/src/Draggable.cpp

@@ -54,8 +54,6 @@ namespace oxygine
     Draggable::Draggable(): _bounds(0, 0, -1, -1),
     Draggable::Draggable(): _bounds(0, 0, -1, -1),
         _dragClient(0),
         _dragClient(0),
         _actor(0),
         _actor(0),
-        _clientPos(0, 0),
-        _dragPos(0, 0),
         _startTm(0),
         _startTm(0),
         _clientIsParent(false),
         _clientIsParent(false),
         _dragEnabled(true),
         _dragEnabled(true),

+ 1 - 1
oxygine/src/PointerState.cpp

@@ -2,7 +2,7 @@
 #include "Actor.h"
 #include "Actor.h"
 namespace oxygine
 namespace oxygine
 {
 {
-    PointerState::PointerState(): _index(0), _position(0, 0)
+    PointerState::PointerState(): _index(0)
     {
     {
         for (int i = 0; i < MouseButton_Count; ++i)
         for (int i = 0; i < MouseButton_Count; ++i)
             _isPressed[i] = false;
             _isPressed[i] = false;

+ 0 - 2
oxygine/src/SlidingActor.cpp

@@ -19,8 +19,6 @@ namespace oxygine
         _rad(_defaultTouchThreshold),
         _rad(_defaultTouchThreshold),
         _maxSpeed(250),
         _maxSpeed(250),
         _downTime(0),
         _downTime(0),
-        _downPos(0, 0),
-        _speed(0, 0),
         _lastTime(0), _current(0), _lastIterTime(0)
         _lastTime(0), _current(0), _lastIterTime(0)
     {
     {
         _clip = new ClipRectActor;
         _clip = new ClipRectActor;

+ 1 - 1
oxygine/src/SlidingActor.h

@@ -25,7 +25,7 @@ namespace oxygine
                 END = sysEventID('S', 'E', 'N')
                 END = sysEventID('S', 'E', 'N')
             };
             };
 
 
-            SlidingEvent(SEvent ev) : Event(ev), speed(0, 0) {}
+            SlidingEvent(SEvent ev) : Event(ev) {}
             Vector2 speed;
             Vector2 speed;
         };
         };
 
 

File diff suppressed because it is too large
+ 0 - 1
oxygine/src/core/system_data.cpp


+ 1 - 1
oxygine/src/math/vector2.h

@@ -96,7 +96,7 @@ namespace oxygine
     }
     }
 
 
     template <class T>
     template <class T>
-    VectorT2<T>::VectorT2()
+    VectorT2<T>::VectorT2(): x(0), y(0)
     {}
     {}
 
 
     template <class T>
     template <class T>

BIN
oxygine/system_data/original/system/anims/button.png


+ 1 - 0
oxygine/system_data/original/system/res.xml

@@ -11,6 +11,7 @@
 		<image file="images.png"/>
 		<image file="images.png"/>
 		<image file="logo.png"/>
 		<image file="logo.png"/>
 		<image file="btn.png" guideX1="19" guideY1="15" guideX2="46" guideY2="42" vertical="2" horizontal="2"/>
 		<image file="btn.png" guideX1="19" guideY1="15" guideX2="46" guideY2="42" vertical="2" horizontal="2"/>
+		<image file="button.png" cols="3"/>
 	</atlas>
 	</atlas>
 	
 	
 	<set path = "system/fonts" />
 	<set path = "system/fonts" />

Some files were not shown because too many files changed in this diff