Skip to content

Commit

Permalink
Game Menu: Refactor object geometry using Rect (was RectRaw)
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Dec 31, 2011
1 parent 81ce961 commit e0fa154
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 136 deletions.
12 changes: 4 additions & 8 deletions doomsday/plugins/common/include/hu_lib.h
Expand Up @@ -195,7 +195,7 @@ typedef struct mn_object_s {
int data2;

/// Current geometry.
RectRaw _geometry;
Rect* _geometry;
} mn_object_t;

mn_obtype_e MNObject_Type(const mn_object_t* obj);
Expand All @@ -208,21 +208,21 @@ int MNObject_Flags(const mn_object_t* obj);
*
* @return Rectangluar region of the parent space.
*/
const RectRaw* MNObject_Geometry(const mn_object_t* obj);
const Rect* MNObject_Geometry(const mn_object_t* obj);

/**
* Retrieve the origin of the object within the two-dimensioned coordinate
* space of the owning object.
* @return Origin point within the parent space.
*/
const Point2Raw* MNObject_Origin(const mn_object_t* obj);
const Point2* MNObject_Origin(const mn_object_t* obj);

/**
* Retrieve the boundary dimensions of the object expressed as units of
* the coordinate space of the owning object.
* @return Size of this object in units of the parent's coordinate space.
*/
const Size2Raw* MNObject_Size(const mn_object_t* obj);
const Size2* MNObject_Size(const mn_object_t* obj);

/// @return Flags value post operation for caller convenience.
int MNObject_SetFlags(mn_object_t* obj, flagop_t op, int flags);
Expand Down Expand Up @@ -585,17 +585,13 @@ boolean MNColorBox_CopyColor(mn_object_t* obj, int flags, const mn_object_t* oth
#if __JDOOM__ || __JDOOM64__
# define MNDATA_SLIDER_OFFSET_X (0)
# define MNDATA_SLIDER_OFFSET_Y (0)
# define MNDATA_SLIDER_PADDING_X (0)
# define MNDATA_SLIDER_PADDING_Y (2)
# define MNDATA_SLIDER_PATCH_LEFT ("M_THERML")
# define MNDATA_SLIDER_PATCH_RIGHT ("M_THERMR")
# define MNDATA_SLIDER_PATCH_MIDDLE ("M_THERM2")
# define MNDATA_SLIDER_PATCH_HANDLE ("M_THERMO")
#elif __JHERETIC__ || __JHEXEN__
# define MNDATA_SLIDER_OFFSET_X (0)
# define MNDATA_SLIDER_OFFSET_Y (1)
# define MNDATA_SLIDER_PADDING_X (0)
# define MNDATA_SLIDER_PADDING_Y (0)
# define MNDATA_SLIDER_PATCH_LEFT ("M_SLDLT")
# define MNDATA_SLIDER_PATCH_RIGHT ("M_SLDRT")
# define MNDATA_SLIDER_PATCH_MIDDLE ("M_SLDMD1")
Expand Down
5 changes: 5 additions & 0 deletions doomsday/plugins/common/include/hu_menu.h
Expand Up @@ -119,6 +119,11 @@ void Hu_MenuRegister(void);
*/
void Hu_MenuInit(void);

/**
* Menu shutdown, to be called when the game menu is no longer needed.
*/
void Hu_MenuShutdown(void);

/**
* Load any resources the menu needs.
*/
Expand Down
2 changes: 2 additions & 0 deletions doomsday/plugins/common/src/g_game.c
Expand Up @@ -939,8 +939,10 @@ void G_CommonShutdown(void)
P_Shutdown();
G_ShutdownEventSequences();

Hu_MenuShutdown();
ST_Shutdown();
GUI_Shutdown();

FI_StackShutdown();
}

Expand Down

0 comments on commit e0fa154

Please sign in to comment.