[Scummvm-git-logs] scummvm master -> 6009e646f69729df280455679cb52912b9e3e3b7

aquadran noreply at scummvm.org
Sun Jul 31 19:16:50 UTC 2022


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

Summary:
6009e646f6 ICB: Few more endian fixes


Commit: 6009e646f69729df280455679cb52912b9e3e3b7
    https://github.com/scummvm/scummvm/commit/6009e646f69729df280455679cb52912b9e3e3b7
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2022-07-31T21:16:45+02:00

Commit Message:
ICB: Few more endian fixes

Changed paths:
    engines/icb/icon_menu_pc.cpp
    engines/icb/remora_sprite.cpp
    engines/icb/remora_sprite_pc.cpp


diff --git a/engines/icb/icon_menu_pc.cpp b/engines/icb/icon_menu_pc.cpp
index 43499fe34d6..63cf41b15a0 100644
--- a/engines/icb/icon_menu_pc.cpp
+++ b/engines/icb/icon_menu_pc.cpp
@@ -99,8 +99,8 @@ void _icon_menu::Activate(const _icon_list *pIconList, const _icon_menu_duplicat
 		_pxBitmap *psIconBitmap = (_pxBitmap *)rs_icons->Res_open(strFullIconName.c_str(), nFullIconNameHash, m_pcIconCluster, m_nIconClusterHash);
 
 		// Check the schema is correct.
-		if (psIconBitmap->schema != PC_BITMAP_SCHEMA)
-			Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", strFullIconName.c_str(), PC_BITMAP_SCHEMA, psIconBitmap->schema);
+		if (FROM_LE_32(psIconBitmap->schema) != PC_BITMAP_SCHEMA)
+			Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", strFullIconName.c_str(), PC_BITMAP_SCHEMA, FROM_LE_32(psIconBitmap->schema));
 
 		// Create a surface for the icon
 		m_pnIconSurfaceIDs[i] = surface_manager->Create_new_surface(strIconName.c_str(), ICON_X_SIZE, ICON_Y_SIZE, EITHER);
@@ -180,8 +180,8 @@ void _icon_menu::ReActivate() {
 		_pxBitmap *psIconBitmap = (_pxBitmap *)rs_icons->Res_open(strFullIconName.c_str(), nFullIconNameHash, m_pcIconCluster, m_nIconClusterHash);
 
 		// Check the schema is correct.
-		if (psIconBitmap->schema != PC_BITMAP_SCHEMA)
-			Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", strFullIconName.c_str(), PC_BITMAP_SCHEMA, psIconBitmap->schema);
+		if (FROM_LE_32(psIconBitmap->schema) != PC_BITMAP_SCHEMA)
+			Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", strFullIconName.c_str(), PC_BITMAP_SCHEMA, FROM_LE_32(psIconBitmap->schema));
 
 		// Create a surface for the icon
 		m_pnIconSurfaceIDs[i] = surface_manager->Create_new_surface("Icon", ICON_X_SIZE, ICON_Y_SIZE, EITHER);
@@ -430,8 +430,8 @@ void _icon_menu::SetupAdding(const char *pcIconName, uint32 &nSurfaceID) {
 	_pxBitmap *psIconBitmap = (_pxBitmap *)rs_icons->Res_open(strFullIconName.c_str(), nFullIconNameHash, m_pcIconCluster, m_nIconClusterHash);
 
 	// Check the schema is correct.
-	if (psIconBitmap->schema != PC_BITMAP_SCHEMA)
-		Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", strFullIconName.c_str(), PC_BITMAP_SCHEMA, psIconBitmap->schema);
+	if (FROM_LE_32(psIconBitmap->schema) != PC_BITMAP_SCHEMA)
+		Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", strFullIconName.c_str(), PC_BITMAP_SCHEMA, FROM_LE_32(psIconBitmap->schema));
 
 	// Create a surface for the clips icon.
 	nSurfaceID = surface_manager->Create_new_surface(pcIconName, ICON_X_SIZE, ICON_Y_SIZE, EITHER);
@@ -578,8 +578,8 @@ void _icon_menu::SetUpOffScreenArrows() {
 
 		_pxBitmap *psIconBitmap = (_pxBitmap *)rs_icons->Res_open(strLeftArrowIconName.c_str(), nFullIconNameHash, m_pcIconCluster, m_nIconClusterHash);
 
-		if (psIconBitmap->schema != PC_BITMAP_SCHEMA)
-			Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", strLeftArrowIconName.c_str(), PC_BITMAP_SCHEMA, psIconBitmap->schema);
+		if (FROM_LE_32(psIconBitmap->schema) != PC_BITMAP_SCHEMA)
+			Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", strLeftArrowIconName.c_str(), PC_BITMAP_SCHEMA, FROM_LE_32(psIconBitmap->schema));
 
 		// Draw the two frames onto their respective surfaces.
 		SpriteXYFrameDraw(pyLeftBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, nullptr, 255);
@@ -610,8 +610,8 @@ void _icon_menu::SetUpOffScreenArrows() {
 
 		_pxBitmap *psIconBitmap = (_pxBitmap *)rs_icons->Res_open(strRightArrowIconName.c_str(), nFullIconNameHash, m_pcIconCluster, m_nIconClusterHash);
 
-		if (psIconBitmap->schema != PC_BITMAP_SCHEMA)
-			Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", strRightArrowIconName.c_str(), PC_BITMAP_SCHEMA, psIconBitmap->schema);
+		if (FROM_LE_32(psIconBitmap->schema) != PC_BITMAP_SCHEMA)
+			Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", strRightArrowIconName.c_str(), PC_BITMAP_SCHEMA, FROM_LE_32(psIconBitmap->schema));
 
 		// Draw the two frames onto their respective surfaces.
 		SpriteXYFrameDraw(pyRightBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, nullptr, 255);
diff --git a/engines/icb/remora_sprite.cpp b/engines/icb/remora_sprite.cpp
index d8035bce8e4..2360129f51c 100644
--- a/engines/icb/remora_sprite.cpp
+++ b/engines/icb/remora_sprite.cpp
@@ -54,8 +54,8 @@ void _remora_sprite::InitialiseFromBitmapName(const char *pcBitmapName, const ch
 	// made more sophisticated to deal with sprites that change in size as they are played.
 	psSprite = (_pxSprite *)((byte *)psBitmap + FROM_LE_32(psBitmap->sprite_offsets[0]));
 
-	m_nHalfSpriteWidth = psSprite->width / 2;
-	m_nHalfSpriteHeight = psSprite->height / 2;
+	m_nHalfSpriteWidth = FROM_LE_32(psSprite->width) / 2;
+	m_nHalfSpriteHeight = FROM_LE_32(psSprite->height) / 2;
 
 	// Frame PC starts at 0.
 	m_nFramePC = 0;
diff --git a/engines/icb/remora_sprite_pc.cpp b/engines/icb/remora_sprite_pc.cpp
index b530f1eee48..9695ddca0a5 100644
--- a/engines/icb/remora_sprite_pc.cpp
+++ b/engines/icb/remora_sprite_pc.cpp
@@ -59,8 +59,8 @@ void _remora_sprite::GenericSpriteDraw(int32 nX, int32 nY, bool8 bPosition, cons
 	// Open the resource and get the current frame.
 	psBitmap = (_pxBitmap *)rs_remora->Res_open(m_pcName, m_nNameHash, m_pcClusterName, m_nClusterHash);
 
-	if (psBitmap->schema != PC_BITMAP_SCHEMA)
-		Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", m_pcName, PC_BITMAP_SCHEMA, psBitmap->schema);
+	if (FROM_LE_32(psBitmap->schema) != PC_BITMAP_SCHEMA)
+		Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", m_pcName, PC_BITMAP_SCHEMA, FROM_LE_32(psBitmap->schema));
 
 	// Lock the surface and get the pitch.
 	uint32 remoraSurfaceId = g_oRemora->GetRemoraSurfaceId();




More information about the Scummvm-git-logs mailing list