mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 16:51:31 +00:00
- fixed: Parsing of color strings with 6 characters and spaces did not work.
- fixed: State labels must be evaluated for the state's owner, not the calling actor. SVN r1354 (trunk)
This commit is contained in:
parent
6eb32dc0c2
commit
bf63041585
9 changed files with 22 additions and 16 deletions
|
@ -1,3 +1,7 @@
|
|||
January 5, 2009 (Changes by Graf Zahl)
|
||||
- fixed: Parsing of color strings with 6 characters and spaces did not work.
|
||||
- fixed: State labels must be evaluated for the state's owner, not the calling actor.
|
||||
|
||||
January 4, 2009 (Changes by Graf Zahl)
|
||||
- Fixed: For map spawns any change to an actor's floor z-coordinate must be
|
||||
delayed until after its z-coordinate has been set. That means that for
|
||||
|
|
|
@ -72,7 +72,7 @@ struct PSymbolVariable : public PSymbol
|
|||
// parameters passed.
|
||||
struct FState;
|
||||
struct StateCallData;
|
||||
typedef void (*actionf_p)(AActor *self, FState *state, int parameters, StateCallData *statecall);
|
||||
typedef void (*actionf_p)(AActor *self, AActor *stateowner, FState *state, int parameters, StateCallData *statecall);
|
||||
|
||||
struct PSymbolActionFunction : public PSymbol
|
||||
{
|
||||
|
|
|
@ -104,11 +104,11 @@ struct FState
|
|||
if (setdefaultparams) ParameterIndex = 0;
|
||||
}
|
||||
}
|
||||
inline bool CallAction(AActor *self, StateCallData *statecall = NULL)
|
||||
inline bool CallAction(AActor *self, AActor *stateowner, StateCallData *statecall = NULL)
|
||||
{
|
||||
if (ActionFunc != NULL)
|
||||
{
|
||||
ActionFunc(self, this, ParameterIndex-1, statecall);
|
||||
ActionFunc(self, stateowner, this, ParameterIndex-1, statecall);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -520,7 +520,7 @@ bool AActor::SetState (FState *newstate)
|
|||
}
|
||||
}
|
||||
|
||||
if (newstate->CallAction(this))
|
||||
if (newstate->CallAction(this, this))
|
||||
{
|
||||
// Check whether the called action function resulted in destroying the actor
|
||||
if (ObjectFlags & OF_EuthanizeMe)
|
||||
|
|
|
@ -99,7 +99,7 @@ void P_SetPsprite (player_t *player, int position, FState *state)
|
|||
|
||||
if (player->mo != NULL)
|
||||
{
|
||||
if (state->CallAction(player->mo))
|
||||
if (state->CallAction(player->mo, player->ReadyWeapon))
|
||||
{
|
||||
if (!psp->state)
|
||||
{
|
||||
|
|
|
@ -351,26 +351,26 @@ struct StateCallData
|
|||
|
||||
// Macros to handle action functions. These are here so that I don't have to
|
||||
// change every single use in case the parameters change.
|
||||
#define DECLARE_ACTION(name) void AF_##name(AActor *self, FState *, int, StateCallData *);
|
||||
#define DECLARE_ACTION(name) void AF_##name(AActor *self, AActor *stateowner, FState *, int, StateCallData *);
|
||||
|
||||
// This distinction is here so that CALL_ACTION produces errors when trying to
|
||||
// access a function that requires parameters.
|
||||
#define DEFINE_ACTION_FUNCTION(cls, name) \
|
||||
void AF_##name (AActor *self, FState *, int, StateCallData *); \
|
||||
void AF_##name (AActor *self, AActor *stateowner, FState *, int, StateCallData *); \
|
||||
static AFuncDesc info_##cls##_##name = { #name, AF_##name }; \
|
||||
MSVC_ASEG AFuncDesc *infoptr_##cls##_##name GCC_ASEG = &info_##cls##_##name; \
|
||||
void AF_##name (AActor *self, FState *, int, StateCallData *statecall)
|
||||
void AF_##name (AActor *self, AActor *stateowner, FState *, int, StateCallData *statecall)
|
||||
|
||||
#define DEFINE_ACTION_FUNCTION_PARAMS(cls, name) \
|
||||
void AFP_##name (AActor *self, FState *CallingState, int ParameterIndex, StateCallData *statecall); \
|
||||
void AFP_##name (AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall); \
|
||||
static AFuncDesc info_##cls##_##name = { #name, AFP_##name }; \
|
||||
MSVC_ASEG AFuncDesc *infoptr_##cls##_##name GCC_ASEG = &info_##cls##_##name; \
|
||||
void AFP_##name (AActor *self, FState *CallingState, int ParameterIndex, StateCallData *statecall)
|
||||
void AFP_##name (AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall)
|
||||
|
||||
#define DECLARE_PARAMINFO AActor *self, FState *CallingState, int ParameterIndex, StateCallData *statecall
|
||||
#define PUSH_PARAMINFO self, CallingState, ParameterIndex, statecall
|
||||
#define DECLARE_PARAMINFO AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall
|
||||
#define PUSH_PARAMINFO self, stateowner, CallingState, ParameterIndex, statecall
|
||||
|
||||
#define CALL_ACTION(name,self) AF_##name(self, NULL, 0, NULL)
|
||||
#define CALL_ACTION(name,self) AF_##name(self, self, NULL, 0, NULL)
|
||||
|
||||
|
||||
int EvalExpressionI (DWORD x, AActor *self);
|
||||
|
@ -395,7 +395,7 @@ FName EvalExpressionName (DWORD x, AActor *self);
|
|||
#define ACTION_PARAM_CLASS(var,i) \
|
||||
const PClass *var = EvalExpressionClass(ParameterIndex+i, self);
|
||||
#define ACTION_PARAM_STATE(var,i) \
|
||||
FState *var = EvalExpressionState(ParameterIndex+i, self);
|
||||
FState *var = EvalExpressionState(ParameterIndex+i, stateowner);
|
||||
#define ACTION_PARAM_COLOR(var,i) \
|
||||
PalEntry var = EvalExpressionCol(ParameterIndex+i, self);
|
||||
#define ACTION_PARAM_SOUND(var,i) \
|
||||
|
|
|
@ -103,7 +103,7 @@ bool ACustomInventory::CallStateChain (AActor *actor, FState * State)
|
|||
// Assume success. The code pointer will set this to false if necessary
|
||||
StateCall.State = State;
|
||||
StateCall.Result = true;
|
||||
if (State->CallAction(actor, &StateCall))
|
||||
if (State->CallAction(actor, this, &StateCall))
|
||||
{
|
||||
// collect all the results. Even one successful call signifies overall success.
|
||||
result |= StateCall.Result;
|
||||
|
|
|
@ -2611,7 +2611,7 @@ FxExpression *FxMultiNameState::Resolve(FCompileContext &ctx)
|
|||
CHECKRESOLVED();
|
||||
if (names[0] == NAME_None)
|
||||
{
|
||||
scope = ctx.cls;
|
||||
scope = NULL;
|
||||
}
|
||||
else if (names[0] == NAME_Super)
|
||||
{
|
||||
|
|
|
@ -465,9 +465,11 @@ int V_GetColorFromString (const DWORD *palette, const char *cstr)
|
|||
c[1] = (color & 0xff00) >> 8;
|
||||
c[2] = (color & 0xff);
|
||||
}
|
||||
else goto normal;
|
||||
}
|
||||
else
|
||||
{
|
||||
normal:
|
||||
// Treat it as a space-delemited hexadecimal string
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue