├── marathon2 ├── Icon_ ├── binaries │ ├── NotPPC │ ├── demo.resource │ ├── folder icon │ ├── game.resource │ ├── marathon2.resource │ └── .AppleDouble │ │ ├── NotPPC │ │ ├── .Parent │ │ ├── folder icon │ │ ├── demo.resource │ │ ├── game.resource │ │ └── marathon2.resource ├── export_definitions ├── extract │ ├── sndextract │ ├── shapeextract │ ├── sndextract.make │ ├── shapeextract.make │ ├── .AppleDouble │ │ ├── .Parent │ │ ├── shapeextract │ │ ├── sndextract │ │ ├── sndextract.c │ │ ├── shapeextract.c │ │ ├── shapeextract.make │ │ └── sndextract.make │ ├── shapeextract.c │ └── sndextract.c ├── interface_editor ├── demos │ ├── demos.resource │ ├── L00.demo │ ├── L01.demo │ ├── L05.demo │ └── .AppleDouble │ │ ├── .Parent │ │ ├── L00.demo │ │ ├── L01.demo │ │ ├── L05.demo │ │ └── demos.resource ├── graphics │ ├── demo.screens │ ├── game.screens │ └── .AppleDouble │ │ ├── .Parent │ │ ├── demo.screens │ │ └── game.screens ├── map.c ├── map.h ├── vbl.c ├── wad.c ├── fades.c ├── items.c ├── makefile ├── player.c ├── player.h ├── render.c ├── render.h ├── screen.a ├── screen.c ├── shapes.c ├── shell.c ├── shell.h ├── sound.c ├── tags.h ├── world.c ├── world.h ├── demos.make ├── devices.c ├── effects.c ├── effects.h ├── game_wad.c ├── monsters.c ├── monsters.h ├── network.c ├── network.h ├── physics.c ├── scenery.c ├── texts.make ├── valkyrie.c ├── weapons.c ├── buildprogram ├── flood_map.c ├── game_window.c ├── interface.c ├── lightsource.c ├── marathon2.c ├── marathon2.r ├── network_ddp.c ├── pathfinding.c ├── platforms.c ├── platforms.h ├── projectiles.c ├── projectiles.h ├── quadruple.s ├── shapes.make ├── game_dialogs.c ├── motion_sensor.c ├── network_adsp.c ├── network_games.c ├── network_names.c ├── overhead_map.c ├── .AppleDouble │ ├── Icon_ │ ├── crc.c │ ├── crc.h │ ├── map.c │ ├── map.h │ ├── vbl.c │ ├── vbl.h │ ├── wad.c │ ├── wad.h │ ├── .Parent │ ├── fades.c │ ├── fades.h │ ├── items.c │ ├── items.h │ ├── media.c │ ├── media.h │ ├── mouse.c │ ├── mouse.h │ ├── music.c │ ├── music.h │ ├── shell.c │ ├── shell.h │ ├── sound.c │ ├── sound.h │ ├── tags.h │ ├── world.c │ ├── world.h │ ├── demos.make │ ├── devices.c │ ├── effects.c │ ├── effects.h │ ├── game_wad.c │ ├── game_wad.h │ ├── images.c │ ├── images.h │ ├── makefile │ ├── monsters.c │ ├── monsters.h │ ├── network.c │ ├── network.h │ ├── physics.c │ ├── player.c │ ├── player.h │ ├── progress.c │ ├── progress.h │ ├── render.c │ ├── render.h │ ├── scenery.c │ ├── scenery.h │ ├── screen.a │ ├── screen.c │ ├── screen.h │ ├── shapes.c │ ├── texts.make │ ├── textures.c │ ├── textures.h │ ├── valkyrie.c │ ├── valkyrie.h │ ├── weapons.c │ ├── weapons.h │ ├── buildprogram │ ├── extensions.h │ ├── find_files.c │ ├── find_files.h │ ├── flood_map.c │ ├── flood_map.h │ ├── interface.c │ ├── interface.h │ ├── marathon2.c │ ├── marathon2.r │ ├── placement.c │ ├── platforms.c │ ├── platforms.h │ ├── quadruple.s │ ├── shapes.make │ ├── wad_prefs.c │ ├── wad_prefs.h │ ├── game_dialogs.c │ ├── game_errors.c │ ├── game_errors.h │ ├── game_window.c │ ├── game_window.h │ ├── lightsource.c │ ├── lightsource.h │ ├── map_accessors.c │ ├── motion_sensor.c │ ├── motion_sensor.h │ ├── network_adsp.c │ ├── network_ddp.c │ ├── network_games.c │ ├── network_games.h │ ├── network_modem.c │ ├── network_modem.h │ ├── network_names.c │ ├── network_sound.h │ ├── overhead_map.c │ ├── overhead_map.h │ ├── pathfinding.c │ ├── preferences.c │ ├── preferences.h │ ├── projectiles.c │ ├── projectiles.h │ ├── vbl_macintosh.c │ ├── wad_macintosh.c │ ├── files_macintosh.c │ ├── interface_editor │ ├── interface_menus.h │ ├── key_definitions.h │ ├── keyboard_dialog.c │ ├── network_dialogs.c │ ├── network_lookup.c │ ├── network_speaker.c │ ├── network_stream.c │ ├── network_stream.h │ ├── physics_models.h │ ├── physics_patches.c │ ├── portable_files.h │ ├── screen_drawing.c │ ├── screen_drawing.h │ ├── sound_macintosh.c │ ├── vbl_definitions.h │ ├── computer_interface.c │ ├── computer_interface.h │ ├── effect_definitions.h │ ├── export_definitions │ ├── export_definitions.c │ ├── import_definitions.c │ ├── item_definitions.h │ ├── low_level_textures.c │ ├── macintosh_network.h │ ├── map_constructors.c │ ├── media_definitions.h │ ├── network_listener.a │ ├── network_microphone.c │ ├── physics_patches.make │ ├── preprocess_map_mac.c │ ├── scottish_textures.a │ ├── scottish_textures.c │ ├── scottish_textures.h │ ├── screen_definitions.h │ ├── shape_definitions.h │ ├── shape_descriptors.h │ ├── shapes_macintosh.c │ ├── song_definitions.h │ ├── sound_definitions.h │ ├── weapon_definitions.h │ ├── interface_macintosh.c │ ├── monster_definitions.h │ ├── platform_definitions.h │ ├── scenery_definitions.h │ ├── scottish_textures16.a │ ├── wad_prefs_macintosh.c │ ├── collection_definition.h │ ├── export_definitions.make │ ├── game_window_macintosh.c │ ├── network_modem_protocol.c │ ├── network_modem_protocol.h │ ├── overhead_map_macintosh.c │ └── projectile_definitions.h ├── keyboard_dialog.c ├── map_constructors.c ├── network_dialogs.c ├── network_listener.a ├── network_lookup.c ├── network_speaker.c ├── physics_models.h ├── physics_patches.c ├── screen_drawing.c ├── shapes_macintosh.c ├── sound_macintosh.c ├── computer_interface.c ├── effect_definitions.h ├── import_definitions.c ├── low_level_textures.c ├── physics_patches.make ├── scottish_textures.a ├── scottish_textures.c ├── scottish_textures.h ├── shape_descriptors.h ├── sound_definitions.h ├── weapon_definitions.h ├── collection_definition.h ├── export_definitions.make ├── interface_macintosh.c ├── monster_definitions.h ├── scenery_definitions.h ├── scottish_textures16.a ├── network_modem_protocol.c ├── projectile_definitions.h ├── demos.demo │ └── .AppleDouble │ │ └── .Parent ├── editor code │ ├── .AppleDouble │ │ ├── .Parent │ │ └── editor.h │ └── editor.h ├── mouse.h ├── crc.h ├── scenery.h ├── music.h ├── motion_sensor.h ├── progress.h ├── game_errors.h ├── screen_definitions.h ├── overhead_map.h ├── interface_menus.h ├── valkyrie.h ├── game_errors.c ├── game_window.h ├── song_definitions.h ├── network_sound.h ├── network_modem.h ├── images.h ├── textures.h ├── network_stream.h ├── network_modem_protocol.h ├── network_games.h ├── flood_map.h ├── vbl_definitions.h ├── find_files.h ├── shape_definitions.h ├── portable_files.h ├── vbl.h ├── extensions.h ├── wad_prefs.h ├── preferences.h ├── screen.h ├── game_window_macintosh.c ├── game_wad.h ├── items.h ├── fades.h ├── media.h ├── progress.c ├── media_definitions.h ├── map_accessors.c ├── lightsource.h ├── screen_drawing.h ├── export_definitions.c ├── weapons.h ├── computer_interface.h ├── textures.c ├── item_definitions.h ├── crc.c ├── find_files.c ├── macintosh_network.h ├── files_macintosh.c ├── key_definitions.h ├── media.c ├── mouse.c ├── network_stream.c ├── wad_prefs_macintosh.c ├── wad_prefs.c ├── wad.h ├── platform_definitions.h └── overhead_map_macintosh.c └── Marathon 2 Source ReadMe /marathon2/Icon_: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/binaries/NotPPC: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/export_definitions: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/extract/sndextract: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/interface_editor: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/binaries/demo.resource: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/binaries/folder icon: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/binaries/game.resource: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/demos/demos.resource: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/extract/shapeextract: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/graphics/demo.screens: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/graphics/game.screens: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/binaries/marathon2.resource: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /marathon2/map.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/map.c -------------------------------------------------------------------------------- /marathon2/map.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/map.h -------------------------------------------------------------------------------- /marathon2/vbl.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/vbl.c -------------------------------------------------------------------------------- /marathon2/wad.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/wad.c -------------------------------------------------------------------------------- /marathon2/fades.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/fades.c -------------------------------------------------------------------------------- /marathon2/items.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/items.c -------------------------------------------------------------------------------- /marathon2/makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/makefile -------------------------------------------------------------------------------- /marathon2/player.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/player.c -------------------------------------------------------------------------------- /marathon2/player.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/player.h -------------------------------------------------------------------------------- /marathon2/render.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/render.c -------------------------------------------------------------------------------- /marathon2/render.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/render.h -------------------------------------------------------------------------------- /marathon2/screen.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/screen.a -------------------------------------------------------------------------------- /marathon2/screen.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/screen.c -------------------------------------------------------------------------------- /marathon2/shapes.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/shapes.c -------------------------------------------------------------------------------- /marathon2/shell.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/shell.c -------------------------------------------------------------------------------- /marathon2/shell.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/shell.h -------------------------------------------------------------------------------- /marathon2/sound.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/sound.c -------------------------------------------------------------------------------- /marathon2/tags.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/tags.h -------------------------------------------------------------------------------- /marathon2/world.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/world.c -------------------------------------------------------------------------------- /marathon2/world.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/world.h -------------------------------------------------------------------------------- /marathon2/demos.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/demos.make -------------------------------------------------------------------------------- /marathon2/devices.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/devices.c -------------------------------------------------------------------------------- /marathon2/effects.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/effects.c -------------------------------------------------------------------------------- /marathon2/effects.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/effects.h -------------------------------------------------------------------------------- /marathon2/game_wad.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/game_wad.c -------------------------------------------------------------------------------- /marathon2/monsters.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/monsters.c -------------------------------------------------------------------------------- /marathon2/monsters.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/monsters.h -------------------------------------------------------------------------------- /marathon2/network.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network.c -------------------------------------------------------------------------------- /marathon2/network.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network.h -------------------------------------------------------------------------------- /marathon2/physics.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/physics.c -------------------------------------------------------------------------------- /marathon2/scenery.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/scenery.c -------------------------------------------------------------------------------- /marathon2/texts.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/texts.make -------------------------------------------------------------------------------- /marathon2/valkyrie.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/valkyrie.c -------------------------------------------------------------------------------- /marathon2/weapons.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/weapons.c -------------------------------------------------------------------------------- /marathon2/buildprogram: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/buildprogram -------------------------------------------------------------------------------- /marathon2/flood_map.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/flood_map.c -------------------------------------------------------------------------------- /marathon2/game_window.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/game_window.c -------------------------------------------------------------------------------- /marathon2/interface.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/interface.c -------------------------------------------------------------------------------- /marathon2/lightsource.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/lightsource.c -------------------------------------------------------------------------------- /marathon2/marathon2.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/marathon2.c -------------------------------------------------------------------------------- /marathon2/marathon2.r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/marathon2.r -------------------------------------------------------------------------------- /marathon2/network_ddp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network_ddp.c -------------------------------------------------------------------------------- /marathon2/pathfinding.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/pathfinding.c -------------------------------------------------------------------------------- /marathon2/platforms.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/platforms.c -------------------------------------------------------------------------------- /marathon2/platforms.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/platforms.h -------------------------------------------------------------------------------- /marathon2/projectiles.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/projectiles.c -------------------------------------------------------------------------------- /marathon2/projectiles.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/projectiles.h -------------------------------------------------------------------------------- /marathon2/quadruple.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/quadruple.s -------------------------------------------------------------------------------- /marathon2/shapes.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/shapes.make -------------------------------------------------------------------------------- /marathon2/demos/L00.demo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/demos/L00.demo -------------------------------------------------------------------------------- /marathon2/demos/L01.demo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/demos/L01.demo -------------------------------------------------------------------------------- /marathon2/demos/L05.demo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/demos/L05.demo -------------------------------------------------------------------------------- /marathon2/game_dialogs.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/game_dialogs.c -------------------------------------------------------------------------------- /marathon2/motion_sensor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/motion_sensor.c -------------------------------------------------------------------------------- /marathon2/network_adsp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network_adsp.c -------------------------------------------------------------------------------- /marathon2/network_games.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network_games.c -------------------------------------------------------------------------------- /marathon2/network_names.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network_names.c -------------------------------------------------------------------------------- /marathon2/overhead_map.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/overhead_map.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/Icon_: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/Icon_ -------------------------------------------------------------------------------- /marathon2/.AppleDouble/crc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/crc.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/crc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/crc.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/map.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/map.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/map.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/map.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/vbl.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/vbl.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/vbl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/vbl.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/wad.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/wad.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/wad.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/wad.h -------------------------------------------------------------------------------- /marathon2/keyboard_dialog.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/keyboard_dialog.c -------------------------------------------------------------------------------- /marathon2/map_constructors.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/map_constructors.c -------------------------------------------------------------------------------- /marathon2/network_dialogs.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network_dialogs.c -------------------------------------------------------------------------------- /marathon2/network_listener.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network_listener.a -------------------------------------------------------------------------------- /marathon2/network_lookup.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network_lookup.c -------------------------------------------------------------------------------- /marathon2/network_speaker.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network_speaker.c -------------------------------------------------------------------------------- /marathon2/physics_models.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/physics_models.h -------------------------------------------------------------------------------- /marathon2/physics_patches.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/physics_patches.c -------------------------------------------------------------------------------- /marathon2/screen_drawing.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/screen_drawing.c -------------------------------------------------------------------------------- /marathon2/shapes_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/shapes_macintosh.c -------------------------------------------------------------------------------- /marathon2/sound_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/sound_macintosh.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/.Parent: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/.Parent -------------------------------------------------------------------------------- /marathon2/.AppleDouble/fades.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/fades.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/fades.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/fades.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/items.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/items.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/items.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/items.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/media.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/media.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/media.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/media.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/mouse.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/mouse.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/mouse.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/mouse.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/music.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/music.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/music.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/music.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/shell.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/shell.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/shell.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/shell.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/sound.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/sound.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/sound.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/sound.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/tags.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/tags.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/world.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/world.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/world.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/world.h -------------------------------------------------------------------------------- /marathon2/computer_interface.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/computer_interface.c -------------------------------------------------------------------------------- /marathon2/effect_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/effect_definitions.h -------------------------------------------------------------------------------- /marathon2/import_definitions.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/import_definitions.c -------------------------------------------------------------------------------- /marathon2/low_level_textures.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/low_level_textures.c -------------------------------------------------------------------------------- /marathon2/physics_patches.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/physics_patches.make -------------------------------------------------------------------------------- /marathon2/scottish_textures.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/scottish_textures.a -------------------------------------------------------------------------------- /marathon2/scottish_textures.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/scottish_textures.c -------------------------------------------------------------------------------- /marathon2/scottish_textures.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/scottish_textures.h -------------------------------------------------------------------------------- /marathon2/shape_descriptors.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/shape_descriptors.h -------------------------------------------------------------------------------- /marathon2/sound_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/sound_definitions.h -------------------------------------------------------------------------------- /marathon2/weapon_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/weapon_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/demos.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/demos.make -------------------------------------------------------------------------------- /marathon2/.AppleDouble/devices.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/devices.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/effects.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/effects.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/effects.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/effects.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/game_wad.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/game_wad.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/game_wad.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/game_wad.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/images.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/images.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/images.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/images.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/makefile -------------------------------------------------------------------------------- /marathon2/.AppleDouble/monsters.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/monsters.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/monsters.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/monsters.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/physics.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/physics.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/player.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/player.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/player.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/player.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/progress.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/progress.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/progress.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/progress.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/render.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/render.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/render.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/render.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/scenery.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/scenery.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/scenery.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/scenery.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/screen.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/screen.a -------------------------------------------------------------------------------- /marathon2/.AppleDouble/screen.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/screen.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/screen.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/screen.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/shapes.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/shapes.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/texts.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/texts.make -------------------------------------------------------------------------------- /marathon2/.AppleDouble/textures.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/textures.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/textures.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/textures.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/valkyrie.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/valkyrie.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/valkyrie.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/valkyrie.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/weapons.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/weapons.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/weapons.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/weapons.h -------------------------------------------------------------------------------- /marathon2/collection_definition.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/collection_definition.h -------------------------------------------------------------------------------- /marathon2/export_definitions.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/export_definitions.make -------------------------------------------------------------------------------- /marathon2/extract/sndextract.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/extract/sndextract.make -------------------------------------------------------------------------------- /marathon2/interface_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/interface_macintosh.c -------------------------------------------------------------------------------- /marathon2/monster_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/monster_definitions.h -------------------------------------------------------------------------------- /marathon2/scenery_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/scenery_definitions.h -------------------------------------------------------------------------------- /marathon2/scottish_textures16.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/scottish_textures16.a -------------------------------------------------------------------------------- /marathon2/.AppleDouble/buildprogram: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/buildprogram -------------------------------------------------------------------------------- /marathon2/.AppleDouble/extensions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/extensions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/find_files.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/find_files.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/find_files.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/find_files.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/flood_map.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/flood_map.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/flood_map.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/flood_map.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/interface.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/interface.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/interface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/interface.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/marathon2.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/marathon2.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/marathon2.r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/marathon2.r -------------------------------------------------------------------------------- /marathon2/.AppleDouble/placement.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/placement.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/platforms.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/platforms.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/platforms.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/platforms.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/quadruple.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/quadruple.s -------------------------------------------------------------------------------- /marathon2/.AppleDouble/shapes.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/shapes.make -------------------------------------------------------------------------------- /marathon2/.AppleDouble/wad_prefs.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/wad_prefs.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/wad_prefs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/wad_prefs.h -------------------------------------------------------------------------------- /marathon2/extract/shapeextract.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/extract/shapeextract.make -------------------------------------------------------------------------------- /marathon2/network_modem_protocol.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/network_modem_protocol.c -------------------------------------------------------------------------------- /marathon2/projectile_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/projectile_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/game_dialogs.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/game_dialogs.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/game_errors.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/game_errors.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/game_errors.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/game_errors.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/game_window.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/game_window.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/game_window.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/game_window.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/lightsource.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/lightsource.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/lightsource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/lightsource.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/map_accessors.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/map_accessors.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/motion_sensor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/motion_sensor.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/motion_sensor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/motion_sensor.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_adsp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_adsp.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_ddp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_ddp.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_games.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_games.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_games.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_games.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_modem.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_modem.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_modem.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_modem.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_names.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_names.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_sound.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_sound.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/overhead_map.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/overhead_map.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/overhead_map.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/overhead_map.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/pathfinding.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/pathfinding.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/preferences.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/preferences.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/preferences.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/preferences.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/projectiles.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/projectiles.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/projectiles.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/projectiles.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/vbl_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/vbl_macintosh.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/wad_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/wad_macintosh.c -------------------------------------------------------------------------------- /marathon2/binaries/.AppleDouble/NotPPC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/binaries/.AppleDouble/NotPPC -------------------------------------------------------------------------------- /marathon2/demos/.AppleDouble/.Parent: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/demos/.AppleDouble/.Parent -------------------------------------------------------------------------------- /marathon2/demos/.AppleDouble/L00.demo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/demos/.AppleDouble/L00.demo -------------------------------------------------------------------------------- /marathon2/demos/.AppleDouble/L01.demo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/demos/.AppleDouble/L01.demo -------------------------------------------------------------------------------- /marathon2/demos/.AppleDouble/L05.demo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/demos/.AppleDouble/L05.demo -------------------------------------------------------------------------------- /marathon2/extract/.AppleDouble/.Parent: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/extract/.AppleDouble/.Parent -------------------------------------------------------------------------------- /marathon2/.AppleDouble/files_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/files_macintosh.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/interface_editor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/interface_editor -------------------------------------------------------------------------------- /marathon2/.AppleDouble/interface_menus.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/interface_menus.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/key_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/key_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/keyboard_dialog.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/keyboard_dialog.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_dialogs.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_dialogs.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_lookup.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_lookup.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_speaker.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_speaker.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_stream.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_stream.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_stream.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_stream.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/physics_models.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/physics_models.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/physics_patches.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/physics_patches.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/portable_files.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/portable_files.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/screen_drawing.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/screen_drawing.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/screen_drawing.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/screen_drawing.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/sound_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/sound_macintosh.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/vbl_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/vbl_definitions.h -------------------------------------------------------------------------------- /marathon2/binaries/.AppleDouble/.Parent: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/binaries/.AppleDouble/.Parent -------------------------------------------------------------------------------- /marathon2/graphics/.AppleDouble/.Parent: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/graphics/.AppleDouble/.Parent -------------------------------------------------------------------------------- /marathon2/.AppleDouble/computer_interface.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/computer_interface.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/computer_interface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/computer_interface.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/effect_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/effect_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/export_definitions: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/export_definitions -------------------------------------------------------------------------------- /marathon2/.AppleDouble/export_definitions.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/export_definitions.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/import_definitions.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/import_definitions.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/item_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/item_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/low_level_textures.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/low_level_textures.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/macintosh_network.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/macintosh_network.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/map_constructors.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/map_constructors.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/media_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/media_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_listener.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_listener.a -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_microphone.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_microphone.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/physics_patches.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/physics_patches.make -------------------------------------------------------------------------------- /marathon2/.AppleDouble/preprocess_map_mac.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/preprocess_map_mac.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/scottish_textures.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/scottish_textures.a -------------------------------------------------------------------------------- /marathon2/.AppleDouble/scottish_textures.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/scottish_textures.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/scottish_textures.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/scottish_textures.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/screen_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/screen_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/shape_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/shape_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/shape_descriptors.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/shape_descriptors.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/shapes_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/shapes_macintosh.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/song_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/song_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/sound_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/sound_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/weapon_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/weapon_definitions.h -------------------------------------------------------------------------------- /marathon2/binaries/.AppleDouble/folder icon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/binaries/.AppleDouble/folder icon -------------------------------------------------------------------------------- /marathon2/demos.demo/.AppleDouble/.Parent: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/demos.demo/.AppleDouble/.Parent -------------------------------------------------------------------------------- /marathon2/demos/.AppleDouble/demos.resource: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/demos/.AppleDouble/demos.resource -------------------------------------------------------------------------------- /marathon2/editor code/.AppleDouble/.Parent: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/editor code/.AppleDouble/.Parent -------------------------------------------------------------------------------- /marathon2/editor code/.AppleDouble/editor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/editor code/.AppleDouble/editor.h -------------------------------------------------------------------------------- /marathon2/extract/.AppleDouble/shapeextract: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/extract/.AppleDouble/shapeextract -------------------------------------------------------------------------------- /marathon2/extract/.AppleDouble/sndextract: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/extract/.AppleDouble/sndextract -------------------------------------------------------------------------------- /marathon2/extract/.AppleDouble/sndextract.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/extract/.AppleDouble/sndextract.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/interface_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/interface_macintosh.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/monster_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/monster_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/platform_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/platform_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/scenery_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/scenery_definitions.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/scottish_textures16.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/scottish_textures16.a -------------------------------------------------------------------------------- /marathon2/.AppleDouble/wad_prefs_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/wad_prefs_macintosh.c -------------------------------------------------------------------------------- /marathon2/binaries/.AppleDouble/demo.resource: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/binaries/.AppleDouble/demo.resource -------------------------------------------------------------------------------- /marathon2/binaries/.AppleDouble/game.resource: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/binaries/.AppleDouble/game.resource -------------------------------------------------------------------------------- /marathon2/extract/.AppleDouble/shapeextract.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/extract/.AppleDouble/shapeextract.c -------------------------------------------------------------------------------- /marathon2/graphics/.AppleDouble/demo.screens: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/graphics/.AppleDouble/demo.screens -------------------------------------------------------------------------------- /marathon2/graphics/.AppleDouble/game.screens: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/graphics/.AppleDouble/game.screens -------------------------------------------------------------------------------- /marathon2/.AppleDouble/collection_definition.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/collection_definition.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/export_definitions.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/export_definitions.make -------------------------------------------------------------------------------- /marathon2/.AppleDouble/game_window_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/game_window_macintosh.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_modem_protocol.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_modem_protocol.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/network_modem_protocol.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/network_modem_protocol.h -------------------------------------------------------------------------------- /marathon2/.AppleDouble/overhead_map_macintosh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/overhead_map_macintosh.c -------------------------------------------------------------------------------- /marathon2/.AppleDouble/projectile_definitions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/.AppleDouble/projectile_definitions.h -------------------------------------------------------------------------------- /marathon2/extract/.AppleDouble/shapeextract.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/extract/.AppleDouble/shapeextract.make -------------------------------------------------------------------------------- /marathon2/extract/.AppleDouble/sndextract.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/extract/.AppleDouble/sndextract.make -------------------------------------------------------------------------------- /marathon2/binaries/.AppleDouble/marathon2.resource: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/historicalsource/marathon2/HEAD/marathon2/binaries/.AppleDouble/marathon2.resource -------------------------------------------------------------------------------- /marathon2/mouse.h: -------------------------------------------------------------------------------- 1 | /* MOUSE.H Tuesday, January 17, 1995 2:53:17 PM (Jason') */ void enter_mouse(short type); void test_mouse(short type, long *action_flags, fixed *delta_yaw, fixed *delta_pitch, fixed *delta_velocity); void exit_mouse(short type); void mouse_idle(short type); -------------------------------------------------------------------------------- /marathon2/crc.h: -------------------------------------------------------------------------------- 1 | /* crc.h Sunday, March 5, 1995 6:25:36 PM Calculate the 32 bit CRC for a given file. */ unsigned long calculate_crc_for_file(FileDesc *file); unsigned long calculate_crc_for_opened_file(short refnum); unsigned long calculate_data_crc(unsigned char *buffer, long length); -------------------------------------------------------------------------------- /marathon2/scenery.h: -------------------------------------------------------------------------------- 1 | /* SCENERY.H Thursday, December 1, 1994 12:19:13 PM (Jason) */ /* ---------- prototypes/SCENERY.C */ void initialize_scenery(void); short new_scenery(struct object_location *location, short scenery_type); void animate_scenery(void); void randomize_scenery_shapes(void); void get_scenery_dimensions(short scenery_type, world_distance *radius, world_distance *height); void damage_scenery(short object_index); -------------------------------------------------------------------------------- /marathon2/music.h: -------------------------------------------------------------------------------- 1 | /* music.h Wednesday, July 12, 1995 11:43:21 PM This only allows for one song to be played at a given time. */ enum { // All of our songs. _introduction_song= 0, NUMBER_OF_SONGS }; boolean initialize_music_handler(FileDesc *song_file); void queue_song(short song_index); void music_idle_proc(void); void stop_music(void); void pause_music(boolean pause); boolean music_playing(void); void free_music_channel(void); void fade_out_music(short duration); -------------------------------------------------------------------------------- /marathon2/motion_sensor.h: -------------------------------------------------------------------------------- 1 | /* MOTION_SENSOR.H Friday, June 17, 1994 12:10:02 PM */ /* ---------- prototypes/MOTION_SENSOR.C */ void initialize_motion_sensor(shape_descriptor mount, shape_descriptor virgin_mounts, shape_descriptor alien, shape_descriptor friend, shape_descriptor enemy, shape_descriptor network_compass, short side_length); void reset_motion_sensor(short monster_index); void motion_sensor_scan(short ticks_elapsed); boolean motion_sensor_has_changed(void); void adjust_motion_sensor_range(void); -------------------------------------------------------------------------------- /marathon2/progress.h: -------------------------------------------------------------------------------- 1 | /* progress.h Saturday, October 28, 1995 10:58:57 PM- rdm created. */ enum { strPROGRESS_MESSAGES= 143, _distribute_map_single= 0, _distribute_map_multiple, _receiving_map, _awaiting_map, _distribute_physics_single, _distribute_physics_multiple, _receiving_physics }; void open_progress_dialog(short message_id); void close_progress_dialog(void); void set_progress_dialog_message(short message_id); void draw_progress_bar(long sent, long total); void reset_progress_bar(void); -------------------------------------------------------------------------------- /marathon2/game_errors.h: -------------------------------------------------------------------------------- 1 | /* game_errors.h Monday, June 12, 1995 9:24:29 AM- rdm created. */ enum { /* types */ systemError, gameError, NUMBER_OF_TYPES }; enum { /* Game Errors */ errNone= 0, errMapFileNotSet, errIndexOutOfRange, errTooManyOpenFiles, errUnknownWadVersion, errWadIndexOutOfRange, errServerDied, errUnsyncOnLevelChange, NUMBER_OF_GAME_ERRORS }; void set_game_error(short type, short error_code); short get_game_error(short *type); boolean error_pending(void); void clear_game_error(void); -------------------------------------------------------------------------------- /marathon2/screen_definitions.h: -------------------------------------------------------------------------------- 1 | /* screen_definitions.h Tuesday, July 11, 1995 5:32:20 PM- rdm created. */ /* -------- this contains the ids for the 8 bit picts */ /* the 16 bit versions are these ids + 10000 */ /* the 32 bit versions are these ids + 20000 */ enum { INTRO_SCREEN_BASE= 1000, MAIN_MENU_BASE= 1100, PROLOGUE_SCREEN_BASE= 1200, EPILOGUE_SCREEN_BASE= 1300, CREDIT_SCREEN_BASE= 1400, CHAPTER_SCREEN_BASE= 1500, COMPUTER_INTERFACE_BASE= 1600, INTERFACE_PANEL_BASE= 1700, FINAL_SCREEN_BASE= 1800 }; -------------------------------------------------------------------------------- /marathon2/overhead_map.h: -------------------------------------------------------------------------------- 1 | /* OVERHEAD_MAP.H Saturday, July 9, 1994 11:19:49 PM */ #define OVERHEAD_MAP_MINIMUM_SCALE 1 #define OVERHEAD_MAP_MAXIMUM_SCALE 4 #define DEFAULT_OVERHEAD_MAP_SCALE 3 enum /* modes */ { _rendering_saved_game_preview, _rendering_checkpoint_map, _rendering_game_map }; struct overhead_map_data { short mode; short scale; world_point2d origin; short origin_polygon_index; short half_width, half_height; short width, height; short top, left; boolean draw_everything; }; void _render_overhead_map(struct overhead_map_data *data); -------------------------------------------------------------------------------- /marathon2/interface_menus.h: -------------------------------------------------------------------------------- 1 | /* interface_menus.h Thursday, September 28, 1995 7:02:23 PM- rdm created. */ enum { /* Menus available during the game */ mGame= 128, iPause= 1, iSave, iRevert, iCloseGame, iQuitGame }; enum { /* Menu interface... */ mInterface= 129, iNewGame= 1, iLoadGame, iGatherGame, iJoinGame, iPreferences, iReplayLastFilm, iSaveLastFilm, iReplaySavedFilm, iCredits, iQuit, iCenterButton }; /* This is the menu with nothing in the title, so that it doesn't show up */ /* when the menu bar is drawn atexit.. */ enum { mFakeEmptyMenu= 130 }; -------------------------------------------------------------------------------- /marathon2/valkyrie.h: -------------------------------------------------------------------------------- 1 | /* VALKYRIE.H Saturday, August 20, 1994 11:21:55 AM */ /* ---------- prototypes/VALKYRIE.C */ boolean machine_has_valkyrie(GDSpecPtr spec); void valkyrie_initialize(GDHandle device, boolean pixel_doubling, Rect *frame, pixel8 transparent); void valkyrie_restore(void); void valkyrie_begin(void); void valkyrie_end(void); void valkyrie_initialize_invisible_video_buffer(struct bitmap_definition *bitmap); void valkyrie_switch_to_invisible_video_buffer(void); void valkyrie_erase_video_buffers(void); void valkyrie_erase_graphic_key_frame(pixel8 transparent_color_index); void valkyrie_change_video_clut(CTabHandle color_table); void valkyrie_change_graphic_clut(CTabHandle color_table); -------------------------------------------------------------------------------- /marathon2/game_errors.c: -------------------------------------------------------------------------------- 1 | /* game_errors.c Monday, June 12, 1995 9:25:53 AM- rdm created. */ #include "cseries.h" #include "game_errors.h" #ifdef mpwc #pragma segment file_io #endif static short last_type= systemError; static short last_error= 0; void set_game_error( short type, short error_code) { assert(type>=0 && type=0 && error_code */ short max; /* Maximum matches to return <- */ short count; /* Count of matches found -> */ /* Callback functions, if returns TRUE, you add it. If */ /* callback==NULL, adds all found. <- */ Boolean (*callback)(FSSpec *file, void *data); void *user_data; /* Passed to callback above. <- */ }; /* Find the files! */ OSErr find_files(struct find_file_pb *param_block); /* Useful function for comparing FSSpecs... */ Boolean equal_fsspecs(FSSpec *a, FSSpec *b); -------------------------------------------------------------------------------- /marathon2/shape_definitions.h: -------------------------------------------------------------------------------- 1 | /* SHAPE_DEFINITIONS.H Tuesday, August 29, 1995 9:56:56 AM (Jason) */ /* ---------- structures */ struct collection_header /* 32 bytes */ { short status; word flags; long offset, length; long offset16, length16; #ifdef mac struct collection_definition **collection; void **shading_tables; short unused[2]; #endif #ifdef win short unused[6]; #endif }; /* ---------- byte-swapping data */ static _bs_field _bs_collection_header[]= { _2byte, _2byte, _4byte, _4byte, _4byte, _4byte, _4byte, _4byte, _2byte, _2byte }; static _bs_field _bs_collection_definition[]= { _2byte, _2byte, _2byte, _2byte, _2byte, _4byte, _2byte, _4byte, _2byte, _4byte, _2byte, _4byte, _2byte, _4byte, 253*sizeof(short) }; static _bs_field _bs_high_level_shape_definition[]= { _2byte, _2byte, HIGH_LEVEL_SHAPE_NAME_LENGTH+1, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, 14*sizeof(short), sizeof(short) // we will byte-swap this later but the structure sizes must match }; static _bs_field _bs_low_level_shape_definition[]= { _2byte, _4byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, _2byte, 4*sizeof(short) }; static _bs_field _bs_bitmap_definition[]= { _2byte, _2byte, _2byte, _2byte, _2byte, 2*sizeof(short), sizeof(void *) }; static _bs_field _bs_rgb_color_value[]= { 2*sizeof(byte), _2byte, _2byte, _2byte }; /* ---------- globals */ static struct collection_header collection_headers[MAXIMUM_COLLECTIONS]; -------------------------------------------------------------------------------- /marathon2/portable_files.h: -------------------------------------------------------------------------------- 1 | /* portable_files.h Saturday, August 26, 1995 1:12:37 PM- rdm created. (for the sake of portability) Needless to say, these can be changed to suit your particular OS */ #ifndef __FILE_DESCRIPTIONS__ #define __FILE_DESCRIPTIONS__ /* ------------- file descriptions */ typedef struct { short vRefNum; long parID; unsigned char name[64]; } FileDesc; /* FileDesc==FileDescriptor */ /* ------------- data types */ typedef short FileError; /* same as OSErr */ typedef short fileref; /* File descriptor, for portability */ /* ------------- file error codes! */ enum { errHitFileEOF= -39, errFileNotFound= -43 }; /* ------------- protos */ FileError create_file(FileDesc *file, unsigned long file_type); // creator for mac, extension for dos /* NONE is considered failure! */ fileref open_file_for_reading(FileDesc *file); fileref open_file_for_writing(FileDesc *file); void close_file(fileref refnum); unsigned long get_fpos(fileref refnum); FileError set_fpos(fileref refnum, unsigned long offset); FileError set_eof(fileref refnum, unsigned long offset); unsigned long get_file_length(fileref refnum); FileError read_file(fileref refnum, unsigned long count, void *buffer); FileError write_file(fileref refnum, unsigned long count, void *buffer); FileError delete_file(FileDesc *file); FileError find_preferences_location(FileDesc *file); /* ------ miscellaneous routines */ FileError add_application_name_to_fsspec(FileDesc *file, char *pascal_name); void get_application_filedesc(FileDesc *file); FileError memory_error(void); #endif -------------------------------------------------------------------------------- /marathon2/vbl.h: -------------------------------------------------------------------------------- 1 | /* vbl.h Friday, September 29, 1995 3:24:01 PM- rdm created. */ /* ------------ prototypes/VBL.C */ boolean setup_for_replay_from_file(FileDesc *file, unsigned long map_checksum); boolean setup_replay_from_random_resource(unsigned long map_checksum); void start_recording(void); boolean find_replay_to_use(boolean ask_user, FileDesc *file); void set_recording_header_data(short number_of_players, short level_number, unsigned long map_checksum, short version, struct player_start_data *starts, struct game_data *game_information); void get_recording_header_data(short *number_of_players, short *level_number, unsigned long *map_checksum, short *version, struct player_start_data *starts, struct game_data *game_information); boolean input_controller(void); /* ------------ prototypes/VBL_MACINTOSH.C */ void initialize_keyboard_controller(void); boolean find_replay_to_use(boolean ask_user, FileDesc *file); boolean get_freespace_on_disk(FileDesc *file, unsigned long *free_space); void initialize_keyboard_controller(void); /* true if it found it, false otherwise. always fills in vrefnum and dirid*/ boolean get_recording_filedesc(FileDesc *file); void move_replay(void); long parse_keymap(void); boolean setup_replay_from_random_resource(unsigned long map_checksum); #ifdef DEBUG_REPLAY struct recorded_flag { long flag; short player_index; }; void open_stream_file(void); void write_flags(struct recorded_flag *buffer, long count); static void debug_stream_of_flags(long action_flag, short player_index); static void close_stream_file(void); #endif -------------------------------------------------------------------------------- /marathon2/extensions.h: -------------------------------------------------------------------------------- 1 | /* extensions.h Tuesday, October 31, 1995 11:42:19 AM- rdm created. */ #define BUNGIE_PHYSICS_DATA_VERSION 0 #define PHYSICS_DATA_VERSION 1 #ifdef EXPORT_STRUCTURE struct definition_data { long tag; void *data; short count; short size; }; static struct definition_data definitions[]= { {MONSTER_PHYSICS_TAG, monster_definitions, NUMBER_OF_MONSTER_TYPES, sizeof(struct monster_definition)}, {EFFECTS_PHYSICS_TAG, effect_definitions, NUMBER_OF_EFFECT_TYPES, sizeof(struct effect_definition)}, {PROJECTILE_PHYSICS_TAG, projectile_definitions, NUMBER_OF_PROJECTILE_TYPES, sizeof(struct projectile_definition)}, {PHYSICS_PHYSICS_TAG, physics_models, NUMBER_OF_PHYSICS_MODELS, sizeof(struct physics_constants)}, {WEAPONS_PHYSICS_TAG, weapon_definitions, NUMBER_OF_WEAPONS, sizeof(struct weapon_definition)} }; #define NUMBER_OF_DEFINITIONS (sizeof(definitions)/sizeof(definitions[0])) #else #ifdef IMPORT_STRUCTURE struct definition_data { long tag; void *data; }; static struct definition_data definitions[]= { {MONSTER_PHYSICS_TAG, monster_definitions}, {EFFECTS_PHYSICS_TAG, effect_definitions}, {PROJECTILE_PHYSICS_TAG, projectile_definitions}, {PHYSICS_PHYSICS_TAG, physics_models}, {WEAPONS_PHYSICS_TAG, weapon_definitions}, }; #define NUMBER_OF_DEFINITIONS (sizeof(definitions)/sizeof(definitions[0])) #endif #endif /* ------------- prototypes */ /* Set the physics file to read from.. */ void set_physics_file(FileDesc *file); void set_to_default_physics_file(void); /* Proceses the entire physics file.. */ void import_definition_structures(void); void *get_network_physics_buffer(long *physics_length); void process_network_physics_model(void *data); -------------------------------------------------------------------------------- /marathon2/wad_prefs.h: -------------------------------------------------------------------------------- 1 | /* wad_prefs.h Wednesday, March 22, 1995 12:08:36 AM- rdm created. */ /* Open the file, and allocate whatever internal structures are necessary in the */ /* preferences pointer.. */ boolean w_open_preferences_file( char *prefName, unsigned long preferences_file_type); // ostype for mac, extension for dos void *w_get_data_from_preferences( WadDataType tag, /* Tag to read */ short expected_size, /* Data size */ void (*initialize)(void *prefs), /* Call if I have to allocate it.. */ boolean (*validate)(void *prefs)); /* Verify function-> fixes if bad and returns TRUE */ void w_write_preferences_file(void); /* ------ local structures */ /* This is the structure used internally */ struct preferences_info { FileDesc pref_file; struct wad_data *wad; }; /* This will need to be rewritten! */ #ifdef mac /*----------------- code from macintosh_wad_prefs.c */ #define LOCAL_TO_GLOBAL_DITL(id, first) (id+first) #define GLOBAL_TO_LOCAL_DITL(id, first) (id-first) /* ----- Run the new kick ass dialog box. */ struct preferences_dialog_data { short resource_group; /* What STR# resource? */ short string_index; /* What indexed string? */ short ditl_id; /* What ditl do I append? */ /* This prevents duplication-> you will already have this function */ /* (generally just wraps get_data_from_preferences) */ void *(*get_data)(void); /* Called on setup (initialize your fields) */ void (*setup_dialog_func)(DialogPtr dialog, short first_item, void *prefs); /* Called when a user item is hit */ void (*item_hit_func)(DialogPtr dialog, short first_item, void *prefs, short item_hit); /* Use this to read in the edittext fields, etc. (return FALSE to abort teardown) */ boolean (*teardown_dialog_func)(DialogPtr dialog, short first_item, void *prefs); }; boolean set_preferences(struct preferences_dialog_data *funcs, short count, void (*reload_function)(void)); #endif -------------------------------------------------------------------------------- /marathon2/preferences.h: -------------------------------------------------------------------------------- 1 | /* preferences.h Tuesday, June 13, 1995 10:07:04 AM- rdm created. */ /* New preferences junk */ struct graphics_preferences_data { struct screen_mode_data screen_mode; GDSpec device_spec; }; struct serial_number_data { boolean network_only; byte long_serial_number[10]; Str255 user_name; Str255 tokenized_serial_number; }; struct network_preferences_data { boolean allow_microphone; boolean game_is_untimed; short type; // look in network_dialogs.c for _ethernet, etc... short game_type; short difficulty_level; short game_options; // Penalize suicide, etc... see map.h for constants long time_limit; short kill_limit; short entry_point; }; struct player_preferences_data { char name[PREFERENCES_NAME_LENGTH+1]; short color; short team; unsigned long last_time_ran; short difficulty_level; boolean background_music_on; }; struct input_preferences_data { short input_device; short keycodes[NUMBER_OF_KEYS]; }; #define MAXIMUM_PATCHES_PER_ENVIRONMENT (32) struct environment_preferences_data { FSSpec map_file; FSSpec physics_file; FSSpec shapes_file; FSSpec sounds_file; unsigned long map_checksum; unsigned long physics_checksum; unsigned long shapes_mod_date; unsigned long sounds_mod_date; unsigned long patches[MAXIMUM_PATCHES_PER_ENVIRONMENT]; }; /* New preferences.. (this sorta defeats the purpose of this system, but not really) */ extern struct graphics_preferences_data *graphics_preferences; extern struct serial_number_data *serial_preferences; extern struct network_preferences_data *network_preferences; extern struct player_preferences_data *player_preferences; extern struct input_preferences_data *input_preferences; extern struct sound_manager_parameters *sound_preferences; extern struct environment_preferences_data *environment_preferences; /* --------- functions */ void initialize_preferences(void); void handle_preferences(void); void write_preferences(void); -------------------------------------------------------------------------------- /marathon2/screen.h: -------------------------------------------------------------------------------- 1 | /* SCREEN.H Thursday, August 24, 1995 5:36:27 PM (Jason) */ /* ---------- constants */ enum /* screen sizes */ { _full_screen, _100_percent, _75_percent, _50_percent }; enum /* hardware acceleration codes */ { _no_acceleration, _valkyrie_acceleration }; /* ---------- structures */ // screen_mode_data in SHELL.H for PREFERENCES.H /* ---------- globals */ extern struct color_table *world_color_table, *visible_color_table, *interface_color_table; #ifdef mac extern GDHandle world_device; extern WindowPtr screen_window; #endif /* ---------- prototypes/SCREEN.C */ void change_screen_clut(struct color_table *color_table); void change_interface_clut(struct color_table *color_table); void animate_screen_clut(struct color_table *color_table, boolean full_screen); void build_direct_color_table(struct color_table *color_table, short bit_depth); void start_teleporting_effect(boolean out); void start_extravision_effect(boolean out); void render_screen(short ticks_elapsed); void toggle_overhead_map_display_status(void); void zoom_overhead_map_out(void); void zoom_overhead_map_in(void); void enter_screen(void); void exit_screen(void); void darken_world_window(void); void validate_world_window(void); void change_gamma_level(short gamma_level); void assert_world_color_table(struct color_table *world_color_table, struct color_table *interface_color_table); #ifdef mac void initialize_screen(struct screen_mode_data *mode); void change_screen_mode(struct screen_mode_data *mode, boolean redraw); void process_screen_key(EventRecord *event, short key); void process_screen_click(EventRecord *event); boolean machine_supports_16bit(GDSpecPtr spec); boolean machine_supports_32bit(GDSpecPtr spec); short hardware_acceleration_code(GDSpecPtr spec); void activate_screen_window(WindowPtr window, EventRecord *event, boolean active); void update_screen_window(WindowPtr window, EventRecord *event); void calculate_destination_frame(short size, boolean high_resolution, Rect *frame); #endif -------------------------------------------------------------------------------- /marathon2/extract/shapeextract.c: -------------------------------------------------------------------------------- 1 | /* SHAPEEXTRACT.C Tuesday, August 29, 1995 9:54:17 AM (Jason) */ #include "macintosh_cseries.h" #include #include "::shape_descriptors.h" #include "::shape_definitions.h" /* ---------- macros */ /* ---------- private code */ static void extract_shape_resources(FILE *stream); static void add_resource(short id, long *offset, long *length, FILE *stream); /* ---------- code */ void main( int argc, char **argv) { Str255 filename; short reference_number; if (argc<=2) { fprintf(stderr, "Usage: %s \n", argv[0]); exit(1); } else { strcpy(filename, argv[1]); c2pstr(filename); reference_number= OpenResFile(filename); if (reference_number!=NONE) { FILE *stream= fopen(argv[2], "wb"); if (stream) { extract_shape_resources(stream); fclose(stream); } else { fprintf(stderr, "Error #%d opening %s.\n", -1, argv[2]); exit(1); } CloseResFile(reference_number); } else { fprintf(stderr, "Error #%d opening %s.\n", ResError(), argv[1]); exit(1); } } exit(0); } /* ---------- private code */ static void extract_shape_resources( FILE *stream) { short i; fwrite(collection_headers, sizeof(struct collection_header), MAXIMUM_COLLECTIONS, stream); for (i= 0; ioffset, &header->length, stream); add_resource(1128+i, &header->offset16, &header->length16, stream); } fseek(stream, 0, SEEK_SET); fwrite(collection_headers, sizeof(struct collection_header), MAXIMUM_COLLECTIONS, stream); return; } static void add_resource( short id, long *offset, long *length, FILE *stream) { Handle collection= GetResource('.256', id); if (collection) { HLock(collection); *offset= ftell(stream), *length= GetHandleSize(collection); fwrite(*collection, *length, 1, stream); ReleaseResource(collection); } else { *offset= -1, *length= 0; } return; } -------------------------------------------------------------------------------- /marathon2/game_window_macintosh.c: -------------------------------------------------------------------------------- 1 | /* macintosh_game_window.c Tuesday, August 29, 1995 6:09:18 PM- rdm created. */ #include "macintosh_cseries.h" #include "my32bqd.h" #include "map.h" #include "shell.h" #include "preferences.h" #include "screen_drawing.h" #include "interface.h" #include "screen.h" #include "portable_files.h" #include "sound.h" // for screen_definitions.h #include "screen_definitions.h" #include "images.h" extern GrafPtr screen_window; extern GWorldPtr world_pixels; extern void update_everything(short time_elapsed); /* ------------- code begins! */ void draw_panels( void) { struct screen_mode_data new_mode= graphics_preferences->screen_mode; PicHandle picture; Rect destination= {320, 0, 480, 640}; Rect source= {0, 0, 160, 640}; new_mode.acceleration= _no_acceleration; new_mode.size= _100_percent; new_mode.high_resolution= TRUE; change_screen_mode(&new_mode, FALSE); myLockPixels(world_pixels); picture= get_picture_resource_from_images(INTERFACE_PANEL_BASE); if(picture) { _set_port_to_gworld(); SetOrigin(0, 320); HLock((Handle) picture); DrawPicture(picture, &destination); HUnlock((Handle) picture); update_everything(NONE); ReleaseResource((Handle) picture); SetOrigin(0, 0); _restore_port(); } else { /* Either they don't have the picture, or they are out of memory. Most likely no memory */ alert_user(fatalError, strERRORS, outOfMemory, ResError()); } /* Note that you don't get here if the picture failed.. */ { GrafPtr old_port; RGBColor old_forecolor, old_backcolor; GetPort(&old_port); SetPort(screen_window); GetForeColor(&old_forecolor); GetBackColor(&old_backcolor); RGBForeColor(&rgb_black); RGBBackColor(&rgb_white); /* Slam it to the screen. */ CopyBits((BitMapPtr)*world_pixels->portPixMap, &screen_window->portBits, //(BitMapPtr)*screen_pixmap, &source, &destination, srcCopy, (RgnHandle) NULL); RGBForeColor(&old_forecolor); RGBBackColor(&old_backcolor); SetPort(old_port); } myUnlockPixels(world_pixels); change_screen_mode(&graphics_preferences->screen_mode, FALSE); } -------------------------------------------------------------------------------- /marathon2/game_wad.h: -------------------------------------------------------------------------------- 1 | /* GAME_WAD.H Sunday, July 3, 1994 10:45:56 PM */ #include "portable_files.h" /* -------------------- Private or map editor functions */ void allocate_map_for_counts(short polygon_count, short side_count, short endpoint_count, short line_count, long terminal_data_length); void load_points(saved_map_pt *points, short count); void load_lines(saved_line *lines, short count); void load_sides(saved_side *sides, short count, short version); void load_polygons(saved_poly *polys, short count, short version); void load_lights(struct static_light_data *lights, short count, short version); void load_annotations(saved_annotation *annotations, short count); void load_objects(saved_object *map_objects, short count); void load_media(struct media_data *media, short count); void load_map_info(saved_map_data *map_info); void load_ambient_sound_images(struct ambient_sound_image_data *data, short count); void load_random_sound_images(struct random_sound_image_data *data, short count); void load_terminal_data(byte *data, long length); /* Used _ONLY_ by game_wad.c internally and precalculate.c. */ boolean process_map_wad(struct wad_data *wad, boolean restoring_game, short version); /* Final three calls, must be in this order! */ void recalculate_redundant_map(void); void scan_and_add_platforms(struct static_platform_data *platform_static_data, short count); void complete_loading_level(short *map_indexes, short map_index_count, struct static_platform_data *platform_data, short platform_data_count, struct platform_data *actual_platform_data, short actual_platform_data_count, short version); boolean save_game_file(FileDesc *file); /* -------------- New functions */ void pause_game(void); void resume_game(void); void get_current_saved_game_name(char *file_name); boolean match_checksum_with_map(short vRefNum, long dirID, unsigned long checksum, FileDesc *file); void set_map_file(FileDesc *file); /* --------- from PREPROCESS_MAP_MAC.C */ void get_default_map_spec(FileDesc *new); void get_default_physics_spec(FileDesc *new); void add_finishing_touches_to_save_file(FileDesc *file); -------------------------------------------------------------------------------- /marathon2/items.h: -------------------------------------------------------------------------------- 1 | /* ITEMS.H Thursday, April 6, 1995 1:06:42 PM (Jason') */ /* ---------- constants */ enum /* item types (class) */ { _weapon, _ammunition, _powerup, _item, _weapon_powerup, _ball, NUMBER_OF_ITEM_TYPES, _network_statistics= NUMBER_OF_ITEM_TYPES // Used in game_window.c }; enum /* item types */ { _i_knife, _i_magnum, _i_magnum_magazine, _i_plasma_pistol, _i_plasma_magazine, _i_assault_rifle, _i_assault_rifle_magazine, _i_assault_grenade_magazine, _i_missile_launcher, _i_missile_launcher_magazine, _i_invisibility_powerup, _i_invincibility_powerup, _i_infravision_powerup, _i_alien_shotgun, _i_alien_shotgun_magazine, _i_flamethrower, _i_flamethrower_canister, _i_extravision_powerup, _i_oxygen_powerup, _i_energy_powerup, _i_double_energy_powerup, _i_triple_energy_powerup, _i_shotgun, _i_shotgun_magazine, _i_spht_door_key, _i_uplink_chip, BALL_ITEM_BASE, _i_light_blue_ball= BALL_ITEM_BASE, _i_red_ball, _i_violet_ball, _i_yellow_ball, _i_brown_ball, _i_orange_ball, _i_blue_ball, // heh heh _i_green_ball, NUMBER_OF_DEFINED_ITEMS }; /* ---------- prototypes/ITEMS.C */ short new_item(struct object_location *location, short item_type); void calculate_player_item_array(short player_index, short type, short *items, short *counts, short *array_count); void get_header_name(char *buffer, short type); void get_item_name(char *buffer, short item_id, boolean plural); boolean new_item_in_random_location(short item_type); short count_inventory_lines(short player_index); void swipe_nearby_items(short player_index); void mark_item_collections(boolean loading); short get_item_kind(short item_id); boolean unretrieved_items_on_map(void); boolean item_valid_in_current_environment(short item_type); void trigger_nearby_items(short polygon_index); short find_player_ball_color(short player_index); /* returns the color of the ball or NONE if they don't have one */ short get_item_shape(short item_id); boolean try_and_add_player_item(short player_index, short type); /* Returns NONE if this player is not carrying a ball */ short find_player_ball_color(short player_index); -------------------------------------------------------------------------------- /marathon2/fades.h: -------------------------------------------------------------------------------- 1 | /* FADES.H Tuesday, April 4, 1995 11:48:29 AM (Jason') */ /* ---------- constants */ enum { NUMBER_OF_GAMMA_LEVELS= 8, DEFAULT_GAMMA_LEVEL= 2 }; enum /* fade types */ { _start_cinematic_fade_in, /* force all colors to black immediately */ _cinematic_fade_in, /* fade in from black */ _long_cinematic_fade_in, _cinematic_fade_out, /* fade out from black */ _end_cinematic_fade_out, /* force all colors from black immediately */ _fade_red, /* bullets and fist */ _fade_big_red, /* bigger bullets and fists */ _fade_bonus, /* picking up items */ _fade_bright, /* teleporting */ _fade_long_bright, /* nuclear monster detonations */ _fade_yellow, /* explosions */ _fade_big_yellow, /* big explosions */ _fade_purple, /* ? */ _fade_cyan, /* fighter staves and projectiles */ _fade_white, /* absorbed */ _fade_big_white, /* rocket (probably) absorbed */ _fade_orange, /* flamethrower */ _fade_long_orange, /* marathon lava */ _fade_green, /* hunter projectile */ _fade_long_green, /* alien green goo */ _fade_static, /* compiler projectile */ _fade_negative, /* minor fusion projectile */ _fade_big_negative, /* major fusion projectile */ _fade_flicker_negative, /* hummer projectile */ _fade_dodge_purple, /* alien weapon */ _fade_burn_cyan, /* armageddon beast electricity */ _fade_dodge_yellow, /* armageddon beast projectile */ _fade_burn_green, /* hunter projectile */ _fade_tint_green, /* under goo */ _fade_tint_blue, /* under water */ _fade_tint_orange, /* under lava */ _fade_tint_gross, /* under sewage */ NUMBER_OF_FADE_TYPES }; enum /* effect types */ { _effect_under_water, _effect_under_lava, _effect_under_sewage, _effect_under_goo, NUMBER_OF_FADE_EFFECT_TYPES }; /* ---------- prototypes/FADES.C */ void initialize_fades(void); boolean update_fades(void); void start_fade(short type); void stop_fade(void); boolean fade_finished(void); void set_fade_effect(short type); short get_fade_period(short type); void gamma_correct_color_table(struct color_table *uncorrected_color_table, struct color_table *corrected_color_table, short gamma_level); void explicit_start_fade(short type, struct color_table *original_color_table, struct color_table *animated_color_table); void full_fade(short type, struct color_table *original_color_table); -------------------------------------------------------------------------------- /Marathon 2 Source ReadMe: -------------------------------------------------------------------------------- 1 | So here it is, the mysterious #2 you've heard so much about: the source code for Marathon 2: Durandal. Now all you mad hackers can see how it was done, and nod admiringly or shiver in terror as the situation may demand. This code is issued under the GNU Public License. Please read the license (a copy is enclosed in the same directory as this ReadMe) and abide by its terms. The following are some things to keep in mind when using and perusing this source code: 1. As noted in the license agreement, this code is provided as-is. We're not in a position to offer coding support, so please don't call or email us asking for help or explanations. If you're not a programmer you should probably delete this and get on with your life. Even experienced coders are going to find some of this pretty hairy. 2. These are MPW files, because Macintosh Programmer's Workshop is what we used back in the day. Getting these files to compile under any development environment will require some effort on your part, as certain bits (like the serial number algorithm) have been removed. 3. This is real code written by real programmers and as such contains real language, sometimes in variable names where it's impossible to avoid. If you (or your parents) are especially sensitive to four-letter words, please consider perusing some of the profanity-free source code available on the net, such as "Hello World." 4. This is the Mac source. The sole known archive of the Windows 9x source was placed in a lead box and shipped to one of our island laboratories for safekeeping. Unbeknownst to us, the boat carrying the box made an unscheduled run up the coast of Madagascar, where the ship's captain hoped to catch the end of the annual Miss Middle Of Nowhere pageant. The ship was approximately six miles from shore when it was torpedoed by a one-man sub purchased from the Hammacher-Schlemmer catalog by a punter with more money than brains. Divers are still combing the sea floor looking for the box containing the Windows code, and if we ever find it I'm sure we'll let you know. Windows hackers with lots of spare time may still be able to do interesting things with this code. If you manage to do anything cool with this code, please let us know so we can download it and check it out. Regards, Matthew Soell Director of Customer Support Bungie Software January 17, 2000 (1/17/2000 = 1 + 1 + 7 + 2 + 0 + 0 + 0 = 11 = 1 + 1 = #2) -------------------------------------------------------------------------------- /marathon2/media.h: -------------------------------------------------------------------------------- 1 | /* MEDIA.H Saturday, March 25, 1995 1:27:18 AM (Jason') */ /* ---------- constants */ #define MAXIMUM_MEDIAS_PER_MAP 16 enum /* media types */ { _media_water, _media_lava, _media_goo, _media_sewage, NUMBER_OF_MEDIA_TYPES }; enum /* media flags */ { _media_sound_obstructed_by_floor, // this media makes no sound when under the floor NUMBER_OF_MEDIA_FLAGS /* <= 16 */ }; #define MEDIA_SOUND_OBSTRUCTED_BY_FLOOR(m) TEST_FLAG16((m)->flags, _media_sound_obstructed_by_floor) #define SET_MEDIA_SOUND_OBSTRUCTED_BY_FLOOR(m, v) SET_FLAG16((m)->flags, _media_sound_obstructed_by_floor, (v)) enum /* media detonation types */ { _small_media_detonation_effect, _medium_media_detonation_effect, _large_media_detonation_effect, _large_media_emergence_effect, NUMBER_OF_MEDIA_DETONATION_TYPES }; enum /* media sounds */ { _media_snd_feet_entering, _media_snd_feet_leaving, _media_snd_head_entering, _media_snd_head_leaving, _media_snd_splashing, _media_snd_ambient_over, _media_snd_ambient_under, _media_snd_platform_entering, _media_snd_platform_leaving, NUMBER_OF_MEDIA_SOUNDS }; /* ---------- macros */ #define UNDER_MEDIA(m, z) ((z)<=(m)->height) /* ---------- structures */ struct media_data /* 32 bytes */ { short type; word flags; /* this light is not used as a real light; instead, the intensity of this light is used to determine the height of the media: height= low + (high-low)*intensity ... this sounds gross, but it makes media heights as flexible as light intensities; clearly discontinuous light functions (e.g., strobes) should not be used */ short light_index; /* this is the maximum external velocity due to current; acceleration is 1/32nd of this */ angle current_direction; world_distance current_magnitude; world_distance low, high; world_point2d origin; world_distance height; fixed minimum_light_intensity; shape_descriptor texture; short transfer_mode; short unused[2]; }; /* --------- globals */ extern struct media_data *medias; /* --------- prototypes/MEDIA.C */ short new_media(struct media_data *data); void update_medias(void); void get_media_detonation_effect(short media_index, short type, short *detonation_effect); short get_media_sound(short media_index, short type); short get_media_submerged_fade_effect(short media_index); struct damage_definition *get_media_damage(short media_index, fixed scale); boolean media_in_environment(short media_type, short environment_code); #ifdef DEBUG struct media_data *get_media_data(short media_index); #else #define get_media_data(i) (medias+(i)) #endif -------------------------------------------------------------------------------- /marathon2/progress.c: -------------------------------------------------------------------------------- 1 | /* progress.c Saturday, October 28, 1995 10:56:17 PM- rdm created. */ #include "macintosh_cseries.h" #include "progress.h" enum { dialogPROGRESS= 10002, iPROGRESS_BAR= 1, iPROGRESS_MESSAGE }; /* ------- structures */ struct progress_data { DialogPtr dialog; GrafPtr old_port; UserItemUPP progress_bar_upp; }; /* ------ private prototypes */ static pascal void draw_distribute_progress(DialogPtr dialog, short item_num); /* ------ globals */ struct progress_data progress_data; /* ------ calls */ void open_progress_dialog( short message_id) { Rect item_box; short item_type; Handle item_handle; progress_data.dialog= GetNewDialog(dialogPROGRESS, NULL, (WindowPtr) -1); assert(progress_data.dialog); progress_data.progress_bar_upp= NewUserItemProc(draw_distribute_progress); assert(progress_data.progress_bar_upp); GetPort(&progress_data.old_port); SetPort(progress_data.dialog); GetDItem(progress_data.dialog, iPROGRESS_BAR, &item_type, &item_handle, &item_box); SetDItem(progress_data.dialog, iPROGRESS_BAR, item_type, (Handle) progress_data.progress_bar_upp, &item_box); /* Set the message.. */ set_progress_dialog_message(message_id); ShowWindow(progress_data.dialog); DrawDialog(progress_data.dialog); SetCursor(*(GetCursor(watchCursor))); return; } void set_progress_dialog_message( short message_id) { short item_type; Rect bounds; Handle item_handle; assert(progress_data.dialog); GetDItem(progress_data.dialog, iPROGRESS_MESSAGE, &item_type, &item_handle, &bounds); getpstr(temporary, strPROGRESS_MESSAGES, message_id); SetIText(item_handle, temporary); return; } void close_progress_dialog( void) { SetPort(progress_data.old_port); SetCursor(&qd.arrow); DisposeDialog(progress_data.dialog); DisposeRoutineDescriptor(progress_data.progress_bar_upp); return; } void draw_progress_bar( long sent, long total) { Rect bounds; Handle item; short item_type; short width; GetDItem(progress_data.dialog, iPROGRESS_BAR, &item_type, &item, &bounds); width= (sent*RECTANGLE_WIDTH(&bounds))/total; bounds.right= bounds.left+width; RGBForeColor(system_colors+gray15Percent); PaintRect(&bounds); ForeColor(blackColor); return; } void reset_progress_bar( void) { draw_distribute_progress(progress_data.dialog, iPROGRESS_BAR); return; } /* --------- private code */ static pascal void draw_distribute_progress( DialogPtr dialog, short item_num) { Rect item_box; short item_type; Handle item_handle; GrafPtr old_port; GetPort(&old_port); SetPort(dialog); GetDItem(dialog, item_num, &item_type, &item_handle, &item_box); PenNormal(); RGBForeColor(system_colors+windowHighlight); PaintRect(&item_box); ForeColor(blackColor); InsetRect(&item_box, -1, -1); FrameRect(&item_box); SetPort(old_port); return; } -------------------------------------------------------------------------------- /marathon2/media_definitions.h: -------------------------------------------------------------------------------- 1 | /* MEDIA_DEFINITIONS.H Sunday, March 26, 1995 11:09:26 PM (Jason') */ /* ---------- structures */ struct media_definition { short collection, shape, shape_count, shape_frequency; short transfer_mode; short damage_frequency; // mask&ticks struct damage_definition damage; short detonation_effects[NUMBER_OF_MEDIA_DETONATION_TYPES]; short sounds[NUMBER_OF_MEDIA_SOUNDS]; short submerged_fade_effect; }; /* ---------- globals */ static struct media_definition media_definitions[NUMBER_OF_MEDIA_TYPES]= { /* _media_water */ { _collection_walls1, 19, 1, 0, /* collection, shape, shape_count, frequency */ _xfer_normal, /* transfer mode */ 0, {NONE, 0, 0, 0, FIXED_ONE}, /* damage frequency and definition */ {_effect_small_water_splash, _effect_medium_water_splash, _effect_large_water_splash, _effect_large_water_emergence}, /* small, medium, large detonation effects */ {NONE, NONE, _snd_enter_water, _snd_exit_water, _snd_walking_in_water, _ambient_snd_water, _ambient_snd_under_media, _snd_enter_water, _snd_exit_water}, _effect_under_water, /* submerged fade effect */ }, /* _media_lava */ { _collection_walls2, 12, 1, 0, /* collection, shape, shape_count, frequency */ _xfer_normal, /* transfer mode */ 0xf, {_damage_lava, _alien_damage, 16, 0, FIXED_ONE}, /* damage frequency and definition */ {_effect_small_lava_splash, _effect_medium_lava_splash, _effect_large_lava_splash, _effect_large_lava_emergence}, /* small, medium, large detonation effects */ {NONE, NONE, _snd_enter_lava, _snd_exit_lava, _snd_walking_in_lava, _ambient_snd_lava, _ambient_snd_under_media, _snd_enter_lava, _snd_exit_lava}, _effect_under_lava, /* submerged fade effect */ }, /* _media_goo */ { _collection_walls5, 5, 1, 0, /* collection, shape, shape_count, frequency */ _xfer_normal, /* transfer mode */ 0x7, {_damage_goo, _alien_damage, 8, 0, FIXED_ONE}, /* damage frequency and definition */ {_effect_small_goo_splash, _effect_medium_goo_splash, _effect_large_goo_splash, _effect_large_goo_emergence}, /* small, medium, large detonation effects */ {NONE, NONE, _snd_enter_lava, _snd_exit_lava, _snd_walking_in_lava, _ambient_snd_goo, _ambient_snd_under_media, _snd_enter_lava, _snd_exit_lava}, _effect_under_goo, /* submerged fade effect */ }, /* _media_sewage */ { _collection_walls3, 13, 1, 0, /* collection, shape, shape_count, frequency */ _xfer_normal, /* transfer mode */ 0, {NONE, 0, 0, 0, FIXED_ONE}, /* damage frequency and definition */ {_effect_small_sewage_splash, _effect_medium_sewage_splash, _effect_large_sewage_splash, _effect_large_sewage_emergence}, /* small, medium, large detonation effects */ {NONE, NONE, _snd_enter_sewage, _snd_exit_sewage, NONE, _ambient_snd_sewage, _ambient_snd_under_media, _snd_enter_sewage, _snd_exit_sewage}, _effect_under_sewage, /* submerged fade effect */ }, }; -------------------------------------------------------------------------------- /marathon2/map_accessors.c: -------------------------------------------------------------------------------- 1 | /* MAP_ACCESSORS.C Friday, June 3, 1994 12:10:10 PM Thursday, June 16, 1994 7:32:13 PM if DEBUG is defined, this file is empty. */ #include "cseries.h" #include "map.h" #ifdef mpwc #pragma segment map #endif /* --------- code */ #ifdef DEBUG struct object_data *get_object_data( short object_index) { struct object_data *object; vassert(object_index>=0&&object_index=0&&polygon_indexpolygon_count, csprintf(temporary, "polygon index #%d is out of range", polygon_index)); polygon= map_polygons+polygon_index; return polygon; } struct line_data *get_line_data( short line_index) { struct line_data *line; assert(map_lines); vassert(line_index>=0&&line_indexline_count, csprintf(temporary, "line index #%d is out of range", line_index)); line= map_lines+line_index; return line; } struct side_data *get_side_data( short side_index) { struct side_data *side; assert(map_sides); vassert(side_index>=0&&side_indexside_count, csprintf(temporary, "side index #%d is out of range", side_index)); side= map_sides+side_index; return side; } struct endpoint_data *get_endpoint_data( short endpoint_index) { struct endpoint_data *endpoint; assert(map_endpoints); vassert(endpoint_index>=0&&endpoint_indexendpoint_count, csprintf(temporary, "endpoint index #%d is out of range", endpoint_index)); endpoint= map_endpoints+endpoint_index; return endpoint; } short *get_map_indexes( short index, short count) { assert(map_indexes); vassert(index>=0&&index+count<=dynamic_world->map_index_count, csprintf(temporary, "map_indexes(#%d,#%d) are out of range", index, count)); return map_indexes + index; } struct ambient_sound_image_data *get_ambient_sound_image_data( short ambient_sound_image_index) { struct ambient_sound_image_data *image; vassert(ambient_sound_image_index>=0 && ambient_sound_image_indexambient_sound_image_count, csprintf(temporary, "ambient_sound_image_index #%d is out of range", ambient_sound_image_index)); image= ambient_sound_images + ambient_sound_image_index; return image; } struct random_sound_image_data *get_random_sound_image_data( short random_sound_image_index) { struct random_sound_image_data *image; vassert(random_sound_image_index>=0 && random_sound_image_indexrandom_sound_image_count, csprintf(temporary, "random_sound_image_index #%d is out of range", random_sound_image_index)); image= random_sound_images + random_sound_image_index; return image; } #endif -------------------------------------------------------------------------------- /marathon2/lightsource.h: -------------------------------------------------------------------------------- 1 | /* LIGHTSOURCE.H Wednesday, February 1, 1995 4:22:23 AM (Jason') */ /* ---------- constants */ #define MAXIMUM_LIGHTS_PER_MAP 64 enum /* default light types */ { _normal_light, _strobe_light, _media_light, NUMBER_OF_LIGHT_TYPES }; enum /* states */ { _light_becoming_active, _light_primary_active, _light_secondary_active, _light_becoming_inactive, _light_primary_inactive, _light_secondary_inactive }; /* ---------- static light data */ enum /* lighting functions */ { _constant_lighting_function, // maintain final intensity for period _linear_lighting_function, // linear transition between initial and final intensity over period _smooth_lighting_function, // sine transition between initial and final intensity over period _flicker_lighting_function, // intensity in [smooth_intensity(t),final_intensity] NUMBER_OF_LIGHTING_FUNCTIONS }; /* as intensities, transition functions are given the primary periods of the active and inactive state, plus the intensity at the time of transition */ struct lighting_function_specification /* 7*2 == 14 bytes */ { short function; short period, delta_period; fixed intensity, delta_intensity; }; enum /* static flags */ { _light_is_initially_active, _light_has_slaved_intensities, _light_is_stateless, NUMBER_OF_STATIC_LIGHT_FLAGS /* <=16 */ }; #define LIGHT_IS_INITIALLY_ACTIVE(s) TEST_FLAG16((s)->flags, _light_is_initially_active) #define LIGHT_IS_STATELESS(s) TEST_FLAG16((s)->flags, _light_is_stateless) #define SET_LIGHT_IS_INITIALLY_ACTIVE(s, v) SET_FLAG16((s)->flags, _light_is_initially_active, (v)) #define SET_LIGHT_IS_STATELESS(s, v) SET_FLAG16((s)->flags, _light_is_stateless, (v)) struct static_light_data /* 8*2 + 6*14 == 100 bytes */ { short type; word flags; short phase; // initializer, so lights may start out-of-phase with each other struct lighting_function_specification primary_active, secondary_active, becoming_active; struct lighting_function_specification primary_inactive, secondary_inactive, becoming_inactive; short tag; short unused[4]; }; /* ---------- dynamic light data */ struct light_data /* 14*2 + 100 == 128 bytes */ { word flags; short state; // result of lighting function fixed intensity; // data recalculated each function changed; passed to lighting_function each update short phase, period; fixed initial_intensity, final_intensity; short unused[4]; struct static_light_data static_data; }; /* --------- globals */ extern struct light_data *lights; /* --------- prototypes/LIGHTSOURCE.C */ short new_light(struct static_light_data *data); struct static_light_data *get_defaults_for_light_type(short type); void update_lights(void); boolean get_light_status(short light_index); boolean set_light_status(short light_index, boolean active); boolean set_tagged_light_statuses(short tag, boolean new_status); fixed get_light_intensity(short light_index); #ifdef DEBUG struct light_data *get_light_data(short light_index); #else #define get_light_data(i) (lights+(i)) #endif -------------------------------------------------------------------------------- /marathon2/screen_drawing.h: -------------------------------------------------------------------------------- 1 | /* SCREEN_DRAWING.H Monday, August 15, 1994 3:11:38 PM */ /* Rectangles for the interface, etc.. */ /* rectangle id's */ enum { /* game window rectangles */ _player_name_rect= 0, _oxygen_rect, _shield_rect, _motion_sensor_rect, _microphone_rect, _inventory_rect, _weapon_display_rect, /* interface rectangles */ _new_game_button_rect, _load_game_button_rect, _gather_button_rect, _join_button_rect, _prefs_button_rect, _replay_last_button_rect, _save_last_button_rect, _replace_saved_button_rect, _credits_button_rect, _quit_button_rect, _center_button_rect, NUMBER_OF_INTERFACE_RECTANGLES }; /* Colors for drawing.. */ enum { _energy_weapon_full_color, _energy_weapon_empty_color, _black_color, _inventory_text_color, _inventory_header_background_color, _inventory_background_color, PLAYER_COLOR_BASE_INDEX, _white_color= 14, _invalid_weapon_color, _computer_border_background_text_color, _computer_border_text_color, _computer_interface_text_color, _computer_interface_color_purple, _computer_interface_color_red, _computer_interface_color_pink, _computer_interface_color_aqua, _computer_interface_color_yellow, _computer_interface_color_brown, _computer_interface_color_blue }; enum { /* justification flags for _draw_screen_text */ _no_flags, _center_horizontal= 0x01, _center_vertical= 0x02, _right_justified= 0x04, _top_justified= 0x08, _bottom_justified= 0x10, _wrap_text= 0x20 }; enum { /* Fonts for the interface et al.. */ _interface_font, _weapon_name_font, _player_name_font, _interface_item_count_font, _computer_interface_font, _computer_interface_title_font, _net_stats_font, NUMBER_OF_INTERFACE_FONTS }; /* Structure for portable rectangles. notice it is exactly same as Rect */ struct screen_rectangle { short top, left; short bottom, right; }; typedef struct screen_rectangle screen_rectangle; /* ------- Prototypes */ void initialize_screen_drawing(void); void _set_port_to_screen_window(void); void _set_port_to_gworld(void); void _restore_port(void); /* If source==NULL, source= the shapes bounding rectangle */ void _draw_screen_shape(shape_descriptor shape_id, screen_rectangle *destination, screen_rectangle *source); void _draw_screen_shape_at_x_y(shape_descriptor shape, short x, short y); void _draw_screen_shape_centered(shape_descriptor shape, screen_rectangle *rectangle, short flags); void _draw_screen_text(char *text, screen_rectangle *destination, short flags, short font_id, short text_color); short _text_width(char *buffer, short font_id); void _erase_screen(short color_index); void _scroll_window(short dy, short rectangle_id, short background_color_index); void _fill_screen_rectangle(screen_rectangle *rectangle, short color_index); screen_rectangle *get_interface_rectangle(short index); short _get_font_line_height(short font_index); void _fill_rect(screen_rectangle *rectangle, short color_index); void _frame_rect(screen_rectangle *rectangle, short color_index); void _offset_screen_rect(screen_rectangle *rect, short dx, short dy); -------------------------------------------------------------------------------- /marathon2/export_definitions.c: -------------------------------------------------------------------------------- 1 | /* EXPORT_DEFINITIONS.C Sunday, October 2, 1994 12:35:58 PM (Jason') Tuesday, October 31, 1995 11:02:24 AM (Ryan) */ #include "macintosh_cseries.h" #include "map.h" #include "effects.h" #include "projectiles.h" #include "monsters.h" #include "weapons.h" #include "wad.h" #include "items.h" #include "sound.h" #include "media.h" #include "tags.h" /* ---------- globals */ #define EXPORT_STRUCTURE 1 #include "weapon_definitions.h" #include "monster_definitions.h" #include "projectile_definitions.h" #include "effect_definitions.h" #include "physics_models.h" #include "extensions.h" /* ---------- private code */ static boolean create_physics_file(FileDesc *file); /* ---------- code */ void main( int argc, char **argv) { if (argc<=1) { fprintf(stderr, "Usage: %s \n", argv[0]); exit(1); } else { FSSpec physics_spec; OSErr error; initialize_debugger(TRUE); /* Get the Marathon FSSpec */ error= get_my_fsspec(&physics_spec); strcpy(temporary, argv[1]); c2pstr(temporary); error= FSMakeFSSpec(0, 0, temporary, &physics_spec); if(!error || error==fnfErr) { if(!create_physics_file((FileDesc *) &physics_spec)) { fprintf(stderr, "Unable to create the physics file!\n"); } } else { fprintf(stderr, "%s: Error opening '%s' (Err: %d)", argv[0], argv[1], error); exit(1); } } exit(0); } /* ---------- private code */ static boolean create_physics_file( FileDesc *file) { boolean success= FALSE; FileError error= 0; error= create_wadfile(file, PHYSICS_FILE_TYPE); if(!error) { fileref file_ref; file_ref= open_wad_file_for_writing(file); if(file_ref != NONE) { struct wad_header header; struct directory_entry entries[MAXIMUM_DIRECTORY_ENTRIES_PER_FILE]; /* Create the header.. */ fill_default_wad_header(file, CURRENT_WADFILE_VERSION, BUNGIE_PHYSICS_DATA_VERSION, 1, 0, &header); if(write_wad_header(file_ref, &header)) { struct wad_data *wad= create_empty_wad(); if(wad) { short index; for (index= 0; indextag, definition->data, definition->size*definition->count, 0l); } if(write_wad(file_ref, &header, wad, sizeof(struct wad_header))) { /* Update the header.. */ entries[0].offset_to_start= sizeof(struct wad_header); entries[0].index= 0; entries[0].length= calculate_wad_length(&header, wad); /* Write the directory.. */ header.directory_offset= sizeof(struct wad_header)+entries[0].length; header.wad_count= 1; write_wad_header(file_ref, &header); write_directorys(file_ref, &header, entries); /* We win.. */ success= TRUE; } } else { error= memory_error(); } } /* Save the crc.. */ calculate_and_store_wadfile_checksum(file_ref); close_wad_file(file_ref); fprintf(stderr, "Physics File: %P Checksum: 0x%x\n", file->name, read_wad_file_checksum(file)); } } return success; } -------------------------------------------------------------------------------- /marathon2/weapons.h: -------------------------------------------------------------------------------- 1 | /* weapons2.h Saturday, May 13, 1995 4:41:42 PM- rdm created. */ /* enums for player.c */ enum { /* Weapons */ _weapon_fist, _weapon_pistol, _weapon_plasma_pistol, _weapon_assault_rifle, _weapon_missile_launcher, _weapon_flamethrower, _weapon_alien_shotgun, _weapon_shotgun, _weapon_ball, // or something MAXIMUM_NUMBER_OF_WEAPONS, _weapon_doublefisted_pistols= MAXIMUM_NUMBER_OF_WEAPONS, /* This is a pseudo-weapon */ _weapon_doublefisted_shotguns, PLAYER_TORSO_SHAPE_COUNT }; enum { _shape_weapon_idle, _shape_weapon_charging, _shape_weapon_firing }; enum { _primary_weapon, _secondary_weapon, NUMBER_OF_TRIGGERS }; enum /* weapon display positioning modes */ { _position_low, /* position==0 is invisible, position==FIXED_ONE is sticking out from left/bottom */ _position_center, /* position==0 is off left/bottom, position==FIXED_ONE is off top/right */ _position_high /* position==0 is invisible, position==FIXED_ONE is sticking out from right/top (mirrored, whether you like it or not) */ }; /* ----------------- structures */ struct weapon_display_information { short collection, low_level_shape_index; fixed vertical_position, horizontal_position; short vertical_positioning_mode, horizontal_positioning_mode; short transfer_mode; fixed transfer_phase; boolean flip_horizontal, flip_vertical; }; /* ----------------- prototypes */ /* called once at startup */ void initialize_weapon_manager(void); /* Initialize the weapons for a completely new game. */ void initialize_player_weapons_for_new_game(short player_index); /* initialize the given players weapons-> called after creating a player */ void initialize_player_weapons(short player_index); void *get_weapon_array(void); long calculate_weapon_array_length(void); /* while this returns true, keep calling.. */ boolean get_weapon_display_information(short *count, struct weapon_display_information *data); /* When the player runs over an item, check for reloads, etc. */ void process_new_item_for_reloading(short player_index, short item_type); /* Update the given player's weapons */ void update_player_weapons(short player_index, long action_flags); /* Mark the weapon collections for loading or unloading.. */ void mark_weapon_collections(boolean loading); /* Called when a player dies to discharge the weapons that they have charged up. */ void discharge_charged_weapons(short player_index); /* Called on entry to a level, and will change weapons if this one doesn't work */ /* in the given environment. */ void check_player_weapons_for_environment_change(void); /* Tell me when one of my projectiles hits, and return the weapon_identifier I passed */ /* to new_projectile... */ void player_hit_target(short player_index, short weapon_identifier); /* for drawing the player */ void get_player_weapon_mode_and_type(short player_index, short *shape_weapon_type, short *shape_mode); /* For the game window to update properly */ short get_player_desired_weapon(short player_index); /* This is pinned to the maximum I think I can hold.. */ short get_player_weapon_ammo_count(short player_index, short which_weapon, short which_trigger); #ifdef DEBUG void debug_print_weapon_status(void); #endif -------------------------------------------------------------------------------- /marathon2/computer_interface.h: -------------------------------------------------------------------------------- 1 | /* computer_interface.h Tuesday, August 23, 1994 11:25:40 PM (ajr) Thursday, May 25, 1995 5:18:03 PM- rewriting. New paradigm: Groups each start with one of the following groups: #UNFINISHED, #SUCCESS, #FAILURE First is shown the #LOGON XXXXX Then there are any number of groups with: #INFORMATION, #CHECKPOINT, #SOUND, #MOVIE, #TRACK And a final: #INTERLEVEL TELEPORT, #INTRALEVEL TELEPORT Each group ends with: #END Groupings: #logon XXXX- login message (XXXX is shape for login screen) #unfinished- unfinished message #success- success message #failure- failure message #information- information #briefing XX- briefing, then load XX #checkpoint XX- Checkpoint xx (associated with goal) #sound XXXX- play sound XXXX #movie XXXX- play movie XXXX (from Movie file) #track XXXX- play soundtrack XXXX (from Music file) #interlevel teleport XXX- go to level XXX #intralevel teleport XXX- go to polygon XXX #pict XXXX- diplay the pict resource XXXX Special embedded keys: $B- Bold on $b- bold off $I- Italic on $i- italic off $U- underline on $u- underline off $- anything else is passed through unchanged Preprocessed format: static: long total_length; short grouping_count; short font_changes_count; short total_text_length; dynamic: struct terminal_groupings groups[grouping_count]; struct text_face_data[font_changes_count]; char text; */ /* ------------ structures */ struct static_preprocessed_terminal_data { short total_length; short flags; short lines_per_page; /* Added for internationalization/sync problems */ short grouping_count; short font_changes_count; }; struct view_terminal_data { short top, left, bottom, right; short vertical_offset; }; extern byte *map_terminal_data; extern long map_terminal_data_length; /* ------------ prototypes */ void initialize_terminal_manager(void); void initialize_player_terminal_info(short player_index); void enter_computer_interface(short player_index, short text_number, short completion_flag); void _render_computer_interface(struct view_terminal_data *data); void update_player_for_terminal_mode(short player_index); void update_player_keys_for_terminal(short player_index, long action_flags); long build_terminal_action_flags(char *keymap); void dirty_terminal_view(short player_index); void abort_terminal_mode(short player_index); boolean player_in_terminal_mode(short player_index); void *get_terminal_data_for_save_game(void); long calculate_terminal_data_length(void); /* This returns the text.. */ void *get_terminal_information_array(void); long calculate_terminal_information_length(void); #ifdef PREPROCESSING_CODE struct static_preprocessed_terminal_data *preprocess_text(char *text, short length); struct static_preprocessed_terminal_data *get_indexed_terminal_data(short id); void encode_text(struct static_preprocessed_terminal_data *terminal_text); void decode_text(struct static_preprocessed_terminal_data *terminal_text); void find_all_picts_references_by_terminals(byte *compiled_text, short terminal_count, short *picts, short *picture_count); void find_all_checkpoints_references_by_terminals(byte *compiled_text, short terminal_count, short *checkpoints, short *checkpoint_count); boolean terminal_has_finished_text_type(short terminal_id, short finished_type); #endif -------------------------------------------------------------------------------- /marathon2/textures.c: -------------------------------------------------------------------------------- 1 | /* TEXTURES.C Monday, August 23, 1993 1:47:25 PM Friday, May 13, 1994 1:56:03 PM precalculate_bitmap_row_addresses() now handles the new RLE shapes, added remap_bitmap(). */ #include "cseries.h" #include "textures.h" #ifdef mpwc #pragma segment render #endif #define MARATHON2 /* ---------- code */ pixel8 *calculate_bitmap_origin( struct bitmap_definition *bitmap) { pixel8 *origin; origin= (pixel8 *) (((byte *)bitmap) + sizeof(struct bitmap_definition)); if (bitmap->flags&_COLUMN_ORDER_BIT) { origin+= bitmap->width*sizeof(pixel8 *); } else { origin+= bitmap->height*sizeof(pixel8 *); } return origin; } void erase_bitmap( struct bitmap_definition *bitmap, long pel) { short rows, columns; short row, column; assert(bitmap->bytes_per_row!=NONE); rows= (bitmap->flags&_COLUMN_ORDER_BIT) ? bitmap->width : bitmap->height; columns= (bitmap->flags&_COLUMN_ORDER_BIT) ? bitmap->height : bitmap->width; for (row=0;rowrow_addresses[row]; switch (bitmap->bit_depth) { case 8: for (column=0;columnflags&_COLUMN_ORDER_BIT) ? bitmap->width : bitmap->height; columns= (bitmap->flags&_COLUMN_ORDER_BIT) ? bitmap->height : bitmap->width; if (bitmap->bytes_per_row!=NONE) { for (row=0;rowrow_addresses[row], table, sizeof(pixel8)*columns); } } else { #ifdef MARATHON1 short run_count; pixel8 *pixels; pixels= bitmap->row_addresses[0]; for (row= 0; row0) { map_bytes(pixels, table, run_count); pixels+= run_count; } } } #endif #ifdef MARATHON2 pixel8 *pixels; pixels= bitmap->row_addresses[0]; for (row= 0; rowflags&_COLUMN_ORDER_BIT) ? bitmap->width : bitmap->height; row_address= bitmap->row_addresses[0]; table= bitmap->row_addresses; if ((bytes_per_row= bitmap->bytes_per_row)!=NONE) { for (row=0;row0) row_address+= run_count; } } #endif #ifdef MARATHON2 for (row= 0; row=0) { *buffer= table[*buffer]; buffer+= 1; } return; } -------------------------------------------------------------------------------- /marathon2/item_definitions.h: -------------------------------------------------------------------------------- 1 | /* ITEM_DEFINITIONS.H Saturday, October 22, 1994 3:02:32 PM */ /* ---------- structures */ struct item_definition { short item_kind; short singular_name_id; short plural_name_id; shape_descriptor base_shape; short maximum_count_per_player; short invalid_environments; }; /* ---------- globals */ struct item_definition item_definitions[]= { /* Knife */ {_weapon, 0, 0, NONE, 1, 0}, // pistol and ammo {_weapon, 1, 2, BUILD_DESCRIPTOR(_collection_items, 0), 2, 0}, {_ammunition, 3, 4, BUILD_DESCRIPTOR(_collection_items, 3), 50, 0}, // fusion pistol and ammo {_weapon, 5, 5, BUILD_DESCRIPTOR(_collection_items, 1), 1, 0}, {_ammunition, 6, 7, BUILD_DESCRIPTOR(_collection_items, 4), 25, 0}, // assault rifle, bullets and grenades {_weapon, 8, 8, BUILD_DESCRIPTOR(_collection_items, 2), 1, _environment_vacuum}, {_ammunition, 9, 10, BUILD_DESCRIPTOR(_collection_items, 5), 15, _environment_vacuum}, {_ammunition, 11, 12, BUILD_DESCRIPTOR(_collection_items, 6), 8, _environment_vacuum}, // rocket launcher and ammo {_weapon, 13, 13, BUILD_DESCRIPTOR(_collection_items, 12), 1, _environment_vacuum}, {_ammunition, 14, 15, BUILD_DESCRIPTOR(_collection_items, 7), 4, _environment_vacuum}, // invisibility, invincibility, invfravision {_powerup, NONE, NONE, BUILD_DESCRIPTOR(_collection_items, 8), 1, 0}, {_powerup, NONE, NONE, BUILD_DESCRIPTOR(_collection_items, 9), 1, 0}, {_powerup, NONE, NONE, BUILD_DESCRIPTOR(_collection_items, 14), 1, 0}, // alien weapon and ammunition {_weapon, 16, 16, BUILD_DESCRIPTOR(_collection_items, 13), 1, 0}, {_ammunition, 17, 18, NONE, 999, 0}, // flamethrower and ammo {_weapon, 19, 19, BUILD_DESCRIPTOR(_collection_items, 10), 1, _environment_vacuum}, {_ammunition, 20, 21, BUILD_DESCRIPTOR(_collection_items, 11), 3, _environment_vacuum}, /* extravision powerup */ {_powerup, NONE, NONE, BUILD_DESCRIPTOR(_collection_items, 15), 1, 0}, // energy and oxygen recharges {_powerup, NONE, NONE, BUILD_DESCRIPTOR(_collection_items, 23), 1, 0}, /* oxygen recharge */ {_powerup, NONE, NONE, BUILD_DESCRIPTOR(_collection_items, 20), 1, 0}, /* x1 recharge */ {_powerup, NONE, NONE, BUILD_DESCRIPTOR(_collection_items, 21), 1, 0}, /* x2 recharge */ {_powerup, NONE, NONE, BUILD_DESCRIPTOR(_collection_items, 22), 1, 0}, /* x3 recharge */ // shotgun and ammo {_weapon, 27, 28, BUILD_DESCRIPTOR(_collection_items, 18), 2, 0}, {_ammunition, 17, 18, BUILD_DESCRIPTOR(_collection_items, 19), 80, 0}, // _i_spht_door_key, _i_uplink_chip {_item, 29, 30, BUILD_DESCRIPTOR(_collection_items, 17), 8, 0}, {_item, 31, 32, BUILD_DESCRIPTOR(_collection_items, 16), 1, 0}, // Net game balls. {_ball, 33, 33, BUILD_DESCRIPTOR(BUILD_COLLECTION(_collection_player, 0), 29), 1, _environment_single_player}, {_ball, 34, 34, BUILD_DESCRIPTOR(BUILD_COLLECTION(_collection_player, 1), 29), 1, _environment_single_player}, {_ball, 35, 35, BUILD_DESCRIPTOR(BUILD_COLLECTION(_collection_player, 2), 29), 1, _environment_single_player}, {_ball, 36, 36, BUILD_DESCRIPTOR(BUILD_COLLECTION(_collection_player, 3), 29), 1, _environment_single_player}, {_ball, 37, 37, BUILD_DESCRIPTOR(BUILD_COLLECTION(_collection_player, 4), 29), 1, _environment_single_player}, {_ball, 38, 38, BUILD_DESCRIPTOR(BUILD_COLLECTION(_collection_player, 5), 29), 1, _environment_single_player}, {_ball, 39, 39, BUILD_DESCRIPTOR(BUILD_COLLECTION(_collection_player, 6), 29), 1, _environment_single_player}, {_ball, 40, 40, BUILD_DESCRIPTOR(BUILD_COLLECTION(_collection_player, 7), 29), 1, _environment_single_player} }; -------------------------------------------------------------------------------- /marathon2/crc.c: -------------------------------------------------------------------------------- 1 | /* crc.c Sunday, March 5, 1995 6:21:30 PM CRC Checksum generation for a file. */ #include "cseries.h" #include "portable_files.h" #include "crc.h" #ifdef mpwc #pragma segment file_io #endif /* ---------- constants */ #define TABLE_SIZE (256) #define CRC32_POLYNOMIAL 0xEDB88320L #define BUFFER_SIZE 1024 /* ---------- local data */ static unsigned long *crc_table= NULL; /* ---------- local prototypes ------- */ static unsigned long calculate_file_crc(unsigned char *buffer, short buffer_size, short refnum); static unsigned long calculate_buffer_crc(long count, unsigned long crc, void *buffer); static boolean build_crc_table(void); static void free_crc_table(void); /* -------------- Entry Point ----------- */ unsigned long calculate_crc_for_file( FileDesc *file) { short refnum; unsigned long crc; refnum= open_file_for_reading(file); if(refnum!=NONE) { crc= calculate_crc_for_opened_file(refnum); close_file(refnum); } return crc; } unsigned long calculate_crc_for_opened_file( short refnum) { unsigned long crc; unsigned char *buffer; /* Build the crc table */ if(build_crc_table()) { buffer= (unsigned char *) malloc(BUFFER_SIZE*sizeof(unsigned char)); if(buffer) { crc= calculate_file_crc(buffer, BUFFER_SIZE, refnum); free(buffer); } /* free the crc table! */ free_crc_table(); } return crc; } /* Calculate the crc for a file using the given buffer.. */ unsigned long calculate_data_crc( unsigned char *buffer, long length) { unsigned long crc= 0l; assert(buffer); /* Build the crc table */ if(build_crc_table()) { /* The odd permutions ensure that we get the same crc as for a file */ crc = 0xFFFFFFFFL; crc = calculate_buffer_crc(length, crc, buffer); crc ^= 0xFFFFFFFFL; /* free the crc table! */ free_crc_table(); } return crc; } /* ---------------- Private Code --------------- */ static boolean build_crc_table( void) { boolean success= FALSE; assert(!crc_table); crc_table= (unsigned long *) malloc(TABLE_SIZE*sizeof(unsigned long)); if(crc_table) { /* Build the table */ short index, j; unsigned long crc; for(index= 0; index>1) ^ CRC32_POLYNOMIAL; else crc>>=1; } crc_table[index] = crc; } success= TRUE; } return success; } static void free_crc_table( void) { assert(crc_table); free(crc_table); crc_table= NULL; } /* Calculate for a block of data incrementally */ static unsigned long calculate_buffer_crc( long count, unsigned long crc, void *buffer) { unsigned char *p; unsigned long a; unsigned long b; p= (unsigned char *) buffer; while (count--) { a= (crc >> 8) & 0x00FFFFFFL; b= crc_table[((int) crc ^ *p++) & 0xff]; crc= a^b; } return crc; } /* Calculate the crc for a file using the given buffer.. */ static unsigned long calculate_file_crc( unsigned char *buffer, short buffer_size, short refnum) { unsigned long crc; long count; FileError err; long file_length, initial_position; /* Save and restore the initial file position */ initial_position= get_fpos(refnum); /* Get the file_length */ file_length= get_file_length(refnum); /* Set to the start of the file */ set_fpos(refnum, 0l); crc = 0xFFFFFFFFL; while(file_length) { if(file_length>buffer_size) { count= buffer_size; } else { count= file_length; } err= read_file(refnum, count, buffer); vassert(!err, csprintf(temporary, "Error: %d", err)); crc = calculate_buffer_crc(count, crc, buffer); file_length -= count; } /* Restore the file position */ set_fpos(refnum, initial_position); return (crc ^= 0xFFFFFFFFL); } -------------------------------------------------------------------------------- /marathon2/find_files.c: -------------------------------------------------------------------------------- 1 | /* find_files.c Wednesday, January 11, 1995 6:44:55 PM */ #include "macintosh_cseries.h" #include /* For memset */ #include "find_files.h" #ifdef mpwc #pragma segment file_io #endif /* --------- local prototypes */ static int alphabetical_names(const FSSpec *a, const FSSpec *b); static OSErr enumerate_files(struct find_file_pb *param_block, long directory_id); /* ---------------- Parameter Block Version */ OSErr find_files( struct find_file_pb *param_block) { OSErr err; /* If we need to create the destination buffer */ if(param_block->flags & _ff_create_buffer) { assert(param_block->search_type==_fill_buffer); param_block->buffer= (FSSpec *) NewPtr(sizeof(FSSpec)*param_block->max); } /* Assert that we got it. */ assert(param_block->search_type==_callback_only || param_block->buffer); assert(param_block->version==0); /* Set the variables */ param_block->count= 0; err= enumerate_files(param_block, param_block->directory_id); /* Alphabetical */ if(param_block->flags & _ff_alphabetical) { assert(param_block->search_type==_fill_buffer); qsort(param_block->buffer, param_block->count, sizeof(FSSpec), alphabetical_names); } /* If we created the buffer, make it the exact right size */ if(param_block->flags & _ff_create_buffer) { assert(param_block->search_type==_fill_buffer); SetPtrSize((Ptr) param_block->buffer, sizeof(FSSpec)*(param_block->count)); } return err; } Boolean equal_fsspecs( FSSpec *a, FSSpec *b) { Boolean equal= false; if(a->vRefNum==b->vRefNum && a->parID==b->parID && EqualString(a->name, b->name, false, false)) { equal= true; } return equal; } /* --------- Local Code --------- */ static OSErr enumerate_files( struct find_file_pb *param_block, long directory_id) /* Because it is recursive.. */ { static CInfoPBRec pb; /* static to prevent stack overflow.. */ static FSSpec temp_file; static OSErr err; short index; memset(&pb, 0, sizeof(CInfoPBRec)); temp_file.vRefNum= param_block->vRefNum; pb.hFileInfo.ioVRefNum= temp_file.vRefNum; pb.hFileInfo.ioNamePtr= temp_file.name; for(err= noErr, index=1; param_block->countmax && err==noErr; index++) { pb.hFileInfo.ioDirID= directory_id; pb.hFileInfo.ioFDirIndex= index; err= PBGetCatInfo( &pb, false); if(!err) { if ((pb.hFileInfo.ioFlAttrib & 16) && (param_block->flags & _ff_recurse)) { /* Recurse, if you really want to... */ err= enumerate_files(param_block, pb.dirInfo.ioDrDirID); } else { /* Add.. */ if(param_block->type_to_find==WILDCARD_TYPE || pb.hFileInfo.ioFlFndrInfo.fdType==param_block->type_to_find) { temp_file.vRefNum= pb.hFileInfo.ioVRefNum; temp_file.parID= directory_id; /* Only add if there isn't a callback or it returns TRUE */ switch(param_block->search_type) { case _fill_buffer: if(!param_block->callback || param_block->callback(&temp_file, param_block->user_data)) { /* Copy it in.. */ BlockMove(&temp_file, ¶m_block->buffer[param_block->count++], sizeof(FSSpec)); } break; case _callback_only: assert(param_block->callback); if(param_block->flags & _ff_callback_with_catinfo) { param_block->callback(&temp_file, &pb); } else { param_block->callback(&temp_file, param_block->user_data); } break; default: halt(); break; } } } } else { /* We ran out of files.. */ } } /* If we got a fnfErr, it was because we indexed too far. */ return (err==fnfErr) ? (noErr) : err; } static int alphabetical_names( const FSSpec *a, const FSSpec *b) { return (IUCompString(a->name, b->name)); } -------------------------------------------------------------------------------- /marathon2/macintosh_network.h: -------------------------------------------------------------------------------- 1 | /* MACINTOSH_NETWORK.H Monday, June 20, 1994 12:22:25 PM Wednesday, August 9, 1995 3:34:50 PM- network lookup stuff now takes a version which is concatenated to the lookup type (ryan) */ #include #include #include "network.h" /* ---------- constants */ #define strNETWORK_ERRORS 132 enum /* error string for user */ { netErrCantAddPlayer, netErrCouldntDistribute, netErrCouldntJoin, netErrServerCanceled, netErrMapDistribFailed, netErrWaitedTooLongForMap, netErrSyncFailed, netErrJoinFailed, netErrCantContinue }; /* missing from AppleTalk.h */ #define ddpMaxData 586 /* ---------- DDPFrame and PacketBuffer (DDP) */ struct DDPFrame { short data_size; byte data[ddpMaxData]; MPPParamBlock pb; WDSElement wds[3]; byte header[17]; }; typedef struct DDPFrame DDPFrame, *DDPFramePtr; struct DDPPacketBuffer { short inUse; byte protocolType; byte destinationNode; AddrBlock sourceAddress; short hops; short datagramSize; byte datagramData[ddpMaxData]; }; typedef struct DDPPacketBuffer DDPPacketBuffer, *DDPPacketBufferPtr; /* ---------- ConnectionEnd (ADSP) */ struct ConnectionEnd { short ccbRefNum, socketNum; /* reference number and socket number of this connection end */ /* memory for ADSP */ TPCCB dspCCB; Ptr dspSendQPtr; Ptr dspRecvQPtr; Ptr dspAttnBufPtr; #ifdef env68k long a5; /* store our current a5 here */ #endif DSPParamBlock pb; /* parameter block for this connection end */ }; typedef struct ConnectionEnd ConnectionEnd, *ConnectionEndPtr; /* ---------- types */ typedef EntityName *EntityNamePtr; typedef void (*lookupUpdateProcPtr)(short message, short index); typedef boolean (*lookupFilterProcPtr)(EntityName *entity, AddrBlock *address); typedef void (*packetHandlerProcPtr)(DDPPacketBufferPtr packet); /* ---------- prototypes/NETWORK.C */ short NetState(void); void NetSetServerIdentifier(short identifier); /* for giving to NetLookupOpen() as a filter procedure */ boolean NetEntityNotInGame(EntityName *entity, AddrBlock *address); /* ---------- prototypes/NETWORK_NAMES.C */ OSErr NetRegisterName(char *name, char *type, short version, short socketNumber); OSErr NetUnRegisterName(void); /* ---------- prototypes/NETWORK_LOOKUP.C */ void NetLookupUpdate(void); void NetLookupClose(void); OSErr NetLookupOpen(char *name, char *type, char *zone, short version, lookupUpdateProcPtr updateProc, lookupFilterProcPtr filterProc); void NetLookupRemove(short index); void NetLookupInformation(short index, AddrBlock *address, EntityName *entity); OSErr NetGetZonePopupMenu(MenuHandle menu, short *local_zone); OSErr NetGetZoneList(Ptr zone_names, short maximum_zone_names, short *zone_count, short *local_zone); OSErr NetGetLocalZoneName(Str32 local_zone_name); /* ---------- prototypes/NETWORK_DDP.C */ OSErr NetDDPOpen(void); OSErr NetDDPClose(void); OSErr NetDDPOpenSocket(short *socketNumber, packetHandlerProcPtr packetHandler); OSErr NetDDPCloseSocket(short socketNumber); DDPFramePtr NetDDPNewFrame(void); void NetDDPDisposeFrame(DDPFramePtr frame); OSErr NetDDPSendFrame(DDPFramePtr frame, AddrBlock *address, short protocolType, short socket); /* ---------- prototypes/NETWORK_ADSP.C */ OSErr NetADSPOpen(void); OSErr NetADSPClose(void); OSErr NetADSPEstablishConnectionEnd(ConnectionEndPtr *connection); OSErr NetADSPDisposeConnectionEnd(ConnectionEndPtr connectionEnd); OSErr NetADSPOpenConnection(ConnectionEndPtr connectionEnd, AddrBlock *address); OSErr NetADSPCloseConnection(ConnectionEndPtr connectionEnd, boolean abort); OSErr NetADSPWaitForConnection(ConnectionEndPtr connectionEnd); Boolean NetADSPCheckConnectionStatus(ConnectionEndPtr connectionEnd, AddrBlock *address); OSErr NetADSPWrite(ConnectionEndPtr connectionEnd, void *buffer, word *count); OSErr NetADSPRead(ConnectionEndPtr connectionEnd, void *buffer, word *count); -------------------------------------------------------------------------------- /marathon2/files_macintosh.c: -------------------------------------------------------------------------------- 1 | /* macintosh_files.c Tuesday, August 29, 1995 3:18:54 PM- rdm created. */ #include "macintosh_cseries.h" #include #include #include "portable_files.h" #include "game_errors.h" #include "tags.h" // for APPLICATION_CREATOR /* --------------- code! */ FileError create_file( FileDesc *file, unsigned long file_type) /* Should be OSType, or extension for dos. */ { FileError err; /* Assume that they already confirmed this is goign to die.. */ err= FSpDelete((FSSpec *) file); if(!err || err==fnfErr) { err= FSpCreate((FSSpec *) file, APPLICATION_CREATOR, file_type, smSystemScript); if(!err) { FSpCreateResFile((FSSpec *)file, APPLICATION_CREATOR, file_type, smSystemScript); err= ResError(); } } return err; } fileref open_file_for_reading( FileDesc *file) { fileref file_id; Boolean is_folder, was_aliased; FileError error; ResolveAliasFile((FSSpec *)file, TRUE, &is_folder, &was_aliased); error= FSpOpenDF((FSSpec *)file, fsRdPerm, &file_id); if (error) { dprintf("HOpen('%P', #%d, #%d)==#%d;g;", file->name, file->vRefNum, file->parID, error); file_id= NONE; set_game_error(systemError, error); } return file_id; } fileref open_file_for_writing( FileDesc *file) { fileref file_id; Boolean is_folder, was_aliased; FileError error; ResolveAliasFile((FSSpec *)file, TRUE, &is_folder, &was_aliased); error= FSpOpenDF((FSSpec *)file, fsWrPerm, &file_id); if (error) { dprintf("HOpen('%P', #%d, #%d)==#%d;g;", file->name, file->vRefNum, file->parID, error); file_id= NONE; set_game_error(systemError, error); } return file_id; } void close_file( fileref refnum) { OSErr error; error= FSFlush(refnum, 0); error= FSClose(refnum); assert(!error); return; } unsigned long get_fpos( fileref refnum) { unsigned long position; OSErr err; err= GetFPos(refnum, (long *) &position); assert(!err); return position; } FileError set_fpos( fileref refnum, unsigned long offset) { OSErr err; err= SetFPos(refnum, fsFromStart, offset); return err; } FileError set_eof( fileref refnum, unsigned long offset) { OSErr err; err= SetEOF(refnum, offset); return err; } unsigned long get_file_length( fileref refnum) { unsigned long file_length; unsigned long initial_position; GetFPos(refnum, (long *) &initial_position); SetFPos(refnum, fsFromLEOF, 0l); GetFPos(refnum, (long *) &file_length); SetFPos(refnum, fsFromStart, initial_position); return file_length; } FileError read_file( fileref refnum, unsigned long count, void *buffer) { OSErr err; assert(refnum>=0); err= FSRead(refnum, (long *) &count, buffer); return err; } FileError write_file( fileref refnum, unsigned long count, void *buffer) { OSErr err; err= FSWrite(refnum, (long *) &count, buffer); return err; } FileError delete_file( FileDesc *file) { FileError error; error= FSpDelete((FSSpec *) file); return error; } FileError find_preferences_location( FileDesc *file) { FileError err; err= FindFolder(kOnSystemDisk, kPreferencesFolderType, kCreateFolder, &file->vRefNum, &file->parID); return err; } /* ------- miscellaneous routines */ FileError add_application_name_to_fsspec( FileDesc *file, char *pascal_name) { FileError err; FInfo finder_info; short refnum; err = FSpGetFInfo((FSSpec *) file, &finder_info); if(!err) { refnum= FSpOpenResFile((FSSpec *) file, fsWrPerm); err= ResError(); if(err) { /* This file doesn't have a res fork.. */ if(err==fnfErr) { FSpCreateResFile((FSSpec *) file, finder_info.fdCreator, finder_info.fdType, smSystemScript); err= ResError(); if(!err) { refnum= FSpOpenResFile((FSSpec *) file, fsWrPerm); err= ResError(); } } } } if(!err) { Handle resource; assert(refnum>=0); /* Add in the application name */ err= PtrToHand(pascal_name, &resource, pascal_name[0]+1); assert(!err && resource); AddResource(resource, 'STR ', -16396, ""); ReleaseResource(resource); CloseResFile(refnum); } return err; } void get_application_filedesc( /* this is used to save files in the same directory */ FileDesc *file) { get_my_fsspec((FSSpec *) file); } FileError memory_error( void) { return MemError(); } -------------------------------------------------------------------------------- /marathon2/key_definitions.h: -------------------------------------------------------------------------------- 1 | /* * Monday, September 12, 1994 12:45:17 PM (alain) * This header file can only be included by one other file. right now that's vbl.c * */ /* Constants */ enum /* special flag types */ { _double_flag, _latched_flag }; /* Structures */ struct blacklist_data { short offset1, offset2; /* the combination of keys that should be blacklisted */ short mask1, mask2; /* help for finding them in the keymap */ }; struct special_flag_data { short type; long flag, alternate_flag; short persistence; }; struct key_definition { short offset; long action_flag; short mask; }; /* * various key setups that the user can get. * NOTE that these arrays must all be in the same order, and they must * be in the same order as the text edit boxes in the "setup keys" dialog * */ #define NUMBER_OF_STANDARD_KEY_DEFINITIONS (sizeof(standard_key_definitions)/sizeof(struct key_definition)) static struct key_definition standard_key_definitions[]= { /* keypad */ {0x5b, _moving_forward}, {0x57, _moving_backward}, {0x56, _turning_left}, {0x58, _turning_right}, /* zx translation */ {0x06, _sidestepping_left}, {0x07, _sidestepping_right}, /* as looking */ {0x00, _looking_left}, {0x01, _looking_right}, /* dcv vertical looking */ {0x02, _looking_up}, {0x08, _looking_down}, {0x09, _looking_center}, /* KP7/KP9 for weapon cycling */ {0x59, _cycle_weapons_backward}, {0x5c, _cycle_weapons_forward}, /* space for primary trigger, option for alternate trigger */ {0x31, _left_trigger_state}, {0x3a, _right_trigger_state}, /* shift, control and command modifiers */ {0x37, _sidestep_dont_turn}, {0x3b, _run_dont_walk}, {0x38, _look_dont_turn}, /* tab for action */ {0x30, _action_trigger_state}, /* m for toggle between normal and overhead map view */ {0x2e, _toggle_map}, /* ` for using the microphone */ {0x32, _microphone_button} }; #define NUMBER_OF_LEFT_HANDED_KEY_DEFINITIONS (sizeof(left_handed_key_definitions)/sizeof(struct key_definition)) static struct key_definition left_handed_key_definitions[]= { /* arrows */ {0x7e, _moving_forward}, {0x7d, _moving_backward}, {0x7b, _turning_left}, {0x7c, _turning_right}, /* zx translation */ {0x06, _sidestepping_left}, {0x07, _sidestepping_right}, /* as looking */ {0x00, _looking_left}, {0x01, _looking_right}, /* dcv vertical looking */ {0x02, _looking_up}, {0x08, _looking_down}, {0x09, _looking_center}, /* ;' for weapon cycling */ {0x0c, _cycle_weapons_backward}, {0x0d, _cycle_weapons_forward}, /* space for primary trigger, option for alternate trigger */ {0x31, _left_trigger_state}, {0x3a, _right_trigger_state}, /* shift, control and command modifiers */ {0x37, _sidestep_dont_turn}, {0x3b, _run_dont_walk}, {0x38, _look_dont_turn}, /* tab for action */ {0x30, _action_trigger_state}, /* m for toggle between normal and overhead map view */ {0x2e, _toggle_map}, /* ` for using the microphone */ {0x32, _microphone_button} }; #define NUMBER_OF_POWERBOOK_KEY_DEFINITIONS (sizeof(powerbook_key_definitions)/sizeof(struct key_definition)) static struct key_definition powerbook_key_definitions[]= { /* olk; */ {0x1f, _moving_forward}, {0x25, _moving_backward}, {0x28, _turning_left}, {0x29, _turning_right}, /* zx translation */ {0x06, _sidestepping_left}, {0x07, _sidestepping_right}, /* as looking */ {0x00, _looking_left}, {0x01, _looking_right}, /* dcv vertical looking */ {0x02, _looking_up}, {0x08, _looking_down}, {0x09, _looking_center}, /* ip for weapon cycling */ {0x22, _cycle_weapons_backward}, {0x23, _cycle_weapons_forward}, /* space for primary trigger, option for alternate trigger */ {0x31, _left_trigger_state}, {0x3a, _right_trigger_state}, /* shift, control and command modifiers */ {0x37, _sidestep_dont_turn}, {0x3b, _run_dont_walk}, {0x38, _look_dont_turn}, /* tab for action */ {0x30, _action_trigger_state}, /* m for toggle between normal and overhead map view */ {0x2e, _toggle_map}, /* ` for using the microphone */ {0x32, _microphone_button} }; static struct key_definition *all_key_definitions[NUMBER_OF_KEY_SETUPS]= { &standard_key_definitions, &left_handed_key_definitions, &powerbook_key_definitions }; /* Externed because both vbl.c and vbl_macintosh.c use this. */ extern struct key_definition current_key_definitions[NUMBER_OF_STANDARD_KEY_DEFINITIONS]; -------------------------------------------------------------------------------- /marathon2/media.c: -------------------------------------------------------------------------------- 1 | /* MEDIA.C Sunday, March 26, 1995 1:13:11 AM (Jason') */ #include #include "map.h" #include "media.h" #include "effects.h" #include "fades.h" #include "lightsource.h" #include "sound.h" #ifdef mpwc #pragma segment marathon #endif /* ---------- macros */ #define CALCULATE_MEDIA_HEIGHT(m) ((m)->low + FIXED_INTEGERAL_PART(((m)->high-(m)->low)*get_light_intensity((m)->light_index))) /* ---------- globals */ struct media_data *medias; /* ---------- private prototypes */ static void update_one_media(short media_index, boolean force_update); #ifdef DEBUG static struct media_definition *get_media_definition(short type); #else #define get_media_definition(t) (media_definitions+(t)) #endif /* ---------- globals */ struct media_data *medias; #include "media_definitions.h" /* ---------- code */ // light_index must be loaded short new_media( struct media_data *initializer) { struct media_data *media; short media_index; for (media_index= 0, media= medias; media_indexorigin.x= media->origin.y= 0; update_one_media(media_index, TRUE); break; } } if (media_index==MAXIMUM_MEDIAS_PER_MAP) media_index= NONE; return media_index; } boolean media_in_environment( short media_type, short environment_code) { return collection_in_environment(get_media_definition(media_type)->collection, environment_code); } void update_medias( void) { short media_index; struct media_data *media; for (media_index= 0, media= medias; media_indexorigin.x= WORLD_FRACTIONAL_PART(media->origin.x + ((cosine_table[media->current_direction]*media->current_magnitude)>>TRIG_SHIFT)); media->origin.y= WORLD_FRACTIONAL_PART(media->origin.y + ((sine_table[media->current_direction]*media->current_magnitude)>>TRIG_SHIFT)); } } return; } void get_media_detonation_effect( short media_index, short type, short *detonation_effect) { struct media_data *media= get_media_data(media_index); struct media_definition *definition= get_media_definition(media->type); if (type!=NONE) { assert(type>=0 && typedetonation_effects[type]!=NONE) *detonation_effect= definition->detonation_effects[type]; } return; } short get_media_sound( short media_index, short type) { struct media_data *media= get_media_data(media_index); struct media_definition *definition= get_media_definition(media->type); assert(type>=0 && typesounds[type]; } struct damage_definition *get_media_damage( short media_index, fixed scale) { struct media_data *media= get_media_data(media_index); struct media_definition *definition= get_media_definition(media->type); struct damage_definition *damage= &definition->damage; damage->scale= scale; return (damage->type==NONE || (dynamic_world->tick_count&definition->damage_frequency)) ? (struct damage_definition *) NULL : damage; } short get_media_submerged_fade_effect( short media_index) { struct media_data *media= get_media_data(media_index); struct media_definition *definition= get_media_definition(media->type); return definition->submerged_fade_effect; } #ifdef DEBUG struct media_data *get_media_data( short media_index) { struct media_data *media; vassert(media_index>=0&&media_index=0&&typetype); /* update height */ media->height= (media->low + FIXED_INTEGERAL_PART((media->high-media->low)*get_light_intensity(media->light_index))); /* update texture */ media->texture= BUILD_DESCRIPTOR(definition->collection, definition->shape); media->transfer_mode= definition->transfer_mode; #if 0 if (force_update || !(dynamic_world->tick_count&definition->shape_frequency)) { shape_descriptor texture; do { texture= BUILD_DESCRIPTOR(definition->collection, definition->shape + random()%definition->shape_count); } while (definition->shape_count>1 && texture==media->texture); media->texture= BUILD_DESCRIPTOR(definition->collection, definition->shape); media->transfer_mode= definition->transfer_mode; } #endif return; } -------------------------------------------------------------------------------- /marathon2/mouse.c: -------------------------------------------------------------------------------- 1 | /* MOUSE.C Tuesday, January 17, 1995 2:51:59 PM (Jason') */ /* marathon includes */ #include "macintosh_cseries.h" #include "world.h" #include "map.h" #include "player.h" // for get_absolute_pitch_range() #include "mouse.h" #include "shell.h" #include /* macintosh includes */ #include #include #ifdef mpwc #pragma segment input #endif /* constants */ #define _CursorADBDispatch 0xaadb #define CENTER_MOUSE_X 320 #define CENTER_MOUSE_Y 240 static void get_mouse_location(Point *where); static void set_mouse_location(Point where); static CursorDevicePtr find_mouse_device(void); static boolean trap_available(short trap_num); static TrapType get_trap_type(short trap_num); static short num_toolbox_traps(void); extern pascal OSErr CrsrDevNextDevice(CursorDevicePtr *ourDevice) TWOWORDINLINE(0x700B, 0xAADB); extern pascal OSErr CrsrDevMoveTo(CursorDevicePtr ourDevice, long absX, long absY) TWOWORDINLINE(0x7001, 0xAADB); #define MBState *((byte *)0x0172) #define RawMouse *((Point *)0x082c) #define MTemp *((Point *)0x0828) #define CrsrNewCouple *((short *)0x08ce) /* ---------- globals */ static CursorDevicePtr mouse_device; static fixed snapshot_delta_yaw, snapshot_delta_pitch, snapshot_delta_velocity; static boolean snapshot_button_state; /* ---------- code */ void enter_mouse( short type) { #pragma unused (type) mouse_device= find_mouse_device(); /* will use cursor device manager if non-NULL */ #ifndef env68k vwarn(mouse_device, "no valid mouse/trackball device;g;"); /* must use cursor device manager on non-68k */ #endif snapshot_delta_yaw= snapshot_delta_pitch= snapshot_delta_velocity= FALSE; snapshot_button_state= FALSE; return; } void test_mouse( short type, long *action_flags, fixed *delta_yaw, fixed *delta_pitch, fixed *delta_velocity) { #pragma unused (type) if (snapshot_button_state) *action_flags|= _left_trigger_state; *delta_yaw= snapshot_delta_yaw; *delta_pitch= snapshot_delta_pitch; *delta_velocity= snapshot_delta_velocity; return; } boolean mouse_available( short type) { #pragma unused (type) return TRUE; } void exit_mouse( short type) { #pragma unused (type) return; } /* 1200 pixels per second is the highest possible mouse velocity */ #define MAXIMUM_MOUSE_VELOCITY (1200/MACINTOSH_TICKS_PER_SECOND) //#define MAXIMUM_MOUSE_VELOCITY ((float)1500/MACINTOSH_TICKS_PER_SECOND) /* take a snapshot of the current mouse state */ void mouse_idle( short type) { Point where; Point center; static long last_tick_count; long tick_count= TickCount(); long ticks_elapsed= tick_count-last_tick_count; get_mouse_location(&where); center.h= CENTER_MOUSE_X, center.v= CENTER_MOUSE_Y; set_mouse_location(center); if (ticks_elapsed) { /* calculate axis deltas */ fixed vx= INTEGER_TO_FIXED(where.h-center.h)/(ticks_elapsed*MAXIMUM_MOUSE_VELOCITY); fixed vy= - INTEGER_TO_FIXED(where.v-center.v)/(ticks_elapsed*MAXIMUM_MOUSE_VELOCITY); /* pin and do nonlinearity */ vx= PIN(vx, -FIXED_ONE/2, FIXED_ONE/2), vx>>= 1, vx*= (vx<0) ? -vx : vx, vx>>= 14; vy= PIN(vy, -FIXED_ONE/2, FIXED_ONE/2), vy>>= 1, vy*= (vy<0) ? -vy : vy, vy>>= 14; // vx= PIN(vx, -FIXED_ONE/2, FIXED_ONE/2); // vy= PIN(vy, -FIXED_ONE/2, FIXED_ONE/2); snapshot_delta_yaw= vx; switch (type) { case _mouse_yaw_pitch: snapshot_delta_pitch= vy, snapshot_delta_velocity= 0; break; case _mouse_yaw_velocity: snapshot_delta_velocity= vy, snapshot_delta_pitch= 0; break; default: halt(); } snapshot_button_state= Button(); last_tick_count= tick_count; // dprintf("%08x %08x %08x;g;", snapshot_delta_yaw, snapshot_delta_pitch, snapshot_delta_velocity); } return; } /* ---------- private code */ // unused static void get_mouse_location( Point *where) { if (mouse_device) { where->h = mouse_device->whichCursor->where.h; where->v = mouse_device->whichCursor->where.v; } else { *where= RawMouse; // GetMouse(where); // LocalToGlobal(where); } return; } static void set_mouse_location( Point where) { if (mouse_device) { CrsrDevMoveTo(mouse_device, where.h, where.v); } #ifdef env68k else { RawMouse= where; MTemp= where; CrsrNewCouple= 0xffff; } #endif return; } static CursorDevicePtr find_mouse_device( void) { CursorDevicePtr device= (CursorDevicePtr) NULL; if (trap_available(_CursorADBDispatch)) { do { CrsrDevNextDevice(&device); } while (device && device->devClass!=kDeviceClassMouse && device->devClass!=kDeviceClassTrackball); } return device; } /* ---------- from IM */ static boolean trap_available(short trap_num) { TrapType type; type = get_trap_type(trap_num); if (type == ToolTrap) trap_num &= 0x07ff; if (trap_num > num_toolbox_traps()) trap_num = _Unimplemented; return NGetTrapAddress(trap_num, type) != NGetTrapAddress(_Unimplemented, ToolTrap); } #define TRAP_MASK 0x0800 static TrapType get_trap_type(short trap_num) { if ((trap_num & TRAP_MASK) > 0) return ToolTrap; else return OSTrap; } static short num_toolbox_traps(void) { if (NGetTrapAddress(_InitGraf, ToolTrap) == NGetTrapAddress(0xaa6e, ToolTrap)) return 0x0200; else return 0x0400; } -------------------------------------------------------------------------------- /marathon2/network_stream.c: -------------------------------------------------------------------------------- 1 | /* network_stream.c Saturday, September 30, 1995 1:24:52 AM- rdm created. The goal of this file is to have a high-level stream interface that can be integrated into future products. Definition: Stream- A method of communications that guarantees accurate, inorder delivery. This implies ADSP for network transports, and some form of xmodem/something for modem connections. */ #include "macintosh_cseries.h" #include "macintosh_network.h" #include "network_modem.h" #include "network_stream.h" #include "shell.h" //--> only for system_information! #ifdef mpwc #pragma segment network_modem #endif // #define USE_MODEM static short transport_type= kNetworkTransportType; static ConnectionEndPtr dspConnection; /* our adsp connection */ static AddrBlock adsp_end_address; /* ----- local prototypes */ static OSErr stream_write(void *data, word length); static OSErr stream_read(void *data, word *length); /* ------ code */ OSErr NetSendStreamPacket( short packet_type, void *packet_data) { OSErr error; word packet_length; packet_length= NetStreamPacketLength(packet_type); error= stream_write(&packet_type, sizeof(short)); if(!error) { error= stream_write(packet_data, packet_length); } return error; } OSErr NetReceiveStreamPacket( short *packet_type, void *buffer) /* Must be large enough for the biggest packet type.. */ { OSErr error; word length; length= sizeof(short); error= stream_read(packet_type, &length); if(!error) { length= NetStreamPacketLength(*packet_type); error= stream_read(buffer, &length); } return error; } OSErr NetOpenStreamToPlayer( short player_index) { OSErr error; switch(transport_type) { case kNetworkTransportType: error= NetADSPOpenConnection(dspConnection, NetGetPlayerADSPAddress(player_index)); break; case kModemTransportType: #ifdef USE_MODEM assert(player_index<2); /* Only two players with a modem connection! */ error= noErr; break; #endif default: halt(); break; } return error; } OSErr NetCloseStreamConnection( boolean abort) { OSErr error; switch(transport_type) { case kNetworkTransportType: error= NetADSPCloseConnection(dspConnection, abort); break; case kModemTransportType: #ifdef USE_MODEM error= noErr; break; #endif default: halt(); break; } return error; } OSErr NetStreamEstablishConnectionEnd( void) { OSErr error; switch(transport_type) { case kNetworkTransportType: error= NetADSPEstablishConnectionEnd(&dspConnection); break; case kModemTransportType: #ifdef USE_MODEM initialize_modem_endpoint(); break; #endif default: halt(); break; } return error; } OSErr NetStreamDisposeConnectionEnd( void) { OSErr error; switch(transport_type) { case kNetworkTransportType: error= NetADSPDisposeConnectionEnd(dspConnection); break; case kModemTransportType: #ifdef USE_MODEM teardown_modem_endpoint(); error= noErr; break; #endif default: halt(); break; } return error; } short NetGetTransportType( void) { return transport_type; } void NetSetTransportType( short type) { assert(type>=0 && typesocketNum; } boolean NetTransportAvailable( short type) { boolean available; switch(type) { case kNetworkTransportType: available= system_information->appletalk_is_available; break; case kModemTransportType: #ifdef USE_MODEM available= modem_available(); break; #else available= FALSE; #endif break; default: halt(); break; } return available; } /* ------------ code for stream implementations */ static OSErr stream_write( void *data, word length) { OSErr error; switch(transport_type) { case kNetworkTransportType: error= NetADSPWrite(dspConnection, data, &length); break; case kModemTransportType: #ifdef USE_MODEM error= write_modem_endpoint(data, length, kNoTimeout); break; #endif default: halt(); break; } return error; } static OSErr stream_read( void *data, word *length) { OSErr error; switch(transport_type) { case kNetworkTransportType: error= NetADSPRead(dspConnection, data, length); break; case kModemTransportType: #ifdef USE_MODEM error= read_modem_endpoint(data, *length, kNoTimeout); break; #endif default: halt(); break; } return error; } -------------------------------------------------------------------------------- /marathon2/extract/sndextract.c: -------------------------------------------------------------------------------- 1 | /* NORESNAMES.C Saturday, July 3, 1993 8:19:20 AM */ #include "macintosh_cseries.h" #include "byte_swapping.h" #include #include "::world.h" #include "::sound.h" #define STATIC_DEFINITIONS #include "::sound_definitions.h" /* ---------- macros */ #define ALIGN_LONG(x) ((((x)-1)&0xfffffffc)+4) /* ---------- private code */ static void build_sounds_file(char *destination_filename, short source_count, char **source_filenames); static void extract_sound_resources(FILE *stream, long *definition_offset, short base_resource, struct sound_definition *original_definitions, struct sound_definition *working_definitions); /* ---------- code */ void main( int argc, char **argv) { if (argc<=2) { fprintf(stderr, "Usage: %s \n", argv[0]); exit(1); } else { build_sounds_file(argv[1], argc-2, argv+2); } exit(0); } /* ---------- private code */ void build_sounds_file( char *destination_filename, short source_count, char **source_filenames) { FILE *stream= fopen(destination_filename, "wb"); if (stream) { struct sound_definition *original_definitions, *working_definitions; long definition_offset= sizeof(struct sound_file_header); short source; original_definitions= malloc(NUMBER_OF_SOUND_DEFINITIONS*sizeof(struct sound_definition)); working_definitions= malloc(NUMBER_OF_SOUND_DEFINITIONS*sizeof(struct sound_definition)); assert(original_definitions && working_definitions); // write the file header and enough room for each of the sound_definition arrays { struct sound_file_header header; short source_index; memset(&header, 0, sizeof(struct sound_file_header)); header.version= SOUND_FILE_VERSION; header.tag= SOUND_FILE_TAG; header.source_count= source_count; header.sound_count= NUMBER_OF_SOUND_DEFINITIONS; fwrite(&header, sizeof(struct sound_file_header), 1, stream); for (source_index= 0; source_indexsound_code==NONE) { definition->permutations= 0; } else { short permutations; definition->group_offset= ftell(stream); definition->total_length= 0; for (permutations= 0; permutationssound_code + permutations + base_resource); if (sound_handle) { ExtSoundHeaderPtr extended_sound_header; SoundHeaderPtr sound_header; long size; HLock(sound_handle); { long offset; GetSoundHeaderOffset((SndListHandle)sound_handle, &offset); sound_header= (SoundHeaderPtr) (*sound_handle+offset); extended_sound_header= (ExtSoundHeaderPtr) sound_header; } switch (sound_header->encode) { case stdSH: size= sizeof(SoundHeader) + sound_header->length; break; case extSH: size= sizeof(ExtSoundHeader) + extended_sound_header->numFrames*(extended_sound_header->sampleSize>>3); break; default: halt(); } size= ALIGN_LONG(size); definition->sound_offsets[permutations]= definition->total_length; fwrite(sound_header, size, 1, stream); definition->total_length+= size; if (!permutations) definition->single_length= definition->total_length; ReleaseResource(sound_handle); } else { break; } } if (!(definition->permutations= permutations)) { if (!original_definitions) { definition->sound_code= NONE; } else { // if this is an alternate source copy missing sounds from the primary source *definition= original_definitions[i]; } } } } fseek(stream, *definition_offset, SEEK_SET); fwrite(working_definitions, sizeof(struct sound_definition), NUMBER_OF_SOUND_DEFINITIONS, stream); *definition_offset+= NUMBER_OF_SOUND_DEFINITIONS*sizeof(struct sound_definition); return; } -------------------------------------------------------------------------------- /marathon2/wad_prefs_macintosh.c: -------------------------------------------------------------------------------- 1 | /* macintosh_wad_prefs.c Tuesday, August 29, 1995 3:53:22 PM- rdm created. */ #include "macintosh_cseries.h" #include "cseries.h" #include #include "map.h" #include "wad.h" #include "game_errors.h" #include "shell.h" // for refPREFERENCES_DIALOG only #include "wad_prefs.h" extern struct preferences_info *prefInfo; /* ------------------ non portable code! */ static boolean handle_switch(DialogPtr dialog, struct preferences_dialog_data *funcs, void **prefs, short new_section, short old_section); static pascal Boolean preferences_filter_proc(DialogPtr dialog, EventRecord *event, short *item_hit); enum { dlogPREFERENCES_DIALOG= 4000, /* iOK */ /* iCANCEL */ iPREF_SECTION_POPUP= 3, NUMBER_VALID_PREF_ITEMS= 8 }; /* -------------- Preferences Dialog --------- */ /* Kick ass, take names */ boolean set_preferences( struct preferences_dialog_data *funcs, short count, void (*reload_function)(void)) { DialogPtr dialog; short index, current_pref_section, item_type, item_hit; Rect bounds; ControlHandle preferences_control; struct PopupPrivateData **privateHndl; MenuHandle mHandle; void *preferences; short new_value; ModalFilterUPP modal_proc; assert(count); dialog= myGetNewDialog(dlogPREFERENCES_DIALOG, NULL,(WindowPtr) -1, refPREFERENCES_DIALOG); assert(dialog); /* Setup the popup list.. */ GetDItem(dialog, iPREF_SECTION_POPUP, &item_type, (Handle *) &preferences_control, &bounds); assert(preferences_control); privateHndl= (PopupPrivateData **) ((*preferences_control)->contrlData); mHandle= (*privateHndl)->mHandle; /* Append the preferences names to the popup. */ for(index= 0; indexiCANCEL); DisposeRoutineDescriptor(modal_proc); DisposeDialog(dialog); return item_hit==iOK; } /* ------------------ local code */ static boolean handle_switch( DialogPtr dialog, struct preferences_dialog_data *funcs, void **prefs, short new_section, short old_section) { boolean able_to_switch= TRUE; /* Call the cleanup routines.. */ if(old_section != NONE) { able_to_switch= funcs[old_section].teardown_dialog_func(dialog, NUMBER_VALID_PREF_ITEMS, *prefs); if(able_to_switch) { short number_items= CountDITL(dialog)-NUMBER_VALID_PREF_ITEMS; /* Remove the old ones. */ ShortenDITL(dialog, number_items); } } if(able_to_switch) { Handle theDITL; /* Add the data from the dialog... */ theDITL= GetResource('DITL', funcs[new_section].ditl_id); assert(theDITL); /* Append it.. */ AppendDITL(dialog, theDITL, overlayDITL); /* Free the memory */ ReleaseResource(theDITL); *prefs= funcs[new_section].get_data(); /* Called on setup (initialize your fields) */ funcs[new_section].setup_dialog_func(dialog, NUMBER_VALID_PREF_ITEMS, *prefs); } return able_to_switch; } static pascal Boolean preferences_filter_proc( DialogPtr dialog, EventRecord *event, short *item_hit) { short item_type, value, new_value; ControlHandle preferences_control; Rect bounds; boolean handled= FALSE; GetDItem(dialog, iPREF_SECTION_POPUP, &item_type, (Handle *) &preferences_control, &bounds); new_value= value= GetCtlValue(preferences_control); switch(event->what) { case keyDown: case autoKey: switch(event->message & charCodeMask) { case kPAGE_UP: new_value= value-1; break; case kPAGE_DOWN: new_value= value+1; break; case kHOME: new_value= 1; break; case kEND: new_value= 45; break; } new_value= PIN(new_value, 1, GetCtlMax(preferences_control)-1); if(new_value != value) { SetCtlValue(preferences_control, new_value); *item_hit= iPREF_SECTION_POPUP; event->what= nullEvent; handled= TRUE; } break; } if(!handled) { handled= general_filter_proc(dialog, event, item_hit); } return handled; } -------------------------------------------------------------------------------- /marathon2/wad_prefs.c: -------------------------------------------------------------------------------- 1 | /* wad_prefs.c Wednesday, March 22, 1995 12:08:47 AM- rdm created. */ #include "cseries.h" #include #include "map.h" #include "wad.h" #include "game_errors.h" // #include "shell.h" // for refPREFERENCES_DIALOG only #include "wad_prefs.h" #ifdef mpwc #pragma segment file_io #endif /* ------ local defines */ #define CURRENT_PREF_WADFILE_VERSION 0 /* ------ local globals */ struct preferences_info *prefInfo= NULL; /* ------ local prototypes */ static void load_preferences(void); /* ------------ Entry point */ /* Open the file, and allocate whatever internal structures are necessary in the */ /* preferences pointer.. */ boolean w_open_preferences_file( char *prefName, unsigned long preferences_file_type) // ostype for mac, extension for dos { FileError error; boolean success= TRUE; /* allocate space for our global structure to keep track of the prefs file */ prefInfo= (struct preferences_info *) malloc(sizeof(struct preferences_info)); if (prefInfo) { /* Clear memory */ memset(prefInfo, 0, sizeof(struct preferences_info)); memcpy(prefInfo->pref_file.name, prefName, *prefName+1); /* check for the preferences folder using FindFolder, creating it if necessary */ find_preferences_location(&prefInfo->pref_file); /* does the preferences file exist? */ load_preferences(); /* Uses prefInfo.. */ if(error_pending()) { short type; error= get_game_error(&type); if(type==systemError) { switch(error) { case errFileNotFound: // to be portable! error= create_file(&prefInfo->pref_file, preferences_file_type); if (!error) { prefInfo->wad= create_empty_wad(); set_game_error(systemError, error); w_write_preferences_file(); } break; case errNone: default: /* Errors besides fnfErr and noErr get returned. */ break; } set_game_error(systemError, error); } else { /* Something was invalid.. */ error= delete_file(&prefInfo->pref_file); if(!error) { prefInfo->wad= create_empty_wad(); set_game_error(systemError, error); w_write_preferences_file(); } set_game_error(systemError, errNone); } } } else { set_game_error(systemError, memory_error()); } if (error) { /* if something is broken, make sure we at least return valid prefs */ if(prefInfo && !prefInfo->wad) prefInfo->wad= create_empty_wad(); } /* Gotta bail... */ if(!prefInfo || !prefInfo->wad) { success= FALSE; } // dump_wad(prefInfo->wad); return success; } /* Caller should assert this. */ void *w_get_data_from_preferences( WadDataType tag, /* Tag to read */ short expected_size, /* Data size */ void (*initialize)(void *prefs), /* Call if I have to allocate it.. */ boolean (*validate)(void *prefs)) /* Verify function-> fixes if bad and returns TRUE */ { void *data; long length; assert(prefInfo->wad); data= extract_type_from_wad(prefInfo->wad, tag, &length); /* If we got the data, but it was the wrong size, or we didn't get the data... */ if((data && length != expected_size) || (!data)) { /* I have a copy of this pointer in the wad-> it's okay to do this */ data= malloc(expected_size); if(data) { /* Initialize it */ initialize(data); /* Append it to the file, for writing out.. */ append_data_to_wad(prefInfo->wad, tag, data, expected_size, 0); /* Free our private pointer */ free(data); /* Return the real one. */ data= extract_type_from_wad(prefInfo->wad, tag, &length); } } if(data) { /* Only call the validation function if it is present. */ if(validate && validate(data)) { char *new_data; /* We can't hand append_data_to_wad a copy of the data pointer it */ /* contains */ new_data= malloc(expected_size); assert(new_data); memcpy(new_data, data, expected_size); /* Changed in the validation. Save to our wad. */ append_data_to_wad(prefInfo->wad, tag, new_data, expected_size, 0); /* Free the new copy */ free(new_data); /* And reextract the pointer.... */ data= extract_type_from_wad(prefInfo->wad, tag, &length); } } return data; } void w_write_preferences_file( void) { struct wad_header header; fileref refNum; /* We can be called atexit. */ if(error_pending()) { set_game_error(systemError, errNone); } assert(!error_pending()); refNum= open_wad_file_for_writing(&prefInfo->pref_file); if(!error_pending()) { struct directory_entry entry; assert(refNum!=NONE); fill_default_wad_header(&prefInfo->pref_file, CURRENT_WADFILE_VERSION, CURRENT_PREF_WADFILE_VERSION, 1, 0l, &header); if (write_wad_header(refNum, &header)) { long wad_length; long offset= sizeof(struct wad_header); /* Length? */ wad_length= calculate_wad_length(&header, prefInfo->wad); /* Set the entry data..... */ set_indexed_directory_offset_and_length(&header, &entry, 0, offset, wad_length, 0); /* Now write it.. */ if (write_wad(refNum, &header, prefInfo->wad, offset)) { offset+= wad_length; header.directory_offset= offset; if (write_wad_header(refNum, &header) && write_directorys(refNum, &header, &entry)) { /* Success! */ } else { assert(error_pending()); } } else { assert(error_pending()); } /* Since we don't free it, it is opened.. */ } else { assert(error_pending()); } close_wad_file(refNum); } return; } static void load_preferences( void) { fileref refNum; /* If it was already allocated, we are reloading, so free the old one.. */ if(prefInfo->wad) { free_wad(prefInfo->wad); prefInfo->wad= NULL; } refNum= open_wad_file_for_reading(&prefInfo->pref_file); if(!error_pending()) { struct wad_header header; assert(refNum != NONE); /* Read the header from the wad file */ if(read_wad_header(refNum, &header)) { /* Read the indexed wad from the file */ prefInfo->wad= read_indexed_wad_from_file(refNum, &header, 0, FALSE); assert(prefInfo->wad); } /* Close the file.. */ close_wad_file(refNum); } return; } -------------------------------------------------------------------------------- /marathon2/wad.h: -------------------------------------------------------------------------------- 1 | /* WAD.H Thursday, June 30, 1994 10:55:20 PM Sunday, July 3, 1994 5:51:47 PM I wonder if I should include an element size in the entry_header structure... Tuesday, December 13, 1994 4:10:48 PM Included element size in the entry_header for the directory size. The directory is application_specific_directory_data_size+sizeof(struct directory_entry). */ #define PRE_ENTRY_POINT_WADFILE_VERSION 0 #define WADFILE_HAS_DIRECTORY_ENTRY 1 #define WADFILE_SUPPORTS_OVERLAYS 2 #define CURRENT_WADFILE_VERSION (WADFILE_SUPPORTS_OVERLAYS) #define MAXIMUM_DIRECTORY_ENTRIES_PER_FILE 64 #define MAXIMUM_WADFILE_NAME_LENGTH 64 #define MAXIMUM_UNION_WADFILES 16 #define MAXIMUM_OPEN_WADFILES 3 #include "portable_files.h" /* ------------- typedefs */ typedef unsigned long WadDataType; /* ------------- file structures */ struct wad_header { /* 128 bytes */ short version; /* Used internally */ short data_version; /* Used by the data.. */ char file_name[MAXIMUM_WADFILE_NAME_LENGTH]; unsigned long checksum; long directory_offset; short wad_count; short application_specific_directory_data_size; short entry_header_size; short directory_entry_base_size; unsigned long parent_checksum; /* If non-zero, this is the checksum of our parent, and we are simply modifications! */ short unused[20]; }; struct old_directory_entry { /* 8 bytes */ long offset_to_start; /* From start of file */ long length; /* Of total level */ }; struct directory_entry { /* 10 bytes */ long offset_to_start; /* From start of file */ long length; /* Of total level */ short index; /* For inplace modification of the wadfile! */ }; struct old_entry_header { /* 12 bytes */ WadDataType tag; long next_offset; /* From current file location-> ie directory_entry.offset_to_start+next_offset */ long length; /* Of entry */ /* Element size? */ /* Data follows */ }; struct entry_header { /* 16 bytes */ WadDataType tag; long next_offset; /* From current file location-> ie directory_entry.offset_to_start+next_offset */ long length; /* Of entry */ long offset; /* Offset for inplace expansion of data */ /* Element size? */ /* Data follows */ }; /* ---------- Memory Data structures ------------ */ struct tag_data { WadDataType tag; /* What type of data is this? */ byte *data; /* Offset into the wad.. */ long length; /* Length of the data */ long offset; /* Offset for patches */ }; /* This is what a wad * actually is.. */ struct wad_data { short tag_count; /* Tag count */ short padding; byte *read_only_data; /* If this is non NULL, we are read only.... */ struct tag_data *tag_data; /* Tag data array */ }; /* ----- miscellaneous functions */ boolean wad_file_has_checksum(FileDesc *file, unsigned long checksum); boolean wad_file_has_parent_checksum(FileDesc *file, unsigned long parent_checksum); /* Find out how many wads there are in the map */ short number_of_wads_in_file(FileDesc *file); /* returns -1 on error */ /* ----- Open/Close functions */ /* Should be OSType, or extension for dos. */ FileError create_wadfile(FileDesc *file, unsigned long file_type); fileref open_wad_file_for_reading(FileDesc *file); fileref open_wad_file_for_writing(FileDesc *file); void close_wad_file(fileref file_id); /* ----- Hardware dependent functions (From macintosh_wad.c) */ FileError find_other_entries_that_reference_checksum(unsigned long checksum, FileDesc *files_array, short *count); /* ----- Read File functions */ /* Read the header from the wad file */ boolean read_wad_header(fileref file_id, struct wad_header *header); /* Read the indexed wad from the file */ struct wad_data *read_indexed_wad_from_file(fileref file_id, struct wad_header *header, short index, boolean read_only); /* Properly deal with the memory.. */ void free_wad(struct wad_data *wad); long get_size_of_directory_data(struct wad_header *header); /* ----- Read Wad functions */ /* Given a wad, extract the given tag from it */ void *extract_type_from_wad(struct wad_data *wad, WadDataType type, long *length); /* Calculate the length of the wad */ long calculate_wad_length(struct wad_header *file_header, struct wad_data *wad); /* Note wad_count and directory offset in the header! better be correct! */ void *get_indexed_directory_data(struct wad_header *header, short index, void *directories); void *read_directory_data(short file_ref, struct wad_header *header); unsigned long read_wad_file_checksum(FileDesc *file); unsigned long read_wad_file_parent_checksum(FileDesc *file); boolean find_wad_file_that_has_checksum(FileDesc *matching_file, unsigned long file_type, short path_resource_id, unsigned long checksum); /* Added in here for simplicity. Really should be somewhere else.. */ boolean find_file_with_modification_date(FileDesc *matching_file, unsigned long file_type, short path_resource_id, unsigned long modification_date); #ifdef mac /* Handy function to have. Given the fsspec of a directory, returns the id needed */ /* to search inside it.. */ OSErr get_directories_parID(FSSpec *directory, long *parID); #endif /* ------------ Flat wad functions */ /* These functions are used for transferring data, and it completely encapsulates */ /* a given wad from a given file... */ void *get_flat_data(FileDesc *base_file, boolean use_union, short wad_index); long get_flat_data_length(void *data); /* This is how you dispose of it-> you inflate it, then use free_wad() */ struct wad_data *inflate_flat_data(void *data, struct wad_header *header); /* ------------ Union wad functions */ /* Both of these return 0 on error */ fileref open_union_wad_file_for_reading(FileDesc *base_file); fileref open_union_wad_file_for_reading_by_list(FileDesc *files, short count); /* ------------ Write File functions */ struct wad_data *create_empty_wad(void); void fill_default_wad_header(FileDesc *file, short wadfile_version, short data_version, short wad_count, short application_directory_data_size, struct wad_header *header); boolean write_wad_header(fileref file_id, struct wad_header *header); boolean write_directorys(fileref file_id, struct wad_header *header, void *entries); void calculate_and_store_wadfile_checksum(fileref file_id); boolean write_wad(fileref file_id, struct wad_header *file_header, struct wad_data *wad, long offset); void set_indexed_directory_offset_and_length(struct wad_header *header, void *entries, short index, long offset, long length, short wad_index); /* ------ Write Wad Functions */ struct wad_data *append_data_to_wad( struct wad_data *wad, WadDataType type, void *data, long size, long offset); void remove_tag_from_wad(struct wad_data *wad, WadDataType type); /* ------- debug function */ void dump_wad(struct wad_data *wad); -------------------------------------------------------------------------------- /marathon2/platform_definitions.h: -------------------------------------------------------------------------------- 1 | /* PLATFORM_DEFINITIONS.H Monday, June 26, 1995 9:43:22 AM (Jason) */ /* ---------- constants */ enum /* sound codes for play_platform_sound() */ { _stopping_sound, _starting_sound, _obstructed_sound, _uncontrollable_sound }; /* ---------- structures */ struct platform_definition { /* sounds; specific sounds are played if they can be (i.e., ...at_bottom) otherwise the general sound is played */ short starting_extension, starting_contraction; short stopping_extension, stopping_contraction; short obstructed_sound, uncontrollable_sound; short moving_sound; short key_item_index; struct static_platform_data defaults; struct damage_definition damage; }; /* ---------- definitions */ struct platform_definition platform_definitions[NUMBER_OF_PLATFORM_TYPES]= { { // _platform_is_spht_door _snd_spht_door_opening, _snd_spht_door_closing, NONE, NONE, _snd_spht_door_obstructed, _snd_spht_door_obstructed, _ambient_snd_spht_door, NONE, /* key item index */ { /* defaults */ _platform_is_spht_door, _fast_platform, _very_long_delay_platform, NONE, NONE, FLAG(_platform_deactivates_at_initial_level) | FLAG(_platform_extends_floor_to_ceiling) | FLAG(_platform_is_player_controllable) | FLAG(_platform_is_monster_controllable) | FLAG(_platform_reverses_direction_when_obstructed) | FLAG(_platform_is_initially_extended) | FLAG(_platform_comes_from_ceiling) | FLAG(_platform_is_door) }, {_damage_crushing, 0, 30, 10, FIXED_ONE} /* damage, if necessary */ }, { // _platform_is_split_spht_door _snd_spht_door_opening, _snd_spht_door_closing, NONE, NONE, _snd_spht_door_obstructed, _snd_spht_door_obstructed, _ambient_snd_spht_door, NONE, /* key item index */ { /* defaults */ _platform_is_spht_split_door, _slow_platform, _very_long_delay_platform, NONE, NONE, FLAG(_platform_deactivates_at_initial_level) | FLAG(_platform_extends_floor_to_ceiling) | FLAG(_platform_is_player_controllable) | FLAG(_platform_is_monster_controllable) | FLAG(_platform_reverses_direction_when_obstructed) | FLAG(_platform_comes_from_floor) | FLAG(_platform_comes_from_ceiling) | FLAG(_platform_is_initially_extended) | FLAG(_platform_is_door) }, {_damage_crushing, 0, 5, 4, FIXED_ONE} }, { // _platform_is_locked_spht_door _snd_spht_door_opening, _snd_spht_door_closing, NONE, NONE, _snd_spht_door_obstructed, _snd_spht_door_obstructed, _ambient_snd_spht_door, NONE, /* key item index */ { /* defaults */ _platform_is_locked_spht_door, _slow_platform, _very_long_delay_platform, NONE, NONE, FLAG(_platform_deactivates_at_initial_level) | FLAG(_platform_extends_floor_to_ceiling) | FLAG(_platform_is_player_controllable) | FLAG(_platform_is_monster_controllable) | FLAG(_platform_reverses_direction_when_obstructed) | FLAG(_platform_comes_from_floor) | FLAG(_platform_comes_from_ceiling) | FLAG(_platform_is_initially_extended) | FLAG(_platform_is_door) }, {_damage_crushing, 0, 5, 4, FIXED_ONE} }, { // _platform_is_spht_platform NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, /* key item index */ { /* defaults */ _platform_is_spht_platform, _slow_platform, _long_delay_platform, NONE, NONE, FLAG(_platform_is_initially_active) | FLAG(_platform_is_initially_extended) | FLAG(_platform_comes_from_floor) | FLAG(_platform_reverses_direction_when_obstructed) }, {_damage_crushing, 0, 30, 10, FIXED_ONE} /* damage, if necessary */ }, { // _platform_is_noisy_spht_platform _snd_spht_platform_starting, _snd_spht_platform_starting, _snd_spht_platform_stopping, _snd_spht_platform_stopping, _snd_spht_platform_stopping, NONE, _ambient_snd_spht_platform, NONE, /* key item index */ { /* defaults */ _platform_is_noisy_spht_platform, _slow_platform, _long_delay_platform, NONE, NONE, FLAG(_platform_is_initially_active) | FLAG(_platform_is_initially_extended) | FLAG(_platform_comes_from_floor) | FLAG(_platform_reverses_direction_when_obstructed) }, {_damage_crushing, 0, 30, 10, FIXED_ONE} /* damage, if necessary */ }, { // _platform_is_heavy_spht_door _snd_heavy_spht_door_closing, _snd_heavy_spht_door_opening, _snd_heavy_spht_door_closed, _snd_heavy_spht_door_open, _snd_heavy_spht_door_obstructed, _snd_heavy_spht_door_obstructed, _ambient_snd_heavy_spht_door, NONE, /* key item index */ { /* defaults */ _platform_is_heavy_spht_door, _slow_platform, _very_long_delay_platform, NONE, NONE, FLAG(_platform_deactivates_at_initial_level) | FLAG(_platform_extends_floor_to_ceiling) | FLAG(_platform_is_player_controllable) | FLAG(_platform_is_monster_controllable) | FLAG(_platform_reverses_direction_when_obstructed) | FLAG(_platform_comes_from_ceiling) | FLAG(_platform_is_initially_extended) | FLAG(_platform_is_door) }, {_damage_crushing, 0, 5, 4, FIXED_ONE} }, { // pfhor door _snd_pfhor_door_opening, _snd_pfhor_door_closing, NONE, NONE, _snd_pfhor_door_obstructed, _snd_pfhor_door_obstructed, _ambient_snd_pfhor_door, NONE, /* key item index */ { /* defaults */ _platform_is_pfhor_door, _fast_platform, _very_long_delay_platform, NONE, NONE, FLAG(_platform_deactivates_at_initial_level) | FLAG(_platform_extends_floor_to_ceiling) | FLAG(_platform_is_player_controllable) | FLAG(_platform_is_monster_controllable) | FLAG(_platform_reverses_direction_when_obstructed) | FLAG(_platform_is_initially_extended) | FLAG(_platform_comes_from_ceiling) | FLAG(_platform_is_door) }, {_damage_crushing, 0, 30, 10, FIXED_ONE} /* damage, if necessary */ }, { // _platform_is_heavy_spht_platform _snd_heavy_spht_platform_starting, _snd_heavy_spht_platform_starting, _snd_heavy_spht_platform_stopping, _snd_heavy_spht_platform_stopping, _snd_heavy_spht_platform_stopping, NONE, _ambient_snd_heavy_spht_platform, NONE, /* key item index */ { /* defaults */ _platform_is_heavy_spht_platform, _slow_platform, _long_delay_platform, NONE, NONE, FLAG(_platform_is_initially_active) | FLAG(_platform_is_initially_extended) | FLAG(_platform_comes_from_floor) | FLAG(_platform_reverses_direction_when_obstructed), }, {_damage_crushing, 0, 5, 4, FIXED_ONE} }, { // pfhor platform _snd_pfhor_platform_starting, _snd_pfhor_platform_starting, _snd_pfhor_platform_stopping, _snd_pfhor_platform_stopping, _snd_pfhor_platform_stopping, NONE, _ambient_snd_pfhor_platform, NONE, /* key item index */ { /* defaults */ _platform_is_pfhor_platform, _slow_platform, _long_delay_platform, NONE, NONE, FLAG(_platform_is_initially_active) | FLAG(_platform_is_initially_extended) | FLAG(_platform_comes_from_floor) | FLAG(_platform_reverses_direction_when_obstructed) }, {_damage_crushing, 0, 30, 10, FIXED_ONE} /* damage, if necessary */ }, }; -------------------------------------------------------------------------------- /marathon2/overhead_map_macintosh.c: -------------------------------------------------------------------------------- 1 | /* OVERHEAD_MAP_MAC.C Monday, August 28, 1995 1:41:36 PM (Jason) */ /* ---------- private code */ #define NUMBER_OF_POLYGON_COLORS (sizeof(polygon_colors)/sizeof(RGBColor)) static RGBColor polygon_colors[]= { {0, 12000, 0}, {30000, 0, 0}, {14*256, 37*256, 63*256}, {76*256, 27*256, 0}, {137*256, 0, 137*256}, {70*256, 90*256, 0}, {32768, 32768, 0} }; static void draw_overhead_polygon( short vertex_count, short *vertices, short color, short scale) { PolyHandle polygon; world_point2d *vertex; short i; #pragma unused (scale) assert(color>=0&&colortransformed; MoveTo(vertex->x, vertex->y); for (i=0;itransformed; LineTo(vertex->x, vertex->y); } ClosePoly(); PenSize(1, 1); RGBForeColor(polygon_colors+color); FillPoly(polygon, &qd.black); KillPoly(polygon); return; } struct line_definition { RGBColor color; short pen_sizes[OVERHEAD_MAP_MAXIMUM_SCALE-OVERHEAD_MAP_MINIMUM_SCALE+1]; }; #define NUMBER_OF_LINE_DEFINITIONS (sizeof(line_definitions)/sizeof(struct line_definition)) struct line_definition line_definitions[]= { {{0, 65535, 0}, {1, 2, 2, 4}}, {{0, 40000, 0}, {1, 1, 1, 2}}, {{65535, 0, 0}, {1, 2, 2, 4}} }; static void draw_overhead_line( short line_index, short color, short scale) { struct line_data *line= get_line_data(line_index); world_point2d *vertex1= &get_endpoint_data(line->endpoint_indexes[0])->transformed; world_point2d *vertex2= &get_endpoint_data(line->endpoint_indexes[1])->transformed; struct line_definition *definition; assert(color>=0&&colorcolor); PenSize(definition->pen_sizes[scale-OVERHEAD_MAP_MINIMUM_SCALE], definition->pen_sizes[scale-OVERHEAD_MAP_MINIMUM_SCALE]); MoveTo(vertex1->x, vertex1->y); LineTo(vertex2->x, vertex2->y); #ifdef RENDER_DEBUG if (scale==OVERHEAD_MAP_MAXIMUM_SCALE) { world_point2d location; TextFont(monaco); TextFace(normal); TextSize(9); RGBForeColor(&rgb_white); location.x= (vertex1->x+vertex2->x)/2; location.y= (vertex1->y+vertex2->y)/2; psprintf(temporary, "%d", line_index); MoveTo(location.x, location.y); DrawString(temporary); psprintf(temporary, "%d", line->endpoint_indexes[0]); MoveTo(vertex1->x, vertex1->y); DrawString(temporary); psprintf(temporary, "%d", line->endpoint_indexes[1]); MoveTo(vertex2->x, vertex2->y); DrawString(temporary); } #endif return; } struct thing_definition { RGBColor color; short shape; short radii[OVERHEAD_MAP_MAXIMUM_SCALE-OVERHEAD_MAP_MINIMUM_SCALE+1]; }; struct thing_definition thing_definitions[NUMBER_OF_THINGS]= { {{0, 0, 65535}, _rectangle_thing, {1, 2, 4, 8}}, /* civilian */ {{65535, 65535, 65535}, _rectangle_thing, {1, 2, 3, 4}}, /* item */ {{65535, 0, 0}, _rectangle_thing, {1, 2, 4, 8}}, /* non-player monster */ {{65535, 65535, 0}, _rectangle_thing, {1, 1, 2, 3}}, /* projectiles */ {{65535, 0, 0}, _circle_thing, {8, 16, 16, 16}} }; static void draw_overhead_thing( world_point2d *center, angle facing, short color, short scale) { Rect bounds; short radius; struct thing_definition *definition; #pragma unused (facing) assert(color>=0&&colorradii[scale-OVERHEAD_MAP_MINIMUM_SCALE]; RGBForeColor(&definition->color); SetRect(&bounds, center->x-(radius>>1), center->y-(radius>>1), center->x+radius, center->y+radius); switch (definition->shape) { case _rectangle_thing: PaintRect(&bounds); break; case _circle_thing: PenSize(2, 2); FrameOval(&bounds); break; default: halt(); } return; } struct entity_definition { short front, rear, rear_theta; }; #define NUMBER_OF_ENTITY_DEFINITIONS (sizeof(entity_definitions)/sizeof(struct entity_definition)) struct entity_definition entity_definitions[]= { {16, 10, (7*NUMBER_OF_ANGLES)/20}, {16, 10, (7*NUMBER_OF_ANGLES)/20}, {16, 10, (7*NUMBER_OF_ANGLES)/20}, {16, 10, (7*NUMBER_OF_ANGLES)/20}, {16, 10, (7*NUMBER_OF_ANGLES)/20}, {16, 10, (7*NUMBER_OF_ANGLES)/20}, {16, 10, (7*NUMBER_OF_ANGLES)/20}, {16, 10, (7*NUMBER_OF_ANGLES)/20}, }; static void draw_overhead_player( world_point2d *center, angle facing, short color, short scale) { short i; PolyHandle polygon; world_point2d triangle[3]; struct entity_definition *definition; RGBColor rgb_color; assert(color>=0&&colorfront>>(OVERHEAD_MAP_MAXIMUM_SCALE-scale), facing); translate_point2d(triangle+1, definition->rear>>(OVERHEAD_MAP_MAXIMUM_SCALE-scale), normalize_angle(facing+definition->rear_theta)); translate_point2d(triangle+2, definition->rear>>(OVERHEAD_MAP_MAXIMUM_SCALE-scale), normalize_angle(facing-definition->rear_theta)); if (scale < 2) { RGBForeColor(&rgb_color); MoveTo(triangle[0].x, triangle[0].y); if (triangle[1].x != triangle[0].x || triangle[1].y != triangle[0].y) LineTo(triangle[1].x, triangle[1].y); else LineTo(triangle[2].x, triangle[2].y); } else { polygon= OpenPoly(); MoveTo(triangle[2].x, triangle[2].y); for (i=0;i<3;++i) LineTo(triangle[i].x, triangle[i].y); ClosePoly(); PenSize(1, 1); RGBForeColor(&rgb_color); FillPoly(polygon, &qd.black); KillPoly(polygon); } return; } struct annotation_definition { RGBColor color; short font, face; short sizes[OVERHEAD_MAP_MAXIMUM_SCALE-OVERHEAD_MAP_MINIMUM_SCALE+1]; }; #define NUMBER_OF_ANNOTATION_DEFINITIONS (sizeof(annotation_definitions)/sizeof(struct annotation_definition)) struct annotation_definition annotation_definitions[]= { {{0, 65535, 0}, monaco, bold, {5, 9, 12, 18}}, }; static void draw_overhead_annotation( world_point2d *location, short color, char *text, short scale) { struct annotation_definition *definition; Str255 pascal_text; vassert(color>=0&&colorx, location->y); TextFont(definition->font); TextFace(definition->face); TextSize(definition->sizes[scale-OVERHEAD_MAP_MINIMUM_SCALE]); RGBForeColor(&definition->color); DrawString(pascal_text); return; } static RGBColor map_name_color= {0, 0xffff, 0}; static void draw_map_name( struct overhead_map_data *data, char *name) { Str255 pascal_name; strcpy(pascal_name, name); c2pstr(pascal_name); TextFont(monaco); TextFace(normal); TextSize(18); RGBForeColor(&map_name_color); MoveTo(data->half_width - (StringWidth(pascal_name)>>1), 25); DrawString(pascal_name); return; } --------------------------------------------------------------------------------