diff --git a/src/nostalgia/CMakeLists.txt b/src/nostalgia/CMakeLists.txt index 9d04f333..2d17bf24 100644 --- a/src/nostalgia/CMakeLists.txt +++ b/src/nostalgia/CMakeLists.txt @@ -13,6 +13,7 @@ endif() add_subdirectory(core) add_subdirectory(common) +add_subdirectory(scene) add_subdirectory(world) if(NOSTALGIA_BUILD_PLAYER) diff --git a/src/nostalgia/scene/CMakeLists.txt b/src/nostalgia/scene/CMakeLists.txt new file mode 100644 index 00000000..295efd0a --- /dev/null +++ b/src/nostalgia/scene/CMakeLists.txt @@ -0,0 +1,21 @@ + +add_library( + NostalgiaScene + scene.cpp +) + +target_link_libraries( + NostalgiaScene PUBLIC + NostalgiaCore +) + +install( + FILES + scene.hpp + DESTINATION + include/nostalgia/scene +) + +#if(NOSTALGIA_BUILD_STUDIO) +# add_subdirectory(studio) +#endif() diff --git a/src/nostalgia/scene/scene.cpp b/src/nostalgia/scene/scene.cpp new file mode 100644 index 00000000..8ce19fb7 --- /dev/null +++ b/src/nostalgia/scene/scene.cpp @@ -0,0 +1,15 @@ +/* + * Copyright 2016 - 2020 gtalent2@gmail.com + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "scene.hpp" + +namespace nostalgia::scene { + + + +} diff --git a/src/nostalgia/scene/scene.hpp b/src/nostalgia/scene/scene.hpp new file mode 100644 index 00000000..1b0cd4ab --- /dev/null +++ b/src/nostalgia/scene/scene.hpp @@ -0,0 +1,53 @@ +/* + * Copyright 2016 - 2020 gtalent2@gmail.com + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include + +namespace nostalgia::scene { + +struct TileDoc { + + constexpr static auto Fields = 2; + constexpr static auto Preloadable = true; + constexpr static auto TypeName = "net.drinkingtea.nostalgia.scene.Tile"; + constexpr static auto TypeVersion = 1; + + uint16_t sheetIdx = 0; + uint8_t type = 0; + +}; + +struct SceneDoc { + + using TileMapRow = ox::Vector; + using TileMapLayer = ox::Vector; + using TileMap = ox::Vector; + + constexpr static auto Fields = 1; + constexpr static auto Preloadable = true; + constexpr static auto TypeName = "net.drinkingtea.nostalgia.scene.Scene"; + constexpr static auto TypeVersion = 1; + + TileMap tiles; + +}; + +struct SceneInstance { + + uint16_t layers = 0; + uint16_t *columns = nullptr; + uint16_t *rows = nullptr; + uint16_t **tileMapIdx = nullptr; + uint8_t **tileType = nullptr; + +}; + +}