3dfx info mode (#443)
* adds third debug info mode added in 3dfx patch * fix DRPixelmapHasZeros
This commit is contained in:
parent
08ff6f20c0
commit
2e31fc6956
|
@ -67,7 +67,13 @@ void ToggleInfo(void) {
|
||||||
} else {
|
} else {
|
||||||
gInfo_on = !gInfo_on;
|
gInfo_on = !gInfo_on;
|
||||||
if (gInfo_on) {
|
if (gInfo_on) {
|
||||||
|
#ifdef DETHRACE_3DFX_PATCH
|
||||||
|
if (PDKeyDown(KEY_SHIFT_ANY)) {
|
||||||
|
gInfo_mode = (gInfo_mode + 1) % 3;
|
||||||
|
}
|
||||||
|
#else
|
||||||
gInfo_mode = PDKeyDown(KEY_SHIFT_ANY);
|
gInfo_mode = PDKeyDown(KEY_SHIFT_ANY);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,17 +152,8 @@ void MungeHeadups(void) {
|
||||||
gMr_odo = (double)gFrame_period * gProgram_state.current_car.speedo_speed * WORLD_SCALE / 1600.0 + gMr_odo;
|
gMr_odo = (double)gFrame_period * gProgram_state.current_car.speedo_speed * WORLD_SCALE / 1600.0 + gMr_odo;
|
||||||
if (gInfo_on) {
|
if (gInfo_on) {
|
||||||
bearing = 360.0 - FastScalarArcTan2(gCamera_to_world.m[0][2], gCamera_to_world.m[2][2]);
|
bearing = 360.0 - FastScalarArcTan2(gCamera_to_world.m[0][2], gCamera_to_world.m[2][2]);
|
||||||
if (gInfo_mode) {
|
switch (gInfo_mode) {
|
||||||
sprintf(
|
case 0:
|
||||||
the_text,
|
|
||||||
"P'cam: curr=%d, ambi=%d, pend=%d Car: c=%+.3f, a=%+.3f, b=%+.3f",
|
|
||||||
PratcamGetCurrent(),
|
|
||||||
PratcamGetAmbient(),
|
|
||||||
PratcamGetPending(),
|
|
||||||
gCar_to_view->curvature,
|
|
||||||
gCar_to_view->acc_force,
|
|
||||||
gCar_to_view->brake_force);
|
|
||||||
} else {
|
|
||||||
sprintf(
|
sprintf(
|
||||||
the_text,
|
the_text,
|
||||||
"%d.%d (%.3f, %.3f, %.3f) %.0f, %.0f, MILES=%.2f",
|
"%d.%d (%.3f, %.3f, %.3f) %.0f, %.0f, MILES=%.2f",
|
||||||
|
@ -168,6 +165,45 @@ void MungeHeadups(void) {
|
||||||
gCamera_to_horiz_angle,
|
gCamera_to_horiz_angle,
|
||||||
bearing,
|
bearing,
|
||||||
gMr_odo);
|
gMr_odo);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
sprintf(
|
||||||
|
the_text,
|
||||||
|
"P'cam: curr=%d, ambi=%d, pend=%d Car: c=%+.3f, a=%+.3f, b=%+.3f",
|
||||||
|
PratcamGetCurrent(),
|
||||||
|
PratcamGetAmbient(),
|
||||||
|
PratcamGetPending(),
|
||||||
|
gCar_to_view->curvature,
|
||||||
|
gCar_to_view->acc_force,
|
||||||
|
gCar_to_view->brake_force);
|
||||||
|
break;
|
||||||
|
#ifdef DETHRACE_3DFX_PATCH
|
||||||
|
case 2:
|
||||||
|
nearby = SomeNearbyMaterial();
|
||||||
|
strcpy(the_text, nearby->identifier);
|
||||||
|
if (nearby->colour_map != NULL) {
|
||||||
|
sprintf(&the_text[strlen(the_text)], " %s", nearby->colour_map->identifier);
|
||||||
|
user = (tPixelmap_user_data*)nearby->colour_map->user;
|
||||||
|
if (user != NULL) {
|
||||||
|
sprintf(&the_text[strlen(the_text)], " %dx%d to", user->orig_width, user->orig_height);
|
||||||
|
} else {
|
||||||
|
sprintf(&the_text[strlen(the_text)], " %dx%d", nearby->colour_map->width, nearby->colour_map->height);
|
||||||
|
}
|
||||||
|
if ((nearby->flags & BR_MATF_MAP_INTERPOLATION)) {
|
||||||
|
strcat(the_text, " bilinear");
|
||||||
|
} else {
|
||||||
|
strcat(the_text, " nobilinear");
|
||||||
|
}
|
||||||
|
if ((nearby->flags & BR_MATF_MAP_ANTIALIASING) && nearby->colour_map != NULL && nearby->colour_map->mip_offset != 0) {
|
||||||
|
strcat(the_text, " mipmap");
|
||||||
|
} else {
|
||||||
|
strcat(the_text, " nomipmap");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
ChangeHeadupText(gProgram_state.frame_rate_headup, the_text);
|
ChangeHeadupText(gProgram_state.frame_rate_headup, the_text);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2443,9 +2443,8 @@ void InitOpponents(tRace_info* pRace_info) {
|
||||||
gHead_on_cos_value = cosf(.5235668f);
|
gHead_on_cos_value = cosf(.5235668f);
|
||||||
gAcme_frame_count = 0;
|
gAcme_frame_count = 0;
|
||||||
gProgram_state.current_car.no_of_processes_recording_my_trail = 0;
|
gProgram_state.current_car.no_of_processes_recording_my_trail = 0;
|
||||||
rank_dependent_difficulty = (101.f - (gCurrent_race.suggested_rank < 10 ? .5f : (float)gCurrent_race.suggested_rank));
|
rank_dependent_difficulty = (101.f - (gCurrent_race.suggested_rank < 10 ? .5f : gCurrent_race.suggested_rank)) / 10.0f;
|
||||||
// FIXME: unsure about gBig_bang
|
gBig_bang = 70.f - (3 * rank_dependent_difficulty + 10 * gProgram_state.skill_level) * gOpponent_nastyness_frigger;
|
||||||
gBig_bang = 70.f - (float)(3 * rank_dependent_difficulty + 10 * gProgram_state.skill_level) * gOpponent_nastyness_frigger;
|
|
||||||
gIn_view_distance = gCamera_yon + 10.f;
|
gIn_view_distance = gCamera_yon + 10.f;
|
||||||
if (gCamera_yon + 10.f <= 45.f) {
|
if (gCamera_yon + 10.f <= 45.f) {
|
||||||
gIn_view_distance = 45.f;
|
gIn_view_distance = 45.f;
|
||||||
|
|
|
@ -1735,8 +1735,7 @@ void GlorifyMaterial(br_material** pArray, int pCount) {
|
||||||
|
|
||||||
if (gInterpolate_textures) {
|
if (gInterpolate_textures) {
|
||||||
// use linear texture filtering unless we have a "nobilinear" flag or the texture has transparent parts
|
// use linear texture filtering unless we have a "nobilinear" flag or the texture has transparent parts
|
||||||
if ((e == NULL || (e->flags & ExceptionFlag_NoBilinear) == 0)
|
if ((e == NULL || (e->flags & ExceptionFlag_NoBilinear) == 0) && !DRPixelmapHasZeros(pArray[i]->colour_map)) {
|
||||||
&& !DRPixelmapHasZeros(pArray[i]->colour_map)) {
|
|
||||||
pArray[i]->flags |= BR_MATF_MAP_INTERPOLATION;
|
pArray[i]->flags |= BR_MATF_MAP_INTERPOLATION;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1946,11 +1946,13 @@ int DRPixelmapHasZeros(br_pixelmap* pm) {
|
||||||
if (pm->flags & BR_PMF_NO_ACCESS) {
|
if (pm->flags & BR_PMF_NO_ACCESS) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
row_ptr = (char*)pm->pixels + (pm->row_bytes * pm->base_y) + pm->base_x;
|
row_ptr = (char*)pm->pixels + (pm->row_bytes * pm->base_y) + pm->base_x;
|
||||||
for (y = 0; y < pm->height; y++) {
|
for (y = 0; y < pm->height; y++) {
|
||||||
pp = row_ptr;
|
pp = row_ptr;
|
||||||
for (x = 0; x < pm->width; x++) {
|
for (x = 0; x < pm->width; x++) {
|
||||||
if (!pp)
|
// found a zero (transparent) pixel?
|
||||||
|
if (*pp == 0)
|
||||||
return 1;
|
return 1;
|
||||||
pp++;
|
pp++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue