MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / CreateNewMine

Function CreateNewMine

editor/HFile.cpp:448–536  ·  view source on GitHub ↗

Create a new mine with one segment

Source from the content-addressed store, hash-verified

446
447// Create a new mine with one segment
448void CreateNewMine() {
449 // Get rid of old mine
450 FreeAllRooms();
451 FreeAllObjects();
452
453 // Create a new room
454 Curroomp = CreateDefaultRoom();
455 ASSERT(Curroomp != NULL);
456
457 // Reset misc. vars
458 Curface = Curedge = Curvert = 0;
459 Curportal = -1;
460
461 // Say that this is a new mine
462 New_mine = 1;
463
464 // Reset the view position, etc. for the wireframe view
465 ResetWireframeView();
466
467 // Reintialize the objects
468 ResetObjectList();
469
470 // Create the player and put him in the center of the fa
471 CreatePlayerObject(ROOMNUM(Curroomp));
472
473 // Initialize editor viewer
474 Editor_view_mode = VM_MINE;
475 Editor_viewer_id = -1;
476
477 // Create a camera for this level
478 SetEditorViewer();
479
480 // Look for player objects & set player starts
481 FindPlayerStarts();
482
483 // Clear the marked room
484 Markedroomp = NULL;
485
486 // Clear the selected segments
487 ClearRoomSelectedList();
488
489 // Clear the placed room & group
490 Placed_room = -1;
491 Placed_group = NULL;
492
493 // Reset the triggers
494 Num_triggers = 0;
495 Current_trigger = -1;
496
497 // Reset the terrain
498 ResetTerrain(1);
499
500 // Reset terrain sound
501 ClearTerrainSound();
502
503 // Clear game events
504 ClearAllEvents();
505

Callers 2

OnNewDocumentMethod · 0.85
InitCScriptsFunction · 0.85

Calls 15

FreeAllRoomsFunction · 0.85
FreeAllObjectsFunction · 0.85
CreateDefaultRoomFunction · 0.85
ResetWireframeViewFunction · 0.85
ResetObjectListFunction · 0.85
CreatePlayerObjectFunction · 0.85
SetEditorViewerFunction · 0.85
FindPlayerStartsFunction · 0.85
ClearRoomSelectedListFunction · 0.85
ResetTerrainFunction · 0.85
ClearTerrainSoundFunction · 0.85
ClearAllEventsFunction · 0.85

Tested by

no test coverage detected