Skip to content

Commit afa839d

Browse files
authored
Merge branch 'master' into implemement-BoundingVolume0x64
2 parents 6d0e2c8 + d86f067 commit afa839d

21 files changed

Lines changed: 92 additions & 92 deletions

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ add_library(goldp SHARED
161161
GolDP/src/goldrawdpstate.cpp
162162
GolDP/src/goldpexport.cpp
163163
GolDP/src/fluffygloomkins0x118.cpp
164-
GolDP/src/pearldew0x0c.cpp
164+
GolDP/src/directdrawpalette.cpp
165165
GolDP/src/goldevicelist.cpp
166166
GolDP/src/main.cpp
167167
GolDP/src/zoweeblubberworth0xf0.cpp

GolDP/include/bronzefalcon0xc8770.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class BronzeFalcon0xc8770 : public WhiteFalcon0x140 {
175175
// SYNTHETIC: GOLDP 0x10007960
176176
// BronzeFalcon0xc8770::`scalar deleting destructor'
177177

178-
friend class PearlDew0x0c;
178+
friend class DirectDrawPalette;
179179
friend class SlatePeak0x58;
180180
friend class BronzeFalconSurface0x5c;
181181

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef GOLDP_PEARLDEW0X0C_H
2-
#define GOLDP_PEARLDEW0X0C_H
1+
#ifndef GOLDP_DIRECTDRAWPALETTE_H
2+
#define GOLDP_DIRECTDRAWPALETTE_H
33

44
#include "compat.h"
55
#include "decomp.h"
@@ -10,7 +10,7 @@
1010

1111
// VTABLE: GOLDP 0x10056520
1212
// SIZE 0x0c
13-
class PearlDew0x0c : public IPalette0x4 {
13+
class DirectDrawPalette : public IPalette0x4 {
1414
public:
1515
enum {
1616
c_errorBufferSize = 128,
@@ -30,8 +30,8 @@ class PearlDew0x0c : public IPalette0x4 {
3030
c_332RedStride = c_332GreenLevels * c_332GreenStride
3131
};
3232

33-
PearlDew0x0c();
34-
~PearlDew0x0c();
33+
DirectDrawPalette();
34+
~DirectDrawPalette();
3535

3636
void CreateDirectDrawPalette(class BronzeFalcon0xc8770* p_renderer, class GolSurfaceFormat* p_textureFormat);
3737
void Release();
@@ -54,4 +54,4 @@ class PearlDew0x0c : public IPalette0x4 {
5454
LegoU16 m_entryCount; // 0x0a
5555
};
5656

57-
#endif // GOLDP_PEARLDEW0X0C_H
57+
#endif // GOLDP_DIRECTDRAWPALETTE_H

GolDP/include/falcondunebag0x10.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class FalconDuneBag0x10 : public BronzeDuneBag0xc {
1717
void CopyEntriesFrom(IPalette0x4* p_source) override; // vtable+0x04
1818
void SetEntries(ColorRGBA* p_entries, LegoU32 p_start, LegoU32 p_count) override; // vtable+0x08
1919

20-
void FUN_10014770(const GolSurfaceFormat& p_textureFormat);
20+
void Initialize(const GolSurfaceFormat& p_textureFormat);
2121
void Destroy();
2222

2323
LegoU16* GetMappedEntries() const { return m_unk0x0c; }

GolDP/include/silverdune0x30.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "rectangle.h"
77
#include "types.h"
88

9-
class PearlDew0x0c;
9+
class DirectDrawPalette;
1010
class IPalette0x4;
1111
class BronzeFalcon0xc8770;
1212

GolDP/include/slatepeak0x58.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "azureridge0x38.h"
55
#include "compat.h"
66
#include "depthbuffer0x38.h"
7-
#include "pearldew0x0c.h"
7+
#include "directdrawpalette.h"
88

99
class BronzeFalcon0xc8770;
1010

@@ -47,7 +47,7 @@ class SlatePeak0x58 : public AzureRidge0x38 {
4747
void DetachDepthBuffer(DepthBuffer0x38* p_depthBuffer);
4848
void SetDisplayPalette(BronzeFalcon0xc8770* p_renderer);
4949

50-
PearlDew0x0c m_palette; // 0x38
50+
DirectDrawPalette m_palette; // 0x38
5151
GolDrawState* m_drawState; // 0x44
5252
LPDIRECTDRAWSURFACE4 m_displaySurface; // 0x48
5353
LPDIRECTDRAWSURFACE4 m_renderSurface; // 0x4c

GolDP/src/bronzedunebag0xc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void BronzeDuneBag0xc::Initialize(const GolSurfaceFormat& p_textureFormat)
2828
if (m_entries != NULL) {
2929
m_size = 0;
3030
delete[] m_entries;
31-
m_entries = 0;
31+
m_entries = NULL;
3232
}
3333

3434
m_size = 1 << p_textureFormat.m_bitsPerPixel;
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
#include "pearldew0x0c.h"
1+
#include "directdrawpalette.h"
22

33
#include "bronzefalcon0xc8770.h"
44
#include "golerror.h"
55
#include "golsurfaceformat.h"
66

77
#include <stdio.h>
88

9-
DECOMP_SIZE_ASSERT(PearlDew0x0c, 0x0c)
9+
DECOMP_SIZE_ASSERT(DirectDrawPalette, 0x0c)
1010

1111
// GLOBAL: GOLDP 0x10063150
12-
PALETTEENTRY g_paletteEntries[PearlDew0x0c::c_paletteEntries8Bit];
12+
PALETTEENTRY g_paletteEntries[DirectDrawPalette::c_paletteEntries8Bit];
1313

1414
// FUNCTION: GOLDP 0x10007190
15-
PearlDew0x0c::PearlDew0x0c()
15+
DirectDrawPalette::DirectDrawPalette()
1616
{
1717
m_palette = NULL;
1818
m_firstEntry = 0;
1919
m_entryCount = 0;
2020
}
2121

2222
// FUNCTION: GOLDP 0x100071b0
23-
PearlDew0x0c::~PearlDew0x0c()
23+
DirectDrawPalette::~DirectDrawPalette()
2424
{
2525
if (m_palette) {
2626
m_palette->Release();
@@ -32,7 +32,7 @@ PearlDew0x0c::~PearlDew0x0c()
3232
}
3333

3434
// FUNCTION: GOLDP 0x100071e0
35-
void PearlDew0x0c::CreateDirectDrawPalette(BronzeFalcon0xc8770* p_renderer, GolSurfaceFormat* p_textureFormat)
35+
void DirectDrawPalette::CreateDirectDrawPalette(BronzeFalcon0xc8770* p_renderer, GolSurfaceFormat* p_textureFormat)
3636
{
3737
LegoChar buffer[c_errorBufferSize];
3838

@@ -133,7 +133,7 @@ void PearlDew0x0c::CreateDirectDrawPalette(BronzeFalcon0xc8770* p_renderer, GolS
133133
}
134134

135135
// FUNCTION: GOLDP 0x100073f0
136-
void PearlDew0x0c::Release()
136+
void DirectDrawPalette::Release()
137137
{
138138
if (m_palette) {
139139
m_palette->Release();
@@ -145,7 +145,7 @@ void PearlDew0x0c::Release()
145145
}
146146

147147
// FUNCTION: GOLDP 0x10007420
148-
void PearlDew0x0c::GetEntries(ColorRGBA* p_entries, LegoU32 p_start, LegoU32 p_count)
148+
void DirectDrawPalette::GetEntries(ColorRGBA* p_entries, LegoU32 p_start, LegoU32 p_count)
149149
{
150150
LegoChar buffer[c_errorBufferSize];
151151

@@ -182,7 +182,7 @@ void PearlDew0x0c::GetEntries(ColorRGBA* p_entries, LegoU32 p_start, LegoU32 p_c
182182
}
183183

184184
// FUNCTION: GOLDP 0x10007500
185-
void PearlDew0x0c::SetEntries(ColorRGBA* p_entries, LegoU32 p_start, LegoU32 p_count)
185+
void DirectDrawPalette::SetEntries(ColorRGBA* p_entries, LegoU32 p_start, LegoU32 p_count)
186186
{
187187
LegoChar buffer[c_errorBufferSize];
188188

@@ -201,7 +201,7 @@ void PearlDew0x0c::SetEntries(ColorRGBA* p_entries, LegoU32 p_start, LegoU32 p_c
201201
}
202202

203203
// FUNCTION: GOLDP 0x100075b0
204-
void PearlDew0x0c::GetEntry(ColorRGBA* p_entry, LegoU32 p_index)
204+
void DirectDrawPalette::GetEntry(ColorRGBA* p_entry, LegoU32 p_index)
205205
{
206206
PALETTEENTRY entry;
207207
LegoChar buffer[c_errorBufferSize];
@@ -219,7 +219,7 @@ void PearlDew0x0c::GetEntry(ColorRGBA* p_entry, LegoU32 p_index)
219219
}
220220

221221
// FUNCTION: GOLDP 0x10007620
222-
void PearlDew0x0c::CopyEntriesFrom(IPalette0x4* p_source)
222+
void DirectDrawPalette::CopyEntriesFrom(IPalette0x4* p_source)
223223
{
224224
ColorRGBA entry;
225225
LegoChar buffer[c_errorBufferSize];
@@ -241,7 +241,7 @@ void PearlDew0x0c::CopyEntriesFrom(IPalette0x4* p_source)
241241
}
242242

243243
// FUNCTION: GOLDP 0x100076d0
244-
LegoS32 PearlDew0x0c::FindEntry(const ColorRGBA& p_entry)
244+
LegoS32 DirectDrawPalette::FindEntry(const ColorRGBA& p_entry)
245245
{
246246
DWORD caps;
247247
LegoChar buffer[c_errorBufferSize];
@@ -280,19 +280,19 @@ LegoS32 PearlDew0x0c::FindEntry(const ColorRGBA& p_entry)
280280
}
281281

282282
// FUNCTION: GOLDP 0x100077b0
283-
LegoU32 PearlDew0x0c::GetFirstEntry()
283+
LegoU32 DirectDrawPalette::GetFirstEntry()
284284
{
285285
return m_firstEntry;
286286
}
287287

288288
// FUNCTION: GOLDP 0x100077c0
289-
LegoU32 PearlDew0x0c::GetEntryCount()
289+
LegoU32 DirectDrawPalette::GetEntryCount()
290290
{
291291
return m_entryCount;
292292
}
293293

294294
// FUNCTION: GOLDP 0x100077d0
295-
LegoU32 PearlDew0x0c::GetPaletteSize()
295+
LegoU32 DirectDrawPalette::GetPaletteSize()
296296
{
297297
if (m_entryCount == c_paletteEntries8BitUsable) {
298298
return c_paletteEntries8Bit;
@@ -302,7 +302,7 @@ LegoU32 PearlDew0x0c::GetPaletteSize()
302302
}
303303

304304
// STUB: GOLDP 0x100077f0
305-
void PearlDew0x0c::Set332PaletteEntries()
305+
void DirectDrawPalette::Set332PaletteEntries()
306306
{
307307
LegoChar buffer[c_errorBufferSize];
308308

GolDP/src/falcondunebag0x10.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ FalconDuneBag0x10::~FalconDuneBag0x10()
2020
}
2121

2222
// FUNCTION: GOLDP 0x10014770
23-
void FalconDuneBag0x10::FUN_10014770(const GolSurfaceFormat& p_textureFormat)
23+
void FalconDuneBag0x10::Initialize(const GolSurfaceFormat& p_textureFormat)
2424
{
2525
if (m_entries != NULL) {
2626
if (m_unk0x0c != NULL) {
@@ -31,7 +31,7 @@ void FalconDuneBag0x10::FUN_10014770(const GolSurfaceFormat& p_textureFormat)
3131
Shutdown();
3232
}
3333

34-
Initialize(p_textureFormat);
34+
BronzeDuneBag0xc::Initialize(p_textureFormat);
3535

3636
m_unk0x0c = new LegoU16[m_size];
3737
if (m_unk0x0c == NULL) {

GolDP/src/purpledune0x7c.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
#include "bronzefalcon0xc8770.h"
44
#include "ddrawutil.h"
5+
#include "directdrawpalette.h"
56
#include "falcondunebag0x10.h"
67
#include "golcommondrawstate.h"
78
#include "golerror.h"
89
#include "golimgfile.h"
9-
#include "pearldew0x0c.h"
1010

1111
#include <stdio.h>
1212
#include <string.h>
@@ -404,11 +404,11 @@ void PurpleDune0x7c::FUN_10016380()
404404
}
405405
else {
406406
if (palette != NULL) {
407-
static_cast<PearlDew0x0c*>(palette)->Release();
407+
static_cast<DirectDrawPalette*>(palette)->Release();
408408

409409
palette = m_palette;
410410
if (palette != NULL) {
411-
delete static_cast<PearlDew0x0c*>(palette);
411+
delete static_cast<DirectDrawPalette*>(palette);
412412
}
413413

414414
m_palette = NULL;
@@ -528,11 +528,11 @@ void PurpleDune0x7c::FUN_100165c0(GolCommonDrawState* p_drawState, BronzeFalcon0
528528
break;
529529
}
530530

531-
if ((m_palette = new PearlDew0x0c) == NULL) {
531+
if ((m_palette = new DirectDrawPalette) == NULL) {
532532
GOL_FATALERROR(c_golErrorOutOfMemory);
533533
}
534534

535-
static_cast<PearlDew0x0c*>(m_palette)->CreateDirectDrawPalette(&p_renderer, &m_textureFormat2);
535+
static_cast<DirectDrawPalette*>(m_palette)->CreateDirectDrawPalette(&p_renderer, &m_textureFormat2);
536536
}
537537
else {
538538
surfaceDesc.ddpfPixelFormat.dwRGBBitCount = m_textureFormat2.m_bitsPerPixel;
@@ -597,7 +597,7 @@ void PurpleDune0x7c::FUN_100165c0(GolCommonDrawState* p_drawState, BronzeFalcon0
597597
}
598598
}
599599
else {
600-
result = m_surface->SetPalette(static_cast<PearlDew0x0c*>(m_palette)->GetPalette());
600+
result = m_surface->SetPalette(static_cast<DirectDrawPalette*>(m_palette)->GetPalette());
601601
if (result) {
602602
LegoChar errorMessage[64];
603603
::sprintf(errorMessage, "Unable to set texture palette\nerror %x", result);
@@ -659,7 +659,7 @@ void PurpleDune0x7c::FUN_100168c0(BronzeFalcon0xc8770& p_renderer)
659659
GOL_FATALERROR(c_golErrorOutOfMemory);
660660
}
661661

662-
static_cast<FalconDuneBag0x10*>(m_palette)->FUN_10014770(m_textureFormat2);
662+
static_cast<FalconDuneBag0x10*>(m_palette)->Initialize(m_textureFormat2);
663663
mipmap->m_paletteData = static_cast<FalconDuneBag0x10*>(m_palette)->m_unk0x0c;
664664
}
665665
else {

0 commit comments

Comments
 (0)