Compare commits

...

5 Commits

Author SHA1 Message Date
an 37e4f2a68b somehow missed these files 2019-08-14 06:38:33 -04:00
an 8081cd640b style guide 2019-08-14 06:35:49 -04:00
an 62f0107abc tabs, not spaces 2019-08-14 06:32:51 -04:00
an c88d002505 style changes 2019-08-14 06:31:41 -04:00
an 6a1c2320a6 update style guide 2019-08-14 05:40:30 -04:00
73 changed files with 2564 additions and 2548 deletions

View File

@ -7,116 +7,113 @@ as it is merely a look into the global constant state table.
``` ```
struct State struct State
{ {
readonly uint8 Frame; readonly uint8 Frame;
readonly State NextState; readonly State NextState;
readonly int Sprite; readonly int Sprite;
readonly int16 Tics; readonly int16 Tics;
readonly int Misc1; readonly int Misc1;
readonly int Misc2; readonly int Misc2;
readonly uint16 TicRange; readonly uint16 TicRange;
readonly uint8 UseFlags; readonly uint8 UseFlags;
readonly bool bCanRaise; readonly bool bCanRaise;
readonly bool bDeHackEd; readonly bool bDeHackEd;
readonly bool bFast; readonly bool bFast;
readonly bool bFullBright; readonly bool bFullBright;
readonly bool bNoDelay; readonly bool bNoDelay;
readonly bool bSameFrame; readonly bool bSameFrame;
readonly bool bSlow; readonly bool bSlow;
int DistanceTo(State other); int DistanceTo(State other);
bool InStateSequence(State base); bool InStateSequence(State base);
bool ValidateSpriteFrame(); bool ValidateSpriteFrame();
textureid, bool, vector2 GetSpriteTexture(int rotation, int skin = 0, vector2 scale = (0, 0)); textureid, bool, vector2 GetSpriteTexture(int rotation, int skin = 0, vector2 scale = (0, 0));
} }
``` ```
- `Frame` ### `Frame`
The sprite frame of this state. The sprite frame of this state.
- `NextState` ### `NextState`
A pointer to the next state in the global state table. A pointer to the next state in the global state table.
- `Sprite` ### `Sprite`
The sprite ID of this state. The sprite ID of this state.
- `Tics` ### `Tics`
The number of game ticks this state lasts. The number of game ticks this state lasts.
- `Misc1` ### `Misc1`, `Misc2`
- `Misc2`
Primarily used in DeHackEd compatibility. Don't use this. Primarily used in DeHackEd compatibility. Don't use this.
- `TicRange` ### `TicRange`
The maximum amount of tics to add for random tic durations, or `0` if the The maximum amount of tics to add for random tic durations, or `0` if the
duration is not random. For example, `TNT1 A random(5, 7)` would have a duration is not random. For example, `TNT1 A random(5, 7)` would have a `Tics`
`Tics` value of `5` and a `TicRange` of `2`. value of `5` and a `TicRange` of `2`.
- `UseFlags` ### `UseFlags`
The scope of this state. See *Action Scoping*. Can have any of the The scope of this state. See *Action Scoping*. Can have any of the
`DefaultStateUsage` flags. `DefaultStateUsage` flags.
- `bCanRaise` ### `bCanRaise`
State has the `CanRaise` flag, allowing `A_VileChase` to target this actor State has the `CanRaise` flag, allowing `A_VileChase` to target this actor for
for healing without entering an infinitely long state. healing without entering an infinitely long state.
- `bDeHackEd` ### `bDeHackEd`
`true` if the state has been modified by DeHackEd. `true` if the state has been modified by DeHackEd.
- `bFast` ### `bFast`
State has the `Fast` flag, halving the duration when fast monsters is State has the `Fast` flag, halving the duration when fast monsters is enabled.
enabled.
- `bFullBright` ### `bFullBright`
State has the `Bright` flag, making it fully bright regardless of other State has the `Bright` flag, making it fully bright regardless of other
lighting conditions. lighting conditions.
- `bNoDelay` ### `bNoDelay`
State has the `NoDelay` flag, forcing the associated action function to be State has the `NoDelay` flag, forcing the associated action function to be run
run if the actor is in its first tic. if the actor is in its first tic.
- `bSameFrame` ### `bSameFrame`
`true` if the state's frame is to be kept from the last frame used, i.e., is `true` if the state's frame is to be kept from the last frame used, i.e., is
`#`. `#`.
- `bSlow` ### `bSlow`
State has the `Slow` flag, doubling the duration when slow monsters is State has the `Slow` flag, doubling the duration when slow monsters is enabled.
enabled.
- `DistanceTo` ### `DistanceTo`
Returns the offset between this state and `other` in the global frame table. Returns the offset between this state and `other` in the global frame table.
Only works if both states are owned by the same actor. Only works if both states are owned by the same actor.
- `InStateSequence` ### `InStateSequence`
Returns `true` if this state is within a contiguous state sequence beginning Returns `true` if this state is within a contiguous state sequence beginning
with `base`. with `base`.
- `ValidateSpriteFrame` ### `ValidateSpriteFrame`
Returns `true` if the sprite frame actually exists. Returns `true` if the sprite frame actually exists.
- `GetSpriteTexture` ### `GetSpriteTexture`
Returns the texture, if the texture should be flipped horizontally, and Returns the texture, if the texture should be flipped horizontally, and scaling
scaling of this state's sprite. Scaling will return `scale` unless `skin` is of this state's sprite. Scaling will return `scale` unless `skin` is nonzero.
nonzero. `skin` determines the player skin used. `skin` determines the player skin used.
<!-- EOF --> <!-- EOF -->

View File

@ -9,96 +9,96 @@ variant of `TArray` existing in the engine.
``` ```
struct Array<Type> struct Array<Type>
{ {
uint Max() const; uint Max() const;
uint Size() const; uint Size() const;
void Append(array<Type> other); void Append(array<Type> other);
void Copy(array<Type> other); void Copy(array<Type> other);
void Move(array<Type> other); void Move(array<Type> other);
void Clear(); void Clear();
void Delete(uint index, int deletecount = 1); void Delete(uint index, int deletecount = 1);
bool Pop(); bool Pop();
uint Find(Type item) const; uint Find(Type item) const;
void Grow(uint amount); void Grow(uint amount);
void Insert(uint index, Type item); void Insert(uint index, Type item);
uint Push(Type item); uint Push(Type item);
uint Reserve(uint amount); uint Reserve(uint amount);
void Resize(uint amount); void Resize(uint amount);
void ShrinkToFit(); void ShrinkToFit();
} }
``` ```
- `Max` ### `Max`
Returns the amount of allocated objects in the array. Returns the amount of allocated objects in the array.
- `Size` ### `Size`
Returns the amount of constructed objects in the array. Returns the amount of constructed objects in the array.
- `Clear` ### `Clear`
Clears out the entire array, possibly destroying all objects in it. Clears out the entire array, possibly destroying all objects in it.
- `Delete` ### `Delete`
Removes `count` objects starting at `index`, possibly destroying them. Moves Removes `count` objects starting at `index`, possibly destroying them. Moves
objects after `index + count` to the left. objects after `index + count` to the left.
- `Pop` ### `Pop`
Removes the last item in the array, possibly destroying it. Returns `false` Removes the last item in the array, possibly destroying it. Returns `false` if
if there are no items in the array to begin with. there are no items in the array to begin with.
- `Append` ### `Append`
Value-copies another array's contents and places them into this array at the Value-copies another array's contents and places them into this array at the
end. end.
- `Copy` ### `Copy`
Value-copies another array's contents into this array. The contents of Value-copies another array's contents into this array. The contents of `other`
`other` are preserved. This operation can be extremely taxing in some cases. are preserved. This operation can be extremely taxing in some cases.
- `Move` ### `Move`
Moves another array's contents into this array. The contents of `other` are Moves another array's contents into this array. The contents of `other` are
left indeterminate and shall not be used. This operation is extremely fast left indeterminate and shall not be used. This operation is extremely fast
as it only copies pointers but must be used carefully to avoid error. as it only copies pointers but must be used carefully to avoid error.
- `Find` ### `Find`
Finds the index of `item` in the array, or `Size` if it couldn't be found. Finds the index of `item` in the array, or `Size` if it couldn't be found.
- `Grow` ### `Grow`
Ensures the array can hold at least `amount` new members, growing the Ensures the array can hold at least `amount` new members, growing the allocated
allocated object amount if necessary. object amount if necessary.
- `Insert` ### `Insert`
Inserts `item` at `index`. Moves objects after `index` to the right. Inserts `item` at `index`. Moves objects after `index` to the right.
- `Push` ### `Push`
Places `item` at the end of the array, calling `Grow` if necessary. Places `item` at the end of the array, calling `Grow` if necessary.
- `Reserve` ### `Reserve`
Adds `amount` new empty-constructed objects at the end of the array, Adds `amount` new empty-constructed objects at the end of the array, increasing
increasing `Size` and calling `Grow` if necessary. Value types are `Size` and calling `Grow` if necessary. Value types are initialized to zero and
initialized to zero and reference types to `null`. reference types to `null`.
- `Resize` ### `Resize`
Adds or removes objects based on `amount`. If it is less than `Size` then Adds or removes objects based on `amount`. If it is less than `Size` then
objects are destroyed, if it is more then objects are empty-constructed. New objects are destroyed, if it is more then objects are empty-constructed. New
objects follow the same initialization rules as `Reserve`. objects follow the same initialization rules as `Reserve`.
- `ShrinkToFit` ### `ShrinkToFit`
Shrinks `Max` to `Size`. Does not mutate any objects in the array. Shrinks `Max` to `Size`. Does not mutate any objects in the array.
<!-- EOF --> <!-- EOF -->

View File

@ -9,77 +9,74 @@ as they aren't "strongly" typed.
``` ```
struct CVar struct CVar
{ {
static CVar FindCVar(name n); static CVar FindCVar(name n);
static CVar GetCVar(name n, PlayerInfo player = null); static CVar GetCVar(name n, PlayerInfo player = null);
bool GetBool(); bool GetBool();
double GetFloat(); double GetFloat();
int GetInt(); int GetInt();
string GetString(); string GetString();
void SetBool(bool v); void SetBool(bool v);
void SetFloat(double v); void SetFloat(double v);
void SetInt(int v); void SetInt(int v);
void SetString(string v); void SetString(string v);
int GetRealType(); int GetRealType();
int ResetToDefault(); int ResetToDefault();
} }
``` ```
- `FindCVar` ### `FindCVar`
Returns a server CVar by name, or `null` if none is found. Returns a server CVar by name, or `null` if none is found.
- `GetCVar` ### `GetCVar`
Returns a user or server CVar by name, with `player` as the user if Returns a user or server CVar by name, with `player` as the user if applicable,
applicable, or `null` if none is found. or `null` if none is found.
- `GetBool` ### `GetBool`
Returns a boolean representing the value of the CVar, or `false` if it Returns a boolean representing the value of the CVar, or `false` if it
cannot be represented. cannot be represented.
- `GetFloat` ### `GetFloat`
Returns a float representing the value of the CVar, or `0.0` if it cannot be Returns a float representing the value of the CVar, or `0.0` if it cannot be
represented. represented.
- `GetInt` ### `GetInt`
Returns an integer representing the value of the CVar, or `0` if it cannot Returns an integer representing the value of the CVar, or `0` if it cannot be
be represented. represented.
- `GetString` ### `GetString`
Returns a string representing the value of the CVar. CVars can always be Returns a string representing the value of the CVar. CVars can always be
represented as strings. represented as strings.
- `SetBool` ### `SetBool`, `SetFloat`, `SetInt`, `SetString`
- `SetFloat`
- `SetInt`
- `SetString`
Sets the representation of the CVar to `v`. May only be used on mod-defined Sets the representation of the CVar to `v`. May only be used on mod-defined
CVars. CVars.
- `GetRealType` ### `GetRealType`
Returns the type of the CVar as it was defined, which may be one of the Returns the type of the CVar as it was defined, which may be one of the
following: following:
| Name | | Name |
| ---- | | ---- |
| `CVar.CVAR_BOOL` | | `CVar.CVAR_BOOL` |
| `CVar.CVAR_COLOR | | `CVar.CVAR_COLOR` |
| `CVar.CVAR_FLOAT` | | `CVar.CVAR_FLOAT` |
| `CVar.CVAR_INT` | | `CVar.CVAR_INT` |
| `CVar.CVAR_STRING` | | `CVar.CVAR_STRING` |
- `ResetToDefault` ### `ResetToDefault`
Resets the CVar to its default value and returns 0. The purpose of the Resets the CVar to its default value and returns 0. The purpose of the
return is unknown. May only be used on mod-defined CVars. return is unknown. May only be used on mod-defined CVars.
<!-- EOF --> <!-- EOF -->

View File

@ -6,7 +6,7 @@ range 0 to 255, inclusive.
``` ```
struct Color struct Color
{ {
uint8 r, g, b, a; uint8 r, g, b, a;
} }
``` ```

View File

@ -5,12 +5,12 @@ Fixed-size arrays have a size method attached to them for convenience purposes.
``` ```
struct Type[N] struct Type[N]
{ {
uint Size() const; uint Size() const;
} }
``` ```
- `Size` ### `Size`
Returns the size of the array. This is a compile-time constant. Returns the size of the array. This is a compile-time constant.
<!-- EOF --> <!-- EOF -->

View File

@ -5,45 +5,45 @@ The base class of all `class` types.
``` ```
class Object class Object
{ {
bool bDestroyed; bool bDestroyed;
class GetClass(); class GetClass();
string GetClassName(); string GetClassName();
class GetParentClass(); class GetParentClass();
virtualscope void Destroy(); virtualscope void Destroy();
virtual virtualscope void OnDestroy(); virtual virtualscope void OnDestroy();
} }
``` ```
- `bDestroyed` ### `bDestroyed`
This object wants to be destroyed but has not yet been garbage collected. This object wants to be destroyed but has not yet been garbage collected.
- `GetClass` ### `GetClass`
Returns the class type of this object. Returns the class type of this object.
- `GetClassName` ### `GetClassName`
Returns a string representation of the class type of this object. Returns a string representation of the class type of this object.
- `GetParentClass` ### `GetParentClass`
Returns the class type of this object's parent class. Returns the class type of this object's parent class.
- `Destroy` ### `Destroy`
Destroys this object. Do not use the object after calling this. References Destroys this object. Do not use the object after calling this. References to
to it will be invalidated. it will be invalidated.
- `OnDestroy` ### `OnDestroy`
Called just before the object is collected by the garbage collector. **Not Called just before the object is collected by the garbage collector. **Not
deterministic** unless the object is linked into the thinker list, in which deterministic** unless the object is linked into the thinker list, in which
case it is destroyed earlier in a deterministic setting. Not all `Thinker`s case it is destroyed earlier in a deterministic setting. Not all `Thinker`s are
are linked into this list, so be careful when overriding this. Any `Actor` linked into this list, so be careful when overriding this. Any `Actor` will
will generally be safe. generally be safe.
<!-- EOF --> <!-- EOF -->

View File

@ -5,109 +5,107 @@ Strings have many methods attached to them for manipulating text.
``` ```
struct String struct String
{ {
static vararg string Format(string format, ...); static vararg string Format(string format, ...);
vararg void AppendFormat(string format, ...); vararg void AppendFormat(string format, ...);
string CharAt(int pos) const; string CharAt(int pos) const;
int CharCodeAt(int pos) const; int CharCodeAt(int pos) const;
string Filter(); string Filter();
int IndexOf(string substr, int startIndex = 0) const; int IndexOf(string substr, int startIndex = 0) const;
string Left(int len) const; string Left(int len) const;
uint Length() const; uint Length() const;
string Mid(int pos = 0, int len = int.Max) const; string Mid(int pos = 0, int len = int.Max) const;
void Remove(int index, int amount); void Remove(int index, int amount);
void Replace(string pattern, string replacement); void Replace(string pattern, string replacement);
int RightIndexOf(string substr, int endIndex = int.Max) const; int RightIndexOf(string substr, int endIndex = int.Max) const;
void Split(out array<string> tokens, string delimiter, EmptyTokenType keepEmpty = TOK_KEEPEMPTY) const; void Split(out array<string> tokens, string delimiter, EmptyTokenType keepEmpty = TOK_KEEPEMPTY) const;
double ToDouble() const; double ToDouble() const;
int ToInt(int base = 0) const; int ToInt(int base = 0) const;
void ToLower(); void ToLower();
void ToUpper(); void ToUpper();
void Truncate(int newlen); void Truncate(int newlen);
deprecated("3.5.1") int LastIndexOf(string substr, int endIndex = int.Max) const; deprecated("3.5.1") int LastIndexOf(string substr, int endIndex = int.Max) const;
} }
``` ```
- `Format` ### `Format`
Creates a string using a format string and any amount of arguments. Creates a string using a format string and any amount of arguments.
- `AppendFormat` ### `AppendFormat`
Works like `Format`, but appends the result to the string. Works like `Format`, but appends the result to the string.
- `CharAt` ### `CharAt`
Returns the character at `pos` as a new string. Returns the character at `pos` as a new string.
- `CharCodeAt` ### `CharCodeAt`
Returns the character at `pos` as an integer. Returns the character at `pos` as an integer.
- `Filter` ### `Filter`
Replaces escape sequences in a string with escaped characters as a new Replaces escape sequences in a string with escaped characters as a new string.
string.
- `IndexOf` ### `IndexOf`
Returns the first index of `substr` starting from the left at `start`. Returns the first index of `substr` starting from the left at `start`.
- `Left` ### `Left`
Returns the first `len` characters as a new string. Returns the first `len` characters as a new string.
- `Length` ### `Length`
Returns the number of characters in this string. Returns the number of characters in this string.
- `Mid` ### `Mid`
Returns `len` characters starting at `pos` as a new string. Returns `len` characters starting at `pos` as a new string.
- `Remove` ### `Remove`
Removes `amount` characters starting at `index` in place. Removes `amount` characters starting at `index` in place.
- `Replace` ### `Replace`
Replaces all instances of `pattern` with `replacement` in place. Replaces all instances of `pattern` with `replacement` in place.
- `RightIndexOf` ### `RightIndexOf`
Returns the first index of `substr` starting from the right at `end`. Returns the first index of `substr` starting from the right at `end`.
- `Split` ### `Split`
Splits the string by each `delimiter` into `tokens`. `keepEmpty` may be Splits the string by each `delimiter` into `tokens`. `keepEmpty` may be either
either `TOK_SKIPEMPTY` (the default) or `TOK_KEEPEMPTY`, which will keep or `TOK_SKIPEMPTY` (the default) or `TOK_KEEPEMPTY`, which will keep or discard
discard empty strings found while splitting. empty strings found while splitting.
- `ToDouble` ### `ToDouble`
Interprets the string as a double precision floating point number. Interprets the string as a double precision floating point number.
- `ToInt` ### `ToInt`
Interprets the string as a base `base` integer, guessing the base if it is Interprets the string as a base `base` integer, guessing the base if it is `0`.
`0`.
- `ToLower` ### `ToLower`
Converts all characters in the string to lowercase in place. Converts all characters in the string to lowercase in place.
- `ToUpper` ### `ToUpper`
Converts all characters in the string to uppercase in place. Converts all characters in the string to uppercase in place.
- `Truncate` ### `Truncate`
Truncates the string to `len` characters in place. Truncates the string to `len` characters in place.
- `LastIndexOf` ### `LastIndexOf`
Broken. Use `RightIndexOf` instead. Broken. Use `RightIndexOf` instead.
<!-- EOF --> <!-- EOF -->

View File

@ -5,16 +5,15 @@ The localized string table as defined by `LANGUAGE`.
``` ```
struct StringTable struct StringTable
{ {
static string Localize(string val, bool prefixed = true); static string Localize(string val, bool prefixed = true);
} }
``` ```
- `Localize` ### `Localize`
Returns the localized variant of `val`. If `prefixed` is `true`, the string Returns the localized variant of `val`. If `prefixed` is `true`, the string is
is returned as-is unless it is prefixed with `$` where the `$` character returned as-is unless it is prefixed with `$` where the `$` character itself is
itself is ignored. **Not deterministic** unless there is only one variant of ignored. **Not deterministic** unless there is only one variant of `val`. This
`val`. This is generally fine because this should only be used for visual is generally fine because this should only be used for visual strings anyway.
strings anyway.
<!-- EOF --> <!-- EOF -->

View File

@ -13,8 +13,8 @@ The user-defined stat numbers begin at `Thinker.STAT_USER` and end at
except as relative to these two. except as relative to these two.
<!-- <!--
NOTE: These tables are not alphabetically organized as their ordering is NOTE: These tables are not alphabetically organized as their ordering is
meaningful. meaningful.
--> -->
Thinkers which do not think and are elided from many checks: Thinkers which do not think and are elided from many checks:
@ -52,43 +52,43 @@ Thinkers which do think and are mandatory to many checks:
``` ```
class Thinker : Object play class Thinker : Object play
{ {
const TICRATE; const TICRATE;
LevelLocals Level; LevelLocals Level;
void ChangeStatNum(int stat); void ChangeStatNum(int stat);
virtual void PostBeginPlay(); virtual void PostBeginPlay();
virtual void Tick(); virtual void Tick();
static clearscope int Tics2Seconds(int tics); static clearscope int Tics2Seconds(int tics);
} }
``` ```
- `TICRATE` ### `TICRATE`
The number of game ticks in a second. This value is always `int(35)`. The number of game ticks in a second. This value is always `int(35)`.
- `Level` ### `Level`
The level this `Thinker` is in, which may differ from another one's. The level this `Thinker` is in, which may differ from another one's.
- `ChangeStatNum` ### `ChangeStatNum`
Changes the statnum of this `Thinker`. Changes the statnum of this `Thinker`.
- `PostBeginPlay` ### `PostBeginPlay`
Called at the very end of this Thinker's initialization. Called at the very end of this Thinker's initialization.
- `Tick` ### `Tick`
Called every game tick. The order between this thinker's `Tick` and every Called every game tick. The order between this thinker's `Tick` and every other
other thinker in the same statnum is unspecified. thinker in the same statnum is unspecified.
- `Tics2Seconds` ### `Tics2Seconds`
Roughly converts a number of tics to an integral amount of seconds. Roughly converts a number of tics to an integral amount of seconds. Equivalent
Equivalent to `tics / TICRATE`. to `tics / TICRATE`.
<!-- EOF --> <!-- EOF -->

View File

@ -6,28 +6,28 @@ operator.
``` ```
struct Vector2 struct Vector2
{ {
double x, y; double x, y;
double Length() const; double Length() const;
vector2 Unit() const; vector2 Unit() const;
} }
struct Vector3 struct Vector3
{ {
double x, y, z; double x, y, z;
vector2 xy; vector2 xy;
double Length() const; double Length() const;
vector3 Unit() const; vector3 Unit() const;
} }
``` ```
- `Length` ### `Length`
Returns the length (magnitude) of the vector. Returns the length (magnitude) of the vector.
- `Unit` ### `Unit`
Returns a normalized vector. Equivalent to `vec / vec.Length()`. Returns a normalized vector. Equivalent to `vec / vec.Length()`.
<!-- EOF --> <!-- EOF -->

View File

@ -6,22 +6,22 @@ fit the screen and clipping region.
``` ```
class BrokenLines : Object class BrokenLines : Object
{ {
int Count(); int Count();
string StringAt(int line); string StringAt(int line);
int StringWidth(int line); int StringWidth(int line);
} }
``` ```
- `Count` ### `Count`
Returns the amount of lines in this container. Returns the amount of lines in this container.
- `StringAt` ### `StringAt`
Returns the text of line `line`. Returns the text of line `line`.
- `StringWidth` ### `StringWidth`
Returns the width (in pixels) of line `line`. Returns the width (in pixels) of line `line`.
<!-- EOF --> <!-- EOF -->

View File

@ -5,28 +5,27 @@ Basic access to console functionality.
``` ```
struct Console struct Console
{ {
static void HideConsole(); static void HideConsole();
static void MidPrint(Font font, string text, bool bold = false); static void MidPrint(Font font, string text, bool bold = false);
static vararg void PrintF(string fmt, ...); static vararg void PrintF(string fmt, ...);
} }
``` ```
- `HideConsole` ### `HideConsole`
Hides the console if it is open and `GameState` is not `GS_FULLCONSOLE`. Hides the console if it is open and `GameState` is not `GS_FULLCONSOLE`.
- `MidPrint` ### `MidPrint`
Prints `text` (possibly a `LANGUAGE` string if prefixed with `$`) in `font` Prints `text` (possibly a `LANGUAGE` string if prefixed with `$`) in `font` to
to the middle of the screen for 1½ seconds. Will print even if the player is the middle of the screen for 1½ seconds. Will print even if the player is a
a spectator if `bold` is `true`. Uses the `msgmidcolor` CVar for non-bold spectator if `bold` is `true`. Uses the `msgmidcolor` CVar for non-bold
messages and `msgmidcolor2` for bold messages. messages and `msgmidcolor2` for bold messages.
This is the function used internally by ACS' `Print` and `PrintBold` This is the function used internally by ACS' `Print` and `PrintBold` functions.
functions.
- `PrintF` ### `PrintF`
Prints a formatted string to the console. Prints a formatted string to the console.
<!-- EOF --> <!-- EOF -->

View File

@ -6,56 +6,56 @@ not use as a member unless marked as `transient`.**
``` ```
struct Font struct Font
{ {
static Font FindFont(name fontname); static Font FindFont(name fontname);
static int FindFontColor(name color); static int FindFontColor(name color);
static Font GetFont(name fontname); static Font GetFont(name fontname);
double GetBottomAlignOffset(int code); double GetBottomAlignOffset(int code);
int GetCharWidth(int code); int GetCharWidth(int code);
string GetCursor(); string GetCursor();
int GetHeight(); int GetHeight();
int StringWidth(string code); int StringWidth(string code);
BrokenLines BreakLines(string text, int maxlen); BrokenLines BreakLines(string text, int maxlen);
} }
``` ```
- `FindFont` ### `FindFont`
Gets a font as defined in `FONTDEFS`. Gets a font as defined in `FONTDEFS`.
- `FindFontColor` ### `FindFontColor`
Returns the color range enumeration for a named color. Returns the color range enumeration for a named color.
- `GetFont` ### `GetFont`
Gets a font either as defined in `FONTDEFS` or a ZDoom/bitmap font. Gets a font either as defined in `FONTDEFS` or a ZDoom/bitmap font.
- `GetBottomAlignOffset` ### `GetBottomAlignOffset`
Returns the baseline for the character `code`. Returns the baseline for the character `code`.
- `GetCharWidth` ### `GetCharWidth`
Returns the width in pixels of a character code. Returns the width in pixels of a character code.
- `GetCursor` ### `GetCursor`
Returns the string used as a blinking cursor graphic for this font. Returns the string used as a blinking cursor graphic for this font.
- `GetHeight` ### `GetHeight`
Returns the line height of the font. Returns the line height of the font.
- `StringWidth` ### `StringWidth`
Returns the width in pixels of the string. Returns the width in pixels of the string.
- `BreakLines` ### `BreakLines`
Breaks `text` up into a `BrokenLines` structure according to the screen and Breaks `text` up into a `BrokenLines` structure according to the screen and
clip region, as well as appropriately accounting for a maximum width in clip region, as well as appropriately accounting for a maximum width in pixels
pixels of `maxlen`. of `maxlen`.
<!-- EOF --> <!-- EOF -->

View File

@ -5,17 +5,17 @@ A font as defined in `MAPINFO`/GameInfo.
``` ```
struct GIFont struct GIFont
{ {
name Color; name Color;
name FontName; name FontName;
} }
``` ```
- `Color` ### `Color`
The color of the font. The color of the font.
- `FontName` ### `FontName`
The name of the font. The name of the font.
<!-- EOF --> <!-- EOF -->

View File

@ -8,169 +8,168 @@ Note: There are no longer any fully paletted renderers in GZDoom as of version
``` ```
struct Screen struct Screen
{ {
static vararg void DrawChar(Font font, int cr, double x, double y, int character, ...); static vararg void DrawChar(Font font, int cr, double x, double y, int character, ...);
static vararg void DrawShape(textureid tex, bool animate, Shape2D s, ...); static vararg void DrawShape(textureid tex, bool animate, Shape2D s, ...);
static vararg void DrawText(Font font, int cr, double x, double y, string text, ...); static vararg void DrawText(Font font, int cr, double x, double y, string text, ...);
static vararg void DrawTexture(textureid tex, bool animate, double x, double y, ...); static vararg void DrawTexture(textureid tex, bool animate, double x, double y, ...);
static void Clear(int left, int top, int right, int bottom, color cr, int palcolor = -1); static void Clear(int left, int top, int right, int bottom, color cr, int palcolor = -1);
static void Dim(color cr, double amount, int x, int y, int w, int h); static void Dim(color cr, double amount, int x, int y, int w, int h);
static void DrawFrame(int x, int y, int w, int h); static void DrawFrame(int x, int y, int w, int h);
static void DrawLine(int x0, int y0, int x1, int y1, color cr, int alpha = 255); static void DrawLine(int x0, int y0, int x1, int y1, color cr, int alpha = 255);
static void DrawThickLine(int x0, int y0, int x1, int y1, double thickness, color cr, int alpha = 255); static void DrawThickLine(int x0, int y0, int x1, int y1, double thickness, color cr, int alpha = 255);
static double GetAspectRatio(); static double GetAspectRatio();
static int GetHeight(); static int GetHeight();
static int GetWidth(); static int GetWidth();
static color PaletteColor(int index); static color PaletteColor(int index);
static vector2, vector2 VirtualToRealCoords(vector2 pos, vector2 size, vector2 vsize, bool vbottom = false, bool handleaspect = true); static vector2, vector2 VirtualToRealCoords(vector2 pos, vector2 size, vector2 vsize, bool vbottom = false, bool handleaspect = true);
static void ClearClipRect(); static void ClearClipRect();
static int, int, int, int GetClipRect(); static int, int, int, int GetClipRect();
static int, int, int, int GetViewWindow(); static int, int, int, int GetViewWindow();
static void SetClipRect(int x, int y, int w, int h); static void SetClipRect(int x, int y, int w, int h);
} }
``` ```
- `DrawChar` ### `DrawChar`
The same as `DrawTexture`, but draws the texture of character code The same as `DrawTexture`, but draws the texture of character code `character`
`character` from `font`. The output color may be modified by the font color from `font`. The output color may be modified by the font color `cr`.
`cr`.
- `DrawShape` ### `DrawShape`
TODO TODO
- `DrawText` ### `DrawText`
TODO TODO
- `DrawTexture` ### `DrawTexture`
Draws texture `tex`, possibly animated by the animation ticker if `animate` Draws texture `tex`, possibly animated by the animation ticker if `animate` is
is `true`, at horizontal position `x` and vertical position `y`. `true`, at horizontal position `x` and vertical position `y`.
Various properties of this drawing process can be changed by passing extra Various properties of this drawing process can be changed by passing extra
arguments to this function. After all arguments are parsed, the arguments to this function. After all arguments are parsed, the "`CleanMode`"
"`CleanMode`" internal variable is used along with the specified virtual internal variable is used along with the specified virtual width/height to
width/height to determine how to finally transform positions. `CleanMode` determine how to finally transform positions. `CleanMode` may be one of the
may be one of the following: following:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `DTA_BASE` | No position scaling is performed. | | `DTA_BASE` | No position scaling is performed. |
| `DTA_CLEAN` | Scales all positions by `Clean*Fac`. See the documentation for those variables for more information. | | `DTA_CLEAN` | Scales all positions by `Clean*Fac`. See the documentation for those variables for more information. |
| `DTA_CLEANNOMOVE` | Scales the destination width and height by `Clean*Fac`. | | `DTA_CLEANNOMOVE` | Scales the destination width and height by `Clean*Fac`. |
| `DTA_CLEANNOMOVE_1` | Scales the destination width and height by `Clean*Fac_1`. | | `DTA_CLEANNOMOVE_1` | Scales the destination width and height by `Clean*Fac_1`. |
| `DTA_FULLSCREEN` | Sets the X and Y positions to `0`. (Yes, really, this is all it does.) | | `DTA_FULLSCREEN` | Sets the X and Y positions to `0`. (Yes, really, this is all it does.) |
| `DTA_HUDRULES` | Scales all positions by the current status bar's scaling rules. | | `DTA_HUDRULES` | Scales all positions by the current status bar's scaling rules. |
| `DTA_HUDRULESC` | Scales all positions by the current status bar's scaling rules and centers the X position. | | `DTA_HUDRULESC` | Scales all positions by the current status bar's scaling rules and centers the X position. |
Here is a list of tags and their respective arguments which may be used: Here is a list of tags and their respective arguments which may be used:
| Name | Arguments | Description | | Name | Arguments | Description |
| ---- | --------- | ----------- | | ---- | --------- | ----------- |
| `DTA_320X200` | `bool use` | Sets `CleanMode` to `DTA_BASE` and the virtual width/height to `320`/`200` if `use` is `true`. Note that 320x200 does not scale properly to the screen as it must be 320x240 to do so. | | `DTA_320X200` | `bool use` | Sets `CleanMode` to `DTA_BASE` and the virtual width/height to `320`/`200` if `use` is `true`. Note that 320x200 does not scale properly to the screen as it must be 320x240 to do so. |
| `DTA_ALPHACHANNEL` | `bool use` | Does nothing unless `DTA_FILLCOLOR` is used and the render style is unspecified, in which case it will set the render style to "shaded" if `use` is `true`. | | `DTA_ALPHACHANNEL` | `bool use` | Does nothing unless `DTA_FILLCOLOR` is used and the render style is unspecified, in which case it will set the render style to "shaded" if `use` is `true`. |
| `DTA_ALPHA` | `double alpha` | Sets the alpha of the drawn texture to `alpha`. | | `DTA_ALPHA` | `double alpha` | Sets the alpha of the drawn texture to `alpha`. |
| `DTA_BOTTOM320X200` | `bool use` | Same as `DTA_320X200`, but also enables position transformation as if a call to `VirtualToRealCoords` with `vbottom` to `true`. Note that this is the only way to actually set this, but it may be overridden by following arguments to effectively toggle only this flag. | | `DTA_BOTTOM320X200` | `bool use` | Same as `DTA_320X200`, but also enables position transformation as if a call to `VirtualToRealCoords` with `vbottom` to `true`. Note that this is the only way to actually set this, but it may be overridden by following arguments to effectively toggle only this flag. |
| `DTA_CENTERBOTTOMOFFSET` | `bool use` | Same as `DTA_CENTERBOTTOMOFFSET`, but the Y offset is aligned to the bottom instead of the center. | | `DTA_CENTERBOTTOMOFFSET` | `bool use` | Same as `DTA_CENTERBOTTOMOFFSET`, but the Y offset is aligned to the bottom instead of the center. |
| `DTA_CENTEROFFSET` | `bool use` | Overrides the texture's X and Y offsets, centering them between the texture's height and width if `use` is `true`. | | `DTA_CENTEROFFSET` | `bool use` | Overrides the texture's X and Y offsets, centering them between the texture's height and width if `use` is `true`. |
| `DTA_CLEANNOMOVE1` | `bool use` | Sets `CleanMode` to `DTA_CLEANNOMOVE1` if `use` is `true`. | | `DTA_CLEANNOMOVE1` | `bool use` | Sets `CleanMode` to `DTA_CLEANNOMOVE1` if `use` is `true`. |
| `DTA_CLEANNOMOVE` | `bool use` | Sets `CleanMode` to `DTA_CLEANNOMOVE` if `use` is `true`. | | `DTA_CLEANNOMOVE` | `bool use` | Sets `CleanMode` to `DTA_CLEANNOMOVE` if `use` is `true`. |
| `DTA_CLEAN` | `bool use` | Sets `CleanMode` to `DTA_CLEAN` if `use` is `true`. | | `DTA_CLEAN` | `bool use` | Sets `CleanMode` to `DTA_CLEAN` if `use` is `true`. |
| `DTA_CLIPBOTTOM`, `DTA_CLIPTOP` | `int length` | Sets the vertical clipping for the texture. | | `DTA_CLIPBOTTOM`, `DTA_CLIPTOP` | `int length` | Sets the vertical clipping for the texture. |
| `DTA_CLIPLEFT`, `DTA_CLIPRIGHT` | `int length` | Sets the horizontal clipping for the texture. | | `DTA_CLIPLEFT`, `DTA_CLIPRIGHT` | `int length` | Sets the horizontal clipping for the texture. |
| `DTA_COLOROVERLAY` | `color cr` | Multiplies `cr` with the texture. Alpha determines the intensity of this overlay. Applied before render styles. | | `DTA_COLOROVERLAY` | `color cr` | Multiplies `cr` with the texture. Alpha determines the intensity of this overlay. Applied before render styles. |
| `DTA_COLOR` | `color cr` | Multiplies `cr` with the texture. Applied after render styles change the color. | | `DTA_COLOR` | `color cr` | Multiplies `cr` with the texture. Applied after render styles change the color. |
| `DTA_DESATURATE` | `int amount` | Desaturates the texture by `amount` (range 0-255.) | | `DTA_DESATURATE` | `int amount` | Desaturates the texture by `amount` (range 0-255.) |
| `DTA_DESTHEIGHTF`, `DTA_DESTWIDTHF` | `double size` | Same as `DTA_DESTHEIGHT`/`DTA_DESTWIDTH`, but with decimal arguments. | | `DTA_DESTHEIGHTF`, `DTA_DESTWIDTHF` | `double size` | Same as `DTA_DESTHEIGHT`/`DTA_DESTWIDTH`, but with decimal arguments. |
| `DTA_DESTHEIGHT`, `DTA_DESTWIDTH` | `int size` | Sets the resulting width or height on screen of the texture and sets `CleanMode` to `DTA_BASE`. | | `DTA_DESTHEIGHT`, `DTA_DESTWIDTH` | `int size` | Sets the resulting width or height on screen of the texture and sets `CleanMode` to `DTA_BASE`. |
| `DTA_FILLCOLOR` | `color cr` | Sets the render style to "stencil" if one is not specified and the fill color to `cr`. | | `DTA_FILLCOLOR` | `color cr` | Sets the render style to "stencil" if one is not specified and the fill color to `cr`. |
| `DTA_FLIPX`, `DTA_FLIPY` | `bool use` | Flips the X or Y position if `use` is `true`. | `DTA_FLIPX`, `DTA_FLIPY` | `bool use` | Flips the X or Y position if `use` is `true`.
| `DTA_FULLSCREEN` | `bool use` | Sets `CleanMode` to `DTA_FULLSCREEN` and the virtual width and height to the display size of the texture. | | `DTA_FULLSCREEN` | `bool use` | Sets `CleanMode` to `DTA_FULLSCREEN` and the virtual width and height to the display size of the texture. |
| `DTA_HUDRULES` | `int type` | Sets `CleanMode` to `DTA_HUDRULESC` if `type` is `BaseStatusBar.HUD_HORIZCENTER`, or `DTA_HUDRULES` if it is `BaseStatusBar.HUD_NORMAL`. | | `DTA_HUDRULES` | `int type` | Sets `CleanMode` to `DTA_HUDRULESC` if `type` is `BaseStatusBar.HUD_HORIZCENTER`, or `DTA_HUDRULES` if it is `BaseStatusBar.HUD_NORMAL`. |
| `DTA_KEEPRATIO` | `bool on` | Enables aspect ratio correction if `on` is `true`. | | `DTA_KEEPRATIO` | `bool on` | Enables aspect ratio correction if `on` is `true`. |
| `DTA_LEFTOFFSETF`, `DTA_TOPOFFSETF` | `double ofs` | Same as `DTA_LEFTOFFSET`/`DTA_TOPOFFSETF`, but with decimal arguments. | | `DTA_LEFTOFFSETF`, `DTA_TOPOFFSETF` | `double ofs` | Same as `DTA_LEFTOFFSET`/`DTA_TOPOFFSETF`, but with decimal arguments. |
| `DTA_LEFTOFFSET`, `DTA_TOPOFFSET` | `int ofs` | Overrides the texture's X or Y offset. | | `DTA_LEFTOFFSET`, `DTA_TOPOFFSET` | `int ofs` | Overrides the texture's X or Y offset. |
| `DTA_LEGACYRENDERSTYLE` | `int style` | Overrides the render style. Note that there is also a `DTA_RENDERSTYLE` which cannot be used because the engine does not expose `FRenderStyle` yet. | | `DTA_LEGACYRENDERSTYLE` | `int style` | Overrides the render style. Note that there is also a `DTA_RENDERSTYLE` which cannot be used because the engine does not expose `FRenderStyle` yet. |
| `DTA_MASKED` | `bool on` | Turns the texture fully opaque (no alpha mask) if `on` is `false`. Default value is on. | | `DTA_MASKED` | `bool on` | Turns the texture fully opaque (no alpha mask) if `on` is `false`. Default value is on. |
| `DTA_SRCHEIGHT`, `DTA_SRCWIDTH` | `int size` | Sets the width or height of the source image. Will cut the texture if lower than the original size. If the size is larger than the original, it will cause UV clamping, repeating the pixels at the image borders. | | `DTA_SRCHEIGHT`, `DTA_SRCWIDTH` | `int size` | Sets the width or height of the source image. Will cut the texture if lower than the original size. If the size is larger than the original, it will cause UV clamping, repeating the pixels at the image borders. |
| `DTA_SRCX`, `DTA_SRCY` | `int pos` | Sets the X or Y on the source image to start the texture at. Texture wrapping will cause a UV clamping effect, repeating the pixels at the image borders. | | `DTA_SRCX`, `DTA_SRCY` | `int pos` | Sets the X or Y on the source image to start the texture at. Texture wrapping will cause a UV clamping effect, repeating the pixels at the image borders. |
| `DTA_TRANSLATIONINDEX` | `int index` | Remaps colors in the destination texture with translation table `index`. | | `DTA_TRANSLATIONINDEX` | `int index` | Remaps colors in the destination texture with translation table `index`. |
| `DTA_VIRTUALHEIGHTF`, `DTA_VIRTUALWIDTHF` | `double size` | Same as `DTA_VIRTUALHEIGHT`/`DTA_VIRTUALWIDTH`, but with decimal arguments. | | `DTA_VIRTUALHEIGHTF`, `DTA_VIRTUALWIDTHF` | `double size` | Same as `DTA_VIRTUALHEIGHT`/`DTA_VIRTUALWIDTH`, but with decimal arguments. |
| `DTA_VIRTUALHEIGHT`, `DTA_VIRTUALWIDTH` | `int size` | Sets the virtual width or height to `size`. | | `DTA_VIRTUALHEIGHT`, `DTA_VIRTUALWIDTH` | `int size` | Sets the virtual width or height to `size`. |
| `DTA_WINDOWLEFTF`, `DTA_WINDOWRIGHTF` | `double size` | Same as `DTA_WINDOWLEFT`/`DTA_WINDOWRIGHT`, but with decimal arguments. | | `DTA_WINDOWLEFTF`, `DTA_WINDOWRIGHTF` | `double size` | Same as `DTA_WINDOWLEFT`/`DTA_WINDOWRIGHT`, but with decimal arguments. |
| `DTA_WINDOWLEFT`, `DTA_WINDOWRIGHT` | `int size` | Crops `size` pixels from the left or right. | | `DTA_WINDOWLEFT`, `DTA_WINDOWRIGHT` | `int size` | Crops `size` pixels from the left or right. |
- `Clear` ### `Clear`
Draws a rectangle from `top left` to `bottom right` in screen coordinates of Draws a rectangle from `top left` to `bottom right` in screen coordinates of
`cr` color. Does not support translucent colors. `palcolor` is a palette `cr` color. Does not support translucent colors. `palcolor` is a palette index
index to use as a color in paletted renderers or `-1` for automatic to use as a color in paletted renderers or `-1` for automatic conversion from
conversion from the given RGB color. the given RGB color.
- `Dim` ### `Dim`
Draws a rectangle at `x y` of `w h` size in screen coordinates of `cr` Draws a rectangle at `x y` of `w h` size in screen coordinates of `cr` color.
color. Does not support translucent colors, but `amount` may be used to Does not support translucent colors, but `amount` may be used to specify the
specify the translucency in a range of 0-1 inclusive. translucency in a range of 0-1 inclusive.
- `DrawFrame` ### `DrawFrame`
Draws a frame around a rectangle at `x y` of `w h` size in screen Draws a frame around a rectangle at `x y` of `w h` size in screen coordinates,
coordinates, using the border graphics as defined in `MAPINFO`/GameInfo. using the border graphics as defined in `MAPINFO`/GameInfo.
- `DrawLine` ### `DrawLine`
Draws a one pixel wide line from `x0 y0` to `x1 y1` in screen coordinates of Draws a one pixel wide line from `x0 y0` to `x1 y1` in screen coordinates of
color `cr` with alpha `alpha` (range 0-255.) color `cr` with alpha `alpha` (range 0-255.)
- `DrawThickLine` ### `DrawThickLine`
Draws a `thickness` pixel wide line from `x0 y0` to `x1 y1` in screen Draws a `thickness` pixel wide line from `x0 y0` to `x1 y1` in screen
coordinates of color `cr` with alpha `alpha` (range 0-255.) coordinates of color `cr` with alpha `alpha` (range 0-255.)
- `GetAspectRatio` ### `GetAspectRatio`
Returns the aspect ratio of the screen. Returns the aspect ratio of the screen.
- `GetHeight` ### `GetHeight`
Returns the height of the screen. Returns the height of the screen.
- `GetWidth` ### `GetWidth`
Returns the width of the screen. Returns the width of the screen.
- `PaletteColor` ### `PaletteColor`
Returns a `color` for a given palette index. Returns a `color` for a given palette index.
- `VirtualToRealCoords` ### `VirtualToRealCoords`
Converts virtual coordinates `pos` from virtual coordinate space `vsize` to Converts virtual coordinates `pos` from virtual coordinate space `vsize` to
screen coordinate space `size`, possibly accounting for aspect ratio screen coordinate space `size`, possibly accounting for aspect ratio
differences if `handleaspect` is true. If the ratio is 5:4, `vbottom` will differences if `handleaspect` is true. If the ratio is 5:4, `vbottom` will
account for the higher-than-wide conversion by repositioning vertically. account for the higher-than-wide conversion by repositioning vertically.
- `ClearClipRect` ### `ClearClipRect`
Clears the clipping rectangle if there is one. Clears the clipping rectangle if there is one.
- `GetClipRect` ### `GetClipRect`
Returns the clipping rectangle's `x`/`y`/`w`/`h`. Returns the clipping rectangle's `x`/`y`/`w`/`h`.
- `GetViewWindow` ### `GetViewWindow`
Returns the 3D viewing window, which may be smaller than the screen size Returns the 3D viewing window, which may be smaller than the screen size with
with any given `screenblocks` setting. any given `screenblocks` setting.
- `SetClipRect` ### `SetClipRect`
Sets the clipping rectangle to restrict further drawing to the region Sets the clipping rectangle to restrict further drawing to the region starting
starting at `x y` of size `w h` in screen coordinates. at `x y` of size `w h` in screen coordinates.
<!-- EOF --> <!-- EOF -->

View File

@ -5,33 +5,33 @@ Represents an arbitrary polygonal 2D shape.
``` ```
class Shape2D : Object class Shape2D : Object
{ {
void Clear(int which = C_Verts | C_Coords | C_Indices); void Clear(int which = C_Verts | C_Coords | C_Indices);
void PushCoord(vector2 c); void PushCoord(vector2 c);
void PushTriangle(int a, int b, int c); void PushTriangle(int a, int b, int c);
void PushVertex(vector2 v); void PushVertex(vector2 v);
} }
``` ```
- `Clear` ### `Clear`
Clears data out of a shape. Uses these as a bit flag: Clears data out of a shape. Uses these as a bit flag:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `Shape2D.C_Coords` | Clears texture coordinates. | | `Shape2D.C_Coords` | Clears texture coordinates. |
| `Shape2D.C_Indices` | Clears vertex indices. | | `Shape2D.C_Indices` | Clears vertex indices. |
| `Shape2D.C_Verts` | Clears vertices. | | `Shape2D.C_Verts` | Clears vertices. |
- `PushCoord` ### `PushCoord`
Pushes a texture coordinate into the shape buffer. Pushes a texture coordinate into the shape buffer.
- `PushTriangle` ### `PushTriangle`
Pushes the indices of a triangle into the shape buffer. Pushes the indices of a triangle into the shape buffer.
- `PushVertex` ### `PushVertex`
Pushes a vertex into the shape buffer. Pushes a vertex into the shape buffer.
<!-- EOF --> <!-- EOF -->

View File

@ -6,104 +6,103 @@ information on textures.
``` ```
struct TexMan struct TexMan
{ {
static textureid CheckForTexture(string name, int usetype, int flags = TexMan.TryAny); static textureid CheckForTexture(string name, int usetype, int flags = TexMan.TryAny);
static int CheckRealHeight(textureid tex); static int CheckRealHeight(textureid tex);
static string GetName(textureid tex); static string GetName(textureid tex);
static vector2 GetScaledOffset(textureid tex); static vector2 GetScaledOffset(textureid tex);
static vector2 GetScaledSize(textureid tex); static vector2 GetScaledSize(textureid tex);
static int, int GetSize(textureid tex); static int, int GetSize(textureid tex);
static void SetCameraToTexture(Actor viewpoint, string texture, double fov); static void SetCameraToTexture(Actor viewpoint, string texture, double fov);
static bool OkForLocalization(textureid patch, string textSubstitute); static bool OkForLocalization(textureid patch, string textSubstitute);
deprecated("3.8") static void ReplaceTextures(string from, string to, int flags); deprecated("3.8") static void ReplaceTextures(string from, string to, int flags);
} }
``` ```
- `CheckForTexture` ### `CheckForTexture`
Returns a `textureid` for the texture named `name`. `usetype` may be one of Returns a `textureid` for the texture named `name`. `usetype` may be one of the
the following, which selects what kind of texture to find: following, which selects what kind of texture to find:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `TexMan.TYPE_ANY` | Any kind of texture. | | `TexMan.TYPE_ANY` | Any kind of texture. |
| `TexMan.TYPE_AUTOPAGE` | Unused. | | `TexMan.TYPE_AUTOPAGE` | Unused. |
| `TexMan.TYPE_BUILD` | Unused. | | `TexMan.TYPE_BUILD` | Unused. |
| `TexMan.TYPE_DECAL` | A decal pic defined in `DECALDEF`. | | `TexMan.TYPE_DECAL` | A decal pic defined in `DECALDEF`. |
| `TexMan.TYPE_FIRSTDEFINED` | The first composite texture defined by the IWad. | | `TexMan.TYPE_FIRSTDEFINED` | The first composite texture defined by the IWad. |
| `TexMan.TYPE_FLAT` | A flat (ceiling/floor texture,) i.e. `FLOOR0_1`. | | `TexMan.TYPE_FLAT` | A flat (ceiling/floor texture,) i.e. `FLOOR0_1`. |
| `TexMan.TYPE_FONTCHAR` | Unused. | | `TexMan.TYPE_FONTCHAR` | Unused. |
| `TexMan.TYPE_MISCPATCH` | A loose graphic, i.e. `M_DOOM`. | | `TexMan.TYPE_MISCPATCH` | A loose graphic, i.e. `M_DOOM`. |
| `TexMan.TYPE_NULL` | Reserved for the null graphic. Ignores `name`. | | `TexMan.TYPE_NULL` | Reserved for the null graphic. Ignores `name`. |
| `TexMan.TYPE_OVERRIDE` | Overridable generalized textures, for instance textures defined in `TX_START` or BUILD ART tiles. | | `TexMan.TYPE_OVERRIDE` | Overridable generalized textures, for instance textures defined in `TX_START` or BUILD ART tiles. |
| `TexMan.TYPE_SKINGRAPHIC` | Any loose graphic defined in `S_SKIN` i.e. statusbar faces. | | `TexMan.TYPE_SKINGRAPHIC` | Any loose graphic defined in `S_SKIN` i.e. statusbar faces. |
| `TexMan.TYPE_SKINSPRITE` | Any sprite defined in `S_SKIN`. | | `TexMan.TYPE_SKINSPRITE` | Any sprite defined in `S_SKIN`. |
| `TexMan.TYPE_SPRITE` | A sprite in `S_START`, i.e. `MEDIA0`. | | `TexMan.TYPE_SPRITE` | A sprite in `S_START`, i.e. `MEDIA0`. |
| `TexMan.TYPE_WALLPATCH` | An uncomposited patch, i.e. `DOOR2_1`. | | `TexMan.TYPE_WALLPATCH` | An uncomposited patch, i.e. `DOOR2_1`. |
| `TexMan.TYPE_WALL` | Any composited wall texture, i.e. `STARTAN2`. | | `TexMan.TYPE_WALL` | Any composited wall texture, i.e. `STARTAN2`. |
`flags` may be any of the following combined (with the bitwise OR operator `flags` may be any of the following combined (with the bitwise OR operator
`|`:) `|`:)
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `TexMan.ALLOWSKINS` | Allows `SkinGraphic`s to be returned under normal circumstances. | | `TexMan.ALLOWSKINS` | Allows `SkinGraphic`s to be returned under normal circumstances. |
| `TexMan.DONTCREATE` | Will never create a new texture when searching. | | `TexMan.DONTCREATE` | Will never create a new texture when searching. |
| `TexMan.LOCALIZE` | TODO . | | `TexMan.LOCALIZE` | TODO . |
| `TexMan.OVERRIDABLE` | Allows overriding of this texture by for instance `TEXTURES`. | | `TexMan.OVERRIDABLE` | Allows overriding of this texture by for instance `TEXTURES`. |
| `TexMan.RETURNFIRST` | Allows returning the `FirstDefined` "null" texture under normal circumstances. | | `TexMan.RETURNFIRST` | Allows returning the `FirstDefined` "null" texture under normal circumstances. |
| `TexMan.SHORTNAMEONLY` | Will force use of a short name when searching. | | `TexMan.SHORTNAMEONLY` | Will force use of a short name when searching. |
| `TexMan.TRYANY` | Returns any other type of texture if one is not found in the specified use type. Default. | | `TexMan.TRYANY` | Returns any other type of texture if one is not found in the specified use type. Default. |
- `CheckRealHeight` ### `CheckRealHeight`
Returns the height in pixels of the texture down to the last scanline which Returns the height in pixels of the texture down to the last scanline which has
has actual pixel data. Note that this operation is extremely slow and should actual pixel data. Note that this operation is extremely slow and should be
be used sparingly. used sparingly.
- `GetName` ### `GetName`
Returns the original name of a `textureid`. Returns the original name of a `textureid`.
- `GetScaledOffset` ### `GetScaledOffset`
Returns the offsets for this texture used to display it (rather than the Returns the offsets for this texture used to display it (rather than the
original offsets.) original offsets.)
- `GetScaledSize` ### `GetScaledSize`
Returns the size used to display this texture (rather than the physical Returns the size used to display this texture (rather than the physical size.)
size.)
- `GetSize` ### `GetSize`
Returns the width and height of a `textureid`. Returns the width and height of a `textureid`.
- `SetCameraToTexture` ### `SetCameraToTexture`
Sets the camera texture (as defined in `ANIMDEFS`) `texture` to the Sets the camera texture (as defined in `ANIMDEFS`) `texture` to the viewpoint
viewpoint of `viewpoint` with a fov of `fov`. of `viewpoint` with a fov of `fov`.
- `OkForLocalization` ### `OkForLocalization`
TODO TODO
- `ReplaceTextures` ### `ReplaceTextures`
Note: This function is deprecated and `LevelLocals::ReplaceTextures` should Note: This function is deprecated and `LevelLocals::ReplaceTextures` should be
be used instead. used instead.
Replaces textures named `from` with `to` within the map. `flags` may be used Replaces textures named `from` with `to` within the map. `flags` may be used to
to filter out certain textures from being replaced: filter out certain textures from being replaced:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `TexMan.NOT_BOTTOM` | Filters out linedef bottom textures. | | `TexMan.NOT_BOTTOM` | Filters out linedef bottom textures. |
| `TexMan.NOT_CEILING` | Filters out ceiling flats. | | `TexMan.NOT_CEILING` | Filters out ceiling flats. |
| `TexMan.NOT_FLAT` | Filters out any flat texture. | | `TexMan.NOT_FLAT` | Filters out any flat texture. |
| `TexMan.NOT_FLOOR` | Filters out floor flats. | | `TexMan.NOT_FLOOR` | Filters out floor flats. |
| `TexMan.NOT_MIDDLE` | Filters out linedef middle textures. | | `TexMan.NOT_MIDDLE` | Filters out linedef middle textures. |
| `TexMan.NOT_TOP` | Filters out linedef upper textures. | | `TexMan.NOT_TOP` | Filters out linedef upper textures. |
| `TexMan.NOT_WALL` | Filters out any linedef texture. | | `TexMan.NOT_WALL` | Filters out any linedef texture. |
<!-- EOF --> <!-- EOF -->

View File

@ -7,39 +7,39 @@ only works with the integer on the right hand side.)
``` ```
struct TextureID struct TextureID
{ {
bool Exists() const; bool Exists() const;
bool IsNull() const; bool IsNull() const;
bool IsValid() const; bool IsValid() const;
void SetInvalid(); void SetInvalid();
void SetNull(); void SetNull();
} }
``` ```
- `Exists` ### `Exists`
Checks if the texture exists within the texture manager at all. Checks if the texture exists within the texture manager at all.
- `IsNull` ### `IsNull`
Checks if the texture is the null index (`0`.) Checks if the texture is the null index (`0`.)
- `IsValid` ### `IsValid`
Checks if the texture index is not the invalid index (`-1`.) Checks if the texture index is not the invalid index (`-1`.)
- `SetInvalid` ### `SetInvalid`
Sets the texture index to `-1`. Sets the texture index to `-1`.
- `SetNull` ### `SetNull`
Sets the texture index to `0`. Sets the texture index to `0`.
The proper way to zero-initialize a `textureid` is: The proper way to zero-initialize a `textureid` is:
``` ```
textureid tex; textureid tex;
tex.SetNull(); tex.SetNull();
``` ```
<!-- EOF --> <!-- EOF -->

View File

@ -5,32 +5,32 @@ The information for a `ConsoleProcess` or `NetworkProcess` event.
``` ```
struct ConsoleEvent struct ConsoleEvent
{ {
readonly int Player; readonly int Player;
readonly string Name; readonly string Name;
readonly int Args[3]; readonly int Args[3];
readonly bool IsManual; readonly bool IsManual;
} }
``` ```
- `Player` ### `Player`
The player who created this event, or `-1` if there was no activator. This The player who created this event, or `-1` if there was no activator. This will
will always be positive for `NetworkProcess` events and always `-1` for always be positive for `NetworkProcess` events and always `-1` for
`ConsoleProcess` events. `ConsoleProcess` events.
- `Name` ### `Name`
The name as provided to `SendNetworkEvent`. Use this to distinguish between The name as provided to `SendNetworkEvent`. Use this to distinguish between
event types. It is favorable to prefix names with the name of your mod or event types. It is favorable to prefix names with the name of your mod or game
game so that it will not potentially conflict with other mods. so that it will not potentially conflict with other mods.
- `Args` ### `Args`
The arguments as provided to `SendNetworkEvent`. The arguments as provided to `SendNetworkEvent`.
- `IsManual` ### `IsManual`
`true` if this event was created manually, for instance through a console `true` if this event was created manually, for instance through a console
command. command.
<!-- EOF --> <!-- EOF -->

View File

@ -15,20 +15,20 @@ overridden on this type.
``` ```
class EventHandler : StaticEventHandler class EventHandler : StaticEventHandler
{ {
clearscope static StaticEventHandler Find(class<StaticEventHandler> type); clearscope static StaticEventHandler Find(class<StaticEventHandler> type);
clearscope static void SendNetworkEvent(string name, int arg1 = 0, int arg2 = 0, int arg3 = 0); clearscope static void SendNetworkEvent(string name, int arg1 = 0, int arg2 = 0, int arg3 = 0);
} }
``` ```
- `Find` ### `Find`
Finds and returns the `StaticEventHandler` type `type` if it is registered, Finds and returns the `StaticEventHandler` type `type` if it is registered, or
or `null` if it does not exist. It should be noted that this is exactly the `null` if it does not exist. It should be noted that this is exactly the same
same as `StaticEventHandler`'s, and does not actually check for as `StaticEventHandler`'s, and does not actually check for `EventHandlers`,
`EventHandlers`, although due to inheritance will return them correctly. although due to inheritance will return them correctly.
- `SendNetworkEvent` ### `SendNetworkEvent`
Sends a network event with no activator. Sends a network event with no activator.
<!-- EOF --> <!-- EOF -->

View File

@ -5,40 +5,40 @@ The information for a `RenderOverlay` event.
``` ```
struct RenderEvent struct RenderEvent
{ {
readonly vector3 ViewPos; readonly vector3 ViewPos;
readonly double ViewAngle; readonly double ViewAngle;
readonly double ViewPitch; readonly double ViewPitch;
readonly double ViewRoll; readonly double ViewRoll;
readonly double FracTic; readonly double FracTic;
readonly Actor Camera; readonly Actor Camera;
} }
``` ```
- `ViewPos` ### `ViewPos`
The position at which the camera is at. The position at which the camera is at.
- `ViewAngle` ### `ViewAngle`
The yaw angle of the camera. The yaw angle of the camera.
- `ViewPitch` ### `ViewPitch`
The pitch angle of the camera. The pitch angle of the camera.
- `ViewRoll` ### `ViewRoll`
The roll angle of the camera. The roll angle of the camera.
- `FracTic` ### `FracTic`
A value between 0 and 1 (exclusive) representing the time between the last A value between 0 and 1 (exclusive) representing the time between the last game
game tick and the next game tick. This is most useful for interpolation, and tick and the next game tick. This is most useful for interpolation, and you can
you can add it to the current game tick to get the real time at which this add it to the current game tick to get the real time at which this event has
event has been called. Precision is not specified. been called. Precision is not specified.
- `Camera` ### `Camera`
The actor which is acting as the camera for the player's view. The actor which is acting as the camera for the player's view.
<!-- EOF --> <!-- EOF -->

View File

@ -6,25 +6,25 @@ this event to change the result of replacement checking.
``` ```
struct ReplaceEvent struct ReplaceEvent
{ {
readonly class<Actor> Replacee; readonly class<Actor> Replacee;
class<Actor> Replacement; class<Actor> Replacement;
bool IsFinal; bool IsFinal;
} }
``` ```
- `Replacee` ### `Replacee`
The actor class which is being replaced. The actor class which is being replaced.
- `Replacement` ### `Replacement`
What to replace it with. This class type is already effected by skill and What to replace it with. This class type is already effected by skill and actor
actor definition replacements, so it may be useful to read it. Modify this definition replacements, so it may be useful to read it. Modify this to change
to change what the resulting replacement class ends up being. what the resulting replacement class ends up being.
- `IsFinal` ### `IsFinal`
If `true`, the engine will not attempt to continue going down the If `true`, the engine will not attempt to continue going down the replacement
replacement chain, and will directly replace the actor with `Replacement`. chain, and will directly replace the actor with `Replacement`.
<!-- EOF --> <!-- EOF -->

View File

@ -17,233 +17,232 @@ documentation.
``` ```
class StaticEventHandler : Object play class StaticEventHandler : Object play
{ {
clearscope static StaticEventHandler Find(class<StaticEventHandler> type); clearscope static StaticEventHandler Find(class<StaticEventHandler> type);
virtual void OnRegister(); virtual void OnRegister();
virtual void OnUnregister(); virtual void OnUnregister();
virtual void WorldLoaded(WorldEvent e); virtual void WorldLoaded(WorldEvent e);
virtual void WorldUnloaded(WorldEvent e); virtual void WorldUnloaded(WorldEvent e);
virtual void WorldThingSpawned(WorldEvent e); virtual void WorldThingSpawned(WorldEvent e);
virtual void WorldThingDied(WorldEvent e); virtual void WorldThingDied(WorldEvent e);
virtual void WorldThingRevived(WorldEvent e); virtual void WorldThingRevived(WorldEvent e);
virtual void WorldThingDamaged(WorldEvent e); virtual void WorldThingDamaged(WorldEvent e);
virtual void WorldThingDestroyed(WorldEvent e); virtual void WorldThingDestroyed(WorldEvent e);
virtual void WorldLinePreActivated(WorldEvent e); virtual void WorldLinePreActivated(WorldEvent e);
virtual void WorldLineActivated(WorldEvent e); virtual void WorldLineActivated(WorldEvent e);
virtual void WorldSectorDamaged(WorldEvent e); virtual void WorldSectorDamaged(WorldEvent e);
virtual void WorldLineDamaged(WorldEvent e); virtual void WorldLineDamaged(WorldEvent e);
virtual void WorldLightning(WorldEvent e); virtual void WorldLightning(WorldEvent e);
virtual void WorldTick(); virtual void WorldTick();
virtual ui void RenderOverlay(RenderEvent e); virtual ui void RenderOverlay(RenderEvent e);
virtual void PlayerEntered(PlayerEvent e); virtual void PlayerEntered(PlayerEvent e);
virtual void PlayerRespawned(PlayerEvent e); virtual void PlayerRespawned(PlayerEvent e);
virtual void PlayerDied(PlayerEvent e); virtual void PlayerDied(PlayerEvent e);
virtual void PlayerDisconnected(PlayerEvent e); virtual void PlayerDisconnected(PlayerEvent e);
virtual ui bool UiProcess(UiEvent e); virtual ui bool UiProcess(UiEvent e);
virtual ui void UiTick(); virtual ui void UiTick();
virtual ui void PostUiTick(); virtual ui void PostUiTick();
virtual ui bool InputProcess(InputEvent e); virtual ui bool InputProcess(InputEvent e);
virtual ui void ConsoleProcess(ConsoleEvent e); virtual ui void ConsoleProcess(ConsoleEvent e);
virtual void NetworkProcess(ConsoleEvent e); virtual void NetworkProcess(ConsoleEvent e);
virtual void CheckReplacement(ReplaceEvent e); virtual void CheckReplacement(ReplaceEvent e);
virtual void NewGame(); virtual void NewGame();
void SetOrder(int order); void SetOrder(int order);
readonly int Order; readonly int Order;
bool IsUiProcessor; bool IsUiProcessor;
bool RequireMouse; bool RequireMouse;
} }
``` ```
- `Find` ### `Find`
Finds and returns the `StaticEventHandler` type `type` if it is registered, Finds and returns the `StaticEventHandler` type `type` if it is registered, or
or `null` if it does not exist. `null` if it does not exist.
- `OnRegister` ### `OnRegister`
Called when this type is registered. This is where you should set `Order`, Called when this type is registered. This is where you should set `Order`,
`IsUiProcessor` and `RequireMouse`. `IsUiProcessor` and `RequireMouse`.
- `OnUnregister` ### `OnUnregister`
Called when this type is un-registered. With `StaticEventHandler`s this is Called when this type is un-registered. With `StaticEventHandler`s this is
called when the engine shuts down, so it isn't particularly useful. called when the engine shuts down, so it isn't particularly useful.
- `WorldLoaded` ### `WorldLoaded`
Called directly after the status bar is attached to the player and after Called directly after the status bar is attached to the player and after
`REOPEN` ACS scripts are called, just before the display is flushed and `REOPEN` ACS scripts are called, just before the display is flushed and
auto-save is done. auto-save is done.
- `WorldUnloaded` ### `WorldUnloaded`
Called directly after `UNLOADING` ACS scripts, just before the level is Called directly after `UNLOADING` ACS scripts, just before the level is
changed. changed.
- `WorldThingSpawned` ### `WorldThingSpawned`
Called directly after an actor's `PostBeginPlay` function. Called directly after an actor's `PostBeginPlay` function.
- `WorldThingDied` ### `WorldThingDied`
Called after `MorphedDeath`, inventory items have called `OwnerDied`, and Called after `MorphedDeath`, inventory items have called `OwnerDied`, and the
the target is set to the damage source, just before `KILL` ACS scripts are target is set to the damage source, just before `KILL` ACS scripts are called
called and the rest of the death handling is done. and the rest of the death handling is done.
- `WorldThingRevived` ### `WorldThingRevived`
Called when an actor is revived, after everything is finished. Called when an actor is revived, after everything is finished.
- `WorldThingDamaged` ### `WorldThingDamaged`
Called directly before `Die`, or directly after after `DamageMobj` finishes. Called directly before `Die`, or directly after after `DamageMobj` finishes.
- `WorldThingDestroyed` ### `WorldThingDestroyed`
Called at the beginning of an actor's `OnDestroy` function. Called at the beginning of an actor's `OnDestroy` function.
- `WorldLinePreActivated` ### `WorldLinePreActivated`
Called directly after a line is tested for activation, before any other Called directly after a line is tested for activation, before any other
activation specials are called (such as checking for keys, executing the activation specials are called (such as checking for keys, executing the line
line special, etc.) special, etc.)
- `WorldLineActivated` ### `WorldLineActivated`
Called directly after a line's special is executed, if it succeeded, before Called directly after a line's special is executed, if it succeeded, before any
any other handling (such as changing a switch's texture) is completed. other handling (such as changing a switch's texture) is completed.
- `WorldSectorDamaged` ### `WorldSectorDamaged`
Called when a sector is damaged if it has any health groups, before any Called when a sector is damaged if it has any health groups, before any other
other handling is done. handling is done.
- `WorldLineDamaged` ### `WorldLineDamaged`
Called when a line is damaged if it has any health groups, before any other Called when a line is damaged if it has any health groups, before any other
handling is done. handling is done.
- `WorldLightning` ### `WorldLightning`
Called when lightning strikes, directly after the sound is played, just Called when lightning strikes, directly after the sound is played, just before
before `LIGHTNING` ACS scripts are called. `LIGHTNING` ACS scripts are called.
- `WorldTick` ### `WorldTick`
Called on every world tick, after interpolators are updated, world freeze is Called on every world tick, after interpolators are updated, world freeze is
updated, sight counters are reset, particles have run their thinkers, and updated, sight counters are reset, particles have run their thinkers, and
players have run their thinkers, just before the status bar is ticked, the players have run their thinkers, just before the status bar is ticked, the
level ticks, thinkers are ticked, and the level time is updated. This is not level ticks, thinkers are ticked, and the level time is updated. This is not
called when the game is paused, and its execution is entirely deterministic called when the game is paused, and its execution is entirely deterministic
regardless of how this event handler is applied. regardless of how this event handler is applied.
- `RenderOverlay` ### `RenderOverlay`
Despite the name, this is actually run on the status bar, specifically in Despite the name, this is actually run on the status bar, specifically in
`BaseStatusBar::DrawTopStuff`. It is run after `HudMessage`s are drawn and `BaseStatusBar::DrawTopStuff`. It is run after `HudMessage`s are drawn and
power-ups are drawn, just before ゴゴゴ「The Log」ゴゴゴ is drawn. You may power-ups are drawn, just before ゴゴゴ「The Log」ゴゴゴ is drawn. You may use
use `Screen` functions in this function. `Screen` functions in this function.
- `PlayerEntered` ### `PlayerEntered`
Called during level load when each player enters the game, after the camera Called during level load when each player enters the game, after the camera is
is set but just before `RETURN` ACS scripts are called. set but just before `RETURN` ACS scripts are called.
- `PlayerRespawned` ### `PlayerRespawned`
Called when a player spawns, directly after the teleport fog is spanwed and Called when a player spawns, directly after the teleport fog is spanwed and
just before `RESPAWN` ACS scripts are called. Also called similarly at the just before `RESPAWN` ACS scripts are called. Also called similarly at the end
end of the `Respawn` function, for example when the `resurrect` cheat is of the `Respawn` function, for example when the `resurrect` cheat is used.
used.
- `PlayerDied` ### `PlayerDied`
Called after `WorldThingDied` and `GetDeathHeight`, and after the actor's Called after `WorldThingDied` and `GetDeathHeight`, and after the actor's thing
thing special is activated, when the obituary has been displayed, just special is activated, when the obituary has been displayed, just before `DEATH`
before `DEATH` ACS scripts have been called. ACS scripts have been called.
- `PlayerDisconnected` ### `PlayerDisconnected`
Called when a bot is removed and when a player disconnects from the game, Called when a bot is removed and when a player disconnects from the game, just
just before `DISCONNECT` ACS scripts are called. before `DISCONNECT` ACS scripts are called.
- `UiProcess` ### `UiProcess`
Called only if `IsUiProcessor` is `true`. Called when a GUI event is Called only if `IsUiProcessor` is `true`. Called when a GUI event is dispatched
dispatched by the engine, for example when the UI is active and the player by the engine, for example when the UI is active and the player has pressed a
has pressed a key or moved the mouse. Mouse movements will only be captured key or moved the mouse. Mouse movements will only be captured if `RequireMouse`
if `RequireMouse` is `true`. Because this interacts directly with the OS it is `true`. Because this interacts directly with the OS it is not part of the
is not part of the game simulation, therefore has `ui` scope and must game simulation, therefore has `ui` scope and must dispatch commands to the
dispatch commands to the game as networked events. If the return value is game as networked events. If the return value is `true`, the function will
`true`, the function will block any further handlers from processing this block any further handlers from processing this event, essentially "eating"
event, essentially "eating" it. If the return value is `false`, other it. If the return value is `false`, other handlers will continue to be called
handlers will continue to be called as normal. as normal.
- `UiTick` ### `UiTick`
Despite what it may seem, this function is actually called deterministically Despite what it may seem, this function is actually called deterministically
within the game loop, just before the level is ticked and after the player's within the game loop, just before the level is ticked and after the player's
network commands are created. Albeit this, it is `ui` scope, so it should network commands are created. Albeit this, it is `ui` scope, so it should be
be used to process UI code. used to process UI code.
- `PostUiTick` ### `PostUiTick`
Similar to `UiTick`, this is also deterministic, but called after all other Similar to `UiTick`, this is also deterministic, but called after all other
tickers. tickers.
- `InputProcess` ### `InputProcess`
The same as `UiProcess`, but this is only called when inputs are being The same as `UiProcess`, but this is only called when inputs are being directed
directed to the game, rather than to the GUI. All of the same restrictions to the game, rather than to the GUI. All of the same restrictions apply to this
apply to this as they do to `UiProcess`, and the return value acts the same. as they do to `UiProcess`, and the return value acts the same.
- `ConsoleProcess` ### `ConsoleProcess`
Called when network events which have no player activator are received. Called when network events which have no player activator are received.
- `NetworkProcess` ### `NetworkProcess`
Called when network events which have a player activator are received. Called when network events which have a player activator are received.
- `CheckReplacement` ### `CheckReplacement`
Called during actor replacement, after skill replacement is done, but before Called during actor replacement, after skill replacement is done, but before
any other replacement (such as actor replacements done in ZScript actor any other replacement (such as actor replacements done in ZScript actor
definitions.) definitions.)
- `NewGame` ### `NewGame`
Called on a new game, directly after level data is reset and right before Called on a new game, directly after level data is reset and right before the
the level is set up. level is set up.
- `SetOrder` ### `SetOrder`
Sets the ordering of this event handler, which can be read from `Order`. Sets the ordering of this event handler, which can be read from `Order`.
- `Order` ### `Order`
The arbitrary ordering of this event handler relative to other ones. Event The arbitrary ordering of this event handler relative to other ones. Event
handlers with lower ordering numbers have their functions executed first. handlers with lower ordering numbers have their functions executed first. You
You can set this variable with `SetOrder`. can set this variable with `SetOrder`.
- `IsUiProcessor` ### `IsUiProcessor`
If `true`, GUI events will be sent to this event handler through If `true`, GUI events will be sent to this event handler through `UiProcess`.
`UiProcess`. This is mainly for optimization purposes. This is mainly for optimization purposes.
- `RequireMouse` ### `RequireMouse`
If `true`, mouse events will be sent to this event handler through If `true`, mouse events will be sent to this event handler through
`InputProcess` and/or `UiProcess`. This is mainly for optimization purposes. `InputProcess` and/or `UiProcess`. This is mainly for optimization purposes.
<!-- EOF --> <!-- EOF -->

View File

@ -22,11 +22,11 @@ Single files can also be loaded as archives, containing only themselves.
In short: In short:
- *Lump* refers to an object from any archive type with an 8 character filename (extension removed.) * *Lump* refers to an object from any archive type with an 8 character filename (extension removed.)
- *File* refers to fully qualified object from a resource archive, which can also be used as a lump through its truncated name. * *File* refers to fully qualified object from a resource archive, which can also be used as a lump through its truncated name.
- *Archives* are real files or folders which hold *lumps*. * *Archives* are real files or folders which hold *lumps*.
- *Resource archives* are archives with a folder structure for determining lump namespaces, and also store fully qualified paths for files. * *Resource archives* are archives with a folder structure for determining lump namespaces, and also store fully qualified paths for files.
- *Wad files* are archives which hold only lumps, and use markers for determining lump namespaces. * *Wad files* are archives which hold only lumps, and use markers for determining lump namespaces.
| Name | Description | Resource path | Wad file marker | | Name | Description | Resource path | Wad file marker |
| ---- | ----------- | ------------- | --------------- | | ---- | ----------- | ------------- | --------------- |
@ -54,44 +54,44 @@ resource archive folder namespaces, which are normally under `NS_GLOBAL`.
``` ```
struct Wads struct Wads
{ {
static int CheckNumForFullName(string name); static int CheckNumForFullName(string name);
static int CheckNumForName(string name, int ns, int wadnum = -1, bool exact = false); static int CheckNumForName(string name, int ns, int wadnum = -1, bool exact = false);
static int FindLump(string name, int startlump = 0, FindLumpNamespace ns = Wads.GLOBALNAMESPACE); static int FindLump(string name, int startlump = 0, FindLumpNamespace ns = Wads.GLOBALNAMESPACE);
static string ReadLump(int lump); static string ReadLump(int lump);
} }
``` ```
- `CheckNumForFullName` ### `CheckNumForFullName`
Returns the handle of the first file named `name`, matching only the full Returns the handle of the first file named `name`, matching only the full path
path to it, including the extension, or `-1` if the file was not found. Only to it, including the extension, or `-1` if the file was not found. Only works
works with files defined in resource archives. with files defined in resource archives.
- `CheckNumForName` ### `CheckNumForName`
Returns the handle of the first lump named `name` within namespace `ns`. If Returns the handle of the first lump named `name` within namespace `ns`. If
`wadnum` is not `-1`, then it signifies, if `exact` is false, the number of `wadnum` is not `-1`, then it signifies, if `exact` is false, the number of the
the last archive to search in, or the only archive to search in if `exact` last archive to search in, or the only archive to search in if `exact` is
is `true`. `true`.
Note there is currently no way to actually *get* the number of an archive, Note there is currently no way to actually *get* the number of an archive, even
even the current one. The only guarantee is that archive `0` will be the the current one. The only guarantee is that archive `0` will be the base
base archive (`gzdoom.pk3`.) archive (`gzdoom.pk3`.)
- `FindLump` ### `FindLump`
Returns the handle of the first lump named `name` starting at `startlump` Returns the handle of the first lump named `name` starting at `startlump` (zero
(zero indicates the first lump) in either the global namespace or any indicates the first lump) in either the global namespace or any namespace. `ns`
namespace. `ns` can be either `Wads.GLOBALNAMESPACE` or `Wads.ANYNAMESPACE` can be either `Wads.GLOBALNAMESPACE` or `Wads.ANYNAMESPACE` to specify this.
to specify this. Returns `-1` if there are no lumps with that name left. Returns `-1` if there are no lumps with that name left.
This function can be used in a loop to find all lumps with a specified name. This function can be used in a loop to find all lumps with a specified name.
- `ReadLump` ### `ReadLump`
Reads the whole contents of `lump` into a string and returns the result. If Reads the whole contents of `lump` into a string and returns the result. If
`lump` is not valid, returns an empty string. Note that binary lumps can be `lump` is not valid, returns an empty string. Note that binary lumps can be
loaded this way and the string's length will be correct according to the loaded this way and the string's length will be correct according to the lump's
lump's size even if null characters are present in the lump. size even if null characters are present in the lump.
<!-- EOF --> <!-- EOF -->

View File

@ -32,109 +32,109 @@ readonly ui bool NetGame;
int LocalViewPitch; int LocalViewPitch;
``` ```
- `AutomapBindings` ### `AutomapBindings`
TODO TODO
- `Bindings` ### `Bindings`
TODO TODO
- `BigFont` ### `BigFont`
The `bigfont` for the current game. The `bigfont` for the current game.
- `CleanHeight` ### `CleanHeight`
The current screen height divided by `CleanYFac`. **Not deterministic.** The current screen height divided by `CleanYFac`. **Not deterministic.**
- `CleanHeight_1` ### `CleanHeight_1`
The current screen height divided by `CleanYFac_1`. **Not deterministic.** The current screen height divided by `CleanYFac_1`. **Not deterministic.**
- `CleanWidth` ### `CleanWidth`
The current screen width divided by `CleanXFac`. **Not deterministic.** The current screen width divided by `CleanXFac`. **Not deterministic.**
- `CleanWidth_1` ### `CleanWidth_1`
The current screen width divided by `CleanYFac_1`. **Not deterministic.** The current screen width divided by `CleanYFac_1`. **Not deterministic.**
- `CleanXFac` ### `CleanXFac`
Integral scaling factor for horizontal positions to scale from 320x200 to Integral scaling factor for horizontal positions to scale from 320x200 to the
the current virtual resolution. **Not deterministic.** current virtual resolution. **Not deterministic.**
- `CleanXFac_1` ### `CleanXFac_1`
Integral scaling factor for horizontal positions to scale from 320x200 to Integral scaling factor for horizontal positions to scale from 320x200 to the
the current virtual resolution, accounting for aspect ratio differences. current virtual resolution, accounting for aspect ratio differences. **Not
**Not deterministic.** deterministic.**
- `CleanYFac` ### `CleanYFac`
Integral scaling factor for vertical positions to scale from 320x200 to the Integral scaling factor for vertical positions to scale from 320x200 to the
current virtual resolution. **Not deterministic.** current virtual resolution. **Not deterministic.**
- `CleanYFac_1` ### `CleanYFac_1`
Integral scaling factor for vertical positions to scale from 320x200 to the Integral scaling factor for vertical positions to scale from 320x200 to the
current virtual resolution, accounting for aspect ratio differences. **Not current virtual resolution, accounting for aspect ratio differences. **Not
deterministic.** deterministic.**
- `ConFont` ### `ConFont`
The console font. The console font.
- `IntermissionFont` ### `IntermissionFont`
The font used in intermission screens. The font used in intermission screens.
- `SmallFont` ### `SmallFont`
The `smallfnt` for the current game. The `smallfnt` for the current game.
- `SmallFont2` ### `SmallFont2`
The alternate `smallfnt`. The alternate `smallfnt`.
- `NewConsoleFont` ### `NewConsoleFont`
TODO TODO
- `NewSmallFont` ### `NewSmallFont`
TODO TODO
- `BackbuttonAlpha` ### `BackbuttonAlpha`
Alpha of the back button in menus. Alpha of the back button in menus.
- `BackbuttonTime` ### `BackbuttonTime`
The time until the back button starts fading out in menus. The time until the back button starts fading out in menus.
- `MenuActive` ### `MenuActive`
The current active menu state. One of: The current active menu state. One of:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `Menu.Off` | No active menu. | | `Menu.Off` | No active menu. |
| `Menu.OnNoPause` | Menu is opened, but the game is not paused. | | `Menu.OnNoPause` | Menu is opened, but the game is not paused. |
| `Menu.On` | Menu is open, game is paused. | | `Menu.On` | Menu is open, game is paused. |
| `Menu.WaitKey` | Menu is opened, waiting for a key for a controls menu binding. | | `Menu.WaitKey` | Menu is opened, waiting for a key for a controls menu binding. |
- `StatusBar` ### `StatusBar`
TODO TODO
- `NetGame` ### `NetGame`
Whether this is a networked game or not. Whether this is a networked game or not.
- `LocalViewPitch` ### `LocalViewPitch`
The pitch angle (in degrees) of `ConsolePlayer`'s view. **Not deterministic.** The pitch angle (in degrees) of `ConsolePlayer`'s view. **Not deterministic.**
<!-- EOF --> <!-- EOF -->

View File

@ -12,29 +12,29 @@ const PLAYERMISSILERANGE;
const SAWRANGE; const SAWRANGE;
``` ```
- `MAXPLAYERNAME` ### `MAXPLAYERNAME`
The maximum length of a player name. The maximum length of a player name.
- `MAXPLAYERS` ### `MAXPLAYERS`
The maximum amount of players in game. The maximum amount of players in game.
- `DEFMELEERANGE` ### `DEFMELEERANGE`
The range where melee will be used for monsters, and the range for the The range where melee will be used for monsters, and the range for the player's
player's melee attacks. melee attacks.
- `MISSILERANGE` ### `MISSILERANGE`
The maximum range for monster missile/hit-scan attacks. The maximum range for monster missile/hit-scan attacks.
- `PLAYERMISSILERANGE` ### `PLAYERMISSILERANGE`
The maximum range for player missile/hit-scan attacks. The maximum range for player missile/hit-scan attacks.
- `SAWRANGE` ### `SAWRANGE`
The range of Doom's Chainsaw weapon. The range of Doom's Chainsaw weapon.
<!-- EOF --> <!-- EOF -->

View File

@ -15,72 +15,72 @@ deprecated("3.8") readonly bool GlobalFreeze;
int ValidCount; int ValidCount;
``` ```
- `AutomapActive` ### `AutomapActive`
`true` if the auto-map is currently open on the client. **Not deterministic.** `true` if the auto-map is currently open on the client. **Not deterministic.**
- `DemoPlayback` ### `DemoPlayback`
User is watching a demo. User is watching a demo.
- `GameAction` ### `GameAction`
Current global game action. May be one of: Current global game action. May be one of:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `ga_autoloadgame` | Don't use this. | | `ga_autoloadgame` | Don't use this. |
| `ga_autosave` | Creates an autosave. | | `ga_autosave` | Creates an autosave. |
| `ga_completed` | Don't use this. | | `ga_completed` | Don't use this. |
| `ga_fullconsole` | Don't use this. | | `ga_fullconsole` | Don't use this. |
| `ga_loadgamehideicon` | Don't use this. | | `ga_loadgamehideicon` | Don't use this. |
| `ga_loadgameplaydemo` | Don't use this. | | `ga_loadgameplaydemo` | Don't use this. |
| `ga_loadgame` | Don't use this. | | `ga_loadgame` | Don't use this. |
| `ga_loadlevel` | Don't use this. | | `ga_loadlevel` | Don't use this. |
| `ga_newgame2` | Don't use this. | | `ga_newgame2` | Don't use this. |
| `ga_newgame` | Don't use this. | | `ga_newgame` | Don't use this. |
| `ga_nothing` | Does nothing. | | `ga_nothing` | Does nothing. |
| `ga_playdemo` | Don't use this. | | `ga_playdemo` | Don't use this. |
| `ga_recordgame` | Don't use this. | | `ga_recordgame` | Don't use this. |
| `ga_savegame` | Don't use this. | | `ga_savegame` | Don't use this. |
| `ga_screenshot` | Takes a screenshot. | | `ga_screenshot` | Takes a screenshot. |
| `ga_slideshow` | Don't use this. | | `ga_slideshow` | Don't use this. |
| `ga_togglemap` | Toggles the auto-map. | | `ga_togglemap` | Toggles the auto-map. |
| `ga_worlddone` | Don't use this. | | `ga_worlddone` | Don't use this. |
- `GameState` ### `GameState`
Current global game state. May be one of: Current global game state. May be one of:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `GS_DEMOSCREEN` | Inside a level but watching a demo in the main menu. | | `GS_DEMOSCREEN` | Inside a level but watching a demo in the main menu. |
| `GS_FINALE` | Reading a cluster end text or at the end sequence. | | `GS_FINALE` | Reading a cluster end text or at the end sequence. |
| `GS_FULLCONSOLE` | Outside of a level, console only. | | `GS_FULLCONSOLE` | Outside of a level, console only. |
| `GS_HIDECONSOLE` | Outside of a level, console hidden (i.e. main menu.) | | `GS_HIDECONSOLE` | Outside of a level, console hidden (i.e. main menu.) |
| `GS_INTERMISSION` | In between levels. | | `GS_INTERMISSION` | In between levels. |
| `GS_LEVEL` | Inside a level. | | `GS_LEVEL` | Inside a level. |
| `GS_STARTUP` | Game not yet initialized. | | `GS_STARTUP` | Game not yet initialized. |
| `GS_TITLELEVEL` | Watching a `TITLEMAP` in the main menu. | | `GS_TITLELEVEL` | Watching a `TITLEMAP` in the main menu. |
- `GameTic` ### `GameTic`
Number of game tics passed since engine initialization. **Not deterministic.** Number of game tics passed since engine initialization. **Not deterministic.**
- `Level` ### `Level`
All level info as defined in `LevelLocals`. All level info as defined in `LevelLocals`.
- `MusPlaying` ### `MusPlaying`
TODO TODO
- `GlobalFreeze` ### `GlobalFreeze`
Deprecated. Don't use. Deprecated. Don't use.
- `ValidCount` ### `ValidCount`
Don't use this. Don't use this.
<!-- EOF --> <!-- EOF -->

View File

@ -16,47 +16,46 @@ readonly textureid SkyFlatNum;
readonly Weapon WP_NOCHANGE; readonly Weapon WP_NOCHANGE;
``` ```
- `AllActorClasses` ### `AllActorClasses`
An array of every actor class type reference. An array of every actor class type reference.
- `AllClasses` ### `AllClasses`
An array of every class type reference. An array of every class type reference.
- `PlayerClasses` ### `PlayerClasses`
An array of all player classes as defined in `MAPINFO`/GameInfo and An array of all player classes as defined in `MAPINFO`/GameInfo and `KEYCONF`.
`KEYCONF`.
- `PlayerSkins` ### `PlayerSkins`
An array of all player skins as defined in `SKININFO` and `S_SKIN`. An array of all player skins as defined in `SKININFO` and `S_SKIN`.
- `Teams` ### `Teams`
An array of all teams. Maximum index is `Team.Max`. An array of all teams. Maximum index is `Team.Max`.
- `Deh` ### `Deh`
Static DeHackEd information. Static DeHackEd information.
- `GameInfo` ### `GameInfo`
Static information from `MAPINFO`/GameInfo. Static information from `MAPINFO`/GameInfo.
- `OptionMenuSettings` ### `OptionMenuSettings`
Defaults for `OptionMenu`s as defined in `MENUDEF`'s `OptionMenuSettings` Defaults for `OptionMenu`s as defined in `MENUDEF`'s `OptionMenuSettings` block
block and `MAPINFO`/GameInfo. and `MAPINFO`/GameInfo.
- `SkyFlatNum` ### `SkyFlatNum`
The texture ID for sky flats. `F_SKY1` by default in Doom. The texture ID for sky flats. `F_SKY1` by default in Doom.
- `WP_NOCHANGE` ### `WP_NOCHANGE`
A constant denoting that the weapon the player is currently holding A constant denoting that the weapon the player is currently holding shouldn't
shouldn't be switched from. be switched from.
<!-- EOF --> <!-- EOF -->

View File

@ -10,24 +10,24 @@ readonly bool PlayerInGame[MAXPLAYERS];
play PlayerInfo Players[MAXPLAYERS]; play PlayerInfo Players[MAXPLAYERS];
``` ```
- `ConsolePlayer` ### `ConsolePlayer`
Number of the player running the client. **Not deterministic.** Number of the player running the client. **Not deterministic.**
- `Multiplayer` ### `Multiplayer`
Game is networked. Game is networked.
- `Net_Arbitrator` ### `Net_Arbitrator`
Number of the player who initiated or currently hosts the game. Number of the player who initiated or currently hosts the game.
- `PlayerInGame` ### `PlayerInGame`
`true` if the player is currently in-game. `true` if the player is currently in-game.
- `Players` ### `Players`
`PlayerInfo` structures for each player. `PlayerInfo` structures for each player.
<!-- EOF --> <!-- EOF -->

View File

@ -7,17 +7,16 @@ Type GetDefaultByType(class<Actor> type);
Type New(class typename = ThisClass); Type New(class typename = ThisClass);
``` ```
- `GetDefaultByType` ### `GetDefaultByType`
Returns an object containing the default values for each member of the Returns an object containing the default values for each member of the `Actor`
`Actor` type provided as they would be set in `BeginPlay`. **Note that the type provided as they would be set in `BeginPlay`. **Note that the return value
return value cannot be serialized and if stored must be marked as cannot be serialized and if stored must be marked as `transient`.** The
`transient`.** The returned object is a pseudo-object which is stored only returned object is a pseudo-object which is stored only in-memory.
in-memory.
- `New` ### `New`
Typically spelled lowercase (`new`), creates an object with type `typename`. Typically spelled lowercase (`new`), creates an object with type `typename`.
Defaults to using the class of the calling object. Defaults to using the class of the calling object.
<!-- EOF --> <!-- EOF -->

View File

@ -11,64 +11,64 @@ deprecated("3.8") vector3, int G_PickDeathmatchStart();
deprecated("3.8") vector3, int G_PickPlayerStart(int pnum, int flags = 0); deprecated("3.8") vector3, int G_PickPlayerStart(int pnum, int flags = 0);
``` ```
- `G_SkillName` ### `G_SkillName`
The name of the skill in play. The name of the skill in play.
- `G_SkillPropertyInt` ### `G_SkillPropertyInt`
Returns a skill property. `p` may be: Returns a skill property. `p` may be:
| Name | | Name |
| ---- | | ---- |
| `SKILLP_ACSRETURN` | | `SKILLP_ACSRETURN` |
| `SKILLP_AUTOUSEHEALTH` | | `SKILLP_AUTOUSEHEALTH` |
| `SKILLP_DISABLECHEATS` | | `SKILLP_DISABLECHEATS` |
| `SKILLP_EASYBOSSBRAIN` | | `SKILLP_EASYBOSSBRAIN` |
| `SKILLP_EASYKEY` | | `SKILLP_EASYKEY` |
| `SKILLP_FASTMONSTERS` | | `SKILLP_FASTMONSTERS` |
| `SKILLP_INFIGHT` | | `SKILLP_INFIGHT` |
| `SKILLP_NOPAIN` | | `SKILLP_NOPAIN` |
| `SKILLP_PLAYERRESPAWN` | | `SKILLP_PLAYERRESPAWN` |
| `SKILLP_RESPAWNLIMIT` | | `SKILLP_RESPAWNLIMIT` |
| `SKILLP_RESPAWN` | | `SKILLP_RESPAWN` |
| `SKILLP_SLOWMONSTERS` | | `SKILLP_SLOWMONSTERS` |
| `SKILLP_SPAWNFILTER` | | `SKILLP_SPAWNFILTER` |
- `G_SkillPropertyFloat` ### `G_SkillPropertyFloat`
Returns a skill property. `p` may be: Returns a skill property. `p` may be:
| Name | | Name |
| ---- | | ---- |
| `SKILLP_AGGRESSIVENESS` | | `SKILLP_AGGRESSIVENESS` |
| `SKILLP_AMMOFACTOR` | | `SKILLP_AMMOFACTOR` |
| `SKILLP_ARMORFACTOR` | | `SKILLP_ARMORFACTOR` |
| `SKILLP_DAMAGEFACTOR` | | `SKILLP_DAMAGEFACTOR` |
| `SKILLP_DROPAMMOFACTOR` | | `SKILLP_DROPAMMOFACTOR` |
| `SKILLP_FRIENDLYHEALTH` | | `SKILLP_FRIENDLYHEALTH` |
| `SKILLP_HEALTHFACTOR` | | `SKILLP_HEALTHFACTOR` |
| `SKILLP_MONSTERHEALTH` | | `SKILLP_MONSTERHEALTH` |
| `SKILLP_KICKBACKFACTOR` | | `SKILLP_KICKBACKFACTOR` |
- `G_PickDeathmatchStart` ### `G_PickDeathmatchStart`
Note: This function is deprecated and `LevelLocals::PickDeathmatchStart` Note: This function is deprecated and `LevelLocals::PickDeathmatchStart` should
should be used instead. be used instead.
Returns the position and angle of a random death-match start location. Returns the position and angle of a random death-match start location.
- `G_PickPlayerStart` ### `G_PickPlayerStart`
Note: This function is deprecated and `LevelLocals::PickPlayerStart` should Note: This function is deprecated and `LevelLocals::PickPlayerStart` should be
be used instead. used instead.
Returns the position and angle of a player start for player `pnum`. `flags` Returns the position and angle of a player start for player `pnum`. `flags` may
may be: be:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `PPS_FORCERANDOM` | Always picks a random player spawn for this player. | | `PPS_FORCERANDOM` | Always picks a random player spawn for this player. |
| `PPS_NOBLOCKINGCHECK` | Does not check if an object is blocking the player spawn. | | `PPS_NOBLOCKINGCHECK` | Does not check if an object is blocking the player spawn. |
<!-- EOF --> <!-- EOF -->

View File

@ -28,97 +28,97 @@ double TanH(double n);
double VectorAngle(double x, double y); double VectorAngle(double x, double y);
``` ```
- `Abs` ### `Abs`
Returns `|n|` (absolute of `n`.) Returns `|n|` (absolute of `n`.)
- `ACos` ### `ACos`
Returns the arc-cosine of `n`. Returns the arc-cosine of `n`.
- `ASin` ### `ASin`
Returns the arc-sine of `n`. Returns the arc-sine of `n`.
- `ATan` ### `ATan`
Returns the arc-tangent of `n`. Returns the arc-tangent of `n`.
- `ATan2` ### `ATan2`
Returns the arc-tangent of `y / x` using the arguments' signs to determine Returns the arc-tangent of `y / x` using the arguments' signs to determine the
the correct quadrant. correct quadrant.
- `BAM` ### `BAM`
Returns a byte angle of `angle` (`degrees * (0x40000000 / 90.0)`.) Returns a byte angle of `angle` (`degrees * (0x40000000 / 90.0)`.)
- `Ceil` ### `Ceil`
Returns the integral portion of `n`, rounded up. Returns the integral portion of `n`, rounded up.
- `Clamp` ### `Clamp`
Returns `n` if `n` is more than `minimum` and less than `maximum`, or either Returns `n` if `n` is more than `minimum` and less than `maximum`, or either of
of those values if it is not. those values if it is not.
- `Cos` ### `Cos`
Returns the cosine of `n`. Returns the cosine of `n`.
- `CosH` ### `CosH`
Returns the hyperbolic cosine of `n`. Returns the hyperbolic cosine of `n`.
- `Exp` ### `Exp`
Returns euler's number raised to the power `n`. Note that you probably want Returns euler's number raised to the power `n`. Note that you probably want
instead the `**` binary operator, as in `a ** b`, since euler's number is instead the `**` binary operator, as in `a ** b`, since euler's number is
generally not a very useful constant when programming games. generally not a very useful constant when programming games.
- `Floor` ### `Floor`
Returns the integral portion of `n`, rounded down. Returns the integral portion of `n`, rounded down.
- `Log` ### `Log`
Returns the natural (base of euler's number) logarithm of `n`. Returns the natural (base of euler's number) logarithm of `n`.
- `Log10` ### `Log10`
Returns the common (base 10) logarithm of `n`. Note that this is useful for Returns the common (base 10) logarithm of `n`. Note that this is useful for
instance when calculating the number of decimal digits in a number. instance when calculating the number of decimal digits in a number.
- `Max` ### `Max`
Returns `n` if `n` is less than `maximum`, or `maximum`. Returns `n` if `n` is less than `maximum`, or `maximum`.
- `Min` ### `Min`
Returns `n` if `n` is more than `minimum`, or `minimum`. Returns `n` if `n` is more than `minimum`, or `minimum`.
- `Sin` ### `Sin`
Returns the sine of `n`. Returns the sine of `n`.
- `SinH` ### `SinH`
Returns the hyperbolic sine of `n`. Returns the hyperbolic sine of `n`.
- `Sqrt` ### `Sqrt`
Returns the square root of `n`. Returns the square root of `n`.
- `Tan` ### `Tan`
Returns the tangent of `n`. Returns the tangent of `n`.
- `TanH` ### `TanH`
Returns the hyperbolic tangent of `n`. Returns the hyperbolic tangent of `n`.
- `VectorAngle` ### `VectorAngle`
Same as `ATan2`, but with arguments reversed. Same as `ATan2`, but with arguments reversed.
<!-- EOF --> <!-- EOF -->

View File

@ -13,30 +13,30 @@ int RandomPick(int...);
void SetRandomSeed(uint num); void SetRandomSeed(uint num);
``` ```
- `FRandom` ### `FRandom`
Returns a random float between `min` and `max`. Returns a random float between `min` and `max`.
- `FRandomPick` ### `FRandomPick`
Same as `RandomPick`, but with floats. Same as `RandomPick`, but with floats.
- `Random` ### `Random`
Returns a random integer between `min` and `max`. Returns a random integer between `min` and `max`.
- `Random2` ### `Random2`
Returns a random integer value between `-mask` and `mask`. `mask` is used as Returns a random integer value between `-mask` and `mask`. `mask` is used as a
a bit mask, so it is recommended to use a value of one less than a power of bit mask, so it is recommended to use a value of one less than a power of two
two (i.e. 3, 7, 15, 31, 63, 127, 255...) (i.e. 3, 7, 15, 31, 63, 127, 255...)
- `RandomPick` ### `RandomPick`
Returns one of the provided parameters randomly. Returns one of the provided parameters randomly.
- `SetRandomSeed` ### `SetRandomSeed`
Sets the seed of the RNG table to `num`. Sets the seed of the RNG table to `num`.
<!-- EOF --> <!-- EOF -->

View File

@ -12,84 +12,84 @@ void S_ResumeSound(bool notsfx);
void S_Sound(sound id, int channel, float volume = 1, float attenuation = ATTN_NORM); void S_Sound(sound id, int channel, float volume = 1, float attenuation = ATTN_NORM);
``` ```
- `MarkSound` ### `MarkSound`
Marks `snd` to be pre-cached (loaded into memory early.) Marks `snd` to be pre-cached (loaded into memory early.)
- `SetMusicVolume` ### `SetMusicVolume`
Sets the volume of the music relative to the user's volume. Range is 0-1, Sets the volume of the music relative to the user's volume. Range is 0-1,
inclusive. inclusive.
- `S_ChangeMusic` ### `S_ChangeMusic`
Changes the music to `name`. If `name` is `"*"`, the music will be set to Changes the music to `name`. If `name` is `"*"`, the music will be set to the
the default music for this level. Will loop if `looping` is `true`. `force` default music for this level. Will loop if `looping` is `true`. `force` will
will force the music to play even if a playlist (from the `playlist` console force the music to play even if a playlist (from the `playlist` console
command) is playing. command) is playing.
`order` may mean something different based on the music format: `order` may mean something different based on the music format:
| Format | Meaning | | Format | Meaning |
| ------ | ------- | | ------ | ------- |
| Tracker music (`.mod`, `.xm`, etc.) | Specifies the order the song will start at. | | Tracker music (`.mod`, `.xm`, etc.) | Specifies the order the song will start at. |
| Multi-track `.ogg`, `.flac`, etc. | Specifies the track to begin playing at. | | Multi-track `.ogg`, `.flac`, etc. | Specifies the track to begin playing at. |
| Any other format | No meaning, will be ignored. | | Any other format | No meaning, will be ignored. |
- `S_GetLength` ### `S_GetLength`
Returns the length of a sound in seconds. **Potentially non-deterministic if Returns the length of a sound in seconds. **Potentially non-deterministic if
all users in a networked game are not using the same sounds.** all users in a networked game are not using the same sounds.**
- `S_PauseSound` ### `S_PauseSound`
Pauses music if `notmusic` is `false` and all game sounds if `notsfx` is Pauses music if `notmusic` is `false` and all game sounds if `notsfx` is
`false`. Used for instance in the time stop power-up. `false`. Used for instance in the time stop power-up.
- `S_ResumeSound` ### `S_ResumeSound`
Resumes playing music and, if `notsfx` is `false`, all game sounds as well. Resumes playing music and, if `notsfx` is `false`, all game sounds as well.
- `S_Sound` ### `S_Sound`
Plays a sound (as defined in `SNDINFO`) from the calling object if it has Plays a sound (as defined in `SNDINFO`) from the calling object if it has world
world presence (is an actor or sector etc.) presence (is an actor or sector etc.)
`channel` may be: `channel` may be:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `CHAN_AUTO` | Automatically assigns the sound to a free channel (if one exists.) | | `CHAN_AUTO` | Automatically assigns the sound to a free channel (if one exists.) |
| `CHAN_BODY` | For footsteps and generally anything else. | | `CHAN_BODY` | For footsteps and generally anything else. |
| `CHAN_ITEM` | For item pickups. | | `CHAN_ITEM` | For item pickups. |
| `CHAN_VOICE` | For player grunts. | | `CHAN_VOICE` | For player grunts. |
| `CHAN_WEAPON` | For weapon noises. | | `CHAN_WEAPON` | For weapon noises. |
| `CHAN_5` | Extra sound channel. | | `CHAN_5` | Extra sound channel. |
| `CHAN_6` | Extra sound channel. | | `CHAN_6` | Extra sound channel. |
| `CHAN_7` | Extra sound channel. | | `CHAN_7` | Extra sound channel. |
`channel` may also have the following flags applied with the binary OR `channel` may also have the following flags applied with the binary OR
operator `|`: operator `|`:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `CHAN_LISTENERZ` | Sound ignores height entirely, playing at the listener's vertical position. | | `CHAN_LISTENERZ` | Sound ignores height entirely, playing at the listener's vertical position. |
| `CHAN_LOOP` | Continues playing the sound on loop until it is stopped manually. | | `CHAN_LOOP` | Continues playing the sound on loop until it is stopped manually. |
| `CHAN_MAYBE_LOCAL` | Does not play sound to other players if the silent pickup compatibility flag is enabled. | | `CHAN_MAYBE_LOCAL` | Does not play sound to other players if the silent pickup compatibility flag is enabled. |
| `CHAN_NOPAUSE` | Does not pause in menus or when `S_PauseSound` is called. | | `CHAN_NOPAUSE` | Does not pause in menus or when `S_PauseSound` is called. |
| `CHAN_NOSTOP` | Does not start a new sound if the channel is already playing something. | | `CHAN_NOSTOP` | Does not start a new sound if the channel is already playing something. |
| `CHAN_UI` | Does not record sound in saved games or demos. | | `CHAN_UI` | Does not record sound in saved games or demos. |
Additionally, `CHAN_PICKUP` is equivalent to `CHAN_ITEM | CHAN_MAYBE_LOCAL`. Additionally, `CHAN_PICKUP` is equivalent to `CHAN_ITEM | CHAN_MAYBE_LOCAL`.
`attenuation` determines the drop-off distance of the sound. The higher the `attenuation` determines the drop-off distance of the sound. The higher the
value, the quicker it fades. Constants include: value, the quicker it fades. Constants include:
| Name | Value | Description | | Name | Value | Description |
| ---- | ----- | ----------- | | ---- | ----- | ----------- |
| `ATTN_IDLE` | `1.001` | Uses Doom's default sound attenuation. | | `ATTN_IDLE` | `1.001` | Uses Doom's default sound attenuation. |
| `ATTN_NONE` | `0` | Does not drop off at all, plays throughout the whole map. | | `ATTN_NONE` | `0` | Does not drop off at all, plays throughout the whole map. |
| `ATTN_NORM` | `1` | Drops off using the `close_dist` and `clipping_dist` defined in `SNDINFO`. Default. | | `ATTN_NORM` | `1` | Drops off using the `close_dist` and `clipping_dist` defined in `SNDINFO`. Default. |
| `ATTN_STATIC` | `3` | Drops off quickly, at around 512 units. | | `ATTN_STATIC` | `3` | Drops off quickly, at around 512 units. |
<!-- EOF --> <!-- EOF -->

View File

@ -7,12 +7,13 @@ uint MSTime();
vararg void ThrowAbortException(string format, ...); vararg void ThrowAbortException(string format, ...);
``` ```
- `MSTime` ### `MSTime`
Returns the number of milliseconds since the engine was started. **Not deterministic.** Returns the number of milliseconds since the engine was started. **Not
deterministic.**
- `ThrowAbortException` ### `ThrowAbortException`
Kills the VM and ends the game (without exiting) with a formatted error. Kills the VM and ends the game (without exiting) with a formatted error.
<!-- EOF --> <!-- EOF -->

View File

@ -5,46 +5,46 @@ Static DeHackEd information.
``` ```
struct DehInfo struct DehInfo
{ {
readonly int BfgCells; readonly int BfgCells;
readonly int BlueAC; readonly int BlueAC;
readonly double ExplosionAlpha; readonly double ExplosionAlpha;
readonly uint8 ExplosionStyle; readonly uint8 ExplosionStyle;
readonly int MaxHealth; readonly int MaxHealth;
readonly int MaxSoulsphere; readonly int MaxSoulsphere;
readonly int NoAutofreeze; readonly int NoAutofreeze;
} }
``` ```
- `BfgCells` ### `BfgCells`
The amount of ammunition `A_FireBfg` will deplete. Default is 40. The amount of ammunition `A_FireBfg` will deplete. Default is 40.
- `BlueAC` ### `BlueAC`
Multiple of 100 for `BlueArmor`'s `Armor.SaveAmount`. Default is 2 for 200 Multiple of 100 for `BlueArmor`'s `Armor.SaveAmount`. Default is 2 for 200
armor. armor.
- `ExplosionAlpha` ### `ExplosionAlpha`
For actors with the `DEHEXPLOSION` flag, the alpha to set the actor to on For actors with the `DEHEXPLOSION` flag, the alpha to set the actor to on
explosion. explosion.
- `ExplosionStyle` ### `ExplosionStyle`
For actors with the `DEHEXPLOSION` flag, the render style to be applied on For actors with the `DEHEXPLOSION` flag, the render style to be applied on
explosion. explosion.
- `MaxHealth` ### `MaxHealth`
TODO TODO
- `MaxSoulsphere` ### `MaxSoulsphere`
The `Inventory.MaxAmount` for `Soulsphere`. Default is 200. The `Inventory.MaxAmount` for `Soulsphere`. Default is 200.
- `NoAutofreeze` ### `NoAutofreeze`
Overrides generic freezing deaths if not zero, making all actors act as if Overrides generic freezing deaths if not zero, making all actors act as if they
they had the `NOICEDEATH` flag. had the `NOICEDEATH` flag.
<!-- EOF --> <!-- EOF -->

View File

@ -6,47 +6,47 @@ and `MAPINFO`/GameInfo.
``` ```
struct FOptionMenuSettings struct FOptionMenuSettings
{ {
int mTitleColor; int mTitleColor;
int mFontColor; int mFontColor;
int mFontColorValue; int mFontColorValue;
int mFontColorMore; int mFontColorMore;
int mFontColorHeader; int mFontColorHeader;
int mFontColorHighlight; int mFontColorHighlight;
int mFontColorSelection; int mFontColorSelection;
int mLineSpacing; int mLineSpacing;
} }
``` ```
- `mTitleColor` ### `mTitleColor`
TODO TODO
- `mFontColor` ### `mFontColor`
TODO TODO
- `mFontColorValue` ### `mFontColorValue`
TODO TODO
- `mFontColorMore` ### `mFontColorMore`
TODO TODO
- `mFontColorHeader` ### `mFontColorHeader`
TODO TODO
- `mFontColorHighlight` ### `mFontColorHighlight`
TODO TODO
- `mFontColorSelection` ### `mFontColorSelection`
TODO TODO
- `mLineSpacing` ### `mLineSpacing`
The spacing in virtual pixels between two lines in an `OptionMenu`. The spacing in virtual pixels between two lines in an `OptionMenu`.
<!-- EOF --> <!-- EOF -->

View File

@ -5,28 +5,28 @@ Static information from `MAPINFO`/GameInfo.
``` ```
struct GameInfoStruct struct GameInfoStruct
{ {
double Armor2Percent; double Armor2Percent;
string ArmorIcon1; string ArmorIcon1;
string ArmorIcon2; string ArmorIcon2;
name BackpackType; name BackpackType;
textureid BerserkPic; textureid BerserkPic;
int DefKickBack; int DefKickBack;
color DefaultBloodColor; color DefaultBloodColor;
int DefaultDropStyle; int DefaultDropStyle;
int GameType; int GameType;
double GibFactor; double GibFactor;
textureid HealthPic; textureid HealthPic;
array<name> InfoPages; array<name> InfoPages;
bool IntermissionCounter; bool IntermissionCounter;
bool NoRandomPlayerClass; bool NoRandomPlayerClass;
double NormForwardMove[2]; double NormForwardMove[2];
double NormSideMove[2]; double NormSideMove[2];
double TeleFogHeight; double TeleFogHeight;
string mBackButton; string mBackButton;
name mSliderColor; name mSliderColor;
GIFont mStatScreenEnteringFont; GIFont mStatScreenEnteringFont;
GIFont mStatScreenFinishedFont; GIFont mStatScreenFinishedFont;
GIFont mStatScreenMapNameFont; GIFont mStatScreenMapNameFont;
} }
``` ```

View File

@ -5,156 +5,156 @@ Most map-relative data is stored in this structure.
``` ```
struct LevelLocals struct LevelLocals
{ {
// Map data // Map data
array<Line> Lines; array<Line> Lines;
array<Sector> Sectors; array<Sector> Sectors;
array<Side> Sides; array<Side> Sides;
internal array<SectorPortal> SectorPortals; internal array<SectorPortal> SectorPortals;
readonly array<Vertex> Vertexes; readonly array<Vertex> Vertexes;
// Stats // Stats
int Found_Items; int Found_Items;
int Found_Secrets; int Found_Secrets;
int Killed_Monsters; int Killed_Monsters;
int Total_Items; int Total_Items;
int Total_Monsters; int Total_Monsters;
int Total_Secrets; int Total_Secrets;
// Time // Time
readonly int MapTime; readonly int MapTime;
readonly int ParTime; readonly int ParTime;
readonly int StartTime; readonly int StartTime;
readonly int SuckTime; readonly int SuckTime;
readonly int Time; readonly int Time;
readonly int TotalTime; readonly int TotalTime;
// Map sequencing // Map sequencing
readonly int Cluster; readonly int Cluster;
readonly int ClusterFlags; readonly int ClusterFlags;
readonly string LevelName; readonly string LevelName;
readonly int LevelNum; readonly int LevelNum;
readonly string MapName; readonly string MapName;
string NextMap; string NextMap;
string NextSecretMap; string NextSecretMap;
readonly int MapType; readonly int MapType;
// Music // Music
readonly string Music; readonly string Music;
readonly int MusicOrder; readonly int MusicOrder;
// Sky // Sky
readonly textureid SkyTexture1; readonly textureid SkyTexture1;
readonly textureid SkyTexture2; readonly textureid SkyTexture2;
float SkySpeed1; float SkySpeed1;
float SkySpeed2; float SkySpeed2;
// Physics // Physics
play double AirControl play double AirControl;
play double AirFriction; play double AirFriction;
play int AirSupply; play int AirSupply;
play double Gravity; play double Gravity;
readonly int CompatFlags; readonly int CompatFlags;
readonly int CompatFlags2; readonly int CompatFlags2;
// State // State
bool AllMap; bool AllMap;
deprecated("3.8") bool Frozen; deprecated("3.8") bool Frozen;
// Static info // Static info
name DeathSequence; name DeathSequence;
readonly bool ActOwnSpecial; readonly bool ActOwnSpecial;
readonly bool AllowRespawn; readonly bool AllowRespawn;
readonly bool CheckSwitchRange; readonly bool CheckSwitchRange;
readonly string F1Pic; readonly string F1Pic;
readonly int FogDensity; readonly int FogDensity;
readonly bool Infinite_Flight; readonly bool Infinite_Flight;
readonly bool KeepFullInventory; readonly bool KeepFullInventory;
readonly bool MissilesActivateImpact; readonly bool MissilesActivateImpact;
readonly bool MonsterFallingDamage; readonly bool MonsterFallingDamage;
readonly bool MonstersTelefrag; readonly bool MonstersTelefrag;
readonly bool NoInventoryBar; readonly bool NoInventoryBar;
readonly bool NoMonsters; readonly bool NoMonsters;
readonly bool No_Dlg_Freeze; readonly bool No_Dlg_Freeze;
readonly int OutsideFogDensity; readonly int OutsideFogDensity;
readonly float PixelStretch; readonly float PixelStretch;
readonly bool PolyGrind; readonly bool PolyGrind;
readonly bool RemoveItems; readonly bool RemoveItems;
readonly int SkyFog; readonly int SkyFog;
readonly bool SndSeqTotalCtrl; readonly bool SndSeqTotalCtrl;
readonly double TeamDamage; readonly double TeamDamage;
double GetUdmfFloat(int type, int index, name key); double GetUdmfFloat(int type, int index, name key);
int GetUdmfInt(int type, int index, name key); int GetUdmfInt(int type, int index, name key);
string GetUdmfString(int type, int index, name key); string GetUdmfString(int type, int index, name key);
play int ExecuteSpecial(int special, Actor activator, Line linedef, bool lineside, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0, int arg5 = 0); play int ExecuteSpecial(int special, Actor activator, Line linedef, bool lineside, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0, int arg5 = 0);
void ChangeSky(textureid sky1, textureid sky2); void ChangeSky(textureid sky1, textureid sky2);
string FormatMapName(int mapnamecolor); string FormatMapName(int mapnamecolor);
string GetChecksum() const; string GetChecksum() const;
void SetInterMusic(string nextmap); void SetInterMusic(string nextmap);
void StartIntermission(name type, int state) const; void StartIntermission(name type, int state) const;
string TimeFormatted(bool totals = false); string TimeFormatted(bool totals = false);
bool IsCrouchingAllowed() const; bool IsCrouchingAllowed() const;
bool IsFreelookAllowed() const; bool IsFreelookAllowed() const;
bool IsJumpingAllowed() const; bool IsJumpingAllowed() const;
void GiveSecret(Actor activator, bool printmsg = true, bool playsound = true); void GiveSecret(Actor activator, bool printmsg = true, bool playsound = true);
void StartSlideshow(name whichone = 'none'); void StartSlideshow(name whichone = 'none');
void WorldDone(); void WorldDone();
static void MakeScreenShot(); static void MakeScreenShot();
static void MakeAutoSave(); static void MakeAutoSave();
deprecated("3.8") static void RemoveAllBots(bool fromlist); deprecated("3.8") static void RemoveAllBots(bool fromlist);
ui vector2 GetAutomapPosition(); ui vector2 GetAutomapPosition();
play SpotState GetSpotState(bool create = true); play SpotState GetSpotState(bool create = true);
int FindUniqueTid(int start = 0, int limit = 0); int FindUniqueTid(int start = 0, int limit = 0);
uint GetSkyboxPortal(Actor actor); uint GetSkyboxPortal(Actor actor);
void ReplaceTextures(string from, string to, int flags); void ReplaceTextures(string from, string to, int flags);
clearscope HealthGroup FindHealthGroup(int id); clearscope HealthGroup FindHealthGroup(int id);
vector3, int PickDeathmatchStart(); vector3, int PickDeathmatchStart();
vector3, int PickPlayerStart(int pnum, int flags = 0); vector3, int PickPlayerStart(int pnum, int flags = 0);
int IsFrozen() const; int IsFrozen() const;
void SetFrozen(bool on); void SetFrozen(bool on);
clearscope bool IsPointInLevel(vector3 p) const; clearscope bool IsPointInLevel(vector3 p) const;
clearscope Sector PointInSector(vector2 p) const; clearscope Sector PointInSector(vector2 p) const;
deprecated("3.8") static clearscope bool IsPointInMap(vector3 p); deprecated("3.8") static clearscope bool IsPointInMap(vector3 p);
clearscope vector3 SphericalCoords(vector3 viewpoint, vector3 targetPos, vector2 viewAngles = (0, 0), bool absolute = false) const; clearscope vector3 SphericalCoords(vector3 viewpoint, vector3 targetPos, vector2 viewAngles = (0, 0), bool absolute = false) const;
clearscope vector2 Vec2Diff(vector2 v1, vector2 v2) const; clearscope vector2 Vec2Diff(vector2 v1, vector2 v2) const;
clearscope vector2 Vec2Offset(vector2 pos, vector2 dir, bool absolute = false) const; clearscope vector2 Vec2Offset(vector2 pos, vector2 dir, bool absolute = false) const;
clearscope vector3 Vec2OffsetZ(vector2 pos, vector2 dir, double atz, bool absolute = false) const; clearscope vector3 Vec2OffsetZ(vector2 pos, vector2 dir, double atz, bool absolute = false) const;
clearscope vector3 Vec3Diff(vector3 v1, vector3 v2) const; clearscope vector3 Vec3Diff(vector3 v1, vector3 v2) const;
clearscope vector3 Vec3Offset(vector3 pos, vector3 dir, bool absolute = false) const; clearscope vector3 Vec3Offset(vector3 pos, vector3 dir, bool absolute = false) const;
SectorTagIterator CreateSectorTagIterator(int tag, Line defline = null); SectorTagIterator CreateSectorTagIterator(int tag, Line defline = null);
LineIDIterator CreateLineIDIterator(int tag); LineIDIterator CreateLineIDIterator(int tag);
ActorIterator CreateActorIterator(int tid, class<Actor> type = "Actor"); ActorIterator CreateActorIterator(int tid, class<Actor> type = "Actor");
play bool CreateCeiling(Sector sec, int type, Line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, int crushmode = 0); play bool CreateCeiling(Sector sec, int type, Line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, int crushmode = 0);
play bool CreateFloor(Sector sec, int type, Line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, bool crushmode = false, bool hereticlower = false); play bool CreateFloor(Sector sec, int type, Line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, bool crushmode = false, bool hereticlower = false);
} }
``` ```
TODO TODO
- `ClusterFlags` ### `ClusterFlags`
Flags for this cluster. May contain any of the following bit flags: Flags for this cluster. May contain any of the following bit flags:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `Level.CLUSTER_HUB` | This cluster uses hub behaviour. | | `Level.CLUSTER_HUB` | This cluster uses hub behaviour. |
<!-- EOF --> <!-- EOF -->

View File

@ -5,28 +5,28 @@ A class containing an animated intermission background.
``` ```
class InterBackground : Object play class InterBackground : Object play
{ {
static InterBackground Create(WBStartStruct wbs); static InterBackground Create(WBStartStruct wbs);
virtual void DrawBackground(int curstate, bool drawsplat, bool pointeron); virtual void DrawBackground(int curstate, bool drawsplat, bool pointeron);
virtual bool LoadBackground(bool isenterpic); virtual bool LoadBackground(bool isenterpic);
virtual void UpdateAnimatedBack(); virtual void UpdateAnimatedBack();
} }
``` ```
- `Create` ### `Create`
TODO TODO
- `DrawBackground` ### `DrawBackground`
TODO TODO
- `LoadBackground` ### `LoadBackground`
TODO TODO
- `UpdateAnimatedBack` ### `UpdateAnimatedBack`
TODO TODO
<!-- EOF --> <!-- EOF -->

View File

@ -5,31 +5,31 @@ Either a patch or string depending on external configurations.
``` ```
struct PatchInfo play struct PatchInfo play
{ {
int mColor; int mColor;
Font mFont; Font mFont;
textureid mPatch; textureid mPatch;
void Init(GIFont gifont); void Init(GIFont gifont);
} }
``` ```
- `mColor` ### `mColor`
The color of the font, if this is a string. The color of the font, if this is a string.
- `mFont` ### `mFont`
The font, if this is a string, or `null`. The font, if this is a string, or `null`.
- `mPatch` ### `mPatch`
The patch, if this is a patch, or an invalid texture. The patch, if this is a patch, or an invalid texture.
- `Init` ### `Init`
Initializes the structure. If `gifont.Color` is `'Null'`, and Initializes the structure. If `gifont.Color` is `'Null'`, and `gifont.FontName`
`gifont.FontName` is a valid patch, `mPatch` will be set accordingly. is a valid patch, `mPatch` will be set accordingly. Otherwise, if the font has
Otherwise, if the font has a color or the patch is invalid, a color or the patch is invalid, `gifont.FontName` is used to set `mFont` (or
`gifont.FontName` is used to set `mFont` (or it is defaulted to `BigFont`.) it is defaulted to `BigFont`.)
<!-- EOF --> <!-- EOF -->

View File

@ -5,422 +5,420 @@ The base class for intermission status screens. Any status screen used by
Status screens have four stages: Status screens have four stages:
- `STATCOUNT`, where the stats are counted and displayed. * `STATCOUNT`, where the stats are counted and displayed.
- `SHOWNEXTLOC`, where the next map is shown as "ENTERING (map name)" and in episodic maps, the world map. * `SHOWNEXTLOC`, where the next map is shown as "ENTERING (map name)" and in episodic maps, the world map.
- `NOSTATE`, at the very end of this process, where the last frame is drawn and the intermission is exited. * `NOSTATE`, at the very end of this process, where the last frame is drawn and the intermission is exited.
- `LEAVINGINTERMISSION`, which is used only to signify that all stages are done and the status screen has been exited. * `LEAVINGINTERMISSION`, which is used only to signify that all stages are done and the status screen has been exited.
These are provided as constants in `StatusScreen`. The starting stage is `STATCOUNT`. These are provided as constants in `StatusScreen`. The starting stage is `STATCOUNT`.
``` ```
class StatusScreen : Object abstract play class StatusScreen : Object abstract play
{ {
const NG_STATSY; const NG_STATSY;
const SHOWNEXTLOCDELAY; const SHOWNEXTLOCDELAY;
const SP_STATSX; const SP_STATSX;
const SP_STATSY; const SP_STATSY;
const SP_TIMEX; const SP_TIMEX;
const SP_TIMEY; const SP_TIMEY;
const TITLEY; const TITLEY;
InterBackground BG; InterBackground BG;
WBPlayerStruct Plrs[MAXPLAYERS]; WBPlayerStruct Plrs[MAXPLAYERS];
WBStartStruct Wbs; WBStartStruct Wbs;
int AccelerateStage; int AccelerateStage;
int BCnt; int BCnt;
int Cnt; int Cnt;
int Cnt_Deaths[MAXPLAYERS]; int Cnt_Deaths[MAXPLAYERS];
int Cnt_Frags[MAXPLAYERS]; int Cnt_Frags[MAXPLAYERS];
int Cnt_Items[MAXPLAYERS]; int Cnt_Items[MAXPLAYERS];
int Cnt_Kills[MAXPLAYERS]; int Cnt_Kills[MAXPLAYERS];
int Cnt_Par; int Cnt_Par;
int Cnt_Pause; int Cnt_Pause;
int Cnt_Secret[MAXPLAYERS]; int Cnt_Secret[MAXPLAYERS];
int Cnt_Time; int Cnt_Time;
int Cnt_Total_Time; int Cnt_Total_Time;
int CurState; int CurState;
int DoFrags; int DoFrags;
int Me; int Me;
int NG_State; int NG_State;
bool NoAutoStartMap; bool NoAutoStartMap;
bool PlayerReady[MAXPLAYERS]; bool PlayerReady[MAXPLAYERS];
int Player_Deaths[MAXPLAYERS]; int Player_Deaths[MAXPLAYERS];
bool Snl_PointerOn; bool Snl_PointerOn;
int SP_State; int SP_State;
float ShadowAlpha; float ShadowAlpha;
int Total_Deaths; int Total_Deaths;
int Total_Frags; int Total_Frags;
PatchInfo Entering; PatchInfo Entering;
PatchInfo Finished; PatchInfo Finished;
PatchInfo MapName; PatchInfo MapName;
textureid Items; textureid Items;
textureid Kills; textureid Kills;
textureid P_Secret; textureid P_Secret;
textureid Par; textureid Par;
textureid Secret; textureid Secret;
textureid Sucks; textureid Sucks;
textureid Timepic; textureid Timepic;
string LNameTexts[2]; string LNameTexts[2];
int DrawCharPatch(Font fnt, int charcode, int x, int y, int translation = Font.CR_UNTRANSLATED, bool nomove = false); int DrawCharPatch(Font fnt, int charcode, int x, int y, int translation = Font.CR_UNTRANSLATED, bool nomove = false);
void DrawEL(); void DrawEL();
int DrawLF(); int DrawLF();
int DrawName(int y, textureid tex, string levelname); int DrawName(int y, textureid tex, string levelname);
int DrawNum(Font fnt, int x, int y, int n, int digits, bool leadingzeros = true, int translation = Font.CR_UNTRANSLATED); int DrawNum(Font fnt, int x, int y, int n, int digits, bool leadingzeros = true, int translation = Font.CR_UNTRANSLATED);
int DrawPatchText(int y, PatchInfo pinfo, string stringname); int DrawPatchText(int y, PatchInfo pinfo, string stringname);
void DrawPercent(Font fnt, int x, int y, int p, int b, bool show_total = true, int color = Font.CR_UNTRANSLATED); void DrawPercent(Font fnt, int x, int y, int p, int b, bool show_total = true, int color = Font.CR_UNTRANSLATED);
void DrawTime(int x, int y, int t, bool no_sucks = false); void DrawTime(int x, int y, int t, bool no_sucks = false);
bool AutoSkip(); bool AutoSkip();
virtual void Drawer(); virtual void Drawer();
virtual void End(); virtual void End();
virtual void Start(WBStartStruct wbs_); virtual void Start(WBStartStruct wbs_);
virtual void StartMusic(); virtual void StartMusic();
virtual void Ticker(); virtual void Ticker();
protected virtual void DrawNoState(); protected virtual void DrawNoState();
protected virtual void DrawShowNextLoc(); protected virtual void DrawShowNextLoc();
protected virtual void DrawStats(); protected virtual void DrawStats();
protected virtual void InitNoState(); protected virtual void InitNoState();
protected virtual void InitShowNextLoc(); protected virtual void InitShowNextLoc();
protected virtual void InitStats(); protected virtual void InitStats();
protected virtual void UpdateNoState(); protected virtual void UpdateNoState();
protected virtual void UpdateShowNextLoc(); protected virtual void UpdateShowNextLoc();
protected virtual void UpdateStats(); protected virtual void UpdateStats();
protected void CheckForAccelerate(); protected void CheckForAccelerate();
protected int FragSum(int playernum); protected int FragSum(int playernum);
static int, int, int GetPlayerWidths(); static int, int, int GetPlayerWidths();
static color GetRowColor(PlayerInfo player, bool highlight); static color GetRowColor(PlayerInfo player, bool highlight);
static void GetSortedPlayers(in out array<int> sorted, bool teamplay); static void GetSortedPlayers(in out array<int> sorted, bool teamplay);
static void PlaySound(sound snd); static void PlaySound(sound snd);
} }
``` ```
- `NG_STATSY` ### `NG_STATSY`
TODO TODO
- `SHOWNEXTLOCDELAY` ### `SHOWNEXTLOCDELAY`
TODO TODO
- `SP_STATSX` ### `SP_STATSX`
TODO TODO
- `SP_STATSY` ### `SP_STATSY`
TODO TODO
- `SP_TIMEX` ### `SP_TIMEX`
TODO TODO
- `SP_TIMEY` ### `SP_TIMEY`
TODO TODO
- `TITLEY` ### `TITLEY`
The Y position (in 320x200 pixels) to draw the top of the "finished" and The Y position (in 320x200 pixels) to draw the top of the "finished" and
"entering" texts. Used by `DrawEL` and `DrawLF`. "entering" texts. Used by `DrawEL` and `DrawLF`.
- `BG` ### `BG`
The `InterBackground` object for this intermission, set by `Start` with the The `InterBackground` object for this intermission, set by `Start` with the
initial `Wbs` object. initial `Wbs` object.
- `Plrs` ### `Plrs`
The value of `Wbs.Plyr` when `Start` was called. Usually not changed, so The value of `Wbs.Plyr` when `Start` was called. Usually not changed, so
essentially equivalent to `Wbs.Plyr`. essentially equivalent to `Wbs.Plyr`.
- `Wbs` ### `Wbs`
The `WBStartStruct` passed to this class via the `Start` function. The `WBStartStruct` passed to this class via the `Start` function.
- `AccelerateStage` ### `AccelerateStage`
Used to signify to the current stage that it should go quicker or be skipped Used to signify to the current stage that it should go quicker or be skipped
entirely. entirely.
- `BCnt` ### `BCnt`
TODO TODO
- `Cnt` ### `Cnt`
TODO TODO
- `Cnt_Deaths` ### `Cnt_Deaths`
TODO TODO
- `Cnt_Frags` ### `Cnt_Frags`
TODO TODO
- `Cnt_Items` ### `Cnt_Items`
TODO TODO
- `Cnt_Kills` ### `Cnt_Kills`
TODO TODO
- `Cnt_Par` ### `Cnt_Par`
TODO TODO
- `Cnt_Pause` ### `Cnt_Pause`
TODO TODO
- `Cnt_Secret` ### `Cnt_Secret`
TODO TODO
- `Cnt_Time` ### `Cnt_Time`
TODO TODO
- `Cnt_Total_Time` ### `Cnt_Total_Time`
TODO TODO
- `CurState` ### `CurState`
The current stage the intermission is in. The current stage the intermission is in.
- `DoFrags` ### `DoFrags`
TODO TODO
- `Me` ### `Me`
The value of `Wbs.PNum` when `Start` was called. Usually not changed, so The value of `Wbs.PNum` when `Start` was called. Usually not changed, so
essentially equivalent to `Wbs.PNum`. essentially equivalent to `Wbs.PNum`.
- `NG_State` ### `NG_State`
TODO TODO
- `NoAutoStartMap` ### `NoAutoStartMap`
TODO TODO
- `PlayerReady` ### `PlayerReady`
Used in networked games to signify when each player is ready to continue to Used in networked games to signify when each player is ready to continue to the
the next map. Set by `CheckForAccelerate`. next map. Set by `CheckForAccelerate`.
- `Player_Deaths` ### `Player_Deaths`
TODO TODO
- `Snl_PointerOn` ### `Snl_PointerOn`
TODO TODO
- `SP_State` ### `SP_State`
Used in single-player status screens during the `STATCOUNT` stage for Used in single-player status screens during the `STATCOUNT` stage for
indicating the current round of statistics to count up. indicating the current round of statistics to count up.
- `ShadowAlpha` ### `ShadowAlpha`
TODO TODO
- `Total_Deaths` ### `Total_Deaths`
TODO TODO
- `Total_Frags` ### `Total_Frags`
TODO TODO
- `Entering` ### `Entering`
TODO TODO
- `Finished` ### `Finished`
TODO TODO
- `MapName` ### `MapName`
TODO TODO
- `Items` ### `Items`
The "ITEMS" (default `WIOSTI`) graphic. The "ITEMS" (default `WIOSTI`) graphic.
- `Kills` ### `Kills`
The "KILLS" (default `WIOSTK`) graphic. The "KILLS" (default `WIOSTK`) graphic.
- `P_Secret` ### `P_Secret`
The "SECRET" (default `WISCRT2`) graphic. The "SECRET" (default `WISCRT2`) graphic.
- `Par` ### `Par`
The "PAR" (default `WIPAR`) graphic. The "PAR" (default `WIPAR`) graphic.
- `Secret` ### `Secret`
The "SCRT" (default `WIOSTS`) graphic. The "SCRT" (default `WIOSTS`) graphic.
- `Sucks` ### `Sucks`
The "SUCKS" (default `WISUCKS`) graphic. The "SUCKS" (default `WISUCKS`) graphic.
- `Timepic` ### `Timepic`
The "TIME" (default `WITIME`) graphic. The "TIME" (default `WITIME`) graphic.
- `LNameTexts` ### `LNameTexts`
TODO TODO
- `DrawCharPatch` ### `DrawCharPatch`
TODO TODO
- `DrawEL` ### `DrawEL`
TODO TODO
- `DrawLF` ### `DrawLF`
TODO TODO
- `DrawName` ### `DrawName`
TODO TODO
- `DrawNum` ### `DrawNum`
TODO TODO
- `DrawPatchText` ### `DrawPatchText`
TODO TODO
- `DrawPercent` ### `DrawPercent`
TODO TODO
- `DrawTime` ### `DrawTime`
TODO TODO
- `AutoSkip` ### `AutoSkip`
TODO TODO
- `Drawer` ### `Drawer`
Called by `WI_Drawer`, which is called every frame when `GameState` is Called by `WI_Drawer`, which is called every frame when `GameState` is
`GS_INTERMISSION`. `GS_INTERMISSION`.
- `End` ### `End`
Called when the intermission should end. Default behaviour is to set Called when the intermission should end. Default behaviour is to set `CurState`
`CurState` to `LEAVINGINTERMISSION` and remove bots in death-match. to `LEAVINGINTERMISSION` and remove bots in death-match. Generally,
Generally, `Level.WorldDone` should be called directly after this. `Level.WorldDone` should be called directly after this.
- `Start` ### `Start`
Called by `WI_Start` after the `WBStartStruct` is populated, sounds are Called by `WI_Start` after the `WBStartStruct` is populated, sounds are stopped
stopped and the screen blend is set to black. Sets up initial values and and the screen blend is set to black. Sets up initial values and runs
runs `InitStats`. `InitStats`.
- `StartMusic` ### `StartMusic`
Called in the first tick by `Ticker` to set the intermission music. Called in the first tick by `Ticker` to set the intermission music.
- `Ticker` ### `Ticker`
Called by `WI_Ticker`, which is called every game tick when `GameState` is Called by `WI_Ticker`, which is called every game tick when `GameState` is
`GS_INTERMISSION`. `GS_INTERMISSION`.
- `DrawNoState` ### `DrawNoState`
Called by `Drawer` when `CurState` is `NOSTATE` or any other non-state. Called by `Drawer` when `CurState` is `NOSTATE` or any other non-state.
- `DrawShowNextLoc` ### `DrawShowNextLoc`
Called by `Drawer` when `CurState` is `SHOWNEXTLOC` and, by default, Called by `Drawer` when `CurState` is `SHOWNEXTLOC` and, by default,
`DrawNoState` after setting `Snl_PointerOn` to `true`. `DrawNoState` after setting `Snl_PointerOn` to `true`.
- `DrawStats` ### `DrawStats`
Called by `Drawer` directly after drawing the animated background when Called by `Drawer` directly after drawing the animated background when
`CurState` is `STATCOUNT`. `CurState` is `STATCOUNT`.
- `InitNoState` ### `InitNoState`
Called by `UpdateShowNextLoc` to initiate the `NOSTATE` stage. Called by `UpdateShowNextLoc` to initiate the `NOSTATE` stage.
- `InitShowNextLoc` ### `InitShowNextLoc`
Called by `UpdateStats` to initiate the `SHOWNEXTLOC` stage. Called by `UpdateStats` to initiate the `SHOWNEXTLOC` stage.
- `InitStats` ### `InitStats`
Called by `Start` to initiate the `STATCOUNT` stage. Called by `Start` to initiate the `STATCOUNT` stage.
- `UpdateNoState` ### `UpdateNoState`
Called by `Ticker` when `CurState` is `NOSTATE` or any other non-state. Called by `Ticker` when `CurState` is `NOSTATE` or any other non-state. Exits
Exits the intermission by calling `End` and `Level.WorldDone` when the intermission by calling `End` and `Level.WorldDone` when appropriate.
appropriate.
- `UpdateShowNextLoc` ### `UpdateShowNextLoc`
Called by `Ticker` when `CurState` is `SHOWNEXTLOC`. Runs `InitNoState` when Called by `Ticker` when `CurState` is `SHOWNEXTLOC`. Runs `InitNoState` when
appropriate and alternates `Snl_PointerOn`. appropriate and alternates `Snl_PointerOn`.
- `UpdateStats` ### `UpdateStats`
Called by `Ticker` when `CurState` is `STATCOUNT`. Runs `InitShowNextLoc` Called by `Ticker` when `CurState` is `STATCOUNT`. Runs `InitShowNextLoc`
when appropriate. when appropriate.
- `CheckForAccelerate` ### `CheckForAccelerate`
Updates the values of `AccelerateStage` and `PlayerReady` according to each Updates the values of `AccelerateStage` and `PlayerReady` according to each
player's inputs. player's inputs.
- `FragSum` ### `FragSum`
Returns the number of frags player `playernum` has accumulated against all Returns the number of frags player `playernum` has accumulated against all
currently in-game players. This is different from `WBPlayerStruct.FragCount` currently in-game players. This is different from `WBPlayerStruct.FragCount`
because it is counted dynamically, i.e. if a player leaves the count will be because it is counted dynamically, i.e. if a player leaves the count will be
changed. This is only useful for game modes where frags do not count as changed. This is only useful for game modes where frags do not count as score.
score.
- `GetPlayerWidths` ### `GetPlayerWidths`
TODO TODO
- `GetRowColor` ### `GetRowColor`
TODO TODO
- `GetSortedPlayers` ### `GetSortedPlayers`
TODO TODO
- `PlaySound` ### `PlaySound`
Plays a UI sound at full volume using `S_Sound`. Plays a UI sound at full volume using `S_Sound`.
<!-- EOF --> <!-- EOF -->

View File

@ -5,39 +5,39 @@ Information for each individual player for a `StatusScreen`.
``` ```
struct WBPlayerStruct struct WBPlayerStruct
{ {
int SItems; int SItems;
int SKills; int SKills;
int SSecret; int SSecret;
int STime; int STime;
int FragCount; int FragCount;
int Frags[MAXPLAYERS]; int Frags[MAXPLAYERS];
} }
``` ```
- `SItems` ### `SItems`
The number of items this player acquired. The number of items this player acquired.
- `SKills` ### `SKills`
The number of monsters this player killed. The number of monsters this player killed.
- `SSecret` ### `SSecret`
The number of secrets this player found. The number of secrets this player found.
- `STime` ### `STime`
The time this player finished the level at, in ticks. (This is the same for The time this player finished the level at, in ticks. (This is the same for all
all players.) players.)
- `FragCount` ### `FragCount`
The total amount of frags this player scored against all players. The total amount of frags this player scored against all players.
- `Frags` ### `Frags`
The number of frags this player scored against each other player. The number of frags this player scored against each other player.
<!-- EOF --> <!-- EOF -->

View File

@ -5,92 +5,92 @@ Information passed into the `StatusScreen` class when an intermission starts.
``` ```
struct WBStartStruct struct WBStartStruct
{ {
WBPlayerStruct Plyr[MAXPLAYERS]; WBPlayerStruct Plyr[MAXPLAYERS];
int PNum; int PNum;
int Finished_Ep; int Finished_Ep;
int Next_Ep; int Next_Ep;
string Current; string Current;
string Next; string Next;
string NextName; string NextName;
textureid LName0; textureid LName0;
textureid LName1; textureid LName1;
int MaxFrags; int MaxFrags;
int MaxItems; int MaxItems;
int MaxKills; int MaxKills;
int MaxSecret; int MaxSecret;
int ParTime; int ParTime;
int SuckTime; int SuckTime;
int TotalTime; int TotalTime;
} }
``` ```
- `Plyr` ### `Plyr`
The `WBPlayerStruct` for each player. The `WBPlayerStruct` for each player.
- `PNum` ### `PNum`
The index of the player to show stats for. The index of the player to show stats for.
- `Finished_Ep` ### `Finished_Ep`
The cluster of the finished map, minus one. The cluster of the finished map, minus one.
- `Next_Ep` ### `Next_Ep`
The cluster of the next map, minus one. The cluster of the next map, minus one.
- `Current` ### `Current`
The name of the map that was finished. The name of the map that was finished.
- `Next` ### `Next`
The name of the next map. The name of the next map.
- `NextName` ### `NextName`
The printable name of the next map. The printable name of the next map.
- `LName0` ### `LName0`
Texture ID of the level name of the map that was finished. Texture ID of the level name of the map that was finished.
- `LName1` ### `LName1`
Texture ID of the level name of the map being entered. Texture ID of the level name of the map being entered.
- `MaxFrags` ### `MaxFrags`
Unknown purpose, not actually used by any part of the engine. Unknown purpose, not actually used by any part of the engine.
- `MaxItems` ### `MaxItems`
The maximum number of acquired items in the map. The maximum number of acquired items in the map.
- `MaxKills` ### `MaxKills`
The maximum number of killed monsters in the map. The maximum number of killed monsters in the map.
- `MaxSecret` ### `MaxSecret`
The maximum number of found secrets in the map. The maximum number of found secrets in the map.
- `ParTime` ### `ParTime`
The par time of the map, in ticks. The par time of the map, in ticks.
- `SuckTime` ### `SuckTime`
The suck time of the map, in minutes. The suck time of the map, in minutes.
- `TotalTime` ### `TotalTime`
The total time for the whole game, in ticks. The total time for the whole game, in ticks.
<!-- EOF --> <!-- EOF -->

View File

@ -5,28 +5,28 @@ Describes the coloring of a sector.
``` ```
struct FColorMap struct FColorMap
{ {
uint8 BlendFactor; uint8 BlendFactor;
uint8 Desaturation; uint8 Desaturation;
color FadeColor; color FadeColor;
color LightColor; color LightColor;
} }
``` ```
- `BlendFactor` ### `BlendFactor`
TODO: "This is for handling Legacy-style color maps which use a different TODO: "This is for handling Legacy-style color maps which use a different
formula to calculate how the color affects lighting." formula to calculate how the color affects lighting."
- `Desaturation` ### `Desaturation`
How much to desaturate colors in this sector. Range is 0 to 255, inclusive. How much to desaturate colors in this sector. Range is 0 to 255, inclusive.
- `FadeColor` ### `FadeColor`
The color of fog in this sector. None if all components are 0. The color of fog in this sector. None if all components are 0.
- `LightColor` ### `LightColor`
The color of the sector. Default if all components are 0. The color of the sector. Default if all components are 0.
<!-- EOF --> <!-- EOF -->

View File

@ -5,174 +5,174 @@ Also known as a "linedef." A line segment with two sides and two vertices.
``` ```
struct Line play struct Line play
{ {
readonly Sector BackSector, FrontSector; readonly Sector BackSector, FrontSector;
readonly double BBox[4]; readonly double BBox[4];
readonly vector2 Delta; readonly vector2 Delta;
readonly Side Sidedef[2]; readonly Side Sidedef[2];
readonly Vertex V1, V2; readonly Vertex V1, V2;
readonly uint PortalIndex; readonly uint PortalIndex;
readonly uint PortalTransferred; readonly uint PortalTransferred;
readonly int Health; readonly int Health;
readonly int HealthGroup; readonly int HealthGroup;
double Alpha; double Alpha;
uint Flags; uint Flags;
int ValidCount; int ValidCount;
uint Activation; uint Activation;
int Args[5]; int Args[5];
int LockNumber; int LockNumber;
int Special; int Special;
int Index(); int Index();
bool Activate(Actor activator, int side, int type); bool Activate(Actor activator, int side, int type);
bool RemoteActivate(Actor activator, int side, int type, vector3 pos); bool RemoteActivate(Actor activator, int side, int type, vector3 pos);
Line GetPortalDestination(); Line GetPortalDestination();
bool IsLinePortal(); bool IsLinePortal();
bool IsVisualPortal(); bool IsVisualPortal();
clearscope int GetHealth(); clearscope int GetHealth();
void SetHealth(int newhealth); void SetHealth(int newhealth);
double GetUdmfFloat(name nm); double GetUdmfFloat(name nm);
int GetUdmfInt(name nm); int GetUdmfInt(name nm);
string GetUdmfString(name nm); string GetUdmfString(name nm);
} }
``` ```
- `BackSector`, `FrontSector` ### `BackSector`, `FrontSector`
The sector of the front and back sides of this line. The sector of the front and back sides of this line.
- `BBox` ### `BBox`
The top, bottom, left and right of the line, respective to array index. The top, bottom, left and right of the line, respective to array index.
- `Delta` ### `Delta`
Equivalent to `V2 - V1`. Equivalent to `V2 - V1`.
- `V1`, `V2` ### `V1`, `V2`
Returns the start and end points of this line segment, respectively. Returns the start and end points of this line segment, respectively.
- `Sidedef` ### `Sidedef`
The front and back sides of this line, 0 and 1 respectively. The aliases The front and back sides of this line, 0 and 1 respectively. The aliases
`Line.Front` and `Line.Back` are provided as well. `Line.Front` and `Line.Back` are provided as well.
- `PortalIndex` ### `PortalIndex`
TODO TODO
- `PortalTransferred` ### `PortalTransferred`
TODO TODO
- `Health` ### `Health`
TODO TODO
- `HealthGroup` ### `HealthGroup`
TODO TODO
- `Alpha` ### `Alpha`
Alpha of the middle texture on both sides. Alpha of the middle texture on both sides.
- `Flags` ### `Flags`
Any combination of the following bit flags: Any combination of the following bit flags:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `ML_3DMIDTEX_IMPASS` | Middle texture will collide with projectiles and allow them to pass through. | | `ML_3DMIDTEX_IMPASS` | Middle texture will collide with projectiles and allow them to pass through. |
| `ML_3DMIDTEX` | Middle texture can be collided with and walked on as if it were a thin sector. | | `ML_3DMIDTEX` | Middle texture can be collided with and walked on as if it were a thin sector. |
| `ML_ADDTRANS` | Middle textures are drawn with additive translucency on both sides. | | `ML_ADDTRANS` | Middle textures are drawn with additive translucency on both sides. |
| `ML_BLOCKEVERYTHING` | Line blocks everything. | | `ML_BLOCKEVERYTHING` | Line blocks everything. |
| `ML_BLOCKHITSCAN` | Line blocks hit scan attacks. | | `ML_BLOCKHITSCAN` | Line blocks hit scan attacks. |
| `ML_BLOCKING` | Line is solid and blocks everything but projectiles and hit scan attacks. | | `ML_BLOCKING` | Line is solid and blocks everything but projectiles and hit scan attacks. |
| `ML_BLOCKMONSTERS` | Line blocks non-flying monsters. | | `ML_BLOCKMONSTERS` | Line blocks non-flying monsters. |
| `ML_BLOCKPROJECTILE` | Line blocks projectiles. | | `ML_BLOCKPROJECTILE` | Line blocks projectiles. |
| `ML_BLOCKSIGHT` | Line blocks line of sight. | | `ML_BLOCKSIGHT` | Line blocks line of sight. |
| `ML_BLOCKUSE` | Line blocks use actions. | | `ML_BLOCKUSE` | Line blocks use actions. |
| `ML_BLOCK_FLOATERS` | Line blocks flying monsters. | | `ML_BLOCK_FLOATERS` | Line blocks flying monsters. |
| `ML_BLOCK_PLAYERS` | Line blocks players. | | `ML_BLOCK_PLAYERS` | Line blocks players. |
| `ML_CHECKSWITCHRANGE` | Checks the activator's vertical position as well as horizontal before activating. | | `ML_CHECKSWITCHRANGE` | Checks the activator's vertical position as well as horizontal before activating. |
| `ML_CLIP_MIDTEX` | Applies `WALLF_CLIP_MIDTEX` to both sides. | | `ML_CLIP_MIDTEX` | Applies `WALLF_CLIP_MIDTEX` to both sides. |
| `ML_DONTDRAW` | Never shown on the auto-map. | | `ML_DONTDRAW` | Never shown on the auto-map. |
| `ML_DONTPEGBOTTOM` | Lower texture is unpegged on both sides. | | `ML_DONTPEGBOTTOM` | Lower texture is unpegged on both sides. |
| `ML_DONTPEGTOP` | Upper texture is unpegged on both sides. | | `ML_DONTPEGTOP` | Upper texture is unpegged on both sides. |
| `ML_FIRSTSIDEONLY` | Special can only be activated from the front side. | | `ML_FIRSTSIDEONLY` | Special can only be activated from the front side. |
| `ML_MAPPED` | Always shown on the auto-map. | | `ML_MAPPED` | Always shown on the auto-map. |
| `ML_MONSTERSCANACTIVATE` | Monsters may activate this line. | | `ML_MONSTERSCANACTIVATE` | Monsters may activate this line. |
| `ML_RAILING` | Line is a railing that can be jumped over. | | `ML_RAILING` | Line is a railing that can be jumped over. |
| `ML_REPEAT_SPECIAL` | Special may be activated multiple times. | | `ML_REPEAT_SPECIAL` | Special may be activated multiple times. |
| `ML_SECRET` | Line will be shown as one-sided on the auto-map. | | `ML_SECRET` | Line will be shown as one-sided on the auto-map. |
| `ML_SOUNDBLOCK` | Blocks sound propagation after two lines with this flag. | | `ML_SOUNDBLOCK` | Blocks sound propagation after two lines with this flag. |
| `ML_TWOSIDED` | Line has a back side. | | `ML_TWOSIDED` | Line has a back side. |
| `ML_WRAP_MIDTEX` | Applies `WALLF_WRAP_MIDTEX` to both sides. | | `ML_WRAP_MIDTEX` | Applies `WALLF_WRAP_MIDTEX` to both sides. |
| `ML_ZONEBOUNDARY` | Reverb zone boundary. | | `ML_ZONEBOUNDARY` | Reverb zone boundary. |
- `ValidCount` ### `ValidCount`
Don't use this. Don't use this.
- `Activation` ### `Activation`
TODO TODO
- `Args` ### `Args`
Arguments of the line's special action. Arguments of the line's special action.
- `LockNumber` ### `LockNumber`
TODO TODO
- `Special` ### `Special`
Number of the special action to be executed when this line is activated. Number of the special action to be executed when this line is activated.
- `Index` ### `Index`
Returns the index of this line. Returns the index of this line.
- `Activate` ### `Activate`
TODO TODO
- `RemoteActivate` ### `RemoteActivate`
TODO TODO
- `GetPortalDestination` ### `GetPortalDestination`
TODO TODO
- `IsLinePortal` ### `IsLinePortal`
TODO TODO
- `IsVisualPortal` ### `IsVisualPortal`
TODO TODO
- `GetHealth` ### `GetHealth`
TODO TODO
- `SetHealth` ### `SetHealth`
TODO TODO
- `GetUdmfFloat`, `GetUdmfInt`, `GetUdmfString` ### `GetUdmfFloat`, `GetUdmfInt`, `GetUdmfString`
Gets a named UDMF property attached to this linedef. Gets a named UDMF property attached to this linedef.
<!-- EOF --> <!-- EOF -->

View File

@ -5,19 +5,19 @@ Iterates over line indices with a specified tag.
``` ```
class LineIdIterator : Object class LineIdIterator : Object
{ {
static LineIdIterator Create(int tag); static LineIdIterator Create(int tag);
int Next(); int Next();
} }
``` ```
- `Create` ### `Create`
Creates a new iterator over lines with tag `tag`. Creates a new iterator over lines with tag `tag`.
- `Next` ### `Next`
Returns the index of the current line and advances the iterator. Returns Returns the index of the current line and advances the iterator. Returns `-1`
`-1` when the list is exhausted. when the list is exhausted.
<!-- EOF --> <!-- EOF -->

View File

@ -5,69 +5,69 @@ TODO
``` ```
struct SecPlane play struct SecPlane play
{ {
double D; double D;
double NegiC; double NegiC;
vector3 Normal; vector3 Normal;
void ChangeHeight(double hdiff); void ChangeHeight(double hdiff);
double GetChangedHeight(double hdiff) const; double GetChangedHeight(double hdiff) const;
double HeightDiff(double oldd, double newd = 0.0) const; double HeightDiff(double oldd, double newd = 0.0) const;
bool IsEqual(SecPlane other) const; bool IsEqual(SecPlane other) const;
bool IsSlope() const; bool IsSlope() const;
int PointOnSide(vector3 pos) const; int PointOnSide(vector3 pos) const;
double PointToDist(vector2 xy, double z) const; double PointToDist(vector2 xy, double z) const;
double ZAtPointDist(vector2 v, double dist) const; double ZAtPointDist(vector2 v, double dist) const;
clearscope double ZAtPoint(vector2 v) const; clearscope double ZAtPoint(vector2 v) const;
} }
``` ```
- `D` ### `D`
TODO TODO
- `NegiC` ### `NegiC`
TODO TODO
- `Normal` ### `Normal`
TODO TODO
- `ChangeHeight` ### `ChangeHeight`
TODO TODO
- `GetChangedHeight` ### `GetChangedHeight`
TODO TODO
- `HeightDiff` ### `HeightDiff`
TODO TODO
- `IsEqual` ### `IsEqual`
TODO TODO
- `IsSlope` ### `IsSlope`
TODO TODO
- `PointOnSide` ### `PointOnSide`
TODO TODO
- `PointToDist` ### `PointToDist`
TODO TODO
- `ZAtPointDist` ### `ZAtPointDist`
TODO TODO
- `ZAtPoint` ### `ZAtPoint`
TODO TODO
<!-- EOF --> <!-- EOF -->

View File

@ -5,37 +5,37 @@ TODO
``` ```
struct SecSpecial play struct SecSpecial play
{ {
int DamageAmount; int DamageAmount;
int16 DamageInterval; int16 DamageInterval;
name DamageType; name DamageType;
int Flags; int Flags;
int16 LeakyDamage; int16 LeakyDamage;
int16 Special; int16 Special;
} }
``` ```
- `DamageAmount` ### `DamageAmount`
TODO TODO
- `DamageInterval` ### `DamageInterval`
TODO TODO
- `DamageType` ### `DamageType`
TODO TODO
- `Flags` ### `Flags`
TODO TODO
- `LeakyDamage` ### `LeakyDamage`
TODO TODO
- `Special` ### `Special`
TODO TODO
<!-- EOF --> <!-- EOF -->

View File

@ -5,189 +5,189 @@ TODO
``` ```
struct Sector play struct Sector play
{ {
readonly color[5] AdditiveColors; readonly color[5] AdditiveColors;
readonly FColormap ColorMap; readonly FColormap ColorMap;
readonly color[5] SpecialColors; readonly color[5] SpecialColors;
Actor SoundTarget; Actor SoundTarget;
int16 LightLevel; int16 LightLevel;
int16 SeqType; int16 SeqType;
int16 Special; int16 Special;
name SeqName; name SeqName;
int Sky; int Sky;
readonly vector2 CenterSpot; readonly vector2 CenterSpot;
Actor ThingList; Actor ThingList;
int ValidCount; int ValidCount;
double Friction; double Friction;
double MoveFactor; double MoveFactor;
int TerrainNum[2]; int TerrainNum[2];
SectorEffect CeilingData; SectorEffect CeilingData;
SectorEffect FloorData; SectorEffect FloorData;
SectorEffect LightingData; SectorEffect LightingData;
int NextSec; int NextSec;
int PrevSec; int PrevSec;
uint8 SoundTraversed; uint8 SoundTraversed;
int8 StairLock; int8 StairLock;
readonly array<Line> Lines; readonly array<Line> Lines;
readonly SecPlane CeilingPlane; readonly SecPlane CeilingPlane;
readonly SecPlane FloorPlane; readonly SecPlane FloorPlane;
readonly Sector HeightSec; readonly Sector HeightSec;
uint BottomMap; uint BottomMap;
uint MidMap; uint MidMap;
uint TopMap; uint TopMap;
int DamageAmount; int DamageAmount;
int16 DamageInterval; int16 DamageInterval;
name DamageType; name DamageType;
double Gravity; double Gravity;
int16 LeakyDamage; int16 LeakyDamage;
readonly uint16 ZoneNumber; readonly uint16 ZoneNumber;
readonly int HealthCeiling; readonly int HealthCeiling;
readonly int HealthCeilingGroup; readonly int HealthCeilingGroup;
readonly int HealthFloor; readonly int HealthFloor;
readonly int HealthFloorGroup; readonly int HealthFloorGroup;
uint Flags; uint Flags;
uint16 MoreFlags; uint16 MoreFlags;
SectorAction SecActTarget; SectorAction SecActTarget;
readonly int PortalGroup; readonly int PortalGroup;
internal uint[2] Portals; internal uint[2] Portals;
readonly int SectorNum; readonly int SectorNum;
int Index(); int Index();
double, Sector, F3DFloor NextHighestCeilingAt(double x, double y, double bottomz, double topz, int flags = 0); double, Sector, F3DFloor NextHighestCeilingAt(double x, double y, double bottomz, double topz, int flags = 0);
double, Sector, F3DFloor NextLowestFloorAt(double x, double y, double z, int flags = 0, double steph = 0); double, Sector, F3DFloor NextLowestFloorAt(double x, double y, double z, int flags = 0, double steph = 0);
void RemoveForceField(); void RemoveForceField();
static clearscope Sector PointInSector(vector2 pt); static clearscope Sector PointInSector(vector2 pt);
void CheckPortalPlane(int plane); void CheckPortalPlane(int plane);
int GetCeilingLight(); int GetCeilingLight();
int GetFloorLight(); int GetFloorLight();
Sector GetHeightSec(); Sector GetHeightSec();
void GetSpecial(out SecSpecial spec); void GetSpecial(out SecSpecial spec);
int GetTerrain(int pos); int GetTerrain(int pos);
bool PlaneMoving(int pos); bool PlaneMoving(int pos);
void SetSpecial(SecSpecial spec); void SetSpecial(SecSpecial spec);
void TransferSpecial(Sector model); void TransferSpecial(Sector model);
double, double GetFriction(int plane); double, double GetFriction(int plane);
double, Sector HighestCeilingAt(vector2 a); double, Sector HighestCeilingAt(vector2 a);
double, Sector LowestFloorAt(vector2 a); double, Sector LowestFloorAt(vector2 a);
void AddXOffset(int pos, double o); void AddXOffset(int pos, double o);
void AddYOffset(int pos, double o); void AddYOffset(int pos, double o);
void ChangeFlags(int pos, int and, int or); void ChangeFlags(int pos, int and, int or);
double GetAlpha(int pos); double GetAlpha(int pos);
double GetAngle(int pos, bool addbase = true); double GetAngle(int pos, bool addbase = true);
int GetFlags(int pos); int GetFlags(int pos);
color GetGlowColor(int pos); color GetGlowColor(int pos);
double GetGlowHeight(int pos); double GetGlowHeight(int pos);
int GetPlaneLight(int pos); int GetPlaneLight(int pos);
int GetVisFlags(int pos); int GetVisFlags(int pos);
double GetXOffset(int pos); double GetXOffset(int pos);
double GetXScale(int pos); double GetXScale(int pos);
double GetYOffset(int pos, bool addbase = true); double GetYOffset(int pos, bool addbase = true);
double GetYScale(int pos); double GetYScale(int pos);
void SetAdditiveColor(int pos, color cr); void SetAdditiveColor(int pos, color cr);
void SetAlpha(int pos, double o); void SetAlpha(int pos, double o);
void SetAngle(int pos, double o); void SetAngle(int pos, double o);
void SetBase(int pos, double y, double o); void SetBase(int pos, double y, double o);
void SetColor(color c, int desat = 0); void SetColor(color c, int desat = 0);
void SetFade(color c); void SetFade(color c);
void SetFogDensity(int dens); void SetFogDensity(int dens);
void SetGlowColor(int pos, color color); void SetGlowColor(int pos, color color);
void SetGlowHeight(int pos, double height); void SetGlowHeight(int pos, double height);
void SetPlaneLight(int pos, int level); void SetPlaneLight(int pos, int level);
void SetSpecialColor(int pos, color color); void SetSpecialColor(int pos, color color);
void SetXOffset(int pos, double o); void SetXOffset(int pos, double o);
void SetXScale(int pos, double o); void SetXScale(int pos, double o);
void SetYOffset(int pos, double o); void SetYOffset(int pos, double o);
void SetYScale(int pos, double o); void SetYScale(int pos, double o);
void AdjustFloorClip(); void AdjustFloorClip();
void ChangeLightLevel(int newval); void ChangeLightLevel(int newval);
int GetLightLevel(); int GetLightLevel();
double GetPlaneTexZ(int pos); double GetPlaneTexZ(int pos);
textureid GetTexture(int pos); textureid GetTexture(int pos);
bool IsLinked(Sector other, bool ceiling); bool IsLinked(Sector other, bool ceiling);
void SetLightLevel(int newval); void SetLightLevel(int newval);
void SetPlaneTexZ(int pos, double val, bool dirtify = false); void SetPlaneTexZ(int pos, double val, bool dirtify = false);
void SetTexture(int pos, textureid tex, bool floorclip = true); void SetTexture(int pos, textureid tex, bool floorclip = true);
double CenterCeiling(); double CenterCeiling();
double CenterFloor(); double CenterFloor();
void ClearPortal(int plane); void ClearPortal(int plane);
int GetOppositePortalGroup(int plane); int GetOppositePortalGroup(int plane);
vector2 GetPortalDisplacement(int plane); vector2 GetPortalDisplacement(int plane);
double GetPortalPlaneZ(int plane); double GetPortalPlaneZ(int plane);
int GetPortalType(int plane); int GetPortalType(int plane);
bool PortalBlocksMovement(int plane); bool PortalBlocksMovement(int plane);
bool PortalBlocksSight(int plane); bool PortalBlocksSight(int plane);
bool PortalBlocksSound(int plane); bool PortalBlocksSound(int plane);
bool PortalBlocksView(int plane); bool PortalBlocksView(int plane);
bool PortalIsLinked(int plane); bool PortalIsLinked(int plane);
bool TriggerSectorActions(Actor thing, int activation); bool TriggerSectorActions(Actor thing, int activation);
int MoveCeiling(double speed, double dest, int crush, int direction, bool hexencrush); int MoveCeiling(double speed, double dest, int crush, int direction, bool hexencrush);
int MoveFloor(double speed, double dest, int crush, int direction, bool hexencrush, bool instant = false); int MoveFloor(double speed, double dest, int crush, int direction, bool hexencrush, bool instant = false);
Sector NextSpecialSector(int type, Sector prev); Sector NextSpecialSector(int type, Sector prev);
double, Vertex FindHighestCeilingSurrounding(); double, Vertex FindHighestCeilingSurrounding();
double, Vertex FindHighestFloorPoint(); double, Vertex FindHighestFloorPoint();
double, Vertex FindHighestFloorSurrounding(); double, Vertex FindHighestFloorSurrounding();
double, Vertex FindLowestCeilingPoint(); double, Vertex FindLowestCeilingPoint();
double, Vertex FindLowestCeilingSurrounding(); double, Vertex FindLowestCeilingSurrounding();
double, Vertex FindLowestFloorSurrounding(); double, Vertex FindLowestFloorSurrounding();
double, Vertex FindNextHighestCeiling(); double, Vertex FindNextHighestCeiling();
double, Vertex FindNextHighestFloor(); double, Vertex FindNextHighestFloor();
double, Vertex FindNextLowestCeiling(); double, Vertex FindNextLowestCeiling();
double, Vertex FindNextLowestFloor(); double, Vertex FindNextLowestFloor();
int FindMinSurroundingLight(int max); int FindMinSurroundingLight(int max);
Sector FindModelCeilingSector(double floordestheight); Sector FindModelCeilingSector(double floordestheight);
Sector FindModelFloorSector(double floordestheight); Sector FindModelFloorSector(double floordestheight);
double FindShortestTextureAround(); double FindShortestTextureAround();
double FindShortestUpperAround(); double FindShortestUpperAround();
void SetEnvironment(string env); void SetEnvironment(string env);
void SetEnvironmentID(int envnum); void SetEnvironmentID(int envnum);
SeqNode CheckSoundSequence(int chan); SeqNode CheckSoundSequence(int chan);
bool IsMakingLoopingSound(); bool IsMakingLoopingSound();
SeqNode StartSoundSequence(int chan, name seqname, int modenum); SeqNode StartSoundSequence(int chan, name seqname, int modenum);
SeqNode StartSoundSequenceID(int chan, int sequence, int type, int modenum, bool nostop = false); SeqNode StartSoundSequenceID(int chan, int sequence, int type, int modenum, bool nostop = false);
void StopSoundSequence(int chan); void StopSoundSequence(int chan);
void ClearSecret(); void ClearSecret();
bool IsSecret(); bool IsSecret();
bool WasSecret(); bool WasSecret();
clearscope int GetHealth(SectorPart part); clearscope int GetHealth(SectorPart part);
void SetHealth(SectorPart part, int newhealth); void SetHealth(SectorPart part, int newhealth);
double GetUdmfFloat(name nm); double GetUdmfFloat(name nm);
int GetUdmfInt(name nm); int GetUdmfInt(name nm);
string GetUdmfString(name nm); string GetUdmfString(name nm);
} }
``` ```

View File

@ -5,18 +5,18 @@ A thinker which is attached to a sector and effects it in some way.
``` ```
class SectorEffect : Thinker class SectorEffect : Thinker
{ {
protected Sector m_Sector; protected Sector m_Sector;
Sector GetSector(); Sector GetSector();
} }
``` ```
- `m_Sector` ### `m_Sector`
The sector this effect is attached to. The sector this effect is attached to.
- `GetSector` ### `GetSector`
Returns the sector this effect is attached to. Returns the sector this effect is attached to.
<!-- EOF --> <!-- EOF -->

View File

@ -5,27 +5,27 @@ Iterates over sector indices with a specified tag.
``` ```
class SectorTagIterator : Object class SectorTagIterator : Object
{ {
static SectorTagIterator Create(int tag, Line defline = null); static SectorTagIterator Create(int tag, Line defline = null);
int Next(); int Next();
int NextCompat(bool compat, int secnum); int NextCompat(bool compat, int secnum);
} }
``` ```
- `Create` ### `Create`
Creates a new iterator over sectors with tag `tag`. TODO: I can't find where Creates a new iterator over sectors with tag `tag`. TODO: I can't find where
`defline` is actually used. It is a mystery. `defline` is actually used. It is a mystery.
- `Next` ### `Next`
Returns the index of the current sector and advances the iterator. Returns Returns the index of the current sector and advances the iterator. Returns `-1`
`-1` when the list is exhausted. when the list is exhausted.
- `NextCompat` ### `NextCompat`
If `compat` is `false`, acts exactly as `Next`. Otherwise, returns the If `compat` is `false`, acts exactly as `Next`. Otherwise, returns the index of
index of the current sector and advances the iterator in a manner the current sector and advances the iterator in a manner compatible with Doom's
compatible with Doom's stair builders. stair builders.
<!-- EOF --> <!-- EOF -->

View File

@ -15,122 +15,122 @@ The three portions of a sidedef can be referred to with:
``` ```
struct Side play struct Side play
{ {
readonly Line Linedef; readonly Line Linedef;
readonly Sector Sector; readonly Sector Sector;
uint8 Flags; uint8 Flags;
int16 Light; int16 Light;
int Index(); int Index();
clearscope Vertex V1(); clearscope Vertex V1();
clearscope Vertex V2(); clearscope Vertex V2();
textureid GetTexture(int which); textureid GetTexture(int which);
double GetTextureXOffset(int which); double GetTextureXOffset(int which);
double GetTextureYOffset(int which); double GetTextureYOffset(int which);
double GetTextureXScale(int which); double GetTextureXScale(int which);
double GetTextureYScale(int which); double GetTextureYScale(int which);
void SetTexture(int which, textureid tex); void SetTexture(int which, textureid tex);
void SetTextureXOffset(int which, double offset); void SetTextureXOffset(int which, double offset);
void SetTextureYOffset(int which, double offset); void SetTextureYOffset(int which, double offset);
void SetTextureXScale(int which, double scale); void SetTextureXScale(int which, double scale);
void SetTextureYScale(int which, double scale); void SetTextureYScale(int which, double scale);
void AddTextureXOffset(int which, double delta); void AddTextureXOffset(int which, double delta);
void AddTextureYOffset(int which, double delta); void AddTextureYOffset(int which, double delta);
void MultiplyTextureXScale(int which, double delta); void MultiplyTextureXScale(int which, double delta);
void MultiplyTextureYScale(int which, double delta); void MultiplyTextureYScale(int which, double delta);
void SetSpecialColor(int tier, int position, color cr); void SetSpecialColor(int tier, int position, color cr);
color GetAdditiveColor(int tier); color GetAdditiveColor(int tier);
void SetAdditiveColor(int tier, color cr); void SetAdditiveColor(int tier, color cr);
void EnableAdditiveColor(int tier, bool enable); void EnableAdditiveColor(int tier, bool enable);
double GetUdmfFloat(name nm); double GetUdmfFloat(name nm);
int GetUdmfInt(name nm); int GetUdmfInt(name nm);
string GetUdmfString(name nm); string GetUdmfString(name nm);
} }
``` ```
- `Linedef` ### `Linedef`
The line this side belongs to. The line this side belongs to.
- `Sector` ### `Sector`
The sector this side belongs to. The sector this side belongs to.
- `Flags` ### `Flags`
Any combination of the following bit flags: Any combination of the following bit flags:
| Name | Description | | Name | Description |
| ---- | ----------- | | ---- | ----------- |
| `WALLF_ABSLIGHTING` | Light is absolute instead of relative to the sector. | | `WALLF_ABSLIGHTING` | Light is absolute instead of relative to the sector. |
| `WALLF_CLIP_MIDTEX` | Clips the middle texture when it goes under the floor or above the ceiling. | | `WALLF_CLIP_MIDTEX` | Clips the middle texture when it goes under the floor or above the ceiling. |
| `WALLF_LIGHT_FOG` | The wall's lighting will ignore fog effects. | | `WALLF_LIGHT_FOG` | The wall's lighting will ignore fog effects. |
| `WALLF_NOAUTODECALS` | Don't attach decals to this surface. | | `WALLF_NOAUTODECALS` | Don't attach decals to this surface. |
| `WALLF_NOFAKECONTRAST` | Disables the "fake contrast" effect for this side. | | `WALLF_NOFAKECONTRAST` | Disables the "fake contrast" effect for this side. |
| `WALLF_POLYOBJ` | This sidedef belongs to a polyobject. | | `WALLF_POLYOBJ` | This sidedef belongs to a polyobject. |
| `WALLF_SMOOTHLIGHTING` | Applies a unique contrast at all angles. | | `WALLF_SMOOTHLIGHTING` | Applies a unique contrast at all angles. |
| `WALLF_WRAP_MIDTEX` | Repeats the middle texture infinitely on the vertical axis. | | `WALLF_WRAP_MIDTEX` | Repeats the middle texture infinitely on the vertical axis. |
- `Light` ### `Light`
The light level of this side. Relative to the sector lighting unless The light level of this side. Relative to the sector lighting unless
`WALLF_ABSLIGHTING`. `WALLF_ABSLIGHTING`.
- `Index` ### `Index`
Returns the index of this side. Returns the index of this side.
- `V1`, `V2` ### `V1`, `V2`
Returns the start and end points of this sidedef, respectively. Returns the start and end points of this sidedef, respectively.
- `GetTexture`, `SetTexture` ### `GetTexture`, `SetTexture`
Gets or sets the texture of one portion of the sidedef. Gets or sets the texture of one portion of the sidedef.
- `GetTextureXOffset`, `SetTextureXOffset`, `AddTextureXOffset` ### `GetTextureXOffset`, `SetTextureXOffset`, `AddTextureXOffset`
Gets, sets or adds to the texture portion's horizontal offset. Gets, sets or adds to the texture portion's horizontal offset.
- `GetTextureYOffset`, `SetTextureYOffset`, `AddTextureYOffset` ### `GetTextureYOffset`, `SetTextureYOffset`, `AddTextureYOffset`
Gets, sets or adds to the texture portion's vertical offset. Gets, sets or adds to the texture portion's vertical offset.
- `GetTextureXScale`, `SetTextureXScale`, `MultiplyTextureXScale` ### `GetTextureXScale`, `SetTextureXScale`, `MultiplyTextureXScale`
Gets, sets or multiplies the texture portion's horizontal scale. Gets, sets or multiplies the texture portion's horizontal scale.
- `GetTextureYScale`, `SetTextureYScale`, `MultiplyTextureYScale` ### `GetTextureYScale`, `SetTextureYScale`, `MultiplyTextureYScale`
Gets, sets or multiplies the texture portion's vertical scale. Gets, sets or multiplies the texture portion's vertical scale.
- `SetSpecialColor` ### `SetSpecialColor`
TODO TODO
- `GetAdditiveColor`, `SetAdditiveColor` ### `GetAdditiveColor`, `SetAdditiveColor`
TODO TODO
- `EnableAdditiveColor` ### `EnableAdditiveColor`
TODO TODO
- `GetUdmfFloat`, `GetUdmfInt`, `GetUdmfString` ### `GetUdmfFloat`, `GetUdmfInt`, `GetUdmfString`
Gets a named UDMF property attached to this sidedef. Gets a named UDMF property attached to this sidedef.
<!-- EOF --> <!-- EOF -->

View File

@ -5,18 +5,18 @@ A point in world space.
``` ```
struct Vertex play struct Vertex play
{ {
readonly vector2 P; readonly vector2 P;
int Index(); int Index();
} }
``` ```
- `P` ### `P`
The point this object represents. The point this object represents.
- `Index` ### `Index`
The index of this vertex in the global vertices array. The index of this vertex in the global vertices array.
<!-- EOF --> <!-- EOF -->

View File

@ -5,39 +5,39 @@ A player class as defined in either `MAPINFO`/GameInfo or `KEYCONF`.
``` ```
struct PlayerClass struct PlayerClass
{ {
uint Flags; uint Flags;
array<int> Skins; array<int> Skins;
class<Actor> Type; class<Actor> Type;
bool CheckSkin(int skin); bool CheckSkin(int skin);
void EnumColorsets(out array<int> data); void EnumColorsets(out array<int> data);
name GetColorsetName(int setnum); name GetColorsetName(int setnum);
} }
``` ```
- `Flags` ### `Flags`
Not currently implemented correctly, `PCF_NOMENU` does not exist in ZScript, Not currently implemented correctly, `PCF_NOMENU` does not exist in ZScript,
but its value is `1` if you need to check for that. but its value is `1` if you need to check for that.
- `Skins` ### `Skins`
Skin indices available to this player class. Skin indices available to this player class.
- `Type` ### `Type`
The class type reference for this player class. The class type reference for this player class.
- `CheckSkin` ### `CheckSkin`
Checks if `skin` is in `Skins`. Checks if `skin` is in `Skins`.
- `EnumColorsets` ### `EnumColorsets`
TODO TODO
- `GetColorsetName` ### `GetColorsetName`
TODO TODO
<!-- EOF --> <!-- EOF -->

View File

@ -5,67 +5,67 @@ A player skin as defined in `SKININFO` or `S_SKIN`.
``` ```
struct PlayerSkin struct PlayerSkin
{ {
int CrouchSprite; int CrouchSprite;
string Face; string Face;
uint8 Gender; uint8 Gender;
int NameSpc; int NameSpc;
bool OtherGame; bool OtherGame;
uint8 Range0End; uint8 Range0End;
uint8 Range0Start; uint8 Range0Start;
vector2 Scale; vector2 Scale;
string SkinName; string SkinName;
int Sprite; int Sprite;
} }
``` ```
- `CrouchSprite` ### `CrouchSprite`
The crouching sprite ID for this skin. The crouching sprite ID for this skin.
- `Face` ### `Face`
Prefix for statusbar face graphics. Prefix for statusbar face graphics.
- `Gender` ### `Gender`
Default gender of the skin. May be one of the following: Default gender of the skin. May be one of the following:
| Name | Value | Description | | Name | Value | Description |
| ---- | :---: | ----------- | | ---- | :---: | ----------- |
| `GENDER_FEMALE` | `1` | Feminine. | | `GENDER_FEMALE` | `1` | Feminine. |
| `GENDER_MALE` | `0` | Masculine. | | `GENDER_MALE` | `0` | Masculine. |
| `GENDER_NEUTRAL` | `2` | Neutral. | | `GENDER_NEUTRAL` | `2` | Neutral. |
| `GENDER_OTHER` | `3` | Other (robot, zombie, etc.) | | `GENDER_OTHER` | `3` | Other (robot, zombie, etc.) |
- `NameSpc` ### `NameSpc`
If this skin was defined in S_SKIN, this is the lump ID of the marker itself. If this skin was defined in S_SKIN, this is the lump ID of the marker itself.
- `OtherGame` ### `OtherGame`
The player skin is made for another game and needs to be color remapped The player skin is made for another game and needs to be color remapped
differently. differently.
- `Range0End` ### `Range0End`
The end index of the translation range to be used for changing the player The end index of the translation range to be used for changing the player
sprite's color. sprite's color.
- `Range0Start` ### `Range0Start`
The beginning index of the translation range to be used for changing the The beginning index of the translation range to be used for changing the player
player sprite's color. sprite's color.
- `Scale` ### `Scale`
The scaling factor used for the player sprite. The scaling factor used for the player sprite.
- `SkinName` ### `SkinName`
Name of the skin. Name of the skin.
- `Sprite` ### `Sprite`
The sprite ID for this skin. The sprite ID for this skin.
<!-- EOF --> <!-- EOF -->

View File

@ -5,23 +5,23 @@ A team as defined in `TEAMINFO`.
``` ```
struct Team struct Team
{ {
const Max; const Max;
const NoTeam; const NoTeam;
string mName; string mName;
} }
``` ```
- `Max` ### `Max`
The maximum number of teams. The maximum number of teams.
- `NoTeam` ### `NoTeam`
A constant index for a player with no team. A constant index for a player with no team.
- `mName` ### `mName`
The name of the team. The name of the team.
<!-- EOF --> <!-- EOF -->

View File

@ -5,38 +5,38 @@ A sound sequence (`SNDSEQ`) node.
``` ```
class SeqNode : Object class SeqNode : Object
{ {
static name GetSequenceSlot(int sequence, int type); static name GetSequenceSlot(int sequence, int type);
static void MarkPrecacheSounds(int sequence, int type); static void MarkPrecacheSounds(int sequence, int type);
void AddChoice(int seqnum, int type); void AddChoice(int seqnum, int type);
bool AreModesSame(name n, int mode1); bool AreModesSame(name n, int mode1);
bool AreModesSameID(int sequence, int type, int mode1); bool AreModesSameID(int sequence, int type, int mode1);
name GetSequenceName(); name GetSequenceName();
} }
``` ```
- `GetSequenceSlot` ### `GetSequenceSlot`
TODO TODO
- `MarkPrecacheSounds` ### `MarkPrecacheSounds`
TODO TODO
- `AddChoice` ### `AddChoice`
TODO TODO
- `AreModesSame` ### `AreModesSame`
TODO TODO
- `AreModesSameID` ### `AreModesSameID`
TODO TODO
- `GetSequenceName` ### `GetSequenceName`
TODO TODO
<!-- EOF --> <!-- EOF -->

View File

@ -19,121 +19,121 @@ The predefined layers are:
``` ```
class PSprite : Object play class PSprite : Object play
{ {
readonly State CurState; readonly State CurState;
readonly int ID; readonly int ID;
readonly PSprite Next; readonly PSprite Next;
readonly PlayerInfo Owner; readonly PlayerInfo Owner;
double Alpha; double Alpha;
Actor Caller; Actor Caller;
bool FirstTic; bool FirstTic;
int Frame; int Frame;
double OldX; double OldX;
double OldY; double OldY;
bool ProcessPending; bool ProcessPending;
spriteid Sprite; spriteid Sprite;
int Tics; int Tics;
double X; double X;
double Y; double Y;
bool bAddBob; bool bAddBob;
bool bAddWeapon; bool bAddWeapon;
bool bCVarFast; bool bCVarFast;
bool bFlip; bool bFlip;
bool bPowDouble; bool bPowDouble;
void SetState(State newstate, bool pending = false); void SetState(State newstate, bool pending = false);
void Tick(); void Tick();
} }
``` ```
- `CurState` ### `CurState`
TODO TODO
- `ID` ### `ID`
TODO TODO
- `Next` ### `Next`
TODO TODO
- `Owner` ### `Owner`
TODO TODO
- `Alpha` ### `Alpha`
The amount of translucency of the PSprite, range 0-1 inclusive. The amount of translucency of the PSprite, range 0-1 inclusive.
- `Caller` ### `Caller`
TODO TODO
- `FirstTic` ### `FirstTic`
TODO TODO
- `Frame` ### `Frame`
Frame number of the sprite. Frame number of the sprite.
- `OldX` ### `OldX`
TODO TODO
- `OldY` ### `OldY`
TODO TODO
- `ProcessPending` ### `ProcessPending`
TODO TODO
- `Sprite` ### `Sprite`
The sprite to display on this layer. The sprite to display on this layer.
- `Tics` ### `Tics`
The number of game ticks before the next state takes over. The number of game ticks before the next state takes over.
- `X` ### `X`
The offset from the weapon's normal resting position on the horizontal axis. The offset from the weapon's normal resting position on the horizontal axis.
- `Y` ### `Y`
The offset from the weapon's normal resting position on the vertical axis. The offset from the weapon's normal resting position on the vertical axis. Note
Note that `32` is the real resting position because of `A_Raise`. that `32` is the real resting position because of `A_Raise`.
- `bAddBob` ### `bAddBob`
Adds the weapon's bobbing to this layer's offset. Adds the weapon's bobbing to this layer's offset.
- `bAddWeapon` ### `bAddWeapon`
Adds the weapon layer's offsets to this layer's offset. Adds the weapon layer's offsets to this layer's offset.
- `bCVarFast` ### `bCVarFast`
Layer will respect `sv_fastweapons`. Layer will respect `sv_fastweapons`.
- `bFlip` ### `bFlip`
Flips the weapon visually horizontally. Flips the weapon visually horizontally.
- `bPowDouble` ### `bPowDouble`
Layer will respect `PowerDoubleFiringSpeed`. Layer will respect `PowerDoubleFiringSpeed`.
- `SetState` ### `SetState`
TODO TODO
- `Tick` ### `Tick`
Called by `PlayerPawn::TickPSprites` to advance the frame. Called by `PlayerPawn::TickPSprites` to advance the frame.
<!-- EOF --> <!-- EOF -->

View File

@ -4,7 +4,7 @@
* [ACS](#acs) * [ACS](#acs)
* [Actors](#actors) * [Actors](#actors)
* [Examples: Actor Replacement](#examples-actor-replacement) * [Examples: Actor Replacement](#examples-actor-replacement)
* [Console Commands](#console-commands) * [Console Commands](#console-commands)
* [CVARINFO](#cvarinfo) * [CVARINFO](#cvarinfo)
* [DECALDEF](#decaldef) * [DECALDEF](#decaldef)
@ -125,24 +125,24 @@ TODO: this can be used for custom buttons
In `MAPINFO`, the `GameInfo` block (referred to as `MAPINFO`/GameInfo in this In `MAPINFO`, the `GameInfo` block (referred to as `MAPINFO`/GameInfo in this
document) the following properties interact directly with ZScript: document) the following properties interact directly with ZScript:
- `EventHandlers` and `AddEventHandlers` override or add to the list of * `EventHandlers` and `AddEventHandlers` override or add to the list of
`StaticEventHandler` or `EventHandler` classes registered by the game (as `StaticEventHandler` or `EventHandler` classes registered by the game (as
opposed to event handlers registered per-map.) opposed to event handlers registered per-map.)
- `MessageBoxClass` sets the `MessageBoxMenu` class to use for message boxes * `MessageBoxClass` sets the `MessageBoxMenu` class to use for message boxes
used by the engine's GUI. used by the engine's GUI.
- `PlayerClasses` and `AddPlayerClasses` override or add to the list of * `PlayerClasses` and `AddPlayerClasses` override or add to the list of
`PlayerPawn` classes the game provides. `PlayerPawn` classes the game provides.
- `PrecacheClasses` will pre-cache all sprites used by an `Actor` class. Note * `PrecacheClasses` will pre-cache all sprites used by an `Actor` class. Note
that this also works for `StateProvider` degenerates like `Weapon`. that this also works for `StateProvider` degenerates like `Weapon`.
- `StatScreen_CoOp` sets the `StatusScreen` class to use for co-op intermission * `StatScreen_CoOp` sets the `StatusScreen` class to use for co-op intermission
screens. screens.
- `StatScreen_DM` sets the `StatusScreen` class to use for Deathmatch * `StatScreen_DM` sets the `StatusScreen` class to use for Deathmatch
intermission screens. intermission screens.
- `StatScreen_Single` sets the `StatusScreen` class to use for single-player * `StatScreen_Single` sets the `StatusScreen` class to use for single-player
intermission screens. intermission screens.
- `StatusBarClass` sets the status bar class used by the game to the provided * `StatusBarClass` sets the status bar class used by the game to the provided
`BaseStatusBar` class. `BaseStatusBar` class.
- `WeaponSlot` sets the game's default weapon slots to the provided `Weapon` * `WeaponSlot` sets the game's default weapon slots to the provided `Weapon`
classes. classes.
TODO: there are other things here as well, like map event handlers TODO: there are other things here as well, like map event handlers

View File

@ -1,16 +1,17 @@
# Concepts
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Action Scoping](#action-scoping) * [Concepts](#concepts)
* [Object Scoping](#object-scoping) * [Action Scoping](#action-scoping)
* [Format String](#format-string) * [Object Scoping](#object-scoping)
* [Sprite](#sprite) * [Format String](#format-string)
* [Game Tick](#game-tick) * [Sprite](#sprite)
* [Interpolation](#interpolation) * [Game Tick](#game-tick)
* [Interpolation](#interpolation)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Concepts
Here is a cursory view of concepts vital to ZScript and ZDoom in general. If Here is a cursory view of concepts vital to ZScript and ZDoom in general. If
you can't find something here, it's likely inherited directly from Doom, so you you can't find something here, it's likely inherited directly from Doom, so you
should check [the Doom Wiki][1] for more relevant information. should check [the Doom Wiki][1] for more relevant information.
@ -72,12 +73,12 @@ arbitrary data to a contiguous character string. A format string contains
normal characters and *conversion specifiers*. See [this page][2] for more normal characters and *conversion specifiers*. See [this page][2] for more
information. Differences between C's `printf` and ZScript formats include: information. Differences between C's `printf` and ZScript formats include:
- Since there's no `char` type, `int` is used for `%c`. * Since there's no `char` type, `int` is used for `%c`.
- `%s` also works for `name`. * `%s` also works for `name`.
- No `%n` specifier. * No `%n` specifier.
- An additional conversion specifier `%B` exists which converts a number to * An additional conversion specifier `%B` exists which converts a number to
binary. binary.
- An additional conversion specifier `%H` exists which works like `%g` but * An additional conversion specifier `%H` exists which works like `%g` but
automatically selects the smallest appropriate precision. automatically selects the smallest appropriate precision.
[2]: https://en.cppreference.com/w/c/io/fprintf [2]: https://en.cppreference.com/w/c/io/fprintf
@ -102,23 +103,22 @@ The Doom engine, as long as it has existed and into every faithful-enough port
of it, no matter how different from the source material, runs the game of it, no matter how different from the source material, runs the game
simulation in the same way: simulation in the same way:
- Input events are processed. *Input events are processed.*
Keyboard, mouse, gamepad, etc. if a local player, the demo file if watching Keyboard, mouse, gamepad, etc. if a local player, the demo file if watching a
a demo, packets over the internet in networked games. demo, packets over the internet in networked games.
- The game is *ticked*. *The game is "ticked".*
Every 1/35th of a second that passes, a new "game tick" takes place, also Every 1/35th of a second that passes, a new "game tick" takes place, also
referred to as *gametic*, *tick* or simply *tic*. referred to as *gametic*, *tick* or simply *tic*.
- The game is rendered. *The game is rendered.*
All information from the *current* game tick is rendered. This usually All information from the *current* game tick is rendered. This usually happens
happens more often than the game is actually ticked. In ZDoom, Eternity more often than the game is actually ticked. In ZDoom, Eternity Engine, and
Engine, and some other ports, the information is interpolated between the some other ports, the information is interpolated between the last and current
last and current game tick when there is extra time available to give game tick when there is extra time available to give smoother rendering.
smoother rendering.
For more information on ticks, please refer to [the relevant Doom Wiki For more information on ticks, please refer to [the relevant Doom Wiki
article][4]. article][4].

View File

@ -1,22 +1,23 @@
# Style
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Capitalization Conventions](#capitalization-conventions) * [Style](#style)
* [Rationale](#rationale) * [Capitalization Conventions](#capitalization-conventions)
* [Word Choice](#word-choice) * [Rationale](#rationale)
* [Rationale](#rationale-1) * [Word Choice](#word-choice)
* [Naming Type Members](#naming-type-members) * [Rationale](#rationale-1)
* [Rationale](#rationale-2) * [Naming Type Members](#naming-type-members)
* [Layout Conventions](#layout-conventions) * [Rationale](#rationale-2)
* [Rationale](#rationale-3) * [Layout Conventions](#layout-conventions)
* [Commenting Conventions](#commenting-conventions) * [Rationale](#rationale-3)
* [Rationale](#rationale-4) * [Commenting Conventions](#commenting-conventions)
* [Language Guidelines](#language-guidelines) * [Rationale](#rationale-4)
* [Rationale](#rationale-5) * [Language Guidelines](#language-guidelines)
* [Rationale](#rationale-5)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Style
This is a style guide for the ZScript documentation to encourage best-practice This is a style guide for the ZScript documentation to encourage best-practice
coding with it, focused on clarity and consistency of formatting. It is also coding with it, focused on clarity and consistency of formatting. It is also
intended to be a general style guide for writing new code, but this purpose is intended to be a general style guide for writing new code, but this purpose is
@ -34,7 +35,8 @@ you must not rely on case differences in identifiers due to this.
Capitalize the first letter of each word in an identifier. Acronyms over 2 Capitalize the first letter of each word in an identifier. Acronyms over 2
characters in length are considered whole words, so for instance prefer characters in length are considered whole words, so for instance prefer
`XmlWidget` over `XMLWidget` but `IOStream` over `IoStream`. Acronyms of one `XmlWidget` over `XMLWidget` but `IOStream` over `IoStream`. Acronyms of one
character also count, so prefer `PrintF` over `Printf`. character also count, so prefer `PrintF` over `Printf`. Members with `m`
prefixes in unmodifiable code must not capitalize the `m`.
For identifiers of parameter names and local scope variables do not capitalize For identifiers of parameter names and local scope variables do not capitalize
the first word. In these cases, prefer `xmlWidget` over `XmlWidget` or the first word. In these cases, prefer `xmlWidget` over `XmlWidget` or
@ -42,9 +44,8 @@ the first word. In these cases, prefer `xmlWidget` over `XmlWidget` or
over `TypeF` or `nChars` over `NChars`. (Note that the former two are malformed over `TypeF` or `nChars` over `NChars`. (Note that the former two are malformed
names, however. See the "Word Choice" section for more information.) names, however. See the "Word Choice" section for more information.)
Identifiers used for flags (declared with `flagdef`) and constants (declared Constants (declared with `const`, `static const`, or `enum`) must be all
with `const`, `static const`, or `enum`) must be all uppercase, except the `b` uppercase, and must separate words with underscores.
prefix on flags, and can separate words with underscores.
Argument names in base archive methods may be renamed, but arguments with Argument names in base archive methods may be renamed, but arguments with
defaults may not be renamed as they are part of the API. defaults may not be renamed as they are part of the API.
@ -71,10 +72,15 @@ written advocate for this. The purpose in ZScript is primarily moot due to case
insensitivity, but we apply these rules to make reading easier and more insensitivity, but we apply these rules to make reading easier and more
consistent with most other programming languages that have existed. consistent with most other programming languages that have existed.
Capitalizing constants, enumerations, and flags is an artifact of the way they Capitalizing constants and enumerations is an artifact of the way they are
are declared in ZDoom, and also in the original Linux Doom source code. This is declared in ZDoom, and also in the original Linux Doom source code. This is
extended to static arrays for consistency. extended to static arrays for consistency.
Flags were capitalized in Linux Doom due to being constants, and internally
within ZDoom they are still constants, but due to the style of ZScript using
full capitalization appears inconsistent. This is especially true due to the
use of `m` prefixes in places within ZScript's standard library.
## Word Choice ## Word Choice
In new identifiers, do not add underscores anywhere within the identifier, In new identifiers, do not add underscores anywhere within the identifier,
@ -128,10 +134,10 @@ mod. Avoid violent words such as `Die`, `Destroy`, `Kill`, except where
literally applicable. Prefer for instance `Stop`, `Drop`, `Halt`. literally applicable. Prefer for instance `Stop`, `Drop`, `Halt`.
Always name members with nouns, noun phrases or adjectives. Boolean values Always name members with nouns, noun phrases or adjectives. Boolean values
should often be prefixed with `Is`, `Has`, and other existential present-tense should often be prefixed with `Is`, `Has`, `Can`, and other existential
verbs. All members of class types should be prefixed with `m_`, despite rules present-tense verbs. All members of class types should be prefixed with `m_`,
against Hungarian notation and underscores. Try to name members productively despite rules against Hungarian notation and underscores. Try to name members
rather than vaguely, instead of `RefInt` write `RefCount`. productively rather than vaguely, instead of `RefInt` write `RefCount`.
### Rationale ### Rationale
@ -163,8 +169,8 @@ members, and so this prefix is omitted within them.
## Layout Conventions ## Layout Conventions
Use 3 spaces for indentation. Indent at each block, but do not indent `case` Use tabs with a width of 3 characters for indentation. Indent at each block,
labels. Align all code to 80 columns. but do not indent `case` labels. Align all code to 80 columns.
Write only one statement or declaration per line, except in the case of Write only one statement or declaration per line, except in the case of
multiple-assignment operations, in which case pairing all of the related multiple-assignment operations, in which case pairing all of the related
@ -187,9 +193,10 @@ when there is a single sub-statement, for instance with `if(x) y = z;`.
The convention of 3 spaces for indentation comes from [Eternity Engine's style The convention of 3 spaces for indentation comes from [Eternity Engine's style
guideline.][1] There is no other reason for this decision, other than it is guideline.][1] There is no other reason for this decision, other than it is
pleasing to the eye while not being excessive. The indentation and blank line pleasing to the eye while not being excessive. Hardware tabs are used instead
rules are generally the same as the majority of C-like language style of spaces in order to allow for user configuration, increasing accessibility.
guidelines. The indentation and blank line rules are generally the same as the majority of
C-like language style guidelines.
Alignment to 80 columns is for the purpose of reading the raw documentation Alignment to 80 columns is for the purpose of reading the raw documentation
text under standard size Linux terminals. This is useful, for instance, when text under standard size Linux terminals. This is useful, for instance, when

View File

@ -1,35 +1,36 @@
# Versions
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Version 3.1.0](#version-310) * [Versions](#versions)
* [Version 3.2.0](#version-320) * [Version 3.1.0](#version-310)
* [Version 3.2.1](#version-321) * [Version 3.2.0](#version-320)
* [Version 3.2.2](#version-322) * [Version 3.2.1](#version-321)
* [Version 3.2.3](#version-323) * [Version 3.2.2](#version-322)
* [Version 3.2.4](#version-324) * [Version 3.2.3](#version-323)
* [Version 3.2.5](#version-325) * [Version 3.2.4](#version-324)
* [Version 3.3.0](#version-330) * [Version 3.2.5](#version-325)
* [Version 3.3.1](#version-331) * [Version 3.3.0](#version-330)
* [Version 3.3.2](#version-332) * [Version 3.3.1](#version-331)
* [Version 3.4.0](#version-340) * [Version 3.3.2](#version-332)
* [Version 3.5.0](#version-350) * [Version 3.4.0](#version-340)
* [Version 3.5.1](#version-351) * [Version 3.5.0](#version-350)
* [Version 3.6.0](#version-360) * [Version 3.5.1](#version-351)
* [Version 3.7.0](#version-370) * [Version 3.6.0](#version-360)
* [Version 3.7.2](#version-372) * [Version 3.7.0](#version-370)
* [Version 3.8.0 (Legacy)](#version-380-legacy) * [Version 3.7.2](#version-372)
* [Version 3.8.1 (Legacy)](#version-381-legacy) * [Version 3.8.0 (Legacy)](#version-380-legacy)
* [Version 3.8.2 (Legacy)](#version-382-legacy) * [Version 3.8.1 (Legacy)](#version-381-legacy)
* [Version 4.0.0](#version-400) * [Version 3.8.2 (Legacy)](#version-382-legacy)
* [Version 4.1.0](#version-410) * [Version 4.0.0](#version-400)
* [Version 4.1.1](#version-411) * [Version 4.1.0](#version-410)
* [Version 4.1.2](#version-412) * [Version 4.1.1](#version-411)
* [Version 4.1.3](#version-413) * [Version 4.1.2](#version-412)
* [Version 4.2.0](#version-420) * [Version 4.1.3](#version-413)
* [Version 4.2.0](#version-420)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Versions
Here is a list of differences between ZScript versions. Here is a list of differences between ZScript versions.
## Version 3.1.0 ## Version 3.1.0

View File

@ -7,7 +7,7 @@
* [Versions](#versions) * [Versions](#versions)
* [Top-level](#top-level) * [Top-level](#top-level)
* [Include directives](#include-directives) * [Include directives](#include-directives)
* [Example: Include directives](#example-include-directives) * [Example: Include directives](#example-include-directives)
* [Table of Contents](#table-of-contents) * [Table of Contents](#table-of-contents)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
@ -89,11 +89,11 @@ version of ZScript. The minimum version supported by this documentation is 3.0.
A ZScript file can have one of several things at the top level of the file, A ZScript file can have one of several things at the top level of the file,
following a version directive: following a version directive:
- Class definitions * Class definitions
- Structure definitions * Structure definitions
- Enumeration definitions * Enumeration definitions
- Constant definitions * Constant definitions
- Include directives * Include directives
# Include directives # Include directives

View File

@ -1,7 +1,6 @@
# Class Definitions
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Class Definitions](#class-definitions)
* [Example: Class headers](#example-class-headers) * [Example: Class headers](#example-class-headers)
* [Example: Class definitions](#example-class-definitions) * [Example: Class definitions](#example-class-definitions)
* [Class Flags](#class-flags) * [Class Flags](#class-flags)
@ -17,6 +16,8 @@
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Class Definitions
A class defines an object type within ZScript, and is most of what you'll be A class defines an object type within ZScript, and is most of what you'll be
creating within the language. creating within the language.
@ -37,7 +38,7 @@ A class is formed with the syntax:
``` ```
class Identifier $[ : Base-class]$ $[Class-flags...]$ class Identifier $[ : Base-class]$ $[Class-flags...]$
{ {
$[Class-content...]$ $[Class-content...]$
} }
``` ```
@ -107,14 +108,14 @@ Basic class definition with a member variable and member function.
``` ```
class BasicClass class BasicClass
{ {
// "m_Thing" is attached to any "instance" of BasicClass. // "m_Thing" is attached to any "instance" of BasicClass.
int m_Thing; int m_Thing;
// Changes "m_Thing" to 500 on an instance of BasicClass. // Changes "m_Thing" to 500 on an instance of BasicClass.
void ChangeThing() void ChangeThing()
{ {
m_Thing = 500; m_Thing = 500;
} }
} }
``` ```
@ -148,16 +149,16 @@ inherits `Actor`.
Class contents are an optional list of various things logically contained Class contents are an optional list of various things logically contained
within the class, including: within the class, including:
- Member declarations * Member declarations
- Method definitions * Method definitions
- Property definitions * Property definitions
- Flag definitions * Flag definitions
- Default blocks * Default blocks
- State definitions * State definitions
- Enumeration definitions * Enumeration definitions
- Structure definitions * Structure definitions
- Constant definitions * Constant definitions
- Static array definitions * Static array definitions
# Property Definitions # Property Definitions
@ -185,21 +186,21 @@ A class with some properties.
``` ```
class MyCoolActor : Actor class MyCoolActor : Actor
{ {
// You can set defined properties in a "default" block like in DECORATE. // You can set defined properties in a "default" block like in DECORATE.
// This will also be available in DECORATE code that inherits your class! // This will also be available in DECORATE code that inherits your class!
default default
{ {
MyCoolActor.MyCoolMember 5000; MyCoolActor.MyCoolMember 5000;
MyCoolActor.MyCoolMemberList 501, 502; MyCoolActor.MyCoolMemberList 501, 502;
} }
// Declare some members. // Declare some members.
int m_MyCoolMember; int m_MyCoolMember;
int m_CoolMember1, m_CoolMember2; int m_CoolMember1, m_CoolMember2;
// Declare some properties attached to our members. // Declare some properties attached to our members.
property MyCoolMember: m_MyCoolMember; property MyCoolMember: m_MyCoolMember;
property MyCoolMemberList: m_CoolMember1, m_CoolMember2; property MyCoolMemberList: m_CoolMember1, m_CoolMember2;
} }
``` ```
@ -241,29 +242,29 @@ A class with some flags.
``` ```
class MyCoolActorWithFlags : Actor class MyCoolActorWithFlags : Actor
{ {
// You can set defined flag in a "default" block like in DECORATE. // You can set defined flag in a "default" block like in DECORATE.
// This will also be available in DECORATE code that inherits your class! // This will also be available in DECORATE code that inherits your class!
// Hey, those sentences sounded familiar... // Hey, those sentences sounded familiar...
default default
{ {
+MyCoolActorWithFlags.ThisOneIsOn +MyCoolActorWithFlags.ThisOneIsOn
-MyCoolActorWithFlags.ThisOneIsOff -MyCoolActorWithFlags.ThisOneIsOff
} }
// Declare a flag field for all of the flags. This can hold up to 32 flags. // Declare a flag field for all of the flags. This can hold up to 32 flags.
int m_Flags; int m_Flags;
// Declare the flags, one at a time... // Declare the flags, one at a time...
flagdef ThisOneIsOn: m_Flags, 0; flagdef ThisOneIsOn: m_Flags, 0;
flagdef ThisOneIsOff: m_Flags, 1; flagdef ThisOneIsOff: m_Flags, 1;
flagdef ThisOneAliasesOn: m_Flags, 0; flagdef ThisOneAliasesOn: m_Flags, 0;
// Unnecessary, since you can just access it directly, but this demonstrates // Unnecessary, since you can just access it directly, but this demonstrates
// how declared flags can be used in methods. // how declared flags can be used in methods.
bool CheckIfOnIsOn() bool CheckIfOnIsOn()
{ {
return bThisOneIsOn; return bThisOneIsOn;
} }
} }
``` ```
@ -280,7 +281,7 @@ ZScript, for syntax flexibility purposes, it must be enclosed in a block with
``` ```
default default
{ {
$[Default-statement...]$ $[Default-statement...]$
} }
``` ```
@ -332,7 +333,7 @@ A state definition block has the syntax:
``` ```
states $[ ( Scope $[ , Scope]$... ) ]$ states $[ ( Scope $[ , Scope]$... ) ]$
{ {
$[State-or-label...]$ $[State-or-label...]$
} }
``` ```

View File

@ -1,12 +1,13 @@
# Constant Definitions
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Example: Constant definitions](#example-constant-definitions) * [Constant Definitions](#constant-definitions)
* [Example: Constant definitions](#example-constant-definitions)
* [Static array definitions](#static-array-definitions) * [Static array definitions](#static-array-definitions)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Constant Definitions
Constants are simple named values. They are created with the syntax: Constants are simple named values. They are created with the syntax:
``` ```

View File

@ -1,12 +1,12 @@
Enumeration Definitions
=======================
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Example: Enumeration definitions](#example-enumeration-definitions) * [Enumeration Definitions](#enumeration-definitions)
* [Example: Enumeration definitions](#example-enumeration-definitions)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Enumeration Definitions
An enumeration is a list of named numbers, which by default will be incremental An enumeration is a list of named numbers, which by default will be incremental
from 0. By default they decay to the type `int`, but the default decay type can from 0. By default they decay to the type `int`, but the default decay type can
be set manually. be set manually.
@ -16,7 +16,7 @@ An enumeration definition takes the form:
``` ```
enum Identifier $[ : Integer-type]$ enum Identifier $[ : Integer-type]$
{ {
$[Enumerator $[ , Enumerator]$... $[ , ]$]$ $[Enumerator $[ , Enumerator]$... $[ , ]$]$
} }
``` ```
@ -39,20 +39,20 @@ Identifier $[ = Expression]$
// Basic enumeration. // Basic enumeration.
enum MyCoolEnum enum MyCoolEnum
{ {
A_THING, // Has value int(0) ... A_THING, // Has value int(0) ...
BEES, // ... 1 ... BEES, // ... 1 ...
CALCIUM, // ... 2 ... CALCIUM, // ... 2 ...
DEXTROSE, // ... and 3. DEXTROSE, // ... and 3.
} }
// Less trivial example. // Less trivial example.
enum MyCoolerEnum : int16 enum MyCoolerEnum : int16
{ {
A = 500, // Has value int16(500), A = 500, // Has value int16(500),
B, // 501, B, // 501,
C = 200, C = 200,
D, // 201, D, // 201,
E, // and 202. E, // and 202.
} }
``` ```
<!-- EOF --> <!-- EOF -->

View File

@ -1,27 +1,30 @@
# Expressions and Operators
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Expressions and Operators](#expressions-and-operators)
* [Literals](#literals) * [Literals](#literals)
* [String literals](#string-literals) * [String literals](#string-literals)
* [Class type literals](#class-type-literals) * [Class type literals](#class-type-literals)
* [Name literals](#name-literals) * [Name literals](#name-literals)
* [Integer literals](#integer-literals) * [Integer literals](#integer-literals)
* [Float literals](#float-literals) * [Float literals](#float-literals)
* [Boolean literals](#boolean-literals) * [Boolean literals](#boolean-literals)
* [Null pointer](#null-pointer) * [Null pointer](#null-pointer)
* [Expressions](#expressions) * [Expressions](#expressions)
* [Primary expressions](#primary-expressions) * [Primary expressions](#primary-expressions)
* [Vector literals](#vector-literals) * [Vector literals](#vector-literals)
* [Postfix expressions](#postfix-expressions) * [Postfix expressions](#postfix-expressions)
* [Argument list](#argument-list) * [Argument list](#argument-list)
* [Unary expressions](#unary-expressions) * [Unary expressions](#unary-expressions)
* [Binary expressions](#binary-expressions) * [Binary expressions](#binary-expressions)
* [Assignment expressions](#assignment-expressions) * [Assignment expressions](#assignment-expressions)
* [Ternary expression](#ternary-expression) * [Ternary expression](#ternary-expression)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Expressions and Operators
TODO
# Literals # Literals
Much like C or most other programming languages, ZScript has object literals, Much like C or most other programming languages, ZScript has object literals,
@ -166,11 +169,11 @@ arithmetic and various conditions.
Basic expressions, also known as primary expressions, can be one of: Basic expressions, also known as primary expressions, can be one of:
- An identifier for a constant or variable. * An identifier for a constant or variable.
- The `Super` keyword. * The `Super` keyword.
- Any object literal. * Any object literal.
- A vector literal. * A vector literal.
- An expression in parentheses. * An expression in parentheses.
Identifiers work as you expect, they reference a variable or constant. The Identifiers work as you expect, they reference a variable or constant. The
`Super` keyword references the parent type or any member within it. `Super` keyword references the parent type or any member within it.

View File

@ -1,12 +1,13 @@
# Member Declarations
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Example: Member declarations](#example-member-declarations) * [Member Declarations](#member-declarations)
* [Example: Member declarations](#example-member-declarations)
* [Member Declaration Flags](#member-declaration-flags) * [Member Declaration Flags](#member-declaration-flags)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Member Declarations
Member declarations define data within a structure or class that can be Member declarations define data within a structure or class that can be
accessed directly within methods of the object (or its derived classes,) or accessed directly within methods of the object (or its derived classes,) or
indirectly from instances of it with the member access operator. indirectly from instances of it with the member access operator.

View File

@ -1,14 +1,15 @@
# Method Definitions
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Method Definitions](#method-definitions)
* [Method Argument List](#method-argument-list) * [Method Argument List](#method-argument-list)
* [Example: Method argument lists](#example-method-argument-lists) * [Example: Method argument lists](#example-method-argument-lists)
* [Method Definition Flags](#method-definition-flags) * [Method Definition Flags](#method-definition-flags)
* [Action functions](#action-functions) * [Action functions](#action-functions)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Method Definitions
Method definitions define functions within a structure or class that can be Method definitions define functions within a structure or class that can be
accessed directly within other methods of the object (or its derived classes,) accessed directly within other methods of the object (or its derived classes,)
or indirectly from instances of it with the member access operator. or indirectly from instances of it with the member access operator.
@ -22,7 +23,7 @@ Methods are formed as so:
``` ```
$[Method-definition-flags...]$ Type $[ , Type]$... Identifier ( $[Method-argument-list]$ ) $[ const ]$ $[Method-definition-flags...]$ Type $[ , Type]$... Identifier ( $[Method-argument-list]$ ) $[ const ]$
{ {
$[Statement...]$ $[Statement...]$
} }
``` ```

View File

@ -1,25 +1,26 @@
# Statements
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Statements](#statements)
* [Compound Statements](#compound-statements) * [Compound Statements](#compound-statements)
* [Expression Statements](#expression-statements) * [Expression Statements](#expression-statements)
* [Example: Expression statements](#example-expression-statements) * [Example: Expression statements](#example-expression-statements)
* [Conditional Statements](#conditional-statements) * [Conditional Statements](#conditional-statements)
* [Example: Conditional statements](#example-conditional-statements) * [Example: Conditional statements](#example-conditional-statements)
* [Switch Statements](#switch-statements) * [Switch Statements](#switch-statements)
* [Example: Switch statements](#example-switch-statements) * [Example: Switch statements](#example-switch-statements)
* [Loop Statements](#loop-statements) * [Loop Statements](#loop-statements)
* [Control Flow Statements](#control-flow-statements) * [Control Flow Statements](#control-flow-statements)
* [Example: Control flow statements](#example-control-flow-statements) * [Example: Control flow statements](#example-control-flow-statements)
* [Local Variable Statements](#local-variable-statements) * [Local Variable Statements](#local-variable-statements)
* [Multi-assignment Statements](#multi-assignment-statements) * [Multi-assignment Statements](#multi-assignment-statements)
* [Example: Multi-assignment statements](#example-multi-assignment-statements) * [Example: Multi-assignment statements](#example-multi-assignment-statements)
* [Static Array Statements](#static-array-statements) * [Static Array Statements](#static-array-statements)
* [Null Statements](#null-statements) * [Null Statements](#null-statements)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Statements
All functions are made up of a list of *statements* enclosed with left and All functions are made up of a list of *statements* enclosed with left and
right braces, which in and of itself is a statement called a *compound right braces, which in and of itself is a statement called a *compound
statement*, or *block*. statement*, or *block*.
@ -30,7 +31,7 @@ A compound statement is formed as:
``` ```
{ {
$[Statement...]$ $[Statement...]$
} }
``` ```
@ -77,17 +78,17 @@ if ( Expression ) Statement $[ else Statement]$
// Simple conditional. // Simple conditional.
if(a) if(a)
B(); B();
// Simple conditional, with else statement and a block. // Simple conditional, with else statement and a block.
if(a) if(a)
{ {
B(); B();
c = d; c = d;
} }
else else
e = f; e = f;
``` ```
# Switch Statements # Switch Statements
@ -107,17 +108,17 @@ switch ( Expression ) Statement
switch(a) switch(a)
{ {
case 500: case 500:
Console.PrintF("a is 500"); Console.PrintF("a is 500");
break; break;
case 501: case 501:
Console.PrintF("a is 501"); Console.PrintF("a is 501");
// Falls through to the next case. // Falls through to the next case.
case 502: case 502:
Console.PrintF("a is 501 or 502"); Console.PrintF("a is 501 or 502");
break; break;
default: default:
Console.PrintF("not sure what a is!"); Console.PrintF("not sure what a is!");
// "break" is implied here. // "break" is implied here.
} }
``` ```
@ -151,11 +152,11 @@ iteration is complete. The `do while` and `do until` loops are formed as such:
``` ```
do do
Statement Statement
while ( Expression ) // unlike C, you don't need a semicolon here while ( Expression ) // unlike C, you don't need a semicolon here
do do
Statement Statement
until ( Expression ) until ( Expression )
``` ```
@ -194,47 +195,47 @@ return $[Expression $[ , Expression]$...]$ ;
// Use of "continue." // Use of "continue."
for(int i = 0; i < 50; i++) for(int i = 0; i < 50; i++)
{ {
// Don't do anything when "i" is 25. // Don't do anything when "i" is 25.
if(i == 25) if(i == 25)
continue; continue;
DoThing(i); DoThing(i);
} }
// Use of "break." // Use of "break."
for(int i = 0; i < 50; i++) for(int i = 0; i < 50; i++)
{ {
// "break" when "i" is 25. // "break" when "i" is 25.
if(i == 25) if(i == 25)
break; break;
DoThing(i); DoThing(i);
} }
// Use of `return` in various contexts. // Use of `return` in various contexts.
void ReturnsNothing() void ReturnsNothing()
{ {
// Exit early if "m_Thing" isn't 50. // Exit early if "m_Thing" isn't 50.
if(m_Thing != 50) if(m_Thing != 50)
return; return;
DoThing(m_Thing); DoThing(m_Thing);
} }
int ReturnsInt() int ReturnsInt()
{ {
// "m_Thing" is 50, so return 50. // "m_Thing" is 50, so return 50.
if(m_Thing == 50) if(m_Thing == 50)
return 50; return 50;
// Must have a return, eventually. // Must have a return, eventually.
return 0; return 0;
} }
int, int ReturnsTwoInts() int, int ReturnsTwoInts()
{ {
// Returns 1 and 2. // Returns 1 and 2.
return 1, 2; return 1, 2;
} }
``` ```

View File

@ -1,13 +1,14 @@
# Structure Definitions
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Example: Structure definitions](#example-structure-definitions) * [Structure Definitions](#structure-definitions)
* [Example: Structure definitions](#example-structure-definitions)
* [Structure Flags](#structure-flags) * [Structure Flags](#structure-flags)
* [Structure Content](#structure-content) * [Structure Content](#structure-content)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Structure Definitions
A structure is an object type that does not inherit from Object and is not A structure is an object type that does not inherit from Object and is not
always (though occasionally is) a reference type, unlike classes. Structures always (though occasionally is) a reference type, unlike classes. Structures
marked as `native` are passed by-reference to and from the engine in an marked as `native` are passed by-reference to and from the engine in an
@ -26,7 +27,7 @@ A structure takes the form of:
``` ```
struct Identifier $[Structure-flags...]$ struct Identifier $[Structure-flags...]$
{ {
$[Structure-content...]$ $[Structure-content...]$
} }
``` ```
@ -38,9 +39,9 @@ Optionally followed by a semicolon.
// Simple structure. // Simple structure.
struct MyCoolStructure struct MyCoolStructure
{ {
int X; int X;
int Y; int Y;
int Z; int Z;
} }
``` ```
@ -59,9 +60,9 @@ struct MyCoolStructure
Structure contents are an optional list of various things logically contained Structure contents are an optional list of various things logically contained
within the structure, including: within the structure, including:
- Member declarations * Member declarations
- Method definitions * Method definitions
- Enumeration definitions * Enumeration definitions
- Constant definitions * Constant definitions
<!-- EOF --> <!-- EOF -->

View File

@ -1,11 +1,24 @@
# Types
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
* [Types](#types)
* [Integer Types](#integer-types) * [Integer Types](#integer-types)
* [Symbols](#symbols) * [Symbols](#symbols)
* [`Max`](#max)
* [`Min`](#min)
* [Floating-point Types](#floating-point-types) * [Floating-point Types](#floating-point-types)
* [Symbols](#symbols-1) * [Symbols](#symbols-1)
* [`Dig`](#dig)
* [`Epsilon`](#epsilon)
* [`Infinity`](#infinity)
* [`Mant_Dig`](#mant_dig)
* [`Max`](#max-1)
* [`Max_Exp`](#max_exp)
* [`Max_10_Exp`](#max_10_exp)
* [`Min_Denormal`](#min_denormal)
* [`Min_Exp`](#min_exp)
* [`Min_Normal`](#min_normal)
* [`Min_10_Exp`](#min_10_exp)
* [`NaN`](#nan)
* [Strings](#strings) * [Strings](#strings)
* [Names](#names) * [Names](#names)
* [Colors](#colors) * [Colors](#colors)
@ -22,6 +35,8 @@
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
# Types
ZScript has several categories of types: Integer types, floating-point ZScript has several categories of types: Integer types, floating-point
(decimal) types, strings, vectors, names, classes, et al. There are a wide (decimal) types, strings, vectors, names, classes, et al. There are a wide
variety of ways to use these types, as well as a wide variety of places they variety of ways to use these types, as well as a wide variety of places they
@ -62,13 +77,13 @@ Some types have aliases as well:
Integer types have symbols attached which can be accessed by `typename.name`, Integer types have symbols attached which can be accessed by `typename.name`,
for instance `int.Max`. for instance `int.Max`.
- `Max` ### `Max`
Maximum value of type. Maximum value of type.
- `Min` ### `Min`
Minimum value of type. Minimum value of type.
# Floating-point Types # Floating-point Types
@ -87,53 +102,53 @@ numbers. There are two such types available to ZScript:
Floating-point types have symbols attached which can be accessed by Floating-point types have symbols attached which can be accessed by
`typename.name`, for instance `double.Infinity`. `typename.name`, for instance `double.Infinity`.
- `Dig` ### `Dig`
Number of decimal digits in type. Number of decimal digits in type.
- `Epsilon` ### `Epsilon`
ε value of type. ε value of type.
- `Infinity` ### `Infinity`
∞ value of type. ∞ value of type.
- `Mant_Dig` ### `Mant_Dig`
Number of mantissa bits in type. Number of mantissa bits in type.
- `Max` ### `Max`
Maximum value of type. Maximum value of type.
- `Max_Exp` ### `Max_Exp`
Maximum exponent bits value of type. Maximum exponent bits value of type.
- `Max_10_Exp` ### `Max_10_Exp`
Maximum exponent of type. Maximum exponent of type.
- `Min_Denormal` ### `Min_Denormal`
Minimum positive subnormal value of type. Minimum positive subnormal value of type.
- `Min_Exp` ### `Min_Exp`
Minimum exponent bits value of type. Minimum exponent bits value of type.
- `Min_Normal` ### `Min_Normal`
Minimum value of type. Minimum value of type.
- `Min_10_Exp` ### `Min_10_Exp`
Minimum exponent of type. Minimum exponent of type.
- `NaN` ### `NaN`
Not-a-Number value of type. Not-a-Number value of type.
# Strings # Strings
@ -220,8 +235,8 @@ so the following:
``` ```
for(int i = 0; i < 5; i++) for(int i = 0; i < 5; i++)
{ {
array<int> a; array<int> a;
a.Push(0); a.Push(0);
} }
``` ```