Skip to content

Commit

Permalink
Fix demo loop crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
doomhack committed Dec 13, 2019
1 parent 82fe766 commit 614f308
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 49 deletions.
78 changes: 33 additions & 45 deletions source/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,69 +354,57 @@ static struct
}

const demostates[][4] =
{
{
{
{D_DrawTitle1, "TITLEPIC"},
{D_DrawTitle1, "TITLEPIC"},
{D_DrawTitle2, "TITLEPIC"},
{D_DrawTitle1, "TITLEPIC"},
{D_DrawTitle1, "TITLEPIC"},
{D_DrawTitle1, "TITLEPIC"},
{D_DrawTitle2, "TITLEPIC"},
{D_DrawTitle1, "TITLEPIC"},
},

{
{G_DeferedPlayDemo, "demo1"},
{G_DeferedPlayDemo, "demo1"},
{G_DeferedPlayDemo, "demo1"},
{G_DeferedPlayDemo, "demo1"},
{G_DeferedPlayDemo, "demo1"},
{G_DeferedPlayDemo, "demo1"},
{G_DeferedPlayDemo, "demo1"},
{G_DeferedPlayDemo, "demo1"},
},
{
{D_SetPageName, NULL},
{D_SetPageName, NULL},
{D_SetPageName, NULL},
{D_SetPageName, NULL},
{D_SetPageName, "TITLEPIC"},
{D_SetPageName, "TITLEPIC"},
{D_SetPageName, "TITLEPIC"},
{D_SetPageName, "TITLEPIC"},
},

{
{G_DeferedPlayDemo, "demo2"},
{G_DeferedPlayDemo, "demo2"},
{G_DeferedPlayDemo, "demo2"},
{G_DeferedPlayDemo, "demo2"},
{G_DeferedPlayDemo, "demo2"},
{G_DeferedPlayDemo, "demo2"},
{G_DeferedPlayDemo, "demo2"},
{G_DeferedPlayDemo, "demo2"},
},

{
{D_SetPageName, "HELP2"},
{D_SetPageName, "HELP2"},
{D_SetPageName, "CREDIT"},
{D_DrawTitle1, "TITLEPIC"},
{D_SetPageName, "TITLEPIC"},
{D_SetPageName, "TITLEPIC"},
{D_SetPageName, "TITLEPIC"},
{D_SetPageName, "TITLEPIC"},
},

{
{G_DeferedPlayDemo, "demo3"},
{G_DeferedPlayDemo, "demo3"},
{G_DeferedPlayDemo, "demo3"},
{G_DeferedPlayDemo, "demo3"},
{G_DeferedPlayDemo, "demo3"},
{G_DeferedPlayDemo, "demo3"},
{G_DeferedPlayDemo, "demo3"},
{G_DeferedPlayDemo, "demo3"},
},

{
{NULL},
{NULL},
{NULL},
{D_SetPageName, "CREDIT"},
},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
}

{
{NULL},
{NULL},
{NULL},
{G_DeferedPlayDemo, "demo4"},
},

{
{NULL},
{NULL},
{NULL},
{NULL},
}
};
};

/*
* This cycles through the demo sequences.
Expand All @@ -435,8 +423,8 @@ void D_DoAdvanceDemo(void)

if (!demostates[++_g->demosequence][_g->gamemode].func)
_g->demosequence = 0;
demostates[_g->demosequence][_g->gamemode].func
(demostates[_g->demosequence][_g->gamemode].name);

demostates[_g->demosequence][_g->gamemode].func(demostates[_g->demosequence][_g->gamemode].name);
}

//
Expand Down
2 changes: 1 addition & 1 deletion source/doom_iwad.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "iwad/doom1.gba.h"
#include "iwad/doomu.gba.h"

#include "doom_iwad.h"

Expand Down
3 changes: 0 additions & 3 deletions source/r_hotpath.iwram.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,9 +1602,6 @@ static void R_DrawColumnInCache(const column_t* patch, byte* cache, int originy,
#define CACHE_ENTRY(c, t) ((c << 16 | t))
#define CACHE_HASH(c, t) (((c >> 4) ^ t) & CACHE_KEY_MASK)

#define CACHE_HASH2(c, t) ((((unsigned int)t | (unsigned int)c << 16)*2654435761u) & CACHE_KEY_MASK)


static unsigned int FindColumnCacheItem(unsigned int texture, unsigned int column)
{
//static unsigned int looks, peeks;
Expand Down

0 comments on commit 614f308

Please sign in to comment.