module LibDoom

Defined in:

doo-cr.cr
doo-cr/doo-cr.cr
doo-cr/variables.cr

Constant Summary

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
NEEDS_BYTE_SWAP = IO::ByteFormat::SystemEndian != IO::ByteFormat::NetworkEndian
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 Method Summary

Macro Summary

Class Method Detail

def self.a_baby_metal(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_bfg_sound(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_bfg_spray(mo : Pointer(CDoom::Mobj)) #

Spawn a BFG explosion on every monster in view


[View source]
def self.a_boss_death(mo : Pointer(CDoom::Mobj)) #

Possibly trigger special effects if on first boss level


[View source]
def self.a_brain_awake(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_brain_die(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_brain_explode(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_brain_pain(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_brain_scream(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_brain_spit(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_bruis_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_bspi_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_chase(actor : Pointer(CDoom::Mobj)) #

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


[View source]
def self.a_check_reload(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_close_shotgun2(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_cpos_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_cpos_refire(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_cyber_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_explode(thingy : Pointer(CDoom::Mobj)) #

[View source]
def self.a_face_target(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_fall(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_fat_attack1(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_fat_attack2(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_fat_attack3(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_fat_raise(actor : Pointer(CDoom::Mobj)) #

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


[View source]
def self.a_fire(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_fire_bfg(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_fire_cgun(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_fire_crackle(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_fire_missile(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_fire_pistol(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_fire_plasma(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_fire_shotgun(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_fire_shotgun2(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_gun_flash(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_head_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_hoof(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_keen_die(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_light0(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_light1(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_light2(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_load_shotgun2(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_look(actor : Pointer(CDoom::Mobj)) #

Stay in state until a player is sighted.


[View source]
def self.a_lower(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

Lowers current weapon, and changes weapon at bottom.


[View source]
def self.a_metal(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_open_shotgun2(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_pain(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_pain_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_pain_die(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_pain_shoot_skull(actor : Pointer(CDoom::Mobj), angle : CDoom::Angle) #

[View source]
def self.a_player_scream(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_pos_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_punch(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_raise(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_refire(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

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


[View source]
def self.a_sarg_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_saw(player : Pointer(CDoom::Player), psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.a_scream(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_skel_fist(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_skel_missile(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_skel_whoosh(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_skull_attack(actor : Pointer(CDoom::Mobj)) #

Fly at the player like a missile


[View source]
def self.a_spawn_fly(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.a_spawn_sound(mo : Pointer(CDoom::Mobj)) #

travelling cube sound


[View source]
def self.a_spid_refire(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_spos_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_start_fire(actor : Pointer(CDoom::Mobj)) #

Keep fire in front of player unless out of sight


[View source]
def self.a_tracer(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_troop_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_vile_attack(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_vile_chase(actor : Pointer(CDoom::Mobj)) #

Check for ressurecting a body


[View source]
def self.a_vile_start(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.a_vile_target(actor : Pointer(CDoom::Mobj)) #

Spawn the hellfire


[View source]
def self.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.


[View source]
def self.a_xscream(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.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.


[View source]
def self.am_activate_new_scale #

[View source]
def self.am_add_mark #

adds a marker at the current location


[View source]
def self.am_change_window_loc #

[View source]
def self.am_change_window_scale #

Zooming


[View source]
def self.am_clear_fb(color : Int32) #

Clear automap frame buffer.


[View source]
def self.am_clear_marks #

[View source]
def self.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.


[View source]
def self.am_do_follow_player #

[View source]
def self.am_draw_crosshair(color : Int32) #

[View source]
def self.am_draw_fline(fl : Pointer(CDoom::Fline), color : Int32) #

Classic Bresenham w/ whatever optimizations needed for speed


[View source]
def self.am_draw_grid(color : Int32) #

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


[View source]
def self.am_draw_line_character(lineguy : Pointer(CDoom::Mline), lineguylines : Int32, scale : CDoom::Fixed, angle : CDoom::Angle, color : Int32, x : CDoom::Fixed, y : CDoom::Fixed) #

[View source]
def self.am_draw_marks #

[View source]
def self.am_draw_mline(ml : Pointer(CDoom::Mline), color : Int32) #

Clip lines, draw visible part sof lines.


[View source]
def self.am_draw_players #

[View source]
def self.am_draw_things(colors : Int32, colorrange : Int32) #

[View source]
def self.am_draw_walls #

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


[View source]
def self.am_drawer #

[View source]
def self.am_find_min_max_boundaries #

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


[View source]
def self.am_init_variables #

[View source]
def self.am_level_init #

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


[View source]
def self.am_load_pics #

[View source]
def self.am_max_out_window_scale #

set the window scale to the minimum size


[View source]
def self.am_min_out_window_scale #

set the window scale to the maximum size


[View source]
def self.am_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool #

Handle events (user inputs) in automap mode


[View source]
def self.am_restore_scale_and_loc #

[View source]
def self.am_rotate(x : Pointer(CDoom::Fixed), y : Pointer(CDoom::Fixed), a : CDoom::Angle) #

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


[View source]
def self.am_save_scale_and_loc #

[View source]
def self.am_start #

[View source]
def self.am_stop #

[View source]
def self.am_ticker #

Updates on Game Tick


[View source]
def self.am_unload_pics #

[View source]
def self.am_update_light_lev #

[View source]
def self.bind_to_local_port(socket : UDPSocket, port : Int32) #

[View source]
def self.check_abort #

check_abort


[View source]
def self.cht_check_cheat(cht : Pointer(CDoom::Cheatseq), key : LibC::Char) : LibC::Int #

[View source]
def self.cht_get_param(cht : Pointer(CDoom::Cheatseq), buffer : Pointer(LibC::Char)) #

[View source]
def self.confirm_version #

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


[View source]
def self.d_add_file(file : Pointer(UInt8)) #

[View source]
def self.d_advance_demo #

d_advance_demo Called after each demo or intro demosequence finishes


[View source]
def self.d_arbitrate_net_start #

d_arbitrate_net_start


[View source]
def self.d_check_net_game #

d_check_net_game Works out player numbers among the net participants


[View source]
def self.d_display #

d_display draw current display, possibly wiping it from the previous


[View source]
def self.d_do_advance_demo #

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


[View source]
def self.d_doom_loop #

[View source]
def self.d_doom_main #

d_doom_main


[View source]
def self.d_page_drawer #

[View source]
def self.d_page_ticker #

d_page_ticker Handles timing for warped projection


[View source]
def self.d_post_event(ev : Pointer(CDoom::Event)) #

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


[View source]
def self.d_process_events #

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


[View source]
def self.d_quit_net_game #

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


[View source]
def self.d_start_title #

[View source]
def self.doom_atoi(str : Pointer(UInt8)) : Int32 #

[View source]
def self.doom_atox(str : Pointer(UInt8)) : Int32 #

[View source]
def self.doom_button_down(button : CDoom::DoomButton) #

[View source]
def self.doom_button_up(button : CDoom::DoomButton) #

[View source]
def self.doom_close_impl(handle : Pointer(Void)) #

[View source]
def self.doom_concat(dst : Pointer(UInt8), src : Pointer(UInt8)) : Pointer(UInt8) #

[View source]
def self.doom_ctoa(c : UInt8) : Pointer(UInt8) #

[View source]
def self.doom_draw #

[View source]
def self.doom_eof_impl(handle : Pointer(Void)) : Int32 #

[View source]
def self.doom_exit_impl(code : Int32) #

[View source]
def self.doom_fprint(handle : Pointer(Void), str : Pointer(UInt8)) : Int32 #

[View source]
def self.doom_get_sound_buffer : Pointer(Int16) #

[View source]
def self.doom_getenv_impl(var : Pointer(UInt8)) : Pointer(UInt8) #

[View source]
def self.doom_gettime_impl(sec : Pointer(Int32), usec : Pointer(Int32)) #

[View source]
def self.doom_htonl(x : UInt32) : UInt32 #

[View source]
def self.doom_htons(x : Int16) : Int16 #

[View source]
def self.doom_init(argc : Int32, argv : Pointer(Pointer(UInt8)), flags : Int32) #

[View source]
def self.doom_itoa(k : Int32, radix : Int32) : Pointer(UInt8) #

[View source]
def self.doom_key_down(key : CDoom::DoomKey) #

[View source]
def self.doom_key_up(key : CDoom::DoomKey) #

[View source]
def self.doom_memcpy(destination : Pointer(Void), source : Pointer(Void), num : Int32) : Pointer(Void) #

[View source]
def self.doom_memset(ptr : Pointer(Void), value : Int32, num : Int32) #

[View source]
def self.doom_mouse_move(delta_x : Int32, delta_y : Int32) #

[View source]
def self.doom_open_impl(filename : Pointer(UInt8), mode : Pointer(UInt8)) : Pointer(Void) #

[View source]
def self.doom_ptoa(p : Pointer(Void)) : Pointer(UInt8) #

[View source]
def self.doom_read_impl(handle : Pointer(Void), buf : Pointer(Void), count : Int32) : Int32 #

[View source]
def self.doom_seek_impl(handle : Pointer(Void), offset : Int32, origin : CDoom::DoomSeek) : Int32 #

[View source]
def self.doom_set_exit(exit_fn : CDoom::DoomExitFn) #

[View source]
def self.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) #

[View source]
def self.doom_set_getenv(getenv_fn : CDoom::DoomGetenvFn) #

[View source]
def self.doom_set_gettime(gettime_fn : CDoom::DoomGettimeFn) #

[View source]
def self.doom_strcasecmp(str1 : Pointer(UInt8), str2 : Pointer(UInt8)) : Int32 #

[View source]
def self.doom_strcmp(str1 : Pointer(UInt8), str2 : Pointer(UInt8)) : Int32 #

[View source]
def self.doom_strcpy(dst : Pointer(UInt8), src : Pointer(UInt8)) : Pointer(UInt8) #

[View source]
def self.doom_strlen(str : Pointer(UInt8)) : Int32 #

[View source]
def self.doom_strncasecmp(str1 : Pointer(UInt8), str2 : Pointer(UInt8), n : Int32) : Int32 #

[View source]
def self.doom_strncmp(str1 : Pointer(UInt8), str2 : Pointer(UInt8), n : Int32) : Int32 #

[View source]
def self.doom_strncpy(dst : Pointer(UInt8), src : Pointer(UInt8), num : Int32) : Pointer(UInt8) #

[View source]
def self.doom_strupr(s : Pointer(LibC::Char)) #

[View source]
def self.doom_tell_impl(handle : Pointer(Void)) : Int32 #

[View source]
def self.doom_tick_midi : UInt64 #

[View source]
def self.doom_toupper(c : Int32) : Int32 #

[View source]
def self.doom_write_impl(handle : Pointer(Void), buf : Pointer(Void), count : Int32) : Int32 #

[View source]
def self.ev_build_stairs(line : Pointer(CDoom::Line), type : CDoom::Stairenum) : LibC::Int #

BUILD A STAIRCASE!


[View source]
def self.ev_ceiling_crush_stop(line : Pointer(CDoom::Line)) : LibC::Int #

Stop a ceiling from crushing!


[View source]
def self.ev_do_ceiling(line : Pointer(CDoom::Line), type : CDoom::Ceilingenum) : LibC::Int #

Move a ceiling up/down and all around!


[View source]
def self.ev_do_donut(line : Pointer(CDoom::Line)) : LibC::Int #

Special Stuff that can not be categorized


[View source]
def self.ev_do_door(line : Pointer(CDoom::Line), type : CDoom::Vldoorenum) : LibC::Int #

open a door manually, no tag value


[View source]
def self.ev_do_floor(line : Pointer(CDoom::Line), floortype : CDoom::Floorenum) : LibC::Int #

[View source]
def self.ev_do_locked_door(line : Pointer(CDoom::Line), type : CDoom::Vldoorenum, thing : Pointer(CDoom::Mobj)) : LibC::Int #

[View source]
def self.ev_do_plat(line : Pointer(CDoom::Line), type : CDoom::Plattype, amount : LibC::Int) : LibC::Int #

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


[View source]
def self.ev_light_turn_on(line : Pointer(CDoom::Line), bright : LibC::Int) #

[View source]
def self.ev_start_light_strobing(line : Pointer(CDoom::Line)) #

Start strobing lights (usually from a trigger)


[View source]
def self.ev_stop_plat(line : Pointer(CDoom::Line)) #

[View source]
def self.ev_teleport(line : Pointer(CDoom::Line), side : LibC::Int, thing : Pointer(CDoom::Mobj)) : LibC::Int #

[View source]
def self.ev_turn_tag_lights_off(line : Pointer(CDoom::Line)) #

TURN LINE'S TAG LIGHTS OFF


[View source]
def self.ev_vertical_door(line : Pointer(CDoom::Line), thing : Pointer(CDoom::Mobj)) #

[View source]
def self.expand_tics(low : Int32) : Int32 #

[View source]
def self.extract_file_base(path : Pointer(LibC::Char), dest : Pointer(LibC::Char)) #

[View source]
def self.f_bunny_scroll #

f_bunny_scroll


[View source]
def self.f_cast_drawer #

f_cast_drawer


[View source]
def self.f_cast_print(text : Pointer(UInt8)) #

[View source]
def self.f_cast_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool #

[View source]
def self.f_cast_ticker #

f_cast_ticker


[View source]
def self.f_draw_patch_col(x : Int32, patch : Pointer(CDoom::Patch), col : Int32) #

f_draw_patch_col


[View source]
def self.f_drawer #

[View source]
def self.f_responder(event : Pointer(CDoom::Event)) : CDoom::DoomBool #

[View source]
def self.f_start_cast #

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


[View source]
def self.f_start_finale #

f_start_finale


[View source]
def self.f_text_write #

f_text_write


[View source]
def self.f_ticker #

f_ticker


[View source]
def self.find_response_file #

Find a Response File


[View source]
def self.fixed_div(a : CDoom::Fixed, b : CDoom::Fixed) : CDoom::Fixed #

[View source]
def self.fixed_div2(a : CDoom::Fixed, b : CDoom::Fixed) : CDoom::Fixed #

[View source]
def self.fixed_mul(a : CDoom::Fixed, b : CDoom::Fixed) : CDoom::Fixed #

[View source]
def self.foreign_translation(ch : UInt8) : UInt8 #

[View source]
def self.g_begin_recording #

[View source]
def self.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


[View source]
def self.g_check_demo_status : CDoom::DoomBool #

===================

= 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


[View source]
def self.g_check_spot(playernum : Int32, mthing : Pointer(CDoom::Mapthing)) : CDoom::DoomBool #

[View source]
def self.g_deathmatch_spawn_player(playernum : Int32) #

[View source]
def self.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.


[View source]
def self.g_defered_play_demo(name : Pointer(UInt8)) #

[View source]
def self.g_despawn_player(playernum : Int32) #

[View source]
def self.g_do_completed #

[View source]
def self.g_do_load_game #

[View source]
def self.g_do_load_level #

g_do_load_level


[View source]
def self.g_do_new_game #

[View source]
def self.g_do_play_demo #

[View source]
def self.g_do_reborn(playernum : Int32) #

g_do_reborn


[View source]
def self.g_do_save_game #

[View source]
def self.g_do_world_done #

g_do_world_done


[View source]
def self.g_exit_level #

[View source]
def self.g_init_new(skill : CDoom::Skill, episode : Int32, map : Int32) #

[View source]
def self.g_init_player(player : Int32) #

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


[View source]
def self.g_load_game(name : Pointer(UInt8)) #

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


[View source]
def self.g_player_finish_level(player : Int32) #

g_player_finish_level Can when a player completes a level.


[View source]
def self.g_player_reborn(player : Int32) #

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


[View source]
def self.g_read_demo_ticcmd(cmd : Pointer(CDoom::Ticcmd)) #

DEMO RECORDING


[View source]
def self.g_record_demo(name : Pointer(UInt8)) #

g_record_demo


[View source]
def self.g_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool #

[View source]
def self.g_save_game(slot : Int32, description : Pointer(UInt8)) #

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


[View source]
def self.g_screenshot #

[View source]
def self.g_secret_exit_level #

Here's for the german edition. Literally 1984


[View source]
def self.g_ticker #

g_ticker Make ticcmds for the players.


[View source]
def self.g_time_demo(name : Pointer(UInt8)) #

g_time_demo


[View source]
def self.g_world_done #

g_world_done


[View source]
def self.g_write_demo_ticcmd(cmd : Pointer(CDoom::Ticcmd)) #

[View source]
def self.get_local_address : Int32 #

[View source]
def self.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


[View source]
def self.get_packets #

get_packets


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.getsfx(sfxname : Pointer(UInt8), len : Pointer(Int32)) : Pointer(Void) #

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


[View source]
def self.h_get_packet : CDoom::DoomBool #

h_get_packet Returns false if no packet is waiting


[View source]
def self.h_send_packet(node : Int32, flags : Int32) #

[View source]
def self.hu_dequeue_chat_char : UInt8 #

[View source]
def self.hu_drawer #

[View source]
def self.hu_erase #

[View source]
def self.hu_init #

[View source]
def self.hu_queue_chat_char(c : UInt8) #

[View source]
def self.hu_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool #

[View source]
def self.hu_start #

[View source]
def self.hu_stop #

[View source]
def self.hu_ticker #

[View source]
def self.hulib_add_char_to_text_line(t : Pointer(CDoom::HU_Textline), ch : UInt8) : CDoom::DoomBool #

[View source]
def self.hulib_add_line_to_s_text(s : Pointer(CDoom::HU_Stext)) #

[View source]
def self.hulib_add_message_to_s_text(s : Pointer(CDoom::HU_Stext), prefix : Pointer(UInt8), msg : Pointer(UInt8)) #

[View source]
def self.hulib_add_prefix_to_i_text(it : Pointer(CDoom::HU_Itext), str : Pointer(UInt8)) #

[View source]
def self.hulib_clear_text_line(t : Pointer(CDoom::HU_Textline)) #

[View source]
def self.hulib_del_char_from_i_text(it : Pointer(CDoom::HU_Itext)) #

The following deletion routines adhere to the left margin restriction


[View source]
def self.hulib_del_char_from_text_line(t : Pointer(CDoom::HU_Textline)) : CDoom::DoomBool #

[View source]
def self.hulib_draw_i_text(it : Pointer(CDoom::HU_Itext)) #

[View source]
def self.hulib_draw_s_text(s : Pointer(CDoom::HU_Stext)) #

[View source]
def self.hulib_draw_text_line(l : Pointer(CDoom::HU_Textline), drawcursor : CDoom::DoomBool) #

[View source]
def self.hulib_erase_i_text(it : Pointer(CDoom::HU_Itext)) #

[View source]
def self.hulib_erase_line_from_i_text(it : Pointer(CDoom::HU_Itext)) #

[View source]
def self.hulib_erase_s_text(s : Pointer(CDoom::HU_Stext)) #

[View source]
def self.hulib_erase_text_line(l : Pointer(CDoom::HU_Textline)) #

sorta called by hu_erase and just better darn get things straight


[View source]
def self.hulib_init_i_text(it : Pointer(CDoom::HU_Itext), x : Int32, y : Int32, font : Pointer(Pointer(CDoom::Patch)), startchar : Int32, on : Pointer(CDoom::DoomBool)) #

[View source]
def self.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)) #

[View source]
def self.hulib_init_text_line(t : Pointer(CDoom::HU_Textline), x : Int32, y : Int32, f : Pointer(Pointer(CDoom::Patch)), sc : Int32) #

[View source]
def self.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


[View source]
def self.hulib_reset_i_text(it : Pointer(CDoom::HU_Itext)) #

Resets left margin as well


[View source]
def self.i_alloc_low(length : LibC::Int) : Pointer(CDoom::Byte) #

[View source]
def self.i_base_ticcmd : Pointer(CDoom::Ticcmd) #

[View source]
def self.i_error(error : String) #

i_error


[View source]
def self.i_finish_update #

[View source]
def self.i_get_heap_size : LibC::Int #

[View source]
def self.i_get_sfx_lump_num(sfx : Pointer(CDoom::Sfxinfo)) : Int32 #

[View source]
def self.i_get_time : LibC::Int #

i_get_time returns time in 1/70th second tics


[View source]
def self.i_init #

i_init


[View source]
def self.i_init_graphics #

[View source]
def self.i_init_music #

MUSIC API.


[View source]
def self.i_init_network #

[View source]
def self.i_init_sound #

[View source]
def self.i_net_cmd #

[View source]
def self.i_pause_song(handle : Int32) #

[View source]
def self.i_play_song(handle : Int32, looping : Int32) #

[View source]
def self.i_qry_song_playing(handle : LibC::Int) : LibC::Int #

Is the song playing?


[View source]
def self.i_quit #

i_quit


[View source]
def self.i_read_screen(scr : Pointer(CDoom::Byte)) #

[View source]
def self.i_register_song(data : Pointer(Void)) : LibC::Int #

[View source]
def self.i_resume_song(handle : Int32) #

[View source]
def self.i_set_channels #

[View source]
def self.i_set_music_volume(volume : Int32) #

MUSIC API - dummy. Some code from DOS version.


[View source]
def self.i_set_palette(palette : Pointer(CDoom::Byte)) #

[View source]
def self.i_set_sfx_volume(volume : Int32) #

[View source]
def self.i_shutdown_graphics #

[View source]
def self.i_shutdown_music #

[View source]
def self.i_shutdown_sound #

[View source]
def self.i_sound_is_playing(handle : Int32) : Int32 #

[View source]
def self.i_start_frame #

[View source]
def self.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.


[View source]
def self.i_start_tic #

[View source]
def self.i_stop_song(handle : LibC::Int) #

[View source]
def self.i_stop_sound(handle : Int32) #

[View source]
def self.i_tactile(on : LibC::Int, off : LibC::Int, total : LibC::Int) #

[View source]
def self.i_tick_song : UInt64 #

Is the song playing?


[View source]
def self.i_unregister_song(handle : LibC::Int) #

[View source]
def self.i_update_no_blit #

[View source]
def self.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.


[View source]
def self.i_update_sound_params(handle : LibC::Int, vol : LibC::Int, sep : LibC::Int, pitch : LibC::Int) #

[View source]
def self.i_wait_vbl(count : LibC::Int) #

[View source]
def self.i_zone_base(size : Pointer(LibC::Int)) : Pointer(CDoom::Byte) #

[View source]
def self.identify_version #

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


[View source]
def self.keystates #

[View source]
def self.m_add_to_box(box : Pointer(CDoom::Fixed), x : CDoom::Fixed, y : CDoom::Fixed) #

[View source]
def self.m_change_alwaysrun(choice : Int32) #

Toggle always-run on/off


[View source]
def self.m_change_crosshair(choice : Int32) #

Toggle crosshair on/off


[View source]
def self.m_change_messages(choice : Int32) #

Toggle messages on/off


[View source]
def self.m_change_sensitivity(choice : Int32) #

[View source]
def self.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


[View source]
def self.m_choose_skill(choice : Int32) #

[View source]
def self.m_clear_box(box : Pointer(CDoom::Fixed)) #

[View source]
def self.m_clear_menus #

[View source]
def self.m_clear_random #

[View source]
def self.m_do_save(slot : Int32) #

m_responder calls this when user is finished


[View source]
def self.m_draw_edit_controls #

[View source]
def self.m_draw_empty_cell(menu : Pointer(CDoom::Menu), item : Int32) #

[View source]
def self.m_draw_episode #

m_episode


[View source]
def self.m_draw_key(key : Pointer(Int32)) : String #

[View source]
def self.m_draw_load #

m_draw_load & Cie


[View source]
def self.m_draw_mainmenu #

m_draw_mainmenu


[View source]
def self.m_draw_moreoptions #

[View source]
def self.m_draw_newgame #

m_newgame


[View source]
def self.m_draw_options #

m_options


[View source]
def self.m_draw_readthis1 #

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


[View source]
def self.m_draw_readthis2 #

Read This Menus - optional second page.


[View source]
def self.m_draw_save #

m_save_game & Cie.


[View source]
def self.m_draw_save_load_border(x : Int32, y : Int32) #

Draw border for the savegame description


[View source]
def self.m_draw_selcell(menu : Pointer(CDoom::Menu), item : Int32) #

[View source]
def self.m_draw_sound #

Change Sfx & Music volumes


[View source]
def self.m_draw_text(x : Int32, y : Int32, direct : CDoom::DoomBool, string : Pointer(LibC::Char)) : LibC::Int #

[View source]
def self.m_draw_thermo(x : LibC::Int, y : LibC::Int, therm_width : LibC::Int, therm_dot : LibC::Int) #

Menu Methods


[View source]
def self.m_drawer #

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


[View source]
def self.m_edit_backward(choice : Int32) #

[View source]
def self.m_edit_controls(choice : Int32) #

[View source]
def self.m_edit_forward(choice : Int32) #

[View source]
def self.m_edit_shoot(choice : Int32) #

[View source]
def self.m_edit_sleft(choice : Int32) #

[View source]
def self.m_edit_sprint(choice : Int32) #

[View source]
def self.m_edit_sright(choice : Int32) #

[View source]
def self.m_edit_tleft(choice : Int32) #

[View source]
def self.m_edit_tright(choice : Int32) #

[View source]
def self.m_edit_use(choice : Int32) #

[View source]
def self.m_endgame(choice : Int32) #

[View source]
def self.m_endgame_response(ch : Int32) #

m_endgame


[View source]
def self.m_episode(choice : Int32) #

[View source]
def self.m_finish_readthis(choice : Int32) #

[View source]
def self.m_init #

[View source]
def self.m_load_defaults #

[View source]
def self.m_load_game(choice : Int32) #

Selected from DOOM menu


[View source]
def self.m_load_select(choice : Int32) #

User wants to load this game


[View source]
def self.m_moreoptions(choice : Int32) #

[View source]
def self.m_mouse_move(choice : Int32) #

[View source]
def self.m_musicvol(choice : Int32) #

[View source]
def self.m_new_game(choice : Int32) #

[View source]
def self.m_options(choice : Int32) #

[View source]
def self.m_quickload #

[View source]
def self.m_quickload_response(ch : Int32) #

m_quickload


[View source]
def self.m_quicksave #

[View source]
def self.m_quicksave_response(ch : Int32) #

m_quicksave


[View source]
def self.m_quit_response(ch : Int32) #

m_quitdoom


[View source]
def self.m_quitdoom(choice : Int32) #

[View source]
def self.m_random : Int32 #

[View source]
def self.m_read_file(name : Pointer(LibC::Char), buffer : Pointer(Pointer(CDoom::Byte))) : LibC::Int #

[View source]
def self.m_read_save_strings #

m_read_save_strings read the strings from the savegame files


[View source]
def self.m_readthis(choice : Int32) #

m_readthis


[View source]
def self.m_readthis2(choice : Int32) #

[View source]
def self.m_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool #

m_responder


[View source]
def self.m_save_defaults #

[View source]
def self.m_save_game(choice : Int32) #

Selected from DOOM menu


[View source]
def self.m_save_select(choice : Int32) #

User wants to save. Start string input for m_responder


[View source]
def self.m_screenshot #

[View source]
def self.m_setup_next_menu(menudef : Pointer(CDoom::Menu)) #

[View source]
def self.m_sfxvol(choice : Int32) #

[View source]
def self.m_size_display(choice : Int32) #

[View source]
def self.m_sound(choice : Int32) #

[View source]
def self.m_start_control_panel #

[View source]
def self.m_start_message(string : Pointer(LibC::Char), routine : Proc(Int32, Nil), input : CDoom::DoomBool) #

[View source]
def self.m_stop_message #

[View source]
def self.m_string_height(string : Pointer(UInt8)) : Int32 #

Find string height from hu_font chars


[View source]
def self.m_string_width(string : Pointer(UInt8)) : Int32 #

Find string width from hu_font chars


[View source]
def self.m_ticker #

[View source]
def self.m_toggle_amactivedraw(choice : Int32) #

[View source]
def self.m_toggle_fullscreen(choice : Int32) #

[View source]
def self.m_toggle_pitching(choice : Int32) #

[View source]
def self.m_toggle_smoothpan(choice : Int32) #

[View source]
def self.m_toggle_weaponfirecentered(choice : Int32) #

[View source]
def self.m_verify_nightmare(ch : Int32) #

[View source]
def self.m_write_file(name : Pointer(LibC::Char), source : Pointer(Void), length : LibC::Int) : CDoom::DoomBool #

[View source]
def self.m_write_text(x : Int32, y : Int32, string : Pointer(UInt8)) #

Write a string using the hu_font


[View source]
def self.net_buffer_checksum : UInt32 #

Checksum


[View source]
def self.net_buffer_size : Int32 #

[View source]
def self.net_update #

net_update Builds ticcmds for console player, sends out a packet


[View source]
def self.p_activate_in_stasis(tag : LibC::Int) #

[View source]
def self.p_activate_in_stasis_ceiling(line : Pointer(CDoom::Line)) #

Restart a ceiling that's in-stasis


[View source]
def self.p_add_active_ceiling(c : Pointer(CDoom::Ceiling)) #

Add an active ceiling


[View source]
def self.p_add_active_plat(plat : Pointer(CDoom::Plat)) #

[View source]
def self.p_add_thinker(thinker : Pointer(CDoom::Thinker)) #

Adds a new thinker at the end of the list.


[View source]
def self.p_aim_line_attack(t1 : Pointer(CDoom::Mobj), angle : CDoom::Angle, distance : CDoom::Fixed) : CDoom::Fixed #

[View source]
def self.p_aprox_distance(dx : CDoom::Fixed, dy : CDoom::Fixed) : CDoom::Fixed #

Gives an estimation of distance (not exact)


[View source]
def self.p_archive_players(file : File) #

[View source]
def self.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


[View source]
def self.p_archive_thinkers(file : File) #

[View source]
def self.p_archive_world(file : File) #

[View source]
def self.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.


[View source]
def self.p_block_things_iterator(x : LibC::Int, y : LibC::Int, func : Proc(Pointer(CDoom::Mobj), CDoom::DoomBool)) : CDoom::DoomBool #

[View source]
def self.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.


[View source]
def self.p_bring_up_weapon(player : Pointer(CDoom::Player)) #

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


[View source]
def self.p_bullet_slope(mo : Pointer(CDoom::Mobj)) #

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


[View source]
def self.p_calc_height(player : Pointer(CDoom::Player)) #

Calculate the walking / running height adjustment


[View source]
def self.p_change_sector(sector : Pointer(CDoom::Sector), crunch : CDoom::DoomBool) : CDoom::DoomBool #

[View source]
def self.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).


[View source]
def self.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.


[View source]
def self.p_check_melee_range(actor : Pointer(CDoom::Mobj)) : CDoom::DoomBool #

[View source]
def self.p_check_missile_range(actor : Pointer(CDoom::Mobj)) : CDoom::DoomBool #

[View source]
def self.p_check_missile_spawn(th : Pointer(CDoom::Mobj)) #

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


[View source]
def self.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


[View source]
def self.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.


[View source]
def self.p_cross_bsp_node(bspnum : LibC::Int) : CDoom::DoomBool #

Returns true if strace crosses the given node successfully.


[View source]
def self.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.


[View source]
def self.p_cross_subsector(num : LibC::Int) : CDoom::DoomBool #

Returns true if strace crosses the given subsector successfully.


[View source]
def self.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.


[View source]
def self.p_death_think(player : Pointer(CDoom::Player)) #

[View source]
def self.p_divline_side(x : CDoom::Fixed, y : CDoom::Fixed, node : Pointer(CDoom::Divline)) : LibC::Int #

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


[View source]
def self.p_drop_weapon(player : Pointer(CDoom::Player)) #

Player died, so put the weapon away.


[View source]
def self.p_explode_missile(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.p_find_highest_ceiling_surrounding(sec : Pointer(CDoom::Sector)) : CDoom::Fixed #

FIND HIGHEST CEILING IN THE SURROUNDING SECTORS


[View source]
def self.p_find_highest_floor_surrounding(sec : Pointer(CDoom::Sector)) : CDoom::Fixed #

FIND HIGHEST FLOOR HEIGHT IN SURROUNDING SECTORS


[View source]
def self.p_find_lowest_ceiling_surrounding(sec : Pointer(CDoom::Sector)) : CDoom::Fixed #

FIND LOWEST CEILING IN THE SURROUNDING SECTORS


[View source]
def self.p_find_lowest_floor_surrounding(sec : Pointer(CDoom::Sector)) : CDoom::Fixed #

FIND LOWEST FLOOR HEIGHT IN SURROUNDING SECTORS


[View source]
def self.p_find_min_surrounding_light(sector : Pointer(CDoom::Sector), max : LibC::Int) : LibC::Int #

Find minimum light from an adjacent sector


[View source]
def self.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.


[View source]
def self.p_find_sector_from_line_tag(line : Pointer(CDoom::Line), start : LibC::Int) : LibC::Int #

RETURN NEXT SECTOR # THAT LINE TAG REFERS TO


[View source]
def self.p_fire_weapon(player : Pointer(CDoom::Player)) #

[View source]
def self.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


[View source]
def self.p_give_armor(player : Pointer(CDoom::Player), armortype : LibC::Int) : CDoom::DoomBool #

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


[View source]
def self.p_give_body(player : Pointer(CDoom::Player), num : LibC::Int) : CDoom::DoomBool #

Returns false if the body isn't needed at all


[View source]
def self.p_give_card(player : Pointer(CDoom::Player), card : CDoom::Card) #

[View source]
def self.p_give_power(player : Pointer(CDoom::Player), power : LibC::Int) : CDoom::DoomBool #

[View source]
def self.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.


[View source]
def self.p_group_lines #

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


[View source]
def self.p_gunshot(mo : Pointer(CDoom::Mobj), accurate : CDoom::DoomBool) #

[View source]
def self.p_hit_slide_line(ld : Pointer(CDoom::Line)) #

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


[View source]
def self.p_init #

[View source]
def self.p_init_pic_anims #

[View source]
def self.p_init_switch_list #

Only called at game initialization


[View source]
def self.p_init_thinkers #

[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.p_kill_mobj(source : Pointer(CDoom::Mobj), target : Pointer(CDoom::Mobj)) #

[View source]
def self.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.


[View source]
def self.p_line_opening(linedef : Pointer(CDoom::Line)) #

Sets opentop and openbottom to the window through a two sided line.

OPTIMIZE keep this precalculated


[View source]
def self.p_load_blockmap(lump : LibC::Int) #

[View source]
def self.p_load_linedefs(lump : LibC::Int) #

Also counts secret lines for intermissions.


[View source]
def self.p_load_nodes(lump : LibC::Int) #

[View source]
def self.p_load_sectors(lump : LibC::Int) #

[View source]
def self.p_load_segs(lump : LibC::Int) #

[View source]
def self.p_load_sidedefs(lump : LibC::Int) #

[View source]
def self.p_load_subsectors(lump : LibC::Int) #

[View source]
def self.p_load_things(lump : LibC::Int) #

[View source]
def self.p_load_vertexes(lump : LibC::Int) #

[View source]
def self.p_look_for_players(actor : Pointer(CDoom::Mobj), allaround : CDoom::DoomBool) : CDoom::DoomBool #

[View source]
def self.p_make_divline(li : Pointer(CDoom::Line), dl : Pointer(CDoom::Divline)) #

[View source]
def self.p_mobj_thinker(mobj : Pointer(CDoom::Mobj)) #

[View source]
def self.p_move(actor : Pointer(CDoom::Mobj)) : CDoom::DoomBool #

[View source]
def self.p_move_player(player : Pointer(CDoom::Player)) #

[View source]
def self.p_move_psprites(player : Pointer(CDoom::Player)) #

Called every tic by player thinking routine.


[View source]
def self.p_new_chase_dir(actor : Pointer(CDoom::Mobj)) #

[View source]
def self.p_nightmare_respawn(mobj : Pointer(CDoom::Mobj)) #

[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.p_player_in_special_sector(player : Pointer(CDoom::Player)) #

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


[View source]
def self.p_player_think(player : Pointer(CDoom::Player)) #

[View source]
def self.p_point_on_divline_side(x : CDoom::Fixed, y : CDoom::Fixed, line : Pointer(CDoom::Divline)) : LibC::Int #

[View source]
def self.p_point_on_line_side(x : CDoom::Fixed, y : CDoom::Fixed, line : Pointer(CDoom::Line)) : LibC::Int #

Returns 0 or 1


[View source]
def self.p_radius_attack(spot : Pointer(CDoom::Mobj), source : Pointer(CDoom::Mobj), damage : LibC::Int) #

Source is the creature that caused the explosion at spot.


[View source]
def self.p_random : Int32 #

Which one is deterministic?


[View source]
def self.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.


[View source]
def self.p_remove_active_ceiling(c : Pointer(CDoom::Ceiling)) #

Remove a ceiling's thinker


[View source]
def self.p_remove_active_plat(plat : Pointer(CDoom::Plat)) #

[View source]
def self.p_remove_mobj(mobj : Pointer(CDoom::Mobj)) #

[View source]
def self.p_remove_thinker(thinker : Pointer(CDoom::Thinker)) #

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


[View source]
def self.p_respawn_specials #

[View source]
def self.p_run_thinkers #

[View source]
def self.p_set_mobj_state(mobj : Pointer(CDoom::Mobj), state : CDoom::Statenum) : CDoom::DoomBool #

[View source]
def self.p_set_psprite(player : Pointer(CDoom::Player), position : LibC::Int, stnum : CDoom::Statenum) #

[View source]
def self.p_set_thing_position(thing : Pointer(CDoom::Mobj)) #

[View source]
def self.p_setup_level(episode : LibC::Int, map : LibC::Int, playermask : LibC::Int, skill : CDoom::Skill) #

[View source]
def self.p_setup_psprites(player : Pointer(CDoom::Player)) #

Called at start of level for each player.


[View source]
def self.p_shoot_special_line(thing : Pointer(CDoom::Mobj), line : Pointer(CDoom::Line)) #

Called when a thing shoots a special line.


[View source]
def self.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.


[View source]
def self.p_spawn_blood(x : CDoom::Fixed, y : CDoom::Fixed, z : CDoom::Fixed, damage : Int32) #

[View source]
def self.p_spawn_door_close_in_30(sec : Pointer(CDoom::Sector)) #

Spawn a door that closes after 30 seconds


[View source]
def self.p_spawn_door_raise_in_5_mins(sec : Pointer(CDoom::Sector), secnum : LibC::Int) #

Spawn a door that opens after 5 minutes


[View source]
def self.p_spawn_fire_flicker(sector : Pointer(CDoom::Sector)) #

[View source]
def self.p_spawn_glowing_light(sector : Pointer(CDoom::Sector)) #

[View source]
def self.p_spawn_light_flash(sector : Pointer(CDoom::Sector)) #

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


[View source]
def self.p_spawn_map_thing(mthing : Pointer(CDoom::Mapthing)) #

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


[View source]
def self.p_spawn_missile(source : Pointer(CDoom::Mobj), dest : Pointer(CDoom::Mobj), type : CDoom::Mobjtype) : Pointer(CDoom::Mobj) #

[View source]
def self.p_spawn_mobj(x : CDoom::Fixed, y : CDoom::Fixed, z : CDoom::Fixed, type : CDoom::Mobjtype) : Pointer(CDoom::Mobj) #

[View source]
def self.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.


[View source]
def self.p_spawn_player_missile(source : Pointer(CDoom::Mobj), type : CDoom::Mobjtype) #

Tries to aim at a nearby monster


[View source]
def self.p_spawn_puff(x : CDoom::Fixed, y : CDoom::Fixed, z : CDoom::Fixed) #

[View source]
def self.p_spawn_specials #

Parses command line parameters.


[View source]
def self.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


[View source]
def self.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.


[View source]
def self.p_teleport_move(thing : Pointer(CDoom::Mobj), x : CDoom::Fixed, y : CDoom::Fixed) : CDoom::DoomBool #

[View source]
def self.p_thing_height_clip(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool #

[View source]
def self.p_thrust(player : Pointer(CDoom::Player), angle : CDoom::Angle, move : CDoom::Fixed) #

Moves the given origin along a given angle.


[View source]
def self.p_ticker #

[View source]
def self.p_touch_special_thing(special : Pointer(CDoom::Mobj), toucher : Pointer(CDoom::Mobj)) #

[View source]
def self.p_traverse_intercepts(func : CDoom::Traverser, maxfrac : CDoom::Fixed) : CDoom::DoomBool #

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


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.p_unarchive_players(file : File) #

[View source]
def self.p_unarchive_specials(file : File) #

[View source]
def self.p_unarchive_thinkers(file : File) #

[View source]
def self.p_unarchive_world(file : File) #

[View source]
def self.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.


[View source]
def self.p_update_specials #

Animate planes, scroll walls, etc.


[View source]
def self.p_use_lines(player : Pointer(CDoom::Player)) #

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


[View source]
def self.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.


[View source]
def self.p_xymovement(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.p_zmovement(mo : Pointer(CDoom::Mobj)) #

[View source]
def self.packet_get #

[View source]
def self.packet_send #

[View source]
def self.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.


[View source]
def self.pit_add_thing_intercepts(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool #

[View source]
def self.pit_change_sector(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool #

[View source]
def self.pit_check_line(ld : Pointer(CDoom::Line)) : CDoom::DoomBool #

Adjusts tmfloorz and tmceilingz as lines are contacted


[View source]
def self.pit_check_thing(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool #

[View source]
def self.pit_radius_attack(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool #

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


[View source]
def self.pit_stomp_thing(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool #

[View source]
def self.pit_vile_check(thing : Pointer(CDoom::Mobj)) : CDoom::DoomBool #

Detect a corpse that could be raised.


[View source]
def self.ptr_aim_traverse(int : Pointer(CDoom::Intercept)) : CDoom::DoomBool #

Sets linetaget and aimslope when a target is aimed at.


[View source]
def self.ptr_shoot_traverse(int : Pointer(CDoom::Intercept)) : CDoom::DoomBool #

[View source]
def self.ptr_slide_traverse(int : Pointer(CDoom::Intercept)) : CDoom::DoomBool #

[View source]
def self.ptr_use_traverse(int : Pointer(CDoom::Intercept)) : CDoom::DoomBool #

[View source]
def self.punch_peers #

[View source]
def self.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.


[View source]
def self.r_add_sprites(sec : Pointer(CDoom::Sector)) #

During BSP traversal, this adds sprites by sector.


[View source]
def self.r_addline(line : Pointer(CDoom::Seg)) #

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


[View source]
def self.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.


[View source]
def self.r_check_plane(pl : Pointer(CDoom::Visplane), start : LibC::Int, stop : LibC::Int) : Pointer(CDoom::Visplane) #

[View source]
def self.r_check_texture_num_for_name(name : Pointer(LibC::Char)) : LibC::Int #

Check whether texture is available. Filter out NoTexture indicator.


[View source]
def self.r_clear_clip_segs #

[View source]
def self.r_clear_draw_segs #

[View source]
def self.r_clear_planes #

At begining of frame.


[View source]
def self.r_clear_sprites #

Called at frame start.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.r_draw_masked #

[View source]
def self.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.


[View source]
def self.r_draw_planes #

At the end of each frame.


[View source]
def self.r_draw_player_sprites #

[View source]
def self.r_draw_psprite(psp : Pointer(CDoom::Pspdef)) #

[View source]
def self.r_draw_span #

Draws the actual span.


[View source]
def self.r_draw_sprite(spr : Pointer(CDoom::Vissprite)) #

[View source]
def self.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.


[View source]
def self.r_draw_view_border #

Draws the border around the view for different size windows?


[View source]
def self.r_draw_vis_sprite(vis : Pointer(CDoom::Vissprite), x1 : LibC::Int, x2 : LibC::Int) #

[View source]
def self.r_execute_set_view_size #

[View source]
def self.r_fill_back_screen #

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


[View source]
def self.r_find_plane(height : CDoom::Fixed, picnum : LibC::Int, lightlevel : LibC::Int) : Pointer(CDoom::Visplane) #

[View source]
def self.r_flat_num_for_name(name : Pointer(LibC::Char)) : LibC::Int #

Retrieval, get a flat number for a flat name.


[View source]
def self.r_generate_composite(texnum : LibC::Int) #

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


[View source]
def self.r_generate_lookup(texnum : LibC::Int) #

[View source]
def self.r_get_column(tex : LibC::Int, col : LibC::Int) : Pointer(CDoom::Byte) #

[View source]
def self.r_init #

[View source]
def self.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.


[View source]
def self.r_init_colormaps #

[View source]
def self.r_init_data #

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


[View source]
def self.r_init_flats #

[View source]
def self.r_init_light_tables #

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


[View source]
def self.r_init_sky_map #

Called whenever the view size changes.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.r_init_sprites(namelist : Pointer(Pointer(LibC::Char))) #

Called at program start.


[View source]
def self.r_init_tables #

[View source]
def self.r_init_texture_mapping #

[View source]
def self.r_init_textures #

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


[View source]
def self.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.


[View source]
def self.r_install_sprite_lump(lump : LibC::Int, frame : LibC::UInt, rotation : LibC::UInt, flipped : CDoom::DoomBool) #

Local function for R_InitSprites.


[View source]
def self.r_make_spans(x : LibC::Int, t1 : LibC::Int, b1 : LibC::Int, t2 : LibC::Int, b2 : LibC::Int) #

[View source]
def self.r_map_plane(y : LibC::Int, x1 : LibC::Int, x2 : LibC::Int) #

Uses global vars: planeheight ds_source basexscale baseyscale viewx viewy

BASIC PRIMITIVE


[View source]
def self.r_new_vis_sprite : Pointer(CDoom::Vissprite) #

[View source]
def self.r_point_in_subsector(x : CDoom::Fixed, y : CDoom::Fixed) : Pointer(CDoom::Subsector) #

[View source]
def self.r_point_on_seg_side(x : CDoom::Fixed, y : CDoom::Fixed, line : Pointer(CDoom::Seg)) : LibC::Int #

[View source]
def self.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).


[View source]
def self.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.


[View source]
def self.r_point_to_angle2(x1 : CDoom::Fixed, y1 : CDoom::Fixed, x2 : CDoom::Fixed, y2 : CDoom::Fixed) : CDoom::Angle #

[View source]
def self.r_point_to_dist(x : CDoom::Fixed, y : CDoom::Fixed) : CDoom::Fixed #

[View source]
def self.r_precache_level #

Preloads all relevant graphics for the level.


[View source]
def self.r_project_sprite(thing : Pointer(CDoom::Mobj)) #

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


[View source]
def self.r_render_bsp_node(bspnum : LibC::Int) #

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


[View source]
def self.r_render_masked_seg_range(ds : Pointer(CDoom::Drawseg), x1 : LibC::Int, x2 : LibC::Int) #

[View source]
def self.r_render_player_view(player : Pointer(CDoom::Player)) #

[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.r_setup_frame(player : Pointer(CDoom::Player)) #

[View source]
def self.r_sort_vis_sprites #

[View source]
def self.r_store_wall_range(start : LibC::Int, stop : LibC::Int) #

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


[View source]
def self.r_subsector(num : LibC::Int) #

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


[View source]
def self.r_texture_num_for_name(name : Pointer(LibC::Char)) : LibC::Int #

Calls R_CheckTextureNumForName, aborts with error message.


[View source]
def self.r_video_erase(ofs : LibC::UInt, count : LibC::Int) #

Copy a screen buffer.


[View source]
def self.reset_all_channels #

[View source]
def self.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.


[View source]
def self.s_change_music(musicnum : LibC::Int, looping : LibC::Int) #

[View source]
def self.s_get_channel(origin : Pointer(Void), sfxinfo : Pointer(CDoom::Sfxinfo)) : LibC::Int #

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


[View source]
def self.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.


[View source]
def self.s_pause_sound #

Stop and resume music, during game PAUSE.


[View source]
def self.s_resume_sound #

[View source]
def self.s_set_music_volume(volume : LibC::Int) #

[View source]
def self.s_set_sfx_volume(volume : LibC::Int) #

[View source]
def self.s_start #

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


[View source]
def self.s_start_music(m_id : LibC::Int) #

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


[View source]
def self.s_start_sound(origin : Pointer(Void), sfx_id : LibC::Int) #

[View source]
def self.s_start_sound_at_volume(origin_p : Pointer(Void), sfx_id : LibC::Int, volume : LibC::Int) #

[View source]
def self.s_stop_channel(cnum : LibC::Int) #

[View source]
def self.s_stop_music #

[View source]
def self.s_stop_sound(origin : Pointer(Void)) #

[View source]
def self.s_update_sounds(listener_p : Pointer(Void)) #

Updates music & sounds


[View source]
def self.slope_div(num : LibC::UInt, den : LibC::UInt) : LibC::Int #

[View source]
def self.st_calc_pain_offset : LibC::Int #

[View source]
def self.st_create_widgets #

[View source]
def self.st_diff_draw #

[View source]
def self.st_do_palette_stuff #

[View source]
def self.st_do_refresh #

[View source]
def self.st_draw_widgets(refresh : CDoom::DoomBool) #

[View source]
def self.st_drawer(fullscreen : CDoom::DoomBool, refresh : CDoom::DoomBool) #

[View source]
def self.st_init #

[View source]
def self.st_init_data #

[View source]
def self.st_load_data #

[View source]
def self.st_load_graphics #

[View source]
def self.st_refresh_background #

[View source]
def self.st_responder(ev : Pointer(CDoom::Event)) : CDoom::DoomBool #

Respond to keyboard input events, intercept cheats.


[View source]
def self.st_start #

[View source]
def self.st_stop #

[View source]
def self.st_ticker #

[View source]
def self.st_unload_data #

[View source]
def self.st_unload_graphics #

[View source]
def self.st_update_face_widget #

[View source]
def self.st_update_widgets #

[View source]
def self.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?


[View source]
def self.stlib_init #

[View source]
def self.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)) #

[View source]
def self.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)) #

[View source]
def self.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) #

?


[View source]
def self.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)) #

[View source]
def self.stlib_update_bin_icon(bi : Pointer(CDoom::ST_Binicon), refresh : CDoom::DoomBool) #

[View source]
def self.stlib_update_mult_icon(mi : Pointer(CDoom::ST_Multicon), refresh : CDoom::DoomBool) #

[View source]
def self.stlib_update_num(n : Pointer(CDoom::ST_Number), refresh : CDoom::DoomBool) #

[View source]
def self.stlib_update_percent(per : Pointer(CDoom::ST_Percent), refresh : LibC::Int) #

[View source]
def self.t_fire_flicker(flick : Pointer(CDoom::Fireflicker)) #

[View source]
def self.t_glow(g : Pointer(CDoom::Glow)) #

[View source]
def self.t_light_flash(flash : Pointer(CDoom::Lightflash)) #

Do flashing lights.


[View source]
def self.t_move_ceiling(ceiling : Pointer(CDoom::Ceiling)) #

[View source]
def self.t_move_floor(floor : Pointer(CDoom::Floormove)) #

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


[View source]
def self.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 #

[View source]
def self.t_plat_raise(plat : Pointer(CDoom::Plat)) #

Move a plat up and down


[View source]
def self.t_strobe_flash(flash : Pointer(CDoom::Strobe)) #

[View source]
def self.t_vertical_door(door : Pointer(CDoom::Vldoor)) #

Move a locked door up/down


[View source]
def self.try_run_tics #

try_run_tics


[View source]
def self.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.


[View source]
def self.udp_socket : UDPSocket #

[View source]
def self.update_audio #

[View source]
def self.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) #

[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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) #

[View source]
def self.v_get_block(x : LibC::Int, y : LibC::Int, scrn : LibC::Int, width : LibC::Int, height : LibC::Int, dest : Pointer(CDoom::Byte)) #

[View source]
def self.v_init #

[View source]
def self.v_mark_rect(x : LibC::Int, y : LibC::Int, width : LibC::Int, height : LibC::Int) #

[View source]
def self.w_add_file(filename : Pointer(LibC::Char)) #

[View source]
def self.w_cache_lump_name(name : Pointer(LibC::Char), tag : LibC::Int) : Pointer(Void) #

[View source]
def self.w_cache_lump_num(lump : LibC::Int, tag : LibC::Int) : Pointer(Void) #

[View source]
def self.w_check_num_for_name(name : Pointer(LibC::Char)) : LibC::Int #

Returns -1 if name not found.


[View source]
def self.w_get_num_for_name(name : Pointer(LibC::Char)) : LibC::Int #

Calls w_check_num_for_name, but bombs out if not found.


[View source]
def self.w_init_file(filename : Pointer(LibC::Char)) #

Just initialize from a single file.


[View source]
def self.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.


[View source]
def self.w_lump_length(lump : LibC::Int) : LibC::Int #

Returns the buffer size needed to load the given lump.


[View source]
def self.w_read_lump(lump : LibC::Int, dest : Pointer(Void)) #

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


[View source]
def self.w_reload #

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


[View source]
def self.wi_check_for_accelerate #

[View source]
def self.wi_draw_animated_back #

[View source]
def self.wi_draw_deathmatch_stats #

[View source]
def self.wi_draw_el #

Draws "Entering "


[View source]
def self.wi_draw_lf #

Draws " Finished!"


[View source]
def self.wi_draw_netgame_stats #

[View source]
def self.wi_draw_no_state #

[View source]
def self.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.


[View source]
def self.wi_draw_on_lnode(n : LibC::Int, c : Pointer(Pointer(CDoom::Patch))) #

[View source]
def self.wi_draw_percent(x : LibC::Int, y : LibC::Int, p : LibC::Int) #

[View source]
def self.wi_draw_show_next_loc #

[View source]
def self.wi_draw_stats #

[View source]
def self.wi_draw_time(x : LibC::Int, y : LibC::Int, t : LibC::Int) #

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


[View source]
def self.wi_drawer #

[View source]
def self.wi_end #

[View source]
def self.wi_frag_sum(playernum : LibC::Int) : LibC::Int #

[View source]
def self.wi_init_animated_back #

[View source]
def self.wi_init_deathmatch_stats #

[View source]
def self.wi_init_netgame_stats #

[View source]
def self.wi_init_no_state #

[View source]
def self.wi_init_show_next_loc #

[View source]
def self.wi_init_stats #

[View source]
def self.wi_init_variables(wbstartstruct : Pointer(CDoom::Wbstartstruct)) #

[View source]
def self.wi_load_data #

[View source]
def self.wi_slam_background #

[View source]
def self.wi_start(wbstartstruct : Pointer(CDoom::Wbstartstruct)) #

[View source]
def self.wi_ticker #

Updates stuff each tick


[View source]
def self.wi_unload_data #

[View source]
def self.wi_update_animated_back #

[View source]
def self.wi_update_deathmatch_stats #

[View source]
def self.wi_update_netgame_stats #

[View source]
def self.wi_update_no_state #

[View source]
def self.wi_update_show_next_loc #

[View source]
def self.wi_update_stats #

[View source]
def self.wipe_do_color_x_form(width : Int32, height : Int32, ticks : Int32) : Int32 #

[View source]
def self.wipe_do_melt(width : Int32, height : Int32, ticks : Int32) : Int32 #

[View source]
def self.wipe_end_screen(x : Int32, y : Int32, width : Int32, height : Int32) : Int32 #

[View source]
def self.wipe_exit_color_x_form(width : Int32, height : Int32, ticks : Int32) : Int32 #

[View source]
def self.wipe_exit_melt(width : Int32, height : Int32, ticks : Int32) : Int32 #

[View source]
def self.wipe_init_color_x_form(width : Int32, height : Int32, ticks : Int32) : Int32 #

[View source]
def self.wipe_init_melt(width : Int32, height : Int32, ticks : Int32) : Int32 #

[View source]
def self.wipe_screen_wipe(wipeno : Int32, x : Int32, y : Int32, width : Int32, height : Int32, ticks : Int32) : Int32 #

[View source]
def self.wipe_shitty_col_major_x_form(array : Pointer(Int16), width : Int32, height : Int32) #

[View source]
def self.wipe_start_screen(x : Int32, y : Int32, width : Int32, height : Int32) : Int32 #

[View source]
def self.write_pcx_file(filename : Pointer(LibC::Char), data : Pointer(CDoom::Byte), width : LibC::Int, height : LibC::Int, palette : Pointer(CDoom::Byte)) #

[View source]
def self.z_change_tag2(ptr : Pointer(Void), tag : LibC::Int) #

[View source]
def self.z_check_heap #

[View source]
def self.z_free(ptr : Pointer(Void)) #

[View source]
def self.z_free_tags(lowtag : LibC::Int, hightag : LibC::Int) #

[View source]
def self.z_init #

[View source]
def self.z_malloc(size : LibC::Int, tag : LibC::Int, user : Pointer(Void)) : Pointer(Void) #

[View source]

Macro Detail

macro dooutcode(oc, mx, my) #

[View source]
macro poll_button(doombutton, raylibbutton) #

[View source]
macro poll_key(doomkey, raylibkey) #

-- Macros for quick key polling --


[View source]
macro poll_two_key(doomkey, raylibkey1, raylibkey2) #

[View source]
macro putdot(xx, yy, cc) #

[View source]