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
{
readonly uint8 Frame;
readonly State NextState;
readonly int Sprite;
readonly int16 Tics;
readonly uint8 Frame;
readonly State NextState;
readonly int Sprite;
readonly int16 Tics;
readonly int Misc1;
readonly int Misc2;
readonly uint16 TicRange;
readonly uint8 UseFlags;
readonly int Misc1;
readonly int Misc2;
readonly uint16 TicRange;
readonly uint8 UseFlags;
readonly bool bCanRaise;
readonly bool bDeHackEd;
readonly bool bFast;
readonly bool bFullBright;
readonly bool bNoDelay;
readonly bool bSameFrame;
readonly bool bSlow;
readonly bool bCanRaise;
readonly bool bDeHackEd;
readonly bool bFast;
readonly bool bFullBright;
readonly bool bNoDelay;
readonly bool bSameFrame;
readonly bool bSlow;
int DistanceTo(State other);
bool InStateSequence(State base);
bool ValidateSpriteFrame();
int DistanceTo(State other);
bool InStateSequence(State base);
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`
- `Misc2`
### `Misc1`, `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
duration is not random. For example, `TNT1 A random(5, 7)` would have a
`Tics` value of `5` and a `TicRange` of `2`.
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 `Tics`
value of `5` and a `TicRange` of `2`.
- `UseFlags`
### `UseFlags`
The scope of this state. See *Action Scoping*. Can have any of the
`DefaultStateUsage` flags.
The scope of this state. See *Action Scoping*. Can have any of the
`DefaultStateUsage` flags.
- `bCanRaise`
### `bCanRaise`
State has the `CanRaise` flag, allowing `A_VileChase` to target this actor
for healing without entering an infinitely long state.
State has the `CanRaise` flag, allowing `A_VileChase` to target this actor for
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
enabled.
State has the `Fast` flag, halving the duration when fast monsters is enabled.
- `bFullBright`
### `bFullBright`
State has the `Bright` flag, making it fully bright regardless of other
lighting conditions.
State has the `Bright` flag, making it fully bright regardless of other
lighting conditions.
- `bNoDelay`
### `bNoDelay`
State has the `NoDelay` flag, forcing the associated action function to be
run if the actor is in its first tic.
State has the `NoDelay` flag, forcing the associated action function to be run
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
enabled.
State has the `Slow` flag, doubling the duration when slow monsters is enabled.
- `DistanceTo`
### `DistanceTo`
Returns the offset between this state and `other` in the global frame table.
Only works if both states are owned by the same actor.
Returns the offset between this state and `other` in the global frame table.
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
with `base`.
Returns `true` if this state is within a contiguous state sequence beginning
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
scaling of this state's sprite. Scaling will return `scale` unless `skin` is
nonzero. `skin` determines the player skin used.
Returns the texture, if the texture should be flipped horizontally, and scaling
of this state's sprite. Scaling will return `scale` unless `skin` is nonzero.
`skin` determines the player skin used.
<!-- EOF -->

View File

@ -9,96 +9,96 @@ variant of `TArray` existing in the engine.
```
struct Array<Type>
{
uint Max() const;
uint Size() const;
uint Max() const;
uint Size() const;
void Append(array<Type> other);
void Copy(array<Type> other);
void Move(array<Type> other);
void Append(array<Type> other);
void Copy(array<Type> other);
void Move(array<Type> other);
void Clear();
void Delete(uint index, int deletecount = 1);
bool Pop();
void Clear();
void Delete(uint index, int deletecount = 1);
bool Pop();
uint Find(Type item) const;
void Grow(uint amount);
void Insert(uint index, Type item);
uint Push(Type item);
uint Reserve(uint amount);
void Resize(uint amount);
void ShrinkToFit();
uint Find(Type item) const;
void Grow(uint amount);
void Insert(uint index, Type item);
uint Push(Type item);
uint Reserve(uint amount);
void Resize(uint amount);
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
objects after `index + count` to the left.
Removes `count` objects starting at `index`, possibly destroying them. Moves
objects after `index + count` to the left.
- `Pop`
### `Pop`
Removes the last item in the array, possibly destroying it. Returns `false`
if there are no items in the array to begin with.
Removes the last item in the array, possibly destroying it. Returns `false` if
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
end.
Value-copies another array's contents and places them into this array at the
end.
- `Copy`
### `Copy`
Value-copies another array's contents into this array. The contents of
`other` are preserved. This operation can be extremely taxing in some cases.
Value-copies another array's contents into this array. The contents of `other`
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
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.
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
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
allocated object amount if necessary.
Ensures the array can hold at least `amount` new members, growing the allocated
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,
increasing `Size` and calling `Grow` if necessary. Value types are
initialized to zero and reference types to `null`.
Adds `amount` new empty-constructed objects at the end of the array, increasing
`Size` and calling `Grow` if necessary. Value types are initialized to zero and
reference types to `null`.
- `Resize`
### `Resize`
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 follow the same initialization rules as `Reserve`.
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 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 -->

View File

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

View File

@ -6,7 +6,7 @@ range 0 to 255, inclusive.
```
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]
{
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 -->

View File

@ -5,45 +5,45 @@ The base class of all `class` types.
```
class Object
{
bool bDestroyed;
bool bDestroyed;
class GetClass();
string GetClassName();
class GetParentClass();
class GetClass();
string GetClassName();
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
to it will be invalidated.
Destroys this object. Do not use the object after calling this. References to
it will be invalidated.
- `OnDestroy`
### `OnDestroy`
Called just before the object is collected by the garbage collector. **Not
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
are linked into this list, so be careful when overriding this. Any `Actor`
will generally be safe.
Called just before the object is collected by the garbage collector. **Not
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 are
linked into this list, so be careful when overriding this. Any `Actor` will
generally be safe.
<!-- EOF -->

View File

@ -5,109 +5,107 @@ Strings have many methods attached to them for manipulating text.
```
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;
int CharCodeAt(int pos) const;
string Filter();
int IndexOf(string substr, int startIndex = 0) const;
string Left(int len) const;
uint Length() const;
string Mid(int pos = 0, int len = int.Max) const;
void Remove(int index, int amount);
void Replace(string pattern, string replacement);
int RightIndexOf(string substr, int endIndex = int.Max) const;
void Split(out array<string> tokens, string delimiter, EmptyTokenType keepEmpty = TOK_KEEPEMPTY) const;
double ToDouble() const;
int ToInt(int base = 0) const;
void ToLower();
void ToUpper();
void Truncate(int newlen);
string CharAt(int pos) const;
int CharCodeAt(int pos) const;
string Filter();
int IndexOf(string substr, int startIndex = 0) const;
string Left(int len) const;
uint Length() const;
string Mid(int pos = 0, int len = int.Max) const;
void Remove(int index, int amount);
void Replace(string pattern, string replacement);
int RightIndexOf(string substr, int endIndex = int.Max) const;
void Split(out array<string> tokens, string delimiter, EmptyTokenType keepEmpty = TOK_KEEPEMPTY) const;
double ToDouble() const;
int ToInt(int base = 0) const;
void ToLower();
void ToUpper();
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
string.
Replaces escape sequences in a string with escaped characters as a new 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
either `TOK_SKIPEMPTY` (the default) or `TOK_KEEPEMPTY`, which will keep or
discard empty strings found while splitting.
Splits the string by each `delimiter` into `tokens`. `keepEmpty` may be either
`TOK_SKIPEMPTY` (the default) or `TOK_KEEPEMPTY`, which will keep or discard
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
`0`.
Interprets the string as a base `base` integer, guessing the base if it is `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 -->

View File

@ -5,16 +5,15 @@ The localized string table as defined by `LANGUAGE`.
```
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
is returned as-is unless it is prefixed with `$` where the `$` character
itself is ignored. **Not deterministic** unless there is only one variant of
`val`. This is generally fine because this should only be used for visual
strings anyway.
Returns the localized variant of `val`. If `prefixed` is `true`, the string is
returned as-is unless it is prefixed with `$` where the `$` character itself is
ignored. **Not deterministic** unless there is only one variant of `val`. This
is generally fine because this should only be used for visual strings anyway.
<!-- 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.
<!--
NOTE: These tables are not alphabetically organized as their ordering is
meaningful.
NOTE: These tables are not alphabetically organized as their ordering is
meaningful.
-->
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
{
const TICRATE;
const TICRATE;
LevelLocals Level;
LevelLocals Level;
void ChangeStatNum(int stat);
void ChangeStatNum(int stat);
virtual void PostBeginPlay();
virtual void Tick();
virtual void PostBeginPlay();
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
other thinker in the same statnum is unspecified.
Called every game tick. The order between this thinker's `Tick` and every other
thinker in the same statnum is unspecified.
- `Tics2Seconds`
### `Tics2Seconds`
Roughly converts a number of tics to an integral amount of seconds.
Equivalent to `tics / TICRATE`.
Roughly converts a number of tics to an integral amount of seconds. Equivalent
to `tics / TICRATE`.
<!-- EOF -->

View File

@ -6,28 +6,28 @@ operator.
```
struct Vector2
{
double x, y;
double x, y;
double Length() const;
vector2 Unit() const;
double Length() const;
vector2 Unit() const;
}
struct Vector3
{
double x, y, z;
vector2 xy;
double x, y, z;
vector2 xy;
double Length() const;
vector3 Unit() const;
double Length() 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 -->

View File

@ -6,22 +6,22 @@ fit the screen and clipping region.
```
class BrokenLines : Object
{
int Count();
string StringAt(int line);
int StringWidth(int line);
int Count();
string StringAt(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 -->

View File

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

View File

@ -6,56 +6,56 @@ not use as a member unless marked as `transient`.**
```
struct Font
{
static Font FindFont(name fontname);
static int FindFontColor(name color);
static Font GetFont(name fontname);
static Font FindFont(name fontname);
static int FindFontColor(name color);
static Font GetFont(name fontname);
double GetBottomAlignOffset(int code);
int GetCharWidth(int code);
string GetCursor();
int GetHeight();
int StringWidth(string code);
double GetBottomAlignOffset(int code);
int GetCharWidth(int code);
string GetCursor();
int GetHeight();
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
clip region, as well as appropriately accounting for a maximum width in
pixels of `maxlen`.
Breaks `text` up into a `BrokenLines` structure according to the screen and
clip region, as well as appropriately accounting for a maximum width in pixels
of `maxlen`.
<!-- EOF -->

View File

@ -5,17 +5,17 @@ A font as defined in `MAPINFO`/GameInfo.
```
struct GIFont
{
name Color;
name FontName;
name Color;
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 -->

View File

@ -8,169 +8,168 @@ Note: There are no longer any fully paletted renderers in GZDoom as of version
```
struct Screen
{
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 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 DrawChar(Font font, int cr, double x, double y, int character, ...);
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 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 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 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 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 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 DrawThickLine(int x0, int y0, int x1, int y1, double thickness, color cr, int alpha = 255);
static double GetAspectRatio();
static int GetHeight();
static int GetWidth();
static color PaletteColor(int index);
static vector2, vector2 VirtualToRealCoords(vector2 pos, vector2 size, vector2 vsize, bool vbottom = false, bool handleaspect = true);
static double GetAspectRatio();
static int GetHeight();
static int GetWidth();
static color PaletteColor(int index);
static vector2, vector2 VirtualToRealCoords(vector2 pos, vector2 size, vector2 vsize, bool vbottom = false, bool handleaspect = true);
static void ClearClipRect();
static int, int, int, int GetClipRect();
static int, int, int, int GetViewWindow();
static void SetClipRect(int x, int y, int w, int h);
static void ClearClipRect();
static int, int, int, int GetClipRect();
static int, int, int, int GetViewWindow();
static void SetClipRect(int x, int y, int w, int h);
}
```
- `DrawChar`
### `DrawChar`
The same as `DrawTexture`, but draws the texture of character code
`character` from `font`. The output color may be modified by the font color
`cr`.
The same as `DrawTexture`, but draws the texture of character code `character`
from `font`. The output color may be modified by the font color `cr`.
- `DrawShape`
### `DrawShape`
TODO
TODO
- `DrawText`
### `DrawText`
TODO
TODO
- `DrawTexture`
### `DrawTexture`
Draws texture `tex`, possibly animated by the animation ticker if `animate`
is `true`, at horizontal position `x` and vertical position `y`.
Draws texture `tex`, possibly animated by the animation ticker if `animate` is
`true`, at horizontal position `x` and vertical position `y`.
Various properties of this drawing process can be changed by passing extra
arguments to this function. After all arguments are parsed, the
"`CleanMode`" internal variable is used along with the specified virtual
width/height to determine how to finally transform positions. `CleanMode`
may be one of the following:
Various properties of this drawing process can be changed by passing extra
arguments to this function. After all arguments are parsed, the "`CleanMode`"
internal variable is used along with the specified virtual width/height to
determine how to finally transform positions. `CleanMode` may be one of the
following:
| Name | Description |
| ---- | ----------- |
| `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_CLEANNOMOVE` | Scales the destination width and height by `Clean*Fac`. |
| `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_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. |
| Name | Description |
| ---- | ----------- |
| `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_CLEANNOMOVE` | Scales the destination width and height by `Clean*Fac`. |
| `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_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. |
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 |
| ---- | --------- | ----------- |
| `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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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. |
| 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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
`cr` color. Does not support translucent colors. `palcolor` is a palette
index to use as a color in paletted renderers or `-1` for automatic
conversion from the given RGB color.
Draws a rectangle from `top left` to `bottom right` in screen coordinates of
`cr` color. Does not support translucent colors. `palcolor` is a palette index
to use as a color in paletted renderers or `-1` for automatic conversion from
the given RGB color.
- `Dim`
### `Dim`
Draws a rectangle at `x y` of `w h` size in screen coordinates of `cr`
color. Does not support translucent colors, but `amount` may be used to
specify the translucency in a range of 0-1 inclusive.
Draws a rectangle at `x y` of `w h` size in screen coordinates of `cr` color.
Does not support translucent colors, but `amount` may be used to specify the
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
coordinates, using the border graphics as defined in `MAPINFO`/GameInfo.
Draws a frame around a rectangle at `x y` of `w h` size in screen coordinates,
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
color `cr` with alpha `alpha` (range 0-255.)
Draws a one pixel wide line from `x0 y0` to `x1 y1` in screen coordinates of
color `cr` with alpha `alpha` (range 0-255.)
- `DrawThickLine`
### `DrawThickLine`
Draws a `thickness` pixel wide line from `x0 y0` to `x1 y1` in screen
coordinates of color `cr` with alpha `alpha` (range 0-255.)
Draws a `thickness` pixel wide line from `x0 y0` to `x1 y1` in screen
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
screen coordinate space `size`, possibly accounting for aspect ratio
differences if `handleaspect` is true. If the ratio is 5:4, `vbottom` will
account for the higher-than-wide conversion by repositioning vertically.
Converts virtual coordinates `pos` from virtual coordinate space `vsize` to
screen coordinate space `size`, possibly accounting for aspect ratio
differences if `handleaspect` is true. If the ratio is 5:4, `vbottom` will
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
with any given `screenblocks` setting.
Returns the 3D viewing window, which may be smaller than the screen size with
any given `screenblocks` setting.
- `SetClipRect`
### `SetClipRect`
Sets the clipping rectangle to restrict further drawing to the region
starting at `x y` of size `w h` in screen coordinates.
Sets the clipping rectangle to restrict further drawing to the region starting
at `x y` of size `w h` in screen coordinates.
<!-- EOF -->

View File

@ -5,33 +5,33 @@ Represents an arbitrary polygonal 2D shape.
```
class Shape2D : Object
{
void Clear(int which = C_Verts | C_Coords | C_Indices);
void PushCoord(vector2 c);
void PushTriangle(int a, int b, int c);
void PushVertex(vector2 v);
void Clear(int which = C_Verts | C_Coords | C_Indices);
void PushCoord(vector2 c);
void PushTriangle(int a, int b, int c);
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 |
| ---- | ----------- |
| `Shape2D.C_Coords` | Clears texture coordinates. |
| `Shape2D.C_Indices` | Clears vertex indices. |
| `Shape2D.C_Verts` | Clears vertices. |
| Name | Description |
| ---- | ----------- |
| `Shape2D.C_Coords` | Clears texture coordinates. |
| `Shape2D.C_Indices` | Clears vertex indices. |
| `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 -->

View File

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

View File

@ -7,39 +7,39 @@ only works with the integer on the right hand side.)
```
struct TextureID
{
bool Exists() const;
bool IsNull() const;
bool IsValid() const;
void SetInvalid();
void SetNull();
bool Exists() const;
bool IsNull() const;
bool IsValid() const;
void SetInvalid();
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;
tex.SetNull();
```
```
textureid tex;
tex.SetNull();
```
<!-- EOF -->

View File

@ -5,32 +5,32 @@ The information for a `ConsoleProcess` or `NetworkProcess` event.
```
struct ConsoleEvent
{
readonly int Player;
readonly string Name;
readonly int Args[3];
readonly bool IsManual;
readonly int Player;
readonly string Name;
readonly int Args[3];
readonly bool IsManual;
}
```
- `Player`
### `Player`
The player who created this event, or `-1` if there was no activator. This
will always be positive for `NetworkProcess` events and always `-1` for
`ConsoleProcess` events.
The player who created this event, or `-1` if there was no activator. This will
always be positive for `NetworkProcess` events and always `-1` for
`ConsoleProcess` events.
- `Name`
### `Name`
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
game so that it will not potentially conflict with other mods.
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 game
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
command.
`true` if this event was created manually, for instance through a console
command.
<!-- EOF -->

View File

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

View File

@ -5,40 +5,40 @@ The information for a `RenderOverlay` event.
```
struct RenderEvent
{
readonly vector3 ViewPos;
readonly double ViewAngle;
readonly double ViewPitch;
readonly double ViewRoll;
readonly double FracTic;
readonly Actor Camera;
readonly vector3 ViewPos;
readonly double ViewAngle;
readonly double ViewPitch;
readonly double ViewRoll;
readonly double FracTic;
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
game tick and the next game tick. This is most useful for interpolation, and
you can add it to the current game tick to get the real time at which this
event has been called. Precision is not specified.
A value between 0 and 1 (exclusive) representing the time between the last game
tick and the next game tick. This is most useful for interpolation, and you can
add it to the current game tick to get the real time at which this event has
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 -->

View File

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

View File

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

View File

@ -22,11 +22,11 @@ Single files can also be loaded as archives, containing only themselves.
In short:
- *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.
- *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.
- *Wad files* are archives which hold only lumps, and use markers for determining lump namespaces.
* *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.
* *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.
* *Wad files* are archives which hold only lumps, and use markers for determining lump namespaces.
| Name | Description | Resource path | Wad file marker |
| ---- | ----------- | ------------- | --------------- |
@ -54,44 +54,44 @@ resource archive folder namespaces, which are normally under `NS_GLOBAL`.
```
struct Wads
{
static int CheckNumForFullName(string name);
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 string ReadLump(int lump);
static int CheckNumForFullName(string name);
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 string ReadLump(int lump);
}
```
- `CheckNumForFullName`
### `CheckNumForFullName`
Returns the handle of the first file named `name`, matching only the full
path to it, including the extension, or `-1` if the file was not found. Only
works with files defined in resource archives.
Returns the handle of the first file named `name`, matching only the full path
to it, including the extension, or `-1` if the file was not found. Only works
with files defined in resource archives.
- `CheckNumForName`
### `CheckNumForName`
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
the last archive to search in, or the only archive to search in if `exact`
is `true`.
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 the
last archive to search in, or the only archive to search in if `exact` is
`true`.
Note there is currently no way to actually *get* the number of an archive,
even the current one. The only guarantee is that archive `0` will be the
base archive (`gzdoom.pk3`.)
Note there is currently no way to actually *get* the number of an archive, even
the current one. The only guarantee is that archive `0` will be the base
archive (`gzdoom.pk3`.)
- `FindLump`
### `FindLump`
Returns the handle of the first lump named `name` starting at `startlump`
(zero indicates the first lump) in either the global namespace or any
namespace. `ns` can be either `Wads.GLOBALNAMESPACE` or `Wads.ANYNAMESPACE`
to specify this. Returns `-1` if there are no lumps with that name left.
Returns the handle of the first lump named `name` starting at `startlump` (zero
indicates the first lump) in either the global namespace or any namespace. `ns`
can be either `Wads.GLOBALNAMESPACE` or `Wads.ANYNAMESPACE` to specify this.
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
`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
lump's size even if null characters are present in the lump.
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
loaded this way and the string's length will be correct according to the lump's
size even if null characters are present in the lump.
<!-- EOF -->

View File

@ -32,109 +32,109 @@ readonly ui bool NetGame;
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
the current virtual resolution. **Not deterministic.**
Integral scaling factor for horizontal positions to scale from 320x200 to the
current virtual resolution. **Not deterministic.**
- `CleanXFac_1`
### `CleanXFac_1`
Integral scaling factor for horizontal positions to scale from 320x200 to
the current virtual resolution, accounting for aspect ratio differences.
**Not deterministic.**
Integral scaling factor for horizontal positions to scale from 320x200 to the
current virtual resolution, accounting for aspect ratio differences. **Not
deterministic.**
- `CleanYFac`
### `CleanYFac`
Integral scaling factor for vertical positions to scale from 320x200 to the
current virtual resolution. **Not deterministic.**
Integral scaling factor for vertical positions to scale from 320x200 to the
current virtual resolution. **Not deterministic.**
- `CleanYFac_1`
### `CleanYFac_1`
Integral scaling factor for vertical positions to scale from 320x200 to the
current virtual resolution, accounting for aspect ratio differences. **Not
deterministic.**
Integral scaling factor for vertical positions to scale from 320x200 to the
current virtual resolution, accounting for aspect ratio differences. **Not
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 |
| ---- | ----------- |
| `Menu.Off` | No active menu. |
| `Menu.OnNoPause` | Menu is opened, but the game is not paused. |
| `Menu.On` | Menu is open, game is paused. |
| `Menu.WaitKey` | Menu is opened, waiting for a key for a controls menu binding. |
| Name | Description |
| ---- | ----------- |
| `Menu.Off` | No active menu. |
| `Menu.OnNoPause` | Menu is opened, but the game is not paused. |
| `Menu.On` | Menu is open, game is paused. |
| `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 -->

View File

@ -12,29 +12,29 @@ const PLAYERMISSILERANGE;
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
player's melee attacks.
The range where melee will be used for monsters, and the range for the player's
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 -->

View File

@ -15,72 +15,72 @@ deprecated("3.8") readonly bool GlobalFreeze;
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 |
| ---- | ----------- |
| `ga_autoloadgame` | Don't use this. |
| `ga_autosave` | Creates an autosave. |
| `ga_completed` | Don't use this. |
| `ga_fullconsole` | Don't use this. |
| `ga_loadgamehideicon` | Don't use this. |
| `ga_loadgameplaydemo` | Don't use this. |
| `ga_loadgame` | Don't use this. |
| `ga_loadlevel` | Don't use this. |
| `ga_newgame2` | Don't use this. |
| `ga_newgame` | Don't use this. |
| `ga_nothing` | Does nothing. |
| `ga_playdemo` | Don't use this. |
| `ga_recordgame` | Don't use this. |
| `ga_savegame` | Don't use this. |
| `ga_screenshot` | Takes a screenshot. |
| `ga_slideshow` | Don't use this. |
| `ga_togglemap` | Toggles the auto-map. |
| `ga_worlddone` | Don't use this. |
| Name | Description |
| ---- | ----------- |
| `ga_autoloadgame` | Don't use this. |
| `ga_autosave` | Creates an autosave. |
| `ga_completed` | Don't use this. |
| `ga_fullconsole` | Don't use this. |
| `ga_loadgamehideicon` | Don't use this. |
| `ga_loadgameplaydemo` | Don't use this. |
| `ga_loadgame` | Don't use this. |
| `ga_loadlevel` | Don't use this. |
| `ga_newgame2` | Don't use this. |
| `ga_newgame` | Don't use this. |
| `ga_nothing` | Does nothing. |
| `ga_playdemo` | Don't use this. |
| `ga_recordgame` | Don't use this. |
| `ga_savegame` | Don't use this. |
| `ga_screenshot` | Takes a screenshot. |
| `ga_slideshow` | Don't use this. |
| `ga_togglemap` | Toggles the auto-map. |
| `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 |
| ---- | ----------- |
| `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_FULLCONSOLE` | Outside of a level, console only. |
| `GS_HIDECONSOLE` | Outside of a level, console hidden (i.e. main menu.) |
| `GS_INTERMISSION` | In between levels. |
| `GS_LEVEL` | Inside a level. |
| `GS_STARTUP` | Game not yet initialized. |
| `GS_TITLELEVEL` | Watching a `TITLEMAP` in the main menu. |
| Name | Description |
| ---- | ----------- |
| `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_FULLCONSOLE` | Outside of a level, console only. |
| `GS_HIDECONSOLE` | Outside of a level, console hidden (i.e. main menu.) |
| `GS_INTERMISSION` | In between levels. |
| `GS_LEVEL` | Inside a level. |
| `GS_STARTUP` | Game not yet initialized. |
| `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 -->

View File

@ -16,47 +16,46 @@ readonly textureid SkyFlatNum;
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
`KEYCONF`.
An array of all player classes as defined in `MAPINFO`/GameInfo and `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`
block and `MAPINFO`/GameInfo.
Defaults for `OptionMenu`s as defined in `MENUDEF`'s `OptionMenuSettings` block
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
shouldn't be switched from.
A constant denoting that the weapon the player is currently holding shouldn't
be switched from.
<!-- EOF -->

View File

@ -10,24 +10,24 @@ readonly bool PlayerInGame[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 -->

View File

@ -7,17 +7,16 @@ Type GetDefaultByType(class<Actor> type);
Type New(class typename = ThisClass);
```
- `GetDefaultByType`
### `GetDefaultByType`
Returns an object containing the default values for each member of the
`Actor` type provided as they would be set in `BeginPlay`. **Note that the
return value cannot be serialized and if stored must be marked as
`transient`.** The returned object is a pseudo-object which is stored only
in-memory.
Returns an object containing the default values for each member of the `Actor`
type provided as they would be set in `BeginPlay`. **Note that the return value
cannot be serialized and if stored must be marked as `transient`.** The
returned object is a pseudo-object which is stored only in-memory.
- `New`
### `New`
Typically spelled lowercase (`new`), creates an object with type `typename`.
Defaults to using the class of the calling object.
Typically spelled lowercase (`new`), creates an object with type `typename`.
Defaults to using the class of the calling object.
<!-- 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);
```
- `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 |
| ---- |
| `SKILLP_ACSRETURN` |
| `SKILLP_AUTOUSEHEALTH` |
| `SKILLP_DISABLECHEATS` |
| `SKILLP_EASYBOSSBRAIN` |
| `SKILLP_EASYKEY` |
| `SKILLP_FASTMONSTERS` |
| `SKILLP_INFIGHT` |
| `SKILLP_NOPAIN` |
| `SKILLP_PLAYERRESPAWN` |
| `SKILLP_RESPAWNLIMIT` |
| `SKILLP_RESPAWN` |
| `SKILLP_SLOWMONSTERS` |
| `SKILLP_SPAWNFILTER` |
| Name |
| ---- |
| `SKILLP_ACSRETURN` |
| `SKILLP_AUTOUSEHEALTH` |
| `SKILLP_DISABLECHEATS` |
| `SKILLP_EASYBOSSBRAIN` |
| `SKILLP_EASYKEY` |
| `SKILLP_FASTMONSTERS` |
| `SKILLP_INFIGHT` |
| `SKILLP_NOPAIN` |
| `SKILLP_PLAYERRESPAWN` |
| `SKILLP_RESPAWNLIMIT` |
| `SKILLP_RESPAWN` |
| `SKILLP_SLOWMONSTERS` |
| `SKILLP_SPAWNFILTER` |
- `G_SkillPropertyFloat`
### `G_SkillPropertyFloat`
Returns a skill property. `p` may be:
Returns a skill property. `p` may be:
| Name |
| ---- |
| `SKILLP_AGGRESSIVENESS` |
| `SKILLP_AMMOFACTOR` |
| `SKILLP_ARMORFACTOR` |
| `SKILLP_DAMAGEFACTOR` |
| `SKILLP_DROPAMMOFACTOR` |
| `SKILLP_FRIENDLYHEALTH` |
| `SKILLP_HEALTHFACTOR` |
| `SKILLP_MONSTERHEALTH` |
| `SKILLP_KICKBACKFACTOR` |
| Name |
| ---- |
| `SKILLP_AGGRESSIVENESS` |
| `SKILLP_AMMOFACTOR` |
| `SKILLP_ARMORFACTOR` |
| `SKILLP_DAMAGEFACTOR` |
| `SKILLP_DROPAMMOFACTOR` |
| `SKILLP_FRIENDLYHEALTH` |
| `SKILLP_HEALTHFACTOR` |
| `SKILLP_MONSTERHEALTH` |
| `SKILLP_KICKBACKFACTOR` |
- `G_PickDeathmatchStart`
### `G_PickDeathmatchStart`
Note: This function is deprecated and `LevelLocals::PickDeathmatchStart`
should be used instead.
Note: This function is deprecated and `LevelLocals::PickDeathmatchStart` should
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
be used instead.
Note: This function is deprecated and `LevelLocals::PickPlayerStart` should be
used instead.
Returns the position and angle of a player start for player `pnum`. `flags`
may be:
Returns the position and angle of a player start for player `pnum`. `flags` may
be:
| Name | Description |
| ---- | ----------- |
| `PPS_FORCERANDOM` | Always picks a random player spawn for this player. |
| `PPS_NOBLOCKINGCHECK` | Does not check if an object is blocking the player spawn. |
| Name | Description |
| ---- | ----------- |
| `PPS_FORCERANDOM` | Always picks a random player spawn for this player. |
| `PPS_NOBLOCKINGCHECK` | Does not check if an object is blocking the player spawn. |
<!-- EOF -->

View File

@ -28,97 +28,97 @@ double TanH(double n);
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
the correct quadrant.
Returns the arc-tangent of `y / x` using the arguments' signs to determine the
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
of those values if it is not.
Returns `n` if `n` is more than `minimum` and less than `maximum`, or either of
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
instead the `**` binary operator, as in `a ** b`, since euler's number is
generally not a very useful constant when programming games.
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
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
instance when calculating the number of decimal digits in a number.
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.
- `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 -->

View File

@ -13,30 +13,30 @@ int RandomPick(int...);
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
a bit mask, so it is recommended to use a value of one less than a power of
two (i.e. 3, 7, 15, 31, 63, 127, 255...)
Returns a random integer value between `-mask` and `mask`. `mask` is used as a
bit mask, so it is recommended to use a value of one less than a power of two
(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 -->

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);
```
- `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,
inclusive.
Sets the volume of the music relative to the user's volume. Range is 0-1,
inclusive.
- `S_ChangeMusic`
### `S_ChangeMusic`
Changes the music to `name`. If `name` is `"*"`, the music will be set to
the default music for this level. Will loop if `looping` is `true`. `force`
will force the music to play even if a playlist (from the `playlist` console
command) is playing.
Changes the music to `name`. If `name` is `"*"`, the music will be set to the
default music for this level. Will loop if `looping` is `true`. `force` will
force the music to play even if a playlist (from the `playlist` console
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 |
| ------ | ------- |
| 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. |
| Any other format | No meaning, will be ignored. |
| Format | Meaning |
| ------ | ------- |
| 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. |
| Any other format | No meaning, will be ignored. |
- `S_GetLength`
### `S_GetLength`
Returns the length of a sound in seconds. **Potentially non-deterministic if
all users in a networked game are not using the same sounds.**
Returns the length of a sound in seconds. **Potentially non-deterministic if
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
`false`. Used for instance in the time stop power-up.
Pauses music if `notmusic` is `false` and all game sounds if `notsfx` is
`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
world presence (is an actor or sector etc.)
Plays a sound (as defined in `SNDINFO`) from the calling object if it has world
presence (is an actor or sector etc.)
`channel` may be:
`channel` may be:
| Name | Description |
| ---- | ----------- |
| `CHAN_AUTO` | Automatically assigns the sound to a free channel (if one exists.) |
| `CHAN_BODY` | For footsteps and generally anything else. |
| `CHAN_ITEM` | For item pickups. |
| `CHAN_VOICE` | For player grunts. |
| `CHAN_WEAPON` | For weapon noises. |
| `CHAN_5` | Extra sound channel. |
| `CHAN_6` | Extra sound channel. |
| `CHAN_7` | Extra sound channel. |
| Name | Description |
| ---- | ----------- |
| `CHAN_AUTO` | Automatically assigns the sound to a free channel (if one exists.) |
| `CHAN_BODY` | For footsteps and generally anything else. |
| `CHAN_ITEM` | For item pickups. |
| `CHAN_VOICE` | For player grunts. |
| `CHAN_WEAPON` | For weapon noises. |
| `CHAN_5` | Extra sound channel. |
| `CHAN_6` | Extra sound channel. |
| `CHAN_7` | Extra sound channel. |
`channel` may also have the following flags applied with the binary OR
operator `|`:
`channel` may also have the following flags applied with the binary OR
operator `|`:
| Name | Description |
| ---- | ----------- |
| `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_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_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. |
| Name | Description |
| ---- | ----------- |
| `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_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_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. |
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
value, the quicker it fades. Constants include:
`attenuation` determines the drop-off distance of the sound. The higher the
value, the quicker it fades. Constants include:
| Name | Value | Description |
| ---- | ----- | ----------- |
| `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_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. |
| Name | Value | Description |
| ---- | ----- | ----------- |
| `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_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. |
<!-- EOF -->

View File

@ -7,12 +7,13 @@ uint MSTime();
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 -->

View File

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

View File

@ -6,47 +6,47 @@ and `MAPINFO`/GameInfo.
```
struct FOptionMenuSettings
{
int mTitleColor;
int mFontColor;
int mFontColorValue;
int mFontColorMore;
int mFontColorHeader;
int mFontColorHighlight;
int mFontColorSelection;
int mLineSpacing;
int mTitleColor;
int mFontColor;
int mFontColorValue;
int mFontColorMore;
int mFontColorHeader;
int mFontColorHighlight;
int mFontColorSelection;
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 -->

View File

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

View File

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

View File

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

View File

@ -5,31 +5,31 @@ Either a patch or string depending on external configurations.
```
struct PatchInfo play
{
int mColor;
Font mFont;
textureid mPatch;
int mColor;
Font mFont;
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
`gifont.FontName` is a valid patch, `mPatch` will be set accordingly.
Otherwise, if the font has a color or the patch is invalid,
`gifont.FontName` is used to set `mFont` (or it is defaulted to `BigFont`.)
Initializes the structure. If `gifont.Color` is `'Null'`, and `gifont.FontName`
is a valid patch, `mPatch` will be set accordingly. Otherwise, if the font has
a color or the patch is invalid, `gifont.FontName` is used to set `mFont` (or
it is defaulted to `BigFont`.)
<!-- EOF -->

View File

@ -5,422 +5,420 @@ The base class for intermission status screens. Any status screen used by
Status screens have four stages:
- `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.
- `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.
* `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.
* `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.
These are provided as constants in `StatusScreen`. The starting stage is `STATCOUNT`.
```
class StatusScreen : Object abstract play
{
const NG_STATSY;
const SHOWNEXTLOCDELAY;
const SP_STATSX;
const SP_STATSY;
const SP_TIMEX;
const SP_TIMEY;
const TITLEY;
const NG_STATSY;
const SHOWNEXTLOCDELAY;
const SP_STATSX;
const SP_STATSY;
const SP_TIMEX;
const SP_TIMEY;
const TITLEY;
InterBackground BG;
WBPlayerStruct Plrs[MAXPLAYERS];
WBStartStruct Wbs;
InterBackground BG;
WBPlayerStruct Plrs[MAXPLAYERS];
WBStartStruct Wbs;
int AccelerateStage;
int BCnt;
int Cnt;
int Cnt_Deaths[MAXPLAYERS];
int Cnt_Frags[MAXPLAYERS];
int Cnt_Items[MAXPLAYERS];
int Cnt_Kills[MAXPLAYERS];
int Cnt_Par;
int Cnt_Pause;
int Cnt_Secret[MAXPLAYERS];
int Cnt_Time;
int Cnt_Total_Time;
int CurState;
int DoFrags;
int Me;
int NG_State;
bool NoAutoStartMap;
bool PlayerReady[MAXPLAYERS];
int Player_Deaths[MAXPLAYERS];
bool Snl_PointerOn;
int SP_State;
float ShadowAlpha;
int Total_Deaths;
int Total_Frags;
int AccelerateStage;
int BCnt;
int Cnt;
int Cnt_Deaths[MAXPLAYERS];
int Cnt_Frags[MAXPLAYERS];
int Cnt_Items[MAXPLAYERS];
int Cnt_Kills[MAXPLAYERS];
int Cnt_Par;
int Cnt_Pause;
int Cnt_Secret[MAXPLAYERS];
int Cnt_Time;
int Cnt_Total_Time;
int CurState;
int DoFrags;
int Me;
int NG_State;
bool NoAutoStartMap;
bool PlayerReady[MAXPLAYERS];
int Player_Deaths[MAXPLAYERS];
bool Snl_PointerOn;
int SP_State;
float ShadowAlpha;
int Total_Deaths;
int Total_Frags;
PatchInfo Entering;
PatchInfo Finished;
PatchInfo MapName;
PatchInfo Entering;
PatchInfo Finished;
PatchInfo MapName;
textureid Items;
textureid Kills;
textureid P_Secret;
textureid Par;
textureid Secret;
textureid Sucks;
textureid Timepic;
textureid Items;
textureid Kills;
textureid P_Secret;
textureid Par;
textureid Secret;
textureid Sucks;
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);
void DrawEL();
int DrawLF();
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 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 DrawTime(int x, int y, int t, bool no_sucks = false);
int DrawCharPatch(Font fnt, int charcode, int x, int y, int translation = Font.CR_UNTRANSLATED, bool nomove = false);
void DrawEL();
int DrawLF();
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 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 DrawTime(int x, int y, int t, bool no_sucks = false);
bool AutoSkip();
bool AutoSkip();
virtual void Drawer();
virtual void End();
virtual void Start(WBStartStruct wbs_);
virtual void StartMusic();
virtual void Ticker();
virtual void Drawer();
virtual void End();
virtual void Start(WBStartStruct wbs_);
virtual void StartMusic();
virtual void Ticker();
protected virtual void DrawNoState();
protected virtual void DrawShowNextLoc();
protected virtual void DrawStats();
protected virtual void InitNoState();
protected virtual void InitShowNextLoc();
protected virtual void InitStats();
protected virtual void UpdateNoState();
protected virtual void UpdateShowNextLoc();
protected virtual void UpdateStats();
protected virtual void DrawNoState();
protected virtual void DrawShowNextLoc();
protected virtual void DrawStats();
protected virtual void InitNoState();
protected virtual void InitShowNextLoc();
protected virtual void InitStats();
protected virtual void UpdateNoState();
protected virtual void UpdateShowNextLoc();
protected virtual void UpdateStats();
protected void CheckForAccelerate();
protected int FragSum(int playernum);
protected void CheckForAccelerate();
protected int FragSum(int playernum);
static int, int, int GetPlayerWidths();
static color GetRowColor(PlayerInfo player, bool highlight);
static void GetSortedPlayers(in out array<int> sorted, bool teamplay);
static void PlaySound(sound snd);
static int, int, int GetPlayerWidths();
static color GetRowColor(PlayerInfo player, bool highlight);
static void GetSortedPlayers(in out array<int> sorted, bool teamplay);
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
"entering" texts. Used by `DrawEL` and `DrawLF`.
The Y position (in 320x200 pixels) to draw the top of the "finished" and
"entering" texts. Used by `DrawEL` and `DrawLF`.
- `BG`
### `BG`
The `InterBackground` object for this intermission, set by `Start` with the
initial `Wbs` object.
The `InterBackground` object for this intermission, set by `Start` with the
initial `Wbs` object.
- `Plrs`
### `Plrs`
The value of `Wbs.Plyr` when `Start` was called. Usually not changed, so
essentially equivalent to `Wbs.Plyr`.
The value of `Wbs.Plyr` when `Start` was called. Usually not changed, so
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
entirely.
Used to signify to the current stage that it should go quicker or be skipped
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
essentially equivalent to `Wbs.PNum`.
The value of `Wbs.PNum` when `Start` was called. Usually not changed, so
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
the next map. Set by `CheckForAccelerate`.
Used in networked games to signify when each player is ready to continue to the
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
indicating the current round of statistics to count up.
Used in single-player status screens during the `STATCOUNT` stage for
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
`GS_INTERMISSION`.
Called by `WI_Drawer`, which is called every frame when `GameState` is
`GS_INTERMISSION`.
- `End`
### `End`
Called when the intermission should end. Default behaviour is to set
`CurState` to `LEAVINGINTERMISSION` and remove bots in death-match.
Generally, `Level.WorldDone` should be called directly after this.
Called when the intermission should end. Default behaviour is to set `CurState`
to `LEAVINGINTERMISSION` and remove bots in death-match. Generally,
`Level.WorldDone` should be called directly after this.
- `Start`
### `Start`
Called by `WI_Start` after the `WBStartStruct` is populated, sounds are
stopped and the screen blend is set to black. Sets up initial values and
runs `InitStats`.
Called by `WI_Start` after the `WBStartStruct` is populated, sounds are stopped
and the screen blend is set to black. Sets up initial values and runs
`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
`GS_INTERMISSION`.
Called by `WI_Ticker`, which is called every game tick when `GameState` is
`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,
`DrawNoState` after setting `Snl_PointerOn` to `true`.
Called by `Drawer` when `CurState` is `SHOWNEXTLOC` and, by default,
`DrawNoState` after setting `Snl_PointerOn` to `true`.
- `DrawStats`
### `DrawStats`
Called by `Drawer` directly after drawing the animated background when
`CurState` is `STATCOUNT`.
Called by `Drawer` directly after drawing the animated background when
`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.
Exits the intermission by calling `End` and `Level.WorldDone` when
appropriate.
Called by `Ticker` when `CurState` is `NOSTATE` or any other non-state. Exits
the intermission by calling `End` and `Level.WorldDone` when appropriate.
- `UpdateShowNextLoc`
### `UpdateShowNextLoc`
Called by `Ticker` when `CurState` is `SHOWNEXTLOC`. Runs `InitNoState` when
appropriate and alternates `Snl_PointerOn`.
Called by `Ticker` when `CurState` is `SHOWNEXTLOC`. Runs `InitNoState` when
appropriate and alternates `Snl_PointerOn`.
- `UpdateStats`
### `UpdateStats`
Called by `Ticker` when `CurState` is `STATCOUNT`. Runs `InitShowNextLoc`
when appropriate.
Called by `Ticker` when `CurState` is `STATCOUNT`. Runs `InitShowNextLoc`
when appropriate.
- `CheckForAccelerate`
### `CheckForAccelerate`
Updates the values of `AccelerateStage` and `PlayerReady` according to each
player's inputs.
Updates the values of `AccelerateStage` and `PlayerReady` according to each
player's inputs.
- `FragSum`
### `FragSum`
Returns the number of frags player `playernum` has accumulated against all
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
changed. This is only useful for game modes where frags do not count as
score.
Returns the number of frags player `playernum` has accumulated against all
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
changed. This is only useful for game modes where frags do not count as 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 -->

View File

@ -5,39 +5,39 @@ Information for each individual player for a `StatusScreen`.
```
struct WBPlayerStruct
{
int SItems;
int SKills;
int SSecret;
int STime;
int SItems;
int SKills;
int SSecret;
int STime;
int FragCount;
int Frags[MAXPLAYERS];
int FragCount;
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
all players.)
The time this player finished the level at, in ticks. (This is the same for all
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 -->

View File

@ -5,92 +5,92 @@ Information passed into the `StatusScreen` class when an intermission starts.
```
struct WBStartStruct
{
WBPlayerStruct Plyr[MAXPLAYERS];
int PNum;
WBPlayerStruct Plyr[MAXPLAYERS];
int PNum;
int Finished_Ep;
int Next_Ep;
int Finished_Ep;
int Next_Ep;
string Current;
string Next;
string NextName;
string Current;
string Next;
string NextName;
textureid LName0;
textureid LName1;
textureid LName0;
textureid LName1;
int MaxFrags;
int MaxItems;
int MaxKills;
int MaxSecret;
int MaxFrags;
int MaxItems;
int MaxKills;
int MaxSecret;
int ParTime;
int SuckTime;
int TotalTime;
int ParTime;
int SuckTime;
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 -->

View File

@ -5,28 +5,28 @@ Describes the coloring of a sector.
```
struct FColorMap
{
uint8 BlendFactor;
uint8 Desaturation;
color FadeColor;
color LightColor;
uint8 BlendFactor;
uint8 Desaturation;
color FadeColor;
color LightColor;
}
```
- `BlendFactor`
### `BlendFactor`
TODO: "This is for handling Legacy-style color maps which use a different
formula to calculate how the color affects lighting."
TODO: "This is for handling Legacy-style color maps which use a different
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 -->

View File

@ -5,174 +5,174 @@ Also known as a "linedef." A line segment with two sides and two vertices.
```
struct Line play
{
readonly Sector BackSector, FrontSector;
readonly double BBox[4];
readonly vector2 Delta;
readonly Side Sidedef[2];
readonly Vertex V1, V2;
readonly Sector BackSector, FrontSector;
readonly double BBox[4];
readonly vector2 Delta;
readonly Side Sidedef[2];
readonly Vertex V1, V2;
readonly uint PortalIndex;
readonly uint PortalTransferred;
readonly uint PortalIndex;
readonly uint PortalTransferred;
readonly int Health;
readonly int HealthGroup;
readonly int Health;
readonly int HealthGroup;
double Alpha;
uint Flags;
int ValidCount;
double Alpha;
uint Flags;
int ValidCount;
uint Activation;
int Args[5];
int LockNumber;
int Special;
uint Activation;
int Args[5];
int LockNumber;
int Special;
int Index();
int Index();
bool Activate(Actor activator, int side, int type);
bool RemoteActivate(Actor activator, int side, int type, vector3 pos);
bool Activate(Actor activator, int side, int type);
bool RemoteActivate(Actor activator, int side, int type, vector3 pos);
Line GetPortalDestination();
bool IsLinePortal();
bool IsVisualPortal();
Line GetPortalDestination();
bool IsLinePortal();
bool IsVisualPortal();
clearscope int GetHealth();
void SetHealth(int newhealth);
clearscope int GetHealth();
void SetHealth(int newhealth);
double GetUdmfFloat(name nm);
int GetUdmfInt(name nm);
string GetUdmfString(name nm);
double GetUdmfFloat(name nm);
int GetUdmfInt(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
`Line.Front` and `Line.Back` are provided as well.
The front and back sides of this line, 0 and 1 respectively. The aliases
`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 |
| ---- | ----------- |
| `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_ADDTRANS` | Middle textures are drawn with additive translucency on both sides. |
| `ML_BLOCKEVERYTHING` | Line blocks everything. |
| `ML_BLOCKHITSCAN` | Line blocks 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_BLOCKPROJECTILE` | Line blocks projectiles. |
| `ML_BLOCKSIGHT` | Line blocks line of sight. |
| `ML_BLOCKUSE` | Line blocks use actions. |
| `ML_BLOCK_FLOATERS` | Line blocks flying monsters. |
| `ML_BLOCK_PLAYERS` | Line blocks players. |
| `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_DONTDRAW` | Never shown on the auto-map. |
| `ML_DONTPEGBOTTOM` | Lower 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_MAPPED` | Always shown on the auto-map. |
| `ML_MONSTERSCANACTIVATE` | Monsters may activate this line. |
| `ML_RAILING` | Line is a railing that can be jumped over. |
| `ML_REPEAT_SPECIAL` | Special may be activated multiple times. |
| `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_TWOSIDED` | Line has a back side. |
| `ML_WRAP_MIDTEX` | Applies `WALLF_WRAP_MIDTEX` to both sides. |
| `ML_ZONEBOUNDARY` | Reverb zone boundary. |
| Name | Description |
| ---- | ----------- |
| `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_ADDTRANS` | Middle textures are drawn with additive translucency on both sides. |
| `ML_BLOCKEVERYTHING` | Line blocks everything. |
| `ML_BLOCKHITSCAN` | Line blocks 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_BLOCKPROJECTILE` | Line blocks projectiles. |
| `ML_BLOCKSIGHT` | Line blocks line of sight. |
| `ML_BLOCKUSE` | Line blocks use actions. |
| `ML_BLOCK_FLOATERS` | Line blocks flying monsters. |
| `ML_BLOCK_PLAYERS` | Line blocks players. |
| `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_DONTDRAW` | Never shown on the auto-map. |
| `ML_DONTPEGBOTTOM` | Lower 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_MAPPED` | Always shown on the auto-map. |
| `ML_MONSTERSCANACTIVATE` | Monsters may activate this line. |
| `ML_RAILING` | Line is a railing that can be jumped over. |
| `ML_REPEAT_SPECIAL` | Special may be activated multiple times. |
| `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_TWOSIDED` | Line has a back side. |
| `ML_WRAP_MIDTEX` | Applies `WALLF_WRAP_MIDTEX` to both sides. |
| `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 -->

View File

@ -5,19 +5,19 @@ Iterates over line indices with a specified tag.
```
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
`-1` when the list is exhausted.
Returns the index of the current line and advances the iterator. Returns `-1`
when the list is exhausted.
<!-- EOF -->

View File

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

View File

@ -5,37 +5,37 @@ TODO
```
struct SecSpecial play
{
int DamageAmount;
int16 DamageInterval;
name DamageType;
int Flags;
int16 LeakyDamage;
int16 Special;
int DamageAmount;
int16 DamageInterval;
name DamageType;
int Flags;
int16 LeakyDamage;
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 -->

View File

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

View File

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

View File

@ -15,122 +15,122 @@ The three portions of a sidedef can be referred to with:
```
struct Side play
{
readonly Line Linedef;
readonly Sector Sector;
readonly Line Linedef;
readonly Sector Sector;
uint8 Flags;
int16 Light;
uint8 Flags;
int16 Light;
int Index();
int Index();
clearscope Vertex V1();
clearscope Vertex V2();
clearscope Vertex V1();
clearscope Vertex V2();
textureid GetTexture(int which);
textureid GetTexture(int which);
double GetTextureXOffset(int which);
double GetTextureYOffset(int which);
double GetTextureXOffset(int which);
double GetTextureYOffset(int which);
double GetTextureXScale(int which);
double GetTextureYScale(int which);
double GetTextureXScale(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 SetTextureYOffset(int which, double offset);
void SetTextureXOffset(int which, double offset);
void SetTextureYOffset(int which, double offset);
void SetTextureXScale(int which, double scale);
void SetTextureYScale(int which, double scale);
void SetTextureXScale(int which, double scale);
void SetTextureYScale(int which, double scale);
void AddTextureXOffset(int which, double delta);
void AddTextureYOffset(int which, double delta);
void AddTextureXOffset(int which, double delta);
void AddTextureYOffset(int which, double delta);
void MultiplyTextureXScale(int which, double delta);
void MultiplyTextureYScale(int which, double delta);
void MultiplyTextureXScale(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);
void SetAdditiveColor(int tier, color cr);
color GetAdditiveColor(int tier);
void SetAdditiveColor(int tier, color cr);
void EnableAdditiveColor(int tier, bool enable);
void EnableAdditiveColor(int tier, bool enable);
double GetUdmfFloat(name nm);
int GetUdmfInt(name nm);
string GetUdmfString(name nm);
double GetUdmfFloat(name nm);
int GetUdmfInt(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 |
| ---- | ----------- |
| `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_LIGHT_FOG` | The wall's lighting will ignore fog effects. |
| `WALLF_NOAUTODECALS` | Don't attach decals to this surface. |
| `WALLF_NOFAKECONTRAST` | Disables the "fake contrast" effect for this side. |
| `WALLF_POLYOBJ` | This sidedef belongs to a polyobject. |
| `WALLF_SMOOTHLIGHTING` | Applies a unique contrast at all angles. |
| `WALLF_WRAP_MIDTEX` | Repeats the middle texture infinitely on the vertical axis. |
| Name | Description |
| ---- | ----------- |
| `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_LIGHT_FOG` | The wall's lighting will ignore fog effects. |
| `WALLF_NOAUTODECALS` | Don't attach decals to this surface. |
| `WALLF_NOFAKECONTRAST` | Disables the "fake contrast" effect for this side. |
| `WALLF_POLYOBJ` | This sidedef belongs to a polyobject. |
| `WALLF_SMOOTHLIGHTING` | Applies a unique contrast at all angles. |
| `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
`WALLF_ABSLIGHTING`.
The light level of this side. Relative to the sector lighting unless
`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 -->

View File

@ -5,18 +5,18 @@ A point in world space.
```
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 -->

View File

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

View File

@ -5,67 +5,67 @@ A player skin as defined in `SKININFO` or `S_SKIN`.
```
struct PlayerSkin
{
int CrouchSprite;
string Face;
uint8 Gender;
int NameSpc;
bool OtherGame;
uint8 Range0End;
uint8 Range0Start;
vector2 Scale;
string SkinName;
int Sprite;
int CrouchSprite;
string Face;
uint8 Gender;
int NameSpc;
bool OtherGame;
uint8 Range0End;
uint8 Range0Start;
vector2 Scale;
string SkinName;
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 |
| ---- | :---: | ----------- |
| `GENDER_FEMALE` | `1` | Feminine. |
| `GENDER_MALE` | `0` | Masculine. |
| `GENDER_NEUTRAL` | `2` | Neutral. |
| `GENDER_OTHER` | `3` | Other (robot, zombie, etc.) |
| Name | Value | Description |
| ---- | :---: | ----------- |
| `GENDER_FEMALE` | `1` | Feminine. |
| `GENDER_MALE` | `0` | Masculine. |
| `GENDER_NEUTRAL` | `2` | Neutral. |
| `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
differently.
The player skin is made for another game and needs to be color remapped
differently.
- `Range0End`
### `Range0End`
The end index of the translation range to be used for changing the player
sprite's color.
The end index of the translation range to be used for changing the player
sprite's color.
- `Range0Start`
### `Range0Start`
The beginning index of the translation range to be used for changing the
player sprite's color.
The beginning index of the translation range to be used for changing the player
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 -->

View File

@ -5,23 +5,23 @@ A team as defined in `TEAMINFO`.
```
struct Team
{
const Max;
const NoTeam;
const Max;
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 -->

View File

@ -5,38 +5,38 @@ A sound sequence (`SNDSEQ`) node.
```
class SeqNode : Object
{
static name GetSequenceSlot(int sequence, int type);
static void MarkPrecacheSounds(int sequence, int type);
static name GetSequenceSlot(int sequence, int type);
static void MarkPrecacheSounds(int sequence, int type);
void AddChoice(int seqnum, int type);
bool AreModesSame(name n, int mode1);
bool AreModesSameID(int sequence, int type, int mode1);
name GetSequenceName();
void AddChoice(int seqnum, int type);
bool AreModesSame(name n, int mode1);
bool AreModesSameID(int sequence, int type, int mode1);
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 -->

View File

@ -19,121 +19,121 @@ The predefined layers are:
```
class PSprite : Object play
{
readonly State CurState;
readonly int ID;
readonly PSprite Next;
readonly PlayerInfo Owner;
readonly State CurState;
readonly int ID;
readonly PSprite Next;
readonly PlayerInfo Owner;
double Alpha;
Actor Caller;
bool FirstTic;
int Frame;
double OldX;
double OldY;
bool ProcessPending;
spriteid Sprite;
int Tics;
double X;
double Y;
double Alpha;
Actor Caller;
bool FirstTic;
int Frame;
double OldX;
double OldY;
bool ProcessPending;
spriteid Sprite;
int Tics;
double X;
double Y;
bool bAddBob;
bool bAddWeapon;
bool bCVarFast;
bool bFlip;
bool bPowDouble;
bool bAddBob;
bool bAddWeapon;
bool bCVarFast;
bool bFlip;
bool bPowDouble;
void SetState(State newstate, bool pending = false);
void Tick();
void SetState(State newstate, bool pending = false);
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.
Note that `32` is the real resting position because of `A_Raise`.
The offset from the weapon's normal resting position on the vertical axis. Note
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 -->

View File

@ -4,7 +4,7 @@
* [ACS](#acs)
* [Actors](#actors)
* [Examples: Actor Replacement](#examples-actor-replacement)
* [Examples: Actor Replacement](#examples-actor-replacement)
* [Console Commands](#console-commands)
* [CVARINFO](#cvarinfo)
* [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
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
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.
- `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.
- `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`.
- `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.
- `StatScreen_DM` sets the `StatusScreen` class to use for Deathmatch
* `StatScreen_DM` sets the `StatusScreen` class to use for Deathmatch
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.
- `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.
- `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.
TODO: there are other things here as well, like map event handlers

View File

@ -1,16 +1,17 @@
# Concepts
<!-- vim-markdown-toc GFM -->
* [Action Scoping](#action-scoping)
* [Object Scoping](#object-scoping)
* [Format String](#format-string)
* [Sprite](#sprite)
* [Game Tick](#game-tick)
* [Interpolation](#interpolation)
* [Concepts](#concepts)
* [Action Scoping](#action-scoping)
* [Object Scoping](#object-scoping)
* [Format String](#format-string)
* [Sprite](#sprite)
* [Game Tick](#game-tick)
* [Interpolation](#interpolation)
<!-- vim-markdown-toc -->
# Concepts
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
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
information. Differences between C's `printf` and ZScript formats include:
- Since there's no `char` type, `int` is used for `%c`.
- `%s` also works for `name`.
- No `%n` specifier.
- An additional conversion specifier `%B` exists which converts a number to
* Since there's no `char` type, `int` is used for `%c`.
* `%s` also works for `name`.
* No `%n` specifier.
* An additional conversion specifier `%B` exists which converts a number to
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.
[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
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
a demo, packets over the internet in networked games.
Keyboard, mouse, gamepad, etc. if a local player, the demo file if watching a
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
referred to as *gametic*, *tick* or simply *tic*.
Every 1/35th of a second that passes, a new "game tick" takes place, also
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
happens more often than the game is actually ticked. In ZDoom, Eternity
Engine, and some other ports, the information is interpolated between the
last and current game tick when there is extra time available to give
smoother rendering.
All information from the *current* game tick is rendered. This usually happens
more often than the game is actually ticked. In ZDoom, Eternity Engine, and
some other ports, the information is interpolated between the last and current
game tick when there is extra time available to give smoother rendering.
For more information on ticks, please refer to [the relevant Doom Wiki
article][4].

View File

@ -1,22 +1,23 @@
# Style
<!-- vim-markdown-toc GFM -->
* [Capitalization Conventions](#capitalization-conventions)
* [Rationale](#rationale)
* [Word Choice](#word-choice)
* [Rationale](#rationale-1)
* [Naming Type Members](#naming-type-members)
* [Rationale](#rationale-2)
* [Layout Conventions](#layout-conventions)
* [Rationale](#rationale-3)
* [Commenting Conventions](#commenting-conventions)
* [Rationale](#rationale-4)
* [Language Guidelines](#language-guidelines)
* [Rationale](#rationale-5)
* [Style](#style)
* [Capitalization Conventions](#capitalization-conventions)
* [Rationale](#rationale)
* [Word Choice](#word-choice)
* [Rationale](#rationale-1)
* [Naming Type Members](#naming-type-members)
* [Rationale](#rationale-2)
* [Layout Conventions](#layout-conventions)
* [Rationale](#rationale-3)
* [Commenting Conventions](#commenting-conventions)
* [Rationale](#rationale-4)
* [Language Guidelines](#language-guidelines)
* [Rationale](#rationale-5)
<!-- vim-markdown-toc -->
# Style
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
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
characters in length are considered whole words, so for instance prefer
`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
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
names, however. See the "Word Choice" section for more information.)
Identifiers used for flags (declared with `flagdef`) and constants (declared
with `const`, `static const`, or `enum`) must be all uppercase, except the `b`
prefix on flags, and can separate words with underscores.
Constants (declared with `const`, `static const`, or `enum`) must be all
uppercase, and must separate words with underscores.
Argument names in base archive methods may be renamed, but arguments with
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
consistent with most other programming languages that have existed.
Capitalizing constants, enumerations, and flags is an artifact of the way they
are declared in ZDoom, and also in the original Linux Doom source code. This is
Capitalizing constants and enumerations is an artifact of the way they are
declared in ZDoom, and also in the original Linux Doom source code. This is
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
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`.
Always name members with nouns, noun phrases or adjectives. Boolean values
should often be prefixed with `Is`, `Has`, and other existential present-tense
verbs. All members of class types should be prefixed with `m_`, despite rules
against Hungarian notation and underscores. Try to name members productively
rather than vaguely, instead of `RefInt` write `RefCount`.
should often be prefixed with `Is`, `Has`, `Can`, and other existential
present-tense verbs. All members of class types should be prefixed with `m_`,
despite rules against Hungarian notation and underscores. Try to name members
productively rather than vaguely, instead of `RefInt` write `RefCount`.
### Rationale
@ -163,8 +169,8 @@ members, and so this prefix is omitted within them.
## Layout Conventions
Use 3 spaces for indentation. Indent at each block, but do not indent `case`
labels. Align all code to 80 columns.
Use tabs with a width of 3 characters for indentation. Indent at each block,
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
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
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
rules are generally the same as the majority of C-like language style
guidelines.
pleasing to the eye while not being excessive. Hardware tabs are used instead
of spaces in order to allow for user configuration, increasing accessibility.
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
text under standard size Linux terminals. This is useful, for instance, when

View File

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

View File

@ -7,7 +7,7 @@
* [Versions](#versions)
* [Top-level](#top-level)
* [Include directives](#include-directives)
* [Example: Include directives](#example-include-directives)
* [Example: Include directives](#example-include-directives)
* [Table of Contents](#table-of-contents)
<!-- 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,
following a version directive:
- Class definitions
- Structure definitions
- Enumeration definitions
- Constant definitions
- Include directives
* Class definitions
* Structure definitions
* Enumeration definitions
* Constant definitions
* Include directives
# Include directives

View File

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

View File

@ -1,12 +1,13 @@
# Constant Definitions
<!-- 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)
<!-- vim-markdown-toc -->
# Constant Definitions
Constants are simple named values. They are created with the syntax:
```

View File

@ -1,12 +1,12 @@
Enumeration Definitions
=======================
<!-- vim-markdown-toc GFM -->
* [Example: Enumeration definitions](#example-enumeration-definitions)
* [Enumeration Definitions](#enumeration-definitions)
* [Example: Enumeration definitions](#example-enumeration-definitions)
<!-- vim-markdown-toc -->
# Enumeration Definitions
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
be set manually.
@ -16,7 +16,7 @@ An enumeration definition takes the form:
```
enum Identifier $[ : Integer-type]$
{
$[Enumerator $[ , Enumerator]$... $[ , ]$]$
$[Enumerator $[ , Enumerator]$... $[ , ]$]$
}
```
@ -39,20 +39,20 @@ Identifier $[ = Expression]$
// Basic enumeration.
enum MyCoolEnum
{
A_THING, // Has value int(0) ...
BEES, // ... 1 ...
CALCIUM, // ... 2 ...
DEXTROSE, // ... and 3.
A_THING, // Has value int(0) ...
BEES, // ... 1 ...
CALCIUM, // ... 2 ...
DEXTROSE, // ... and 3.
}
// Less trivial example.
enum MyCoolerEnum : int16
{
A = 500, // Has value int16(500),
B, // 501,
C = 200,
D, // 201,
E, // and 202.
A = 500, // Has value int16(500),
B, // 501,
C = 200,
D, // 201,
E, // and 202.
}
```
<!-- EOF -->

View File

@ -1,27 +1,30 @@
# Expressions and Operators
<!-- vim-markdown-toc GFM -->
* [Expressions and Operators](#expressions-and-operators)
* [Literals](#literals)
* [String literals](#string-literals)
* [Class type literals](#class-type-literals)
* [Name literals](#name-literals)
* [Integer literals](#integer-literals)
* [Float literals](#float-literals)
* [Boolean literals](#boolean-literals)
* [Null pointer](#null-pointer)
* [String literals](#string-literals)
* [Class type literals](#class-type-literals)
* [Name literals](#name-literals)
* [Integer literals](#integer-literals)
* [Float literals](#float-literals)
* [Boolean literals](#boolean-literals)
* [Null pointer](#null-pointer)
* [Expressions](#expressions)
* [Primary expressions](#primary-expressions)
* [Vector literals](#vector-literals)
* [Postfix expressions](#postfix-expressions)
* [Argument list](#argument-list)
* [Unary expressions](#unary-expressions)
* [Binary expressions](#binary-expressions)
* [Assignment expressions](#assignment-expressions)
* [Ternary expression](#ternary-expression)
* [Primary expressions](#primary-expressions)
* [Vector literals](#vector-literals)
* [Postfix expressions](#postfix-expressions)
* [Argument list](#argument-list)
* [Unary expressions](#unary-expressions)
* [Binary expressions](#binary-expressions)
* [Assignment expressions](#assignment-expressions)
* [Ternary expression](#ternary-expression)
<!-- vim-markdown-toc -->
# Expressions and Operators
TODO
# 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:
- An identifier for a constant or variable.
- The `Super` keyword.
- Any object literal.
- A vector literal.
- An expression in parentheses.
* An identifier for a constant or variable.
* The `Super` keyword.
* Any object literal.
* A vector literal.
* An expression in parentheses.
Identifiers work as you expect, they reference a variable or constant. The
`Super` keyword references the parent type or any member within it.

View File

@ -1,12 +1,13 @@
# Member Declarations
<!-- 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)
<!-- vim-markdown-toc -->
# Member Declarations
Member declarations define data within a structure or class that can be
accessed directly within methods of the object (or its derived classes,) or
indirectly from instances of it with the member access operator.

View File

@ -1,14 +1,15 @@
# Method Definitions
<!-- vim-markdown-toc GFM -->
* [Method Definitions](#method-definitions)
* [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)
* [Action functions](#action-functions)
* [Action functions](#action-functions)
<!-- vim-markdown-toc -->
# Method Definitions
Method definitions define functions within a structure or class that can be
accessed directly within other methods of the object (or its derived classes,)
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 ]$
{
$[Statement...]$
$[Statement...]$
}
```

View File

@ -1,25 +1,26 @@
# Statements
<!-- vim-markdown-toc GFM -->
* [Statements](#statements)
* [Compound Statements](#compound-statements)
* [Expression Statements](#expression-statements)
* [Example: Expression statements](#example-expression-statements)
* [Example: Expression statements](#example-expression-statements)
* [Conditional Statements](#conditional-statements)
* [Example: Conditional statements](#example-conditional-statements)
* [Example: Conditional statements](#example-conditional-statements)
* [Switch Statements](#switch-statements)
* [Example: Switch statements](#example-switch-statements)
* [Example: Switch statements](#example-switch-statements)
* [Loop Statements](#loop-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)
* [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)
* [Null Statements](#null-statements)
<!-- vim-markdown-toc -->
# Statements
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
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.
if(a)
B();
B();
// Simple conditional, with else statement and a block.
if(a)
{
B();
c = d;
B();
c = d;
}
else
e = f;
e = f;
```
# Switch Statements
@ -107,17 +108,17 @@ switch ( Expression ) Statement
switch(a)
{
case 500:
Console.PrintF("a is 500");
break;
Console.PrintF("a is 500");
break;
case 501:
Console.PrintF("a is 501");
// Falls through to the next case.
Console.PrintF("a is 501");
// Falls through to the next case.
case 502:
Console.PrintF("a is 501 or 502");
break;
Console.PrintF("a is 501 or 502");
break;
default:
Console.PrintF("not sure what a is!");
// "break" is implied here.
Console.PrintF("not sure what a is!");
// "break" is implied here.
}
```
@ -151,11 +152,11 @@ iteration is complete. The `do while` and `do until` loops are formed as such:
```
do
Statement
Statement
while ( Expression ) // unlike C, you don't need a semicolon here
do
Statement
Statement
until ( Expression )
```
@ -194,47 +195,47 @@ return $[Expression $[ , Expression]$...]$ ;
// Use of "continue."
for(int i = 0; i < 50; i++)
{
// Don't do anything when "i" is 25.
if(i == 25)
continue;
// Don't do anything when "i" is 25.
if(i == 25)
continue;
DoThing(i);
DoThing(i);
}
// Use of "break."
for(int i = 0; i < 50; i++)
{
// "break" when "i" is 25.
if(i == 25)
break;
// "break" when "i" is 25.
if(i == 25)
break;
DoThing(i);
DoThing(i);
}
// Use of `return` in various contexts.
void ReturnsNothing()
{
// Exit early if "m_Thing" isn't 50.
if(m_Thing != 50)
return;
// Exit early if "m_Thing" isn't 50.
if(m_Thing != 50)
return;
DoThing(m_Thing);
DoThing(m_Thing);
}
int ReturnsInt()
{
// "m_Thing" is 50, so return 50.
if(m_Thing == 50)
return 50;
// "m_Thing" is 50, so return 50.
if(m_Thing == 50)
return 50;
// Must have a return, eventually.
return 0;
// Must have a return, eventually.
return 0;
}
int, int ReturnsTwoInts()
{
// Returns 1 and 2.
return 1, 2;
// Returns 1 and 2.
return 1, 2;
}
```

View File

@ -1,13 +1,14 @@
# Structure Definitions
<!-- 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 Content](#structure-content)
<!-- vim-markdown-toc -->
# Structure Definitions
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
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...]$
{
$[Structure-content...]$
$[Structure-content...]$
}
```
@ -38,9 +39,9 @@ Optionally followed by a semicolon.
// Simple structure.
struct MyCoolStructure
{
int X;
int Y;
int Z;
int X;
int Y;
int Z;
}
```
@ -59,9 +60,9 @@ struct MyCoolStructure
Structure contents are an optional list of various things logically contained
within the structure, including:
- Member declarations
- Method definitions
- Enumeration definitions
- Constant definitions
* Member declarations
* Method definitions
* Enumeration definitions
* Constant definitions
<!-- EOF -->

View File

@ -1,11 +1,24 @@
# Types
<!-- vim-markdown-toc GFM -->
* [Types](#types)
* [Integer Types](#integer-types)
* [Symbols](#symbols)
* [Symbols](#symbols)
* [`Max`](#max)
* [`Min`](#min)
* [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)
* [Names](#names)
* [Colors](#colors)
@ -22,6 +35,8 @@
<!-- vim-markdown-toc -->
# Types
ZScript has several categories of types: Integer types, floating-point
(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
@ -62,13 +77,13 @@ Some types have aliases as well:
Integer types have symbols attached which can be accessed by `typename.name`,
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
@ -87,53 +102,53 @@ numbers. There are two such types available to ZScript:
Floating-point types have symbols attached which can be accessed by
`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
@ -220,8 +235,8 @@ so the following:
```
for(int i = 0; i < 5; i++)
{
array<int> a;
a.Push(0);
array<int> a;
a.Push(0);
}
```