svn commit: r336036 - in head/games/flare-engine: . files
Dmitry Marakasov
amdmi3 at FreeBSD.org
Tue Dec 10 01:19:56 UTC 2013
Author: amdmi3
Date: Tue Dec 10 01:19:55 2013
New Revision: 336036
URL: http://svnweb.freebsd.org/changeset/ports/336036
Log:
- Extend upstream patch to display more info when engine is run without game specified
Modified:
head/games/flare-engine/Makefile
head/games/flare-engine/files/patch-no-game-specified
Modified: head/games/flare-engine/Makefile
==============================================================================
--- head/games/flare-engine/Makefile Tue Dec 10 01:19:30 2013 (r336035)
+++ head/games/flare-engine/Makefile Tue Dec 10 01:19:55 2013 (r336036)
@@ -3,6 +3,7 @@
PORTNAME= flare
PORTVERSION= 0.19
+PORTREVISION= 1
CATEGORIES= games
MASTER_SITES= SF/${PORTNAME}-game/Linux/
DISTNAME= ${PORTNAME}-engine.${PORTVERSION}
Modified: head/games/flare-engine/files/patch-no-game-specified
==============================================================================
--- head/games/flare-engine/files/patch-no-game-specified Tue Dec 10 01:19:30 2013 (r336035)
+++ head/games/flare-engine/files/patch-no-game-specified Tue Dec 10 01:19:55 2013 (r336036)
@@ -1,3 +1,97 @@
+commit 2a85555c8f0851de1bccc3f633a8072e1ea15551
+Author: Justin Jacobs <jajdorkster at gmail.com>
+Date: Mon Dec 9 20:06:56 2013 -0500
+
+ Display the default game warning on the title screen
+
+ Closes #896
+
+diff --git src/GameStateTitle.cpp src/GameStateTitle.cpp
+index 2cdd797..3ca06e8 100644
+--- src/GameStateTitle.cpp
++++ src/GameStateTitle.cpp
+@@ -24,6 +24,8 @@ FLARE. If not, see http://www.gnu.org/licenses/
+ #include "SharedResources.h"
+ #include "WidgetButton.h"
+ #include "WidgetLabel.h"
++#include "WidgetScrollBox.h"
++#include "UtilsMath.h"
+
+ GameStateTitle::GameStateTitle() : GameState() {
+
+@@ -71,6 +73,21 @@ GameStateTitle::GameStateTitle() : GameState() {
+ tablist.add(button_cfg);
+ tablist.add(button_credits);
+ tablist.add(button_exit);
++
++ // Warning text box
++ warning_box = NULL;
++ if (GAME_FOLDER == "default") {
++ std::string warning_text = msg->get("Warning: A game wasn't specified, falling back to the 'default' game. Did you forget the --game flag? (e.g. --game=flare-game). See --help for more details.");
++ Point warning_size = font->calc_size(warning_text, VIEW_W/2);
++
++ int warning_box_h = warning_size.y;
++ clampCeil(warning_box_h, VIEW_H/2);
++ warning_box = new WidgetScrollBox(VIEW_W/2, warning_box_h);
++ warning_box->resize(warning_size.y);
++
++ font->setFont("font_normal");
++ font->renderShadowed(warning_text, 0, 0, JUSTIFY_LEFT, warning_box->contents, VIEW_W/2, FONT_WHITE);
++ }
+ }
+
+ void GameStateTitle::logic() {
+@@ -83,6 +100,10 @@ void GameStateTitle::logic() {
+ exitRequested = true;
+ }
+
++ if (warning_box) {
++ warning_box->logic();
++ }
++
+ tablist.logic();
+
+ if (button_play->checkClick()) {
+@@ -134,6 +155,11 @@ void GameStateTitle::render() {
+
+ // version number
+ label_version->render();
++
++ // warning text
++ if (warning_box) {
++ warning_box->render();
++ }
+ }
+
+ GameStateTitle::~GameStateTitle() {
+@@ -142,5 +168,6 @@ GameStateTitle::~GameStateTitle() {
+ delete button_credits;
+ delete button_exit;
+ delete label_version;
++ delete warning_box;
+ SDL_FreeSurface(logo);
+ }
+diff --git src/GameStateTitle.h src/GameStateTitle.h
+index 7494dc5..ed2a093 100644
+--- src/GameStateTitle.h
++++ src/GameStateTitle.h
+@@ -24,6 +24,7 @@ FLARE. If not, see http://www.gnu.org/licenses/
+
+ class WidgetButton;
+ class WidgetLabel;
++class WidgetScrollBox;
+
+ class GameStateTitle : public GameState {
+ private:
+@@ -33,6 +34,7 @@ private:
+ WidgetButton *button_cfg;
+ WidgetButton *button_credits;
+ WidgetLabel *label_version;
++ WidgetScrollBox *warning_box;
+
+ TabList tablist;
+
+
commit 2f99397b27a407d8f5a34a023a6e54b378d0e32d
Author: Justin Jacobs <jajdorkster at gmail.com>
Date: Sat Dec 7 04:52:17 2013 -0500
More information about the svn-ports-all
mailing list