From 08c2a06822d37f275195a867a96c868281015224 Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Wed, 16 Jan 2008 18:54:16 +0000 Subject: [PATCH] GUI cleanup git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3497 4a71c877-e1ca-e34f-864e-861f7616d084 --- lib/ivis_common/piepalette.h | 4 +- lib/ivis_opengl/piepalette.c | 3 ++ lib/widget/form.c | 33 -------------- lib/widget/form.h | 1 - src/design.c | 3 -- src/hci.c | 2 - src/intdisplay.c | 17 ------- src/intdisplay.h | 2 - src/intelmap.c | 2 - src/intimage.c | 86 ------------------------------------ src/keyedit.c | 7 +-- src/multilimit.c | 1 - src/multimenu.c | 1 - src/transporter.c | 4 -- 14 files changed, 8 insertions(+), 158 deletions(-) diff --git a/lib/ivis_common/piepalette.h b/lib/ivis_common/piepalette.h index aa022ac38..dc8dbfeea 100644 --- a/lib/ivis_common/piepalette.h +++ b/lib/ivis_common/piepalette.h @@ -70,7 +70,9 @@ #define WZCOL_RADAR_BACKGROUND psPalette[24] #define WZCOL_MAP_OUTLINE_OK psPalette[25] #define WZCOL_MAP_OUTLINE_BAD psPalette[26] -#define WZCOL_MAX 27 +#define WZCOL_KEYMAP_ACTIVE psPalette[27] +#define WZCOL_KEYMAP_FIXED psPalette[28] +#define WZCOL_MAX 29 //************************************************************************* diff --git a/lib/ivis_opengl/piepalette.c b/lib/ivis_opengl/piepalette.c index 5e6370840..86c4e53ec 100644 --- a/lib/ivis_opengl/piepalette.c +++ b/lib/ivis_opengl/piepalette.c @@ -151,6 +151,9 @@ void pie_SetColourDefines(void) WZCOL_MAP_OUTLINE_OK = WZCOL_WHITE; WZCOL_MAP_OUTLINE_BAD = WZCOL_RED; + + WZCOL_KEYMAP_ACTIVE = pal_Colour(0, 128, 0); + WZCOL_KEYMAP_FIXED = pal_Colour(128, 0, 0); } PIELIGHT pal_SetBrightness(UBYTE brightness) diff --git a/lib/widget/form.c b/lib/widget/form.c index 02549144b..48a40e28e 100644 --- a/lib/widget/form.c +++ b/lib/widget/form.c @@ -308,7 +308,6 @@ static BOOL formCreateTabbed(W_TABFORM **ppsWidget, W_FORMINIT *psInit) (*ppsWidget)->majorPos = psInit->majorPos; (*ppsWidget)->minorPos = psInit->minorPos; (*ppsWidget)->pTabDisplay = psInit->pTabDisplay; - (*ppsWidget)->pFormDisplay = psInit->pFormDisplay; (*ppsWidget)->TabMultiplier = psInit->TabMultiplier; (*ppsWidget)->numButtons = psInit->numButtons; (*ppsWidget)->numStats = psInit->numStats; @@ -1574,38 +1573,6 @@ void formDisplayTabbed(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGH y1 -= psForm->tabMinorThickness - psForm->tabVertOffset; } - /* Adjust for where the tabs are */ -// if (psForm->majorPos == WFORM_TABLEFT || psForm->minorPos == WFORM_TABLEFT) -// { -// x0 += psForm->tabThickness - psForm->tabHorzOffset; -// } -// if (psForm->majorPos == WFORM_TABRIGHT || psForm->minorPos == WFORM_TABRIGHT) -// { -// x1 -= psForm->tabThickness - psForm->tabHorzOffset; -// } -// if (psForm->majorPos == WFORM_TABTOP || psForm->minorPos == WFORM_TABTOP) -// { -// y0 += psForm->tabThickness - psForm->tabVertOffset; -// } -// if (psForm->majorPos == WFORM_TABBOTTOM || psForm->minorPos == WFORM_TABBOTTOM) -// { -// y1 -= psForm->tabThickness - psForm->tabVertOffset; -// } - - if(psForm->pFormDisplay) { - psForm->pFormDisplay((WIDGET *)psForm, xOffset, yOffset, psForm->aColours); - } else { - /* Draw the form outline */ - if (!(psForm->style & WFORM_INVISIBLE)) - { - pie_BoxFill(x0, y0, x1, y1, pColours[WCOL_BKGRND]); - iV_Line(x0,y1,x0,y0, pColours[WCOL_LIGHT]); - iV_Line(x0,y0,x1,y0, pColours[WCOL_LIGHT]); - iV_Line(x1,y0,x1,y1, pColours[WCOL_DARK]); - iV_Line(x1,y1,x0,y1, pColours[WCOL_DARK]); - } - } - /* Draw the major tabs */ switch (psForm->majorPos) { diff --git a/lib/widget/form.h b/lib/widget/form.h index b065ba45f..4b7b7e704 100644 --- a/lib/widget/form.h +++ b/lib/widget/form.h @@ -95,7 +95,6 @@ typedef struct _w_tabform UWORD numButtons; //# of buttons per form W_MAJORTAB asMajor[WFORM_MAXMAJOR]; // The major tab information TAB_DISPLAY pTabDisplay; // Optional callback for display tabs. - WIDGET_DISPLAY pFormDisplay; // Optional callback to display the form. } W_TABFORM; diff --git a/src/design.c b/src/design.c index 327b59c30..dbe5632b4 100644 --- a/src/design.c +++ b/src/design.c @@ -978,7 +978,6 @@ static BOOL _intAddTemplateForm(DROID_TEMPLATE *psSelected) sFormInit.majorOffset = DES_TAB_LEFTOFFSET; sFormInit.tabVertOffset = (DES_TAB_HEIGHT/2); //(DES_TAB_HEIGHT/2)+2; sFormInit.tabMajorThickness = DES_TAB_HEIGHT; - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; for (i=0; i< sFormInit.numMajor; i++) @@ -2096,7 +2095,6 @@ static BOOL intAddComponentForm(UDWORD numButtons) sFormInit.majorOffset = DES_TAB_LEFTOFFSET; sFormInit.tabVertOffset = (DES_TAB_HEIGHT/2); sFormInit.tabMajorThickness = DES_TAB_HEIGHT; - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; for (i=0; i< sFormInit.numMajor; i++) @@ -4625,7 +4623,6 @@ void intDisplayDesignForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIEL //AdjustTabFormSize(Form,&x0,&y0,&x1,&y1); - //RenderWindowFrame(&FrameDesignView,x0,y0,x1-x0,y1-y0); RenderWindowFrame(&FrameNormal,x0,y0,x1-x0,y1-y0); } diff --git a/src/hci.c b/src/hci.c index 4b21df39e..2b37c348c 100644 --- a/src/hci.c +++ b/src/hci.c @@ -4526,7 +4526,6 @@ static BOOL intAddObjectWindow(BASE_OBJECT *psObjects, BASE_OBJECT *psSelected,B sFormInit.tabVertOffset = (OBJ_TABHEIGHT/2); sFormInit.tabMajorThickness = OBJ_TABHEIGHT; sFormInit.tabMajorGap = OBJ_TABOFFSET; - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; @@ -5790,7 +5789,6 @@ if (numForms(numStats, butPerForm)>8) //only want these buttons when tab count > sFormInit.tabVertOffset = (OBJ_TABHEIGHT/2); sFormInit.tabMajorThickness = OBJ_TABHEIGHT; sFormInit.tabMajorGap = OBJ_TABOFFSET; - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; //Build menu can have up to 80 stats - so can research now 13/09/99 AB diff --git a/src/intdisplay.c b/src/intdisplay.c index ded4cf1a1..282313637 100644 --- a/src/intdisplay.c +++ b/src/intdisplay.c @@ -1260,23 +1260,6 @@ void AdjustTabFormSize(W_TABFORM *Form,UDWORD *x0,UDWORD *y0,UDWORD *x1,UDWORD * } -void intDisplayObjectForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours) -{ -// W_TABFORM *Form = (W_TABFORM*)psWidget; -// UDWORD x0,y0,x1,y1; -// -// x0 = xOffset+Form->x; -// y0 = yOffset+Form->y; -// x1 = x0 + Form->width; -// y1 = y0 + Form->height; -// -// AdjustTabFormSize(Form,&x0,&y0,&x1,&y1); -// -// RenderWindowFrame(&FrameObject,x0,y0,x1-x0,y1-y0); -} - - - // Widget callback function to do the open form animation. Doesn't just open Plain Forms!! // void intOpenPlainForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours) diff --git a/src/intdisplay.h b/src/intdisplay.h index 03befd613..ecd7049f5 100644 --- a/src/intdisplay.h +++ b/src/intdisplay.h @@ -191,8 +191,6 @@ void intDisplayStatsButton(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIE void AdjustTabFormSize(W_TABFORM *Form,UDWORD *x0,UDWORD *y0,UDWORD *x1,UDWORD *y1); -void intDisplayObjectForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours); - void intDisplayStatsForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours); void intOpenPlainForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours); diff --git a/src/intelmap.c b/src/intelmap.c index 586c2aee0..b660280b8 100644 --- a/src/intelmap.c +++ b/src/intelmap.c @@ -343,7 +343,6 @@ static BOOL intAddMessageForm(BOOL playCurrent) sFormInit.aNumMinors[i] = 1; } - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; @@ -567,7 +566,6 @@ BOOL intAddMessageView(MESSAGE * psMessage) sFormInit.width, sFormInit.height, FALSE, &cur_seq, &cur_seqpage)); - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; diff --git a/src/intimage.c b/src/intimage.c index ed1927a99..3c57d0ad0 100644 --- a/src/intimage.c +++ b/src/intimage.c @@ -106,92 +106,6 @@ IMAGEFRAME FrameRadar = { }; -//IMAGEFRAME FrameObject = { -// 0,0, 0,0, -// -1, -// -1, -// -1, -// -1, -// -1, FR_SOLID, -// -1, FR_SOLID, -// -1, FR_SOLID, -// -1, FR_SOLID, -// {{FR_IGNORE, 0,0, 0,0 ,0}, -// {FR_IGNORE, 0,0, 0,0 ,0}, -// {FR_IGNORE, 0,0, 0,0 ,0}, -// {FR_IGNORE, 0,0, 0,0 ,0}, -// {FR_IGNORE, 0,0, 0,0 ,0}}, -//}; -// -//IMAGEFRAME FrameStats = { -// 0,0, 0,0, -// -1, -// -1, -// -1, -// -1, -// IMAGE_FRAME_HT, FR_SOLID, -// IMAGE_FRAME_VR, FR_SOLID, -// IMAGE_FRAME_HB, FR_SOLID, -// IMAGE_FRAME_VL, FR_SOLID, -// {{FR_FRAME, 8,3, -6,-5 ,190}, -// {FR_IGNORE, 0,0, 0,0 ,0}, -// {FR_IGNORE, 0,0, 0,0 ,0}, -// {FR_IGNORE, 0,0, 0,0 ,0}, -// {FR_IGNORE, 0,0, 0,0 ,0}}, -//}; -// -//IMAGEFRAME FrameDesignView = { -// 0,0, 0,0, -// IMAGE_FRAME_VC0, -// IMAGE_FRAME_VC1, -// IMAGE_FRAME_VC2, -// IMAGE_FRAME_VC3, -// IMAGE_FRAME_HT2, FR_SOLID, -// IMAGE_FRAME_VR2, FR_SOLID, -// IMAGE_FRAME_HB2, FR_SOLID, -// IMAGE_FRAME_VL2, FR_SOLID, -// {{FR_FRAME, 0,0, 0,0, 1}, -// {FR_FRAME, 0,0, 0,0 ,1}, -// {FR_FRAME, 0,0, 0,0 ,1}, -// {FR_FRAME, 0,0, 0,0 ,1}, -// {FR_FRAME, 0,0, 0,0 ,1}}, -//}; -// -//IMAGEFRAME FrameDesignHilight = { -// 0,0, 0,0, -// IMAGE_FRAME_HC0, -// IMAGE_FRAME_HC1, -// IMAGE_FRAME_HC2, -// IMAGE_FRAME_HC3, -// IMAGE_FRAME_HTH, FR_SOLID, -// IMAGE_FRAME_VRH, FR_SOLID, -// IMAGE_FRAME_HBH, FR_SOLID, -// IMAGE_FRAME_VLH, FR_SOLID, -// {{FR_FRAME, 0,0, 0,0, 1}, -// {FR_FRAME, 0,0, 0,0 ,1}, -// {FR_FRAME, 0,0, 0,0 ,1}, -// {FR_FRAME, 0,0, 0,0 ,1}, -// {FR_FRAME, 0,0, 0,0 ,1}}, -//}; -// -//IMAGEFRAME FrameText = { -// 0,0, 0,0, -// -1, -// -1, -// IMAGE_FRAME_C3, -// IMAGE_FRAME_C2, -// -1, FR_SOLID, -// IMAGE_FRAME_VR, FR_SOLID, -// IMAGE_FRAME_HB, FR_SOLID, -// IMAGE_FRAME_VL, FR_SOLID, -// {{FR_FRAME, 0,1, 0,-1 ,224}, -// {FR_IGNORE, 0,0, 0,0 ,0}, -// {FR_IGNORE, 0,0, 0,0 ,0}, -// {FR_IGNORE, 0,0, 0,0 ,0}, -// {FR_IGNORE, 0,0, 0,0 ,0}}, -//}; - - // Tab definitions, defines graphics to use for major and minor tabs. TABDEF StandardTab = { IMAGE_TAB1, // Major tab normal. diff --git a/src/keyedit.c b/src/keyedit.c index 41b7a7783..6caa50418 100644 --- a/src/keyedit.c +++ b/src/keyedit.c @@ -319,11 +319,11 @@ void displayKeyMap(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *p if(psMapping == selectedKeyMap) { - pie_BoxFillIndex(x,y,x+w,y+h,COL_GREEN); + pie_BoxFill(x, y, x + w, y + h, WZCOL_KEYMAP_ACTIVE); } else if(psMapping->status == KEYMAP_ALWAYS || psMapping->status == KEYMAP_ALWAYS_PROCESS) { - pie_BoxFillIndex(x,y,x+w,y+h,COL_RED); + pie_BoxFill(x, y , x + w, y + h, WZCOL_KEYMAP_FIXED); } else { @@ -339,8 +339,6 @@ void displayKeyMap(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *p // draw binding keyMapToString(sKey,psMapping); iV_DrawText(sKey, x + 370, y + (psWidget->height / 2) + 3); - - return; } // //////////////////////////////////////////////////////////////////////////// @@ -421,7 +419,6 @@ BOOL startKeyMapEditor(BOOL first) sFormInit.majorOffset = OBJ_TABOFFSET; sFormInit.tabVertOffset = (OBJ_TABHEIGHT/2); sFormInit.tabMajorThickness = OBJ_TABHEIGHT; - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; for (i=0; i< sFormInit.numMajor; i++) diff --git a/src/multilimit.c b/src/multilimit.c index f46f116f8..26128eb4b 100644 --- a/src/multilimit.c +++ b/src/multilimit.c @@ -203,7 +203,6 @@ BOOL startLimitScreen(void) sFormInit.majorOffset = OBJ_TABOFFSET; sFormInit.tabVertOffset = (OBJ_TABHEIGHT/2); //(DES_TAB_HEIGHT/2)+2; sFormInit.tabMajorThickness = OBJ_TABHEIGHT; - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; for (i=0; i< sFormInit.numMajor; i++) diff --git a/src/multimenu.c b/src/multimenu.c index 2d8a8bf9c..44b420d68 100644 --- a/src/multimenu.c +++ b/src/multimenu.c @@ -429,7 +429,6 @@ void addMultiRequest(const char* searchDir, const char* fileExtension, UDWORD mo sFormInit.majorOffset = OBJ_TABOFFSET; sFormInit.tabVertOffset = (OBJ_TABHEIGHT/2); sFormInit.tabMajorThickness = OBJ_TABHEIGHT; - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; for (i = 0; i < sFormInit.numMajor; ++i) diff --git a/src/transporter.c b/src/transporter.c index acb433c88..80b0f2992 100644 --- a/src/transporter.c +++ b/src/transporter.c @@ -585,7 +585,6 @@ BOOL intAddTransButtonForm(void) sFormInit.aNumMinors[i] = 1; } - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; @@ -727,7 +726,6 @@ BOOL intAddTransContentsForm(void) sFormInit.aNumMinors[i] = 1; } - sFormInit.pFormDisplay = intDisplayObjectForm; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; @@ -923,8 +921,6 @@ BOOL intAddDroidsAvailForm(void) sFormInit.aNumMinors[i] = 1; } - sFormInit.pFormDisplay = intDisplayObjectForm; - sFormInit.pUserData = &SmallTab; sFormInit.pTabDisplay = intDisplayTab;