1
0
forked from 0ad/0ad

Removing PS_RESULT errors from GUI, return values still need work

Affects Ticket #128

This was SVN commit r7145.
This commit is contained in:
sluzky 2009-09-23 21:16:55 +00:00
parent f118acf979
commit 90f6641c1d
8 changed files with 110 additions and 89 deletions

View File

@ -267,7 +267,7 @@ CRect CDropDown::GetListRect() const
bool CDropDown::MouseOver() bool CDropDown::MouseOver()
{ {
if(!GetGUI()) if(!GetGUI())
throw PS_NEEDS_PGUI; throw PSERROR_GUI_OperationNeedsGUIObject();
if (m_Open) if (m_Open)
{ {

View File

@ -32,10 +32,6 @@ CGUI
#ifndef INCLUDED_CGUI #ifndef INCLUDED_CGUI
#define INCLUDED_CGUI #define INCLUDED_CGUI
#include "ps/Errors.h"
ERROR_GROUP(GUI);
ERROR_TYPE(GUI, JSOpenFailed);
//-------------------------------------------------------- //--------------------------------------------------------
// Includes / Compiler directives // Includes / Compiler directives
//-------------------------------------------------------- //--------------------------------------------------------
@ -66,6 +62,8 @@ extern InReaction gui_handler(const SDL_Event_* ev);
// Error declarations // Error declarations
//-------------------------------------------------------- //--------------------------------------------------------
ERROR_TYPE(GUI, JSOpenFailed);
//-------------------------------------------------------- //--------------------------------------------------------
// Declarations // Declarations
//-------------------------------------------------------- //--------------------------------------------------------

View File

@ -182,14 +182,3 @@ bool CClientArea::SetClientArea(const CStr& Value)
//-------------------------------------------------------- //--------------------------------------------------------
// Error definitions // Error definitions
//-------------------------------------------------------- //--------------------------------------------------------
// TODO Gee: (2004-09-01) Keeper? The PS_NAME_ABIGUITY for instance doesn't let the user know which objects.
DEFINE_ERROR(PS_NAME_TAKEN, "Reference name is taken");
DEFINE_ERROR(PS_OBJECT_FAIL, "Object provided is null");
DEFINE_ERROR(PS_SETTING_FAIL, "Setting does not exist");
DEFINE_ERROR(PS_VALUE_INVALID, "Value provided is syntactically incorrect");
DEFINE_ERROR(PS_NEEDS_PGUI, "m_pGUI is NULL when needed for a requested operation");
DEFINE_ERROR(PS_NAME_AMBIGUITY, "Two or more objects are sharing name");
DEFINE_ERROR(PS_NEEDS_NAME, "An object are trying to fit into a GUI without a name");
DEFINE_ERROR(PS_LEXICAL_FAIL, "PS_LEXICAL_FAIL");
DEFINE_ERROR(PS_SYNTACTICAL_FAIL, "PS_SYNTACTICAL_FAIL");

View File

@ -44,6 +44,9 @@ GUI Core, stuff that the whole GUI uses
#include "ps/Overlay.h" #include "ps/Overlay.h"
#include "ps/CStr.h" #include "ps/CStr.h"
#include "ps/Errors.h"
#include "ps/Pyrogenesis.h" // deprecated DECLARE_ERROR #include "ps/Pyrogenesis.h" // deprecated DECLARE_ERROR
//-------------------------------------------------------- //--------------------------------------------------------
@ -217,15 +220,14 @@ public:
//-------------------------------------------------------- //--------------------------------------------------------
// Error declarations // Error declarations
//-------------------------------------------------------- //--------------------------------------------------------
DECLARE_ERROR(PS_NAME_TAKEN); ERROR_GROUP(GUI);
DECLARE_ERROR(PS_OBJECT_FAIL);
DECLARE_ERROR(PS_SETTING_FAIL);
DECLARE_ERROR(PS_VALUE_INVALID);
DECLARE_ERROR(PS_NEEDS_PGUI);
DECLARE_ERROR(PS_NAME_AMBIGUITY);
DECLARE_ERROR(PS_NEEDS_NAME);
DECLARE_ERROR(PS_LEXICAL_FAIL); ERROR_TYPE(GUI, ReferenceNameTake);
DECLARE_ERROR(PS_SYNTACTICAL_FAIL); ERROR_TYPE(GUI, NullObjectProvided);
ERROR_TYPE(GUI, InvalidSetting);
ERROR_TYPE(GUI, InvalidValueSyntax);
ERROR_TYPE(GUI, OperationNeedsGUIObject);
ERROR_TYPE(GUI, NameAmbiguity);
ERROR_TYPE(GUI, ObjectNeedsName);
#endif #endif

View File

@ -310,11 +310,11 @@ template <typename T>
PS_RESULT GUI<T>::GetSettingPointer(const IGUIObject *pObject, const CStr& Setting, T* &Value) PS_RESULT GUI<T>::GetSettingPointer(const IGUIObject *pObject, const CStr& Setting, T* &Value)
{ {
if (pObject == NULL) if (pObject == NULL)
return PS_OBJECT_FAIL; throw PSERROR_GUI_NullObjectProvided();
std::map<CStr, SGUISetting>::const_iterator it = pObject->m_Settings.find(Setting); std::map<CStr, SGUISetting>::const_iterator it = pObject->m_Settings.find(Setting);
if (it == pObject->m_Settings.end()) if (it == pObject->m_Settings.end())
return PS_SETTING_FAIL; throw PSERROR_GUI_InvalidSetting();
if (it->second.m_pSetting == NULL) if (it->second.m_pSetting == NULL)
return PS_FAIL; return PS_FAIL;
@ -344,10 +344,10 @@ PS_RESULT GUI<T>::SetSetting(IGUIObject *pObject, const CStr& Setting,
const T &Value, const bool& SkipMessage) const T &Value, const bool& SkipMessage)
{ {
if (pObject == NULL) if (pObject == NULL)
return PS_OBJECT_FAIL; throw PSERROR_GUI_NullObjectProvided();
if (!pObject->SettingExists(Setting)) if (!pObject->SettingExists(Setting))
return PS_SETTING_FAIL; throw PSERROR_GUI_InvalidSetting();
#ifndef NDEBUG #ifndef NDEBUG
CheckType<T>(pObject, Setting); CheckType<T>(pObject, Setting);

View File

@ -163,7 +163,7 @@ public:
const CStr& Setting, T &Value) const CStr& Setting, T &Value)
{ {
if (!GUIinstance.ObjectExists(Object)) if (!GUIinstance.ObjectExists(Object))
return PS_OBJECT_FAIL; throw PSERROR_GUI_NullObjectProvided();
// Retrieve pointer and call sibling function // Retrieve pointer and call sibling function
const IGUIObject *pObject = GetObjectPointer(GUIinstance, Object); const IGUIObject *pObject = GetObjectPointer(GUIinstance, Object);
@ -201,7 +201,7 @@ public:
const bool& SkipMessage=false) const bool& SkipMessage=false)
{ {
if (!GUIinstance.ObjectExists(Object)) if (!GUIinstance.ObjectExists(Object))
return PS_OBJECT_FAIL; throw PSERROR_GUI_NullObjectProvided();
// Retrieve pointer and call sibling function // Retrieve pointer and call sibling function

View File

@ -147,11 +147,11 @@ void IGUIObject::AddToPointersMap(map_pObjects &ObjectMap)
// (i.e. being the base object) // (i.e. being the base object)
if (m_Name.empty()) if (m_Name.empty())
{ {
throw PS_NEEDS_NAME; throw PSERROR_GUI_ObjectNeedsName();
} }
if (ObjectMap.count(m_Name) > 0) if (ObjectMap.count(m_Name) > 0)
{ {
throw PS_NAME_AMBIGUITY; throw PSERROR_GUI_NameAmbiguity();
} }
else else
{ {
@ -195,7 +195,7 @@ void IGUIObject::AddSetting(const EGUISettingType &Type, const CStr& Name)
bool IGUIObject::MouseOver() bool IGUIObject::MouseOver()
{ {
if(!GetGUI()) if(!GetGUI())
throw PS_NEEDS_PGUI; throw PSERROR_GUI_OperationNeedsGUIObject();
return m_CachedActualSize.PointInside(GetMousePos()); return m_CachedActualSize.PointInside(GetMousePos());
} }
@ -282,7 +282,7 @@ PS_RESULT IGUIObject::SetSetting(const CStr& Setting, const CStr& Value, const b
PS_RESULT IGUIObject::GetSettingType(const CStr& Setting, EGUISettingType &Type) const PS_RESULT IGUIObject::GetSettingType(const CStr& Setting, EGUISettingType &Type) const
{ {
if (!SettingExists(Setting)) if (!SettingExists(Setting))
return PS_SETTING_FAIL; throw PSERROR_GUI_InvalidSetting();
if (m_Settings.find(Setting) == m_Settings.end()) if (m_Settings.find(Setting) == m_Settings.end())
return PS_FAIL; return PS_FAIL;

View File

@ -1,20 +1,3 @@
/* Copyright (C) 2009 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
// Auto-generated by errorlist.pl - do not edit. // Auto-generated by errorlist.pl - do not edit.
#include "precompiled.h" #include "precompiled.h"
@ -50,7 +33,14 @@ class PSERROR_File_OpenFailed : public PSERROR_File { public: PSRETURN getCode()
class PSERROR_File_ReadFailed : public PSERROR_File { public: PSRETURN getCode() const; }; class PSERROR_File_ReadFailed : public PSERROR_File { public: PSRETURN getCode() const; };
class PSERROR_File_UnexpectedEOF : public PSERROR_File { public: PSRETURN getCode() const; }; class PSERROR_File_UnexpectedEOF : public PSERROR_File { public: PSRETURN getCode() const; };
class PSERROR_File_WriteFailed : public PSERROR_File { public: PSRETURN getCode() const; }; class PSERROR_File_WriteFailed : public PSERROR_File { public: PSRETURN getCode() const; };
class PSERROR_GUI_InvalidSetting : public PSERROR_GUI { public: PSRETURN getCode() const; };
class PSERROR_GUI_InvalidValueSyntax : public PSERROR_GUI { public: PSRETURN getCode() const; };
class PSERROR_GUI_JSOpenFailed : public PSERROR_GUI { public: PSRETURN getCode() const; }; class PSERROR_GUI_JSOpenFailed : public PSERROR_GUI { public: PSRETURN getCode() const; };
class PSERROR_GUI_NameAmbiguity : public PSERROR_GUI { public: PSRETURN getCode() const; };
class PSERROR_GUI_NullObjectProvided : public PSERROR_GUI { public: PSRETURN getCode() const; };
class PSERROR_GUI_ObjectNeedsName : public PSERROR_GUI { public: PSRETURN getCode() const; };
class PSERROR_GUI_OperationNeedsGUIObject : public PSERROR_GUI { public: PSRETURN getCode() const; };
class PSERROR_GUI_ReferenceNameTake : public PSERROR_GUI { public: PSRETURN getCode() const; };
class PSERROR_Game_World_MapLoadFailed : public PSERROR_Game_World { public: PSRETURN getCode() const; }; class PSERROR_Game_World_MapLoadFailed : public PSERROR_Game_World { public: PSRETURN getCode() const; };
class PSERROR_I18n_Script_SetupFailed : public PSERROR_I18n_Script { public: PSRETURN getCode() const; }; class PSERROR_I18n_Script_SetupFailed : public PSERROR_I18n_Script { public: PSRETURN getCode() const; };
class PSERROR_Renderer_VBOFailed : public PSERROR_Renderer { public: PSRETURN getCode() const; }; class PSERROR_Renderer_VBOFailed : public PSERROR_Renderer { public: PSRETURN getCode() const; };
@ -83,7 +73,14 @@ extern const PSRETURN PSRETURN_File_OpenFailed = 0x04000003;
extern const PSRETURN PSRETURN_File_ReadFailed = 0x04000004; extern const PSRETURN PSRETURN_File_ReadFailed = 0x04000004;
extern const PSRETURN PSRETURN_File_UnexpectedEOF = 0x04000005; extern const PSRETURN PSRETURN_File_UnexpectedEOF = 0x04000005;
extern const PSRETURN PSRETURN_File_WriteFailed = 0x04000006; extern const PSRETURN PSRETURN_File_WriteFailed = 0x04000006;
extern const PSRETURN PSRETURN_GUI_JSOpenFailed = 0x05000001; extern const PSRETURN PSRETURN_GUI_InvalidSetting = 0x05000001;
extern const PSRETURN PSRETURN_GUI_InvalidValueSyntax = 0x05000002;
extern const PSRETURN PSRETURN_GUI_JSOpenFailed = 0x05000003;
extern const PSRETURN PSRETURN_GUI_NameAmbiguity = 0x05000004;
extern const PSRETURN PSRETURN_GUI_NullObjectProvided = 0x05000005;
extern const PSRETURN PSRETURN_GUI_ObjectNeedsName = 0x05000006;
extern const PSRETURN PSRETURN_GUI_OperationNeedsGUIObject = 0x05000007;
extern const PSRETURN PSRETURN_GUI_ReferenceNameTake = 0x05000008;
extern const PSRETURN PSRETURN_Game_World_MapLoadFailed = 0x06040001; extern const PSRETURN PSRETURN_Game_World_MapLoadFailed = 0x06040001;
extern const PSRETURN PSRETURN_I18n_Script_SetupFailed = 0x07030001; extern const PSRETURN PSRETURN_I18n_Script_SetupFailed = 0x07030001;
extern const PSRETURN PSRETURN_Renderer_VBOFailed = 0x08000001; extern const PSRETURN PSRETURN_Renderer_VBOFailed = 0x08000001;
@ -135,69 +132,83 @@ extern const PSRETURN CODE__PSRETURN_Scripting_DefineType = 0x09010000;
extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile = 0xffff0000; extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile = 0xffff0000;
extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile = 0x09020000; extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile = 0x09020000;
extern const PSRETURN MASK__PSRETURN_CVFSFile_AlreadyLoaded = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_CVFSFile_AlreadyLoaded = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_CVFSFile_AlreadyLoaded = 0x01000001; extern const PSRETURN CODE__PSRETURN_CVFSFile_AlreadyLoaded = 0x01000001;
extern const PSRETURN MASK__PSRETURN_CVFSFile_InvalidBufferAccess = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_CVFSFile_InvalidBufferAccess = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_CVFSFile_InvalidBufferAccess = 0x01000002; extern const PSRETURN CODE__PSRETURN_CVFSFile_InvalidBufferAccess = 0x01000002;
extern const PSRETURN MASK__PSRETURN_CVFSFile_LoadFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_CVFSFile_LoadFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_CVFSFile_LoadFailed = 0x01000003; extern const PSRETURN CODE__PSRETURN_CVFSFile_LoadFailed = 0x01000003;
extern const PSRETURN MASK__PSRETURN_DllLoader_DllNotLoaded = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_DllLoader_DllNotLoaded = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_DllLoader_DllNotLoaded = 0x02000001; extern const PSRETURN CODE__PSRETURN_DllLoader_DllNotLoaded = 0x02000001;
extern const PSRETURN MASK__PSRETURN_DllLoader_SymbolNotFound = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_DllLoader_SymbolNotFound = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_DllLoader_SymbolNotFound = 0x02000002; extern const PSRETURN CODE__PSRETURN_DllLoader_SymbolNotFound = 0x02000002;
extern const PSRETURN MASK__PSRETURN_Error_InvalidError = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Error_InvalidError = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Error_InvalidError = 0x03000001; extern const PSRETURN CODE__PSRETURN_Error_InvalidError = 0x03000001;
extern const PSRETURN MASK__PSRETURN_File_InvalidType = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_File_InvalidType = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_File_InvalidType = 0x04000001; extern const PSRETURN CODE__PSRETURN_File_InvalidType = 0x04000001;
extern const PSRETURN MASK__PSRETURN_File_InvalidVersion = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_File_InvalidVersion = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_File_InvalidVersion = 0x04000002; extern const PSRETURN CODE__PSRETURN_File_InvalidVersion = 0x04000002;
extern const PSRETURN MASK__PSRETURN_File_OpenFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_File_OpenFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_File_OpenFailed = 0x04000003; extern const PSRETURN CODE__PSRETURN_File_OpenFailed = 0x04000003;
extern const PSRETURN MASK__PSRETURN_File_ReadFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_File_ReadFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_File_ReadFailed = 0x04000004; extern const PSRETURN CODE__PSRETURN_File_ReadFailed = 0x04000004;
extern const PSRETURN MASK__PSRETURN_File_UnexpectedEOF = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_File_UnexpectedEOF = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_File_UnexpectedEOF = 0x04000005; extern const PSRETURN CODE__PSRETURN_File_UnexpectedEOF = 0x04000005;
extern const PSRETURN MASK__PSRETURN_File_WriteFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_File_WriteFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_File_WriteFailed = 0x04000006; extern const PSRETURN CODE__PSRETURN_File_WriteFailed = 0x04000006;
extern const PSRETURN MASK__PSRETURN_GUI_JSOpenFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_GUI_InvalidSetting = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_JSOpenFailed = 0x05000001; extern const PSRETURN CODE__PSRETURN_GUI_InvalidSetting = 0x05000001;
extern const PSRETURN MASK__PSRETURN_Game_World_MapLoadFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_GUI_InvalidValueSyntax = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_InvalidValueSyntax = 0x05000002;
extern const PSRETURN MASK__PSRETURN_GUI_JSOpenFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_JSOpenFailed = 0x05000003;
extern const PSRETURN MASK__PSRETURN_GUI_NameAmbiguity = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_NameAmbiguity = 0x05000004;
extern const PSRETURN MASK__PSRETURN_GUI_NullObjectProvided = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_NullObjectProvided = 0x05000005;
extern const PSRETURN MASK__PSRETURN_GUI_ObjectNeedsName = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_ObjectNeedsName = 0x05000006;
extern const PSRETURN MASK__PSRETURN_GUI_OperationNeedsGUIObject = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_OperationNeedsGUIObject = 0x05000007;
extern const PSRETURN MASK__PSRETURN_GUI_ReferenceNameTake = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_GUI_ReferenceNameTake = 0x05000008;
extern const PSRETURN MASK__PSRETURN_Game_World_MapLoadFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Game_World_MapLoadFailed = 0x06040001; extern const PSRETURN CODE__PSRETURN_Game_World_MapLoadFailed = 0x06040001;
extern const PSRETURN MASK__PSRETURN_I18n_Script_SetupFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_I18n_Script_SetupFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_I18n_Script_SetupFailed = 0x07030001; extern const PSRETURN CODE__PSRETURN_I18n_Script_SetupFailed = 0x07030001;
extern const PSRETURN MASK__PSRETURN_Renderer_VBOFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Renderer_VBOFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Renderer_VBOFailed = 0x08000001; extern const PSRETURN CODE__PSRETURN_Renderer_VBOFailed = 0x08000001;
extern const PSRETURN MASK__PSRETURN_Scripting_DefineType_AlreadyExists = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_DefineType_AlreadyExists = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineType_AlreadyExists = 0x09010001; extern const PSRETURN CODE__PSRETURN_Scripting_DefineType_AlreadyExists = 0x09010001;
extern const PSRETURN MASK__PSRETURN_Scripting_DefineType_CreationFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_DefineType_CreationFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineType_CreationFailed = 0x09010002; extern const PSRETURN CODE__PSRETURN_Scripting_DefineType_CreationFailed = 0x09010002;
extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile_EvalErrors = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile_EvalErrors = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile_EvalErrors = 0x09020001; extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile_EvalErrors = 0x09020001;
extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile_OpenFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_LoadFile_OpenFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile_OpenFailed = 0x09020002; extern const PSRETURN CODE__PSRETURN_Scripting_LoadFile_OpenFailed = 0x09020002;
extern const PSRETURN MASK__PSRETURN_Scripting_CallFunctionFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_CallFunctionFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_CallFunctionFailed = 0x09000001; extern const PSRETURN CODE__PSRETURN_Scripting_CallFunctionFailed = 0x09000001;
extern const PSRETURN MASK__PSRETURN_Scripting_ConversionFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_ConversionFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_ConversionFailed = 0x09000002; extern const PSRETURN CODE__PSRETURN_Scripting_ConversionFailed = 0x09000002;
extern const PSRETURN MASK__PSRETURN_Scripting_CreateObjectFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_CreateObjectFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_CreateObjectFailed = 0x09000003; extern const PSRETURN CODE__PSRETURN_Scripting_CreateObjectFailed = 0x09000003;
extern const PSRETURN MASK__PSRETURN_Scripting_DefineConstantFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_DefineConstantFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_DefineConstantFailed = 0x09000004; extern const PSRETURN CODE__PSRETURN_Scripting_DefineConstantFailed = 0x09000004;
extern const PSRETURN MASK__PSRETURN_Scripting_RegisterFunctionFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_RegisterFunctionFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_RegisterFunctionFailed = 0x09000005; extern const PSRETURN CODE__PSRETURN_Scripting_RegisterFunctionFailed = 0x09000005;
extern const PSRETURN MASK__PSRETURN_Scripting_SetupFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_SetupFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_SetupFailed = 0x09000006; extern const PSRETURN CODE__PSRETURN_Scripting_SetupFailed = 0x09000006;
extern const PSRETURN MASK__PSRETURN_Scripting_TypeDoesNotExist = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Scripting_TypeDoesNotExist = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Scripting_TypeDoesNotExist = 0x09000007; extern const PSRETURN CODE__PSRETURN_Scripting_TypeDoesNotExist = 0x09000007;
extern const PSRETURN MASK__PSRETURN_System_RequiredExtensionsMissing = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_System_RequiredExtensionsMissing = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_System_RequiredExtensionsMissing = 0x0a000001; extern const PSRETURN CODE__PSRETURN_System_RequiredExtensionsMissing = 0x0a000001;
extern const PSRETURN MASK__PSRETURN_System_SDLInitFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_System_SDLInitFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_System_SDLInitFailed = 0x0a000002; extern const PSRETURN CODE__PSRETURN_System_SDLInitFailed = 0x0a000002;
extern const PSRETURN MASK__PSRETURN_System_VmodeFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_System_VmodeFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_System_VmodeFailed = 0x0a000003; extern const PSRETURN CODE__PSRETURN_System_VmodeFailed = 0x0a000003;
extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLOpenFailed = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLOpenFailed = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLOpenFailed = 0x0b000001; extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLOpenFailed = 0x0b000001;
extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLParseError = 0xFFFFFFFF; extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLParseError = 0xffffffff;
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLParseError = 0x0b000002; extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLParseError = 0x0b000002;
PSRETURN PSERROR_CVFSFile_AlreadyLoaded::getCode() const { return 0x01000001; } PSRETURN PSERROR_CVFSFile_AlreadyLoaded::getCode() const { return 0x01000001; }
@ -212,7 +223,14 @@ PSRETURN PSERROR_File_OpenFailed::getCode() const { return 0x04000003; }
PSRETURN PSERROR_File_ReadFailed::getCode() const { return 0x04000004; } PSRETURN PSERROR_File_ReadFailed::getCode() const { return 0x04000004; }
PSRETURN PSERROR_File_UnexpectedEOF::getCode() const { return 0x04000005; } PSRETURN PSERROR_File_UnexpectedEOF::getCode() const { return 0x04000005; }
PSRETURN PSERROR_File_WriteFailed::getCode() const { return 0x04000006; } PSRETURN PSERROR_File_WriteFailed::getCode() const { return 0x04000006; }
PSRETURN PSERROR_GUI_JSOpenFailed::getCode() const { return 0x05000001; } PSRETURN PSERROR_GUI_InvalidSetting::getCode() const { return 0x05000001; }
PSRETURN PSERROR_GUI_InvalidValueSyntax::getCode() const { return 0x05000002; }
PSRETURN PSERROR_GUI_JSOpenFailed::getCode() const { return 0x05000003; }
PSRETURN PSERROR_GUI_NameAmbiguity::getCode() const { return 0x05000004; }
PSRETURN PSERROR_GUI_NullObjectProvided::getCode() const { return 0x05000005; }
PSRETURN PSERROR_GUI_ObjectNeedsName::getCode() const { return 0x05000006; }
PSRETURN PSERROR_GUI_OperationNeedsGUIObject::getCode() const { return 0x05000007; }
PSRETURN PSERROR_GUI_ReferenceNameTake::getCode() const { return 0x05000008; }
PSRETURN PSERROR_Game_World_MapLoadFailed::getCode() const { return 0x06040001; } PSRETURN PSERROR_Game_World_MapLoadFailed::getCode() const { return 0x06040001; }
PSRETURN PSERROR_I18n_Script_SetupFailed::getCode() const { return 0x07030001; } PSRETURN PSERROR_I18n_Script_SetupFailed::getCode() const { return 0x07030001; }
PSRETURN PSERROR_Renderer_VBOFailed::getCode() const { return 0x08000001; } PSRETURN PSERROR_Renderer_VBOFailed::getCode() const { return 0x08000001; }
@ -259,7 +277,14 @@ const char* GetErrorString(PSRETURN code)
case 0x04000004: return "File_ReadFailed"; case 0x04000004: return "File_ReadFailed";
case 0x04000005: return "File_UnexpectedEOF"; case 0x04000005: return "File_UnexpectedEOF";
case 0x04000006: return "File_WriteFailed"; case 0x04000006: return "File_WriteFailed";
case 0x05000001: return "GUI_JSOpenFailed"; case 0x05000001: return "GUI_InvalidSetting";
case 0x05000002: return "GUI_InvalidValueSyntax";
case 0x05000003: return "GUI_JSOpenFailed";
case 0x05000004: return "GUI_NameAmbiguity";
case 0x05000005: return "GUI_NullObjectProvided";
case 0x05000006: return "GUI_ObjectNeedsName";
case 0x05000007: return "GUI_OperationNeedsGUIObject";
case 0x05000008: return "GUI_ReferenceNameTake";
case 0x06040001: return "Game_World_MapLoadFailed"; case 0x06040001: return "Game_World_MapLoadFailed";
case 0x07030001: return "I18n_Script_SetupFailed"; case 0x07030001: return "I18n_Script_SetupFailed";
case 0x08000001: return "Renderer_VBOFailed"; case 0x08000001: return "Renderer_VBOFailed";
@ -300,7 +325,14 @@ void ThrowError(PSRETURN code)
case 0x04000004: throw PSERROR_File_ReadFailed(); break; case 0x04000004: throw PSERROR_File_ReadFailed(); break;
case 0x04000005: throw PSERROR_File_UnexpectedEOF(); break; case 0x04000005: throw PSERROR_File_UnexpectedEOF(); break;
case 0x04000006: throw PSERROR_File_WriteFailed(); break; case 0x04000006: throw PSERROR_File_WriteFailed(); break;
case 0x05000001: throw PSERROR_GUI_JSOpenFailed(); break; case 0x05000001: throw PSERROR_GUI_InvalidSetting(); break;
case 0x05000002: throw PSERROR_GUI_InvalidValueSyntax(); break;
case 0x05000003: throw PSERROR_GUI_JSOpenFailed(); break;
case 0x05000004: throw PSERROR_GUI_NameAmbiguity(); break;
case 0x05000005: throw PSERROR_GUI_NullObjectProvided(); break;
case 0x05000006: throw PSERROR_GUI_ObjectNeedsName(); break;
case 0x05000007: throw PSERROR_GUI_OperationNeedsGUIObject(); break;
case 0x05000008: throw PSERROR_GUI_ReferenceNameTake(); break;
case 0x06040001: throw PSERROR_Game_World_MapLoadFailed(); break; case 0x06040001: throw PSERROR_Game_World_MapLoadFailed(); break;
case 0x07030001: throw PSERROR_I18n_Script_SetupFailed(); break; case 0x07030001: throw PSERROR_I18n_Script_SetupFailed(); break;
case 0x08000001: throw PSERROR_Renderer_VBOFailed(); break; case 0x08000001: throw PSERROR_Renderer_VBOFailed(); break;