]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/title.cpp
Do not use DESTDIR in PREFIX, but only in the install target.
[quix0rs-blobwars.git] / src / title.cpp
index b022cdb22394a6321b5b3769f71d18913c0551e6..c27ae4baa217a668b04bba46bc0c355822bc68b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2010 Parallel Realities
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -118,7 +118,7 @@ void setupSaveWidgets()
        for (int i = 0 ; i < 5 ; i++)
        {
                snprintf(widgetName, sizeof widgetName, "save%d", i + 1);
-               strncpy(engine.getWidgetByName(widgetName)->label, engine.saveSlot[i], sizeof engine.getWidgetByName(widgetName)->label);
+               strlcpy(engine.getWidgetByName(widgetName)->label, engine.saveSlot[i], sizeof engine.getWidgetByName(widgetName)->label);
                
                if ((strstr(engine.saveSlot[i], _("Empty"))) || (strstr(engine.saveSlot[i], _("Corrupt"))))
                {
@@ -126,7 +126,7 @@ void setupSaveWidgets()
                }
                
                snprintf(widgetName, sizeof widgetName, "slot%d", i + 1);
-               strncpy(engine.getWidgetByName(widgetName)->label, engine.saveSlot[i], sizeof engine.getWidgetByName(widgetName)->label);
+               strlcpy(engine.getWidgetByName(widgetName)->label, engine.saveSlot[i], sizeof engine.getWidgetByName(widgetName)->label);
        }
 }
 
@@ -145,7 +145,7 @@ void loadTitleWidgets()
        setupSaveWidgets();
        
        Widget *widget = engine.getWidgetByName("labelManual");
-       strncpy(widget->label, GAMEPLAYMANUAL, sizeof widget->label);
+       strlcpy(widget->label, GAMEPLAYMANUAL, sizeof widget->label);
 
        showTitleWidgets();
 }
@@ -189,7 +189,7 @@ int title()
        SDL_Surface *subTitle = graphics.quickSprite("SubTitle", graphics.getString(_("Blob Wars : Episode I"), true));
 
        graphics.setFontSize(0);
-       SDL_Surface *copyright = graphics.quickSprite("Copyright", graphics.getString(_("Copyright (C) 2004, 2005 Parallel Realities"), true));
+       SDL_Surface *copyright = graphics.quickSprite("Copyright", graphics.getString(_("Copyright (C) 2004-2010 Parallel Realities"), true));
 
        char v[50];
        #define STRINGIFY_VALUE(x) STRINGIFY(x)
@@ -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 Blob Wars: Metal Blob Solid, 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 Blob Wars!"), 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());
+}