diff --git a/assets/scene/scene1.json b/assets/scene/scene1.json index 5d4b00b..b287f02 100644 --- a/assets/scene/scene1.json +++ b/assets/scene/scene1.json @@ -4,6 +4,13 @@ "translate": [ 0.0, 0.0, -1.0 ], "rotate": [ 0.0, 0.0, 0.0 ], "scale": [ 1.0, 1.0, 1.0 ], - "type": "orthographic" - } + "type": "orthographic", + "zoom-level": 0.45 + }, + "quad" : [ + { + "name": "Screen", + "scale": [ 1.0, -0.9, 1.0 ] + } + ] } diff --git a/src/ppu.cpp b/src/ppu.cpp index a7fb1ad..ad0d767 100644 --- a/src/ppu.cpp +++ b/src/ppu.cpp @@ -20,25 +20,16 @@ #include "ppu.h" #include "ruc/meta/assert.h" -PPU ::PPU(uint32_t frequency) +PPU::PPU(uint32_t frequency) : ProcessingUnit(frequency) { m_shared_registers.emplace("LY", &m_lcd_y_coordinate); - // Setup screen - auto& scene = Inferno::Application::the().scene(); - m_entity = scene.createEntity("Screen"); - - // Flip the screen to accommodate OpenGL's coordinate system - auto& transform = scene.getComponent(m_entity); - transform.scale.y = -1.0f; - - auto texture = std::make_shared(m_screen.data(), SCREEN_WIDTH, SCREEN_HEIGHT, FORMAT_SIZE); - scene.addComponent(m_entity, glm::vec4 { 1.0f }, texture); + m_entity = scene.findEntity("Screen"); } -PPU ::~PPU() +PPU::~PPU() { }