- [WIP] Comence amb el propertygrid

- [NEW] Módul aux
- [WIP] Módul tilemap ja mostra el mapa
- [FIX] japi/draw: les textures han de vores en NEAREST
This commit is contained in:
2025-11-18 17:12:53 +01:00
parent d686673b8e
commit 03baa43543
8 changed files with 183 additions and 1 deletions

View File

@@ -4,8 +4,12 @@
#include "menu.h"
#include "toolbar.h"
#include "treeview.h"
#include "propertygrid.h"
#include "tilemap.h"
#include "fkYAML/node.hpp"
#include <filesystem>
#include <iostream>
#include "aux.h"
namespace fs = std::filesystem;
@@ -23,6 +27,20 @@ void loadRoom(std::string room_file)
room = fkyaml::node::deserialize(std::string(f));
current_room = room_file;
free(f);
uint16_t tiles[32*16];
int i=0;
for(auto row : room.at("tilemap").as_seq())
{
for (auto t : row.as_seq())
{
tiles[i] = t.get_value<int>();
i++;
}
}
tilemap::set(tiles);
tilemap::setBackground(aux::getColorByName(room["room"]["bgColor"].get_value<std::string>()));
//fkyaml::node name_node = room["room"]["name"];
//printf("%s\n", name_node.get_value<std::string>().c_str());
}
@@ -33,6 +51,7 @@ void game::init()
game::setState(loop);
font::load("font/8bithud");
draw::cls(0x00000000);
tilemap::init();
std::vector<std::string> room_names;
@@ -101,6 +120,12 @@ bool loop()
}
treeview::end();
tilemap::start();
tilemap::draw();
propertygrid::start();
propertygrid::end();
/*x1 += 6; x2 = x1 + font::len("FILE")+6;
font::print("FILE", x1, 5); x1=x2;