Implement PixMap.rowBytes

This commit is contained in:
Iliyas Jorio 2021-01-10 10:16:30 +01:00
parent 774b9fe1b4
commit 87a27333c3
2 changed files with 2 additions and 0 deletions

View File

@ -40,6 +40,7 @@ struct GrafPortImpl
macpm = {}; macpm = {};
macpm.bounds = boundsRect; macpm.bounds = boundsRect;
macpm.pixelSize = 32; macpm.pixelSize = 32;
macpm.rowBytes = (pixels.width * macpm.pixelSize / 8) | (1 << 15); // bit 15 = 1: structure is PixMap, not BitMap
macpm._impl = (Ptr) &pixels; macpm._impl = (Ptr) &pixels;
macpmPtr = &macpm; macpmPtr = &macpm;
} }

View File

@ -143,6 +143,7 @@ typedef struct PixMap
{ {
Rect bounds; Rect bounds;
short pixelSize; short pixelSize;
short rowBytes;
Ptr _impl; // Points to ARGBPixmap Ptr _impl; // Points to ARGBPixmap
} PixMap; } PixMap;
typedef PixMap* PixMapPtr; typedef PixMap* PixMapPtr;