MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / play

Function play

TheForceEngine/TFE_Editor/LevelEditor/levelEditor.cpp:4715–4752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4713 }
4714
4715 void play()
4716 {
4717 // For now assume Dark Forces - TODO: Fix for Outlaws support.
4718 size_t len = strlen(s_editorConfig.darkForcesPort);
4719 bool invalidPort = false;
4720 if (len == 0) { invalidPort = true; }
4721 #ifdef _WIN32
4722 char ext[32];
4723 FileUtil::getFileExtension(s_editorConfig.darkForcesPort, ext);
4724 if (strcasecmp(ext, "exe"))
4725 {
4726 invalidPort = true;
4727 }
4728 #endif
4729 if (invalidPort)
4730 {
4731 showMessageBox("Error", "You need to set a source port before you can test.\nOpen the Level menu and choose Test Options to set.");
4732 return;
4733 }
4734 // Fix-up any issues that may cause a crash.
4735 fixupLevel();
4736
4737 StartPoint start = {};
4738 start.pos = s_camera.pos;
4739 start.yaw = s_camera.yaw;
4740 start.pitch = s_camera.pitch;
4741 start.sector = findSector3d(start.pos);
4742
4743 char exportPath[TFE_MAX_PATH];
4744 getTempDirectory(exportPath);
4745 if (!exportLevel(exportPath, s_level.slot.c_str(), start.sector ? &start : nullptr))
4746 {
4747 if (!start.sector)
4748 {
4749 LE_ERROR("Cannot test level, camera must be inside of a sector or a start point placed.");
4750 }
4751 }
4752 }
4753
4754 void copyToClipboard(const std::string& str)
4755 {

Callers 1

updateFunction · 0.85

Calls 7

showMessageBoxFunction · 0.85
fixupLevelFunction · 0.85
findSector3dFunction · 0.85
getTempDirectoryFunction · 0.85
exportLevelFunction · 0.85
c_strMethod · 0.80
getFileExtensionFunction · 0.50

Tested by

no test coverage detected