Skip to content

Commit

Permalink
Simplify screen decl
Browse files Browse the repository at this point in the history
Avoid going through a reference and remove null_surface
  • Loading branch information
Daft-Freak committed Oct 31, 2024
1 parent d1e7975 commit d0ab773
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions 32blit/engine/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace blit {

if(new_screen.pen_blend)
screen.pbf = new_screen.pen_blend;

if(new_screen.blit_blend)
screen.bbf = new_screen.blit_blend;

Expand Down Expand Up @@ -89,8 +89,7 @@ namespace blit {
return ret;
}

Surface null_surface(nullptr, PixelFormat::M, Size(0, 0));
Surface &screen = null_surface;
Surface screen(nullptr, PixelFormat::M, Size(0, 0));

static const uint32_t update_rate_ms = 10;
static uint32_t pending_update_time = 0;
Expand Down
2 changes: 1 addition & 1 deletion 32blit/engine/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace blit {

enum ScreenMode { lores, hires, hires_palette };
extern Surface &screen;
extern Surface screen;


extern void (*init) ();
Expand Down

0 comments on commit d0ab773

Please sign in to comment.