GAF Library
Generic Animation Format
 All Classes Functions Pages
GAFSubobjectState.h
1 #pragma once
2 
3 #ifndef __GAF_SUBOBJECT_STATE__
4 #define __GAF_SUBOBJECT_STATE__
5 
6 #include "cocoa/CCObject.h"
7 #include "cocoa/CCAffineTransform.h"
8 
9 #include <string>
10 namespace cocos2d
11 {
12  class CCDictionary;
13 }
14 
15 using namespace cocos2d;
16 
17 enum GAFColorTransformIndex
18 {
19  GAFCTI_R,
20  GAFCTI_G,
21  GAFCTI_B,
22  GAFCTI_A,
23 };
24 
25 class GAFSubobjectState : public CCObject
26 {
27 public:
28  std::string objectId;
29  int zIndex;
30  std::string maskObjectId;
31  CCAffineTransform affineTransform;
32 
33  static GAFSubobjectState * createWithStateDictionary(CCDictionary * dict, const char * objectId);
34  static GAFSubobjectState * createEmptyWithObjectId(const char * objectId);
35 
36  bool initWithStateDictionary(CCDictionary * dict, const char * objectId);
37  bool initEmptyWinthObjectId(const char * objectId);
39  inline CCDictionary * filters()
40  {
41  return _filters;
42  }
43  inline float * colorMults()
44  {
45  return &_colorMults[0];
46  }
47  inline float * colorOffsets()
48  {
49  return &_colorOffsets[0];
50  }
51  inline bool isVisisble() const
52  {
53  return _colorMults[GAFCTI_A] != 0;
54  }
55 protected:
57 private:
58  CCDictionary * _filters;
59  float _colorMults[4];
60  float _colorOffsets[4];
61 }; // GAFSubobjectState
62 
63 #endif // __GAF_SUBOBJECT_STATE__
Definition: GAFSubobjectState.h:25