Got assemblies to unload again

This commit is contained in:
Peter Slattery 2019-11-22 23:57:30 -08:00
parent a5e774c8d1
commit 67b402b74f
3 changed files with 17 additions and 13 deletions

View File

@ -167,19 +167,18 @@ LoadAssembly (app_state* State, context Context, char* Path)
internal void
UnloadAssembly (s32 AssemblyIndex, app_state* State, context Context)
{
assembly Assembly = State->AssemblyList[AssemblyIndex];
/*
s32 LEDsInAssembly = Assembly.LEDBuffer->Count;
s32 MemoryRequiredForAssembly = CalculateMemorySizeForAssembly(LEDsInAssembly, Assembly.Name.Length);
Context.PlatformFree((u8*)Assembly.LEDBuffer, MemoryRequiredForAssembly);
State->TotalLEDsCount -= LEDsInAssembly;
*/
assembly* Assembly = State->AssemblyList + AssemblyIndex;
State->TotalLEDsCount -= Assembly->LEDCount;
Context.PlatformFree(Assembly->Arena.Base, Assembly->Arena.Size);
if (AssemblyIndex != (State->AssembliesCount - 1))
{
State->AssemblyList[AssemblyIndex] = State->AssemblyList[State->AssembliesCount - 1];
}
else
{
*Assembly = {};
}
State->AssembliesCount -= 1;
}
@ -339,8 +338,6 @@ HandleInput (app_state* State, input_queue InputQueue, mouse_state Mouse)
ActiveCommands = State->Modes.ActiveModes[State->Modes.ActiveModesCount - 1].Commands;
}
for (s32 EventIdx = 0; EventIdx < InputQueue.QueueUsed; EventIdx++)
{
input_entry Event = InputQueue.Entries[EventIdx];

View File

@ -601,7 +601,12 @@ PLATFORM_ALLOC(Win32Alloc)
PLATFORM_FREE(Win32Free)
{
b32 Result = VirtualFree(Base, Size, MEM_RELEASE);
b32 Result = VirtualFree(Base, 0, MEM_RELEASE);
if (!Result)
{
s32 Error = WSAGetLastError();
InvalidCodePath;
}
return Result;
}

View File

@ -4,9 +4,11 @@ YOU WERE IN THE MIDDLE OF
Assembly -> SACN interface
- you need to rebuild the map from leds -> universes
- - thinking about storing a sparse array of { led_start_index, led_count, led_universe, led_channel }
x you need to rebuild the map from leds -> universes
- x thinking about storing a sparse array of { led_start_index, led_count, led_universe, led_channel }
- that we can iterate over to populate dmx buffers
- need to create a data structure in CreateDMXBuffers that prevents duplication of DMXBuffers.
- - thinking about a dictionary. Key is Universe, length is 256, create parallel arrays as necessary
BUGS
- Typing a period into a float value doesn't register. Problem here is that we arent' translating key presses into characters at the win32 layer. Need to do that.