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

Function CreateNewViewer

editor/HView.cpp:333–350  ·  view source on GitHub ↗

Creates a new viewer object. Copies position & orientation from the current viewer

Source from the content-addressed store, hash-verified

331
332// Creates a new viewer object. Copies position & orientation from the current viewer
333void CreateNewViewer() {
334 int objnum;
335
336 objnum = CreateViewerObject(Editor_view_mode, &Viewer_object->pos, Viewer_object->roomnum);
337
338 if (objnum == -1) {
339 OutrageMessageBox("Cannot create new viewer: you already have the maximum number of viewers.");
340 return;
341 }
342
343 ObjSetOrient(&Objects[objnum], &Viewer_object->orient);
344
345 SetViewer(objnum);
346
347 EditorStatus("Viewer %d created.", GetViewerNum());
348
349 World_changed = 1;
350}
351
352// Select next viewer
353void SelectNextViewer() {

Callers 1

OnViewNewviewerMethod · 0.85

Calls 6

CreateViewerObjectFunction · 0.85
OutrageMessageBoxFunction · 0.85
ObjSetOrientFunction · 0.85
SetViewerFunction · 0.85
EditorStatusFunction · 0.85
GetViewerNumFunction · 0.85

Tested by

no test coverage detected