Remove global args from Game

I've decided to call dwgfx/game/map/obj/key/help/music the "global args".
Because they're essentially global variables that are being passed
around in args.

This commit removes global args from all functions on the Game class,
and deals with updating the callsites of said functions accordingly. It
also renames all usages of 'dwgfx' in Game.cpp to 'graphics', since the
global variable is called 'graphics' now.

Interesting to note, I was removing the class defines from Game.h, but
it turns out that Graphics.h depends on the mapclass and entityclass
defines from Game.h. And also Graphics.h spelled mapclass wrong (it
forgot the "class") so I just decided to use that existing line instead.
This is only temporary and after all is said and done, at the end of
this pull request those class defines will be gone.
This commit is contained in:
Misa
2020-03-30 17:16:02 -07:00
committed by Ethan Lee
parent 1be398319c
commit 0e561f23f8
8 changed files with 586 additions and 593 deletions

View File

@@ -9,11 +9,6 @@
#include "GraphicsUtil.h"
class entityclass;
class mapclass;
class Graphics;
class musicclass;
class Game
{
public:
@@ -37,52 +32,52 @@ public:
void resetgameclock();
void customsavequick(std::string savfile, mapclass& map, entityclass& obj, musicclass& music);
void savequick(mapclass& map, entityclass& obj, musicclass& music);
void customsavequick(std::string savfile);
void savequick();
void gameclock();
std::string giventimestring(int hrs, int min, int sec, UtilityClass& help );
std::string giventimestring(int hrs, int min, int sec);
std::string timestring(UtilityClass& help);
std::string timestring();
std::string partimestring(UtilityClass& help);
std::string partimestring();
std::string resulttimestring(UtilityClass& help);
std::string resulttimestring();
std::string timetstring(int t, UtilityClass& help);
std::string timetstring(int t);
void createmenu(std::string t);
void lifesequence(entityclass& obj);
void lifesequence();
void gethardestroom(mapclass& map);
void gethardestroom();
void updatestate(Graphics& dwgfx, mapclass& map, entityclass& obj, UtilityClass& help, musicclass& music);
void updatestate();
void unlocknum(int t, mapclass& map, Graphics& dwgfx);
void unlocknum(int t);
void loadstats(mapclass& map, Graphics& dwgfx);
void loadstats();
void savestats(mapclass& map, Graphics& dwgfx);
void savestats();
void deletestats(mapclass& map, Graphics& dwgfx);
void deletestats();
void deletequick();
void savetele(mapclass& map, entityclass& obj, musicclass& music);
void savetele();
void loadtele(mapclass& map, entityclass& obj, musicclass& music);
void loadtele();
void deletetele();
void customstart(entityclass& obj, musicclass& music );
void customstart();
void start(entityclass& obj, musicclass& music );
void start();
void startspecial(int t, entityclass& obj, musicclass& music);
void startspecial(int t);
void starttrial(int t, entityclass& obj, musicclass& music);
void starttrial(int t);
void telegotoship()
{
@@ -104,14 +99,14 @@ public:
void swnpenalty();
void deathsequence(mapclass& map, entityclass& obj, musicclass& music);
void deathsequence();
void customloadquick(std::string savfile, mapclass& map, entityclass& obj, musicclass& music);
void loadquick(mapclass& map, entityclass& obj, musicclass& music);
void customloadquick(std::string savfile);
void loadquick();
void loadsummary(mapclass& map, UtilityClass& help);
void loadsummary();
void initteleportermode(mapclass& map);
void initteleportermode();
std::string saveFilePath;