Skip to content

Commit

Permalink
splash ready.
Browse files Browse the repository at this point in the history
All subs ready, phase 1 complete.
  • Loading branch information
oz authored and oz committed Jan 29, 2021
1 parent 262b098 commit 6756c54
Show file tree
Hide file tree
Showing 9 changed files with 390 additions and 81 deletions.
Binary file modified Doc/FuncStats.xlsx
Binary file not shown.
8 changes: 8 additions & 0 deletions SpaceCadetPinball/SpaceCadetPinball.rc
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,14 @@ BEGIN
END


/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//

splash_bitmap BITMAP "splash_bitmap.bmp"


/////////////////////////////////////////////////////////////////////////////
//
// String Table
Expand Down
3 changes: 3 additions & 0 deletions SpaceCadetPinball/SpaceCadetPinball.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
<ClInclude Include="resource.h" />
<ClInclude Include="score.h" />
<ClInclude Include="Sound.h" />
<ClInclude Include="splash.h" />
<ClInclude Include="TBall.h" />
<ClInclude Include="TBlocker.h" />
<ClInclude Include="TBumper.h" />
Expand Down Expand Up @@ -247,6 +248,7 @@
<ClCompile Include="score.cpp" />
<ClCompile Include="Sound.cpp" />
<ClCompile Include="SpaceCadetPinball.cpp" />
<ClCompile Include="splash.cpp" />
<ClCompile Include="TBall.cpp" />
<ClCompile Include="TBlocker.cpp" />
<ClCompile Include="TBumper.cpp" />
Expand Down Expand Up @@ -302,6 +304,7 @@
</ItemGroup>
<ItemGroup>
<Image Include="Icon_1.ico" />
<Image Include="splash_bitmap.bmp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
9 changes: 9 additions & 0 deletions SpaceCadetPinball/SpaceCadetPinball.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@
<ClInclude Include="WaveMix.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="splash.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
Expand Down Expand Up @@ -416,6 +419,9 @@
<ClCompile Include="WaveMix.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="splash.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Natvis Include="NatvisFile.natvis" />
Expand All @@ -434,5 +440,8 @@
<Image Include="Icon_1.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="splash_bitmap.bmp">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>
112 changes: 36 additions & 76 deletions SpaceCadetPinball/loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "zdrv.h"


errorMsg loader::loader_errors[] =
errorMsg loader::loader_errors[] =
{
errorMsg{0, "Bad Handle"},
errorMsg{1, "No Type Field"},
Expand Down Expand Up @@ -365,15 +365,6 @@ int loader::kicker(int groupIndex, visualKickerStruct* kicker)

int loader::query_visual(int groupIndex, int groupIndexOffset, visualStruct* visual)
{
int shortVal;
__int16* nextShortVal;
int shortValSub100;
int shortValSub300;
int shortValSub304;
int shortValSub602;
int shortValSub1100;
int shortValSub1101;

default_vsi(visual);
if (groupIndex < 0)
return error(0, 18);
Expand All @@ -396,75 +387,44 @@ int loader::query_visual(int groupIndex, int groupIndexOffset, visualStruct* vis
unsigned int shortArrSize = partman::field_size(loader_table, stateId, datFieldTypes::ShortArray);
for (auto index = 0u; index < shortArrSize / 2;)
{
shortVal = *shortArr;
nextShortVal = shortArr + 1;
if (shortVal <= 406)
{
if (shortVal == 406)
{
visual->Kicker.HardHitSoundId = get_sound_id(*nextShortVal);
}
else
{
shortValSub100 = shortVal - 100;
if (shortValSub100)
{
shortValSub300 = shortValSub100 - 200;
if (shortValSub300)
{
shortValSub304 = shortValSub300 - 4;
if (shortValSub304)
{
if (shortValSub304 != 96)
return error(9, 18);
if (kicker(*nextShortVal, &visual->Kicker))
return error(14, 18);
}
else
{
visual->SoftHitSoundId = get_sound_id(*nextShortVal);
}
}
else if (material(*nextShortVal, visual))
{
return error(15, 18);
}
}
else if (groupIndexOffset)
{
return error(7, 18);
}
}
goto LABEL_31;
}
shortValSub602 = shortVal - 602;
if (!shortValSub602)
{
visual->CollisionGroup |= 1 << *nextShortVal;
goto LABEL_31;
}
shortValSub1100 = shortValSub602 - 498;
if (!shortValSub1100)
switch (shortArr[0])
{
visual->SoundIndex4 = get_sound_id(*nextShortVal);
goto LABEL_31;
}
shortValSub1101 = shortValSub1100 - 1;
if (!shortValSub1101)
{
visual->SoundIndex3 = get_sound_id(*nextShortVal);
LABEL_31:
shortArr = nextShortVal + 1;
index = index + 2;
goto LABEL_32;
}
if (shortValSub1101 != 399)
case 100:
if (groupIndexOffset)
return error(7, 18);
break;
case 300:
if (material(shortArr[1], visual))
return error(15, 18);
break;
case 304:
visual->SoftHitSoundId = get_sound_id(shortArr[1]);
break;
case 400:
if (kicker(shortArr[1], &visual->Kicker))
return error(14, 18);
break;
case 406:
visual->Kicker.HardHitSoundId = get_sound_id(shortArr[1]);
break;
case 602:
visual->CollisionGroup |= 1 << shortArr[1];
break;
case 1100:
visual->SoundIndex4 = get_sound_id(shortArr[1]);
break;
case 1101:
visual->SoundIndex3 = get_sound_id(shortArr[1]);
break;
case 1500:
shortArr += 7;
index += 7;
break;
default:
return error(9, 18);
shortArr = nextShortVal + 8;
index = index + 9;
LABEL_32:
{
}
shortArr += 2;
index += 2;
}
}

Expand Down
Loading

0 comments on commit 6756c54

Please sign in to comment.