C client: Fix progress not being reset to 0 on showing loading screen

This commit is contained in:
UnknownShadow200 2018-09-26 20:46:08 +10:00
parent 1eda8f11a1
commit 5f8254eb8a
2 changed files with 4 additions and 4 deletions

View File

@ -592,6 +592,7 @@ struct Screen* LoadingScreen_MakeInstance(const String* title, const String* mes
struct LoadingScreen* s = &LoadingScreen_Instance;
s->LastState = NULL;
s->VTABLE = &LoadingScreen_VTABLE;
s->Progress = 0.0f;
String title_copy = String_FromArray(s->__TitleBuffer);
String_AppendString(&title_copy, title);

View File

@ -188,7 +188,6 @@ static UInt32 Codebook_Lookup1Values(UInt32 entries, UInt32 dimensions) {
return 0;
}
#define CODEWORD_UNUSED UInt8_MaxValue
static bool Codebook_CalcCodewords(struct Codebook* c, UInt8* len) {
c->Codewords = Mem_Alloc(c->NumCodewords, sizeof(UInt32), "codewords");
c->CodewordLens = Mem_Alloc(c->NumCodewords, sizeof(UInt8), "raw codeword lens");
@ -200,7 +199,7 @@ static bool Codebook_CalcCodewords(struct Codebook* c, UInt8* len) {
/* add codeword 0 to tree */
for (i = 0; i < c->Entries; i++) {
if (len[i] == CODEWORD_UNUSED) continue;
if (!len[i]) continue;
c->Codewords[0] = 0;
c->CodewordLens[0] = len[i];
@ -216,7 +215,7 @@ static bool Codebook_CalcCodewords(struct Codebook* c, UInt8* len) {
i++; /* first codeword was already handled */
for (j = 1; i < c->Entries; i++) {
UInt32 root = len[i];
if (root == CODEWORD_UNUSED) continue;
if (!root) continue;
/* per spec, find lowest possible value (leftmost) */
while (root && next_codewords[root] == 0) root--;
@ -252,7 +251,7 @@ static ReturnCode Codebook_DecodeSetup(struct VorbisState* ctx, struct Codebook*
if (sparse) {
Int32 flag = Vorbis_ReadBits(ctx, 1);
if (!flag) {
codewordLens[i] = CODEWORD_UNUSED;
codewordLens[i] = 0;
continue; /* unused entry */
}
}