void iV_TransBoxFill(float x0, float y0, float x1, float y1) { PIELIGHT light; light.byte.r = pie_FILLRED; light.byte.g = pie_FILLGREEN; light.byte.b = pie_FILLBLUE; light.byte.a = pie_FILLTRANS; pie_UniTransBoxFill(x0, y0, x1, y1, light); }
void pie_TransBoxFill(SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1) { UDWORD rgb; UDWORD transparency; rgb = (pie_FILLRED<<16) | (pie_FILLGREEN<<8) | pie_FILLBLUE;//blue transparency = pie_FILLTRANS; pie_UniTransBoxFill(x0, y0, x1, y1, rgb, transparency); // pie_doWeirdBoxFX(x0,y0,x1,y1); }
//loadbar update void loadingScreenCallback(void) { const PIELIGHT loadingbar_background = WZCOL_LOADING_BAR_BACKGROUND; const uint32_t currTick = wzGetTicks(); unsigned int i; if (currTick - lastTick < 50) { return; } lastTick = currTick; /* Draw the black rectangle at the bottom, with a two pixel border */ pie_UniTransBoxFill(barLeftX - 2, barLeftY - 2, barRightX + 2, barRightY + 2, loadingbar_background); for (i = 1; i < starsNum; ++i) { stars[i].xPos = stars[i].xPos + stars[i].speed; if (stars[i].xPos >= barRightX) { stars[i] = newStar(); stars[i].xPos = 1; } { const int topX = barLeftX + stars[i].xPos; const int topY = barLeftY + i * (boxHeight - starHeight) / starsNum; const int botX = MIN(topX + stars[i].speed, barRightX); const int botY = topY + starHeight; pie_UniTransBoxFill(topX, topY, botX, botY, stars[i].colour); } } pie_ScreenFlip(CLEAR_OFF_AND_NO_BUFFER_DOWNLOAD);//loading callback // dont clear. audio_Update(); }
void iV_TransBoxFill(float x0, float y0, float x1, float y1) { pie_UniTransBoxFill(x0, y0, x1, y1, WZCOL_TRANSPARENT_BOX); }
// ----------------------------------------------------------------------------------- static void drawStatBars(void) { UDWORD index; bool bMoreBars; UDWORD x,y; UDWORD width,height; if(!bDispStarted) { bDispStarted = true; dispST = gameTime2; audio_PlayTrack(ID_SOUND_BUTTON_CLICK_5); } fillUpStats(); pie_UniTransBoxFill(16 + D_W, MT_Y_POS - 16, pie_GetVideoBufferWidth() - D_W - 16, MT_Y_POS + 256+16, WZCOL_SCORE_BOX); iV_Box(16 + D_W, MT_Y_POS - 16, pie_GetVideoBufferWidth() - D_W - 16, MT_Y_POS + 256+16, WZCOL_SCORE_BOX_BORDER); iV_DrawText( _("Unit Losses"), LC_X + D_W, 80 + 16 + D_H ); iV_DrawText( _("Structure Losses"), LC_X + D_W, 140 + 16 + D_H ); iV_DrawText( _("Force Information"), LC_X + D_W, 200 + 16 + D_H ); index = 0; bMoreBars = true; while(bMoreBars) { /* Is it time to display this bar? */ if( infoBars[index].bActive) { /* Has it been queued before? */ if(infoBars[index].bQueued == false) { /* Don't do this next time...! */ infoBars[index].bQueued = true; /* Play a sound */ // audio_PlayTrack(ID_SOUND_BUTTON_CLICK_5); } x = infoBars[index].topX+D_W; y = infoBars[index].topY+D_H; width = infoBars[index].width; height = infoBars[index].height; iV_Box(x, y, x + width, y + height, WZCOL_BLACK); /* Draw the background border box */ pie_BoxFill(x - 1, y - 1, x + width + 1, y + height + 1, WZCOL_MENU_BACKGROUND); /* Draw the interior grey */ pie_BoxFill(x, y, x + width, y + height, WZCOL_MENU_SCORES_INTERIOR); if( ((gameTime2 - dispST) > infoBars[index].queTime) ) { /* Now draw amount filled */ const float mul = (gameTime2 - dispST < BAR_CRAWL_TIME) ? (float)(gameTime2 - dispST) / (float)BAR_CRAWL_TIME : 1.f; const float length = (float)infoBars[index].percent / 100.f * (float)infoBars[index].width * mul; if((int)length > 4) { /* Black shadow */ pie_BoxFill(x + 1, y + 3, x + length - 1, y + height - 1, WZCOL_MENU_SHADOW); /* Solid coloured bit */ pie_BoxFill(x + 1, y + 2, x + length - 4, y + height - 4, getColour(index)); } } /* Now render the text by the bar */ sprintf(text, getDescription((MR_STRING)infoBars[index].stringID), infoBars[index].number); iV_DrawText(text, x + width + 16, y + 12); /* If we're beyond STAT_ROOKIE, then we're on rankings */ if(index>=STAT_GREEN && index <= STAT_ACE) { iV_DrawImage(IntImages,(UWORD)(IMAGE_LEV_0 + (index - STAT_GREEN)),x-8,y+2); } } /* Move onto the next bar */ index++; if(infoBars[index].topX == 0 && infoBars[index].topY == 0) { bMoreBars = false; } } dispAdditionalInfo(); }
void scoreDataToScreen(WIDGET *psWidget, ScoreDataToScreenCache& cache) { int index, x, y, width, height; bool bMoreBars; if (!bDispStarted) { bDispStarted = true; dispST = realTime; audio_PlayTrack(ID_SOUND_BUTTON_CLICK_5); } fillUpStats(); pie_UniTransBoxFill(16 + D_W, MT_Y_POS - 16, pie_GetVideoBufferWidth() - D_W - 16, MT_Y_POS + 256 + 16, WZCOL_SCORE_BOX); iV_Box(16 + D_W, MT_Y_POS - 16, pie_GetVideoBufferWidth() - D_W - 16, MT_Y_POS + 256 + 16, WZCOL_SCORE_BOX_BORDER); cache.wzLabelText_UnitLosses.setText(_("Unit Losses"), font_regular); cache.wzLabelText_UnitLosses.render(LC_X + D_W, 80 + 16 + D_H, WZCOL_FORM_TEXT); cache.wzLabelText_StructureLosses.setText(_("Structure Losses"), font_regular); cache.wzLabelText_StructureLosses.render(LC_X + D_W, 140 + 16 + D_H, WZCOL_FORM_TEXT); cache.wzLabelText_ForceInformation.setText(_("Force Information"), font_regular); cache.wzLabelText_ForceInformation.render(LC_X + D_W, 200 + 16 + D_H, WZCOL_FORM_TEXT); index = 0; bMoreBars = true; while (bMoreBars) { /* Is it time to display this bar? */ if (infoBars[index].bActive) { /* Has it been queued before? */ if (infoBars[index].bQueued == false) { /* Don't do this next time...! */ infoBars[index].bQueued = true; /* Play a sound */ audio_PlayTrack(ID_SOUND_BUTTON_CLICK_5); } x = infoBars[index].topX + D_W; y = infoBars[index].topY + D_H; width = infoBars[index].width; height = infoBars[index].height; iV_Box(x, y, x + width, y + height, WZCOL_BLACK); /* Draw the background border box */ pie_BoxFill(x - 1, y - 1, x + width + 1, y + height + 1, WZCOL_MENU_BACKGROUND); /* Draw the interior grey */ pie_BoxFill(x, y, x + width, y + height, WZCOL_MENU_SCORES_INTERIOR); if (((realTime - dispST) > infoBars[index].queTime)) { /* Now draw amount filled */ const float mul = (realTime - dispST < BAR_CRAWL_TIME) ? (float)(realTime - dispST) / (float)BAR_CRAWL_TIME : 1.f; const float length = (float)infoBars[index].percent / 100.f * (float)infoBars[index].width * mul; if ((int)length > 4) { /* Black shadow */ pie_BoxFill(x + 1, y + 3, x + length - 1, y + height - 1, WZCOL_MENU_SHADOW); /* Solid coloured bit */ pie_BoxFill(x + 1, y + 2, x + length - 4, y + height - 4, getColour(index)); } } /* Now render the text by the bar */ sprintf(text, getDescription((MR_STRING)infoBars[index].stringID), infoBars[index].number); if (index >= cache.wzInfoBarText.size()) { cache.wzInfoBarText.resize(index + 1); } cache.wzInfoBarText[index].setText(text, font_regular); cache.wzInfoBarText[index].render(x + width + 16, y + 12, WZCOL_FORM_TEXT); /* If we're beyond STAT_ROOKIE, then we're on rankings */ if (index >= STAT_GREEN && index <= STAT_ACE) { iV_DrawImage(IntImages, (UWORD)(IMAGE_LEV_0 + (index - STAT_GREEN)), x - 8, y + 2); } } /* Move onto the next bar */ index++; if ((index > STAT_ACE) || (infoBars[index].topX == 0 && infoBars[index].topY == 0)) { bMoreBars = false; } } /* We now need to display the mission time, game time, average unit experience level an number of artefacts found */ /* Firstly, top of the screen, number of artefacts found */ sprintf(text, _("ARTIFACTS RECOVERED: %d"), missionData.artefactsFound); cache.wzInfoText_ArtifactsFound.setText(text, font_regular); cache.wzInfoText_ArtifactsFound.render((pie_GetVideoBufferWidth() - cache.wzInfoText_ArtifactsFound.width()) / 2, 300 + D_H, WZCOL_FORM_TEXT); /* Get the mission result time in a string - and write it out */ getAsciiTime((char *)&text2, gameTime - missionData.missionStarted); sprintf(text, _("Mission Time - %s"), text2); cache.wzInfoText_MissionTime.setText(text, font_regular); cache.wzInfoText_MissionTime.render((pie_GetVideoBufferWidth() - cache.wzInfoText_MissionTime.width()) / 2, 320 + D_H, WZCOL_FORM_TEXT); /* Write out total game time so far */ getAsciiTime((char *)&text2, gameTime); sprintf(text, _("Total Game Time - %s"), text2); cache.wzInfoText_TotalGameTime.setText(text, font_regular); cache.wzInfoText_TotalGameTime.render((pie_GetVideoBufferWidth() - cache.wzInfoText_TotalGameTime.width()) / 2, 340 + D_H, WZCOL_FORM_TEXT); if (Cheated) { // A quick way to flash the text PIELIGHT cheatedTextColor = ((realTime / 250) % 2) ? WZCOL_RED : WZCOL_YELLOW; sprintf(text, "%s", _("You cheated!")); cache.wzInfoText_Cheated.setText(text, font_regular); cache.wzInfoText_Cheated.render((pie_GetVideoBufferWidth() - cache.wzInfoText_Cheated.width()) / 2, 360 + D_H, cheatedTextColor); } }