1
0
forked from 0ad/0ad

Don't leak all GUI objects on name ambiguity following 5cc814759f and remove ERROR_GROUP GUI.

Delete CGUI::UpdateObjects and don't recreate the entire object
hierarchy by recursing through the existing one each time when inserting
one GUI Object.
Change CGUI::AddObject to only insert the one relevant pointer into the
map hierarchy, return success value and delete the child upon failed
insertion in the caller instead of leaking it.
Defer GUIM_LOAD and UpdateCachedSize recursion until all XML files
linked in the page XML file were loaded.
Delete related ERROR_TYPE NameAmbiguity, ObjectNeedsName, and unrelated
JSOpenFailed and in consistency with the rest, do the LOGERROR in the
scope where the error occurs.
Delete ERROR_TYPE InvalidSetting from 90f6641c1d unused following
85a622b13a, 1a49ccb294, ERROR_TYPE OperationNeedsGUIObject from
90f6641c1d unused following d3e56f0f57, see also e1014aad3b, refs #128.

This was SVN commit r23067.
This commit is contained in:
elexis 2019-10-11 16:20:50 +00:00
parent bd914702fb
commit a01e68a4ea
8 changed files with 172 additions and 363 deletions

View File

@ -126,7 +126,6 @@ InReaction CGUI::HandleEvent(const SDL_Event_* ev)
IGUIObject* pNearest = nullptr;
// TODO Gee: (2004-09-08) Big TODO, don't do the below if the SDL_Event is something like a keypress!
try
{
PROFILE("mouse events");
// TODO Gee: Optimizations needed!
@ -205,12 +204,6 @@ InReaction CGUI::HandleEvent(const SDL_Event_* ev)
m_BaseObject.RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::UpdateMouseOver, static_cast<IGUIObject* const&>(pNearest));
}
}
catch (PSERROR_GUI& e)
{
UNUSED2(e);
debug_warn(L"CGUI::HandleEvent error");
// TODO Gee: Handle
}
// BUTTONUP's effect on m_MouseButtons is handled after
// everything else, so that e.g. 'press' handlers (activated
@ -336,14 +329,7 @@ void CGUI::Draw()
// drawn on top of everything else
glClear(GL_DEPTH_BUFFER_BIT);
try
{
m_BaseObject.RecurseObject(&IGUIObject::IsHidden, &IGUIObject::Draw);
}
catch (PSERROR_GUI& e)
{
LOGERROR("GUI draw error: %s", e.what());
}
m_BaseObject.RecurseObject(&IGUIObject::IsHidden, &IGUIObject::Draw);
}
void CGUI::DrawSprite(const CGUISpriteInstance& Sprite, int CellID, const float& Z, const CRect& Rect, const CRect& UNUSED(Clipping))
@ -359,45 +345,26 @@ void CGUI::DrawSprite(const CGUISpriteInstance& Sprite, int CellID, const float&
void CGUI::UpdateResolution()
{
// Update ALL cached
m_BaseObject.RecurseObject(nullptr, &IGUIObject::UpdateCachedSize);
}
void CGUI::AddObject(IGUIObject* pObject)
bool CGUI::AddObject(IGUIObject& parent, IGUIObject& child)
{
try
if (child.m_Name.empty())
{
m_BaseObject.AddChild(pObject);
// Cache tree
pObject->RecurseObject(nullptr, &IGUIObject::UpdateCachedSize);
SGUIMessage msg(GUIM_LOAD);
pObject->RecurseObject(nullptr, &IGUIObject::HandleMessage, msg);
}
catch (PSERROR_GUI&)
{
throw;
}
}
void CGUI::UpdateObjects()
{
// We'll fill a temporary map until we know everything succeeded
map_pObjects AllObjects;
try
{
// Fill freshly
m_BaseObject.RecurseObject(nullptr, &IGUIObject::AddToPointersMap, AllObjects);
}
catch (PSERROR_GUI&)
{
throw;
LOGERROR("Can't register an object without name!");
return false;
}
// Else actually update the real one
m_pAllObjects.swap(AllObjects);
if (m_pAllObjects.find(child.m_Name) != m_pAllObjects.end())
{
LOGERROR("Can't register more than one object of the name %s", child.m_Name.c_str());
return false;
}
m_pAllObjects[child.m_Name] = &child;
parent.AddChild(child);
return true;
}
bool CGUI::ObjectExists(const CStr& Name) const
@ -511,31 +478,28 @@ void CGUI::LoadXmlFile(const VfsPath& Filename, boost::unordered_set<VfsPath>& P
return;
XMBElement node = XeroFile.GetRoot();
CStr root_name(XeroFile.GetElementString(node.GetNodeName()));
try
{
if (root_name == "objects")
{
Xeromyces_ReadRootObjects(node, &XeroFile, Paths);
// Re-cache all values so these gets cached too.
//UpdateResolution();
}
else if (root_name == "sprites")
Xeromyces_ReadRootSprites(node, &XeroFile);
else if (root_name == "styles")
Xeromyces_ReadRootStyles(node, &XeroFile);
else if (root_name == "setup")
Xeromyces_ReadRootSetup(node, &XeroFile);
else
debug_warn(L"CGUI::LoadXmlFile error");
}
catch (PSERROR_GUI& e)
{
LOGERROR("Errors loading GUI file %s (%u)", Filename.string8(), e.getCode());
return;
}
if (root_name == "objects")
Xeromyces_ReadRootObjects(node, &XeroFile, Paths);
else if (root_name == "sprites")
Xeromyces_ReadRootSprites(node, &XeroFile);
else if (root_name == "styles")
Xeromyces_ReadRootStyles(node, &XeroFile);
else if (root_name == "setup")
Xeromyces_ReadRootSetup(node, &XeroFile);
else
LOGERROR("CGUI::LoadXmlFile encountered an unknown XML root node type: %s", root_name.c_str());
}
void CGUI::LoadedXmlFiles()
{
m_BaseObject.RecurseObject(nullptr, &IGUIObject::UpdateCachedSize);
SGUIMessage msg(GUIM_LOAD);
m_BaseObject.RecurseObject(nullptr, &IGUIObject::HandleMessage, msg);
SendEventToAll("load");
}
//===================================================================
@ -662,7 +626,7 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
for (XMBAttribute attr : attributes)
{
// If value is "null", then it is equivalent as never being entered
if (CStr(attr.Value) == "null")
if (attr.Value == "null")
continue;
// Ignore "type" and "style", we've already checked it
@ -725,7 +689,7 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
if (scriptfile.Load(g_VFS, filename) != PSRETURN_OK)
{
LOGERROR("Error opening GUI script action file '%s'", utf8_from_wstring(filename));
throw PSERROR_GUI_JSOpenFailed();
continue;
}
code = scriptfile.DecodeUTF8(); // assume it's UTF-8
@ -886,17 +850,8 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
object->SetSetting<float>("z", 10.f, false);
}
try
{
if (pParent == &m_BaseObject)
AddObject(object);
else
pParent->AddChild(object);
}
catch (PSERROR_GUI& e)
{
LOGERROR("GUI error: %s", e.what());
}
if (!AddObject(*pParent, *object))
delete object;
}
void CGUI::Xeromyces_ReadRepeat(XMBElement Element, CXeromyces* pFile, IGUIObject* pParent, std::vector<std::pair<CStr, CStr> >& NameSubst, boost::unordered_set<VfsPath>& Paths, u32 nesting_depth)
@ -1319,7 +1274,8 @@ void CGUI::Xeromyces_ReadTooltip(XMBElement Element, CXeromyces* pFile)
object->SetSettingFromString(attr_name, attr_value.FromUTF8(), true);
}
AddObject(object);
if (!AddObject(m_BaseObject, *object))
delete object;
}
void CGUI::Xeromyces_ReadColor(XMBElement Element, CXeromyces* pFile)

View File

@ -37,8 +37,6 @@
#include <map>
#include <vector>
ERROR_TYPE(GUI, JSOpenFailed);
extern const double SELECT_DBLCLICK_RATE;
class CGUISpriteInstance;
@ -126,6 +124,11 @@ public:
*/
void LoadXmlFile(const VfsPath& Filename, boost::unordered_set<VfsPath>& Paths);
/**
* Called after all XML files linked in the page file were loaded.
*/
void LoadedXmlFiles();
/**
* Allows the JS side to modify the hotkey setting assigned to a GUI object.
*/
@ -238,27 +241,12 @@ public:
shared_ptr<ScriptInterface> GetScriptInterface() { return m_ScriptInterface; };
JS::Value GetGlobalObject() { return m_ScriptInterface->GetGlobalObject(); };
/**
* Updates the object pointers, needs to be called each
* time an object has been added or removed.
*
* This function is atomic, meaning if it throws anything, it will
* have seen it through that nothing was ultimately changed.
*
* @throws PSERROR_GUI that is thrown from IGUIObject::AddToPointersMap().
*/
void UpdateObjects();
private:
/**
* Adds an object to the GUI's object database
* Private, since you can only add objects through
* XML files. Why? Because it enables the GUI to
* be much more encapsulated and safe.
*
* @throws Rethrows PSERROR_GUI from IGUIObject::AddChild().
* The CGUI takes ownership of the child object and links the parent with the child.
* Returns false on failure to take over ownership of the child object.
*/
void AddObject(IGUIObject* pObject);
bool AddObject(IGUIObject& parent, IGUIObject& child);
/**
* You input the name of the object type, and let's

View File

@ -196,7 +196,7 @@ void CGUIManager::SGUIPage::LoadPage(shared_ptr<ScriptRuntime> scriptRuntime)
}
}
gui->SendEventToAll("load");
gui->LoadedXmlFiles();
shared_ptr<ScriptInterface> scriptInterface = gui->GetScriptInterface();
JSContext* cx = scriptInterface->GetContext();

View File

@ -71,62 +71,14 @@ IGUIObject::~IGUIObject()
if (!m_ScriptHandlers.empty())
JS_RemoveExtraGCRootsTracer(m_pGUI.GetScriptInterface()->GetJSRuntime(), Trace, this);
// m_Children is deleted along all other GUI Objects in the CGUI destructor
}
//-------------------------------------------------------------------
// Functions
//-------------------------------------------------------------------
void IGUIObject::AddChild(IGUIObject* pChild)
void IGUIObject::AddChild(IGUIObject& pChild)
{
// ENSURE(pChild);
pChild->SetParent(this);
m_Children.push_back(pChild);
{
try
{
// Atomic function, if it fails it won't
// have changed anything
//UpdateObjects();
pChild->GetGUI().UpdateObjects();
}
catch (PSERROR_GUI&)
{
// If anything went wrong, reverse what we did and throw
// an exception telling it never added a child
m_Children.erase(m_Children.end()-1);
throw;
}
}
// else do nothing
}
void IGUIObject::AddToPointersMap(map_pObjects& ObjectMap)
{
// Just don't do anything about the top node
if (m_pParent == nullptr)
return;
// Now actually add this one
// notice we won't add it if it's doesn't have any parent
// (i.e. being the base object)
if (m_Name.empty())
{
throw PSERROR_GUI_ObjectNeedsName();
}
if (ObjectMap.find(m_Name) != ObjectMap.end())
{
throw PSERROR_GUI_NameAmbiguity(m_Name.c_str());
}
else
{
ObjectMap[m_Name] = this;
}
pChild.SetParent(this);
m_Children.push_back(&pChild);
}
template<typename T>

View File

@ -107,33 +107,9 @@ public:
CStr GetPresentableName() const;
/**
* Adds object and its children to the map, it's name being the
* first part, and the second being itself.
*
* @param ObjectMap Adds this to the map_pObjects.
*
* @throws PSERROR_GUI_ObjectNeedsName Name is missing
* @throws PSERROR_GUI_NameAmbiguity Name is already taken
* Builds the object hierarchy with references.
*/
void AddToPointersMap(map_pObjects& ObjectMap);
/**
* Notice nothing will be returned or thrown if the child hasn't
* been inputted into the GUI yet. This is because that's were
* all is checked. Now we're just linking two objects, but
* it's when we're inputting them into the GUI we'll check
* validity! Notice also when adding it to the GUI this function
* will inevitably have been called by CGUI::AddObject which
* will catch the throw and return the error code.
* i.e. The user will never put in the situation wherein a throw
* must be caught, the GUI's internal error handling will be
* completely transparent to the interfacially sequential model.
*
* @param pChild Child to add
*
* @throws PSERROR_GUI from CGUI::UpdateObjects().
*/
void AddChild(IGUIObject* pChild);
void AddChild(IGUIObject& pChild);
/**
* Return all child objects of the current object.

View File

@ -46,7 +46,7 @@ enum EGUIMessageType
GUIM_RELEASED,
GUIM_DOUBLE_PRESSED,
GUIM_MOUSE_MOTION,
GUIM_LOAD, // Called when an object is added to the GUI.
GUIM_LOAD, // Called after all objects were added to the GUI.
GUIM_GOT_FOCUS,
GUIM_LOST_FOCUS,
GUIM_PRESSED_MOUSE_RIGHT,

View File

@ -19,7 +19,6 @@
#define INCLUDED_CGUISIZE
#include "ps/CStr.h"
#include "ps/Errors.h"
#include "ps/Shapes.h"
#include "scriptinterface/ScriptInterface.h"
@ -72,12 +71,4 @@ public:
bool FromJSVal(JSContext* cx, JS::HandleValue v);
};
ERROR_GROUP(GUI);
ERROR_TYPE(GUI, InvalidSetting);
ERROR_TYPE(GUI, OperationNeedsGUIObject);
ERROR_TYPE(GUI, NameAmbiguity);
ERROR_TYPE(GUI, ObjectNeedsName);
#endif // INCLUDED_CGUISIZE

View File

@ -9,7 +9,6 @@ class PSERROR_Deserialize : public PSERROR { protected: PSERROR_Deserialize(cons
class PSERROR_DllLoader : public PSERROR { protected: PSERROR_DllLoader(const char* msg); };
class PSERROR_Error : public PSERROR { protected: PSERROR_Error(const char* msg); };
class PSERROR_File : public PSERROR { protected: PSERROR_File(const char* msg); };
class PSERROR_GUI : public PSERROR { protected: PSERROR_GUI(const char* msg); };
class PSERROR_Game : public PSERROR { protected: PSERROR_Game(const char* msg); };
class PSERROR_Scripting : public PSERROR { protected: PSERROR_Scripting(const char* msg); };
class PSERROR_Serialize : public PSERROR { protected: PSERROR_Serialize(const char* msg); };
@ -35,11 +34,6 @@ class PSERROR_File_OpenFailed : public PSERROR_File { public: PSERROR_File_OpenF
class PSERROR_File_ReadFailed : public PSERROR_File { public: PSERROR_File_ReadFailed(); PSERROR_File_ReadFailed(const char* msg); PSRETURN getCode() const; };
class PSERROR_File_UnexpectedEOF : public PSERROR_File { public: PSERROR_File_UnexpectedEOF(); PSERROR_File_UnexpectedEOF(const char* msg); PSRETURN getCode() const; };
class PSERROR_File_WriteFailed : public PSERROR_File { public: PSERROR_File_WriteFailed(); PSERROR_File_WriteFailed(const char* msg); PSRETURN getCode() const; };
class PSERROR_GUI_InvalidSetting : public PSERROR_GUI { public: PSERROR_GUI_InvalidSetting(); PSERROR_GUI_InvalidSetting(const char* msg); PSRETURN getCode() const; };
class PSERROR_GUI_JSOpenFailed : public PSERROR_GUI { public: PSERROR_GUI_JSOpenFailed(); PSERROR_GUI_JSOpenFailed(const char* msg); PSRETURN getCode() const; };
class PSERROR_GUI_NameAmbiguity : public PSERROR_GUI { public: PSERROR_GUI_NameAmbiguity(); PSERROR_GUI_NameAmbiguity(const char* msg); PSRETURN getCode() const; };
class PSERROR_GUI_ObjectNeedsName : public PSERROR_GUI { public: PSERROR_GUI_ObjectNeedsName(); PSERROR_GUI_ObjectNeedsName(const char* msg); PSRETURN getCode() const; };
class PSERROR_GUI_OperationNeedsGUIObject : public PSERROR_GUI { public: PSERROR_GUI_OperationNeedsGUIObject(); PSERROR_GUI_OperationNeedsGUIObject(const char* msg); PSRETURN getCode() const; };
class PSERROR_Game_World_MapLoadFailed : public PSERROR_Game_World { public: PSERROR_Game_World_MapLoadFailed(); PSERROR_Game_World_MapLoadFailed(const char* msg); PSRETURN getCode() const; };
class PSERROR_Scripting_CallFunctionFailed : public PSERROR_Scripting { public: PSERROR_Scripting_CallFunctionFailed(); PSERROR_Scripting_CallFunctionFailed(const char* msg); PSRETURN getCode() const; };
class PSERROR_Scripting_CreateObjectFailed : public PSERROR_Scripting { public: PSERROR_Scripting_CreateObjectFailed(); PSERROR_Scripting_CreateObjectFailed(const char* msg); PSRETURN getCode() const; };
@ -77,32 +71,27 @@ extern const PSRETURN PSRETURN_File_OpenFailed = 0x05000003;
extern const PSRETURN PSRETURN_File_ReadFailed = 0x05000004;
extern const PSRETURN PSRETURN_File_UnexpectedEOF = 0x05000005;
extern const PSRETURN PSRETURN_File_WriteFailed = 0x05000006;
extern const PSRETURN PSRETURN_GUI_InvalidSetting = 0x06000001;
extern const PSRETURN PSRETURN_GUI_JSOpenFailed = 0x06000002;
extern const PSRETURN PSRETURN_GUI_NameAmbiguity = 0x06000003;
extern const PSRETURN PSRETURN_GUI_ObjectNeedsName = 0x06000004;
extern const PSRETURN PSRETURN_GUI_OperationNeedsGUIObject = 0x06000005;
extern const PSRETURN PSRETURN_Game_World_MapLoadFailed = 0x07030001;
extern const PSRETURN PSRETURN_Scripting_DefineType_AlreadyExists = 0x08010001;
extern const PSRETURN PSRETURN_Scripting_DefineType_CreationFailed = 0x08010002;
extern const PSRETURN PSRETURN_Scripting_LoadFile_EvalErrors = 0x08020001;
extern const PSRETURN PSRETURN_Scripting_LoadFile_OpenFailed = 0x08020002;
extern const PSRETURN PSRETURN_Scripting_CallFunctionFailed = 0x08000001;
extern const PSRETURN PSRETURN_Scripting_CreateObjectFailed = 0x08000002;
extern const PSRETURN PSRETURN_Scripting_DefineConstantFailed = 0x08000003;
extern const PSRETURN PSRETURN_Scripting_RegisterFunctionFailed = 0x08000004;
extern const PSRETURN PSRETURN_Scripting_SetupFailed = 0x08000005;
extern const PSRETURN PSRETURN_Scripting_TypeDoesNotExist = 0x08000006;
extern const PSRETURN PSRETURN_Serialize_InvalidCharInString = 0x09000001;
extern const PSRETURN PSRETURN_Serialize_InvalidScriptValue = 0x09000002;
extern const PSRETURN PSRETURN_Serialize_OutOfBounds = 0x09000003;
extern const PSRETURN PSRETURN_Serialize_ScriptError = 0x09000004;
extern const PSRETURN PSRETURN_System_RequiredExtensionsMissing = 0x0a000001;
extern const PSRETURN PSRETURN_System_SDLInitFailed = 0x0a000002;
extern const PSRETURN PSRETURN_System_VmodeFailed = 0x0a000003;
extern const PSRETURN PSRETURN_Xeromyces_XMLOpenFailed = 0x0b000001;
extern const PSRETURN PSRETURN_Xeromyces_XMLParseError = 0x0b000002;
extern const PSRETURN PSRETURN_Xeromyces_XMLValidationFailed = 0x0b000003;
extern const PSRETURN PSRETURN_Game_World_MapLoadFailed = 0x06030001;
extern const PSRETURN PSRETURN_Scripting_DefineType_AlreadyExists = 0x07010001;
extern const PSRETURN PSRETURN_Scripting_DefineType_CreationFailed = 0x07010002;
extern const PSRETURN PSRETURN_Scripting_LoadFile_EvalErrors = 0x07020001;
extern const PSRETURN PSRETURN_Scripting_LoadFile_OpenFailed = 0x07020002;
extern const PSRETURN PSRETURN_Scripting_CallFunctionFailed = 0x07000001;
extern const PSRETURN PSRETURN_Scripting_CreateObjectFailed = 0x07000002;
extern const PSRETURN PSRETURN_Scripting_DefineConstantFailed = 0x07000003;
extern const PSRETURN PSRETURN_Scripting_RegisterFunctionFailed = 0x07000004;
extern const PSRETURN PSRETURN_Scripting_SetupFailed = 0x07000005;
extern const PSRETURN PSRETURN_Scripting_TypeDoesNotExist = 0x07000006;
extern const PSRETURN PSRETURN_Serialize_InvalidCharInString = 0x08000001;
extern const PSRETURN PSRETURN_Serialize_InvalidScriptValue = 0x08000002;
extern const PSRETURN PSRETURN_Serialize_OutOfBounds = 0x08000003;
extern const PSRETURN PSRETURN_Serialize_ScriptError = 0x08000004;
extern const PSRETURN PSRETURN_System_RequiredExtensionsMissing = 0x09000001;
extern const PSRETURN PSRETURN_System_SDLInitFailed = 0x09000002;
extern const PSRETURN PSRETURN_System_VmodeFailed = 0x09000003;
extern const PSRETURN PSRETURN_Xeromyces_XMLOpenFailed = 0x0a000001;
extern const PSRETURN PSRETURN_Xeromyces_XMLParseError = 0x0a000002;
extern const PSRETURN PSRETURN_Xeromyces_XMLValidationFailed = 0x0a000003;
extern const PSRETURN MASK__PSRETURN_CVFSFile = 0xff000000;
extern const PSRETURN CODE__PSRETURN_CVFSFile = 0x01000000;
@ -114,24 +103,22 @@ extern const PSRETURN MASK__PSRETURN_Error = 0xff000000;
extern const PSRETURN CODE__PSRETURN_Error = 0x04000000;
extern const PSRETURN MASK__PSRETURN_File = 0xff000000;
extern const PSRETURN CODE__PSRETURN_File = 0x05000000;
extern const PSRETURN MASK__PSRETURN_GUI = 0xff000000;
extern const PSRETURN CODE__PSRETURN_GUI = 0x06000000;
extern const PSRETURN MASK__PSRETURN_Game = 0xff000000;
extern const PSRETURN CODE__PSRETURN_Game = 0x07000000;
extern const PSRETURN CODE__PSRETURN_Game = 0x06000000;
extern const PSRETURN MASK__PSRETURN_Scripting = 0xff000000;
extern const PSRETURN CODE__PSRETURN_Scripting = 0x08000000;
extern const PSRETURN CODE__PSRETURN_Scripting = 0x07000000;
extern const PSRETURN MASK__PSRETURN_Serialize = 0xff000000;
extern const PSRETURN CODE__PSRETURN_Serialize = 0x09000000;
extern const PSRETURN MASK__PSRETURN_System = 0x0a000000;
extern const PSRETURN CODE__PSRETURN_System = 0x0a000000;
extern const PSRETURN MASK__PSRETURN_Xeromyces = 0x0b000000;
extern const PSRETURN CODE__PSRETURN_Xeromyces = 0x0b000000;
extern const PSRETURN CODE__PSRETURN_Serialize = 0x08000000;
extern const PSRETURN MASK__PSRETURN_System = 0xff000000;
extern const PSRETURN CODE__PSRETURN_System = 0x09000000;
extern const PSRETURN MASK__PSRETURN_Xeromyces = 0x0a000000;
extern const PSRETURN CODE__PSRETURN_Xeromyces = 0x0a000000;
extern const PSRETURN MASK__PSRETURN_Game_World = 0xffff0000;
extern const PSRETURN CODE__PSRETURN_Game_World = 0x07030000;
extern const PSRETURN CODE__PSRETURN_Game_World = 0x06030000;
extern const PSRETURN MASK__PSRETURN_Scripting_DefineType = 0xffff0000;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineType = 0x08010000;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineType = 0x07010000;
extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile = 0xffff0000;
extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile = 0x08020000;
extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile = 0x07020000;
extern const PSRETURN MASK__PSRETURN_CVFSFile_AlreadyLoaded = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_CVFSFile_AlreadyLoaded = 0x01000001;
@ -163,65 +150,54 @@ extern const PSRETURN MASK__PSRETURN_File_UnexpectedEOF = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_File_UnexpectedEOF = 0x05000005;
extern const PSRETURN MASK__PSRETURN_File_WriteFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_File_WriteFailed = 0x05000006;
extern const PSRETURN MASK__PSRETURN_GUI_InvalidSetting = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_InvalidSetting = 0x06000001;
extern const PSRETURN MASK__PSRETURN_GUI_JSOpenFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_JSOpenFailed = 0x06000002;
extern const PSRETURN MASK__PSRETURN_GUI_NameAmbiguity = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_NameAmbiguity = 0x06000003;
extern const PSRETURN MASK__PSRETURN_GUI_ObjectNeedsName = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_ObjectNeedsName = 0x06000004;
extern const PSRETURN MASK__PSRETURN_GUI_OperationNeedsGUIObject = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_OperationNeedsGUIObject = 0x06000005;
extern const PSRETURN MASK__PSRETURN_Game_World_MapLoadFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Game_World_MapLoadFailed = 0x07030001;
extern const PSRETURN CODE__PSRETURN_Game_World_MapLoadFailed = 0x06030001;
extern const PSRETURN MASK__PSRETURN_Scripting_DefineType_AlreadyExists = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineType_AlreadyExists = 0x08010001;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineType_AlreadyExists = 0x07010001;
extern const PSRETURN MASK__PSRETURN_Scripting_DefineType_CreationFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineType_CreationFailed = 0x08010002;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineType_CreationFailed = 0x07010002;
extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile_EvalErrors = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile_EvalErrors = 0x08020001;
extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile_EvalErrors = 0x07020001;
extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile_OpenFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile_OpenFailed = 0x08020002;
extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile_OpenFailed = 0x07020002;
extern const PSRETURN MASK__PSRETURN_Scripting_CallFunctionFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_CallFunctionFailed = 0x08000001;
extern const PSRETURN CODE__PSRETURN_Scripting_CallFunctionFailed = 0x07000001;
extern const PSRETURN MASK__PSRETURN_Scripting_CreateObjectFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_CreateObjectFailed = 0x08000002;
extern const PSRETURN CODE__PSRETURN_Scripting_CreateObjectFailed = 0x07000002;
extern const PSRETURN MASK__PSRETURN_Scripting_DefineConstantFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineConstantFailed = 0x08000003;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineConstantFailed = 0x07000003;
extern const PSRETURN MASK__PSRETURN_Scripting_RegisterFunctionFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_RegisterFunctionFailed = 0x08000004;
extern const PSRETURN CODE__PSRETURN_Scripting_RegisterFunctionFailed = 0x07000004;
extern const PSRETURN MASK__PSRETURN_Scripting_SetupFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_SetupFailed = 0x08000005;
extern const PSRETURN CODE__PSRETURN_Scripting_SetupFailed = 0x07000005;
extern const PSRETURN MASK__PSRETURN_Scripting_TypeDoesNotExist = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_TypeDoesNotExist = 0x08000006;
extern const PSRETURN CODE__PSRETURN_Scripting_TypeDoesNotExist = 0x07000006;
extern const PSRETURN MASK__PSRETURN_Serialize_InvalidCharInString = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Serialize_InvalidCharInString = 0x09000001;
extern const PSRETURN CODE__PSRETURN_Serialize_InvalidCharInString = 0x08000001;
extern const PSRETURN MASK__PSRETURN_Serialize_InvalidScriptValue = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Serialize_InvalidScriptValue = 0x09000002;
extern const PSRETURN CODE__PSRETURN_Serialize_InvalidScriptValue = 0x08000002;
extern const PSRETURN MASK__PSRETURN_Serialize_OutOfBounds = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Serialize_OutOfBounds = 0x09000003;
extern const PSRETURN CODE__PSRETURN_Serialize_OutOfBounds = 0x08000003;
extern const PSRETURN MASK__PSRETURN_Serialize_ScriptError = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Serialize_ScriptError = 0x09000004;
extern const PSRETURN CODE__PSRETURN_Serialize_ScriptError = 0x08000004;
extern const PSRETURN MASK__PSRETURN_System_RequiredExtensionsMissing = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_System_RequiredExtensionsMissing = 0x0a000001;
extern const PSRETURN CODE__PSRETURN_System_RequiredExtensionsMissing = 0x09000001;
extern const PSRETURN MASK__PSRETURN_System_SDLInitFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_System_SDLInitFailed = 0x0a000002;
extern const PSRETURN CODE__PSRETURN_System_SDLInitFailed = 0x09000002;
extern const PSRETURN MASK__PSRETURN_System_VmodeFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_System_VmodeFailed = 0x0a000003;
extern const PSRETURN CODE__PSRETURN_System_VmodeFailed = 0x09000003;
extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLOpenFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLOpenFailed = 0x0b000001;
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLOpenFailed = 0x0a000001;
extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLParseError = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLParseError = 0x0b000002;
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLParseError = 0x0a000002;
extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLValidationFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLValidationFailed = 0x0b000003;
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLValidationFailed = 0x0a000003;
PSERROR_CVFSFile::PSERROR_CVFSFile(const char* msg) : PSERROR(msg) { }
PSERROR_Deserialize::PSERROR_Deserialize(const char* msg) : PSERROR(msg) { }
PSERROR_DllLoader::PSERROR_DllLoader(const char* msg) : PSERROR(msg) { }
PSERROR_Error::PSERROR_Error(const char* msg) : PSERROR(msg) { }
PSERROR_File::PSERROR_File(const char* msg) : PSERROR(msg) { }
PSERROR_GUI::PSERROR_GUI(const char* msg) : PSERROR(msg) { }
PSERROR_Game::PSERROR_Game(const char* msg) : PSERROR(msg) { }
PSERROR_Scripting::PSERROR_Scripting(const char* msg) : PSERROR(msg) { }
PSERROR_Serialize::PSERROR_Serialize(const char* msg) : PSERROR(msg) { }
@ -291,109 +267,89 @@ PSERROR_File_WriteFailed::PSERROR_File_WriteFailed() : PSERROR_File(NULL) { }
PSERROR_File_WriteFailed::PSERROR_File_WriteFailed(const char* msg) : PSERROR_File(msg) { }
PSRETURN PSERROR_File_WriteFailed::getCode() const { return 0x05000006; }
PSERROR_GUI_InvalidSetting::PSERROR_GUI_InvalidSetting() : PSERROR_GUI(NULL) { }
PSERROR_GUI_InvalidSetting::PSERROR_GUI_InvalidSetting(const char* msg) : PSERROR_GUI(msg) { }
PSRETURN PSERROR_GUI_InvalidSetting::getCode() const { return 0x06000001; }
PSERROR_GUI_JSOpenFailed::PSERROR_GUI_JSOpenFailed() : PSERROR_GUI(NULL) { }
PSERROR_GUI_JSOpenFailed::PSERROR_GUI_JSOpenFailed(const char* msg) : PSERROR_GUI(msg) { }
PSRETURN PSERROR_GUI_JSOpenFailed::getCode() const { return 0x06000002; }
PSERROR_GUI_NameAmbiguity::PSERROR_GUI_NameAmbiguity() : PSERROR_GUI(NULL) { }
PSERROR_GUI_NameAmbiguity::PSERROR_GUI_NameAmbiguity(const char* msg) : PSERROR_GUI(msg) { }
PSRETURN PSERROR_GUI_NameAmbiguity::getCode() const { return 0x06000003; }
PSERROR_GUI_ObjectNeedsName::PSERROR_GUI_ObjectNeedsName() : PSERROR_GUI(NULL) { }
PSERROR_GUI_ObjectNeedsName::PSERROR_GUI_ObjectNeedsName(const char* msg) : PSERROR_GUI(msg) { }
PSRETURN PSERROR_GUI_ObjectNeedsName::getCode() const { return 0x06000004; }
PSERROR_GUI_OperationNeedsGUIObject::PSERROR_GUI_OperationNeedsGUIObject() : PSERROR_GUI(NULL) { }
PSERROR_GUI_OperationNeedsGUIObject::PSERROR_GUI_OperationNeedsGUIObject(const char* msg) : PSERROR_GUI(msg) { }
PSRETURN PSERROR_GUI_OperationNeedsGUIObject::getCode() const { return 0x06000005; }
PSERROR_Game_World_MapLoadFailed::PSERROR_Game_World_MapLoadFailed() : PSERROR_Game_World(NULL) { }
PSERROR_Game_World_MapLoadFailed::PSERROR_Game_World_MapLoadFailed(const char* msg) : PSERROR_Game_World(msg) { }
PSRETURN PSERROR_Game_World_MapLoadFailed::getCode() const { return 0x07030001; }
PSRETURN PSERROR_Game_World_MapLoadFailed::getCode() const { return 0x06030001; }
PSERROR_Scripting_DefineType_AlreadyExists::PSERROR_Scripting_DefineType_AlreadyExists() : PSERROR_Scripting_DefineType(NULL) { }
PSERROR_Scripting_DefineType_AlreadyExists::PSERROR_Scripting_DefineType_AlreadyExists(const char* msg) : PSERROR_Scripting_DefineType(msg) { }
PSRETURN PSERROR_Scripting_DefineType_AlreadyExists::getCode() const { return 0x08010001; }
PSRETURN PSERROR_Scripting_DefineType_AlreadyExists::getCode() const { return 0x07010001; }
PSERROR_Scripting_DefineType_CreationFailed::PSERROR_Scripting_DefineType_CreationFailed() : PSERROR_Scripting_DefineType(NULL) { }
PSERROR_Scripting_DefineType_CreationFailed::PSERROR_Scripting_DefineType_CreationFailed(const char* msg) : PSERROR_Scripting_DefineType(msg) { }
PSRETURN PSERROR_Scripting_DefineType_CreationFailed::getCode() const { return 0x08010002; }
PSRETURN PSERROR_Scripting_DefineType_CreationFailed::getCode() const { return 0x07010002; }
PSERROR_Scripting_LoadFile_EvalErrors::PSERROR_Scripting_LoadFile_EvalErrors() : PSERROR_Scripting_LoadFile(NULL) { }
PSERROR_Scripting_LoadFile_EvalErrors::PSERROR_Scripting_LoadFile_EvalErrors(const char* msg) : PSERROR_Scripting_LoadFile(msg) { }
PSRETURN PSERROR_Scripting_LoadFile_EvalErrors::getCode() const { return 0x08020001; }
PSRETURN PSERROR_Scripting_LoadFile_EvalErrors::getCode() const { return 0x07020001; }
PSERROR_Scripting_LoadFile_OpenFailed::PSERROR_Scripting_LoadFile_OpenFailed() : PSERROR_Scripting_LoadFile(NULL) { }
PSERROR_Scripting_LoadFile_OpenFailed::PSERROR_Scripting_LoadFile_OpenFailed(const char* msg) : PSERROR_Scripting_LoadFile(msg) { }
PSRETURN PSERROR_Scripting_LoadFile_OpenFailed::getCode() const { return 0x08020002; }
PSRETURN PSERROR_Scripting_LoadFile_OpenFailed::getCode() const { return 0x07020002; }
PSERROR_Scripting_CallFunctionFailed::PSERROR_Scripting_CallFunctionFailed() : PSERROR_Scripting(NULL) { }
PSERROR_Scripting_CallFunctionFailed::PSERROR_Scripting_CallFunctionFailed(const char* msg) : PSERROR_Scripting(msg) { }
PSRETURN PSERROR_Scripting_CallFunctionFailed::getCode() const { return 0x08000001; }
PSRETURN PSERROR_Scripting_CallFunctionFailed::getCode() const { return 0x07000001; }
PSERROR_Scripting_CreateObjectFailed::PSERROR_Scripting_CreateObjectFailed() : PSERROR_Scripting(NULL) { }
PSERROR_Scripting_CreateObjectFailed::PSERROR_Scripting_CreateObjectFailed(const char* msg) : PSERROR_Scripting(msg) { }
PSRETURN PSERROR_Scripting_CreateObjectFailed::getCode() const { return 0x08000002; }
PSRETURN PSERROR_Scripting_CreateObjectFailed::getCode() const { return 0x07000002; }
PSERROR_Scripting_DefineConstantFailed::PSERROR_Scripting_DefineConstantFailed() : PSERROR_Scripting(NULL) { }
PSERROR_Scripting_DefineConstantFailed::PSERROR_Scripting_DefineConstantFailed(const char* msg) : PSERROR_Scripting(msg) { }
PSRETURN PSERROR_Scripting_DefineConstantFailed::getCode() const { return 0x08000003; }
PSRETURN PSERROR_Scripting_DefineConstantFailed::getCode() const { return 0x07000003; }
PSERROR_Scripting_RegisterFunctionFailed::PSERROR_Scripting_RegisterFunctionFailed() : PSERROR_Scripting(NULL) { }
PSERROR_Scripting_RegisterFunctionFailed::PSERROR_Scripting_RegisterFunctionFailed(const char* msg) : PSERROR_Scripting(msg) { }
PSRETURN PSERROR_Scripting_RegisterFunctionFailed::getCode() const { return 0x08000004; }
PSRETURN PSERROR_Scripting_RegisterFunctionFailed::getCode() const { return 0x07000004; }
PSERROR_Scripting_SetupFailed::PSERROR_Scripting_SetupFailed() : PSERROR_Scripting(NULL) { }
PSERROR_Scripting_SetupFailed::PSERROR_Scripting_SetupFailed(const char* msg) : PSERROR_Scripting(msg) { }
PSRETURN PSERROR_Scripting_SetupFailed::getCode() const { return 0x08000005; }
PSRETURN PSERROR_Scripting_SetupFailed::getCode() const { return 0x07000005; }
PSERROR_Scripting_TypeDoesNotExist::PSERROR_Scripting_TypeDoesNotExist() : PSERROR_Scripting(NULL) { }
PSERROR_Scripting_TypeDoesNotExist::PSERROR_Scripting_TypeDoesNotExist(const char* msg) : PSERROR_Scripting(msg) { }
PSRETURN PSERROR_Scripting_TypeDoesNotExist::getCode() const { return 0x08000006; }
PSRETURN PSERROR_Scripting_TypeDoesNotExist::getCode() const { return 0x07000006; }
PSERROR_Serialize_InvalidCharInString::PSERROR_Serialize_InvalidCharInString() : PSERROR_Serialize(NULL) { }
PSERROR_Serialize_InvalidCharInString::PSERROR_Serialize_InvalidCharInString(const char* msg) : PSERROR_Serialize(msg) { }
PSRETURN PSERROR_Serialize_InvalidCharInString::getCode() const { return 0x09000001; }
PSRETURN PSERROR_Serialize_InvalidCharInString::getCode() const { return 0x08000001; }
PSERROR_Serialize_InvalidScriptValue::PSERROR_Serialize_InvalidScriptValue() : PSERROR_Serialize(NULL) { }
PSERROR_Serialize_InvalidScriptValue::PSERROR_Serialize_InvalidScriptValue(const char* msg) : PSERROR_Serialize(msg) { }
PSRETURN PSERROR_Serialize_InvalidScriptValue::getCode() const { return 0x09000002; }
PSRETURN PSERROR_Serialize_InvalidScriptValue::getCode() const { return 0x08000002; }
PSERROR_Serialize_OutOfBounds::PSERROR_Serialize_OutOfBounds() : PSERROR_Serialize(NULL) { }
PSERROR_Serialize_OutOfBounds::PSERROR_Serialize_OutOfBounds(const char* msg) : PSERROR_Serialize(msg) { }
PSRETURN PSERROR_Serialize_OutOfBounds::getCode() const { return 0x09000003; }
PSRETURN PSERROR_Serialize_OutOfBounds::getCode() const { return 0x08000003; }
PSERROR_Serialize_ScriptError::PSERROR_Serialize_ScriptError() : PSERROR_Serialize(NULL) { }
PSERROR_Serialize_ScriptError::PSERROR_Serialize_ScriptError(const char* msg) : PSERROR_Serialize(msg) { }
PSRETURN PSERROR_Serialize_ScriptError::getCode() const { return 0x09000004; }
PSRETURN PSERROR_Serialize_ScriptError::getCode() const { return 0x08000004; }
PSERROR_System_RequiredExtensionsMissing::PSERROR_System_RequiredExtensionsMissing() : PSERROR_System(NULL) { }
PSERROR_System_RequiredExtensionsMissing::PSERROR_System_RequiredExtensionsMissing(const char* msg) : PSERROR_System(msg) { }
PSRETURN PSERROR_System_RequiredExtensionsMissing::getCode() const { return 0x0a000001; }
PSRETURN PSERROR_System_RequiredExtensionsMissing::getCode() const { return 0x09000001; }
PSERROR_System_SDLInitFailed::PSERROR_System_SDLInitFailed() : PSERROR_System(NULL) { }
PSERROR_System_SDLInitFailed::PSERROR_System_SDLInitFailed(const char* msg) : PSERROR_System(msg) { }
PSRETURN PSERROR_System_SDLInitFailed::getCode() const { return 0x0a000002; }
PSRETURN PSERROR_System_SDLInitFailed::getCode() const { return 0x09000002; }
PSERROR_System_VmodeFailed::PSERROR_System_VmodeFailed() : PSERROR_System(NULL) { }
PSERROR_System_VmodeFailed::PSERROR_System_VmodeFailed(const char* msg) : PSERROR_System(msg) { }
PSRETURN PSERROR_System_VmodeFailed::getCode() const { return 0x0a000003; }
PSRETURN PSERROR_System_VmodeFailed::getCode() const { return 0x09000003; }
PSERROR_Xeromyces_XMLOpenFailed::PSERROR_Xeromyces_XMLOpenFailed() : PSERROR_Xeromyces(NULL) { }
PSERROR_Xeromyces_XMLOpenFailed::PSERROR_Xeromyces_XMLOpenFailed(const char* msg) : PSERROR_Xeromyces(msg) { }
PSRETURN PSERROR_Xeromyces_XMLOpenFailed::getCode() const { return 0x0b000001; }
PSRETURN PSERROR_Xeromyces_XMLOpenFailed::getCode() const { return 0x0a000001; }
PSERROR_Xeromyces_XMLParseError::PSERROR_Xeromyces_XMLParseError() : PSERROR_Xeromyces(NULL) { }
PSERROR_Xeromyces_XMLParseError::PSERROR_Xeromyces_XMLParseError(const char* msg) : PSERROR_Xeromyces(msg) { }
PSRETURN PSERROR_Xeromyces_XMLParseError::getCode() const { return 0x0b000002; }
PSRETURN PSERROR_Xeromyces_XMLParseError::getCode() const { return 0x0a000002; }
PSERROR_Xeromyces_XMLValidationFailed::PSERROR_Xeromyces_XMLValidationFailed() : PSERROR_Xeromyces(NULL) { }
PSERROR_Xeromyces_XMLValidationFailed::PSERROR_Xeromyces_XMLValidationFailed(const char* msg) : PSERROR_Xeromyces(msg) { }
PSRETURN PSERROR_Xeromyces_XMLValidationFailed::getCode() const { return 0x0b000003; }
PSRETURN PSERROR_Xeromyces_XMLValidationFailed::getCode() const { return 0x0a000003; }
PSERROR::PSERROR(const char* msg) : m_msg(msg) { }
@ -422,32 +378,27 @@ const char* GetErrorString(PSRETURN code)
case 0x05000004: return "File_ReadFailed";
case 0x05000005: return "File_UnexpectedEOF";
case 0x05000006: return "File_WriteFailed";
case 0x06000001: return "GUI_InvalidSetting";
case 0x06000002: return "GUI_JSOpenFailed";
case 0x06000003: return "GUI_NameAmbiguity";
case 0x06000004: return "GUI_ObjectNeedsName";
case 0x06000005: return "GUI_OperationNeedsGUIObject";
case 0x07030001: return "Game_World_MapLoadFailed";
case 0x08010001: return "Scripting_DefineType_AlreadyExists";
case 0x08010002: return "Scripting_DefineType_CreationFailed";
case 0x08020001: return "Scripting_LoadFile_EvalErrors";
case 0x08020002: return "Scripting_LoadFile_OpenFailed";
case 0x08000001: return "Scripting_CallFunctionFailed";
case 0x08000002: return "Scripting_CreateObjectFailed";
case 0x08000003: return "Scripting_DefineConstantFailed";
case 0x08000004: return "Scripting_RegisterFunctionFailed";
case 0x08000005: return "Scripting_SetupFailed";
case 0x08000006: return "Scripting_TypeDoesNotExist";
case 0x09000001: return "Serialize_InvalidCharInString";
case 0x09000002: return "Serialize_InvalidScriptValue";
case 0x09000003: return "Serialize_OutOfBounds";
case 0x09000004: return "Serialize_ScriptError";
case 0x0a000001: return "System_RequiredExtensionsMissing";
case 0x0a000002: return "System_SDLInitFailed";
case 0x0a000003: return "System_VmodeFailed";
case 0x0b000001: return "Xeromyces_XMLOpenFailed";
case 0x0b000002: return "Xeromyces_XMLParseError";
case 0x0b000003: return "Xeromyces_XMLValidationFailed";
case 0x06030001: return "Game_World_MapLoadFailed";
case 0x07010001: return "Scripting_DefineType_AlreadyExists";
case 0x07010002: return "Scripting_DefineType_CreationFailed";
case 0x07020001: return "Scripting_LoadFile_EvalErrors";
case 0x07020002: return "Scripting_LoadFile_OpenFailed";
case 0x07000001: return "Scripting_CallFunctionFailed";
case 0x07000002: return "Scripting_CreateObjectFailed";
case 0x07000003: return "Scripting_DefineConstantFailed";
case 0x07000004: return "Scripting_RegisterFunctionFailed";
case 0x07000005: return "Scripting_SetupFailed";
case 0x07000006: return "Scripting_TypeDoesNotExist";
case 0x08000001: return "Serialize_InvalidCharInString";
case 0x08000002: return "Serialize_InvalidScriptValue";
case 0x08000003: return "Serialize_OutOfBounds";
case 0x08000004: return "Serialize_ScriptError";
case 0x09000001: return "System_RequiredExtensionsMissing";
case 0x09000002: return "System_SDLInitFailed";
case 0x09000003: return "System_VmodeFailed";
case 0x0a000001: return "Xeromyces_XMLOpenFailed";
case 0x0a000002: return "Xeromyces_XMLParseError";
case 0x0a000003: return "Xeromyces_XMLValidationFailed";
default: return "Unrecognised error";
}
@ -472,32 +423,27 @@ void ThrowError(PSRETURN code)
case 0x05000004: throw PSERROR_File_ReadFailed(); break;
case 0x05000005: throw PSERROR_File_UnexpectedEOF(); break;
case 0x05000006: throw PSERROR_File_WriteFailed(); break;
case 0x06000001: throw PSERROR_GUI_InvalidSetting(); break;
case 0x06000002: throw PSERROR_GUI_JSOpenFailed(); break;
case 0x06000003: throw PSERROR_GUI_NameAmbiguity(); break;
case 0x06000004: throw PSERROR_GUI_ObjectNeedsName(); break;
case 0x06000005: throw PSERROR_GUI_OperationNeedsGUIObject(); break;
case 0x07030001: throw PSERROR_Game_World_MapLoadFailed(); break;
case 0x08010001: throw PSERROR_Scripting_DefineType_AlreadyExists(); break;
case 0x08010002: throw PSERROR_Scripting_DefineType_CreationFailed(); break;
case 0x08020001: throw PSERROR_Scripting_LoadFile_EvalErrors(); break;
case 0x08020002: throw PSERROR_Scripting_LoadFile_OpenFailed(); break;
case 0x08000001: throw PSERROR_Scripting_CallFunctionFailed(); break;
case 0x08000002: throw PSERROR_Scripting_CreateObjectFailed(); break;
case 0x08000003: throw PSERROR_Scripting_DefineConstantFailed(); break;
case 0x08000004: throw PSERROR_Scripting_RegisterFunctionFailed(); break;
case 0x08000005: throw PSERROR_Scripting_SetupFailed(); break;
case 0x08000006: throw PSERROR_Scripting_TypeDoesNotExist(); break;
case 0x09000001: throw PSERROR_Serialize_InvalidCharInString(); break;
case 0x09000002: throw PSERROR_Serialize_InvalidScriptValue(); break;
case 0x09000003: throw PSERROR_Serialize_OutOfBounds(); break;
case 0x09000004: throw PSERROR_Serialize_ScriptError(); break;
case 0x0a000001: throw PSERROR_System_RequiredExtensionsMissing(); break;
case 0x0a000002: throw PSERROR_System_SDLInitFailed(); break;
case 0x0a000003: throw PSERROR_System_VmodeFailed(); break;
case 0x0b000001: throw PSERROR_Xeromyces_XMLOpenFailed(); break;
case 0x0b000002: throw PSERROR_Xeromyces_XMLParseError(); break;
case 0x0b000003: throw PSERROR_Xeromyces_XMLValidationFailed(); break;
case 0x06030001: throw PSERROR_Game_World_MapLoadFailed(); break;
case 0x07010001: throw PSERROR_Scripting_DefineType_AlreadyExists(); break;
case 0x07010002: throw PSERROR_Scripting_DefineType_CreationFailed(); break;
case 0x07020001: throw PSERROR_Scripting_LoadFile_EvalErrors(); break;
case 0x07020002: throw PSERROR_Scripting_LoadFile_OpenFailed(); break;
case 0x07000001: throw PSERROR_Scripting_CallFunctionFailed(); break;
case 0x07000002: throw PSERROR_Scripting_CreateObjectFailed(); break;
case 0x07000003: throw PSERROR_Scripting_DefineConstantFailed(); break;
case 0x07000004: throw PSERROR_Scripting_RegisterFunctionFailed(); break;
case 0x07000005: throw PSERROR_Scripting_SetupFailed(); break;
case 0x07000006: throw PSERROR_Scripting_TypeDoesNotExist(); break;
case 0x08000001: throw PSERROR_Serialize_InvalidCharInString(); break;
case 0x08000002: throw PSERROR_Serialize_InvalidScriptValue(); break;
case 0x08000003: throw PSERROR_Serialize_OutOfBounds(); break;
case 0x08000004: throw PSERROR_Serialize_ScriptError(); break;
case 0x09000001: throw PSERROR_System_RequiredExtensionsMissing(); break;
case 0x09000002: throw PSERROR_System_SDLInitFailed(); break;
case 0x09000003: throw PSERROR_System_VmodeFailed(); break;
case 0x0a000001: throw PSERROR_Xeromyces_XMLOpenFailed(); break;
case 0x0a000002: throw PSERROR_Xeromyces_XMLParseError(); break;
case 0x0a000003: throw PSERROR_Xeromyces_XMLValidationFailed(); break;
default: throw PSERROR_Error_InvalidError(); // Hmm...
}