Fix errors found when compiling

This commit is contained in:
Monster Iestyn 2018-11-03 21:13:44 +00:00 committed by mazmazz
parent 98d532f119
commit d327f82e85
3 changed files with 39 additions and 33 deletions

View File

@ -1655,18 +1655,18 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
else if (fastcmp(word, "BACKCOLOR"))
{
UINT8 backcolor;
if (usi == 0 || fastcmp(word2, "WHITE")) backcolor = 0;
else if (usi == 1 || fastcmp(word2, "GRAY") || fastcmp(word2, "GREY")) backcolor = 1;
else if (usi == 2 || fastcmp(word2, "BROWN")) backcolor = 2;
else if (usi == 3 || fastcmp(word2, "RED")) backcolor = 3;
else if (usi == 4 || fastcmp(word2, "ORANGE")) backcolor = 4;
else if (usi == 5 || fastcmp(word2, "YELLOW")) backcolor = 5;
else if (usi == 6 || fastcmp(word2, "GREEN")) backcolor = 6;
else if (usi == 7 || fastcmp(word2, "BLUE")) backcolor = 7;
else if (usi == 8 || fastcmp(word2, "PURPLE")) backcolor = 8;
else if (usi == 9 || fastcmp(word2, "MAGENTA")) backcolor = 9;
else if (usi == 10 || fastcmp(word2, "AQUA")) backcolor = 10;
else if (usi < 0) backcolor = UINT8_MAX; // CONS_BACKCOLOR user-configured
if (i == 0 || fastcmp(word2, "WHITE")) backcolor = 0;
else if (i == 1 || fastcmp(word2, "GRAY") || fastcmp(word2, "GREY")) backcolor = 1;
else if (i == 2 || fastcmp(word2, "BROWN")) backcolor = 2;
else if (i == 3 || fastcmp(word2, "RED")) backcolor = 3;
else if (i == 4 || fastcmp(word2, "ORANGE")) backcolor = 4;
else if (i == 5 || fastcmp(word2, "YELLOW")) backcolor = 5;
else if (i == 6 || fastcmp(word2, "GREEN")) backcolor = 6;
else if (i == 7 || fastcmp(word2, "BLUE")) backcolor = 7;
else if (i == 8 || fastcmp(word2, "PURPLE")) backcolor = 8;
else if (i == 9 || fastcmp(word2, "MAGENTA")) backcolor = 9;
else if (i == 10 || fastcmp(word2, "AQUA")) backcolor = 10;
else if (i < 0) backcolor = UINT8_MAX; // CONS_BACKCOLOR user-configured
else backcolor = 11; // default green
textprompts[num]->page[pagenum].backcolor = backcolor;
}
@ -1685,7 +1685,7 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
textprompts[num]->page[pagenum].verticalalign = align;
}
else if (fastcmp(word, "TEXTSPEED"))
textprompts[num]->page[pagenum].textspeed = min(max(0, usi), 15);
textprompts[num]->page[pagenum].textspeed = min(max(0, i), 15);
else if (fastcmp(word, "TEXTSFX"))
textprompts[num]->page[pagenum].textsfx = get_number(word2);
else if (fastcmp(word, "METAPAGE"))

View File

@ -2113,31 +2113,36 @@ void F_TextPromptDrawer(void)
// reuse:
// cutnum -> promptnum
// scenenum -> pagenum
if (!promptactive)
return;
lumpnum_t iconlump = W_CheckNumForName(textprompts[cutnum]->page[scenenum].iconname);
UINT8 pagelines = textprompts[cutnum]->page[scenenum].lines ? textprompts[cutnum]->page[scenenum].lines : 4;
boolean rightside = (iconlump != LUMPERROR && textprompts[cutnum]->page[scenenum].rightside);
// Vertical calculations
INT32 boxh = pagelines*2;
INT32 texth = textprompts[cutnum]->page[scenenum].name[0] ? (pagelines-1)*2 : pagelines*2; // name takes up first line if it exists
INT32 texty = BASEVIDHEIGHT - ((texth * 4) + (texth/2)*4);
INT32 namey = BASEVIDHEIGHT - ((boxh * 4) + (boxh/2)*4);
INT32 chevrony = BASEVIDHEIGHT - (((1*2) * 4) + ((1*2)/2)*4); // force on last line
// Horizontal calculations
// Shift text to the right if we have a character icon on the left side
// Add 4 margin against icon
INT32 textx = (iconlump != LUMPERROR && !rightside) ? ((boxh * 4) + (boxh/2)*4) + 4 : 4;
INT32 textr = rightside ? BASEVIDWIDTH - (((boxh * 4) + (boxh/2)*4) + 4) : BASEVIDWIDTH-4;
lumpnum_t iconlump;
UINT8 pagelines;
boolean rightside;
INT32 boxh, texth, texty, namey, chevrony;
INT32 textx, textr;
// Data
patch_t *patch;
char *text;
if (!promptactive)
return;
iconlump = W_CheckNumForName(textprompts[cutnum]->page[scenenum].iconname);
pagelines = textprompts[cutnum]->page[scenenum].lines ? textprompts[cutnum]->page[scenenum].lines : 4;
rightside = (iconlump != LUMPERROR && textprompts[cutnum]->page[scenenum].rightside);
// Vertical calculations
boxh = pagelines*2;
texth = textprompts[cutnum]->page[scenenum].name[0] ? (pagelines-1)*2 : pagelines*2; // name takes up first line if it exists
texty = BASEVIDHEIGHT - ((texth * 4) + (texth/2)*4);
namey = BASEVIDHEIGHT - ((boxh * 4) + (boxh/2)*4);
chevrony = BASEVIDHEIGHT - (((1*2) * 4) + ((1*2)/2)*4); // force on last line
// Horizontal calculations
// Shift text to the right if we have a character icon on the left side
// Add 4 margin against icon
textx = (iconlump != LUMPERROR && !rightside) ? ((boxh * 4) + (boxh/2)*4) + 4 : 4;
textr = rightside ? BASEVIDWIDTH - (((boxh * 4) + (boxh/2)*4) + 4) : BASEVIDWIDTH-4;
// Draw background
V_DrawTutorialBack(boxh);

View File

@ -17,6 +17,7 @@
#include "doomtype.h"
#include "d_event.h"
#include "p_mobj.h"
//
// FINALE