[Scummvm-git-logs] scummvm master -> 14414d0a8779ddff514fc14b182e8845504a9220

sev- sev at scummvm.org
Mon Jul 19 07:41:51 UTC 2021


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

Summary:
09620c3baf DEVTOOLS: Initial version of dumper companion
14414d0a87 SAGA2: Eliminate non-portable va_arg method


Commit: 09620c3bafbdc12ce41d9901415a5f855363f783
    https://github.com/scummvm/scummvm/commit/09620c3bafbdc12ce41d9901415a5f855363f783
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-07-19T09:24:32+02:00

Commit Message:
DEVTOOLS: Initial version of dumper companion

Changed paths:
  A devtools/dumper-companion.pl


diff --git a/devtools/dumper-companion.pl b/devtools/dumper-companion.pl
new file mode 100644
index 0000000000..d3d32f8afb
--- /dev/null
+++ b/devtools/dumper-companion.pl
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+use strict;
+use Getopt::Std;
+
+sub VERSION_MESSAGE() {
+    print "$0 version 1.0\n"
+}
+
+sub HELP_MESSAGE();
+sub processIso($);
+
+getopts('hmf:e:');
+
+if ($::opt_h) {
+    HELP_MESSAGE();
+    exit 0;
+}
+
+if ($::opt_f) {
+    processIso($::opt_f);
+}
+
+exit 0;
+
+sub processIso($) {
+    my $isofile = shift;
+
+    print "Mounting ISO...";
+    flush STDOUT;
+
+    system("hmount \"$isofile\" >/dev/null 2>&1") == 0 or die "Can't execute hmount";
+    print "done\n";
+
+    open(my $ls, "-|", "hls -1ablRU");
+
+    my $dir = "";
+    my $mdir = "";
+
+    while (<$ls>) {
+        chomp;
+        print "$_...                          \r";
+        flush STDOUT;
+
+        if (/^:/) {
+            $mdir = $_;
+            s/^://;
+            s/:/\//g;
+            $dir = $_;
+            mkdir "$_";
+        } elsif (/^[fF]/) {
+            if (/[fF]i?\s+[^\s]+\s+([0-9]+)\s+([0-9]+)\s+\w+\s+\d+\s+\d+\s+(.*)/) {
+                my $res = $1;
+                my $data = $2;
+                my $fname = $3;
+
+                if ($res != 0) {
+                    system("hcopy -m -- $mdir$fname $dir$fname");
+                } else {
+                    system("hcopy -r -- $mdir$fname $dir$fname");
+                }
+            } else {
+                die "Bad format:\n$_\n";
+            }
+        }
+    }
+    print "\n";
+
+    print "Unounting ISO...";
+    flush STDOUT;
+
+    system("humount >/dev/null 2>&1") == 0 or die "Can't execute humount";
+    print "done\n";
+}
+
+sub HELP_MESSAGE() {
+		print <<EOF;
+Usage: $0 [OPTIONS]...
+
+Dumping Mac files into MacBinary format
+
+There are 2 operation modes. Direct MacBinary encoding (Mac-only) and dumping ISO
+contents with hfsutils.
+
+Mode 1:
+  $0 -m
+      Operate in MacBinary encoding mode
+
+Mode 2:
+  $0 [-e <encoding>] -f <file.iso>
+      Operate in disk dumping mode
+	  Optionally specify 'jap' for using 'recode' for converting Japanese file names
+
+Miscellaneous:
+  -h, --help   display this help and exit
+EOF
+}


Commit: 14414d0a8779ddff514fc14b182e8845504a9220
    https://github.com/scummvm/scummvm/commit/14414d0a8779ddff514fc14b182e8845504a9220
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-07-19T09:41:20+02:00

Commit Message:
SAGA2: Eliminate non-portable va_arg method

Changed paths:
    engines/saga2/actor.cpp
    engines/saga2/actor.h


diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index 94bce111a9..dc6de16758 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -2362,27 +2362,24 @@ void Actor::updateAppearance(int32) {
 						//Currently Attitude Not Set So Always Hits Zero
 						case 0:
 							//Returns True If Successful No Checking Yet
-							SetAvailableAction(0, actionWaitAgressive,
+							setAvailableAction(actionWaitAgressive,
 							                   actionWaitImpatient,
 							                   actionWaitFriendly,
-							                   actionStand,
-							                   -1);//Second To Last Parameter Is The Default
+							                   actionStand); // This is default
 							break;
 
 						case 1:
-							SetAvailableAction(0, actionWaitImpatient,
+							setAvailableAction(actionWaitImpatient,
 							                   actionWaitFriendly,
 							                   actionWaitAgressive,
-							                   actionStand,
-							                   -1);
+							                   actionStand);
 							break;
 
 						case 2:
-							SetAvailableAction(0, actionWaitFriendly,
+							setAvailableAction(actionWaitFriendly,
 							                   actionWaitImpatient,
 							                   actionWaitAgressive,
-							                   actionStand,
-							                   -1);
+							                   actionStand);
 
 						}
 					} else //Assume -1
@@ -2400,21 +2397,20 @@ void Actor::updateAppearance(int32) {
 	}// End if (appearance)
 }
 
-bool Actor::SetAvailableAction(int16 flags_, ...) {
-	bool            result = false;
-	va_list Actions;
-	va_start(Actions, flags_); //Initialize To First Argument Even Though We Dont Use It In The Loop
+bool Actor::setAvailableAction(int16 action1, int16 action2, int16 action3, int16 actiondefault) {
+	if (setAction(action1, 0))
+		return true;
 
-	for (;;) { //Infinite Loop
-		int thisAction = va_arg(Actions, int);  //Increment To Second Argument Ignoring Flags
-		if (thisAction < 0) break;              //Check If Last Parameter Since Last Always Should Be -1
-		if (setAction(thisAction, flags_)) {     //Try To Set This Action
-			result = true;  //If Successful
-			break;
-		}
-	}
-	va_end(Actions); //Clean Up
-	return result;
+	if (setAction(action2, 0))
+		return true;
+
+	if (setAction(action3, 0))
+		return true;
+
+	if (setAction(actiondefault, 0))
+		return true;
+
+	return false;
 }
 
 //-----------------------------------------------------------------------
diff --git a/engines/saga2/actor.h b/engines/saga2/actor.h
index 1c37cbc30e..5ead65e415 100644
--- a/engines/saga2/actor.h
+++ b/engines/saga2/actor.h
@@ -916,7 +916,7 @@ public:
 	void updateAppearance(int32 deltaTime);
 
 	//  Used To Find Wait State When Preffered Not Available
-	bool SetAvailableAction(int16, ...);
+	bool setAvailableAction(int16 action1, int16 action2, int16 action3, int16 actiondefault);
 
 	//  Set the current animation sequence that the actor is doing.
 	//  Returns the number of poses in the sequence, or 0 if there




More information about the Scummvm-git-logs mailing list