2008-03-19 21:09:53 +00:00
|
|
|
#ifndef __XLAT_H
|
|
|
|
#define __XLAT_H
|
|
|
|
|
|
|
|
#include "doomtype.h"
|
|
|
|
#include "tarray.h"
|
|
|
|
|
2012-01-23 00:24:42 +00:00
|
|
|
enum ELineTransTagOp
|
|
|
|
{
|
|
|
|
TAGOP_None,
|
|
|
|
TAGOP_Add,
|
|
|
|
TAGOP_Mul,
|
|
|
|
TAGOP_Div,
|
|
|
|
TAGOP_And,
|
|
|
|
TAGOP_Or,
|
|
|
|
TAGOP_Xor,
|
|
|
|
|
|
|
|
TAGOP_NUMBITS = 3,
|
|
|
|
TAGOP_MASK = (1 << TAGOP_NUMBITS) - 1
|
|
|
|
};
|
|
|
|
|
2008-03-19 21:09:53 +00:00
|
|
|
enum
|
|
|
|
{
|
2012-01-23 00:24:42 +00:00
|
|
|
LINETRANS_MAXARGS = 5,
|
|
|
|
LINETRANS_TAGSHIFT = 30 - LINETRANS_MAXARGS * TAGOP_NUMBITS,
|
2008-03-19 21:09:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct FLineTrans
|
|
|
|
{
|
|
|
|
int special;
|
|
|
|
int flags;
|
|
|
|
int args[5];
|
|
|
|
|
|
|
|
FLineTrans()
|
|
|
|
{
|
|
|
|
special = flags = args[0] = args[1] = args[2] = args[3] = args[4] = 0;
|
|
|
|
}
|
|
|
|
FLineTrans(int _special, int _flags, int arg1, int arg2, int arg3, int arg4, int arg5)
|
|
|
|
{
|
|
|
|
special = _special;
|
|
|
|
flags = _flags;
|
|
|
|
args[0] = arg1;
|
|
|
|
args[1] = arg2;
|
|
|
|
args[2] = arg3;
|
|
|
|
args[3] = arg4;
|
|
|
|
args[4] = arg5;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#define MAX_BOOMISH 16
|
|
|
|
|
|
|
|
struct FBoomArg
|
|
|
|
{
|
|
|
|
bool bOrExisting;
|
|
|
|
bool bUseConstant;
|
|
|
|
BYTE ListSize;
|
|
|
|
BYTE ArgNum;
|
|
|
|
BYTE ConstantValue;
|
|
|
|
WORD AndValue;
|
|
|
|
WORD ResultFilter[15];
|
|
|
|
BYTE ResultValue[15];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FBoomTranslator
|
|
|
|
{
|
|
|
|
WORD FirstLinetype;
|
|
|
|
WORD LastLinetype;
|
|
|
|
BYTE NewSpecial;
|
|
|
|
TArray<FBoomArg> Args;
|
|
|
|
} ;
|
|
|
|
|
2008-03-23 00:23:47 +00:00
|
|
|
struct FSectorTrans
|
|
|
|
{
|
|
|
|
int newtype;
|
|
|
|
bool bitmask_allowed;
|
|
|
|
|
|
|
|
FSectorTrans(int t=0, bool bitmask = false)
|
|
|
|
{
|
|
|
|
newtype = t;
|
|
|
|
bitmask_allowed = bitmask;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FSectorMask
|
|
|
|
{
|
|
|
|
int mask;
|
|
|
|
int op;
|
|
|
|
int shift;
|
|
|
|
};
|
|
|
|
|
2009-11-21 23:11:12 +00:00
|
|
|
struct FLineFlagTrans
|
|
|
|
{
|
|
|
|
int newvalue;
|
|
|
|
bool ismask;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-19 21:09:53 +00:00
|
|
|
extern TAutoGrowArray<FLineTrans> SimpleLineTranslations;
|
|
|
|
extern FBoomTranslator Boomish[MAX_BOOMISH];
|
|
|
|
extern int NumBoomish;
|
2008-03-23 00:23:47 +00:00
|
|
|
extern TAutoGrowArray<FSectorTrans> SectorTranslations;
|
|
|
|
extern TArray<FSectorMask> SectorMasks;
|
2009-11-21 23:11:12 +00:00
|
|
|
extern FLineFlagTrans LineFlagTranslations[16];
|
2008-03-19 21:09:53 +00:00
|
|
|
|
2008-03-19 23:03:14 +00:00
|
|
|
#endif
|