Skip to content

Commit

Permalink
Some fixes for xrSE_Factory
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Aug 5, 2017
1 parent 62f56d7 commit 2cef17b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 66 deletions.
8 changes: 4 additions & 4 deletions src/utils/xrSE_Factory/script_space.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#pragma once

#include "script_space_forward.h"
#include "xrScriptEngine/script_space_forward.hpp"

#pragma warning(push)

Expand All @@ -18,9 +18,9 @@
#pragma warning(disable : 4267)

extern "C" {
#include <lua/lua.h>
#include <lua/lualib.h>
#include <lua/lauxlib.h>
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
};

#include <luabind/luabind.hpp>
Expand Down
38 changes: 1 addition & 37 deletions src/utils/xrSE_Factory/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@

#include "xrCore/xrCore.h"

#define WIN32_LEAN_AND_MEAN

#define ENGINE_API
#define ECORE_API
#define DLL_API __declspec(dllexport)
#define DLL_API XR_EXPORT
#define TIXML_USE_STL

#include "clsid_game.h"
Expand All @@ -35,38 +33,4 @@ void throw_exception(std::exception const& A);

#if XRAY_EXCEPTIONS
IC xr_string string2xr_string(LPCSTR s) { return s ? s : ""; }
#define THROW(expr) \
do \
{ \
if (!(expr)) \
{ \
string4096 assertion_info; \
::Debug.gather_info(_TRE(#expr), 0, 0, 0, DEBUG_INFO, assertion_info); \
throw assertion_info; \
} \
} while (0)
#define THROW2(expr, msg0) \
do \
{ \
if (!(expr)) \
{ \
string4096 assertion_info; \
::Debug.gather_info(_TRE(#expr), msg0, 0, 0, DEBUG_INFO, assertion_info); \
throw assertion_info; \
} \
} while (0)
#define THROW3(expr, msg0, msg1) \
do \
{ \
if (!(expr)) \
{ \
string4096 assertion_info; \
::Debug.gather_info(_TRE(#expr), msg0, msg1, 0, DEBUG_INFO, assertion_info); \
throw assertion_info; \
} \
} while (0)
#else
#define THROW VERIFY
#define THROW2 VERIFY2
#define THROW3 VERIFY3
#endif
7 changes: 1 addition & 6 deletions src/utils/xrSE_Factory/xrUIXmlParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@ shared_str CUIXml::correct_file_name(LPCSTR path, LPCSTR fn)
{
#ifdef XRGAME_EXPORTS
if (0 == xr_strcmp(path, UI_PATH) || 0 == xr_strcmp(path, "UI"))
{
return UI()->get_xml_name(fn);
}
else
return fn;
#else
return fn;
#endif
return fn;
}

//#define LOG_ALL_XMLS
Expand Down
4 changes: 2 additions & 2 deletions src/utils/xrSE_Factory/xrUIXmlParser.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "xrXMLParser/xrXMLParser.h"
#include "xrCore/XML/XMLDocument.hpp"

class CUIXml : public CXml
class CUIXml : public XMLDocument
{
int m_dbg_id;

Expand Down
35 changes: 18 additions & 17 deletions src/xrServerEntities/script_ini_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "xrScriptEngine/script_engine.hpp"
#include "ai_space.h"
#include "object_factory.h"
#include "xrCore/xrDebug.h"

CScriptIniFile::CScriptIniFile(IReader* F, LPCSTR path) : inherited(F, path) {}
CScriptIniFile::CScriptIniFile(LPCSTR szFileName, BOOL ReadOnly, BOOL bLoadAtStart, BOOL SaveAtEnd)
Expand Down Expand Up @@ -38,41 +39,41 @@ int CScriptIniFile::r_token(LPCSTR S, LPCSTR L, const CScriptTokenList& token_li
LPCSTR CScriptIniFile::r_string_wb(LPCSTR S, LPCSTR L) { return *inherited::r_string_wb(S, L); }
u32 CScriptIniFile::line_count(LPCSTR S)
{
THROW3(inherited::section_exist(S), "Cannot find section", S);
return (inherited::line_count(S));
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
return inherited::line_count(S);
}

LPCSTR CScriptIniFile::r_string(LPCSTR S, LPCSTR L)
{
THROW3(inherited::section_exist(S), "Cannot find section", S);
THROW3(inherited::line_exist(S, L), "Cannot find line", L);
return (inherited::r_string(S, L));
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
VERIFY3(inherited::line_exist(S, L), "Cannot find line", L);
return inherited::r_string(S, L);
}

u32 CScriptIniFile::r_u32(LPCSTR S, LPCSTR L)
{
THROW3(inherited::section_exist(S), "Cannot find section", S);
THROW3(inherited::line_exist(S, L), "Cannot find line", L);
return (inherited::r_u32(S, L));
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
VERIFY3(inherited::line_exist(S, L), "Cannot find line", L);
return inherited::r_u32(S, L);
}

int CScriptIniFile::r_s32(LPCSTR S, LPCSTR L)
{
THROW3(inherited::section_exist(S), "Cannot find section", S);
THROW3(inherited::line_exist(S, L), "Cannot find line", L);
return (inherited::r_s32(S, L));
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
VERIFY3(inherited::line_exist(S, L), "Cannot find line", L);
return inherited::r_s32(S, L);
}

float CScriptIniFile::r_float(LPCSTR S, LPCSTR L)
{
THROW3(inherited::section_exist(S), "Cannot find section", S);
THROW3(inherited::line_exist(S, L), "Cannot find line", L);
return (inherited::r_float(S, L));
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
VERIFY3(inherited::line_exist(S, L), "Cannot find line", L);
return inherited::r_float(S, L);
}

Fvector CScriptIniFile::r_fvector3(LPCSTR S, LPCSTR L)
{
THROW3(inherited::section_exist(S), "Cannot find section", S);
THROW3(inherited::line_exist(S, L), "Cannot find line", L);
return (inherited::r_fvector3(S, L));
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
VERIFY3(inherited::line_exist(S, L), "Cannot find line", L);
return inherited::r_fvector3(S, L);
}

0 comments on commit 2cef17b

Please sign in to comment.