New version of PaletteGodGenerate (#106)

This version makes seeding with GodPick optional and even if you want to seed it will only require one press of "Ok". The rest is taken care of by RandI32.
This commit is contained in:
Sharoy Veduchi 2023-05-29 03:01:03 -07:00 committed by GitHub
parent a551afdd90
commit 899c733ec1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,4 +12,33 @@ public U0 PaletteGodGenerate()
}
}
PaletteGodGenerate;
public U0 PaletteGodGenerate2(Bool NeedForSneed=0)
{
//This one will involve a lot less tapping
//and be a lot more random
I64 i;
CBGR24 palette;
I64 SNEED;
I32 FEED;
if(!NeedForSneed) //By default if no args are passed, it assumes the user
{ //doesn't want or care for a seed.
goto Generate;
}
else //If a 1 is passed of course, we seed the RNG
{
SNEED = GodPick;
Seed(SNEED);
}
Generate:
for (i=0; i < 16; i++)
{
FEED = RandI32;
palette = FEED & 0xFFFFFF;
gr_palette[i] = palette;
LFBFlush;
}
}