1
0
mirror of https://github.com/jummy0/sb2-decomp synced 2025-03-14 20:23:30 +01:00

PIXTABLES

This commit is contained in:
jummy 2024-09-11 12:26:02 -05:00
parent cd3e7366b4
commit 45038d6ce5
4 changed files with 1266 additions and 70 deletions

View File

@ -23,7 +23,8 @@
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{e424a3cb-c8b8-447c-be63-41a57e65b449}</ProjectGuid>
<RootNamespace>SpeedyEggbert2Source</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>
</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -74,10 +75,10 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WINVER=0x400;WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>dxsdk3\sdk\inc</AdditionalIncludeDirectories>
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions>
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE;_WIN32_WINNT;NTDDI_VERSION</UndefinePreprocessorDefinitions>
<PrecompiledHeaderFile />
</ClCompile>
<Link>
@ -98,10 +99,10 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WINVER=0x400;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>dxsdk3\sdk\inc</AdditionalIncludeDirectories>
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions>
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE;_WIN32_WINNT;NTDDI_VERSION</UndefinePreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -119,10 +120,10 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WINVER=0x400;WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>dxsdk3\sdk\inc</AdditionalIncludeDirectories>
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions>
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE;_WIN32_WINNT;NTDDI_VERSION</UndefinePreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -141,10 +142,10 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WINVER=0x400;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>dxsdk3\sdk\inc</AdditionalIncludeDirectories>
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions>
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE;_WIN32_WINNT;NTDDI_VERSION</UndefinePreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -315,42 +315,42 @@ void CPixmap::QuickIcon(int channel, int rank, POINT pos)
if (channel == CHOBJECT)
{
if (table_icon_object[0] <= rank) return;
rect.left = table_icon_object[rank * 6 + 0];
rect.top = table_icon_object[rank * 6 + 1];
rect.right = rect.left + table_icon_object[rank * 6 + 4];
rect.bottom = rect.top + table_icon_object[rank * 6 + 5];
pos.x += table_icon_object[rank * 6 + 2];
pos.y += table_icon_object[rank * 6 + 3];
rect.left = table_icon_object[rank * 6 + 0 + 1];
rect.top = table_icon_object[rank * 6 + 1 + 1];
rect.right = rect.left + table_icon_object[rank * 6 + 4 + 1];
rect.bottom = rect.top + table_icon_object[rank * 6 + 5 + 1];
pos.x += table_icon_object[rank * 6 + 2 + 1];
pos.y += table_icon_object[rank * 6 + 3 + 1];
}
else if (channel == CHELEMENT)
{
if (table_icon_element[0] <= rank) return;
rect.left = table_icon_element[rank * 6 + 0];
rect.top = table_icon_element[rank * 6 + 1];
rect.right = rect.left + table_icon_element[rank * 6 + 4];
rect.bottom = rect.top + table_icon_element[rank * 6 + 5];
pos.x += table_icon_element[rank * 6 + 2];
pos.y += table_icon_element[rank * 6 + 3];
rect.left = table_icon_element[rank * 6 + 0 + 1];
rect.top = table_icon_element[rank * 6 + 1 + 1];
rect.right = rect.left + table_icon_element[rank * 6 + 4 + 1];
rect.bottom = rect.top + table_icon_element[rank * 6 + 5 + 1];
pos.x += table_icon_element[rank * 6 + 2 + 1];
pos.y += table_icon_element[rank * 6 + 3 + 1];
}
else if (IsBlupiChannel(channel))
{
if (table_icon_blupi[0] <= rank) return;
rect.left = table_icon_blupi[rank * 6 + 0];
rect.top = table_icon_blupi[rank * 6 + 1];
rect.right = rect.left + table_icon_blupi[rank * 6 + 4];
rect.bottom = rect.top + table_icon_blupi[rank * 6 + 5];
pos.x += table_icon_blupi[rank * 6 + 2];
pos.y += table_icon_blupi[rank * 6 + 3];
rect.left = table_icon_blupi[rank * 6 + 0 + 1];
rect.top = table_icon_blupi[rank * 6 + 1 + 1];
rect.right = rect.left + table_icon_blupi[rank * 6 + 4 + 1];
rect.bottom = rect.top + table_icon_blupi[rank * 6 + 5 + 1];
pos.x += table_icon_blupi[rank * 6 + 2 + 1];
pos.y += table_icon_blupi[rank * 6 + 3 + 1];
}
else if (channel == CHEXPLO)
{
if (table_icon_explo[0] <= rank) return;
rect.left = table_icon_explo[rank * 6 + 0];
rect.top = table_icon_explo[rank * 6 + 1];
rect.right = rect.left + table_icon_explo[rank * 6 + 4];
rect.bottom = rect.top + table_icon_explo[rank * 6 + 5];
pos.x += table_icon_explo[rank * 6 + 2];
pos.y += table_icon_explo[rank * 6 + 3];
rect.left = table_icon_explo[rank * 6 + 0 + 1];
rect.top = table_icon_explo[rank * 6 + 1 + 1];
rect.right = rect.left + table_icon_explo[rank * 6 + 4 + 1];
rect.bottom = rect.top + table_icon_explo[rank * 6 + 5 + 1];
pos.x += table_icon_explo[rank * 6 + 2 + 1];
pos.y += table_icon_explo[rank * 6 + 3 + 1];
}
else
{
@ -1223,42 +1223,42 @@ BOOL CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos,
if (channel == CHOBJECT)
{
if (table_icon_object[0] <= rank) return FALSE;
rect.left = table_icon_object[rank * 6 + 0];
rect.top = table_icon_object[rank * 6 + 1];
rect.right = rect.left + table_icon_object[rank * 6 + 4];
rect.bottom = rect.top + table_icon_object[rank * 6 + 5];
pos.x += table_icon_object[rank * 6 + 2];
pos.y += table_icon_object[rank * 6 + 3];
rect.left = table_icon_object[rank * 6 + 0 + 1];
rect.top = table_icon_object[rank * 6 + 1 + 1];
rect.right = rect.left + table_icon_object[rank * 6 + 4 + 1];
rect.bottom = rect.top + table_icon_object[rank * 6 + 5 + 1];
pos.x += table_icon_object[rank * 6 + 2 + 1];
pos.y += table_icon_object[rank * 6 + 3 + 1];
}
else if (channel == CHELEMENT)
{
if (table_icon_element[0] <= rank) return FALSE;
rect.left = table_icon_element[rank * 6 + 0];
rect.top = table_icon_element[rank * 6 + 1];
rect.right = rect.left + table_icon_element[rank * 6 + 4];
rect.bottom = rect.top + table_icon_element[rank * 6 + 5];
pos.x += table_icon_element[rank * 6 + 2];
pos.y += table_icon_element[rank * 6 + 3];
rect.left = table_icon_element[rank * 6 + 0 + 1];
rect.top = table_icon_element[rank * 6 + 1 + 1];
rect.right = rect.left + table_icon_element[rank * 6 + 4 + 1];
rect.bottom = rect.top + table_icon_element[rank * 6 + 5 + 1];
pos.x += table_icon_element[rank * 6 + 2 + 1];
pos.y += table_icon_element[rank * 6 + 3 + 1];
}
else if (IsBlupiChannel(channel))
{
if (table_icon_blupi[0] <= rank) return FALSE;
rect.left = table_icon_blupi[rank * 6 + 0];
rect.top = table_icon_blupi[rank * 6 + 1];
rect.right = rect.left + table_icon_blupi[rank * 6 + 4];
rect.bottom = rect.top + table_icon_blupi[rank * 6 + 5];
pos.x += table_icon_blupi[rank * 6 + 2];
pos.y += table_icon_blupi[rank * 6 + 3];
rect.left = table_icon_blupi[rank * 6 + 0 + 1];
rect.top = table_icon_blupi[rank * 6 + 1 + 1];
rect.right = rect.left + table_icon_blupi[rank * 6 + 4 + 1];
rect.bottom = rect.top + table_icon_blupi[rank * 6 + 5 + 1];
pos.x += table_icon_blupi[rank * 6 + 2 + 1];
pos.y += table_icon_blupi[rank * 6 + 3 + 1];
}
else if (channel == CHEXPLO)
{
if (table_icon_explo[0] <= rank) return FALSE;
rect.left = table_icon_explo[rank * 6 + 0];
rect.top = table_icon_explo[rank * 6 + 1];
rect.right = rect.left + table_icon_explo[rank * 6 + 4];
rect.bottom = rect.top + table_icon_explo[rank * 6 + 5];
pos.x += table_icon_explo[rank * 6 + 2];
pos.y += table_icon_explo[rank * 6 + 3];
rect.left = table_icon_explo[rank * 6 + 0 + 1];
rect.top = table_icon_explo[rank * 6 + 1 + 1];
rect.right = rect.left + table_icon_explo[rank * 6 + 4 + 1];
rect.bottom = rect.top + table_icon_explo[rank * 6 + 5 + 1];
pos.x += table_icon_explo[rank * 6 + 2 + 1];
pos.y += table_icon_explo[rank * 6 + 3 + 1];
}
else
{

File diff suppressed because it is too large Load Diff

31
util/extract_pixtables.py Normal file
View File

@ -0,0 +1,31 @@
# JUMMY WAS HERE
# extract pixtables from speedy blupi 2.2 english ver
import sys
import io
offsets = {}
offsets['table_icon_blupi'] = 0x81bf8
offsets['table_icon_element'] = 0x84070
offsets['table_icon_explo'] = 0x84e00
offsets['table_icon_object'] = 0x82bc0
outs = {}
with io.open('BLUPI.exe', 'rb') as f:
data = f.read()
for k, v in offsets.items():
lg = int.from_bytes(data[v : v + 2], 'little')
outs[k] = []
outs[k].append("extern short " + k + "[]{");
outs[k].append(str(lg) + ',');
for i in range(lg):
string = ''
for j in range(6):
string += str(int.from_bytes(data[v + i*12 + j*2 + 2 : v + i*12 + j*2 + 4], 'little')) + ','
if j % 2 == 1:
string += ' '
outs[k].append(string)
outs[k].append('};')
with io.open('out.h', 'wb') as f2:
f2.write(bytearray(('\n\n'.join(['\n'.join(w) for w in [v for _, v in outs.items()]])), 'ascii'))