[Scummvm-git-logs] scummvm master -> 4a4c1da24e4f273ab26a84ef459c8d84de45991b

somaen noreply at scummvm.org
Sun Jul 7 22:37:32 UTC 2024


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

Summary:
1a7480b410 WATCHMAKER: Fix auto without reference (CID 1526877)
ecd61f373b WATCHMAKER: Fix extra copy in t3dCheckMaterialVB (CID 1527010)
5f68ab5843 WATCHMAKER: Fix extra copy in t3dLightCharacter (CID 1526765)
6612c662bc WATCHMAKER: Use Common::Rect and init all members in Renderer (CID 1509206)
b6c6b069f0 WATCHMAKER: Initialize all members of WGame (CID 1509150)
40717d4da7 WATCHMAKER: Fix uint32/uint16-warning in t3dLoadMeshes
0e91b088fb WATCHMAKER: Initialize PortalList to nullptr (CID 1509168)
2ed6017546 WATCHMAKER: Init SuperEventActivate to false (CID 1509147)
4a4c1da24e WATCHMAKER: Initialize all fields in t3dLIGHT (CID 1509183)


Commit: 1a7480b4106fb0495a44a28d58775bfdbc5db493
    https://github.com/scummvm/scummvm/commit/1a7480b4106fb0495a44a28d58775bfdbc5db493
Author: Einar Johan Trøan Sømåen (somaen at scummvm.org)
Date: 2024-07-08T00:36:21+02:00

Commit Message:
WATCHMAKER: Fix auto without reference (CID 1526877)

Changed paths:
    engines/watchmaker/ll/ll_ffile.cpp


diff --git a/engines/watchmaker/ll/ll_ffile.cpp b/engines/watchmaker/ll/ll_ffile.cpp
index c720e8e2713..2a27fba0906 100644
--- a/engines/watchmaker/ll/ll_ffile.cpp
+++ b/engines/watchmaker/ll/ll_ffile.cpp
@@ -77,7 +77,7 @@ Common::SharedPtr<Common::SeekableReadStream> FastFile::resolve(const char *file
 	if (index == -1) {
 		return nullptr;
 	}
-	auto entry = _files[index];
+	const auto &entry = _files[index];
 	int size = 0;
 	if (index == _numFiles - 1) {
 		size = _totalSize - entry.offset;


Commit: ecd61f373bd0f5769b6921d52406e09d22d9c4e6
    https://github.com/scummvm/scummvm/commit/ecd61f373bd0f5769b6921d52406e09d22d9c4e6
Author: Einar Johan Trøan Sømåen (somaen at scummvm.org)
Date: 2024-07-08T00:36:21+02:00

Commit Message:
WATCHMAKER: Fix extra copy in t3dCheckMaterialVB (CID 1527010)

Changed paths:
    engines/watchmaker/3d/geometry.cpp


diff --git a/engines/watchmaker/3d/geometry.cpp b/engines/watchmaker/3d/geometry.cpp
index 641d3f7736d..ea3d0670e35 100644
--- a/engines/watchmaker/3d/geometry.cpp
+++ b/engines/watchmaker/3d/geometry.cpp
@@ -2809,8 +2809,7 @@ void t3dCheckMaterialVB(MaterialPtr mat) {
 //	gv = rLockVertexPtr(mat->VB, DDLOCK_WRITEONLY | DDLOCK_NOSYSLOCK);
 	mat->VBO->_buffer.clear();
 	for (int i = 0; i < mat->NumAllocatedVerts(); i++) {
-		auto vert = *mat->VertsList[i];
-		mat->VBO->_buffer.push_back(vert);
+		mat->VBO->_buffer.push_back(*mat->VertsList[i]);
 		//memcpy(gv, mat->VertsList[i], sizeof(gVertex));
 	}
 


Commit: 5f68ab5843c0f87bb53b2784fa9aed43c824a250
    https://github.com/scummvm/scummvm/commit/5f68ab5843c0f87bb53b2784fa9aed43c824a250
Author: Einar Johan Trøan Sømåen (somaen at scummvm.org)
Date: 2024-07-08T00:36:21+02:00

Commit Message:
WATCHMAKER: Fix extra copy in t3dLightCharacter (CID 1526765)

Changed paths:
    engines/watchmaker/3d/geometry.cpp


diff --git a/engines/watchmaker/3d/geometry.cpp b/engines/watchmaker/3d/geometry.cpp
index ea3d0670e35..77812cac140 100644
--- a/engines/watchmaker/3d/geometry.cpp
+++ b/engines/watchmaker/3d/geometry.cpp
@@ -1610,7 +1610,7 @@ void t3dLightCharacter(t3dCHARACTER *Ch) {
 	for (j = 0; j < mesh->NumVerts; j++, gv++)
 		gv->diffuse = amb;
 
-	auto light = Ch->CurRoom->LightTable[0];
+	const auto &light = Ch->CurRoom->LightTable[0];
 	if (light.Type & T3D_LIGHT_ALLLIGHTSOFF) {
 		mesh->VBptr = nullptr;
 		return;


Commit: 6612c662bc9357554a44bbd9623f5948dad8d3aa
    https://github.com/scummvm/scummvm/commit/6612c662bc9357554a44bbd9623f5948dad8d3aa
Author: Einar Johan Trøan Sømåen (somaen at scummvm.org)
Date: 2024-07-08T00:36:21+02:00

Commit Message:
WATCHMAKER: Use Common::Rect and init all members in Renderer (CID 1509206)

Changed paths:
    engines/watchmaker/3d/render/opengl_2d.cpp
    engines/watchmaker/3d/texture.h
    engines/watchmaker/module.mk
    engines/watchmaker/renderer.cpp
    engines/watchmaker/renderer.h


diff --git a/engines/watchmaker/3d/render/opengl_2d.cpp b/engines/watchmaker/3d/render/opengl_2d.cpp
index cba57af4550..4f607499df4 100644
--- a/engines/watchmaker/3d/render/opengl_2d.cpp
+++ b/engines/watchmaker/3d/render/opengl_2d.cpp
@@ -39,7 +39,7 @@
 
 namespace Watchmaker {
 
-Rect gBlitterExtends;
+Common::Rect gBlitterExtends;
 int gStencilBitDepth;
 
 unsigned int CurLoaderFlags;
@@ -101,14 +101,14 @@ void rGetExtends(int *x1, int *y1, int *x2, int *y2) {
 
 //************************************************************************************************************************
 void rResetExtends() {
-	gBlitterExtends.left = 99999999;
-	gBlitterExtends.top = 99999999;
-	gBlitterExtends.right = -99999999;
-	gBlitterExtends.bottom = -99999999;
+	gBlitterExtends.left = SHRT_MAX;
+	gBlitterExtends.top = SHRT_MAX;
+	gBlitterExtends.right = SHRT_MIN;
+	gBlitterExtends.bottom = SHRT_MIN;
 }
 
 // TODO: Move this to Renderer
-extern Rect gBlitterViewport;
+extern Common::Rect gBlitterViewport;
 bool gClipToBlitterViewport(int *sposx, int *sposy, int *sdimx, int *sdimy,
                             int *dposx, int *dposy) {
 	int dwWidth, dwHeight;
@@ -141,7 +141,7 @@ bool gClipToBlitterViewport(int *sposx, int *sposy, int *sdimx, int *sdimy,
 	return true;
 }
 
-void renderTexture(WGame &game, gTexture &bitmap, Rect srcRect, Rect dstRect) {
+void renderTexture(WGame &game, gTexture &bitmap, Common::Rect srcRect, Common::Rect dstRect) {
 	checkGlError("Entering renderTexture");
 	glClearColor(0, 0, 1, 0);
 	glEnable(GL_TEXTURE_2D);
@@ -160,7 +160,7 @@ void renderTexture(WGame &game, gTexture &bitmap, Rect srcRect, Rect dstRect) {
 	float leftSrc = ((float)srcRect.left) / bitmap.RealDimX;
 	float rightSrc = ((float)srcRect.right) / bitmap.RealDimX;
 
-	Rect viewport = game._renderer->_viewport;
+	Common::Rect viewport = game._renderer->_viewport;
 	float bottomDst = 1.0 - ((dstRect.bottom == 0 ? 0 : ((double)dstRect.bottom) / viewport.height()) * 2.0);
 	float topDst = 1.0 - ((dstRect.top == 0 ? 0 : ((double)dstRect.top) / viewport.height()) * 2.0);
 	float leftDst = ((dstRect.left == 0 ? 0 : ((double)dstRect.left) / viewport.width()) * 2.0) - 1.0;
@@ -186,7 +186,7 @@ void renderTexture(WGame &game, gTexture &bitmap, Rect srcRect, Rect dstRect) {
 	checkGlError("Exiting renderTexture");
 }
 
-void gTexture::render(WGame &game, Rect src, Rect dst) {
+void gTexture::render(WGame &game, Common::Rect src, Common::Rect dst) {
 	// Render self
 	if (_texture) {
 		renderTexture(game, *this, src, dst);
@@ -256,14 +256,14 @@ void rBlitter(WGame &game, int dst, int src, int dposx, int dposy,
 	}
 
 	{
-		Rect srcRect;
+		Common::Rect srcRect;
 		// Source rect
 		srcRect.top = sposy;
 		srcRect.left = sposx;
 		srcRect.right = sposx + sdimx;
 		srcRect.bottom = sposy + sdimy;
 
-		Rect dstRect;
+		Common::Rect dstRect;
 		// Destination rect
 		// Convention in dpos is that 0,0 is upper left hand corner, increasing down the y-axis.
 		dstRect.top = dposy;
diff --git a/engines/watchmaker/3d/texture.h b/engines/watchmaker/3d/texture.h
index 4c21a904350..b428565675a 100644
--- a/engines/watchmaker/3d/texture.h
+++ b/engines/watchmaker/3d/texture.h
@@ -51,15 +51,15 @@ struct gTexture {
 		warning("Clearing %d", _blitsOnTop.size());
 		_blitsOnTop.clear();
 	}
-	void render(WGame &game, Rect src, Rect dst);
-	void blitInto(gTexture *texture, Rect src, Rect dst) {
+	void render(WGame &game, Common::Rect src, Common::Rect dst);
+	void blitInto(gTexture *texture, Common::Rect src, Common::Rect dst) {
 		_blitsOnTop.push_back({texture, src, dst});
 	}
 private:
 	struct Blit {
 		gTexture *texture;
-		Rect src;
-		Rect dst;
+		Common::Rect src;
+		Common::Rect dst;
 	};
 	Common::Array<Blit> _blitsOnTop;
 };
diff --git a/engines/watchmaker/module.mk b/engines/watchmaker/module.mk
index 09a40cfe0e0..dd6649bc2d0 100644
--- a/engines/watchmaker/module.mk
+++ b/engines/watchmaker/module.mk
@@ -73,7 +73,6 @@ MODULE_OBJS = \
 	globvar.o \
 	main.o \
 	metaengine.o \
-	rect.o \
 	render.o \
 	renderer.o \
 	saveload.o \
diff --git a/engines/watchmaker/renderer.cpp b/engines/watchmaker/renderer.cpp
index bde53450c06..f30bc8fd7a3 100644
--- a/engines/watchmaker/renderer.cpp
+++ b/engines/watchmaker/renderer.cpp
@@ -45,7 +45,7 @@ Renderer::Renderer(WGame *game, sdl_wrapper *wrapper) : _2dStuff(this), sdl(wrap
 }
 
 // blitter info
-Rect            gBlitterViewport;
+Common::Rect    gBlitterViewport;
 gTexture        gScreenBuffer;
 
 void Renderer::initGL() {
@@ -106,7 +106,7 @@ bool Renderer::createScreenBuffer() {
 
 void Renderer::initBlitterViewPort() {
 	auto info = getScreenInfos();
-	Rect viewport{0, 0, (int)info.width, (int)info.height};
+	Common::Rect viewport{0, 0, (int16)info.width, (int16)info.height};
 
 	// This is just leftover, as the original viewport-setting would default to the screenbuffer-size.
 	if ((viewport.top == 0) && (viewport.bottom == 0) && (viewport.left == 0) && (viewport.right == 0)) {
diff --git a/engines/watchmaker/renderer.h b/engines/watchmaker/renderer.h
index ac5a33b68cd..1abd3fa6c2c 100644
--- a/engines/watchmaker/renderer.h
+++ b/engines/watchmaker/renderer.h
@@ -49,7 +49,7 @@ public:
 	TwoDeeStuff _2dStuff;
 
 	Fonts *_fonts = nullptr;
-	Rect _viewport;
+	Common::Rect _viewport;
 	Renderer(WGame *game, sdl_wrapper *wrapper);
 	bool addMaterial(gMaterial &material, const Common::String &name, int NumFaces, unsigned int LoaderFlags);
 
@@ -97,7 +97,7 @@ private:
 	// aspect correction
 	float gAspectX = 1, gAspectY = 1;
 	float gInvAspectX = 1, gInvAspectY = 1;
-	float _nearPlane;
+	float _nearPlane = 0.0f;
 	Math::Matrix4 _projectionMatrix;
 };
 


Commit: b6c6b069f013f51e551cfbeadaff163e29015c3b
    https://github.com/scummvm/scummvm/commit/b6c6b069f013f51e551cfbeadaff163e29015c3b
Author: Einar Johan Trøan Sømåen (somaen at scummvm.org)
Date: 2024-07-08T00:36:21+02:00

Commit Message:
WATCHMAKER: Initialize all members of WGame (CID 1509150)

Changed paths:
    engines/watchmaker/game.h


diff --git a/engines/watchmaker/game.h b/engines/watchmaker/game.h
index e90a918e55d..8462636458e 100644
--- a/engines/watchmaker/game.h
+++ b/engines/watchmaker/game.h
@@ -38,7 +38,7 @@ class Renderer;
 
 struct GameVars {
 private:
-	int32 CurRoom;
+	int32 CurRoom = 0;
 
 public:
 	void setCurRoomId(int32 room) {
@@ -53,9 +53,9 @@ class MeshModifiers;
 class RoomManager;
 
 class WGame {
-	bool g_bReady, g_bActive;
+	bool g_bReady = false, g_bActive = false;
 	//bool g_bSkipActive = false;
-	const char *CharName[32];
+	const char *CharName[32] = {};
 	uint32 LoadChar;
 	MeshModifiers *_meshModifiers;
 


Commit: 40717d4da7eec480ea92b5a1575eb3752dad1f5d
    https://github.com/scummvm/scummvm/commit/40717d4da7eec480ea92b5a1575eb3752dad1f5d
Author: Einar Johan Trøan Sømåen (somaen at scummvm.org)
Date: 2024-07-08T00:36:22+02:00

Commit Message:
WATCHMAKER: Fix uint32/uint16-warning in t3dLoadMeshes

Changed paths:
    engines/watchmaker/3d/t3d_body.cpp


diff --git a/engines/watchmaker/3d/t3d_body.cpp b/engines/watchmaker/3d/t3d_body.cpp
index cc3e4d2a93f..8391fd305bd 100644
--- a/engines/watchmaker/3d/t3d_body.cpp
+++ b/engines/watchmaker/3d/t3d_body.cpp
@@ -108,7 +108,7 @@ void t3dLoadMaterials(WGame &game, t3dBODY *b, Common::SeekableReadStream &strea
 
 void t3dLoadMeshes(t3dBODY *b, uint32 numMeshes, t3dMESH *&ReceiveRipples, uint8 &Mirror, Common::SeekableReadStream &stream) {
 	b->MeshTable.clear();
-	for (uint16 mesh = 0; mesh < numMeshes; mesh++) {
+	for (uint32 mesh = 0; mesh < numMeshes; mesh++) {
 		b->MeshTable.push_back(t3dMESH(b, stream, ReceiveRipples, Mirror));
 	}
 }


Commit: 0e91b088fbea6de4c764f4eda83580d269ec1f12
    https://github.com/scummvm/scummvm/commit/0e91b088fbea6de4c764f4eda83580d269ec1f12
Author: Einar Johan Trøan Sømåen (somaen at scummvm.org)
Date: 2024-07-08T00:36:22+02:00

Commit Message:
WATCHMAKER: Initialize PortalList to nullptr (CID 1509168)

Changed paths:
    engines/watchmaker/3d/t3d_mesh.h


diff --git a/engines/watchmaker/3d/t3d_mesh.h b/engines/watchmaker/3d/t3d_mesh.h
index 3386e6d652b..0d433c1bbcb 100644
--- a/engines/watchmaker/3d/t3d_mesh.h
+++ b/engines/watchmaker/3d/t3d_mesh.h
@@ -71,7 +71,7 @@ struct t3dMESH {
 	t3dV3F                SolarRGBVar[4];             // Override ambient color variation for solar movement
 
 	uint32                Flags;                      // Flags
-	t3dBODY              *PortalList;            // Pointer to portal connected
+	t3dBODY              *PortalList = nullptr;       // Pointer to portal connected
 	Common::Array<t3dMESH *> RejectedMeshes;      // rejected mesh from portal
 
 	void saveVertexBuffer() { // Scorre le mesh


Commit: 2ed6017546c4c2f34dc3c58a0a8b8524ac7efd40
    https://github.com/scummvm/scummvm/commit/2ed6017546c4c2f34dc3c58a0a8b8524ac7efd40
Author: Einar Johan Trøan Sømåen (somaen at scummvm.org)
Date: 2024-07-08T00:36:22+02:00

Commit Message:
WATCHMAKER: Init SuperEventActivate to false (CID 1509147)

Changed paths:
    engines/watchmaker/schedule.h


diff --git a/engines/watchmaker/schedule.h b/engines/watchmaker/schedule.h
index 48eeb35893d..961a6e4bf62 100644
--- a/engines/watchmaker/schedule.h
+++ b/engines/watchmaker/schedule.h
@@ -50,7 +50,7 @@ public:
 	pqueue Game;
 	// message *TheMessage; // TODO: Replace the global variable with this
 	message idlemessage  = {EventClass::MC_IDLE, 0, MP_DEFAULT};
-	uint8 SuperEventActivate;
+	uint8 SuperEventActivate = false;
 private:
 	int _maxmsg = 0;
 	message _waitingMsg[MAXWAITINGMSGS];


Commit: 4a4c1da24e4f273ab26a84ef459c8d84de45991b
    https://github.com/scummvm/scummvm/commit/4a4c1da24e4f273ab26a84ef459c8d84de45991b
Author: Einar Johan Trøan Sømåen (somaen at scummvm.org)
Date: 2024-07-08T00:36:22+02:00

Commit Message:
WATCHMAKER: Initialize all fields in t3dLIGHT (CID 1509183)

Changed paths:
    engines/watchmaker/t3d.h


diff --git a/engines/watchmaker/t3d.h b/engines/watchmaker/t3d.h
index f2086165cf1..c960311fa04 100644
--- a/engines/watchmaker/t3d.h
+++ b/engines/watchmaker/t3d.h
@@ -286,10 +286,10 @@ struct t3dLIGHT {
 	t3dF32      HotSpot, FallOff;           // spot ranges
 	t3dV3F      Color;                      // orig color
 	uint8       Flicker;                    // flicker activated
-	uint8       FlickerDelay;               // flicker delay
-	int8       LightRandomizer;            // flicker randomizer
+	uint8       FlickerDelay = 0;           // flicker delay
+	int8       LightRandomizer = 0;         // flicker randomizer
 	Common::SharedPtr<t3dParticle> Particle;  // paticles attached
-	t3dF32      FlareSize;                  // flare size
+	t3dF32      FlareSize = 0;              // flare size
 	gMaterial   Material[2];                // flare material
 	t3dAnimLight AnimLight;                 // animation attached
 	t3dV3F      SolarColor[4];              // Ambient color value for solar movement




More information about the Scummvm-git-logs mailing list