Skip to content

Commit f1be773

Browse files
committed
Start work on GolBmpFile and GolTgaFile
1 parent bdd14f5 commit f1be773

35 files changed

Lines changed: 1571 additions & 291 deletions

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,15 @@ option(RACERS_DECOMP_ASSERT "Assert struct size" ${MSVC_FOR_DECOMP})
7777
add_cxx_warning(parentheses)
7878

7979
set(COMMON_SOURCES
80+
common/src/golsurfaceformat.cpp
8081
common/src/golnametable.cpp
8182
common/src/golerror.cpp
8283
common/src/golfile.cpp
8384
common/src/golfsutil.cpp
85+
common/src/golimgfile.cpp
86+
common/src/golbmpfile.cpp
87+
common/src/goltgafile.cpp
88+
common/src/goldecompress.cpp
8489
common/src/golcpu.cpp
8590
common/src/golhashtable.cpp
8691
common/src/golstream.cpp
@@ -107,7 +112,6 @@ set(GOLDP_INLINE_EXPANSION_SOURCES
107112
GolDP/src/whitebaffoon0x50.cpp
108113
GolDP/src/whitefalcon0x140.cpp
109114
GolDP/src/duskwindbananarelic0x24.cpp
110-
GolDP/src/falcontextureformat.cpp
111115
GolDP/src/bronzefalconsurface0x5c.cpp
112116
GolDP/src/falcondunebag0x10.cpp
113117
GolDP/src/depthbuffer0x38.cpp
@@ -156,7 +160,6 @@ add_library(goldp SHARED
156160
GolDP/src/azureridge0x38.cpp
157161
GolDP/src/amberlensbase0x120.cpp
158162
GolDP/src/amberlens0x344.cpp
159-
GolDP/src/falcontextureformat.cpp
160163
GolDP/src/jadeorbit0x220.cpp
161164
GolDP/src/ddrawutil.cpp
162165
GolDP/src/jadeorbitbase0x10.cpp
@@ -186,7 +189,6 @@ add_library(goldp SHARED
186189
GolDP/src/softwarerenderer0x58.cpp
187190
GolDP/src/falcondunebag0x10.cpp
188191
GolDP/src/boundingshape0x2c.cpp
189-
GolDP/src/moonlitcanvas0x5b0.cpp
190192
util/decomp.cpp
191193
$<TARGET_OBJECTS:common_goldp>
192194
)

GolDP/include/bronzedune0x4c.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
class BronzeDune0x4c : public GoldDune0x38 {
1111
public:
1212
BronzeDune0x4c();
13-
~BronzeDune0x4c() override; // vtable+0x00
14-
IPalette0x4* GetPalette() override; // vtable+0x1c
15-
void VTable0x30(WhiteFalcon0x140& p_renderer, MoonlitCanvas0x5b0* p_source) override; // vtable+0x30
13+
~BronzeDune0x4c() override; // vtable+0x00
14+
IPalette0x4* GetPalette() override; // vtable+0x1c
15+
void VTable0x30(WhiteFalcon0x140& p_renderer, GolImgFile* p_source) override; // vtable+0x30
1616
void VTable0x34(
1717
WhiteFalcon0x140& p_renderer,
18-
const FalconTextureFormat& p_textureFormat,
18+
const GolSurfaceFormat& p_textureFormat,
1919
LegoU32 p_width,
2020
LegoU32 p_height
2121
) override; // vtable+0x34

GolDP/include/bronzedunebag0xc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class BronzeDuneBag0xc : public IPalette0x4 {
1919
LegoU32 GetPaletteSize() override; // vtable+0x
2020
virtual ~BronzeDuneBag0xc(); // vtable+0x00
2121

22-
void FUN_1002a120(const FalconTextureFormat& p_textureFormat);
22+
void FUN_1002a120(const GolSurfaceFormat& p_textureFormat);
2323
void FUN_1002a1b0();
2424

2525
bool HasEntries() const { return m_entries != NULL; }

GolDP/include/bronzefalcon0xc8770.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typedef void (BronzeFalcon0xc8770::*BronzeFalconDrawFunction)(undefined4, undefi
2424
class BronzeFalcon0xc8770 : public WhiteFalcon0x140 {
2525
public:
2626
// SIZE 0x18
27-
struct TextureFormat : public FalconTextureFormat {
27+
struct TextureFormat : public GolSurfaceFormat {
2828
TextureFormat();
2929
};
3030

@@ -38,8 +38,8 @@ class BronzeFalcon0xc8770 : public WhiteFalcon0x140 {
3838
void ReleaseResources() override; // vtable+0x04
3939
~BronzeFalcon0xc8770() override; // vtable+0x08
4040
void SelectTextureFormat(
41-
const FalconTextureFormat& p_requestedTextureFormat,
42-
FalconTextureFormat* p_actualTextureFormat,
41+
const GolSurfaceFormat& p_requestedTextureFormat,
42+
GolSurfaceFormat* p_actualTextureFormat,
4343
LegoBool32
4444
) override; // vtable+0x0c
4545
GolCommonDrawState* GetDrawState() override; // vtable+0x10

GolDP/include/color.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@ struct ColorRGBA {
1313
LegoU8 m_alp; // 0x03
1414
};
1515

16+
// SIZE: 0x3
17+
struct ColorBGR {
18+
LegoU8 m_blu; // 0x00
19+
LegoU8 m_grn; // 0x01
20+
LegoU8 m_red; // 0x02
21+
};
22+
1623
// SIZE: 0xc
1724
struct FColorRGB {
1825
LegoFloat m_red; // 0x00
1926
LegoFloat m_grn; // 0x04
2027
LegoFloat m_blu; // 0x08
2128
};
22-
2329
#endif // COLOR_H

GolDP/include/falcondunebag0x10.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "bronzedunebag0xc.h"
55
#include "decomp.h"
6-
#include "falcontextureformat.h"
6+
#include "golsurfaceformat.h"
77

88
#include <windows.h>
99

@@ -20,14 +20,14 @@ class FalconDuneBag0x10 : public BronzeDuneBag0xc {
2020
void FUN_10014770(undefined4*);
2121
void Destroy();
2222

23-
static void SetTextureFormat(const FalconTextureFormat& p_format);
23+
static void SetTextureFormat(const GolSurfaceFormat& p_format);
2424
// SYNTHETIC: GOLDP 0x100146e0
2525
// FalconDuneBag0x10::`scalar deleting destructor'
2626

2727
private:
2828
LegoU16* m_unk0x0c; // 0x0c
2929

30-
static FalconTextureFormat g_textureFormat;
30+
static GolSurfaceFormat g_textureFormat;
3131
};
3232

3333
#endif // FALCONDUNEBAG0X10_H

GolDP/include/golddune0x38.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "silverdune0x30.h"
55

66
class WhiteFalcon0x140;
7-
class MoonlitCanvas0x5b0;
7+
class GolImgFile;
88

99
// VTABLE: GOLDP 0x1005766c
1010
// SIZE 0x38
@@ -20,10 +20,10 @@ class GoldDune0x38 : public SilverDune0x30 {
2020
};
2121
GoldDune0x38();
2222

23-
virtual void VTable0x30(WhiteFalcon0x140& p_renderer, MoonlitCanvas0x5b0* p_source); // vtable+0x30
23+
virtual void VTable0x30(WhiteFalcon0x140& p_renderer, GolImgFile* p_source); // vtable+0x30
2424
virtual void VTable0x34(
2525
WhiteFalcon0x140& p_renderer,
26-
const FalconTextureFormat& p_textureFormat,
26+
const GolSurfaceFormat& p_textureFormat,
2727
LegoU32 p_width,
2828
LegoU32 p_height
2929
) = 0; // vtable+0x34

GolDP/include/magentaribbon0x20.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "golnametable.h"
55

66
class BronzeFalcon0xc8770;
7-
class FalconTextureFormat;
7+
class GolSurfaceFormat;
88
class GoldDune0x38;
99

1010
// VTABLE: GOLDP 0x100575ac
@@ -20,7 +20,7 @@ class MagentaRibbon0x20 : public GolNameTable {
2020
virtual void VTable0x14() = 0; // vtable+0x14
2121
virtual void VTable0x18(
2222
LegoU32 p_index,
23-
const FalconTextureFormat& p_textureFormat,
23+
const GolSurfaceFormat& p_textureFormat,
2424
LegoU32 p_width,
2525
LegoU32 p_height
2626
) = 0; // vtable+0x18

GolDP/include/moonlitcanvas0x5b0.h

Lines changed: 0 additions & 69 deletions
This file was deleted.

GolDP/include/pearldew0x0c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PearlDew0x0c : public IPalette0x4 {
3333
PearlDew0x0c();
3434
~PearlDew0x0c();
3535

36-
void CreateDirectDrawPalette(class BronzeFalcon0xc8770* p_renderer, class FalconTextureFormat* p_textureFormat);
36+
void CreateDirectDrawPalette(class BronzeFalcon0xc8770* p_renderer, class GolSurfaceFormat* p_textureFormat);
3737
void Release();
3838
void Set332PaletteEntries();
3939

0 commit comments

Comments
 (0)