#include <l_main.h>
Public Methods | |
void | read_level (SDL_RWops *const src, tr_version_e game_version) |
reads the level. | |
Public Attributes | |
tr_version_e | game_version |
game engine version. | |
bitu32 | num_textiles |
number of 256x256 textiles. | |
bitu32 | num_room_textiles |
number of 256x256 room textiles (TR4-5). | |
bitu32 | num_obj_textiles |
number of 256x256 object textiles (TR4-5). | |
bitu32 | num_bump_textiles |
number of 256x256 bump textiles (TR4-5). | |
bitu32 | num_misc_textiles |
number of 256x256 misc textiles (TR4-5). | |
std::vector< tr_textile8_t > | textile8 |
8-bit 256x256 textiles(TR1-3). | |
std::vector< tr2_textile16_t > | textile16 |
16-bit 256x256 textiles(TR2-5). | |
std::vector< tr4_textile32_t > | textile32 |
32-bit 256x256 textiles(TR4-5). | |
bool | read_32bit_textiles |
are other 32bit textiles than misc ones read? | |
std::vector< tr5_room_t > | rooms |
all rooms (normal and alternate). | |
std::vector< bitu16 > | floor_data |
the floor data. | |
std::vector< tr4_mesh_t > | meshes |
all meshes (static and moveables). | |
std::vector< bitu32 > | mesh_indices |
mesh index table. | |
std::vector< tr_animation_t > | animations |
animations for moveables. | |
std::vector< tr_state_change_t > | state_changes |
state changes for moveables. | |
std::vector< tr_anim_dispatch_t > | anim_dispatches |
animation dispatches for moveables. | |
std::vector< tr_anim_command_t > | anim_commands |
animation commands for moveables. | |
std::vector< tr_meshtree_t > | mesh_trees |
mesh trees for moveables. | |
std::vector< tr_frame_t > | frames |
frames for moveables. | |
std::vector< tr_moveable_t > | moveables |
data for the moveables. | |
std::vector< tr_staticmesh_t > | static_meshes |
data for the static meshes. | |
std::vector< tr4_object_texture_t > | object_textures |
object texture definitions. | |
std::vector< tr_animated_textures_t > | animated_textures |
animated textures. | |
std::vector< tr_sprite_texture_t > | sprite_textures |
sprite texture definitions. | |
std::vector< tr_sprite_sequence_t > | sprite_sequences |
sprite sequences for animation. | |
std::vector< tr_camera_t > | cameras |
cameras. | |
std::vector< tr4_extra_camera_t > | flyby_cameras |
flyby cameras. | |
std::vector< tr_sound_source_t > | sound_sources |
sound sources. | |
std::vector< tr_box_t > | boxes |
boxes. | |
std::vector< bitu16 > | overlaps |
overlaps. | |
std::vector< bit16 > | zones |
zones. | |
std::vector< tr2_item_t > | items |
items. | |
tr_lightmap_t | lightmap |
ligthmap (TR1-3). | |
tr2_palette_t | palette |
colour palette (TR1-3). | |
tr2_palette_t | palette16 |
colour palette (TR2-3). | |
std::vector< tr4_ai_object_t > | ai_objects |
ai objects (TR4-5). | |
std::vector< tr_cinematic_frame_t > | cinematic_frames |
cinematic frames (TR1-3). | |
std::vector< bitu8 > | demo_data |
demo data. | |
bit16 | soundmap [450] |
soundmap (TR: 256 values TR2-4: 370 values TR5: 450 values). | |
std::vector< tr_sound_details_t > | sound_details |
sound details. | |
std::vector< bitu8 > | samples |
samples. | |
std::vector< bitu32 > | sample_indices |
sample indices. | |
Protected Methods | |
bit8 | read_bit8 (SDL_RWops *const src) |
reads signed 8-bit value. | |
bitu8 | read_bitu8 (SDL_RWops *const src) |
reads unsigned 8-bit value. | |
bit16 | read_bit16 (SDL_RWops *const src) |
reads signed 16-bit value. | |
bitu16 | read_bitu16 (SDL_RWops *const src) |
reads unsigned 16-bit value. | |
bit32 | read_bit32 (SDL_RWops *const src) |
reads signed 32-bit value. | |
bitu32 | read_bitu32 (SDL_RWops *const src) |
reads unsigned 32-bit value. | |
float | read_float (SDL_RWops *const src) |
reads float value. | |
void | read_mesh_data (SDL_RWops *const src) |
reads the mesh data. | |
void | read_frame_moveable_data (SDL_RWops *const src) |
reads frame and moveable data. | |
void | read_tr_colour (SDL_RWops *const src, tr2_colour_t &colour) |
reads rgb colour. | |
void | read_tr_vertex16 (SDL_RWops *const src, tr5_vertex_t &vertex) |
reads three 16-bit vertex components. | |
void | read_tr_vertex32 (SDL_RWops *const src, tr5_vertex_t &vertex) |
reads three 32-bit vertex components. | |
void | read_tr_face3 (SDL_RWops *const src, tr4_face3_t &face) |
reads a triangle definition. | |
void | read_tr_face4 (SDL_RWops *const src, tr4_face4_t &face) |
reads a triangle definition. | |
void | read_tr_textile8 (SDL_RWops *const src, tr_textile8_t &textile) |
reads a 8-bit 256x256 textile. | |
void | read_tr_lightmap (SDL_RWops *const src, tr_lightmap_t &lightmap) |
reads the lightmap. | |
void | read_tr_palette (SDL_RWops *const src, tr2_palette_t &palette) |
reads the 256 colour palette values. | |
void | read_tr_room_sprite (SDL_RWops *const src, tr_room_sprite_t &room_sprite) |
reads a room sprite definition. | |
void | read_tr_room_portal (SDL_RWops *const src, tr_room_portal_t &portal) |
reads a room portal definition. | |
void | read_tr_room_sector (SDL_RWops *const src, tr_room_sector_t &room_sector) |
reads a room sector definition. | |
void | read_tr_room_light (SDL_RWops *const src, tr5_room_light_t &light) |
reads a room light definition. | |
void | read_tr_room_vertex (SDL_RWops *const src, tr5_room_vertex_t &room_vertex) |
reads a room vertex definition. | |
void | read_tr_room_staticmesh (SDL_RWops *const src, tr2_room_staticmesh_t &room_static_mesh) |
reads a room staticmesh definition. | |
void | read_tr_room (SDL_RWops *const src, tr5_room_t &room) |
reads a room definition. | |
void | read_tr_object_texture_vert (SDL_RWops *const src, tr4_object_texture_vert_t &vert) |
reads object texture vertex definition. | |
void | read_tr_object_texture (SDL_RWops *const src, tr4_object_texture_t &object_texture) |
reads object texture definition. | |
void | read_tr_sprite_texture (SDL_RWops *const src, tr_sprite_texture_t &sprite_texture) |
reads sprite texture definition. | |
void | read_tr_sprite_sequence (SDL_RWops *const src, tr_sprite_sequence_t &sprite_sequence) |
reads sprite sequence definition. | |
void | read_tr_mesh (SDL_RWops *const src, tr4_mesh_t &mesh) |
reads mesh definition. | |
void | read_tr_animation (SDL_RWops *const src, tr_animation_t &animation) |
reads an animation definition. | |
void | read_tr_meshtree (SDL_RWops *const src, tr_meshtree_t &meshtree) |
reads a mesh tree value. | |
void | read_tr_frame (SDL_RWops *const src, tr_frame_t &frame, bitu32 num_rotations) |
void | read_tr_moveable (SDL_RWops *const src, tr_moveable_t &moveable) |
reads a moveable definition. | |
void | read_tr_item (SDL_RWops *const src, tr2_item_t &item) |
reads an item definition. | |
void | read_tr_staticmesh (SDL_RWops *const src, tr_staticmesh_t &mesh) |
reads a static mesh definition. | |
void | read_tr_level (SDL_RWops *const src, bool demo_or_ub) |
void | read_tr2_colour4 (SDL_RWops *const src, tr2_colour_t &colour) |
void | read_tr2_palette16 (SDL_RWops *const src, tr2_palette_t &palette16) |
void | read_tr2_textile16 (SDL_RWops *const src, tr2_textile16_t &textile) |
void | read_tr2_room_light (SDL_RWops *const src, tr5_room_light_t &light) |
void | read_tr2_room_vertex (SDL_RWops *const src, tr5_room_vertex_t &room_vertex) |
void | read_tr2_room_staticmesh (SDL_RWops *const src, tr2_room_staticmesh_t &room_static_mesh) |
void | read_tr2_room (SDL_RWops *const src, tr5_room_t &room) |
void | read_tr2_frame (SDL_RWops *const src, tr_frame_t &frame, bitu32 num_rotations) |
void | read_tr2_item (SDL_RWops *const src, tr2_item_t &item) |
void | read_tr2_level (SDL_RWops *const src, bool demo) |
void | read_tr3_room_vertex (SDL_RWops *const src, tr5_room_vertex_t &room_vertex) |
void | read_tr3_room_staticmesh (SDL_RWops *const src, tr2_room_staticmesh_t &room_static_mesh) |
void | read_tr3_room (SDL_RWops *const src, tr5_room_t &room) |
void | read_tr3_item (SDL_RWops *const src, tr2_item_t &item) |
void | read_tr3_level (SDL_RWops *const src) |
void | read_tr4_vertex_float (SDL_RWops *const src, tr5_vertex_t &vertex) |
void | read_tr4_textile32 (SDL_RWops *const src, tr4_textile32_t &textile) |
void | read_tr4_face3 (SDL_RWops *const src, tr4_face3_t &meshface) |
void | read_tr4_face4 (SDL_RWops *const src, tr4_face4_t &meshface) |
void | read_tr4_room_light (SDL_RWops *const src, tr5_room_light_t &light) |
void | read_tr4_room (SDL_RWops *const src, tr5_room_t &room) |
void | read_tr4_object_texture_vert (SDL_RWops *const src, tr4_object_texture_vert_t &vert) |
void | read_tr4_object_texture (SDL_RWops *const src, tr4_object_texture_t &object_texture) |
void | read_tr4_mesh (SDL_RWops *const src, tr4_mesh_t &mesh) |
void | read_tr4_animation (SDL_RWops *const src, tr_animation_t &animation) |
reads an animation definition. | |
void | read_tr4_level (SDL_RWops *const _src) |
void | read_tr5_room_light (SDL_RWops *const src, tr5_room_light_t &light) |
void | read_tr5_room_layer (SDL_RWops *const src, tr5_room_layer_t &layer) |
void | read_tr5_room_vertex (SDL_RWops *const src, tr5_room_vertex_t &vert) |
void | read_tr5_room (SDL_RWops *const orgsrc, tr5_room_t &room) |
void | read_tr5_moveable (SDL_RWops *const src, tr_moveable_t &moveable) |
void | read_tr5_level (SDL_RWops *const src) |
This contains all necessary functions to load a TR level. Some corrections to the data are done, like converting to OpenGLs coordinate system. All indexes are converted, so they can be used directly. Endian conversion is done at the lowest possible layer, most of the time this is in the read_bitxxx functions.
|
reads signed 16-bit value. uses current position from src. does endian correction. throws trxReadError when not successful. |
|
reads signed 32-bit value. uses current position from src. does endian correction. throws trxReadError when not successful. |
|
reads signed 8-bit value. uses current position from src. throws trxReadError when not successful. |
|
reads unsigned 16-bit value. uses current position from src. does endian correction. throws trxReadError when not successful. |
|
reads unsigned 32-bit value. uses current position from src. does endian correction. throws trxReadError when not successful. |
|
reads unsigned 8-bit value. uses current position from src. throws trxReadError when not successful. |
|
reads float value. uses current position from src. does endian correction. throws trxReadError when not successful. |
|
reads the level. Takes a SDL_RWop and the game_version of the file and reads the structures into the members of TR_Level. |
|
reads rgb colour. Reads three rgb colour components. The read 6-bit values get shifted, so they are 8-bit. The alpha value of tr2_colour_t gets set to 0. |
|
reads a triangle definition. The lighting value is set to 0, as it is only in TR4-5. |
|
reads a triangle definition. The lighting value is set to 0, as it is only in TR4-5. |
|
reads mesh definition. The read num_normals value is positive when normals are available and negative when light values are available. The values get set appropiatly. |
|
reads a moveable definition. some sanity checks get done which throw a exception on failure. frame_offset needs to be corrected later in TR_Level::read_tr_level. |
|
reads object texture definition. some sanity checks get done and if they fail an exception gets thrown. all values introduced in TR4 get set appropiatly. |
|
reads a room definition. intensity1 gets converted, so it matches the 0-32768 range introduced in TR3. intensity2 is introduced in TR2 and is set to intensity1 for TR1. light_mode is only in TR2 and is set 0 for TR1. light_colour is only in TR3-4 and gets set appropiatly. |
|
reads a room light definition. intensity1 gets converted, so it matches the 0-32768 range introduced in TR3. intensity2 and fade2 are introduced in TR2 and are set to intensity1 and fade1 for TR1. |
|
reads a room portal definition. A check is preformed to see wether the normal lies on a coordinate axis, if not an exception gets thrown. |
|
reads a room staticmesh definition. rotation gets converted to float and scaled appropiatly. intensity1 gets converted, so it matches the 0-32768 range introduced in TR3. intensity2 is introduced in TR2 and is set to intensity1 for TR1. |
|
reads a room vertex definition. lighting1 gets converted, so it matches the 0-32768 range introduced in TR3. lighting2 is introduced in TR2 and is set to lighting1 for TR1. attributes is introduced in TR2 and is set 0 for TR1. All other values are introduced in TR5 and get set to appropiate values. |
|
reads sprite sequence definition. length is negative when read and thus gets negated. |
|
reads sprite texture definition. some sanity checks get done and if they fail an exception gets thrown. |
|
reads three 16-bit vertex components. The values get converted from bit16 to float. y and z are negated to fit OpenGLs coordinate system. |
|
reads three 32-bit vertex components. The values get converted from bit32 to float. y and z are negated to fit OpenGLs coordinate system. |