diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 32 |
1 files changed, 19 insertions, 13 deletions
@@ -329,8 +329,8 @@ Render_Comp(project_data *File, project_state *State, memory *Memory, ImGuiIO io int32 Offset = (State->Interact_Active == interact_type_keyframe_move) ? (int32)State->Interact_Offset[0] : 0; for (int h = 0; h < AmountOf(Layer->Property); h++) { property_channel *Property = &Layer->Property[h]; - sorted_property_info *InfoLocation = Property_GetSortedInfo(SortedPropertyInfo, i, h); - uint16 *ArrayLocation = Property_GetSortedArray(SortedPropertyArray, i, h); + sorted_property_info *InfoLocation = Property_GetSortedInfo(SortedPropertyInfo, Index_Physical, h); + uint16 *ArrayLocation = Property_GetSortedArray(SortedPropertyArray, Index_Physical, h); if (Property->Block_Bezier_Count) { real32 MinY, MaxY; Property_MinMax_Y(Memory, State, Property, InfoLocation, &MinY, &MaxY); @@ -380,14 +380,11 @@ Render_Comp(project_data *File, project_state *State, memory *Memory, ImGuiIO io uint64 ScratchActive = 0; if (!Layer->IsPrecomp) { block_source *Source; - if (State->PreviewSource == -1) { - Source = (block_source *)Memory_Block_AddressAtIndex(Memory, F_Sources, Layer->Block_Source_Index); - } else { + if ((State->PreviewSource != -1) && Layer->IsSelected) { Source = (block_source *)Memory_Block_AddressAtIndex(Memory, F_Sources, State->PreviewSource); + } else { + Source = (block_source *)Memory_Block_AddressAtIndex(Memory, F_Sources, Layer->Block_Source_Index); } - Width = Source->Width; - Height = Source->Height; - BytesPerPixel = Source->BytesPerPixel; if (Source->Type == source_type_principal || Source->Type == source_type_principal_temp) { if (State->Interact_Active == interact_type_brush && State->Brush.LayerToPaint_Index == Index_Physical) { Assert(Source->Type == source_type_principal); @@ -428,7 +425,9 @@ Render_Comp(project_data *File, project_state *State, memory *Memory, ImGuiIO io } BitmapAddress = Memory_Block_Bitmap_AddressAtIndex(Memory, Entry->Block_StartIndex); } - + Width = Source->Width; + Height = Source->Height; + BytesPerPixel = Source->BytesPerPixel; } else { block_composition *Precomp = (block_composition *)Memory_Block_AddressAtIndex(Memory, F_Precomps, Layer->Block_Source_Index); BitmapAddress = Render_Comp(File, State, Memory, io, SortedCompArray, SortedLayerArray, @@ -453,6 +452,8 @@ Render_Comp(project_data *File, project_state *State, memory *Memory, ImGuiIO io } */ + Assert(Width); + Assert(Height); transform_info T = Transform_Calculate(State, Memory, File, Layer, Comp, Width, Height, BytesPerPixel); T.SourceBuffer = BitmapAddress; rectangle RenderRegion = {0, 0, Comp->Width, Comp->Height}; @@ -588,19 +589,24 @@ int main(int argc, char *argv[]) { #if 0 { - uint16 SourceIndex = Source_Generate(File, State, &Memory, (void *)"../asset/t_a.png"); + uint16 SourceIndex = Source_Generate(File, State, &Memory, (void *)"../asset/hand/a.png"); block_source *Source = (block_source *)Memory_Block_AddressAtIndex(&Memory, F_Sources, 0); Source->IsSelected = true; } { - uint16 SourceIndex = Source_Generate(File, State, &Memory, (void *)"../asset/t_b.png"); + uint16 SourceIndex = Source_Generate(File, State, &Memory, (void *)"../asset/hand/b.jpg"); block_source *Source = (block_source *)Memory_Block_AddressAtIndex(&Memory, F_Sources, 1); Source->IsSelected = true; } { - uint16 SourceIndex = Source_Generate(File, State, &Memory, (void *)"../asset/t_c.png"); + uint16 SourceIndex = Source_Generate(File, State, &Memory, (void *)"../asset/hand/c.png"); + block_source *Source = (block_source *)Memory_Block_AddressAtIndex(&Memory, F_Sources, 2); + Source->IsSelected = true; + } + { + uint16 SourceIndex = Source_Generate(File, State, &Memory, (void *)"../asset/hand/d.png"); block_source *Source = (block_source *)Memory_Block_AddressAtIndex(&Memory, F_Sources, 2); Source->IsSelected = true; } @@ -711,7 +717,7 @@ int main(int argc, char *argv[]) { Brush_CalcBitmapAlphaFromSize(&Memory, &State->Brush, 4); State_BindBrushTexture(&Memory, &State->Brush, 4); - // File_Open(File, State, &Memory, "test"); + File_Open(File, State, &Memory, "test"); #if STABLE curl_global_init(CURL_GLOBAL_ALL); |