scummvm/scummvm — pull request #154 by fingolfin (2011-12-28 15:47:53+00:00)
Title: Dreamweb: Mark structs packed, minor tweaks

This contains some minor changes. Foremost is that it marks most of the structs in structs.h as packed. This may not strictly be necessary, but it serves as a remainder that these structs are being directly read from / stored into files.

For some (maybe all) of these, it might actually be beneficial to change that. For example, if this was applied to DynObject and SetObject, then they could be changed to inherit from a common base class, with a declaration like this:

struct Object {
uint8 slotSize;
uint8 slotCount;
uint8 objId[4];
uint8 mapad[5];
};

This then in turn could be used to clean up some code (e.g. getAnyAd returning a void pointer, or objectMatch assuming that objId starts at offset 12 for both DynObject and SetObject instances).