1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-27 15:08:30 +02:00

Remove global args from preloader.cpp

This removes all global args from preloader.cpp, and changes all 'dwgfx'
to 'graphics'.
This commit is contained in:
Misa 2020-04-01 15:01:08 -07:00 committed by Ethan Lee
parent 07a0c74b01
commit cef111d35b
3 changed files with 33 additions and 33 deletions

View File

@ -357,7 +357,7 @@ int main(int argc, char *argv[])
{ {
case PRELOADER: case PRELOADER:
//Render //Render
preloaderrender(graphics, game, help); preloaderrender();
break; break;
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
case EDITORMODE: case EDITORMODE:

View File

@ -9,10 +9,10 @@ int pre_darkcol=0, pre_lightcol=0, pre_curcol=0, pre_coltimer=0, pre_offset=0;
int pre_frontrectx=30, pre_frontrecty=20, pre_frontrectw=260, pre_frontrecth=200; int pre_frontrectx=30, pre_frontrecty=20, pre_frontrectw=260, pre_frontrecth=200;
int pre_temprectx=0, pre_temprecty=0, pre_temprectw=320, pre_temprecth=240; int pre_temprectx=0, pre_temprecty=0, pre_temprectw=320, pre_temprecth=240;
void preloaderrender(Graphics& dwgfx, Game& game, UtilityClass& help) void preloaderrender()
{ {
//TODO //TODO
//dwgfx.backbuffer.lock(); //graphics.backbuffer.lock();
//Draw grid //Draw grid
@ -34,32 +34,32 @@ void preloaderrender(Graphics& dwgfx, Game& game, UtilityClass& help)
} }
switch(pre_curcol) { switch(pre_curcol) {
case 0: case 0:
pre_lightcol = dwgfx.RGBflip(0xBF,0x59,0x6F); pre_lightcol = graphics.RGBflip(0xBF,0x59,0x6F);
pre_darkcol = dwgfx.RGBflip(0x88,0x3E,0x53); pre_darkcol = graphics.RGBflip(0x88,0x3E,0x53);
break; break;
case 1: case 1:
pre_lightcol = dwgfx.RGBflip(0x6C,0xBC,0x5C); pre_lightcol = graphics.RGBflip(0x6C,0xBC,0x5C);
pre_darkcol = dwgfx.RGBflip(0x50,0x86,0x40); pre_darkcol = graphics.RGBflip(0x50,0x86,0x40);
break; break;
case 2: case 2:
pre_lightcol = dwgfx.RGBflip(0x5D,0x57,0xAA); pre_lightcol = graphics.RGBflip(0x5D,0x57,0xAA);
pre_darkcol = dwgfx.RGBflip(0x2F,0x2F,0x6C); pre_darkcol = graphics.RGBflip(0x2F,0x2F,0x6C);
break; break;
case 3: case 3:
pre_lightcol = dwgfx.RGBflip(0xB7,0xBA,0x5E); pre_lightcol = graphics.RGBflip(0xB7,0xBA,0x5E);
pre_darkcol = dwgfx.RGBflip(0x84,0x83,0x42); pre_darkcol = graphics.RGBflip(0x84,0x83,0x42);
break; break;
case 4: case 4:
pre_lightcol = dwgfx.RGBflip(0x57,0x90,0xAA); pre_lightcol = graphics.RGBflip(0x57,0x90,0xAA);
pre_darkcol = dwgfx.RGBflip(0x2F,0x5B,0x6C); pre_darkcol = graphics.RGBflip(0x2F,0x5B,0x6C);
break; break;
case 5: case 5:
pre_lightcol = dwgfx.RGBflip(0x90,0x61,0xB1); pre_lightcol = graphics.RGBflip(0x90,0x61,0xB1);
pre_darkcol = dwgfx.RGBflip(0x58,0x3D,0x71); pre_darkcol = graphics.RGBflip(0x58,0x3D,0x71);
break; break;
default: default:
pre_lightcol = dwgfx.RGBflip(0x00,0x00,0x00); pre_lightcol = graphics.RGBflip(0x00,0x00,0x00);
pre_darkcol = dwgfx.RGBflip(0x08,0x00,0x00); pre_darkcol = graphics.RGBflip(0x08,0x00,0x00);
break; break;
} }
@ -67,20 +67,20 @@ void preloaderrender(Graphics& dwgfx, Game& game, UtilityClass& help)
pre_temprecty = (i * 16)- pre_offset; pre_temprecty = (i * 16)- pre_offset;
if (i % 2 == 0) if (i % 2 == 0)
{ {
FillRect(dwgfx.backBuffer, pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, pre_lightcol); FillRect(graphics.backBuffer, pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, pre_lightcol);
} }
else else
{ {
FillRect(dwgfx.backBuffer, pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, pre_darkcol); FillRect(graphics.backBuffer, pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, pre_darkcol);
} }
} }
FillRect(dwgfx.backBuffer, pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, dwgfx.getBGR(0x3E,0x31,0xA2)); FillRect(graphics.backBuffer, pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, graphics.getBGR(0x3E,0x31,0xA2));
if(pre_fakepercent==100){ if(pre_fakepercent==100){
dwgfx.Print(282-(15*8), 204, "LOADING... " + help.String(int(pre_fakepercent))+"%", 124, 112, 218, false); graphics.Print(282-(15*8), 204, "LOADING... " + help.String(int(pre_fakepercent))+"%", 124, 112, 218, false);
}else{ }else{
dwgfx.Print(282-(14*8), 204, "LOADING... " + help.String(int(pre_fakepercent))+"%", 124, 112, 218, false); graphics.Print(282-(14*8), 204, "LOADING... " + help.String(int(pre_fakepercent))+"%", 124, 112, 218, false);
} }
//Render //Render
@ -90,37 +90,37 @@ void preloaderrender(Graphics& dwgfx, Game& game, UtilityClass& help)
}else if (pre_transition <= -10) { }else if (pre_transition <= -10) {
game.gamestate=TITLEMODE; game.gamestate=TITLEMODE;
}else if (pre_transition < 5) { }else if (pre_transition < 5) {
FillRect(dwgfx.backBuffer, 0, 0, 320,240, dwgfx.getBGR(0,0,0)); FillRect(graphics.backBuffer, 0, 0, 320,240, graphics.getBGR(0,0,0));
}else if (pre_transition < 20) { }else if (pre_transition < 20) {
pre_temprecty = 0; pre_temprecty = 0;
pre_temprecth = 240; pre_temprecth = 240;
FillRect(dwgfx.backBuffer, pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, 0x000000); FillRect(graphics.backBuffer, pre_temprectx, pre_temprecty, pre_temprectw,pre_temprecth, 0x000000);
FillRect(dwgfx.backBuffer, pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, dwgfx.getBGR(0x3E,0x31,0xA2)); FillRect(graphics.backBuffer, pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, graphics.getBGR(0x3E,0x31,0xA2));
dwgfx.Print(282-(15*8), 204, "LOADING... 100%", 124, 112, 218, false); graphics.Print(282-(15*8), 204, "LOADING... 100%", 124, 112, 218, false);
} }
if (game.test) if (game.test)
{ {
dwgfx.Print(5, 5, game.teststring, 196, 196, 255 - help.glow, false); graphics.Print(5, 5, game.teststring, 196, 196, 255 - help.glow, false);
} }
dwgfx.drawfade(); graphics.drawfade();
if (game.flashlight > 0 && !game.noflashingmode) if (game.flashlight > 0 && !game.noflashingmode)
{ {
game.flashlight--; game.flashlight--;
dwgfx.flashlight(); graphics.flashlight();
} }
if (game.screenshake > 0 && !game.noflashingmode) if (game.screenshake > 0 && !game.noflashingmode)
{ {
game.screenshake--; game.screenshake--;
dwgfx.screenshake(); graphics.screenshake();
} }
else else
{ {
dwgfx.render(); graphics.render();
} }
//dwgfx.backbuffer.unlock(); //graphics.backbuffer.unlock();
} }

View File

@ -5,6 +5,6 @@
#include "Game.h" #include "Game.h"
#include "UtilityClass.h" #include "UtilityClass.h"
void preloaderrender(Graphics& dwgfx, Game& game, UtilityClass& help); void preloaderrender();
#endif /* PRELOADER_H */ #endif /* PRELOADER_H */