Explorar el Código

Graphics: remove automatic fill on frame start, add fill_screen function

Streetwalrus Einstein hace 10 años
padre
commit
a62ba45e1c
Se han modificado 3 ficheros con 4 adiciones y 11 borrados
  1. 2 3
      platform/Graphics.h
  2. 2 5
      platform/nspire/Graphics.cpp
  3. 0 3
      src/engine/main.cpp

+ 2 - 3
platform/Graphics.h

@@ -39,10 +39,9 @@ namespace WalrusRPG
                         const WalrusRPG::Utils::Rect &window);
 
         /*
-         * Set a background color or texture to be used by frame_begin()
-         * To be defined further
+         * Fill the screen with a color
          */
-        void set_bg(const WalrusRPG::Graphics::Pixel &new_bg);
+        void fill(const WalrusRPG::Graphics::Pixel &color);
     }
 }
 

+ 2 - 5
platform/nspire/Graphics.cpp

@@ -6,8 +6,6 @@
 
 using namespace Nspire;
 
-GRAPHICS::Pixel bg(0);
-
 void GRAPHICS::init()
 {
     CXfb::buffer_allocate();
@@ -20,7 +18,6 @@ void GRAPHICS::deinit()
 
 void GRAPHICS::frame_begin()
 {
-    CXfb::buffer_fill(bg);
 }
 
 void GRAPHICS::frame_end()
@@ -34,7 +31,7 @@ void GRAPHICS::put_sprite(const uint16_t *sheet, int x, int y,
     CXfb::draw_sprite_sheet(sheet, x, y, window);
 }
 
-void GRAPHICS::set_bg(const WalrusRPG::Graphics::Pixel &new_bg)
+void GRAPHICS::fill(const WalrusRPG::Graphics::Pixel &color)
 {
-    bg = new_bg;
+    CXfb::buffer_fill(color);
 }

+ 0 - 3
src/engine/main.cpp

@@ -15,9 +15,6 @@ int main(int argc, char *argv[])
     UNUSED(argv);
 
     Graphics::init();
-    Graphics::Pixel bg(0xFF, 0x40, 0xD0);
-    Graphics::set_bg(bg);
-
     Timers::init(0);
     Interrupts::init();