summaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'main.h')
-rw-r--r--main.h75
1 files changed, 62 insertions, 13 deletions
diff --git a/main.h b/main.h
index 26b3666..e0a9374 100644
--- a/main.h
+++ b/main.h
@@ -90,6 +90,28 @@ struct block_bezier {
bezier_point Point[MAX_KEYFRAMES_PER_BLOCK];
};
+enum selection_type
+{
+ selection_none,
+ selection_layer,
+ selection_effect,
+ selection_keyframe,
+ selection_maskpoint,
+ selection_source
+};
+
+struct clipboard_channel {
+ void *Name;
+ uint16 LayerOffset;
+ uint16 KeyframeCount;
+};
+
+struct clipboard_contents {
+ selection_type Type;
+ clipboard_channel Channel[16];
+ uint16 ChannelCount;
+};
+
struct layer_bitmap_state {
// Image and video
bool32 ToUpdate = 1;
@@ -120,11 +142,13 @@ struct sorted_property_info
{
uint32 MinYIndex;
uint32 MaxYIndex;
+ bool32 IsGraphSelected;
};
struct sorted_comp_info
{
uint32 LayerCount;
+ uint32 CurrentSortIndex; // Used intermediately in the sorting algorithm
};
struct sorted_layer
@@ -227,12 +251,14 @@ char *BrushNames[brush_amount] = {
struct brush_state
{
ImVec2 UIPos; // Initial position when ctrl is held
- real32 Size = 15; // Maxes at 1024 for now
+ real32 Size = 512; // Maxes at 1024 for now
real32 Hardness = 1.0f; // From 1 to 100
real32 Spacing = 1.0f;
brush_type Type = brush_normal;
GLuint GLTexture;
void *PaintBuffer;
+ void *TransientBitmap;
+ uint32 LayerToPaint_Index = -1;
rectangle CacheBounds;
};
@@ -245,7 +271,7 @@ enum interact_type
interact_type_keyframe_move,
interact_type_keyframe_scale,
interact_type_keyframe_rotate,
- interact_type_newlayer_paint
+ interact_type_brush
};
char *ToolName[] {
@@ -288,12 +314,17 @@ struct project_state
pen_state Pen = {};
brush_state Brush;
+ sd_state SD;
+
char DummyName2[512];
bool32 IsRunning = 1;
bool32 IsPlaying;
bool32 FirstFrame = 1;
+ void *ClipboardBuffer;
+ uint64 ClipboardSize;
+
int16 MostRecentlySelectedLayer = -1;
// selection_type RecentSelectionType = selection_none;
@@ -376,6 +407,7 @@ struct property_header
real32 DefaultVal;
real32 MinVal;
real32 MaxVal;
+ bool32 AlwaysInteger;
};
struct property_channel {
@@ -388,6 +420,7 @@ struct property_channel {
real32 CurrentValue;
real32 MaxVal;
real32 MinVal;
+ bool32 AlwaysInteger;
real32 ScrubVal; // increment when dragging on sliders, etc.
bool32 IsToggled;
@@ -476,9 +509,36 @@ struct transform_info {
void *SourceBuffer;
};
+struct brush_info {
+ uint32 BrushLength;
+ rectangle LayerBounds;
+ uint32 LayerPitch;
+ uint32 BrushPitch;
+ int32 ExtraX;
+ int32 ExtraY;
+ render_byte_info LayerBits;
+ render_byte_info BrushBits;
+ int BytesPerPixel;
+ int SourceWidth;
+ int SourceBytesPerPixel;
+ void *BrushBuffer;
+ real32 R_Brush;
+ real32 G_Brush;
+ real32 B_Brush;
+ real32 A_Brush;
+ uint8 *BrushRow;
+};
+
+enum render_type {
+ render_type_main,
+ render_type_direct,
+ render_type_brush
+};
+
struct render_entry {
void *RenderData;
void *OutputBuffer;
+ render_type RenderType;
rectangle RenderRegion;
};
@@ -538,17 +598,6 @@ struct main_sdl
SDL_Renderer *Renderer;
};
-// used to determine what to copy/paste, delete, etc
-enum selection_type
-{
- selection_none,
- selection_layer,
- selection_effect,
- selection_keyframe,
- selection_maskpoint,
- selection_source
-};
-
char *ToolName[] {
"Move",
"Pen"