Doocr
Constants
Binary Angle Measument, BAM.
The blocks header word, matching to it's type and the following sub-header words
A mapping of the BEX code name to the Crystal pointer
The C Constant string name mapped to it's variables For cases interp, use to variables and split on '%s'
Demo compatible version (Gameplay version)
Midi info
Net compatible version (Netcode version)
Save compatible version (Save data version)
Class methods
Possibly trigger special effects if on first boss level
Actor has a melee attack, so it tries to close as fast as possible
firing three missiles (bruisers) in three different directions? Doesn't look like it.
Lowers current weapon, and changes weapon at bottom.
The player can re-fire the weapon without lowering it entirely.
The player can fire the weapon or change to another weapon at this time. Follows after getting weapon up, or after previous attack/fire sequence.
This function adds a sound to the list of currently active sounds, which is maintained as a given number (eight, usually) of internal channels. Returns a handle.
Automap clipping of lines.
Based on Cohen-Sutherland clipping algorithm but with a slightly faster reject and precalculated slopes. If the speed is needed, use a hash algorithm to handle the common cases.
Classic Bresenham w/ whatever optimizations needed for speed
Clip lines, draw visible part sof lines.
Determines bounding box of all vertices, sets global variables controlling zoom range.
Handle events (user inputs) in automap mode
Rotation in 2D. Used to rotate player arrow line character.
This cycles through the demo sequences. Todo: FIXME - version dependend demo numbers?
d_post_event Called by the I/O functions when input is detected
d_process_events Send all the events of the given timestamp down the responder chain
d_quit_net_game Called before quitting to leave a net game without hanging the other players
Adds a dehacked file Parses it and changes everything accordingly Supports pre-bex dehacked as well as bex
Parses a text block Although not a BEX extension, it uses DEH_STRINGS so I put it in here
BUILD A STAIRCASE!
Move a ceiling up/down and all around!
Special Stuff that can not be categorized
open a door manually, no tag value
Do Platforms "amount" is only used for SOME platforms.
Start strobing lights (usually from a trigger)
g_build_ticcmd Builds a ticcmd from all of the available inputs or reads it from the demo buffer. If recording a demo, write it out
===================
= g_check_demo_status
= Called after a death or level completion to allow demos to be cleaned up = Returns true if a new demo loop action will take place
g_init_new Can be called by the startup code or the menu task, consoleplayer, displayplayer, playeringame[] should be set.
g_init_player Called at the start. Called by the game initialization functions.
g_load_game Can be called by the startup code or the menu task.
g_player_finish_level Can when a player completes a level.
g_player_reborn Called after a player dies almost everything is cleared and initialized
g_save_game Called by the menu task. Description is a 24 byte text string
Return sector_t * of sector next to current. 0 if not two-sided line
Will return a sector_t* given the number of the current sector, the line number and the side (0/1) that you want.
Will return a side_t* given the number of the current sector, the line number, and the side (0/1) that you want.
This function loads the sound data from the WAD lump, for single sound.
The following deletion routines adhere to the left margin restriction
sorta called by hu_erase and just better darn get things straight
wrapper function for handling general keyed input. returns true if it ate the key
Starting a sound means adding it to the current list of active sounds in the internal channels. As the SFX info struct contains e.g. a pointer to the raw data, it is ignored. As our sound handling does not handle priority, it is ignored. Pitching (that is, increased speed of playback) is set, but currently not used by mixing.
This function loops all active (internal) sound channels, retrieves a given number of samples from the raw sound data, modifies it according to the current (internal) channel parameters, mixes the per channel samples into the global mixbuffer, clamping it to the allowed range, and sets up everything for transferring the contents of the mixbuffer to the (two) hardware channels (left and right, that is).
This function currently supports only 16bit.
identify_version Checks availability of IWAD files by name, to determine whether registered/commercial features should be executed (notably loading PWAD's).
Menu Methods
Gives an estimation of distance (not exact)
Things to handle:
T_MoveCeiling, (ceiling_t: sector_t * swizzle), - active list T_VerticalDoor, (vldoor_t: sector_t * swizzle), T_MoveFloor, (floormove_t: sector_t * swizzle), T_LightFlash, (lightflash_t: sector_t * swizzle), T_StrobeFlash, (strobe_t: sector_t *), T_Glow, (glow_t: sector_t *), T_PlatRaise, (plat_t: sector_t *), - active list
The validcount flags are used to avoid checking lines that are marked in multiple mapblocks, so increment validcount before the first call to P_BlockLinesIterator, then make one or more calls to it.
Considers the line to be infinite Returns side 0 or 1, -1 if box crosses the line.
Starts bringing the pending weapon up from the bottom of the screen. Uses player
Sets a slope so a near miss is at aproximately the height of the intended target
Calculate the walking / running height adjustment
Function that changes wall texture. Tell it if switch is ok to use again (1=yes, it's a button).
Returns true if there is enough ammo to shoot. If not, selects the next weapon to use.
Moves the missile forward a bit and possibly explodes it right there.
This is purely informative, nothing is modified (except things picked up).
in: a mobj_t (can be valid or invalid) a position to be checked (doesn't need to be related to the mobj_t->x,y)
during: special things are touched if MF_PICKUP early out on solid lines?
out: newsubsec floorz ceilingz tmdropoffz the lowest point contacted (monsters won't move to a dropoff) speciallines[] numspeciallines
Returns true if a straight line between t1 and t2 is unobstructed. Uses REJECT.
Returns true if strace crosses the given node successfully.
Called every time a thing origin is about to cross a line with a non 0 special.
Returns true if strace crosses the given subsector successfully.
Damages both enemies and players "inflictor" is the thing that caused the damage creature or missile, can be 0 (slime, etc) "source" is the thing to target after taking damage creature or 0 Source and inflictor are the same for melee attacks. Source can be 0 for slime, barrel explosions and other environmental stuff.
Returns side 0 (front), 1 (back), or 2 (on).
FIND HIGHEST CEILING IN THE SURROUNDING SECTORS
FIND HIGHEST FLOOR HEIGHT IN SURROUNDING SECTORS
FIND LOWEST CEILING IN THE SURROUNDING SECTORS
FIND LOWEST FLOOR HEIGHT IN SURROUNDING SECTORS
Find minimum light from an adjacent sector
FIND NEXT HIGHEST FLOOR IN SURROUNDING SECTORS Note: this should be doable w/o a fixed array.
RETURN NEXT SECTOR # THAT LINE TAG REFERS TO
Num is the number of clip loads, not the individual count (0= 1/2 clip). Returns false if the ammo can't be picked up at all
Returns false if the armor is worse than the current armor.
Returns false if the body isn't needed at all
The weapon name may have a MF_DROPPED flag ored in.
Builds sector line lists and subsector sector numbers. Finds block bounding boxes for sectors.
Adjusts the xmove / ymove so that the next move will slide along the wall.
Returns the fractional intercept point along the first divline. This is only called by the addthings and addlines traversers.
Returns the fractional intercept point along the first divline. This is only called by the addthings and addlines traversers.
If damage == 0, it is just a test trace that will leave linetarget set.
Sets opentop and openbottom to the window through a two sided line. OPTIMIZE: keep this precalculated
If a monster yells at a player, it will alert other monsters to the player.
Traces a line from x1,y1 to x2,y2, calling the traverser function for each. Returns true if the traverser function returns true for all lines.
Called every tic frame that the player origin is in a special sector
Returns 0 or 1
Source is the creature that caused the explosion at spot.
Called by p_noise_alert. Recursively traverse adjacent sectors, sound blocking lines cut off traversal.
Deallocation is lazy -- it will not actually be freed until its thinking turn comes up.
Called when a thing shoots a special line.
The momx / momy move is bad, so try to slide along a wall. Find the first line hit, move flush to it, and slide along it
This is a kludgy mess.
Spawn a door that closes after 30 seconds
Spawn a door that opens after 5 minutes
After the map has been loaded, scan each sector for specials that spawn thinkers
The fields of the mapthing should already be in host byte order.
Called when a player is spawned on the level. Most of the player structure stays unchanged between levels.
Tries to aim at a nearby monster
After the map has been loaded, scan each sector for specials that spawn thinkers
Start a button counting down till it turns off.
Moves the given origin along a given angle.
Returns true if the traverser function returns true for all lines.
Attempt to move to a new position, crossing special lines unless MF_TELEPORT is set.
Attempts to move actor on in its current (ob->moveangle) direction. If blocked by either a wall or an actor returns FALSE If move is either clear or blocked only by a door, returns TRUE and sets... If a door is in the way, an OpenDoor call is made to start it opening.
Unlinks a thing from block map and sectors. On each position change, BLOCKMAP and other lookups maintaining lists ot things inside these structures need to be updated.
Looks for special lines in front of the player to activate.
Called when a thing uses a special line. Only the front sides of lines are usable.
Looks for lines in the given block that intercept the given trace to add to the intercepts list.
A line is crossed if its endpoints are on opposite sides of the trace. Returns true if earlyout and a solid line hit.
Adjusts tmfloorz and tmceilingz as lines are contacted
"bombsource" is the creature that caused the explosion at "bombspot".
Detect a corpse that could be raised.
Sets linetaget and aimslope when a target is aimed at.
Expand a given bbox so that it encloses a given point.
During BSP traversal, this adds sprites by sector.
Clips the given segment and adds any visible pieces to the line list.
Checks BSP node/subtree bounding box. Returns true if some part of the bbox might be visible.
Check whether texture is available. Filter out NoTexture indicator.
Clips the given range of columns, but does not includes it in the clip list. Does handle windows, e.g. LineDefs with upper and lower texture.
Does handle solid walls, e.g. single sided LineDefs (middle texture) that entirely block the view.
A column is a vertical slice/span from a wall texture that, given the DOOM style restrictions on the view orientation, will always have constant z depth. Thus a special case loop for very fast rendering can be used. It has also been used with Wolfenstein 3D.
Clip and draw a column from a patch into a cached post.
Framebuffer postprocessing. Creates a fuzzy image by copying pixels from adjacent ones to left and right. Used with an all black colormap, this could create the SHADOW effect, i.e. spectres and invisible players.
Used for sprites and masked mid textures. Masked means: partly transparent, i.e. stored in posts/runs of opaque pixels.
Used to draw player sprites with the green colorramp mapped to others. Could be used with different translation tables, e.g. the lighter colored version of the BaronOfHell, the HellKnight, uses identical sprites, kinda brightened up.
Fills the back screen with a pattern for variable screen sizes Also draws a beveled edge.
Retrieval, get a flat number for a flat name.
Using the texture definition, the composite texture is created from the patches, and each column is cached.
Creats lookup tables that avoid multiplies and other hazzles for getting the framebuffer address of a pixel to draw.
Only inits the zlight table, because the scalelight table changes with view size.
Pass a null terminated list of sprite names (4 chars exactly) to be used. Builds the sprite rotation matrixes to account for horizontally flipped sprites. Will report an error if the lumps are inconsistant. Only called at startup.
Sprite lump names are 4 characters for the actor, a letter for the frame, and a number for the rotation. A sprite that is flippable will have an additional letter/number appended. The rotation character can be 0 to signify no rotations.
Finds the width and hoffset of all sprites in the wad, so the sprite does not need to be cached completely just for having the header info ready during rendering.
Creates the translation tables to map the green color ramp to gray, brown, red. Assumes a given structure of the PLAYPAL. Could be read from a lump instead.
Local function for R_InitSprites.
Uses global vars: planeheight ds_source basexscale baseyscale viewx viewy
BASIC PRIMITIVE
Traverse BSP (sub) tree, check point against partition plane. Returns side 0 (front) or 1 (back).
To get a global angle from cartesian coordinates, the coordinates are flipped until they are in the first octant of the coordinate system, then the y (<=x) is scaled and divided by x to get a tangent (slope) value which is looked up in the tantoangle[] table.
Generates a vissprite for a thing if it might be visible.
Renders all subsectors below a given node, traversing subtree recursively. Just call with BSP root.
Draws zero, one, or two textures (and possibly a masked texture) for walls. Can draw or mark the starting pixel of floor and ceiling textures. CALLED: CORE LOOPING ROUTINE.
Returns the texture mapping scale for the current line (horizontal span) at the given angle. rw_distance must be calculated first.
Do not really change anything here, because it might be in the middle of a refresh. The change will take effect next refresh.
A wall segment will be drawn between start and stop pixels (inclusive).
Determine floor/ceiling planes. Add sprites of things in sector. Draw one or more line segments.
Calls R_CheckTextureNumForName, aborts with error message.
Changes volume, stereo-separation, and pitch variables from the norm of a sound effect to be played. If the sound is not audible, returns a 0. Otherwise, modifies parameters and returns 1.
If none available, return -1. Otherwise channel #.
Initializes sound stuff, including volume Sets channels, SFX and music volume, allocates channel buffer, sets S_sfx lookup.
Per level startup code. Kills playing sounds at start of level, determines music if any, changes music.
Respond to keyboard input events, intercept cheats.
A fairly efficient way to draw a number based on differences from the old number. Note: worth the trouble?
?
Given the sector number and the line number, it will tell you whether the line is two-sided or not.
Draw a linear block of pixels into the view buffer.
Masks a column based masked pic to the screen.
Draws directly to the screen on the pc.
Masks a column based masked pic to the screen. Flips horizontally, e.g. to mirror face.
Calls w_check_num_for_name, but bombs out if not found.
Pass a null terminated list of files to use. All files are optional, but at least one file must be found. Files with a .wad extension are idlink files with multiple lumps. Other files are single lumps with the base filename for the lump name. Lump names can appear multiple times. The name searcher looks backwards, so a later file does override all earlier ones.
Returns the buffer size needed to load the given lump.
Loads the lump into the given buffer, which must be >= w_lump_length().
Draws a number. If digits > 0, then use that many digits minimum, otherwise only use as many as necessary. Returns new x position.
Display level completion time and par, or "sucks" message if overflow.