1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-18 10:38:31 +02:00

Remove global args from mapclass

This commit removes the global args being passed around from the
function args on the mapclass object, as well as updating all callers in
other files to not have those args. Furthermore, 'dwgfx' has been
renamed to 'graphics' in Map.cpp.
This commit is contained in:
Misa 2020-03-31 01:09:42 -07:00 committed by Ethan Lee
parent cac1a9e3ab
commit 35d9bcce05
4 changed files with 127 additions and 127 deletions

View File

@ -290,7 +290,7 @@ void towerlogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& musi
game.gravitycontrol = game.savegc;
dwgfx.textboxremove();
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
}
}
@ -391,13 +391,13 @@ void towerlogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& musi
if (game.door_left > -2 && obj.entities[player].xp < -14)
{
obj.entities[player].xp += 320;
map.gotoroom(48, 52, dwgfx, game, obj, music);
map.gotoroom(48, 52);
}
if (game.door_right > -2 && obj.entities[player].xp >= 308)
{
obj.entities[player].xp -= 320;
obj.entities[player].yp -= (71*8);
map.gotoroom(game.roomx + 1, game.roomy+1, dwgfx, game, obj, music);
map.gotoroom(game.roomx + 1, game.roomy+1);
}
}
else
@ -410,18 +410,18 @@ void towerlogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& musi
{
obj.entities[player].xp += 320;
obj.entities[player].yp -= (71 * 8);
map.gotoroom(50, 54, dwgfx, game, obj, music);
map.gotoroom(50, 54);
}
else
{
obj.entities[player].xp += 320;
map.gotoroom(50, 53, dwgfx, game, obj, music);
map.gotoroom(50, 53);
}
}
if (game.door_right > -2 && obj.entities[player].xp >= 308)
{
obj.entities[player].xp -= 320;
map.gotoroom(52, 53, dwgfx, game, obj, music);
map.gotoroom(52, 53);
}
}
}
@ -453,12 +453,12 @@ void towerlogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& musi
{
obj.entities[player].xp += 320;
obj.entities[player].yp -= (671 * 8);
map.gotoroom(108, 109, dwgfx, game, obj, music);
map.gotoroom(108, 109);
}
if (game.door_right > -2 && obj.entities[player].xp >= 308)
{
obj.entities[player].xp -= 320;
map.gotoroom(110, 104, dwgfx, game, obj, music);
map.gotoroom(110, 104);
}
}
}
@ -678,7 +678,7 @@ void gamelogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music
game.gravitycontrol = game.savegc;
dwgfx.textboxremove();
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
}
}
@ -700,7 +700,7 @@ void gamelogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music
temp = 1+int(fRandom() * 6);
if (temp == map.final_mapcol) temp = (temp + 1) % 6;
if (temp == 0) temp = 6;
map.changefinalcol(temp, obj,game);
map.changefinalcol(temp);
}
else if (map.final_colorframe == 2)
{
@ -708,7 +708,7 @@ void gamelogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music
temp = 1+int(fRandom() * 6);
if (temp == map.final_mapcol) temp = (temp + 1) % 6;
if (temp == 0) temp = 6;
map.changefinalcol(temp, obj,game);
map.changefinalcol(temp);
}
}
}
@ -1145,12 +1145,12 @@ void gamelogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music
if (game.door_down > -2 && obj.entities[player].yp >= 238)
{
obj.entities[player].yp -= 240;
map.gotoroom(game.roomx, game.roomy + 1, dwgfx, game, obj, music);
map.gotoroom(game.roomx, game.roomy + 1);
}
if (game.door_up > -2 && obj.entities[player].yp < -2)
{
obj.entities[player].yp += 240;
map.gotoroom(game.roomx, game.roomy - 1, dwgfx, game, obj, music);
map.gotoroom(game.roomx, game.roomy - 1);
}
}
else if (map.warpy)
@ -1197,12 +1197,12 @@ void gamelogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music
if (game.door_left > -2 && obj.entities[player].xp < -14)
{
obj.entities[player].xp += 320;
map.gotoroom(game.roomx - 1, game.roomy, dwgfx, game, obj, music);
map.gotoroom(game.roomx - 1, game.roomy);
}
if (game.door_right > -2 && obj.entities[player].xp >= 308)
{
obj.entities[player].xp -= 320;
map.gotoroom(game.roomx + 1, game.roomy, dwgfx, game, obj, music);
map.gotoroom(game.roomx + 1, game.roomy);
}
}
else
@ -1212,22 +1212,22 @@ void gamelogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music
if (game.door_down > -2 && obj.entities[player].yp >= 238)
{
obj.entities[player].yp -= 240;
map.gotoroom(game.roomx, game.roomy + 1, dwgfx, game, obj, music);
map.gotoroom(game.roomx, game.roomy + 1);
}
if (game.door_up > -2 && obj.entities[player].yp < -2)
{
obj.entities[player].yp += 240;
map.gotoroom(game.roomx, game.roomy - 1, dwgfx, game, obj, music);
map.gotoroom(game.roomx, game.roomy - 1);
}
if (game.door_left > -2 && obj.entities[player].xp < -14)
{
obj.entities[player].xp += 320;
map.gotoroom(game.roomx - 1, game.roomy, dwgfx, game, obj, music);
map.gotoroom(game.roomx - 1, game.roomy);
}
if (game.door_right > -2 && obj.entities[player].xp >= 308)
{
obj.entities[player].xp -= 320;
map.gotoroom(game.roomx + 1, game.roomy, dwgfx, game, obj, music);
map.gotoroom(game.roomx + 1, game.roomy);
}
}
@ -1241,7 +1241,7 @@ void gamelogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music
edi2 = (edi-(edi%40))/40;
edj2 = (edj-(edj%30))/30;
map.warpto(100+edi2, 100+edj2, obj.getplayer(), edi%40, (edj%30)+2, dwgfx, game, obj, music);
map.warpto(100+edi2, 100+edj2, obj.getplayer(), edi%40, (edj%30)+2);
game.teleport = false;
if (game.teleport == false)
@ -1257,56 +1257,56 @@ void gamelogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music
{
int i = obj.getplayer();
obj.entities[i].yp = 225;
map.gotoroom(119, 100, dwgfx, game, obj, music);
map.gotoroom(119, 100);
game.teleport = false;
}
else if (game.roomx == 119 && game.roomy == 100)
{
int i = obj.getplayer();
obj.entities[i].yp = 225;
map.gotoroom(119, 103, dwgfx, game, obj, music);
map.gotoroom(119, 103);
game.teleport = false;
}
else if (game.roomx == 119 && game.roomy == 103)
{
int i = obj.getplayer();
obj.entities[i].xp = 0;
map.gotoroom(116, 103, dwgfx, game, obj, music);
map.gotoroom(116, 103);
game.teleport = false;
}
else if (game.roomx == 116 && game.roomy == 103)
{
int i = obj.getplayer();
obj.entities[i].yp = 225;
map.gotoroom(116, 100, dwgfx, game, obj, music);
map.gotoroom(116, 100);
game.teleport = false;
}
else if (game.roomx == 116 && game.roomy == 100)
{
int i = obj.getplayer();
obj.entities[i].xp = 0;
map.gotoroom(114, 102, dwgfx, game, obj, music);
map.gotoroom(114, 102);
game.teleport = false;
}
else if (game.roomx == 114 && game.roomy == 102)
{
int i = obj.getplayer();
obj.entities[i].yp = 225;
map.gotoroom(113, 100, dwgfx, game, obj, music);
map.gotoroom(113, 100);
game.teleport = false;
}
else if (game.roomx == 116 && game.roomy == 104)
{
//pre warp zone here
map.warpto(107, 101, obj.getplayer(), 14, 16, dwgfx, game, obj, music);
map.warpto(107, 101, obj.getplayer(), 14, 16);
}
else if (game.roomx == 107 && game.roomy == 101)
{
map.warpto(105, 119, obj.getplayer(), 5, 26, dwgfx, game, obj, music);
map.warpto(105, 119, obj.getplayer(), 5, 26);
}
else if (game.roomx == 105 && game.roomy == 118)
{
map.warpto(101, 111, obj.getplayer(), 34, 6, dwgfx, game, obj, music);
map.warpto(101, 111, obj.getplayer(), 34, 6);
}
else if (game.roomx == 101 && game.roomy == 111)
{
@ -1314,31 +1314,31 @@ void gamelogic(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music
switch(game.teleportxpos)
{
case 1:
map.warpto(108, 108, obj.getplayer(), 4, 27, dwgfx, game, obj, music);
map.warpto(108, 108, obj.getplayer(), 4, 27);
break;
case 2:
map.warpto(101, 111, obj.getplayer(), 12, 27, dwgfx, game, obj, music);
map.warpto(101, 111, obj.getplayer(), 12, 27);
break;
case 3:
map.warpto(119, 111, obj.getplayer(), 31, 7, dwgfx, game, obj, music);
map.warpto(119, 111, obj.getplayer(), 31, 7);
break;
case 4:
map.warpto(114, 117, obj.getplayer(), 19, 16, dwgfx, game, obj, music);
map.warpto(114, 117, obj.getplayer(), 19, 16);
break;
}
}
else if (game.roomx == 108 && game.roomy == 106)
{
map.warpto(119, 111, obj.getplayer(), 4, 27, dwgfx, game, obj, music);
map.warpto(119, 111, obj.getplayer(), 4, 27);
}
else if (game.roomx == 100 && game.roomy == 111)
{
map.warpto(101, 111, obj.getplayer(), 24, 6, dwgfx, game, obj, music);
map.warpto(101, 111, obj.getplayer(), 24, 6);
}
else if (game.roomx == 119 && game.roomy == 107)
{
//Secret lab, to super gravitron
map.warpto(119, 108, obj.getplayer(), 19, 10, dwgfx, game, obj, music);
map.warpto(119, 108, obj.getplayer(), 19, 10);
}
if (game.teleport == false)
{

View File

@ -515,7 +515,7 @@ int mapclass::maptiletoenemycol(int t)
return 11;
}
void mapclass::changefinalcol(int t, entityclass& obj, Game& game)
void mapclass::changefinalcol(int t)
{
//change the map to colour t - for the game's final stretch.
//First up, the tiles. This is just a setting:
@ -819,12 +819,12 @@ void mapclass::showship()
explored[4 + (11 * 20)] = 1;
}
void mapclass::resetplayer(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music)
void mapclass::resetplayer()
{
bool was_in_tower = towermode;
if (game.roomx != game.saverx || game.roomy != game.savery)
{
gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
gotoroom(game.saverx, game.savery);
}
game.deathseq = -1;
@ -876,16 +876,16 @@ void mapclass::resetplayer(Graphics& dwgfx, Game& game, entityclass& obj, musicc
}
}
void mapclass::warpto(int rx, int ry , int t, int tx, int ty, Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music)
void mapclass::warpto(int rx, int ry , int t, int tx, int ty)
{
gotoroom(rx, ry, dwgfx, game, obj, music);
gotoroom(rx, ry);
game.teleport = false;
obj.entities[t].xp = tx * 8;
obj.entities[t].yp = (ty * 8) - obj.entities[t].h;
game.gravitycontrol = 0;
}
void mapclass::gotoroom(int rx, int ry, Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music)
void mapclass::gotoroom(int rx, int ry)
{
//First, destroy the current room
obj.removeallblocks();
@ -999,7 +999,7 @@ void mapclass::gotoroom(int rx, int ry, Graphics& dwgfx, Game& game, entityclass
if (game.roomx == 107 && game.roomy == 109) music.niceplay(4);
if (game.roomx == 108 && game.roomy == 109)
{
if (dwgfx.setflipmode)
if (graphics.setflipmode)
{
music.niceplay(9);
}
@ -1010,7 +1010,7 @@ void mapclass::gotoroom(int rx, int ry, Graphics& dwgfx, Game& game, entityclass
}
if (game.roomx == 109)
{
if (dwgfx.setflipmode)
if (graphics.setflipmode)
{
music.niceplay(9);
}
@ -1053,7 +1053,7 @@ void mapclass::gotoroom(int rx, int ry, Graphics& dwgfx, Game& game, entityclass
if (game.roomx == 104 && game.roomy == 112) music.niceplay(4);
}
temp = rx + (ry * 100);
loadlevel(game.roomx, game.roomy, dwgfx, game, obj, music);
loadlevel(game.roomx, game.roomy);
//Do we need to reload the background?
@ -1061,9 +1061,9 @@ void mapclass::gotoroom(int rx, int ry, Graphics& dwgfx, Game& game, entityclass
if(redrawbg)
{
dwgfx.backgrounddrawn = false; //Used for background caching speedup
graphics.backgrounddrawn = false; //Used for background caching speedup
}
dwgfx.foregrounddrawn = false; //Used for background caching speedup
graphics.foregrounddrawn = false; //Used for background caching speedup
game.prevroomx = game.roomx;
game.prevroomy = game.roomy;
@ -1174,7 +1174,7 @@ std::string mapclass::currentarea(int t)
return "???";
}
void mapclass::loadlevel(int rx, int ry, Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music)
void mapclass::loadlevel(int rx, int ry)
{
int t;
//t = rx + (ry * 100);
@ -1287,13 +1287,13 @@ void mapclass::loadlevel(int rx, int ry, Graphics& dwgfx, Game& game, entityclas
{
//in the secret lab! Crazy background!
background = 2;
if (rx == 116 && ry == 105) dwgfx.rcol = 1;
if (rx == 117 && ry == 105) dwgfx.rcol = 5;
if (rx == 118 && ry == 105) dwgfx.rcol = 4;
if (rx == 117 && ry == 106) dwgfx.rcol = 2;
if (rx == 118 && ry == 106) dwgfx.rcol = 0;
if (rx == 119 && ry == 106) dwgfx.rcol = 3;
if (rx == 119 && ry == 107) dwgfx.rcol = 1;
if (rx == 116 && ry == 105) graphics.rcol = 1;
if (rx == 117 && ry == 105) graphics.rcol = 5;
if (rx == 118 && ry == 105) graphics.rcol = 4;
if (rx == 117 && ry == 106) graphics.rcol = 2;
if (rx == 118 && ry == 106) graphics.rcol = 0;
if (rx == 119 && ry == 106) graphics.rcol = 3;
if (rx == 119 && ry == 107) graphics.rcol = 1;
}
}
}
@ -1304,7 +1304,7 @@ void mapclass::loadlevel(int rx, int ry, Graphics& dwgfx, Game& game, entityclas
if (rx == 119 && ry == 108 && !custommode)
{
background = 5;
dwgfx.rcol = 3;
graphics.rcol = 3;
warpx = true;
warpy = true;
}
@ -1334,7 +1334,7 @@ void mapclass::loadlevel(int rx, int ry, Graphics& dwgfx, Game& game, entityclas
roomname = lablevel.roomname;
tileset = 1;
background = 2;
dwgfx.rcol = lablevel.rcol;
graphics.rcol = lablevel.rcol;
break;
case 3: //The Tower
tdrawback = true;
@ -1380,8 +1380,8 @@ void mapclass::loadlevel(int rx, int ry, Graphics& dwgfx, Game& game, entityclas
roomname = warplevel.roomname;
tileset = 1;
background = 3;
dwgfx.rcol = warplevel.rcol;
dwgfx.backgrounddrawn = false;
graphics.rcol = warplevel.rcol;
graphics.backgrounddrawn = false;
warpx = warplevel.warpx;
warpy = warplevel.warpy;
@ -1402,8 +1402,8 @@ void mapclass::loadlevel(int rx, int ry, Graphics& dwgfx, Game& game, entityclas
roomname = finallevel.roomname;
tileset = 1;
background = 3;
dwgfx.rcol = finallevel.rcol;
dwgfx.backgrounddrawn = false;
graphics.rcol = finallevel.rcol;
graphics.backgrounddrawn = false;
if (finalstretch)
{
@ -1419,8 +1419,8 @@ void mapclass::loadlevel(int rx, int ry, Graphics& dwgfx, Game& game, entityclas
if (warpx && warpy) background = 5;
}
dwgfx.rcol = 6;
changefinalcol(final_mapcol, obj, game);
graphics.rcol = 6;
changefinalcol(final_mapcol);
break;
case 7: //Final Level, Tower 1
tdrawback = true;
@ -1589,7 +1589,7 @@ void mapclass::loadlevel(int rx, int ry, Graphics& dwgfx, Game& game, entityclas
case 2: //Lab
tileset = 1;
background = 2;
dwgfx.rcol = ed.level[curlevel].tilecol;
graphics.rcol = ed.level[curlevel].tilecol;
break;
case 3: //Warp Zone/intermission
tileset = 1;
@ -1608,21 +1608,21 @@ void mapclass::loadlevel(int rx, int ry, Graphics& dwgfx, Game& game, entityclas
//If screen warping, then override all that:
bool redrawbg = game.roomx != game.prevroomx || game.roomy != game.prevroomy;
if(redrawbg){
dwgfx.backgrounddrawn = false;
graphics.backgrounddrawn = false;
}
if(ed.level[curlevel].warpdir>0){
if(ed.level[curlevel].warpdir==1){
warpx=true;
background=3;
dwgfx.rcol = ed.getwarpbackground(rx-100,ry-100);
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
}else if(ed.level[curlevel].warpdir==2){
warpy=true;
background=4;
dwgfx.rcol = ed.getwarpbackground(rx-100,ry-100);
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
}else if(ed.level[curlevel].warpdir==3){
warpx=true; warpy=true;
background = 5;
dwgfx.rcol = ed.getwarpbackground(rx-100,ry-100);
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
}
}

View File

@ -44,7 +44,7 @@ public:
int maptiletoenemycol(int t);
void changefinalcol(int t, entityclass& obj, Game& game);
void changefinalcol(int t);
void setcol(const int r1, const int g1, const int b1 , const int r2, const int g2, const int b2, const int c);
@ -73,15 +73,15 @@ public:
void showship();
void resetplayer(Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music);
void resetplayer();
void warpto(int rx, int ry , int t, int tx, int ty, Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music);
void warpto(int rx, int ry , int t, int tx, int ty);
void gotoroom(int rx, int ry, Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music);
void gotoroom(int rx, int ry);
std::string currentarea(int t);
void loadlevel(int rx, int ry, Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music);
void loadlevel(int rx, int ry);
std::vector <int> roomdeaths;

View File

@ -280,7 +280,7 @@ void scriptclass::run( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map,
if (words[0] == "gotoroom")
{
//USAGE: gotoroom(x,y) (manually add 100)
map.gotoroom(ss_toi(words[1])+100, ss_toi(words[2])+100, dwgfx, game, obj, music);
map.gotoroom(ss_toi(words[1])+100, ss_toi(words[2])+100);
}
if (words[0] == "cutscene")
{
@ -1462,7 +1462,7 @@ void scriptclass::run( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map,
{
map.resetnames();
map.resetmap();
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
map.tdrawback = true;
obj.resetallflags();
@ -1518,7 +1518,7 @@ void scriptclass::run( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map,
map.finaly = ss_toi(words[2]);
game.roomx = map.finalx;
game.roomy = map.finaly;
map.gotoroom(game.roomx, game.roomy, dwgfx, game, obj, music);
map.gotoroom(game.roomx, game.roomy);
}
else if (words[0] == "rescued")
{
@ -1983,7 +1983,7 @@ void scriptclass::run( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map,
game.savepoint = 0;
game.gravitycontrol = 0;
map.gotoroom(46, 54, dwgfx, game, obj, music);
map.gotoroom(46, 54);
}
else if (words[0] == "telesave")
{
@ -2562,9 +2562,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intro");
break;
@ -2585,9 +2585,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
dwgfx.fademode = 4;
break;
case 2: //Load Quicksave
@ -2607,13 +2607,13 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
//a very special case for here needs to ensure that the tower is set correctly
if (map.towermode)
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
i = obj.getplayer();
map.ypos = obj.entities[i].yp - 120;
@ -2646,9 +2646,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
dwgfx.fademode = 4;
break;
case 4:
@ -2674,9 +2674,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
dwgfx.fademode = 4;
break;
case 5:
@ -2702,9 +2702,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
dwgfx.fademode = 4;
break;
case 6:
@ -2730,9 +2730,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
dwgfx.fademode = 4;
break;
case 7:
@ -2758,9 +2758,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
dwgfx.fademode = 4;
break;
case 8:
@ -2792,9 +2792,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
dwgfx.fademode = 4;
break;
case 9:
@ -2817,9 +2817,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intro");
@ -2846,9 +2846,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intro");
@ -2882,9 +2882,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
music.play(11);
dwgfx.fademode = 4;
break;
@ -2917,9 +2917,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intermission_1");
break;
@ -2952,9 +2952,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intermission_1");
break;
@ -2987,9 +2987,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intermission_1");
break;
@ -3022,9 +3022,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intermission_1");
break;
@ -3054,9 +3054,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intermission_2");
break;
@ -3086,9 +3086,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intermission_2");
break;
@ -3118,9 +3118,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intermission_2");
break;
@ -3150,9 +3150,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
load("intermission_2");
break;
@ -3173,9 +3173,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
dwgfx.fademode = 4;
break;
case 21: //play custom level (in editor)
@ -3210,9 +3210,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
if(ed.levmusic>0){
music.play(ed.levmusic);
}else{
@ -3249,9 +3249,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
ed.generatecustomminimap(dwgfx, map);
map.customshowmm=true;
@ -3295,9 +3295,9 @@ void scriptclass::startgamemode( int t, KeyPoll& key, Graphics& dwgfx, Game& gam
}
else
{
map.resetplayer(dwgfx, game, obj, music);
map.resetplayer();
}
map.gotoroom(game.saverx, game.savery, dwgfx, game, obj, music);
map.gotoroom(game.saverx, game.savery);
/* Handled by load
if(ed.levmusic>0){
music.play(ed.levmusic);
@ -3342,7 +3342,7 @@ void scriptclass::teleport( Graphics& dwgfx, Game& game, mapclass& map, entitycl
}
game.gravitycontrol = 0;
map.gotoroom(100+game.teleport_to_x, 100+game.teleport_to_y, dwgfx, game, obj, music);
map.gotoroom(100+game.teleport_to_x, 100+game.teleport_to_y);
j = obj.getteleporter();
obj.entities[j].state = 2;
game.teleport_to_new_area = false;