* Cleanup: Remove the partial editor tools integration from the TORQUE_SECURE_VFS implementation in preference for developers building mod tools builds instead.

This commit is contained in:
Robert MacGregor 2022-06-13 08:08:43 -04:00
parent 161ffc62fe
commit ba07e6c6d7
2 changed files with 0 additions and 103 deletions

View file

@ -37,25 +37,6 @@ void sdl_CloseSplashWindow(void* hinst);
#ifdef TORQUE_SDL
#ifdef TORQUE_SECURE_VFS
PlatformWindowManagerSDL::DragAndDropFSInfo::DragAndDropFSInfo()
{
}
PlatformWindowManagerSDL::DragAndDropFSInfo::DragAndDropFSInfo(String rootName, Torque::FS::FileSystemRef fileSystem) : mRootName(rootName), mDragAndDropFS(fileSystem)
{
if (!Torque::FS::Mount(rootName, fileSystem))
{
Con::errorf("Could not mount drag and drop FS!");
}
}
PlatformWindowManagerSDL::DragAndDropFSInfo::~DragAndDropFSInfo()
{
}
#endif
PlatformWindowManager * CreatePlatformWindowManager()
{
return new PlatformWindowManagerSDL();
@ -87,15 +68,6 @@ PlatformWindowManagerSDL::PlatformWindowManagerSDL()
PlatformWindowManagerSDL::~PlatformWindowManagerSDL()
{
// Unmount all drag and drop FS mounts
for (auto iteration = mActiveDragAndDropFSByPath.begin(); iteration != mActiveDragAndDropFSByPath.end(); ++iteration)
{
auto&& mapping = *iteration;
Torque::FS::Unmount(mapping.value.mDragAndDropFS);
}
mActiveDragAndDropByRoot.clear();
mActiveDragAndDropFSByPath.clear();
// Kill all our windows first.
while(mWindowListHead)
// The destructors update the list, so this works just fine.
@ -457,61 +429,7 @@ void PlatformWindowManagerSDL::_process()
if (!Platform::isDirectory(fileName) && !Platform::isFile(fileName))
break;
#ifdef TORQUE_SECURE_VFS
// Determine what the directory is so we can mount it
Torque::Path targetDirectory = Torque::Path(fileName);
// If we're dropping a file, strip off file information - otherwise if a directory mount it directly
if (Platform::isFile(fileName))
{
targetDirectory.setExtension("");
targetDirectory.setFileName("");
}
const String directoryName = targetDirectory.getDirectory(targetDirectory.getDirectoryCount() - 1);
auto dropFSMount = mActiveDragAndDropFSByPath.find(targetDirectory);
if (dropFSMount == mActiveDragAndDropFSByPath.end())
{
Torque::FS::FileSystemRef newMount = Platform::FS::createNativeFS(targetDirectory.getFullPath());
// Search for an unused root in case we have duplicate names
U32 rootCounter = 1;
String chosenRootName = directoryName;
auto search = mActiveDragAndDropByRoot.find(chosenRootName);
while (search != mActiveDragAndDropByRoot.end())
{
char buffer[32];
dSprintf(buffer, sizeof(buffer), "%u", rootCounter);
chosenRootName = directoryName + buffer;
search = mActiveDragAndDropByRoot.find(chosenRootName);
}
mActiveDragAndDropFSByPath[targetDirectory] = DragAndDropFSInfo(directoryName, newMount);
mActiveDragAndDropFSByPath[chosenRootName] = mActiveDragAndDropFSByPath[targetDirectory];
}
DragAndDropFSInfo& filesystemInformation = mActiveDragAndDropFSByPath[targetDirectory];
// Load source file information
Torque::Path sourceFile = fileName;
// Build a reference to the file in VFS
Torque::Path targetFile;
targetFile.setRoot(filesystemInformation.mRootName);
targetFile.setPath("/");
// Only copy file & extension information if we're dropping a file
if (Platform::isFile(fileName))
{
targetFile.setFileName(sourceFile.getFileName());
targetFile.setExtension(sourceFile.getExtension());
}
Con::executef("onDropFile", StringTable->insert(targetFile.getFullPath()));
#else
Con::executef("onDropFile", StringTable->insert(fileName));
#endif
SDL_free(fileName); // Free dropped_filedir memory
break;

View file

@ -27,7 +27,6 @@
#include "gfx/gfxStructs.h"
#include "windowManager/sdl/sdlWindow.h"
#include "core/util/tVector.h"
#include "core/volume.h"
struct SDL_Window;
class FileDialog; // TODO SDL REMOVE
@ -58,18 +57,6 @@ public:
RAW_INPUT = 2 /// < We only want raw input.
};
#ifdef TORQUE_SECURE_VFS
struct DragAndDropFSInfo
{
String mRootName;
Torque::FS::FileSystemRef mDragAndDropFS;
DragAndDropFSInfo();
DragAndDropFSInfo(String rootName, Torque::FS::FileSystemRef fileSystem);
~DragAndDropFSInfo();
};
#endif
protected:
friend class PlatformWindowSDL;
friend class FileDialog; // TODO SDL REMOVE
@ -110,14 +97,6 @@ protected:
/// After it is handled, it will return to state NONE.
KeyboardInputState mInputState;
#ifdef TORQUE_SECURE_VFS
/// Used to check if a root is already used when generating root names.
HashMap<String, DragAndDropFSInfo> mActiveDragAndDropByRoot;
/// Used to keep track of what mounts are handling a given path.
HashMap<Torque::Path, DragAndDropFSInfo> mActiveDragAndDropFSByPath;
#endif
public:
PlatformWindowManagerSDL();
~PlatformWindowManagerSDL();