From bebaf6f984894e0215ca2819ed9204d9d438e77f Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 28 Jul 2019 11:40:19 +0100 Subject: [PATCH] * Add comments for maintenence. * Fix not-guaranteed-to-be-set-to-zero-ness of sparklloop * Add blackrock sparkles to good ending. * Don't have emerald sparkles be randomised. * Adjust credits to include Sal (credits sprites + four merged internal MRs and a bunch of public ones) and a few other known contributors, plus remove oni's name (he requested i do it a whiiile ago) --- src/f_finale.c | 165 +++++++++++++++++++++++++++++-------------------- 1 file changed, 97 insertions(+), 68 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index e17c1118a..64a6503e7 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -104,7 +104,7 @@ static patch_t *endfwrk[3]; // firework - replaced with skin when good ending static patch_t *endspkl[3]; // sparkle static patch_t *endglow[2]; // glow aura - replaced with black rock's midway through good ending static patch_t *endxpld[4]; // mini explosion -static INT32 sparkloffs[8][3][2]; // seven emerald sparkles + eggrock explosions +static INT32 sparkloffs[3][2]; // eggrock explosions/blackrock sparkles static INT32 sparklloop; // @@ -985,6 +985,7 @@ static const char *credits[] = { "\1Assistance", "\"chi.miru\"", // helped port slope drawing code from ZDoom "Andrew \"orospakr\" Clunis", + "Sally \"TehRealSalt\" Cochenour", "Gregor \"Oogaland\" Dick", "Louis-Antoine \"LJSonic\" de Moulins", // for fixing 2.1's netcode (de Rochefort doesn't quite fit on the screen sorry lol) "Victor \"Steel Titanium\" Fuentes", @@ -1004,8 +1005,9 @@ static const char *credits[] = { // Everyone else is acknowledged under "Special Thanks > SRB2 Community Contributors". "", "\1Sprite Artists", - "Odi \"Iceman404\" Atunzu", + "\"Iceman404\"", "Victor \"VAdaPEGA\" Ara\x1Fjo", // Araújo -- sorry for our limited font! D: + "Sally \"TehRealSalt\" Cochenour", "Jim \"MotorRoach\" DeMello", "Desmond \"Blade\" DesJardins", "Sherman \"CoatRack\" DesJardins", @@ -1087,7 +1089,10 @@ static const char *credits[] = { "Simon \"sirjuddington\" Judd", // SLADE developer // Acknowledged here are the following: // Minor merge request authors, see guideline above - // Golden - Expanded thin font + // - Golden - Expanded thin font + // Creators of small quantities of sprite/texture assets + // - Arietty - New Green Hill-styled textures + // - Scizor300 - the only other contributor to the 2.0 SRB2 Asset Pack "SRB2 Community Contributors", "", "\1Produced By", @@ -1279,8 +1284,7 @@ boolean F_CreditResponder(event_t *event) // ============ // EVALUATION // ============ -#define INTERVAL (360/7) -#define TRANSLEVEL V_80TRANS +#define SPARKLLOOPTIME 7 // must be odd void F_StartGameEvaluation(void) { @@ -1309,6 +1313,7 @@ void F_StartGameEvaluation(void) CON_ToggleOff(); finalecount = -1; + sparklloop = 0; } void F_GameEvaluationDrawer(void) @@ -1373,7 +1378,24 @@ void F_GameEvaluationDrawer(void) colormap[1] = R_GetTranslationColormap(TC_BLINK, SKINCOLOR_AQUA, GTC_CACHE); V_DrawFixedPatch(x, y, scale, trans< (finalecount/SPARKLLOOPTIME)) + j = (finalecount/SPARKLLOOPTIME); + while (j) + { + if (j > 1 || sparklloop >= 2) + { + // if j == 0 - alternate between 0 and 1 + // 1 - 1 and 2 + // 2 - 2 and not rendered + V_DrawFixedPatch(x+sparkloffs[j-1][0], y+sparkloffs[j-1][1], FRACUNIT, 0, W_CachePatchName(va("ENDSPKL%.1d", (j - ((sparklloop & 1) ? 0 : 1))), PU_LEVEL), R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_AQUA, GTC_CACHE)); + } + j--; + } + } + else { patch_t *eggrock = W_CachePatchName("ENDEGRK5", PU_LEVEL); V_DrawFixedPatch(x, y, scale, 0, eggrock, colormap[0]); @@ -1392,24 +1414,16 @@ void F_GameEvaluationDrawer(void) fa = (FixedAngle(eemeralds_cur*FRACUNIT)>>ANGLETOFINESHIFT) & FINEMASK; x = (BASEVIDWIDTH<<(FRACBITS-1)) + (60*FINECOSINE(fa)); y = ((BASEVIDHEIGHT+16)<<(FRACBITS-1)) + (60*FINESINE(fa)); - eemeralds_cur += INTERVAL; + eemeralds_cur += (360/7); if (i & 1) eemeralds_cur++; patchname[4] = 'A'+(char)i; - V_DrawFixedPatch(x, y, FRACUNIT, ((emeralds & (1<= 5*TICRATE) { -#if 0 - if (drawemblem) - V_DrawScaledPatch(120, 192, 0, W_CachePatchName("NWNGA0", PU_CACHE)); - - if (drawchaosemblem) - V_DrawScaledPatch(200, 192, 0, W_CachePatchName("NWNGA0", PU_CACHE)); -#endif - V_DrawString(8, 16, V_YELLOWMAP, "Unlocked:"); if (!(netgame) && (!modifiedgame || savemoddata)) @@ -1438,16 +1452,33 @@ void F_GameEvaluationTicker(void) { finalecount++; - if (sparklloop) - sparklloop--; - - if (!goodending - && (finalecount == (5*TICRATE)/2 - || finalecount == (7*TICRATE)/2 - || finalecount == ((7*TICRATE)/2)+5)) + if (goodending) { - S_StartSound(NULL, sfx_s3k5c); - sparklloop = 10; + if (++sparklloop == SPARKLLOOPTIME) // time to roll the randomisation again + { + angle_t workingangle = FixedAngle((M_RandomKey(360))<>ANGLETOFINESHIFT; + fixed_t workingradius = M_RandomKey(26); + sparkloffs[2][0] = sparkloffs[1][0]; + sparkloffs[2][1] = sparkloffs[1][1]; + sparkloffs[1][0] = sparkloffs[0][0]; + sparkloffs[1][1] = sparkloffs[0][1]; + sparkloffs[0][0] = (30<>ANGLETOFINESHIFT; workingradius = M_RandomKey(26); - sparkloffs[7][0][0] = (30< INFLECTIONPOINT*2) @@ -1668,7 +1688,7 @@ void F_EndingDrawer(void) boolean borderstuff = false; INT32 tweakx = 0, tweaky = 0; - if (parallaxticker < 75) + if (parallaxticker < 75) // f background's supposed to be visible { V_DrawFixedPatch(-(x/10), -(y/10), FRACUNIT, 0, endbgsp[0], NULL); // nebula V_DrawFixedPatch(-(x/5), -(y/5), FRACUNIT, 0, endbgsp[1], NULL); // sun @@ -1730,7 +1750,7 @@ void F_EndingDrawer(void) j += tweaky<<2; } - if (parallaxticker <= 70) + if (parallaxticker <= 70) // eggrock/blackrock { INT32 trans; fixed_t scale = FRACUNIT; @@ -1752,8 +1772,8 @@ void F_EndingDrawer(void) doexplosions = true; if (!sparklloop) { - x += ((sparkloffs[7][0][0] < 30<= 3 && doexplosions) { INT32 boomtime = parallaxticker - sparklloop; @@ -1843,10 +1864,11 @@ void F_EndingDrawer(void) x = ((((BASEVIDWIDTH-82)/2)+11)<= TICRATE && finalecount < INFLECTIONPOINT) { INT32 workingtime = finalecount - TICRATE; - fixed_t radius[4]; + fixed_t radius = ((vid.width/vid.dupx)*(INFLECTIONPOINT - TICRATE - workingtime))/(INFLECTIONPOINT - TICRATE); angle_t fa; INT32 eemeralds_cur[4]; char patchname[7] = "CEMGx0"; + radius <<= FRACBITS; + for (i = 0; i < 4; ++i) { if (i == 1) @@ -1878,22 +1903,9 @@ void F_EndingDrawer(void) else if (i) workingtime -= SPARKLLOOPTIME; eemeralds_cur[i] = workingtime % 360; - radius[i] = ((vid.width/vid.dupx)*(INFLECTIONPOINT - TICRATE - workingtime))/(INFLECTIONPOINT - TICRATE); - radius[i] <<= FRACBITS; } - for (i = 0; i < 7; ++i) - { - fa = (FixedAngle(eemeralds_cur[0]*FRACUNIT)>>ANGLETOFINESHIFT) & FINEMASK; - x = (BASEVIDWIDTH<<(FRACBITS-1)) + FixedMul(FINECOSINE(fa),radius[0]); - y = ((BASEVIDHEIGHT+16)<<(FRACBITS-1)) + FixedMul(FINESINE(fa),radius[0]); - eemeralds_cur[0] += INTERVAL; - if (i & 1) - eemeralds_cur[0]++; - - patchname[4] = 'A'+(char)i; - V_DrawFixedPatch(x, y, FRACUNIT, 0, W_CachePatchName(patchname, PU_LEVEL), NULL); - } + // sparkles for (i = 0; i < 7; ++i) { UINT8* colormap; @@ -1928,9 +1940,9 @@ void F_EndingDrawer(void) while (j) { fa = (FixedAngle(eemeralds_cur[j]*FRACUNIT)>>ANGLETOFINESHIFT) & FINEMASK; - x = (BASEVIDWIDTH<<(FRACBITS-1)) + FixedMul(FINECOSINE(fa),radius[j]) + sparkloffs[i][j-1][0]; - y = ((BASEVIDHEIGHT+16)<<(FRACBITS-1)) + FixedMul(FINESINE(fa),radius[j]) + sparkloffs[i][j-1][1]; - eemeralds_cur[j] += INTERVAL; + x = (BASEVIDWIDTH<<(FRACBITS-1)) + FixedMul(FINECOSINE(fa),radius); + y = (BASEVIDHEIGHT<<(FRACBITS-1)) + FixedMul(FINESINE(fa),radius); + eemeralds_cur[j] += (360/7); if (i & 1) eemeralds_cur[j]++; @@ -1942,6 +1954,20 @@ void F_EndingDrawer(void) j--; } } + + // ...then emeralds themselves + for (i = 0; i < 7; ++i) + { + fa = (FixedAngle(eemeralds_cur[0]*FRACUNIT)>>ANGLETOFINESHIFT) & FINEMASK; + x = (BASEVIDWIDTH<<(FRACBITS-1)) + FixedMul(FINECOSINE(fa),radius); + y = ((BASEVIDHEIGHT+16)<<(FRACBITS-1)) + FixedMul(FINESINE(fa),radius); + eemeralds_cur[0] += (360/7); + if (i & 1) + eemeralds_cur[0]++; + + patchname[4] = 'A'+(char)i; + V_DrawFixedPatch(x, y, FRACUNIT, 0, W_CachePatchName(patchname, PU_LEVEL), NULL); + } } // if (goodending... } // (finalecount > 20) @@ -1989,6 +2015,9 @@ void F_EndingDrawer(void) } } +#undef SPARKLLOOPTIME +#undef INFLECTIONPOINT + // ========== // GAME END // ==========