mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
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:
parent
a551afdd90
commit
899c733ec1
1 changed files with 30 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue