| 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 | { |
no test coverage detected