[Scummvm-git-logs] scummvm master -> 2f3d4fa0d2c8ea56af1a3739c823afabb142c597

Strangerke noreply at scummvm.org
Thu Jan 16 22:22:50 UTC 2025


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:
f1c14cec16 GOT: small cleanup
2f3d4fa0d2 GOT: Move some code from header to source file, small cleanup


Commit: f1c14cec16ca8bdd915ae0846c7db6c6a1bebf03
    https://github.com/scummvm/scummvm/commit/f1c14cec16ca8bdd915ae0846c7db6c6a1bebf03
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-16T23:22:31+01:00

Commit Message:
GOT: small cleanup

Changed paths:
    engines/got/data/high_scores.cpp
    engines/got/data/setup.cpp
    engines/got/game/boss1.cpp
    engines/got/game/boss2.cpp
    engines/got/game/script.cpp


diff --git a/engines/got/data/high_scores.cpp b/engines/got/data/high_scores.cpp
index cd1d5d745da..67145269848 100644
--- a/engines/got/data/high_scores.cpp
+++ b/engines/got/data/high_scores.cpp
@@ -82,10 +82,9 @@ void HighScores::save() {
 void HighScores::add(int area, const Common::String &name, uint total) {
 	// Find the index for the new score in the list
 	int newIndex;
-	for (newIndex = 0; newIndex < HIGH_SCORES_PER_AREA &&
-					   total < _scores[area - 1][newIndex]._total;
-		 ++newIndex) {
+	for (newIndex = 0; newIndex < HIGH_SCORES_PER_AREA && total < _scores[area - 1][newIndex]._total; ++newIndex) {
 	}
+	
 	if (newIndex == HIGH_SCORES_PER_AREA)
 		// Lower than all current scores, so ignore it
 		return;
diff --git a/engines/got/data/setup.cpp b/engines/got/data/setup.cpp
index 4e37ab464aa..af199ef959d 100644
--- a/engines/got/data/setup.cpp
+++ b/engines/got/data/setup.cpp
@@ -31,17 +31,16 @@ SetupFlags &SetupFlags::operator=(const Got::SetupFlags &src) {
 
 void SetupFlags::sync(Common::Serializer &s) {
 	byte flags[8] = {};
-	int i;
 
 	if (s.isSaving()) {
-		for (i = 0; i < 64; ++i) {
+		for (int i = 0; i < 64; ++i) {
 			if (_flags[i])
 				flags[i / 8] = flags[i / 8] | (1 << (i % 8));
 		}
 		s.syncBytes(flags, 8);
 	} else {
 		s.syncBytes(flags, 8);
-		for (i = 0; i < 64; ++i)
+		for (int i = 0; i < 64; ++i)
 			_flags[i] = (flags[i / 8] & (1 << (i % 8))) != 0;
 	}
 }
diff --git a/engines/got/game/boss1.cpp b/engines/got/game/boss1.cpp
index 3a5d249cbdd..31e42a3f5be 100644
--- a/engines/got/game/boss1.cpp
+++ b/engines/got/game/boss1.cpp
@@ -35,8 +35,10 @@ namespace Got {
 static int boss1_dead();
 
 int boss1_movement(ACTOR *actr) {
-	int x1, y1, f;
+	int x1, y1;
 
+	bool f = false;
+	
 	if (_G(boss_dead))
 		return boss1_dead();
 
@@ -108,7 +110,6 @@ int boss1_movement(ACTOR *actr) {
 		actr->temp2 = 0;
 	}
 	
-	f = 0;
 	if (actr->counter) {
 		actr->counter--;
 		switch (d) {
@@ -119,7 +120,7 @@ int boss1_movement(ACTOR *actr) {
 			y1 += 2;
 
 			if (!check_move2(x1, y1, &_G(actor[5])))
-				f = 1;
+				f = true;
 			else {
 				actr->x = _G(actor[5]).x;
 				actr->y = _G(actor[5]).y - 16;
@@ -129,16 +130,16 @@ int boss1_movement(ACTOR *actr) {
 		case 2:
 			y1 -= 2;
 			if (!check_move2(x1, y1, actr))
-				f = 1;
+				f = true;
 			break;
 
 		default:
 			break;
 		}
 	} else
-		f = 1;
+		f = true;
 
-	if (f == 1) {
+	if (f) {
 		actr->counter = g_events->getRandomNumber(10, 99);
 		d = g_events->getRandomNumber(1);
 		actr->edge_counter = 20;
diff --git a/engines/got/game/boss2.cpp b/engines/got/game/boss2.cpp
index 0c32b5867a9..b1a8957d362 100644
--- a/engines/got/game/boss2.cpp
+++ b/engines/got/game/boss2.cpp
@@ -37,7 +37,9 @@ static const byte EXPLOSION[] = {
 	101, 102, 105, 106, 109, 110, 113, 114, 117, 118,
 	121, 122, 125, 126, 129, 130, 133, 134, 137, 138,
 	141, 142, 145, 146, 149, 150, 153, 154, 157, 158,
-	161, 162, 165, 166, 169, 170, 173, 174, 177, 178};
+	161, 162, 165, 166, 169, 170, 173, 174, 177, 178
+};
+
 static byte expf[60];
 static byte num_skulls; // Hehe
 static byte num_spikes;
diff --git a/engines/got/game/script.cpp b/engines/got/game/script.cpp
index 0bec52ecfe4..3a76c91c020 100644
--- a/engines/got/game/script.cpp
+++ b/engines/got/game/script.cpp
@@ -196,7 +196,7 @@ int Scripts::get_command() {
 		return -1;
 
 	int i = 0;
-	while (1) {
+	while (true) {
 		if (!SCR_COMMAND[i])
 			break; // Lookup command
 
@@ -390,7 +390,7 @@ int Scripts::get_next_val() {
 
 int Scripts::get_internal_variable() {
 	int i = 0;
-	while (1) {
+	while (true) {
 		if (!INTERNAL_VARIABLE[i])
 			return 0; // Lookup internal variable
 		int len = strlen(INTERNAL_VARIABLE[i]);


Commit: 2f3d4fa0d2c8ea56af1a3739c823afabb142c597
    https://github.com/scummvm/scummvm/commit/2f3d4fa0d2c8ea56af1a3739c823afabb142c597
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-16T23:22:32+01:00

Commit Message:
GOT: Move some code from header to source file, small cleanup

Changed paths:
    engines/got/game/script.cpp
    engines/got/game/script.h
    engines/got/gfx/gfx_surface.h
    engines/got/got.h
    engines/got/messages.h


diff --git a/engines/got/game/script.cpp b/engines/got/game/script.cpp
index 3a76c91c020..c2a7f137270 100644
--- a/engines/got/game/script.cpp
+++ b/engines/got/game/script.cpp
@@ -839,11 +839,26 @@ int Scripts::cmd_ask() {
 	return 0;
 }
 
+void Scripts::pause() {
+	_paused = SCRIPT_PAUSED;
+}
+
+void Scripts::resume() {
+	_paused = SCRIPT_RESUMING;
+}
+
 void Scripts::setAskResponse(int option) {
 	_numVar[_askVar] = option;
 	resume();
 }
 
+void Scripts::runIfResuming() {
+	if (_paused == SCRIPT_RESUMING) {
+		_paused = SCRIPT_READY;
+		scriptLoop();
+	}
+}
+
 int Scripts::cmd_sound() {
 	if (!calc_value())
 		return 5;
diff --git a/engines/got/game/script.h b/engines/got/game/script.h
index 5d72fa6b04d..ed751a2df38 100644
--- a/engines/got/game/script.h
+++ b/engines/got/game/script.h
@@ -38,23 +38,11 @@ public:
 	Scripts();
 	~Scripts();
 
-	void execute_script(long index, const Gfx::Pics &speakerIcon,
-						ScriptEndFn endFn = nullptr);
-
-	void pause() {
-		_paused = SCRIPT_PAUSED;
-	}
-	void resume() {
-		_paused = SCRIPT_RESUMING;
-	}
-
+	void execute_script(long index, const Gfx::Pics &speakerIcon, ScriptEndFn endFn = nullptr);
+	void pause();
+	void resume();
 	void setAskResponse(int option);
-	void runIfResuming() {
-		if (_paused == SCRIPT_RESUMING) {
-			_paused = SCRIPT_READY;
-			scriptLoop();
-		}
-	}
+	void runIfResuming();
 
 private:
     ScriptEndFn _endFn = nullptr;
diff --git a/engines/got/gfx/gfx_surface.h b/engines/got/gfx/gfx_surface.h
index 7997cf14411..0251f10d98a 100644
--- a/engines/got/gfx/gfx_surface.h
+++ b/engines/got/gfx/gfx_surface.h
@@ -29,10 +29,8 @@ namespace Gfx {
 
 class GfxSurface : public Graphics::ManagedSurface {
 public:
-	GfxSurface() : Graphics::ManagedSurface() {
-	}
-	GfxSurface(Graphics::ManagedSurface &surf, const Common::Rect &bounds) : Graphics::ManagedSurface(surf, bounds) {
-	}
+	GfxSurface() : Graphics::ManagedSurface() {}
+	GfxSurface(Graphics::ManagedSurface &surf, const Common::Rect &bounds) : Graphics::ManagedSurface(surf, bounds) {}
 
 	/**
      * Write some text to the surface
diff --git a/engines/got/got.h b/engines/got/got.h
index b2023980360..554df06e430 100644
--- a/engines/got/got.h
+++ b/engines/got/got.h
@@ -27,7 +27,6 @@
 #include "common/scummsys.h"
 #include "common/serializer.h"
 #include "common/system.h"
-#include "common/util.h"
 #include "engines/engine.h"
 #include "got/events.h"
 #include "got/vars.h"
diff --git a/engines/got/messages.h b/engines/got/messages.h
index 20f107d295f..200a9f7b4d6 100644
--- a/engines/got/messages.h
+++ b/engines/got/messages.h
@@ -34,8 +34,7 @@ struct Message {};
 struct FocusMessage : public Message {
 	UIElement *_priorView = nullptr;
 	FocusMessage() : Message() {}
-	FocusMessage(UIElement *priorView) : Message(),
-										 _priorView(priorView) {}
+	FocusMessage(UIElement *priorView) : Message(), _priorView(priorView) {}
 };
 
 struct UnfocusMessage : public Message {};




More information about the Scummvm-git-logs mailing list