From owner-svn-ports-head@FreeBSD.ORG Tue Dec 10 01:19:56 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83C3DDFA; Tue, 10 Dec 2013 01:19:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6EE24127F; Tue, 10 Dec 2013 01:19:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA1Jurb081701; Tue, 10 Dec 2013 01:19:56 GMT (envelope-from amdmi3@svn.freebsd.org) Received: (from amdmi3@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA1JusX081699; Tue, 10 Dec 2013 01:19:56 GMT (envelope-from amdmi3@svn.freebsd.org) Message-Id: <201312100119.rBA1JusX081699@svn.freebsd.org> From: Dmitry Marakasov Date: Tue, 10 Dec 2013 01:19:56 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r336036 - in head/games/flare-engine: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 01:19:56 -0000 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 +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 Date: Sat Dec 7 04:52:17 2013 -0500