Class methods
a_bfg_spray(mo :
Pointer(
CDoom::Mobj))
Spawn a BFG explosion on every monster in view
Sourcea_boss_death(mo :
Pointer(
CDoom::Mobj))
Possibly trigger special effects
if on first boss level
Sourcea_chase(actor :
Pointer(
CDoom::Mobj))
Actor has a melee attack,
so it tries to close as fast as possible
Sourcea_fat_raise(actor :
Pointer(
CDoom::Mobj))
firing three missiles (bruisers)
in three different directions?
Doesn't look like it.
Sourcea_look(actor :
Pointer(
CDoom::Mobj))
Stay in state until a player is sighted.
Sourcea_lower(player :
Pointer(
CDoom::Player), psp :
Pointer(
CDoom::Pspdef))
Lowers current weapon,
and changes weapon at bottom.
Sourcea_pain_shoot_skull(actor :
Pointer(
CDoom::Mobj), angle :
CDoom::Angle)
Sourcea_refire(player :
Pointer(
CDoom::Player), psp :
Pointer(
CDoom::Pspdef))
The player can re-fire the weapon
without lowering it entirely.
Sourcea_skull_attack(actor :
Pointer(
CDoom::Mobj))
Fly at the player like a missile
Sourcea_start_fire(actor :
Pointer(
CDoom::Mobj))
Keep fire in front of player unless out of sight
Sourcea_vile_chase(actor :
Pointer(
CDoom::Mobj))
Check for ressurecting a body
Sourcea_weapon_ready(player :
Pointer(
CDoom::Player), psp :
Pointer(
CDoom::Pspdef))
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.
SourceThis 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.
Sourceam_add_mark
adds a marker at the current location
Sourceam_clear_fb(color :
Int32)
Clear automap frame buffer.
Sourceam_clip_mline(ml :
Pointer(
CDoom::Mline), fl :
Pointer(
CDoom::Fline)) :
CDoom::DoomBool 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.
SourceClassic Bresenham w/ whatever optimizations needed for speed
Sourceam_draw_grid(color :
Int32)
Draws flat (floor/ceiling tile) aligned grid lines.
Sourceam_draw_line_character(lineguy :
Pointer(
CDoom::Mline), lineguylines :
Int32, scale :
CDoom::Fixed, angle :
CDoom::Angle, color :
Int32, x :
CDoom::Fixed, y :
CDoom::Fixed)
SourceClip lines, draw visible part sof lines.
Sourceam_draw_walls
Determines visible lines, draws them.
This is LineDef based, not LineSeg based.
Sourceam_find_min_max_boundaries
Determines bounding box of all vertices,
sets global variables controlling zoom range.
Sourceam_level_init
should be called at the start of every level
right now, i figure it out myself
Sourceam_max_out_window_scale
set the window scale to the minimum size
Sourceam_min_out_window_scale
set the window scale to the maximum size
Sourceam_responder(ev :
Pointer(
CDoom::Event)) :
CDoom::DoomBool Handle events (user inputs) in automap mode
Sourceam_restore_scale_and_loc
Sourceam_rotate(x :
Pointer(
CDoom::Fixed), y :
Pointer(
CDoom::Fixed), a :
CDoom::Angle)
Rotation in 2D.
Used to rotate player arrow line character.
Sourcecht_check_cheat(cht :
Pointer(
CDoom::Cheatseq), key :
LibC::Char) :
LibC::Int Sourceconfirm_version
Confirms a WAD files type
based off of data in the WAD
Sourced_advance_demo
d_advance_demo
Called after each demo or intro demosequence finishes
Sourced_check_net_game
d_check_net_game
Works out player numbers among the net participants
Sourced_display
d_display
draw current display, possibly wiping it from the previous
Sourced_do_advance_demo
This cycles through the demo sequences.
Todo: FIXME - version dependend demo numbers?
Sourced_page_ticker
d_page_ticker
Handles timing for warped projection
Sourced_post_event(ev :
Pointer(
CDoom::Event))
d_post_event
Called by the I/O functions when input is detected
Sourced_process_events
d_process_events
Send all the events of the given timestamp down the responder chain
Sourced_quit_net_game
d_quit_net_game
Called before quitting to leave a net game
without hanging the other players
Sourcedoom_key_down(key : CDoom::DoomKey)
Sourcedoom_key_up(key : CDoom::DoomKey)
Sourcedoom_set_exit(exit_fn : CDoom::DoomExitFn)
Sourcedoom_set_file_io(open_fn : CDoom::DoomOpenFn, close_fn : CDoom::DoomCloseFn, read_fn : CDoom::DoomReadFn, write_fn : CDoom::DoomWriteFn, seek_fn : CDoom::DoomSeekFn, tell_fn : CDoom::DoomTellFn, eof_fn : CDoom::DoomEofFn)
Sourcedoom_set_getenv(getenv_fn : CDoom::DoomGetenvFn)
Sourcedoom_set_gettime(gettime_fn : CDoom::DoomGettimeFn)
Sourceev_build_stairs(line :
Pointer(
CDoom::Line), type :
CDoom::Stairenum) :
LibC::Int Sourceev_ceiling_crush_stop(line :
Pointer(
CDoom::Line)) :
LibC::Int Stop a ceiling from crushing!
Sourceev_do_ceiling(line :
Pointer(
CDoom::Line), type :
CDoom::Ceilingenum) :
LibC::Int Move a ceiling up/down and all around!
Sourceev_do_donut(line :
Pointer(
CDoom::Line)) :
LibC::Int Special Stuff that can not be categorized
Sourceev_do_door(line :
Pointer(
CDoom::Line), type :
CDoom::Vldoorenum) :
LibC::Int open a door manually, no tag value
Sourceev_do_floor(line :
Pointer(
CDoom::Line), floortype :
CDoom::Floorenum) :
LibC::Int Sourceev_do_locked_door(line :
Pointer(
CDoom::Line), type :
CDoom::Vldoorenum, thing :
Pointer(
CDoom::Mobj)) :
LibC::Int Sourceev_do_plat(line :
Pointer(
CDoom::Line), type :
CDoom::Plattype, amount :
LibC::Int) :
LibC::Int Do Platforms
"amount" is only used for SOME platforms.
Sourceev_light_turn_on(line :
Pointer(
CDoom::Line), bright :
LibC::Int)
Sourceev_start_light_strobing(line :
Pointer(
CDoom::Line))
Start strobing lights (usually from a trigger)
Sourceev_teleport(line :
Pointer(
CDoom::Line), side :
LibC::Int, thing :
Pointer(
CDoom::Mobj)) :
LibC::Int Sourceev_turn_tag_lights_off(line :
Pointer(
CDoom::Line))
TURN LINE'S TAG LIGHTS OFF
Sourcef_cast_responder(ev :
Pointer(
CDoom::Event)) :
CDoom::DoomBool Sourcef_responder(event :
Pointer(
CDoom::Event)) :
CDoom::DoomBool Sourcef_start_cast
Final DOOM 2 animation
Casting by id Software.
in order of appearance
Sourcefixed_div(a : CDoom::Fixed, b : CDoom::Fixed) : CDoom::Fixed
Sourcefixed_div2(a : CDoom::Fixed, b : CDoom::Fixed) : CDoom::Fixed
Sourcefixed_mul(a : CDoom::Fixed, b : CDoom::Fixed) : CDoom::Fixed
Sourceg_build_ticcmd(cmd :
Pointer(
CDoom::Ticcmd))
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
Sourceg_check_demo_status
===================
= 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
Sourceg_check_spot(playernum :
Int32, mthing :
Pointer(
CDoom::Mapthing)) :
CDoom::DoomBool Sourceg_defered_init_new(skill :
CDoom::Skill, episode :
Int32, map :
Int32)
g_init_new
Can be called by the startup code or the menu task,
consoleplayer, displayplayer, playeringame[] should be set.
Sourceg_init_player(player :
Int32)
g_init_player
Called at the start.
Called by the game initialization functions.
Sourceg_load_game
Can be called by the startup code or the menu task.
Sourceg_player_finish_level(player :
Int32)
g_player_finish_level
Can when a player completes a level.
Sourceg_player_reborn(player :
Int32)
g_player_reborn
Called after a player dies
almost everything is cleared and initialized
Sourceg_save_game
Called by the menu task.
Description is a 24 byte text string
Sourceg_secret_exit_level
Here's for the german edition. Literally 1984
Sourceg_ticker
g_ticker
Make ticcmds for the players.
SourceReturn sector_t * of sector next to current.
0 if not two-sided line
Sourceget_sector(current_sector :
LibC::Int, line :
LibC::Int, side :
LibC::Int) :
Pointer(
CDoom::Sector)
Will return a sector_t*
given the number of the current sector,
the line number and the side (0/1) that you want.
Sourceget_side(current_sector :
LibC::Int, line :
LibC::Int, side :
LibC::Int) :
Pointer(
CDoom::Side)
Will return a side_t*
given the number of the current sector,
the line number, and the side (0/1) that you want.
SourceThis function loads the sound data from the WAD lump,
for single sound.
Sourceh_get_packet
h_get_packet
Returns false if no packet is waiting
Sourcehulib_add_char_to_text_line(t :
Pointer(
CDoom::HU_Textline), ch :
UInt8) :
CDoom::DoomBool Sourcehulib_add_line_to_s_text(s :
Pointer(
CDoom::HU_Stext))
Sourcehulib_clear_text_line(t :
Pointer(
CDoom::HU_Textline))
Sourcehulib_del_char_from_i_text(it :
Pointer(
CDoom::HU_Itext))
The following deletion routines adhere to the left margin restriction
Sourcehulib_del_char_from_text_line(t :
Pointer(
CDoom::HU_Textline)) :
CDoom::DoomBool Sourcehulib_draw_i_text(it :
Pointer(
CDoom::HU_Itext))
Sourcehulib_draw_s_text(s :
Pointer(
CDoom::HU_Stext))
Sourcehulib_draw_text_line(l :
Pointer(
CDoom::HU_Textline), drawcursor :
CDoom::DoomBool)
Sourcehulib_erase_i_text(it :
Pointer(
CDoom::HU_Itext))
Sourcehulib_erase_line_from_i_text(it :
Pointer(
CDoom::HU_Itext))
Sourcehulib_erase_s_text(s :
Pointer(
CDoom::HU_Stext))
Sourcehulib_erase_text_line(l :
Pointer(
CDoom::HU_Textline))
sorta called by hu_erase and just better darn get things straight
Sourcehulib_key_in_i_text(it :
Pointer(
CDoom::HU_Itext), ch :
UInt8) :
CDoom::DoomBool wrapper function for handling general keyed input.
returns true if it ate the key
Sourcehulib_reset_i_text(it :
Pointer(
CDoom::HU_Itext))
Resets left margin as well
Sourcei_get_time
i_get_time
returns time in 1/70th second tics
Sourcei_qry_song_playing(handle : LibC::Int) : LibC::Int
Sourcei_set_music_volume(volume :
Int32)
MUSIC API - dummy. Some code from DOS version.
SourceStarting 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.
Sourcei_stop_song(handle : LibC::Int)
Sourcei_tactile(on : LibC::Int, off : LibC::Int, total : LibC::Int)
Sourcei_unregister_song(handle : LibC::Int)
Sourcei_update_sound
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.
Sourcei_update_sound_params(handle : LibC::Int, vol : LibC::Int, sep : LibC::Int, pitch : LibC::Int)
Sourcei_wait_vbl(count : LibC::Int)
Sourceidentify_version
identify_version
Checks availability of IWAD files by name,
to determine whether registered/commercial features
should be executed (notably loading PWAD's).
Sourcem_add_to_box(box :
Pointer(
CDoom::Fixed), x :
CDoom::Fixed, y :
CDoom::Fixed)
Sourcem_check_parm
Checks for the given parameter
in the program's command line arguments.
Returns the argument number (1 to argc-1)
or 0 if not present
Sourcem_responder calls this when user is finished
Sourcem_draw_readthis1
Read This Menus
Had a "quick hack to fix romero bug"
Sourcem_draw_readthis2
Read This Menus - optional second page.
SourceDraw border for the savegame description
Sourcem_draw_sound
Change Sfx & Music volumes
Sourcem_draw_text(x :
Int32, y :
Int32, direct :
CDoom::DoomBool, string :
Pointer(
LibC::Char)) :
LibC::Int Sourcem_draw_thermo(x : LibC::Int, y : LibC::Int, therm_width : LibC::Int, therm_dot : LibC::Int)
Sourcem_drawer
m_drawer
Called after the view has been rendered,
but before it has been blitted.
Sourcem_load_select(choice :
Int32)
User wants to load this game
Sourcem_read_save_strings
m_read_save_strings
read the strings from the savegame files
Sourcem_save_select(choice :
Int32)
User wants to save. Start string input for m_responder
SourceFind string height from hu_font chars
SourceFind string width from hu_font chars
Sourcem_write_file(name :
Pointer(
LibC::Char), source :
Pointer(
Void), length :
LibC::Int) :
CDoom::DoomBool SourceWrite a string using the hu_font
Sourcenet_update
net_update
Builds ticcmds for console player,
sends out a packet
Sourcep_activate_in_stasis(tag : LibC::Int)
Sourcep_activate_in_stasis_ceiling(line :
Pointer(
CDoom::Line))
Restart a ceiling that's in-stasis
Sourcep_add_thinker(thinker :
Pointer(
CDoom::Thinker))
Adds a new thinker at the end of the list.
Sourcep_aim_line_attack(t1 :
Pointer(
CDoom::Mobj), angle :
CDoom::Angle, distance :
CDoom::Fixed) :
CDoom::Fixed Sourcep_aprox_distance(dx : CDoom::Fixed, dy : CDoom::Fixed) : CDoom::Fixed
Gives an estimation of distance (not exact)
Sourcep_archive_specials(file :
File)
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
Sourcep_block_lines_iterator(x :
LibC::Int, y :
LibC::Int, func :
Proc(
Pointer(
CDoom::Line),
CDoom::DoomBool)) :
CDoom::DoomBool 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.
Sourcep_block_things_iterator(x :
LibC::Int, y :
LibC::Int, func :
Proc(
Pointer(
CDoom::Mobj),
CDoom::DoomBool)) :
CDoom::DoomBool Sourcep_box_on_line_side(tmbox :
Pointer(
CDoom::Fixed), ld :
Pointer(
CDoom::Line)) :
LibC::Int Considers the line to be infinite
Returns side 0 or 1, -1 if box crosses the line.
Sourcep_bring_up_weapon(player :
Pointer(
CDoom::Player))
Starts bringing the pending weapon up
from the bottom of the screen.
Uses player
Sourcep_bullet_slope(mo :
Pointer(
CDoom::Mobj))
Sets a slope so a near miss is at aproximately
the height of the intended target
Sourcep_calc_height(player :
Pointer(
CDoom::Player))
Calculate the walking / running height adjustment
Sourcep_change_sector(sector :
Pointer(
CDoom::Sector), crunch :
CDoom::DoomBool) :
CDoom::DoomBool Sourcep_change_switch_texture(line :
Pointer(
CDoom::Line), use_again :
LibC::Int)
Function that changes wall texture.
Tell it if switch is ok to use again (1=yes, it's a button).
Sourcep_check_ammo(player :
Pointer(
CDoom::Player)) :
CDoom::DoomBool Returns true if there is enough ammo to shoot.
If not, selects the next weapon to use.
Sourcep_check_melee_range(actor :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool Sourcep_check_missile_range(actor :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool Sourcep_check_missile_spawn(th :
Pointer(
CDoom::Mobj))
Moves the missile forward a bit
and possibly explodes it right there.
Sourcep_check_position(thing :
Pointer(
CDoom::Mobj), x :
CDoom::Fixed, y :
CDoom::Fixed) :
CDoom::DoomBool 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
Sourcep_check_sight(t1 :
Pointer(
CDoom::Mobj), t2 :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool Returns true
if a straight line between t1 and t2 is unobstructed.
Uses REJECT.
Sourcep_cross_bsp_node(bspnum : LibC::Int) : CDoom::DoomBool
Returns true
if strace crosses the given node successfully.
Sourcep_cross_special_line(linenum :
LibC::Int, side :
LibC::Int, thing :
Pointer(
CDoom::Mobj))
Called every time a thing origin is about
to cross a line with a non 0 special.
Sourcep_cross_subsector(num : LibC::Int) : CDoom::DoomBool
Returns true
if strace crosses the given subsector successfully.
Sourcep_damage_mobj(target :
Pointer(
CDoom::Mobj), inflictor :
Pointer(
CDoom::Mobj), source :
Pointer(
CDoom::Mobj), damage :
LibC::Int)
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.
Sourcep_divline_side(x :
CDoom::Fixed, y :
CDoom::Fixed, node :
Pointer(
CDoom::Divline)) :
LibC::Int Returns side 0 (front), 1 (back), or 2 (on).
Sourcep_drop_weapon(player :
Pointer(
CDoom::Player))
Player died, so put the weapon away.
Sourcep_find_highest_ceiling_surrounding(sec :
Pointer(
CDoom::Sector)) :
CDoom::Fixed FIND HIGHEST CEILING IN THE SURROUNDING SECTORS
Sourcep_find_highest_floor_surrounding(sec :
Pointer(
CDoom::Sector)) :
CDoom::Fixed FIND HIGHEST FLOOR HEIGHT IN SURROUNDING SECTORS
Sourcep_find_lowest_ceiling_surrounding(sec :
Pointer(
CDoom::Sector)) :
CDoom::Fixed FIND LOWEST CEILING IN THE SURROUNDING SECTORS
Sourcep_find_lowest_floor_surrounding(sec :
Pointer(
CDoom::Sector)) :
CDoom::Fixed FIND LOWEST FLOOR HEIGHT IN SURROUNDING SECTORS
Sourcep_find_min_surrounding_light(sector :
Pointer(
CDoom::Sector), max :
LibC::Int) :
LibC::Int Find minimum light from an adjacent sector
Sourcep_find_next_highest_floor(sec :
Pointer(
CDoom::Sector), currentheight :
LibC::Int) :
CDoom::Fixed FIND NEXT HIGHEST FLOOR IN SURROUNDING SECTORS
Note: this should be doable w/o a fixed array.
Sourcep_find_sector_from_line_tag(line :
Pointer(
CDoom::Line), start :
LibC::Int) :
LibC::Int RETURN NEXT SECTOR # THAT LINE TAG REFERS TO
Sourcep_give_ammo(player :
Pointer(
CDoom::Player), ammo :
CDoom::Ammotype, num :
LibC::Int) :
CDoom::DoomBool 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
Sourcep_give_armor(player :
Pointer(
CDoom::Player), armortype :
LibC::Int) :
CDoom::DoomBool Returns false if the armor is worse
than the current armor.
Sourcep_give_body(player :
Pointer(
CDoom::Player), num :
LibC::Int) :
CDoom::DoomBool Returns false if the body isn't needed at all
Sourcep_give_card(player :
Pointer(
CDoom::Player), card :
CDoom::Card)
Sourcep_give_power(player :
Pointer(
CDoom::Player), power :
LibC::Int) :
CDoom::DoomBool Sourcep_give_weapon(player :
Pointer(
CDoom::Player), weapon :
CDoom::Weapontype, dropped :
CDoom::DoomBool) :
CDoom::DoomBool The weapon name may have a MF_DROPPED flag ored in.
Sourcep_group_lines
Builds sector line lists and subsector sector numbers.
Finds block bounding boxes for sectors.
Sourcep_gunshot(mo :
Pointer(
CDoom::Mobj), accurate :
CDoom::DoomBool)
Sourcep_hit_slide_line(ld :
Pointer(
CDoom::Line))
Adjusts the xmove / ymove
so that the next move will slide along the wall.
Sourcep_init_switch_list
Only called at game initialization
Sourcep_intercept_vector(v2 :
Pointer(
CDoom::Divline), v1 :
Pointer(
CDoom::Divline)) :
CDoom::Fixed Returns the fractional intercept point
along the first divline.
This is only called by the addthings
and addlines traversers.
Sourcep_intercept_vector2(v2 :
Pointer(
CDoom::Divline), v1 :
Pointer(
CDoom::Divline)) :
CDoom::Fixed Returns the fractional intercept point
along the first divline.
This is only called by the addthings and addlines traversers.
Sourcep_line_attack(t1 :
Pointer(
CDoom::Mobj), angle :
CDoom::Angle, distance :
CDoom::Fixed, slope :
CDoom::Fixed, damage :
LibC::Int)
If damage == 0, it is just a test trace
that will leave linetarget set.
Sourcep_line_opening(linedef :
Pointer(
CDoom::Line))
Sets opentop and openbottom to the window
through a two sided line.
OPTIMIZE: keep this precalculated
Sourcep_load_blockmap(lump : LibC::Int)
Sourcep_load_linedefs(lump : LibC::Int)
Also counts secret lines for intermissions.
Sourcep_load_nodes(lump : LibC::Int)
Sourcep_load_sectors(lump : LibC::Int)
Sourcep_load_segs(lump : LibC::Int)
Sourcep_load_sidedefs(lump : LibC::Int)
Sourcep_load_subsectors(lump : LibC::Int)
Sourcep_load_things(lump : LibC::Int)
Sourcep_load_vertexes(lump : LibC::Int)
Sourcep_look_for_players(actor :
Pointer(
CDoom::Mobj), allaround :
CDoom::DoomBool) :
CDoom::DoomBool Sourcep_move_psprites(player :
Pointer(
CDoom::Player))
Called every tic by player thinking routine.
Sourcep_noise_alert(target :
Pointer(
CDoom::Mobj), emmiter :
Pointer(
CDoom::Mobj))
If a monster yells at a player,
it will alert other monsters to the player.
Sourcep_path_traverse(x1 :
CDoom::Fixed, y1 :
CDoom::Fixed, x2 :
CDoom::Fixed, y2 :
CDoom::Fixed, flags :
LibC::Int, trav :
Proc(
Pointer(
CDoom::Intercept),
CDoom::DoomBool)) :
CDoom::DoomBool 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.
Sourcep_player_in_special_sector(player :
Pointer(
CDoom::Player))
Called every tic frame
that the player origin is in a special sector
Sourcep_point_on_divline_side(x :
CDoom::Fixed, y :
CDoom::Fixed, line :
Pointer(
CDoom::Divline)) :
LibC::Int Sourcep_point_on_line_side(x :
CDoom::Fixed, y :
CDoom::Fixed, line :
Pointer(
CDoom::Line)) :
LibC::Int Sourcep_radius_attack(spot :
Pointer(
CDoom::Mobj), source :
Pointer(
CDoom::Mobj), damage :
LibC::Int)
Source is the creature that caused the explosion at spot.
Sourcep_random
Which one is deterministic?
Sourcep_recursive_sound(sec :
Pointer(
CDoom::Sector), soundblocks :
LibC::Int)
Called by p_noise_alert.
Recursively traverse adjacent sectors,
sound blocking lines cut off traversal.
Sourcep_remove_active_ceiling(c :
Pointer(
CDoom::Ceiling))
Remove a ceiling's thinker
Sourcep_remove_thinker(thinker :
Pointer(
CDoom::Thinker))
Deallocation is lazy -- it will not actually be freed
until its thinking turn comes up.
Sourcep_set_mobj_state(mobj :
Pointer(
CDoom::Mobj), state :
CDoom::Statenum) :
CDoom::DoomBool Sourcep_set_psprite(player :
Pointer(
CDoom::Player), position :
LibC::Int, stnum :
CDoom::Statenum)
Sourcep_setup_level(episode : LibC::Int, map : LibC::Int, playermask : LibC::Int, skill : CDoom::Skill)
Sourcep_setup_psprites(player :
Pointer(
CDoom::Player))
Called at start of level for each player.
Sourcep_shoot_special_line(thing :
Pointer(
CDoom::Mobj), line :
Pointer(
CDoom::Line))
Called when a thing shoots a special line.
Sourcep_slide_move(mo :
Pointer(
CDoom::Mobj))
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.
Sourcep_spawn_blood(x :
CDoom::Fixed, y :
CDoom::Fixed, z :
CDoom::Fixed, damage :
Int32)
Sourcep_spawn_door_close_in_30(sec :
Pointer(
CDoom::Sector))
Spawn a door that closes after 30 seconds
Sourcep_spawn_door_raise_in_5_mins(sec :
Pointer(
CDoom::Sector), secnum :
LibC::Int)
Spawn a door that opens after 5 minutes
Sourcep_spawn_light_flash(sector :
Pointer(
CDoom::Sector))
After the map has been loaded, scan each sector
for specials that spawn thinkers
Sourcep_spawn_map_thing(mthing :
Pointer(
CDoom::Mapthing))
The fields of the mapthing should
already be in host byte order.
Sourcep_spawn_mobj(x :
CDoom::Fixed, y :
CDoom::Fixed, z :
CDoom::Fixed, type :
CDoom::Mobjtype) :
Pointer(
CDoom::Mobj)
Sourcep_spawn_player(mthing :
Pointer(
CDoom::Mapthing))
Called when a player is spawned on the level.
Most of the player structure stays unchanged
between levels.
Sourcep_spawn_player_missile(source :
Pointer(
CDoom::Mobj), type :
CDoom::Mobjtype)
Tries to aim at a nearby monster
Sourcep_spawn_puff(x : CDoom::Fixed, y : CDoom::Fixed, z : CDoom::Fixed)
Sourcep_spawn_specials
Parses command line parameters.
Sourcep_spawn_strobe_flash(sector :
Pointer(
CDoom::Sector), fast_or_slow :
LibC::Int, in_sync :
LibC::Int)
After the map has been loaded, scan each sector
for specials that spawn thinkers
Sourcep_start_button(line :
Pointer(
CDoom::Line), w :
CDoom::Bwhere, texture :
LibC::Int, time :
LibC::Int)
Start a button counting down till it turns off.
Sourcep_teleport_move(thing :
Pointer(
CDoom::Mobj), x :
CDoom::Fixed, y :
CDoom::Fixed) :
CDoom::DoomBool Sourcep_thing_height_clip(thing :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool Sourcep_thrust(player :
Pointer(
CDoom::Player), angle :
CDoom::Angle, move :
CDoom::Fixed)
Moves the given origin along a given angle.
Sourcep_traverse_intercepts(func : CDoom::Traverser, maxfrac : CDoom::Fixed) : CDoom::DoomBool
Returns true if the traverser function returns true
for all lines.
Sourcep_try_move(thing :
Pointer(
CDoom::Mobj), x :
CDoom::Fixed, y :
CDoom::Fixed) :
CDoom::DoomBool Attempt to move to a new position,
crossing special lines unless MF_TELEPORT is set.
Sourcep_try_walk(actor :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool 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.
Sourcep_unset_thing_position(thing :
Pointer(
CDoom::Mobj))
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.
Sourcep_update_specials
Animate planes, scroll walls, etc.
Sourcep_use_lines(player :
Pointer(
CDoom::Player))
Looks for special lines in front of the player to activate.
Sourcep_use_special_line(thing :
Pointer(
CDoom::Mobj), line :
Pointer(
CDoom::Line), side :
LibC::Int) :
CDoom::DoomBool Called when a thing uses a special line.
Only the front sides of lines are usable.
Sourcepit_add_line_intercepts(ld :
Pointer(
CDoom::Line)) :
CDoom::DoomBool 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.
Sourcepit_add_thing_intercepts(thing :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool Sourcepit_change_sector(thing :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool Sourcepit_check_line(ld :
Pointer(
CDoom::Line)) :
CDoom::DoomBool Adjusts tmfloorz and tmceilingz as lines are contacted
Sourcepit_check_thing(thing :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool Sourcepit_radius_attack(thing :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool "bombsource" is the creature
that caused the explosion at "bombspot".
Sourcepit_stomp_thing(thing :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool Sourcepit_vile_check(thing :
Pointer(
CDoom::Mobj)) :
CDoom::DoomBool Detect a corpse that could be raised.
Sourceptr_aim_traverse(int :
Pointer(
CDoom::Intercept)) :
CDoom::DoomBool Sets linetaget and aimslope when a target is aimed at.
Sourceptr_shoot_traverse(int :
Pointer(
CDoom::Intercept)) :
CDoom::DoomBool Sourceptr_slide_traverse(int :
Pointer(
CDoom::Intercept)) :
CDoom::DoomBool Sourceptr_use_traverse(int :
Pointer(
CDoom::Intercept)) :
CDoom::DoomBool Sourcer_add_point_to_box(x :
LibC::Int, y :
LibC::Int, box :
Pointer(
CDoom::Fixed))
Expand a given bbox
so that it encloses a given point.
Sourcer_add_sprites(sec :
Pointer(
CDoom::Sector))
During BSP traversal, this adds sprites by sector.
Sourcer_addline(line :
Pointer(
CDoom::Seg))
Clips the given segment
and adds any visible pieces to the line list.
Sourcer_check_bbox(bspcoord :
Pointer(
CDoom::Fixed)) :
CDoom::DoomBool Checks BSP node/subtree bounding box.
Returns true
if some part of the bbox might be visible.
Sourcer_check_plane(pl :
Pointer(
CDoom::Visplane), start :
LibC::Int, stop :
LibC::Int) :
Pointer(
CDoom::Visplane)
Sourcer_check_texture_num_for_name(name :
Pointer(
LibC::Char)) :
LibC::Int Check whether texture is available.
Filter out NoTexture indicator.
Sourcer_clip_pass_wall_segment(first : LibC::Int, last : LibC::Int)
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.
Sourcer_clip_solid_wall_segment(first : LibC::Int, last : LibC::Int)
Does handle solid walls,
e.g. single sided LineDefs (middle texture)
that entirely block the view.
Sourcer_draw_column
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.
Sourcer_draw_column_in_cache(patch :
Pointer(
CDoom::Column), cache :
Pointer(
CDoom::Byte), originy :
LibC::Int, cacheheight :
LibC::Int)
Clip and draw a column
from a patch into a cached post.
Sourcer_draw_fuzz_column
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.
Sourcer_draw_masked_column(column :
Pointer(
CDoom::Column))
Used for sprites and masked mid textures.
Masked means: partly transparent, i.e. stored
in posts/runs of opaque pixels.
Sourcer_draw_planes
At the end of each frame.
Sourcer_draw_translated_column
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.
Sourcer_draw_view_border
Draws the border around the view
for different size windows?
Sourcer_draw_vis_sprite(vis :
Pointer(
CDoom::Vissprite), x1 :
LibC::Int, x2 :
LibC::Int)
Sourcer_fill_back_screen
Fills the back screen with a pattern
for variable screen sizes
Also draws a beveled edge.
Sourcer_find_plane(height :
CDoom::Fixed, picnum :
LibC::Int, lightlevel :
LibC::Int) :
Pointer(
CDoom::Visplane)
Sourcer_flat_num_for_name(name :
Pointer(
LibC::Char)) :
LibC::Int Retrieval, get a flat number for a flat name.
Sourcer_generate_composite(texnum : LibC::Int)
Using the texture definition,
the composite texture is created from the patches,
and each column is cached.
Sourcer_generate_lookup(texnum : LibC::Int)
Sourcer_get_column(tex :
LibC::Int, col :
LibC::Int) :
Pointer(
CDoom::Byte)
Sourcer_init_buffer(width : LibC::Int, height : LibC::Int)
Creats lookup tables that avoid
multiplies and other hazzles
for getting the framebuffer address
of a pixel to draw.
Sourcer_init_data
Locates all the lumps
that will be used by all views
Must be called after W_Init.
Sourcer_init_light_tables
Only inits the zlight table,
because the scalelight table changes with view size.
Sourcer_init_sky_map
Called whenever the view size changes.
SourcePass 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.
Sourcer_init_sprite_lumps
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.
Sourcer_init_texture_mapping
Sourcer_init_textures
Initializes the texture list
with the textures from the world map.
Sourcer_init_translation_tables
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.
Sourcer_install_sprite_lump(lump : LibC::Int, frame : LibC::UInt, rotation : LibC::UInt, flipped : CDoom::DoomBool)
Local function for R_InitSprites.
Sourcer_make_spans(x : LibC::Int, t1 : LibC::Int, b1 : LibC::Int, t2 : LibC::Int, b2 : LibC::Int)
Sourcer_map_plane(y : LibC::Int, x1 : LibC::Int, x2 : LibC::Int)
Uses global vars:
planeheight
ds_source
basexscale
baseyscale
viewx
viewy
BASIC PRIMITIVE
Sourcer_point_in_subsector(x :
CDoom::Fixed, y :
CDoom::Fixed) :
Pointer(
CDoom::Subsector)
Sourcer_point_on_seg_side(x :
CDoom::Fixed, y :
CDoom::Fixed, line :
Pointer(
CDoom::Seg)) :
LibC::Int Sourcer_point_on_side(x :
CDoom::Fixed, y :
CDoom::Fixed, node :
Pointer(
CDoom::Node)) :
LibC::Int Traverse BSP (sub) tree,
check point against partition plane.
Returns side 0 (front) or 1 (back).
Sourcer_point_to_angle(x : CDoom::Fixed, y : CDoom::Fixed) : CDoom::Angle
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.
Sourcer_point_to_angle2(x1 : CDoom::Fixed, y1 : CDoom::Fixed, x2 : CDoom::Fixed, y2 : CDoom::Fixed) : CDoom::Angle
Sourcer_point_to_dist(x : CDoom::Fixed, y : CDoom::Fixed) : CDoom::Fixed
Sourcer_precache_level
Preloads all relevant graphics for the level.
Sourcer_project_sprite(thing :
Pointer(
CDoom::Mobj))
Generates a vissprite for a thing
if it might be visible.
Sourcer_render_bsp_node(bspnum : LibC::Int)
Renders all subsectors below a given node,
traversing subtree recursively.
Just call with BSP root.
Sourcer_render_masked_seg_range(ds :
Pointer(
CDoom::Drawseg), x1 :
LibC::Int, x2 :
LibC::Int)
Sourcer_render_seg_loop
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.
Sourcer_scale_from_global_angle(visangle : CDoom::Angle) : CDoom::Fixed
Returns the texture mapping scale
for the current line (horizontal span)
at the given angle.
rw_distance must be calculated first.
Sourcer_set_view_size(blocks : LibC::Int, detail : LibC::Int)
Do not really change anything here,
because it might be in the middle of a refresh.
The change will take effect next refresh.
Sourcer_store_wall_range(start : LibC::Int, stop : LibC::Int)
A wall segment will be drawn
between start and stop pixels (inclusive).
Sourcer_subsector(num : LibC::Int)
Determine floor/ceiling planes.
Add sprites of things in sector.
Draw one or more line segments.
Sourcer_texture_num_for_name(name :
Pointer(
LibC::Char)) :
LibC::Int Calls R_CheckTextureNumForName,
aborts with error message.
Sourcer_video_erase(ofs : LibC::UInt, count : LibC::Int)
Sources_adjust_sound_params(listener :
Pointer(
CDoom::Mobj), source :
Pointer(
CDoom::Mobj), vol :
Pointer(
LibC::Int), sep :
Pointer(
LibC::Int), pitch :
Pointer(
LibC::Int)) :
LibC::Int 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.
Sources_change_music(musicnum : LibC::Int, looping : LibC::Int)
Sources_get_channel(origin :
Pointer(
Void), sfxinfo :
Pointer(
CDoom::Sfxinfo)) :
LibC::Int If none available, return -1. Otherwise channel #.
Sources_init(sfx_volume : LibC::Int, music_volume : LibC::Int)
Initializes sound stuff, including volume
Sets channels, SFX and music volume,
allocates channel buffer, sets S_sfx lookup.
Sources_pause_sound
Stop and resume music, during game PAUSE.
Sources_set_music_volume(volume : LibC::Int)
Sources_set_sfx_volume(volume : LibC::Int)
Sources_start
Per level startup code.
Kills playing sounds at start of level,
determines music if any, changes music.
Sources_start_music(m_id : LibC::Int)
Starts some music with the music id found in sounds.h.
Sources_start_sound_at_volume(origin_p :
Pointer(
Void), sfx_id :
LibC::Int, volume :
LibC::Int)
Sources_stop_channel(cnum : LibC::Int)
Sourceslope_div(num : LibC::UInt, den : LibC::UInt) : LibC::Int
Sourcest_drawer(fullscreen : CDoom::DoomBool, refresh : CDoom::DoomBool)
Sourcest_responder(ev :
Pointer(
CDoom::Event)) :
CDoom::DoomBool Respond to keyboard input events,
intercept cheats.
Sourcestlib_draw_num(n :
Pointer(
CDoom::ST_Number), refresh :
CDoom::DoomBool)
A fairly efficient way to draw a number
based on differences from the old number.
Note: worth the trouble?
Sourcestlib_init_bin_icon(b :
Pointer(
CDoom::ST_Binicon), x :
LibC::Int, y :
LibC::Int, i :
Pointer(
CDoom::Patch), val :
Pointer(
CDoom::DoomBool), on :
Pointer(
CDoom::DoomBool))
Sourcestlib_update_bin_icon(bi :
Pointer(
CDoom::ST_Binicon), refresh :
CDoom::DoomBool)
Sourcestlib_update_mult_icon(mi :
Pointer(
CDoom::ST_Multicon), refresh :
CDoom::DoomBool)
Sourcestlib_update_num(n :
Pointer(
CDoom::ST_Number), refresh :
CDoom::DoomBool)
Sourcestlib_update_percent(per :
Pointer(
CDoom::ST_Percent), refresh :
LibC::Int)
Sourcet_move_floor(floor :
Pointer(
CDoom::Floormove))
MOVE A FLOOR TO IT'S DESTINATION (UP OR DOWN)
Sourcet_move_plane(sector :
Pointer(
CDoom::Sector), speed :
CDoom::Fixed, dest :
CDoom::Fixed, crush :
CDoom::DoomBool, floor_or_ceiling :
LibC::Int, direction :
LibC::Int) :
CDoom::Result Sourcet_vertical_door(door :
Pointer(
CDoom::Vldoor))
Move a locked door up/down
Sourcetwo_sided(sector : LibC::Int, line : LibC::Int) : LibC::Int
Given the sector number and the line number,
it will tell you whether the line is two-sided or not.
Sourcev_copy_rect(srcx : LibC::Int, srcy : LibC::Int, srcscrn : LibC::Int, width : LibC::Int, height : LibC::Int, destx : LibC::Int, desty : LibC::Int, destscrn : LibC::Int)
Sourcev_draw_block(x :
LibC::Int, y :
LibC::Int, scrn :
LibC::Int, width :
LibC::Int, height :
LibC::Int, src :
Pointer(
CDoom::Byte))
Draw a linear block of pixels into the view buffer.
Sourcev_draw_patch(x :
LibC::Int, y :
LibC::Int, scrn :
LibC::Int, patch :
Pointer(
CDoom::Patch))
Masks a column based masked pic to the screen.
Sourcev_draw_patch_direct(x :
LibC::Int, y :
LibC::Int, scrn :
LibC::Int, patch :
Pointer(
CDoom::Patch))
Draws directly to the screen on the pc.
Sourcev_draw_patch_flipped(x :
LibC::Int, y :
LibC::Int, scrn :
LibC::Int, patch :
Pointer(
CDoom::Patch))
Masks a column based masked pic to the screen.
Flips horizontally, e.g. to mirror face.
Sourcev_draw_patch_rect_direct(x :
LibC::Int, y :
LibC::Int, scrn :
LibC::Int, patch :
Pointer(
CDoom::Patch), src_x :
LibC::Int, src_w :
LibC::Int)
Sourcev_get_block(x :
LibC::Int, y :
LibC::Int, scrn :
LibC::Int, width :
LibC::Int, height :
LibC::Int, dest :
Pointer(
CDoom::Byte))
Sourcev_mark_rect(x : LibC::Int, y : LibC::Int, width : LibC::Int, height : LibC::Int)
Sourcew_cache_lump_num(lump :
LibC::Int, tag :
LibC::Int) :
Pointer(
Void)
Sourcew_check_num_for_name(name :
Pointer(
LibC::Char)) :
LibC::Int Returns -1 if name not found.
Sourcew_get_num_for_name(name :
Pointer(
LibC::Char)) :
LibC::Int Calls w_check_num_for_name, but bombs out if not found.
Sourcew_init_file(filename :
Pointer(
LibC::Char))
Just initialize from a single file.
SourcePass 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.
Sourcew_lump_length(lump : LibC::Int) : LibC::Int
Returns the buffer size needed to load the given lump.
Sourcew_read_lump(lump :
LibC::Int, dest :
Pointer(
Void))
Loads the lump into the given buffer,
which must be >= w_lump_length().
Sourcew_reload
Flushes any of the reloadable lumps in memory
and reloads the directory.
Sourcewi_draw_deathmatch_stats
Sourcewi_draw_el
Draws "Entering <LevelName>"
Sourcewi_draw_lf
Draws "<Levelname> Finished!"
Sourcewi_draw_num(x : LibC::Int, y : LibC::Int, n : LibC::Int, digits : LibC::Int) : LibC::Int
Draws a number.
If digits > 0, then use that many digits minimum,
otherwise only use as many as necessary.
Returns new x position.
Sourcewi_draw_percent(x : LibC::Int, y : LibC::Int, p : LibC::Int)
Sourcewi_draw_time(x : LibC::Int, y : LibC::Int, t : LibC::Int)
Display level completion time and par,
or "sucks" message if overflow.
Sourcewi_frag_sum(playernum : LibC::Int) : LibC::Int
Sourcewi_init_deathmatch_stats
Sourcewi_init_variables(wbstartstruct :
Pointer(
CDoom::Wbstartstruct))
Sourcewi_update_deathmatch_stats
Sourcewrite_pcx_file(filename :
Pointer(
LibC::Char), data :
Pointer(
CDoom::Byte), width :
LibC::Int, height :
LibC::Int, palette :
Pointer(
CDoom::Byte))
Source