mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-13 21:54:43 +00:00
part4: adapt codebase to changes in lib/
mostly straightforward except for CVSFile / Filesystem. moved the former into the newly created latter component. removed VFSUtil entirely (that functionality is available from lib/file/file_system_util.h) Xeromyces.cpp: simplify buffer handling since smart pointers are now in play. also use WriteBuffer instead of membuffer. This was SVN commit r5519.
This commit is contained in:
@@ -6,8 +6,7 @@
|
||||
#include "ScriptGlue.h"
|
||||
#include "ps/Profile.h"
|
||||
#include "ps/CLogger.h"
|
||||
|
||||
#include "lib/res/res.h"
|
||||
#include "ps/Filesystem.h"
|
||||
|
||||
|
||||
#if OS_WIN
|
||||
@@ -116,15 +115,12 @@ void ScriptingHost::RunScript(const CStr& filename, JSObject* globalObject)
|
||||
{
|
||||
const char* fn = filename.c_str();
|
||||
|
||||
FileIOBuf buf;
|
||||
size_t size;
|
||||
if(vfs_load(fn, buf, size) != INFO::OK) // ERRTODO: translate/pass it on
|
||||
shared_ptr<u8> buf; size_t size;
|
||||
if(g_VFS->LoadFile(fn, buf, size) != INFO::OK) // ERRTODO: translate/pass it on
|
||||
throw PSERROR_Scripting_LoadFile_OpenFailed();
|
||||
|
||||
const char* script = (const char*)buf;
|
||||
const char* script = (const char*)buf.get();
|
||||
RunMemScript(script, size, fn, 1, globalObject);
|
||||
|
||||
(void)file_buf_free(buf);
|
||||
}
|
||||
|
||||
jsval ScriptingHost::CallFunction(const std::string & functionName, jsval * params, int numParams)
|
||||
|
||||
Reference in New Issue
Block a user