2018-01-29 16:25:32 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2022-10-01 16:24:52 +08:00
|
|
|
https://axmolengine.github.io/
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2018-01-29 16:25:32 +08:00
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2018-01-29 16:25:32 +08:00
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2018-01-29 16:25:32 +08:00
|
|
|
THE SOFTWARE 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2014-06-06 17:33:27 +08:00
|
|
|
#ifndef _TILEMAP_TEST_NEW_H_
|
|
|
|
#define _TILEMAP_TEST_NEW_H_
|
|
|
|
|
|
|
|
#include "../BaseTest.h"
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(FastTileMapTests);
|
|
|
|
|
|
|
|
class TileDemoNew : public TestCase
|
2014-06-06 17:33:27 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
TileDemoNew();
|
|
|
|
virtual ~TileDemoNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void onExit() override;
|
2014-06-06 17:33:27 +08:00
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
2014-06-06 17:33:27 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TileMapTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TileMapTestNew);
|
|
|
|
TileMapTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TileMapEditTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TileMapEditTestNew);
|
2021-12-28 16:06:23 +08:00
|
|
|
TileMapEditTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
void updateMap(float dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoTestNew);
|
|
|
|
TMXOrthoTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest2New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoTest2New);
|
|
|
|
TMXOrthoTest2New();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest3New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoTest3New);
|
|
|
|
TMXOrthoTest3New();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest4New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoTest4New);
|
|
|
|
TMXOrthoTest4New();
|
2014-06-06 17:33:27 +08:00
|
|
|
void removeSprite(float dt);
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXReadWriteTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
unsigned int _gid;
|
|
|
|
unsigned int _gid2;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2014-06-06 17:33:27 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXReadWriteTestNew);
|
|
|
|
TMXReadWriteTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
void removeSprite(Node* sender);
|
|
|
|
void updateCol(float dt);
|
|
|
|
void repaintWithGID(float dt);
|
|
|
|
void removeTiles(float dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXHexTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXHexTestNew);
|
|
|
|
TMXHexTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoTestNew);
|
|
|
|
TMXIsoTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTest1New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoTest1New);
|
|
|
|
TMXIsoTest1New();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTest2New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoTest2New);
|
|
|
|
TMXIsoTest2New();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXUncompressedTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXUncompressedTestNew);
|
|
|
|
TMXUncompressedTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXTilesetTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXTilesetTestNew);
|
|
|
|
TMXTilesetTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoObjectsTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoObjectsTestNew);
|
|
|
|
TMXOrthoObjectsTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoObjectsTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoObjectsTestNew);
|
|
|
|
TMXIsoObjectsTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXResizeTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXResizeTestNew);
|
|
|
|
TMXResizeTestNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoZorderNew : public TileDemoNew
|
|
|
|
{
|
2022-07-11 17:50:21 +08:00
|
|
|
axis::Sprite* _tamara;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2014-06-06 17:33:27 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoZorderNew);
|
|
|
|
TMXIsoZorderNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2021-12-28 16:06:23 +08:00
|
|
|
virtual void onExit() override;
|
2014-06-06 17:33:27 +08:00
|
|
|
|
|
|
|
~TMXIsoZorderNew();
|
|
|
|
void repositionSprite(float dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoZorderNew : public TileDemoNew
|
|
|
|
{
|
2022-07-11 17:50:21 +08:00
|
|
|
axis::Sprite* _tamara;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2014-06-06 17:33:27 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoZorderNew);
|
|
|
|
TMXOrthoZorderNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
virtual ~TMXOrthoZorderNew();
|
|
|
|
void repositionSprite(float dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoVertexZNew : public TileDemoNew
|
|
|
|
{
|
2022-07-11 17:50:21 +08:00
|
|
|
axis::Sprite* _tamara;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2014-06-06 17:33:27 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoVertexZNew);
|
|
|
|
TMXIsoVertexZNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
~TMXIsoVertexZNew();
|
|
|
|
void repositionSprite(float dt);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoVertexZNew : public TileDemoNew
|
|
|
|
{
|
2022-07-11 17:50:21 +08:00
|
|
|
axis::Sprite* _tamara;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2014-06-06 17:33:27 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoVertexZNew);
|
|
|
|
TMXOrthoVertexZNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
~TMXOrthoVertexZNew();
|
|
|
|
void repositionSprite(float dt);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoMoveLayerNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoMoveLayerNew);
|
|
|
|
TMXIsoMoveLayerNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoMoveLayerNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoMoveLayerNew);
|
|
|
|
TMXOrthoMoveLayerNew();
|
2014-06-06 17:33:27 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXTilePropertyTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXTilePropertyTestNew);
|
2014-06-06 17:33:27 +08:00
|
|
|
TMXTilePropertyTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoFlipTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoFlipTestNew);
|
2014-06-06 17:33:27 +08:00
|
|
|
TMXOrthoFlipTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoFlipRunTimeTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoFlipRunTimeTestNew);
|
2014-06-06 17:33:27 +08:00
|
|
|
TMXOrthoFlipRunTimeTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
void flipIt(float dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoFromXMLTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoFromXMLTestNew);
|
2014-06-06 17:33:27 +08:00
|
|
|
TMXOrthoFromXMLTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoXMLFormatTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoXMLFormatTestNew);
|
2014-06-06 17:33:27 +08:00
|
|
|
TMXOrthoXMLFormatTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXBug987New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXBug987New);
|
2014-06-06 17:33:27 +08:00
|
|
|
TMXBug987New();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXBug787New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXBug787New);
|
2014-06-06 17:33:27 +08:00
|
|
|
TMXBug787New();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXGIDObjectsTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXGIDObjectsTestNew);
|
2014-06-06 17:33:27 +08:00
|
|
|
TMXGIDObjectsTestNew();
|
|
|
|
virtual std::string title() const override;
|
2021-12-28 16:06:23 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2014-06-06 17:33:27 +08:00
|
|
|
};
|
|
|
|
|
2020-08-28 16:33:52 +08:00
|
|
|
class TileAnimTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TileAnimTestNew);
|
|
|
|
TileAnimTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
axis::FastTMXTiledMap* map;
|
2020-08-28 16:33:52 +08:00
|
|
|
bool _animStarted = true;
|
2022-07-11 17:50:21 +08:00
|
|
|
void onTouchBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
2020-08-28 16:33:52 +08:00
|
|
|
};
|
|
|
|
|
2014-06-06 17:33:27 +08:00
|
|
|
#endif
|