Rev 18 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18 | Rev 20 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | #define DR_TYPES_H |
2 | #define DR_TYPES_H |
3 | 3 | ||
- | 4 | #include "brender/br_types.h" |
|
4 | #include "constants.h" |
5 | #include "constants.h" |
5 | #include "macros.h" |
6 | #include "macros.h" |
6 | 7 | ||
7 | #include "brender.h" |
- | |
8 | #include "s3/s3.h" |
8 | #include "s3/s3.h" |
9 | #include <assert.h> |
9 | #include <assert.h> |
10 | #include <stdarg.h> |
10 | #include <stdarg.h> |
11 | #include <stddef.h> |
11 | #include <stddef.h> |
12 | #include <stdint.h> |
12 | #include <stdint.h> |
Line 471... | Line 471... | ||
471 | br_vector3 row1; |
471 | br_vector3 row1; |
472 | br_vector3 row2; |
472 | br_vector3 row2; |
473 | br_vector3 translation; |
473 | br_vector3 translation; |
474 | } tReduced_matrix; |
474 | } tReduced_matrix; |
475 | 475 | ||
476 | typedef struct tCar_controls { |
476 | typedef struct tCar_controls { |
477 | int joystick_acc : 8; |
477 | int joystick_acc : 8; |
478 | int joystick_dec : 8; |
478 | int joystick_dec : 8; |
479 | unsigned int left : 1; // 0x10000 bit 17 |
479 | unsigned int left : 1; // 0x10000 bit 17 |
480 | unsigned int right : 1; // 0x20000 bit 18 |
480 | unsigned int right : 1; // 0x20000 bit 18 |
481 | unsigned int acc : 1; // 0x40000 bit 19 |
481 | unsigned int acc : 1; // 0x40000 bit 19 |
Line 488... | Line 488... | ||
488 | unsigned int change_up : 1; // 0x2000000 bit 26 |
488 | unsigned int change_up : 1; // 0x2000000 bit 26 |
489 | unsigned int change_down : 1; // 0x4000000 bit 27 |
489 | unsigned int change_down : 1; // 0x4000000 bit 27 |
490 | unsigned int horn : 1; // 0x8000000 bit 28 |
490 | unsigned int horn : 1; // 0x8000000 bit 28 |
491 | } tCar_controls; |
491 | } tCar_controls; |
492 | 492 | ||
493 | typedef struct tNet_message_mechanics_info { |
493 | typedef struct tNet_message_mechanics_info { |
494 | tU8 contents_size; |
494 | tU8 contents_size; |
495 | tNet_message_type type; |
495 | tNet_message_type type; |
496 | tU32 ID; |
496 | tU32 ID; |
497 | tU32 time; |
497 | tU32 time; |
498 | tReduced_matrix mat; |
498 | tReduced_matrix mat; |
499 | br_vector3 v; |
499 | br_vector3 v; |
500 | br_vector3 omega; |
500 | br_vector3 omega; |
501 | tU8 d[4]; |
501 | tU8 d[4]; |
502 | tCar_controls keys; |
502 | tCar_controls keys; |
503 | tU32 cc_coll_time; |
503 | tU32 cc_coll_time; |
504 | tS16 curvature; |
504 | tS16 curvature; |
505 | tU16 revs; |
505 | tU16 revs; |
506 | br_scalar front; |
506 | br_scalar front; |
507 | br_scalar back; |
507 | br_scalar back; |
508 | tU32 repair_time; |
508 | tU32 repair_time; |
509 | tU8 damage[12]; |
509 | tU8 damage[12]; |
510 | tU16 powerups; |
510 | tU16 powerups; |
511 | br_scalar wheel_dam_offset[4]; |
511 | br_scalar wheel_dam_offset[4]; |
512 | } tNet_message_mechanics_info; |
512 | } tNet_message_mechanics_info; |
513 | 513 | ||
514 | typedef struct tDamage_unit { |
514 | typedef struct tDamage_unit { |
515 | int x_coord; |
515 | int x_coord; |
516 | int y_coord; |
516 | int y_coord; |
Line 879... | Line 879... | ||
879 | 879 | ||
880 | typedef struct tComplete_race_data { |
880 | typedef struct tComplete_race_data { |
881 | tU8 finished_calcing_race_route; |
881 | tU8 finished_calcing_race_route; |
882 | tU8 found_race_section; |
882 | tU8 found_race_section; |
883 | } tComplete_race_data; |
883 | } tComplete_race_data; |
884 | 884 | ||
885 | typedef struct tReturn_to_start_data { |
885 | typedef struct tReturn_to_start_data { |
886 | br_vector3 nearest_path_point; |
886 | br_vector3 nearest_path_point; |
887 | tS16 section_no; |
887 | tS16 section_no; |
888 | tU8 waiting_near_start; |
888 | tU8 waiting_near_start; |
889 | } tReturn_to_start_data; |
889 | } tReturn_to_start_data; |
Line 1031... | Line 1031... | ||
1031 | br_vector3 normal; |
1031 | br_vector3 normal; |
1032 | int flags; |
1032 | int flags; |
1033 | br_scalar d; |
1033 | br_scalar d; |
1034 | } tFace_ref; |
1034 | } tFace_ref; |
1035 | 1035 | ||
1036 | #pragma pack(push, 4) |
- | |
1037 | typedef struct tNet_game_player_info { // size: 0xc0 |
1036 | typedef struct tNet_game_player_info { // size: 0xc0 |
1038 | tPD_net_player_info pd_net_info; // @0x0 |
1037 | tPD_net_player_info pd_net_info; // @0x0 |
1039 | tU32 this_players_time_stamp; // @0x10 |
1038 | tU32 this_players_time_stamp; // @0x10 |
1040 | tU32 last_heard_from_him; // @0x14 |
1039 | tU32 last_heard_from_him; // @0x14 |
1041 | tU32 reposition_time; // @0x18 |
1040 | tU32 reposition_time; // @0x18 |
Line 1061... | Line 1060... | ||
1061 | int games_score; // @0x84 |
1060 | int games_score; // @0x84 |
1062 | int last_score_index; // @0x88 |
1061 | int last_score_index; // @0x88 |
1063 | br_matrix34 initial_position; // @0x8c |
1062 | br_matrix34 initial_position; // @0x8c |
1064 | tCar_spec* car; // @0xbc |
1063 | tCar_spec* car; // @0xbc |
1065 | } tNet_game_player_info; |
1064 | } tNet_game_player_info; |
1066 | #pragma pack(pop) |
- | |
1067 | 1065 | ||
1068 | typedef struct tNet_game_options { // size: 0x30 |
1066 | typedef struct tNet_game_options { // size: 0x30 |
1069 | int show_players_on_map; // @0x0 |
1067 | int show_players_on_map; // @0x0 |
1070 | int show_peds_on_map; // @0x4 |
1068 | int show_peds_on_map; // @0x4 |
1071 | int enable_text_messages; // @0x8 |
1069 | int enable_text_messages; // @0x8 |
Line 1129... | Line 1127... | ||
1129 | int number_of_players; |
1127 | int number_of_players; |
1130 | int this_index; |
1128 | int this_index; |
1131 | int batch_number; |
1129 | int batch_number; |
1132 | tNet_game_player_info player; |
1130 | tNet_game_player_info player; |
1133 | } tNet_message_new_player_list; |
1131 | } tNet_message_new_player_list; |
1134 | 1132 | ||
1135 | typedef struct tNet_message_race_over { |
1133 | typedef struct tNet_message_race_over { |
1136 | tU8 contents_size; |
1134 | tU8 contents_size; |
1137 | tNet_message_type type; |
1135 | tNet_message_type type; |
1138 | tRace_over_reason reason; |
1136 | tRace_over_reason reason; |
1139 | } tNet_message_race_over; |
1137 | } tNet_message_race_over; |
Line 1498... | Line 1496... | ||
1498 | int phys_width; |
1496 | int phys_width; |
1499 | int phys_height; |
1497 | int phys_height; |
1500 | void* base_addr; |
1498 | void* base_addr; |
1501 | } tGraf_spec; |
1499 | } tGraf_spec; |
1502 | 1500 | ||
1503 | typedef struct tCollision_info { |
1501 | typedef struct tCollision_info { |
1504 | int index; |
1502 | int index; |
1505 | int disabled; |
1503 | int disabled; |
1506 | tDriver driver; |
1504 | tDriver driver; |
1507 | br_actor* car_master_actor; |
1505 | br_actor* car_master_actor; |
1508 | br_scalar min_torque_squared; |
1506 | br_scalar min_torque_squared; |
1509 | br_scalar break_off_radians_squared; |
1507 | br_scalar break_off_radians_squared; |
1510 | br_vector3 v; |
1508 | br_vector3 v; |
1511 | br_vector3 old_v; |
1509 | br_vector3 old_v; |
1512 | br_vector3 velocity_car_space; |
1510 | br_vector3 velocity_car_space; |
1513 | br_matrix34 oldmat; |
1511 | br_matrix34 oldmat; |
1514 | br_matrix34 old_frame_mat; |
1512 | br_matrix34 old_frame_mat; |
1515 | br_vector3 pos; |
1513 | br_vector3 pos; |
1516 | br_vector3 omega; |
1514 | br_vector3 omega; |
1517 | br_vector3 oldomega; |
1515 | br_vector3 oldomega; |
1518 | br_scalar M; |
1516 | br_scalar M; |
1519 | int infinite_mass; |
1517 | int infinite_mass; |
1520 | br_vector3 I; |
1518 | br_vector3 I; |
1521 | br_vector3 cmpos; |
1519 | br_vector3 cmpos; |
1522 | int extra_point_num; |
1520 | int extra_point_num; |
1523 | br_bounds bounds[3]; |
1521 | br_bounds bounds[3]; |
1524 | br_bounds max_bounds[2]; |
1522 | br_bounds max_bounds[2]; |
1525 | br_vector3 extra_points[6]; |
1523 | br_vector3 extra_points[6]; |
1526 | br_scalar original_extra_points_z[6]; |
1524 | br_scalar original_extra_points_z[6]; |
1527 | br_vector3 old_point; |
1525 | br_vector3 old_point; |
1528 | br_vector3 old_norm; |
1526 | br_vector3 old_norm; |
1529 | int box_face_start; |
1527 | int box_face_start; |
1530 | int box_face_end; |
1528 | int box_face_end; |
1531 | int box_face_ref; |
1529 | int box_face_ref; |
1532 | br_matrix34 last_box_inv_mat; |
1530 | br_matrix34 last_box_inv_mat; |
1533 | br_bounds last_box; |
1531 | br_bounds last_box; |
1534 | int doing_nothing_flag; |
1532 | int doing_nothing_flag; |
1535 | tSpecial_volume* last_special_volume; |
1533 | tSpecial_volume* last_special_volume; |
1536 | tSpecial_volume* auto_special_volume; |
1534 | tSpecial_volume* auto_special_volume; |
1537 | int frame_collision_flag; |
1535 | int frame_collision_flag; |
1538 | int collision_flag; |
1536 | int collision_flag; |
1539 | int max_shrapnel_material; |
1537 | int max_shrapnel_material; |
1540 | br_vector3 direction; |
1538 | br_vector3 direction; |
1541 | float speed; |
1539 | float speed; |
1542 | tU16 car_ID; |
1540 | tU16 car_ID; |
1543 | br_material* shrapnel_material[3]; |
1541 | br_material* shrapnel_material[3]; |
1544 | br_bounds bounds_world_space; |
1542 | br_bounds bounds_world_space; |
1545 | tBounds_type bounds_ws_type; |
1543 | tBounds_type bounds_ws_type; |
1546 | tU16 fire_vertex[12]; |
1544 | tU16 fire_vertex[12]; |
1547 | tU16 num_smoke_columns; |
1545 | tU16 num_smoke_columns; |
1548 | br_vector3 water_normal; |
1546 | br_vector3 water_normal; |
1549 | br_scalar water_d; |
1547 | br_scalar water_d; |
1550 | br_scalar water_depth_factor; |
1548 | br_scalar water_depth_factor; |
1551 | tNet_message_mechanics_info message; |
1549 | tNet_message_mechanics_info message; |
1552 | tU32 last_car_car_collision; |
1550 | tU32 last_car_car_collision; |
1553 | br_scalar dt; |
1551 | br_scalar dt; |
1554 | tCar_spec* who_last_hit_me; |
1552 | tCar_spec* who_last_hit_me; |
1555 | } tCollision_info; |
1553 | } tCollision_info; |
1556 | 1554 | ||
1557 | typedef struct tNon_car_spec { |
1555 | typedef struct tNon_car_spec { |
1558 | tCollision_info collision_info; |
1556 | tCollision_info collision_info; |
1559 | br_scalar free_mass; |
1557 | br_scalar free_mass; |
1560 | br_scalar attached_mass; |
1558 | br_scalar attached_mass; |
1561 | br_vector3 free_cmpos; |
1559 | br_vector3 free_cmpos; |
1562 | br_vector3 attached_cmpos; |
1560 | br_vector3 attached_cmpos; |
1563 | br_scalar min_torque_squared; |
1561 | br_scalar min_torque_squared; |
1564 | br_scalar snap_off_cosine; |
1562 | br_scalar snap_off_cosine; |
1565 | br_vector3 I_over_M; |
1563 | br_vector3 I_over_M; |
1566 | } tNon_car_spec; |
1564 | } tNon_car_spec; |
1567 | 1565 | ||
1568 | typedef struct tOpp_spec { |
1566 | typedef struct tOpp_spec { |
1569 | int index; |
1567 | int index; |
1570 | int ranking; |
1568 | int ranking; |
1571 | int net_player_index; |
1569 | int net_player_index; |
1572 | tCar_spec* car_spec; |
1570 | tCar_spec* car_spec; |
1573 | } tOpp_spec; |
1571 | } tOpp_spec; |
1574 | 1572 | ||
1575 | typedef struct tCheckpoint { |
1573 | typedef struct tCheckpoint { |
1576 | int time_value[3]; |
1574 | int time_value[3]; |
1577 | int quad_count; |
1575 | int quad_count; |