From 2e7b16a8bdb6ad1cf51046d57eb0f5406ee2cc13 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 13 Jun 2012 11:28:25 +0200 Subject: HUGO: Apply coding convention (in progress) --- engines/hugo/game.h | 100 ++++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) (limited to 'engines/hugo/game.h') diff --git a/engines/hugo/game.h b/engines/hugo/game.h index b1c5f407b3..ab5e2dff56 100644 --- a/engines/hugo/game.h +++ b/engines/hugo/game.h @@ -84,11 +84,11 @@ enum path_t { }; struct hugo_boot_t { // Common HUGO boot file - char checksum; // Checksum for boot structure (not exit text) - char registered; // TRUE if registered version, else FALSE - char pbswitch[8]; // Playback switch string - char distrib[32]; // Distributor branding string - uint16 exit_len; // Length of exit text (next in file) + char _checksum; // Checksum for boot structure (not exit text) + char _registered; // TRUE if registered version, else FALSE + char _pbswitch[8]; // Playback switch string + char _distrib[32]; // Distributor branding string + uint16 _exitLen; // Length of exit text (next in file) } PACKED_STRUCT; /** @@ -101,11 +101,11 @@ typedef byte *sound_pt; // ptr to sound (or music) d * Structure for initializing maze processing */ struct maze_t { - bool enabledFl; // TRUE when maze processing enabled - byte size; // Size of (square) maze matrix - int x1, y1, x2, y2; // maze hotspot bounding box - int x3, x4; // north, south x entry coordinates - byte firstScreenIndex; // index of first screen in maze + bool _enabledFl; // TRUE when maze processing enabled + byte _size; // Size of (square) maze matrix + int _x1, _y1, _x2, _y2; // maze hotspot bounding box + int _x3, _x4; // north, south x entry coordinates + byte _firstScreenIndex; // index of first screen in maze }; /** @@ -113,25 +113,25 @@ struct maze_t { * The image data is in 8-bit DIB format, i.e. 1 byte = 1 pixel */ struct seq_t { // Linked list of images - byte *imagePtr; // ptr to image - uint16 bytesPerLine8; // bytes per line (8bits) - uint16 lines; // lines - uint16 x1, x2, y1, y2; // Offsets from x,y: data bounding box - seq_t *nextSeqPtr; // ptr to next record + byte *_imagePtr; // ptr to image + uint16 _bytesPerLine8; // bytes per line (8bits) + uint16 _lines; // lines + uint16 _x1, _x2, _y1, _y2; // Offsets from x,y: data bounding box + seq_t *_nextSeqPtr; // ptr to next record }; /** * The following is an array of structures of above sequences */ struct seqList_t { - uint16 imageNbr; // Number of images in sequence - seq_t *seqPtr; // Ptr to sequence structure + uint16 _imageNbr; // Number of images in sequence + seq_t *_seqPtr; // Ptr to sequence structure }; #include "common/pack-start.h" // START STRUCT PACKING struct sound_hdr_t { // Sound file lookup entry - uint16 size; // Size of sound data in bytes - uint32 offset; // Offset of sound data in file + uint16 _size; // Size of sound data in bytes + uint32 _offset; // Offset of sound data in file } PACKED_STRUCT; #include "common/pack-end.h" // END STRUCT PACKING @@ -141,37 +141,37 @@ static const int kMaxSeqNumb = 4; // Number of sequences of im * Following is definition of object attributes */ struct object_t { - uint16 nounIndex; // String identifying object - uint16 dataIndex; // String describing the object - uint16 *stateDataIndex; // Added by Strangerke to handle the LOOK_S state-dependant descriptions - path_t pathType; // Describe path object follows - int vxPath, vyPath; // Delta velocities (e.g. for CHASE) - uint16 actIndex; // Action list to do on collision with hero - byte seqNumb; // Number of sequences in list - seq_t *currImagePtr; // Sequence image currently in use - seqList_t seqList[kMaxSeqNumb]; // Array of sequence structure ptrs and lengths - cycle_t cycling; // Whether cycling, forward or backward - byte cycleNumb; // No. of times to cycle - byte frameInterval; // Interval (in ticks) between frames - byte frameTimer; // Decrementing timer for above - int8 radius; // Defines sphere of influence by hero - byte screenIndex; // Screen in which object resides - int x, y; // Current coordinates of object - int oldx, oldy; // Previous coordinates of object - int8 vx, vy; // Velocity - byte objValue; // Value of object - int genericCmd; // Bit mask of 'generic' commands for object - uint16 cmdIndex; // ptr to list of cmd structures for verbs - bool carriedFl; // TRUE if object being carried - byte state; // state referenced in cmd list - bool verbOnlyFl; // TRUE if verb-only cmds allowed e.g. sit,look - byte priority; // Whether object fore, background or floating - int16 viewx, viewy; // Position to view object from (or 0 or -1) - int16 direction; // Direction to view object from - byte curSeqNum; // Save which seq number currently in use - byte curImageNum; // Save which image of sequence currently in use - int8 oldvx; // Previous vx (used in wandering) - int8 oldvy; // Previous vy + uint16 _nounIndex; // String identifying object + uint16 _dataIndex; // String describing the object + uint16 *_stateDataIndex; // Added by Strangerke to handle the LOOK_S state-dependant descriptions + path_t _pathType; // Describe path object follows + int _vxPath, _vyPath; // Delta velocities (e.g. for CHASE) + uint16 _actIndex; // Action list to do on collision with hero + byte _seqNumb; // Number of sequences in list + seq_t *_currImagePtr; // Sequence image currently in use + seqList_t _seqList[kMaxSeqNumb]; // Array of sequence structure ptrs and lengths + cycle_t _cycling; // Whether cycling, forward or backward + byte _cycleNumb; // No. of times to cycle + byte _frameInterval; // Interval (in ticks) between frames + byte _frameTimer; // Decrementing timer for above + int8 _radius; // Defines sphere of influence by hero + byte _screenIndex; // Screen in which object resides + int _x, _y; // Current coordinates of object + int _oldx, _oldy; // Previous coordinates of object + int8 _vx, _vy; // Velocity + byte _objValue; // Value of object + int _genericCmd; // Bit mask of 'generic' commands for object + uint16 _cmdIndex; // ptr to list of cmd structures for verbs + bool _carriedFl; // TRUE if object being carried + byte _state; // state referenced in cmd list + bool _verbOnlyFl; // TRUE if verb-only cmds allowed e.g. sit,look + byte _priority; // Whether object fore, background or floating + int16 _viewx, _viewy; // Position to view object from (or 0 or -1) + int16 _direction; // Direction to view object from + byte _curSeqNum; // Save which seq number currently in use + byte _curImageNum; // Save which image of sequence currently in use + int8 _oldvx; // Previous vx (used in wandering) + int8 _oldvy; // Previous vy }; } // End of namespace Hugo -- cgit v1.2.3 From 999ae29de43444118b5990a272a98031c4707ee0 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 13 Jun 2012 20:58:01 +0200 Subject: HUGO: Rename structs and enums --- engines/hugo/game.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'engines/hugo/game.h') diff --git a/engines/hugo/game.h b/engines/hugo/game.h index ab5e2dff56..29e3bf9b55 100644 --- a/engines/hugo/game.h +++ b/engines/hugo/game.h @@ -45,7 +45,7 @@ namespace Hugo { enum {LOOK_NAME = 1, TAKE_NAME}; // Index of name used in showing takeables and in confirming take // Definitions of 'generic' commands: Max # depends on size of gencmd in -// the object_t record since each requires 1 bit. Currently up to 16 +// the Object record since each requires 1 bit. Currently up to 16 enum {LOOK = 1, TAKE = 2, DROP = 4, LOOK_S = 8}; enum TEXTCOLORS { @@ -55,25 +55,25 @@ enum TEXTCOLORS { _TLIGHTRED, _TLIGHTMAGENTA, _TLIGHTYELLOW, _TBRIGHTWHITE }; -enum uif_t {U_FONT5, U_FONT6, U_FONT8, UIF_IMAGES, NUM_UIF_ITEMS}; +enum Uif {U_FONT5, U_FONT6, U_FONT8, UIF_IMAGES, NUM_UIF_ITEMS}; static const int kFirstFont = U_FONT5; /** * Enumerate ways of cycling a sequence of frames */ -enum cycle_t {kCycleInvisible, kCycleAlmostInvisible, kCycleNotCycling, kCycleForward, kCycleBackward}; +enum Cycle {kCycleInvisible, kCycleAlmostInvisible, kCycleNotCycling, kCycleForward, kCycleBackward}; /** * Enumerate sequence index matching direction of travel */ enum {SEQ_RIGHT, SEQ_LEFT, SEQ_DOWN, SEQ_UP}; -enum font_t {LARGE_ROMAN, MED_ROMAN, NUM_GDI_FONTS, INIT_FONTS, DEL_FONTS}; +enum Font {LARGE_ROMAN, MED_ROMAN, NUM_GDI_FONTS, INIT_FONTS, DEL_FONTS}; /** * Enumerate the different path types for an object */ -enum path_t { +enum Path { kPathUser, // User has control of object via cursor keys kPathAuto, // Computer has control, controlled by action lists kPathQuiet, // Computer has control and no commands allowed @@ -83,7 +83,7 @@ enum path_t { kPathWander2 // Same as WANDER, except keeps cycling when stationary }; -struct hugo_boot_t { // Common HUGO boot file +struct hugoBoot { // Common HUGO boot file char _checksum; // Checksum for boot structure (not exit text) char _registered; // TRUE if registered version, else FALSE char _pbswitch[8]; // Playback switch string @@ -94,13 +94,13 @@ struct hugo_boot_t { // Common HUGO boot file /** * Game specific type definitions */ -typedef byte *image_pt; // ptr to an object image (sprite) +typedef byte *ImagePtr; // ptr to an object image (sprite) typedef byte *sound_pt; // ptr to sound (or music) data /** * Structure for initializing maze processing */ -struct maze_t { +struct Maze { bool _enabledFl; // TRUE when maze processing enabled byte _size; // Size of (square) maze matrix int _x1, _y1, _x2, _y2; // maze hotspot bounding box @@ -112,24 +112,24 @@ struct maze_t { * The following is a linked list of images in an animation sequence * The image data is in 8-bit DIB format, i.e. 1 byte = 1 pixel */ -struct seq_t { // Linked list of images +struct Seq { // Linked list of images byte *_imagePtr; // ptr to image uint16 _bytesPerLine8; // bytes per line (8bits) uint16 _lines; // lines uint16 _x1, _x2, _y1, _y2; // Offsets from x,y: data bounding box - seq_t *_nextSeqPtr; // ptr to next record + Seq *_nextSeqPtr; // ptr to next record }; /** * The following is an array of structures of above sequences */ -struct seqList_t { +struct SeqList { uint16 _imageNbr; // Number of images in sequence - seq_t *_seqPtr; // Ptr to sequence structure + Seq *_seqPtr; // Ptr to sequence structure }; #include "common/pack-start.h" // START STRUCT PACKING -struct sound_hdr_t { // Sound file lookup entry +struct SoundHdr { // Sound file lookup entry uint16 _size; // Size of sound data in bytes uint32 _offset; // Offset of sound data in file } PACKED_STRUCT; @@ -140,17 +140,17 @@ static const int kMaxSeqNumb = 4; // Number of sequences of im /** * Following is definition of object attributes */ -struct object_t { +struct Object { uint16 _nounIndex; // String identifying object uint16 _dataIndex; // String describing the object - uint16 *_stateDataIndex; // Added by Strangerke to handle the LOOK_S state-dependant descriptions - path_t _pathType; // Describe path object follows + uint16 *_stateDataIndex; // Added by Strangerke to handle the LOOK_S state-dependant descriptions + Path _pathType; // Describe path object follows int _vxPath, _vyPath; // Delta velocities (e.g. for CHASE) uint16 _actIndex; // Action list to do on collision with hero byte _seqNumb; // Number of sequences in list - seq_t *_currImagePtr; // Sequence image currently in use - seqList_t _seqList[kMaxSeqNumb]; // Array of sequence structure ptrs and lengths - cycle_t _cycling; // Whether cycling, forward or backward + Seq *_currImagePtr; // Sequence image currently in use + SeqList _seqList[kMaxSeqNumb]; // Array of sequence structure ptrs and lengths + Cycle _cycling; // Whether cycling, forward or backward byte _cycleNumb; // No. of times to cycle byte _frameInterval; // Interval (in ticks) between frames byte _frameTimer; // Decrementing timer for above -- cgit v1.2.3 From 179427c78f2a634beb4485661bf2b1fc78ef559f Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 13 Jun 2012 21:18:37 +0200 Subject: HUGO: Rename pointers --- engines/hugo/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/hugo/game.h') diff --git a/engines/hugo/game.h b/engines/hugo/game.h index 29e3bf9b55..ed49ee8cbe 100644 --- a/engines/hugo/game.h +++ b/engines/hugo/game.h @@ -95,7 +95,7 @@ struct hugoBoot { // Common HUGO boot file * Game specific type definitions */ typedef byte *ImagePtr; // ptr to an object image (sprite) -typedef byte *sound_pt; // ptr to sound (or music) data +typedef byte *SoundPtr; // ptr to sound (or music) data /** * Structure for initializing maze processing -- cgit v1.2.3