~ndiddy/libremo

a6a250fe20f5cccf211dfd7b932ca7156cb0597e — Nathan Misner 2 years ago ee1e1d4
fixed slight issue with logo timing
1 files changed, 14 insertions(+), 2 deletions(-)

M logo.cpp
M logo.cpp => logo.cpp +14 -2
@@ 32,6 32,7 @@ typedef enum {
	LOGO_STATE_MESH,
	LOGO_STATE_FLASH,
	LOGO_STATE_RING,
	LOGO_STATE_WAIT,
	LOGO_STATE_FADEOUT
} LOGO_STATE;



@@ 47,6 48,8 @@ static int state = LOGO_STATE_INIT;
#define LOGO_RED (248)
static float red;

static float timer;

int Logo_Run() {
	static float amplitude = 0;
	static float angle = 0;


@@ 111,8 114,8 @@ int Logo_Run() {
		red += 2 * Speed_Multiplier();
		if (red >= LOGO_RED) {
			red = LOGO_RED;
			Fade_Out(120);
			state = LOGO_STATE_FADEOUT;
			timer = 0;
			state = LOGO_STATE_WAIT;
		}

		logoPal[0] = SDL_MapRGB(gPaletteFormat, (int)red, 0, 0);


@@ 120,6 123,15 @@ int Logo_Run() {
		logo->disp(LOGO_X, y, lines);
		break;

	case LOGO_STATE_WAIT:
		timer += Speed_Multiplier();
		if (timer >= 120) {
			Fade_Out(120);
			state = LOGO_STATE_FADEOUT;
		}
		logo->disp(LOGO_X, y, lines);
		break;

	case LOGO_STATE_FADEOUT:
		if (Fade_OutDone()) {
			state = LOGO_STATE_INIT;