/** * Draw the text window for the intelligence display */ static void intDisplaySeqTextView(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL_UNUSED PIELIGHT *pColours) { W_TABFORM *Form = (W_TABFORM*)psWidget; VIEW_REPLAY *psViewReplay = (VIEW_REPLAY*)Form->pUserData; size_t cur_seq, cur_seqpage; UDWORD x0, y0, page; x0 = xOffset + Form->x; y0 = yOffset + Form->y; RenderWindowFrame(FRAME_NORMAL, x0, y0, Form->width, Form->height); /* work out where we're up to in the text */ cur_seq = cur_seqpage = 0; if(Form->style & WFORM_TABBED) { // Gerard 2007-04-07: dead code? ASSERT(!"the form is tabbed", "intDisplaySeqTextView: the form is tabbed"); for (page = 0; page < Form->majorT; page++) { intDisplaySeqTextViewPage(psViewReplay, x0, y0, Form->width, Form->height, false, &cur_seq, &cur_seqpage); } } intDisplaySeqTextViewPage(psViewReplay, x0, y0, Form->width-40, Form->height, true, &cur_seq, &cur_seqpage); }
bool intDisplayMultiJoiningStatus(UBYTE joinCount) { UDWORD x,y,w,h; char sTmp[6]; w = RET_FORMWIDTH; h = RET_FORMHEIGHT; x = RET_X; y = RET_Y; // cameraToHome(selectedPlayer); // home the camera to the player. RenderWindowFrame(FRAME_NORMAL, x, y ,w, h); // draw a wee blu box. // display how far done.. iV_DrawText(_("Players Still Joining"), x+(w/2)-(iV_GetTextWidth(_("Players Still Joining"))/2), y+(h/2)-8 ); if (!NetPlay.playercount) { return true; } sprintf(sTmp,"%d%%", PERCENT((NetPlay.playercount-joinCount),NetPlay.playercount) ); iV_DrawText(sTmp ,x + (w / 2) - 10, y + (h / 2) + 10); return true; }
bool intDisplayMultiJoiningStatus(UBYTE joinCount) { UDWORD x,y,w,h; char sTmp[6]; w = RET_FORMWIDTH; h = RET_FORMHEIGHT; x = RET_X; y = RET_Y; // cameraToHome(selectedPlayer); // home the camera to the player. RenderWindowFrame(FRAME_NORMAL, x, y ,w, h); // draw a wee blu box. // display how far done.. iV_SetFont(font_regular); iV_DrawText(_("Players Still Joining"), x+(w/2)-(iV_GetTextWidth(_("Players Still Joining"))/2), y+(h/2)-8 ); unsigned playerCount = 0; // Calculate what NetPlay.playercount should be, which is apparently only non-zero for the host. for (unsigned player = 0; player < game.maxPlayers; ++player) { if (isHumanPlayer(player)) { ++playerCount; } } if (!playerCount) { return true; } iV_SetFont(font_large); sprintf(sTmp, "%d%%", PERCENT(playerCount - joinCount, playerCount)); iV_DrawText(sTmp ,x + (w / 2) - 10, y + (h / 2) + 10); iV_SetFont(font_small); int yStep = iV_GetTextLineSize(); int yPos = RET_Y - yStep*game.maxPlayers; static const std::string statusStrings[3] = {"☐ ", "☑ ", "☒ "}; for (unsigned player = 0; player < game.maxPlayers; ++player) { int status = -1; if (isHumanPlayer(player)) { status = ingame.JoiningInProgress[player]? 0 : 1; // Human player, still joining or joined. } else if (NetPlay.players[player].ai >= 0) { status = 2; // AI player (automatically joined). } if (status >= 0) { iV_DrawText((statusStrings[status] + getPlayerName(player)).c_str(), x + 5, yPos + yStep*NetPlay.players[player].position); } } return true; }
static void DrawRadarExtras(float radarX, float radarY, float pixSizeH, float pixSizeV) { int viewX = (player.p.x / TILE_UNITS) * pixSizeH; int viewY = (player.p.z / TILE_UNITS) * pixSizeV; drawViewingWindow(radarX, radarY, viewX, viewY, pixSizeH, pixSizeV); RenderWindowFrame(FRAME_RADAR, radarX - 1, radarY - 1, radarWidth + 2, radarHeight + 2); }
/* displays the PIE view for the current message */ void intDisplayPIEView(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL_UNUSED PIELIGHT *pColours) { W_TABFORM *Form = (W_TABFORM*)psWidget; MESSAGE *psMessage = (MESSAGE *)Form->pUserData; UDWORD x0,y0,x1,y1; SWORD image = -1; RESEARCH *psResearch; //shouldn't have any proximity messages here... if (psMessage->type == MSG_PROXIMITY) { return; } if (psMessage && psMessage->pViewData) { x0 = xOffset+Form->x; y0 = yOffset+Form->y; x1 = x0 + Form->width; y1 = y0 + Form->height; //moved from after close render RenderWindowFrame(FRAME_NORMAL, x0 - 1, y0 - 1, x1 - x0 + 2, y1 - y0 + 2); OpenButtonRender((UWORD)(xOffset+Form->x), (UWORD)(yOffset+Form->y), Form->width, Form->height); //OpenButtonRender(Form->x, Form->y,Form->width, Form->height); if (((VIEWDATA *)psMessage->pViewData)->type != VIEW_RES) { ASSERT( false, "intDisplayPIEView: Invalid message type" ); return; } //render an object psResearch = getResearchForMsg((VIEWDATA *)psCurrentMsg->pViewData); renderResearchToBuffer(psResearch, x0+(x1-x0)/2, y0+(y1-y0)/2); CloseButtonRender(); //draw image icon in top left of window image = (SWORD)getResearchForMsg((VIEWDATA *)psMessage->pViewData)->iconID; if (image > 0) { iV_DrawImage(IntImages,image,x0,y0); } } }
/** * Displays the TEXT view for the current message. * If this function breaks, please merge it with intDisplaySeqTextViewPage * which presumably does almost the same. */ void intDisplayTEXTView(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL_UNUSED PIELIGHT *pColours) { W_TABFORM *Form = (W_TABFORM*)psWidget; MESSAGE *psMessage = (MESSAGE *)Form->pUserData; UDWORD x0, y0, x1, y1, i, linePitch; UDWORD ty; x0 = xOffset+Form->x; y0 = yOffset+Form->y; x1 = x0 + Form->width; y1 = y0 + Form->height; ty = y0; RenderWindowFrame(FRAME_NORMAL, x0, y0, x1 - x0, y1 - y0); if (psMessage) { iV_SetFont(font_regular); /* Get the travel to the next line */ linePitch = iV_GetTextLineSize(); /* Fix for spacing.... */ linePitch+=3; ty+=3; /* Fix for spacing.... */ iV_SetTextColour(WZCOL_TEXT_BRIGHT); //add each message for (i = 0; i < ((VIEWDATA *)psMessage->pViewData)->numText; i++) { //check haven't run out of room first! if (i * linePitch > Form->height) { ASSERT( false, "intDisplayTEXTView: Run out of room!" ); return; } //need to check the string will fit! iV_DrawText(_(((VIEWDATA *)psMessage->pViewData)->ppTextMsg[i]), x0 + TEXT_XINDENT, (ty + TEXT_YINDENT*3) + (i * linePitch)); } } }
/* displays the FLIC view for the current message */ void intDisplayFLICView(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DECL_UNUSED PIELIGHT *pColours) { W_TABFORM *Form = (W_TABFORM*)psWidget; MESSAGE *psMessage = (MESSAGE *)Form->pUserData; UDWORD x0,y0,x1,y1; VIEW_RESEARCH *psViewResearch; //shouldn't have any proximity messages here... if (psMessage->type == MSG_PROXIMITY) { return; } if (psMessage && psMessage->pViewData) { OpenButtonRender((UWORD)(xOffset+Form->x), (UWORD)(yOffset+Form->y), Form->width, Form->height); x0 = xOffset+Form->x; y0 = yOffset+Form->y; x1 = x0 + Form->width; y1 = y0 + Form->height; if (((VIEWDATA *)psMessage->pViewData)->type != VIEW_RES) { ASSERT( false, "intDisplayFLICView: Invalid message type" ); return; } RenderWindowFrame(FRAME_NORMAL, x0, y0, x1 - x0, y1 - y0); psViewResearch = (VIEW_RESEARCH *)((VIEWDATA *)psCurrentMsg->pViewData)->pData; // set the dimensions to window size & position seq_SetDisplaySize(192, 168, x0, y0); //render a frame of the current movie *must* force above resolution! seq_RenderVideoToBuffer(psViewResearch->sequenceName, SEQUENCE_HOLD); CloseButtonRender(); } }
static void DrawRadarExtras() { pie_DrawViewingWindow(); RenderWindowFrame(FRAME_RADAR, -1, -1, radarWidth + 2, radarHeight + 2); }
static void DrawRadarExtras(const glm::mat4 &modelViewProjectionMatrix) { pie_DrawViewingWindow(modelViewProjectionMatrix); RenderWindowFrame(FRAME_RADAR, -1, -1, radarWidth + 2, radarHeight + 2, modelViewProjectionMatrix); }