|
coastline 0.0.4
|
The decal editor of the paint shop: the cursor, the palette and its color editor, the tools and the menus of their styles, and the dialog shown on exit from the paint shop. More...


Go to the source code of this file.
Classes | |
| struct | ScreenRect |
| A rectangle of the screen of the paint shop, 640 by 480. More... | |
| struct | PaletteSwatch |
| A color of the palette of the decal, and where it is shown to be picked. More... | |
| struct | DecalGlyph |
| A character of the font of the decals, and its key on the keyboard of the text tool. More... | |
Macros | |
| #define | DECAL_SWATCHES 16 |
| The colors of the palette of a decal. | |
| #define | DECAL_SLOTS 10 |
| The decals of a car that the paint shop edits. | |
| #define | DECAL_GLYPHS 50 |
| The characters of the font of the decals, also the keys of the keyboard. | |
| #define | DECAL_TEXT_LENGTH 16 |
| The characters a text painted on a decal may have. | |
| #define | BRUSH_SIZES 5 |
| The sizes of the brush. | |
Enumerations | |
| enum | { PAINT_TOOL_BRUSH_SIZE , PAINT_TOOL_BRUSH , PAINT_TOOL_FILL , PAINT_TOOL_LINE , PAINT_TOOL_TEXT , PAINT_TOOL_RECTANGLE , PAINT_TOOL_OVAL , PAINT_TOOL_MIRROR , PAINT_TOOL_CLEAR , PAINT_TOOL_LOAD , PAINT_TOOL_SAVE , PAINT_TOOL_UNDO , PAINT_TOOL_EXIT , PAINT_TOOLS } |
| The tools of the paint shop, each a button. More... | |
| enum | { RECT_STYLE_FILLED , RECT_STYLE_OUTLINED , RECT_STYLE_FILLED_ROUND , RECT_STYLE_OUTLINED_ROUND } |
| The styles of the rectangle tool. More... | |
| enum | { OVAL_STYLE_FILLED_ELLIPSE , OVAL_STYLE_OUTLINED_ELLIPSE , OVAL_STYLE_FILLED_CIRCLE , OVAL_STYLE_OUTLINED_CIRCLE } |
| The styles of the oval tool. More... | |
Functions | |
| void | SaveDecalUndo (void) |
| Save a copy of the decal being edited for undo, and count an edit. | |
| void | UndoDecalEdit (void) |
| Restore the copy of the decal saved for undo. | |
| void | ProcessTextInputKeyboard (void) |
| Run one frame of the keyboard of the text tool. | |
| void | ProcessColorEditorDialog (void) |
| Run one frame of the color editor of the color in use. | |
| void | UpdateCursorFromInput (void) |
| Move the cursor by the stick, the D-pad and the C buttons. | |
| void | ProcessDecalEditorInput (void) |
| Deal with a frame of the input of the decal editor: the decals, the palette, the tools and painting. | |
| s32 | IsCursorInButton (Sprite *sprite) |
| Whether the cursor is on a sprite as it is drawn. | |
| s32 | IsCursorInRect (ScreenRect *rect) |
| Whether the cursor is in a rectangle. | |
| s32 | IsCursorInSwatch (PaletteSwatch *swatch) |
| Whether the cursor is on a swatch of the palette. | |
| s32 | IsCursorOnKeyboardKey (DecalGlyph *key) |
| Whether the cursor is on a key of the keyboard. | |
| void | ConvertPaletteToRgb (void) |
| Set the colors of the swatches from the palette of the decal. | |
| void | DrawDecalColorPalette (void) |
| Draw the palette, with the color in use outlined. | |
| void | ProcessBrushStyleMenu (void) |
| Run one frame of the menu of the styles of the brush tool. | |
| void | ProcessTextStyleMenu (void) |
| Run one frame of the menu of the styles of the text tool, and of its colors of the shadow. | |
| void | ProcessRectStyleMenu (void) |
| Run one frame of the menu of the styles of the rectangle tool. | |
| void | ProcessOvalStyleMenu (void) |
| Run one frame of the menu of the styles of the oval tool. | |
| void | ProcessPaintShopExitConfirm (void) |
| Run one frame of the dialog that warns of edits not saved on exit from the paint shop, or fade out at once when there are none. | |
| void | ResetBrushAndSlotHistory (void) |
| Set the brush to its size and every remembered decal to the decal being edited. | |
Variables | |
| Sprite | g_texPaintToolBrush |
| The picture of the brush tool, whose style is round or square. | |
| Sprite | g_texPaintToolText |
| The picture of the text tool, whose style is the drop shadow. | |
| Sprite | g_texPaintToolRect |
| The picture of the rectangle tool, whose style is RECT_STYLE_. | |
| Sprite | g_texPaintToolOval |
| The picture of the oval tool, whose style is OVAL_STYLE_. | |
| Sprite | g_texPaintToolClear |
| The picture of the clear tool. | |
| Sprite | g_texPaintCursor |
| The cursor, whose origin is where it points. | |
| Sprite | g_texKeyboardHighlight |
| The highlight of a key of the keyboard, the size of a key. | |
| Sprite | g_texDecalFont |
| The font of the decals, 16 texels to a character. | |
| Sprite | g_texPaintShapeFilledCircle |
| The icon of the round brush. | |
| ScreenRect | g_rcDecalCanvasFrame [3] |
| Three contiguous paint shop frames, starting with the area around the decal. | |
| ScreenRect | g_rcPaletteFrameLeft |
| The black area behind the two wide swatches of the palette. | |
| ScreenRect | g_rcPaletteFrameRight |
| The black area behind the narrow swatches of the palette, right of the wide ones. | |
| ScreenRect | g_aBrushSizeRects [BRUSH_SIZES] |
| The sizes of the brush, in texels, as rectangles. | |
| ScreenRect | g_aBrushSizeButtonRects [BRUSH_SIZES] |
| The buttons of the sizes of the brush. | |
| DecalGlyph | g_aDecalGlyphs [DECAL_GLYPHS] |
| The characters of the font of the decals. | |
| u8 | g_bDashColorA |
| The colors of the marching dashes of a shape not yet drawn. | |
| u8 | g_bDashColorB |
| The second colour of the marching dashes of a shape not yet drawn. | |
| u8 | g_bBrushSize |
| The size of the brush, an index of g_aBrushSizeRects. | |
| ScreenRect | g_rcBrush |
| The rectangle of the size of the brush. | |
| Sprite * | g_pDecalSlotIcon |
| The icon of the decal being edited. | |
| Sprite * | g_apDecalSlotIcons [DECAL_SLOTS] |
| The icons of the decals. | |
| Sprite * | g_apRectStyleIcons [4] |
| The icons of the styles of the rectangle tool. | |
| Sprite * | g_apOvalStyleIcons [4] |
| The icons of the styles of the oval tool. | |
| u8 | g_bSavedColor |
| The color picked before the last, or the shadow color the text menu restores. | |
| u8 | g_bDecalColor |
| The color painted with, an index of the palette. | |
| u8 | g_bTextShadowColor |
| The color of the shadow of text. | |
| u8 | g_bPaintTool |
| The tool in use, a PAINT_TOOL_ value. | |
| u8 | g_bPreviousPaintTool |
| The tool in use before the last was picked. | |
| u8 | g_bDecalSlot |
| The decal being edited. | |
| u8 | g_bPreviousDecalSlot |
| The decal edited before the last was picked. | |
| u8 | g_bSavedDecalSlot |
| The decal slot selected before a tool temporarily visits every slot. | |
| u8 | g_bUndoDecalSlot |
| The decal the copy that undo restores was taken of. | |
| u8 * | g_pDecalTexels |
| The texels of the decal being edited, 4 bits each. | |
| u8 * | g_pDecalMask |
| The mask of the decal being edited, or NULL. | |
| u8 * | g_pDecalScratchTexels |
| A copy of the texels the flood fill works in. | |
| u8 | g_bDecalWidth |
| The size of the decal being edited, in texels. | |
| u8 | g_bDecalHeight |
| The height of the decal being edited, in texels. | |
| u16 * | g_pDecalPalette |
| The palette of the decal being edited, in RGBA 5551. | |
| ScreenRect | g_rcDecalCanvas |
| Where the decal is shown, 4 pixels to a texel. | |
| u8 | g_bDecalTextLength |
| The characters of the text to paint. | |
| u8 | g_bDecalTextWidth |
| The width of the text to paint, in texels. | |
| u8 | g_bDecalEditCount |
| The edits not saved, for the warning on exit. | |
| u8 | g_bStyleMenuCursor |
| The style under the cursor of a style menu. | |
| u8 | g_bPaintShopPlayer |
| The player who paints, an index of g_aPlayerInputState. | |
| u8 | g_bPaintToolStarted |
| Set while a tool waits for its second click. | |
| u8 | g_bDecalDragActive |
| Set while a press on the decal is being dealt with. | |
| u8 | g_bPaletteEnabled |
| Whether the palette can be clicked. | |
| u8 | g_bDecalSlotHasMirror |
| Whether the decal being edited has a mirror image. | |
| u8 | g_bDecalSlotChanged |
| Set when another decal is picked. | |
| u8 | g_bColorEditorOpen |
| Whether the color editor is open. | |
| u8 | g_bStyleMenuOpen |
| Whether the menu of the styles of the tool is open. | |
| u8 | g_bTextShadowPickerOpen |
| Whether the text menu shows the colors of the shadow. | |
| u8 | g_bPaintShopExiting |
| Set once the paint shop fades out. | |
| u8 | g_aabColorEditorBars [3][3] |
| The colors of the bars of the color editor. | |
| const char * | g_apszColorChannelNames [3] |
| The names of the bars of the color editor. | |
| u8 | g_bColorEditorChannel |
| The bar of the color editor under its cursor. | |
| const char * | g_apszBrushStyleNames [2] |
| The names of the styles of the brush tool. | |
| const char * | g_apszTextStyleNames [2] |
| The names of the styles of the text tool. | |
| const char * | g_apszRectStyleNames [4] |
| The names of the styles of the rectangle tool. | |
| const char * | g_apszOvalStyleNames [4] |
| The names of the styles of the oval tool. | |
| PaletteSwatch | g_aDecalSwatches [DECAL_SWATCHES] |
| The palette of the decal as it is shown. | |
| ScreenRect | g_aPaintToolButtonRects [PAINT_TOOLS] |
| The buttons of the tools. | |
| u8 | g_abSavedSwatchColor [3] |
| The color the color editor restores when it is cancelled. | |
| ScreenRect | g_aDecalSlotRects [DECAL_SLOTS] |
| The buttons of the decals. | |
| DecalGlyph * | g_apDecalTextGlyphs [DECAL_TEXT_LENGTH] |
| The glyphs of the text to paint. | |
The decal editor of the paint shop: the cursor, the palette and its color editor, the tools and the menus of their styles, and the dialog shown on exit from the paint shop.
| #define DECAL_SWATCHES 16 |
The colors of the palette of a decal.
| #define DECAL_SLOTS 10 |
The decals of a car that the paint shop edits.
| #define DECAL_GLYPHS 50 |
The characters of the font of the decals, also the keys of the keyboard.
| #define DECAL_TEXT_LENGTH 16 |
The characters a text painted on a decal may have.
| #define BRUSH_SIZES 5 |
The sizes of the brush.
| anonymous enum |
The tools of the paint shop, each a button.
| anonymous enum |
| anonymous enum |
The styles of the oval tool.
| void SaveDecalUndo | ( | void | ) |
Save a copy of the decal being edited for undo, and count an edit.
| void UndoDecalEdit | ( | void | ) |
Restore the copy of the decal saved for undo.
| void ProcessTextInputKeyboard | ( | void | ) |
Run one frame of the keyboard of the text tool.
| void ProcessColorEditorDialog | ( | void | ) |
Run one frame of the color editor of the color in use.
| void UpdateCursorFromInput | ( | void | ) |
Move the cursor by the stick, the D-pad and the C buttons.
| void ProcessDecalEditorInput | ( | void | ) |
Deal with a frame of the input of the decal editor: the decals, the palette, the tools and painting.
Whether the cursor is on a sprite as it is drawn.
| sprite | The sprite. |
| s32 IsCursorInRect | ( | ScreenRect * | rect | ) |
Whether the cursor is in a rectangle.
| rect | The rectangle. |
| s32 IsCursorInSwatch | ( | PaletteSwatch * | swatch | ) |
Whether the cursor is on a swatch of the palette.
| swatch | The swatch. |
| s32 IsCursorOnKeyboardKey | ( | DecalGlyph * | key | ) |
Whether the cursor is on a key of the keyboard.
| key | The key. |
| void ConvertPaletteToRgb | ( | void | ) |
Set the colors of the swatches from the palette of the decal.
| void DrawDecalColorPalette | ( | void | ) |
Draw the palette, with the color in use outlined.
| void ProcessBrushStyleMenu | ( | void | ) |
Run one frame of the menu of the styles of the brush tool.
| void ProcessTextStyleMenu | ( | void | ) |
Run one frame of the menu of the styles of the text tool, and of its colors of the shadow.
| void ProcessRectStyleMenu | ( | void | ) |
Run one frame of the menu of the styles of the rectangle tool.
| void ProcessOvalStyleMenu | ( | void | ) |
Run one frame of the menu of the styles of the oval tool.
| void ProcessPaintShopExitConfirm | ( | void | ) |
Run one frame of the dialog that warns of edits not saved on exit from the paint shop, or fade out at once when there are none.
| void ResetBrushAndSlotHistory | ( | void | ) |
Set the brush to its size and every remembered decal to the decal being edited.
|
extern |
The picture of the brush tool, whose style is round or square.
|
extern |
The picture of the text tool, whose style is the drop shadow.
|
extern |
The picture of the rectangle tool, whose style is RECT_STYLE_.
|
extern |
The picture of the oval tool, whose style is OVAL_STYLE_.
|
extern |
The picture of the clear tool.
|
extern |
The cursor, whose origin is where it points.
|
extern |
The highlight of a key of the keyboard, the size of a key.
|
extern |
The font of the decals, 16 texels to a character.
|
extern |
The icon of the round brush.
|
extern |
Three contiguous paint shop frames, starting with the area around the decal.
|
extern |
The black area behind the two wide swatches of the palette.
|
extern |
The black area behind the narrow swatches of the palette, right of the wide ones.
|
extern |
The sizes of the brush, in texels, as rectangles.
|
extern |
The buttons of the sizes of the brush.
|
extern |
The characters of the font of the decals.
|
extern |
The colors of the marching dashes of a shape not yet drawn.
|
extern |
The second colour of the marching dashes of a shape not yet drawn.
|
extern |
The size of the brush, an index of g_aBrushSizeRects.
|
extern |
The rectangle of the size of the brush.
|
extern |
The icon of the decal being edited.
|
extern |
The icons of the decals.
|
extern |
The icons of the styles of the rectangle tool.
|
extern |
The icons of the styles of the oval tool.
|
extern |
The color picked before the last, or the shadow color the text menu restores.
|
extern |
The color painted with, an index of the palette.
|
extern |
The color of the shadow of text.
|
extern |
The tool in use, a PAINT_TOOL_ value.
|
extern |
The tool in use before the last was picked.
|
extern |
The decal being edited.
|
extern |
The decal edited before the last was picked.
|
extern |
The decal slot selected before a tool temporarily visits every slot.
|
extern |
The decal the copy that undo restores was taken of.
|
extern |
The texels of the decal being edited, 4 bits each.
|
extern |
The mask of the decal being edited, or NULL.
|
extern |
A copy of the texels the flood fill works in.
|
extern |
The size of the decal being edited, in texels.
|
extern |
The height of the decal being edited, in texels.
|
extern |
The palette of the decal being edited, in RGBA 5551.
|
extern |
Where the decal is shown, 4 pixels to a texel.
|
extern |
The characters of the text to paint.
|
extern |
The width of the text to paint, in texels.
|
extern |
The edits not saved, for the warning on exit.
|
extern |
The style under the cursor of a style menu.
|
extern |
The player who paints, an index of g_aPlayerInputState.
|
extern |
Set while a tool waits for its second click.
Opening the menu of the styles of a tool sets it too, and the menu clears it.
|
extern |
Set while a press on the decal is being dealt with.
|
extern |
Whether the palette can be clicked.
|
extern |
Whether the decal being edited has a mirror image.
|
extern |
Set when another decal is picked.
|
extern |
Whether the color editor is open.
|
extern |
Whether the menu of the styles of the tool is open.
|
extern |
Whether the text menu shows the colors of the shadow.
|
extern |
Set once the paint shop fades out.
|
extern |
The colors of the bars of the color editor.
|
extern |
The names of the bars of the color editor.
|
extern |
The bar of the color editor under its cursor.
|
extern |
The names of the styles of the brush tool.
|
extern |
The names of the styles of the text tool.
|
extern |
The names of the styles of the rectangle tool.
|
extern |
The names of the styles of the oval tool.
|
extern |
The palette of the decal as it is shown.
|
extern |
The buttons of the tools.
|
extern |
The color the color editor restores when it is cancelled.
|
extern |
The buttons of the decals.
|
extern |
The glyphs of the text to paint.