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:
@@ -9,6 +9,7 @@
|
||||
#include "Otherlevel.h"
|
||||
#include "Spacestation2.h"
|
||||
#include "Tower.h"
|
||||
#include "TowerBG.h"
|
||||
#include "WarpClass.h"
|
||||
|
||||
struct Roomtext
|
||||
@@ -47,7 +48,7 @@ public:
|
||||
|
||||
void setcol(const int r1, const int g1, const int b1 , const int r2, const int g2, const int b2, const int c);
|
||||
|
||||
void updatetowerglow();
|
||||
void updatetowerglow(TowerBG& bg_obj);
|
||||
|
||||
void nexttowercolour();
|
||||
|
||||
@@ -102,21 +103,17 @@ public:
|
||||
bool towermode;
|
||||
float ypos;
|
||||
float oldypos;
|
||||
int bypos;
|
||||
int cameramode;
|
||||
int cameraseek, cameraseekframe;
|
||||
int resumedelay;
|
||||
bool minitowermode;
|
||||
int scrolldir;
|
||||
|
||||
//This is the old colour cycle
|
||||
int r, g,b;
|
||||
int colstate, colstatedelay;
|
||||
int colstatedelay;
|
||||
int colsuperstate;
|
||||
int spikeleveltop, spikelevelbottom;
|
||||
int oldspikeleveltop, oldspikelevelbottom;
|
||||
bool tdrawback;
|
||||
int bscroll;
|
||||
//final level navigation
|
||||
int finalx;
|
||||
int finaly;
|
||||
@@ -172,18 +169,8 @@ public:
|
||||
int kludge_bypos;
|
||||
int kludge_colstate;
|
||||
int kludge_scrolldir;
|
||||
void inline bg_to_kludge()
|
||||
{
|
||||
kludge_bypos = bypos;
|
||||
kludge_colstate = colstate;
|
||||
kludge_scrolldir = scrolldir;
|
||||
}
|
||||
void inline kludge_to_bg()
|
||||
{
|
||||
bypos = kludge_bypos;
|
||||
colstate = kludge_colstate;
|
||||
scrolldir = kludge_scrolldir;
|
||||
}
|
||||
void bg_to_kludge();
|
||||
void kludge_to_bg();
|
||||
};
|
||||
|
||||
#ifndef MAP_DEFINITION
|
||||
|
||||
Reference in New Issue
Block a user