module

LibDoom

Constants

ANG180 = 2147483648_i64
ANG270 = 3221225472_i64
ANG45 = 536870912

Binary Angle Measument, BAM.

ANG90 = 1073741824
BOTTOM = 4
DBITS = (FRACBITS - SLOPEBITS)
FINEANGLES = 8192
FINEMASK = (FINEANGLES - 1)
FINESINE_SIZE = (5 * FINEANGLES) // 4
FINETANGENT_SIZE = FINEANGLES // 2
FRACBITS = 16
FRACUNIT = (1 << FRACBITS)
LASTMESSAGE_SIZE = CDoom::HU_MAXLINELENGTH + 1
LEFT = 1
MENU_SCROLL_DEADZONE = 80
MIDI_BANK = 16

TODO: make a setting

MIDI_BUFFER_SIZE = 2048

Midi info

MIDI_SAMPLE_RATE = 44100
MIDI_TICK_TIME = 1.0 / 140.0
NCMD_CHECKSUM = 67108863
NCMD_CONNECT = 134217728
NCMD_DISTRIBUTE = 67108864
NCMD_EXIT = 2147483648_i64
NCMD_KILL = 268435456
NCMD_RETRANSMIT = 1073741824
NCMD_SETUP = 536870912
NULL_PROC = Proc(Nil).new(Pointer(Void).null, Pointer(Void).null)
NULL_PROCP1 = Proc(Int32, Nil).new(Pointer(Void).null, Pointer(Void).null)
PI = 3.141592657
PL_DRONE = 128
RESENDCOUNT = 10
RIGHT = 2
SLOPEBITS = 11
SLOPERANGE = 2048
SRES_X = 320

The resolutions of the render target the screen puts on the screen

SRES_Y = 240
TANTOANGLE_SIZE = SLOPERANGE + 1
TOP = 8
VERSION = 10
VERSION_STR = "1.0"

Class methods

a_baby_metal(mo : Pointer(CDoom::Mobj))
Source
a_bfg_sound(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_bfg_spray(mo : Pointer(CDoom::Mobj))

Spawn a BFG explosion on every monster in view

Source
a_boss_death(mo : Pointer(CDoom::Mobj))

Possibly trigger special effects if on first boss level

Source
a_brain_awake(mo : Pointer(CDoom::Mobj))
Source
a_brain_die(mo : Pointer(CDoom::Mobj))
Source
a_brain_explode(mo : Pointer(CDoom::Mobj))
Source
a_brain_pain(mo : Pointer(CDoom::Mobj))
Source
a_brain_scream(mo : Pointer(CDoom::Mobj))
Source
a_brain_spit(mo : Pointer(CDoom::Mobj))
Source
a_bruis_attack(actor : Pointer(CDoom::Mobj))
Source
a_bspi_attack(actor : Pointer(CDoom::Mobj))
Source
a_chase(actor : Pointer(CDoom::Mobj))

Actor has a melee attack, so it tries to close as fast as possible

Source
a_check_reload(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_close_shotgun2(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_cpos_attack(actor : Pointer(CDoom::Mobj))
Source
a_cpos_refire(actor : Pointer(CDoom::Mobj))
Source
a_cyber_attack(actor : Pointer(CDoom::Mobj))
Source
a_explode(thingy : Pointer(CDoom::Mobj))
Source
a_face_target(actor : Pointer(CDoom::Mobj))
Source
a_fall(actor : Pointer(CDoom::Mobj))
Source
a_fat_attack1(actor : Pointer(CDoom::Mobj))
Source
a_fat_attack2(actor : Pointer(CDoom::Mobj))
Source
a_fat_attack3(actor : Pointer(CDoom::Mobj))
Source
a_fat_raise(actor : Pointer(CDoom::Mobj))

firing three missiles (bruisers) in three different directions? Doesn't look like it.

Source
a_fire(actor : Pointer(CDoom::Mobj))
Source
a_fire_bfg(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_fire_cgun(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_fire_crackle(actor : Pointer(CDoom::Mobj))
Source
a_fire_missile(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_fire_pistol(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_fire_plasma(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_fire_shotgun(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_fire_shotgun2(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_gun_flash(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_head_attack(actor : Pointer(CDoom::Mobj))
Source
a_hoof(mo : Pointer(CDoom::Mobj))
Source
a_keen_die(mo : Pointer(CDoom::Mobj))
Source
a_light0(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_light1(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_light2(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_load_shotgun2(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_look(actor : Pointer(CDoom::Mobj))

Stay in state until a player is sighted.

Source
a_lower(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))

Lowers current weapon, and changes weapon at bottom.

Source
a_metal(mo : Pointer(CDoom::Mobj))
Source
a_open_shotgun2(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_pain(actor : Pointer(CDoom::Mobj))
Source
a_pain_attack(actor : Pointer(CDoom::Mobj))
Source
a_pain_die(actor : Pointer(CDoom::Mobj))
Source
a_pain_shoot_skull(actor : Pointer(CDoom::Mobj), angle : CDoom::Angle)
Source
a_player_scream(mo : Pointer(CDoom::Mobj))
Source
a_pos_attack(actor : Pointer(CDoom::Mobj))
Source
a_punch(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_raise(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_refire(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))

The player can re-fire the weapon without lowering it entirely.

Source
a_sarg_attack(actor : Pointer(CDoom::Mobj))
Source
a_saw(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef))
Source
a_scream(actor : Pointer(CDoom::Mobj))
Source
a_skel_fist(actor : Pointer(CDoom::Mobj))
Source
a_skel_missile(actor : Pointer(CDoom::Mobj))
Source
a_skel_whoosh(actor : Pointer(CDoom::Mobj))
Source
a_skull_attack(actor : Pointer(CDoom::Mobj))

Fly at the player like a missile

Source
a_spawn_fly(mo : Pointer(CDoom::Mobj))
Source
a_spawn_sound(mo : Pointer(CDoom::Mobj))

travelling cube sound

Source
a_spid_refire(actor : Pointer(CDoom::Mobj))
Source
a_spos_attack(actor : Pointer(CDoom::Mobj))
Source
a_start_fire(actor : Pointer(CDoom::Mobj))

Keep fire in front of player unless out of sight

Source
a_tracer(actor : Pointer(CDoom::Mobj))
Source
a_troop_attack(actor : Pointer(CDoom::Mobj))
Source
a_vile_attack(actor : Pointer(CDoom::Mobj))
Source
a_vile_chase(actor : Pointer(CDoom::Mobj))

Check for ressurecting a body

Source
a_vile_start(actor : Pointer(CDoom::Mobj))
Source
a_vile_target(actor : Pointer(CDoom::Mobj))

Spawn the hellfire

Source
a_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.

Source
a_xscream(actor : Pointer(CDoom::Mobj))
Source
addsfx(sfxid : Int32, volume : Int32, step : Int32, seperation : Int32) : Int32

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.

Source
am_activate_new_scale
Source
am_add_mark

adds a marker at the current location

Source
am_change_window_loc
Source
am_change_window_scale

Zooming

Source
am_clear_fb(color : Int32)

Clear automap frame buffer.

Source
am_clear_marks
Source
am_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.

Source
am_do_follow_player
Source
am_draw_crosshair(color : Int32)
Source
am_draw_fline(fl : Pointer(CDoom::Fline), color : Int32)

Classic Bresenham w/ whatever optimizations needed for speed

Source
am_draw_grid(color : Int32)

Draws flat (floor/ceiling tile) aligned grid lines.

Source
am_draw_line_character(lineguy : Pointer(CDoom::Mline), lineguylines : Int32, scale : CDoom::Fixed, angle : CDoom::Angle, color : Int32, x : CDoom::Fixed, y : CDoom::Fixed)
Source
am_draw_marks
Source
am_draw_mline(ml : Pointer(CDoom::Mline), color : Int32)

Clip lines, draw visible part sof lines.

Source
am_draw_players
Source
am_draw_things(colors : Int32, colorrange : Int32)
Source
am_draw_walls

Determines visible lines, draws them. This is LineDef based, not LineSeg based.

Source
am_drawer
Source
am_find_min_max_boundaries

Determines bounding box of all vertices, sets global variables controlling zoom range.

Source
am_init_variables
Source
am_level_init

should be called at the start of every level right now, i figure it out myself

Source
am_load_pics
Source
am_max_out_window_scale

set the window scale to the minimum size

Source
am_min_out_window_scale

set the window scale to the maximum size

Source
am_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool

Handle events (user inputs) in automap mode

Source
am_restore_scale_and_loc
Source
am_rotate(x : Pointer(CDoom::Fixed), y : Pointer(CDoom::Fixed), a : CDoom::Angle)

Rotation in 2D. Used to rotate player arrow line character.

Source
am_save_scale_and_loc
Source
am_start
Source
am_stop
Source
am_ticker

Updates on Game Tick

Source
am_unload_pics
Source
am_update_light_lev
Source
bind_to_local_port(socket : UDPSocket, port : Int32)
Source
check_abort

check_abort

Source
cht_check_cheat(cht : Pointer(CDoom::Cheatseq), key : LibC::Char) : LibC::Int
Source
cht_get_param(cht : Pointer(CDoom::Cheatseq), buffer : Pointer(LibC::Char))
Source
confirm_version

Confirms a WAD files type based off of data in the WAD

Source
d_add_file(file : Pointer(UInt8))
Source
d_advance_demo

d_advance_demo Called after each demo or intro demosequence finishes

Source
d_arbitrate_net_start

d_arbitrate_net_start

Source
d_check_net_game

d_check_net_game Works out player numbers among the net participants

Source
d_display

d_display draw current display, possibly wiping it from the previous

Source
d_do_advance_demo

This cycles through the demo sequences. Todo: FIXME - version dependend demo numbers?

Source
d_doom_loop
Source
d_doom_main

d_doom_main

Source
d_page_drawer
Source
d_page_ticker

d_page_ticker Handles timing for warped projection

Source
d_post_event(ev : Pointer(CDoom::Event))

d_post_event Called by the I/O functions when input is detected

Source
d_process_events

d_process_events Send all the events of the given timestamp down the responder chain

Source
d_quit_net_game

d_quit_net_game Called before quitting to leave a net game without hanging the other players

Source
d_start_title
Source
doom_atoi(str : Pointer(UInt8)) : Int32
Source
doom_atox(str : Pointer(UInt8)) : Int32
Source
doom_button_down(button : CDoom::DoomButton)
Source
doom_button_up(button : CDoom::DoomButton)
Source
doom_close_impl(handle : Pointer(Void))
Source
doom_concat(dst : Pointer(UInt8), src : Pointer(UInt8)) : Pointer(UInt8)
Source
doom_ctoa(c : UInt8) : Pointer(UInt8)
Source
doom_draw
Source
doom_eof_impl(handle : Pointer(Void)) : Int32
Source
doom_exit_impl(code : Int32)
Source
doom_fprint(handle : Pointer(Void), str : Pointer(UInt8)) : Int32
Source
doom_get_sound_buffer
Source
doom_getenv_impl(var : Pointer(UInt8)) : Pointer(UInt8)
Source
doom_gettime_impl(sec : Pointer(Int32), usec : Pointer(Int32))
Source
doom_htonl(x : UInt32) : UInt32
Source
doom_htons(x : Int16) : Int16
Source
doom_init(argc : Int32, argv : Pointer(Pointer(UInt8)), flags : Int32)
Source
doom_itoa(k : Int32, radix : Int32) : Pointer(UInt8)
Source
doom_key_down(key : CDoom::DoomKey)
Source
doom_key_up(key : CDoom::DoomKey)
Source
doom_memcpy(destination : Pointer(Void), source : Pointer(Void), num : Int32) : Pointer(Void)
Source
doom_memset(ptr : Pointer(Void), value : Int32, num : Int32)
Source
doom_mouse_move(delta_x : Int32, delta_y : Int32)
Source
doom_open_impl(filename : Pointer(UInt8), mode : Pointer(UInt8)) : Pointer(Void)
Source
doom_ptoa(p : Pointer(Void)) : Pointer(UInt8)
Source
doom_read_impl(handle : Pointer(Void), buf : Pointer(Void), count : Int32) : Int32
Source
doom_seek_impl(handle : Pointer(Void), offset : Int32, origin : CDoom::DoomSeek) : Int32
Source
doom_set_exit(exit_fn : CDoom::DoomExitFn)
Source
doom_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)
Source
doom_set_getenv(getenv_fn : CDoom::DoomGetenvFn)
Source
doom_set_gettime(gettime_fn : CDoom::DoomGettimeFn)
Source
doom_strcasecmp(str1 : Pointer(UInt8), str2 : Pointer(UInt8)) : Int32
Source
doom_strcmp(str1 : Pointer(UInt8), str2 : Pointer(UInt8)) : Int32
Source
doom_strcpy(dst : Pointer(UInt8), src : Pointer(UInt8)) : Pointer(UInt8)
Source
doom_strlen(str : Pointer(UInt8)) : Int32
Source
doom_strncasecmp(str1 : Pointer(UInt8), str2 : Pointer(UInt8), n : Int32) : Int32
Source
doom_strncmp(str1 : Pointer(UInt8), str2 : Pointer(UInt8), n : Int32) : Int32
Source
doom_strncpy(dst : Pointer(UInt8), src : Pointer(UInt8), num : Int32) : Pointer(UInt8)
Source
doom_strupr(s : Pointer(LibC::Char))
Source
doom_tell_impl(handle : Pointer(Void)) : Int32
Source
doom_tick_midi
Source
doom_toupper(c : Int32) : Int32
Source
doom_write_impl(handle : Pointer(Void), buf : Pointer(Void), count : Int32) : Int32
Source
ev_build_stairs(line : Pointer(CDoom::Line), type : CDoom::Stairenum) : LibC::Int

BUILD A STAIRCASE!

Source
ev_ceiling_crush_stop(line : Pointer(CDoom::Line)) : LibC::Int

Stop a ceiling from crushing!

Source
ev_do_ceiling(line : Pointer(CDoom::Line), type : CDoom::Ceilingenum) : LibC::Int

Move a ceiling up/down and all around!

Source
ev_do_donut(line : Pointer(CDoom::Line)) : LibC::Int

Special Stuff that can not be categorized

Source
ev_do_door(line : Pointer(CDoom::Line), type : CDoom::Vldoorenum) : LibC::Int

open a door manually, no tag value

Source
ev_do_floor(line : Pointer(CDoom::Line), floortype : CDoom::Floorenum) : LibC::Int
Source
ev_do_locked_door(line : Pointer(CDoom::Line), type : CDoom::Vldoorenum, thing : Pointer(CDoom::Mobj)) : LibC::Int
Source
ev_do_plat(line : Pointer(CDoom::Line), type : CDoom::Plattype, amount : LibC::Int) : LibC::Int

Do Platforms "amount" is only used for SOME platforms.

Source
ev_light_turn_on(line : Pointer(CDoom::Line), bright : LibC::Int)
Source
ev_start_light_strobing(line : Pointer(CDoom::Line))

Start strobing lights (usually from a trigger)

Source
ev_stop_plat(line : Pointer(CDoom::Line))
Source
ev_teleport(line : Pointer(CDoom::Line), side : LibC::Int, thing : Pointer(CDoom::Mobj)) : LibC::Int
Source
ev_turn_tag_lights_off(line : Pointer(CDoom::Line))

TURN LINE'S TAG LIGHTS OFF

Source
ev_vertical_door(line : Pointer(CDoom::Line), thing : Pointer(CDoom::Mobj))
Source
expand_tics(low : Int32) : Int32
Source
extract_file_base(path : Pointer(LibC::Char), dest : Pointer(LibC::Char))
Source
f_bunny_scroll

f_bunny_scroll

Source
f_cast_drawer

f_cast_drawer

Source
f_cast_print(text : Pointer(UInt8))
Source
f_cast_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool
Source
f_cast_ticker

f_cast_ticker

Source
f_draw_patch_col(x : Int32, patch : Pointer(CDoom::Patch), col : Int32)

f_draw_patch_col

Source
f_drawer
Source
f_responder(event : Pointer(CDoom::Event)) : CDoom::DoomBool
Source
f_start_cast

Final DOOM 2 animation Casting by id Software. in order of appearance

Source
f_start_finale

f_start_finale

Source
f_text_write

f_text_write

Source
f_ticker

f_ticker

Source
find_response_file

Find a Response File

Source
fixed_div(a : CDoom::Fixed, b : CDoom::Fixed) : CDoom::Fixed
Source
fixed_div2(a : CDoom::Fixed, b : CDoom::Fixed) : CDoom::Fixed
Source
fixed_mul(a : CDoom::Fixed, b : CDoom::Fixed) : CDoom::Fixed
Source
foreign_translation(ch : UInt8) : UInt8
Source
g_begin_recording
Source
g_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

Source
g_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

Source
g_check_spot(playernum : Int32, mthing : Pointer(CDoom::Mapthing)) : CDoom::DoomBool
Source
g_deathmatch_spawn_player(playernum : Int32)
Source
g_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.

Source
g_defered_play_demo(name : Pointer(UInt8))
Source
g_despawn_player(playernum : Int32)
Source
g_do_completed
Source
g_do_load_game
Source
g_do_load_level

g_do_load_level

Source
g_do_new_game
Source
g_do_play_demo
Source
g_do_reborn(playernum : Int32)

g_do_reborn

Source
g_do_save_game
Source
g_do_world_done

g_do_world_done

Source
g_exit_level
Source
g_init_new(skill : CDoom::Skill, episode : Int32, map : Int32)
Source
g_init_player(player : Int32)

g_init_player Called at the start. Called by the game initialization functions.

Source
g_load_game(name : Pointer(UInt8))

g_load_game Can be called by the startup code or the menu task.

Source
g_player_finish_level(player : Int32)

g_player_finish_level Can when a player completes a level.

Source
g_player_reborn(player : Int32)

g_player_reborn Called after a player dies almost everything is cleared and initialized

Source
g_read_demo_ticcmd(cmd : Pointer(CDoom::Ticcmd))

DEMO RECORDING

Source
g_record_demo(name : Pointer(UInt8))

g_record_demo

Source
g_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool
Source
g_save_game(slot : Int32, description : Pointer(UInt8))

g_save_game Called by the menu task. Description is a 24 byte text string

Source
g_screenshot
Source
g_secret_exit_level

Here's for the german edition. Literally 1984

Source
g_ticker

g_ticker Make ticcmds for the players.

Source
g_time_demo(name : Pointer(UInt8))

g_time_demo

Source
g_world_done

g_world_done

Source
g_write_demo_ticcmd(cmd : Pointer(CDoom::Ticcmd))
Source
get_local_address
Source
get_next_sector(line : Pointer(CDoom::Line), sec : Pointer(CDoom::Sector)) : Pointer(CDoom::Sector)

Return sector_t * of sector next to current. 0 if not two-sided line

Source
get_packets

get_packets

Source
get_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.

Source
get_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.

Source
getsfx(sfxname : Pointer(UInt8), len : Pointer(Int32)) : Pointer(Void)

This function loads the sound data from the WAD lump, for single sound.

Source
h_get_packet

h_get_packet Returns false if no packet is waiting

Source
h_send_packet(node : Int32, flags : Int32)
Source
hu_dequeue_chat_char
Source
hu_drawer
Source
hu_erase
Source
hu_init
Source
hu_queue_chat_char(c : UInt8)
Source
hu_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool
Source
hu_start
Source
hu_stop
Source
hu_ticker
Source
hulib_add_char_to_text_line(t : Pointer(CDoom::HU_Textline), ch : UInt8) : CDoom::DoomBool
Source
hulib_add_line_to_s_text(s : Pointer(CDoom::HU_Stext))
Source
hulib_add_message_to_s_text(s : Pointer(CDoom::HU_Stext), prefix : Pointer(UInt8), msg : Pointer(UInt8))
Source
hulib_add_prefix_to_i_text(it : Pointer(CDoom::HU_Itext), str : Pointer(UInt8))
Source
hulib_clear_text_line(t : Pointer(CDoom::HU_Textline))
Source
hulib_del_char_from_i_text(it : Pointer(CDoom::HU_Itext))

The following deletion routines adhere to the left margin restriction

Source
hulib_del_char_from_text_line(t : Pointer(CDoom::HU_Textline)) : CDoom::DoomBool
Source
hulib_draw_i_text(it : Pointer(CDoom::HU_Itext))
Source
hulib_draw_s_text(s : Pointer(CDoom::HU_Stext))
Source
hulib_draw_text_line(l : Pointer(CDoom::HU_Textline), drawcursor : CDoom::DoomBool)
Source
hulib_erase_i_text(it : Pointer(CDoom::HU_Itext))
Source
hulib_erase_line_from_i_text(it : Pointer(CDoom::HU_Itext))
Source
hulib_erase_s_text(s : Pointer(CDoom::HU_Stext))
Source
hulib_erase_text_line(l : Pointer(CDoom::HU_Textline))

sorta called by hu_erase and just better darn get things straight

Source
hulib_init_i_text(it : Pointer(CDoom::HU_Itext), x : Int32, y : Int32, font : Pointer(Pointer(CDoom::Patch)), startchar : Int32, on : Pointer(CDoom::DoomBool))
Source
hulib_init_s_text(s : Pointer(CDoom::HU_Stext), x : Int32, y : Int32, h : Int32, font : Pointer(Pointer(CDoom::Patch)), startchar : Int32, on : Pointer(CDoom::DoomBool))
Source
hulib_init_text_line(t : Pointer(CDoom::HU_Textline), x : Int32, y : Int32, f : Pointer(Pointer(CDoom::Patch)), sc : Int32)
Source
hulib_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

Source
hulib_reset_i_text(it : Pointer(CDoom::HU_Itext))

Resets left margin as well

Source
i_alloc_low(length : LibC::Int) : Pointer(CDoom::Byte)
Source
i_base_ticcmd
Source
i_error(error : String)

i_error

Source
i_finish_update
Source
i_get_heap_size
Source
i_get_sfx_lump_num(sfx : Pointer(CDoom::Sfxinfo)) : Int32
Source
i_get_time

i_get_time returns time in 1/70th second tics

Source
i_init

i_init

Source
i_init_graphics
Source
i_init_music

MUSIC API.

Source
i_init_network
Source
i_init_sound
Source
i_net_cmd
Source
i_pause_song(handle : Int32)
Source
i_play_song(handle : Int32, looping : Int32)
Source
i_qry_song_playing(handle : LibC::Int) : LibC::Int

Is the song playing?

Source
i_quit

i_quit

Source
i_read_screen(scr : Pointer(CDoom::Byte))
Source
i_register_song(data : Pointer(Void)) : LibC::Int
Source
i_resume_song(handle : Int32)
Source
i_set_channels
Source
i_set_music_volume(volume : Int32)

MUSIC API - dummy. Some code from DOS version.

Source
i_set_palette(palette : Pointer(CDoom::Byte))
Source
i_set_sfx_volume(volume : Int32)
Source
i_shutdown_graphics
Source
i_shutdown_music
Source
i_shutdown_sound
Source
i_sound_is_playing(handle : Int32) : Int32
Source
i_start_frame
Source
i_start_sound(id : Int32, vol : Int32, sep : Int32, pitch : Int32, priority : Int32) : Int32

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.

Source
i_start_tic
Source
i_stop_song(handle : LibC::Int)
Source
i_stop_sound(handle : Int32)
Source
i_tactile(on : LibC::Int, off : LibC::Int, total : LibC::Int)
Source
i_tick_song

Is the song playing?

Source
i_unregister_song(handle : LibC::Int)
Source
i_update_no_blit
Source
i_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.

Source
i_update_sound_params(handle : LibC::Int, vol : LibC::Int, sep : LibC::Int, pitch : LibC::Int)
Source
i_wait_vbl(count : LibC::Int)
Source
i_zone_base(size : Pointer(LibC::Int)) : Pointer(CDoom::Byte)
Source
identify_version

identify_version Checks availability of IWAD files by name, to determine whether registered/commercial features should be executed (notably loading PWAD's).

Source
keystates
Source
m_add_to_box(box : Pointer(CDoom::Fixed), x : CDoom::Fixed, y : CDoom::Fixed)
Source
m_change_alwaysrun(choice : Int32)

Toggle always-run on/off

Source
m_change_crosshair(choice : Int32)

Toggle crosshair on/off

Source
m_change_messages(choice : Int32)

Toggle messages on/off

Source
m_change_sensitivity(choice : Int32)
Source
m_check_parm(check : Pointer(UInt8)) : Int32

m_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

Source
m_choose_skill(choice : Int32)
Source
m_clear_box(box : Pointer(CDoom::Fixed))
Source
m_clear_menus
Source
m_clear_random
Source
m_do_save(slot : Int32)

m_responder calls this when user is finished

Source
m_draw_edit_controls
Source
m_draw_empty_cell(menu : Pointer(CDoom::Menu), item : Int32)
Source
m_draw_episode

m_episode

Source
m_draw_key(key : Pointer(Int32)) : String
Source
m_draw_load

m_draw_load & Cie

Source
m_draw_mainmenu

m_draw_mainmenu

Source
m_draw_moreoptions
Source
m_draw_newgame

m_newgame

Source
m_draw_options

m_options

Source
m_draw_readthis1

Read This Menus Had a "quick hack to fix romero bug"

Source
m_draw_readthis2

Read This Menus - optional second page.

Source
m_draw_save

m_save_game & Cie.

Source
m_draw_save_load_border(x : Int32, y : Int32)

Draw border for the savegame description

Source
m_draw_selcell(menu : Pointer(CDoom::Menu), item : Int32)
Source
m_draw_sound

Change Sfx & Music volumes

Source
m_draw_text(x : Int32, y : Int32, direct : CDoom::DoomBool, string : Pointer(LibC::Char)) : LibC::Int
Source
m_draw_thermo(x : LibC::Int, y : LibC::Int, therm_width : LibC::Int, therm_dot : LibC::Int)

Menu Methods

Source
m_drawer

m_drawer Called after the view has been rendered, but before it has been blitted.

Source
m_edit_backward(choice : Int32)
Source
m_edit_controls(choice : Int32)
Source
m_edit_forward(choice : Int32)
Source
m_edit_shoot(choice : Int32)
Source
m_edit_sleft(choice : Int32)
Source
m_edit_sprint(choice : Int32)
Source
m_edit_sright(choice : Int32)
Source
m_edit_tleft(choice : Int32)
Source
m_edit_tright(choice : Int32)
Source
m_edit_use(choice : Int32)
Source
m_endgame(choice : Int32)
Source
m_endgame_response(ch : Int32)

m_endgame

Source
m_episode(choice : Int32)
Source
m_finish_readthis(choice : Int32)
Source
m_init
Source
m_load_defaults
Source
m_load_game(choice : Int32)

Selected from DOOM menu

Source
m_load_select(choice : Int32)

User wants to load this game

Source
m_moreoptions(choice : Int32)
Source
m_mouse_move(choice : Int32)
Source
m_musicvol(choice : Int32)
Source
m_new_game(choice : Int32)
Source
m_options(choice : Int32)
Source
m_quickload
Source
m_quickload_response(ch : Int32)

m_quickload

Source
m_quicksave
Source
m_quicksave_response(ch : Int32)

m_quicksave

Source
m_quit_response(ch : Int32)

m_quitdoom

Source
m_quitdoom(choice : Int32)
Source
m_random
Source
m_read_file(name : Pointer(LibC::Char), buffer : Pointer(Pointer(CDoom::Byte))) : LibC::Int
Source
m_read_save_strings

m_read_save_strings read the strings from the savegame files

Source
m_readthis(choice : Int32)

m_readthis

Source
m_readthis2(choice : Int32)
Source
m_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool

m_responder

Source
m_save_defaults
Source
m_save_game(choice : Int32)

Selected from DOOM menu

Source
m_save_select(choice : Int32)

User wants to save. Start string input for m_responder

Source
m_screenshot
Source
m_setup_next_menu(menudef : Pointer(CDoom::Menu))
Source
m_sfxvol(choice : Int32)
Source
m_size_display(choice : Int32)
Source
m_sound(choice : Int32)
Source
m_start_control_panel
Source
m_start_message(string : Pointer(LibC::Char), routine : Proc(Int32, Nil), input : CDoom::DoomBool)
Source
m_stop_message
Source
m_string_height(string : Pointer(UInt8)) : Int32

Find string height from hu_font chars

Source
m_string_width(string : Pointer(UInt8)) : Int32

Find string width from hu_font chars

Source
m_ticker
Source
m_toggle_amactivedraw(choice : Int32)
Source
m_toggle_fullscreen(choice : Int32)
Source
m_toggle_pitching(choice : Int32)
Source
m_toggle_smoothpan(choice : Int32)
Source
m_toggle_weaponfirecentered(choice : Int32)
Source
m_verify_nightmare(ch : Int32)
Source
m_write_file(name : Pointer(LibC::Char), source : Pointer(Void), length : LibC::Int) : CDoom::DoomBool
Source
m_write_text(x : Int32, y : Int32, string : Pointer(UInt8))

Write a string using the hu_font

Source
net_buffer_checksum

Checksum

Source
net_buffer_size
Source
net_update

net_update Builds ticcmds for console player, sends out a packet

Source
p_activate_in_stasis(tag : LibC::Int)
Source
p_activate_in_stasis_ceiling(line : Pointer(CDoom::Line))

Restart a ceiling that's in-stasis

Source
p_add_active_ceiling(c : Pointer(CDoom::Ceiling))

Add an active ceiling

Source
p_add_active_plat(plat : Pointer(CDoom::Plat))
Source
p_add_thinker(thinker : Pointer(CDoom::Thinker))

Adds a new thinker at the end of the list.

Source
p_aim_line_attack(t1 : Pointer(CDoom::Mobj), angle : CDoom::Angle, distance : CDoom::Fixed) : CDoom::Fixed
Source
p_aprox_distance(dx : CDoom::Fixed, dy : CDoom::Fixed) : CDoom::Fixed

Gives an estimation of distance (not exact)

Source
p_archive_players(file : File)
Source
p_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

Source
p_archive_thinkers(file : File)
Source
p_archive_world(file : File)
Source
p_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.

Source
p_block_things_iterator(x : LibC::Int, y : LibC::Int, func : Proc(Pointer(CDoom::Mobj), CDoom::DoomBool)) : CDoom::DoomBool
Source
p_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.

Source
p_bring_up_weapon(player : Pointer(CDoom::Player))

Starts bringing the pending weapon up from the bottom of the screen. Uses player

Source
p_bullet_slope(mo : Pointer(CDoom::Mobj))

Sets a slope so a near miss is at aproximately the height of the intended target

Source
p_calc_height(player : Pointer(CDoom::Player))

Calculate the walking / running height adjustment

Source
p_change_sector(sector : Pointer(CDoom::Sector), crunch : CDoom::DoomBool) : CDoom::DoomBool
Source
p_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).

Source
p_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.

Source
p_check_melee_range(actor : Pointer(CDoom::Mobj)) : CDoom::DoomBool
Source
p_check_missile_range(actor : Pointer(CDoom::Mobj)) : CDoom::DoomBool
Source
p_check_missile_spawn(th : Pointer(CDoom::Mobj))

Moves the missile forward a bit and possibly explodes it right there.

Source
p_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

Source
p_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.

Source
p_cross_bsp_node(bspnum : LibC::Int) : CDoom::DoomBool

Returns true if strace crosses the given node successfully.

Source
p_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.

Source
p_cross_subsector(num : LibC::Int) : CDoom::DoomBool

Returns true if strace crosses the given subsector successfully.

Source
p_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.

Source
p_death_think(player : Pointer(CDoom::Player))
Source
p_divline_side(x : CDoom::Fixed, y : CDoom::Fixed, node : Pointer(CDoom::Divline)) : LibC::Int

Returns side 0 (front), 1 (back), or 2 (on).

Source
p_drop_weapon(player : Pointer(CDoom::Player))

Player died, so put the weapon away.

Source
p_explode_missile(mo : Pointer(CDoom::Mobj))
Source
p_find_highest_ceiling_surrounding(sec : Pointer(CDoom::Sector)) : CDoom::Fixed

FIND HIGHEST CEILING IN THE SURROUNDING SECTORS

Source
p_find_highest_floor_surrounding(sec : Pointer(CDoom::Sector)) : CDoom::Fixed

FIND HIGHEST FLOOR HEIGHT IN SURROUNDING SECTORS

Source
p_find_lowest_ceiling_surrounding(sec : Pointer(CDoom::Sector)) : CDoom::Fixed

FIND LOWEST CEILING IN THE SURROUNDING SECTORS

Source
p_find_lowest_floor_surrounding(sec : Pointer(CDoom::Sector)) : CDoom::Fixed

FIND LOWEST FLOOR HEIGHT IN SURROUNDING SECTORS

Source
p_find_min_surrounding_light(sector : Pointer(CDoom::Sector), max : LibC::Int) : LibC::Int

Find minimum light from an adjacent sector

Source
p_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.

Source
p_find_sector_from_line_tag(line : Pointer(CDoom::Line), start : LibC::Int) : LibC::Int

RETURN NEXT SECTOR # THAT LINE TAG REFERS TO

Source
p_fire_weapon(player : Pointer(CDoom::Player))
Source
p_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

Source
p_give_armor(player : Pointer(CDoom::Player), armortype : LibC::Int) : CDoom::DoomBool

Returns false if the armor is worse than the current armor.

Source
p_give_body(player : Pointer(CDoom::Player), num : LibC::Int) : CDoom::DoomBool

Returns false if the body isn't needed at all

Source
p_give_card(player : Pointer(CDoom::Player), card : CDoom::Card)
Source
p_give_power(player : Pointer(CDoom::Player), power : LibC::Int) : CDoom::DoomBool
Source
p_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.

Source
p_group_lines

Builds sector line lists and subsector sector numbers. Finds block bounding boxes for sectors.

Source
p_gunshot(mo : Pointer(CDoom::Mobj), accurate : CDoom::DoomBool)
Source
p_hit_slide_line(ld : Pointer(CDoom::Line))

Adjusts the xmove / ymove so that the next move will slide along the wall.

Source
p_init
Source
p_init_pic_anims
Source
p_init_switch_list

Only called at game initialization

Source
p_init_thinkers
Source
p_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.

Source
p_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.

Source
p_kill_mobj(source : Pointer(CDoom::Mobj), target : Pointer(CDoom::Mobj))
Source
p_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.

Source
p_line_opening(linedef : Pointer(CDoom::Line))

Sets opentop and openbottom to the window through a two sided line. OPTIMIZE: keep this precalculated

Source
p_load_blockmap(lump : LibC::Int)
Source
p_load_linedefs(lump : LibC::Int)

Also counts secret lines for intermissions.

Source
p_load_nodes(lump : LibC::Int)
Source
p_load_sectors(lump : LibC::Int)
Source
p_load_segs(lump : LibC::Int)
Source
p_load_sidedefs(lump : LibC::Int)
Source
p_load_subsectors(lump : LibC::Int)
Source
p_load_things(lump : LibC::Int)
Source
p_load_vertexes(lump : LibC::Int)
Source
p_look_for_players(actor : Pointer(CDoom::Mobj), allaround : CDoom::DoomBool) : CDoom::DoomBool
Source
p_make_divline(li : Pointer(CDoom::Line), dl : Pointer(CDoom::Divline))
Source
p_mobj_thinker(mobj : Pointer(CDoom::Mobj))
Source
p_move(actor : Pointer(CDoom::Mobj)) : CDoom::DoomBool
Source
p_move_player(player : Pointer(CDoom::Player))
Source
p_move_psprites(player : Pointer(CDoom::Player))

Called every tic by player thinking routine.

Source
p_new_chase_dir(actor : Pointer(CDoom::Mobj))
Source
p_nightmare_respawn(mobj : Pointer(CDoom::Mobj))
Source
p_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.

Source
p_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.

Source
p_player_in_special_sector(player : Pointer(CDoom::Player))

Called every tic frame that the player origin is in a special sector

Source
p_player_think(player : Pointer(CDoom::Player))
Source
p_point_on_divline_side(x : CDoom::Fixed, y : CDoom::Fixed, line : Pointer(CDoom::Divline)) : LibC::Int
Source
p_point_on_line_side(x : CDoom::Fixed, y : CDoom::Fixed, line : Pointer(CDoom::Line)) : LibC::Int

Returns 0 or 1

Source
p_radius_attack(spot : Pointer(CDoom::Mobj), source : Pointer(CDoom::Mobj), damage : LibC::Int)

Source is the creature that caused the explosion at spot.

Source
p_random

Which one is deterministic?

Source
p_recursive_sound(sec : Pointer(CDoom::Sector), soundblocks : LibC::Int)

Called by p_noise_alert. Recursively traverse adjacent sectors, sound blocking lines cut off traversal.

Source
p_remove_active_ceiling(c : Pointer(CDoom::Ceiling))

Remove a ceiling's thinker

Source
p_remove_active_plat(plat : Pointer(CDoom::Plat))
Source
p_remove_mobj(mobj : Pointer(CDoom::Mobj))
Source
p_remove_thinker(thinker : Pointer(CDoom::Thinker))

Deallocation is lazy -- it will not actually be freed until its thinking turn comes up.

Source
p_respawn_specials
Source
p_run_thinkers
Source
p_set_mobj_state(mobj : Pointer(CDoom::Mobj), state : CDoom::Statenum) : CDoom::DoomBool
Source
p_set_psprite(player : Pointer(CDoom::Player), position : LibC::Int, stnum : CDoom::Statenum)
Source
p_set_thing_position(thing : Pointer(CDoom::Mobj))
Source
p_setup_level(episode : LibC::Int, map : LibC::Int, playermask : LibC::Int, skill : CDoom::Skill)
Source
p_setup_psprites(player : Pointer(CDoom::Player))

Called at start of level for each player.

Source
p_shoot_special_line(thing : Pointer(CDoom::Mobj), line : Pointer(CDoom::Line))

Called when a thing shoots a special line.

Source
p_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.

Source
p_spawn_blood(x : CDoom::Fixed, y : CDoom::Fixed, z : CDoom::Fixed, damage : Int32)
Source
p_spawn_door_close_in_30(sec : Pointer(CDoom::Sector))

Spawn a door that closes after 30 seconds

Source
p_spawn_door_raise_in_5_mins(sec : Pointer(CDoom::Sector), secnum : LibC::Int)

Spawn a door that opens after 5 minutes

Source
p_spawn_fire_flicker(sector : Pointer(CDoom::Sector))
Source
p_spawn_glowing_light(sector : Pointer(CDoom::Sector))
Source
p_spawn_light_flash(sector : Pointer(CDoom::Sector))

After the map has been loaded, scan each sector for specials that spawn thinkers

Source
p_spawn_map_thing(mthing : Pointer(CDoom::Mapthing))

The fields of the mapthing should already be in host byte order.

Source
p_spawn_missile(source : Pointer(CDoom::Mobj), dest : Pointer(CDoom::Mobj), type : CDoom::Mobjtype) : Pointer(CDoom::Mobj)
Source
p_spawn_mobj(x : CDoom::Fixed, y : CDoom::Fixed, z : CDoom::Fixed, type : CDoom::Mobjtype) : Pointer(CDoom::Mobj)
Source
p_spawn_player(mthing : Pointer(CDoom::Mapthing))

Called when a player is spawned on the level. Most of the player structure stays unchanged between levels.

Source
p_spawn_player_missile(source : Pointer(CDoom::Mobj), type : CDoom::Mobjtype)

Tries to aim at a nearby monster

Source
p_spawn_puff(x : CDoom::Fixed, y : CDoom::Fixed, z : CDoom::Fixed)
Source
p_spawn_specials

Parses command line parameters.

Source
p_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

Source
p_start_button(line : Pointer(CDoom::Line), w : CDoom::Bwhere, texture : LibC::Int, time : LibC::Int)

Start a button counting down till it turns off.

Source
p_teleport_move(thing : Pointer(CDoom::Mobj), x : CDoom::Fixed, y : CDoom::Fixed) : CDoom::DoomBool
Source
p_thing_height_clip(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool
Source
p_thrust(player : Pointer(CDoom::Player), angle : CDoom::Angle, move : CDoom::Fixed)

Moves the given origin along a given angle.

Source
p_ticker
Source
p_touch_special_thing(special : Pointer(CDoom::Mobj), toucher : Pointer(CDoom::Mobj))
Source
p_traverse_intercepts(func : CDoom::Traverser, maxfrac : CDoom::Fixed) : CDoom::DoomBool

Returns true if the traverser function returns true for all lines.

Source
p_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.

Source
p_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.

Source
p_unarchive_players(file : File)
Source
p_unarchive_specials(file : File)
Source
p_unarchive_thinkers(file : File)
Source
p_unarchive_world(file : File)
Source
p_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.

Source
p_update_specials

Animate planes, scroll walls, etc.

Source
p_use_lines(player : Pointer(CDoom::Player))

Looks for special lines in front of the player to activate.

Source
p_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.

Source
p_xymovement(mo : Pointer(CDoom::Mobj))
Source
p_zmovement(mo : Pointer(CDoom::Mobj))
Source
packet_get
Source
packet_send
Source
pit_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.

Source
pit_add_thing_intercepts(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool
Source
pit_change_sector(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool
Source
pit_check_line(ld : Pointer(CDoom::Line)) : CDoom::DoomBool

Adjusts tmfloorz and tmceilingz as lines are contacted

Source
pit_check_thing(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool
Source
pit_radius_attack(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool

"bombsource" is the creature that caused the explosion at "bombspot".

Source
pit_stomp_thing(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool
Source
pit_vile_check(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool

Detect a corpse that could be raised.

Source
ptr_aim_traverse(int : Pointer(CDoom::Intercept)) : CDoom::DoomBool

Sets linetaget and aimslope when a target is aimed at.

Source
ptr_shoot_traverse(int : Pointer(CDoom::Intercept)) : CDoom::DoomBool
Source
ptr_slide_traverse(int : Pointer(CDoom::Intercept)) : CDoom::DoomBool
Source
ptr_use_traverse(int : Pointer(CDoom::Intercept)) : CDoom::DoomBool
Source
punch_peers
Source
r_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.

Source
r_add_sprites(sec : Pointer(CDoom::Sector))

During BSP traversal, this adds sprites by sector.

Source
r_addline(line : Pointer(CDoom::Seg))

Clips the given segment and adds any visible pieces to the line list.

Source
r_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.

Source
r_check_plane(pl : Pointer(CDoom::Visplane), start : LibC::Int, stop : LibC::Int) : Pointer(CDoom::Visplane)
Source
r_check_texture_num_for_name(name : Pointer(LibC::Char)) : LibC::Int

Check whether texture is available. Filter out NoTexture indicator.

Source
r_clear_clip_segs
Source
r_clear_draw_segs
Source
r_clear_planes

At begining of frame.

Source
r_clear_sprites

Called at frame start.

Source
r_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.

Source
r_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.

Source
r_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.

Source
r_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.

Source
r_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.

Source
r_draw_masked
Source
r_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.

Source
r_draw_planes

At the end of each frame.

Source
r_draw_player_sprites
Source
r_draw_psprite(psp : Pointer(CDoom::Pspdef))
Source
r_draw_span

Draws the actual span.

Source
r_draw_sprite(spr : Pointer(CDoom::Vissprite))
Source
r_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.

Source
r_draw_view_border

Draws the border around the view for different size windows?

Source
r_draw_vis_sprite(vis : Pointer(CDoom::Vissprite), x1 : LibC::Int, x2 : LibC::Int)
Source
r_execute_set_view_size
Source
r_fill_back_screen

Fills the back screen with a pattern for variable screen sizes Also draws a beveled edge.

Source
r_find_plane(height : CDoom::Fixed, picnum : LibC::Int, lightlevel : LibC::Int) : Pointer(CDoom::Visplane)
Source
r_flat_num_for_name(name : Pointer(LibC::Char)) : LibC::Int

Retrieval, get a flat number for a flat name.

Source
r_generate_composite(texnum : LibC::Int)

Using the texture definition, the composite texture is created from the patches, and each column is cached.

Source
r_generate_lookup(texnum : LibC::Int)
Source
r_get_column(tex : LibC::Int, col : LibC::Int) : Pointer(CDoom::Byte)
Source
r_init
Source
r_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.

Source
r_init_colormaps
Source
r_init_data

Locates all the lumps that will be used by all views Must be called after W_Init.

Source
r_init_flats
Source
r_init_light_tables

Only inits the zlight table, because the scalelight table changes with view size.

Source
r_init_sky_map

Called whenever the view size changes.

Source
r_init_sprite_defs(namelist : Pointer(Pointer(LibC::Char)))

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.

Source
r_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.

Source
r_init_sprites(namelist : Pointer(Pointer(LibC::Char)))

Called at program start.

Source
r_init_tables
Source
r_init_texture_mapping
Source
r_init_textures

Initializes the texture list with the textures from the world map.

Source
r_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.

Source
r_install_sprite_lump(lump : LibC::Int, frame : LibC::UInt, rotation : LibC::UInt, flipped : CDoom::DoomBool)

Local function for R_InitSprites.

Source
r_make_spans(x : LibC::Int, t1 : LibC::Int, b1 : LibC::Int, t2 : LibC::Int, b2 : LibC::Int)
Source
r_map_plane(y : LibC::Int, x1 : LibC::Int, x2 : LibC::Int)

Uses global vars: planeheight ds_source basexscale baseyscale viewx viewy

BASIC PRIMITIVE

Source
r_new_vis_sprite
Source
r_point_in_subsector(x : CDoom::Fixed, y : CDoom::Fixed) : Pointer(CDoom::Subsector)
Source
r_point_on_seg_side(x : CDoom::Fixed, y : CDoom::Fixed, line : Pointer(CDoom::Seg)) : LibC::Int
Source
r_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).

Source
r_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.

Source
r_point_to_angle2(x1 : CDoom::Fixed, y1 : CDoom::Fixed, x2 : CDoom::Fixed, y2 : CDoom::Fixed) : CDoom::Angle
Source
r_point_to_dist(x : CDoom::Fixed, y : CDoom::Fixed) : CDoom::Fixed
Source
r_precache_level

Preloads all relevant graphics for the level.

Source
r_project_sprite(thing : Pointer(CDoom::Mobj))

Generates a vissprite for a thing if it might be visible.

Source
r_render_bsp_node(bspnum : LibC::Int)

Renders all subsectors below a given node, traversing subtree recursively. Just call with BSP root.

Source
r_render_masked_seg_range(ds : Pointer(CDoom::Drawseg), x1 : LibC::Int, x2 : LibC::Int)
Source
r_render_player_view(player : Pointer(CDoom::Player))
Source
r_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.

Source
r_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.

Source
r_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.

Source
r_setup_frame(player : Pointer(CDoom::Player))
Source
r_sort_vis_sprites
Source
r_store_wall_range(start : LibC::Int, stop : LibC::Int)

A wall segment will be drawn between start and stop pixels (inclusive).

Source
r_subsector(num : LibC::Int)

Determine floor/ceiling planes. Add sprites of things in sector. Draw one or more line segments.

Source
r_texture_num_for_name(name : Pointer(LibC::Char)) : LibC::Int

Calls R_CheckTextureNumForName, aborts with error message.

Source
r_video_erase(ofs : LibC::UInt, count : LibC::Int)

Copy a screen buffer.

Source
reset_all_channels
Source
s_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.

Source
s_change_music(musicnum : LibC::Int, looping : LibC::Int)
Source
s_get_channel(origin : Pointer(Void), sfxinfo : Pointer(CDoom::Sfxinfo)) : LibC::Int

If none available, return -1. Otherwise channel #.

Source
s_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.

Source
s_pause_sound

Stop and resume music, during game PAUSE.

Source
s_resume_sound
Source
s_set_music_volume(volume : LibC::Int)
Source
s_set_sfx_volume(volume : LibC::Int)
Source
s_start

Per level startup code. Kills playing sounds at start of level, determines music if any, changes music.

Source
s_start_music(m_id : LibC::Int)

Starts some music with the music id found in sounds.h.

Source
s_start_sound(origin : Pointer(Void), sfx_id : LibC::Int)
Source
s_start_sound_at_volume(origin_p : Pointer(Void), sfx_id : LibC::Int, volume : LibC::Int)
Source
s_stop_channel(cnum : LibC::Int)
Source
s_stop_music
Source
s_stop_sound(origin : Pointer(Void))
Source
s_update_sounds(listener_p : Pointer(Void))

Updates music & sounds

Source
slope_div(num : LibC::UInt, den : LibC::UInt) : LibC::Int
Source
st_calc_pain_offset
Source
st_create_widgets
Source
st_diff_draw
Source
st_do_palette_stuff
Source
st_do_refresh
Source
st_draw_widgets(refresh : CDoom::DoomBool)
Source
st_drawer(fullscreen : CDoom::DoomBool, refresh : CDoom::DoomBool)
Source
st_init
Source
st_init_data
Source
st_load_data
Source
st_load_graphics
Source
st_refresh_background
Source
st_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool

Respond to keyboard input events, intercept cheats.

Source
st_start
Source
st_stop
Source
st_ticker
Source
st_unload_data
Source
st_unload_graphics
Source
st_update_face_widget
Source
st_update_widgets
Source
stlib_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?

Source
stlib_init
Source
stlib_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))
Source
stlib_init_mult_icon(i : Pointer(CDoom::ST_Multicon), x : LibC::Int, y : LibC::Int, il : Pointer(Pointer(CDoom::Patch)), inum : Pointer(LibC::Int), on : Pointer(CDoom::DoomBool))
Source
stlib_init_num(n : Pointer(CDoom::ST_Number), x : LibC::Int, y : LibC::Int, pl : Pointer(Pointer(CDoom::Patch)), num : Pointer(LibC::Int), on : Pointer(CDoom::DoomBool), width : LibC::Int)

?

Source
stlib_init_percent(p : Pointer(CDoom::ST_Percent), x : LibC::Int, y : LibC::Int, pl : Pointer(Pointer(CDoom::Patch)), num : Pointer(LibC::Int), on : Pointer(CDoom::DoomBool), percent : Pointer(CDoom::Patch))
Source
stlib_update_bin_icon(bi : Pointer(CDoom::ST_Binicon), refresh : CDoom::DoomBool)
Source
stlib_update_mult_icon(mi : Pointer(CDoom::ST_Multicon), refresh : CDoom::DoomBool)
Source
stlib_update_num(n : Pointer(CDoom::ST_Number), refresh : CDoom::DoomBool)
Source
stlib_update_percent(per : Pointer(CDoom::ST_Percent), refresh : LibC::Int)
Source
t_fire_flicker(flick : Pointer(CDoom::Fireflicker))
Source
t_glow(g : Pointer(CDoom::Glow))
Source
t_light_flash(flash : Pointer(CDoom::Lightflash))

Do flashing lights.

Source
t_move_ceiling(ceiling : Pointer(CDoom::Ceiling))
Source
t_move_floor(floor : Pointer(CDoom::Floormove))

MOVE A FLOOR TO IT'S DESTINATION (UP OR DOWN)

Source
t_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
Source
t_plat_raise(plat : Pointer(CDoom::Plat))

Move a plat up and down

Source
t_strobe_flash(flash : Pointer(CDoom::Strobe))
Source
t_vertical_door(door : Pointer(CDoom::Vldoor))

Move a locked door up/down

Source
try_run_tics

try_run_tics

Source
two_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.

Source
udp_socket
Source
update_audio
Source
v_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)
Source
v_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.

Source
v_draw_patch(x : LibC::Int, y : LibC::Int, scrn : LibC::Int, patch : Pointer(CDoom::Patch))

Masks a column based masked pic to the screen.

Source
v_draw_patch_direct(x : LibC::Int, y : LibC::Int, scrn : LibC::Int, patch : Pointer(CDoom::Patch))

Draws directly to the screen on the pc.

Source
v_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.

Source
v_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)
Source
v_get_block(x : LibC::Int, y : LibC::Int, scrn : LibC::Int, width : LibC::Int, height : LibC::Int, dest : Pointer(CDoom::Byte))
Source
v_init
Source
v_mark_rect(x : LibC::Int, y : LibC::Int, width : LibC::Int, height : LibC::Int)
Source
w_add_file(filename : Pointer(LibC::Char))
Source
w_cache_lump_name(name : Pointer(LibC::Char), tag : LibC::Int) : Pointer(Void)
Source
w_cache_lump_num(lump : LibC::Int, tag : LibC::Int) : Pointer(Void)
Source
w_check_num_for_name(name : Pointer(LibC::Char)) : LibC::Int

Returns -1 if name not found.

Source
w_get_num_for_name(name : Pointer(LibC::Char)) : LibC::Int

Calls w_check_num_for_name, but bombs out if not found.

Source
w_init_file(filename : Pointer(LibC::Char))

Just initialize from a single file.

Source
w_init_multiple_files(filenames : Pointer(Pointer(LibC::Char)))

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.

Source
w_lump_length(lump : LibC::Int) : LibC::Int

Returns the buffer size needed to load the given lump.

Source
w_read_lump(lump : LibC::Int, dest : Pointer(Void))

Loads the lump into the given buffer, which must be >= w_lump_length().

Source
w_reload

Flushes any of the reloadable lumps in memory and reloads the directory.

Source
wi_check_for_accelerate
Source
wi_draw_animated_back
Source
wi_draw_deathmatch_stats
Source
wi_draw_el

Draws "Entering <LevelName>"

Source
wi_draw_lf

Draws "<Levelname> Finished!"

Source
wi_draw_netgame_stats
Source
wi_draw_no_state
Source
wi_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.

Source
wi_draw_on_lnode(n : LibC::Int, c : Pointer(Pointer(CDoom::Patch)))
Source
wi_draw_percent(x : LibC::Int, y : LibC::Int, p : LibC::Int)
Source
wi_draw_show_next_loc
Source
wi_draw_stats
Source
wi_draw_time(x : LibC::Int, y : LibC::Int, t : LibC::Int)

Display level completion time and par, or "sucks" message if overflow.

Source
wi_drawer
Source
wi_end
Source
wi_frag_sum(playernum : LibC::Int) : LibC::Int
Source
wi_init_animated_back
Source
wi_init_deathmatch_stats
Source
wi_init_netgame_stats
Source
wi_init_no_state
Source
wi_init_show_next_loc
Source
wi_init_stats
Source
wi_init_variables(wbstartstruct : Pointer(CDoom::Wbstartstruct))
Source
wi_load_data
Source
wi_slam_background
Source
wi_start(wbstartstruct : Pointer(CDoom::Wbstartstruct))
Source
wi_ticker

Updates stuff each tick

Source
wi_unload_data
Source
wi_update_animated_back
Source
wi_update_deathmatch_stats
Source
wi_update_netgame_stats
Source
wi_update_no_state
Source
wi_update_show_next_loc
Source
wi_update_stats
Source
wipe_do_color_x_form(width : Int32, height : Int32, ticks : Int32) : Int32
Source
wipe_do_melt(width : Int32, height : Int32, ticks : Int32) : Int32
Source
wipe_end_screen(x : Int32, y : Int32, width : Int32, height : Int32) : Int32
Source
wipe_exit_color_x_form(width : Int32, height : Int32, ticks : Int32) : Int32
Source
wipe_exit_melt(width : Int32, height : Int32, ticks : Int32) : Int32
Source
wipe_init_color_x_form(width : Int32, height : Int32, ticks : Int32) : Int32
Source
wipe_init_melt(width : Int32, height : Int32, ticks : Int32) : Int32
Source
wipe_screen_wipe(wipeno : Int32, x : Int32, y : Int32, width : Int32, height : Int32, ticks : Int32) : Int32
Source
wipe_shitty_col_major_x_form(array : Pointer(Int16), width : Int32, height : Int32)
Source
wipe_start_screen(x : Int32, y : Int32, width : Int32, height : Int32) : Int32
Source
write_pcx_file(filename : Pointer(LibC::Char), data : Pointer(CDoom::Byte), width : LibC::Int, height : LibC::Int, palette : Pointer(CDoom::Byte))
Source
z_change_tag2(ptr : Pointer(Void), tag : LibC::Int)
Source
z_check_heap
Source
z_free(ptr : Pointer(Void))
Source
z_free_tags(lowtag : LibC::Int, hightag : LibC::Int)
Source
z_init
Source
z_malloc(size : LibC::Int, tag : LibC::Int, user : Pointer(Void)) : Pointer(Void)
Source

Macros

dooutcode(oc, mx, my)
Source
poll_button(doombutton, raylibbutton)
Source
poll_key(doomkey, raylibkey)

-- Macros for quick key polling --

Source
poll_two_key(doomkey, raylibkey1, raylibkey2)
Source
putdot(xx, yy, cc)
Source

Nested types