2019-11-23 20:27:39 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2021-12-31 12:12:40 +08:00
|
|
|
|
2022-10-01 16:24:52 +08:00
|
|
|
https://axmolengine.github.io/
|
2021-12-31 12:12:40 +08:00
|
|
|
|
2019-11-23 20:27:39 +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-31 12:12:40 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
2021-12-31 12:12:40 +08:00
|
|
|
|
2019-11-23 20:27:39 +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.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _TILEMAP_TEST_NEW_H_
|
|
|
|
#define _TILEMAP_TEST_NEW_H_
|
|
|
|
|
|
|
|
#include "../BaseTest.h"
|
|
|
|
|
|
|
|
DEFINE_TEST_SUITE(FastTileMapTests);
|
|
|
|
|
|
|
|
class TileDemoNew : public TestCase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TileDemoNew();
|
|
|
|
virtual ~TileDemoNew();
|
|
|
|
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
|
2022-10-18 19:17:36 +08:00
|
|
|
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
2019-11-23 20:27:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TileMapTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TileMapTestNew);
|
|
|
|
TileMapTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TileMapEditTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TileMapEditTestNew);
|
2021-12-31 12:12:40 +08:00
|
|
|
TileMapEditTestNew();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
void updateMap(float dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoTestNew);
|
|
|
|
TMXOrthoTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest2New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoTest2New);
|
|
|
|
TMXOrthoTest2New();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest3New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoTest3New);
|
|
|
|
TMXOrthoTest3New();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest4New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoTest4New);
|
|
|
|
TMXOrthoTest4New();
|
|
|
|
void removeSprite(float dt);
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXReadWriteTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
unsigned int _gid;
|
|
|
|
unsigned int _gid2;
|
2021-12-31 12:12:40 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXReadWriteTestNew);
|
|
|
|
TMXReadWriteTestNew();
|
|
|
|
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:
|
|
|
|
CREATE_FUNC(TMXHexTestNew);
|
|
|
|
TMXHexTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXIsoTestNew);
|
|
|
|
TMXIsoTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTest1New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXIsoTest1New);
|
|
|
|
TMXIsoTest1New();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTest2New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXIsoTest2New);
|
|
|
|
TMXIsoTest2New();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXUncompressedTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXUncompressedTestNew);
|
|
|
|
TMXUncompressedTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXTilesetTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXTilesetTestNew);
|
|
|
|
TMXTilesetTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoObjectsTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoObjectsTestNew);
|
|
|
|
TMXOrthoObjectsTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoObjectsTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXIsoObjectsTestNew);
|
|
|
|
TMXIsoObjectsTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXResizeTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXResizeTestNew);
|
|
|
|
TMXResizeTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoZorderNew : public TileDemoNew
|
|
|
|
{
|
2022-10-18 19:17:36 +08:00
|
|
|
ax::Sprite* _tamara;
|
2021-12-31 12:12:40 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXIsoZorderNew);
|
|
|
|
TMXIsoZorderNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2021-12-31 12:12:40 +08:00
|
|
|
virtual void onExit() override;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
~TMXIsoZorderNew();
|
|
|
|
void repositionSprite(float dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoZorderNew : public TileDemoNew
|
|
|
|
{
|
2022-10-18 19:17:36 +08:00
|
|
|
ax::Sprite* _tamara;
|
2021-12-31 12:12:40 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoZorderNew);
|
|
|
|
TMXOrthoZorderNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
virtual ~TMXOrthoZorderNew();
|
|
|
|
void repositionSprite(float dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoVertexZNew : public TileDemoNew
|
|
|
|
{
|
2022-10-18 19:17:36 +08:00
|
|
|
ax::Sprite* _tamara;
|
2021-12-31 12:12:40 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXIsoVertexZNew);
|
|
|
|
TMXIsoVertexZNew();
|
|
|
|
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-10-18 19:17:36 +08:00
|
|
|
ax::Sprite* _tamara;
|
2021-12-31 12:12:40 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoVertexZNew);
|
|
|
|
TMXOrthoVertexZNew();
|
|
|
|
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:
|
|
|
|
CREATE_FUNC(TMXIsoMoveLayerNew);
|
|
|
|
TMXIsoMoveLayerNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoMoveLayerNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoMoveLayerNew);
|
|
|
|
TMXOrthoMoveLayerNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXTilePropertyTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXTilePropertyTestNew);
|
|
|
|
TMXTilePropertyTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoFlipTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoFlipTestNew);
|
|
|
|
TMXOrthoFlipTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoFlipRunTimeTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoFlipRunTimeTestNew);
|
|
|
|
TMXOrthoFlipRunTimeTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
void flipIt(float dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoFromXMLTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoFromXMLTestNew);
|
|
|
|
TMXOrthoFromXMLTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoXMLFormatTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXOrthoXMLFormatTestNew);
|
|
|
|
TMXOrthoXMLFormatTestNew();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXBug987New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXBug987New);
|
|
|
|
TMXBug987New();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXBug787New : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXBug787New);
|
|
|
|
TMXBug787New();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXGIDObjectsTestNew : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXGIDObjectsTestNew);
|
|
|
|
TMXGIDObjectsTestNew();
|
|
|
|
virtual std::string title() const override;
|
2021-12-31 12:12:40 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2019-11-23 20:27:39 +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-10-18 19:17:36 +08:00
|
|
|
ax::FastTMXTiledMap* map;
|
2020-08-28 16:33:52 +08:00
|
|
|
bool _animStarted = true;
|
2022-10-18 19:17:36 +08:00
|
|
|
void onTouchBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
2020-08-28 16:33:52 +08:00
|
|
|
};
|
|
|
|
|
2023-03-07 23:26:37 +08:00
|
|
|
class TileAnimTestNew2 : public TileDemoNew
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TileAnimTestNew2);
|
|
|
|
TileAnimTestNew2();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
ax::FastTMXTiledMap* map;
|
|
|
|
bool _animStarted = true;
|
|
|
|
void onTouchBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
|
|
|
};
|
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
#endif
|