[Scummvm-git-logs] scummvm master -> 9dd5c387983c0fc9ff59c905cb733b1ff4aaef7f

neuromancer noreply at scummvm.org
Tue Aug 20 18:49:07 UTC 2024


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:
983f49be7e FREESCAPE: handle the case when activation does not produce any effect
9dd5c38798 FREESCAPE: removed glEnableClientState calls


Commit: 983f49be7eb733ec7822e4ae82e287585a4c45a7
    https://github.com/scummvm/scummvm/commit/983f49be7eb733ec7822e4ae82e287585a4c45a7
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-08-20T20:47:26+02:00

Commit Message:
FREESCAPE: handle the case when activation does not produce any effect

Changed paths:
    engines/freescape/freescape.h
    engines/freescape/games/castle/zx.cpp
    engines/freescape/language/instruction.cpp


diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index c4da4d643b9..ca0a6096496 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -384,7 +384,7 @@ public:
 	bool executeObjectConditions(GeometricObject *obj, bool shot, bool collided, bool activated);
 	void executeEntranceConditions(Entrance *entrance);
 	void executeLocalGlobalConditions(bool shot, bool collided, bool timer);
-	void executeCode(FCLInstructionVector &code, bool shot, bool collided, bool timer, bool activated);
+	bool executeCode(FCLInstructionVector &code, bool shot, bool collided, bool timer, bool activated);
 
 	// Instructions
 	bool checkConditional(FCLInstruction &instruction, bool shot, bool collided, bool timer, bool activated);
@@ -493,6 +493,8 @@ public:
 	Common::String _timeoutMessage;
 	Common::String _forceEndGameMessage;
 	Common::String _crushedMessage;
+	Common::String _outOfReachMessage;
+	Common::String _noEffectMessage;
 
 	void loadMessagesFixedSize(Common::SeekableReadStream *file, int offset, int size, int number);
 	virtual void loadMessagesVariableSize(Common::SeekableReadStream *file, int offset, int number);
diff --git a/engines/freescape/games/castle/zx.cpp b/engines/freescape/games/castle/zx.cpp
index a932d57d08f..a92cfb4586a 100644
--- a/engines/freescape/games/castle/zx.cpp
+++ b/engines/freescape/games/castle/zx.cpp
@@ -165,6 +165,8 @@ void CastleEngine::loadAssetsZXFullGame() {
 	_noEnergyMessage = _messagesList[1];
 	_fallenMessage = _messagesList[4];
 	_crushedMessage = _messagesList[3];
+	_outOfReachMessage = _messagesList[7];
+	_noEffectMessage = _messagesList[8];
 }
 
 void CastleEngine::drawZXUI(Graphics::Surface *surface) {
@@ -185,6 +187,7 @@ void CastleEngine::drawZXUI(Graphics::Surface *surface) {
 	int deadline;
 	getLatestMessages(message, deadline);
 	if (deadline <= _countdown) {
+		//debug("deadline: %d countdown: %d", deadline, _countdown);
 		drawStringInSurface(message, 120, 179, front, black, surface);
 		_temporaryMessages.push_back(message);
 		_temporaryMessageDeadlines.push_back(deadline);
diff --git a/engines/freescape/language/instruction.cpp b/engines/freescape/language/instruction.cpp
index 5aa35ff2b63..6bed2972a39 100644
--- a/engines/freescape/language/instruction.cpp
+++ b/engines/freescape/language/instruction.cpp
@@ -115,9 +115,12 @@ bool FreescapeEngine::executeObjectConditions(GeometricObject *obj, bool shot, b
 			debugC(1, kFreescapeDebugCode, "Executing with activated flag: %s", obj->_conditionSource.c_str());
 		else
 			error("Neither shot or collided flag is set!");
-		executeCode(obj->_condition, shot, collided, false, activated); // TODO: check this last parameter
-		executed = true;
+		executed = executeCode(obj->_condition, shot, collided, false, activated); // TODO: check this last parameter
 	}
+	if (activated && !executed)
+		if (!_noEffectMessage.empty())
+			insertTemporaryMessage(_noEffectMessage, _countdown - 2);
+
 	return executed;
 }
 
@@ -140,9 +143,10 @@ void FreescapeEngine::executeLocalGlobalConditions(bool shot, bool collided, boo
 	_executingGlobalCode = false;
 }
 
-void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool collided, bool timer, bool activated) {
+bool FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool collided, bool timer, bool activated) {
 	int ip = 0;
 	bool skip = false;
+	bool executed = false;
 	int codeSize = code.size();
 	assert(codeSize > 0);
 	while (ip <= codeSize - 1) {
@@ -155,6 +159,9 @@ void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool co
 			continue;
 		}
 
+		if (instruction.getType() != Token::CONDITIONAL)
+			executed = true;
+
 		switch (instruction.getType()) {
 		default:
 			error("Instruction %x at ip: %d not implemented!", instruction.getType(), ip);
@@ -273,6 +280,7 @@ void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool co
 		}
 		ip++;
 	}
+	return executed;
 }
 
 void FreescapeEngine::executeRedraw(FCLInstruction &instruction) {


Commit: 9dd5c387983c0fc9ff59c905cb733b1ff4aaef7f
    https://github.com/scummvm/scummvm/commit/9dd5c387983c0fc9ff59c905cb733b1ff4aaef7f
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-08-20T20:47:27+02:00

Commit Message:
FREESCAPE: removed glEnableClientState calls

Changed paths:
    engines/freescape/gfx_opengl_shaders.cpp


diff --git a/engines/freescape/gfx_opengl_shaders.cpp b/engines/freescape/gfx_opengl_shaders.cpp
index c33353f4258..0f5c20f5ef2 100644
--- a/engines/freescape/gfx_opengl_shaders.cpp
+++ b/engines/freescape/gfx_opengl_shaders.cpp
@@ -223,7 +223,6 @@ void OpenGLShaderRenderer::renderPlayerShootBall(byte color, const Common::Point
 	Common::Point initial_position(viewArea.left + viewArea.width() / 2 + 2, _screenH - (viewArea.height() + viewArea.top));
 	Common::Point ball_position = coef * position + (1 - coef) * initial_position;
 
-	glEnableClientState(GL_VERTEX_ARRAY);
 	copyToVertexArray(0, Math::Vector3d(remap(ball_position.x, _screenW), remap(ball_position.y, _screenH), 0));
 
 	for(int i = 0; i <= triangleAmount; i++) {
@@ -326,7 +325,6 @@ void OpenGLShaderRenderer::drawCelestialBody(Math::Vector3d position, float radi
 	glDisable(GL_DEPTH_TEST);
 	glDepthMask(GL_FALSE);
 
-	glEnableClientState(GL_VERTEX_ARRAY);
 	copyToVertexArray(0, position);
 
 	for(int i = 0; i <= triangleAmount; i++) {




More information about the Scummvm-git-logs mailing list