This repository has been archived by the owner on Apr 23, 2020. It is now read-only.
forked from kestrelm/Creature_Cocos2DX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreatureRenderer.h
81 lines (66 loc) · 4.07 KB
/
CreatureRenderer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/******************************************************************************
* Creature Runtimes License
*
* Copyright (c) 2015, Kestrel Moon Studios
* All rights reserved.
*
* Preamble: This Agreement governs the relationship between Licensee and Kestrel Moon Studios(Hereinafter: Licensor).
* This Agreement sets the terms, rights, restrictions and obligations on using [Creature Runtimes] (hereinafter: The Software) created and owned by Licensor,
* as detailed herein:
* License Grant: Licensor hereby grants Licensee a Sublicensable, Non-assignable & non-transferable, Commercial, Royalty free,
* Including the rights to create but not distribute derivative works, Non-exclusive license, all with accordance with the terms set forth and
* other legal restrictions set forth in 3rd party software used while running Software.
* Limited: Licensee may use Software for the purpose of:
* Running Software on Licensee’s Website[s] and Server[s];
* Allowing 3rd Parties to run Software on Licensee’s Website[s] and Server[s];
* Publishing Software’s output to Licensee and 3rd Parties;
* Distribute verbatim copies of Software’s output (including compiled binaries);
* Modify Software to suit Licensee’s needs and specifications.
* Binary Restricted: Licensee may sublicense Software as a part of a larger work containing more than Software,
* distributed solely in Object or Binary form under a personal, non-sublicensable, limited license. Such redistribution shall be limited to unlimited codebases.
* Non Assignable & Non-Transferable: Licensee may not assign or transfer his rights and duties under this license.
* Commercial, Royalty Free: Licensee may use Software for any purpose, including paid-services, without any royalties
* Including the Right to Create Derivative Works: Licensee may create derivative works based on Software,
* including amending Software’s source code, modifying it, integrating it into a larger work or removing portions of Software,
* as long as no distribution of the derivative works is made
*
* THE RUNTIMES IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE RUNTIMES OR THE USE OR OTHER DEALINGS IN THE
* RUNTIMES.
*****************************************************************************/
#ifndef __CocosEngineTest__CreatureRenderer__
#define __CocosEngineTest__CreatureRenderer__
#include <iostream>
#include <memory>
#include "CreatureModule.h"
#include "cocos2d.h"
namespace CreatureRenderer {
class Renderer : public cocos2d::Node, public cocos2d::BlendProtocol {
public:
static Renderer * create(CreatureModule::CreatureManager * manager_in,
cocos2d::Texture2D * texture_in);
virtual void update(float delta);
virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t transformFlags);
virtual void doDraw(const cocos2d::Mat4& transform, uint32_t transformFlags);
virtual void setBlendFunc (const cocos2d::BlendFunc& blendFunc);
virtual const cocos2d::BlendFunc& getBlendFunc () const;
void SetDebugDraw(bool flag_in);
std::pair<glm::vec2, glm::vec2> GetCharacterBounds();
protected:
Renderer(CreatureModule::CreatureManager * manager_in,
cocos2d::Texture2D * texture_in);
virtual ~Renderer();
void drawDebugBones(meshBone * draw_bone);
CreatureModule::CreatureManager * manager;
cocos2d::CustomCommand _drawCommand;
cocos2d::BlendFunc _blendFunc;
cocos2d::Texture2D * texture;
bool debug_draw;
cocos2d::Rect character_bounds;
};
};
#endif /* defined(__CocosEngineTest__CreatureRenderer__) */