Skip to content

Commit

Permalink
- fixed script warnings after updating to version 4.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Aug 3, 2022
1 parent 89e8d7a commit cac54d4
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion wadsrc/static/zscript.txt
@@ -1,4 +1,4 @@
version "4.3"
version "4.9"
#include "zscript/engine/base.zs"
#include "zscript/engine/dynarrays.zs"
#include "zscript/engine/inputevents.zs"
Expand Down
16 changes: 8 additions & 8 deletions wadsrc/static/zscript/engine/dynarrays.zs
Expand Up @@ -3,7 +3,7 @@

struct DynArray_I8 native
{
native readonly uint Size;
native readonly int Size;

native void Copy(DynArray_I8 other);
native void Move(DynArray_I8 other);
Expand All @@ -23,7 +23,7 @@ struct DynArray_I8 native

struct DynArray_I16 native
{
native readonly uint Size;
native readonly int Size;

native void Copy(DynArray_I16 other);
native void Move(DynArray_I16 other);
Expand All @@ -43,7 +43,7 @@ struct DynArray_I16 native

struct DynArray_I32 native
{
native readonly uint Size;
native readonly int Size;

native void Copy(DynArray_I32 other);
native void Move(DynArray_I32 other);
Expand All @@ -64,7 +64,7 @@ struct DynArray_I32 native

struct DynArray_F32 native
{
native readonly uint Size;
native readonly int Size;

native void Copy(DynArray_F32 other);
native void Move(DynArray_F32 other);
Expand All @@ -84,7 +84,7 @@ struct DynArray_F32 native

struct DynArray_F64 native
{
native readonly uint Size;
native readonly int Size;

native void Copy(DynArray_F64 other);
native void Move(DynArray_F64 other);
Expand All @@ -104,7 +104,7 @@ struct DynArray_F64 native

struct DynArray_Ptr native
{
native readonly uint Size;
native readonly int Size;

native void Copy(DynArray_Ptr other);
native void Move(DynArray_Ptr other);
Expand All @@ -124,7 +124,7 @@ struct DynArray_Ptr native

struct DynArray_Obj native
{
native readonly uint Size;
native readonly int Size;

native void Copy(DynArray_Obj other);
native void Move(DynArray_Obj other);
Expand All @@ -144,7 +144,7 @@ struct DynArray_Obj native

struct DynArray_String native
{
native readonly uint Size;
native readonly int Size;

native void Copy(DynArray_String other);
native void Move(DynArray_String other);
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/engine/ui/menu/colorpickermenu.zs
Expand Up @@ -303,7 +303,7 @@ class ColorpickerMenu : OptionMenu
}
// Make sure the cursors stand out against similar colors
// by pulsing them.
blinky = abs(sin(MSTime()/1000.0)) * 0.5 + 0.5;
blinky = abs(sin(MSTimeF()/1000.0)) * 0.5 + 0.5;
col = Color(255, int(r*blinky), int(g*blinky), int(b*blinky));

screen.Clear (box_x, box_y, box_x + w, box_y + 1, col);
Expand Down
4 changes: 2 additions & 2 deletions wadsrc/static/zscript/engine/ui/menu/imagescroller.zs
Expand Up @@ -154,7 +154,7 @@ class ImageScrollerMenu : Menu
{
if (AnimatedTransition)
{
start = MSTime() * (120. / 1000.);
start = MSTimeF() * (120. / 1000.);
length = 30;
dir = animtype;
previous = current;
Expand Down Expand Up @@ -247,7 +247,7 @@ class ImageScrollerMenu : Menu

private bool DrawTransition()
{
double now = MSTime() * (120. / 1000.);
double now = MSTimeF() * (120. / 1000.);
if (now < start + length)
{
double factor = screen.GetWidth()/2;
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/games/blood/ui/menu.zs
Expand Up @@ -64,7 +64,7 @@ class ListMenuItemBloodTextItem : ListMenuItemTextItem
int cr = generic_ui? Font.CR_GRAY : Font.CR_NATIVEPAL;
int trans = generic_ui? 0 : Translation.MakeID(Translation_Remap, pal);

if (selected) shade = 32 - ((MSTime() * 120 / 1000) & 63);
if (selected) shade = 32 - ((int(MSTimeF()) * 120 / 1000) & 63);

Screen.DrawText(gamefont, Font.CR_UNTRANSLATED, xpos+1, mYpos+1, mText, DTA_Color, 0xff000000, DTA_FullscreenScale, FSMode_Fit320x200);
Screen.DrawText(gamefont, Font.CR_NATIVEPAL, xpos, mYpos, mText, DTA_TranslationIndex, trans, DTA_Color, Raze.shadeToLight(shade), DTA_FullscreenScale, FSMode_Fit320x200);
Expand Down
10 changes: 5 additions & 5 deletions wadsrc/static/zscript/games/duke/ui/menu.zs
Expand Up @@ -60,7 +60,7 @@ class DukeMenuDelegate : RazeMenuDelegate

void DrawCursor(double x, double y, double scale, bool right)
{
uint mclock = MSTime() * 120 / 1000;
uint mclock = uint(MSTimeF() * (120. / 1000.));
uint frames = (gameinfo.gametype & GAMEFLAG_RRALL) ? 16 : 7;
String picname;
if (!right) picname= String.Format("SPINNINGNUKEICON%d", ((mclock >> 3) % frames));
Expand Down Expand Up @@ -136,8 +136,8 @@ class ListMenuItemDukeLogo : ListMenuItem
Screen.DrawTexture(TexMan.CheckForTexture("INGAMEDUKETHREEDEE"), false, x, 29, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_CenterOffsetRel, true);
if (gameinfo.gametype & GAMEFLAG_PLUTOPAK)
{
int mclock = MSTime() * 120 / 1000;
int light = 223 + Raze.bsin(mclock<<4, -9);
let mclock = MSTimeF() * 120 / 1000;
int light = 223 + Raze.bsin(mclock * 16, -9);
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);
}
Expand Down Expand Up @@ -175,8 +175,8 @@ class ListMenuItemDukeTextItem : ListMenuItemTextItem

if (selected)
{
int mclock = MSTime() * 120 / 1000;
int light = 231 + ((Raze.bsin(mclock<<5) * 3) >> 11);
let mclock = MSTimeF() * 120 / 1000;
int light = 231 + ((Raze.bsin(mclock * 32) * 3) >> 11);
pe = Color(255, light, light, light);
}
else
Expand Down
4 changes: 2 additions & 2 deletions wadsrc/static/zscript/games/exhumed/ui/menu.zs
Expand Up @@ -96,7 +96,7 @@ class ListMenuItemExhumedTextItem : ListMenuItemTextItem
int width = myfont.StringWidth(mText);
let delegate = ExhumedMenuDelegate(menuDelegate);
double zoom = 1.;
let now = MSTime();
let now = MSTimeF();

if (delegate && (delegate.zoomsize < 1. || delegate.lastzoomsize < 1.))
{
Expand Down Expand Up @@ -143,7 +143,7 @@ class ExhumedMainMenu : ListMenu
delegate.lastzoomsize = delegate.zoomsize;
if (delegate.zoomsize < 1.)
{
delegate.zoomtime = MSTime();
delegate.zoomtime = MSTimeF();
delegate.zoomsize += 0.0625;
if (delegate.zoomsize >= 1.)
delegate.zoomsize = 1.;
Expand Down

0 comments on commit cac54d4

Please sign in to comment.