aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorNicolas Bacca2003-09-28 14:08:20 +0000
committerNicolas Bacca2003-09-28 14:08:20 +0000
commit1f5d51c2586d8aa53853ebb3336bc58d0a9c085d (patch)
tree54c9f03805bf02a9f315633c4b9cc7cb08a21e2f /sword2
parent48da9f38deeab294ce84abb25f5bc980dfccff23 (diff)
downloadscummvm-rg350-1f5d51c2586d8aa53853ebb3336bc58d0a9c085d.tar.gz
scummvm-rg350-1f5d51c2586d8aa53853ebb3336bc58d0a9c085d.tar.bz2
scummvm-rg350-1f5d51c2586d8aa53853ebb3336bc58d0a9c085d.zip
Alignment fix
svn-id: r10459
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/render.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp
index 98087e3e10..a1a33de24a 100644
--- a/sword2/driver/render.cpp
+++ b/sword2/driver/render.cpp
@@ -907,7 +907,8 @@ int32 InitialiseBackgroundLayer(_parallax *p) {
uint16 x;
uint8 *data;
uint8 *dst;
- _parallaxLine *line;
+ _parallaxLine line;
+ uint8 *pLine;
debug(2, "InitialiseBackgroundLayer");
@@ -946,19 +947,21 @@ int32 InitialiseBackgroundLayer(_parallax *p) {
if (p->offset[i] == 0)
continue;
- line = (_parallaxLine *) ((uint8 *) p + FROM_LE_32(p->offset[i]));
- data = (uint8 *) line + sizeof(_parallaxLine);
- x = FROM_LE_16(line->offset);
+ pLine = (uint8 *) p + FROM_LE_32(p->offset[i]);
+ line.packets = READ_LE_UINT16(pLine);
+ line.offset = READ_LE_UINT16(pLine + 2);
+ data = pLine + sizeof(_parallaxLine);
+ x = line.offset;
dst = memchunk + i * p->w + x;
zeros = 0;
- if (line->packets == 0) {
+ if (line.packets == 0) {
memcpy(dst, data, p->w);
continue;
}
- for (j = 0; j < FROM_LE_16(line->packets); j++) {
+ for (j = 0; j < line.packets; j++) {
if (zeros) {
dst += *data;
x += *data;