mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-14 00:34:41 +00:00
fixes and improvements
- directoryPosix: replace most methods with boost filesystem (but not all: the latter cannot efficiently enumerate files AND query their size/mtime) - AllocatorChecker: better name for member functions - file: move the File class here - trace: bugfix - io: move UnalignedWriter to write_buffer.cpp (basically the same thing) - vfs: remove unnecessary "vfs" warts from variable names - vfs_tree: VfsFile now stores single Name/Size/MTime fields instead of the FileInfo record (less clunky) - vfs_path: use boost filesystem's version of the basename/extension functions - lf_alloc: remove (no longer necessary, won't be finished - not worth the trouble) - path_util: remove path_foreach_component (replaced by better path traversal logic) and PathPackage (obsoleted by fs::path) ! resource loading code now receives VfsPath as its filename. there is also OsPath (native absolute path) and Path (relative to binaries/data) - tex is now independent of file loading code; it just en/decodes in-memory buffers - wdll_ver: clean up, use smart pointer to simplify bailout code - wsdl: remove nonexistent failure path from calc_gamma (cruised by here because SDL_SetGamme is failing once after a cold boot at work) - wsnd: simplify OpenAL DLL search, use boost::filesystem - wutil: Wow64 redirection is now packaged in a (RAII) class This was SVN commit r5525.
This commit is contained in:
@@ -113,14 +113,12 @@ void ScriptingHost::RunMemScript(const char* script, size_t size, const char* fi
|
||||
// globalObject defaults to 0 (in which case we use our m_GlobalObject).
|
||||
void ScriptingHost::RunScript(const CStr& filename, JSObject* globalObject)
|
||||
{
|
||||
const char* fn = filename.c_str();
|
||||
|
||||
shared_ptr<u8> buf; size_t size;
|
||||
if(g_VFS->LoadFile(fn, buf, size) != INFO::OK) // ERRTODO: translate/pass it on
|
||||
if(g_VFS->LoadFile(filename, buf, size) != INFO::OK) // ERRTODO: translate/pass it on
|
||||
throw PSERROR_Scripting_LoadFile_OpenFailed();
|
||||
|
||||
const char* script = (const char*)buf.get();
|
||||
RunMemScript(script, size, fn, 1, globalObject);
|
||||
RunMemScript(script, size, filename.c_str(), 1, globalObject);
|
||||
}
|
||||
|
||||
jsval ScriptingHost::CallFunction(const std::string & functionName, jsval * params, int numParams)
|
||||
|
||||
Reference in New Issue
Block a user