Skip to content

Commit

Permalink
Refactor|libcommon|Menu: Moved menu widget implementations to new *cp…
Browse files Browse the repository at this point in the history
…p files
  • Loading branch information
danij-deng committed Sep 17, 2014
1 parent b8c88a5 commit 01559be
Show file tree
Hide file tree
Showing 22 changed files with 4,123 additions and 3,564 deletions.
18 changes: 17 additions & 1 deletion doomsday/plugins/common/common.pri
Expand Up @@ -151,4 +151,20 @@ SOURCES += \
$$common_src/saveslots.cpp \
$$common_src/thingarchive.cpp \
$$common_src/thinkerinfo.cpp \
$$common_src/x_hair.c
$$common_src/x_hair.c \
$$common_src/menu/page.cpp \
$$common_src/menu/widgets/colorpreviewwidget.cpp \
$$common_src/menu/widgets/cvarinlinelistwidget.cpp \
$$common_src/menu/widgets/cvarlineeditwidget.cpp \
$$common_src/menu/widgets/cvartogglewidget.cpp \
$$common_src/menu/widgets/buttonwidget.cpp \
$$common_src/menu/widgets/inlinelistwidget.cpp \
$$common_src/menu/widgets/inputbindingwidget.cpp \
$$common_src/menu/widgets/labelwidget.cpp \
$$common_src/menu/widgets/lineeditwidget.cpp \
$$common_src/menu/widgets/listwidget.cpp \
$$common_src/menu/widgets/mobjpreviewwidget.cpp \
$$common_src/menu/widgets/rectwidget.cpp \
$$common_src/menu/widgets/sliderwidget.cpp \
$$common_src/menu/widgets/textualsliderwidget.cpp \
$$common_src/menu/widgets/widget.cpp
15 changes: 2 additions & 13 deletions doomsday/plugins/common/include/hu_lib.h
Expand Up @@ -79,8 +79,6 @@ typedef enum mn_page_fontid_e
namespace common {
namespace menu {

struct Page;

/**
* @defgroup menuEffectFlags Menu Effect Flags
*/
Expand All @@ -94,22 +92,13 @@ struct Page;

short MN_MergeMenuEffectWithDrawTextFlags(short f);

// Menu render state:
typedef struct mn_rendstate_s {
float pageAlpha;
float textGlitter;
float textShadow;
float textColors[MENU_COLOR_COUNT][4];
fontid_t textFonts[MENU_FONT_COUNT];
} mn_rendstate_t;

extern mn_rendstate_t const *mnRendState;

} // namespace menu
} // namespace common

#endif // __cplusplus

void lerpColor(float *dst, float const *a, float const *b, float t, dd_bool rgbaMode);

typedef enum {
GUI_NONE,
GUI_BOX,
Expand Down
19 changes: 19 additions & 0 deletions doomsday/plugins/common/include/m_ctrl.h
Expand Up @@ -27,6 +27,25 @@
namespace common {
namespace menu {

struct Page;

// Control config flags.
#define CCF_NON_INVERSE 0x1
#define CCF_INVERSE 0x2
#define CCF_STAGED 0x4
#define CCF_REPEAT 0x8
#define CCF_SIDESTEP_MODIFIER 0x10
#define CCF_MULTIPLAYER 0x20

struct controlconfig_t
{
char const *text;
char const *bindContext;
char const *controlName;
char const *command;
int flags;
};

void Hu_MenuInitControlsPage(void);
void Hu_MenuDrawControlsPage(Page *page, Point2Raw const *origin);
void Hu_MenuControlGrabDrawer(char const *niceName, float alpha);
Expand Down
16 changes: 16 additions & 0 deletions doomsday/plugins/common/include/menu/page.h
Expand Up @@ -34,6 +34,22 @@ namespace menu {
#define MPF_NEVER_SCROLL 0x2 ///< Page scrolling is disabled.
///@}

/// @todo refactor away.
struct mn_rendstate_t
{
float pageAlpha;
float textGlitter;
float textShadow;
float textColors[MENU_COLOR_COUNT][4];
fontid_t textFonts[MENU_FONT_COUNT];
};
extern mn_rendstate_t const *mnRendState;

/**
* UI menu page (dialog).
*
* @ingroup menu
*/
struct Page
{
public:
Expand Down

0 comments on commit 01559be

Please sign in to comment.