void PageLayout (boolean shownumber) { int i,oldfontcolor; char ch; oldfontcolor = fontcolor; fontcolor = 0; // // clear the screen // VWB_Bar (0,0,320,200,BACKCOLOR); VWB_DrawPic (0,0,H_TOPWINDOWPIC); VWB_DrawPic (0,8,H_LEFTWINDOWPIC); VWB_DrawPic (312,8,H_RIGHTWINDOWPIC); VWB_DrawPic (8,176,H_BOTTOMINFOPIC); for (i=0;i<TEXTROWS;i++) { leftmargin[i] = LEFTMARGIN; rightmargin[i] = SCREENPIXWIDTH-RIGHTMARGIN; } px = LEFTMARGIN; py = TOPMARGIN; rowon = 0; layoutdone = False; // // make sure we are starting layout text (^P first command) // while (*text <= 32) text++; if (*text != '^' || toupper(*++text) != 'P') Quit ("PageLayout: Text not headed with ^P"); while (*text++ != '\n') ; // // process text stream // do { ch = *text; if (ch == '^') HandleCommand (); else if (ch == 9) { px = (px+8)&0xf8; text++; } else if (ch <= 32) HandleCtrls (); else HandleWord (); } while (!layoutdone); pagenum++; if (shownumber) { #ifdef SPANISH strcpy (str,"Hoja "); itoa (pagenum,str2,10); strcat (str,str2); strcat (str," de "); py = 183; px = 208; #else strcpy (str,"pg "); _itoa (pagenum,str2,10); strcat (str,str2); strcat (str," of "); py = 183; px = 213; #endif _itoa (numpages,str2,10); strcat (str,str2); fontcolor = 0x4f; //12^BACKCOLOR; VWB_DrawPropString (str); } fontcolor = oldfontcolor; }
void PageLayout (bool shownumber, bool helphack) { int i,oldfontcolor; char ch; oldfontcolor = fontcolor; fontcolor = 0; // // clear the screen // int clearx = 0, cleary = 0, clearw = 320, clearh = 200; MenuToRealCoords(clearx, cleary, clearw, clearh, MENU_CENTER); VWB_DrawFill(backgroundFlat, clearx, cleary, clearx+clearw, cleary+clearh); VWB_DrawGraphic(TexMan("TOPWINDW"), 0, 0, MENU_CENTER); VWB_DrawGraphic(TexMan("LFTWINDW"), 0, 8, MENU_CENTER); VWB_DrawGraphic(TexMan("RGTWINDW"), 312, 8, MENU_CENTER); VWB_DrawGraphic(TexMan("BOTWINDW"), 8, 176, MENU_CENTER); for (i=0; i<TEXTROWS; i++) { leftmargin[i] = LEFTMARGIN; rightmargin[i] = SCREENPIXWIDTH-RIGHTMARGIN; } px = LEFTMARGIN; py = TOPMARGIN; rowon = 0; layoutdone = false; // // make sure we are starting layout text (^P first command) // [BL] Why? How about assuming ^P? // while (*text <= 32) text++; if (*text == '^' && toupper(*(text+1)) == 'P') { ++text; while (*text++ != '\n') ; } // // process text stream // do { ch = *text; if (ch == '^') HandleCommand (helphack); else if(ch == '\0') { // Simulate ^E if one does not exist. layoutdone = true; } else if (ch == 9) { px = (px+8)&0xf8; text++; } else if (ch <= 32) HandleCtrls (); else HandleWord (); } while (!layoutdone); pagenum++; if (shownumber) { FString str; str.Format("pg %d of %d", pagenum, numpages); px = 213; py = 183; VWB_DrawPropString (SmallFont, str, gameinfo.FontColors[GameInfo::PAGEINDEX]); } fontcolor = oldfontcolor; }