Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
- fixed a bug where the LUT generation progress wouldn't reset
- recoloured the application's icon
  • Loading branch information
KUNGERMOoN committed Aug 16, 2024
1 parent 2b912b7 commit 5c65dc8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
Binary file modified Assets/Docs/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Assets/Materials/BoardRender.mat
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Material:
- _GridFadePow: 0.65
- _GridScale: 2
- _GridSize: 0.37
- _GridWidth: -0.07
- _GridWidth: 0.07
- _Interp: 0
- _Offset: 0.816
- _Pow: 2.41
Expand Down
4 changes: 4 additions & 0 deletions Assets/Scripts/GUI/GUIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ private void Awake()
Q<Label>("additionalLUTGenerationInfo").style.display =
cause == SimulationRunner.LUTGenerationCause.NoLutsFound
? DisplayStyle.Flex : DisplayStyle.None;

Q<ProgressBar>("LUTprogressBar").value = 0;
Q<Label>("LUTprogressPrecentage").text = "0%";
Q<Label>("LUTProgressStage").text = "Generating...";
};
Simulation.LUTGenerationUpdate += ctx =>
{
Expand Down
4 changes: 4 additions & 0 deletions Assets/Scripts/SimulationRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ public async void GenerateLUT(bool[] birthCount, bool[] surviveCount, string pat
LookupTable builder = new(birthCount, surviveCount);
IEnumerator enumerator = builder.Generate();

lastGenerationProgress = 0;
generationProgress = 0;
LUTGenerationStarted?.Invoke(cause);

CancellationToken token = lutGenerationCancellationSource.Token;
Expand All @@ -189,6 +191,8 @@ await Task.Run(() =>
}
}, token);

if (lutGenerationCancellationSource.IsCancellationRequested) return;

LUTGenerationUpdate?.Invoke((0.9f, true));

builder.WriteToFile(path);
Expand Down
1 change: 1 addition & 0 deletions Assets/Shaders/GameOfLifeSimulation.compute
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ void Update(uint3 id : SV_DispatchThreadID)
uint g = GetPrevious(i + 1);
uint h = GetPrevious(i + Size.y + 3);

//Docs/LookupTables.xlsx shows how those magic numbers are actually obtained
uint input =
((a << 23) & 8388608) +
((b << 19) & 7864320) +
Expand Down
4 changes: 4 additions & 0 deletions Assets/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
some of this stuff is likely obstolete, and
most of it (except for bugfixes) likely won't be implemented in an near future

TODO 0 (aka. ASAP)
Add UI for switching color palettes
Add a system for running multiple simulation ticks in a single frame

TODO 1 (aka. hopefully soon):
Fix switching the focus between ui an camera movement
Figure out what eats 40% of the GPU as soon as we start the game (with "Update in realtime" disabled!)
Expand Down

0 comments on commit 5c65dc8

Please sign in to comment.