void ParsePicCommand (void) { picy=ParseNumber(); picx=ParseNumber(); picnum=ParseNumber(); RipToEOL (); }
void ParseTimedCommand (void) { picy=ParseNumber(); picx=ParseNumber(); picnum=ParseNumber(); picdelay=ParseNumber(); RipToEOL (); }
void ParsePicCommand (bool helphack, bool norip=false) { picy=ParseNumber(); picx=ParseNumber(); // Skip over whitespace while(*text == ' ' || *text == '\t') ++text; if(*text == '[') { const char* texName = text+1; unsigned int len = 0; while(*++text != ']') ++len; picnum = TexMan.GetTexture(FString(texName, len), FTexture::TEX_Any); ++text; } else { int num=ParseNumber(); if(helphack) { switch(num) { case 5: num = 11; break; case 11: num = 5; break; default: break; } } picnum = TexMan.GetArtIndex(num); } if(!norip) RipToEOL (); }
void HandleCommand (void) { int i,margin,top,bottom; int picwidth,picheight,picmid; switch (toupper(*++text)) { case 'B': picy=ParseNumber(); picx=ParseNumber(); picwidth=ParseNumber(); picheight=ParseNumber(); VWB_Bar(picx,picy,picwidth,picheight,BACKCOLOR); RipToEOL(); break; case ';': // comment RipToEOL(); break; case 'P': // ^P is start of next page, ^E is end of file case 'E': layoutdone = True; text--; // back up to the '^' break; case 'C': // ^c<hex digit> changes text color i = toupper(*++text); if (i>='0' && i<='9') fontcolor = i-'0'; else if (i>='A' && i<='F') fontcolor = i-'A'+10; fontcolor *= 16; i = toupper(*++text); if (i>='0' && i<='9') fontcolor += i-'0'; else if (i>='A' && i<='F') fontcolor += i-'A'+10; text++; break; case '>': px = 160; text++; break; case 'L': py=ParseNumber(); rowon = (py-TOPMARGIN)/FONTHEIGHT; py = TOPMARGIN+rowon*FONTHEIGHT; px=ParseNumber(); while (*text++ != '\n') // scan to end of line ; break; case 'T': // ^Tyyy,xxx,ppp,ttt waits ttt tics, then draws pic TimedPicCommand (); break; case 'G': // ^Gyyy,xxx,ppp draws graphic ParsePicCommand (); VWB_DrawPic (picx&~7,picy,picnum); picwidth = pictable[picnum-STARTPICS].width; picheight = pictable[picnum-STARTPICS].height; // // adjust margins // picmid = picx + picwidth/2; if (picmid > SCREENMID) margin = picx-PICMARGIN; // new right margin else margin = picx+picwidth+PICMARGIN; // new left margin top = (picy-TOPMARGIN)/FONTHEIGHT; if (top<0) top = 0; bottom = (picy+picheight-TOPMARGIN)/FONTHEIGHT; if (bottom>=TEXTROWS) bottom = TEXTROWS-1; for (i=top;i<=bottom;i++) if (picmid > SCREENMID) rightmargin[i] = margin; else leftmargin[i] = margin; // // adjust this line if needed // if (px < leftmargin[rowon]) px = leftmargin[rowon]; break; } }
void HandleCommand (bool helphack) { int i,margin,top,bottom; int picmid; switch (toupper(*++text)) { case 'B': { double bx = ParseNumber(); double by = ParseNumber(); double bw = ParseNumber(); double bh = ParseNumber(); MenuToRealCoords(bx, by, bw, bh, MENU_CENTER); VWB_DrawFill(backgroundFlat, (int)bx, (int)by, (int)(bx+bw), (int)(by+bh)); RipToEOL(); break; } case ';': // comment RipToEOL(); break; case 'P': // ^P is start of next page, ^E is end of file case 'E': layoutdone = true; text--; // back up to the '^' break; case 'C': // ^c<hex digit> changes text color i = toupper(*++text); if(i == '[') // Textcolo translation { fontcolor = 255; const BYTE *colorname = (const BYTE *)(text); textcolor = V_ParseFontColor(colorname, CR_UNTRANSLATED, CR_UNTRANSLATED+1); while(*text++ != ']'); } else { textcolor = CR_UNTRANSLATED; if (i>='0' && i<='9') fontcolor = i-'0'; else if (i>='A' && i<='F') fontcolor = i-'A'+10; fontcolor *= 16; i = toupper(*++text); if (i>='0' && i<='9') fontcolor += i-'0'; else if (i>='A' && i<='F') fontcolor += i-'A'+10; text++; } break; case '>': px = 160; text++; break; case 'L': py=ParseNumber(); rowon = (py-TOPMARGIN)/FONTHEIGHT; py = TOPMARGIN+rowon*FONTHEIGHT; px=ParseNumber(); while (*text++ != '\n') // scan to end of line ; break; case 'T': // ^Tyyy,xxx,ppp,ttt waits ttt tics, then draws pic TimedPicCommand (helphack); break; case 'G': // ^Gyyy,xxx,ppp draws graphic { ParsePicCommand (helphack); if(!picnum.isValid()) break; FTexture *picture = TexMan(picnum); VWB_DrawGraphic (picture, picx&~7,picy, MENU_CENTER); // // adjust margins // picmid = picx + picture->GetScaledWidth()/2; if (picmid > SCREENMID) margin = picx-PICMARGIN; // new right margin else margin = picx+picture->GetScaledWidth()+PICMARGIN; // new left margin top = (picy-TOPMARGIN)/FONTHEIGHT; if (top<0) top = 0; bottom = (picy+picture->GetScaledHeight()-TOPMARGIN)/FONTHEIGHT; if (bottom>=TEXTROWS) bottom = TEXTROWS-1; for (i=top; i<=bottom; i++) if (picmid > SCREENMID) rightmargin[i] = margin; else leftmargin[i] = margin; // // adjust this line if needed // if (px < (int) leftmargin[rowon]) px = leftmargin[rowon]; break; } } }
void ParseTimedCommand (bool helphack) { ParsePicCommand(helphack, true); picdelay=ParseNumber(); RipToEOL (); }