Skip to content

Commit b712f25

Browse files
committed
- refactor Tada
1 parent b06bf65 commit b712f25

1 file changed

Lines changed: 16 additions & 39 deletions

File tree

src_rebuild/Game/C/spool.c

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,51 +1973,28 @@ void Tada(void)
19731973
int spec_tpage;
19741974
RECT16 tpagerect;
19751975

1976-
if (specialState == 2)
1976+
switch (specialState)
19771977
{
1978-
tpagerect.w = 64;
1979-
tpagerect.h = 16;
1978+
case 1:
1979+
case 2:
1980+
spec_tpage = specialSlot + (specialState - 1);
1981+
tpagerect.w = 64;
1982+
tpagerect.h = 16;
19801983

1981-
spec_tpage = specialSlot + 1;
1982-
tpagerect.x = tpagepos[spec_tpage].x;
1983-
tpagerect.y = tpagepos[spec_tpage].y + (15 - specBlocksToLoad) * 16;
1984+
tpagerect.x = tpagepos[spec_tpage].x;
1985+
tpagerect.y = tpagepos[spec_tpage].y + (15 - specBlocksToLoad) * 16;
19841986

1985-
if (specBlocksToLoad == 15)
1986-
update_slotinfo(specTpages[GameLevel][specspooldata[2]-1], specialSlot, &tpagerect);
1987-
1988-
LoadImage(&tpagerect, (u_long *)specLoadBuffer);
1989-
}
1990-
else
1991-
{
1992-
if (specialState > 2)
1993-
{
1994-
if (specialState != 4)
1995-
return;
1987+
if (specBlocksToLoad == 15)
1988+
update_slotinfo(specTpages[GameLevel][specspooldata[2] - 1], specialSlot, &tpagerect);
19961989

1990+
LoadImage(&tpagerect, (u_long*)specLoadBuffer);
1991+
break;
1992+
case 4:
19971993
SetupSpecCosmetics(specLoadBuffer);
19981994
SetupSpecDenting(specLoadBuffer + sizeof(CAR_COSMETICS));
1999-
2000-
if (quickSpool == 1)
2001-
return;
2002-
2003-
DrawSyncCallback(SpecialStartNextBlock);
2004-
return;
2005-
}
2006-
2007-
if (specialState != 1)
2008-
return;
2009-
2010-
spec_tpage = specialSlot;
2011-
tpagerect.w = 64;
2012-
tpagerect.h = 16;
2013-
2014-
tpagerect.x = tpagepos[spec_tpage].x;
2015-
tpagerect.y = tpagepos[spec_tpage].y + (15 - specBlocksToLoad) * 16;
2016-
2017-
if (specBlocksToLoad == 15)
2018-
update_slotinfo(specTpages[GameLevel][specspooldata[2]-1], spec_tpage, &tpagerect);
2019-
2020-
LoadImage(&tpagerect, (u_long *)specLoadBuffer);
1995+
break;
1996+
default:
1997+
printWarning("Tada: incorrect special state %d", specialState);
20211998
}
20221999

20232000
if (quickSpool != 1)

0 commit comments

Comments
 (0)