mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-25 18:31:14 +00:00
Corresponding header change for BII; cleanup
(cherry picked from commit 36ccf8a46a72b6c970df04bd6ecc60efd0363476)
This commit is contained in:
parent
c8c1a76381
commit
6b4cc38de6
@ -79,13 +79,13 @@ inline video_depth DepthModeForPixelDepth(int depth)
|
|||||||
// Returns the name of a video_depth, or an empty string if the depth is unknown
|
// Returns the name of a video_depth, or an empty string if the depth is unknown
|
||||||
const char * NameOfDepth(video_depth depth);
|
const char * NameOfDepth(video_depth depth);
|
||||||
|
|
||||||
// Return a bytes-per-row value (assuming no padding) for the specified depth and pixel width
|
// Return a bytes-per-row value (assuming enough bytes to fit the bits but no further padding) for the specified depth and pixel width
|
||||||
inline uint32 TrivialBytesPerRow(uint32 width, video_depth depth)
|
inline uint32 TrivialBytesPerRow(uint32 width, video_depth depth)
|
||||||
{
|
{
|
||||||
switch (depth) {
|
switch (depth) {
|
||||||
case VDEPTH_1BIT: return width / 8;
|
case VDEPTH_1BIT: return (width + 7) / 8;
|
||||||
case VDEPTH_2BIT: return width / 4;
|
case VDEPTH_2BIT: return (width + 3) / 4;
|
||||||
case VDEPTH_4BIT: return width / 2;
|
case VDEPTH_4BIT: return (width + 1) / 2;
|
||||||
case VDEPTH_8BIT: return width;
|
case VDEPTH_8BIT: return width;
|
||||||
case VDEPTH_16BIT: return width * 2;
|
case VDEPTH_16BIT: return width * 2;
|
||||||
case VDEPTH_32BIT: return width * 4;
|
case VDEPTH_32BIT: return width * 4;
|
||||||
|
@ -66,13 +66,13 @@ inline int DepthModeForPixelDepth(int depth)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return a bytes-per-row value (assuming no padding) for the specified depth and pixel width
|
// Return a bytes-per-row value (assuming enough bytes to fit the bits but no further padding) for the specified depth and pixel width
|
||||||
inline uint32 TrivialBytesPerRow(uint32 width, int mode)
|
inline uint32 TrivialBytesPerRow(uint32 width, int mode)
|
||||||
{
|
{
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case APPLE_1_BIT: return (width + 7)/8;
|
case APPLE_1_BIT: return (width + 7) / 8;
|
||||||
case APPLE_2_BIT: return (width + 3)/4;
|
case APPLE_2_BIT: return (width + 3) / 4;
|
||||||
case APPLE_4_BIT: return (width + 1)/2;
|
case APPLE_4_BIT: return (width + 1) / 2;
|
||||||
case APPLE_8_BIT: return width;
|
case APPLE_8_BIT: return width;
|
||||||
case APPLE_16_BIT: return width * 2;
|
case APPLE_16_BIT: return width * 2;
|
||||||
case APPLE_32_BIT: return width * 4;
|
case APPLE_32_BIT: return width * 4;
|
||||||
|
Loading…
Reference in New Issue
Block a user