From: Guus Sliepen Date: Sun, 4 Jul 2010 13:20:10 +0000 (+0200) Subject: Show music credits after some time in title screen, hub and credits. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6cb366bf390f08e47be97c4f5921955137426f32;p=quix0rs-blobwars.git Show music credits after some time in title screen, hub and credits. --- diff --git a/src/hub.cpp b/src/hub.cpp index e3a1be3..4a11741 100644 --- a/src/hub.cpp +++ b/src/hub.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "hub.h" +extern void doMusicInfo(unsigned int); + void createStatsPanel(int page) { SDL_Surface *image = graphics.getSprite("infoPanel", true)->image[0]; @@ -594,6 +596,7 @@ int doHub() int labelWidth = 0; Uint32 frameLimit = SDL_GetTicks() + 16; + Uint32 now = SDL_GetTicks(); int mouseXDelta = 0; int mouseYDelta = 0; @@ -796,6 +799,7 @@ int doHub() graphics.blit(cursor->getCurrentFrame(), engine.getMouseX(), engine.getMouseY(), graphics.screen, true); + doMusicInfo(SDL_GetTicks() - (now + 60000)); engine.delay(frameLimit); frameLimit = SDL_GetTicks() + 16; } diff --git a/src/title.cpp b/src/title.cpp index f219f05..b022cdb 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "title.h" +extern void doMusicInfo(unsigned int); + /** * Displays the skill level widgets and hide the others */ @@ -294,6 +296,8 @@ int title() graphics.blit(version, (630 - version->w), 460, graphics.screen, false); allFadedOn = true; } + + doMusicInfo(SDL_GetTicks() - (now + 39000)); } Math::wrapFloat(&(offX -= 0.25), -graphics.background->w, 0); @@ -516,6 +520,7 @@ void doCredits() audio.playMusic(); engine.resetTimeDifference(); + Uint32 now = SDL_GetTicks(); while (y[numberOfCredits - 1] > 350) { @@ -548,6 +553,8 @@ void doCredits() graphics.drawRect(0, 0, 640, 30, graphics.black, graphics.screen); } + doMusicInfo(SDL_GetTicks() - (now + 10000)); + SDL_Delay(16); }