Albeit not 100% necessary for rewriting the HE sound engine,
I decided to make this change in order to:
- Give proper meaning to magic numbers and variables
which were given temporary names 20 years ago;
- Avoid going insane when making comparison with HE code
and ours, when rewriting the sound code.
Commit befd3b3511 introduced a regression
on big-endian systems, causing Guybrush to moonwalk and Wally to lose
his body in the first scene of COMI, for example.
`costumeFlags` must be read as a little-endian value, now that it it's
been confirmed to be an uint16 and not a byte, in the disasms.
Found after diff'ing the -fverbose-asm output of akos.cpp during a Git
bisect on a big-endian system.
This commit:
- Continues my AKOS relabeling task and adds some documentation and missing information;
- Renames the codec functions from codec1, codec5 and codec16 to something more expressive;
- Add '_' in front of private class members, when missing;
- Changes "v1" names (unnamed variables supposedly coming from Ghidra or similar tools...) to something more expressive;
- Renames related variables from foo_bar (or foobar) to fooBar (on costume.cpp, base-costume.cpp and akos.cpp).
This is part of an on-going effort on my end to document the AKOS code, and fix strange stuff
such as integers being used as booleans, and variable_names instead of variableNames
It was getting painful to go through the AKOS system without proper opcodes documentation, so here it is.
This was checked against COMI and SCUMM HE code, for names consistency.
This was an old workaround for GCC 3.4, but we don't support this
compiler anymore since we now require C++11. This removes a hack and
saves some bytes.
This undoes commit a7a17969c3.
(regression from b542fad7)
The introduction of the skip_column variable caused skipping of columns that are actually meant to be drawn. The original interpreter has a similiar mechanism, but it only applies to colors that are translated via the shadow palette. This avoids recursive shading (pixels that already got translated via the shadow palette could get passed through the table again in case of horizontal scaling). I guess that is what b542fad7 actually meant to fix.
MKID_BE relied on unspecified behavior of the C++ compiler,
and as such was always a bit unsafe. The new MKTAG macro
is slightly less elegant, but does no longer depend on the
behavior of the compiler.
Inspired by FFmpeg, which has an almost identical macro.