From 46efbfbe9a336fd3917799df36c58f81b7fb3af9 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Thu, 3 Oct 2013 23:20:04 +1000 Subject: [PATCH] Forgot to add the license --- editor/map.cpp | 27 ------------- editor/map.hpp | 88 ----------------------------------------- editor/region_pager.cpp | 21 ++++++++++ editor/region_pager.hpp | 21 ++++++++++ 4 files changed, 42 insertions(+), 115 deletions(-) delete mode 100644 editor/map.cpp delete mode 100644 editor/map.hpp diff --git a/editor/map.cpp b/editor/map.cpp deleted file mode 100644 index 1854a28..0000000 --- a/editor/map.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2013 - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source - * distribution. -*/ -#include "map.hpp" - -#include "utility.hpp" - -#include - diff --git a/editor/map.hpp b/editor/map.hpp deleted file mode 100644 index 8d39db5..0000000 --- a/editor/map.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2013 - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source - * distribution. -*/ -#ifndef MAP_HPP_ -#define MAP_HPP_ - -#include "tile.hpp" -#include "region.hpp" -#include "tile_sheet.hpp" - -#include -#include -#include - -class Map { -public: - Map() = default; - ~Map() = default; - - //simple call - void DrawTo(SDL_Surface* const, int camX, int camY); - - //TODO: baking goes here... - - //TODO: prune the map's data - - //manage the whole map - void NewMap(std::string fname, int regionWidth, int regionHeight); - void LoadMap(std::string fname); - void UnloadMap(); - void DeleteMap(); - - //for editing - bool NewTile(Tile const&); - Tile GetTile(int x, int y, int minDepth); - void DeleteTile(Tile const&); - - //for pagination, etc. - Region* NewRegion(int x, int y); - Region* GetRegion(int x, int y); - void DeleteRegion(int x, int y); - void FreeRegion(int x, int y); - - //all tile sheets are loaded into memory during operation - TileSheet* NewTileSheet(std::string name, Uint16 w, Uint16 h); - TileSheet* NewTileSheet(SDL_Surface* const, Uint16 w, Uint16 h); - TileSheet* GetTileSheet(std::string name); - TileSheet* GetTileSheetByRange(int tileIndex); - void DeleteTileSheet(std::string name); - - //raw accessors and mutators - std::string GetName() const { return name; } - - int GetRegionWidth() const { return regionWidth; } - int GetRegionHeight() const { return regionHeight; } - int GetTileRangeEnd() const { return tileRangeEnd; } - - std::list* GetRegions() { return ®ions; } - std::map* GetTileSheets() { return &tileSheets; } - -private: - std::string name; //the name of the map - int regionWidth = 0, regionHeight = 0; //for pagination - int tileRangeEnd = 0; //for managing the tile sheet ranges - - std::list regions; - std::map tileSheets; -}; - -#endif diff --git a/editor/region_pager.cpp b/editor/region_pager.cpp index 335b015..2f4d52f 100644 --- a/editor/region_pager.cpp +++ b/editor/region_pager.cpp @@ -1,3 +1,24 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ #include "region_pager.hpp" #include diff --git a/editor/region_pager.hpp b/editor/region_pager.hpp index f001897..9c3b8ad 100644 --- a/editor/region_pager.hpp +++ b/editor/region_pager.hpp @@ -1,3 +1,24 @@ +/* Copyright: (c) Kayne Ruse 2013 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ #ifndef REGIONPAGER_HPP_ #define REGIONPAGER_HPP_