[Scummvm-git-logs] scummvm-tools master -> 33cd9ff5061144bb463d74de15d124f4f763bf9c

criezy criezy at scummvm.org
Sat Dec 16 23:25:37 CET 2017


This automated email contains information about 6 new commits which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
ad0806d01f COMMON: Rename String::printf to format to match ScummVM
9acf70e2f5 COMMON: Add some Common::String/std::string interoperability functions
4f05f4e5cf PRINCE: Replace C++11 string functions
045655b8c0 RISCOS: Add RISC OS support
a71bab1c9a RISCOS: Improved freetype detection
33cd9ff506 TOOLS: Use operator[](0) instead of std::string::front()


Commit: ad0806d01fc0daef35893ce0c7426a217e51bd13
    https://github.com/scummvm/scummvm-tools/commit/ad0806d01fc0daef35893ce0c7426a217e51bd13
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2017-12-16T22:13:36Z

Commit Message:
COMMON: Rename String::printf to format to match ScummVM

Changed paths:
    common/str.cpp
    common/str.h


diff --git a/common/str.cpp b/common/str.cpp
index d842ba7..f7d8e62 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -433,7 +433,7 @@ uint String::hash() const {
 }
 
 // static
-String String::printf(const char *fmt, ...) {
+String String::format(const char *fmt, ...) {
 	String output;
 	assert(output.isStorageIntern());
 
diff --git a/common/str.h b/common/str.h
index e517bcb..382263f 100644
--- a/common/str.h
+++ b/common/str.h
@@ -218,7 +218,7 @@ public:
 	/**
 	 * Printf-like function. Returns a formatted String.
 	 */
-	static Common::String printf(const char *fmt, ...) GCC_PRINTF(1,2);
+	static Common::String format(const char *fmt, ...) GCC_PRINTF(1,2);
 
 public:
 	typedef char *        iterator;


Commit: 9acf70e2f58de03e8e3ad180f1dbbc21a706b1a9
    https://github.com/scummvm/scummvm-tools/commit/9acf70e2f58de03e8e3ad180f1dbbc21a706b1a9
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2017-12-16T22:13:47Z

Commit Message:
COMMON: Add some Common::String/std::string interoperability functions

Changed paths:
    common/file.cpp
    common/file.h
    common/str.cpp
    common/str.h


diff --git a/common/file.cpp b/common/file.cpp
index 051ccff..20d3b48 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -25,6 +25,7 @@
  */
 
 #include "file.h"
+#include "common/str.h"
 #include <stdarg.h>
 #include <stdio.h>
 #include <assert.h>
@@ -56,11 +57,17 @@ namespace Common {
 Filename::Filename() {
 }
 Filename::Filename(const char *path) : _path(path) {
-	// If this is a directory append '/' at the end if needed.
-	if (!_path.empty() && _path[_path.size() - 1] != '/' && _path[_path.size() - 1] != '\\' && isDirectory(_path.c_str()))
-		_path += '/';
+	postInitWithString();
+}
+Filename::Filename(const std::string &path) : _path(path) {
+	postInitWithString();
 }
-Filename::Filename(std::string path) : _path(path) {
+
+Filename::Filename(const Common::String &path) : _path(path.c_str()) {
+	postInitWithString();
+}
+
+void Filename::postInitWithString() {
 	// If this is a directory append '/' at the end if needed.
 	if (!_path.empty() && _path[_path.size() - 1] != '/' && _path[_path.size() - 1] != '\\' && isDirectory(_path.c_str()))
 		_path += '/';
diff --git a/common/file.h b/common/file.h
index 956b8f7..9ab7406 100644
--- a/common/file.h
+++ b/common/file.h
@@ -35,6 +35,8 @@
 
 namespace Common {
 
+class String;
+
 /**
  * Something unexpected happened while reading / writing to a file.
  * Usually premature end, or that it could not be opened (write / read protected).
@@ -53,7 +55,8 @@ public:
 	std::string _path;
 
 	Filename();
-	Filename(std::string path);
+	Filename(const std::string &path);
+	Filename(const Common::String &path);
 	Filename(const char *path);
 	Filename(const Filename &path);
 	Filename& operator=(const Filename &fn);
@@ -149,6 +152,9 @@ public:
 	 * Returns the path of the filename, the name and extension of the file is stripped.
 	 */
 	std::string getPath() const;
+
+private:
+	void postInitWithString();
 };
 
 /**
diff --git a/common/str.cpp b/common/str.cpp
index f7d8e62..5bd0c36 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -101,6 +101,10 @@ String::String(const String &str)
 	assert(_str != 0);
 }
 
+String::String(const std::string &str) {
+	initWithCStr(str.c_str(), str.size());
+}
+
 String::String(char c)
 : _size(0), _str(_storage) {
 
diff --git a/common/str.h b/common/str.h
index 382263f..211f8be 100644
--- a/common/str.h
+++ b/common/str.h
@@ -29,6 +29,7 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
+#include <string>
 
 namespace Common {
 
@@ -107,6 +108,9 @@ public:
 	/** Construct a copy of the given string. */
 	String(const String &str);
 
+	/** Construct a copy of the given string. */
+	String(const std::string &str);
+
 	/** Construct a string consisting of the given character. */
 	explicit String(char c);
 


Commit: 4f05f4e5cfdd56462a038d42d4a7ef8ce4317637
    https://github.com/scummvm/scummvm-tools/commit/4f05f4e5cfdd56462a038d42d4a7ef8ce4317637
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2017-12-16T22:13:57Z

Commit Message:
PRINCE: Replace C++11 string functions

Changed paths:
    engines/prince/extract_prince.cpp
    engines/prince/extract_prince.h


diff --git a/engines/prince/extract_prince.cpp b/engines/prince/extract_prince.cpp
index b0d8ead..00d7fda 100644
--- a/engines/prince/extract_prince.cpp
+++ b/engines/prince/extract_prince.cpp
@@ -19,9 +19,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include <string.h>
 #include "extract_prince.h"
 #include "common/endian.h"
+#include "common/str.h"
 
 struct FileData;
 
@@ -163,16 +163,16 @@ void ExtractPrince::execute() {
 
 		int mobFileNumber;
 		for (mobFileNumber = 1; mobFileNumber <= 9; ++mobFileNumber) {
-			if (Common::Filename(mainDir.getFullPath() + "mob0" + std::to_string(mobFileNumber) + ".lst").exists() == true) {
+			if (Common::Filename(mainDir.getFullPath() + Common::String::format("mob0%d.lst", mobFileNumber)).exists() == true) {
 				_fFiles.print("%d.\n", mobFileNumber);
-				exportMobs(loadFile(mainDir.getFullPath() + "mob0" + std::to_string(mobFileNumber) + ".lst"));
+				exportMobs(loadFile(mainDir.getFullPath() + Common::String::format("mob0%d.lst", mobFileNumber)));
 				print("Processing mob0%d.lst", mobFileNumber);
 			}
 		}
 		for (mobFileNumber = 10; mobFileNumber <= 61; ++mobFileNumber) {
-			if (Common::Filename(mainDir.getFullPath() + "mob" + std::to_string(mobFileNumber) + ".lst").exists() == true) {
+			if (Common::Filename(mainDir.getFullPath() + Common::String::format("mob%d.lst", mobFileNumber)).exists() == true) {
 				_fFiles.print("%d.\n", mobFileNumber);
-				exportMobs(loadFile(mainDir.getFullPath() + "mob" + std::to_string(mobFileNumber) + ".lst"));
+				exportMobs(loadFile(mainDir.getFullPath() + Common::String::format("mob%d.lst", mobFileNumber)));
 				print("Processing mob%d.lst...", mobFileNumber);
 			}
 		}
@@ -250,7 +250,7 @@ ExtractPrince::FileData ExtractPrince::loadFile(int itemIndex) {
 	return fileData;
 }
 // Uncompressed datafile loader
-ExtractPrince::FileData ExtractPrince::loadFile(std::string fileName) {
+ExtractPrince::FileData ExtractPrince::loadFile(const Common::String &fileName) {
 	Common::File file;
 	file.open(fileName, "rb");
 	if (!file.isOpen()) {
diff --git a/engines/prince/extract_prince.h b/engines/prince/extract_prince.h
index cc440ce..a627457 100644
--- a/engines/prince/extract_prince.h
+++ b/engines/prince/extract_prince.h
@@ -49,7 +49,7 @@ protected:
 	static void decrypt(byte *buffer, uint32 size);
 
 	FileData loadFile(int itemIndex);
-	FileData loadFile(std::string fileName);
+	FileData loadFile(const Common::String &fileName);
 	char correctPolishLetter(char c);
 
 	void exportMobs(FileData fileData);


Commit: 045655b8c0f89cccca0d3d37438decf21871481d
    https://github.com/scummvm/scummvm-tools/commit/045655b8c0f89cccca0d3d37438decf21871481d
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2017-12-16T22:16:00Z

Commit Message:
RISCOS: Add RISC OS support

Changed paths:
  A dists/riscos/!Boot,feb
  A dists/riscos/!Run,feb
  A dists/riscos/!Sprites,ff9
  A dists/riscos/!Sprites11,ff9
    .gitignore
    Makefile
    configure


diff --git a/.gitignore b/.gitignore
index 1380edb..7d8cd50 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,8 @@
 /ScummVM Tools.app
 /scummvm-tools
 /scummvm-tools-cli
+/\!ScummTool
+/*,e1f
 /config.mk
 /config.h
 /config.log
diff --git a/Makefile b/Makefile
index 69dda95..c7325df 100644
--- a/Makefile
+++ b/Makefile
@@ -260,3 +260,47 @@ endif
 	cp $(srcdir)/COPYING $(AMIGAOS4PATH)/tools/COPYING.txt
 	cp $(srcdir)/README $(AMIGAOS4PATH)/tools/README.txt
 	cp $(srcdir)/NEWS $(AMIGAOS4PATH)/tools/NEWS.txt
+
+#
+# RISC OS specific
+#
+
+# Special target to create an RISC OS snapshot installation
+riscosdist: all
+	mkdir -p !ScummTool
+	cp ${srcdir}/dists/riscos/!Boot,feb !ScummTool/!Boot,feb
+	cp ${srcdir}/dists/riscos/!Run,feb !ScummTool/!Run,feb
+	cp ${srcdir}/dists/riscos/!Sprites,ff9 !ScummTool/!Sprites,ff9
+	cp ${srcdir}/dists/riscos/!Sprites11,ff9 !ScummTool/!Sprites11,ff9
+	cp $(srcdir)/README !ScummTool/!Help,fff
+	cp $(srcdir)/COPYING !ScummTool/COPYING,fff
+	cp $(srcdir)/NEWS !ScummTool/NEWS,fff
+	mkdir -p !ScummTool/bin
+	elf2aif construct_mohawk$(EXEEXT) !ScummTool/bin/construct_mohawk,ff8
+	elf2aif decine$(EXEEXT) !ScummTool/bin/decine,ff8
+	elf2aif degob$(EXEEXT) !ScummTool/bin/degob,ff8
+	elf2aif dekyra$(EXEEXT) !ScummTool/bin/dekyra,ff8
+	elf2aif deriven$(EXEEXT) !ScummTool/bin/deriven,ff8
+	elf2aif descumm$(EXEEXT) !ScummTool/bin/descumm,ff8
+	elf2aif desword2$(EXEEXT) !ScummTool/bin/desword2,ff8
+	elf2aif extract_mohawk$(EXEEXT) !ScummTool/bin/extract_mohawk,ff8
+	elf2aif gob_loadcalc$(EXEEXT) !ScummTool/bin/gob_loadcalc,ff8
+	elf2aif scummvm-tools-cli$(EXEEXT) !ScummTool/bin/scummvm-tools-cli,ff8
+ifeq "$(USE_FREETYPE)" "1"
+ifeq "$(USE_ICONV)" "1"
+	elf2aif create_sjisfnt$(EXEEXT) !ScummTool/bin/create_sjisfnt,ff8
+	echo "Set Alias\$$create_sjisfnt <ScummTool\$$Dir>.bin.create_sjisfnt %%*0" >> !ScummTool/!Boot,feb
+endif
+endif
+ifeq "$(USE_BOOST)" "1"
+	elf2aif decompile$(EXEEXT) !ScummTool/bin/decompile,ff8
+	echo "Set Alias\$$decompile <ScummTool\$$Dir>.bin.decompile %%*0" >> !ScummTool/!Boot,feb
+endif
+ifeq "$(USE_WXWIDGETS)" "1"
+	elf2aif scummvm-tools$(EXEEXT) !ScummTool/bin/scummvm-tools,ff8
+	echo "Set Alias\$$scummvm-tools <ScummTool\$$Dir>.bin.scummvm-tools %%*0" >> !ScummTool/!Boot,feb
+	mkdir -p !ScummTool/bin/media
+	cp $(srcdir)/gui/media/detaillogo.jpg !ScummTool/bin/media/detaillogo.jpg,c85
+	cp $(srcdir)/gui/media/logo.jpg !ScummTool/bin/media/logo.jpg,c85
+	cp $(srcdir)/gui/media/tile.gif !ScummTool/bin/media/tile.gif,695
+endif
diff --git a/configure b/configure
index abbd1e6..46298fa 100755
--- a/configure
+++ b/configure
@@ -269,8 +269,8 @@ find_wxconfig() {
 #
 get_system_exe_extension() {
 	case $1 in
-	arm-riscos)
-		_exeext=",ff8"
+	riscos)
+		_exeext=",e1f"
 		;;
 	dreamcast | ds | gamecube | n64 | ps2 | psp | wii)
 		_exeext=".elf"
@@ -517,10 +517,6 @@ android | android-v7a)
 	_host_cpu=arm
 	_host_alias=arm-linux-androideabi
 	;;
-arm-riscos)
-	_host_os=riscos
-	_host_cpu=arm
-	;;
 bada)
 	_host_os=bada
 	if test "$_debug_build" = yes; then
@@ -1244,6 +1240,14 @@ case $_host_os in
 	mint*)
 		DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
 		;;
+	riscos)
+		DEFINES="$DEFINES -DRISCOS"
+		add_line_to_config_mk 'RISCOS = 1'
+		LDFLAGS="$LDFLAGS -L$GCCSDK_INSTALL_ENV/lib"
+		CXXFLAGS="$CXXFLAGS -I$GCCSDK_INSTALL_ENV/include"
+		_wxconfig=$GCCSDK_INSTALL_ENV/bin/wx-config
+		LDFLAGS="$LDFLAGS -static"
+		;;
 	solaris*)
 		DEFINES="$DEFINES -DSOLARIS"
 		DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
@@ -1258,13 +1262,20 @@ if test -n "$_host"; then
 	case "$_host" in
 		arm-linux|arm*-linux-gnueabi|arm-*-linux)
 			;;
-		arm-riscos|linupy)
-			DEFINES="$DEFINES -DLINUPY"
+		arm-*riscos)
+			# toolchain binaries prefixed by host
+			_ranlib=$_host-ranlib
+			_strip=$_host-strip
+			_ar="$_host-ar cru"
+			_as="$_host-as"
 			;;
 		*darwin*)
 			_ranlib=$_host-ranlib
 			_strip=$_host-strip
 			;;
+		linupy)
+			DEFINES="$DEFINES -DLINUPY"
+			;;
 		m68k-atari-mint)
 			DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
 			_ranlib=m68k-atari-mint-ranlib
@@ -1310,7 +1321,7 @@ case $_host_os in
 	amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | psp | wii | wince)
 		_posix=no
 		;;
-	android | beos* | bsd* | darwin* | freebsd* | gph-linux | haiku* | hpux* | iphone | irix* | linux* | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos)
+	android | beos* | bsd* | darwin* | freebsd* | gph-linux | haiku* | hpux* | iphone | irix* | linux* | mint* | netbsd* | openbsd* | riscos | solaris* | sunos* | uclinux* | webos)
 		_posix=yes
 		;;
 	os2-emx*)
diff --git a/dists/riscos/!Boot,feb b/dists/riscos/!Boot,feb
new file mode 100644
index 0000000..8477a57
--- /dev/null
+++ b/dists/riscos/!Boot,feb
@@ -0,0 +1,13 @@
+Set ScummTool$Dir <Obey$Dir>
+IconSprites <ScummTool$Dir>.!Sprites
+
+Set Alias$scummvm-tools-cli <ScummTool$Dir>.bin.scummvm-tools-cli %%*0
+Set Alias$construct_mohawk <ScummTool$Dir>.bin.construct_mohawk %%*0
+Set Alias$extract_mohawk <ScummTool$Dir>.bin.extract_mohawk %%*0
+Set Alias$gob_loadcalc <ScummTool$Dir>.bin.gob_loadcalc %%*0
+Set Alias$decine <ScummTool$Dir>.bin.decine %%*0
+Set Alias$degob <ScummTool$Dir>.bin.degob %%*0
+Set Alias$dekyra <ScummTool$Dir>.bin.dekyra %%*0
+Set Alias$deriven <ScummTool$Dir>.bin.deriven %%*0
+Set Alias$descumm <ScummTool$Dir>.bin.descumm %%*0
+Set Alias$desword2 <ScummTool$Dir>.bin.desword2 %%*0
diff --git a/dists/riscos/!Run,feb b/dists/riscos/!Run,feb
new file mode 100644
index 0000000..1b51c26
--- /dev/null
+++ b/dists/riscos/!Run,feb
@@ -0,0 +1,2 @@
+Run <Obey$Dir>.!Boot
+scummvm-tools-cli %*0
diff --git a/dists/riscos/!Sprites,ff9 b/dists/riscos/!Sprites,ff9
new file mode 100644
index 0000000..bc0ed2b
Binary files /dev/null and b/dists/riscos/!Sprites,ff9 differ
diff --git a/dists/riscos/!Sprites11,ff9 b/dists/riscos/!Sprites11,ff9
new file mode 100644
index 0000000..5ac8087
Binary files /dev/null and b/dists/riscos/!Sprites11,ff9 differ


Commit: a71bab1c9a8038746d7dbab5f6df28cc94b56ec6
    https://github.com/scummvm/scummvm-tools/commit/a71bab1c9a8038746d7dbab5f6df28cc94b56ec6
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2017-12-16T22:16:11Z

Commit Message:
RISCOS: Improved freetype detection

Changed paths:
    configure


diff --git a/configure b/configure
index 46298fa..9c6797f 100755
--- a/configure
+++ b/configure
@@ -98,6 +98,7 @@ _prefix=/usr/local
 _wxincludes=""
 _wxlibs=""
 _wxstaticlibs=""
+_freetypeconfig=freetype-config
 _freetypeincludes=""
 _freetypelibs=""
 _staticlibpath=""
@@ -1246,6 +1247,7 @@ case $_host_os in
 		LDFLAGS="$LDFLAGS -L$GCCSDK_INSTALL_ENV/lib"
 		CXXFLAGS="$CXXFLAGS -I$GCCSDK_INSTALL_ENV/include"
 		_wxconfig=$GCCSDK_INSTALL_ENV/bin/wx-config
+		_freetypeconfig=$GCCSDK_INSTALL_ENV/bin/freetype-config
 		LDFLAGS="$LDFLAGS -static"
 		;;
 	solaris*)
@@ -1506,7 +1508,7 @@ echo "$_zlib"
 echocheck "FreeType"
 if test "$_freetype" = auto ; then
 	_freetype=no
-	if type freetype-config > /dev/null 2>&1 ; then
+	if type $_freetypeconfig > /dev/null 2>&1 ; then
 		_freetype=yes
 	fi
 fi
@@ -1525,22 +1527,22 @@ int main(int argc, char *argv[]) {
 }
 EOF
 
-	_freetypelibs=`freetype-config --libs`
-	_freetypeincludes=`freetype-config --cflags`
+	_freetypelibs=`$_freetypeconfig --libs`
+	_freetypeincludes=`$_freetypeconfig --cflags`
 
 	cc_check_no_clean $_freetypelibs $_freetypeincludes && _freetype=yes
 	# Modern freetype-config scripts accept --static to get all
 	# required flags for static linking. We abuse this to detect
 	# FreeType2 builds which are static themselves.
 	if test "$_freetype" != "yes"; then
-		_freetypelibs=`freetype-config --static --libs 2>/dev/null`
+		_freetypelibs=`$_freetypeconfig --static --libs 2>/dev/null`
 		cc_check_no_clean $_freetypeincludes $_freetypelibs && _freetype=yes
 	fi
 	cc_check_clean
 fi
 
 if test "$_freetype" = yes ; then
-	freetype_version=`freetype-config --ftversion 2>/dev/null`
+	freetype_version=`$_freetypeconfig --ftversion 2>/dev/null`
 else
 	freetype_version="no"
 fi


Commit: 33cd9ff5061144bb463d74de15d124f4f763bf9c
    https://github.com/scummvm/scummvm-tools/commit/33cd9ff5061144bb463d74de15d124f4f763bf9c
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2017-12-16T22:21:53Z

Commit Message:
TOOLS: Use operator[](0) instead of std::string::front()

This was the only remaining C++11 code in tools, and changing it
makes it possible to compile with an older compiler.

Changed paths:
    engines/prince/pack_prince.cpp


diff --git a/engines/prince/pack_prince.cpp b/engines/prince/pack_prince.cpp
index c8b2a0f..d6902c9 100644
--- a/engines/prince/pack_prince.cpp
+++ b/engines/prince/pack_prince.cpp
@@ -732,7 +732,7 @@ void PackPrince::talkTxtNoDialog() {
 		} else if (!line.compare("#END")) {
 			break;
 		} else {
-			if (line.front() == '#') {
+			if (line[0] == '#') {
 				printf("UNKNOWN pragma: %s", line.c_str());
 				break;
 			} else {





More information about the Scummvm-git-logs mailing list