TWINE: fixed compiler warning in release mode

This commit is contained in:
Martin Gerhardy 2021-02-21 12:23:09 +01:00
parent e6f0a51cdc
commit 9ee2fdc19c
3 changed files with 24 additions and 21 deletions

View File

@ -148,7 +148,7 @@ void BodyData::loadSpheres(Common::SeekableReadStream &stream) {
}
bool BodyData::loadFromStream(Common::SeekableReadStream &stream) {
*(uint16 *)&bodyFlag = stream.readUint16LE();
bodyFlag.value = stream.readUint16LE();
minsx = stream.readSint16LE();
maxsx = stream.readSint16LE();
minsy = stream.readSint16LE();

View File

@ -97,23 +97,26 @@ private:
BoneFrame _boneStates[560];
public:
struct BodyFlags {
uint16 unk1 : 1; // 1 << 0
uint16 animated : 1; // 1 << 1
uint16 unk3 : 1; // 1 << 2
uint16 unk4 : 1; // 1 << 3
uint16 unk5 : 1; // 1 << 4
uint16 unk6 : 1; // 1 << 5
uint16 unk7 : 1; // 1 << 6
uint16 alreadyPrepared : 1; // 1 << 7
uint16 unk9 : 1; // 1 << 8
uint16 unk10 : 1; // 1 << 9
uint16 unk11 : 1; // 1 << 10
uint16 unk12 : 1; // 1 << 11
uint16 unk13 : 1; // 1 << 12
uint16 unk14 : 1; // 1 << 13
uint16 unk15 : 1; // 1 << 14
uint16 unk16 : 1; // 1 << 15
union BodyFlags {
struct BitMask {
uint16 unk1 : 1; // 1 << 0
uint16 animated : 1; // 1 << 1
uint16 unk3 : 1; // 1 << 2
uint16 unk4 : 1; // 1 << 3
uint16 unk5 : 1; // 1 << 4
uint16 unk6 : 1; // 1 << 5
uint16 unk7 : 1; // 1 << 6
uint16 alreadyPrepared : 1; // 1 << 7
uint16 unk9 : 1; // 1 << 8
uint16 unk10 : 1; // 1 << 9
uint16 unk11 : 1; // 1 << 10
uint16 unk12 : 1; // 1 << 11
uint16 unk13 : 1; // 1 << 12
uint16 unk14 : 1; // 1 << 13
uint16 unk15 : 1; // 1 << 14
uint16 unk16 : 1; // 1 << 15
} mask;
uint16 value;
} bodyFlag;
int16 minsx = 0;
@ -125,7 +128,7 @@ public:
int16 offsetToData = 0;
inline bool isAnimated() const {
return bodyFlag.animated;
return bodyFlag.mask.animated;
}
inline uint getNumBones() const {

View File

@ -335,11 +335,11 @@ void Text::initText(int32 index) {
}
void Text::initProgressiveTextBuffer() {
Common::fill(&_progressiveTextBuffer[0], &_progressiveTextBuffer[256], ' ');
Common::fill(&_progressiveTextBuffer[0], &_progressiveTextBuffer[sizeof(_progressiveTextBuffer)], ' ');
// the end of the buffer defines how fast the next page is shown - as the
// whitespaces are handled in the fade in process, too. But we need at least 32 chars,
// to completly fade in the last characters of a full page (see TEXT_MAX_FADE_IN_CHR)
_progressiveTextBuffer[255] = '\0';
_progressiveTextBuffer[sizeof(_progressiveTextBuffer) - 1] = '\0';
_progressiveTextBufferPtr = _progressiveTextBuffer;
_dialTextBoxCurrentLine = 0;
}