coastline 0.0.4
Loading...
Searching...
No Matches
decaleditor.h
Go to the documentation of this file.
1#ifndef COASTLINE_DECALEDITOR_H
2#define COASTLINE_DECALEDITOR_H
3
9
10#include <PR/ultratypes.h>
11
12#include "sprite.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
19#define DECAL_SWATCHES 16
20
22#define DECAL_SLOTS 10
23
25#define DECAL_GLYPHS 50
26
28#define DECAL_TEXT_LENGTH 16
29
31#define BRUSH_SIZES 5
32
34enum {
49};
50
52enum {
57};
58
60enum {
65};
66
68typedef struct {
74
76typedef struct {
78 u8 color[3];
80
91
101
111
121
131
141
151
161
171
181
191
201
211
221
231
241
250extern u8 g_bDashColorA;
251
260extern u8 g_bDashColorB;
261
270extern u8 g_bBrushSize;
271
280extern ScreenRect g_rcBrush;
281
291
301
310extern Sprite *g_apRectStyleIcons[4];
311
320extern Sprite *g_apOvalStyleIcons[4];
321
330extern u8 g_bSavedColor;
331
340extern u8 g_bDecalColor;
341
351
360extern u8 g_bPaintTool;
361
371
380extern u8 g_bDecalSlot;
381
391
400extern u8 g_bSavedDecalSlot;
401
410extern u8 g_bUndoDecalSlot;
411
420extern u8 *g_pDecalTexels;
421
430extern u8 *g_pDecalMask;
431
441
450extern u8 g_bDecalWidth;
451
460extern u8 g_bDecalHeight;
461
470extern u16 *g_pDecalPalette;
471
481
491
500extern u8 g_bDecalTextWidth;
501
510extern u8 g_bDecalEditCount;
511
521
531
542
552
561extern u8 g_bPaletteEnabled;
562
572
582
592
601extern u8 g_bStyleMenuOpen;
602
612
622
631extern u8 g_aabColorEditorBars[3][3];
632
641extern const char *g_apszColorChannelNames[3];
642
652
660extern const char *g_apszBrushStyleNames[2];
661
669extern const char *g_apszTextStyleNames[2];
670
678extern const char *g_apszRectStyleNames[4];
679
687extern const char *g_apszOvalStyleNames[4];
688
698
708
717extern u8 g_abSavedSwatchColor[3];
718
728
738
747void SaveDecalUndo(void);
748
757void UndoDecalEdit(void);
758
759#ifdef ENABLE_PATCHES
761void RedoDecalEdit(void);
762
764void SaveAllDecalUndo(void);
765
767void SaveDecalPaletteUndo(void);
768
770void CancelDecalPaletteUndo(void);
771#endif
772
782
792
802
813
825
837
849
861
871
881
891
901
911
921
932
942
943#ifdef __cplusplus
944}
945#endif
946
947#endif /* COASTLINE_DECALEDITOR_H */
u16 * g_pDecalPalette
The palette of the decal being edited, in RGBA 5551.
#define DECAL_SWATCHES
The colors of the palette of a decal.
Definition decaleditor.h:19
ScreenRect g_aBrushSizeRects[BRUSH_SIZES]
The sizes of the brush, in texels, as rectangles.
u8 g_bDecalTextWidth
The width of the text to paint, in texels.
u8 g_bBrushSize
The size of the brush, an index of g_aBrushSizeRects.
const char * g_apszColorChannelNames[3]
The names of the bars of the color editor.
u8 g_bDecalSlot
The decal being edited.
u8 g_bDecalDragActive
Set while a press on the decal is being dealt with.
void ProcessPaintShopExitConfirm(void)
Run one frame of the dialog that warns of edits not saved on exit from the paint shop,...
void ProcessBrushStyleMenu(void)
Run one frame of the menu of the styles of the brush tool.
const char * g_apszOvalStyleNames[4]
The names of the styles of the oval tool.
u8 g_bTextShadowPickerOpen
Whether the text menu shows the colors of the shadow.
ScreenRect g_rcPaletteFrameLeft
The black area behind the two wide swatches of the palette.
Sprite g_texDecalFont
The font of the decals, 16 texels to a character.
Sprite g_texPaintToolClear
The picture of the clear tool.
u8 g_bDashColorB
The second colour of the marching dashes of a shape not yet drawn.
u8 g_bPaintShopPlayer
The player who paints, an index of g_aPlayerInputState.
u8 g_bPaletteEnabled
Whether the palette can be clicked.
u8 g_bDecalColor
The color painted with, an index of the palette.
u8 * g_pDecalTexels
The texels of the decal being edited, 4 bits each.
#define DECAL_TEXT_LENGTH
The characters a text painted on a decal may have.
Definition decaleditor.h:28
void UndoDecalEdit(void)
Restore the copy of the decal saved for undo.
#define BRUSH_SIZES
The sizes of the brush.
Definition decaleditor.h:31
u8 g_bDecalEditCount
The edits not saved, for the warning on exit.
Sprite g_texPaintToolOval
The picture of the oval tool, whose style is OVAL_STYLE_.
void SaveDecalUndo(void)
Save a copy of the decal being edited for undo, and count an edit.
void ResetBrushAndSlotHistory(void)
Set the brush to its size and every remembered decal to the decal being edited.
void ConvertPaletteToRgb(void)
Set the colors of the swatches from the palette of the decal.
#define DECAL_GLYPHS
The characters of the font of the decals, also the keys of the keyboard.
Definition decaleditor.h:25
u8 g_bUndoDecalSlot
The decal the copy that undo restores was taken of.
const char * g_apszTextStyleNames[2]
The names of the styles of the text tool.
ScreenRect g_rcDecalCanvas
Where the decal is shown, 4 pixels to a texel.
ScreenRect g_aDecalSlotRects[DECAL_SLOTS]
The buttons of the decals.
s32 IsCursorInRect(ScreenRect *rect)
Whether the cursor is in a rectangle.
u8 g_abSavedSwatchColor[3]
The color the color editor restores when it is cancelled.
s32 IsCursorInButton(Sprite *sprite)
Whether the cursor is on a sprite as it is drawn.
#define DECAL_SLOTS
The decals of a car that the paint shop edits.
Definition decaleditor.h:22
Sprite * g_apDecalSlotIcons[DECAL_SLOTS]
The icons of the decals.
u8 g_bDecalTextLength
The characters of the text to paint.
u8 g_bPreviousDecalSlot
The decal edited before the last was picked.
u8 * g_pDecalScratchTexels
A copy of the texels the flood fill works in.
Sprite g_texKeyboardHighlight
The highlight of a key of the keyboard, the size of a key.
u8 g_bDecalSlotHasMirror
Whether the decal being edited has a mirror image.
void ProcessRectStyleMenu(void)
Run one frame of the menu of the styles of the rectangle tool.
Sprite g_texPaintShapeFilledCircle
The icon of the round brush.
u8 g_bSavedColor
The color picked before the last, or the shadow color the text menu restores.
void ProcessColorEditorDialog(void)
Run one frame of the color editor of the color in use.
const char * g_apszRectStyleNames[4]
The names of the styles of the rectangle tool.
Sprite g_texPaintToolBrush
The picture of the brush tool, whose style is round or square.
Sprite * g_pDecalSlotIcon
The icon of the decal being edited.
u8 g_bDashColorA
The colors of the marching dashes of a shape not yet drawn.
u8 * g_pDecalMask
The mask of the decal being edited, or NULL.
void DrawDecalColorPalette(void)
Draw the palette, with the color in use outlined.
const char * g_apszBrushStyleNames[2]
The names of the styles of the brush tool.
ScreenRect g_rcBrush
The rectangle of the size of the brush.
@ RECT_STYLE_FILLED
Definition decaleditor.h:53
@ RECT_STYLE_FILLED_ROUND
Definition decaleditor.h:55
@ RECT_STYLE_OUTLINED_ROUND
Definition decaleditor.h:56
@ RECT_STYLE_OUTLINED
Definition decaleditor.h:54
u8 g_bColorEditorChannel
The bar of the color editor under its cursor.
s32 IsCursorOnKeyboardKey(DecalGlyph *key)
Whether the cursor is on a key of the keyboard.
u8 g_bPaintTool
The tool in use, a PAINT_TOOL_ value.
void ProcessDecalEditorInput(void)
Deal with a frame of the input of the decal editor: the decals, the palette, the tools and painting.
void UpdateCursorFromInput(void)
Move the cursor by the stick, the D-pad and the C buttons.
u8 g_bStyleMenuOpen
Whether the menu of the styles of the tool is open.
u8 g_bDecalSlotChanged
Set when another decal is picked.
void ProcessTextStyleMenu(void)
Run one frame of the menu of the styles of the text tool, and of its colors of the shadow.
u8 g_bPreviousPaintTool
The tool in use before the last was picked.
ScreenRect g_aPaintToolButtonRects[PAINT_TOOLS]
The buttons of the tools.
DecalGlyph g_aDecalGlyphs[DECAL_GLYPHS]
The characters of the font of the decals.
void ProcessTextInputKeyboard(void)
Run one frame of the keyboard of the text tool.
u8 g_bDecalHeight
The height of the decal being edited, in texels.
@ OVAL_STYLE_OUTLINED_CIRCLE
Definition decaleditor.h:64
@ OVAL_STYLE_FILLED_CIRCLE
Definition decaleditor.h:63
@ OVAL_STYLE_OUTLINED_ELLIPSE
Definition decaleditor.h:62
@ OVAL_STYLE_FILLED_ELLIPSE
Definition decaleditor.h:61
PaletteSwatch g_aDecalSwatches[DECAL_SWATCHES]
The palette of the decal as it is shown.
Sprite g_texPaintCursor
The cursor, whose origin is where it points.
@ PAINT_TOOL_LINE
Definition decaleditor.h:38
@ PAINT_TOOL_BRUSH_SIZE
Definition decaleditor.h:35
@ PAINT_TOOL_BRUSH
Definition decaleditor.h:36
@ PAINT_TOOL_CLEAR
Definition decaleditor.h:43
@ PAINT_TOOL_LOAD
Definition decaleditor.h:44
@ PAINT_TOOL_UNDO
Definition decaleditor.h:46
@ PAINT_TOOL_MIRROR
Definition decaleditor.h:42
@ PAINT_TOOLS
Definition decaleditor.h:48
@ PAINT_TOOL_FILL
Definition decaleditor.h:37
@ PAINT_TOOL_SAVE
Definition decaleditor.h:45
@ PAINT_TOOL_RECTANGLE
Definition decaleditor.h:40
@ PAINT_TOOL_OVAL
Definition decaleditor.h:41
@ PAINT_TOOL_TEXT
Definition decaleditor.h:39
@ PAINT_TOOL_EXIT
Definition decaleditor.h:47
u8 g_bPaintToolStarted
Set while a tool waits for its second click.
ScreenRect g_rcPaletteFrameRight
The black area behind the narrow swatches of the palette, right of the wide ones.
u8 g_bDecalWidth
The size of the decal being edited, in texels.
ScreenRect g_rcDecalCanvasFrame[3]
Three contiguous paint shop frames, starting with the area around the decal.
Sprite g_texPaintToolRect
The picture of the rectangle tool, whose style is RECT_STYLE_.
u8 g_bSavedDecalSlot
The decal slot selected before a tool temporarily visits every slot.
u8 g_bStyleMenuCursor
The style under the cursor of a style menu.
Sprite * g_apOvalStyleIcons[4]
The icons of the styles of the oval tool.
Sprite g_texPaintToolText
The picture of the text tool, whose style is the drop shadow.
u8 g_bColorEditorOpen
Whether the color editor is open.
DecalGlyph * g_apDecalTextGlyphs[DECAL_TEXT_LENGTH]
The glyphs of the text to paint.
Sprite * g_apRectStyleIcons[4]
The icons of the styles of the rectangle tool.
void ProcessOvalStyleMenu(void)
Run one frame of the menu of the styles of the oval tool.
ScreenRect g_aBrushSizeButtonRects[BRUSH_SIZES]
The buttons of the sizes of the brush.
s32 IsCursorInSwatch(PaletteSwatch *swatch)
Whether the cursor is on a swatch of the palette.
u8 g_bPaintShopExiting
Set once the paint shop fades out.
u8 g_bTextShadowColor
The color of the shadow of text.
u8 g_aabColorEditorBars[3][3]
The colors of the bars of the color editor.
The sprites of the menus: pictures loaded from the cartridge and drawn in strips, and the rectangles ...
A character of the font of the decals, and its key on the keyboard of the text tool.
Definition decaleditor.h:82
s32 x
Definition decaleditor.h:83
s32 kernRight
Definition decaleditor.h:89
s32 kernLeft
Definition decaleditor.h:88
u8 character
Definition decaleditor.h:85
s32 width
Definition decaleditor.h:87
s32 y
Definition decaleditor.h:84
s32 cellX
Definition decaleditor.h:86
A color of the palette of the decal, and where it is shown to be picked.
Definition decaleditor.h:76
ScreenRect rect
Definition decaleditor.h:77
u8 color[3]
Definition decaleditor.h:78
A rectangle of the screen of the paint shop, 640 by 480.
Definition decaleditor.h:68
s32 x
Definition decaleditor.h:69
s32 y
Definition decaleditor.h:70
s32 width
Definition decaleditor.h:71
s32 height
Definition decaleditor.h:72
A picture of the menus.
Definition sprite.h:23
Integer and floating-point types of libultra.
unsigned short u16
Definition ultratypes.h:19
int s32
Definition ultratypes.h:25
unsigned char u8
Definition ultratypes.h:18