mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Refactor tower background to use a separate object instead
Previously, the tower background was controlled by a disparate set of attributes on Graphics and mapclass, and wasn't really encapsulated. (If that's what that word means, I don't particularly care about object-oriented lingo.) But now, all relevant things that a tower background has has been put into a TowerBG struct, so it will be easy to make multiple copies without having to duplicate the code that handles it.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "Maths.h"
|
||||
#include "Screen.h"
|
||||
#include "Textbox.h"
|
||||
#include "TowerBG.h"
|
||||
|
||||
class Graphics
|
||||
{
|
||||
@@ -168,7 +169,7 @@ public:
|
||||
void drawtile2( int x, int y, int t );
|
||||
void drawtile( int x, int y, int t );
|
||||
void drawtowertile( int x, int y, int t );
|
||||
void drawtowertile3( int x, int y, int t, int off );
|
||||
void drawtowertile3( int x, int y, int t, TowerBG& bg_obj );
|
||||
|
||||
void drawmap();
|
||||
|
||||
@@ -192,8 +193,8 @@ public:
|
||||
|
||||
void menuoffrender();
|
||||
|
||||
void drawtowerbackground();
|
||||
void updatetowerbackground();
|
||||
void drawtowerbackground(const TowerBG& bg_obj);
|
||||
void updatetowerbackground(TowerBG& bg_obj);
|
||||
|
||||
void setcol(int t);
|
||||
void drawfinalmap();
|
||||
@@ -225,11 +226,11 @@ public:
|
||||
SDL_Surface* backBuffer;
|
||||
Screen* screenbuffer;
|
||||
SDL_Surface* menubuffer;
|
||||
SDL_Surface* towerbuffer;
|
||||
SDL_Surface* towerbuffer_lerp;
|
||||
SDL_Surface* foregroundBuffer;
|
||||
SDL_Surface* tempBuffer;
|
||||
|
||||
TowerBG towerbg;
|
||||
|
||||
SDL_Rect bfont_rect;
|
||||
SDL_Rect tiles_rect;
|
||||
SDL_Rect sprites_rect;
|
||||
|
||||
Reference in New Issue
Block a user