From 785f72d6eb257dd3392a5962c3310503890b53ba Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Sat, 13 Dec 2014 15:59:27 -0600 Subject: [PATCH] - Renamed RClamp to Pick. --- src/namedef.h | 2 +- src/sc_man_scanner.re | 2 +- src/sc_man_tokens.h | 2 +- src/thingdef/thingdef_exp.cpp | 4 ++-- src/thingdef/thingdef_exp.h | 6 +++--- src/thingdef/thingdef_expression.cpp | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/namedef.h b/src/namedef.h index 7eef612c1..e0b7e8ba6 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -300,7 +300,7 @@ xx(CallACS) xx(Sqrt) xx(CheckClass) xx(IsPointerEqual) -xx(RClamp) +xx(Pick) // Various actor names which are used internally xx(MapSpot) diff --git a/src/sc_man_scanner.re b/src/sc_man_scanner.re index 2e25fb2f7..3a7f717a8 100644 --- a/src/sc_man_scanner.re +++ b/src/sc_man_scanner.re @@ -158,7 +158,7 @@ std2: 'random' { RET(TK_Random); } 'random2' { RET(TK_Random2); } 'frandom' { RET(TK_FRandom); } - 'rclamp' { RET(TK_RClamp); } + 'pick' { RET(TK_Pick); } L (L|D)* { RET(TK_Identifier); } diff --git a/src/sc_man_tokens.h b/src/sc_man_tokens.h index 62622cf00..1c22046c9 100644 --- a/src/sc_man_tokens.h +++ b/src/sc_man_tokens.h @@ -122,5 +122,5 @@ xx(TK_Array, "'array'") xx(TK_In, "'in'") xx(TK_SizeOf, "'sizeof'") xx(TK_AlignOf, "'alignof'") -xx(TK_RClamp, "'rclamp'") +xx(TK_Pick, "'pick'") #undef xx diff --git a/src/thingdef/thingdef_exp.cpp b/src/thingdef/thingdef_exp.cpp index 4cef24187..fd0936485 100644 --- a/src/thingdef/thingdef_exp.cpp +++ b/src/thingdef/thingdef_exp.cpp @@ -371,7 +371,7 @@ static FxExpression *ParseExpression0 (FScanner &sc, const PClass *cls) return new FxRandom(rng, min, max, sc); } - else if (sc.CheckToken(TK_RClamp)) + else if (sc.CheckToken(TK_Pick)) { FRandom *rng; @@ -392,7 +392,7 @@ static FxExpression *ParseExpression0 (FScanner &sc, const PClass *cls) FxExpression *max = ParseExpressionM(sc, cls); sc.MustGetToken(')'); - return new FxRClamp(rng, min, max, sc); + return new FxPick(rng, min, max, sc); } else if (sc.CheckToken(TK_FRandom)) { diff --git a/src/thingdef/thingdef_exp.h b/src/thingdef/thingdef_exp.h index 42e35489d..03e465c3a 100644 --- a/src/thingdef/thingdef_exp.h +++ b/src/thingdef/thingdef_exp.h @@ -559,7 +559,7 @@ public: // //========================================================================== -class FxRClamp : public FxExpression +class FxPick : public FxExpression { protected: FRandom * rng; @@ -567,8 +567,8 @@ protected: public: - FxRClamp(FRandom *, FxExpression *mi, FxExpression *ma, const FScriptPosition &pos); - ~FxRClamp(); + FxPick(FRandom *, FxExpression *mi, FxExpression *ma, const FScriptPosition &pos); + ~FxPick(); FxExpression *Resolve(FCompileContext&); ExpVal EvalExpression(AActor *self); diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 5a5510a0b..dc2cb2209 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -1696,7 +1696,7 @@ ExpVal FxRandom::EvalExpression (AActor *self) // // //========================================================================== -FxRClamp::FxRClamp(FRandom * r, FxExpression *mi, FxExpression *ma, const FScriptPosition &pos) +FxPick::FxPick(FRandom * r, FxExpression *mi, FxExpression *ma, const FScriptPosition &pos) : FxExpression(pos) { if (mi != NULL && ma != NULL) @@ -1715,7 +1715,7 @@ FxRClamp::FxRClamp(FRandom * r, FxExpression *mi, FxExpression *ma, const FScrip // //========================================================================== -FxRClamp::~FxRClamp() +FxPick::~FxPick() { SAFE_DELETE(min); SAFE_DELETE(max); @@ -1727,7 +1727,7 @@ FxRClamp::~FxRClamp() // //========================================================================== -FxExpression *FxRClamp::Resolve(FCompileContext &ctx) +FxExpression *FxPick::Resolve(FCompileContext &ctx) { CHECKRESOLVED(); if (min && max) @@ -1746,7 +1746,7 @@ FxExpression *FxRClamp::Resolve(FCompileContext &ctx) // //========================================================================== -ExpVal FxRClamp::EvalExpression(AActor *self) +ExpVal FxPick::EvalExpression(AActor *self) { ExpVal val; val.Type = VAL_Int;