Skip to content

Commit

Permalink
Merge branch 'master' of ssh://deng.git.sourceforge.net/gitroot/deng/…
Browse files Browse the repository at this point in the history
…deng
  • Loading branch information
skyjake committed Jan 4, 2012
2 parents 9364f59 + 17d6d58 commit ff3bee1
Show file tree
Hide file tree
Showing 8 changed files with 726 additions and 688 deletions.
6 changes: 3 additions & 3 deletions doomsday/engine/portable/src/gl_texmanager.c
Expand Up @@ -876,7 +876,7 @@ static uploadcontentmethod_t prepareVariant(texturevariant_t* tex, image_t* imag
}
else if(0 != image->paletteId)
{
if(fillOutlines && 0 != image->paletteId && (image->flags & IMGF_IS_MASKED))
if(fillOutlines && (image->flags & IMGF_IS_MASKED))
ColorOutlinesIdx(image->pixels, image->size.width, image->size.height);

if(monochrome && !scaleSharp)
Expand Down Expand Up @@ -1241,7 +1241,7 @@ texturevariantspecification_t* GL_TextureVariantSpecificationForContext(
boolean mipmapped, boolean gammaCorrection, boolean noStretch, boolean toAlpha)
{
if(!initedOk)
Con_Error("GL_TextureVariantSpecificationForContext: Textures collection not yet initialized.");
Con_Error("GL_TextureVariantSpecificationForContext: GL texture manager not yet initialized.");
return getVariantSpecificationForContext(tc, flags, border, tClass, tMap, wrapS,
wrapT, minFilter, magFilter, anisoFilter, mipmapped, gammaCorrection, noStretch, toAlpha);
}
Expand All @@ -1250,7 +1250,7 @@ texturevariantspecification_t* GL_DetailTextureVariantSpecificationForContext(
float contrast)
{
if(!initedOk)
Con_Error("GL_DetailTextureVariantSpecificationForContext: Textures collection not yet initialized.");
Con_Error("GL_DetailTextureVariantSpecificationForContext: GL texture manager not yet initialized.");
return getDetailVariantSpecificationForContext(contrast);
}

Expand Down
55 changes: 44 additions & 11 deletions doomsday/plugins/common/include/hu_lib.h
Expand Up @@ -194,12 +194,19 @@ typedef struct mn_object_s {
void* data1;
int data2;

// Auto initialized:

/// Current geometry.
Rect* _geometry;

/// MenuPage which owns this object (if any).
struct mn_page_s* _page;
} mn_object_t;

mn_obtype_e MNObject_Type(const mn_object_t* obj);

struct mn_page_s* MNObject_Page(const mn_object_t* obj);

int MNObject_Flags(const mn_object_t* obj);

/**
Expand Down Expand Up @@ -260,7 +267,7 @@ boolean MNObject_HasAction(mn_object_t* obj, mn_actionid_t action);
int MNObject_ExecAction(mn_object_t* obj, mn_actionid_t action, void* paramaters);

typedef enum {
MENU_COLOR1,
MENU_COLOR1 = 0,
MENU_COLOR2,
MENU_COLOR3,
MENU_COLOR4,
Expand All @@ -276,7 +283,7 @@ typedef enum {
#define VALID_MNPAGE_COLORID(v) ((v) >= MENU_COLOR1 && (v) < MENU_COLOR_COUNT)

typedef enum {
MENU_FONT1,
MENU_FONT1 = 0,
MENU_FONT2,
MENU_FONT3,
MENU_FONT4,
Expand All @@ -292,23 +299,48 @@ typedef enum {
#define VALID_MNPAGE_FONTID(v) ((v) >= MENU_FONT1 && (v) < MENU_FONT_COUNT)

typedef struct mn_page_s {
mn_object_t* objects; // List of objects.
/// Collection of objects on this page.
mn_object_t* objects;
int objectsCount;

/// "Physical" geometry in fixed 320x200 screen coordinate space.
Point2Raw origin;
Rect* geometry;

/// Previous page else @c NULL
struct mn_page_s* previous;

/// Title of this page.
ddstring_t title;

/// Index of the currently focused object else @c -1
int focus;

/// Predefined fonts objects on this page.
fontid_t fonts[MENU_FONT_COUNT];

/// Predefined colors for objects on this page.
uint colors[MENU_COLOR_COUNT];
void (*drawer) (struct mn_page_s* page, const Point2Raw* origin);

/// Page drawing routine.
void (*drawer) (struct mn_page_s* page, const Point2Raw* offset);

/// Menu command responder routine.
int (*cmdResponder) (struct mn_page_s* page, menucommand_e cmd);
struct mn_page_s* previous; // Pointer to the previous page, if any.
void* data;

// Auto-initialized.
int objectsCount;
int focus; // Index of the focus object.
Rect* geometry;
/// User data.
void* userData;
} mn_page_t;

void MNPage_Initialize(mn_page_t* page);

void MNPage_SetTitle(mn_page_t* page, const char* title);

void MNPage_SetX(mn_page_t* page, int x);
void MNPage_SetY(mn_page_t* page, int y);

void MNPage_SetPreviousPage(mn_page_t* page, mn_page_t* prevPage);

/// @return Currently focused object else @c NULL
mn_object_t* MNPage_FocusObject(mn_page_t* page);

Expand Down Expand Up @@ -348,6 +380,8 @@ void MNPage_PredefinedColor(mn_page_t* page, mn_page_colorid_t id, float rgb[3])
*/
fontid_t MNPage_PredefinedFont(mn_page_t* page, mn_page_fontid_t id);

void MNPage_SetPredefinedFont(mn_page_t* page, mn_page_fontid_t id, fontid_t fontId);

/**
* Text objects.
*/
Expand Down Expand Up @@ -680,7 +714,6 @@ extern const mn_rendstate_t* mnRendState;

short MN_MergeMenuEffectWithDrawTextFlags(short f);

int MN_CountObjects(mn_object_t* list);
mn_object_t* MN_MustFindObjectOnPage(mn_page_t* page, int group, int flags);

void MN_DrawPage(mn_page_t* page, float alpha, boolean showFocusCursor);
Expand Down
40 changes: 8 additions & 32 deletions doomsday/plugins/common/include/hu_menu.h
Expand Up @@ -76,35 +76,7 @@
#define MENU_CURSOR_FRAMECOUNT 2
#define MENU_CURSOR_TICSPERFRAME 8

extern mn_page_t MainMenu;
extern mn_page_t GameTypeMenu;
#if __JHEXEN__
extern mn_page_t PlayerClassMenu;
#endif
#if __JDOOM__ || __JHERETIC__
extern mn_page_t EpisodeMenu;
#endif
//extern mn_page_t SkillMenu;
extern mn_page_t OptionsMenu;
extern mn_page_t SoundMenu;
extern mn_page_t GameplayMenu;
extern mn_page_t HudMenu;
extern mn_page_t AutomapMenu;
extern mn_object_t AutomapMenuObjects[];
#if __JHERETIC__ || __JHEXEN__
extern mn_page_t FilesMenu;
#endif
extern mn_page_t LoadMenu;
extern mn_page_t SaveMenu;
extern mn_page_t MultiplayerMenu;
extern mn_page_t PlayerSetupMenu;
#if __JHERETIC__ || __JHEXEN__
extern mn_page_t InventoryMenu;
#endif
extern mn_page_t WeaponMenu;

extern int menuTime;

extern boolean menuNominatingQuickSaveSlot;

/// Register the console commands, variables, etc..., of this module.
Expand Down Expand Up @@ -137,6 +109,13 @@ void Hu_MenuTicker(timespan_t ticLength);
/// @return @c true if the menu is presently visible.
boolean Hu_MenuIsVisible(void);

mn_page_t* Hu_MenuFindPageByName(const char* name);

mn_page_t* Hu_MenuNewPage(const char* name, const Point2Raw* origin,
void (*drawer) (struct mn_page_s* page, const Point2Raw* origin),
int (*cmdResponder) (struct mn_page_s* page, menucommand_e cmd),
void* userData);

/**
* This is the main menu drawing routine (called every tic by the drawing
* loop) Draws the current menu 'page' by calling the funcs attached to
Expand All @@ -147,8 +126,7 @@ void Hu_MenuDrawer(void);
void Hu_MenuDrawFocusCursor(int x, int y, int focusObjectHeight, float alpha);

void Hu_MenuDrawPageTitle(const char* title, int x, int y);

void Hu_MenuDrawPageNavigation(mn_page_t* page, int x, int y);
void Hu_MenuDrawPageHelp(const char* help, int x, int y);

/// @return @c true if the input event @a ev was eaten.
int Hu_MenuPrivilegedResponder(event_t* ev);
Expand Down Expand Up @@ -189,8 +167,6 @@ mn_page_t* Hu_MenuActivePage(void);
*/
void Hu_MenuSetActivePage(mn_page_t* page);

void Hu_MenuComposeSubpageString(mn_page_t* page, size_t bufSize, char* buf);

/**
* Initialize a new singleplayer game according to the options set via the menu.
* @param confirmed If @c true this game configuration has already been confirmed.
Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/common/include/m_ctrl.h
Expand Up @@ -31,8 +31,6 @@

#include "hu_lib.h"

extern mn_page_t ControlsMenu;

void Hu_MenuInitControlsPage(void);
void Hu_MenuDrawControlsPage(mn_page_t* page, const Point2Raw* origin);
void Hu_MenuControlGrabDrawer(const char* niceName, float alpha);
Expand Down
6 changes: 3 additions & 3 deletions doomsday/plugins/common/src/g_game.c
Expand Up @@ -3289,7 +3289,7 @@ static void openLoadMenu(void)
/// \fixme This should be called automatically when opening the page
/// thus making this function redundant.
Hu_MenuUpdateGameSaveWidgets();
Hu_MenuSetActivePage(&LoadMenu);
Hu_MenuSetActivePage(Hu_MenuFindPageByName("LoadGame"));
}

static void openSaveMenu(void)
Expand All @@ -3298,7 +3298,7 @@ static void openSaveMenu(void)
/// \fixme This should be called automatically when opening the page
/// thus making this function redundant.
Hu_MenuUpdateGameSaveWidgets();
Hu_MenuSetActivePage(&SaveMenu);
Hu_MenuSetActivePage(Hu_MenuFindPageByName("SaveGame"));
}

int G_QuickLoadGameResponse(msgresponse_t response, void* context)
Expand Down Expand Up @@ -3385,7 +3385,7 @@ void G_QuickSaveGame(void)
{
Hu_MenuCommand(MCMD_OPEN);
Hu_MenuUpdateGameSaveWidgets();
Hu_MenuSetActivePage(&SaveMenu);
Hu_MenuSetActivePage(Hu_MenuFindPageByName("SaveGame"));
menuNominatingQuickSaveSlot = true;
return;
}
Expand Down

0 comments on commit ff3bee1

Please sign in to comment.