This commit is contained in:
2025-11-03 09:52:54 +01:00
parent 1409ab5bff
commit 3f1c737247
32 changed files with 254 additions and 243 deletions

View File

@@ -656,14 +656,14 @@ void Room::updateAnimatedTiles() {
const int NUM_FRAMES = 4;
// Calcular frame actual basado en tiempo
const int current_frame = static_cast<int>(time_accumulator_ / CONVEYOR_FRAME_DURATION) % NUM_FRAMES;
const int CURRENT_FRAME = static_cast<int>(time_accumulator_ / CONVEYOR_FRAME_DURATION) % NUM_FRAMES;
// Calcular offset basado en dirección
int offset = 0;
if (conveyor_belt_direction_ == -1) {
offset = current_frame * TILE_SIZE;
offset = CURRENT_FRAME * TILE_SIZE;
} else {
offset = (NUM_FRAMES - 1 - current_frame) * TILE_SIZE;
offset = (NUM_FRAMES - 1 - CURRENT_FRAME) * TILE_SIZE;
}
for (auto& a : animated_tiles_) {
@@ -950,7 +950,7 @@ auto Room::loadRoomTileFile(const std::string& file_path, bool verbose) -> std::
const std::string FILENAME = file_path.substr(file_path.find_last_of("\\/") + 1);
// Load file using ResourceHelper (supports both filesystem and pack)
auto file_data = jdd::ResourceHelper::loadFile(file_path);
auto file_data = Jdd::ResourceHelper::loadFile(file_path);
if (!file_data.empty()) {
// Convert bytes to string and parse
@@ -1012,7 +1012,7 @@ auto Room::loadRoomFile(const std::string& file_path, bool verbose) -> Data {
room.number = FILE_NAME.substr(0, FILE_NAME.find_last_of('.'));
// Load file using ResourceHelper (supports both filesystem and pack)
auto file_data = jdd::ResourceHelper::loadFile(file_path);
auto file_data = Jdd::ResourceHelper::loadFile(file_path);
if (!file_data.empty()) {
// Convert bytes to string and parse