Browse Source

Add Map rendering

master
Riyyi 10 years ago
parent
commit
996dd153a8
  1. 4
      src/data/map/level1.json
  2. 4
      src/data/map/level1.tmx
  3. 1
      src/inputmanager.cpp
  4. 1
      src/inputmanager.h
  5. 20
      src/map.cpp
  6. 38
      src/map.h
  7. 34
      src/mapload.cpp
  8. 2
      src/mapload.h
  9. 13
      src/state/maingame.cpp

4
src/data/map/level1.json

@ -1,7 +1,7 @@
{ "height":25,
"layers":[
{
"data":[1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 0, 0, 0, 0, 0, 97, 98, 99, 100, 97, 98, 99, 100, 97, 98, 99, 100, 97, 98, 99, 100, 97, 98, 99, 100, 0, 0, 0, 0, 0, 193, 194, 195, 196, 193, 194, 195, 196, 193, 194, 195, 196, 193, 194, 195, 196, 193, 194, 195, 196, 0, 0, 0, 0, 0, 289, 290, 291, 292, 289, 290, 291, 292, 289, 290, 291, 292, 289, 290, 291, 292, 289, 290, 291, 292, 0, 0, 0, 0, 0, 385, 386, 387, 388, 385, 386, 387, 388, 385, 386, 387, 388, 385, 386, 387, 388, 385, 386, 387, 388, 0, 0, 0, 0, 0, 2153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2172, 0, 0, 0, 0, 0, 2249, 2250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2268, 0, 0, 0, 0, 0, 2345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2364, 0, 0, 0, 0, 0, 2441, 2442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"data":[1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 0, 0, 0, 0, 0, 97, 98, 99, 100, 97, 98, 99, 100, 97, 98, 99, 100, 97, 98, 99, 100, 97, 98, 99, 100, 0, 0, 0, 0, 0, 193, 194, 195, 196, 193, 194, 195, 196, 193, 194, 195, 196, 193, 194, 195, 196, 193, 194, 195, 196, 0, 0, 0, 0, 0, 289, 290, 291, 292, 289, 290, 291, 292, 289, 290, 291, 292, 289, 290, 291, 292, 289, 290, 291, 292, 0, 0, 0, 0, 0, 385, 386, 387, 388, 385, 386, 387, 388, 385, 386, 387, 388, 385, 386, 387, 388, 385, 386, 387, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 481, 482, 483, 484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 577, 578, 579, 580, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 673, 674, 675, 676, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 769, 770, 771, 772, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 865, 866, 867, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 481, 482, 483, 484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 577, 578, 579, 580, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
</data>
</layer>
</map>

1
src/inputmanager.cpp

@ -18,6 +18,7 @@ sf::Keyboard::Key InputManager::KeyboardConfiguration(Input key) {
if(key == Right) return sf::Keyboard::E;
if(key == Up) return sf::Keyboard::Comma;
if(key == Down) return sf::Keyboard::O;
if(key == LoadMap) return sf::Keyboard::L;
return sf::Keyboard::Unknown;
}

1
src/inputmanager.h

@ -16,6 +16,7 @@ public:
Right,
Up,
Down,
LoadMap,
KeyCount ///< Keep last -- the total number of inputs
};

20
src/map.cpp

@ -1,5 +1,9 @@
#include "map.h"
//TileSet::~TileSet() {
// // @Todo remove all tiles from std::vector<sf::Texture*> tile;
//}
Map::Map()
{
@ -11,3 +15,19 @@ Map::~Map()
delete this->layer1;
}
void Map::Render(sf::RenderWindow* window) {
sf::Sprite tile;
int index;
int width = this->layer1->width;
int height = this->layer1->height;
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
index = this->layer1->data[i][j];
if(index != 0) {
tile.setTexture(*this->tileSet->tile[index]);
tile.setPosition(sf::Vector2f(j * this->tileSet->tileWidth, i * this->tileSet->tileHeight));
window->draw(tile);
}
}
}
}

38
src/map.h

@ -3,6 +3,24 @@
#include <iostream>
#include <vector>
#include <SFML/Graphics.hpp>
class Layer
{
public:
//Layer();
//~Layer();
std::vector<std::vector<int>> data;
int height;
// name
// opacity
// type
bool visible;
int width;
int x;
int y;
};
class TileSet
{
@ -26,24 +44,7 @@ public:
// "transparentcolor":"#ffffff"
// @Todo save all tile textures with pointers
// map->tileSet.tile[1];
std::vector<int> tile;
};
class Layer
{
public:
//Layer();
//~Layer();
std::vector<std::vector<int>> data;
int height;
// name
// opacity
// type
bool visible;
int width;
int x;
int y;
std::vector<sf::Texture*> tile;
};
class Map
@ -51,6 +52,7 @@ class Map
public:
Map();
~Map();
void Render(sf::RenderWindow* window);
// Global
int height;

34
src/mapload.cpp

@ -44,22 +44,42 @@ void MapLoad::Parser(std::string* content, Map* map) {
tileSet->tileHeight = document["tilesets"][0]["tileheight"].GetInt();
tileSet->tileWidth = document["tilesets"][0]["tilewidth"].GetInt();
int height = document["layers"][0]["height"].GetInt();
int width = document["layers"][0]["width"].GetInt();
int height = tileSet->imageHeight / tileSet->tileHeight;
int width = tileSet->imageWidth / tileSet->tileWidth;
// Add NULL texture to fill position '0'
sf::Texture* texture = new sf::Texture();
tileSet->tile.push_back(texture);
// Load map tilesheet
std::string tileSheetLocation = tileSet->image;
tileSheetLocation.replace(0, 2, "data");
sf::Image tileSheet;
tileSheet.loadFromFile(tileSheetLocation);
for(int y = 0; y < height; y++) {
for(int x = 0; x < width; x++) {
sf::Texture* texture = new sf::Texture();
texture->loadFromImage(tileSheet, sf::IntRect(x * tileSet->tileWidth, y * tileSet->tileHeight, tileSet->tileWidth, tileSet->tileHeight));
tileSet->tile.push_back(texture);
}
}
// LAYER 1
height = document["layers"][0]["height"].GetInt();
width = document["layers"][0]["width"].GetInt();
Layer* layer = new Layer();
const rapidjson::Value& mapArray = document["layers"][0]["data"];
assert(mapArray.IsArray());
int y = 0;
for (int i = 0; i < height; i++) {
int itr = 0;
for (int y = 0; y < height; y++) {
std::vector<int> row;
for (int j = 0; j < width; j++) {
row.push_back(mapArray[y].GetInt());
y++;
for (int x = 0; x < width; x++) {
row.push_back(mapArray[itr].GetInt());
itr++;
}
layer->data.push_back(row);

2
src/mapload.h

@ -3,7 +3,7 @@
#include <iostream>
#include <fstream>
#include <algorithm>
#include <rapidjson/document.h>
#include "map.h"

13
src/state/maingame.cpp

@ -9,15 +9,15 @@ void MainGame::Initialize(sf::RenderWindow* window) {
this->entityManager->SetCollisionMethod(UpdateCollisions);
// Add entities
this->entityManager->AddEntity("test", new Entity("data\\gfx\\test.png"));
this->entityManager->AddEntity("test", new Entity("data\\gfx\\test.png"));
this->entityManager->AddEntity("test", new Entity("data/gfx/test.png"));
this->entityManager->AddEntity("test", new Entity("data/gfx/test.png"));
this->entityManager->Get("test0")->velocity.x = 0.5;
this->entityManager->Get("test")->setPosition(sf::Vector2f(50, 50));
// Load map
this->map = new Map();
MapLoad mapLoad;
mapLoad.Load(this->map, "data\\map\\level1.json");
mapLoad.Load(this->map, "data/map/level1.json");
}
void MainGame::Update(sf::RenderWindow* window) {
@ -49,9 +49,16 @@ void MainGame::Update(sf::RenderWindow* window) {
}
this->entityManager->Update();
if(inputManager.IsPressed(InputManager::LoadMap)) {
std::cout << "Loading Map..." << std::endl;
MapLoad mapLoad;
mapLoad.Load(this->map, "data/map/level1.json");
}
}
void MainGame::Render(sf::RenderWindow* window) {
this->map->Render(window);
this->entityManager->Render(window);
}

Loading…
Cancel
Save