Rev 18 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 18 | Rev 20 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | #include "crush.h" |
1 | #include "crush.h" |
| 2 | #include "brender.h" |
2 | #include "brender/brender.h" |
| 3 | #include "car.h" |
3 | #include "car.h" |
| 4 | #include "displays.h" |
4 | #include "displays.h" |
| 5 | #include "globvars.h" |
5 | #include "globvars.h" |
| 6 | #include "globvrkm.h" |
6 | #include "globvrkm.h" |
| 7 | #include "globvrpb.h" |
7 | #include "globvrpb.h" |
| Line 483... | Line 483... | ||
| 483 | } |
483 | } |
| 484 | } |
484 | } |
| 485 | memcpy(the_car_actor->actor->model->vertices, |
485 | memcpy(the_car_actor->actor->model->vertices, |
| 486 | the_car_actor->undamaged_vertices, |
486 | the_car_actor->undamaged_vertices, |
| 487 | the_car_actor->actor->model->nvertices * sizeof(br_vertex)); |
487 | the_car_actor->actor->model->nvertices * sizeof(br_vertex)); |
| - | 488 | // FIXME: BrModelUpdate(..., BR_MODU_VERTEX_COLOURS | BR_MODU_VERTEX_POSITIONS) fails on TELL_ME_IF_WE_PASS_THIS_WAY |
|
| 488 | BrModelUpdate |
489 | // BrModelUpdate(the_car_actor->actor->model, BR_MODU_VERTEX_COLOURS | BR_MODU_VERTEX_POSITIONS); |
| - | 490 | BrModelUpdate(the_car_actor->actor->model, BR_MODU_ALL); |
|
| 489 | if (pipe_vertex_count != 0 && IsActionReplayAvailable()) { |
491 | if (pipe_vertex_count != 0 && IsActionReplayAvailable()) { |
| 490 | PipeSingleModelGeometry(pCar->car_ID, j, pipe_vertex_count, pipe_array); |
492 | PipeSingleModelGeometry(pCar->car_ID, j, pipe_vertex_count, pipe_array); |
| 491 | } |
493 | } |
| 492 | } |
494 | } |
| 493 | } |
495 | } |
| Line 659... | Line 661... | ||
| 659 | } |
661 | } |
| 660 | } |
662 | } |
| 661 | 663 | ||
| 662 | // IDA: void __usercall DoPratcamHit(br_vector3 *pHit_vector@<EAX>) |
664 | // IDA: void __usercall DoPratcamHit(br_vector3 *pHit_vector@<EAX>) |
| 663 | void DoPratcamHit(br_vector3* pHit_vector) { |
665 | void DoPratcamHit(br_vector3* pHit_vector) { |
| 664 |
|
666 | //int strength_modifier; // Pierre-Marie Baty -- unused variable |
| 665 | br_scalar strength |
667 | //br_scalar strength; // Pierre-Marie Baty -- unused variable |
| 666 | LOG_TRACE("(%p)", pHit_vector); |
668 | LOG_TRACE("(%p)", pHit_vector); |
| 667 | 669 | ||
| 668 | strength = BrVector3LengthSquared(pHit_vector); |
- | |
| 669 | if (strength > 0.2f) { |
- | |
| 670 | strength_modifier = 8; |
- | |
| 671 | } else if (strength > 0.015f) { |
- | |
| 672 | strength_modifier = 4; |
- | |
| 673 | } else if (strength >= 0.001f) { |
- | |
| 674 | strength_modifier = 0; |
- | |
| 675 | } else { |
- | |
| 676 |
|
670 | STUB_ONCE(); |
| 677 | } |
- | |
| 678 | if (fabsf(pHit_vector->v[2]) >= fabsf(pHit_vector->v[0])) { |
- | |
| 679 | if (pHit_vector->v[2] >= 0.f) { |
- | |
| 680 | PratcamEvent(14 + strength_modifier); |
- | |
| 681 | } else { |
- | |
| 682 | PratcamEvent(13 + strength_modifier); |
- | |
| 683 | } |
- | |
| 684 | } else { |
- | |
| 685 | if (pHit_vector->v[0] >= 0.f) { |
- | |
| 686 | PratcamEvent(15 + strength_modifier); |
- | |
| 687 | } else { |
- | |
| 688 | PratcamEvent(16 + strength_modifier); |
- | |
| 689 | } |
- | |
| 690 | } |
- | |
| 691 | } |
671 | } |
| 692 | 672 | ||
| 693 | // IDA: void __usercall DamageSystems(tCar_spec *pCar@<EAX>, br_vector3 *pImpact_point@<EDX>, br_vector3 *pEnergy_vector@<EBX>, int pWas_hitting_a_car@<ECX>) |
673 | // IDA: void __usercall DamageSystems(tCar_spec *pCar@<EAX>, br_vector3 *pImpact_point@<EDX>, br_vector3 *pEnergy_vector@<EBX>, int pWas_hitting_a_car@<ECX>) |
| 694 | void DamageSystems(tCar_spec* pCar, br_vector3* pImpact_point, br_vector3* pEnergy_vector, int pWas_hitting_a_car) { |
674 | void DamageSystems(tCar_spec* pCar, br_vector3* pImpact_point, br_vector3* pEnergy_vector, int pWas_hitting_a_car) { |
| 695 | int i; |
675 | int i; |
| Line 1173... | Line 1153... | ||
| 1173 | } |
1153 | } |
| 1174 | NetGuaranteedSendMessageToEverybody(gCurrent_net_game, message, NULL); |
1154 | NetGuaranteedSendMessageToEverybody(gCurrent_net_game, message, NULL); |
| 1175 | NetEarnCredits(NetPlayerFromCar(culprit), credits); |
1155 | NetEarnCredits(NetPlayerFromCar(culprit), credits); |
| 1176 | } else { |
1156 | } else { |
| 1177 | PratcamEvent(32); |
1157 | PratcamEvent(32); |
| 1178 | DoFancyHeadup( |
1158 | DoFancyHeadup(11); |
| 1179 | credits_squared = sqr(0.7f / victim->car_model_actors[victim->principal_car_actor].crush_data.softness_factor) * gWasted_creds[gProgram_state.skill_level] + 50.0f; |
1159 | credits_squared = sqr(0.7f / victim->car_model_actors[victim->principal_car_actor].crush_data.softness_factor) * gWasted_creds[gProgram_state.skill_level] + 50.0f; |
| 1180 | credits = 100 * (int)(credits_squared / 100.0); |
1160 | credits = 100 * (int)(credits_squared / 100.0); |
| 1181 | AwardTime(gWasted_time[gProgram_state.skill_level]); |
1161 | AwardTime(gWasted_time[gProgram_state.skill_level]); |
| 1182 | EarnCredits(credits); |
1162 | EarnCredits(credits); |
| 1183 | if (victim->can_be_stolen && !gOpponents[victim->index].dead |
1163 | if (victim->can_be_stolen && !gOpponents[victim->index].dead |
| Line 1238... | Line 1218... | ||
| 1238 | if (gNet_mode == eNet_mode_none) { |
1218 | if (gNet_mode == eNet_mode_none) { |
| 1239 | time = 5 * (int)((total_units_of_damage * gCar_time_value[gProgram_state.skill_level] + 2.5f) / 5.0f); |
1219 | time = 5 * (int)((total_units_of_damage * gCar_time_value[gProgram_state.skill_level] + 2.5f) / 5.0f); |
| 1240 | AwardTime(MIN(time, 90)); |
1220 | AwardTime(MIN(time, 90)); |
| 1241 | if (pCar2) { |
1221 | if (pCar2) { |
| 1242 | if (head_on) { |
1222 | if (head_on) { |
| 1243 | DoFancyHeadup( |
1223 | DoFancyHeadup(10); |
| 1244 | } else if (bonus_level <= 2) { |
1224 | } else if (bonus_level <= 2) { |
| 1245 | if (bonus_level > 1) { |
1225 | if (bonus_level > 1) { |
| 1246 | DoFancyHeadup( |
1226 | DoFancyHeadup(2); |
| 1247 | } |
1227 | } |
| 1248 | } else { |
1228 | } else { |
| 1249 | DoFancyHeadup( |
1229 | DoFancyHeadup(3); |
| 1250 | } |
1230 | } |
| 1251 | } |
1231 | } |
| 1252 | } |
1232 | } |
| 1253 | } |
1233 | } |
| 1254 | for (i = 0; i < COUNT_OF(victim->damage_units); i++) { |
1234 | for (i = 0; i < COUNT_OF(victim->damage_units); i++) { |