]> git.mxchange.org Git - quix0rs-blobwars.git/commitdiff
Add exit screen with pointers to Blobwars 2 and The Battle for the Solar System.
authorGuus Sliepen <guus@debian.org>
Thu, 30 Dec 2010 14:16:28 +0000 (15:16 +0100)
committerGuus Sliepen <guus@debian.org>
Thu, 30 Dec 2010 14:16:28 +0000 (15:16 +0100)
gfx/main/book.png [new file with mode: 0644]
gfx/main/sequel.png [new file with mode: 0644]
src/title.cpp
src/title.h

diff --git a/gfx/main/book.png b/gfx/main/book.png
new file mode 100644 (file)
index 0000000..912c56e
Binary files /dev/null and b/gfx/main/book.png differ
diff --git a/gfx/main/sequel.png b/gfx/main/sequel.png
new file mode 100644 (file)
index 0000000..ce7d14c
Binary files /dev/null and b/gfx/main/sequel.png differ
index c4e0619e740fe0621b9be09b2480cf8d2632980d..e3f0ffecf60026450080f6544837a73b952144b4 100644 (file)
@@ -420,10 +420,7 @@ int title()
        
        if (quit)
        {
-               if (engine.useAudio)
-               {
-                       SDL_Delay(1000);
-               }
+               doQuit();
                exit(0);
        }
        
@@ -565,3 +562,33 @@ void doCredits()
        delete[] y;
        delete[] credit;
 }
+
+/**
+* Shows the exit screen, mentioning the sequel and the book by Stephen Sweeney
+*/
+void doQuit()
+{
+       SDL_FillRect(graphics.screen, NULL, graphics.black);
+       SDL_Surface *sequel = graphics.loadImage("gfx/main/sequel.png");
+       SDL_Surface *book = graphics.loadImage("gfx/main/book.png");
+
+       graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
+       graphics.setFontSize(1);
+       graphics.drawString("If you like Blobwars: Blob and Conquer, you might also like:", 320, 20, true, graphics.screen);
+       graphics.blit(sequel, 160, 200, graphics.screen, true);
+       graphics.blit(book, 480, 200, graphics.screen, true);
+       graphics.setFontSize(0);
+       graphics.drawString("http://blobandconquer.sf.net", 160, 380, true, graphics.screen);
+       graphics.drawString("http://www.battleforthesolarsystem.com", 480, 380, true, graphics.screen);
+       graphics.setFontSize(3);
+       graphics.drawString("Thank you for playing Blobwars!", 320, 430, true, graphics.screen);
+       graphics.setFontSize(0);
+       graphics.drawString("Press Space to Exit.", 320, 460, true, graphics.screen);
+
+       graphics.updateScreen();
+
+       do {
+               SDL_Delay(16);
+               engine.getInput();
+       } while(!engine.userAccepts());
+}
index b8be6fe816e0f3acb5280c3b874f23bf00ab32a1..8a9e0a843f8f3713bf56c356c4ee484b76b44157 100755 (executable)
@@ -29,6 +29,8 @@ extern bool loadGame(int slot);
 
 extern void showOptions();
 
+extern void doQuit();
+
 extern Audio audio;
 extern Config config;
 extern Engine engine;