00001
00002 #include "revolt.h"
00003 #include "camera.h"
00004 #include "main.h"
00005 #include "geom.h"
00006 #include "input.h"
00007 #include "level.h"
00008 #include "dx.h"
00009 #include "texture.h"
00010 #include "text.h"
00011 #include "draw.h"
00012 #include "editzone.h"
00013 #include "editai.h"
00014 #include "ainode.h"
00015 #include "ctrlread.h"
00016 #include "player.h"
00017
00018
00019
00020 FILE_ZONE *CurrentFileZone;
00021
00022 static long FileZoneNum, ShowNodes, BigBrother;
00023 static FILE_ZONE *FileZone;
00024 static long FileZoneAxis, FileZoneAxisType;
00025 static long FileZoneSide, LastFileZoneID;
00026
00027
00028
00029 static char *FileZoneAxisNames[] = {
00030 "X Y",
00031 "X Z",
00032 "Z Y",
00033 "X",
00034 "Y",
00035 "Z",
00036 };
00037
00038 static char *FileZoneAxisTypeNames[] = {
00039 "Camera",
00040 "World",
00041 };
00042
00043
00044
00045 static unsigned short DrawZoneIndex[] = {
00046 1, 3, 7, 5,
00047 2, 0, 4, 6,
00048 4, 5, 7, 6,
00049 0, 2, 3, 1,
00050 3, 2, 6, 7,
00051 0, 1, 5, 4,
00052 };
00053
00054 static long DrawZoneCol[] = {
00055 0x80ff0000,
00056 0x8000ff00,
00057 0x800000ff,
00058 0x80ffff00,
00059 0x80ff00ff,
00060 0x8000ffff,
00061 };
00062
00064
00066
00067 void InitFileZones(void)
00068 {
00069 FileZone = (FILE_ZONE*)malloc(sizeof(FILE_ZONE) * MAX_FILE_ZONES);
00070 if (!FileZone)
00071 {
00072 Box(NULL, "Can't alloc memory for file track zones!", MB_OK);
00073 QuitGame = TRUE;
00074 }
00075 }
00076
00078
00080
00081 void KillFileZones(void)
00082 {
00083 free(FileZone);
00084 }
00085
00087
00089
00090 void LoadFileZones(char *file)
00091 {
00092 long i;
00093 FILE *fp;
00094 FILE_ZONE taz;
00095
00096
00097
00098 fp = fopen(file, "rb");
00099
00100
00101
00102 if (!fp)
00103 {
00104 fp = fopen(file, "wb");
00105 if (!fp) return;
00106 i = 0;
00107 fwrite(&i, sizeof(i), 1, fp);
00108 fclose(fp);
00109 fp = fopen(file, "rb");
00110 if (!fp) return;
00111 }
00112
00113
00114
00115 fread(&FileZoneNum, sizeof(FileZoneNum), 1, fp);
00116
00117 for (i = 0 ; i < FileZoneNum ; i++)
00118 {
00119
00120
00121
00122 fread(&taz, sizeof(taz), 1, fp);
00123
00124 VecMulScalar(&taz.Pos, EditScale);
00125 VecMulScalar((VEC*)taz.Size, EditScale);
00126
00127
00128
00129 FileZone[i] = taz;
00130 }
00131
00132
00133
00134 fclose(fp);
00135 }
00136
00138
00140
00141 void SaveFileZones(char *file)
00142 {
00143 long i;
00144 FILE *fp;
00145 FILE_ZONE taz;
00146 char bak[256];
00147
00148
00149
00150 memcpy(bak, file, strlen(file) - 3);
00151 wsprintf(bak + strlen(file) - 3, "ta-");
00152 remove(bak);
00153 rename(file, bak);
00154
00155
00156
00157 fp = fopen(file, "wb");
00158 if (!fp) return;
00159
00160
00161
00162 fwrite(&FileZoneNum, sizeof(FileZoneNum), 1, fp);
00163
00164
00165
00166 for (i = 0 ; i < FileZoneNum ; i++)
00167 {
00168
00169
00170
00171 taz = FileZone[i];
00172
00173
00174
00175 fwrite(&taz, sizeof(taz), 1, fp);
00176 }
00177
00178
00179
00180 Box("Saved Track Zone File:", file, MB_OK);
00181 fclose(fp);
00182 }
00183
00185
00187
00188 FILE_ZONE *AllocFileZone(void)
00189 {
00190
00191
00192
00193 if (FileZoneNum >= MAX_FILE_ZONES)
00194 return NULL;
00195
00196
00197
00198 return &FileZone[FileZoneNum++];
00199 }
00200
00202
00204
00205 void FreeFileZone(FILE_ZONE *zone)
00206 {
00207 long idx, i;
00208
00209
00210
00211 idx = (long)(zone - FileZone);
00212
00213
00214
00215 for (i = idx ; i < FileZoneNum - 1; i++)
00216 {
00217 FileZone[i] = FileZone[i + 1];
00218 }
00219
00220
00221
00222 FileZoneNum--;
00223 }
00224
00226
00228
00229 void EditFileZones(void)
00230 {
00231 long i, j;
00232 VEC vec, vec2, r, u, l, r2, u2, l2;
00233 float z, sx, sy, rad, add;
00234 MAT mat, mat2;
00235 FILE_ZONE *nzone, *zone, tempzone;
00236
00237
00238
00239 if (Keys[DIK_1] && !LastKeys[DIK_1])
00240 ShowNodes = !ShowNodes;
00241
00242
00243
00244 if (Keys[DIK_2] && !LastKeys[DIK_2])
00245 BigBrother = !BigBrother;
00246
00247
00248
00249 if (CAM_MainCamera->Type != CAM_EDIT)
00250 {
00251 CurrentFileZone = NULL;
00252 return;
00253 }
00254
00255
00256
00257 if (MouseRight)
00258 {
00259 RotMatrixZYX(&mat, (float)-Mouse.lY / 3072, -(float)Mouse.lX / 3072, 0);
00260 MulMatrix(&CAM_MainCamera->WMatrix, &mat, &mat2);
00261 CopyMatrix(&mat2, &CAM_MainCamera->WMatrix);
00262
00263 CAM_MainCamera->WMatrix.m[RY] = 0;
00264 NormalizeVector(&CAM_MainCamera->WMatrix.mv[X]);
00265 CrossProduct(&CAM_MainCamera->WMatrix.mv[Z], &CAM_MainCamera->WMatrix.mv[X], &CAM_MainCamera->WMatrix.mv[Y]);
00266 NormalizeVector(&CAM_MainCamera->WMatrix.mv[Y]);
00267 CrossProduct(&CAM_MainCamera->WMatrix.mv[X], &CAM_MainCamera->WMatrix.mv[Y], &CAM_MainCamera->WMatrix.mv[Z]);
00268 }
00269
00270
00271
00272 if (Keys[DIK_LCONTROL] && Keys[DIK_F4] && !LastKeys[DIK_F4])
00273 {
00274 if (FileZoneNum) for (i = FileZoneNum - 1 ; i ; i--) for (j = 0 ; j < i ; j++) if (FileZone[j].ID > FileZone[j + 1].ID)
00275 {
00276 tempzone = FileZone[j];
00277 FileZone[j] = FileZone[j + 1];
00278 FileZone[j + 1] = tempzone;
00279 }
00280
00281 SaveFileZones(GetLevelFilename("taz", FILENAME_MAKE_BODY | FILENAME_GAME_SETTINGS));
00282 }
00283
00284
00285
00286 if (!CurrentFileZone && Keys[DIK_RETURN] && !LastKeys[DIK_RETURN])
00287 {
00288 nzone = NULL;
00289 z = RenderSettings.FarClip;
00290
00291 zone = FileZone;
00292 for (i = 0 ; i < FileZoneNum ; i++, zone++)
00293 {
00294 for (j = 0 ; j < 2 ; j++)
00295 {
00296 RotTransVector(&ViewMatrix, &ViewTrans, &zone->Pos, &vec);
00297
00298 if (vec.v[Z] < RenderSettings.NearClip || vec.v[Z] >= RenderSettings.FarClip) continue;
00299
00300 sx = vec.v[X] * RenderSettings.GeomPers / vec.v[Z] + REAL_SCREEN_XHALF;
00301 sy = vec.v[Y] * RenderSettings.GeomPers / vec.v[Z] + REAL_SCREEN_YHALF;
00302
00303 rad = 128 * RenderSettings.GeomPers / vec.v[Z];
00304
00305 if (MouseXpos > sx - rad && MouseXpos < sx + rad && MouseYpos > sy - rad && MouseYpos < sy + rad)
00306 {
00307 if (vec.v[Z] < z)
00308 {
00309 nzone = zone;
00310 z = vec.v[Z];
00311 }
00312 }
00313 }
00314 }
00315 if (nzone)
00316 {
00317 CurrentFileZone = nzone;
00318 return;
00319 }
00320 }
00321
00322
00323
00324 if (Keys[DIK_INSERT] && !LastKeys[DIK_INSERT])
00325 {
00326 if ((zone = AllocFileZone()))
00327 {
00328 vec.v[X] = 0;
00329 vec.v[Y] = 0;
00330 vec.v[Z] = 512;
00331 RotVector(&CAM_MainCamera->WMatrix, &vec, &vec2);
00332 AddVector(&CAM_MainCamera->WPos, &vec2, &zone->Pos);
00333
00334 CopyMatrix(&IdentityMatrix, &zone->Matrix);
00335
00336 zone->Size[X] = zone->Size[Y] = zone->Size[Z] = 128;
00337 zone->ID = LastFileZoneID;
00338
00339 CurrentFileZone = zone;
00340 }
00341 }
00342
00343
00344
00345 if (!CurrentFileZone) return;
00346
00347
00348
00349 LastFileZoneID = CurrentFileZone->ID;
00350
00351
00352
00353 if (Keys[DIK_RETURN] && !LastKeys[DIK_RETURN])
00354 {
00355 CurrentFileZone = NULL;
00356 return;
00357 }
00358
00359
00360
00361 if (Keys[DIK_DELETE] && !LastKeys[DIK_DELETE])
00362 {
00363 FreeFileZone(CurrentFileZone);
00364 CurrentFileZone = NULL;
00365 return;
00366 }
00367
00368
00369
00370 if (Keys[DIK_TAB] && !LastKeys[DIK_TAB])
00371 {
00372 if (Keys[DIK_LSHIFT]) FileZoneAxis--;
00373 else FileZoneAxis++;
00374 if (FileZoneAxis == -1) FileZoneAxis = 5;
00375 if (FileZoneAxis == 6) FileZoneAxis = 0;
00376 }
00377
00378
00379
00380 if (Keys[DIK_LALT] && !LastKeys[DIK_LALT])
00381 FileZoneAxisType ^= 1;
00382
00383
00384
00385 if (Keys[DIK_NUMPADMINUS] && !LastKeys[DIK_NUMPADMINUS])
00386 CurrentFileZone->ID--;
00387 if (Keys[DIK_NUMPADPLUS] && !LastKeys[DIK_NUMPADPLUS])
00388 CurrentFileZone->ID++;
00389
00390 CurrentFileZone->ID &= 255;
00391
00392
00393
00394 if (Keys[DIK_SPACE] && !LastKeys[DIK_SPACE])
00395 FileZoneSide = (FileZoneSide + 1) % 6;
00396
00397
00398
00399 add = 0;
00400 if (Keys[DIK_NUMPADSTAR])
00401 add = 4 * TimeFactor;
00402 if (Keys[DIK_NUMPADSLASH])
00403 add = -4 * TimeFactor;
00404
00405 if (Keys[DIK_LCONTROL]) add *= 4;
00406
00407 if (add)
00408 {
00409 if (Keys[DIK_LSHIFT])
00410 {
00411 CurrentFileZone->Size[X] += add;
00412 if (CurrentFileZone->Size[X] < 16) CurrentFileZone->Size[X] = 16;
00413 CurrentFileZone->Size[Y] += add;
00414 if (CurrentFileZone->Size[Y] < 16) CurrentFileZone->Size[Y] = 16;
00415 CurrentFileZone->Size[Z] += add;
00416 if (CurrentFileZone->Size[Z] < 16) CurrentFileZone->Size[Z] = 16;
00417 }
00418 else
00419 {
00420 switch (FileZoneSide)
00421 {
00422 case 0:
00423 CurrentFileZone->Size[X] += add;
00424 if (CurrentFileZone->Size[X] < 16) CurrentFileZone->Size[X] = 16;
00425 CurrentFileZone->Pos.v[X] += CurrentFileZone->Matrix.m[RX] * add;
00426 CurrentFileZone->Pos.v[Y] += CurrentFileZone->Matrix.m[RY] * add;
00427 CurrentFileZone->Pos.v[Z] += CurrentFileZone->Matrix.m[RZ] * add;
00428 break;
00429 case 1:
00430 CurrentFileZone->Size[X] += add;
00431 if (CurrentFileZone->Size[X] < 16) CurrentFileZone->Size[X] = 16;
00432 CurrentFileZone->Pos.v[X] -= CurrentFileZone->Matrix.m[RX] * add;
00433 CurrentFileZone->Pos.v[Y] -= CurrentFileZone->Matrix.m[RY] * add;
00434 CurrentFileZone->Pos.v[Z] -= CurrentFileZone->Matrix.m[RZ] * add;
00435 break;
00436 case 2:
00437 CurrentFileZone->Size[Y] += add;
00438 if (CurrentFileZone->Size[Y] < 16) CurrentFileZone->Size[Y] = 16;
00439 CurrentFileZone->Pos.v[X] += CurrentFileZone->Matrix.m[UX] * add;
00440 CurrentFileZone->Pos.v[Y] += CurrentFileZone->Matrix.m[UY] * add;
00441 CurrentFileZone->Pos.v[Z] += CurrentFileZone->Matrix.m[UZ] * add;
00442 break;
00443 case 3:
00444 CurrentFileZone->Size[Y] += add;
00445 if (CurrentFileZone->Size[Y] < 16) CurrentFileZone->Size[Y] = 16;
00446 CurrentFileZone->Pos.v[X] -= CurrentFileZone->Matrix.m[UX] * add;
00447 CurrentFileZone->Pos.v[Y] -= CurrentFileZone->Matrix.m[UY] * add;
00448 CurrentFileZone->Pos.v[Z] -= CurrentFileZone->Matrix.m[UZ] * add;
00449 break;
00450 case 4:
00451 CurrentFileZone->Size[Z] += add;
00452 if (CurrentFileZone->Size[Z] < 16) CurrentFileZone->Size[Z] = 16;
00453 CurrentFileZone->Pos.v[X] += CurrentFileZone->Matrix.m[LX] * add;
00454 CurrentFileZone->Pos.v[Y] += CurrentFileZone->Matrix.m[LY] * add;
00455 CurrentFileZone->Pos.v[Z] += CurrentFileZone->Matrix.m[LZ] * add;
00456 break;
00457 case 5:
00458 CurrentFileZone->Size[Z] += add;
00459 if (CurrentFileZone->Size[Z] < 16) CurrentFileZone->Size[Z] = 16;
00460 CurrentFileZone->Pos.v[X] -= CurrentFileZone->Matrix.m[LX] * add;
00461 CurrentFileZone->Pos.v[Y] -= CurrentFileZone->Matrix.m[LY] * add;
00462 CurrentFileZone->Pos.v[Z] -= CurrentFileZone->Matrix.m[LZ] * add;
00463 break;
00464 }
00465 }
00466 }
00467
00468
00469
00470 if (MouseLeft)
00471 {
00472 RotTransVector(&ViewMatrix, &ViewTrans, &CurrentFileZone->Pos, &vec);
00473
00474 switch (FileZoneAxis)
00475 {
00476 case FILE_ZONE_AXIS_XY:
00477 vec.v[X] = MouseXrel * vec.v[Z] / RenderSettings.GeomPers + CameraEditXrel;
00478 vec.v[Y] = MouseYrel * vec.v[Z] / RenderSettings.GeomPers + CameraEditYrel;
00479 vec.v[Z] = CameraEditZrel;
00480 break;
00481 case FILE_ZONE_AXIS_XZ:
00482 vec.v[X] = MouseXrel * vec.v[Z] / RenderSettings.GeomPers + CameraEditXrel;
00483 vec.v[Y] = CameraEditYrel;
00484 vec.v[Z] = -MouseYrel * vec.v[Z] / RenderSettings.GeomPers + CameraEditZrel;
00485 break;
00486 case FILE_ZONE_AXIS_ZY:
00487 vec.v[X] = CameraEditXrel;
00488 vec.v[Y] = MouseYrel * vec.v[Z] / RenderSettings.GeomPers + CameraEditYrel;
00489 vec.v[Z] = MouseXrel * vec.v[Z] / RenderSettings.GeomPers + CameraEditZrel;
00490 break;
00491 case FILE_ZONE_AXIS_X:
00492 vec.v[X] = MouseXrel * vec.v[Z] / RenderSettings.GeomPers + CameraEditXrel;
00493 vec.v[Y] = CameraEditYrel;
00494 vec.v[Z] = CameraEditZrel;
00495 break;
00496 case FILE_ZONE_AXIS_Y:
00497 vec.v[X] = CameraEditXrel;
00498 vec.v[Y] = MouseYrel * vec.v[Z] / RenderSettings.GeomPers + CameraEditYrel;
00499 vec.v[Z] = CameraEditZrel;
00500 break;
00501 case FILE_ZONE_AXIS_Z:
00502 vec.v[X] = CameraEditXrel;
00503 vec.v[Y] = CameraEditYrel;
00504 vec.v[Z] = -MouseYrel * vec.v[Z] / RenderSettings.GeomPers + CameraEditZrel;
00505 break;
00506 }
00507
00508 if (FileZoneAxisType == 1)
00509 {
00510 SetVector(&vec2, vec.v[X], vec.v[Y], vec.v[Z]);
00511 }
00512 else
00513 {
00514 RotVector(&CAM_MainCamera->WMatrix, &vec, &vec2);
00515 }
00516
00517 CurrentFileZone->Pos.v[X] += vec2.v[X];
00518 CurrentFileZone->Pos.v[Y] += vec2.v[Y];
00519 CurrentFileZone->Pos.v[Z] += vec2.v[Z];
00520 }
00521
00522
00523
00524 vec.v[X] = vec.v[Y] = vec.v[Z] = 0;
00525
00526 if (Keys[DIK_NUMPAD7]) vec.v[X] -= 0.005f;
00527 if (Keys[DIK_NUMPAD4]) vec.v[X] += 0.005f;
00528 if (Keys[DIK_NUMPAD8]) vec.v[Y] -= 0.005f;
00529 if (Keys[DIK_NUMPAD5]) vec.v[Y] += 0.005f;
00530 if (Keys[DIK_NUMPAD9]) vec.v[Z] -= 0.005f;
00531 if (Keys[DIK_NUMPAD6]) vec.v[Z] += 0.005f;
00532
00533 if (Keys[DIK_NUMPAD1] && !LastKeys[DIK_NUMPAD1]) vec.v[X] += 0.25f;
00534 if (Keys[DIK_NUMPAD2] && !LastKeys[DIK_NUMPAD2]) vec.v[Y] += 0.25f;
00535 if (Keys[DIK_NUMPAD3] && !LastKeys[DIK_NUMPAD3]) vec.v[Z] += 0.25f;
00536
00537 if (Keys[DIK_NUMPAD0]) CopyMatrix(&IdentityMatrix, &CurrentFileZone->Matrix);
00538
00539 RotMatrixZYX(&mat, vec.v[X], vec.v[Y], vec.v[Z]);
00540
00541 if (FileZoneAxisType)
00542 {
00543 MulMatrix(&mat, &CurrentFileZone->Matrix, &mat2);
00544 CopyMatrix(&mat2, &CurrentFileZone->Matrix);
00545 NormalizeMatrix(&CurrentFileZone->Matrix);
00546 }
00547 else if (vec.v[X] || vec.v[Y] || vec.v[Z])
00548 {
00549 RotVector(&ViewMatrix, &CurrentFileZone->Matrix.mv[X], &r);
00550 RotVector(&ViewMatrix, &CurrentFileZone->Matrix.mv[Y], &u);
00551 RotVector(&ViewMatrix, &CurrentFileZone->Matrix.mv[Z], &l);
00552
00553 RotVector(&mat, &r, &r2);
00554 RotVector(&mat, &u, &u2);
00555 RotVector(&mat, &l, &l2);
00556
00557 RotVector(&CAM_MainCamera->WMatrix, &r2, &CurrentFileZone->Matrix.mv[X]);
00558 RotVector(&CAM_MainCamera->WMatrix, &u2, &CurrentFileZone->Matrix.mv[Y]);
00559 RotVector(&CAM_MainCamera->WMatrix, &l2, &CurrentFileZone->Matrix.mv[Z]);
00560
00561 NormalizeMatrix(&CurrentFileZone->Matrix);
00562 }
00563 }
00564
00566
00568
00569 void DrawFileZones(void)
00570 {
00571 long i, j, k, col[4];
00572 FILE_ZONE *zone;
00573 VEC v[8], vpos[8], pos[4];
00574 MAT mat;
00575 VEC vec;
00576 char buf[128];
00577 ONE_AINODE *node;
00578 VEC v1, v2;
00579
00580
00581
00582 if (ShowNodes)
00583 {
00584 ALPHA_OFF();
00585 ZBUFFER_ON();
00586
00587
00588
00589 for (i = 0 ; i < AiNodeNum ; i++)
00590 {
00591 for (j = 0 ; j < 2 ; j++)
00592 {
00593 node = &AiNode[i].Node[j];
00594
00595
00596
00597 DrawModel(&EditAiNodeModel[j], &IdentityMatrix, &node->Pos, MODEL_PLAIN);
00598
00599
00600
00601 for (k = 0 ; k < MAX_AINODE_LINKS ; k++) if (AiNode[i].Next[k])
00602 {
00603 v1.v[X] = AiNode[i].Node[j].Pos.v[X];
00604 v1.v[Y] = AiNode[i].Node[j].Pos.v[Y];
00605 v1.v[Z] = AiNode[i].Node[j].Pos.v[Z];
00606
00607 v2.v[X] = AiNode[i].Next[k]->Node[j].Pos.v[X];
00608 v2.v[Y] = AiNode[i].Next[k]->Node[j].Pos.v[Y];
00609 v2.v[Z] = AiNode[i].Next[k]->Node[j].Pos.v[Z];
00610
00611 if (!j)
00612 {
00613 DrawLine(&v1, &v2, 0x000000, 0xff0000);
00614 }
00615 else
00616 {
00617 DrawLine(&v1, &v2, 0x000000, 0x00ff00);
00618 }
00619 }
00620 }
00621
00622
00623
00624 DrawLine(&AiNode[i].Node[0].Pos, &AiNode[i].Node[1].Pos, 0xffff00, 0xffff00);
00625 }
00626 }
00627
00628
00629
00630 ALPHA_SRC(D3DBLEND_SRCALPHA);
00631 ALPHA_DEST(D3DBLEND_INVSRCALPHA);
00632 WIREFRAME_OFF();
00633
00634
00635
00636 zone = FileZone;
00637 for (i = 0 ; i < FileZoneNum ; i++, zone++)
00638 {
00639
00640
00641
00642 if (!BigBrother && CurrentFileZone && CurrentFileZone != zone)
00643 continue;
00644
00645
00646
00647 SetVector(&v[0], -zone->Size[X], -zone->Size[Y], -zone->Size[Z]);
00648 SetVector(&v[1], zone->Size[X], -zone->Size[Y], -zone->Size[Z]);
00649 SetVector(&v[2], -zone->Size[X], -zone->Size[Y], zone->Size[Z]);
00650 SetVector(&v[3], zone->Size[X], -zone->Size[Y], zone->Size[Z]);
00651
00652 SetVector(&v[4], -zone->Size[X], zone->Size[Y], -zone->Size[Z]);
00653 SetVector(&v[5], zone->Size[X], zone->Size[Y], -zone->Size[Z]);
00654 SetVector(&v[6], -zone->Size[X], zone->Size[Y], zone->Size[Z]);
00655 SetVector(&v[7], zone->Size[X], zone->Size[Y], zone->Size[Z]);
00656
00657 for (j = 0 ; j < 8 ; j++)
00658 {
00659 RotTransVector(&zone->Matrix, &zone->Pos, &v[j], &vpos[j]);
00660 }
00661
00662
00663
00664 SET_TPAGE(-1);
00665 ALPHA_ON();
00666 ZBUFFER_ON();
00667
00668 for (j = 0 ; j < 6 ; j++)
00669 {
00670 for (k = 0 ; k < 4 ; k++)
00671 {
00672 pos[k] = vpos[DrawZoneIndex[j * 4 + k]];
00673
00674 if (CurrentFileZone == zone && j == FileZoneSide)
00675 col[k] = 0x80ffffff * (FrameCount & 1);
00676 else
00677 col[k] = DrawZoneCol[zone->ID % 6];
00678 }
00679
00680 DrawNearClipPolyTEX0(pos, col, 4);
00681 }
00682
00683
00684
00685 wsprintf(buf, "%d", zone->ID);
00686 RotTransVector(&ViewMatrix, &ViewTrans, &zone->Pos, &vec);
00687 vec.v[X] -= 64 * ((zone->ID >= 10) + 1);
00688 vec.v[Y] -= 128;
00689 if (vec.v[Z] > RenderSettings.NearClip)
00690 {
00691 ALPHA_OFF();
00692 ZBUFFER_OFF();
00693 DumpText3D(&vec, 128, 256, 0x00ffff, buf);
00694 }
00695
00696
00697
00698 if (CurrentFileZone == zone)
00699 {
00700 ALPHA_OFF();
00701 ZBUFFER_OFF();
00702
00703 if (FileZoneAxisType)
00704 CopyMatrix(&IdentityMatrix, &mat);
00705 else
00706 CopyMatrix(&CAM_MainCamera->WMatrix, &mat);
00707
00708 MatMulScalar(&mat, 2.0f);
00709 DrawAxis(&mat, &zone->Pos);
00710 }
00711 }
00712
00713
00714
00715 WIREFRAME_ON();
00716 ALPHA_OFF();
00717 ZBUFFER_ON();
00718 }
00719
00721
00723
00724 void DisplayZoneInfo(FILE_ZONE *zone)
00725 {
00726 char buf[128];
00727
00728
00729
00730 wsprintf(buf, "ID %d", zone->ID);
00731 DumpText(450, 0, 8, 16, 0xffff00, buf);
00732
00733
00734
00735 wsprintf(buf, "Axis %s - %s", FileZoneAxisNames[FileZoneAxis], FileZoneAxisTypeNames[FileZoneAxisType]);
00736 DumpText(450, 24, 8, 16, 0xff00ff, buf);
00737
00738
00739
00740 wsprintf(buf, "Big Brother: %s", BigBrother ? "Yep" : "Nope");
00741 DumpText(450, 48, 8, 16, 0x00ffff, buf);
00742 }
00743
00745
00747
00748 void DisplayCurrentTrackZone(void)
00749 {
00750 char buf[128];
00751
00752 wsprintf(buf, "Zone %d", PLR_LocalPlayer->CarAI.ZoneID);
00753 DumpText(0, 128, 8, 16, 0xffffff, buf);
00754 }