Skip to content

Commit 2cef17b

Browse files
committed
Some fixes for xrSE_Factory
1 parent 62f56d7 commit 2cef17b

File tree

5 files changed

+26
-66
lines changed

5 files changed

+26
-66
lines changed

src/utils/xrSE_Factory/script_space.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#pragma once
1010

11-
#include "script_space_forward.h"
11+
#include "xrScriptEngine/script_space_forward.hpp"
1212

1313
#pragma warning(push)
1414

@@ -18,9 +18,9 @@
1818
#pragma warning(disable : 4267)
1919

2020
extern "C" {
21-
#include <lua/lua.h>
22-
#include <lua/lualib.h>
23-
#include <lua/lauxlib.h>
21+
#include <lua.h>
22+
#include <lualib.h>
23+
#include <lauxlib.h>
2424
};
2525

2626
#include <luabind/luabind.hpp>

src/utils/xrSE_Factory/stdafx.h

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@
1010

1111
#include "xrCore/xrCore.h"
1212

13-
#define WIN32_LEAN_AND_MEAN
14-
1513
#define ENGINE_API
1614
#define ECORE_API
17-
#define DLL_API __declspec(dllexport)
15+
#define DLL_API XR_EXPORT
1816
#define TIXML_USE_STL
1917

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

3634
#if XRAY_EXCEPTIONS
3735
IC xr_string string2xr_string(LPCSTR s) { return s ? s : ""; }
38-
#define THROW(expr) \
39-
do \
40-
{ \
41-
if (!(expr)) \
42-
{ \
43-
string4096 assertion_info; \
44-
::Debug.gather_info(_TRE(#expr), 0, 0, 0, DEBUG_INFO, assertion_info); \
45-
throw assertion_info; \
46-
} \
47-
} while (0)
48-
#define THROW2(expr, msg0) \
49-
do \
50-
{ \
51-
if (!(expr)) \
52-
{ \
53-
string4096 assertion_info; \
54-
::Debug.gather_info(_TRE(#expr), msg0, 0, 0, DEBUG_INFO, assertion_info); \
55-
throw assertion_info; \
56-
} \
57-
} while (0)
58-
#define THROW3(expr, msg0, msg1) \
59-
do \
60-
{ \
61-
if (!(expr)) \
62-
{ \
63-
string4096 assertion_info; \
64-
::Debug.gather_info(_TRE(#expr), msg0, msg1, 0, DEBUG_INFO, assertion_info); \
65-
throw assertion_info; \
66-
} \
67-
} while (0)
68-
#else
69-
#define THROW VERIFY
70-
#define THROW2 VERIFY2
71-
#define THROW3 VERIFY3
7236
#endif

src/utils/xrSE_Factory/xrUIXmlParser.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ shared_str CUIXml::correct_file_name(LPCSTR path, LPCSTR fn)
99
{
1010
#ifdef XRGAME_EXPORTS
1111
if (0 == xr_strcmp(path, UI_PATH) || 0 == xr_strcmp(path, "UI"))
12-
{
1312
return UI()->get_xml_name(fn);
14-
}
15-
else
16-
return fn;
17-
#else
18-
return fn;
1913
#endif
14+
return fn;
2015
}
2116

2217
//#define LOG_ALL_XMLS

src/utils/xrSE_Factory/xrUIXmlParser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
2-
#include "xrXMLParser/xrXMLParser.h"
2+
#include "xrCore/XML/XMLDocument.hpp"
33

4-
class CUIXml : public CXml
4+
class CUIXml : public XMLDocument
55
{
66
int m_dbg_id;
77

src/xrServerEntities/script_ini_file.cpp

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "xrScriptEngine/script_engine.hpp"
1212
#include "ai_space.h"
1313
#include "object_factory.h"
14+
#include "xrCore/xrDebug.h"
1415

1516
CScriptIniFile::CScriptIniFile(IReader* F, LPCSTR path) : inherited(F, path) {}
1617
CScriptIniFile::CScriptIniFile(LPCSTR szFileName, BOOL ReadOnly, BOOL bLoadAtStart, BOOL SaveAtEnd)
@@ -38,41 +39,41 @@ int CScriptIniFile::r_token(LPCSTR S, LPCSTR L, const CScriptTokenList& token_li
3839
LPCSTR CScriptIniFile::r_string_wb(LPCSTR S, LPCSTR L) { return *inherited::r_string_wb(S, L); }
3940
u32 CScriptIniFile::line_count(LPCSTR S)
4041
{
41-
THROW3(inherited::section_exist(S), "Cannot find section", S);
42-
return (inherited::line_count(S));
42+
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
43+
return inherited::line_count(S);
4344
}
4445

4546
LPCSTR CScriptIniFile::r_string(LPCSTR S, LPCSTR L)
4647
{
47-
THROW3(inherited::section_exist(S), "Cannot find section", S);
48-
THROW3(inherited::line_exist(S, L), "Cannot find line", L);
49-
return (inherited::r_string(S, L));
48+
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
49+
VERIFY3(inherited::line_exist(S, L), "Cannot find line", L);
50+
return inherited::r_string(S, L);
5051
}
5152

5253
u32 CScriptIniFile::r_u32(LPCSTR S, LPCSTR L)
5354
{
54-
THROW3(inherited::section_exist(S), "Cannot find section", S);
55-
THROW3(inherited::line_exist(S, L), "Cannot find line", L);
56-
return (inherited::r_u32(S, L));
55+
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
56+
VERIFY3(inherited::line_exist(S, L), "Cannot find line", L);
57+
return inherited::r_u32(S, L);
5758
}
5859

5960
int CScriptIniFile::r_s32(LPCSTR S, LPCSTR L)
6061
{
61-
THROW3(inherited::section_exist(S), "Cannot find section", S);
62-
THROW3(inherited::line_exist(S, L), "Cannot find line", L);
63-
return (inherited::r_s32(S, L));
62+
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
63+
VERIFY3(inherited::line_exist(S, L), "Cannot find line", L);
64+
return inherited::r_s32(S, L);
6465
}
6566

6667
float CScriptIniFile::r_float(LPCSTR S, LPCSTR L)
6768
{
68-
THROW3(inherited::section_exist(S), "Cannot find section", S);
69-
THROW3(inherited::line_exist(S, L), "Cannot find line", L);
70-
return (inherited::r_float(S, L));
69+
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
70+
VERIFY3(inherited::line_exist(S, L), "Cannot find line", L);
71+
return inherited::r_float(S, L);
7172
}
7273

7374
Fvector CScriptIniFile::r_fvector3(LPCSTR S, LPCSTR L)
7475
{
75-
THROW3(inherited::section_exist(S), "Cannot find section", S);
76-
THROW3(inherited::line_exist(S, L), "Cannot find line", L);
77-
return (inherited::r_fvector3(S, L));
76+
VERIFY3(inherited::section_exist(S), "Cannot find section", S);
77+
VERIFY3(inherited::line_exist(S, L), "Cannot find line", L);
78+
return inherited::r_fvector3(S, L);
7879
}

0 commit comments

Comments
 (0)