[Scummvm-git-logs] scummvm master -> 929c841dbe0e775ebe5edce8b9fcd15f55d1d386
Strangerke
noreply at scummvm.org
Sat May 11 21:53:30 UTC 2024
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:
929c841dbe BAGEL: Remove unused structs and code in bitmap
Commit: 929c841dbe0e775ebe5edce8b9fcd15f55d1d386
https://github.com/scummvm/scummvm/commit/929c841dbe0e775ebe5edce8b9fcd15f55d1d386
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-11T22:53:20+01:00
Commit Message:
BAGEL: Remove unused structs and code in bitmap
Changed paths:
engines/bagel/boflib/gfx/bitmap.cpp
engines/bagel/boflib/gfx/bitmap.h
diff --git a/engines/bagel/boflib/gfx/bitmap.cpp b/engines/bagel/boflib/gfx/bitmap.cpp
index 97a120cf3eb..6a577332822 100644
--- a/engines/bagel/boflib/gfx/bitmap.cpp
+++ b/engines/bagel/boflib/gfx/bitmap.cpp
@@ -65,9 +65,8 @@ CBofBitmap::CBofBitmap(int dx, int dy, CBofPalette *pPalette, bool bOwnPalette,
_pPalette = nullptr;
_bInitialized = true;
- // Allow privatization of the bitmap (used only on mac from displaytextex).;
- _bPrivateBmp = (pPrivateBuff != nullptr);
- if (_bPrivateBmp == true) {
+ // Allow privatization of the bitmap (used only on mac from displayTextEx).;
+ if (pPrivateBuff != nullptr) {
_pBits = pPrivateBuff;
_bitmap.w = dx;
@@ -80,19 +79,6 @@ CBofBitmap::CBofBitmap(int dx, int dy, CBofPalette *pPalette, bool bOwnPalette,
_pBits = nullptr;
}
- // Fill the info structure
- _cBitmapInfo._infoHeader._infoSize = sizeof(BOFBITMAPINFOHEADER);
- _cBitmapInfo._infoHeader._width = dx;
- _cBitmapInfo._infoHeader._height = dy;
- _cBitmapInfo._infoHeader._planes = 1;
- _cBitmapInfo._infoHeader._bitCount = 8;
- _cBitmapInfo._infoHeader._compression = 0;
- _cBitmapInfo._infoHeader._sizeImage = 0;
- _cBitmapInfo._infoHeader._xPelsPerMeter = 0;
- _cBitmapInfo._infoHeader._yPelsPerMeter = 0;
- _cBitmapInfo._infoHeader._clrUsed = 0;
- _cBitmapInfo._infoHeader._clrImportant = 0;
-
_pPalette = pPalette;
load();
}
diff --git a/engines/bagel/boflib/gfx/bitmap.h b/engines/bagel/boflib/gfx/bitmap.h
index 7c68f65d721..cf314a4febb 100644
--- a/engines/bagel/boflib/gfx/bitmap.h
+++ b/engines/bagel/boflib/gfx/bitmap.h
@@ -52,59 +52,18 @@ namespace Bagel {
// forward declare CBofWindow
class CBofWindow;
-#include "common/pack-start.h" // START STRUCT PACKING
-
-struct bofBITMAPINFOHEADER {
- uint32 _infoSize;
- int32 _width;
- int32 _height;
- uint16 _planes;
- uint16 _bitCount;
- uint32 _compression;
- uint32 _sizeImage;
- int32 _xPelsPerMeter;
- int32 _yPelsPerMeter;
- uint32 _clrUsed;
- uint32 _clrImportant;
-} PACKED_STRUCT;
-typedef bofBITMAPINFOHEADER BOFBITMAPINFOHEADER;
-
-struct bofBITMAPINFO {
- BOFBITMAPINFOHEADER bmiHeader;
- BOFRGBQUAD bmiColors[1];
-} PACKED_STRUCT;
-typedef bofBITMAPINFO BOFBITMAPINFO;
-
-struct bofBITMAPFILEHEADER {
- uint16 _fileType;
- uint32 _fileSize;
- uint16 _reserved1;
- uint16 _reserved2;
- uint32 _offBits;
-} PACKED_STRUCT;
-typedef bofBITMAPFILEHEADER BOFBITMAPFILEHEADER;
-
-struct bofBITMAP_EX {
- BOFBITMAPFILEHEADER _fileHeader;
- BOFBITMAPINFOHEADER _infoHeader;
- BOFRGBQUAD _rgbValues[256];
-} PACKED_STRUCT;
-typedef bofBITMAP_EX BITMAP_EX;
-
-#include "common/pack-end.h" // END STRUCT PACKING
-
class CBofBitmap : public CBofError, public CBofObject, public CCache {
protected:
/**
* Does the actual allocation for this bitmap
* @return true is this bitmap was successfully loaded into the cache
*/
- virtual bool alloc();
+ bool alloc() override;
/**
* Frees the data used by this bitmap (removes from cache)
*/
- virtual void free();
+ void free() override;
//
// data members
@@ -113,8 +72,6 @@ protected:
char _szFileName[MAX_FNAME];
- BITMAP_EX _cBitmapInfo;
-
Graphics::ManagedSurface _bitmap;
byte *_pBits = nullptr;
@@ -130,8 +87,6 @@ protected:
bool _bReadOnly = false;
bool _bInitialized = false;
- bool _bPrivateBmp = false;
-
public:
/**
* Default constructor
@@ -144,6 +99,7 @@ public:
* @param dy Height of new bitmap
* @param pPalette Palette to use for this bitmap
* @param bOwnPalette true if destructor should delete palette
+ * @param pPrivateBuff
*/
CBofBitmap(int dx, int dy, CBofPalette *pPalette, bool bOwnPalette = false, byte *pPrivateBuff = nullptr);
@@ -162,7 +118,7 @@ public:
/**
* Allocates the structures needed for a CBofBitmap
- * @param Palette to be assigned into this bitmap
+ * @param pPalette Palette to be assigned into this bitmap
*/
ErrorCode buildBitmap(CBofPalette *pPalette);
More information about the Scummvm-git-logs
mailing list