Skip to content

Commit

Permalink
UI: Fix the scroll credits speed calculation ...
Browse files Browse the repository at this point in the history
and remove the unwanted auto music volume change
  • Loading branch information
kai-li-wop committed Nov 12, 2023
1 parent 8bba15a commit da9acac
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions code/ui/ui_credits.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ typedef struct {
static wopcredits_t s_wopcredits;

static int creditSeqStarttime;
static float originalMusicVolume;

static const vec4_t color_programming = {1.0f, 0.6f, 1.0f, 1.0f};
static const vec4_t color_models = {1.0f, 0.6f, 0.0f, 1.0f};
Expand Down Expand Up @@ -385,12 +384,11 @@ static void UI_WopCredits_Draw(void) {

UI_DrawNamedPic(216, 0, 648, SCREEN_HEIGHT, WOPCREDITSBG); // pictures have 4:3 resolution referenced

y = SCREEN_HEIGHT - (float)((ysize - 5 * SCREEN_HEIGHT) / TRACKLENGTH) * (float)(uis.realtime - creditSeqStarttime) / 10000;
y = SCREEN_HEIGHT - (float)((ysize + 2 * SCREEN_HEIGHT) / TRACKLENGTH) * (float)(uis.realtime - creditSeqStarttime) / 1000;
for (n = 0; n < ARRAY_LEN(credits); n++) {
if (credits[n].string == NULL) {
if (y < -16) {
UI_StopMusic();
trap_Cmd_ExecuteText(EXEC_APPEND, va("s_musicvolume %f\n", originalMusicVolume));
UI_PopMenu();
break;
}
Expand Down Expand Up @@ -433,7 +431,6 @@ UI_WopCredits_MenuKey
static sfxHandle_t UI_WopCredits_MenuKey(int key) {
if (key == K_MOUSE2 || key == K_ESCAPE) {
UI_StopMusic(); // -> durch refresh sollte automatisch wieder der normale starten
trap_Cmd_ExecuteText(EXEC_APPEND, va("s_musicvolume %f\n", originalMusicVolume));
}
return Menu_DefaultKey(uis.activemenu, key);
}
Expand All @@ -449,10 +446,6 @@ static void UI_WopCredits_MenuInit(void) {
UI_WopCredits_Cache();

creditSeqStarttime = uis.realtime;
originalMusicVolume = trap_Cvar_VariableValue("s_musicvolume");
if (originalMusicVolume < 0.5) {
trap_Cmd_ExecuteText(EXEC_APPEND, "s_musicvolume 0.5\n");
}

UI_StartCreditMusic();

Expand Down

0 comments on commit da9acac

Please sign in to comment.