Moved the camera into the scene where it belongs.

This commit is contained in:
Zed A. Shaw 2025-12-29 23:37:42 -05:00
parent c71566048e
commit 5676382fbb
5 changed files with 29 additions and 27 deletions

View file

@ -99,7 +99,6 @@ namespace boss {
}
}
void Fight::next_combat_dumb_name() {
if(auto action = $battle.next()) {
System::combat(*action, $world, $boss_id, 0);
@ -107,7 +106,6 @@ namespace boss {
$ui.status(L"YOU DIED", L"DEAD");
state(State::END);
} else {
$ui.zoom("", 1.0);
$ui.status(L"PLAYER REQUESTS", L"COMMIT");
$battle.ap_refresh();
$battle.clear_requests();

View file

@ -22,7 +22,6 @@ namespace boss {
$view_sprite($view_texture.getTexture())
{
$view_sprite.setPosition({BOSS_VIEW_X, BOSS_VIEW_Y});
$camera.style("shake");
}
void UI::init() {
@ -80,7 +79,6 @@ namespace boss {
$combat_ui.render(*$window);
$arena.render($view_texture);
$camera.render($view_texture);
$view_texture.display();
$window->draw($view_sprite);
}
@ -115,17 +113,4 @@ namespace boss {
$arena.apply_effect(actor, "flame");
}
}
void UI::zoom(const std::string &cell_name, double ratio) {
if(cell_name == "") {
dbc::log("!!!!!!!!! you should add this to guecs");
$camera.reset($view_texture, BOSS_VIEW_WIDTH, BOSS_VIEW_HEIGHT);
} else {
auto& cell = $arena.$ui.cell_for(cell_name);
$camera.resize(double(BOSS_VIEW_WIDTH)/ratio, double(BOSS_VIEW_HEIGHT)/ratio);
$camera.move(float(cell.mid_x), float(cell.mid_y));
$camera.play();
}
}
}

View file

@ -3,7 +3,6 @@
#include <guecs/ui.hpp>
#include "gui/combat_ui.hpp"
#include "scene.hpp"
#include "camera.hpp"
namespace components {
struct Animation;
@ -27,7 +26,6 @@ namespace boss {
guecs::UI $actions;
sf::RenderTexture $view_texture;
sf::Sprite $view_sprite;
cinematic::Camera $camera;
UI(shared_ptr<DinkyECS::World> world, DinkyECS::Entity boss_id, DinkyECS::Entity player_id);
@ -40,7 +38,6 @@ namespace boss {
void animate_actor(const std::string& actor);
void update_stats();
void play_animations();
void zoom(const std::string& cell, double ratio);
void damage(const std::string& actor, int amount);
};
}