You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(257) |
Jul
(428) |
Aug
(158) |
Sep
(43) |
Oct
(103) |
Nov
(107) |
Dec
(103) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(179) |
Feb
(297) |
Mar
(316) |
Apr
(495) |
May
(229) |
Jun
(218) |
Jul
(396) |
Aug
(195) |
Sep
(110) |
Oct
(158) |
Nov
(320) |
Dec
(117) |
2004 |
Jan
(235) |
Feb
(227) |
Mar
(76) |
Apr
(193) |
May
(462) |
Jun
(18) |
Jul
|
Aug
(3) |
Sep
(15) |
Oct
(20) |
Nov
(24) |
Dec
(36) |
2005 |
Jan
|
Feb
(3) |
Mar
(6) |
Apr
(54) |
May
(7) |
Jun
(10) |
Jul
(50) |
Aug
(41) |
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(76) |
Jun
(116) |
Jul
(10) |
Aug
(43) |
Sep
(18) |
Oct
(27) |
Nov
(60) |
Dec
(118) |
2007 |
Jan
(140) |
Feb
(185) |
Mar
(47) |
Apr
(47) |
May
(1) |
Jun
(61) |
Jul
(292) |
Aug
(168) |
Sep
(97) |
Oct
|
Nov
(32) |
Dec
(109) |
2008 |
Jan
(57) |
Feb
(74) |
Mar
(100) |
Apr
(219) |
May
(169) |
Jun
(95) |
Jul
(127) |
Aug
(80) |
Sep
(87) |
Oct
(69) |
Nov
(125) |
Dec
(73) |
2009 |
Jan
(220) |
Feb
(183) |
Mar
(57) |
Apr
(4) |
May
(1) |
Jun
(67) |
Jul
(2) |
Aug
(18) |
Sep
(47) |
Oct
(74) |
Nov
(28) |
Dec
(140) |
2010 |
Jan
(108) |
Feb
(133) |
Mar
(70) |
Apr
(150) |
May
(162) |
Jun
(150) |
Jul
(101) |
Aug
(42) |
Sep
(67) |
Oct
(135) |
Nov
(116) |
Dec
(176) |
2011 |
Jan
(176) |
Feb
(247) |
Mar
(245) |
Apr
(196) |
May
(138) |
Jun
(110) |
Jul
(114) |
Aug
(129) |
Sep
(19) |
Oct
(46) |
Nov
(127) |
Dec
(132) |
2012 |
Jan
(23) |
Feb
(19) |
Mar
(53) |
Apr
(37) |
May
(27) |
Jun
(2) |
Jul
(1) |
Aug
(20) |
Sep
(7) |
Oct
(21) |
Nov
(14) |
Dec
(34) |
2013 |
Jan
(23) |
Feb
(71) |
Mar
(40) |
Apr
(31) |
May
(26) |
Jun
(36) |
Jul
(13) |
Aug
(44) |
Sep
(72) |
Oct
(40) |
Nov
(44) |
Dec
(8) |
2014 |
Jan
(56) |
Feb
(67) |
Mar
(13) |
Apr
(36) |
May
(16) |
Jun
(26) |
Jul
(23) |
Aug
(14) |
Sep
(22) |
Oct
(2) |
Nov
(17) |
Dec
(13) |
2015 |
Jan
(16) |
Feb
(21) |
Mar
(34) |
Apr
(19) |
May
(11) |
Jun
(5) |
Jul
(15) |
Aug
(13) |
Sep
(4) |
Oct
(7) |
Nov
(5) |
Dec
(4) |
2016 |
Jan
|
Feb
|
Mar
(4) |
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: fluzz <fl...@us...> - 2015-07-28 11:46:46
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via e803cf96b5491ac150c10d2175aac53630278100 (commit) via 814719071da70729acdf49571cab4ddc7bcc129d (commit) from 34df90c971ac0a4f593cdc4566c7dba470bfd3ee (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=814719071da70729acdf49571cab4ddc7bcc129d commit 814719071da70729acdf49571cab4ddc7bcc129d Author: fluzz <fl...@gm...> Date: Mon Jul 27 23:13:10 2015 +0200 Add README.md, used as a frontpage of the gitlab project. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8222229 --- /dev/null +++ b/README.md @@ -0,0 +1,63 @@ +<!-- + * Copyright (c) 2015 Samuel Degrande + * + * This file is part of Freedroid + * + * Freedroid is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Freedroid is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Freedroid; see the file COPYING. If not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + + This file provides a nice frontpage to gitlab's project. + Not meant to be in the tar.gz distribution. +--> + +<img alt="In Town's bar" src="https://gitlab.com/freedroid/freedroid-graphics/raw/master/website/assets/screenshots/town_bar_s.png" width=256 /> +<img alt="In the wild" src="https://gitlab.com/freedroid/freedroid-graphics/raw/master/website/assets/screenshots/in_the_wild_s.png" width=256 /> +<img alt="Fighting" src="https://gitlab.com/freedroid/freedroid-graphics/raw/master/website/assets/screenshots/fighting_s.png" width=256 /> +<img alt="Dialog screen" src="https://gitlab.com/freedroid/freedroid-graphics/raw/master/website/assets/screenshots/dialog_s.png" width=256 /> +<img alt="Inventory screen" src="https://gitlab.com/freedroid/freedroid-graphics/raw/master/website/assets/screenshots/inventory_screen_s.png" width=256 /> + +Description +----------- + +FreedroidRPG is an original isometric 3D role playing game taking place in the future, on Earth. It features action and dialogs. + +#### Visit the [Freedroid Web Site][WWW] + +Features +-------- + +* Fully playable, 12h of fun +* Real time action +* Role playing through rich dialogs +* Works on most computers +* Original music + +Notes +----- +We do not accept merge requests, but we welcome you to submit all your contributions (code patches, dialogs, graphics, sounds, musics) to our [Review Board][RB] + +--- + +| Categories | License | Platforms | +| :---------------------------------------- | :--------------------------------------------- | :-------: | +| Side-Scrolling/Arcade Games, Role-Playing | GNU General Public License version 2.0 (GPLv2) | ![bsd][BSD] ![linux][LIN] ![mac os][MAC] ![windows][WIN] | + +[WWW]: http://www.freedroid.org +[RB]: http://rb.freedroid.org +[BSD]: https://gitlab.com/freedroid/freedroid-graphics/raw/master/website/assets/platforms/bsd.png +[LIN]: https://gitlab.com/freedroid/freedroid-graphics/raw/master/website/assets/platforms/linux.png +[MAC]: https://gitlab.com/freedroid/freedroid-graphics/raw/master/website/assets/platforms/mac.png +[WIN]: https://gitlab.com/freedroid/freedroid-graphics/raw/master/website/assets/platforms/windows.png + http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=e803cf96b5491ac150c10d2175aac53630278100 commit e803cf96b5491ac150c10d2175aac53630278100 Author: fluzz <fl...@gm...> Date: Tue Jul 28 13:42:21 2015 +0200 Use 'new' application icon as window's icon. When the final version of the icon will be pushed, same changes will be needed. diff --git a/graphics/paraicon.bmp b/graphics/paraicon.bmp index 4f39e84..efc81ce 100644 Binary files a/graphics/paraicon.bmp and b/graphics/paraicon.bmp differ diff --git a/graphics/paraicon_32x32.bmp b/graphics/paraicon_32x32.bmp new file mode 100644 index 0000000..08179b8 Binary files /dev/null and b/graphics/paraicon_32x32.bmp differ diff --git a/src/defs.h b/src/defs.h index b8f58a3..b149021 100644 --- a/src/defs.h +++ b/src/defs.h @@ -232,7 +232,11 @@ enum { #define FD_DATADIR ".." // our local fallback #endif -#define ICON_FILE "paraicon.bmp" +#if __WIN32__ +#define ICON_FILE "paraicon_32x32.bmp" +#else +#define ICON_FILE "paraicon.bmp" +#endif //-------------------- #define SKILL_LEVEL_BUTTON_HEIGHT 32 diff --git a/win32/Makefile.am b/win32/Makefile.am index a7e54ca..1f27b68 100644 --- a/win32/Makefile.am +++ b/win32/Makefile.am @@ -1,8 +1,8 @@ ## Process this file with automake to produce Makefile.in -EXTRA_DIST = freedroidRPG.rc w32icon_64x64.png +EXTRA_DIST = freedroidRPG.rc paraicon_64x64.ico WINDRES = $(target)-windres -freedroidRPG.coff: freedroidRPG.rc w32icon_64x64.ico +freedroidRPG.coff: freedroidRPG.rc paraicon_64x64.ico $(WINDRES) -i freedroidRPG.rc -o freedroidRPG.coff -O COFF diff --git a/win32/freedroidRPG.coff b/win32/freedroidRPG.coff index 90b5f16..e622c05 100644 Binary files a/win32/freedroidRPG.coff and b/win32/freedroidRPG.coff differ diff --git a/win32/freedroidRPG.rc b/win32/freedroidRPG.rc index bf7f798..9cac66d 100644 --- a/win32/freedroidRPG.rc +++ b/win32/freedroidRPG.rc @@ -1,2 +1,2 @@ -IDI_ICON1 ICON DISCARDABLE "w32icon_64x64.ico" +IDI_ICON1 ICON DISCARDABLE "paraicon_64x64.ico" diff --git a/win32/paraicon_64x64.ico b/win32/paraicon_64x64.ico new file mode 100644 index 0000000..08abf60 Binary files /dev/null and b/win32/paraicon_64x64.ico differ diff --git a/win32/w32icon_64x64.ico b/win32/w32icon_64x64.ico deleted file mode 100644 index 965e16c..0000000 Binary files a/win32/w32icon_64x64.ico and /dev/null differ ----------------------------------------------------------------------- Summary of changes: README.md | 63 +++++++++++++++++++++++++++++++++++++++++++ graphics/paraicon.bmp | Bin 3194 -> 65674 bytes graphics/paraicon_32x32.bmp | Bin 0 -> 4234 bytes src/defs.h | 6 +++- win32/Makefile.am | 4 +- win32/freedroidRPG.coff | Bin 5974 -> 17246 bytes win32/freedroidRPG.rc | 2 +- win32/paraicon_64x64.ico | Bin 0 -> 16958 bytes win32/w32icon_64x64.ico | Bin 16958 -> 0 bytes 9 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 README.md create mode 100644 graphics/paraicon_32x32.bmp create mode 100644 win32/paraicon_64x64.ico delete mode 100644 win32/w32icon_64x64.ico hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-27 14:24:06
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 34df90c971ac0a4f593cdc4566c7dba470bfd3ee (commit) from d63fec86fd1418cd3842e107fdc8ef0057dbad6f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=34df90c971ac0a4f593cdc4566c7dba470bfd3ee commit 34df90c971ac0a4f593cdc4566c7dba470bfd3ee Author: fluzz <fl...@gm...> Date: Mon Jul 27 16:17:39 2015 +0200 Move definition of the recently introduced terminal_secure at the end of the spec files. Ordering of definitions in droid_archetype.dat and enemy_surfaces.dat *must* not be changed (we still use ordinal indexes to find the definition of a droid, and those indexes are stored in the savegames). So, placing the terminal_secure in the middle of the lists makes those lists be incompatible with old savegames. diff --git a/map/droid_archetypes.dat b/map/droid_archetypes.dat index 2296cfb..83fb6ea 100644 --- a/map/droid_archetypes.dat +++ b/map/droid_archetypes.dat @@ -1071,28 +1071,6 @@ Filename prefix for graphics="terminal" Notes concerning this droid=_"This is a terminal." ** Start of new Robot: ** -Droidname: STM -Default description:_"ERROR: THIS IS A TERMINAL" -Droid uses portrait rotation series with prefix="NONE_AVAILABLE_YET" -Maximum speed of this droid: 0 -Class of this droid: 100 -Drops item class=0 -Maximum energy of this droid: 1 -Rate of healing: 1 -Experience_Reward gained for destroying one of this type: 0 -Aggression distance of this droid=0 -Time spent eyeing Tux=0 -Weapon item="NPC Hand to hand weapon" -Greeting Sound number=-1 -Death sound file name="none" -Attack animation sound file name="none" -Chance of this robot scoring a hit=0 -Time to recover after getting hit=0 -Is this 'droid' a human : 0 -Filename prefix for graphics="terminal_secure" -Notes concerning this droid=_"This is a secure terminal." - -** Start of new Robot: ** Droidname: GUN Default description:_"Autogun" Droid uses portrait rotation series with prefix="autogun" @@ -1146,6 +1124,28 @@ Is this 'droid' a human : 1 Filename prefix for graphics="arthur" Notes concerning this droid=_"It has long since been known that game development is the most important job in the world. Also the coolest. We know that thanks to this guy." +** Start of new Robot: ** +Droidname: STM +Default description:_"ERROR: THIS IS A TERMINAL" +Droid uses portrait rotation series with prefix="NONE_AVAILABLE_YET" +Maximum speed of this droid: 0 +Class of this droid: 100 +Drops item class=0 +Maximum energy of this droid: 1 +Rate of healing: 1 +Experience_Reward gained for destroying one of this type: 0 +Aggression distance of this droid=0 +Time spent eyeing Tux=0 +Weapon item="NPC Hand to hand weapon" +Greeting Sound number=-1 +Death sound file name="none" +Attack animation sound file name="none" +Chance of this robot scoring a hit=0 +Time to recover after getting hit=0 +Is this 'droid' a human : 0 +Filename prefix for graphics="terminal_secure" +Notes concerning this droid=_"This is a secure terminal." + ---------------------------------------------------------------------- ---------------------------------------------------------------------- *** End of Robot Data Section: *** diff --git a/map/enemy_surfaces.dat b/map/enemy_surfaces.dat index 26911e1..72efd45 100644 --- a/map/enemy_surfaces.dat +++ b/map/enemy_surfaces.dat @@ -350,15 +350,6 @@ droid_stand_animation_speed_factor=6 ** End of new surface specification subsection ** ** Start of new surface specification subsection ** -PrefixToFilename="terminal_secure" -droid_walk_animation_speed_factor=10 -droid_attack_animation_speed_factor=10 -droid_gethit_animation_speed_factor=10 -droid_death_animation_speed_factor=4 -droid_stand_animation_speed_factor=6 -** End of new surface specification subsection ** - -** Start of new surface specification subsection ** PrefixToFilename="lawnmower" droid_walk_animation_speed_factor=14 droid_attack_animation_speed_factor=14 @@ -385,6 +376,14 @@ droid_death_animation_speed_factor=17 droid_stand_animation_speed_factor=15 ** End of new surface specification subsection ** +** Start of new surface specification subsection ** +PrefixToFilename="terminal_secure" +droid_walk_animation_speed_factor=10 +droid_attack_animation_speed_factor=10 +droid_gethit_animation_speed_factor=10 +droid_death_animation_speed_factor=4 +droid_stand_animation_speed_factor=6 +** End of new surface specification subsection ** *** End of Enemy Surfaces Section: *** ----------------------------------------------------------------------- Summary of changes: map/droid_archetypes.dat | 44 ++++++++++++++++++++++---------------------- map/enemy_surfaces.dat | 17 ++++++++--------- 2 files changed, 30 insertions(+), 31 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-27 12:22:46
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via d63fec86fd1418cd3842e107fdc8ef0057dbad6f (commit) via c1b0fab24baeb19b674683a589165593d3e9d4b5 (commit) via 568e0662cb15468ff9a8dd6f7234e3fbee403bab (commit) via 7f3c4e28dda62f4567d6ad47ca0936b4376bea67 (commit) via 8f58522502753d8a2e436ce3305f5a8427ee59fd (commit) via 1fd9a7c8c93c705201e6e8345d84ed7e84d9a9de (commit) via a431e3491f123728e8b4f3d8875905e6be1d8a98 (commit) via 7fa3935a5869778560790472b13c5cc5a67a86ae (commit) via d60af322a92532afc0d4a3caf9648e1c2c9d8f2a (commit) via 256189673386f5763254489f4ffff430a8095698 (commit) via b91f5c1e8561699475b9eec8be1b078299f51078 (commit) via d3948f8c04926232d02a40d5bad23585e6d31996 (commit) via a7913895844ec72b394cdb1944ed7d7cce4db55a (commit) via 6a84f6f7228319af5a35df1a568d70ef9d35bfc9 (commit) from 01d4e831504825425920c502b5a6f3af9a547d05 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=6a84f6f7228319af5a35df1a568d70ef9d35bfc9 commit 6a84f6f7228319af5a35df1a568d70ef9d35bfc9 Author: basse <bas...@gm...> Date: Wed Jul 22 21:19:04 2015 +0200 new portrait diff --git a/graphics/droids/female_hunter/portrait.png b/graphics/droids/female_hunter/portrait.png index 3e813de..02f5c25 100644 Binary files a/graphics/droids/female_hunter/portrait.png and b/graphics/droids/female_hunter/portrait.png differ http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=a7913895844ec72b394cdb1944ed7d7cce4db55a commit a7913895844ec72b394cdb1944ed7d7cce4db55a Author: fluzz <fl...@gm...> Date: Sat Jul 18 23:30:33 2015 +0200 More Freedesktop compliance: add desktop file and icon. diff --git a/Makefile.am b/Makefile.am index 733330b..43234a7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,7 +28,7 @@ man_MANS = freedroidRPG.6 freedroid_data = map graphics sound dialogs lua_modules -EXTRA_DIST = m4 $(man_MANS) $(freedroid_data) HELP_WANTED INSTALL.generic +EXTRA_DIST = m4 $(man_MANS) $(freedroid_data) HELP_WANTED INSTALL.freedroidRPG CHECKFLAGS=env SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy @@ -62,12 +62,18 @@ sign: gpg --digest-algo SHA512 -o freedroidrpg-$(VERSION).tar.bz2.sig --detach-sign freedroidrpg-$(VERSION).tar.bz2 md5sum freedroidrpg-$(VERSION).tar.bz2 > freedroidrpg-$(VERSION).tar.bz2.md5 -# For Freedesktop compliant Software Centers +# For Freedesktop compliance -appstreamdir = $(datarootdir)/appdata -appstream_in_files = pkgs/freedesktop/freedroidrpg.appdata.xml -appstream_DATA = $(appstream_in_files) -EXTRA_DIST += $(appstream_in_files) +appstreamdir = $(datadir)/appdata +appstream_in_files = pkgs/freedesktop/freedroidRPG.appdata.xml +dist_appstream_DATA = $(appstream_in_files) + +desktopdir = $(datadir)/applications +desktop_in_files = pkgs/freedesktop/freedroidRPG.desktop +dist_desktop_DATA = $(desktop_in_files) + +icondir = $(datadir)/icons/hicolor/48x48/apps +dist_icon_DATA = pkgs/freedesktop/freedroidRPG.png ## Win32 specific stuff follows here diff --git a/pkgs/freedesktop/freedroidrpg.appdata.xml b/pkgs/freedesktop/freedroidRPG.appdata.xml similarity index 96% rename from pkgs/freedesktop/freedroidrpg.appdata.xml rename to pkgs/freedesktop/freedroidRPG.appdata.xml index 98206f9..451f9fb 100644 --- a/pkgs/freedesktop/freedroidrpg.appdata.xml +++ b/pkgs/freedesktop/freedroidRPG.appdata.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <application> - <id type="desktop">freedroidrpg.desktop</id> + <id type="desktop">freedroidRPG.desktop</id> <metadata_license>CC0-1.0</metadata_license> <project_license>GPL-2.0+</project_license> - <name>FreedroidRPG</name> + <name>freedroidRPG</name> <summary>Isometric 3D RPG similar to game Diablo</summary> <description> <p> diff --git a/pkgs/freedesktop/freedroidRPG.desktop b/pkgs/freedesktop/freedroidRPG.desktop new file mode 100644 index 0000000..02ee7a2 --- /dev/null +++ b/pkgs/freedesktop/freedroidRPG.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=Freedroid RPG +GenericName=Freedroid RPG +Comment=A futuristic immersive RPG about fighting bots +TryExec=freedroidRPG +Exec=freedroidRPG +Icon=freedroidRPG.png +Actions=Game;RolePlaying; +URL=http://www.freedroid.org diff --git a/pkgs/freedesktop/freedroidRPG.png b/pkgs/freedesktop/freedroidRPG.png new file mode 100644 index 0000000..6362f5c Binary files /dev/null and b/pkgs/freedesktop/freedroidRPG.png differ http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=d3948f8c04926232d02a40d5bad23585e6d31996 commit d3948f8c04926232d02a40d5bad23585e6d31996 Author: fluzz <fl...@gm...> Date: Sun Jul 19 15:34:52 2015 +0200 [l10n] Set the gawk's path needed by some l10n scripts. diff --git a/po/po-data/Makevars b/po/po-data/Makevars index 54d03c2..103136c 100644 --- a/po/po-data/Makevars +++ b/po/po-data/Makevars @@ -7,6 +7,9 @@ DOMAIN = freedroidrpg-data subdir = po/po-data top_builddir = ../.. +# Some scripts need to know gawk's path +export AWK=${shell which gawk} + # These options get passed to xgettext. SYS_XGETTEXT:=${XGETTEXT} XGETTEXT=${top_srcdir}/po/xgettext-wrapper ${SYS_XGETTEXT} diff --git a/po/po-dialogs/Makevars b/po/po-dialogs/Makevars index 227fdd1..92e1441 100644 --- a/po/po-dialogs/Makevars +++ b/po/po-dialogs/Makevars @@ -7,6 +7,9 @@ DOMAIN = freedroidrpg-dialogs subdir = po/po-dialogs top_builddir = ../.. +# Some scripts need to know gawk's path +export AWK=${shell which gawk} + # These options get passed to xgettext. SYS_XGETTEXT:=${XGETTEXT} XGETTEXT=${top_srcdir}/po/xgettext-wrapper ${SYS_XGETTEXT} diff --git a/po/po-src/Makevars b/po/po-src/Makevars index 1d9949d..d995937 100644 --- a/po/po-src/Makevars +++ b/po/po-src/Makevars @@ -7,6 +7,9 @@ DOMAIN = freedroidrpg subdir = po/po-src top_builddir = ../.. +# Some scripts need to know gawk's path +export AWK=${shell which gawk} + # These options get passed to xgettext. SYS_XGETTEXT:=${XGETTEXT} XGETTEXT=${top_srcdir}/po/xgettext-wrapper ${SYS_XGETTEXT} diff --git a/po/update-potfiles b/po/update-potfiles index 0e36b35..54c3b20 100755 --- a/po/update-potfiles +++ b/po/update-potfiles @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2014 Samuel Degrande +# Copyright (c) 2014,2015 Samuel Degrande # # This file is part of Freedroid # @@ -53,7 +53,7 @@ top=$(git rev-parse --show-toplevel) # The awk script alphabetically sorts the files list, with files first and then directories # ("width first traversal"). -allfiles=$(cd "$top" && git ls-files --no-empty-directory --exclude-standard ${include[@]} | $(AWK)' +allfiles=$(cd "$top" && git ls-files --no-empty-directory --exclude-standard ${include[@]} | ${AWK} ' BEGIN { IGNORECASE = 1; lines = 0; } { match("/" $0, "(/.*/)[^/]+$", result); diff --git a/po/xgettext-wrapper b/po/xgettext-wrapper index 4260311..7e43d96 100755 --- a/po/xgettext-wrapper +++ b/po/xgettext-wrapper @@ -34,7 +34,7 @@ extract_strings() inf=$1 outf=$2 comment=$3 - $(AWK) ' + ${AWK} ' /TRANSLATORS:/ { sub("--;", "//") print $0 http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=b91f5c1e8561699475b9eec8be1b078299f51078 commit b91f5c1e8561699475b9eec8be1b078299f51078 Author: fluzz <fl...@gm...> Date: Sun Jul 19 23:05:17 2015 +0200 Remove pngfuncs.[c,h] from the distribution of the tools subdirs. pngfuncs.[c,h] are dependencies of the dev tools, located in src/. VPATH is used by the tools' Makefiles to find them. 'make dist', when executed inside the tools subdirs, must not try to distribute them. diff --git a/tools/atlas/Makefile.am b/tools/atlas/Makefile.am index 1ff7c10..e39d37f 100644 --- a/tools/atlas/Makefile.am +++ b/tools/atlas/Makefile.am @@ -14,6 +14,8 @@ bin_PROGRAMS = make_atlas explode_atlas PNGDEPS = pngfuncs.c pngfuncs.h -make_atlas_SOURCES = make_atlas.c $(PNGDEPS) +make_atlas_SOURCES = make_atlas.c +nodist_make_atlas_SOURCES = $(PNGDEPS) -explode_atlas_SOURCES = explode_atlas.c $(PNGDEPS) +explode_atlas_SOURCES = explode_atlas.c +nodist_explode_atlas_SOURCES = $(PNGDEPS) \ No newline at end of file diff --git a/tools/font/Makefile.am b/tools/font/Makefile.am index 961162e..51e46ab 100644 --- a/tools/font/Makefile.am +++ b/tools/font/Makefile.am @@ -21,8 +21,11 @@ make_bmchars_LDADD = -lSDL_ttf CSDEPS = codeset.c codeset.h PNGDEPS = pngfuncs.c pngfuncs.h -explodefont_SOURCES = explodefont.c $(CSDEPS) $(PNGDEPS) +explodefont_SOURCES = explodefont.c $(CSDEPS) +nodist_explodefont_SOURCES = $(PNGDEPS) -gluefont_SOURCES = gluefont.c $(CSDEPS) $(PNGDEPS) +gluefont_SOURCES = gluefont.c $(CSDEPS) +nodist_gluefont_SOURCES = $(PNGDEPS) -make_bmchars_SOURCES = make_bmchars.c $(CSDEPS) $(PNGDEPS) +make_bmchars_SOURCES = make_bmchars.c $(CSDEPS) +nodist_make_bmchars_SOURCES = $(PNGDEPS) \ No newline at end of file diff --git a/tools/image/Makefile.am b/tools/image/Makefile.am index eda9db0..2c30b5e 100644 --- a/tools/image/Makefile.am +++ b/tools/image/Makefile.am @@ -12,6 +12,7 @@ vpath %.h $(top_srcdir)/src bin_PROGRAMS = croppy -croppy_SOURCES = pngfuncs.c pngfuncs.h croppy.c +croppy_SOURCES = croppy.c +nodist_croppy_SOURCES = pngfuncs.c pngfuncs.h EXTRA_DIST = croppy_background_fill.png http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=256189673386f5763254489f4ffff430a8095698 commit 256189673386f5763254489f4ffff430a8095698 Author: fluzz <fl...@gm...> Date: Mon Jul 20 10:22:00 2015 +0200 Add embedded Lua source files to the distribution. diff --git a/Makefile.am b/Makefile.am index 43234a7..ebd5f68 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,7 +28,7 @@ man_MANS = freedroidRPG.6 freedroid_data = map graphics sound dialogs lua_modules -EXTRA_DIST = m4 $(man_MANS) $(freedroid_data) HELP_WANTED INSTALL.freedroidRPG +EXTRA_DIST = m4 lua $(man_MANS) $(freedroid_data) HELP_WANTED INSTALL.freedroidRPG CHECKFLAGS=env SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy diff --git a/lua/Makefile.am b/lua/Makefile.am index 41193e8..a9e438a 100644 --- a/lua/Makefile.am +++ b/lua/Makefile.am @@ -2,6 +2,9 @@ LUA_MAKEFILE = $(top_srcdir)/lua/lua.mk +dist_sources = ${shell find . -name "*.c" -or -name "*.h"} +EXTRA_DIST = $(dist_sources) lua.mk COPYRIGHT + # Export the VPATH variable to the Makefile provided by Lua. export VPATH http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=d60af322a92532afc0d4a3caf9648e1c2c9d8f2a commit d60af322a92532afc0d4a3caf9648e1c2c9d8f2a Author: fluzz <fl...@gm...> Date: Mon Jul 20 10:24:14 2015 +0200 Add one missing file and remove one unexisting file from the distribution diff --git a/src/Makefile.am b/src/Makefile.am index 96cda38..fad14b9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -71,7 +71,7 @@ freedroidRPG_SOURCES = version.c \ lvledit/lvledit_widgets.c lvledit/lvledit_widgets.h \ mapgen/mapgen.c mapgen/mapgen.h mapgen/gram_simple.c animate.c \ mapgen/themes.c mapgen/themes.h \ - lua/luaFD.c lua/luaFD_bindings.h lua/luaFD_tux.c lua/luaFD_npc.c + lua/luaFD.c lua/luaFD.h lua/luaFD_bindings.h lua/luaFD_tux.c lua/luaFD_npc.c nodist_freedroidRPG_SOURCES = savestruct.c savestruct.h build_flags.h BUILT_SOURCES = savestruct.h build_flags.h diff --git a/win32/Makefile.am b/win32/Makefile.am index e7d5f57..24ff246 100644 --- a/win32/Makefile.am +++ b/win32/Makefile.am @@ -7,7 +7,7 @@ endif %.ico : %.png pngtoico $< > $@ -EXTRA_DIST = freedroidRPG.rc w32icon_64x64.png w32icon2_64x64.png +EXTRA_DIST = freedroidRPG.rc w32icon_64x64.png WINDRES = $(target)-windres freedroidRPG.coff: freedroidRPG.rc w32icon_64x64.ico http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=7fa3935a5869778560790472b13c5cc5a67a86ae commit 7fa3935a5869778560790472b13c5cc5a67a86ae Author: fluzz <fl...@gm...> Date: Mon Jul 20 10:25:03 2015 +0200 Remove the default generation of a tar.bzip2 distribution diff --git a/configure.ac b/configure.ac index 85b9c1d..b563a0b 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,7 @@ AC_CANONICAL_TARGET dnl Set automake options (require AC_CANONICAL_TARGET) -AM_INIT_AUTOMAKE([tar-ustar dist-bzip2 -Wno-portability]) +AM_INIT_AUTOMAKE([tar-ustar -Wno-portability]) dnl Commandline options http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=a431e3491f123728e8b4f3d8875905e6be1d8a98 commit a431e3491f123728e8b4f3d8875905e6be1d8a98 Author: fluzz <fl...@gm...> Date: Wed Jul 22 20:57:08 2015 +0200 version.c: If not in a git workdir, set version to PACKAGE_VERSION. Current way to generate the version's value (based on git-describe tag) does not work when built inside a distribution tree. diff --git a/src/Makefile.am b/src/Makefile.am index fad14b9..49926be 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,80 +15,90 @@ endif bin_PROGRAMS = freedroidRPG -EXTRA_DIST = - -freedroidRPG_SOURCES = version.c \ - menu.c shop.c items.c character.c skills.c saveloadgame.c \ - event.c dynarray.c item_upgrades.c item_upgrades_ui.c addon_crafting_ui.c \ - lua.c luaconfig.c \ - armor.c \ - blocks.c \ - floor_tiles.c \ - graphics.c map.c colldet.c init.c \ - image.c \ - takeover.c bullet.c influ.c action.c misc.c text.c text_public.c sound.c \ - enemy.c input.c keyboard.c main.c hud.c view.c automap.c BFont.c font.c \ - defs.h map.h vars.h takeover.h global.h \ - proto.h struct.h system.h BFont.h \ - open_gl.c open_gl_atlas.c open_gl_debug.c mission.c chat.c light.c \ - getopt.c getopt1.c getopt.h scandir.c scandir.h sound_effects.c \ - lang.c lang.h lists.c lists.h \ - gen_savestruct.py savestruct_internal.c savestruct_internal.h \ - string.c pathfinder.c \ - benchmark.c rtprof.c \ +freedroidRPG_SOURCES = \ + action.c addon_crafting_ui.c animate.c armor.c automap.c \ + benchmark.c BFont.c blocks.c bullet.c \ + character.c chat.c colldet.c \ + dynarray.c \ + enemy.c event.c \ + faction.c floor_tiles.c font.c \ + game_ui.c getopt.c getopt1.c graphics.c \ + hud.c \ + image.c influ.c init.c input.c items.c item_upgrades.c item_upgrades_ui.c \ + keyboard.c \ + lang.c light.c lists.c lua.c luaconfig.c \ + main.c map.c map_label.c menu.c misc.c mission.c \ npc.c \ - obstacle_extension.c \ + obstacle.c obstacle_extension.c open_gl.c open_gl_atlas.c open_gl_debug.c \ + pathfinder.c pngfuncs.c \ quest_browser_ui.c \ - map_label.c \ - faction.c \ + rtprof.c \ + saveloadgame.c savestruct_internal.c scandir.c shop.c skills.c sound.c sound_effects.c string.c \ + takeover.c text.c text_public.c \ + view.c \ waypoint.c \ - obstacle.c \ - widgets/widgets.c widgets/widgets.h widgets/widget_button.c widgets/widget_button.h \ - widgets/widget_group.c widgets/widget_group.h \ - widgets/widget_text.c widgets/widget_text.h \ - widgets/widget_background.c widgets/widget_background.h \ - widgets/widget_text_list.c widgets/widget_text_list.h \ - game_ui.c \ - pngfuncs.c pngfuncs.h \ + \ + BFont.h defs.h getopt.h global.h lang.h lists.h map.h pngfuncs.h proto.h savestruct_internal.h scandir.h struct.h system.h takeover.h vars.h \ + \ + gen_savestruct.py \ + \ + lua/luaFD.c lua/luaFD.h lua/luaFD_bindings.h lua/luaFD_tux.c lua/luaFD_npc.c \ + \ lvledit/lvledit.c lvledit/lvledit.h \ lvledit/lvledit_actions.c lvledit/lvledit_actions.h \ - lvledit/lvledit_display.c lvledit/lvledit_display.h \ lvledit/lvledit_beautify_actions.c lvledit/lvledit_beautify_actions.h \ - lvledit/lvledit_input.c \ + lvledit/lvledit_display.c lvledit/lvledit_display.h \ lvledit/lvledit_enemy.c \ + lvledit/lvledit_input.c \ lvledit/lvledit_map.c lvledit/lvledit_map.h \ lvledit/lvledit_menu.c lvledit/lvledit_menu.h \ - lvledit/lvledit_validator.c lvledit/lvledit_validator.h \ lvledit/lvledit_object_lists.c lvledit/lvledit_object_lists.h \ lvledit/lvledit_tools.c lvledit/lvledit_tools.h \ lvledit/lvledit_tool_move.c lvledit/lvledit_tool_move.h \ lvledit/lvledit_tool_place.c lvledit/lvledit_tool_place.h \ lvledit/lvledit_tool_select.c lvledit/lvledit_tool_select.h \ - lvledit/lvledit_widget_map.c lvledit/lvledit_widget_map.h \ - lvledit/lvledit_widget_toolbar.c lvledit/lvledit_widget_toolbar.h \ + lvledit/lvledit_validator.c lvledit/lvledit_validator.h \ + lvledit/lvledit_widgets.c lvledit/lvledit_widgets.h \ lvledit/lvledit_widget_categoryselect.c lvledit/lvledit_widget_categoryselect.h \ + lvledit/lvledit_widget_map.c lvledit/lvledit_widget_map.h \ lvledit/lvledit_widget_minimap.c lvledit/lvledit_widget_minimap.h \ - lvledit/lvledit_widgets.c lvledit/lvledit_widgets.h \ - mapgen/mapgen.c mapgen/mapgen.h mapgen/gram_simple.c animate.c \ + lvledit/lvledit_widget_toolbar.c lvledit/lvledit_widget_toolbar.h \ + \ + mapgen/gram_simple.c \ + mapgen/mapgen.c mapgen/mapgen.h \ mapgen/themes.c mapgen/themes.h \ - lua/luaFD.c lua/luaFD.h lua/luaFD_bindings.h lua/luaFD_tux.c lua/luaFD_npc.c + \ + widgets/widgets.c widgets/widgets.h \ + widgets/widget_background.c widgets/widget_background.h \ + widgets/widget_button.c widgets/widget_button.h \ + widgets/widget_group.c widgets/widget_group.h \ + widgets/widget_text.c widgets/widget_text.h \ + widgets/widget_text_list.c widgets/widget_text_list.h -nodist_freedroidRPG_SOURCES = savestruct.c savestruct.h build_flags.h -BUILT_SOURCES = savestruct.h build_flags.h +EXTRA_DIST = -savestruct.h: struct.h savestruct_internal.h gen_savestruct.py - $(PYTHON) $(srcdir)/gen_savestruct.py $(srcdir)/struct.h savestruct - -version.c: dummy - version_string=`echo "char *freedroid_version = \"$$(git describe --tags 2>/dev/null || echo "@PACKAGE_VERSION@")$$(git diff --exit-code >& /dev/null || echo "_mod")\";"` \ - && (echo $$version_string | cmp -s - $@) || echo $$version_string > $@ +# Generated files rules, to be created before sources compilation +nodist_freedroidRPG_SOURCES = build_flags.h savestruct.c savestruct.h version.c +BUILT_SOURCES = build_flags.h savestruct.h version.c +CLEANFILES = build_flags.h savestruct.c savestruct.h version.c build_flags.h: Makefile @echo '#define BUILD_CFLAGS "$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)"' >$@ @echo '#define BUILD_LDFLAGS "$(AM_LDFLAGS) $(LDFLAGS) $(freedroidRPG_LDADD) $(LIBS)"' >>$@ -dummy: +savestruct.h: struct.h savestruct_internal.h gen_savestruct.py + $(PYTHON) $(srcdir)/gen_savestruct.py $(srcdir)/struct.h savestruct -CLEANFILES = savestruct.c savestruct.h build_flags.h version.c +version.c: dummy + @if $$(git status >&/dev/null) ; then \ + version_string=`echo "char *freedroid_version = \"$$(git describe --tags 2>/dev/null || echo "@PACKAGE_VERSION@")$$(git diff --exit-code >& /dev/null || echo "_mod")\";"` ; \ + else \ + version_string=`echo "char *freedroid_version = \"@PACKAGE_VERSION@\";"` ; \ + fi ; \ + if ! $$(echo $$version_string | cmp -s - $@) ; then \ + echo $$version_string > $@ ; \ + fi + +dummy: .PHONY: dummy http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=1fd9a7c8c93c705201e6e8345d84ed7e84d9a9de commit 1fd9a7c8c93c705201e6e8345d84ed7e84d9a9de Author: Matthias Krüger <mat...@fa...> Date: Mon Jun 8 11:28:34 2015 +0200 fixup for last commit (bea8fbf3), fix duplicate line. diff --git a/map/events.dat b/map/events.dat index 6013c79..5cc8f7f 100644 --- a/map/events.dat +++ b/map/events.dat @@ -1833,7 +1833,6 @@ Enemy faction="ms" if (not arena_final_wave) then arena_next_wave = arena_current_wave + 1 display_big_message(_"All bots are killed! Go to center for next wave.") - display_big_message(_"All bots are killed! Go to center for next wave.") else arena_won = true display_big_message(_"All bots are killed! You won.") http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=8f58522502753d8a2e436ce3305f5a8427ee59fd commit 8f58522502753d8a2e436ce3305f5a8427ee59fd Author: infrared <inf...@fr...> Date: Thu Jul 23 21:31:02 2015 +0200 Extend the endgame, work toward end of act 1. This extends the game past the point where the player propagates the firmware update, killing all bots near the town and disabling the Hell Fortress. The firmware update disables all security measures and exposes a secret teleportation network that enables Spencer to teleport into the server room, accompanied by Bender, who makes a point about stories and what they mean to us, and the escort from the beginning of the game, who offers his own minimalistic congratulations. The player can ask the teleportation network to be linked to the town's teleporter for easy travelling back and forth. The game now ends with Spencer about to share his plan for the future with the player. After returning to the Town, Iris shares an ominous revelation, Tamara mourns her role in history, and Engel vows revenge. Also, the 614 in the cryo facility proves it is not blind. This patch is only a start; the true end of act 1 will involve changes to nearly all dialogs in the game, and more patches will follow. diff --git a/dialogs/614_cryo.lua b/dialogs/614_cryo.lua index dfb92da..05bad83 100644 --- a/dialogs/614_cryo.lua +++ b/dialogs/614_cryo.lua @@ -64,9 +64,14 @@ return { code = function() Npc:says(_"Order Received. Initiating proximity energy level scan...") Npc:says(_"***** Proximity Scan Results *****", "NO_WAIT") - Npc:says(_"Hostile Numeric Presence: [b]HIGH[/b]", "NO_WAIT") - Npc:says(_"Enemy Energy Levels: [b]LOW[/b]", "NO_WAIT") - Npc:says(_"Threat Degree Analysis: [b]MODERATE[/b]", "NO_WAIT") + if (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then + Npc:says(_"Hostile Numeric Presence: [b]HIGH[/b]", "NO_WAIT") + Npc:says(_"Enemy Energy Levels: [b]LOW[/b]", "NO_WAIT") + Npc:says(_"Threat Degree Analysis: [b]MODERATE[/b]", "NO_WAIT") + else + Npc:says(_"Hostile Numeric Presence: [b]NONE[/b]", "NO_WAIT") + Npc:says(_"Threat Degree Analysis: [b]NO THREAT DETECTED[/b]", "NO_WAIT") + end if (cmp_obstacle_state("CryoOuterGate", "closed")) then Npc:says(_"Cryo Complex Gates Status: [b]CLOSED[/b]") else diff --git a/dialogs/Bender.lua b/dialogs/Bender.lua index 9eb0d07..aaa8b0e 100644 --- a/dialogs/Bender.lua +++ b/dialogs/Bender.lua @@ -38,12 +38,21 @@ local Tux = FDrpg.get_tux() return { FirstTime = function() - Tux:says(_"Hello! I'm new here.") - Npc:says(_"Hey, man! I'm Bender, the dead man of this town. And you?") - Npc:set_name("Bender") - --; TRANSLATORS: %s = Tux:get_player_name() - Tux:says(_"I'm %s. I'm fine, thank you.", Tux:get_player_name(), "NO_WAIT") - show("node0") + if (not HF_Spencer_teleported) then + Tux:says(_"Hello! I'm new here.") + Npc:says(_"Hey, man! I'm Bender, the dead man of this town. And you?") + Npc:set_name("Bender") + --; TRANSLATORS: %s = Tux:get_player_name() + Tux:says(_"I'm %s. I'm fine, thank you.", Tux:get_player_name(), "NO_WAIT") + show("node0") + else + Tux:says(_"Hello there!") + --; TRANSLATORS: %s = Tux:get_player_name() + Npc:says(_"Hey, you're the new guy! I mean penguin! Uh, %s, right?", Tux:get_player_name()) + Tux:says(_"Yes, I-", NO_WAIT) + Npc:says(_"Holy wow! Wow, man!") + next("node60") + end end, EveryTime = function() @@ -53,16 +62,40 @@ return { Tux:says(_"How are you doing?") if (Tux:has_quest("Bender's problem")) then if (not Tux:done_quest("Bender's problem")) then - Npc:says(_"Too bad. I have never felt so sick.", "NO_WAIT") - Npc:says(_"Let me die, man!") - - if (Tux:has_item_backpack("Brain Enlargement Pills Antidote")) then - hide("node11", "node12") show("node9") + if (HF_Spencer_teleported) then + if (not Bender_go_talk_to_doc) then + Npc:says(_"Man, it's the end of the apocalypse... And I feel fine!") + Npc:says(_"I mean, I still didn't get the medicine from the doc. I didn't get the chance to really pound him.") + Npc:says(_"But right now everyone's so happy that the bots are all down, I think I'll give him a break.") + Tux:says(_"Maybe you should talk to him soon. He might be in a good mood and give it to you anyway.") + Npc:says(_"Hey, that sounds like a smart idea! Thanks, man, I'll do that!") + Tux:update_quest("Bender's problem", _"Since the killer bots around the town got a taste of my firmware, I think the Doc won't mind giving Bender his medicine now... I should talk to him when I see him.") + Bender_go_talk_to_doc = true + Npc:says(_"Now, I have something I want to say to you...") + Tux:says(_"And what's that?") + Npc:says(_"Holy wow! Wow, man!") + next("node60") + else + Npc:says(_"I still need to go talk to the doc, but just thinking about feeling less sick makes me feel less sick.") + Npc:says(_"It's confusing me a little...") + Tux:says(_"Well, hurry up and get it over with!") + end + hide("node1", "node2", "node3", "node4", "node5", "node6", "node7", "node8", "node9", "node10", "node50") else - hide("node9") show("node12") - end + Npc:says(_"Too bad. I have never felt so sick.", "NO_WAIT") + Npc:says(_"Let me die, man!") + if (Tux:has_item_backpack("Brain Enlargement Pills Antidote")) then + hide("node11", "node12") show("node9") + else + hide("node9") show("node12") + end - hide("node1", "node2", "node3", "node4", "node5", "node6", "node7", "node8", "node10", "node50") + hide("node1", "node2", "node3", "node4", "node5", "node6", "node7", "node8", "node10", "node11", "node50") + end + elseif (Bender_go_talk_to_doc) then + Npc:says(_"I still need to go talk to the doc, but just thinking about feeling less sick makes me feel less sick.") + Npc:says(_"It's confusing me a little...") + Tux:says(_"Well, hurry up and get it over with!") elseif (not tux_has_joined_guard) then Npc:says(_"Much better. I'm cured. You're a good guy, man!", "NO_WAIT") Npc:says(_"What was your name again?") @@ -74,20 +107,50 @@ return { Npc:says(_"Much better. I'm cured. You're a good guy, man!", "NO_WAIT") Npc:says(_"Congratulations on getting into the Red Guard!", "NO_WAIT") Npc:says(_"I voted for you and that was what got you in!", "NO_WAIT") - Npc:says(_"I said we'd be buddies, didn't I? Want to stand guard at the gate with me? It gets boring with just that 614 to talk to.") - Npc:says(_"I could tell you all the secrets of the Red Guard.") + if (not HF_Spencer_teleported) then + Npc:says(_"I said we'd be buddies, didn't I? Want to stand guard at the gate with me? It gets boring with just that 614 to talk to.") + Npc:says(_"I could tell you all the secrets of the Red Guard.") + show("node30") -- @TODO add another way to get this node post-firmware update + else + Npc:says(_"Oh, and congratulations on beating all the bots!") + Npc:says(_"I mean, wow...") + next("node60") + end Bender_congrats = true - show("node30") else - Npc:says(_"Much better. I'm cured. You're a good guy, man!", "NO_WAIT") + if (HF_Spencer_teleported) then + if (Bender_post_firmware_update) then + Npc:says(_"Man, it's the end of the apocalypse... And I feel fine!") + else + Npc:says(_"Oh man, this is so cool! Wow, man!") + next("node60") + end + else + Npc:says(_"Much better. I'm cured. You're a good guy, man!", "NO_WAIT") + end end - else + elseif (not HF_Spencer_teleported) then Npc:says(_"Too bad. I have never felt so sick.", "NO_WAIT") Npc:says(_"Let me die, man!") if (refused_to_help_bender) then show("node8") end + else + if (Bender_post_firmware_update) then + Npc:says(_"Man, it's the end of the apocalypse... And I feel fine!") + else + Npc:says(_"I'm good! Man, a few days ago I was feeling really down... I was really sick.") + Npc:says(_"But now I stopped feeling not-awesome! And it's all thanks to you and all the bots being dead!") + Npc:says(_"Maybe it's also because I pummeled the doc until he gave me some pills.") + Tux:says("...") + Npc:says(_"But I'm really sure it's also because all the bots are gone.") + Npc:says(_"I mean, look around!") + next("node60") + end + -- we hide any nodes that might lead to the player getting Bender's quest after this + hide("node0", "node1", "node2", "node3", "node4", "node5", "node6", "node7", "node8", "node10", "node11", "node50") + pop_topic("Sick Bender") end end @@ -347,11 +410,69 @@ return { end, }, { + id = "node60", + text = "BUG, REPORT ME! Bender node60 -- Post Firmware Update", + code = function() + Npc:says(_"Did you really just totally beat up all the bots in the world at once? Wow!") + Tux:says(_"Well, not all the bots in the world... And I didn't actually beat them all up...") + Npc:says(_"Oh, come on, man. We need this story. Don't do this.") + Tux:says(_"Uh, sorry? Do what?") + Npc:says(_"It doesn't matter what you did, dude. It matters what I think you did, and what I can tell others you did. You just beat up all the bots in the world.") + Tux:says(_"But it's only the ones that get their updates from this factory...") + Npc:says(_"And you did it with one hand tied behind your back! Or your wing, or flipper. You know, man.") + Bender_post_firmware_update = true + show("node61", "node62", "node63") + end, + }, + { + id = "node61", + text = _"Well, I think I rather like that story.", + code = function() + Npc:says(_"Yeah, and you can bet everyone in town is gonna go crazy about it!") + Npc:says(_"I know I will, as soon as I get back I'll make a bet with Ewald about it.") + Npc:says(_"Everyone's been holed up in the town for so long, and I was really starting to run out of good stories to tell.") + hide("node61", "node62") + end, + }, + { + id = "node62", + text = _"But that's not what happened!", + code = function() + Npc:says(_"Sure, not yet, because I didn't tell anyone about it yet.") + Tux:says(_"No, that didn't happen at all, and you saying it happened won't make it happen!") + Npc:says(_"But that's not what everyone will say after I tell them that's what happened.") + Tux:says(_"But... I... Arrrgh!") + Tux:heat(10) + Npc:says(_"Dude, it's not so hard to understand.") + Npc:says(_"Hey, you know, I saw an ad for brain enlargement pills that might do you good.") + Tux:says(_"No, I... I just need to cool off a bit...") + Npc:says(_"Oh, sure, ok. But I can fix you up with some if you change your mind. It's 100%% satisfaction guaranteed, cheap, AND free.") + hide("node62", "node61") + end, + }, + { + id = "node63", + text = _"That was a nice entrance you made there.", + code = function() + Npc:says(_"Hey, thanks, dude. I'm still not so sure what happened.") + Npc:says(_"It all went really fast, Spencer just pulled me out of the pool and said to dry up and meet him at the teleporter.") + Npc:says(_"Then he just rushed off. He was really excited, he didn't even tell me off for cannonballing.") + Tux:says(_"So I guess that means you teleported in here.") + Npc:says(_"I guess we did! Wow, this was my first teleport! This makes it so much more awesome!") + hide("node63") + end, + }, + { id = "node99", text = _"See you later.", code = function() - Npc:says_random(_"Later, man!", - _"Stay cool dude.") + if (not HF_Spencer_teleported) then + Npc:says_random(_"Later, man!", + _"Stay cool dude.") + else + Npc:says_random(_"Oh, ok, go beat up some more bots! Swish! Woosh! Ka-POW!", + _"See you, and thanks for the story!") + end end_dialog() end, }, diff --git a/dialogs/DocMoore.lua b/dialogs/DocMoore.lua index 84b27f2..3442f19 100644 --- a/dialogs/DocMoore.lua +++ b/dialogs/DocMoore.lua @@ -34,7 +34,11 @@ local Tux = FDrpg.get_tux() return { FirstTime = function() - show("node0") + if (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then + show("node0") + else + show("DocMoore_post_firmware_update_firsttime") + end end, EveryTime = function() @@ -59,6 +63,15 @@ return { if (Tux:has_item_backpack("Antibiotic")) then show("node56") end if (Tux:has_item_backpack("Doc-in-a-can")) then show("node57") end + show("node99") + + if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) and + (Tux:has_met("DocMoore")) and + (not DocMoore_post_firmware_update_congrats) then + next("DocMoore_post_firmware_update") + return -- next() node is executed immediately after EveryTime, would look odd if EveryTime contains Npc:says + end + if (Tux:get_hp_ratio() < 0.1) then Npc:says(_"You look gravely injured.") Npc:says(_"I will help you.") @@ -93,7 +106,10 @@ return { show("node42", "node43") end - show("node99") + if (Bender_go_talk_to_doc) and + (not Tux:done_quest("Bender's problem")) then + show("DocMoore_post_firmware_update_bender") + end end, { @@ -165,7 +181,8 @@ return { text = _"Can you fix me up?", code = function() Npc:says(_"Sure, as the only doctor of this slowly growing community, I take responsibility for everyone's health.") - if (not DocMoore_asked_self_damage) then + if (not DocMoore_asked_self_damage) and + (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then Npc:says(_"However, self-inflicted damage might be exempted from this rule in some cases...") show("node11") end @@ -383,12 +400,92 @@ return { end, }, { + id = "DocMoore_post_firmware_update_firsttime", + text = _"Hello!", + code = function() + next("DocMoore_post_firmware_update") + hide("DocMoore_post_firmware_update_firsttime") + show("node1", "node3") + end, + }, + { + id = "DocMoore_post_firmware_update", + text = "BUG REPORT ME! DocMoore node DocMoore_post_firmware_update", + echo_text = false, + code = function() + Npc:says(_"Sorry, the doctor is out- oh! It's you! How can i help you?") + Npc:says(_"Do you need Antibiotics? No, of course not, you look like you're in need of some radiotherapy!") + Tux:says(_"No, I'm fine, thank you...") + Npc:says(_"Are you sure? Anything for you! You're a hero!") + DocMoore_post_firmware_update_congrats = true + show("DocMoore_post_firmware_update_humble", "DocMoore_post_firmware_update_bruised") + hide("node2", "node11", "node20", "node21", "node22", "node30", "node10") -- hide nodes related to Bender's quest and "fix me up" + end, + }, + { id = "DocMoore_post_firmware_update_bruised", + text = _"Well, now that you mentioned it, I am a little bruised.", + code = function() + Npc:says(_"Well, let's take a look at you...") + if (Tux:get_hp_ratio() < 0.3) then + Npc:says(_"Yes, I can see - you've been through some harshness.") + Npc:says(_"But we can fix that. Under my care, you'll be as good as new! Now take this, put it in your mouth and count to 30.") + --; TRANSLATORS: "mrn" = one, "tww" = two, "thow" = three + ow + Tux:says(_"Mrn... Tww... ThOW!") + Npc:says(_"Just a little shot while you were waiting!") + Npc:says(_"Ok, you are fixed now.") + Tux:says(_"Oh, thank you!") + Tux:heal() + else + Npc:says(_"Hmm... Yes... And here...") + Npc:says(_"I see. Well, a preliminary physical examination doesn't show anything very wrong, but we can't be too sure!") + Tux:says(_"What are you doing? Why are you putting on a glove?") + Npc:says(_"Calm down, I do this all the time. Now, relax your muscles...") + Tux:says(_"Whoa! Whoa- thanks, doc, but I'm feeling much better now! Really!") + Npc:says(_"Oh- well, great!") + Npc:says(_"Funny, they always say that...") + end + hide("DocMoore_post_firmware_update_bruised") + show("node10") + end, + }, + { id = "DocMoore_post_firmware_update_humble", + text = _"I only did what I had to do.", + code = function() + Npc:says(_"And what no one thought could be done!") + --; TRANSLATORS: %s = Tux:get_player_name() + Npc:says(_"Listen, %s, you saved everyone's lives here - the least I could do as a doctor is to look out for yours.", Tux:get_player_name()) + hide("DocMoore_post_firmware_update_humble") + end, + }, + { id = "DocMoore_post_firmware_update_bender", + text = _"Have you heard anything from Bender?", + code = function() + Npc:says(_"Bender?") + Npc:says(_"Oh, him! That fool who took the brain growth pills!") + Tux:says(_"Yes. I guess they really should be called brain growth pills. He's still very sick. ") + Npc:says(_"But I can't just give him the antidote.") + Tux:says(_"Why not?") + Npc:says(_"Well, that would be unfair. It would also be unwise, and... And...") + Npc:says(_"Oh, darn it, why not indeed! The worst is past us! He can have all the antidote he wants. I'm in such a good mood, I haven't felt so cheerful since my first autopsy back in medical school!") + Tux:says(". . .") + Npc:says(_"Of course, I mean the celebrations that followed the autopsy. Everyone had passed the exam.") + Tux:says(_"Yes. Of course.") + Tux:end_quest("Bender's problem", _"It is done - I talked to Doc Moore, and he will happily give Bender the antidote.") + hide("DocMoore_post_firmware_update_bender") + end, + }, + { id = "node99", text = _"See you later.", code = function() - Npc:says_random(_"See you later.", - _"Keep healthy!") - end_dialog() + if (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then + Npc:says_random(_"See you later.", + _"Keep healthy!") + else + Npc:says_random(_"Take good care of yourself - I'm taking a vacation!", + _"It's a wonderful day. Thank you.") + end + end_dialog() end, }, } diff --git a/dialogs/Engel.lua b/dialogs/Engel.lua index 9fd91f8..9ad202d 100644 --- a/dialogs/Engel.lua +++ b/dialogs/Engel.lua @@ -36,11 +36,17 @@ local Tux = FDrpg.get_tux() return { FirstTime = function() - show("node0", "node6") + if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then + show("Engel_postfirmwareupdate_FirstTime") + else + show("node0", "node6") + end end, EveryTime = function() - if (Tux:get_program_revision("Extract bot parts") > 0) then + if ((HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) and (not Engel_post_firmware_update)) then + show("Engel_postfirmwareupdate") + elseif (Tux:get_program_revision("Extract bot parts") > 0) then show("node18") end show("node99") @@ -358,11 +364,47 @@ return { end, }, { + id = "Engel_postfirmwareupdate_FirstTime", + text = _"Hi! I'm new here.", + echo_text = false, + code = function() + Tux:says(_"Hi! I'm-") + next("Engel_postfirmwareupdate") + end, + }, + { + id = "Engel_postfirmwareupdate", + text = _"How's it going?", + code = function() + Npc:says(_"RRRRRAAAAAAAARRRGH!") + Tux:says(_"... Excuse me?") + Npc:says(_"I... Will KILL... Who did this?!") + Npc:says(_"All the bots are dead...") + Tux:says(_"Yes! Everyone's safe now-") + Npc:says(_"But I DID NOT KILL THEM!") + Tux:says(_"I...") + -- ; TRANSLATORS: nein = no , Mutter = mother + Npc:says(_"Nein... Nein, I WILL avenge you, Mutter... Yes, I will find whoever took my vengeance away from me... And CRUSH!!") + Tux:says(". . .") + Tux:says(_"Well! I had better go now. Good luck!") + Engel_post_firmware_update = true + hide("Engel_postfirmwareupdate") + end_dialog() + end, + + }, + { id = "node99", text = _"I'll be going then.", code = function() - --; TRANSLATORS: viel Gluck = good luck (should be "viel Glueck, but the ue character is missing in the font) - Npc:says(_"Goodbye and viel Gluck.") + if (not Engel_post_firmware_update) then + --; TRANSLATORS: viel Gluck = good luck (should be "viel Glueck, but the ue character is missing in the font) + Npc:says(_"Goodbye and viel Gluck.") + else + --; TRANSLATORS: rache = revenge + Npc:says_random(_"RACHE!!", + ". . .") + end end_dialog() end, }, diff --git a/dialogs/HF-FirmwareUpdateServer.lua b/dialogs/HF-FirmwareUpdateServer.lua index 40a2fd1..e37f573 100644 --- a/dialogs/HF-FirmwareUpdateServer.lua +++ b/dialogs/HF-FirmwareUpdateServer.lua @@ -22,37 +22,39 @@ local Tux = FDrpg.get_tux() return { EveryTime = function() - play_sound("effects/Menu_Item_Deselected_Sound_0.ogg") - -- Are we human? CAPTCHA!!! - number_one=math.random(2,7) - number_two=math.random(1,number_one-1) - captcha = number_one - number_two - if (captcha == 1) then - captcha = _"one" - elseif (captcha == 2) then - captcha = _"two" - elseif (captcha == 3) then - captcha = _"three" - elseif (captcha == 4) then - captcha = _"four" - elseif (captcha == 5) then - captcha = _"five" - elseif (captcha == 6) then - captcha = _"six" - end - response = user_input_string(string.format(_"CAPTCHA: Please write the lowercase word that answers the following: %d - %d = ?", number_one, number_two)) - if (captcha ~= response) then - Npc:says(_"Non-human detected. Administering paralyzing shock.") - Npc:says(_"NOTE: If you are a human, try again, and make sure you enter a word and not digits.") - freeze_tux_npc(7) - Tux:hurt(20) - Tux:heat(20) - play_sound("effects/Menu_Item_Selected_Sound_1.ogg") - end_dialog() - else - Npc:says(_"Welcome to MS firmware update server for region #54658.") - Npc:says(_"Please select action") - show("node1", "node3", "node99") + if (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then + play_sound("effects/Menu_Item_Deselected_Sound_0.ogg") + -- Are we human? CAPTCHA!!! + number_one=math.random(2,7) + number_two=math.random(1,number_one-1) + captcha = number_one - number_two + if (captcha == 1) then + captcha = _"one" + elseif (captcha == 2) then + captcha = _"two" + elseif (captcha == 3) then + captcha = _"three" + elseif (captcha == 4) then + captcha = _"four" + elseif (captcha == 5) then + captcha = _"five" + elseif (captcha == 6) then + captcha = _"six" + end + response = user_input_string(string.format(_"CAPTCHA: Please write the lowercase word that answers the following: %d - %d = ?", number_one, number_two)) + if (captcha ~= response) then + Npc:says(_"Non-human detected. Administering paralyzing shock.") + Npc:says(_"NOTE: If you are a human, try again, and make sure you enter a word and not digits.") + freeze_tux_npc(7) + Tux:hurt(20) + Tux:heat(20) + play_sound("effects/Menu_Item_Selected_Sound_1.ogg") + end_dialog() + else + Npc:says(_"Welcome to MS firmware update server for region #54658.") + Npc:says(_"Please select action") + show("node1", "node3", "node99") + end end end, @@ -65,6 +67,14 @@ return { else --; TRANSLATORS: %s in %swashere = Tux:get_player_name() Npc:says(_"Currently deployed firmware is v. 5.0.8+%swashere+gpl", Tux:get_player_name()) + if (not HF_FirmwareUpdateServer_Spencer) then + --; TRANSLATORS: "hello?" + Npc:says(_"*Bzzt*ello?") + Tux:says(_"What? What is this?") + start_chat("Spencer") + Tux:update_quest("Propagating a faulty firmware update", _"Spencer somehow contacted me through the firmware server terminal. From what he told me, it worked - the hostile bots are all deactivated! I am now supposed to stand by for further instructions...") + HF_FirmwareUpdateServer_Spencer = true + end end end, }, @@ -82,7 +92,7 @@ return { Npc:says(_"Conflicts resolved,") Npc:says(_"Firmware update propagated!") HF_FirmwareUpdateServer_uploaded_faulty_firmware_update = true - Tux:end_quest("Propagating a faulty firmware update", _"I managed to upload the faulty firmware update to all bots within transmission range. Victory is mine!") + Tux:update_quest("Propagating a faulty firmware update", _"I managed to upload the faulty firmware update to all bots within transmission range. Either the siege on the town ends now... Or everything else does.") kill_faction("ms", "no_respawn") hide("node3") else @@ -98,10 +108,21 @@ return { text = _"Logout", code = function() play_sound("effects/Menu_Item_Selected_Sound_1.ogg") - if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then - win_game() -- Comment this to test the game with all bots dead. - end end_dialog() + if (HF_FirmwareUpdateServer_Spencer) and (not HF_Spencer_teleported) then + local guard = FDrpg.get_npc("Town-TuxGuard") + change_obstacle_type("59-Teleporter", 19) --Prime the teleporter! + add_obstacle(59, 57.6, 29.5, 16) + play_sound("effects/new_teleporter_sound.ogg") + -- We would like the teleportation to be a little delayed for effect, but that's NYI, so... + Spencer:teleport("59-Teleporter-1") + Spencer:set_destination("59-Teleporter-1") + Bender:teleport("59-Teleporter-2") + Bender:set_destination("59-Teleporter-2", "Bender") + guard:teleport("59-Teleporter-3", "Town-TuxGuard") + guard:set_destination("59-Teleporter-3") + HF_Spencer_teleported = true + end end, }, } diff --git a/dialogs/Iris.lua b/dialogs/Iris.lua index 67b08b9..aea7c48 100644 --- a/dialogs/Iris.lua +++ b/dialogs/Iris.lua @@ -43,7 +43,7 @@ return { end else Npc:says_random(_"Sure is dark around here.", - _"I wish there was some decent lighting.") + _"I wish there was some decent lighting.") end end @@ -52,6 +52,13 @@ return { Iris_false_happy = false show("node4") end + + if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) and + (Tux:has_met("Iris")) and + (not Iris_post_firmware_upgrade) then + show("Iris_post_firmware_upgrade") + end + show("node99") end, @@ -59,18 +66,27 @@ return { id = "node0", text = _"Hello.", code = function() - Npc:says_random(_"Hello", - _"Hi there!") - hide("node0") show("node1") + Npc:says_random(_"Hello.", + _"Hi there!") + if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then + Npc:says(_"I've heard about you.") + Npc:says(_"A lot.") + Npc:says(_"You're the talk of the town, actually.") + Iris_post_firmware_upgrade = true + show("node50", "node51", "node52") + else + show("node1") + end + hide("node0") end, }, { id = "node1", text = _"Who are you?", code = function() - Npc:says(_"I'm Iris") + Npc:says(_"I'm Iris.") Npc:set_name("Iris") - Tux:says(_"Hello Iris.") + Tux:says(_"Hello, Iris.") hide("node1") show("node2") end, }, @@ -174,10 +190,113 @@ return { end, }, { + id = "Iris_post_firmware_upgrade", + text = _"Hello.", + code = function() + Npc:says(_"Hello again.") + Npc:says(_"I've been hearing about you all day. You're the talk of the town.") + Iris_post_firmware_upgrade = true + hide("Iris_post_firmware_upgrade") show("node50", "node51", "node52") + end, + }, + { + id = "node50", + text = _"Yep, that's me. I saved everyone's hide. Including yours.", + code = function() + Npc:says(_"You did save a lot of lives, I'll give you that.") + Npc:says(_"But I wouldn't get so excited if I were you. I don't think we're in the clear yet.") + hide("node50", "node51", "node52") show("node53") + end, + }, + { + id = "node51", + text = _"Oh, and what have you heard?", + code = function() + Npc:says(_"Pretty cool stuff, actually. I heard you practically saved the town.") + Npc:says(_"You penetrated the Hell Fortress in a bold operation against all odds, and managed to sabotage every bot from here to the next MegaSys service cell over, without so much as touching any standard interface.") + Npc:says(_"That's what they say, anyway.") + Tux:says(_"Hehe, well, the stories people tell...") + Tux:says(_"The important thing is that everyone's safe now.") + Npc:says(_"Yeah. I just wish I could be as certain of that...") + hide("node50", "node51", "node52") show("node53") + end, + }, + { + id = "node52", + text = _"I know what they say, but I'm really not the superhero they make me out to be.", + code = function() + Npc:says(_"Hey, you gotta give yourself some credit.") + Npc:says(_"Infiltration and sabotage are some of the most complicated types of operations out there. And also the most fun.") + Npc:says(_"And you did pretty well, by the looks of it. Especially for someone with no fingers.") + Tux:says(_"Thank you... I guess.") + Npc:says(_"Yeah. Although there's still a lot to be done.") + hide("node50", "node51", "node52") show("node53") + end, + }, + { + id = "node53", + text = _"What do you mean?", + code = function() + Npc:says(_"I... I'm not sure.") + Npc:says(_"It could be just background noise. Maybe it's not even that. But there's still something a little weird about it.") + Npc:says(_"More than a little, when I think about it.") + Tux:says(_"What are you talking about?") + Npc:says(_"... I hope trusting you with this isn't a mistake.") + --; TRANSLATORS: comm = communication + Npc:says(_"My comm devices have been intercepting strange signals in this area, ever since I got here. It's usually scrambled beyond recognition, and I wasn't even sure it was a signal at all until recently.") + Npc:says(_"It was just before you arrived, actually.") + Tux:says(_"Are you saying I'm emitting some kind of signal?") + Npc:says(_"No - if that were the case my equipment would've been going crazy right now. But it's definitely related to you.") + Tux:says(_"But how do you know?") + Npc:says(_"Because just before you arrived, everything did go crazy. At first I thought we were being nuked and the EMP was causing it.") + Npc:says(_"But then I realized: someone is broadcasting, and they really wanted outreach.") + Npc:says(_"It wasn't scrambled this time, and I listened. The whole thing lasted about an hour. It was mostly binary; I couldn't figure most of it out, but there were some names encoded in hex in there. Places. People.") + Npc:says(_"One of them was you.") + push_topic("Mysterious signal") + hide("node53") show("node54") + end, + }, + { + id = "node54", + text = _"My name? What does this mean?", + topic = "Mysterious signal", + code = function() + Npc:says(_"It means someone knew about you before the Red Guard did, and it means whoever it was broadcast it far and wide.") + Npc:says(_"That's all I can make of it.") + hide("node54") + show("node55", "node56") + end, + }, + { id = "node55", + text = _"I understand.", + topic = "Mysterious signal", + code = function() + Npc:says(_"If I were you, I would be very careful. I'm sure there were a lot of hands stirring in this mess, but I think some of them weren't chopped off by a bot.") + hide("node55", "node56") + pop_topic() + end, + }, + { id = "node56", + text = _"I don't understand.", + topic = "Mysterious signal", + code = function() + Npc:says(_"I don't either, and I don't have anything more to say on the matter.") + --; TRANSLATORS: previous sentence was "I don't have anything more to say on the matter" + Npc:says(_"Just that I hope that your optimism will be justified.") + hide("node55", "node56") + pop_topic() + end, + }, + { id = "node99", text = _"See you later.", code = function() - if (Iris_wants_lamp) then + if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then + Npc:says_random(_"Take care.", + _"Be careful out there.", + _"Keep an eye out for anything weird.", + _"Remember the saying, 'Speak softly and carry a big stick.' I think you'll need that stick soon.") + elseif (Iris_wants_lamp) then Npc:says(_"Bye.") else Npc:says(_"In your dreams, Penguin!") diff --git a/dialogs/Pendragon.lua b/dialogs/Pendragon.lua index 5cc3a4d..3a44b52 100644 --- a/dialogs/Pendragon.lua +++ b/dialogs/Pendragon.lua @@ -28,7 +28,12 @@ local Tux = FDrpg.get_tux() return { FirstTime = function() desertgate_tax = 0 - show("node0") + if (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then + show("node0") + else + show("Pendragon_postfirmwareupdate") + end + end, EveryTime = function() @@ -56,6 +61,10 @@ return { end end + if ((HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) and (not Pendragon_post_firmware_update)) then + show("Pendragon_postfirmwareupdate") + end + show("node99") if (not guard_follow_tux) then @@ -108,6 +117,10 @@ return { Npc:says(_"And you?") --; TRANSLATORS: %s = Tux:get_player_name() Tux:says(_"%s, because it is my name?", Tux:get_player_name()) + if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then + --; TRANSLATORS: %s = Tux:get_player_name() + Npc:says(_"%s. Hah. They won't remember that name the way you think, bird.", Tux:get_player_name()) + end Npc:set_name("Pendragon - Fighter") hide("node2") end, @@ -277,12 +290,79 @@ return { end, }, { + id = "Pendragon_postfirmwareupdate", + text = _"Hi!", + code = function() + Npc:says(_"What do you want?") + Pendragon_post_firmware_update = true + show("Pendragon_postfirmwareupdate_goodbye", "Pendragon_postfirmwareupdate_cont", + "Pendragon_postfirmwareupdate_brag") + hide("Pendragon_postfirmwareupdate") + end, + }, + { + id = "Pendragon_postfirmwareupdate_goodbye", + text = _"Nothing...", + code = function() + Npc:says(_"Get lost. Don't come back.") + hide("Pendragon_postfirmwareupdate_goodbye","Pendragon_postfirmwareupdate_cont", + "Pendragon_postfirmwareupdate_brag") + end_dialog() + end, + }, + { + id = "Pendragon_postfirmwareupdate_cont", + text = _"How's it going?", + code = function() + Npc:says(_"Listen to me carefully, bird.") + Npc:says(_"Maybe it looks like you saved the day, but I know better than that. You're nothing but a duck. You're not a human.") + Npc:says(_"As far as I'm concerned, you just landed here and stole our show. The Red Guard had everything under control, and we did not need your stupid flippers waddling in our affairs.") + Npc:says(_"And don't think that just because Spencer is excited, he's on your side.") + Npc:says(_"He may not share his plans with the rest of us, but I know him well enough to know that he's using you.") + Npc:says(_"He's been using you since he did you a favor and defrosted you, and your stupid bird brain can't even comprehend that. So don't get cocky.") + Npc:says(_"You'll get what you deserve, soon enough, just like all the other bird aliens.") + if (not Pendragon_beaten_up) then + Npc:says(_"HA!") + Tux:del_health(10) + Tux:says(_"Ouch!") + end + hide("Pendragon_postfirmwareupdate_goodbye", "Pendragon_postfirmwareupdate_cont", + "Pendragon_postfirmwareupdate_brag") + end_dialog() + end, + }, + { + id = "Pendragon_postfirmwareupdate_brag", + text = _"I want to see a better attitude around here. You'd better be nice to me.", + code = function() + if (Pendragon_beaten_up) then + Tux:says(_"Remember our lesson?") + Npc:says(". . .") + else + Npc:says(_"You impudent little eggspawn.") + next("Pendragon_postfirmwareupdate_cont") + end + hide("Pendragon_postfirmwareupdate_goodbye", "Pendragon_postfirmwareupdate_cont", + "Pendragon_postfirmwareupdate_brag") + end_dialog() + end, + }, + { id = "node99", text = _"See you later.", code = function() - Npc:says_random(_"Have courage.", - _"Be strong.") + if (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then + Npc:says_random(_"Have courage.", + _"Be strong.") + else + if (Pendragon_beaten_up) then + Npc:says(". . .") + else + Npc:says_random(_"You'll see. Big hero. You'll learn your place soon.", + _"I hate birds.") + end + end end_dialog() end, - }, + } } diff --git a/dialogs/Spencer.lua b/dialogs/Spencer.lua index 599610b..6ea7393 100644 --- a/dialogs/Spencer.lua +++ b/dialogs/Spencer.lua @@ -66,6 +66,10 @@ return { Tux:add_quest("Open Sesame", "It turns out what we thought was the firmware update server was just a gate access server. Spencer speculates the real firmware server is behind this gate. There should be something on the ground I am supposed to follow.") Spencer_can_die = true end_dialog() + elseif (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) and (not HF_FirmwareUpdateServer_Spencer) then + next("node60") + elseif (HF_Spencer_teleported) then + hide("node7") elseif (tux_has_joined_guard) then Npc:says(_"Greetings fellow Red Guard member.") hide("node2", "node12") @@ -561,10 +565,117 @@ return { end, }, { + id = "node60", + text = "BUG, REPORT ME! Spencer node60 -- Post Firmware Update", + code = function() + Npc:says(_"*Fizz*") + --; TRANSLATORS: can you hear me; %s = Tux:get_player_name() + Npc:says(_"*Crackle*n you hear me? Hello? %s?", Tux:get_player_name()) + Tux:says(_"Spencer? How are you reaching me?") + Npc:says(_"You did it! I just can't... I can't believe you actually did it!") + Npc:says(_"The bots outside, they all just dropped! They're scrap metal!") + Npc:says(_"We're saved!") + Tux:says(_"Whew...") + Npc:says(_"But wait! It gets more interesting: we can actually have this conversation face to face.") + Npc:says(_"Stand by.") + add_obstacle(0, 33.5, 51.05, 282) --"Close" Spencer's office door + change_obstacle_type("spencer-opendoor", 321) --Make the obstacle standing for an open door invisible (321=pathblocker) + end_dialog() + show("node61") + end, + }, + { + id = "node61", + text = _"Hey!", + code = function() + Npc:says(_"This must be the main server room. It's safer than an interstellar bunker.") + Npc:says(_"This is the source of all our suffering.") + Npc:says(_"You are truly a living legend, Linarian. I don't know how you did it. I don't know how we can thank you.") + Npc:says(_"You've given us life, and hope.") + hide("node61") show("node62", "node63", "node64") + end, + }, + { + id = "node62", + text = _"What's going on? How did you get in here?", + code = function() + Npc:says(_"When you uploaded the firmware, every security component for this area just blacked out. Every network in range was suddenly open.") + Npc:says(_"Naturally, they were all running on the MegaSys operating system.") + if Tux:has_met("Richard") then + Npc:says(_"Richard is still back at the citadel; he's happier than a jaybird ever since we uncovered all this networking. He calls it a treasure.") + else + Npc:says(_"Our computer administrator at the citadel is as happy as he could be since all this secret networking popped up. He calls it a treasure.") + end + Npc:says(_"The firmware server was one of the things that were hidden in this network, and with all the obfuscations and defenses down, we not only could find it, but had full access.") + Npc:says(_"But the most interesting thing we uncovered is a secret teleportation network. It was very well-guarded, we never even knew it existed, but now it's open for us to use.") + Npc:says(_"My guess is, the corporate bastards who drove this sweatshop would use it to get in and out of work unnoticed. Grab the money and zap off to some island to relax.") + Tux:update_quest("Propagating a faulty firmware update", _"Neutralizing the bot threat in the area wasn't the only thing I'd succeeded in doing: every MegaSys-based security product within range is completely broken now. A new teleportation network was discovered by the Red Guard, which is why Spencer is standing next to me right now.") + hide("node62") show("node65") + end, + }, + { + id = "node63", + text = _"I couldn't have done any different.", + code = function() + Npc:says(_"You are far too modest. I doubt anyone alive right now could have done it.") + Npc:says(_"But the work isn't done... Not even close. The entire galaxy is still at war.") + Npc:says(_"You saved our little t... [truncated message content] |
From: Bastian S. <bas...@us...> - 2015-07-16 12:03:17
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via cf48ea3c303068419221a5e2cf110cb443d53540 (commit) from 01d4e831504825425920c502b5a6f3af9a547d05 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=cf48ea3c303068419221a5e2cf110cb443d53540 commit cf48ea3c303068419221a5e2cf110cb443d53540 Author: basse <bas...@gm...> Date: Thu Jul 16 15:02:57 2015 +0300 new portrait diff --git a/graphics/droids/female_hunter/portrait.png b/graphics/droids/female_hunter/portrait.png index 3e813de..02f5c25 100644 Binary files a/graphics/droids/female_hunter/portrait.png and b/graphics/droids/female_hunter/portrait.png differ ----------------------------------------------------------------------- Summary of changes: graphics/droids/female_hunter/portrait.png | Bin 46307 -> 65648 bytes 1 files changed, 0 insertions(+), 0 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-15 21:32:31
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 01d4e831504825425920c502b5a6f3af9a547d05 (commit) from 9aaa34efc8d8ef6910bb0e399609bb14ca26d4b4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=01d4e831504825425920c502b5a6f3af9a547d05 commit 01d4e831504825425920c502b5a6f3af9a547d05 Author: fluzz <fl...@gm...> Date: Wed Jul 15 23:31:34 2015 +0200 AppData: put the id in lowercase. diff --git a/pkgs/freedesktop/freedroidrpg.appdata.xml b/pkgs/freedesktop/freedroidrpg.appdata.xml index fa697ef..98206f9 100644 --- a/pkgs/freedesktop/freedroidrpg.appdata.xml +++ b/pkgs/freedesktop/freedroidrpg.appdata.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <application> - <id type="desktop">freedroidRPG.desktop</id> + <id type="desktop">freedroidrpg.desktop</id> <metadata_license>CC0-1.0</metadata_license> <project_license>GPL-2.0+</project_license> <name>FreedroidRPG</name> ----------------------------------------------------------------------- Summary of changes: pkgs/freedesktop/freedroidrpg.appdata.xml | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-15 20:41:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 9aaa34efc8d8ef6910bb0e399609bb14ca26d4b4 (commit) via b97a4535d3e6c1d97561f1c847af3eb3085db94f (commit) via dd75794baf48f0f3fed92a709b783ed2de4e8e02 (commit) via bd01af24faa8ccd033e98323c351d1783746e70e (commit) from f044071db0add203616f0db101a09be5febedaf3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=bd01af24faa8ccd033e98323c351d1783746e70e commit bd01af24faa8ccd033e98323c351d1783746e70e Author: fluzz <fl...@gm...> Date: Wed Jul 15 19:25:04 2015 +0200 Add ORed flags (load_image_mod_flags) to define the modifications to apply when loading an image. Currently, USE_OFFSET is defined. USE_WIDE will be added later. Change image loading functions and their callers to use them. diff --git a/src/BFont.c b/src/BFont.c index e124d62..b2b78a6 100644 --- a/src/BFont.c +++ b/src/BFont.c @@ -143,7 +143,7 @@ int load_bfont(const char *filepath, struct font *font) BFont_Info *bfont = MyMalloc(sizeof(BFont_Info)); // Load the font_image->surface - load_image_surface(&bfont->font_image, filepath, FALSE); + load_image_surface(&bfont->font_image, filepath, NO_MOD); // Find character coordinates in the image SDL_Rect char_rect[MAX_CHARS_IN_FONT]; diff --git a/src/automap.c b/src/automap.c index f917c87..0201de5 100644 --- a/src/automap.c +++ b/src/automap.c @@ -324,7 +324,7 @@ static void display_automap_compass() { //load the compass if necessary if (!image_loaded(&compass)) { - load_image(&compass, "compass.png", FALSE); + load_image(&compass, "compass.png", NO_MOD); } display_image_on_screen(&compass, GameConfig.screen_width - compass.w - 10, 40, IMAGE_NO_TRANSFO); diff --git a/src/blocks.c b/src/blocks.c index 53f18bc..efbdfca 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -176,7 +176,7 @@ void Load_Blast_Surfaces(void) for (i = 0; i < sizeof(Blastmap) / sizeof(Blastmap[0]); i++) { for (j = 0; j < Blastmap[i].phases; j++) { sprintf(fpath, "blasts/%s_%04d.png", Blastmap[i].name, j + 1); - load_image(&Blastmap[i].images[j], fpath, TRUE); + load_image(&Blastmap[i].images[j], fpath, USE_OFFSET); } } } @@ -251,7 +251,7 @@ static void load_item_graphics(int item_type) // Load ingame image if (strcmp(spec->item_rotation_series_prefix, "NONE_AVAILABLE_YET")) { sprintf(our_filename, "items/%s/ingame.png", spec->item_rotation_series_prefix); - load_image(&spec->ingame_image, our_filename, TRUE); + load_image(&spec->ingame_image, our_filename, USE_OFFSET); } else { memcpy(&spec->ingame_image, &spec->inventory_image, sizeof(struct image)); } @@ -330,7 +330,7 @@ void Load_Mouse_Move_Cursor_Surfaces(void) for (j = 0; j < NUMBER_OF_MOUSE_CURSOR_PICTURES; j++) { sprintf(our_filename, "cursors/mouse_move_cursor_%d.png", j); - load_image(&MouseCursorImageList[j], our_filename, FALSE); + load_image(&MouseCursorImageList[j], our_filename, NO_MOD); } }; // void Load_Mouse_Move_Cursor_Surfaces( void ) @@ -354,7 +354,7 @@ void iso_load_bullet_surfaces(void) for (k = 0; k < BULLET_DIRECTIONS; k++) { sprintf(constructed_filename, "bullets/iso_bullet_%s_%02d_%04d.png", bullet_spec->name, k, j + 1); - load_image(&bullet_spec->image[k][j], constructed_filename, TRUE); + load_image(&bullet_spec->image[k][j], constructed_filename, USE_OFFSET); } } } @@ -559,7 +559,7 @@ static void load_droid_portrait(int type) strcat(fpath, PrefixToFilename[Droidmap[type].individual_shape_nr]); strcat(fpath, "/portrait.png"); - load_image(&chat_portrait_of_droid[type], fpath, FALSE); + load_image(&chat_portrait_of_droid[type], fpath, NO_MOD); } struct image *get_droid_portrait_image(int type) @@ -607,7 +607,7 @@ struct image *get_map_label_image() static struct image img = EMPTY_IMAGE; if (!image_loaded(&img)) - load_image(&img, "level_editor_map_label_indicator.png", TRUE); + load_image(&img, "level_editor_map_label_indicator.png", USE_OFFSET); return &img; } diff --git a/src/chat.c b/src/chat.c index 3398cb9..e7fbe72 100644 --- a/src/chat.c +++ b/src/chat.c @@ -408,9 +408,9 @@ struct widget_group *create_chat_dialog() // Droid portrait // - struct image *img_frame = widget_load_image_resource("widgets/chat_portrait_frame.png", 0); - struct image *img_connector = widget_load_image_resource("widgets/chat_portrait_connector.png", 0); - struct image *img_tube = widget_load_image_resource("widgets/chat_portrait_tube.png", 0); + struct image *img_frame = widget_load_image_resource("widgets/chat_portrait_frame.png", NO_MOD); + struct image *img_connector = widget_load_image_resource("widgets/chat_portrait_connector.png", NO_MOD); + struct image *img_tube = widget_load_image_resource("widgets/chat_portrait_tube.png", NO_MOD); int chat_portrait_frame_x = 13; int chat_portrait_frame_y = 4; int chat_portrait_connector_x = chat_selector_x; @@ -523,9 +523,9 @@ struct widget_group *create_chat_dialog() WIDGET(button)->rect = b[i].rect; WIDGET(button)->update = b[i].update; - button->image[0][DEFAULT] = widget_load_image_resource(b[i].image[0], 0); - button->image[0][PRESSED] = widget_load_image_resource(b[i].image[1], 0); - button->image[1][DEFAULT] = widget_load_image_resource(b[i].image[2], 0); + button->image[0][DEFAULT] = widget_load_image_resource(b[i].image[0], NO_MOD); + button->image[0][PRESSED] = widget_load_image_resource(b[i].image[1], NO_MOD); + button->image[1][DEFAULT] = widget_load_image_resource(b[i].image[2], NO_MOD); button->activate_button = b[i].activate_button; widget_group_add(chat_menu, WIDGET(button)); diff --git a/src/defs.h b/src/defs.h index cc49ea6..395dd94 100644 --- a/src/defs.h +++ b/src/defs.h @@ -1608,6 +1608,12 @@ enum texture_type { IS_SUBTEXTURE = 1 << 2 }; +// ORed flags defining the modifications to apply when loading an image (used by load_image()) +enum load_image_mod_flags { + NO_MOD = 0, + USE_OFFSET = 1 << 1 // Use the offset file to translate the image +}; + // Draw quads borders (OpenGL only) #define DEBUG_QUAD_BORDER 0 diff --git a/src/game_ui.c b/src/game_ui.c index 9ebeb14..3cd8642 100644 --- a/src/game_ui.c +++ b/src/game_ui.c @@ -445,21 +445,21 @@ static struct widget_group *create_hud_bar() WIDGET(panel)->rect = WIDGET(hud_bar)->rect; // Fixed size tiles - struct image *img_1 = widget_load_image_resource("widgets/hud_background_1.png", 0); + struct image *img_1 = widget_load_image_resource("widgets/hud_background_1.png", NO_MOD); int left_panel_x = WIDGET(panel)->rect.x; widget_background_add(panel, img_1, left_panel_x, WIDGET(panel)->rect.y, img_1->w, img_1->h, 0); - struct image *img_3 = widget_load_image_resource("widgets/hud_background_3.png", 0); + struct image *img_3 = widget_load_image_resource("widgets/hud_background_3.png", NO_MOD); int center_panel_x = WIDGET(panel)->rect.x + (WIDGET(panel)->rect.w - img_3->w) / 2; widget_background_add(panel, img_3, center_panel_x, WIDGET(panel)->rect.y, img_3->w, img_3->h, 0); - struct image *img_5 = widget_load_image_resource("widgets/hud_background_5.png", 0); + struct image *img_5 = widget_load_image_resource("widgets/hud_background_5.png", NO_MOD); int right_panel_x = WIDGET(panel)->rect.x + WIDGET(panel)->rect.w - img_5->w; widget_background_add(panel, img_5, right_panel_x, WIDGET(panel)->rect.y, img_5->w, img_5->h, 0); // Scalable tiles. // These tiles will expand to fill the gap between the 3 fixed tiles. - struct image *img_2 = widget_load_image_resource("widgets/hud_background_2.png", 0); + struct image *img_2 = widget_load_image_resource("widgets/hud_background_2.png", NO_MOD); int left_scaling_panel_x = left_panel_x + img_1->w; int fill = center_panel_x - left_scaling_panel_x; if (fill < 0) @@ -471,7 +471,7 @@ static struct widget_group *create_hud_bar() if (fill > 0) widget_background_add(panel, img_2, left_scaling_panel_x, WIDGET(panel)->rect.y, fill, img_2->h, 0); - struct image *img_4 = widget_load_image_resource("widgets/hud_background_4.png", 0); + struct image *img_4 = widget_load_image_resource("widgets/hud_background_4.png", NO_MOD); int right_scaling_panel_x = center_panel_x + img_3->w; fill = right_panel_x - right_scaling_panel_x; if (fill < 0) @@ -604,7 +604,7 @@ static struct widget_group *create_hud_bar() for (j = 0; j < 2; j++) for (k = 0; k < 3; k++) if (b[i].image[j][k]) - wb->image[j][k] = widget_load_image_resource(b[i].image[j][k], 0); + wb->image[j][k] = widget_load_image_resource(b[i].image[j][k], NO_MOD); widget_set_rect(WIDGET(wb), b[i].rect.x, b[i].rect.y, b[i].rect.w, b[i].rect.h); diff --git a/src/graphics.c b/src/graphics.c index 8e07ad7..c695ecb 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -59,7 +59,7 @@ void blit_mouse_cursor(void) if (!loaded) { for (i = 0; i < 10; i++) { sprintf(constructed_filename, "cursors/mouse_cursor_%04d.png", i); - load_image(&mouse_cursors[i], constructed_filename, FALSE); + load_image(&mouse_cursors[i], constructed_filename, NO_MOD); } loaded = TRUE; } @@ -203,7 +203,7 @@ int do_graphical_number_selection_in_range(int lower_range, int upper_range, int StoreMenuBackground(1); if (!image_loaded(&selection_knob)) { - load_image(&selection_knob, "mouse_buttons/number_selector_selection_knob.png", FALSE); + load_image(&selection_knob, "mouse_buttons/number_selector_selection_knob.png", NO_MOD); } knob_target_rect.w = selection_knob.w; diff --git a/src/image.c b/src/image.c index 0b9531f..05c8294 100644 --- a/src/image.c +++ b/src/image.c @@ -494,7 +494,7 @@ void create_subimage(struct image *source, struct image *new_img, SDL_Rect *rect * correctly placed in an isometric image. * This function loads an image SDL surface, as well as its offset. */ -void load_image_surface(struct image *img, const char *filepath, int use_offset_file) +void load_image_surface(struct image *img, const char *filepath, int mod_flags) { if (image_loaded(img)) { error_message(__FUNCTION__, @@ -517,7 +517,7 @@ void load_image_surface(struct image *img, const char *filepath, int use_offset_ SDL_FreeSurface(surface); - if (use_offset_file) + if (mod_flags & USE_OFFSET) get_offset_for_iso_image_from_file_and_path(filepath, img); else { img->offset_x = 0; @@ -532,9 +532,8 @@ void load_image_surface(struct image *img, const char *filepath, int use_offset_ * Load an image: load the SDL surface, and make a texture from it in OpenGL mode. * \param img Pointer towards the iso_image struct to fill in * \param filename Filename of the image - * \param use_offset_file TRUE if the image uses offset information - */ -void load_image(struct image *img, const char *filename, int use_offset_file) + * \param mod_flags Modifications to apply */ +void load_image(struct image *img, const char *filename, int mod_flags) { char fpath[PATH_MAX]; @@ -544,7 +543,7 @@ void load_image(struct image *img, const char *filename, int use_offset_file) return; } - load_image_surface(img, fpath, use_offset_file); + load_image_surface(img, fpath, mod_flags); if (use_open_gl && (img->w > gl_max_texture_size || img->h > gl_max_texture_size)) { error_message(__FUNCTION__, "Your system only supports %dx%d textures. Image %s is %dx%d and therefore cannot be used as an OpenGL texture.", diff --git a/src/item_upgrades_ui.c b/src/item_upgrades_ui.c index 47fb27b..dddbe5e 100644 --- a/src/item_upgrades_ui.c +++ b/src/item_upgrades_ui.c @@ -106,7 +106,7 @@ static void load_images() for (i = 0; i < IMAGE_MAX; i++) { memset(&images[i], 0, sizeof(struct image)); - load_image(&images[i], fnames[i], FALSE); + load_image(&images[i], fnames[i], NO_MOD); } } diff --git a/src/light.c b/src/light.c index 023c807..75abd8a 100644 --- a/src/light.c +++ b/src/light.c @@ -970,7 +970,7 @@ void blit_classic_SDL_light_radius(int decay_x, int decay_y) for (i = 0; i < NUMBER_OF_SHADOW_IMAGES; i++) { sprintf(constructed_file_name, "light_radius_chunks/iso_light_radius_darkness_%04d.png", i); - load_image(&light_radius_chunk[i], constructed_file_name, FALSE); + load_image(&light_radius_chunk[i], constructed_file_name, NO_MOD); } lrc_nb_columns = (int)ceilf((float)GameConfig.screen_width / (float)(LRC_ISO_WIDTH + LRC_ISO_GAP_X)) + 1; diff --git a/src/lvledit/lvledit_display.c b/src/lvledit/lvledit_display.c index 92397ca..1708567 100644 --- a/src/lvledit/lvledit_display.c +++ b/src/lvledit/lvledit_display.c @@ -110,7 +110,7 @@ static void show_cursor(int must_zoom) // we need to load it. // if (!image_loaded(&level_editor_cursor)) { - load_image(&level_editor_cursor, "level_editor_floor_cursor.png", TRUE); + load_image(&level_editor_cursor, "level_editor_floor_cursor.png", USE_OFFSET); } float scale = must_zoom ? lvledit_zoomfact_inv() : 1.0; @@ -137,7 +137,7 @@ void draw_connection_between_tiles(float x1, float y1, float x2, float y2, int m // we need to load it. // if (!image_loaded(&level_editor_dot_cursor)) { - load_image(&level_editor_dot_cursor, "level_editor_waypoint_dot.png", TRUE); + load_image(&level_editor_dot_cursor, "level_editor_waypoint_dot.png", USE_OFFSET); } // So now that the dot cursor has been loaded, we can start to @@ -189,11 +189,11 @@ static void show_waypoints(int mask) // Maybe, if the level editor floor cursor has not yet been loaded, // we need to load it. if (!image_loaded(&level_editor_waypoint_cursor[0])) { - load_image(&level_editor_waypoint_cursor[0], "level_editor_waypoint_cursor.png", TRUE); + load_image(&level_editor_waypoint_cursor[0], "level_editor_waypoint_cursor.png", USE_OFFSET); } if (!image_loaded(&level_editor_waypoint_cursor[1])) { - load_image(&level_editor_waypoint_cursor[1], "level_editor_norand_waypoint_cursor.png", TRUE); + load_image(&level_editor_waypoint_cursor[1], "level_editor_norand_waypoint_cursor.png", USE_OFFSET); } for (i = 0; i < EditLevel()->waypoints.size; i++) { diff --git a/src/lvledit/lvledit_widgets.c b/src/lvledit/lvledit_widgets.c index b70ff0b..22c446c 100644 --- a/src/lvledit/lvledit_widgets.c +++ b/src/lvledit/lvledit_widgets.c @@ -633,9 +633,9 @@ struct widget_group *get_lvledit_ui() // Buttons use 3 images for each toggle state. Radio buttons have two toggle states. for (j = 0; j < b[i].number_of_toggle_states; j++) { // AllMousePressButtons have only two images: normal and pressed. Hovered state will be ignored. - button->image[j][0] = widget_load_image_resource(AllMousePressButtons[b[i].btn_index + j * 2].button_image_file_name, 0); // Normal state + button->image[j][0] = widget_load_image_resource(AllMousePressButtons[b[i].btn_index + j * 2].button_image_file_name, NO_MOD); // Normal state button->image[j][1] = NULL; // Hovered state - button->image[j][2] = widget_load_image_resource(AllMousePressButtons[b[i].btn_index + j * 2 + 1].button_image_file_name, 0); // Pressed state + button->image[j][2] = widget_load_image_resource(AllMousePressButtons[b[i].btn_index + j * 2 + 1].button_image_file_name, NO_MOD); // Pressed state } // Set button size. diff --git a/src/misc.c b/src/misc.c index 16e9202..3a27cb1 100644 --- a/src/misc.c +++ b/src/misc.c @@ -603,7 +603,7 @@ void ShowGenericButtonFromList(int ButtonIndex) // Load button image if required struct image *img = &btn->button_image; if (!image_loaded(img)) { - load_image(img, btn->button_image_file_name, FALSE); + load_image(img, btn->button_image_file_name, NO_MOD); // Maybe we had '0' entries for the height or width of this button in the list. // This means that we will take the real width and the real height from the image diff --git a/src/open_gl.c b/src/open_gl.c index ecd94a8..66c317c 100644 --- a/src/open_gl.c +++ b/src/open_gl.c @@ -704,7 +704,7 @@ void blit_background(const char *background) if (!image_loaded(&bg->img)) { char path[2048]; sprintf(path, "backgrounds/%s", bg->filename); - load_image(&bg->img, path, FALSE); + load_image(&bg->img, path, NO_MOD); } diff --git a/src/open_gl_atlas.c b/src/open_gl_atlas.c index 174175d..05e688f 100644 --- a/src/open_gl_atlas.c +++ b/src/open_gl_atlas.c @@ -85,7 +85,7 @@ int load_texture_atlas(const char *atlas_name, const char *directory, struct ima // Load the atlas in memory struct image atlas_img = EMPTY_IMAGE; - load_image(&atlas_img, atlas_path, FALSE); + load_image(&atlas_img, atlas_path, NO_MOD); while (*dat && *dat != '*') { // Read each element in the atlas diff --git a/src/quest_browser_ui.c b/src/quest_browser_ui.c index 4c0de14..55ff08b 100644 --- a/src/quest_browser_ui.c +++ b/src/quest_browser_ui.c @@ -625,7 +625,7 @@ struct widget_group *create_quest_browser() int exit_button_arm_y = quest_browser_y + quest_browser_h - 183; struct widget_background *exit_button = widget_background_create(); - struct image *img = widget_load_image_resource("widgets/exit_button_background.png", 0); + struct image *img = widget_load_image_resource("widgets/exit_button_background.png", NO_MOD); widget_set_rect(WIDGET(exit_button), right_side_buttons_x - 5, exit_button_arm_y, img->w, img->h); widget_background_add(exit_button, img, WIDGET(exit_button)->rect.x, WIDGET(exit_button)->rect.y, img->w, img->h, 0); widget_group_add(quest_browser, WIDGET(exit_button)); @@ -684,9 +684,9 @@ struct widget_group *create_quest_browser() for (i = 0; i < sizeof(b) / sizeof(b[0]); i++) { struct widget_button *button = widget_button_create(); - button->image[0][DEFAULT] = widget_load_image_resource(b[i].image[0], 0); - button->image[0][PRESSED] = widget_load_image_resource(b[i].image[1], 0); - button->image[1][DEFAULT] = widget_load_image_resource(b[i].image[2], 0); + button->image[0][DEFAULT] = widget_load_image_resource(b[i].image[0], NO_MOD); + button->image[0][PRESSED] = widget_load_image_resource(b[i].image[1], NO_MOD); + button->image[1][DEFAULT] = widget_load_image_resource(b[i].image[2], NO_MOD); WIDGET(button)->rect = b[i].rect; button->activate_button = b[i].activate_button; diff --git a/src/shop.c b/src/shop.c index a288011..e62f9e8 100644 --- a/src/shop.c +++ b/src/shop.c @@ -167,7 +167,7 @@ void ShowRescaledItem(int position, int TuxItemRow, item * ShowItem) static struct image equipped_icon; if (!image_loaded(&equipped_icon)) { - load_image(&equipped_icon, "cursors/mouse_cursor_0003.png", FALSE); + load_image(&equipped_icon, "cursors/mouse_cursor_0003.png", NO_MOD); } TuxItemRowRect.x = 55 * GameConfig.screen_width / 640; @@ -240,7 +240,7 @@ void ShowItemPicture(int PosX, int PosY, int Number) // Look for the next file if (find_file(ConstructedFileName, GRAPHICS_DIR, fpath, SILENT)) { - load_image(&item_rotation_img[i], ConstructedFileName, FALSE); + load_image(&item_rotation_img[i], ConstructedFileName, NO_MOD); } else { NumberOfImagesInThisRotation = i; diff --git a/src/skills.c b/src/skills.c index a1e6aa2..f0f6c4f 100644 --- a/src/skills.c +++ b/src/skills.c @@ -703,7 +703,7 @@ void load_skill_icon_if_needed(spell_skill_spec *spec) if (!image_loaded(&spec->icon_surface)) { char filename[1000]; sprintf(filename, "skill_icons/%s", spec->icon_name); - load_image(&spec->icon_surface, filename, FALSE); + load_image(&spec->icon_surface, filename, NO_MOD); } } @@ -722,7 +722,7 @@ static void load_skill_level_images_if_needed(void) return; // Load the image - load_image(&img, SKILL_LEVEL_BUTTON_FILE, FALSE); + load_image(&img, SKILL_LEVEL_BUTTON_FILE, NO_MOD); // Create the subimages for (i = 0; i < NUMBER_OF_SKILL_PAGES; i++) { diff --git a/src/takeover.c b/src/takeover.c index 2486fe6..5299230 100644 --- a/src/takeover.c +++ b/src/takeover.c @@ -161,7 +161,7 @@ static void show_droid_picture(int PosX, int PosY, int type) sprintf(filename, "droids/%s/portrait_%04d.jpg", Droidmap[type].droid_portrait_rotation_series_prefix, i + 1); - load_image(&droid_images[i], filename, FALSE); + load_image(&droid_images[i], filename, NO_MOD); } strcpy(LastImageSeriesPrefix, Droidmap[type].droid_portrait_rotation_series_prefix); @@ -771,7 +771,7 @@ static void GetTakeoverGraphics(void) if (TakeoverGraphicsAreAlreadyLoaded) return; - load_image(&img, TO_BLOCK_FILE, FALSE); + load_image(&img, TO_BLOCK_FILE, NO_MOD); // Get the fill-blocks for (i = 0; i < NUM_FILL_BLOCKS; i++, curx += FILL_BLOCK_LEN + 2) { @@ -932,7 +932,7 @@ static void ShowPlayground(enemy * target) static struct image bg; if (!image_loaded(&bg)) { - load_image(&bg, "backgrounds/takeover_console.png", FALSE); + load_image(&bg, "backgrounds/takeover_console.png", NO_MOD); } display_image_on_screen(&bg, GameConfig.screen_width / 2 - 340, GameConfig.screen_height / 2 - 294, IMAGE_NO_TRANSFO); diff --git a/src/widgets/widget_background.c b/src/widgets/widget_background.c index 6d79f3d..13f8612 100644 --- a/src/widgets/widget_background.c +++ b/src/widgets/widget_background.c @@ -163,7 +163,7 @@ void widget_background_load_3x3_tiles(struct widget_background *panel, char *bas for (j = 0; j < 3; j++) { sprintf(file,"%s_%i_%i.png", base_name, i, j); - tile[i][j].image = widget_load_image_resource(file, 0); + tile[i][j].image = widget_load_image_resource(file, NO_MOD); } } int width = tile[0][0].image->w + tile[1][1].image->w + tile[2][2].image->w; diff --git a/src/widgets/widgets.c b/src/widgets/widgets.c index 2834939..b8cb5c0 100644 --- a/src/widgets/widgets.c +++ b/src/widgets/widgets.c @@ -63,7 +63,7 @@ LIST_HEAD(image_resource_list); * the image_resource_list, then the already loaded image is returned. * Else, the image is loaded from disk, and stored in \e image_resource_list. */ -struct image *widget_load_image_resource(char *name, int use_offset_file) +struct image *widget_load_image_resource(char *name, int mod_flags) { struct image_resource *res; @@ -79,7 +79,7 @@ struct image *widget_load_image_resource(char *name, int use_offset_file) // Image not found, allocate memory and load it from its file. res = MyMalloc(sizeof(struct image_resource)); res->name = strdup(name); - load_image(&res->img, res->name, use_offset_file); + load_image(&res->img, res->name, mod_flags); list_add(&res->node, &image_resource_list); return &res->img; } http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=dd75794baf48f0f3fed92a709b783ed2de4e8e02 commit dd75794baf48f0f3fed92a709b783ed2de4e8e02 Author: fluzz <fl...@gm...> Date: Wed Jul 15 20:01:47 2015 +0200 Add find_suffixed_file() This function adds a suffix to a filename (before the file name extension), and then calls the standard find_file() to find it. diff --git a/src/misc.c b/src/misc.c index 3a27cb1..321fc53 100644 --- a/src/misc.c +++ b/src/misc.c @@ -692,7 +692,7 @@ static int _file_exists(const char *fname, const char *subdir, char *file_path) if (nb >= PATH_MAX) { *file_path = 0; error_message(__FUNCTION__, "Pathname too long (max is %d): %s/%s", - NO_REPORT, PATH_MAX, subdir, fname); + NO_REPORT, PATH_MAX, subdir, fname); return 0; } @@ -731,6 +731,42 @@ int find_file(const char *fname, int subdir_handle, char *file_path, int error_r } /* ----------------------------------------------------------------- + * Find a suffixed filename in subdir (using a data_dir handle). + * + * The 'suffix' is added before the filename extension. + * + * fills in the (ALLOC'd) string and returns 1 if okay, 0 on error. + * file_path's length HAS to be PATH_MAX. + * ----------------------------------------------------------------- */ +int find_suffixed_file(const char *fname, const char *suffix, int subdir_handle, char *file_path, int error_report) +{ + char suffixed_fname[PATH_MAX]; + char *actual_fname = (char *)fname; + + if (suffix) { + int fname_length = strlen(fname); + int suffix_length = strlen(suffix); + if ((fname_length + suffix_length + 1) >= PATH_MAX) { + *file_path = 0; + error_message(__FUNCTION__, "Filename + suffix too long (max is %d): %s, with suffix: %s", + PLEASE_INFORM, PATH_MAX, fname, suffix); + return 0; + } + + int pos = strrchr(fname, '.') - fname; + + memcpy(suffixed_fname, fname, pos); + memcpy(suffixed_fname + pos, suffix, suffix_length); + memcpy(suffixed_fname + pos + suffix_length, fname + pos, fname_length - pos + 1); + suffixed_fname[fname_length + suffix_length] = '\0'; + + actual_fname = suffixed_fname; + } + + return find_file(actual_fname, subdir_handle, file_path, error_report); +} + +/* ----------------------------------------------------------------- * Find a localized version of a filename in subdir (using a data_dir handle). * * The localized versions are to be put in subdirs, using locale names. diff --git a/src/proto.h b/src/proto.h index 406dad3..2ba3174 100644 --- a/src/proto.h +++ b/src/proto.h @@ -579,6 +579,7 @@ int MouseCursorIsOnButton(int ButtonIndex, int x, int y); void *MyMemmem(char *haystack, size_t haystacklen, char *needle, size_t needlelen); int init_data_dirs_path(); int find_file(const char *, int, char *, int); +int find_suffixed_file(const char *, const char *, int, char *, int); int find_localized_file(const char *, int, char *, int); int find_encoded_file(const char *, int, char *, int); void Pause(void); http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=b97a4535d3e6c1d97561f1c847af3eb3085db94f commit b97a4535d3e6c1d97561f1c847af3eb3085db94f Author: fluzz <fl...@gm...> Date: Wed Jul 15 22:25:44 2015 +0200 Add USE_WIDE flag, to instruct load_image() to try to load the wide version of an image. diff --git a/src/defs.h b/src/defs.h index 395dd94..b8f58a3 100644 --- a/src/defs.h +++ b/src/defs.h @@ -1611,7 +1611,8 @@ enum texture_type { // ORed flags defining the modifications to apply when loading an image (used by load_image()) enum load_image_mod_flags { NO_MOD = 0, - USE_OFFSET = 1 << 1 // Use the offset file to translate the image + USE_OFFSET = 1 << 1, // Use the offset file to translate the image + USE_WIDE = 1 << 2 // Use the wide version of the file (if it exists) }; // Draw quads borders (OpenGL only) diff --git a/src/image.c b/src/image.c index 05c8294..936b08e 100644 --- a/src/image.c +++ b/src/image.c @@ -537,12 +537,24 @@ void load_image(struct image *img, const char *filename, int mod_flags) { char fpath[PATH_MAX]; + if (mod_flags & USE_WIDE) { + int need_wide_version = (GameConfig.screen_width / (float)GameConfig.screen_height) >= ((16/9.0 + 4/3.0) / 2.0); + if (need_wide_version) { + // Try to load the wide version + if (find_suffixed_file(filename, "_wide", GRAPHICS_DIR, fpath, SILENT)) + goto IMAGE_FILE_FOUND; + } + } + + // Try to load the narrow version if (!find_file(filename, GRAPHICS_DIR, fpath, PLEASE_INFORM)) { struct image empty = EMPTY_IMAGE; *img = empty; return; } +IMAGE_FILE_FOUND: + load_image_surface(img, fpath, mod_flags); if (use_open_gl && (img->w > gl_max_texture_size || img->h > gl_max_texture_size)) { http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=9aaa34efc8d8ef6910bb0e399609bb14ca26d4b4 commit 9aaa34efc8d8ef6910bb0e399609bb14ca26d4b4 Author: fluzz <fl...@gm...> Date: Wed Jul 15 22:29:27 2015 +0200 Load the wide version of a background image, if available and if the screen ratio calls for it. Else, load the standard narrow image. diff --git a/src/open_gl.c b/src/open_gl.c index 66c317c..887260e 100644 --- a/src/open_gl.c +++ b/src/open_gl.c @@ -704,7 +704,7 @@ void blit_background(const char *background) if (!image_loaded(&bg->img)) { char path[2048]; sprintf(path, "backgrounds/%s", bg->filename); - load_image(&bg->img, path, NO_MOD); + load_image(&bg->img, path, USE_WIDE); } @@ -715,7 +715,7 @@ void blit_background(const char *background) float scalex = 1.0, scaley = 1.0; if (bg->must_scale) { scalex = (float)GameConfig.screen_width / bg->img.w; - scaley = (float)GameConfig.screen_height / (bg->img.w * 3 / 4); + scaley = (float)GameConfig.screen_height / bg->img.h; } x *= scalex; ----------------------------------------------------------------------- Summary of changes: src/BFont.c | 2 +- src/automap.c | 2 +- src/blocks.c | 12 +++++----- src/chat.c | 12 +++++----- src/defs.h | 7 ++++++ src/game_ui.c | 12 +++++----- src/graphics.c | 4 +- src/image.c | 23 ++++++++++++++++----- src/item_upgrades_ui.c | 2 +- src/light.c | 2 +- src/lvledit/lvledit_display.c | 8 +++--- src/lvledit/lvledit_widgets.c | 4 +- src/misc.c | 40 +++++++++++++++++++++++++++++++++++++- src/open_gl.c | 4 +- src/open_gl_atlas.c | 2 +- src/proto.h | 1 + src/quest_browser_ui.c | 8 +++--- src/shop.c | 4 +- src/skills.c | 4 +- src/takeover.c | 6 ++-- src/widgets/widget_background.c | 2 +- src/widgets/widgets.c | 4 +- 22 files changed, 110 insertions(+), 55 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-15 13:26:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via f044071db0add203616f0db101a09be5febedaf3 (commit) from 44589be893b6a20da72c05a261c865b6e0d6ce22 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=f044071db0add203616f0db101a09be5febedaf3 commit f044071db0add203616f0db101a09be5febedaf3 Author: Matthias Krüger <mat...@fa...> Date: Wed Jul 15 15:25:24 2015 +0200 [lvledit] fix wrong zoom settings when removing map and validating Fix issue799 diff --git a/src/lvledit/lvledit_validator.c b/src/lvledit/lvledit_validator.c index cfdf8fa..45fb19c 100644 --- a/src/lvledit/lvledit_validator.c +++ b/src/lvledit/lvledit_validator.c @@ -1533,6 +1533,8 @@ static void lvlval_map_labels_execute(struct level_validator *this, struct lvlva int level_validation() { + game_status = INSIDE_MENU; + enum validator_return_code final_rc = VALIDATION_PASS; int uncaught_excpt = FALSE; @@ -1646,6 +1648,8 @@ int level_validation() // Hack: eat all pending events. input_handle(); + game_status = INSIDE_LVLEDITOR; + return (final_rc != VALIDATION_PASS); } ----------------------------------------------------------------------- Summary of changes: src/lvledit/lvledit_validator.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-15 13:04:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 44589be893b6a20da72c05a261c865b6e0d6ce22 (commit) from 2f60d45829e3afb2492519e4e6c048d8919a3983 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=44589be893b6a20da72c05a261c865b6e0d6ce22 commit 44589be893b6a20da72c05a261c865b6e0d6ce22 Author: Matthias Krüger <mat...@fa...> Date: Wed Jul 15 15:03:04 2015 +0200 [lvleditor] Don't spam beautify-grass stuff into stdout diff --git a/src/lvledit/lvledit_beautify_actions.c b/src/lvledit/lvledit_beautify_actions.c index 586b6ea..de574a0 100644 --- a/src/lvledit/lvledit_beautify_actions.c +++ b/src/lvledit/lvledit_beautify_actions.c @@ -426,7 +426,6 @@ static void fix_isolated_grass_tile(level * EditLevel, int x, int y) west_grass = TRUE; if (!north_grass && !south_grass && !east_grass && !west_grass) { - DebugPrintf(-4, "\nFixed an isolated grass tile."); our_rand = MyRandom(100); if (our_rand < 33) change_transparent_floor(EditLevel, x, y, ISO_OVERLAY_GRASS_17, ISO_FLOOR_SAND); @@ -460,8 +459,6 @@ void level_editor_beautify_grass_tiles(level * EditLevel) yend = start.y + len.y; } - DebugPrintf(-4, "\nlevel_editor_beautify_grass_tiles (...): process started..."); - // Make sure the level has multilayer floor if (EditLevel->floor_layers == 1) EditLevel->floor_layers++; @@ -474,7 +471,6 @@ void level_editor_beautify_grass_tiles(level * EditLevel) if (is_full_grass_tile(this_tile_value)) { fix_corners_in_this_grass_tile(EditLevel, x, y); - DebugPrintf(1, "\nlevel_editor_beautify_grass_tiles (...): found a grass tile."); } } } @@ -487,7 +483,6 @@ void level_editor_beautify_grass_tiles(level * EditLevel) if (is_full_grass_tile(this_tile_value)) { fix_anticorners_in_this_grass_tile(EditLevel, x, y); - DebugPrintf(1, "\nlevel_editor_beautify_grass_tiles (...): found a grass tile."); } } } @@ -500,7 +495,6 @@ void level_editor_beautify_grass_tiles(level * EditLevel) if (is_full_grass_tile(this_tile_value)) { fix_halfpieces_in_this_grass_tile(EditLevel, x, y); - DebugPrintf(1, "\nlevel_editor_beautify_grass_tiles (...): found a grass tile."); } } } @@ -539,7 +533,6 @@ void level_editor_beautify_grass_tiles(level * EditLevel) if (is_full_grass_tile(this_tile_value)) { fix_isolated_grass_tile(EditLevel, x, y); - DebugPrintf(1, "\nlevel_editor_beautify_grass_tiles (...): found a grass tile."); } } } ----------------------------------------------------------------------- Summary of changes: src/lvledit/lvledit_beautify_actions.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-15 12:44:54
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 2f60d45829e3afb2492519e4e6c048d8919a3983 (commit) from 6c0d2b7909628ad6e88c710cb8b371a46045bd55 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=2f60d45829e3afb2492519e4e6c048d8919a3983 commit 2f60d45829e3afb2492519e4e6c048d8919a3983 Author: fluzz <fl...@gm...> Date: Wed Jul 15 14:43:06 2015 +0200 Do not remove the AppData XML file on 'make clean'. This was a wrong copy-paste from an example on how to integrate the AddData file into autotools. diff --git a/Makefile.am b/Makefile.am index 840589d..733330b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,7 +29,6 @@ man_MANS = freedroidRPG.6 freedroid_data = map graphics sound dialogs lua_modules EXTRA_DIST = m4 $(man_MANS) $(freedroid_data) HELP_WANTED INSTALL.generic -CLEANFILES = CHECKFLAGS=env SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy @@ -69,7 +68,6 @@ appstreamdir = $(datarootdir)/appdata appstream_in_files = pkgs/freedesktop/freedroidrpg.appdata.xml appstream_DATA = $(appstream_in_files) EXTRA_DIST += $(appstream_in_files) -CLEANFILES += $(appstream_DATA) ## Win32 specific stuff follows here ----------------------------------------------------------------------- Summary of changes: Makefile.am | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-15 11:22:09
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 6c0d2b7909628ad6e88c710cb8b371a46045bd55 (commit) from d4d6f17a1a93c77541fc91845ac3206fde114543 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=6c0d2b7909628ad6e88c710cb8b371a46045bd55 commit 6c0d2b7909628ad6e88c710cb8b371a46045bd55 Author: fluzz <fl...@gm...> Date: Wed Jul 15 13:17:11 2015 +0200 Add AppData XML file, used by Freedesktop compliant Software Centers to display informations about the game. Proposed by zdenek. diff --git a/Makefile.am b/Makefile.am index 0368ad1..840589d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,6 +29,7 @@ man_MANS = freedroidRPG.6 freedroid_data = map graphics sound dialogs lua_modules EXTRA_DIST = m4 $(man_MANS) $(freedroid_data) HELP_WANTED INSTALL.generic +CLEANFILES = CHECKFLAGS=env SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy @@ -62,6 +63,14 @@ sign: gpg --digest-algo SHA512 -o freedroidrpg-$(VERSION).tar.bz2.sig --detach-sign freedroidrpg-$(VERSION).tar.bz2 md5sum freedroidrpg-$(VERSION).tar.bz2 > freedroidrpg-$(VERSION).tar.bz2.md5 +# For Freedesktop compliant Software Centers + +appstreamdir = $(datarootdir)/appdata +appstream_in_files = pkgs/freedesktop/freedroidrpg.appdata.xml +appstream_DATA = $(appstream_in_files) +EXTRA_DIST += $(appstream_in_files) +CLEANFILES += $(appstream_DATA) + ## Win32 specific stuff follows here win_txts = COPYING AUTHORS README ChangeLog diff --git a/pkgs/freedesktop/freedroidrpg.appdata.xml b/pkgs/freedesktop/freedroidrpg.appdata.xml new file mode 100644 index 0000000..fa697ef --- /dev/null +++ b/pkgs/freedesktop/freedroidrpg.appdata.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<application> + <id type="desktop">freedroidRPG.desktop</id> + <metadata_license>CC0-1.0</metadata_license> + <project_license>GPL-2.0+</project_license> + <name>FreedroidRPG</name> + <summary>Isometric 3D RPG similar to game Diablo</summary> + <description> + <p> + FreedroidRPG is an original isometric 3D role playing game + taking place in the future, on Earth. It features action and + dialogs. + </p> + <p> + The game tells the story of a world destroyed by a conflict between + robots and their human masters. Play as Tux in a quest to save the + world from the murderous rebel bots who know no mercy. You get to + choose which path you wish to follow, and freedom of choice is + everywhere in the game. + </p> + <p> + FreedroidRPG features a real time combat system with melee and + ranged weapons, fairly similar to the proprietary game Diablo. + There is an innovative system of programs that can be run in order + to take control of enemy robots, alter their behavior, or improve one's + characteristics. You can use over 50 different kinds of items and + fight countless enemies on your way to your destiny. An advanced + dialog system provides story background and immersive role + playing situations. + </p> + <p> + The game is complete, fully playable, and can provide about + 12 hours of fun. It is still being actively developed, and + help is welcome in many areas. People having - or trying to acquire - + programming, map editing, or writing skills will find FreedroidRPG + to be an exciting, fast-moving project in which they can fully + express their creativity. + </p> + </description> + <icon>http://www.freedroid.org/imgs/logo.png</icon> + <categories> + <category>Role Playing</category> + <category>Games</category> + </categories> + <keywords> + <keyword>RPG</keyword> + </keywords> + <screenshots> + <screenshot type="default">http://www.freedroid.org/imgs/screenshot.jpg</screenshot> + </screenshots> + <url type="homepage">http://www.freedroid.org/</url> +</application> ----------------------------------------------------------------------- Summary of changes: Makefile.am | 9 +++++ pkgs/freedesktop/freedroidrpg.appdata.xml | 52 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 0 deletions(-) create mode 100644 pkgs/freedesktop/freedroidrpg.appdata.xml hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-15 09:52:14
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via d4d6f17a1a93c77541fc91845ac3206fde114543 (commit) from b78ab84fb0d4ac6ec44ac91f2b9fcfe6f5a53483 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=d4d6f17a1a93c77541fc91845ac3206fde114543 commit d4d6f17a1a93c77541fc91845ac3206fde114543 Author: Scott Furry <sco...@gm...> Date: Wed Jul 15 11:50:55 2015 +0200 Expanding DOxygen Docs - command line parameters and cheat codes. FDRPG. Documenting both command line paramaters and cheat codes available. diff --git a/doc/tools/cmdlineref.md b/doc/tools/cmdlineref.md new file mode 100644 index 0000000..c9b31c0 --- /dev/null +++ b/doc/tools/cmdlineref.md @@ -0,0 +1,128 @@ +Freedroid Command Line Arguments {#cmdlineref} +================================ +\tableofcontents + +Game Play and Informational Options {#normalstart} +=================================== +<em>see the function [ParseCommandLine](../init_8c.html) for details</em>\n +\n +Command line options and switches shown below will result in either\n + 1) Game information returned on the command line then exit, or\n + 2) Freedroid RPG to start-up with a defined state.\n +\n +Unless stated otherwise, game setting changes are saved to user preferences and are persistent between game restarts.\n +If switches are stated as being mutally exclusive, and more than one is used, only the last instanced is honoured at game start.\n +\n + + freedroidRPG [-h | --help] + [-v | --version] + [-e | --editor] + [-s | --sound] [-q | --nosound] + [-o | --open_gl] [-n | --no_open_gl] + [-f | --fullscreen] [-w | --window] + [-t isocode | --system_lang=isocode] + [-l character-name | --load=character-name] + [-r Y | --resolution=Y] + [-r HxV | --resolution=HxV] + [-d X | --debug=X] + +\n +<strong>[-h | --help]</strong>\n +Show help message for freedroidRPG game and exit to command prompt.\n +\n +<strong>[-v | --version]</strong>\n +Print Freedroid RPG version, brief GNU GPL statement and exit to command prompt.\n +\n +<strong>[-e | --editor]</strong>\n +Starts Freedroid RPG in the level editor at the last selected level.\n +If level has not been set previously, default level selected will be the Cryo Stasis Lab (level 12).\n +\n +<strong>[-s | --sound]</strong>\n +<strong>[-q | --nosound]</strong>\n +Mutally exclusive switches to start Freedroid RPG with sound setting either enabled or disabled.\n +\n +<strong>[-o | --open_gl]</strong>\n +<strong>[-n | --no_open_gl]</strong>\n +Mutally exclusive option to start Freedroid RPG with Open GL graphic output setting either enabled or disabled.\n +\n +<strong>[-f | --fullscreen]</strong>\n +<strong>[-w | --window]</strong>\n +Mutally exclusive option to start Freedroid RPG either in a window or fullscreen display.\n +\n +<strong>[-t *isocode* | --system_lang=<em>isocode</em>]</strong>\n +Freedroid RPG will start and attempt to use the language identified by *isocode* during game play.\n +See __setlocale__ man page for details. The language specified by the user must be available on the system.\n +If Freedroid RPG cannot find the requested language, it will revert to the system default for game play.\n +\n +<strong>[-l *character-name* | --load=<em>character-name</em>]</strong>\n +Freedroid RPG game will start normally and attempt to load a previously saved game for *character-name*\n +If the *character-name* saved game cannot be loaded, Freedroid RPG will display a warning and revert to the main menu.\n +\n +<strong>[-r *Y* | --resolution=<em>Y</em>]</strong>\n +<strong>[-r *HxV* | --resolution=<em>HxV</em>]</strong>\n +Start Freedroid RPG using the selected video resolution.\n +*Y* is an integer value starting ranging from 0(indicating 640x480 display) to as many supported resolutions. +Using *99* as a value for *Y* will cause Freedroid RPG to print all available supported resolutions and exit to command line. +On first usage, the game will use default resolution 0.\n +\n +A specific resolution value can be used and must be of the form WxH (eg. 1400x900). +The choosen custom resolution value will not appear in the options menu resolution screen.\n +\n +Resolution value can be used for both full screen and windowed display. +Some graphics (e.g. main screen) may appear stretched due to images being developed based on an assumed screen dimensions. +If Freedroid RPG is started in windowed mode with a specific resolution, the window will be sized to the dimensions given.\n +\n +Resolution can be changed from the game options menu, but a restart is required for the settings to take effect.\n + Display resolution is stored in the settings file and recalled on each game start.\n +\n +<strong>[-d *X* | --debug=<em>X</em>]</strong>\n +Option will set verbosity of debug ouput the game will produce in the console during execution. +*X* is an integer value ranging from 1(default value) to 5. +Debug verbosity is not persistent between restarts as it is not stored in game settings file.\n +\n + +Benchmark and Self-Testing Options {#testingstart} +================================== +<em>see the function [benchmark](../benchmark_8c.html) for details</em>\n +\n +The benchmark switch (-b) is utilized for game development and testing.\n +Each option for benchmark performs a testing function of game mechanics on the local system and returns a result to the console.\n +\n +For all tests listed below, Freedroid RPG will start, initialize, execute the designated test(s) and return to the command prompt. +Indication will be given of testing success/fail and elapsed testing time.\n +\n + + freedroidRPG [-b | --benchmark {text | dialog | loadship | loadgame | savegame | dynarray | mapgen | leveltest} ] + +\n +<strong>freedroidRPG -b text</strong>\n +Code will be executed to test whether a string can be rendered using a designated game font.\n +\n +<strong>freedroidRPG -b dialog</strong>\n +All lua-based dialog files are parsed and validated.\n +Files are each parsed for "node" values to ensure dialog continuity and no broken code is present. +During parsing of each dialog file, the name of the file as well as each node name found are printed to the console. +On completion of file parsing a success/fail status is returned. Parsing continues with the next dialog file. +See [Dialog Designer Manual](../manual/dialog.html) for details on dialog file structure.\n +\n +<strong>freedroidRPG -b loadship</strong>\n +Instructs game logic to load the "levels.dat" file. Benchmarking involves 10 file load cycles\n +Loading will execute all the logic needed to insure file is parsable and no errors in game logic occurred.\n +\n +<strong>freedroidRPG -b loadgame</strong>\n +Saved game loading performance test.\n +\n +<strong>freedroidRPG -b savegame</strong>\n +Save game writing performance test.\n +\n +<strong>freedroidRPG -b dynarray</strong>\n +Execute game code to allocate memory, create dynamic arrays, deallocate and release memory.\n +\n +<strong>freedroidRPG -b mapgen</strong>\n +Benchmark testing for creating a temporary *ship* with random levels.\n +\n +<strong>freedroidRPG -b leveltest</strong>\n +Instructs game logic to load the "levels.dat" file. Only one file load cycle is executed\n +Loading will execute all the logic needed to insure file is parsable and no errors in game logic occurred.\n +\n +\n diff --git a/doc/tools/index.md b/doc/tools/index.md index 42e4677..9a3d7d0 100644 --- a/doc/tools/index.md +++ b/doc/tools/index.md @@ -6,4 +6,6 @@ developers and/or maintainers to support debug and development activities of Fre The following Tools manuals are available: +- [Freedroid Command Line Arguments](@ref cmdlineref) - [Freedroid Dialog Node Mapper Tool](@ref fddnm) +- [Freedroid Play Testing and Cheats](@ref playcheat) diff --git a/doc/tools/playcheat.md b/doc/tools/playcheat.md new file mode 100644 index 0000000..f4a9bf3 --- /dev/null +++ b/doc/tools/playcheat.md @@ -0,0 +1,163 @@ +Freedroid Play Testing and Cheats {#playcheat} +================================= +\tableofcontents + + +Purpose {#ptPurpose} +======= +In a large multi-level game, playing sequentially through the game itself is very time consuming and tedious. +Development and debugging practices would be degraded with the need to save every game state or playing through to test a minor change. +Freedroid RPG has several means to alter game and player states in order to improve testing/debugging.\n +\n +While described as "cheats", altering the game and player states is not meant to be used during normal game play. +Cheat options will only be effective when no other game dialogs or menus are on screen. +Character information dialogs (i.e. Spells, Character Data, Inventory) on screen does not prevent cheat code functions.\n +\n +Keys to press to active the desired cheat function are denoted between square braces (i.e. <em>[</em> and <em>]</em>). +Codes involving multiple keys require all keys to be pressed. +Sequence and timing of keypresses are not factors, but all keys must be pressed before releasing keys. +Some cheat codes call for a specific "handedness" of keypresses. +In these instances, <em>[LEFT xxxx]</em> and <em>[RIGHT xxxx]</em> keys are not equivalent.\n +\n +Cheat Menu Options {#ptMenuOptions} +====================== +The main "cheat" menu is accessed by the keystrokes +<strong>[LEFT CTRL][LEFT ALT][LEFT SHIFT][C]</strong>.\n +The game will be paused and a screen showing current states will be presented.\n +Key presses to alter cheat options will be enabled.\n +\n +<strong>[f]</strong>\n +Give player xray vision (see through walls). (Default:OFF)\n +\n +<strong>[g]</strong>\n +"God Mode" - Player is invincible. (Default:OFF)\n +\n +<strong>[i]</strong>\n +Player is invisible (no-time-limit invisibility). (Default:OFF)\n +\n +<strong>[l]</strong>\n +<em>L</em>ist all NPC's on the current level.\n +\n +<strong>[L]</strong> <em>(note case - same as [SHIFT][l] )</em>\n +List all NPC's alive on the current level.\n +\n +<strong>[k]</strong>\n +List all NPC's killed on the current level.\n +\n +<strong>[d]</strong>\n +Destroy all NPC's (both droids and interactive characters) on the current level.\n +\n +<strong>[h]</strong>\n +Acquire one level of all spells available in game.\n +If spell already acquired, increment skill level of that spell by one.\n +\n +<strong>[c]</strong>\n +Player acquires 1 million circuits.\n +Line also displays current amount of circuits in possession.\n +\n +<strong>[n]</strong>\n +Alter game mechanics to enble hidden droids.\n +Default is to allow droid invisibility (No Hidden Droids: OFF).\n +\n +<strong>[r]</strong>\n +Unlimited running stamina.\n +Normal in-game effects of running for the player are ignored.\n +\n +<strong>[s]</strong>\n +Player is able to run twice as fast. (Default:OFF)\n +\n +<strong>[t]</strong>\n +The penultimate weapon! A Cheat Gun! +This two-handed weapon has excessive druability and does incredible damage with each shot.\n +Cheat Gun enables player to **blast** through any/all droid obstacles with little effort. +<em>(Okay...its fun, too. What's your point?)</em>\n +\n +<strong>[x]</strong>\n +Enable cheat keys (Default: ON).\n +Cheat keys setting will only take affect after the Cheat Menu has been first presented.\n +\n +<strong>[T]</strong> <em>(note case - same as [SHIFT][t] )</em>\n +Player acquires one training point.\n +Line also displays current number training points available to be distributed.\n +\n +<strong>[e]</strong>\n +Control the display of enemy state information (e.g. patrol, attack, etc). (Default: OFF)\n +\n +<strong>[q]</strong>\n +Exit cheat menu and resumes game.\n +\n +\n +In-Game Cheats {#ptOtherOptions} +============== +Once enabled from the Cheat Menu, the key strokes shown below will be available.\n +\n +<strong>NOTE: </strong>Number keys (such as <em>[1]</em>, etc) is not the same as a Keypad number key. +If a keypad is not available on the users keyboard, these cheats cannot be activated.\n +\n +<strong>[Keypad 1]</strong>\n +Add 1000 experience points to player total.\n +\n +<strong>[Keypad 2]</strong>\n +Double player total experience points.\n +\n +<strong>[Keypad 7]</strong>\n +Increment player <em>Melee</em> skill (hand-to-hand fighting ability).\n +\n +<strong>[Keypad 4]</strong>\n +Decrement player <em>Melee</em> skill.\n +\n +<strong>[Keypad 8]</strong>\n +Increment player <em>Range</em> skill (shooting ability).\n +\n +<strong>[Keypad 5]</strong>\n +Decrement player <em>Range</em> skill.\n +\n +<strong>[Keypad 9]</strong>\n +Increment player <em>Programming</em> skill.\n +\n +<strong>[Keypad 6]</strong>\n +Decrement player <em>Programming</em> skill.\n +\n +<strong>[RIGHT CTRL][r]</strong>\n +Increment player <em>Repair</em> spell ability level.\n +\n +<strong>[RIGHT CTRL][RIGHT SHIFT][r]</strong>\n +Decrement player <em>Repair</em> spell ability level.\n +\n +<strong>[LEFT CTRL][r]</strong>\n +Drop a random item near player's position.\n +\n +<strong>[LEFT CTRL][LEFT SHIFT][r]</strong>\n +Drop a random magical item near player's position.\n +\n +<strong>[LEFT CTRL][LEFT ALT][LEFT SHIFT][r]</strong>\n +Respawn all NPC's (including killed droids) on current level.\n +\n +<strong>[LEFT CTRL][LEFT ALT][LEFT SHIFT][g]</strong>\n +Reload and redisplay current graphics.\n +\n +\n +Takeover Win {#ptTakeover} +============ +When hacking a bot, a forced win can be enacted during the takeover game. +The player must still go through the process of selecting colour (or side).\n +\n +Once the game has started, entering the key combination +<strong>[LEFT CTRL][LEFT ALT][w]</strong> +will cause the takeover game to exit with the player as victor. +The bot attempting to be hacked will now be under control of the player. +Although the player has forced a win, the player statistics reflect a forced win as a normal win.\n +\n +\n +In-Game Level Editing {#ptLvlEdit} +===================== +There are numerous use cases where there is a need to alter the items in the game "ship" or levels. +The most obvious is those times where testing requires the player character be located on another level. +Rather than manually moving the character, the character can be repositioned using the Level Editor. +This method also allows developers to move the character to the debug screens, which are not available during game play.\n +\n +Level Editor can be accessed in-game, when no other menus or dialogs are active, by using the key combination +<strong>[LEFT CTRL][LEFT ALT][e]</strong>.\n +\n +Usage of the Level Editor is described in other Freedroid RPG support documents.\n +\n ----------------------------------------------------------------------- Summary of changes: doc/tools/cmdlineref.md | 128 +++++++++++++++++++++++++++++++++++++ doc/tools/index.md | 2 + doc/tools/playcheat.md | 163 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 293 insertions(+), 0 deletions(-) create mode 100644 doc/tools/cmdlineref.md create mode 100644 doc/tools/playcheat.md hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-15 09:28:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via b78ab84fb0d4ac6ec44ac91f2b9fcfe6f5a53483 (commit) from 574877ccf1ad7a8e8e148e39876ee7d713ebd83c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=b78ab84fb0d4ac6ec44ac91f2b9fcfe6f5a53483 commit b78ab84fb0d4ac6ec44ac91f2b9fcfe6f5a53483 Author: Scott Furry <sco...@gm...> Date: Wed Jul 15 11:27:44 2015 +0200 [FDDNM] Updating/improving doxygen document presentation. Minor change to improve readability and layout of information. diff --git a/doc/tools/fddnm.md b/doc/tools/fddnm.md index 5044df9..3bdb6e8 100644 --- a/doc/tools/fddnm.md +++ b/doc/tools/fddnm.md @@ -68,58 +68,58 @@ Show help message for fddnm\n [[-T | --format=]arg] [[-d | --dialog=]arg] \n - [-q]\n - Quiet - no output to stdout\n +<strong>[-q]</strong>\n +Quiet - no output to stdout\n \n - [-P | \-\-verboseprint]\n - Print parsed dialog data to text file. Text file placed in output directory.\n - Note - output file will be named "[PREFIX][Dialog Name]_VPARSE.txt"\n +<strong>[-P | \-\-verboseprint]</strong>\n +Print parsed dialog data to text file. Text file placed in output directory.\n +Note - output file will be named "[PREFIX][Dialog Name]_VPARSE.txt"\n \n - [-D | \-\-verbosedot]\n - Print analyzed dialog data used to create graphic to text file. Text file placed in output directory.\n - Note - output file will be named "[PREFIX][Dialog Name]_VDOT.txt"\n +<strong>[-D | \-\-verbosedot]</strong>\n +Print analyzed dialog data used to create graphic to text file. Text file placed in output directory.\n +Note - output file will be named "[PREFIX][Dialog Name]_VDOT.txt"\n \n - [-G | --group] - Grouping is used as a layout hint to graphviz.\n - Enables nodes connected to "end_dialog" to be grouped closer to "end_dialog" node.\n - (E.g. Dixon or Tania graphs produce better output with this setting enabled).\n +<strong>[-G | --group]</strong>\n +Grouping is used as a layout hint to graphviz.\n +Enables nodes connected to "end_dialog" to be grouped closer to "end_dialog" node.\n +(E.g. Dixon or Tania graphs produce better output with this setting enabled).\n \n - [-H | --extrainfo] - enable HTML-like dot output - includeds presentation of extra node information.\n - (See below for an example of the output produced.)\n +<strong>[-H | --extrainfo]</strong>\n +enable HTML-like dot output - includeds presentation of extra node information.\n +(See below for an example of the output produced.)\n \n - [-I | \-\-individual]\n - Program is to parse and process all dialog files individually.\n - Any references to \"include\" another dialog file will not be processed. (e.g. 614-cryo.lua)\n +<strong>[-I | \-\-individual]</strong>\n +Program is to parse and process all dialog files individually.\n +Any references to \"include\" another dialog file will not be processed. (e.g. 614-cryo.lua)\n \n - [-s | \-\-dirsearch=] *arg* \n - Directory *arg* will be searched for dialog files (DEFAULT: [FDRPG root]/dialogs)\n +<strong>[-s | \-\-dirsearch=]<em>arg</em></strong>\n +Directory *arg* will be searched for dialog files (DEFAULT: [FDRPG root]/dialogs)\n \n - [-o | \-\-diroutput=] *arg* \n - Directory *arg* will be used to store program output (graphic or text) (DEFAULT: current directory)\n +<strong>[-o | \-\-diroutput=]<em>arg</em></strong>\n +Directory *arg* will be used to store program output (graphic or text) (DEFAULT: current directory)\n \n - [-F | \-\-fileprefix=] *arg* \n - *arg* will be the validated text used as a prefix for output file names.\n - Note - see the second entry "portable_name" in the [Boost Filesystem Portability Guide](http://www.boost.org/doc/libs/1_55_0/libs/filesystem/doc/portability_guide.htm#recommendations) for limitations\n +<strong>[-F | \-\-fileprefix=]<em>arg</em></strong>\n +*arg* will be the validated text used as a prefix for output file names.\n +Note - see the second entry "portable_name" in the [Boost Filesystem Portability Guide](http://www.boost.org/doc/libs/1_55_0/libs/filesystem/doc/portability_guide.htm#recommendations) for limitations\n \n - [-L | \-\-layout=] *arg* \n - *arg* is the direction of graph layout. One of [ TB (DEFAULT) | LR | RL | BT ]\n - Note: see [Graphviz rankdir attribute](http://www.graphviz.org/content/attrs#drankdir) for details\n +<strong>[-L | \-\-layout=]<em>arg</em></strong>\n +*arg* is the direction of graph layout. One of [ TB (DEFAULT) | LR | RL | BT ]\n +Note: see [Graphviz rankdir attribute](http://www.graphviz.org/content/attrs#drankdir) for details\n \n - [-T | \-\-format=] *arg* \n - *arg* is the graphic format of output. One of [ none | dot | jpg | png | svg (DEFAULT) ]\n +<strong>[-T | \-\-format=]<em>arg</em></strong>\n +*arg* is the graphic format of output. One of [ none | dot | jpg | png | svg (DEFAULT) ]\n \n - [ | -d | \-\-dialog=] *arg* \n - *arg* is the file name of dialog to be parsed without its *lua* file extension.\n - No supplied dialog names implies all dialogs in search directory are to be parsed.\n - More than one dialog name can be used without the switch as the use of the switch is optional. +<strong>[ | -d | \-\-dialog=]<em>arg</em></strong>\n +*arg* is the file name of dialog to be parsed without its *lua* file extension.\n +No supplied dialog names implies all dialogs in search directory are to be parsed.\n +More than one dialog name can be used without the switch as the use of the switch is optional. \n Examples {#examples} ======== Usage Examples:\n -(all examples assume current directory is [FDRPG root]/tools/fddnm)\n +<em>All examples assume current directory is \[FDRPG root\]/tools/fddnm</em>\n \n - Parse all found dialogs and produce output in the form of png graphic files\n @@ -178,8 +178,8 @@ the addition of an end_dialog node, the Parsed node count will be set to (Detect \n ![Example Dialog Conversion Output (with detail)](@ref example_extra.png) -Using the command line switch *[-H | --extrainfo]* will result in diagrams similar to above. -The only change is the inclusion of text ( *text="..."* for each node in the dialog file). +Using the command line switch <strong>[-H | --extrainfo]</strong> will result in diagrams similar to above. +The only change is the inclusion of text ( <em>text="..."</em> for each node in the dialog file). Currently, the line wrap value is set for 30 characters. ![Example Error Indication](@ref example_error.png) ----------------------------------------------------------------------- Summary of changes: doc/tools/fddnm.md | 74 ++++++++++++++++++++++++++-------------------------- 1 files changed, 37 insertions(+), 37 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-14 21:40:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 574877ccf1ad7a8e8e148e39876ee7d713ebd83c (commit) from 1aec5cfe4556fc68169ff93eac3d246c58a75806 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=574877ccf1ad7a8e8e148e39876ee7d713ebd83c commit 574877ccf1ad7a8e8e148e39876ee7d713ebd83c Author: v4hn <me...@v4...> Date: Tue Jul 14 23:33:30 2015 +0200 [lua] Don't try to open an intentionally shortened file path, when displaying an erroneous line. 'short_src' replaces the string's heading with ellipis if the string contains more than 60 chars. diff --git a/src/lua.c b/src/lua.c index 46e1813..67be205 100644 --- a/src/lua.c +++ b/src/lua.c @@ -1781,7 +1781,7 @@ int resume_lua_coroutine(struct lua_coroutine *coroutine) } else { // The script code is in an external file // Extract the erroneous function's code from the source file - FILE *src = fopen(ar.short_src, "r"); + FILE *src = fopen(&ar.source[1], "r"); struct auto_string *code = alloc_autostr(256); char buffer[256] = ""; char *ptr = buffer; ----------------------------------------------------------------------- Summary of changes: src/lua.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-14 20:38:33
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via ac3b271fdfca2584a595d0a6d2a4369191a5c667 (commit) via a2fe75aee1be0bf329abc9312835adfa2564e95c (commit) from f2c68897b4cdd16c844c61c46069af6640a80179 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=a2fe75aee1be0bf329abc9312835adfa2564e95c commit a2fe75aee1be0bf329abc9312835adfa2564e95c Author: v4hn <me...@v4...> Date: Tue Jul 14 22:26:57 2015 +0200 Global 'unpack' was deprecated already in lua5.2 and got removed in 5.3. It has been moved inside the 'table' module. diff --git a/dialogs/Ewald.lua b/dialogs/Ewald.lua index 45537ac..76fb0fe 100644 --- a/dialogs/Ewald.lua +++ b/dialogs/Ewald.lua @@ -502,7 +502,7 @@ return { table.insert(random_says, _"Bucking the statistics. I like that.") end - Npc:says_random(unpack(random_says)) + Npc:says_random(table.unpack(random_says)) hide("node54", "node55") next("node56") end, }, @@ -524,7 +524,7 @@ return { table.insert(random_says, _"Betting against the game. I like that.") end - Npc:says_random(unpack(random_says)) + Npc:says_random(table.unpack(random_says)) hide("node54", "node55") next("node56") end, }, diff --git a/map/script_helpers.lua b/map/script_helpers.lua index 6f097d6..fcdbbf0 100644 --- a/map/script_helpers.lua +++ b/map/script_helpers.lua @@ -333,7 +333,7 @@ function chat_says_format(text, ...) no_wait = "NO_WAIT" table.remove(arg) end - text = string.format(text, unpack(arg)) + text = string.format(text, table.unpack(arg)) return text, no_wait end http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=ac3b271fdfca2584a595d0a6d2a4369191a5c667 commit ac3b271fdfca2584a595d0a6d2a4369191a5c667 Author: fluzz <fl...@gm...> Date: Tue Jul 14 22:30:20 2015 +0200 Fix wrong copy-paste introduced with commit 2afcf2afca58. diff --git a/src/savestruct_internal.c b/src/savestruct_internal.c index b9791dd..1e7106f 100644 --- a/src/savestruct_internal.c +++ b/src/savestruct_internal.c @@ -80,7 +80,7 @@ define_read_xxx(uint8_t); #if __WIN32__ define_write_xxx(uint8_t, "%hu"); #else -define_write_xxx(uint8_t, "%hu"); +define_write_xxx(uint8_t, "%hhu"); #endif /** ----------------------------------------------------------------------- Summary of changes: dialogs/Ewald.lua | 4 ++-- map/script_helpers.lua | 2 +- src/savestruct_internal.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-07-14 20:11:27
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via f2c68897b4cdd16c844c61c46069af6640a80179 (commit) via 2afcf2afca58f7713abf75efd5b78a9f3dcc8188 (commit) via cbe9c56ebe0ede28bde285229f32c97f0349e7d1 (commit) via 89ffb58bf281ca4c96cf9282c76ce4b11bbed725 (commit) from 92de0f36b4deffb7255d53057e4eb20d2320c61b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=89ffb58bf281ca4c96cf9282c76ce4b11bbed725 commit 89ffb58bf281ca4c96cf9282c76ce4b11bbed725 Author: fluzz <fl...@gm...> Date: Fri Jun 26 17:53:29 2015 +0200 Fix compilation warning on win32: %e conversion specifier not known. "%e" is used in the format string of strftime to output the day number formatted on 2 chars with a leading blank if needed. That specifier is not known by the win32 implementation. On win32, "%#d" is used instead. diff --git a/src/saveloadgame.c b/src/saveloadgame.c index ebb21ca..6425cd6 100644 --- a/src/saveloadgame.c +++ b/src/saveloadgame.c @@ -45,8 +45,12 @@ #endif #ifndef HAVE_NL_LANGINFO +#if __WIN32__ +#define nl_langinfo(X) "%a %b %#d %H:%M:%S %Y" +#else #define nl_langinfo(X) "%a %b %e %H:%M:%S %Y" #endif +#endif #define SAVEDGAME_EXT ".sav.gz" #define SAVE_GAME_THUMBNAIL_EXT ".thumbnail.png" http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=cbe9c56ebe0ede28bde285229f32c97f0349e7d1 commit cbe9c56ebe0ede28bde285229f32c97f0349e7d1 Author: fluzz <fl...@gm...> Date: Fri Jun 26 18:58:14 2015 +0200 On 32b OS, size_t is an unsigned int while it is a long unsigned int on 64b OS. A dedicated length specifier, which takes care of the actual type, is to be used in a printf format string when printing a size_t data. On Windows that specifier is 'I'. On Linux and MacOS, it is 'z'. diff --git a/src/defs.h b/src/defs.h index cbb12da..cc49ea6 100644 --- a/src/defs.h +++ b/src/defs.h @@ -39,8 +39,8 @@ #define FALSE (0) #endif -#define ERR -1 -#define OK 0 +#define ERR -1 +#define OK 0 #ifndef max #define max(x,y) ((x) < (y) ? (y) : (x) ) @@ -49,6 +49,14 @@ #define min(x,y) ((x) > (y) ? (y) : (x) ) #endif +// On Linux and MacOS, 'z' is the length modifier to be used in printf() for +// a size_t data. On Windows, 'I' is to be used. +#if __WIN32__ +#define SIZE_T_F "%Iu" +#else +#define SIZE_T_F "%zu" +#endif + //-------------------- // Here you can control the debug level for the various modules, or at least // that's the way it is planned to be. Turn on and off debugging as you like. diff --git a/src/dynarray.c b/src/dynarray.c index be73cb3..12a072b 100644 --- a/src/dynarray.c +++ b/src/dynarray.c @@ -65,7 +65,7 @@ void dynarray_resize(struct dynarray *array, int membernum, size_t membersize) { void *buffer = realloc(array->arr, membernum * membersize); if (!buffer) { - error_message(__FUNCTION__, "Not enough memory to realloc a dynarray (requested size: %lu)", IS_FATAL, membernum * membersize); + error_message(__FUNCTION__, "Not enough memory to realloc a dynarray (requested size: " SIZE_T_F ")", IS_FATAL, membernum * membersize); } array->arr = buffer; array->capacity = membernum; diff --git a/src/keyboard.c b/src/keyboard.c index cd375cc..4311e3a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -195,7 +195,7 @@ void input_keyboard_init(void) if (sizeof(default_keybinds) / sizeof(default_keybinds[0]) > sizeof(GameConfig.input_keybinds) / sizeof(GameConfig.input_keybinds[0])) error_message(__FUNCTION__, - "There are %zu keyboard commands defined in keyboard.c, but GameConfig structure only supports %zu.", + "There are " SIZE_T_F " keyboard commands defined in keyboard.c, but GameConfig structure only supports " SIZE_T_F ".", PLEASE_INFORM | IS_FATAL, sizeof(default_keybinds) / sizeof(default_keybinds[0]), sizeof(GameConfig.input_keybinds) / sizeof(GameConfig.input_keybinds[0])); diff --git a/src/mapgen/mapgen.c b/src/mapgen/mapgen.c index d886b77..5b96f7d 100644 --- a/src/mapgen/mapgen.c +++ b/src/mapgen/mapgen.c @@ -571,7 +571,7 @@ int mapgen_add_room(int x, int y, int w, int h) max_rooms += 10; struct roominfo *buffer = realloc(rooms, max_rooms * sizeof(struct roominfo)); if (!buffer) { - error_message(__FUNCTION__, "Not enough memory to reallocate the 'rooms' datastruct (requested size: %lu).", IS_FATAL, max_rooms * sizeof(struct roominfo)); + error_message(__FUNCTION__, "Not enough memory to reallocate the 'rooms' datastruct (requested size: " SIZE_T_F ").", IS_FATAL, max_rooms * sizeof(struct roominfo)); return -1; } rooms = buffer; http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=2afcf2afca58f7713abf75efd5b78a9f3dcc8188 commit 2afcf2afca58f7713abf75efd5b78a9f3dcc8188 Author: fluzz <fl...@gm...> Date: Fri Jun 26 19:08:28 2015 +0200 Win32 does not understand the "hh" format string's length specifier. diff --git a/src/savestruct_internal.c b/src/savestruct_internal.c index 4d8064d..b9791dd 100644 --- a/src/savestruct_internal.c +++ b/src/savestruct_internal.c @@ -77,7 +77,11 @@ define_read_xxx(uint8_t); * \param strout The auto_string to be filled * \param data Pointer to the data to write */ -define_write_xxx(uint8_t, "%hhu"); +#if __WIN32__ +define_write_xxx(uint8_t, "%hu"); +#else +define_write_xxx(uint8_t, "%hu"); +#endif /** * \fn void read_uint16_t(lua_State *L, int index, uint16_t *data) http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=f2c68897b4cdd16c844c61c46069af6640a80179 commit f2c68897b4cdd16c844c61c46069af6640a80179 Author: fluzz <fl...@gm...> Date: Tue Jul 14 21:18:00 2015 +0200 [configure] Restrict the use of the system-wide Lua lib to 5.2. Depending on the way Lua 5.3 was built by the distro packager, the lib can be more or less compatible with 5.2. To avoid any issue, we restrict to using 5.2 only (if not found, we compile with our embedded version). diff --git a/configure.ac b/configure.ac index c4ec8e8..85b9c1d 100644 --- a/configure.ac +++ b/configure.ac @@ -312,8 +312,8 @@ AS_VAR_IF([embedded_lua], [no], ], [ embedded_lua="yes" - summary_lua="embedded (due to Lua not found system-wide)" - AC_MSG_NOTICE([No system-wide Lua library found! Using embedded Lua instead]) + summary_lua="embedded (due to Lua 5.2 not found system-wide)" + AC_MSG_NOTICE([No system-wide Lua 5.2 library found. Using embedded Lua instead]) ] ) ] diff --git a/m4/lua.m4 b/m4/lua.m4 index 7fffbd0..1e7884f 100644 --- a/m4/lua.m4 +++ b/m4/lua.m4 @@ -35,9 +35,9 @@ dnl AC_DEFUN([KYUA_LUA], [ lua_found=no - PKG_CHECK_MODULES([LUA], [lua >= 5.2], [lua_found=yes], [true]) + PKG_CHECK_MODULES([LUA], [lua >= 5.2 lua < 5.3], [lua_found=yes], [true]) if test "${lua_found}" = no; then - PKG_CHECK_MODULES([LUA], [lua5.2 >= 5.2], [lua_found=yes], [true]) + PKG_CHECK_MODULES([LUA], [lua5.2 >= 5.2 lua5.2 < 5.3], [lua_found=yes], [true]) fi ]) ----------------------------------------------------------------------- Summary of changes: configure.ac | 4 ++-- m4/lua.m4 | 4 ++-- src/defs.h | 12 ++++++++++-- src/dynarray.c | 2 +- src/keyboard.c | 2 +- src/mapgen/mapgen.c | 2 +- src/saveloadgame.c | 4 ++++ src/savestruct_internal.c | 6 +++++- 8 files changed, 26 insertions(+), 10 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-06-23 20:16:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 92de0f36b4deffb7255d53057e4eb20d2320c61b (commit) from bea8fbf38664d8ecbf4c236c5fd3697df28311b1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=92de0f36b4deffb7255d53057e4eb20d2320c61b commit 92de0f36b4deffb7255d53057e4eb20d2320c61b Author: fluzz <fl...@gm...> Date: Tue Jun 23 22:14:15 2015 +0200 configure.ac: malloc() and realloc() can not be tested when cross-compiling with mingw32 Mingw32 uses maaloc() and realloc() from Windows native msvcrt.dll. When cross-compiling those functions can thus not be checked. diff --git a/configure.ac b/configure.ac index a674b3a..c4ec8e8 100644 --- a/configure.ac +++ b/configure.ac @@ -346,9 +346,13 @@ dnl Checks for library functions. AS_BOX([Checking library functions]) -AC_FUNC_MALLOC +AS_VAR_IF([cross_compiling], [no], + [ + AC_FUNC_MALLOC + AC_FUNC_REALLOC + ] +) AC_FUNC_MKTIME -AC_FUNC_REALLOC AC_FUNC_STRCOLL AC_CHECK_FUNCS([alphasort atexit clock_gettime floor getcwd memchr memmove memset mkdir]) AC_CHECK_FUNCS([nl_langinfo pow putenv rint scandir setenv setlocale sqrt strchr strcspn]) ----------------------------------------------------------------------- Summary of changes: configure.ac | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- freedroidRPG |
From: Matthias <mat...@us...> - 2015-06-08 09:26:44
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via bea8fbf38664d8ecbf4c236c5fd3697df28311b1 (commit) from 35403246a3a981aff88a52f2c7a65975a07f0cf8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=bea8fbf38664d8ecbf4c236c5fd3697df28311b1 commit bea8fbf38664d8ecbf4c236c5fd3697df28311b1 Author: Xenux <xe...@fr...> Date: Mon Jun 8 11:23:36 2015 +0200 bot arena: use Enemy Hacked trigger, arena can now be won by hacking the bots. Fixes #757. diff --git a/map/events.dat b/map/events.dat index daaf5f9..6013c79 100644 --- a/map/events.dat +++ b/map/events.dat @@ -1783,7 +1783,8 @@ Silent=0 * New event trigger * Name="Arena Bot Killed" -Trigger on enemy death in level=29 +Trigger on enemy death +Enemy level=29 Enemy faction="ms" <LuaCode> if (arena_remaining_bots == nil) then @@ -1813,6 +1814,39 @@ Enemy faction="ms" * End of trigger * * New event trigger * +Name=_"Arena Bot Hacked" +Trigger on enemy hack +Enemy level=29 +Enemy faction="ms" +<LuaCode> + if (arena_remaining_bots == nil) then + return -- The counter of bot is disabled, stop now. + else + -- For each death, decrement the number of remaining bots. + arena_remaining_bots = arena_remaining_bots - 1 + end + + if (arena_remaining_bots <= 0) then + arena_remaining_bots = nil -- Delete the counter of bot + + -- If Tux haven't reached the final wave, ... + if (not arena_final_wave) then + arena_next_wave = arena_current_wave + 1 + display_big_message(_"All bots are killed! Go to center for next wave.") + display_big_message(_"All bots are killed! Go to center for next wave.") + else + arena_won = true + display_big_message(_"All bots are killed! You won.") + + -- Open the doors + change_obstacle_state("Arena-RingEntrance", "opened") + change_obstacle_state("Arena-AccessTrapdoor", "opened") + end + end +</LuaCode> +* End of trigger * + +* New event trigger * Name="Stop Arena" Trigger at label="StopArenaSquare" Silent=1 ----------------------------------------------------------------------- Summary of changes: map/events.dat | 36 +++++++++++++++++++++++++++++++++++- 1 files changed, 35 insertions(+), 1 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-06-04 12:28:29
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 35403246a3a981aff88a52f2c7a65975a07f0cf8 (commit) via 170c84278b02b7790ae79c374a40d512066a56d8 (commit) from f96377ec3b90dfacc5dcd3b19a9232f8998a71b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=170c84278b02b7790ae79c374a40d512066a56d8 commit 170c84278b02b7790ae79c374a40d512066a56d8 Author: fluzz <fl...@gm...> Date: Thu Jun 4 14:20:53 2015 +0200 Fix a memleak related to the use of error_once_message and alert_once_window diff --git a/src/misc.c b/src/misc.c index 02903d7..16e9202 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1365,11 +1365,11 @@ static void free_memory_before_exit(void) reset_visible_levels(); clear_animated_floor_tile_list(); + // other stuff delete_events(); free_current_ship(); - - // free level editor memory leveleditor_cleanup(); + free_error_msg_store(); } /** diff --git a/src/proto.h b/src/proto.h index 300d600..406dad3 100644 --- a/src/proto.h +++ b/src/proto.h @@ -668,6 +668,7 @@ char *ReadAndMallocAndTerminateFile(const char *filename, const char *File_End_S char *LocateStringInData(char *SearchBeginPointer, const char *SearchTextPointer); void DebugPrintf(int db_level, const char *fmt, ...) PRINTF_FMT_ATTRIBUTE(2,3); void clean_error_msg_store(); +void free_error_msg_store(); void error_message(const char *, const char *, int, ...) PRINTF_FMT_ATTRIBUTE(2,4); void error_once_message(int, const char *, const char *, int, ...) PRINTF_FMT_ATTRIBUTE(3,5); void alert_window(const char *text, ...) PRINTF_FMT_ATTRIBUTE(1,2); diff --git a/src/text_public.c b/src/text_public.c index 1d3201c..06c8ecc 100644 --- a/src/text_public.c +++ b/src/text_public.c @@ -142,6 +142,7 @@ static int _first_use_of_msg(int when, struct auto_string *msg) stored_item->when = when; stored_item->msg = msg; dynarray_add(msg_store, stored_item, sizeof(struct msg_store_item)); + free(stored_item); return TRUE; } @@ -180,6 +181,23 @@ void clean_error_msg_store() } /** + * Free all the memory slots used by the msg_store + */ +void free_error_msg_store() +{ + if (!msg_store) // msg store was not used + return; + + int i; + for (i = 0; i < msg_store->size; i++) { + struct msg_store_item *stored_item = (struct msg_store_item *)dynarray_member(msg_store, i, sizeof(struct msg_store_item)); + free_autostr(stored_item->msg); + } + dynarray_free(msg_store); + free(msg_store); +} + +/** * This function should help to simplify and standardize the many error * messages possible in FreedroidRPG. */ http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=35403246a3a981aff88a52f2c7a65975a07f0cf8 commit 35403246a3a981aff88a52f2c7a65975a07f0cf8 Author: fluzz <fl...@gm...> Date: Thu Jun 4 14:22:59 2015 +0200 lvleditor: Stop drawing a line of walls when the mouse pointer leaves the level's map. Currently, the walls ouside the level are not drawn, when the mouse leaves the level, but the lvleditor is still in 'drawing line of walls' mode. As soon as the mouse re-enters the level's boundaries, the level editor tries to plant a new wall, but on an invalid position. This patch calls end_wall_line() when the mouse is not in the level. diff --git a/src/lvledit/lvledit_tool_place.c b/src/lvledit/lvledit_tool_place.c index 907e493..f25c7f1 100644 --- a/src/lvledit/lvledit_tool_place.c +++ b/src/lvledit/lvledit_tool_place.c @@ -644,6 +644,10 @@ int leveleditor_place_input(SDL_Event *event) if (!mouse_in_level) { // We must not place objects outside of the level + // And we stop drawing walls if mouse leaved the level + if (our_mode == LINE_WALLS) { + end_wall_line(1); + } return 0; } ----------------------------------------------------------------------- Summary of changes: src/lvledit/lvledit_tool_place.c | 4 ++++ src/misc.c | 4 ++-- src/proto.h | 1 + src/text_public.c | 18 ++++++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-06-03 18:09:09
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via f96377ec3b90dfacc5dcd3b19a9232f8998a71b7 (commit) from 790c87fe28804679334b8a68aa2faa8f66694744 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=f96377ec3b90dfacc5dcd3b19a9232f8998a71b7 commit f96377ec3b90dfacc5dcd3b19a9232f8998a71b7 Author: fluzz <fl...@gm...> Date: Wed Jun 3 19:04:53 2015 +0200 Prettier opengl_debug output messages. Output names of flags instead of there numerical values, when known. Also do not output notification messages. diff --git a/src/open_gl_debug.c b/src/open_gl_debug.c index 70a1d2f..bd91c9e 100644 --- a/src/open_gl_debug.c +++ b/src/open_gl_debug.c @@ -94,20 +94,109 @@ typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bu PFNGLDEBUGMESSAGECONTROLPROC glDebugMessageControl; PFNGLDEBUGMESSAGECALLBACKPROC glDebugMessageCallback; +#define DBG_FLAG(f) { f, #f } +struct debug_flag { + GLenum flag_value; + char *flag_descr; +} debug_flags[] = { + DBG_FLAG(GL_DEBUG_OUTPUT_SYNCHRONOUS), + DBG_FLAG(GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH), + DBG_FLAG(GL_DEBUG_CALLBACK_FUNCTION), + DBG_FLAG(GL_DEBUG_CALLBACK_USER_PARAM), + DBG_FLAG(GL_DEBUG_SOURCE_API), + DBG_FLAG(GL_DEBUG_SOURCE_WINDOW_SYSTEM), + DBG_FLAG(GL_DEBUG_SOURCE_SHADER_COMPILER), + DBG_FLAG(GL_DEBUG_SOURCE_THIRD_PARTY), + DBG_FLAG(GL_DEBUG_SOURCE_APPLICATION), + DBG_FLAG(GL_DEBUG_SOURCE_OTHER), + DBG_FLAG(GL_DEBUG_TYPE_ERROR), + DBG_FLAG(GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR), + DBG_FLAG(GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR), + DBG_FLAG(GL_DEBUG_TYPE_PORTABILITY), + DBG_FLAG(GL_DEBUG_TYPE_PERFORMANCE), + DBG_FLAG(GL_DEBUG_TYPE_OTHER), + DBG_FLAG(GL_DEBUG_TYPE_MARKER), + DBG_FLAG(GL_DEBUG_TYPE_PUSH_GROUP), + DBG_FLAG(GL_DEBUG_TYPE_POP_GROUP), + DBG_FLAG(GL_DEBUG_SEVERITY_NOTIFICATION), + DBG_FLAG(GL_MAX_DEBUG_GROUP_STACK_DEPTH), + DBG_FLAG(GL_DEBUG_GROUP_STACK_DEPTH), + DBG_FLAG(GL_BUFFER), + DBG_FLAG(GL_SHADER), + DBG_FLAG(GL_PROGRAM), + DBG_FLAG(GL_QUERY), + DBG_FLAG(GL_PROGRAM_PIPELINE), + DBG_FLAG(GL_SAMPLER), + DBG_FLAG(GL_DISPLAY_LIST), + DBG_FLAG(GL_MAX_LABEL_LENGTH), + DBG_FLAG(GL_MAX_DEBUG_MESSAGE_LENGTH), + DBG_FLAG(GL_MAX_DEBUG_LOGGED_MESSAGES), + DBG_FLAG(GL_DEBUG_LOGGED_MESSAGES), + DBG_FLAG(GL_DEBUG_SEVERITY_HIGH), + DBG_FLAG(GL_DEBUG_SEVERITY_MEDIUM), + DBG_FLAG(GL_DEBUG_SEVERITY_LOW), + DBG_FLAG(GL_DEBUG_OUTPUT), + { 0x0503, "GL_STACK_OVERFLOW" }, + { 0x0504, "GL_STACK_UNDERFLOW" } +}; +#undef DBG_FLAG + +static struct debug_flag *find_debug_flag(GLenum value) +{ + unsigned int i; + for (i=0; i < sizeof(debug_flags)/sizeof(debug_flags[0]); i++) { + if (debug_flags[i].flag_value == value) + return &debug_flags[i]; + } + return NULL; +} static void gl_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam) { // Ignore certain message IDs + if (id == 131204) { // "Waste of memory: Texture 0 has mipmaps, while it's min filter is inconsistent with mipmaps." // Possible nvidia bug in version 313.30, ignore it for now return; } + if (severity == GL_DEBUG_SEVERITY_NOTIFICATION) { + // Do not display notifications + return; + } // Report a good looking error message - error_message(__FUNCTION__, "Source = %x, type = %x, id = %d, severity = %x: %s", - NO_REPORT, source, type, id, severity, message); + + struct auto_string *msg = alloc_autostr(256); + struct debug_flag *data = NULL; + + data = find_debug_flag(source); + if (data) { + autostr_append(msg, "Source = %s,", data->flag_descr); + } else { + autostr_append(msg, "Source = 0x%x,", source); + } + + data = find_debug_flag(type); + if (data) { + autostr_append(msg, " type = %s,", data->flag_descr); + } else { + autostr_append(msg, " type = 0x%x,", type); + } + + autostr_append(msg, " id = %d,", id); + + data = find_debug_flag(severity); + if (data) { + autostr_append(msg, " severity = %s,", data->flag_descr); + } else { + autostr_append(msg, " severity = 0x%x,", severity); + } + + error_message(__FUNCTION__, "%s: %s", NO_REPORT, msg->value, message); + + free_autostr(msg); } #endif // HAVE_LIBGL ----------------------------------------------------------------------- Summary of changes: src/open_gl_debug.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 91 insertions(+), 2 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-06-03 18:06:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 790c87fe28804679334b8a68aa2faa8f66694744 (commit) via fe408a5399f7af95ecaea3fdaa415b4530cf5783 (commit) from 6d8e6bb5bd17695b750c9fdb986acdcc45b76057 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=fe408a5399f7af95ecaea3fdaa415b4530cf5783 commit fe408a5399f7af95ecaea3fdaa415b4530cf5783 Author: fluzz <fl...@gm...> Date: Tue Jun 2 19:40:31 2015 +0200 Use strncpy in two places, to avoid a potentiel buffer overflow. diff --git a/src/lvledit/lvledit_actions.c b/src/lvledit/lvledit_actions.c index f5d7f12..1ce07fd 100644 --- a/src/lvledit/lvledit_actions.c +++ b/src/lvledit/lvledit_actions.c @@ -598,7 +598,7 @@ void level_editor_action_change_map_label_user(level *EditLevel, float x, float char suggested_label[200]; int i; - suggested_label[0] = 0; + suggested_label[0] = '\0'; // We check if a map label already exists for this spot for (i = 0; i < EditLevel->map_labels.size; i++) { @@ -606,15 +606,17 @@ void level_editor_action_change_map_label_user(level *EditLevel, float x, float if ((fabs(map_label->pos.x + 0.5 - x) < 0.5) && (fabs(map_label->pos.y + 0.5 - y) < 0.5)) { - + // Use the old label as a suggestion old_name = map_label->label_name; - strcpy(suggested_label, old_name); + strncpy(suggested_label, old_name, sizeof(suggested_label) - 1); + suggested_label[sizeof(suggested_label) - 1] = '\0'; break; } } - + // Check if the name entered already exists + while (1) { // Show popup window to enter a new map label name = GetEditableStringInPopupWindow(sizeof(suggested_label) - 1, _("\nPlease enter map label: \n\n"), suggested_label); @@ -636,7 +638,8 @@ void level_editor_action_change_map_label_user(level *EditLevel, float x, float alert_window("%s", _("The new name of the map label already exists, please choose an other name.")); // Copy the name in order to have it in the input box - strcpy(suggested_label, name); + strncpy(suggested_label, name, sizeof(suggested_label) - 1); + suggested_label[sizeof(suggested_label) - 1] = '\0'; free(name); // Restore the menu background in order to correctly draw the next popup window http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=790c87fe28804679334b8a68aa2faa8f66694744 commit 790c87fe28804679334b8a68aa2faa8f66694744 Author: fluzz <fl...@gm...> Date: Tue Jun 2 19:38:41 2015 +0200 Fix a double-free issue arising when leaving the game after an obstacle's label has been changed several times. diff --git a/src/lvledit/lvledit_actions.c b/src/lvledit/lvledit_actions.c index 1ce07fd..925ffda 100644 --- a/src/lvledit/lvledit_actions.c +++ b/src/lvledit/lvledit_actions.c @@ -240,6 +240,7 @@ static int action_change_obstacle_label(level *EditLevel, obstacle *obstacle, ch // If the obstacle already has a label, remove it char *old_label = get_obstacle_extension(EditLevel, obstacle, OBSTACLE_EXTENSION_LABEL); if (old_label) { + old_label = strdup(old_label); del_obstacle_extension(EditLevel, obstacle, OBSTACLE_EXTENSION_LABEL); } @@ -247,17 +248,18 @@ static int action_change_obstacle_label(level *EditLevel, obstacle *obstacle, ch if (undoable) { action_push(ACT_SET_OBSTACLE_LABEL, obstacle, old_label); } else { - free(old_label); + if (old_label) { + free(old_label); + old_label = NULL; + } } // If the new label is empty, we are done if (!name || !strlen(name)) return 0; - name = strdup(name); - // Assign the new label - add_obstacle_extension(EditLevel, obstacle, OBSTACLE_EXTENSION_LABEL, name); + add_obstacle_extension(EditLevel, obstacle, OBSTACLE_EXTENSION_LABEL, strdup(name)); return undoable; } ----------------------------------------------------------------------- Summary of changes: src/lvledit/lvledit_actions.c | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) hooks/post-receive -- freedroidRPG |
From: Matthias <mat...@us...> - 2015-05-28 10:44:07
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 6d8e6bb5bd17695b750c9fdb986acdcc45b76057 (commit) from 7e8c23ed48acb0d8caa33c71a95be4de9ab0cde1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=6d8e6bb5bd17695b750c9fdb986acdcc45b76057 commit 6d8e6bb5bd17695b750c9fdb986acdcc45b76057 Author: Gregory Lozet <gre...@gm...> Date: Thu May 28 12:42:12 2015 +0200 editor: fix heap use after free cutting map label. Fixes #814. diff --git a/src/lvledit/lvledit_actions.c b/src/lvledit/lvledit_actions.c index bb860d3..f5d7f12 100644 --- a/src/lvledit/lvledit_actions.c +++ b/src/lvledit/lvledit_actions.c @@ -587,9 +587,7 @@ static void action_change_map_label(level *EditLevel, int i, char *name, int x, return; // Create a new map label at the position of cursor - char *new_label_name = strdup(name); - add_map_label(EditLevel, x, y, new_label_name); - free(new_label_name); + add_map_label(EditLevel, x, y, strdup(name)); } void level_editor_action_change_map_label_user(level *EditLevel, float x, float y) @@ -660,7 +658,7 @@ void level_editor_action_change_map_label_user(level *EditLevel, float x, float */ void action_create_map_label(level *lvl, int x, int y, char *label_name) { - add_map_label(lvl, x, y, label_name); + add_map_label(lvl, x, y, strdup(label_name)); action_push(ACT_REMOVE_MAP_LABEL, x, y); } diff --git a/src/lvledit/lvledit_tool_select.c b/src/lvledit/lvledit_tool_select.c index 1ee5096..d602fa4 100644 --- a/src/lvledit/lvledit_tool_select.c +++ b/src/lvledit/lvledit_tool_select.c @@ -1170,7 +1170,7 @@ void level_editor_paste_selection() } // Add and select - action_create_map_label(EditLevel(), m->pos.x, m->pos.y, strdup(str->value)); + action_create_map_label(EditLevel(), m->pos.x, m->pos.y, str->value); select_map_label_on_tile(m->pos.x, m->pos.y); free_autostr(str); ----------------------------------------------------------------------- Summary of changes: src/lvledit/lvledit_actions.c | 6 ++---- src/lvledit/lvledit_tool_select.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-05-28 10:15:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 7e8c23ed48acb0d8caa33c71a95be4de9ab0cde1 (commit) via a034e7819e0f29d923f266ad34ac203551384d81 (commit) via 95937421effdd46cfb65f1259f8c4d61d0172d7f (commit) from ad89f0f6dace4516ac08c77c0ec2e03c81b78cfa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=95937421effdd46cfb65f1259f8c4d61d0172d7f commit 95937421effdd46cfb65f1259f8c4d61d0172d7f Author: fluzz <fl...@gm...> Date: Wed May 27 19:33:42 2015 +0200 Protect a call to w->update_tree(). diff --git a/src/widgets/widget_group.c b/src/widgets/widget_group.c index 7d7d8b0..c919e74 100644 --- a/src/widgets/widget_group.c +++ b/src/widgets/widget_group.c @@ -220,7 +220,8 @@ static void group_update(struct widget *wg) // Propagate on all children if (wg->enabled) { list_for_each_entry(w, &WIDGET_GROUP(wg)->list, node) { - w->update_tree(w); + if (w && w->update_tree) + w->update_tree(w); } } } http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=a034e7819e0f29d923f266ad34ac203551384d81 commit a034e7819e0f29d923f266ad34ac203551384d81 Author: fluzz <fl...@gm...> Date: Wed May 27 19:36:02 2015 +0200 Fix a copy/paste typo in the computation of an array size. diff --git a/src/lvledit/lvledit_widgets.c b/src/lvledit/lvledit_widgets.c index 1f73a24..9d402bc 100644 --- a/src/lvledit/lvledit_widgets.c +++ b/src/lvledit/lvledit_widgets.c @@ -103,7 +103,7 @@ static struct { { OBJECT_ITEM, item_category_list, sizeof(item_category_list) / sizeof(item_category_list[0]) }, { OBJECT_ENEMY, enemy_category_list, sizeof(enemy_category_list) / sizeof(enemy_category_list[0]) }, { OBJECT_WAYPOINT, waypoint_category_list, sizeof(waypoint_category_list) / sizeof(waypoint_category_list[0]) }, - { OBJECT_MAP_LABEL, map_label_category_list, sizeof(map_label_category_list) / sizeof(waypoint_category_list[0]) }, + { OBJECT_MAP_LABEL, map_label_category_list, sizeof(map_label_category_list) / sizeof(map_label_category_list[0]) }, }; // Level editor buttons' primary actions http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=7e8c23ed48acb0d8caa33c71a95be4de9ab0cde1 commit 7e8c23ed48acb0d8caa33c71a95be4de9ab0cde1 Author: fluzz <fl...@gm...> Date: Thu May 28 11:34:14 2015 +0200 [widgets] Replace use of 'lambda-like' functions by use of standard functions, and adapt configure.ac and the widget documentation accordingly. The update callback of widgets is implemented using lambda-like functions (through the use of the WIDGET_ANONYMOUS macro). When gcc is used to build the game, those lambda-like functions are implemented using nested functions inside statement expressions. Gcc implements nested functions with 'trampolines' (code added on the stack at run-time, which calls the actual function, see https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html and https://gcc.gnu.org/onlinedocs/gccint/Trampolines.html). The trampoline code being on the stack, it is not more available as soon as the containing function is leaved. A pointer to the nested function (the trampoline) is thus invalid outside of the containing function. However, when a nested function does not use 'upvalues', the call to the trampoline code can be optimized to a direct call to the actual nested function code (in the .text section). Prior to gcc 5, that optimization was done even in -O0. That's no more true with gcc 5 (see the small test below). This means that we can no more use nested functions to implement our WIDGET_ANONYMOUS. No other method being available, we have to get back to the use of a 'standard' function pointer. ------------------ Small test ------------------ $ cat test.c void main(int argc, char *argv[]) { void inner_f() { printf("tada\n"); } printf("%p\n", inner_f); } $ gcc4.9 -O0 test.c -o test $ nm test | grep inner_f 0000000000400580 t inner_f.2180 $ ./test 0x400580 $ gcc5.1 -O0 test.c test $ nm test | grep inner_f 0000000000400586 t inner_f.2287 $ ./test 0x7fffba0a14a0 $ gcc5.1 -O1 test.c test $ nm test | grep inner_f 0000000000400586 t inner_f.2323 $ ./test 0x400586 diff --git a/configure.ac b/configure.ac index 5df1091..a674b3a 100644 --- a/configure.ac +++ b/configure.ac @@ -319,39 +319,6 @@ AS_VAR_IF([embedded_lua], [no], ] ) -dnl We need anonymous lambda-like functions. -dnl With GCC, it possibly needs -fnested-functions while with CLANG it needs -fblocks - -AS_BOX([Checking how to implement lambda-like functions]) - -AM_CONDITIONAL([HAVE_CBLOCKS], [false]) -AS_VAR_IF([xiph_cv_c_compiler_clang], [no], - [ - AS_VAR_IF([GCC], [yes], - [ - AC_MSG_CHECKING([for -fnested-functions]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([], [void foo(void) {}; foo();])], - [AC_MSG_RESULT("no")], - [ - AC_MSG_RESULT(required) - AS_VAR_APPEND([FD_CFLAGS], [" -fnested-functions"]) - ] - ) - ], - [ - AC_MSG_ERROR([We need either GCC or Clang, to create lambda-like functions!]) - ] - ) - ], - [ - DISPATCH_C_BLOCKS - AS_VAR_APPEND([FD_CFLAGS], [" $CBLOCKS_CFLAGS"]) - AS_VAR_APPEND([FD_LDFLAGS], [" $CBLOCKS_LDFLAGS"]) - AS_VAR_APPEND([FD_LIBS], [" $CBLOCKS_LIBS"]) - ] -) - dnl Checks for header files. AS_BOX([Checking header files]) diff --git a/m4/blocks.m4 b/m4/blocks.m4 deleted file mode 100644 index 52f10c9..0000000 --- a/m4/blocks.m4 +++ /dev/null @@ -1,63 +0,0 @@ -AC_DEFUN([DISPATCH_C_BLOCKS], [ -# -# Allow configure to be passed a path to the directory where it should look -# for the Blocks runtime library, if any. -# -AC_ARG_WITH([blocks-runtime], - [AS_HELP_STRING([--with-blocks-runtime], - [Specify path to the blocks runtime])], - [blocks_runtime=${withval} - CBLOCKS_LDFLAGS="-L$blocks_runtime"] -) - -# -# Detect compiler support for Blocks; perhaps someday -fblocks won't be -# required, in which case we'll need to change this. -# -AC_CACHE_CHECK([for C Blocks support], [dispatch_cv_cblocks], [ - saveCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fblocks" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[(void)^{int i; i = 0; }();])], [ - CFLAGS="$saveCFLAGS" - dispatch_cv_cblocks="-fblocks" - ], [ - CFLAGS="$saveCFLAGS" - dispatch_cv_cblocks="no" - ]) -]) - -AS_IF([test "x$dispatch_cv_cblocks" != "xno"], [ - # - # It may be necessary to directly link the Blocks runtime on some - # systems, so give it a try if we can't link a C program that uses - # Blocks. We will want to remove this at somepoint, as really -fblocks - # should force that linkage already. - # - saveCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fblocks -O0" - AC_MSG_CHECKING([whether additional libraries are required for the Blocks runtime]) - AC_TRY_LINK([], [ - ^{ int j; j=0; }(); - ], [ - AC_MSG_RESULT([no]); - ], [ - saveLIBS="$LIBS" - LIBS="$LIBS -lBlocksRuntime" - AC_TRY_LINK([], [ - ^{ int k; k=0; }(); - ], [ - AC_MSG_RESULT([-lBlocksRuntime]) - CBLOCKS_LIBS="-lBlocksRuntime" - ], [ - AC_MSG_ERROR([can't find Blocks runtime]) - ]) - LIBS="$saveLIBS" - ]) - CFLAGS="$saveCFLAGS" - have_cblocks=true - CBLOCKS_CFLAGS="$dispatch_cv_cblocks" -], [ - have_cblocks=false -]) -AM_CONDITIONAL(HAVE_CBLOCKS, $have_cblocks) -]) diff --git a/src/chat.c b/src/chat.c index cad12d3..3398cb9 100644 --- a/src/chat.c +++ b/src/chat.c @@ -306,6 +306,40 @@ static void scroll_down_chat_selector(struct widget_button *wb) widget_text_list_scroll_down(chat_selector); } +// +// Widgets update callbacks +// + +static void _enable_if_waiting_user_click(struct widget *w) +{ + w->enabled = chat_get_current_context()->wait_user_click; +} + +static void _enable_if_not_waiting_user_click(struct widget *w) +{ + w->enabled = !chat_get_current_context()->wait_user_click; +} + +static void _enable_if_chat_log_can_scroll_up(struct widget *w) +{ + WIDGET_BUTTON(w)->active = widget_text_can_scroll_up(chat_log); +} + +static void _enable_if_chat_log_can_scroll_down(struct widget *w) +{ + WIDGET_BUTTON(w)->active = widget_text_can_scroll_down(chat_log); +} + +static void _enable_if_chat_selector_can_scroll_up(struct widget *w) +{ + WIDGET_BUTTON(w)->active = widget_text_list_can_scroll_up(chat_selector); +} + +static void _enable_if_chat_selector_can_scroll_down(struct widget *w) +{ + WIDGET_BUTTON(w)->active = widget_text_list_can_scroll_down(chat_selector); +} + /** * This function builds the chat interface if it hasn't already been initialized. */ @@ -367,9 +401,7 @@ struct widget_group *create_chat_dialog() widget_set_rect(WIDGET(chat_selector), chat_selector_inner_rect.x, chat_selector_inner_rect.y, chat_selector_inner_rect.w, chat_selector_inner_rect.h); chat_selector->process_entry = dialog_option_selected; - WIDGET(chat_selector)->update = WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = !chat_get_current_context()->wait_user_click; - }); + WIDGET(chat_selector)->update = _enable_if_not_waiting_user_click; widget_group_add(chat_menu, WIDGET(chat_selector)); // @@ -452,43 +484,35 @@ struct widget_group *create_chat_dialog() char *image[3]; SDL_Rect rect; void (*activate_button)(struct widget_button *); - void (WIDGET_ANONYMOUS_MARKER update) (struct widget *); + void (*update) (struct widget *); } b[] = { // Chat Log scroll up { {"widgets/chat_scroll_up_off.png", NULL, "widgets/chat_scroll_up.png"}, {chat_log_x + (chat_log_w - 158) / 2, chat_log_y + 2, 158, 22}, scroll_up_chat_log, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = widget_text_can_scroll_up(chat_log); - }) + _enable_if_chat_log_can_scroll_up }, // Chat Log scroll down { {"widgets/chat_scroll_down_off.png", NULL, "widgets/chat_scroll_down.png"}, {chat_log_x + (chat_log_w - 158) / 2, chat_log_y + chat_log_h - 41, 158, 22}, scroll_down_chat_log, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = widget_text_can_scroll_down(chat_log); - }) + _enable_if_chat_log_can_scroll_down }, // Chat Selector Scroll up { {"widgets/chat_scroll_up_off.png", NULL, "widgets/chat_scroll_up.png"}, {chat_selector_x + (chat_selector_w - 158) / 2, chat_selector_y - 2, 158, 22}, scroll_up_chat_selector, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = widget_text_list_can_scroll_up(chat_selector); - }) + _enable_if_chat_selector_can_scroll_up }, // Chat Selector Scroll down { {"widgets/chat_scroll_down_off.png", NULL, "widgets/chat_scroll_down.png"}, {chat_selector_x + (chat_selector_w - 158) / 2, chat_selector_y + chat_selector_h - 23, 158, 22}, scroll_down_chat_selector, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = widget_text_list_can_scroll_down(chat_selector); - }) + _enable_if_chat_selector_can_scroll_down } }; @@ -514,9 +538,7 @@ struct widget_group *create_chat_dialog() chat_wait = widget_group_create(); widget_set_rect(WIDGET(chat_wait), 0, 0, GameConfig.screen_width, GameConfig.screen_height); WIDGET(chat_wait)->enabled = FALSE; - WIDGET(chat_wait)->update = WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = chat_get_current_context()->wait_user_click; - }); + WIDGET(chat_wait)->update = _enable_if_waiting_user_click; struct widget_text* wait_text = widget_text_create(); widget_set_rect(WIDGET(wait_text), chat_selector_inner_rect.x, chat_selector_inner_rect.y, diff --git a/src/game_ui.c b/src/game_ui.c index 5de89ad..9ebeb14 100644 --- a/src/game_ui.c +++ b/src/game_ui.c @@ -378,6 +378,60 @@ static void item_alarm_display(struct widget *w) } } +// +// Widgets update callbacks +// + +static void _enable_if_quest_browser_open(struct widget *w) +{ + w->enabled = quest_browser_activated; +} + +static void _activate_if_quest_browser_changed(struct widget *w) +{ + WIDGET_BUTTON(w)->active = Me.quest_browser_changed; +} + +static void _activate_if_points_to_distribute(struct widget *w) +{ + WIDGET_BUTTON(w)->active = (Me.points_to_distribute > 0); +} + +static void _enable_if_skill_help_panel_open(struct widget *w) +{ + w->enabled = GameConfig.skill_explanation_screen_visible; +} + +static void _enable_if_char_panel_open(struct widget *w) +{ + w->enabled = GameConfig.CharacterScreen_Visible; +} + +static void _enable_if_skill_panel_open(struct widget *w) +{ + w->enabled = GameConfig.SkillScreen_Visible; +} + +static void _enable_if_map_covered(struct widget *w) +{ + w->enabled = (addon_crafting_ui_visible() || item_upgrade_ui_visible()); +} + +static void _enable_if_addon_crafting_panel_open(struct widget *w) +{ + w->enabled = addon_crafting_ui_visible(); +} + +static void _enable_if_item_upgrade_panel_open(struct widget *w) +{ + w->enabled = item_upgrade_ui_visible(); +} + +static void _enable_if_inventory_panel_open(struct widget *w) +{ + w->enabled = GameConfig.Inventory_Visible; +} + /** * This function builds the hud bar widgets. */ @@ -444,7 +498,7 @@ static struct widget_group *create_hud_bar() void (*display)(struct widget *); void (*activate_button)(struct widget_button *); char *(*get_tooltip_text)(); - void (WIDGET_ANONYMOUS_MARKER update)(struct widget *); + void (*update)(struct widget *); } b[] = { // Current skill button { @@ -453,9 +507,7 @@ static struct widget_group *create_hud_bar() NULL, current_skill_button_click, get_current_skill_button_tooltip, - WIDGET_ANONYMOUS(struct widget *w, { - current_skill_button_update(w); - }) + current_skill_button_update }, // Current weapon button { @@ -464,9 +516,7 @@ static struct widget_group *create_hud_bar() NULL, (void(*)(struct widget_button *))TuxReloadWeapon, get_current_weapon_button_tooltip, - WIDGET_ANONYMOUS(struct widget *w, { - current_weapon_button_update(w); - }) + current_weapon_button_update }, // Log button { @@ -476,9 +526,7 @@ static struct widget_group *create_hud_bar() NULL, (void(*)(struct widget_button *))toggle_quest_browser, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = Me.quest_browser_changed; - }) + _activate_if_quest_browser_changed }, // Inventory button { @@ -498,9 +546,7 @@ static struct widget_group *create_hud_bar() NULL, toggle_character_screen, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = (Me.points_to_distribute > 0); - }) + _activate_if_points_to_distribute }, // Skill button { @@ -581,7 +627,7 @@ static struct widget_group *create_hud_bar() struct widget_text *ammo = widget_text_create(); widget_set_rect(WIDGET(ammo), left_panel_x + 36, WIDGET(panel)->rect.y + 77, 100, 22); ammo->font = FPS_Display_Font; - WIDGET(ammo)->update = WIDGET_ANONYMOUS(struct widget *w, { current_ammo_update(w); }); + WIDGET(ammo)->update = current_ammo_update; // Message log. init_message_log(); @@ -621,51 +667,39 @@ struct widget_group *get_game_ui() struct { SDL_Rect rect; void (*display)(struct widget *w); - void (WIDGET_ANONYMOUS_MARKER update)(struct widget *w); + void (*update)(struct widget *w); } panels[] = { { {0, 0, 320, 480}, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = GameConfig.skill_explanation_screen_visible; - }) + _enable_if_skill_help_panel_open }, { {GameConfig.screen_width - 320, 0, 320, 480}, (void *)ShowCharacterScreen, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = GameConfig.CharacterScreen_Visible; - }) + _enable_if_char_panel_open }, { {GameConfig.screen_width - 320, 0, 320, 480}, (void *)ShowSkillsScreen, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = GameConfig.SkillScreen_Visible; - }) + _enable_if_skill_panel_open }, // This widget, covering the whole screen, avoid mouse event propagation to the other widgets // when the addon crafting or item upgrade panels are opened. { {0, 0, GameConfig.screen_width, GameConfig.screen_height}, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = (addon_crafting_ui_visible() || item_upgrade_ui_visible()); - }) + _enable_if_map_covered }, { {0, 0, 320, 480}, (void *)show_addon_crafting_ui, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = addon_crafting_ui_visible(); - }) + _enable_if_addon_crafting_panel_open }, { {320, 0, 320, 480}, (void *)show_item_upgrade_ui, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = item_upgrade_ui_visible(); - }) + _enable_if_item_upgrade_panel_open }, // The item held in hand is displayed by show_inventory_screen(). // In order to have this item displayed in front of all widgets, @@ -673,9 +707,7 @@ struct widget_group *get_game_ui() { {0, 0, 320, 480}, (void *)show_inventory_screen, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = GameConfig.Inventory_Visible; - }) + _enable_if_inventory_panel_open } }; @@ -690,9 +722,7 @@ struct widget_group *get_game_ui() // Create the quest browser. struct widget_group *quest_browser = create_quest_browser(); - WIDGET(quest_browser)->update = WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = quest_browser_activated; - }); + WIDGET(quest_browser)->update = _enable_if_quest_browser_open; widget_group_add(game_widget_group, WIDGET(quest_browser)); // Create the chat dialog. diff --git a/src/lvledit/lvledit_widgets.c b/src/lvledit/lvledit_widgets.c index 9d402bc..b70ff0b 100644 --- a/src/lvledit/lvledit_widgets.c +++ b/src/lvledit/lvledit_widgets.c @@ -106,7 +106,10 @@ static struct { { OBJECT_MAP_LABEL, map_label_category_list, sizeof(map_label_category_list) / sizeof(map_label_category_list[0]) }, }; +// // Level editor buttons' primary actions +// + static void undo_button_click(struct widget_button *wb) { level_editor_action_undo(); @@ -256,7 +259,10 @@ static void zoom_in_button_right_click(struct widget_button *wb) VanishingMessageEndDate = SDL_GetTicks() + 1000; } +// // Leveleditor floor layers button callbacks +// + static void floor_layers_button_click(struct widget_button *wb) { GameConfig.show_all_floor_layers = !GameConfig.show_all_floor_layers; @@ -270,9 +276,127 @@ static void floor_layers_button_right_click(struct widget_button *wb) action_change_floor_layer(EditLevel(), next_layer); } +// +// Widgets update callbacks +// + +static void _enable_if_undo_list_not_empty(struct widget *w) +{ + w->enabled = !list_empty(&to_undo); +} + +static void _enable_if_redo_list_not_empty(struct widget *w) +{ + w->enabled = !list_empty(&to_redo); +} + +static void _enable_is_selection_not_empty(struct widget *w) +{ + w->enabled = !selection_empty(); +} + +static void _enable_if_can_cycle_marked_object(struct widget *w) +{ + w->enabled = level_editor_can_cycle_marked_object(); +} + +static void _activate_if_show_wp_connections(struct widget *w) +{ + WIDGET_BUTTON(w)->active = !GameConfig.show_wp_connections; +} + +static void _enable_if_single_obstacle_selected(struct widget *w) +{ + w->enabled = single_tile_selection(OBJECT_OBSTACLE) ? 1 : 0; +} + +static void _enable_if_single_chest_selected(struct widget *w) +{ + w->enabled = 0; + + obstacle *o = single_tile_selection(OBJECT_OBSTACLE); + if (o) { + struct obstacle_spec *obs_spec = get_obstacle_spec(o->type); + if (obs_spec->action && !strncmp(obs_spec->action, "chest", 5)) + w->enabled = 1; + } +} + +static void _activate_if_enemies_not_shown(struct widget *w) +{ + WIDGET_BUTTON(w)->active = GameConfig.omit_enemies_in_level_editor; +} + +static void _activate_if_tooltips_not_shown(struct widget *w) +{ + WIDGET_BUTTON(w)->active = !GameConfig.show_lvledit_tooltips; +} + +static void _activate_if_collrects_not_shown(struct widget *w) +{ + WIDGET_BUTTON(w)->active = !draw_collision_rectangles; +} + +static void _activate_if_grid_shown(struct widget *w) +{ + WIDGET_BUTTON(w)->active = GameConfig.show_grid; +} + +static void _activate_if_obstacles_not_shown(struct widget *w) +{ + WIDGET_BUTTON(w)->active = GameConfig.omit_obstacles_in_level_editor; +} + +static void _activate_if_map_labels_not_shown(struct widget *w) +{ + WIDGET_BUTTON(w)->active = GameConfig.omit_map_labels_in_level_editor; +} + +static void _activate_if_zoom_off(struct widget *w) +{ + WIDGET_BUTTON(w)->active = !GameConfig.zoom_is_on; +} + +static void _activate_if_all_floors_not_shown(struct widget *w) +{ + w->enabled = selection_type() == OBJECT_FLOOR && EditLevel()->floor_layers > 1; + WIDGET_BUTTON(w)->active = !GameConfig.show_all_floor_layers; +} + +static void _activate_if_selection_of_obstacles(struct widget *w) +{ + WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_OBSTACLE); +} + +static void _activate_if_selection_of_tiles(struct widget *w) +{ + WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_FLOOR); +} + +static void _activate_if_selection_of_items(struct widget *w) +{ + WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_ITEM); +} + +static void _activate_if_selection_of_enemies(struct widget *w) +{ + WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_ENEMY); +} + +static void _activate_if_selection_of_waypoints(struct widget *w) +{ + WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_WAYPOINT); +} + +static void _activate_if_selection_of_map_labels(struct widget *w) +{ + WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_MAP_LABEL); +} + /** * This function returns the editor top level widget and creates it if necessary. */ + struct widget_group *get_lvledit_ui() { if (level_editor_widget_group) @@ -302,25 +426,21 @@ struct widget_group *get_lvledit_ui() int number_of_toggle_states; void (*activate_button)(struct widget_button *); void (*activate_button_secondary)(struct widget_button *); - void (WIDGET_ANONYMOUS_MARKER update)(struct widget *); + void (*update)(struct widget *); } b[] = { {LEVEL_EDITOR_UNDO_BUTTON, NULL, _("Undo\n\nUse this button to undo your last actions."), 1, undo_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = !list_empty(&to_undo); - }) + _enable_if_undo_list_not_empty }, {LEVEL_EDITOR_REDO_BUTTON, NULL, _("Redo\n\nUse this button to redo an action."), 1, redo_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = !list_empty(&to_redo); - }) + _enable_if_redo_list_not_empty }, {LEVEL_EDITOR_SAVE_SHIP_BUTTON, NULL, _("Save Map\n\nThis button will save your current map over the file '../map/levels.dat' from your current working directory."), @@ -341,125 +461,91 @@ struct widget_group *get_lvledit_ui() 1, delete_obstacle_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = !selection_empty(); - }) + _enable_is_selection_not_empty }, {LEVEL_EDITOR_NEXT_OBJECT_BUTTON, NULL, _("Next object on currently selected tile\n\nUse this button to cycle the currently marked object on this tile.\n\nYou can also use the N key for this."), 1, next_object_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = level_editor_can_cycle_marked_object(); - }) + _enable_if_can_cycle_marked_object }, {LEVEL_EDITOR_TOGGLE_WAYPOINT_CONNECTIONS_BUTTON, NULL, _("Toggle display waypoint connections\n\nUse this button to toggle between waypoint connections displayed on and off."), 2, toggle_waypoints_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = !GameConfig.show_wp_connections; - }) + _activate_if_show_wp_connections }, {LEVEL_EDITOR_NEW_OBSTACLE_LABEL_BUTTON, NULL, _("New obstacle label\n\nUse this button to attach a label to the currently marked obstacle. These obstacle labels can be used to define obstacles to be modified by events.\n"), 1, new_obstacle_label_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = single_tile_selection(OBJECT_OBSTACLE) ? 1 : 0; - }) + _enable_if_single_obstacle_selected }, {LEVEL_EDITOR_EDIT_CHEST_BUTTON, NULL, _("Edit chests contents\n\nUse this button to change the contents of the chest. If it is empty the game may generate random items at run time."), 1, edit_chest_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = 0; - - obstacle *o = single_tile_selection(OBJECT_OBSTACLE); - if (o) { - struct obstacle_spec *obs_spec = get_obstacle_spec(o->type); - if (obs_spec->action && !strncmp(obs_spec->action, "chest", 5)) - w->enabled = 1; - } - }) + _enable_if_single_chest_selected }, {LEVEL_EDITOR_TOGGLE_ENEMIES_BUTTON, NULL, _("Toggle display enemies\n\nUse this button to toggle between enemies displayed in level editor or enemies hidden in level editor."), 2, toggle_enemies_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = GameConfig.omit_enemies_in_level_editor; - }) + _activate_if_enemies_not_shown }, {LEVEL_EDITOR_TOGGLE_TOOLTIPS_BUTTON, NULL, _("Toggle display tooltips\n\nUse this button to toggle these annoying help windows on and off."), 2, toggle_tooltips_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = !GameConfig.show_lvledit_tooltips; - }) + _activate_if_tooltips_not_shown }, {LEVEL_EDITOR_TOGGLE_COLLISION_RECTS_BUTTON, NULL, _("Toggle display collision rectangles\n\nUse this button to toggle the visible collision rectangles on and off."), 2, toggle_collisions_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = !draw_collision_rectangles; - }) + _activate_if_collrects_not_shown }, {LEVEL_EDITOR_TOGGLE_GRID_BUTTON_OFF, NULL, _("Toggle grid mode.\n\nUse this button to toggle grid displaying on and off.\n\nUse right click to change the grid mode."), 2, toggle_grid_button_click, toggle_grid_button_right_click, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = GameConfig.show_grid; - }) + _activate_if_grid_shown }, {LEVEL_EDITOR_TOGGLE_OBSTACLES_BUTTON, NULL, _("Toggle display obstacles\n\nUse this button to toggle between obstacles displayed in level editor or obstacles hidden in level editor."), 2, toggle_obstacles_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = GameConfig.omit_obstacles_in_level_editor; - }) + _activate_if_obstacles_not_shown }, {LEVEL_EDITOR_TOGGLE_MAP_LABELS_BUTTON, NULL, _("Toggle display map labels name\n\nUse this button to toggle between map labels name displayed in level editor or map labels name hidden in level editor."), 2, toggle_map_labels_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = GameConfig.omit_map_labels_in_level_editor; - }) + _activate_if_map_labels_not_shown }, {LEVEL_EDITOR_ZOOM_IN_BUTTON, NULL, _("Zoom in/out\n\nUse this button to zoom INTO or OUT of the level.\n\nUse right click to change the zoom ratio.\n"), 2, zoom_in_button_click, zoom_in_button_right_click, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = !GameConfig.zoom_is_on; - }) + _activate_if_zoom_off }, {LEVEL_EDITOR_ALL_FLOOR_LAYERS_BUTTON, NULL, _("Toggle floor layers\n\nUse this button to toggle between all floor layers displayed or single floor layer displayed.\n\nUse right click to change the current floor layer.\n"), 2, floor_layers_button_click, floor_layers_button_right_click, - WIDGET_ANONYMOUS(struct widget *w, { - w->enabled = selection_type() == OBJECT_FLOOR && EditLevel()->floor_layers > 1; - WIDGET_BUTTON(w)->active = !GameConfig.show_all_floor_layers; - }) + _activate_if_all_floors_not_shown }, {LEVEL_EDITOR_QUIT_BUTTON, NULL, _("Test Map\n\nThis will save your map and reload it after you finish testing, avoiding saving an unclean world state."), @@ -487,36 +573,28 @@ struct widget_group *get_lvledit_ui() 2, typeselect_obstacle_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_OBSTACLE); - }) + _activate_if_selection_of_obstacles }, {LEVEL_EDITOR_TYPESELECT_FLOOR_BUTTON, _("Floor"), NULL, 2, typeselect_floor_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_FLOOR); - }) + _activate_if_selection_of_tiles }, {LEVEL_EDITOR_TYPESELECT_ITEM_BUTTON, _("Item"), NULL, 2, typeselect_item_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_ITEM); - }) + _activate_if_selection_of_items }, {LEVEL_EDITOR_TYPESELECT_ENEMY_BUTTON, _("Enemy"), NULL, 2, typeselect_enemy_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_ENEMY); - }) + _activate_if_selection_of_enemies }, //; TRANSLATORS: Waypoint {LEVEL_EDITOR_TYPESELECT_WAYPOINT_BUTTON, _("Wayp."), @@ -524,18 +602,14 @@ struct widget_group *get_lvledit_ui() 2, typeselect_waypoint_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_WAYPOINT); - }) + _activate_if_selection_of_waypoints }, {LEVEL_EDITOR_TYPESELECT_MAP_LABEL_BUTTON, _("Label"), NULL, 2, typeselect_map_label_button_click, NULL, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = (selection_type() == OBJECT_MAP_LABEL); - }) + _activate_if_selection_of_map_labels } }; diff --git a/src/quest_browser_ui.c b/src/quest_browser_ui.c index 510724a..4c0de14 100644 --- a/src/quest_browser_ui.c +++ b/src/quest_browser_ui.c @@ -540,6 +540,35 @@ static void display_dark_background(struct widget *w) draw_rectangle(&w->rect, 0, 0, 0, 150); } +// +// Widgets update callbacks +// + +static void _activate_if_open_missions_shown(struct widget *w) +{ + WIDGET_BUTTON(w)->active = current_quest_browser_mode == QUEST_BROWSER_SHOW_OPEN_MISSIONS; +} + +static void _activate_if_done_missions_shown(struct widget *w) +{ + WIDGET_BUTTON(w)->active = current_quest_browser_mode == QUEST_BROWSER_SHOW_DONE_MISSIONS; +} + +static void _activate_if_notes_shown(struct widget *w) +{ + WIDGET_BUTTON(w)->active = current_quest_browser_mode == QUEST_BROWSER_SHOW_NOTES; +} + +static void _activate_if_can_scroll_up(struct widget *w) +{ + WIDGET_BUTTON(w)->active = can_scroll_up(); +} + +static void _activate_if_can_scroll_down(struct widget *w) +{ + WIDGET_BUTTON(w)->active = can_scroll_down(); +} + /** * This function returns the quest log top level widget and creates it if necessary. */ @@ -605,34 +634,28 @@ struct widget_group *create_quest_browser() char *image[3]; SDL_Rect rect; void (*activate_button)(struct widget_button *); - void (WIDGET_ANONYMOUS_MARKER update) (struct widget *); + void (*update) (struct widget *); } b[] = { // Open quests { {"widgets/quest_open_off.png", NULL, "widgets/quest_open.png"}, {right_side_buttons_x, quest_browser_y + 37, 126, 29}, toggle_open_quests, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = current_quest_browser_mode == QUEST_BROWSER_SHOW_OPEN_MISSIONS; - }) + _activate_if_open_missions_shown }, // Done quests { {"widgets/quest_done_off.png", NULL, "widgets/quest_done.png"}, {right_side_buttons_x, quest_browser_y + 76, 126, 29}, toggle_done_quests, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = current_quest_browser_mode == QUEST_BROWSER_SHOW_DONE_MISSIONS; - }) + _activate_if_done_missions_shown }, // Notes { {"widgets/quest_notes_off.png", NULL, "widgets/quest_notes.png"}, {right_side_buttons_x, quest_browser_y + 115, 126, 29}, toggle_notes, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = current_quest_browser_mode == QUEST_BROWSER_SHOW_NOTES; - }) + _activate_if_notes_shown }, // Exit button { @@ -646,18 +669,14 @@ struct widget_group *create_quest_browser() {"widgets/scroll_up_off.png", NULL, "widgets/scroll_up.png"}, {quest_browser_x + quest_browser_w / 2 - 59, quest_browser_y - 14, 118, 17}, scroll_up, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = can_scroll_up(); - }) + _activate_if_can_scroll_up }, // Scroll down { {"widgets/scroll_down_off.png", NULL, "widgets/scroll_down.png"}, {quest_browser_x + quest_browser_w / 2 - 59, quest_browser_y + quest_browser_h, 118, 17}, scroll_down, - WIDGET_ANONYMOUS(struct widget *w, { - WIDGET_BUTTON(w)->active = can_scroll_down(); - }) + _activate_if_can_scroll_down } }; diff --git a/src/widgets/widgets.h b/src/widgets/widgets.h index 736f338..06ab4d7 100644 --- a/src/widgets/widgets.h +++ b/src/widgets/widgets.h @@ -49,7 +49,7 @@ /// \n /// The current GUI is drawn from the top of the tree down to the leaves, and /// from left to right for sibling widgets. Thus, the last child of a node -/// visually will cover its sibling, if drawn at the same position.\n +/// will visually cover its sibling, if drawn at the same position.\n /// All widgets positions are absolute, expressed in screen coordinates.\n /// \n /// An interaction event is propagated from the top of the current active GUI @@ -76,7 +76,7 @@ /// SDL_Rect rect; // Bounding box /// ... /// void (*display)(struct widget *); // Pseudo-virtual display function -/// void (WIDGET_ANONYMOUS_MARKER update)(struct widget *); // Pseudo_virtual update callback +/// void (*update)(struct widget *); // Pseudo-virtual update callback /// int (*handle_event)(struct widget *, SDL_Event *); // Pseudo-virtual event handler /// void (*free)(struct widget *); // Pseudo-virtual 'release' function /// ... @@ -169,7 +169,6 @@ /// attribute. To update itself, a widget shall overload the \e update() /// pseudo-virtual function. That function is called when needed by the gui /// subsystem engine.\n -/// Note: An \e update() function \b has to be an anonymous function (see below). /// \code /// void my_button_update(struct widget *this_widget) /// { @@ -181,38 +180,7 @@ /// } /// /// struct widget_button *my_button = widget_button_create(); -/// WIDGET(my_button)->update = WIDGET_ANONYMOUS(struct widget *w, { my_button_update(w); }); -/// \endcode -/// \n -/// Most of the time, an \update() function is a single line of code, such as -/// setting one widget's attribute depending of an other value. Sometime, a -/// more complex code is to be called. We would thus like to be able to set -/// an \e update() function as a pointer to an actual named function or to an -/// anonymous function.\n -/// To simulate an anonymous function definition, a WIDGET_ANONYMOUS -/// macro has been defined (see http://en.wikipedia.org/wiki/Anonymous_function#C_.28non-standard_extension.29). -/// The code inside an anonymous function can be as complex as wanted, but -/// for readability large code should be avoided. -/// \n -/// Note: Due to the way WIDGET_ANONYMOUS is implemented with some compilers -/// (clang, especially), \b all \e update() functions have to be defined using -/// WIDGET_ANONYMOUS, even if a simple function's pointer would usually be enough -/// (see above example). -/// \n -/// The former example can, for instance be rewritten: -/// \code -/// WIDGET(my_button)->update = WIDGET_ANONYMOUS(struct widget *w, { -/// WIDGET_BUTTON(w)->image = (some_global_variable == some_value) ? img1 : img2; -/// }); -/// \endcode -/// \n -/// To call of function returning a value that can be stored in the widget's -/// attribute, one will write: -/// \code -/// struct image *get_img() { ... } -/// WIDGET(my_button)->update = WIDGET_ANONYMOUS(struct widget *w, { -/// WIDGET_BUTTON(w)->image = get_img(); -/// }); +/// WIDGET(my_button)->update = my_button_update; /// \endcode /// /// \par Creating a GUI @@ -278,6 +246,9 @@ /// \n /// Example: /// \code +/// static void _enable_if_panel_open(struct widget *) { +/// w->enabled = Game.panel_open; +/// } /// ... /// my_gui_root = widget_group_create(); /// widget_set_rect(WIDGET(my_gui_root), gui_x, gui_y, gui_width, gui_height); @@ -290,7 +261,7 @@ /// // create the invisible panel and add it to the root node /// panel = widget_group_create(); /// WIDGET(panel)->enabled = FALSE; -/// WIDGET(panel)->update = WIDGET_ANONYMOUS(struct widget *w, { w->enabled = Game.panel_opened; }); +/// WIDGET(panel)->update = _enable_if_panel_open; /// ... /// widget_group_add(my_gui_root, WIDGET(panel)); /// \endcode @@ -338,12 +309,6 @@ #define EXTERN #endif -#ifdef __clang__ -#define WIDGET_ANONYMOUS_MARKER ^ -#else -#define WIDGET_ANONYMOUS_MARKER * -#endif - /////////////////////////////////////////////////////////////////////////////// /// \defgroup gui2d_widget Base widget type /// \ingroup gui2d @@ -406,7 +371,7 @@ struct widget { /// by inheriting widgets. /// @{ void (*display) (struct widget *); /**< Display the widget. */ - void (WIDGET_ANONYMOUS_MARKER update) (struct widget *); /**< Update the widget's attributes. */ + void (*update) (struct widget *); /**< Update the widget's attributes. */ int (*handle_event) (struct widget *, SDL_Event *); /**< General event handler. */ void (*free) (struct widget *); /**< Free the widget. */ /// @} @@ -428,62 +393,6 @@ struct widget { */ #define WIDGET(x) ((struct widget *)x) -/** - * \brief Macro used to create an anonymous function. - * - * Currenly only used to define \e update() functions. - * \n - * Usage examples:\n - * - Set the \e enabled attribute to the value of one game data - * \code - * the_widget->update = WIDGET_ANONYMOUS(struct widget *w, { - * widget_type(w)->enabled = boolean_game_data; - * }); - * \endcode - * - Set the \e enabled attribute depending on the value of one game data - * \code - * the_widget->update = WIDGET_ANONYMOUS(struct widget *w, { - * widget_type(w)->enabled = (int_game_data >= 0.5) ? TRUE : FALSE; - * }); - * \endcode - * - Set the \e enabled attribute to be the result of a function call - * \code - * the_widget->update = WIDGET_ANONYMOUS(struct widget *w, { - * widget_type(w)->enabled = compute_value(some_game_data...); - * }); - * \endcode - * - Call a function - * \code - * the_widget->update = WIDGET_ANONYMOUS(struct widget *w, { - * some_function(w, ...); - * }); - * \endcode - * - * \param param 'signature' of the callback function - * \param code the code to execute (has to be enclosed into curly brackets) - */ -/* - * Implementation note. - * The goal of the macro is to create an anonymous function and to return a - * pointer to this function. - * On gcc, this is done with the use of a compound statement expression and a - * nested function declared inside the compound block (gcc extensions). - * On clang, which does not implement nested functions, this is done with the - * use of the clang 'block' extension. - */ -#ifdef __clang__ -#define WIDGET_ANONYMOUS(param, code) \ - ^void(param) \ - code -#else -#define WIDGET_ANONYMOUS(param, code) \ - ({ \ - void anonymous_func(param) \ - code \ - anonymous_func; \ - }) -#endif - struct widget *widget_create(void); void widget_init(struct widget *); void widget_set_rect(struct widget *, int, int, int, int); ----------------------------------------------------------------------- Summary of changes: configure.ac | 33 ------ m4/blocks.m4 | 63 ------------ src/chat.c | 60 ++++++++---- src/game_ui.c | 108 +++++++++++++------- src/lvledit/lvledit_widgets.c | 220 +++++++++++++++++++++++++++-------------- src/quest_browser_ui.c | 51 +++++++--- src/widgets/widget_group.c | 3 +- src/widgets/widgets.h | 107 ++------------------ 8 files changed, 302 insertions(+), 343 deletions(-) delete mode 100644 m4/blocks.m4 hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-05-25 12:25:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via ad89f0f6dace4516ac08c77c0ec2e03c81b78cfa (commit) from 61acdcb67349db8ec3d5cddfa37493947cc46f80 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=ad89f0f6dace4516ac08c77c0ec2e03c81b78cfa commit ad89f0f6dace4516ac08c77c0ec2e03c81b78cfa Author: fluzz <fl...@gm...> Date: Mon May 25 14:22:52 2015 +0200 Configure output: add a default summary_lua, so that the final report prints "use Lua library: embedded" when 'configure' is run with --with-embedded-lua diff --git a/configure.ac b/configure.ac index 5c1610b..5df1091 100644 --- a/configure.ac +++ b/configure.ac @@ -125,6 +125,7 @@ dnl Checks for libraries. AS_BOX([Checking compulsory libraries]) dnl Force use of embedded lua in ASAN mode +summary_lua="embedded" AS_VAR_IF([sanitize_address], [yes], [ embedded_lua="yes" @@ -311,7 +312,7 @@ AS_VAR_IF([embedded_lua], [no], ], [ embedded_lua="yes" - summary_lua="embedded" + summary_lua="embedded (due to Lua not found system-wide)" AC_MSG_NOTICE([No system-wide Lua library found! Using embedded Lua instead]) ] ) ----------------------------------------------------------------------- Summary of changes: configure.ac | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-05-25 12:03:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via 61acdcb67349db8ec3d5cddfa37493947cc46f80 (commit) from a936df6c8a67cf7661ba41e2057b827ca0473a4b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=61acdcb67349db8ec3d5cddfa37493947cc46f80 commit 61acdcb67349db8ec3d5cddfa37493947cc46f80 Author: fluzz <fl...@gm...> Date: Mon May 25 13:59:27 2015 +0200 Entirely initialize 'enter_event' and 'leave-event', to avoid valgrind to complain that a "Conditional jump or move depends on uninitialised value(s)" when those data are used in lvledit_widget_categoryselect.c:40 diff --git a/src/widgets/widget_group.c b/src/widgets/widget_group.c index c10766e..7d7d8b0 100644 --- a/src/widgets/widget_group.c +++ b/src/widgets/widget_group.c @@ -63,12 +63,8 @@ static void widget_group_free(struct widget *w); static int group_mouse_event(struct widget *wg, SDL_Event *event) { struct widget *w, *current_widget = NULL; - SDL_Event enter_event; - enter_event.type = SDL_USEREVENT; - enter_event.user.code = EVENT_MOUSE_ENTER; - SDL_Event leave_event; - leave_event.type = SDL_USEREVENT; - leave_event.user.code = EVENT_MOUSE_LEAVE; + SDL_Event enter_event = { .user = { .type = SDL_USEREVENT, .code = EVENT_MOUSE_ENTER } }; + SDL_Event leave_event = { .user = { .type = SDL_USEREVENT, .code = EVENT_MOUSE_LEAVE } }; // Get the widget under the cursor. // The loop is done in reverse to ensure that widgets covering other widgets catch the event first. ----------------------------------------------------------------------- Summary of changes: src/widgets/widget_group.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) hooks/post-receive -- freedroidRPG |
From: fluzz <fl...@us...> - 2015-05-25 11:37:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "freedroidRPG". The branch, master has been updated via a936df6c8a67cf7661ba41e2057b827ca0473a4b (commit) from 8448dd0a6efba2c281ba349e81436773da7191a9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://freedroid.git.sourceforge.net/git/gitweb.cgi?p=freedroid/freedroid;a=commit;h=a936df6c8a67cf7661ba41e2057b827ca0473a4b commit a936df6c8a67cf7661ba41e2057b827ca0473a4b Author: Gregory Lozet <gre...@gm...> Date: Wed May 20 23:11:34 2015 +0200 Fix some memory leaks Add calls to free() and 'destructors' in several places to fix some memory leaks detected by valgrind. diff --git a/src/action.c b/src/action.c index f7a5b78..df7d813 100644 --- a/src/action.c +++ b/src/action.c @@ -149,9 +149,6 @@ static void throw_out_all_chest_content(int obst_index) } // Empty the item list - for (i = 0; i < drop_count; i++) { - dynarray_del(item_list, 0, sizeof(item)); - } dynarray_free(item_list); // Remove the chest items obstacle extension diff --git a/src/benchmark.c b/src/benchmark.c index 477e099..4d7507c 100644 --- a/src/benchmark.c +++ b/src/benchmark.c @@ -188,6 +188,7 @@ static int mapgen_bench() timer_start(); while (loop--) { CreateNewMapLevel(0); + curShip.num_levels = 1; level *l = curShip.AllLevels[0]; l->xlen = 90; l->ylen = 90; diff --git a/src/influ.c b/src/influ.c index 553ce7e..2967faf 100644 --- a/src/influ.c +++ b/src/influ.c @@ -1637,6 +1637,16 @@ void free_tux() } } + for (i = 0; i < MAX_ITEMS_IN_INVENTORY; i++) { + if (Me.Inventory[i].type != -1) { + delete_upgrade_sockets(&Me.Inventory[i]); + } + } + delete_upgrade_sockets(&Me.weapon_item); + delete_upgrade_sockets(&Me.drive_item); + delete_upgrade_sockets(&Me.armour_item); + delete_upgrade_sockets(&Me.shield_item); + delete_upgrade_sockets(&Me.special_item); } /** diff --git a/src/lvledit/lvledit_actions.c b/src/lvledit/lvledit_actions.c index 0072ef9..bb860d3 100644 --- a/src/lvledit/lvledit_actions.c +++ b/src/lvledit/lvledit_actions.c @@ -57,6 +57,8 @@ static void clear_action(action * action) free(action->d.change_obstacle_name.new_name); else if (action->type == ACT_SET_MAP_LABEL && action->d.change_label_name.new_name != NULL) free(action->d.change_label_name.new_name); + else if (action->type == ACT_CREATE_MAP_LABEL && action->d.create_map_label.label_name != NULL) + free(action->d.create_map_label.label_name); else if (action->type == ACT_CREATE_ENEMY && action->d.create_enemy != NULL) enemy_free(action->d.create_enemy); @@ -572,10 +574,10 @@ static void action_change_map_label(level *EditLevel, int i, char *name, int x, map_label = &ACCESS_MAP_LABEL(EditLevel->map_labels, i); // Get the old label for undoable actions - old_label = map_label->label_name; + old_label = strdup(map_label->label_name); // Delete the map label - del_map_label(EditLevel, old_label); + del_map_label(EditLevel, map_label->label_name); } action_push(ACT_SET_MAP_LABEL, i, old_label, x, y); @@ -584,10 +586,10 @@ static void action_change_map_label(level *EditLevel, int i, char *name, int x, if (!name || !strlen(name)) return; - name = strdup(name); - // Create a new map label at the position of cursor - add_map_label(EditLevel, x, y, name); + char *new_label_name = strdup(name); + add_map_label(EditLevel, x, y, new_label_name); + free(new_label_name); } void level_editor_action_change_map_label_user(level *EditLevel, float x, float y) @@ -645,6 +647,7 @@ void level_editor_action_change_map_label_user(level *EditLevel, float x, float // Change a map label when the name enter by the user is valid action_change_map_label(EditLevel, i, name, rintf(x - 0.5), rintf(y - 0.5)); + free(name); } /** @@ -982,33 +985,9 @@ void CreateNewMapLevel(int level_num) void delete_map_level(int lnum) { - int i; - level *l = curShip.AllLevels[lnum]; - - free(l->Levelname); - free(l->Background_Song_Name); - - // Clear out all the existing glue information. - free_glued_obstacles(l); - - // Delete floor tiles - for (i = 0; i < l->ylen; i++) - free(l->map[i]); - - // Free obstacle extensions. - dynarray_free(&l->obstacle_extensions); - - // Free map labels. - dynarray_free(&l->map_labels); - - // Free waypoints. - dynarray_free(&l->waypoints); - - // Free memory - free(curShip.AllLevels[lnum]); - curShip.AllLevels[lnum] = NULL; - // Remove references to this level from others + level *l = NULL; + BROWSE_LEVELS(l) { if (l->jump_target_north == lnum) l->jump_target_north = -1; @@ -1020,6 +999,10 @@ void delete_map_level(int lnum) l->jump_target_east = -1; } + // Free memory + free_ship_level(curShip.AllLevels[lnum]); + curShip.AllLevels[lnum] = NULL; + if (lnum == curShip.num_levels - 1) curShip.num_levels--; @@ -1028,7 +1011,6 @@ void delete_map_level(int lnum) action_freestack(); clear_selection(-1); clear_clipboard(-1); - } static int get_chest_contents(level *l, obstacle *o, item *items[MAX_ITEMS_IN_INVENTORY]) diff --git a/src/lvledit/lvledit_enemy.c b/src/lvledit/lvledit_enemy.c index 60652e5..1ecb3d9 100644 --- a/src/lvledit/lvledit_enemy.c +++ b/src/lvledit/lvledit_enemy.c @@ -173,7 +173,7 @@ static void edit_special_force_info(enemy *en) // Edit the faction user_input = GetEditableStringInPopupWindow(sizeof(suggested_val) - 1, displayed_text->value, suggested_val); if (!user_input) - return; + goto out; en->faction = get_faction_id(user_input); @@ -182,6 +182,7 @@ static void edit_special_force_info(enemy *en) free(user_input); // Change the dialog + user_input = NULL; while (1) { user_input = GetEditableStringInPopupWindow(sizeof(suggested_val) - 1, displayed_text->value, suggested_val); if (!user_input) @@ -193,6 +194,7 @@ static void edit_special_force_info(enemy *en) alert_window(_("Dialog \"%s\" not found!"), user_input); RestoreMenuBackground(0); sprintf(suggested_val, "%s", user_input); + free(user_input); } free(en->dialog_section_name); @@ -228,6 +230,8 @@ static void edit_special_force_info(enemy *en) en->CompletelyFixed = 0; break; } + + free(user_input); } // TRANSLATORS: the max. distance the bot can move away from its spawn position @@ -239,7 +243,7 @@ static void edit_special_force_info(enemy *en) while(1) { numb = get_number_popup(displayed_text->value, suggested_val); if (numb == -2) - return; + goto out; if (numb != -1) break; @@ -273,12 +277,14 @@ static void edit_special_force_info(enemy *en) alert_window(_("Item \"%s\" not found!"), user_input); RestoreMenuBackground(0); sprintf(suggested_val, "%s", user_input); + free(user_input); } // TRANSLATORS: Will the bot walk towards tux as soon as he seems tux? autostr_append(displayed_text, _("%s\n Approaches Tux: "), (en->on_death_drop_item_code == -1) ? _("none") : ItemMap[en->on_death_drop_item_code].id); sprintf(suggested_val, "%s", en->will_rush_tux ? _("yes") : _("no")); + free(user_input); // Rush Tux while (1) { @@ -294,7 +300,10 @@ static void edit_special_force_info(enemy *en) en->will_rush_tux = 0; break; } + + free(user_input); } + free(user_input); out: free_autostr(displayed_text); diff --git a/src/lvledit/lvledit_tool_select.c b/src/lvledit/lvledit_tool_select.c index 55f186b..1ee5096 100644 --- a/src/lvledit/lvledit_tool_select.c +++ b/src/lvledit/lvledit_tool_select.c @@ -320,6 +320,9 @@ static void __clear_selected_list(struct list_head *lst, int nbelem, int is_clip /* Clearing the clipboard requires freeing the wrapped floor tiles */ struct lvledit_map_tile *t = e->data; free(t->tile); + } else if (e->type == OBJECT_MAP_LABEL && is_clipboard) { + struct map_label *m = e->data; + free(m->label_name); } free(e->data); } @@ -1017,7 +1020,7 @@ void level_editor_copy_selection() case OBJECT_MAP_LABEL: m = MyMalloc(sizeof(map_label)); memcpy(m, e->data, sizeof(map_label)); - + m->label_name = strdup(((map_label*) e->data)->label_name); add_object_to_list(&clipboard_elements, m, OBJECT_MAP_LABEL); break; default: diff --git a/src/map.c b/src/map.c index 1def707..f621249 100644 --- a/src/map.c +++ b/src/map.c @@ -359,9 +359,9 @@ static void decode_random_droids(level *loadlevel, char *data) if (loadlevel->random_droids.nr <= 0) return; + // Now we read in the type(s) of random droids for this level data = strstr(data, ALLOWED_TYPE_INDICATION_STRING); - // Now we read in the type(s) of random droids for this level search_ptr = ReadAndMallocStringFromDataOptional(data, ALLOWED_TYPE_INDICATION_STRING, "\n"); if (search_ptr) { char *droid_type_ptr = search_ptr; diff --git a/src/map_label.c b/src/map_label.c index 8b65036..c457b86 100644 --- a/src/map_label.c +++ b/src/map_label.c @@ -64,6 +64,8 @@ void del_map_label(level *lvl, const char *label_name) if (!strcmp(map_label->label_name, label_name)) { // Delete the map label + free(map_label->label_name); + map_label->label_name = NULL; dynarray_del(&lvl->map_labels, i, sizeof(struct map_label)); return; } diff --git a/src/npc.c b/src/npc.c index fdaae2c..51aea30 100644 --- a/src/npc.c +++ b/src/npc.c @@ -98,6 +98,15 @@ void clear_npcs() n->shoplistweight[i] = 0; } + for (i = 0; i < n->enabled_nodes.size; i++) { + char **ptr = dynarray_member(&n->enabled_nodes, i, sizeof(char *)); + free(*ptr); + *ptr = NULL; + } + dynarray_free(&n->enabled_nodes); + + npc_clear_inventory(n); + free(n); } @@ -127,6 +136,14 @@ int npc_add_shoplist(const char *dialog_basename, const char *item_name, int wei static void npc_clear_inventory(struct npc *n) { + int i; + + // delete the upgrade sockets of the items + for (i = 0; i < n->npc_inventory.size; i++) { + item* it = &((item *)(n->npc_inventory.arr))[i]; + delete_upgrade_sockets(it); + } + dynarray_free(&n->npc_inventory); } diff --git a/src/obstacle_extension.c b/src/obstacle_extension.c index fc211cd..330e6d6 100644 --- a/src/obstacle_extension.c +++ b/src/obstacle_extension.c @@ -134,6 +134,9 @@ void del_obstacle_extension(level *lvl, obstacle *obs, enum obstacle_extension_t if (ext->type != type) continue; + free(ext->data); + ext->data = NULL; + dynarray_del(&lvl->obstacle_extensions, i, sizeof(struct obstacle_extension)); } } @@ -149,6 +152,9 @@ void del_obstacle_extensions(level *lvl, obstacle *obs) if (ext->obs != obs) continue; + free(ext->data); + ext->data = NULL; + dynarray_del(&lvl->obstacle_extensions, i, sizeof(struct obstacle_extension)); } } @@ -166,7 +172,6 @@ void add_obstacle_extension(level *lvl, obstacle *obs, enum obstacle_extension_t ext.obs = obs; ext.data = data; - dynarray_add(&lvl->obstacle_extensions, &ext, sizeof(struct obstacle_extension)); } ----------------------------------------------------------------------- Summary of changes: src/action.c | 3 -- src/benchmark.c | 1 + src/influ.c | 10 ++++++++ src/lvledit/lvledit_actions.c | 46 +++++++++++------------------------- src/lvledit/lvledit_enemy.c | 13 +++++++++- src/lvledit/lvledit_tool_select.c | 5 +++- src/map.c | 2 +- src/map_label.c | 2 + src/npc.c | 17 +++++++++++++ src/obstacle_extension.c | 7 +++++- 10 files changed, 66 insertions(+), 40 deletions(-) hooks/post-receive -- freedroidRPG |