mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 06:41:41 +00:00
- Added handling for UDMF user keys.
- Added support for ACS functions that can be defined without recompiling ACC. - Fixed: The short lump name for embedded files must be cleared so that they are not found by a normal lump search. - Added AProp_Notarget actor property. - Fixed: TraceBleed was missing a NULL pointer check, - Fixed: P_RandomChaseDir could crash for friendly monsters that belong to a player which left the game. - Changed A_PodGrow so that it plays the generator's attack sound instead of "misc/podgrow". SVN r1575 (trunk)
This commit is contained in:
parent
b224765351
commit
571d28281b
16 changed files with 540 additions and 1493 deletions
|
@ -1,283 +0,0 @@
|
||||||
|
|
||||||
README - DOOM assembly code
|
|
||||||
|
|
||||||
Okay, I add the DOS assembly module for the historically
|
|
||||||
inclined here (may rec.games.programmer suffer). If anyone
|
|
||||||
feels the urge to port these to GNU GCC; either inline or
|
|
||||||
as separate modules including Makefile support, be my guest.
|
|
||||||
|
|
||||||
Module tmap.S includes the inner loops for texture mapping,
|
|
||||||
the interesting one being the floor/ceiling span rendering.
|
|
||||||
|
|
||||||
There was another module in the source dump, fpfunc.S, that
|
|
||||||
had both texture mapping and fixed point functions. It
|
|
||||||
contained implementations both for i386 and M68k. For
|
|
||||||
brevity, I include only the i386 fixed point stuff below.
|
|
||||||
|
|
||||||
//====================================================
|
|
||||||
// tmap.S as of January 10th, 1997
|
|
||||||
|
|
||||||
//================
|
|
||||||
//
|
|
||||||
// R_DrawColumn
|
|
||||||
//
|
|
||||||
//================
|
|
||||||
|
|
||||||
.data
|
|
||||||
loopcount .long 0
|
|
||||||
pixelcount .long 0
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
.align 16
|
|
||||||
.globl _R_DrawColumn
|
|
||||||
_R_DrawColumn:
|
|
||||||
|
|
||||||
pushad
|
|
||||||
|
|
||||||
movl ebp,[_dc_yl]
|
|
||||||
movl ebx,ebp
|
|
||||||
movl edi,[_ylookup+ebx*4]
|
|
||||||
movl ebx,[_dc_x]
|
|
||||||
addl edi,[_columnofs + ebx*4]
|
|
||||||
|
|
||||||
movl eax,[_dc_yh]
|
|
||||||
incl eax
|
|
||||||
subl eax,ebp // pixel count
|
|
||||||
movl [pixelcount],eax // save for final pixel
|
|
||||||
js done // nothing to scale
|
|
||||||
shrl eax,1 // double pixel count
|
|
||||||
movl [loopcount],eax
|
|
||||||
|
|
||||||
movl ecx,[_dc_iscale]
|
|
||||||
|
|
||||||
movl eax,[_centery]
|
|
||||||
subl eax,ebp
|
|
||||||
imull ecx
|
|
||||||
movl ebp,[_dc_texturemid]
|
|
||||||
subl ebp,eax
|
|
||||||
shll ebp,9 // 7 significant bits, 25 frac
|
|
||||||
|
|
||||||
movl esi,[_dc_source]
|
|
||||||
|
|
||||||
|
|
||||||
movl ebx,[_dc_iscale]
|
|
||||||
shll ebx,9
|
|
||||||
movl eax,OFFSET patch1+2 // convice tasm to modify code...
|
|
||||||
movl [eax],ebx
|
|
||||||
movl eax,OFFSET patch2+2 // convice tasm to modify code...
|
|
||||||
movl [eax],ebx
|
|
||||||
|
|
||||||
// eax aligned colormap
|
|
||||||
// ebx aligned colormap
|
|
||||||
// ecx,edx scratch
|
|
||||||
// esi virtual source
|
|
||||||
// edi moving destination pointer
|
|
||||||
// ebp frac
|
|
||||||
|
|
||||||
movl ecx,ebp // begin calculating first pixel
|
|
||||||
addl ebp,ebx // advance frac pointer
|
|
||||||
shrl ecx,25 // finish calculation for first pixel
|
|
||||||
movl edx,ebp // begin calculating second pixel
|
|
||||||
addl ebp,ebx // advance frac pointer
|
|
||||||
shrl edx,25 // finish calculation for second pixel
|
|
||||||
movl eax,[_dc_colormap]
|
|
||||||
movl ebx,eax
|
|
||||||
movb al,[esi+ecx] // get first pixel
|
|
||||||
movb bl,[esi+edx] // get second pixel
|
|
||||||
movb al,[eax] // color translate first pixel
|
|
||||||
movb bl,[ebx] // color translate second pixel
|
|
||||||
|
|
||||||
testl [pixelcount],0fffffffeh
|
|
||||||
jnz doubleloop // at least two pixels to map
|
|
||||||
jmp checklast
|
|
||||||
|
|
||||||
.align 16
|
|
||||||
doubleloop:
|
|
||||||
movl ecx,ebp // begin calculating third pixel
|
|
||||||
patch1:
|
|
||||||
addl ebp,12345678h // advance frac pointer
|
|
||||||
movb [edi],al // write first pixel
|
|
||||||
shrl ecx,25 // finish calculation for third pixel
|
|
||||||
movl edx,ebp // begin calculating fourth pixel
|
|
||||||
patch2:
|
|
||||||
addl ebp,12345678h // advance frac pointer
|
|
||||||
movl [edi+SCREENWIDTH],bl // write second pixel
|
|
||||||
shrl edx,25 // finish calculation for fourth pixel
|
|
||||||
movb al,[esi+ecx] // get third pixel
|
|
||||||
addl edi,SCREENWIDTH*2 // advance to third pixel destination
|
|
||||||
movb bl,[esi+edx] // get fourth pixel
|
|
||||||
decl [loopcount] // done with loop?
|
|
||||||
movb al,[eax] // color translate third pixel
|
|
||||||
movb bl,[ebx] // color translate fourth pixel
|
|
||||||
jnz doubleloop
|
|
||||||
|
|
||||||
// check for final pixel
|
|
||||||
checklast:
|
|
||||||
testl [pixelcount],1
|
|
||||||
jz done
|
|
||||||
movb [edi],al // write final pixel
|
|
||||||
|
|
||||||
done:
|
|
||||||
popad
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//================
|
|
||||||
//
|
|
||||||
// R_DrawSpan
|
|
||||||
//
|
|
||||||
// Horizontal texture mapping
|
|
||||||
//
|
|
||||||
//================
|
|
||||||
|
|
||||||
|
|
||||||
.align 16
|
|
||||||
.globl _R_DrawSpan
|
|
||||||
_R_DrawSpan:
|
|
||||||
pushad
|
|
||||||
|
|
||||||
//
|
|
||||||
// find loop count
|
|
||||||
//
|
|
||||||
movl eax,[_ds_x2]
|
|
||||||
incl eax
|
|
||||||
subl eax,[_ds_x1] // pixel count
|
|
||||||
movl [pixelcount],eax // save for final pixel
|
|
||||||
js hdone // nothing to scale
|
|
||||||
shrl eax,1 // double pixel count
|
|
||||||
movl [loopcount],eax
|
|
||||||
|
|
||||||
//
|
|
||||||
// build composite position
|
|
||||||
//
|
|
||||||
movl ebp,[_ds_xfrac]
|
|
||||||
shll ebp,10
|
|
||||||
andl ebp,0ffff0000h
|
|
||||||
movl eax,[_ds_yfrac]
|
|
||||||
shrl eax,6
|
|
||||||
andl eax,0ffffh
|
|
||||||
orl ebp,eax
|
|
||||||
|
|
||||||
movl esi,[_ds_source]
|
|
||||||
|
|
||||||
//
|
|
||||||
// calculate screen dest
|
|
||||||
//
|
|
||||||
movl edi,[_ds_y]
|
|
||||||
movl edi,[_ylookup+edi*4]
|
|
||||||
movl eax,[_ds_x1]
|
|
||||||
addl edi,[_columnofs+eax*4]
|
|
||||||
|
|
||||||
//
|
|
||||||
// build composite step
|
|
||||||
//
|
|
||||||
movl ebx,[_ds_xstep]
|
|
||||||
shll ebx,10
|
|
||||||
andl ebx,0ffff0000h
|
|
||||||
movl eax,[_ds_ystep]
|
|
||||||
shrl eax,6
|
|
||||||
andl eax,0ffffh
|
|
||||||
orl ebx,eax
|
|
||||||
|
|
||||||
movl eax,OFFSET hpatch1+2 // convice tasm to modify code...
|
|
||||||
movl [eax],ebx
|
|
||||||
movl eax,OFFSET hpatch2+2 // convice tasm to modify code...
|
|
||||||
movl [eax],ebx
|
|
||||||
|
|
||||||
// eax aligned colormap
|
|
||||||
// ebx aligned colormap
|
|
||||||
// ecx,edx scratch
|
|
||||||
// esi virtual source
|
|
||||||
// edi moving destination pointer
|
|
||||||
// ebp frac
|
|
||||||
|
|
||||||
shldl ecx,ebp,22 // begin calculating third pixel (y units)
|
|
||||||
shldl ecx,ebp,6 // begin calculating third pixel (x units)
|
|
||||||
addl ebp,ebx // advance frac pointer
|
|
||||||
andl ecx,4095 // finish calculation for third pixel
|
|
||||||
shldl edx,ebp,22 // begin calculating fourth pixel (y units)
|
|
||||||
shldl edx,ebp,6 // begin calculating fourth pixel (x units)
|
|
||||||
addl ebp,ebx // advance frac pointer
|
|
||||||
andl edx,4095 // finish calculation for fourth pixel
|
|
||||||
movl eax,[_ds_colormap]
|
|
||||||
movl ebx,eax
|
|
||||||
movb al,[esi+ecx] // get first pixel
|
|
||||||
movb bl,[esi+edx] // get second pixel
|
|
||||||
movb al,[eax] // color translate first pixel
|
|
||||||
movb bl,[ebx] // color translate second pixel
|
|
||||||
|
|
||||||
testl [pixelcount],0fffffffeh
|
|
||||||
jnz hdoubleloop // at least two pixels to map
|
|
||||||
jmp hchecklast
|
|
||||||
|
|
||||||
|
|
||||||
.align 16
|
|
||||||
hdoubleloop:
|
|
||||||
shldl ecx,ebp,22 // begin calculating third pixel (y units)
|
|
||||||
shldl ecx,ebp,6 // begin calculating third pixel (x units)
|
|
||||||
hpatch1:
|
|
||||||
addl ebp,12345678h // advance frac pointer
|
|
||||||
movb [edi],al // write first pixel
|
|
||||||
andl ecx,4095 // finish calculation for third pixel
|
|
||||||
shldl edx,ebp,22 // begin calculating fourth pixel (y units)
|
|
||||||
shldl edx,ebp,6 // begin calculating fourth pixel (x units)
|
|
||||||
hpatch2:
|
|
||||||
addl ebp,12345678h // advance frac pointer
|
|
||||||
movb [edi+1],bl // write second pixel
|
|
||||||
andl edx,4095 // finish calculation for fourth pixel
|
|
||||||
movb al,[esi+ecx] // get third pixel
|
|
||||||
addl edi,2 // advance to third pixel destination
|
|
||||||
movb bl,[esi+edx] // get fourth pixel
|
|
||||||
decl [loopcount] // done with loop?
|
|
||||||
movb al,[eax] // color translate third pixel
|
|
||||||
movb bl,[ebx] // color translate fourth pixel
|
|
||||||
jnz hdoubleloop
|
|
||||||
|
|
||||||
// check for final pixel
|
|
||||||
hchecklast:
|
|
||||||
testl [pixelcount],1
|
|
||||||
jz hdone
|
|
||||||
movb [edi],al // write final pixel
|
|
||||||
|
|
||||||
hdone:
|
|
||||||
popad
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//====================================================
|
|
||||||
// fpfunc.S as of January 10th, 1997 (parts)
|
|
||||||
|
|
||||||
#ifdef i386
|
|
||||||
|
|
||||||
.text
|
|
||||||
.align 4
|
|
||||||
.globl _FixedMul
|
|
||||||
_FixedMul:
|
|
||||||
pushl %ebp
|
|
||||||
movl %esp,%ebp
|
|
||||||
movl 8(%ebp),%eax
|
|
||||||
imull 12(%ebp)
|
|
||||||
shrdl $16,%edx,%eax
|
|
||||||
popl %ebp
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
.align 4
|
|
||||||
.globl _FixedDiv2
|
|
||||||
_FixedDiv2:
|
|
||||||
pushl %ebp
|
|
||||||
movl %esp,%ebp
|
|
||||||
movl 8(%ebp),%eax
|
|
||||||
cdq
|
|
||||||
shldl $16,%eax,%edx
|
|
||||||
sall $16,%eax
|
|
||||||
idivl 12(%ebp)
|
|
||||||
popl %ebp
|
|
||||||
ret
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
303
docs/classes.txt
303
docs/classes.txt
|
@ -1,303 +0,0 @@
|
||||||
ZDoom 1.19 offers a partial conversion of the Doom code to C++. As such, some
|
|
||||||
functions and classes have been encapsulated in classes. This document tries
|
|
||||||
to give an overview of those classes and how to use them.
|
|
||||||
|
|
||||||
Command line parameters
|
|
||||||
=======================
|
|
||||||
|
|
||||||
Previous versions of ZDoom kept the command line in the myargv and myargc
|
|
||||||
global variables. This version uses a single variable, Args, of type DArgs.
|
|
||||||
This class is defined in m_argv.h and implemented in m_argv.cpp. The three
|
|
||||||
most important functions are:
|
|
||||||
|
|
||||||
int DArgs::CheckParm (const char *check) const;
|
|
||||||
|
|
||||||
Checks to see if a parameter exists. If it does, it's index number is
|
|
||||||
returned. Use the GetArg() method to retrieve an arguments specified
|
|
||||||
after it.
|
|
||||||
|
|
||||||
char *DArgs::CheckValue (const char *check) const;
|
|
||||||
|
|
||||||
This is similar to CheckParm(), but it returns the value of the argument
|
|
||||||
immediately following parameter. If the parameter is not present, or it
|
|
||||||
has no argument, NULL is returned.
|
|
||||||
|
|
||||||
char *DArgs::GetArg (int index) const;
|
|
||||||
|
|
||||||
Retrieves the value of an argument. This is similar to argv[index].
|
|
||||||
|
|
||||||
For the other functions, check the implementation in m_argv.cpp to see what
|
|
||||||
they do.
|
|
||||||
|
|
||||||
Error messages
|
|
||||||
==============
|
|
||||||
|
|
||||||
There are two functions for reporting error conditions: I_Error() and
|
|
||||||
I_FatalError(). Use the first for errors that can be recovered from. It will
|
|
||||||
drop the user to the fullscreen console and print the message. Use the
|
|
||||||
second for error conditions that are much harder to recover from. It will
|
|
||||||
terminate the program and display the message.
|
|
||||||
|
|
||||||
Console commands
|
|
||||||
================
|
|
||||||
|
|
||||||
Adding new console commands is now very simple, compared to previous
|
|
||||||
versions of ZDoom. Registration is now completely automatic if you use the
|
|
||||||
BEGIN_COMMAND and END_COMMAND macros defined in c_dispatch.h. A simple
|
|
||||||
command could be implemented like this:
|
|
||||||
|
|
||||||
#include "c_dispatch.h"
|
|
||||||
|
|
||||||
BEGIN_COMMAND(hello)
|
|
||||||
{
|
|
||||||
Printf (PRINT_HIGH, "Hello, world!\n");
|
|
||||||
}
|
|
||||||
END_COMMAND(hello)
|
|
||||||
|
|
||||||
The parameter to the BEGIN_COMMAND and END_COMMAND macros is the name of
|
|
||||||
the command, as typed at the console (in this case, "hello"). You should use
|
|
||||||
the same name for both BEGIN_ and END_. You can access the arguments to the
|
|
||||||
command using argc and argv. If you want to know who activated the command,
|
|
||||||
m_Instigator is a pointer to the actor of the player who called it.
|
|
||||||
|
|
||||||
Console variables
|
|
||||||
=================
|
|
||||||
|
|
||||||
Adding new console variables is also similar. The c_cvars.h file contains
|
|
||||||
four macros related to using cvars:
|
|
||||||
|
|
||||||
CVAR (name, default, flags)
|
|
||||||
|
|
||||||
Declares a new console variable with the name "name" and default
|
|
||||||
value "default" and flags "flags". (See c_cvars.h for the different
|
|
||||||
flags). An example:
|
|
||||||
|
|
||||||
CVAR (var_friction, "1", CVAR_SERVERINFO);
|
|
||||||
|
|
||||||
EXTERN_CVAR (name)
|
|
||||||
|
|
||||||
Imports a cvar defined elsewhere. This just generates the code
|
|
||||||
"extern cvar_t name;", but you should still use this macro.
|
|
||||||
|
|
||||||
BEGIN_CUSTOM_CVAR (name, default, flags)
|
|
||||||
END_CUSTOM_CVAR (name)
|
|
||||||
|
|
||||||
Declares a cvar that performs some special action each time its value
|
|
||||||
changes. You should use a compound statement between the BEGIN_ and
|
|
||||||
END_ macros, just like with commands above. Any code between these
|
|
||||||
two macros can use "var" to access the associated cvar. Example:
|
|
||||||
|
|
||||||
BEGIN_CUSTOM_CVAR (splashfactor, "1.0", CVAR_SERVERINFO)
|
|
||||||
{
|
|
||||||
if (var.value <= 0.0f)
|
|
||||||
var.Set (1.0f);
|
|
||||||
else
|
|
||||||
selfthrustscale = 1.0f / var.value;
|
|
||||||
}
|
|
||||||
END_CUSTOM_CVAR (splashfactor)
|
|
||||||
|
|
||||||
This example also illustrates bounds checking for cvars. The basic
|
|
||||||
idea is:
|
|
||||||
|
|
||||||
if (variable is within range)
|
|
||||||
<do something with it>
|
|
||||||
else
|
|
||||||
<set it to something that is in range>
|
|
||||||
|
|
||||||
Calling Set() will automatically execute the code block again, so you
|
|
||||||
must make sure that you do nothing but reset the value of the cvar if
|
|
||||||
it's out of range. The code block will also be executed at program
|
|
||||||
startup when the cvar is constructed.
|
|
||||||
|
|
||||||
The DObject class hierarchy
|
|
||||||
===========================
|
|
||||||
|
|
||||||
Most classes in ZDoom 1.18 are descendants of the DObject class. This class
|
|
||||||
provides basic typechecking and serialization functionality. In a future
|
|
||||||
version of ZDoom, it will also provide a means to interface C++ code with
|
|
||||||
DoomScript. If you want to be able to perform type-checking on a class, save
|
|
||||||
it to disk, or access it from DoomScript (in a later version), it should be
|
|
||||||
a descendant of DObject.
|
|
||||||
|
|
||||||
The basic features of DObject require that you use some of the macros in
|
|
||||||
dobject.h: DECLARE_CLASS, IMPLEMENT_CLASS, DECLARE_SERIAL, and
|
|
||||||
IMPLEMENT_SERIAL. For a class that won't be saved to disk, do this:
|
|
||||||
|
|
||||||
class MyClass : public DObject
|
|
||||||
{
|
|
||||||
DECLARE_CLASS (MyClass, DObject)
|
|
||||||
public:
|
|
||||||
...
|
|
||||||
Rest of class definition
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
Then someplace else, where you define the class, add this line:
|
|
||||||
|
|
||||||
IMPLEMENT_CLASS (MyClass, DObject)
|
|
||||||
|
|
||||||
(You should be sure to replace MyClass with the actual name of your class
|
|
||||||
and DObject with the name of your class's superclass.)
|
|
||||||
|
|
||||||
For a class that can be saved to disk (ie, a serializable class), use
|
|
||||||
DECLARE_SERIAL and IMPLEMENT_SERIAL instead. Serializable classes require
|
|
||||||
default constructors. If you don't want anybody to be able to create an
|
|
||||||
instance of the class using the default constructor, you can hide it
|
|
||||||
inside the private portion of the class definition:
|
|
||||||
|
|
||||||
...
|
|
||||||
private:
|
|
||||||
MyClass () {}
|
|
||||||
...
|
|
||||||
|
|
||||||
Serializable classes also require that you define a Serialize() method.
|
|
||||||
This function should call the superclass's Serialize() method and then
|
|
||||||
either store or extract the fields for the class. (Whenever you change
|
|
||||||
the contents of a class, be sure to change its accompanying Serialize()
|
|
||||||
method.) A generic Serialize() looks like this:
|
|
||||||
|
|
||||||
void MyClass::Serialize (FArchive &arc)
|
|
||||||
{
|
|
||||||
Super::Serialize (arc);
|
|
||||||
if (arc.IsStoring ())
|
|
||||||
{
|
|
||||||
arc << m_field1 << m_field2 << m_field3 << ... ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
arc >> m_field1 >> m_field2 >> m_field3 >> ... ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
There are also some structs that use some serialization code that you
|
|
||||||
should be sure to change if you change the structs. The code for
|
|
||||||
serializing sector_t and line_t can be found in P_SerializeWorld() in
|
|
||||||
p_saveg.cpp. The code for serializing player_t is in p_user.cpp as
|
|
||||||
player_t::Serialize().
|
|
||||||
|
|
||||||
To determine the type of an object, you can use the IsA() and IsKindOf()
|
|
||||||
methods of DObject. IsA() tests if the object is an instance of a
|
|
||||||
specific type of class, and is probably not what you want. IsKindOf()
|
|
||||||
checks if an object is a specific type of class or one of its
|
|
||||||
descendants. Example: Suppose anActor points to an instance of AActor.
|
|
||||||
(anActor->IsA (RUNTIME_CLASS(DThinker))) will return false because AActor
|
|
||||||
is not the same as DThinker, but (anActor->IsKindOf
|
|
||||||
(RUNTIME_CLASS(DThinker))) will return true because AActor is a
|
|
||||||
descendant of DThinker.
|
|
||||||
|
|
||||||
Pointer cleanup
|
|
||||||
===============
|
|
||||||
|
|
||||||
Whenever an object is destroyed, ZDoom will attempt to NULL any pointers that
|
|
||||||
pointed to that object. This eliminates various anomalies caused by trying to
|
|
||||||
reference stale pointers. This mechanism is not entirely transparent and
|
|
||||||
requires some work on your part. When you create a subclass of DObject that
|
|
||||||
contains pointers, you should use the IMPLEMENT_POINTY_SERIAL or
|
|
||||||
IMPLEMENT_POINTY_CLASS macros instead of IMPLEMENT_SERIAL or IMPLEMENT_CLASS.
|
|
||||||
Following the macro, you list each element of the class that points to a
|
|
||||||
DObject (or a subclass of it). If the pointer points to something that is not
|
|
||||||
a DObject (such as a char *), you do not need to include it in this list.
|
|
||||||
After you list all the pointers, use the END_POINTERS macro.
|
|
||||||
|
|
||||||
The implementation for the AActor class looks like this:
|
|
||||||
|
|
||||||
IMPLEMENT_POINTY_SERIAL (AActor, DThinker)
|
|
||||||
DECLARE_POINTER (target)
|
|
||||||
DECLARE_POINTER (lastenemy)
|
|
||||||
DECLARE_POINTER (tracer)
|
|
||||||
DECLARE_POINTER (goal)
|
|
||||||
END_POINTERS
|
|
||||||
|
|
||||||
If you add pointers to any class, you need to update this list accordingly.
|
|
||||||
The player class uses a hack, because it is not derived from DObject, to
|
|
||||||
clear pointers. See player_t::FixPointers() in p_user.cpp if you add any
|
|
||||||
pointers to player_t.
|
|
||||||
|
|
||||||
When you want to destroy any object derived from DThinker (this includes all
|
|
||||||
actors), call that object's Destroy() method. Do not use delete, because it
|
|
||||||
is not guaranteed to perform all necessary cleanup. If the object is not
|
|
||||||
derived from DThinker, however, you can safely call delete on it.
|
|
||||||
|
|
||||||
As an example, if you have an instance of AActor called actor, and you want
|
|
||||||
to get rid of it, use:
|
|
||||||
actor->Destroy ();
|
|
||||||
|
|
||||||
If you have an instance of DCanvas called canvas and want to get rid of it,
|
|
||||||
either of the following will work (but not both):
|
|
||||||
canvas->Destroy (); or
|
|
||||||
delete canvas;
|
|
||||||
|
|
||||||
Thinkers
|
|
||||||
========
|
|
||||||
|
|
||||||
Almost everything that can affect the appearance of the world is implemented
|
|
||||||
as a subclass of DThinker. The important base classes are:
|
|
||||||
|
|
||||||
DPolyAction
|
|
||||||
|
|
||||||
A polyobject that is doing something (DRotatePoly, DMovePoly, or
|
|
||||||
DPolyDoor).
|
|
||||||
|
|
||||||
DSectorEffect
|
|
||||||
|
|
||||||
An effect that occurs inside a certain sector. This is further broken
|
|
||||||
up into DLighting (for lighting changes) and DMover (for floor/
|
|
||||||
ceiling movement). DMover is also subclassed into DMovingFloor (for
|
|
||||||
moving floors only) and DMovingCeiling (for moving ceilings only).
|
|
||||||
For effects that move both the floor and ceiling, subclass DMover
|
|
||||||
and have a look at either DPillar or DElevator.
|
|
||||||
|
|
||||||
AActor
|
|
||||||
|
|
||||||
This is probably the most important. All players, monsters, items,
|
|
||||||
ammo, weapons, and anything else that appears as a sprite in the
|
|
||||||
world is an instance of AActor. This is nowhere near as encapsulated
|
|
||||||
as I would like it to be because of the necessity to maintain
|
|
||||||
compatibility with DeHackEd patches until DoomScript is done. This
|
|
||||||
means that there is no easy way to subclass AActor and spawn an
|
|
||||||
instance of the subclass in the map. I don't like it, but it's a step
|
|
||||||
in the right direction.
|
|
||||||
|
|
||||||
To find all instances of a specific type of thinker in a map, you can use the
|
|
||||||
TThinkerIterator template class. It's usage is simple:
|
|
||||||
|
|
||||||
TThinkerIterator<TypeOfClass> iterator;
|
|
||||||
TypeOfClass *object;
|
|
||||||
|
|
||||||
while ( (object = iterator.Next ()) )
|
|
||||||
{
|
|
||||||
// do something with the object
|
|
||||||
}
|
|
||||||
|
|
||||||
AActor methods
|
|
||||||
==============
|
|
||||||
|
|
||||||
A few of the functions that operate on actors have been moved inside the
|
|
||||||
AActor class:
|
|
||||||
|
|
||||||
P_ClearTidHashes() -> AActor::ClearTIDHashes()
|
|
||||||
P_AddMobjToHash() -> AActor::AddToHash()
|
|
||||||
P_RemoveMobjFromHash() -> AActor::RemoveFromHash()
|
|
||||||
P_FindMobjByTid() -> AActor::FindByTID()
|
|
||||||
P_FindGoal() -> AActor::FindGoal()
|
|
||||||
|
|
||||||
P_UnsetThingPosition() -> AActor::UnlinkFromWorld()
|
|
||||||
P_SetThingPosition() -> AActor::LinkToWorld()
|
|
||||||
|
|
||||||
AActor::SetOrigin() has also been introduced. It simply moves the actor to
|
|
||||||
a specific location on the map without performing any collision detection.
|
|
||||||
|
|
||||||
A bit more on serialization
|
|
||||||
===========================
|
|
||||||
|
|
||||||
The serialization mechanism is a fairly standard, yet powerful, framework
|
|
||||||
that can save a bunch of objects to disk and properly maintain pointers
|
|
||||||
between them. When you store a pointer to an object, the object will also be
|
|
||||||
stored to disk if it hasn't been already. When you read the pointer, the
|
|
||||||
object it points to will also be read from disk if it hasn't been already.
|
|
||||||
This allows pointers to objects to be preserved without any extra effort on
|
|
||||||
your part. Pointers to something other than a DObject or one of its
|
|
||||||
descendents need to be implemented specially by overloading operator << (see
|
|
||||||
info.h for a few of these). If you're not sure how serialization works, take
|
|
||||||
a look at some of the serialization functions for the existing classes by
|
|
||||||
grepping through the source for "::Serialize" (without the quotes).
|
|
756
docs/colors.txt
756
docs/colors.txt
|
@ -1,756 +0,0 @@
|
||||||
! $XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp $
|
|
||||||
|
|
||||||
255 250 250 snow
|
|
||||||
248 248 255 ghost white
|
|
||||||
248 248 255 GhostWhite
|
|
||||||
245 245 245 white smoke
|
|
||||||
245 245 245 WhiteSmoke
|
|
||||||
220 220 220 gainsboro
|
|
||||||
255 250 240 floral white
|
|
||||||
255 250 240 FloralWhite
|
|
||||||
253 245 230 old lace
|
|
||||||
253 245 230 OldLace
|
|
||||||
250 240 230 linen
|
|
||||||
250 235 215 antique white
|
|
||||||
250 235 215 AntiqueWhite
|
|
||||||
255 239 213 papaya whip
|
|
||||||
255 239 213 PapayaWhip
|
|
||||||
255 235 205 blanched almond
|
|
||||||
255 235 205 BlanchedAlmond
|
|
||||||
255 228 196 bisque
|
|
||||||
255 218 185 peach puff
|
|
||||||
255 218 185 PeachPuff
|
|
||||||
255 222 173 navajo white
|
|
||||||
255 222 173 NavajoWhite
|
|
||||||
255 228 181 moccasin
|
|
||||||
255 248 220 cornsilk
|
|
||||||
255 255 240 ivory
|
|
||||||
255 250 205 lemon chiffon
|
|
||||||
255 250 205 LemonChiffon
|
|
||||||
255 245 238 seashell
|
|
||||||
240 255 240 honeydew
|
|
||||||
245 255 250 mint cream
|
|
||||||
245 255 250 MintCream
|
|
||||||
240 255 255 azure
|
|
||||||
240 248 255 alice blue
|
|
||||||
240 248 255 AliceBlue
|
|
||||||
230 230 250 lavender
|
|
||||||
255 240 245 lavender blush
|
|
||||||
255 240 245 LavenderBlush
|
|
||||||
255 228 225 misty rose
|
|
||||||
255 228 225 MistyRose
|
|
||||||
255 255 255 white
|
|
||||||
0 0 0 black
|
|
||||||
47 79 79 dark slate gray
|
|
||||||
47 79 79 DarkSlateGray
|
|
||||||
47 79 79 dark slate grey
|
|
||||||
47 79 79 DarkSlateGrey
|
|
||||||
105 105 105 dim gray
|
|
||||||
105 105 105 DimGray
|
|
||||||
105 105 105 dim grey
|
|
||||||
105 105 105 DimGrey
|
|
||||||
112 128 144 slate gray
|
|
||||||
112 128 144 SlateGray
|
|
||||||
112 128 144 slate grey
|
|
||||||
112 128 144 SlateGrey
|
|
||||||
119 136 153 light slate gray
|
|
||||||
119 136 153 LightSlateGray
|
|
||||||
119 136 153 light slate grey
|
|
||||||
119 136 153 LightSlateGrey
|
|
||||||
190 190 190 gray
|
|
||||||
190 190 190 grey
|
|
||||||
211 211 211 light grey
|
|
||||||
211 211 211 LightGrey
|
|
||||||
211 211 211 light gray
|
|
||||||
211 211 211 LightGray
|
|
||||||
25 25 112 midnight blue
|
|
||||||
25 25 112 MidnightBlue
|
|
||||||
0 0 128 navy
|
|
||||||
0 0 128 navy blue
|
|
||||||
0 0 128 NavyBlue
|
|
||||||
100 149 237 cornflower blue
|
|
||||||
100 149 237 CornflowerBlue
|
|
||||||
72 61 139 dark slate blue
|
|
||||||
72 61 139 DarkSlateBlue
|
|
||||||
106 90 205 slate blue
|
|
||||||
106 90 205 SlateBlue
|
|
||||||
123 104 238 medium slate blue
|
|
||||||
123 104 238 MediumSlateBlue
|
|
||||||
132 112 255 light slate blue
|
|
||||||
132 112 255 LightSlateBlue
|
|
||||||
0 0 205 medium blue
|
|
||||||
0 0 205 MediumBlue
|
|
||||||
65 105 225 royal blue
|
|
||||||
65 105 225 RoyalBlue
|
|
||||||
0 0 255 blue
|
|
||||||
30 144 255 dodger blue
|
|
||||||
30 144 255 DodgerBlue
|
|
||||||
0 191 255 deep sky blue
|
|
||||||
0 191 255 DeepSkyBlue
|
|
||||||
135 206 235 sky blue
|
|
||||||
135 206 235 SkyBlue
|
|
||||||
135 206 250 light sky blue
|
|
||||||
135 206 250 LightSkyBlue
|
|
||||||
70 130 180 steel blue
|
|
||||||
70 130 180 SteelBlue
|
|
||||||
176 196 222 light steel blue
|
|
||||||
176 196 222 LightSteelBlue
|
|
||||||
173 216 230 light blue
|
|
||||||
173 216 230 LightBlue
|
|
||||||
176 224 230 powder blue
|
|
||||||
176 224 230 PowderBlue
|
|
||||||
175 238 238 pale turquoise
|
|
||||||
175 238 238 PaleTurquoise
|
|
||||||
0 206 209 dark turquoise
|
|
||||||
0 206 209 DarkTurquoise
|
|
||||||
72 209 204 medium turquoise
|
|
||||||
72 209 204 MediumTurquoise
|
|
||||||
64 224 208 turquoise
|
|
||||||
0 255 255 cyan
|
|
||||||
224 255 255 light cyan
|
|
||||||
224 255 255 LightCyan
|
|
||||||
95 158 160 cadet blue
|
|
||||||
95 158 160 CadetBlue
|
|
||||||
102 205 170 medium aquamarine
|
|
||||||
102 205 170 MediumAquamarine
|
|
||||||
127 255 212 aquamarine
|
|
||||||
0 100 0 dark green
|
|
||||||
0 100 0 DarkGreen
|
|
||||||
85 107 47 dark olive green
|
|
||||||
85 107 47 DarkOliveGreen
|
|
||||||
143 188 143 dark sea green
|
|
||||||
143 188 143 DarkSeaGreen
|
|
||||||
46 139 87 sea green
|
|
||||||
46 139 87 SeaGreen
|
|
||||||
60 179 113 medium sea green
|
|
||||||
60 179 113 MediumSeaGreen
|
|
||||||
32 178 170 light sea green
|
|
||||||
32 178 170 LightSeaGreen
|
|
||||||
152 251 152 pale green
|
|
||||||
152 251 152 PaleGreen
|
|
||||||
0 255 127 spring green
|
|
||||||
0 255 127 SpringGreen
|
|
||||||
124 252 0 lawn green
|
|
||||||
124 252 0 LawnGreen
|
|
||||||
0 255 0 green
|
|
||||||
127 255 0 chartreuse
|
|
||||||
0 250 154 medium spring green
|
|
||||||
0 250 154 MediumSpringGreen
|
|
||||||
173 255 47 green yellow
|
|
||||||
173 255 47 GreenYellow
|
|
||||||
50 205 50 lime green
|
|
||||||
50 205 50 LimeGreen
|
|
||||||
154 205 50 yellow green
|
|
||||||
154 205 50 YellowGreen
|
|
||||||
34 139 34 forest green
|
|
||||||
34 139 34 ForestGreen
|
|
||||||
107 142 35 olive drab
|
|
||||||
107 142 35 OliveDrab
|
|
||||||
189 183 107 dark khaki
|
|
||||||
189 183 107 DarkKhaki
|
|
||||||
240 230 140 khaki
|
|
||||||
238 232 170 pale goldenrod
|
|
||||||
238 232 170 PaleGoldenrod
|
|
||||||
250 250 210 light goldenrod yellow
|
|
||||||
250 250 210 LightGoldenrodYellow
|
|
||||||
255 255 224 light yellow
|
|
||||||
255 255 224 LightYellow
|
|
||||||
255 255 0 yellow
|
|
||||||
255 215 0 gold
|
|
||||||
238 221 130 light goldenrod
|
|
||||||
238 221 130 LightGoldenrod
|
|
||||||
218 165 32 goldenrod
|
|
||||||
184 134 11 dark goldenrod
|
|
||||||
184 134 11 DarkGoldenrod
|
|
||||||
188 143 143 rosy brown
|
|
||||||
188 143 143 RosyBrown
|
|
||||||
205 92 92 indian red
|
|
||||||
205 92 92 IndianRed
|
|
||||||
139 69 19 saddle brown
|
|
||||||
139 69 19 SaddleBrown
|
|
||||||
160 82 45 sienna
|
|
||||||
205 133 63 peru
|
|
||||||
222 184 135 burlywood
|
|
||||||
245 245 220 beige
|
|
||||||
245 222 179 wheat
|
|
||||||
244 164 96 sandy brown
|
|
||||||
244 164 96 SandyBrown
|
|
||||||
210 180 140 tan
|
|
||||||
210 105 30 chocolate
|
|
||||||
178 34 34 firebrick
|
|
||||||
165 42 42 brown
|
|
||||||
233 150 122 dark salmon
|
|
||||||
233 150 122 DarkSalmon
|
|
||||||
250 128 114 salmon
|
|
||||||
255 160 122 light salmon
|
|
||||||
255 160 122 LightSalmon
|
|
||||||
255 165 0 orange
|
|
||||||
255 140 0 dark orange
|
|
||||||
255 140 0 DarkOrange
|
|
||||||
255 127 80 coral
|
|
||||||
240 128 128 light coral
|
|
||||||
240 128 128 LightCoral
|
|
||||||
255 99 71 tomato
|
|
||||||
255 69 0 orange red
|
|
||||||
255 69 0 OrangeRed
|
|
||||||
255 0 0 red
|
|
||||||
255 105 180 hot pink
|
|
||||||
255 105 180 HotPink
|
|
||||||
255 20 147 deep pink
|
|
||||||
255 20 147 DeepPink
|
|
||||||
255 192 203 pink
|
|
||||||
255 182 193 light pink
|
|
||||||
255 182 193 LightPink
|
|
||||||
219 112 147 pale violet red
|
|
||||||
219 112 147 PaleVioletRed
|
|
||||||
176 48 96 maroon
|
|
||||||
199 21 133 medium violet red
|
|
||||||
199 21 133 MediumVioletRed
|
|
||||||
208 32 144 violet red
|
|
||||||
208 32 144 VioletRed
|
|
||||||
255 0 255 magenta
|
|
||||||
238 130 238 violet
|
|
||||||
221 160 221 plum
|
|
||||||
218 112 214 orchid
|
|
||||||
186 85 211 medium orchid
|
|
||||||
186 85 211 MediumOrchid
|
|
||||||
153 50 204 dark orchid
|
|
||||||
153 50 204 DarkOrchid
|
|
||||||
148 0 211 dark violet
|
|
||||||
148 0 211 DarkViolet
|
|
||||||
138 43 226 blue violet
|
|
||||||
138 43 226 BlueViolet
|
|
||||||
160 32 240 purple
|
|
||||||
147 112 219 medium purple
|
|
||||||
147 112 219 MediumPurple
|
|
||||||
216 191 216 thistle
|
|
||||||
255 250 250 snow1
|
|
||||||
238 233 233 snow2
|
|
||||||
205 201 201 snow3
|
|
||||||
139 137 137 snow4
|
|
||||||
255 245 238 seashell1
|
|
||||||
238 229 222 seashell2
|
|
||||||
205 197 191 seashell3
|
|
||||||
139 134 130 seashell4
|
|
||||||
255 239 219 AntiqueWhite1
|
|
||||||
238 223 204 AntiqueWhite2
|
|
||||||
205 192 176 AntiqueWhite3
|
|
||||||
139 131 120 AntiqueWhite4
|
|
||||||
255 228 196 bisque1
|
|
||||||
238 213 183 bisque2
|
|
||||||
205 183 158 bisque3
|
|
||||||
139 125 107 bisque4
|
|
||||||
255 218 185 PeachPuff1
|
|
||||||
238 203 173 PeachPuff2
|
|
||||||
205 175 149 PeachPuff3
|
|
||||||
139 119 101 PeachPuff4
|
|
||||||
255 222 173 NavajoWhite1
|
|
||||||
238 207 161 NavajoWhite2
|
|
||||||
205 179 139 NavajoWhite3
|
|
||||||
139 121 94 NavajoWhite4
|
|
||||||
255 250 205 LemonChiffon1
|
|
||||||
238 233 191 LemonChiffon2
|
|
||||||
205 201 165 LemonChiffon3
|
|
||||||
139 137 112 LemonChiffon4
|
|
||||||
255 248 220 cornsilk1
|
|
||||||
238 232 205 cornsilk2
|
|
||||||
205 200 177 cornsilk3
|
|
||||||
139 136 120 cornsilk4
|
|
||||||
255 255 240 ivory1
|
|
||||||
238 238 224 ivory2
|
|
||||||
205 205 193 ivory3
|
|
||||||
139 139 131 ivory4
|
|
||||||
240 255 240 honeydew1
|
|
||||||
224 238 224 honeydew2
|
|
||||||
193 205 193 honeydew3
|
|
||||||
131 139 131 honeydew4
|
|
||||||
255 240 245 LavenderBlush1
|
|
||||||
238 224 229 LavenderBlush2
|
|
||||||
205 193 197 LavenderBlush3
|
|
||||||
139 131 134 LavenderBlush4
|
|
||||||
255 228 225 MistyRose1
|
|
||||||
238 213 210 MistyRose2
|
|
||||||
205 183 181 MistyRose3
|
|
||||||
139 125 123 MistyRose4
|
|
||||||
240 255 255 azure1
|
|
||||||
224 238 238 azure2
|
|
||||||
193 205 205 azure3
|
|
||||||
131 139 139 azure4
|
|
||||||
131 111 255 SlateBlue1
|
|
||||||
122 103 238 SlateBlue2
|
|
||||||
105 89 205 SlateBlue3
|
|
||||||
71 60 139 SlateBlue4
|
|
||||||
72 118 255 RoyalBlue1
|
|
||||||
67 110 238 RoyalBlue2
|
|
||||||
58 95 205 RoyalBlue3
|
|
||||||
39 64 139 RoyalBlue4
|
|
||||||
0 0 255 blue1
|
|
||||||
0 0 238 blue2
|
|
||||||
0 0 205 blue3
|
|
||||||
0 0 139 blue4
|
|
||||||
30 144 255 DodgerBlue1
|
|
||||||
28 134 238 DodgerBlue2
|
|
||||||
24 116 205 DodgerBlue3
|
|
||||||
16 78 139 DodgerBlue4
|
|
||||||
99 184 255 SteelBlue1
|
|
||||||
92 172 238 SteelBlue2
|
|
||||||
79 148 205 SteelBlue3
|
|
||||||
54 100 139 SteelBlue4
|
|
||||||
0 191 255 DeepSkyBlue1
|
|
||||||
0 178 238 DeepSkyBlue2
|
|
||||||
0 154 205 DeepSkyBlue3
|
|
||||||
0 104 139 DeepSkyBlue4
|
|
||||||
135 206 255 SkyBlue1
|
|
||||||
126 192 238 SkyBlue2
|
|
||||||
108 166 205 SkyBlue3
|
|
||||||
74 112 139 SkyBlue4
|
|
||||||
176 226 255 LightSkyBlue1
|
|
||||||
164 211 238 LightSkyBlue2
|
|
||||||
141 182 205 LightSkyBlue3
|
|
||||||
96 123 139 LightSkyBlue4
|
|
||||||
198 226 255 SlateGray1
|
|
||||||
185 211 238 SlateGray2
|
|
||||||
159 182 205 SlateGray3
|
|
||||||
108 123 139 SlateGray4
|
|
||||||
202 225 255 LightSteelBlue1
|
|
||||||
188 210 238 LightSteelBlue2
|
|
||||||
162 181 205 LightSteelBlue3
|
|
||||||
110 123 139 LightSteelBlue4
|
|
||||||
191 239 255 LightBlue1
|
|
||||||
178 223 238 LightBlue2
|
|
||||||
154 192 205 LightBlue3
|
|
||||||
104 131 139 LightBlue4
|
|
||||||
224 255 255 LightCyan1
|
|
||||||
209 238 238 LightCyan2
|
|
||||||
180 205 205 LightCyan3
|
|
||||||
122 139 139 LightCyan4
|
|
||||||
187 255 255 PaleTurquoise1
|
|
||||||
174 238 238 PaleTurquoise2
|
|
||||||
150 205 205 PaleTurquoise3
|
|
||||||
102 139 139 PaleTurquoise4
|
|
||||||
152 245 255 CadetBlue1
|
|
||||||
142 229 238 CadetBlue2
|
|
||||||
122 197 205 CadetBlue3
|
|
||||||
83 134 139 CadetBlue4
|
|
||||||
0 245 255 turquoise1
|
|
||||||
0 229 238 turquoise2
|
|
||||||
0 197 205 turquoise3
|
|
||||||
0 134 139 turquoise4
|
|
||||||
0 255 255 cyan1
|
|
||||||
0 238 238 cyan2
|
|
||||||
0 205 205 cyan3
|
|
||||||
0 139 139 cyan4
|
|
||||||
151 255 255 DarkSlateGray1
|
|
||||||
141 238 238 DarkSlateGray2
|
|
||||||
121 205 205 DarkSlateGray3
|
|
||||||
82 139 139 DarkSlateGray4
|
|
||||||
127 255 212 aquamarine1
|
|
||||||
118 238 198 aquamarine2
|
|
||||||
102 205 170 aquamarine3
|
|
||||||
69 139 116 aquamarine4
|
|
||||||
193 255 193 DarkSeaGreen1
|
|
||||||
180 238 180 DarkSeaGreen2
|
|
||||||
155 205 155 DarkSeaGreen3
|
|
||||||
105 139 105 DarkSeaGreen4
|
|
||||||
84 255 159 SeaGreen1
|
|
||||||
78 238 148 SeaGreen2
|
|
||||||
67 205 128 SeaGreen3
|
|
||||||
46 139 87 SeaGreen4
|
|
||||||
154 255 154 PaleGreen1
|
|
||||||
144 238 144 PaleGreen2
|
|
||||||
124 205 124 PaleGreen3
|
|
||||||
84 139 84 PaleGreen4
|
|
||||||
0 255 127 SpringGreen1
|
|
||||||
0 238 118 SpringGreen2
|
|
||||||
0 205 102 SpringGreen3
|
|
||||||
0 139 69 SpringGreen4
|
|
||||||
0 255 0 green1
|
|
||||||
0 238 0 green2
|
|
||||||
0 205 0 green3
|
|
||||||
0 139 0 green4
|
|
||||||
127 255 0 chartreuse1
|
|
||||||
118 238 0 chartreuse2
|
|
||||||
102 205 0 chartreuse3
|
|
||||||
69 139 0 chartreuse4
|
|
||||||
192 255 62 OliveDrab1
|
|
||||||
179 238 58 OliveDrab2
|
|
||||||
154 205 50 OliveDrab3
|
|
||||||
105 139 34 OliveDrab4
|
|
||||||
202 255 112 DarkOliveGreen1
|
|
||||||
188 238 104 DarkOliveGreen2
|
|
||||||
162 205 90 DarkOliveGreen3
|
|
||||||
110 139 61 DarkOliveGreen4
|
|
||||||
255 246 143 khaki1
|
|
||||||
238 230 133 khaki2
|
|
||||||
205 198 115 khaki3
|
|
||||||
139 134 78 khaki4
|
|
||||||
255 236 139 LightGoldenrod1
|
|
||||||
238 220 130 LightGoldenrod2
|
|
||||||
205 190 112 LightGoldenrod3
|
|
||||||
139 129 76 LightGoldenrod4
|
|
||||||
255 255 224 LightYellow1
|
|
||||||
238 238 209 LightYellow2
|
|
||||||
205 205 180 LightYellow3
|
|
||||||
139 139 122 LightYellow4
|
|
||||||
255 255 0 yellow1
|
|
||||||
238 238 0 yellow2
|
|
||||||
205 205 0 yellow3
|
|
||||||
139 139 0 yellow4
|
|
||||||
255 215 0 gold1
|
|
||||||
238 201 0 gold2
|
|
||||||
205 173 0 gold3
|
|
||||||
139 117 0 gold4
|
|
||||||
255 193 37 goldenrod1
|
|
||||||
238 180 34 goldenrod2
|
|
||||||
205 155 29 goldenrod3
|
|
||||||
139 105 20 goldenrod4
|
|
||||||
255 185 15 DarkGoldenrod1
|
|
||||||
238 173 14 DarkGoldenrod2
|
|
||||||
205 149 12 DarkGoldenrod3
|
|
||||||
139 101 8 DarkGoldenrod4
|
|
||||||
255 193 193 RosyBrown1
|
|
||||||
238 180 180 RosyBrown2
|
|
||||||
205 155 155 RosyBrown3
|
|
||||||
139 105 105 RosyBrown4
|
|
||||||
255 106 106 IndianRed1
|
|
||||||
238 99 99 IndianRed2
|
|
||||||
205 85 85 IndianRed3
|
|
||||||
139 58 58 IndianRed4
|
|
||||||
255 130 71 sienna1
|
|
||||||
238 121 66 sienna2
|
|
||||||
205 104 57 sienna3
|
|
||||||
139 71 38 sienna4
|
|
||||||
255 211 155 burlywood1
|
|
||||||
238 197 145 burlywood2
|
|
||||||
205 170 125 burlywood3
|
|
||||||
139 115 85 burlywood4
|
|
||||||
255 231 186 wheat1
|
|
||||||
238 216 174 wheat2
|
|
||||||
205 186 150 wheat3
|
|
||||||
139 126 102 wheat4
|
|
||||||
255 165 79 tan1
|
|
||||||
238 154 73 tan2
|
|
||||||
205 133 63 tan3
|
|
||||||
139 90 43 tan4
|
|
||||||
255 127 36 chocolate1
|
|
||||||
238 118 33 chocolate2
|
|
||||||
205 102 29 chocolate3
|
|
||||||
139 69 19 chocolate4
|
|
||||||
255 48 48 firebrick1
|
|
||||||
238 44 44 firebrick2
|
|
||||||
205 38 38 firebrick3
|
|
||||||
139 26 26 firebrick4
|
|
||||||
255 64 64 brown1
|
|
||||||
238 59 59 brown2
|
|
||||||
205 51 51 brown3
|
|
||||||
139 35 35 brown4
|
|
||||||
255 140 105 salmon1
|
|
||||||
238 130 98 salmon2
|
|
||||||
205 112 84 salmon3
|
|
||||||
139 76 57 salmon4
|
|
||||||
255 160 122 LightSalmon1
|
|
||||||
238 149 114 LightSalmon2
|
|
||||||
205 129 98 LightSalmon3
|
|
||||||
139 87 66 LightSalmon4
|
|
||||||
255 165 0 orange1
|
|
||||||
238 154 0 orange2
|
|
||||||
205 133 0 orange3
|
|
||||||
139 90 0 orange4
|
|
||||||
255 127 0 DarkOrange1
|
|
||||||
238 118 0 DarkOrange2
|
|
||||||
205 102 0 DarkOrange3
|
|
||||||
139 69 0 DarkOrange4
|
|
||||||
255 114 86 coral1
|
|
||||||
238 106 80 coral2
|
|
||||||
205 91 69 coral3
|
|
||||||
139 62 47 coral4
|
|
||||||
255 99 71 tomato1
|
|
||||||
238 92 66 tomato2
|
|
||||||
205 79 57 tomato3
|
|
||||||
139 54 38 tomato4
|
|
||||||
255 69 0 OrangeRed1
|
|
||||||
238 64 0 OrangeRed2
|
|
||||||
205 55 0 OrangeRed3
|
|
||||||
139 37 0 OrangeRed4
|
|
||||||
255 0 0 red1
|
|
||||||
238 0 0 red2
|
|
||||||
205 0 0 red3
|
|
||||||
139 0 0 red4
|
|
||||||
255 20 147 DeepPink1
|
|
||||||
238 18 137 DeepPink2
|
|
||||||
205 16 118 DeepPink3
|
|
||||||
139 10 80 DeepPink4
|
|
||||||
255 110 180 HotPink1
|
|
||||||
238 106 167 HotPink2
|
|
||||||
205 96 144 HotPink3
|
|
||||||
139 58 98 HotPink4
|
|
||||||
255 181 197 pink1
|
|
||||||
238 169 184 pink2
|
|
||||||
205 145 158 pink3
|
|
||||||
139 99 108 pink4
|
|
||||||
255 174 185 LightPink1
|
|
||||||
238 162 173 LightPink2
|
|
||||||
205 140 149 LightPink3
|
|
||||||
139 95 101 LightPink4
|
|
||||||
255 130 171 PaleVioletRed1
|
|
||||||
238 121 159 PaleVioletRed2
|
|
||||||
205 104 137 PaleVioletRed3
|
|
||||||
139 71 93 PaleVioletRed4
|
|
||||||
255 52 179 maroon1
|
|
||||||
238 48 167 maroon2
|
|
||||||
205 41 144 maroon3
|
|
||||||
139 28 98 maroon4
|
|
||||||
255 62 150 VioletRed1
|
|
||||||
238 58 140 VioletRed2
|
|
||||||
205 50 120 VioletRed3
|
|
||||||
139 34 82 VioletRed4
|
|
||||||
255 0 255 magenta1
|
|
||||||
238 0 238 magenta2
|
|
||||||
205 0 205 magenta3
|
|
||||||
139 0 139 magenta4
|
|
||||||
255 131 250 orchid1
|
|
||||||
238 122 233 orchid2
|
|
||||||
205 105 201 orchid3
|
|
||||||
139 71 137 orchid4
|
|
||||||
255 187 255 plum1
|
|
||||||
238 174 238 plum2
|
|
||||||
205 150 205 plum3
|
|
||||||
139 102 139 plum4
|
|
||||||
224 102 255 MediumOrchid1
|
|
||||||
209 95 238 MediumOrchid2
|
|
||||||
180 82 205 MediumOrchid3
|
|
||||||
122 55 139 MediumOrchid4
|
|
||||||
191 62 255 DarkOrchid1
|
|
||||||
178 58 238 DarkOrchid2
|
|
||||||
154 50 205 DarkOrchid3
|
|
||||||
104 34 139 DarkOrchid4
|
|
||||||
155 48 255 purple1
|
|
||||||
145 44 238 purple2
|
|
||||||
125 38 205 purple3
|
|
||||||
85 26 139 purple4
|
|
||||||
171 130 255 MediumPurple1
|
|
||||||
159 121 238 MediumPurple2
|
|
||||||
137 104 205 MediumPurple3
|
|
||||||
93 71 139 MediumPurple4
|
|
||||||
255 225 255 thistle1
|
|
||||||
238 210 238 thistle2
|
|
||||||
205 181 205 thistle3
|
|
||||||
139 123 139 thistle4
|
|
||||||
0 0 0 gray0
|
|
||||||
0 0 0 grey0
|
|
||||||
3 3 3 gray1
|
|
||||||
3 3 3 grey1
|
|
||||||
5 5 5 gray2
|
|
||||||
5 5 5 grey2
|
|
||||||
8 8 8 gray3
|
|
||||||
8 8 8 grey3
|
|
||||||
10 10 10 gray4
|
|
||||||
10 10 10 grey4
|
|
||||||
13 13 13 gray5
|
|
||||||
13 13 13 grey5
|
|
||||||
15 15 15 gray6
|
|
||||||
15 15 15 grey6
|
|
||||||
18 18 18 gray7
|
|
||||||
18 18 18 grey7
|
|
||||||
20 20 20 gray8
|
|
||||||
20 20 20 grey8
|
|
||||||
23 23 23 gray9
|
|
||||||
23 23 23 grey9
|
|
||||||
26 26 26 gray10
|
|
||||||
26 26 26 grey10
|
|
||||||
28 28 28 gray11
|
|
||||||
28 28 28 grey11
|
|
||||||
31 31 31 gray12
|
|
||||||
31 31 31 grey12
|
|
||||||
33 33 33 gray13
|
|
||||||
33 33 33 grey13
|
|
||||||
36 36 36 gray14
|
|
||||||
36 36 36 grey14
|
|
||||||
38 38 38 gray15
|
|
||||||
38 38 38 grey15
|
|
||||||
41 41 41 gray16
|
|
||||||
41 41 41 grey16
|
|
||||||
43 43 43 gray17
|
|
||||||
43 43 43 grey17
|
|
||||||
46 46 46 gray18
|
|
||||||
46 46 46 grey18
|
|
||||||
48 48 48 gray19
|
|
||||||
48 48 48 grey19
|
|
||||||
51 51 51 gray20
|
|
||||||
51 51 51 grey20
|
|
||||||
54 54 54 gray21
|
|
||||||
54 54 54 grey21
|
|
||||||
56 56 56 gray22
|
|
||||||
56 56 56 grey22
|
|
||||||
59 59 59 gray23
|
|
||||||
59 59 59 grey23
|
|
||||||
61 61 61 gray24
|
|
||||||
61 61 61 grey24
|
|
||||||
64 64 64 gray25
|
|
||||||
64 64 64 grey25
|
|
||||||
66 66 66 gray26
|
|
||||||
66 66 66 grey26
|
|
||||||
69 69 69 gray27
|
|
||||||
69 69 69 grey27
|
|
||||||
71 71 71 gray28
|
|
||||||
71 71 71 grey28
|
|
||||||
74 74 74 gray29
|
|
||||||
74 74 74 grey29
|
|
||||||
77 77 77 gray30
|
|
||||||
77 77 77 grey30
|
|
||||||
79 79 79 gray31
|
|
||||||
79 79 79 grey31
|
|
||||||
82 82 82 gray32
|
|
||||||
82 82 82 grey32
|
|
||||||
84 84 84 gray33
|
|
||||||
84 84 84 grey33
|
|
||||||
87 87 87 gray34
|
|
||||||
87 87 87 grey34
|
|
||||||
89 89 89 gray35
|
|
||||||
89 89 89 grey35
|
|
||||||
92 92 92 gray36
|
|
||||||
92 92 92 grey36
|
|
||||||
94 94 94 gray37
|
|
||||||
94 94 94 grey37
|
|
||||||
97 97 97 gray38
|
|
||||||
97 97 97 grey38
|
|
||||||
99 99 99 gray39
|
|
||||||
99 99 99 grey39
|
|
||||||
102 102 102 gray40
|
|
||||||
102 102 102 grey40
|
|
||||||
105 105 105 gray41
|
|
||||||
105 105 105 grey41
|
|
||||||
107 107 107 gray42
|
|
||||||
107 107 107 grey42
|
|
||||||
110 110 110 gray43
|
|
||||||
110 110 110 grey43
|
|
||||||
112 112 112 gray44
|
|
||||||
112 112 112 grey44
|
|
||||||
115 115 115 gray45
|
|
||||||
115 115 115 grey45
|
|
||||||
117 117 117 gray46
|
|
||||||
117 117 117 grey46
|
|
||||||
120 120 120 gray47
|
|
||||||
120 120 120 grey47
|
|
||||||
122 122 122 gray48
|
|
||||||
122 122 122 grey48
|
|
||||||
125 125 125 gray49
|
|
||||||
125 125 125 grey49
|
|
||||||
127 127 127 gray50
|
|
||||||
127 127 127 grey50
|
|
||||||
130 130 130 gray51
|
|
||||||
130 130 130 grey51
|
|
||||||
133 133 133 gray52
|
|
||||||
133 133 133 grey52
|
|
||||||
135 135 135 gray53
|
|
||||||
135 135 135 grey53
|
|
||||||
138 138 138 gray54
|
|
||||||
138 138 138 grey54
|
|
||||||
140 140 140 gray55
|
|
||||||
140 140 140 grey55
|
|
||||||
143 143 143 gray56
|
|
||||||
143 143 143 grey56
|
|
||||||
145 145 145 gray57
|
|
||||||
145 145 145 grey57
|
|
||||||
148 148 148 gray58
|
|
||||||
148 148 148 grey58
|
|
||||||
150 150 150 gray59
|
|
||||||
150 150 150 grey59
|
|
||||||
153 153 153 gray60
|
|
||||||
153 153 153 grey60
|
|
||||||
156 156 156 gray61
|
|
||||||
156 156 156 grey61
|
|
||||||
158 158 158 gray62
|
|
||||||
158 158 158 grey62
|
|
||||||
161 161 161 gray63
|
|
||||||
161 161 161 grey63
|
|
||||||
163 163 163 gray64
|
|
||||||
163 163 163 grey64
|
|
||||||
166 166 166 gray65
|
|
||||||
166 166 166 grey65
|
|
||||||
168 168 168 gray66
|
|
||||||
168 168 168 grey66
|
|
||||||
171 171 171 gray67
|
|
||||||
171 171 171 grey67
|
|
||||||
173 173 173 gray68
|
|
||||||
173 173 173 grey68
|
|
||||||
176 176 176 gray69
|
|
||||||
176 176 176 grey69
|
|
||||||
179 179 179 gray70
|
|
||||||
179 179 179 grey70
|
|
||||||
181 181 181 gray71
|
|
||||||
181 181 181 grey71
|
|
||||||
184 184 184 gray72
|
|
||||||
184 184 184 grey72
|
|
||||||
186 186 186 gray73
|
|
||||||
186 186 186 grey73
|
|
||||||
189 189 189 gray74
|
|
||||||
189 189 189 grey74
|
|
||||||
191 191 191 gray75
|
|
||||||
191 191 191 grey75
|
|
||||||
194 194 194 gray76
|
|
||||||
194 194 194 grey76
|
|
||||||
196 196 196 gray77
|
|
||||||
196 196 196 grey77
|
|
||||||
199 199 199 gray78
|
|
||||||
199 199 199 grey78
|
|
||||||
201 201 201 gray79
|
|
||||||
201 201 201 grey79
|
|
||||||
204 204 204 gray80
|
|
||||||
204 204 204 grey80
|
|
||||||
207 207 207 gray81
|
|
||||||
207 207 207 grey81
|
|
||||||
209 209 209 gray82
|
|
||||||
209 209 209 grey82
|
|
||||||
212 212 212 gray83
|
|
||||||
212 212 212 grey83
|
|
||||||
214 214 214 gray84
|
|
||||||
214 214 214 grey84
|
|
||||||
217 217 217 gray85
|
|
||||||
217 217 217 grey85
|
|
||||||
219 219 219 gray86
|
|
||||||
219 219 219 grey86
|
|
||||||
222 222 222 gray87
|
|
||||||
222 222 222 grey87
|
|
||||||
224 224 224 gray88
|
|
||||||
224 224 224 grey88
|
|
||||||
227 227 227 gray89
|
|
||||||
227 227 227 grey89
|
|
||||||
229 229 229 gray90
|
|
||||||
229 229 229 grey90
|
|
||||||
232 232 232 gray91
|
|
||||||
232 232 232 grey91
|
|
||||||
235 235 235 gray92
|
|
||||||
235 235 235 grey92
|
|
||||||
237 237 237 gray93
|
|
||||||
237 237 237 grey93
|
|
||||||
240 240 240 gray94
|
|
||||||
240 240 240 grey94
|
|
||||||
242 242 242 gray95
|
|
||||||
242 242 242 grey95
|
|
||||||
245 245 245 gray96
|
|
||||||
245 245 245 grey96
|
|
||||||
247 247 247 gray97
|
|
||||||
247 247 247 grey97
|
|
||||||
250 250 250 gray98
|
|
||||||
250 250 250 grey98
|
|
||||||
252 252 252 gray99
|
|
||||||
252 252 252 grey99
|
|
||||||
255 255 255 gray100
|
|
||||||
255 255 255 grey100
|
|
||||||
169 169 169 dark grey
|
|
||||||
169 169 169 DarkGrey
|
|
||||||
169 169 169 dark gray
|
|
||||||
169 169 169 DarkGray
|
|
||||||
0 0 139 dark blue
|
|
||||||
0 0 139 DarkBlue
|
|
||||||
0 139 139 dark cyan
|
|
||||||
0 139 139 DarkCyan
|
|
||||||
139 0 139 dark magenta
|
|
||||||
139 0 139 DarkMagenta
|
|
||||||
139 0 0 dark red
|
|
||||||
139 0 0 DarkRed
|
|
||||||
144 238 144 light green
|
|
||||||
144 238 144 LightGreen
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,20 @@
|
||||||
- Added Species property for actors and separated Hexen's Demon1 and Demon2
|
- Added Species property for actors and separated Hexen's Demon1 and Demon2
|
||||||
into different species.
|
into different species.
|
||||||
|
|
||||||
|
May 10, 2009 (Changes by Graf Zahl)
|
||||||
|
- Added handling for UDMF user keys.
|
||||||
|
- Added support for ACS functions that can be defined without recompiling ACC.
|
||||||
|
- Fixed: The short lump name for embedded files must be cleared so that they
|
||||||
|
are not found by a normal lump search.
|
||||||
|
|
||||||
|
May 9, 2009 (Changes by Graf Zahl)
|
||||||
|
- Added AProp_Notarget actor property.
|
||||||
|
- Fixed: TraceBleed was missing a NULL pointer check,
|
||||||
|
- Fixed: P_RandomChaseDir could crash for friendly monsters that belong to
|
||||||
|
a player which left the game.
|
||||||
|
- Changed A_PodGrow so that it plays the generator's attack sound instead of
|
||||||
|
"misc/podgrow".
|
||||||
|
|
||||||
May 8, 2009
|
May 8, 2009
|
||||||
- Added transference of a select few flags from PowerProtection to its owner.
|
- Added transference of a select few flags from PowerProtection to its owner.
|
||||||
- Added actor type parameters to A_PodPain() and A_MakePod().
|
- Added actor type parameters to A_PodPain() and A_MakePod().
|
||||||
|
|
|
@ -116,7 +116,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MakePod)
|
||||||
}
|
}
|
||||||
mo->SetState (mo->FindState("Grow"));
|
mo->SetState (mo->FindState("Grow"));
|
||||||
P_ThrustMobj (mo, pr_makepod()<<24, (fixed_t)(4.5*FRACUNIT));
|
P_ThrustMobj (mo, pr_makepod()<<24, (fixed_t)(4.5*FRACUNIT));
|
||||||
S_Sound (mo, CHAN_BODY, "world/podgrow", 1, ATTN_IDLE);
|
S_Sound (mo, CHAN_BODY, self->AttackSound, 1, ATTN_IDLE);
|
||||||
self->special1++; // Increment generated pod count
|
self->special1++; // Increment generated pod count
|
||||||
mo->master = self; // Link the generator to the pod
|
mo->master = self; // Link the generator to the pod
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -70,6 +70,7 @@
|
||||||
#include "sbarinfo.h"
|
#include "sbarinfo.h"
|
||||||
#include "cmdlib.h"
|
#include "cmdlib.h"
|
||||||
#include "m_png.h"
|
#include "m_png.h"
|
||||||
|
#include "p_setup.h"
|
||||||
|
|
||||||
extern FILE *Logfile;
|
extern FILE *Logfile;
|
||||||
|
|
||||||
|
@ -2405,6 +2406,7 @@ enum
|
||||||
APROP_Friendly = 16,
|
APROP_Friendly = 16,
|
||||||
APROP_SpawnHealth = 17,
|
APROP_SpawnHealth = 17,
|
||||||
APROP_Dropped = 18,
|
APROP_Dropped = 18,
|
||||||
|
APROP_Notarget = 19,
|
||||||
};
|
};
|
||||||
|
|
||||||
// These are needed for ACS's APROP_RenderStyle
|
// These are needed for ACS's APROP_RenderStyle
|
||||||
|
@ -2492,6 +2494,10 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
|
||||||
if (value) actor->flags2 |= MF2_INVULNERABLE; else actor->flags2 &= ~MF2_INVULNERABLE;
|
if (value) actor->flags2 |= MF2_INVULNERABLE; else actor->flags2 &= ~MF2_INVULNERABLE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case APROP_Notarget:
|
||||||
|
if (value) actor->flags3 |= MF3_NOTARGET; else actor->flags3 &= ~MF3_NOTARGET;
|
||||||
|
break;
|
||||||
|
|
||||||
case APROP_JumpZ:
|
case APROP_JumpZ:
|
||||||
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
|
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
|
||||||
static_cast<APlayerPawn *>(actor)->JumpZ = value;
|
static_cast<APlayerPawn *>(actor)->JumpZ = value;
|
||||||
|
@ -2595,6 +2601,7 @@ int DLevelScript::GetActorProperty (int tid, int property)
|
||||||
case APROP_ChaseGoal: return !!(actor->flags5 & MF5_CHASEGOAL);
|
case APROP_ChaseGoal: return !!(actor->flags5 & MF5_CHASEGOAL);
|
||||||
case APROP_Frightened: return !!(actor->flags4 & MF4_FRIGHTENED);
|
case APROP_Frightened: return !!(actor->flags4 & MF4_FRIGHTENED);
|
||||||
case APROP_Friendly: return !!(actor->flags & MF_FRIENDLY);
|
case APROP_Friendly: return !!(actor->flags & MF_FRIENDLY);
|
||||||
|
case APROP_Notarget: return !!(actor->flags3 & MF3_NOTARGET);
|
||||||
case APROP_SpawnHealth: if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
|
case APROP_SpawnHealth: if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
|
||||||
{
|
{
|
||||||
return static_cast<APlayerPawn *>(actor)->MaxHealth;
|
return static_cast<APlayerPawn *>(actor)->MaxHealth;
|
||||||
|
@ -2772,8 +2779,80 @@ int DLevelScript::DoClassifyActor(int tid)
|
||||||
return classify;
|
return classify;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum EACSFunctions
|
||||||
|
{
|
||||||
|
GetLineUDMFInt=1,
|
||||||
|
GetLineUDMFFixed,
|
||||||
|
GetThingUDMFInt,
|
||||||
|
GetThingUDMFFixed,
|
||||||
|
GetSectorUDMFInt,
|
||||||
|
GetSectorUDMFFixed,
|
||||||
|
GetSideUDMFInt,
|
||||||
|
GetSideUDMFFixed,
|
||||||
|
};
|
||||||
|
|
||||||
|
int DLevelScript::SideFromID(int id, int side)
|
||||||
|
{
|
||||||
|
if (side != 0 && side != 1) return -1;
|
||||||
|
|
||||||
|
if (id == 0)
|
||||||
|
{
|
||||||
|
if (activationline == NULL) return -1;
|
||||||
|
if (activationline->sidenum[side] == NO_SIDE) return -1;
|
||||||
|
return sides[activationline->sidenum[side]].Index;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int line = P_FindLineFromID(id, -1);
|
||||||
|
if (line == -1) return -1;
|
||||||
|
if (lines[line].sidenum[side] == NO_SIDE) return -1;
|
||||||
|
return sides[lines[line].sidenum[side]].Index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int DLevelScript::LineFromID(int id)
|
||||||
|
{
|
||||||
|
if (id == 0)
|
||||||
|
{
|
||||||
|
if (activationline == NULL) return -1;
|
||||||
|
return int(activationline - lines);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return P_FindLineFromID(id, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
|
||||||
|
{
|
||||||
|
switch(funcIndex)
|
||||||
|
{
|
||||||
|
case GetLineUDMFInt:
|
||||||
|
return GetUDMFInt(UDMF_Line, LineFromID(args[0]), FBehavior::StaticLookupString(args[1]));
|
||||||
|
case GetLineUDMFFixed:
|
||||||
|
return GetUDMFFixed(UDMF_Line, LineFromID(args[0]), FBehavior::StaticLookupString(args[1]));
|
||||||
|
case GetThingUDMFInt:
|
||||||
|
case GetThingUDMFFixed:
|
||||||
|
return 0; // Not implemented yet
|
||||||
|
case GetSectorUDMFInt:
|
||||||
|
return GetUDMFInt(UDMF_Sector, P_FindSectorFromTag(args[0], -1), FBehavior::StaticLookupString(args[1]));
|
||||||
|
case GetSectorUDMFFixed:
|
||||||
|
return GetUDMFFixed(UDMF_Sector, P_FindSectorFromTag(args[0], -1), FBehavior::StaticLookupString(args[1]));
|
||||||
|
case GetSideUDMFInt:
|
||||||
|
return GetUDMFInt(UDMF_Side, SideFromID(args[0], args[1]), FBehavior::StaticLookupString(args[2]));
|
||||||
|
case GetSideUDMFFixed:
|
||||||
|
return GetUDMFFixed(UDMF_Side, SideFromID(args[0], args[1]), FBehavior::StaticLookupString(args[2]));
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define NEXTWORD (LittleLong(*pc++))
|
#define NEXTWORD (LittleLong(*pc++))
|
||||||
#define NEXTBYTE (fmt==ACS_LittleEnhanced?getbyte(pc):NEXTWORD)
|
#define NEXTBYTE (fmt==ACS_LittleEnhanced?getbyte(pc):NEXTWORD)
|
||||||
|
#define NEXTSHORT (fmt==ACS_LittleEnhanced?getshort(pc):NEXTWORD)
|
||||||
#define STACK(a) (Stack[sp - (a)])
|
#define STACK(a) (Stack[sp - (a)])
|
||||||
#define PushToStack(a) (Stack[sp++] = (a))
|
#define PushToStack(a) (Stack[sp++] = (a))
|
||||||
|
|
||||||
|
@ -2784,6 +2863,13 @@ inline int getbyte (int *&pc)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline int getshort (int *&pc)
|
||||||
|
{
|
||||||
|
int res = LittleShort( *(SWORD *)pc);
|
||||||
|
pc = (int *)((BYTE *)pc+2);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
int DLevelScript::RunScript ()
|
int DLevelScript::RunScript ()
|
||||||
{
|
{
|
||||||
DACSThinker *controller = DACSThinker::ActiveThinker;
|
DACSThinker *controller = DACSThinker::ActiveThinker;
|
||||||
|
@ -3064,6 +3150,17 @@ int DLevelScript::RunScript ()
|
||||||
pc = (int *)((BYTE *)pc + 6);
|
pc = (int *)((BYTE *)pc + 6);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PCD_CALLFUNC:
|
||||||
|
{
|
||||||
|
int argCount = NEXTBYTE;
|
||||||
|
int funcIndex = NEXTSHORT;
|
||||||
|
|
||||||
|
int retval = CallFunction(argCount, funcIndex, &STACK(argCount));
|
||||||
|
sp -= argCount-1;
|
||||||
|
STACK(1) = retval;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case PCD_CALL:
|
case PCD_CALL:
|
||||||
case PCD_CALLDISCARD:
|
case PCD_CALLDISCARD:
|
||||||
{
|
{
|
||||||
|
|
|
@ -586,6 +586,7 @@ public:
|
||||||
PCD_CLASSIFYACTOR,
|
PCD_CLASSIFYACTOR,
|
||||||
PCD_PRINTBINARY,
|
PCD_PRINTBINARY,
|
||||||
/*350*/ PCD_PRINTHEX,
|
/*350*/ PCD_PRINTHEX,
|
||||||
|
PCD_CALLFUNC,
|
||||||
|
|
||||||
/*351*/ PCODE_COMMAND_COUNT
|
/*351*/ PCODE_COMMAND_COUNT
|
||||||
};
|
};
|
||||||
|
@ -715,6 +716,7 @@ protected:
|
||||||
static int DoSpawnSpot (int type, int spot, int tid, int angle);
|
static int DoSpawnSpot (int type, int spot, int tid, int angle);
|
||||||
static int DoSpawnSpotFacing (int type, int spot, int tid);
|
static int DoSpawnSpotFacing (int type, int spot, int tid);
|
||||||
int DoClassifyActor (int tid);
|
int DoClassifyActor (int tid);
|
||||||
|
int CallFunction(int argCount, int funcIndex, SDWORD *args);
|
||||||
|
|
||||||
void DoFadeTo (int r, int g, int b, int a, fixed_t time);
|
void DoFadeTo (int r, int g, int b, int a, fixed_t time);
|
||||||
void DoFadeRange (int r1, int g1, int b1, int a1,
|
void DoFadeRange (int r1, int g1, int b1, int a1,
|
||||||
|
@ -725,6 +727,9 @@ protected:
|
||||||
int GetActorProperty (int tid, int property);
|
int GetActorProperty (int tid, int property);
|
||||||
int GetPlayerInput (int playernum, int inputnum);
|
int GetPlayerInput (int playernum, int inputnum);
|
||||||
|
|
||||||
|
int LineFromID(int id);
|
||||||
|
int SideFromID(int id, int side);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DLevelScript ();
|
DLevelScript ();
|
||||||
|
|
||||||
|
|
|
@ -846,7 +846,8 @@ void P_RandomChaseDir (AActor *actor)
|
||||||
}
|
}
|
||||||
player = players[i].mo;
|
player = players[i].mo;
|
||||||
}
|
}
|
||||||
|
if (player != NULL && playeringame[i])
|
||||||
|
{
|
||||||
if (pr_newchasedir() & 1 || !P_CheckSight (actor, player))
|
if (pr_newchasedir() & 1 || !P_CheckSight (actor, player))
|
||||||
{
|
{
|
||||||
deltax = player->x - actor->x;
|
deltax = player->x - actor->x;
|
||||||
|
@ -903,6 +904,7 @@ void P_RandomChaseDir (AActor *actor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If the actor elects to continue in its current direction, let it do
|
// If the actor elects to continue in its current direction, let it do
|
||||||
// so unless the way is blocked. Then it must turn.
|
// so unless the way is blocked. Then it must turn.
|
||||||
|
|
|
@ -3393,11 +3393,14 @@ void P_TraceBleed (int damage, AActor *target, AActor *missile)
|
||||||
|
|
||||||
void P_TraceBleed (int damage, AActor *target)
|
void P_TraceBleed (int damage, AActor *target)
|
||||||
{
|
{
|
||||||
|
if (target != NULL)
|
||||||
|
{
|
||||||
fixed_t one = pr_tracebleed() << 24;
|
fixed_t one = pr_tracebleed() << 24;
|
||||||
fixed_t two = (pr_tracebleed()-128) << 16;
|
fixed_t two = (pr_tracebleed()-128) << 16;
|
||||||
|
|
||||||
P_TraceBleed (damage, target->x, target->y, target->z + target->height/2,
|
P_TraceBleed (damage, target->x, target->y, target->z + target->height/2,
|
||||||
target, one, two);
|
target, one, two);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -382,6 +382,8 @@ void P_SerializeWorld (FArchive &arc)
|
||||||
<< si->Flags
|
<< si->Flags
|
||||||
<< si->LeftSide
|
<< si->LeftSide
|
||||||
<< si->RightSide;
|
<< si->RightSide;
|
||||||
|
if (SaveVersion >= 1575)
|
||||||
|
arc << si->Index;
|
||||||
DBaseDecal::SerializeChain (arc, &si->AttachedDecals);
|
DBaseDecal::SerializeChain (arc, &si->AttachedDecals);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
void P_SpawnSlopeMakers (FMapThing *firstmt, FMapThing *lastmt);
|
void P_SpawnSlopeMakers (FMapThing *firstmt, FMapThing *lastmt);
|
||||||
void P_SetSlopes ();
|
void P_SetSlopes ();
|
||||||
void BloodCrypt (void *data, int key, int len);
|
void BloodCrypt (void *data, int key, int len);
|
||||||
|
void P_ClearUDMFKeys();
|
||||||
|
|
||||||
extern AActor *P_SpawnMapThing (FMapThing *mthing, int position);
|
extern AActor *P_SpawnMapThing (FMapThing *mthing, int position);
|
||||||
extern bool P_LoadBuildMap (BYTE *mapdata, size_t len, FMapThing **things, int *numthings);
|
extern bool P_LoadBuildMap (BYTE *mapdata, size_t len, FMapThing **things, int *numthings);
|
||||||
|
@ -2331,6 +2332,7 @@ void P_LoadSideDefs2 (MapData * map)
|
||||||
sd->SetTextureYOffset(LittleShort(msd->rowoffset)<<FRACBITS);
|
sd->SetTextureYOffset(LittleShort(msd->rowoffset)<<FRACBITS);
|
||||||
sd->linenum = NO_INDEX;
|
sd->linenum = NO_INDEX;
|
||||||
sd->Flags = 0;
|
sd->Flags = 0;
|
||||||
|
sd->Index = i;
|
||||||
|
|
||||||
// killough 4/4/98: allow sidedef texture names to be overloaded
|
// killough 4/4/98: allow sidedef texture names to be overloaded
|
||||||
// killough 4/11/98: refined to allow colormaps to work as wall
|
// killough 4/11/98: refined to allow colormaps to work as wall
|
||||||
|
@ -3281,6 +3283,7 @@ void P_FreeLevelData ()
|
||||||
delete[] level.Scrolls;
|
delete[] level.Scrolls;
|
||||||
level.Scrolls = NULL;
|
level.Scrolls = NULL;
|
||||||
}
|
}
|
||||||
|
P_ClearUDMFKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern msecnode_t *headsecnode;
|
extern msecnode_t *headsecnode;
|
||||||
|
|
|
@ -108,4 +108,7 @@ void P_LoadTranslator(const char *lumpname);
|
||||||
void P_TranslateLineDef (line_t *ld, maplinedef_t *mld);
|
void P_TranslateLineDef (line_t *ld, maplinedef_t *mld);
|
||||||
int P_TranslateSectorSpecial (int);
|
int P_TranslateSectorSpecial (int);
|
||||||
|
|
||||||
|
int GetUDMFInt(int type, int index, const char *key);
|
||||||
|
fixed_t GetUDMFFixed(int type, int index, const char *key);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
383
src/p_udmf.cpp
383
src/p_udmf.cpp
|
@ -123,6 +123,116 @@ extern TArray<int> linemap;
|
||||||
|
|
||||||
#define CHECK_N(f) if (!(namespace_bits&(f))) break;
|
#define CHECK_N(f) if (!(namespace_bits&(f))) break;
|
||||||
|
|
||||||
|
|
||||||
|
//===========================================================================
|
||||||
|
//
|
||||||
|
// Storage of UDMF user properties
|
||||||
|
//
|
||||||
|
//===========================================================================
|
||||||
|
|
||||||
|
typedef TMap<int, FUDMFKeys> FUDMFKeyMap;
|
||||||
|
|
||||||
|
|
||||||
|
static FUDMFKeyMap UDMFKeys[4];
|
||||||
|
// Things must be handled differently
|
||||||
|
|
||||||
|
void P_ClearUDMFKeys()
|
||||||
|
{
|
||||||
|
for(int i=0;i<4;i++)
|
||||||
|
{
|
||||||
|
UDMFKeys[i].Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int STACK_ARGS udmfcmp(const void *a, const void *b)
|
||||||
|
{
|
||||||
|
FUDMFKey *A = (FUDMFKey*)a;
|
||||||
|
FUDMFKey *B = (FUDMFKey*)b;
|
||||||
|
|
||||||
|
return int(A->Key) - int(B->Key);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FUDMFKeys::Sort()
|
||||||
|
{
|
||||||
|
qsort(&(*this)[0], Size(), sizeof(FUDMFKey), udmfcmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
FUDMFKey *FUDMFKeys::Find(FName key)
|
||||||
|
{
|
||||||
|
int min = 0, max = Size()-1;
|
||||||
|
|
||||||
|
while (min <= max)
|
||||||
|
{
|
||||||
|
int mid = (min + max) / 2;
|
||||||
|
if ((*this)[mid].Key == key)
|
||||||
|
{
|
||||||
|
return &(*this)[mid];
|
||||||
|
}
|
||||||
|
else if ((*this)[mid].Key <= key)
|
||||||
|
{
|
||||||
|
min = mid + 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
max = mid - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
//===========================================================================
|
||||||
|
//
|
||||||
|
// Retrieves UDMF user properties
|
||||||
|
//
|
||||||
|
//===========================================================================
|
||||||
|
|
||||||
|
int GetUDMFInt(int type, int index, const char *key)
|
||||||
|
{
|
||||||
|
assert(type >=0 && type <=3);
|
||||||
|
|
||||||
|
if (index > 0)
|
||||||
|
{
|
||||||
|
FUDMFKeys *pKeys = UDMFKeys[type].CheckKey(index);
|
||||||
|
|
||||||
|
if (pKeys != NULL)
|
||||||
|
{
|
||||||
|
FUDMFKey *pKey = pKeys->Find(key);
|
||||||
|
if (pKey != NULL)
|
||||||
|
{
|
||||||
|
return FLOAT2FIXED(pKey->IntVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
fixed_t GetUDMFFixed(int type, int index, const char *key)
|
||||||
|
{
|
||||||
|
assert(type >=0 && type <=3);
|
||||||
|
|
||||||
|
if (index > 0)
|
||||||
|
{
|
||||||
|
FUDMFKeys *pKeys = UDMFKeys[type].CheckKey(index);
|
||||||
|
|
||||||
|
if (pKeys != NULL)
|
||||||
|
{
|
||||||
|
FUDMFKey *pKey = pKeys->Find(key);
|
||||||
|
if (pKey != NULL)
|
||||||
|
{
|
||||||
|
return FLOAT2FIXED(pKey->FloatVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//===========================================================================
|
||||||
|
//
|
||||||
|
// UDMF parser
|
||||||
|
//
|
||||||
|
//===========================================================================
|
||||||
|
|
||||||
struct UDMFParser
|
struct UDMFParser
|
||||||
{
|
{
|
||||||
FScanner sc;
|
FScanner sc;
|
||||||
|
@ -131,6 +241,7 @@ struct UDMFParser
|
||||||
bool isTranslated;
|
bool isTranslated;
|
||||||
bool isExtended;
|
bool isExtended;
|
||||||
bool floordrop;
|
bool floordrop;
|
||||||
|
FString parsedString;
|
||||||
|
|
||||||
TArray<line_t> ParsedLines;
|
TArray<line_t> ParsedLines;
|
||||||
TArray<side_t> ParsedSides;
|
TArray<side_t> ParsedSides;
|
||||||
|
@ -148,7 +259,7 @@ struct UDMFParser
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// Parses a 'key = value' line of the map but doesn't read the semicolon
|
// Parses a 'key = value' line of the map
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
|
@ -176,6 +287,13 @@ struct UDMFParser
|
||||||
sc.Float = -sc.Float;
|
sc.Float = -sc.Float;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (sc.TokenType == TK_StringConst)
|
||||||
|
{
|
||||||
|
parsedString = sc.String;
|
||||||
|
}
|
||||||
|
int savedtoken = sc.TokenType;
|
||||||
|
sc.MustGetToken(';');
|
||||||
|
sc.TokenType = savedtoken;
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +345,7 @@ struct UDMFParser
|
||||||
{
|
{
|
||||||
sc.ScriptMessage("String value expected for key '%s'", key);
|
sc.ScriptMessage("String value expected for key '%s'", key);
|
||||||
}
|
}
|
||||||
return sc.String;
|
return parsedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Flag(DWORD &value, int mask, const char *key)
|
void Flag(DWORD &value, int mask, const char *key)
|
||||||
|
@ -236,6 +354,61 @@ struct UDMFParser
|
||||||
else value &= ~mask;
|
else value &= ~mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void AddUserKey(FName key, int kind, int index)
|
||||||
|
{
|
||||||
|
FUDMFKeys &keyarray = UDMFKeys[kind][index];
|
||||||
|
|
||||||
|
for(unsigned i=0; i < keyarray.Size(); i++)
|
||||||
|
{
|
||||||
|
if (keyarray[i].Key == key)
|
||||||
|
{
|
||||||
|
switch (sc.TokenType)
|
||||||
|
{
|
||||||
|
case TK_Int:
|
||||||
|
keyarray[i] = sc.Number;
|
||||||
|
break;
|
||||||
|
case TK_Float:
|
||||||
|
keyarray[i] = sc.Float;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case TK_String:
|
||||||
|
keyarray[i] = parsedString;
|
||||||
|
break;
|
||||||
|
case TK_True:
|
||||||
|
keyarray[i] = 1;
|
||||||
|
break;
|
||||||
|
case TK_False:
|
||||||
|
keyarray[i] = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FUDMFKey ukey;
|
||||||
|
ukey.Key = key;
|
||||||
|
switch (sc.TokenType)
|
||||||
|
{
|
||||||
|
case TK_Int:
|
||||||
|
ukey = sc.Number;
|
||||||
|
break;
|
||||||
|
case TK_Float:
|
||||||
|
ukey = sc.Float;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case TK_String:
|
||||||
|
ukey = parsedString;
|
||||||
|
break;
|
||||||
|
case TK_True:
|
||||||
|
ukey = 1;
|
||||||
|
break;
|
||||||
|
case TK_False:
|
||||||
|
ukey = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
keyarray.Push(ukey);
|
||||||
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// Parse a thing block
|
// Parse a thing block
|
||||||
|
@ -377,9 +550,12 @@ struct UDMFParser
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if (!strnicmp("user_", key.GetChars(), 5))
|
||||||
|
{
|
||||||
|
// Custom user key - handle later
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sc.MustGetToken(';');
|
|
||||||
}
|
}
|
||||||
// Thing specials are only valid in namespaces with Hexen-type specials
|
// Thing specials are only valid in namespaces with Hexen-type specials
|
||||||
// and in ZDoomTranslated - which will use the translator on them.
|
// and in ZDoomTranslated - which will use the translator on them.
|
||||||
|
@ -412,7 +588,7 @@ struct UDMFParser
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void ParseLinedef(line_t *ld)
|
void ParseLinedef(line_t *ld, int index)
|
||||||
{
|
{
|
||||||
bool passuse = false;
|
bool passuse = false;
|
||||||
bool strifetrans = false;
|
bool strifetrans = false;
|
||||||
|
@ -435,11 +611,11 @@ struct UDMFParser
|
||||||
{
|
{
|
||||||
case NAME_V1:
|
case NAME_V1:
|
||||||
ld->v1 = (vertex_t*)(intptr_t)CheckInt(key); // must be relocated later
|
ld->v1 = (vertex_t*)(intptr_t)CheckInt(key); // must be relocated later
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_V2:
|
case NAME_V2:
|
||||||
ld->v2 = (vertex_t*)(intptr_t)CheckInt(key); // must be relocated later
|
ld->v2 = (vertex_t*)(intptr_t)CheckInt(key); // must be relocated later
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Special:
|
case NAME_Special:
|
||||||
ld->special = CheckInt(key);
|
ld->special = CheckInt(key);
|
||||||
|
@ -449,19 +625,19 @@ struct UDMFParser
|
||||||
ld->special = 0; // NULL all specials which don't exist in Hexen
|
ld->special = 0; // NULL all specials which don't exist in Hexen
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Id:
|
case NAME_Id:
|
||||||
ld->id = CheckInt(key);
|
ld->id = CheckInt(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Sidefront:
|
case NAME_Sidefront:
|
||||||
ld->sidenum[0] = CheckInt(key);
|
ld->sidenum[0] = CheckInt(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Sideback:
|
case NAME_Sideback:
|
||||||
ld->sidenum[1] = CheckInt(key);
|
ld->sidenum[1] = CheckInt(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Arg0:
|
case NAME_Arg0:
|
||||||
case NAME_Arg1:
|
case NAME_Arg1:
|
||||||
|
@ -469,63 +645,63 @@ struct UDMFParser
|
||||||
case NAME_Arg3:
|
case NAME_Arg3:
|
||||||
case NAME_Arg4:
|
case NAME_Arg4:
|
||||||
ld->args[int(key)-int(NAME_Arg0)] = CheckInt(key);
|
ld->args[int(key)-int(NAME_Arg0)] = CheckInt(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Blocking:
|
case NAME_Blocking:
|
||||||
Flag(ld->flags, ML_BLOCKING, key);
|
Flag(ld->flags, ML_BLOCKING, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Blockmonsters:
|
case NAME_Blockmonsters:
|
||||||
Flag(ld->flags, ML_BLOCKMONSTERS, key);
|
Flag(ld->flags, ML_BLOCKMONSTERS, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Twosided:
|
case NAME_Twosided:
|
||||||
Flag(ld->flags, ML_TWOSIDED, key);
|
Flag(ld->flags, ML_TWOSIDED, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Dontpegtop:
|
case NAME_Dontpegtop:
|
||||||
Flag(ld->flags, ML_DONTPEGTOP, key);
|
Flag(ld->flags, ML_DONTPEGTOP, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Dontpegbottom:
|
case NAME_Dontpegbottom:
|
||||||
Flag(ld->flags, ML_DONTPEGBOTTOM, key);
|
Flag(ld->flags, ML_DONTPEGBOTTOM, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Secret:
|
case NAME_Secret:
|
||||||
Flag(ld->flags, ML_SECRET, key);
|
Flag(ld->flags, ML_SECRET, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Blocksound:
|
case NAME_Blocksound:
|
||||||
Flag(ld->flags, ML_SOUNDBLOCK, key);
|
Flag(ld->flags, ML_SOUNDBLOCK, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Dontdraw:
|
case NAME_Dontdraw:
|
||||||
Flag(ld->flags, ML_DONTDRAW, key);
|
Flag(ld->flags, ML_DONTDRAW, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Mapped:
|
case NAME_Mapped:
|
||||||
Flag(ld->flags, ML_MAPPED, key);
|
Flag(ld->flags, ML_MAPPED, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Jumpover:
|
case NAME_Jumpover:
|
||||||
CHECK_N(St | Zd | Zdt | Va)
|
CHECK_N(St | Zd | Zdt | Va)
|
||||||
Flag(ld->flags, ML_RAILING, key);
|
Flag(ld->flags, ML_RAILING, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Blockfloating:
|
case NAME_Blockfloating:
|
||||||
CHECK_N(St | Zd | Zdt | Va)
|
CHECK_N(St | Zd | Zdt | Va)
|
||||||
Flag(ld->flags, ML_BLOCK_FLOATERS, key);
|
Flag(ld->flags, ML_BLOCK_FLOATERS, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Transparent:
|
case NAME_Transparent:
|
||||||
CHECK_N(St | Zd | Zdt | Va)
|
CHECK_N(St | Zd | Zdt | Va)
|
||||||
strifetrans = CheckBool(key);
|
strifetrans = CheckBool(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Passuse:
|
case NAME_Passuse:
|
||||||
CHECK_N(Dm | Zd | Zdt | Va)
|
CHECK_N(Dm | Zd | Zdt | Va)
|
||||||
passuse = CheckBool(key);
|
passuse = CheckBool(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -536,39 +712,39 @@ struct UDMFParser
|
||||||
{
|
{
|
||||||
case NAME_Playercross:
|
case NAME_Playercross:
|
||||||
Flag(ld->activation, SPAC_Cross, key);
|
Flag(ld->activation, SPAC_Cross, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Playeruse:
|
case NAME_Playeruse:
|
||||||
Flag(ld->activation, SPAC_Use, key);
|
Flag(ld->activation, SPAC_Use, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Monstercross:
|
case NAME_Monstercross:
|
||||||
Flag(ld->activation, SPAC_MCross, key);
|
Flag(ld->activation, SPAC_MCross, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Impact:
|
case NAME_Impact:
|
||||||
Flag(ld->activation, SPAC_Impact, key);
|
Flag(ld->activation, SPAC_Impact, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Playerpush:
|
case NAME_Playerpush:
|
||||||
Flag(ld->activation, SPAC_Push, key);
|
Flag(ld->activation, SPAC_Push, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Missilecross:
|
case NAME_Missilecross:
|
||||||
Flag(ld->activation, SPAC_PCross, key);
|
Flag(ld->activation, SPAC_PCross, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Monsteruse:
|
case NAME_Monsteruse:
|
||||||
Flag(ld->activation, SPAC_MUse, key);
|
Flag(ld->activation, SPAC_MUse, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Monsterpush:
|
case NAME_Monsterpush:
|
||||||
Flag(ld->activation, SPAC_MPush, key);
|
Flag(ld->activation, SPAC_MPush, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Repeatspecial:
|
case NAME_Repeatspecial:
|
||||||
Flag(ld->flags, ML_REPEAT_SPECIAL, key);
|
Flag(ld->flags, ML_REPEAT_SPECIAL, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -579,7 +755,7 @@ struct UDMFParser
|
||||||
{
|
{
|
||||||
case NAME_Alpha:
|
case NAME_Alpha:
|
||||||
ld->Alpha = CheckFixed(key);
|
ld->Alpha = CheckFixed(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Renderstyle:
|
case NAME_Renderstyle:
|
||||||
{
|
{
|
||||||
|
@ -587,61 +763,65 @@ struct UDMFParser
|
||||||
if (!stricmp(str, "translucent")) ld->flags &= ~ML_ADDTRANS;
|
if (!stricmp(str, "translucent")) ld->flags &= ~ML_ADDTRANS;
|
||||||
else if (!stricmp(str, "add")) ld->flags |= ML_ADDTRANS;
|
else if (!stricmp(str, "add")) ld->flags |= ML_ADDTRANS;
|
||||||
else sc.ScriptMessage("Unknown value \"%s\" for 'renderstyle'\n", str);
|
else sc.ScriptMessage("Unknown value \"%s\" for 'renderstyle'\n", str);
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NAME_Anycross:
|
case NAME_Anycross:
|
||||||
Flag(ld->activation, SPAC_AnyCross, key);
|
Flag(ld->activation, SPAC_AnyCross, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Monsteractivate:
|
case NAME_Monsteractivate:
|
||||||
Flag(ld->flags, ML_MONSTERSCANACTIVATE, key);
|
Flag(ld->flags, ML_MONSTERSCANACTIVATE, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Blockplayers:
|
case NAME_Blockplayers:
|
||||||
Flag(ld->flags, ML_BLOCK_PLAYERS, key);
|
Flag(ld->flags, ML_BLOCK_PLAYERS, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Blockeverything:
|
case NAME_Blockeverything:
|
||||||
Flag(ld->flags, ML_BLOCKEVERYTHING, key);
|
Flag(ld->flags, ML_BLOCKEVERYTHING, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Zoneboundary:
|
case NAME_Zoneboundary:
|
||||||
Flag(ld->flags, ML_ZONEBOUNDARY, key);
|
Flag(ld->flags, ML_ZONEBOUNDARY, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Clipmidtex:
|
case NAME_Clipmidtex:
|
||||||
Flag(ld->flags, ML_CLIP_MIDTEX, key);
|
Flag(ld->flags, ML_CLIP_MIDTEX, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Wrapmidtex:
|
case NAME_Wrapmidtex:
|
||||||
Flag(ld->flags, ML_WRAP_MIDTEX, key);
|
Flag(ld->flags, ML_WRAP_MIDTEX, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Midtex3d:
|
case NAME_Midtex3d:
|
||||||
Flag(ld->flags, ML_3DMIDTEX, key);
|
Flag(ld->flags, ML_3DMIDTEX, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Checkswitchrange:
|
case NAME_Checkswitchrange:
|
||||||
Flag(ld->flags, ML_CHECKSWITCHRANGE, key);
|
Flag(ld->flags, ML_CHECKSWITCHRANGE, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Firstsideonly:
|
case NAME_Firstsideonly:
|
||||||
Flag(ld->flags, ML_FIRSTSIDEONLY, key);
|
Flag(ld->flags, ML_FIRSTSIDEONLY, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_blockprojectiles:
|
case NAME_blockprojectiles:
|
||||||
Flag(ld->flags, ML_BLOCKPROJECTILE, key);
|
Flag(ld->flags, ML_BLOCKPROJECTILE, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_blockuse:
|
case NAME_blockuse:
|
||||||
Flag(ld->flags, ML_BLOCKUSE, key);
|
Flag(ld->flags, ML_BLOCKUSE, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sc.MustGetToken(';');
|
|
||||||
|
if (!strnicmp("user_", key.GetChars(), 5))
|
||||||
|
{
|
||||||
|
AddUserKey(key, UDMF_Line, index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isTranslated)
|
if (isTranslated)
|
||||||
|
@ -671,7 +851,7 @@ struct UDMFParser
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void ParseSidedef(side_t *sd, mapsidedef_t *sdt)
|
void ParseSidedef(side_t *sd, mapsidedef_t *sdt, int index)
|
||||||
{
|
{
|
||||||
fixed_t texofs[2]={0,0};
|
fixed_t texofs[2]={0,0};
|
||||||
|
|
||||||
|
@ -688,27 +868,27 @@ struct UDMFParser
|
||||||
{
|
{
|
||||||
case NAME_Offsetx:
|
case NAME_Offsetx:
|
||||||
texofs[0] = CheckInt(key) << FRACBITS;
|
texofs[0] = CheckInt(key) << FRACBITS;
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Offsety:
|
case NAME_Offsety:
|
||||||
texofs[1] = CheckInt(key) << FRACBITS;
|
texofs[1] = CheckInt(key) << FRACBITS;
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Texturetop:
|
case NAME_Texturetop:
|
||||||
strncpy(sdt->toptexture, CheckString(key), 8);
|
strncpy(sdt->toptexture, CheckString(key), 8);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Texturebottom:
|
case NAME_Texturebottom:
|
||||||
strncpy(sdt->bottomtexture, CheckString(key), 8);
|
strncpy(sdt->bottomtexture, CheckString(key), 8);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Texturemiddle:
|
case NAME_Texturemiddle:
|
||||||
strncpy(sdt->midtexture, CheckString(key), 8);
|
strncpy(sdt->midtexture, CheckString(key), 8);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Sector:
|
case NAME_Sector:
|
||||||
sd->sector = (sector_t*)(intptr_t)CheckInt(key);
|
sd->sector = (sector_t*)(intptr_t)CheckInt(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -718,53 +898,55 @@ struct UDMFParser
|
||||||
{
|
{
|
||||||
case NAME_offsetx_top:
|
case NAME_offsetx_top:
|
||||||
sd->SetTextureXOffset(side_t::top, CheckFixed(key));
|
sd->SetTextureXOffset(side_t::top, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_offsety_top:
|
case NAME_offsety_top:
|
||||||
sd->SetTextureYOffset(side_t::top, CheckFixed(key));
|
sd->SetTextureYOffset(side_t::top, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_offsetx_mid:
|
case NAME_offsetx_mid:
|
||||||
sd->SetTextureXOffset(side_t::mid, CheckFixed(key));
|
sd->SetTextureXOffset(side_t::mid, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_offsety_mid:
|
case NAME_offsety_mid:
|
||||||
sd->SetTextureYOffset(side_t::mid, CheckFixed(key));
|
sd->SetTextureYOffset(side_t::mid, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_offsetx_bottom:
|
case NAME_offsetx_bottom:
|
||||||
sd->SetTextureXOffset(side_t::bottom, CheckFixed(key));
|
sd->SetTextureXOffset(side_t::bottom, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_offsety_bottom:
|
case NAME_offsety_bottom:
|
||||||
sd->SetTextureYOffset(side_t::bottom, CheckFixed(key));
|
sd->SetTextureYOffset(side_t::bottom, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_light:
|
case NAME_light:
|
||||||
sd->SetLight(CheckInt(key));
|
sd->SetLight(CheckInt(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_lightabsolute:
|
case NAME_lightabsolute:
|
||||||
if (CheckBool(key)) sd->Flags |= WALLF_ABSLIGHTING;
|
if (CheckBool(key)) sd->Flags |= WALLF_ABSLIGHTING;
|
||||||
else sd->Flags &= ~WALLF_ABSLIGHTING;
|
else sd->Flags &= ~WALLF_ABSLIGHTING;
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_nofakecontrast:
|
case NAME_nofakecontrast:
|
||||||
if (CheckBool(key)) sd->Flags |= WALLF_NOFAKECONTRAST;
|
if (CheckBool(key)) sd->Flags |= WALLF_NOFAKECONTRAST;
|
||||||
else sd->Flags &= WALLF_NOFAKECONTRAST;
|
else sd->Flags &= WALLF_NOFAKECONTRAST;
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_smoothlighting:
|
case NAME_smoothlighting:
|
||||||
if (CheckBool(key)) sd->Flags |= WALLF_SMOOTHLIGHTING;
|
if (CheckBool(key)) sd->Flags |= WALLF_SMOOTHLIGHTING;
|
||||||
else sd->Flags &= ~WALLF_SMOOTHLIGHTING;
|
else sd->Flags &= ~WALLF_SMOOTHLIGHTING;
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (!strnicmp("user_", key.GetChars(), 5))
|
||||||
sc.MustGetToken(';');
|
{
|
||||||
|
AddUserKey(key, UDMF_Side, index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// initialization of these is delayed to allow separate offsets and add them with the global ones.
|
// initialization of these is delayed to allow separate offsets and add them with the global ones.
|
||||||
sd->AddTextureXOffset(side_t::top, texofs[0]);
|
sd->AddTextureXOffset(side_t::top, texofs[0]);
|
||||||
|
@ -818,23 +1000,23 @@ struct UDMFParser
|
||||||
{
|
{
|
||||||
case NAME_Heightfloor:
|
case NAME_Heightfloor:
|
||||||
sec->SetPlaneTexZ(sector_t::floor, CheckInt(key) << FRACBITS);
|
sec->SetPlaneTexZ(sector_t::floor, CheckInt(key) << FRACBITS);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Heightceiling:
|
case NAME_Heightceiling:
|
||||||
sec->SetPlaneTexZ(sector_t::ceiling, CheckInt(key) << FRACBITS);
|
sec->SetPlaneTexZ(sector_t::ceiling, CheckInt(key) << FRACBITS);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Texturefloor:
|
case NAME_Texturefloor:
|
||||||
SetTexture(sec, index, sector_t::floor, CheckString(key));
|
SetTexture(sec, index, sector_t::floor, CheckString(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Textureceiling:
|
case NAME_Textureceiling:
|
||||||
SetTexture(sec, index, sector_t::ceiling, CheckString(key));
|
SetTexture(sec, index, sector_t::ceiling, CheckString(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Lightlevel:
|
case NAME_Lightlevel:
|
||||||
sec->lightlevel = (BYTE)clamp<int>(CheckInt(key), 0, 255);
|
sec->lightlevel = (BYTE)clamp<int>(CheckInt(key), 0, 255);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Special:
|
case NAME_Special:
|
||||||
sec->special = (short)CheckInt(key);
|
sec->special = (short)CheckInt(key);
|
||||||
|
@ -844,11 +1026,11 @@ struct UDMFParser
|
||||||
if (sec->special < 0 || sec->special > 255 || !HexenSectorSpecialOk[sec->special])
|
if (sec->special < 0 || sec->special > 255 || !HexenSectorSpecialOk[sec->special])
|
||||||
sec->special = 0; // NULL all unknown specials
|
sec->special = 0; // NULL all unknown specials
|
||||||
}
|
}
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Id:
|
case NAME_Id:
|
||||||
sec->tag = (short)CheckInt(key);
|
sec->tag = (short)CheckInt(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -858,99 +1040,102 @@ struct UDMFParser
|
||||||
{
|
{
|
||||||
case NAME_Xpanningfloor:
|
case NAME_Xpanningfloor:
|
||||||
sec->SetXOffset(sector_t::floor, CheckFixed(key));
|
sec->SetXOffset(sector_t::floor, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Ypanningfloor:
|
case NAME_Ypanningfloor:
|
||||||
sec->SetYOffset(sector_t::floor, CheckFixed(key));
|
sec->SetYOffset(sector_t::floor, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Xpanningceiling:
|
case NAME_Xpanningceiling:
|
||||||
sec->SetXOffset(sector_t::ceiling, CheckFixed(key));
|
sec->SetXOffset(sector_t::ceiling, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Ypanningceiling:
|
case NAME_Ypanningceiling:
|
||||||
sec->SetYOffset(sector_t::ceiling, CheckFixed(key));
|
sec->SetYOffset(sector_t::ceiling, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Xscalefloor:
|
case NAME_Xscalefloor:
|
||||||
sec->SetXScale(sector_t::floor, CheckFixed(key));
|
sec->SetXScale(sector_t::floor, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Yscalefloor:
|
case NAME_Yscalefloor:
|
||||||
sec->SetYScale(sector_t::floor, CheckFixed(key));
|
sec->SetYScale(sector_t::floor, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Xscaleceiling:
|
case NAME_Xscaleceiling:
|
||||||
sec->SetXScale(sector_t::ceiling, CheckFixed(key));
|
sec->SetXScale(sector_t::ceiling, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Yscaleceiling:
|
case NAME_Yscaleceiling:
|
||||||
sec->SetYScale(sector_t::ceiling, CheckFixed(key));
|
sec->SetYScale(sector_t::ceiling, CheckFixed(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Rotationfloor:
|
case NAME_Rotationfloor:
|
||||||
sec->SetAngle(sector_t::floor, CheckAngle(key));
|
sec->SetAngle(sector_t::floor, CheckAngle(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Rotationceiling:
|
case NAME_Rotationceiling:
|
||||||
sec->SetAngle(sector_t::ceiling, CheckAngle(key));
|
sec->SetAngle(sector_t::ceiling, CheckAngle(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Lightfloor:
|
case NAME_Lightfloor:
|
||||||
sec->SetPlaneLight(sector_t::floor, CheckInt(key));
|
sec->SetPlaneLight(sector_t::floor, CheckInt(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Lightceiling:
|
case NAME_Lightceiling:
|
||||||
sec->SetPlaneLight(sector_t::ceiling, CheckInt(key));
|
sec->SetPlaneLight(sector_t::ceiling, CheckInt(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Lightfloorabsolute:
|
case NAME_Lightfloorabsolute:
|
||||||
if (CheckBool(key)) sec->ChangeFlags(sector_t::floor, 0, SECF_ABSLIGHTING);
|
if (CheckBool(key)) sec->ChangeFlags(sector_t::floor, 0, SECF_ABSLIGHTING);
|
||||||
else sec->ChangeFlags(sector_t::floor, SECF_ABSLIGHTING, 0);
|
else sec->ChangeFlags(sector_t::floor, SECF_ABSLIGHTING, 0);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Lightceilingabsolute:
|
case NAME_Lightceilingabsolute:
|
||||||
if (CheckBool(key)) sec->ChangeFlags(sector_t::ceiling, 0, SECF_ABSLIGHTING);
|
if (CheckBool(key)) sec->ChangeFlags(sector_t::ceiling, 0, SECF_ABSLIGHTING);
|
||||||
else sec->ChangeFlags(sector_t::ceiling, SECF_ABSLIGHTING, 0);
|
else sec->ChangeFlags(sector_t::ceiling, SECF_ABSLIGHTING, 0);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Gravity:
|
case NAME_Gravity:
|
||||||
sec->gravity = float(CheckFloat(key));
|
sec->gravity = float(CheckFloat(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Lightcolor:
|
case NAME_Lightcolor:
|
||||||
lightcolor = CheckInt(key);
|
lightcolor = CheckInt(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Fadecolor:
|
case NAME_Fadecolor:
|
||||||
fadecolor = CheckInt(key);
|
fadecolor = CheckInt(key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Desaturation:
|
case NAME_Desaturation:
|
||||||
desaturation = int(255*CheckFloat(key));
|
desaturation = int(255*CheckFloat(key));
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Silent:
|
case NAME_Silent:
|
||||||
Flag(sec->Flags, SECF_SILENT, key);
|
Flag(sec->Flags, SECF_SILENT, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_NoRespawn:
|
case NAME_NoRespawn:
|
||||||
Flag(sec->Flags, SECF_NORESPAWN, key);
|
Flag(sec->Flags, SECF_NORESPAWN, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Nofallingdamage:
|
case NAME_Nofallingdamage:
|
||||||
Flag(sec->Flags, SECF_NOFALLINGDAMAGE, key);
|
Flag(sec->Flags, SECF_NOFALLINGDAMAGE, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
case NAME_Dropactors:
|
case NAME_Dropactors:
|
||||||
Flag(sec->Flags, SECF_FLOORDROP, key);
|
Flag(sec->Flags, SECF_FLOORDROP, key);
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc.MustGetToken(';');
|
if (!strnicmp("user_", key.GetChars(), 5))
|
||||||
|
{
|
||||||
|
AddUserKey(key, UDMF_Sector, index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sec->floorplane.d = -sec->GetPlaneTexZ(sector_t::floor);
|
sec->floorplane.d = -sec->GetPlaneTexZ(sector_t::floor);
|
||||||
|
@ -1196,14 +1381,14 @@ struct UDMFParser
|
||||||
else if (sc.Compare("linedef"))
|
else if (sc.Compare("linedef"))
|
||||||
{
|
{
|
||||||
line_t li;
|
line_t li;
|
||||||
ParseLinedef(&li);
|
ParseLinedef(&li, ParsedLines.Size());
|
||||||
ParsedLines.Push(li);
|
ParsedLines.Push(li);
|
||||||
}
|
}
|
||||||
else if (sc.Compare("sidedef"))
|
else if (sc.Compare("sidedef"))
|
||||||
{
|
{
|
||||||
side_t si;
|
side_t si;
|
||||||
mapsidedef_t st;
|
mapsidedef_t st;
|
||||||
ParseSidedef(&si, &st);
|
ParseSidedef(&si, &st, ParsedSides.Size());
|
||||||
ParsedSides.Push(si);
|
ParsedSides.Push(si);
|
||||||
ParsedSideTextures.Push(st);
|
ParsedSideTextures.Push(st);
|
||||||
}
|
}
|
||||||
|
|
65
src/r_defs.h
65
src/r_defs.h
|
@ -85,6 +85,70 @@ class FBitmap;
|
||||||
struct FCopyInfo;
|
struct FCopyInfo;
|
||||||
class DInterpolation;
|
class DInterpolation;
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
UDMF_Line,
|
||||||
|
UDMF_Side,
|
||||||
|
UDMF_Sector,
|
||||||
|
UDMF_Thing
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct FUDMFKey
|
||||||
|
{
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
UDMF_Int,
|
||||||
|
UDMF_Float,
|
||||||
|
UDMF_String
|
||||||
|
};
|
||||||
|
|
||||||
|
FName Key;
|
||||||
|
int Type;
|
||||||
|
int IntVal;
|
||||||
|
double FloatVal;
|
||||||
|
FString StringVal;
|
||||||
|
|
||||||
|
FUDMFKey()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
FUDMFKey& operator =(int val)
|
||||||
|
{
|
||||||
|
Type = UDMF_Int;
|
||||||
|
IntVal = val;
|
||||||
|
FloatVal = val;
|
||||||
|
StringVal = "";
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
FUDMFKey& operator =(double val)
|
||||||
|
{
|
||||||
|
Type = UDMF_Float;
|
||||||
|
IntVal = int(val);
|
||||||
|
FloatVal = val;
|
||||||
|
StringVal = "";
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
FUDMFKey& operator =(const FString &val)
|
||||||
|
{
|
||||||
|
Type = UDMF_String;
|
||||||
|
IntVal = strtol(val, NULL, 0);
|
||||||
|
FloatVal = strtod(val, NULL);
|
||||||
|
StringVal = val;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class FUDMFKeys : public TArray<FUDMFKey>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void Sort();
|
||||||
|
FUDMFKey *Find(FName key);
|
||||||
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// The SECTORS record, at runtime.
|
// The SECTORS record, at runtime.
|
||||||
// Stores things/mobjs.
|
// Stores things/mobjs.
|
||||||
|
@ -663,6 +727,7 @@ struct side_t
|
||||||
WORD TexelLength;
|
WORD TexelLength;
|
||||||
SWORD Light;
|
SWORD Light;
|
||||||
BYTE Flags;
|
BYTE Flags;
|
||||||
|
int Index; // needed to access custom UDMF fields which are stored in loading order.
|
||||||
|
|
||||||
int GetLightLevel (bool foggy, int baselight) const;
|
int GetLightLevel (bool foggy, int baselight) const;
|
||||||
|
|
||||||
|
|
|
@ -147,6 +147,12 @@ void FResourceLump::LumpNameSetup(char *iname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// Checks for embedded resource files
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
void FResourceLump::CheckEmbedded()
|
void FResourceLump::CheckEmbedded()
|
||||||
{
|
{
|
||||||
// Checks for embedded archives
|
// Checks for embedded archives
|
||||||
|
@ -155,6 +161,7 @@ void FResourceLump::CheckEmbedded()
|
||||||
{
|
{
|
||||||
// Mark all embedded WADs
|
// Mark all embedded WADs
|
||||||
Flags |= LUMPF_EMBEDDED;
|
Flags |= LUMPF_EMBEDDED;
|
||||||
|
memset(Name, 0, 8);
|
||||||
}
|
}
|
||||||
/* later
|
/* later
|
||||||
else
|
else
|
||||||
|
@ -162,10 +169,12 @@ void FResourceLump::CheckEmbedded()
|
||||||
if (c==NULL) c = strstr(Name, ".zip");
|
if (c==NULL) c = strstr(Name, ".zip");
|
||||||
if (c==NULL) c = strstr(Name, ".pk3");
|
if (c==NULL) c = strstr(Name, ".pk3");
|
||||||
if (c==NULL) c = strstr(Name, ".7z");
|
if (c==NULL) c = strstr(Name, ".7z");
|
||||||
|
if (c==NULL) c = strstr(Name, ".pak");
|
||||||
if (c && strlen(c) <= 4)
|
if (c && strlen(c) <= 4)
|
||||||
{
|
{
|
||||||
// Mark all embedded archives in any directory
|
// Mark all embedded archives in any directory
|
||||||
Flags |= LUMPF_EMBEDDED;
|
Flags |= LUMPF_EMBEDDED;
|
||||||
|
memset(Name, 0, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -68,6 +68,7 @@ ACTOR PodGenerator 43
|
||||||
+NOBLOCKMAP
|
+NOBLOCKMAP
|
||||||
+NOSECTOR
|
+NOSECTOR
|
||||||
+DONTSPLASH
|
+DONTSPLASH
|
||||||
|
AttackSound "misc/podgrow"
|
||||||
|
|
||||||
action native A_MakePod (class<Actor> podtype = "Pod");
|
action native A_MakePod (class<Actor> podtype = "Pod");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue