coastline 0.0.4
Loading...
Searching...
No Matches
paintshop.h File Reference

The paint shop, where the players paint decals, and the saving and loading of decals on the controller pak. More...

#include <PR/ultratypes.h>
#include "common/vecmath.h"
#include "common/vehicle.h"
#include "decaleditor.h"
#include "sprite.h"
Include dependency graph for paintshop.h:

Go to the source code of this file.

Macros

#define PAK_DIALOG_CANCELLED   999
 The result of the dialog of the controller pak when the player cancels it.
#define PAK_ERROR_RUMBLE_PAK   9999
 The error of the dialog of the controller pak while it waits for the rumble pak to go.
#define PAK_ERROR_TRANSFER   99999
 The error of a transfer of decals that the controller pak rejected as invalid.
#define DECAL_BUFFER_SIZE   0x800
 The bytes of the texels of a decal, at 4 bits a texel.

Functions

void RenderDecalPreview3D (void)
 Draw the car beside the decal, turning to the decal slot when it changes.
void ProcessPaintShopScreen (void)
 Run one frame of the paint shop.
void ResetPaintShopState (void)
 Set the tools, the colors, and the cursor back to their state on entering the paint shop.
void DrawPakErrorMessage (s32 error, u8 operation, u8 inCarSelect)
 Draw the message of an error of the controller pak in a box.
void ProcessFillClearMenu (void)
 Run one frame of the menu of the clear tool.
void ProcessMirrorFlipMenu (void)
 Run one frame of the menu of the mirror tool.
void MirrorDecalToOppositePanel (void)
 Copy the decal being painted mirrored to the slot on the other side of the car, and paint that slot next.
void FlipDecalPixels (void)
 Flip the decal being painted by the choice of the menu of the mirror tool.
void AllocateEditorBuffers (void)
 Allocate the buffer of the decals and load the textures of the A and B buttons.
s32 ProcessDecalSaveLoad (VehicleModel *model, u8 player, u8 operation, u8 inCarSelect, u8 *done)
 Run one frame of the dialog that loads the decals of a model from the controller pak or saves them to it.

Variables

Sprite g_texPaintWholeCar
 The picture of a whole car on the menu of the clear tool.
Sprite g_texPanelLeftDoor
 The buttons of the decal panels.
Sprite g_texPanel8Overlay
 The lights drawn over the buttons of panels 8 and 9.
Sprite g_texBrushSizeRound
 The brush sizes of the round brush, top to bottom.
Sprite g_texBrushSizeSquare
 The brush sizes of the square brush.
Sprite g_texPaintToolMirror
 The button of the mirror; its style is the choice of its menu, 0 to mirror, 1 to flip horizontally, and 2 to flip vertically.
Sprite g_texKeyboardPanel
 The keyboard of the text tool.
Sprite g_texKeyboardBackground
 The backing of the keys of the keyboard.
Sprite * g_apPaintToolIcons [PAINT_TOOLS]
 The pictures of the buttons of the paint shop, by their PAINT_TOOL_ values.
u16 g_awPaintShopButtonPalette [16]
 The palette of the pictures of the buttons of the paint shop, read from the cartridge.
u8 * g_pDecalUndoBuffer
 The texels of the decal before the last edit.
u8 g_bKeyboardHoverKey
 The key under the cursor.
u8 g_bShowPreview3D
 Whether the car is drawn beside the decal.
u8 g_bUndoAvailable
 Whether the undo buffer has an edit.
u8 g_bEyedropperActive
 Whether the B button picks the color under the cursor.
Vec3f s_aPanelViewDirections [DECAL_SLOTS]
 The forward axis of the car that shows each decal slot.
u8 * s_pMirrorSource
 The texels of the decal a mirror copies from.
u8 g_bPakFileNeedsCreate
 Whether the file of the decals is created first.
s32 g_dwPakFileOffset
 Where the next chunk of the file of the decals is.
u8 g_bMirrorTargetPanel
 The slot a mirror copies the decal to.
u8 g_bPakRumbleSwapped
 Whether the rumble pak was swapped for the controller pak.
s32 g_dwPakChunkSize
 The bytes of the chunk last moved.
u8 g_bPakDecalIndex
 The decal being moved.
char g_szDecalText [24]
 The text typed.

Detailed Description

The paint shop, where the players paint decals, and the saving and loading of decals on the controller pak.

Macro Definition Documentation

◆ PAK_DIALOG_CANCELLED

#define PAK_DIALOG_CANCELLED   999

The result of the dialog of the controller pak when the player cancels it.

◆ PAK_ERROR_RUMBLE_PAK

#define PAK_ERROR_RUMBLE_PAK   9999

The error of the dialog of the controller pak while it waits for the rumble pak to go.

◆ PAK_ERROR_TRANSFER

#define PAK_ERROR_TRANSFER   99999

The error of a transfer of decals that the controller pak rejected as invalid.

◆ DECAL_BUFFER_SIZE

#define DECAL_BUFFER_SIZE   0x800

The bytes of the texels of a decal, at 4 bits a texel.

Function Documentation

◆ RenderDecalPreview3D()

void RenderDecalPreview3D ( void )

Draw the car beside the decal, turning to the decal slot when it changes.

Ghidra address:
USA: 0x80242bdc
Ghidra address:
Asia: 0x8024272C
Ghidra address:
EUR: 0x802440ec
Ghidra address:
JPN: 0x80243bcc

◆ ProcessPaintShopScreen()

void ProcessPaintShopScreen ( void )

Run one frame of the paint shop.

Ghidra address:
USA: 0x80243260
Ghidra address:
Asia: 0x80242DB0
Ghidra address:
EUR: 0x80244770
Ghidra address:
JPN: 0x80244250

◆ ResetPaintShopState()

void ResetPaintShopState ( void )

Set the tools, the colors, and the cursor back to their state on entering the paint shop.

Ghidra address:
USA: 0x80244ba8
Ghidra address:
Asia: 0x802446F8
Ghidra address:
EUR: 0x802460cc
Ghidra address:
JPN: 0x80245bc0

◆ DrawPakErrorMessage()

void DrawPakErrorMessage ( s32 error,
u8 operation,
u8 inCarSelect )

Draw the message of an error of the controller pak in a box.

Parameters
errorThe error, a PFS_ERR_ value or PAK_ERROR_TRANSFER.
operationPAINT_TOOL_LOAD or PAINT_TOOL_SAVE.
inCarSelect1 when the dialog runs on the car select screen.
Ghidra address:
USA: 0x80244d84
Ghidra address:
Asia: 0x802448D4
Ghidra address:
EUR: 0x802462a8
Ghidra address:
JPN: 0x80245d9c

◆ ProcessFillClearMenu()

void ProcessFillClearMenu ( void )

Run one frame of the menu of the clear tool.

Ghidra address:
USA: 0x80247b0c
Ghidra address:
Asia: 0x8024765C
Ghidra address:
EUR: 0x802491bc
Ghidra address:
JPN: 0x80248cf4

◆ ProcessMirrorFlipMenu()

void ProcessMirrorFlipMenu ( void )

Run one frame of the menu of the mirror tool.

Ghidra address:
USA: 0x8024843c
Ghidra address:
Asia: 0x80247F8C
Ghidra address:
EUR: 0x80249aec
Ghidra address:
JPN: 0x80249630

◆ MirrorDecalToOppositePanel()

void MirrorDecalToOppositePanel ( void )

Copy the decal being painted mirrored to the slot on the other side of the car, and paint that slot next.

Ghidra address:
USA: 0x80248b80
Ghidra address:
Asia: 0x802486D0
Ghidra address:
EUR: 0x8024a164
Ghidra address:
JPN: 0x80249c9c

◆ FlipDecalPixels()

void FlipDecalPixels ( void )

Flip the decal being painted by the choice of the menu of the mirror tool.

Ghidra address:
USA: 0x80248db4
Ghidra address:
Asia: 0x80248904
Ghidra address:
EUR: 0x8024a398
Ghidra address:
JPN: 0x80249ed0

◆ AllocateEditorBuffers()

void AllocateEditorBuffers ( void )

Allocate the buffer of the decals and load the textures of the A and B buttons.

Ghidra address:
USA: 0x80248f38
Ghidra address:
Asia: 0x80248A88
Ghidra address:
EUR: 0x8024a51c
Ghidra address:
JPN: 0x8024a054

◆ ProcessDecalSaveLoad()

s32 ProcessDecalSaveLoad ( VehicleModel * model,
u8 player,
u8 operation,
u8 inCarSelect,
u8 * done )

Run one frame of the dialog that loads the decals of a model from the controller pak or saves them to it.

Parameters
modelThe model the decals are loaded onto or saved from.
playerThe controller of the pak.
operationPAINT_TOOL_LOAD or PAINT_TOOL_SAVE.
inCarSelect1 when the dialog runs on the car select screen.
doneSet once the dialog is done.
Returns
0 while it runs and once the decals are moved, PAK_DIALOG_CANCELLED when the player cancels the swap of the rumble pak on the car select screen, or an error.
Ghidra address:
USA: 0x80248f88
Ghidra address:
Asia: 0x80248AD8
Ghidra address:
EUR: 0x8024a56c
Ghidra address:
JPN: 0x8024a094

Variable Documentation

◆ g_texPaintWholeCar

Sprite g_texPaintWholeCar
extern

The picture of a whole car on the menu of the clear tool.

Ghidra address:
USA: 0x8028cba0
Ghidra address:
Asia: 0x8028C6F0
Ghidra address:
EUR: 0x8028f300
Ghidra address:
JPN: 0x8028ed50

◆ g_texPanelLeftDoor

Sprite g_texPanelLeftDoor
extern

The buttons of the decal panels.

Ghidra address:
USA: 0x8028cbd0
Ghidra address:
Asia: 0x8028C720
Ghidra address:
EUR: 0x8028f330
Ghidra address:
JPN: 0x8028ed80

◆ g_texPanel8Overlay

Sprite g_texPanel8Overlay
extern

The lights drawn over the buttons of panels 8 and 9.

Ghidra address:
USA: 0x8028cdb0
Ghidra address:
Asia: 0x8028C900
Ghidra address:
EUR: 0x8028f510
Ghidra address:
JPN: 0x8028ef60

◆ g_texBrushSizeRound

Sprite g_texBrushSizeRound
extern

The brush sizes of the round brush, top to bottom.

Ghidra address:
USA: 0x8028ce10
Ghidra address:
Asia: 0x8028C960
Ghidra address:
EUR: 0x8028f570
Ghidra address:
JPN: 0x8028efc0

◆ g_texBrushSizeSquare

Sprite g_texBrushSizeSquare
extern

The brush sizes of the square brush.

Ghidra address:
USA: 0x8028ce40
Ghidra address:
Asia: 0x8028C990
Ghidra address:
EUR: 0x8028f5a0
Ghidra address:
JPN: 0x8028eff0

◆ g_texPaintToolMirror

Sprite g_texPaintToolMirror
extern

The button of the mirror; its style is the choice of its menu, 0 to mirror, 1 to flip horizontally, and 2 to flip vertically.

Ghidra address:
USA: 0x8028cf90
Ghidra address:
Asia: 0x8028CAE0
Ghidra address:
EUR: 0x8028f6f0
Ghidra address:
JPN: 0x8028f160

◆ g_texKeyboardPanel

Sprite g_texKeyboardPanel
extern

The keyboard of the text tool.

Ghidra address:
USA: 0x8028d230
Ghidra address:
Asia: 0x8028CD80
Ghidra address:
EUR: 0x8028f990
Ghidra address:
JPN: 0x8028f400

◆ g_texKeyboardBackground

Sprite g_texKeyboardBackground
extern

The backing of the keys of the keyboard.

Ghidra address:
USA: 0x8028d260
Ghidra address:
Asia: 0x8028CDB0
Ghidra address:
EUR: 0x8028f9c0
Ghidra address:
JPN: 0x8028f430

◆ g_apPaintToolIcons

Sprite* g_apPaintToolIcons[PAINT_TOOLS]
extern

The pictures of the buttons of the paint shop, by their PAINT_TOOL_ values.

Ghidra address:
USA: 0x8028dad4
Ghidra address:
Asia: 0x8028D624
Ghidra address:
EUR: 0x80290234
Ghidra address:
JPN: 0x8028fca4

◆ g_awPaintShopButtonPalette

u16 g_awPaintShopButtonPalette[16]
extern

The palette of the pictures of the buttons of the paint shop, read from the cartridge.

Ghidra address:
JPN: 0x8028f020

◆ g_pDecalUndoBuffer

u8* g_pDecalUndoBuffer
extern

The texels of the decal before the last edit.

Ghidra address:
USA: 0x8028db80
Ghidra address:
Asia: 0x8028D6D0
Ghidra address:
EUR: 0x802902e0
Ghidra address:
JPN: 0x8028fd50

◆ g_bKeyboardHoverKey

u8 g_bKeyboardHoverKey
extern

The key under the cursor.

Ghidra address:
USA: 0x8028dba4
Ghidra address:
Asia: 0x8028D6F4
Ghidra address:
EUR: 0x80290304
Ghidra address:
JPN: 0x8028fd74

◆ g_bShowPreview3D

u8 g_bShowPreview3D
extern

Whether the car is drawn beside the decal.

Ghidra address:
USA: 0x8028dbd8
Ghidra address:
Asia: 0x8028D728
Ghidra address:
EUR: 0x80290338
Ghidra address:
JPN: 0x8028fda8

◆ g_bUndoAvailable

u8 g_bUndoAvailable
extern

Whether the undo buffer has an edit.

Ghidra address:
USA: 0x8028dbdc
Ghidra address:
Asia: 0x8028D72C
Ghidra address:
EUR: 0x8029033c
Ghidra address:
JPN: 0x8028fdac

◆ g_bEyedropperActive

u8 g_bEyedropperActive
extern

Whether the B button picks the color under the cursor.

Ghidra address:
USA: 0x8028dbec
Ghidra address:
Asia: 0x8028D73C
Ghidra address:
EUR: 0x8029034c
Ghidra address:
JPN: 0x8028fdbc

◆ s_aPanelViewDirections

Vec3f s_aPanelViewDirections[DECAL_SLOTS]
extern

The forward axis of the car that shows each decal slot.

Ghidra address:
USA: 0x8028dc08
Ghidra address:
Asia: 0x8028D758
Ghidra address:
EUR: 0x80290368
Ghidra address:
JPN: 0x8028fdd8

◆ s_pMirrorSource

u8* s_pMirrorSource
extern

The texels of the decal a mirror copies from.

Ghidra address:
USA: 0x8028dca4
Ghidra address:
Asia: 0x8028D7F4
Ghidra address:
EUR: 0x80290444
Ghidra address:
JPN: 0x8028fec4

◆ g_bPakFileNeedsCreate

u8 g_bPakFileNeedsCreate
extern

Whether the file of the decals is created first.

Ghidra address:
USA: 0x8028dcc0
Ghidra address:
Asia: 0x8028D810
Ghidra address:
EUR: 0x80290460
Ghidra address:
JPN: 0x8028fee0

◆ g_dwPakFileOffset

s32 g_dwPakFileOffset
extern

Where the next chunk of the file of the decals is.

Ghidra address:
USA: 0x8028dcc4
Ghidra address:
Asia: 0x8028D814
Ghidra address:
EUR: 0x80290464
Ghidra address:
JPN: 0x8028fee4

◆ g_bMirrorTargetPanel

u8 g_bMirrorTargetPanel
extern

The slot a mirror copies the decal to.

Ghidra address:
USA: 0x80369dab
Ghidra address:
Asia: 0x8036985B
Ghidra address:
EUR: 0x8036c2ab
Ghidra address:
JPN: 0x8036af0b

◆ g_bPakRumbleSwapped

u8 g_bPakRumbleSwapped
extern

Whether the rumble pak was swapped for the controller pak.

Ghidra address:
USA: 0x80369e50
Ghidra address:
Asia: 0x80369900
Ghidra address:
EUR: 0x8036c350
Ghidra address:
JPN: 0x8036afb0

◆ g_dwPakChunkSize

s32 g_dwPakChunkSize
extern

The bytes of the chunk last moved.

Ghidra address:
USA: 0x80369e5c
Ghidra address:
Asia: 0x8036990C
Ghidra address:
EUR: 0x8036c35c
Ghidra address:
JPN: 0x8036afbc

◆ g_bPakDecalIndex

u8 g_bPakDecalIndex
extern

The decal being moved.

Ghidra address:
USA: 0x80369e61
Ghidra address:
Asia: 0x80369911
Ghidra address:
EUR: 0x8036c361
Ghidra address:
JPN: 0x8036afc1

◆ g_szDecalText

char g_szDecalText[24]
extern

The text typed.

Ghidra address:
USA: 0x80369ea8
Ghidra address:
Asia: 0x80369958
Ghidra address:
EUR: 0x8036c3a8
Ghidra address:
JPN: 0x8036b008