2010-09-01 17:30:51 +08:00
|
|
|
#ifndef _TILEMAP_TEST_H_
|
|
|
|
#define _TILEMAP_TEST_H_
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
#include "../testBasic.h"
|
2013-06-08 08:21:11 +08:00
|
|
|
#include "../BaseTest.h"
|
2013-12-27 14:42:45 +08:00
|
|
|
#include "renderer/CCCustomCommand.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-08 08:21:11 +08:00
|
|
|
class TileDemo : public BaseTest
|
2010-09-01 17:30:51 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
|
|
|
TileDemo(void);
|
|
|
|
virtual ~TileDemo(void);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
void restartCallback(Ref* sender);
|
|
|
|
void nextCallback(Ref* sender);
|
|
|
|
void backCallback(Ref* sender);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-10-23 16:14:03 +08:00
|
|
|
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TileMapTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TileMapTest(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TileMapEditTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TileMapEditTest (void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2012-06-08 13:55:28 +08:00
|
|
|
void updateMap(float dt);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXOrthoTest(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest2 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXOrthoTest2(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest3 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXOrthoTest3(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest4 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXOrthoTest4(void);
|
2012-06-08 13:55:28 +08:00
|
|
|
void removeSprite(float dt);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXReadWriteTest : public TileDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
unsigned int _gid;
|
|
|
|
unsigned int _gid2;
|
2010-09-01 17:30:51 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXReadWriteTest(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void removeSprite(Node* sender);
|
2012-06-08 13:55:28 +08:00
|
|
|
void updateCol(float dt);
|
|
|
|
void repaintWithGID(float dt);
|
|
|
|
void removeTiles(float dt);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXHexTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXHexTest(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXIsoTest(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTest1 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXIsoTest1(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTest2 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXIsoTest2(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXUncompressedTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXUncompressedTest(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXTilesetTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXTilesetTest(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TMXOrthoObjectsTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXOrthoObjectsTest(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2014-03-01 08:10:48 +08:00
|
|
|
virtual void draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated) override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2013-12-26 11:19:09 +08:00
|
|
|
protected:
|
2013-12-27 14:42:45 +08:00
|
|
|
CustomCommand _renderCmd;
|
2014-03-06 07:49:08 +08:00
|
|
|
void onDraw(const kmMat4 &transform, bool transformUpdated);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoObjectsTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXIsoObjectsTest(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2014-03-01 08:10:48 +08:00
|
|
|
virtual void draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated) override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2013-12-26 11:19:09 +08:00
|
|
|
protected:
|
2013-12-27 14:42:45 +08:00
|
|
|
CustomCommand _renderCmd;
|
2014-03-06 07:49:08 +08:00
|
|
|
void onDraw(const kmMat4 &transform, bool transformUpdated);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXResizeTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXResizeTest(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoZorder : public TileDemo
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
Sprite* _tamara;
|
2010-09-01 17:30:51 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXIsoZorder(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onExit(void);
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
~TMXIsoZorder();
|
2012-06-08 13:55:28 +08:00
|
|
|
void repositionSprite(float dt);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoZorder : public TileDemo
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
Sprite* _tamara;
|
2010-09-01 17:30:51 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXOrthoZorder(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual ~TMXOrthoZorder();
|
2012-06-08 13:55:28 +08:00
|
|
|
void repositionSprite(float dt);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoVertexZ : public TileDemo
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
Sprite* _tamara;
|
2010-09-01 17:30:51 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXIsoVertexZ(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
~TMXIsoVertexZ();
|
2012-06-08 13:55:28 +08:00
|
|
|
void repositionSprite(float dt);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoVertexZ : public TileDemo
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
Sprite* _tamara;
|
2010-09-01 17:30:51 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXOrthoVertexZ(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
~TMXOrthoVertexZ();
|
2012-06-08 13:55:28 +08:00
|
|
|
void repositionSprite(float dt);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoMoveLayer : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXIsoMoveLayer(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoMoveLayer : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXOrthoMoveLayer(void);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXTilePropertyTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TMXTilePropertyTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class TMXOrthoFlipTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TMXOrthoFlipTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoFlipRunTimeTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TMXOrthoFlipRunTimeTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void flipIt(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2013-12-30 11:33:41 +08:00
|
|
|
class TMXOrthoFromXMLTest : public TileDemo
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
TMXOrthoFromXMLTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-03-26 16:46:23 +08:00
|
|
|
};
|
|
|
|
|
2013-12-30 12:01:22 +08:00
|
|
|
class TMXOrthoXMLFormatTest : public TileDemo
|
2013-12-30 11:33:41 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-12-30 12:01:22 +08:00
|
|
|
TMXOrthoXMLFormatTest();
|
2013-12-30 11:33:41 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2011-02-23 16:47:25 +08:00
|
|
|
class TMXBug987 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TMXBug987();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2011-02-23 16:47:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXBug787 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TMXBug787();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2011-02-23 16:47:25 +08:00
|
|
|
};
|
|
|
|
|
2011-07-12 14:21:29 +08:00
|
|
|
class TMXGIDObjectsTest : public TileDemo
|
2011-07-06 14:56:05 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXGIDObjectsTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2014-03-01 08:10:48 +08:00
|
|
|
virtual void draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated) override;
|
2013-12-26 11:19:09 +08:00
|
|
|
|
|
|
|
protected:
|
2013-12-27 14:42:45 +08:00
|
|
|
CustomCommand _renderCmd;
|
2014-03-06 07:49:08 +08:00
|
|
|
void onDraw(const kmMat4 &transform, bool transformUpdated);
|
2013-12-26 11:19:09 +08:00
|
|
|
|
2011-07-06 14:56:05 +08:00
|
|
|
};
|
|
|
|
|
2010-09-01 17:30:51 +08:00
|
|
|
class TileMapTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|