mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
* 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:
parent
161ffc62fe
commit
ba07e6c6d7
2 changed files with 0 additions and 103 deletions
|
|
@ -37,25 +37,6 @@ void sdl_CloseSplashWindow(void* hinst);
|
||||||
|
|
||||||
#ifdef TORQUE_SDL
|
#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()
|
PlatformWindowManager * CreatePlatformWindowManager()
|
||||||
{
|
{
|
||||||
return new PlatformWindowManagerSDL();
|
return new PlatformWindowManagerSDL();
|
||||||
|
|
@ -87,15 +68,6 @@ PlatformWindowManagerSDL::PlatformWindowManagerSDL()
|
||||||
|
|
||||||
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.
|
// Kill all our windows first.
|
||||||
while(mWindowListHead)
|
while(mWindowListHead)
|
||||||
// The destructors update the list, so this works just fine.
|
// The destructors update the list, so this works just fine.
|
||||||
|
|
@ -457,61 +429,7 @@ void PlatformWindowManagerSDL::_process()
|
||||||
if (!Platform::isDirectory(fileName) && !Platform::isFile(fileName))
|
if (!Platform::isDirectory(fileName) && !Platform::isFile(fileName))
|
||||||
break;
|
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));
|
Con::executef("onDropFile", StringTable->insert(fileName));
|
||||||
#endif
|
|
||||||
|
|
||||||
SDL_free(fileName); // Free dropped_filedir memory
|
SDL_free(fileName); // Free dropped_filedir memory
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
#include "gfx/gfxStructs.h"
|
#include "gfx/gfxStructs.h"
|
||||||
#include "windowManager/sdl/sdlWindow.h"
|
#include "windowManager/sdl/sdlWindow.h"
|
||||||
#include "core/util/tVector.h"
|
#include "core/util/tVector.h"
|
||||||
#include "core/volume.h"
|
|
||||||
|
|
||||||
struct SDL_Window;
|
struct SDL_Window;
|
||||||
class FileDialog; // TODO SDL REMOVE
|
class FileDialog; // TODO SDL REMOVE
|
||||||
|
|
@ -58,18 +57,6 @@ public:
|
||||||
RAW_INPUT = 2 /// < We only want raw input.
|
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:
|
protected:
|
||||||
friend class PlatformWindowSDL;
|
friend class PlatformWindowSDL;
|
||||||
friend class FileDialog; // TODO SDL REMOVE
|
friend class FileDialog; // TODO SDL REMOVE
|
||||||
|
|
@ -110,14 +97,6 @@ protected:
|
||||||
/// After it is handled, it will return to state NONE.
|
/// After it is handled, it will return to state NONE.
|
||||||
KeyboardInputState mInputState;
|
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:
|
public:
|
||||||
PlatformWindowManagerSDL();
|
PlatformWindowManagerSDL();
|
||||||
~PlatformWindowManagerSDL();
|
~PlatformWindowManagerSDL();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue