/* * UpdateDODIntro: * Updates the DOD Intro Music And GFX */ void UpdateDODIntro(BOOL *ttl) { RECT SrcRect, DesRect; // Source And Destination Rectangles RGB rgb; // RGB Triplet For BlitString static int count[NUM_INTRO_LINES] = { 480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // Counters For Each Line Of Intro Text int i; // Variable For Looping HRESULT ret; // Set Source And Destination Rectangles To Size Of Screen SetRect(&SrcRect, 0, 0, 640, 480); SetRect(&DesRect, 0, 0, 640, 480); // Blit the DOD PIC to the back surface lpDDSBack->Blt(&DesRect, lpDDSDOD, &SrcRect, DDBLT_WAIT, NULL); // Init The Clock (Used For Wait_Clock) Start_Clock(); // Loop through each line of text for (i = 0; i < NUM_INTRO_LINES; i++) { // If the line of text has been initialized if (count[i]) { // set the red, green, blue color components based on counter rgb.r = count[i] % 256 + 31; rgb.g = 0; rgb.b = 0; // blit the string to the back surface BlitString(dodintro_text[i], 15, count[i], &rgb); // decrement the counter by one (moves upward) count[i] -= 1; // determine if it's time to kill this line if ((rgb.r - 31) == 0) { count[i] = 0; } // determing if it's time to start the next line going if (i != (NUM_INTRO_LINES - 1)) if (count[i] < 460 && !count[i + 1]) { count[i + 1] = 480; } } } // hold this intro to about 10 frames per second (100 ms) Wait_Clock(100); // flip to the primary surface ret = DDFlip(); if (ret == DDERR_SURFACELOST) { RestoreGraphics(); } // see if it's time to kill this intro phase *ttl = FALSE; for (i = 0; i < NUM_INTRO_LINES; i++) { if (count[i] > 0) { *ttl = TRUE; } } }
void DrawUptime(void) { static int first = 1; static int old_days, old_hours, old_minutes; long uptime; int i; uptime = curtime - start_uptime + start_time; /* blit minutes */ uptime /=60; i = uptime % 60; if (old_minutes != i || first) { old_minutes = i; sprintf(buf, "%02i", i); #ifdef HI_INTS BlitString(buf, 45, 29); #else BlitString(buf, 45, 37); #endif } /* blit hours */ uptime /=60; i = uptime % 24; if (old_hours != i || first) { old_hours = i; sprintf(buf, "%02i", i); #ifdef HI_INTS BlitString(buf, 29, 29); #else BlitString(buf, 29, 37); #endif } /* blit days */ uptime /= 24; i = uptime; if (old_days != i || first) { old_days = i; sprintf(buf, "%03i", i); #ifdef HI_INTS BlitString(buf, 6, 29); #else BlitString(buf, 6, 37); #endif } first = 0; }
/* * UpdateCredits: * Updates the credits screen */ void UpdateCredits(BOOL *ttl) { RGB rgb; // RGB Triplet For BlitString HRESULT ret; int special[NUM_CREDIT_LINES] = { 1, 0, 0, 1, // Special Color For Each Line Of Intro Text 0, 0, 1, 0, // Special Color For Each Line Of Intro Text 0, 1, 0, 0, // Special Color For Each Line Of Intro Text 1, 0, 0, 0, // Special Color For Each Line Of Intro Text 0, 0, 0, 0, // Special Color For Each Line Of Intro Text 0, 2, 2, 0, // Special Color For Each Line Of Intro Text 0, 0, 0, 2, // Special Color For Each Line Of Intro Text 2, 0, 0, 0, // Special Color For Each Line Of Intro Text 0, 2, 2, 2, // Special Color For Each Line Of Intro Text 2, 2, 0, 2 }; int i; // Variable For Looping // clear out the back surface DDFillSurface(lpDDSBack, 0); // Init The Clock (Used For Wait_Clock) Start_Clock(); // Loop through each line of text for (i = 0; i < NUM_CREDIT_LINES; i++) { // If the line of text has been initialized if (count[i]) { // set the red, green, blue color components based on counter if (special[i] == 0) { if (count[i] > 224) { rgb.r = 255 - (count[i] % 256 + 31); } else { rgb.r = count[i] % 256 + 31; } rgb.g = 0; rgb.b = 0; } else if (special[i] == 1) { if (count[i] > 224) { rgb.r = 255 - (count[i] % 256 + 31); } else { rgb.r = count[i] % 256 + 31; } rgb.g = 0; if (count[i] > 224) { rgb.b = 255 - (count[i] % 256 + 31); } else { rgb.b = count[i] % 256 + 31; } } else if (special[i] == 2) { if (count[i] > 224) { rgb.r = 255 - (count[i] % 256 + 31); } else { rgb.r = count[i] % 256 + 31; } if (count[i] > 224) { rgb.g = 255 - (count[i] % 256 + 31); } else { rgb.g = count[i] % 256 + 31; } rgb.b = 0; } // blit the string to the back surface BlitString(dodcredit_text[i], 30, count[i], &rgb); // decrement the counter by one (moves upward) count[i] -= 1; // determing if it's time to start the next line going if (i != (NUM_CREDIT_LINES - 1)) if (count[i] < 460 && !count[i + 1]) { count[i + 1] = 480; } } } // hold this intro to about 10 frames per second (100 ms) Wait_Clock(100); // flip to the primary surface ret = DDFlip(); if (ret == DDERR_SURFACELOST) { RestoreGraphics(); } // see if it's time to get the hell outa here *ttl = FALSE; for (i = 0; i < NUM_CREDIT_LINES; i++) { if (count[i] > 0) { *ttl = TRUE; } } }