mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
palette generation cleanup
This commit is contained in:
parent
899c733ec1
commit
7da26fdde9
1 changed files with 13 additions and 34 deletions
|
@ -1,43 +1,22 @@
|
||||||
|
public U0 PaletteGod(Bool seedUse=TRUE, Bool instant=TRUE)
|
||||||
public U0 PaletteGodGenerate()
|
|
||||||
{
|
{
|
||||||
|
// Instantly generate a random palette, seed-based or not
|
||||||
I64 i;
|
I64 i;
|
||||||
CBGR24 palette;
|
CBGR24 palette;
|
||||||
|
I32 color;
|
||||||
|
|
||||||
for (i = 0; i < 16; i++)
|
if (seedUse)
|
||||||
{
|
Seed(GodPick);
|
||||||
palette = GodPick & 0xFFFFFF;
|
|
||||||
gr_palette[i] = palette;
|
|
||||||
LFBFlush;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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++)
|
for (i=0; i < 16; i++)
|
||||||
{
|
{
|
||||||
FEED = RandI32;
|
if (instant || seedUse)
|
||||||
palette = FEED & 0xFFFFFF;
|
{
|
||||||
|
color = RandI32;
|
||||||
|
palette = color & 0xFFFFFF;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
palette = GodPick & 0xFFFFFF;
|
||||||
|
}
|
||||||
gr_palette[i] = palette;
|
gr_palette[i] = palette;
|
||||||
LFBFlush;
|
LFBFlush;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue