[go: up one dir, main page]

Menu

[904618]: / src / d_think.h  Maximize  Restore  History

Download this file

161 lines (138 with data), 5.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
// ----------------------------------------------------------------------------
// :oCCCCOCoc.
// .cCO8OOOOOOOOO8Oo:
// .oOO8OOOOOOOOOOOOOOOCc
// cO8888: .:oOOOOC. TM
// :888888: :CCCc .oOOOOC. ### ### #########
// C888888: .ooo: .C######## ##### ##### ###### ###### ##########
// O888888: .oO### ### ##### ##### ######## ######## #### ###
// C888888: :8O. .C########## ### #### ### ## ## ## ## #### ###
// :8@@@@8: :888c o### ### #### ### ######## ######## ##########
// :8@@@@C C@@@@ oo######## ### ## ### ###### ###### #########
// cO@@@@@@@@@@@@@@@@@Oc0
// :oO8@@@@@@@@@@Oo.
// .oCOOOOOCc. http://remood.org/
// ----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2008-2013 GhostlyDeath <ghostlydeath@remood.org>
// <ghostlydeath@gmail.com>
// ----------------------------------------------------------------------------
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// ----------------------------------------------------------------------------
// DESCRIPTION: MapObj data. Map Objects or mobjs are actors, entities,
// thinker, take-your-pick... anything that moves, acts, or
// suffers state changes of more or less violent nature.
#ifndef __D_THINK__
#define __D_THINK__
#include "doomtype.h"
//
// Experimental stuff.
// To compile this as "ANSI C with classes"
// we will need to handle the various
// action functions cleanly.
//
typedef void (*actionf_v) ();
typedef void (*actionf_p1) (void*);
typedef void (*actionf_p2) (void*, void*);
typedef void (*actionf_p3) (void*, void*, void*);
typedef void (*actionf_p4) (void*, void*, void*, void*);
typedef void (*actionf_p5) (void*, void*, void*, uint8_t, void*);
typedef union
{
actionf_v acv;
actionf_p1 acp1;
actionf_p2 acp2;
actionf_p3 acp3;
actionf_p4 acp4;
actionf_p5 acp5;
} actionf_t;
// Historically, "think_t" is yet another
// function pointer to a routine to handle
// an actor.
typedef actionf_t think_t;
/* Define P_ThinkerType_t */
#if !defined(__REMOOD_PTT_DEFINED)
typedef int P_ThinkerType_t;
#define __REMOOD_PTT_DEFINED
#endif
/* P_ThinkerType_t -- Type of thinker this is */
enum P_ThinkerType_e
{
PTT_CAP, // Thinker Cap
PTT_VERTICALDOOR, // T_VerticalDoor/vldoor_t
PTT_FIREFLICKER, // T_FireFlicker/fireflicker_t
PTT_LIGHTFLASH, // T_LightFlash/lightflash_t
PTT_STROBEFLASH, // T_StrobeFlash/strobe_t
PTT_GLOW, // T_Glow/glow_t
PTT_LIGHTFADE, // T_LightFade/lightlevel_t
PTT_MOVEFLOOR, // T_MoveFloor/floormove_t
PTT_MOVECEILING, // T_MoveCeiling/ceiling_t
PTT_PLATRAISE, // T_PlatRaise/plat_t
PTT_MOVEELEVATOR, // T_MoveElevator/elevator_t
PTT_SCROLL, // T_Scroll/scroll_t
PTT_FRICTION, // T_Friction/friction_t
PTT_PUSHER, // T_Pusher/pusher_t
PTT_MOBJ, // P_MobjThinker/mobj_t
PTT_DEFUNCT, // Defunct Object
PTT_DELETEME, // Deletes this thing
NUMPTHINKERTYPES
};
/* Define thinker_t */
#if !defined(__REMOOD_THINKERT_DEFINED)
typedef struct thinker_s thinker_t;
#define __REMOOD_THINKERT_DEFINED
#endif
// Doubly linked list of actors.
struct thinker_s
{
P_ThinkerType_t Type;
thinker_t* prev;
thinker_t* next;
think_t function;
};
extern thinker_t thinkercap;
extern thinker_t** g_ThinkerList; // List of thinkers
extern size_t g_NumThinkerList; // Thinkers in list
/* G_ThinkerInfo_t -- Thinker info (save games) */
typedef struct G_ThinkerInfo_s
{
size_t Size;
actionf_t Func;
} G_ThinkerInfo_t;
extern const G_ThinkerInfo_t g_ThinkerData[NUMPTHINKERTYPES]; // Thinker Data
actionf_t G_ThinkTypeToFunc(const P_ThinkerType_t a_Type);
P_ThinkerType_t G_ThinkFuncToType(actionf_t a_Func);
/* Define S_NoiseThinker_t */
#if !defined(__REMOOD_SNOISETHNK_DEFINED)
typedef struct S_NoiseThinker_s S_NoiseThinker_t;
#define __REMOOD_SNOISETHNK_DEFINED
#endif
/* S_NoiseThinker_t -- A thinker that makes noise */
struct S_NoiseThinker_s
{
uint32_t Flags; // Sound flags
/* World Position */
fixed_t x;
fixed_t y;
fixed_t z;
/* Momenntum */
// This is for doppler and such
fixed_t momx;
fixed_t momy;
fixed_t momz;
/* Other things */
fixed_t Pitch; // Pitch modification
fixed_t Volume; // Volume modification
angle_t Angle; // Angle
};
#endif