[Scummvm-cvs-logs] scummvm master -> 28dae010fb859b0b42e4f433bc4f72b08c036fbb

bluegr md5 at scummvm.org
Sat Feb 19 23:20:37 CET 2011


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:
ef38e4f57f SCI: Moved the gcCountdown() code inside the op_callk case, since that's the only place where it's used
28dae010fb SAGA: Fixed palette setting inside Gfx::setPaletteColor() (thanks to LordHoto for noticing this)


Commit: ef38e4f57f32f495b7f1d8289306e6d829394aeb
    https://github.com/scummvm/scummvm/commit/ef38e4f57f32f495b7f1d8289306e6d829394aeb
Author: md5 (md5 at scummvm.org)
Date: 2011-02-19T14:18:27-08:00

Commit Message:
SCI: Moved the gcCountdown() code inside the op_callk case, since that's the only place where it's used

Changed paths:
    engines/sci/engine/vm.cpp



diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 4f5a263..a6677ee 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -759,13 +759,6 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) {
 		s->_executionStack.pop_back();
 }
 
-static void gcCountDown(EngineState *s) {
-	if (s->gcCountDown-- <= 0) {
-		s->gcCountDown = s->scriptGCInterval;
-		run_gc(s);
-	}
-}
-
 int readPMachineInstruction(const byte *src, byte &extOpcode, int16 opparams[4]) {
 	uint offset = 0;
 	extOpcode = src[offset++]; // Get "extended" opcode (lower bit has special meaning)
@@ -1150,9 +1143,13 @@ void run_vm(EngineState *s) {
 		}
 
 		case op_callk: { // 0x21 (33)
-			// Call kernel function
-			gcCountDown(s);
+			// Run the garbage collector, if needed
+			if (s->gcCountDown-- <= 0) {
+				s->gcCountDown = s->scriptGCInterval;
+				run_gc(s);
+			}
 
+			// Call kernel function
 			s->xs->sp -= (opparams[1] >> 1) + 1;
 
 			bool oldScriptHeader = (getSciVersion() == SCI_VERSION_0_EARLY);


Commit: 28dae010fb859b0b42e4f433bc4f72b08c036fbb
    https://github.com/scummvm/scummvm/commit/28dae010fb859b0b42e4f433bc4f72b08c036fbb
Author: md5 (md5 at scummvm.org)
Date: 2011-02-19T14:19:08-08:00

Commit Message:
SAGA: Fixed palette setting inside Gfx::setPaletteColor() (thanks to LordHoto for noticing this)

Changed paths:
    engines/saga/gfx.cpp



diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp
index c46da4c..5fc2082 100644
--- a/engines/saga/gfx.cpp
+++ b/engines/saga/gfx.cpp
@@ -238,7 +238,7 @@ void Gfx::setPaletteColor(int n, int r, int g, int b) {
 	}
 
 	if (update)
-		_system->getPaletteManager()->setPalette(_currentPal, n, 1);
+		_system->getPaletteManager()->setPalette(_currentPal + n * 3, n, 1);
 }
 
 void Gfx::getCurrentPal(PalEntry *src_pal) {






More information about the Scummvm-git-logs mailing list