~rabbits/hiversaires

db83151198fde11caf78a2e368366ebdcddd3efa — Rezmason 3 years ago a296271
Fixed a flicker bug in tween onComplete handling
5 files changed, 17 insertions(+), 23 deletions(-)

M TODO.txt
M src/gui.c
M src/gui.h
M src/play.c
M src/tween.c
M TODO.txt => TODO.txt +3 -12
@@ 1,19 1,10 @@
- talk to Devine:
  1. Do you want to implement the 100 rabbits logo, or shall I?
    Jumping dots or a direct port of the JS dots?
  2. Who goes in the credits?
    No rush on this
  4. Can you coordinate a Merveilles beta test once we have builds?
    I can write out a list of things to test more extensively

- credits
  Just rasterize them
  Make an SVG, use libsvg to render it, put the command in a text file someplace, end of story
bug: audio loading hitch
  - spin up a separate SDL in a thread for audio and mixer
profile
  - any memory leaks? probably not?
- logo screen
- credits
  Just rasterize them
  Make an SVG, use libsvg to render it, put the command in a text file someplace, end of story

deploy, test
  - Compile for multiple platforms

M src/gui.c => src/gui.c +4 -4
@@ 486,12 486,12 @@ GUI_ShowNode(char *nodeName, Orientation orientation, NodeModifier modifier, dou
}

void
GUI_ShowSplash(void (*onComplete)())
GUI_ShowSplash(float delay, void (*onComplete)())
{
	Stage_SetAlpha(BILLBOARD_MENU_BLACK, 1);
	Stage_Fade(BILLBOARD_SPLASH_TOP, 0, 1, 2, 0, NULL);
	Stage_Fade(BILLBOARD_SPLASH_LEFT, 0, 1, 1.5, 1, NULL);
	Stage_Fade(BILLBOARD_SPLASH_RIGHT, 0, 1, 1.5, 1.75, onComplete);
	Stage_Fade(BILLBOARD_SPLASH_TOP, 0, 1, 2, 0 + delay, NULL);
	Stage_Fade(BILLBOARD_SPLASH_LEFT, 0, 1, 1.5, 1 + delay, NULL);
	Stage_Fade(BILLBOARD_SPLASH_RIGHT, 0, 1, 1.5, 1.75 + delay, onComplete);
}

void

M src/gui.h => src/gui.h +1 -1
@@ 106,7 106,7 @@ void GUI_ShowHomeMenu();
void GUI_ShowMovement(int nudgeX, int nudgeY);
void GUI_ShowNode(char *nodeName, Orientation orientation, NodeModifier modifier, double fadeDuration, double fadeDelay);
void GUI_ShowCreditsMenu(int showSecret);
void GUI_ShowSplash(void (*onComplete)());
void GUI_ShowSplash(float delay, void (*onComplete)());
void GUI_HideSplash(float delay, void (*onComplete)());
void GUI_FlashVignette();
void GUI_ShowSave();

M src/play.c => src/play.c +1 -1
@@ 209,7 209,7 @@ Play_Init(GameState *state)
	currentNode = Nodes_Get(_state->nodeName);
	refreshNode(0, 0);

	GUI_ShowSplash(hideSplash);
	GUI_ShowSplash(0.5, hideSplash);

	printf(
		"		\n\n"

M src/tween.c => src/tween.c +8 -5
@@ 19,6 19,7 @@ void
Tween_Update(Tween *tween, double now)
{
	double t;
	int complete = 0;
	if(tween->duration <= 0) {
		return;
	}


@@ 27,14 28,16 @@ Tween_Update(Tween *tween, double now)
		t = 0;
	} else if(t >= 1) {
		t = 1;
		complete = 1;
		tween->duration = -1;
		if(tween->onComplete != NULL) {
			void (*onComplete)() = tween->onComplete;
			tween->onComplete = NULL;
			onComplete();
		}
	}
	tween->value = t * tween->endValue + (1. - t) * tween->startValue;

	if(complete && tween->onComplete != NULL) {
		void (*onComplete)() = tween->onComplete;
		tween->onComplete = NULL;
		onComplete();
	}
}

void