Kdevelop included, libtmxparser excluded

This commit is contained in:
2023-07-11 14:28:46 -04:00
parent fd17014eef
commit e4c270a81d
128 changed files with 17774 additions and 28 deletions

View File

@ -9,7 +9,7 @@
#define SRC_ECS_COLLIDERCOMPONENT_H_
#include <string>
#include "SDL2/SDL.h"
#include <SDL2/SDL.h>
#include "Components.h"
#include "ECS.h"
#include "../assetmgr/TextureManager.h"

View File

@ -9,7 +9,7 @@
#define SRC_ECS_SPRITECOMPONENT_H_
#include "Components.h"
#include "SDL2/SDL.h"
#include <SDL2/SDL.h>
#include "../assetmgr/TextureManager.h"
#include "Animation.h"
#include <map>

View File

@ -9,7 +9,7 @@
#define SRC_ECS_TILECOMPONENT_H_
#include "ECS.h"
#include "SDL2/SDL.h"
#include <SDL2/SDL.h>
#include "../assetmgr/AssetManager.h"
class TileComponent : public Component

View File

@ -9,20 +9,20 @@
#define SRC_ECS_TILEMAPCOMPONENT_H_
#include "ECS.h"
#include "../../libsdl2/include/SDL.h"
#include <SDL2/SDL.h>
#include "../assetmgr/AssetManager.h"
#include <fstream>
#include <iostream>
#include <string>
#include <tuple>
#include "tmxparser.h"
//#include "../../libtmx-parser/src/tmxparser.h"
class TileMapComponent : public Component
{
public:
SDL_Texture* texture;
SDL_Rect srcRect, destRect;
tmxparser::TmxMap map;
//tmxparser::TmxMap map;
int globalScale;
std::vector<SDL_Rect> tileSet;
std::vector<SDL_Rect> destRects;
@ -40,9 +40,9 @@ public:
SDL_DestroyTexture(texture);
}
TileMapComponent(tmxparser::TmxMap loadedMap, int gScale, int offsetX, int offsetY)
TileMapComponent(/*tmxparser::TmxMap loadedMap,*/ int gScale, int offsetX, int offsetY)
{
map = loadedMap;
/*map = loadedMap;
std::string texturePath = "assets/textures/tiles/" + loadedMap.tilesetCollection[0].name + ".png";
Game::assets->AddTexture(map.tilesetCollection[0].name, texturePath.c_str());
setTex(map.tilesetCollection[0].name);
@ -54,9 +54,9 @@ public:
tileWidth = map.tileWidth;
// =========== Setup Tile Set ===========
tileSetTotal = map.tilesetCollection[0].colCount*map.tilesetCollection[0].rowCount;
tileSetTotal = map.tilesetCollection[0].colCount*map.tilesetCollection[0].rowCount;*/
tileSet.resize(tileSetTotal);
/*
for (int r=0;r<map.tilesetCollection[0].rowCount;r++){
for (int c=0;c<map.tilesetCollection[0].colCount;c++){
srcRect.x = c*map.tilesetCollection[0].tileWidth;
@ -87,7 +87,7 @@ public:
}
}
destRect.w = destRect.h = map.tileWidth * gScale;
}
*/}
void update() override
{
@ -104,7 +104,7 @@ public:
{
//iterate through rows and columns of the map to draw the tiles
// First cycle through rows
for (int r = 0;r<map.height;r++){
/* for (int r = 0;r<map.height;r++){
// Next cycle through each column or tile in that row:
for (int c = 0;c<map.width;c++){
int i = r*map.width+c;
@ -118,7 +118,7 @@ public:
}
}
}
}
}*/
}

View File

@ -13,7 +13,7 @@
#define ASCII_ROW_COUNT 16
#include "Components.h"
#include "SDL2/SDL.h"
#include <SDL2/SDL.h>
#include "../assetmgr/TextureManager.h"
#include "../assetmgr/AssetManager.h"
#include <stdio.h>