coastline 0.0.4
Loading...
Searching...
No Matches
paintundo.h File Reference
Include dependency graph for paintundo.h:

Go to the source code of this file.

Macros

#define PAINT_UNDO_SLOT   0
#define PAINT_UNDO_ALL   1
#define PAINT_UNDO_PALETTE   2

Functions

void InitPaintUndo (u8 *memory, u32 capacity, VehicleModel *model, u16 *palette)
 Initialise paint history in the remaining interface memory.
void RecordPaintUndoSlot (s32 slot)
 Record the current pixels of one slot before an edit.
void RecordPaintUndoAll (void)
 Record every slot before an edit that changes the whole car.
void RecordPaintUndoPalette (void)
 Record the palette before its colour editor changes it.
void CancelPaintUndoPalette (void)
 Discard the latest entry when a palette edit is cancelled.
s32 UndoPaintChange (void)
 Restore the previous edit.
s32 RedoPaintChange (void)
 Reapply the next edit.
void MarkPaintUndoSaved (void)
 Record the current history position as saved.
void ResetPaintUndo (void)
 Clear history after loading another decal file.
s32 PaintUndoIsDirty (void)
 Return whether current decals differ from the saved history position.
s32 PaintUndoCanUndo (void)
 Return whether an earlier edit can be restored.

Macro Definition Documentation

◆ PAINT_UNDO_SLOT

#define PAINT_UNDO_SLOT   0

A saved edit to one decal slot.

◆ PAINT_UNDO_ALL

#define PAINT_UNDO_ALL   1

A saved edit to every decal slot.

◆ PAINT_UNDO_PALETTE

#define PAINT_UNDO_PALETTE   2

A saved palette edit.

Function Documentation

◆ InitPaintUndo()

void InitPaintUndo ( u8 * memory,
u32 capacity,
VehicleModel * model,
u16 * palette )

Initialise paint history in the remaining interface memory.

Parameters
memoryWritable history storage.
capacityNumber of available bytes in memory.
modelVehicle model containing the decal textures.
paletteDecal palette to restore with colour edits.

◆ RecordPaintUndoSlot()

void RecordPaintUndoSlot ( s32 slot)

Record the current pixels of one slot before an edit.

Parameters
slotIndex of the slot to record.

◆ RecordPaintUndoAll()

void RecordPaintUndoAll ( void )

Record every slot before an edit that changes the whole car.

◆ RecordPaintUndoPalette()

void RecordPaintUndoPalette ( void )

Record the palette before its colour editor changes it.

◆ CancelPaintUndoPalette()

void CancelPaintUndoPalette ( void )

Discard the latest entry when a palette edit is cancelled.

◆ UndoPaintChange()

s32 UndoPaintChange ( void )

Restore the previous edit.

Returns
The restored entry type, or -1 when history is empty.

◆ RedoPaintChange()

s32 RedoPaintChange ( void )

Reapply the next edit.

Returns
The reapplied entry type, or -1 when redo history is empty.

◆ MarkPaintUndoSaved()

void MarkPaintUndoSaved ( void )

Record the current history position as saved.

◆ ResetPaintUndo()

void ResetPaintUndo ( void )

Clear history after loading another decal file.

◆ PaintUndoIsDirty()

s32 PaintUndoIsDirty ( void )

Return whether current decals differ from the saved history position.

Returns
Nonzero if there are unsaved edits.

◆ PaintUndoCanUndo()

s32 PaintUndoCanUndo ( void )

Return whether an earlier edit can be restored.

Returns
Nonzero if undo history is available.