mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-14 11:50:49 +00:00
- migrated Duke's intro images and the first episode's ending animation.
This commit is contained in:
parent
6ed1d5e678
commit
2a2c85c082
3 changed files with 104 additions and 79 deletions
|
@ -596,10 +596,8 @@ public:
|
|||
int frame = clock / nFrameNs;
|
||||
|
||||
twod->ClearScreen();
|
||||
Printf("clock = %llu, frame = %d\n", clock, frame);
|
||||
if (frame > nFrame)
|
||||
{
|
||||
Printf("Updating\n");
|
||||
Smacker_GetPalette(hSMK, palette);
|
||||
Smacker_GetFrame(hSMK, pFrame.Data());
|
||||
animtex.SetFrame(palette, pFrame.Data());
|
||||
|
|
|
@ -91,7 +91,7 @@ static void DrawCaption(const char* text)
|
|||
}
|
||||
|
||||
|
||||
class DBloodSummaryScreen : public DScreenJob
|
||||
class DBloodSummaryScreen : public DSkippableScreenJob
|
||||
{
|
||||
void DrawKills(void)
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ class DBloodSummaryScreen : public DScreenJob
|
|||
}
|
||||
|
||||
|
||||
int Frame(uint64_t clock, bool skiprequest)
|
||||
void Draw(double) override
|
||||
{
|
||||
drawTextScreenBackground();
|
||||
if (gGameOptions.nGameType == 0)
|
||||
|
@ -160,7 +160,7 @@ class DBloodSummaryScreen : public DScreenJob
|
|||
DrawCaption(GStrings("TXTB_FRAGSTATS"));
|
||||
DrawKills();
|
||||
}
|
||||
int myclock = int(clock * 120 / 1'000'000'000);
|
||||
int myclock = ticks * 120 / GameTicRate;
|
||||
if ((myclock & 32))
|
||||
{
|
||||
auto text = GStrings("PRESSKEY");
|
||||
|
@ -168,7 +168,6 @@ class DBloodSummaryScreen : public DScreenJob
|
|||
if (!SmallFont2->CanPrint(text)) font = 0;
|
||||
viewDrawText(font, text, 160, 134, -128, 0, 1, font == 3);
|
||||
}
|
||||
return skiprequest ? -1 : 1;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -285,7 +284,7 @@ public:
|
|||
else pzLoadingScreenText1 = GStrings(FStringf("TXTB_NETGT%d", gGameOptions.nGameType));
|
||||
}
|
||||
|
||||
int Frame(uint64_t clock, bool skiprequest)
|
||||
void Draw(double) override
|
||||
{
|
||||
twod->ClearScreen();
|
||||
drawTextScreenBackground();
|
||||
|
@ -297,7 +296,6 @@ public:
|
|||
if (!SmallFont2->CanPrint(text)) font = 0;
|
||||
|
||||
viewDrawText(font, GStrings("TXTB_PLSWAIT"), 160, 134, -128, 0, 1, font == 3);
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -165,20 +165,23 @@ static void MiniText(double x, double y, const char* t, int shade, int align = -
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class DDRealmsScreen : public DScreenJob
|
||||
class DDRealmsScreen : public DSkippableScreenJob
|
||||
{
|
||||
public:
|
||||
DDRealmsScreen() : DScreenJob(fadein | fadeout) {}
|
||||
DDRealmsScreen() : DSkippableScreenJob(fadein | fadeout) {}
|
||||
|
||||
int Frame(uint64_t clock, bool skiprequest) override
|
||||
void OnTick() override
|
||||
{
|
||||
if (ticks >= 7 * GameTicRate) state = finished;
|
||||
}
|
||||
|
||||
void Draw(double smoothratio) override
|
||||
{
|
||||
const uint64_t duration = 7'000'000'000;
|
||||
const auto tex = tileGetTexture(DREALMS, true);
|
||||
int translation = tex->GetTexture()->GetImage()->UseGamePalette() ? TRANSLATION(Translation_BasePalettes, DREALMSPAL) : 0;
|
||||
|
||||
twod->ClearScreen();
|
||||
DrawTexture(twod, tex, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_TranslationIndex, translation, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE);
|
||||
return skiprequest ? -1 : clock < duration ? 1 : 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -188,27 +191,18 @@ public:
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class DTitleScreen : public DScreenJob
|
||||
class DTitleScreen : public DSkippableScreenJob
|
||||
{
|
||||
int soundanm = 0;
|
||||
|
||||
public:
|
||||
DTitleScreen() : DScreenJob(fadein | fadeout)
|
||||
DTitleScreen() : DSkippableScreenJob(fadein | fadeout)
|
||||
{
|
||||
}
|
||||
|
||||
int Frame(uint64_t nsclock, bool skiprequest) override
|
||||
void OnTick() override
|
||||
{
|
||||
twod->ClearScreen();
|
||||
int clock = nsclock * 120 / 1'000'000'000;
|
||||
|
||||
twod->ClearScreen();
|
||||
|
||||
// Only translate if the image depends on the global palette.
|
||||
auto tex = tileGetTexture(BETASCREEN, true);
|
||||
int translation = tex->GetTexture()->GetImage()->UseGamePalette() ? TRANSLATION(Translation_BasePalettes, TITLEPAL) : 0;
|
||||
DrawTexture(twod, tex, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_TranslationIndex, translation, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE);
|
||||
|
||||
int clock = ticks * 120 / GameTicRate;
|
||||
if (soundanm == 0 && clock >= 120 && clock < 120 + 60)
|
||||
{
|
||||
soundanm = 1;
|
||||
|
@ -230,6 +224,25 @@ public:
|
|||
if (isPlutoPak()) S_PlaySound(PIPEBOMB_EXPLODE, CHAN_AUTO, CHANF_UI);
|
||||
}
|
||||
|
||||
if (clock > (860 + 120))
|
||||
{
|
||||
state = finished;
|
||||
}
|
||||
}
|
||||
|
||||
void Draw(double smoothratio) override
|
||||
{
|
||||
twod->ClearScreen();
|
||||
int clock = (ticks + smoothratio) * 120 / GameTicRate;
|
||||
|
||||
twod->ClearScreen();
|
||||
|
||||
// Only translate if the image depends on the global palette.
|
||||
auto tex = tileGetTexture(BETASCREEN, true);
|
||||
int translation = tex->GetTexture()->GetImage()->UseGamePalette() ? TRANSLATION(Translation_BasePalettes, TITLEPAL) : 0;
|
||||
DrawTexture(twod, tex, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_TranslationIndex, translation, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE);
|
||||
|
||||
|
||||
double scale = clamp(clock - 120, 0, 60) / 64.;
|
||||
if (scale > 0.)
|
||||
{
|
||||
|
@ -262,13 +275,6 @@ public:
|
|||
DTA_CenterOffsetRel, true, DTA_TranslationIndex, translation, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE);
|
||||
}
|
||||
}
|
||||
|
||||
if (clock > (860 + 120))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return skiprequest ? -1 : 1;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -310,16 +316,14 @@ void Logo_d(const CompletionFunc &completion)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class DEpisode1End1 : public DScreenJob
|
||||
class DEpisode1End1 : public DSkippableScreenJob
|
||||
{
|
||||
int bonuscnt = 0;
|
||||
int bossani = -1;
|
||||
int breatheani = -1;
|
||||
bool breathebg = false;
|
||||
|
||||
public:
|
||||
DEpisode1End1() : DScreenJob(fadein | fadeout) {}
|
||||
|
||||
int Frame(uint64_t nsclock, bool skiprequest) override
|
||||
{
|
||||
static const int breathe[] =
|
||||
static inline const int breathe[] =
|
||||
{
|
||||
0, 30,VICTORY1 + 1,176,59,
|
||||
30, 60,VICTORY1 + 2,176,59,
|
||||
|
@ -327,7 +331,7 @@ public:
|
|||
90, 120,0 ,176,59
|
||||
};
|
||||
|
||||
static const int bossmove[] =
|
||||
static inline const int bossmove[] =
|
||||
{
|
||||
0, 120,VICTORY1 + 3,86,59,
|
||||
220, 260,VICTORY1 + 4,86,59,
|
||||
|
@ -338,19 +342,20 @@ public:
|
|||
350, 380,VICTORY1 + 8,86,59,
|
||||
};
|
||||
|
||||
auto translation = TRANSLATION(Translation_BasePalettes, ENDINGPAL);
|
||||
public:
|
||||
DEpisode1End1() : DSkippableScreenJob(fadein | fadeout) {}
|
||||
|
||||
int currentclock = nsclock * 120 / 1'000'000'000;
|
||||
|
||||
uint64_t span = nsclock / 1'000'000;
|
||||
|
||||
twod->ClearScreen();
|
||||
DrawTexture(twod, tileGetTexture(VICTORY1, true), 0, 50, DTA_FullscreenScale, FSMode_Fit320x200,
|
||||
DTA_TranslationIndex, translation, DTA_LegacyRenderStyle, STYLE_Normal, DTA_TopLeft, true, TAG_DONE);
|
||||
void OnTick()
|
||||
{
|
||||
int currentclock = ticks * 120 / GameTicRate;
|
||||
|
||||
bossani = -1;
|
||||
breathebg = false;
|
||||
breatheani = -1;
|
||||
|
||||
// boss
|
||||
if (currentclock > 390 && currentclock < 780)
|
||||
{
|
||||
for (int t = 0; t < 35; t += 5) if (bossmove[t + 2] && (currentclock % 390) > bossmove[t] && (currentclock % 390) <= bossmove[t + 1])
|
||||
{
|
||||
if (t == 10 && bonuscnt == 1)
|
||||
|
@ -359,8 +364,8 @@ public:
|
|||
S_PlaySound(SQUISHED, CHAN_AUTO, CHANF_UI);
|
||||
bonuscnt++;
|
||||
}
|
||||
DrawTexture(twod, tileGetTexture(bossmove[t + 2], true), bossmove[t + 3], bossmove[t + 4], DTA_FullscreenScale, FSMode_Fit320x200,
|
||||
DTA_TranslationIndex, translation, DTA_TopLeft, true, TAG_DONE);
|
||||
bossani = t;
|
||||
}
|
||||
}
|
||||
|
||||
// Breathe
|
||||
|
@ -368,8 +373,7 @@ public:
|
|||
{
|
||||
if (currentclock >= 750)
|
||||
{
|
||||
DrawTexture(twod, tileGetTexture(VICTORY1 + 8, true), 86, 59, DTA_FullscreenScale, FSMode_Fit320x200,
|
||||
DTA_TranslationIndex, translation, DTA_TopLeft, true, TAG_DONE);
|
||||
breathebg = true;
|
||||
if (currentclock >= 750 && bonuscnt == 2)
|
||||
{
|
||||
S_PlaySound(DUKETALKTOBOSS, CHAN_AUTO, CHANF_UI);
|
||||
|
@ -384,12 +388,37 @@ public:
|
|||
S_PlaySound(BOSSTALKTODUKE, CHAN_AUTO, CHANF_UI);
|
||||
bonuscnt++;
|
||||
}
|
||||
DrawTexture(twod, tileGetTexture(breathe[t + 2], true), breathe[t + 3], breathe[t + 4], DTA_FullscreenScale, FSMode_Fit320x200,
|
||||
breatheani = t;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Draw(double) override
|
||||
{
|
||||
auto translation = TRANSLATION(Translation_BasePalettes, ENDINGPAL);
|
||||
|
||||
twod->ClearScreen();
|
||||
DrawTexture(twod, tileGetTexture(VICTORY1, true), 0, 50, DTA_FullscreenScale, FSMode_Fit320x200,
|
||||
DTA_TranslationIndex, translation, DTA_LegacyRenderStyle, STYLE_Normal, DTA_TopLeft, true, TAG_DONE);
|
||||
|
||||
if (bossani != -1)
|
||||
{
|
||||
DrawTexture(twod, tileGetTexture(bossmove[bossani + 2], true), bossmove[bossani + 3], bossmove[bossani + 4], DTA_FullscreenScale, FSMode_Fit320x200,
|
||||
DTA_TranslationIndex, translation, DTA_TopLeft, true, TAG_DONE);
|
||||
}
|
||||
|
||||
if (breathebg)
|
||||
{
|
||||
DrawTexture(twod, tileGetTexture(VICTORY1 + 8, true), 86, 59, DTA_FullscreenScale, FSMode_Fit320x200,
|
||||
DTA_TranslationIndex, translation, DTA_TopLeft, true, TAG_DONE);
|
||||
}
|
||||
|
||||
if (breatheani != -1)
|
||||
{
|
||||
DrawTexture(twod, tileGetTexture(breathe[breatheani + 2], true), breathe[breatheani + 3], breathe[breatheani + 4], DTA_FullscreenScale, FSMode_Fit320x200,
|
||||
DTA_TranslationIndex, translation, DTA_TopLeft, true, TAG_DONE);
|
||||
}
|
||||
// Only end after having faded out.
|
||||
return skiprequest ? -1 : 1;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue