Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

EMI: PS2 version fixes #975

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion engines/grim/set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,12 @@ void SetShadow::loadBinary(Common::SeekableReadStream *data) {
data->read(name, nameLen);
_name = Common::String(name);

data->skip(5); // Unknown
int numUnknownBytes = data->readSint32LE();
// The following bytes seem to be always 0. Perhaps padding of some sort?
for (int i = 0; i < numUnknownBytes; ++i) {
byte value = data->readByte();
assert(value == 0);
}

char v[sizeof(float) * 3];
data->read(v, sizeof(float) * 3);
Expand Down
8 changes: 7 additions & 1 deletion graphics/pixelformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ struct PixelFormat {
}

inline void colorToARGB(uint32 color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) const {
a = (aBits() == 0) ? 0xFF : (((color >> aShift) << aLoss) & 0xFF);
if (aBits() == 0) {
a = 0xFF;
} else if (aBits() == 1) {
a = (color >> aShift) ? 0xFF : 0;
} else {
a = ((color >> aShift) << aLoss) & 0xFF;
}
r = ((color >> rShift) << rLoss) & 0xFF;
g = ((color >> gShift) << gLoss) & 0xFF;
b = ((color >> bShift) << bLoss) & 0xFF;
Expand Down