mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-13 19:40:43 +00:00
- Replace calcSinTableValue()
with game's native bsin()
export.
* Also repair light for Duke's `DrawCursor()` with a multiply and shift down to get the `bsin()` output up to 24 and not 21.33 etc
This commit is contained in:
parent
ced8a83331
commit
1685890bc5
3 changed files with 4 additions and 9 deletions
|
@ -65,7 +65,7 @@ class DukeMenuDelegate : RazeMenuDelegate
|
||||||
String picname;
|
String picname;
|
||||||
if (!right) picname= String.Format("SPINNINGNUKEICON%d", ((mclock >> 3) % frames));
|
if (!right) picname= String.Format("SPINNINGNUKEICON%d", ((mclock >> 3) % frames));
|
||||||
else picname = String.Format("SPINNINGNUKEICON%d", frames - 1 - ((frames - 1 + (mclock >> 3)) % frames));
|
else picname = String.Format("SPINNINGNUKEICON%d", frames - 1 - ((frames - 1 + (mclock >> 3)) % frames));
|
||||||
int light = 231 + (Raze.calcSinTableValue(mclock<<5) / 768.);
|
int light = 231 + ((Raze.bsin(mclock<<5) * 3) >> 11);
|
||||||
let pe = color(255, light, light, light);
|
let pe = color(255, light, light, light);
|
||||||
Screen.DrawTexture(TexMan.CheckForTexture(picname), false, x, y, DTA_FullscreenScale, FSMode_Fit320x200, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_Color, pe, DTA_CenterOffsetRel, true);
|
Screen.DrawTexture(TexMan.CheckForTexture(picname), false, x, y, DTA_FullscreenScale, FSMode_Fit320x200, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_Color, pe, DTA_CenterOffsetRel, true);
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ class ListMenuItemDukeLogo : ListMenuItem
|
||||||
if (gameinfo.gametype & GAMEFLAG_PLUTOPAK)
|
if (gameinfo.gametype & GAMEFLAG_PLUTOPAK)
|
||||||
{
|
{
|
||||||
int mclock = MSTime() * 120 / 1000;
|
int mclock = MSTime() * 120 / 1000;
|
||||||
int light = 223 + (Raze.calcSinTableValue(mclock<<4) / 512.);
|
int light = 223 + (Raze.bsin(mclock<<4) >> 9);
|
||||||
let pe = Color(255, light, light, light);
|
let pe = Color(255, light, light, light);
|
||||||
Screen.DrawTexture(TexMan.CheckForTexture("MENUPLUTOPAKSPRITE"), false, x + 100, 36, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_Color, pe, DTA_CenterOffsetRel, true);
|
Screen.DrawTexture(TexMan.CheckForTexture("MENUPLUTOPAKSPRITE"), false, x + 100, 36, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_Color, pe, DTA_CenterOffsetRel, true);
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ class ListMenuItemDukeTextItem : ListMenuItemTextItem
|
||||||
if (selected)
|
if (selected)
|
||||||
{
|
{
|
||||||
int mclock = MSTime() * 120 / 1000;
|
int mclock = MSTime() * 120 / 1000;
|
||||||
int light = 231 + (Raze.calcSinTableValue(mclock<<5) / 512.);
|
int light = 231 + (Raze.bsin(mclock<<5) >> 9);
|
||||||
pe = Color(255, light, light, light);
|
pe = Color(255, light, light, light);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -101,7 +101,7 @@ class ListMenuItemExhumedTextItem : ListMenuItemTextItem
|
||||||
double y = mYpos + v.y / 2;
|
double y = mYpos + v.y / 2;
|
||||||
|
|
||||||
int shade;
|
int shade;
|
||||||
if (selected) shade = Raze.CalcSinTableValue(MSTime() * 16 * 120 / 1000) >> 9;
|
if (selected) shade = Raze.bsin(MSTime() * 16 * 120 / 1000) >> 9;
|
||||||
else if (Selectable()) shade = 0;
|
else if (Selectable()) shade = 0;
|
||||||
else shade = 25;
|
else shade = 25;
|
||||||
let color = Raze.shadeToLight(shade);
|
let color = Raze.shadeToLight(shade);
|
||||||
|
|
|
@ -135,11 +135,6 @@ struct Raze
|
||||||
{
|
{
|
||||||
const kAngleMask = 0x7FF;
|
const kAngleMask = 0x7FF;
|
||||||
const BAngToDegree = 360. / 2048.;
|
const BAngToDegree = 360. / 2048.;
|
||||||
|
|
||||||
static int calcSinTableValue(int ang)
|
|
||||||
{
|
|
||||||
return int(16384 * sin((360./2048) * ang));
|
|
||||||
}
|
|
||||||
|
|
||||||
native static Color shadeToLight(int shade);
|
native static Color shadeToLight(int shade);
|
||||||
native static String PlayerName(int i);
|
native static String PlayerName(int i);
|
||||||
|
|
Loading…
Reference in a new issue