Skip to content

Commit 9d06bd6

Browse files
committed
input: Remove unnecessary resize callback for ID texture.
1 parent 4cc321f commit 9d06bd6

File tree

3 files changed

+1
-26
lines changed

3 files changed

+1
-26
lines changed

libopenage/input/input_manager.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,6 @@ bool InputManager::process(const QEvent &ev) {
155155
return false;
156156
}
157157

158-
void InputManager::set_id_texture(const std::shared_ptr<renderer::Texture2d> &id_texture) {
159-
this->game_controller->set_id_texture(id_texture);
160-
}
161-
162158
void InputManager::process_action(const input::Event &ev,
163159
const input_action &action,
164160
const std::shared_ptr<InputContext> &ctx) {

libopenage/input/input_manager.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ class GuiInput;
1818

1919
namespace openage {
2020

21-
namespace renderer {
22-
class Texture2d;
23-
} // namespace renderer
24-
2521
namespace input {
2622

2723
namespace camera {
@@ -155,16 +151,6 @@ class InputManager {
155151
*/
156152
bool process(const QEvent &ev);
157153

158-
/**
159-
* Set the texture that maps pixels to entity IDs.
160-
*
161-
* Each pixel value in the texture corresponds to an entity ID. This
162-
* mapping may be used for interacting with entities in the game world.
163-
*
164-
* @param id_texture ID texture.
165-
*/
166-
void set_id_texture(const std::shared_ptr<renderer::Texture2d> &id_texture);
167-
168154
private:
169155
/**
170156
* Process the (default) action for an input event.

libopenage/presenter/presenter.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,7 @@ void Presenter::init_input() {
255255
input_ctx->set_game_bindings(engine_context);
256256

257257
auto id_texture = this->world_renderer->get_id_texture();
258-
this->input_manager->set_id_texture(id_texture);
259-
260-
window->add_resize_callback([&](size_t /* width */, size_t /* height */, double /*scale*/) {
261-
// TODO: We must guarantee that this happens AFTER the world renderer
262-
// has resized its textures.
263-
auto id_texture = this->world_renderer->get_id_texture();
264-
this->input_manager->set_id_texture(id_texture);
265-
});
258+
game_controller->set_id_texture(id_texture);
266259
}
267260

268261
// attach GUI if it's initialized

0 commit comments

Comments
 (0)