1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Remove global args from editorclass

This removes global arg passing from all functions on editorclass.
Callers have been updated correspondingly. Additionally, all 'dwgfx' has
been replaced with 'graphics' in editor.cpp.
This commit is contained in:
Misa 2020-03-31 12:52:10 -07:00 committed by Ethan Lee
parent ea3c778b84
commit 9bc45c586e
4 changed files with 450 additions and 454 deletions

View file

@ -3224,7 +3224,7 @@ void scriptclass::startgamemode( int t )
//Initilise the level //Initilise the level
//First up, find the start point //First up, find the start point
ed.weirdloadthing(ed.ListOfMetaData[game.playcustomlevel].filename); ed.weirdloadthing(ed.ListOfMetaData[game.playcustomlevel].filename);
ed.findstartpoint(game); ed.findstartpoint();
game.gamestate = GAMEMODE; game.gamestate = GAMEMODE;
music.fadeout(); music.fadeout();
@ -3253,7 +3253,7 @@ void scriptclass::startgamemode( int t )
} }
map.gotoroom(game.saverx, game.savery); map.gotoroom(game.saverx, game.savery);
ed.generatecustomminimap(graphics, map); ed.generatecustomminimap();
map.customshowmm=true; map.customshowmm=true;
if(ed.levmusic>0){ if(ed.levmusic>0){
music.play(ed.levmusic); music.play(ed.levmusic);
@ -3267,7 +3267,7 @@ void scriptclass::startgamemode( int t )
//Initilise the level //Initilise the level
//First up, find the start point //First up, find the start point
ed.weirdloadthing(ed.ListOfMetaData[game.playcustomlevel].filename); ed.weirdloadthing(ed.ListOfMetaData[game.playcustomlevel].filename);
ed.findstartpoint(game); ed.findstartpoint();
game.gamestate = GAMEMODE; game.gamestate = GAMEMODE;
music.fadeout(); music.fadeout();
@ -3305,7 +3305,7 @@ void scriptclass::startgamemode( int t )
music.currentsong=-1; music.currentsong=-1;
} }
*/ */
ed.generatecustomminimap(graphics, map); ed.generatecustomminimap();
graphics.fademode = 4; graphics.fademode = 4;
//load("intro"); //load("intro");
break; break;

File diff suppressed because it is too large Load diff

View file

@ -7,9 +7,6 @@
#include <string> #include <string>
#include "Script.h" #include "Script.h"
class KeyPoll; class Graphics; class Game; class mapclass; class entityclass; class UtilityClass; class musicclass;
class edentities{ class edentities{
public: public:
int x, y, t; int x, y, t;
@ -129,7 +126,7 @@ class editorclass{
void load(std::string& _path); void load(std::string& _path);
void save(std::string& _path); void save(std::string& _path);
void generatecustomminimap(Graphics& dwgfx, mapclass& map); void generatecustomminimap();
int edgetile(int x, int y); int edgetile(int x, int y);
int warpzoneedgetile(int x, int y); int warpzoneedgetile(int x, int y);
int outsideedgetile(int x, int y); int outsideedgetile(int x, int y);
@ -142,7 +139,7 @@ class editorclass{
int findcrewmate(int t); int findcrewmate(int t);
int findwarptoken(int t); int findwarptoken(int t);
void countstuff(); void countstuff();
void findstartpoint(Game& game); void findstartpoint();
void weirdloadthing(std::string t); void weirdloadthing(std::string t);
int getlevelcol(int t); int getlevelcol(int t);
int getenemycol(int t); int getenemycol(int t);
@ -245,16 +242,15 @@ int edentat(int xp, int yp);
bool edentclear(int xp, int yp); bool edentclear(int xp, int yp);
void fillbox(Graphics& dwgfx, int x, int y, int x2, int y2, int c); void fillbox(int x, int y, int x2, int y2, int c);
void fillboxabs(Graphics& dwgfx, int x, int y, int x2, int y2, int c); void fillboxabs(int x, int y, int x2, int y2, int c);
void editorrender(KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, entityclass& obj, UtilityClass& help); void editorrender();
void editorlogic(KeyPoll& key, Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music, mapclass& map, UtilityClass& help); void editorlogic();
void editorinput(KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, void editorinput();
entityclass& obj, UtilityClass& help, musicclass& music);
#endif /* EDITOR_H */ #endif /* EDITOR_H */

View file

@ -363,11 +363,11 @@ int main(int argc, char *argv[])
case EDITORMODE: case EDITORMODE:
graphics.flipmode = false; graphics.flipmode = false;
//Input //Input
editorinput(key, graphics, game, map, obj, help, music); editorinput();
//Render //Render
editorrender(key, graphics, game, map, obj, help); editorrender();
////Logic ////Logic
editorlogic(key, graphics, game, obj, music, map, help); editorlogic();
break; break;
#endif #endif
case TITLEMODE: case TITLEMODE: