Skip to content

Commit 3aa80f1

Browse files
authored
Merge pull request #242 from qweasdd136963/xd_dev_dev
Fixes and changes
2 parents b7b3401 + 78f104d commit 3aa80f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+275
-479
lines changed

src/Layers/xrRenderDX10/3DFluid/dx103DFluidData.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@
55

66
namespace
77
{
8-
const xr_token simulation_type_token[] = {{"Fog", dx103DFluidData::ST_FOG}, {"Fire", dx103DFluidData::ST_FIRE}, {0, 0}};
8+
const xr_token simulation_type_token[] = {
9+
{"Fog", dx103DFluidData::ST_FOG},
10+
{"Fire", dx103DFluidData::ST_FIRE},
11+
{0, 0}
12+
};
913

10-
const xr_token emitter_type_token[] = {{"SimpleGaussian", dx103DFluidEmitters::ET_SimpleGausian},
11-
{"SimpleDraught", dx103DFluidEmitters::ET_SimpleDraught}, {0, 0}};
14+
const xr_token emitter_type_token[] = {
15+
{"SimpleGaussian", dx103DFluidEmitters::ET_SimpleGausian},
16+
{"SimpleDraught", dx103DFluidEmitters::ET_SimpleDraught},
17+
{0, 0}
18+
};
1219
}
1320

1421
DXGI_FORMAT dx103DFluidData::m_VPRenderTargetFormats[VP_NUM_TARGETS] = {
@@ -20,7 +27,7 @@ DXGI_FORMAT dx103DFluidData::m_VPRenderTargetFormats[VP_NUM_TARGETS] = {
2027
dx103DFluidData::dx103DFluidData()
2128
{
2229
D3D_TEXTURE3D_DESC desc;
23-
desc.BindFlags = D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET;
30+
desc.BindFlags = D3D_BIND_SHADER_RESOURCE | D3D_BIND_RENDER_TARGET;
2431
desc.CPUAccessFlags = 0;
2532
desc.MipLevels = 1;
2633
desc.MiscFlags = 0;

src/Layers/xrRenderDX10/3DFluid/dx103DFluidManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void dx103DFluidManager::Initialize(int width, int height, int depth)
104104
InitShaders();
105105

106106
D3D_TEXTURE3D_DESC desc;
107-
desc.BindFlags = D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET;
107+
desc.BindFlags = D3D_BIND_SHADER_RESOURCE | D3D_BIND_RENDER_TARGET;
108108
desc.CPUAccessFlags = 0;
109109
desc.MipLevels = 1;
110110
desc.MiscFlags = 0;

src/Layers/xrRenderDX10/Blender_Recorder_R3.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ void CBlender_Compile::r_Pass(LPCSTR _vs, LPCSTR _gs, LPCSTR _ps, bool bFog, BOO
197197
#ifdef USE_DX11
198198
dest.hs = RImplementation.Resources->_CreateHS("null");
199199
dest.ds = RImplementation.Resources->_CreateDS("null");
200+
dest.cs = RImplementation.Resources->_CreateCS("null");
200201
#endif
201202
ctable.merge(&ps->constants);
202203
ctable.merge(&vs->constants);

src/editors/xrEditor/entry_point.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int entry_point(pcstr commandLine)
4242
splash->Show();
4343

4444
splash->SetStatus("Loading xrDebug...");
45-
xrDebug::Initialize(false);
45+
xrDebug::Initialize();
4646

4747
splash->SetStatus("Loading Core...");
4848
thread_spawn(UIThreadProc, "OpenXRay Editor UI Thread", 0, nullptr);

src/xrGame/F1.cpp

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/xrGame/F1.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ class CF1 : public CGrenade
77
typedef CGrenade inherited;
88

99
public:
10-
CF1(void);
11-
virtual ~CF1(void);
10+
CF1() {}
11+
virtual ~CF1() {}
1212
};

src/xrGame/PHCommander.cpp

Lines changed: 19 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#include "stdafx.h"
22
#include "PHCommander.h"
3-
43
#include "phsimplecalls.h"
5-
#ifdef DEBUG
64

7-
// extern CPHWorld *ph_world;
5+
#ifdef DEBUG
86
#include "xrPhysics/IPHWorld.h"
97
#endif
108

@@ -19,7 +17,7 @@ CPHCall::~CPHCall()
1917
xr_delete(m_action);
2018
xr_delete(m_condition);
2119
}
22-
bool CPHCall::obsolete() { return m_action->obsolete() || m_condition->obsolete(); }
20+
bool CPHCall::obsolete() { return !m_action || m_action->obsolete() || !m_condition || m_condition->obsolete(); }
2321
void CPHCall::check()
2422
{
2523
if (m_condition && m_condition->is_true() && m_action)
@@ -50,14 +48,6 @@ void CPHCommander::clear()
5048
{
5149
remove_call(m_calls.end() - 1);
5250
}
53-
while (m_calls_as_add_buffer.size())
54-
{
55-
remove_call(m_calls_as_add_buffer.end() - 1);
56-
}
57-
while (m_calls_as_remove_buffer.size())
58-
{
59-
remove_call(m_calls_as_remove_buffer.end() - 1);
60-
}
6151
}
6252

6353
void CPHCommander::update()
@@ -96,12 +86,13 @@ void CPHCommander::add_call_threadsafety(CPHCondition* condition, CPHAction* act
9686
add_call(condition, action);
9787
lock.Leave();
9888
}
99-
void CPHCommander::add_call(CPHCondition* condition, CPHAction* action, PHCALL_STORAGE& cs)
89+
90+
void CPHCommander::add_call(CPHCondition* condition, CPHAction* action)
10091
{
101-
cs.push_back(new CPHCall(condition, action));
92+
m_calls.push_back(new CPHCall(condition, action));
10293
}
103-
void CPHCommander::add_call(CPHCondition* condition, CPHAction* action) { add_call(condition, action, m_calls); }
104-
void CPHCommander::remove_call(PHCALL_I i, PHCALL_STORAGE& cs)
94+
95+
void CPHCommander::remove_call(PHCALL_I i)
10596
{
10697
#ifdef DEBUG
10798
const CPHCallOnStepCondition* esc = smart_cast<const CPHCallOnStepCondition*>((*i)->condition());
@@ -117,10 +108,9 @@ void CPHCommander::remove_call(PHCALL_I i, PHCALL_STORAGE& cs)
117108
}
118109
#endif
119110
delete_call(*i);
120-
cs.erase(i);
111+
m_calls.erase(i);
121112
}
122113

123-
void CPHCommander::remove_call(PHCALL_I i) { remove_call(i, m_calls); }
124114
struct SFEqualPred
125115
{
126116
CPHReqComparerV *cmp_condition, *cmp_action;
@@ -150,46 +140,33 @@ struct SFRemovePred2
150140
}
151141
};
152142

153-
PHCALL_I CPHCommander::find_call(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action, PHCALL_STORAGE& cs)
154-
{
155-
return std::find_if(cs.begin(), cs.end(), SFEqualPred(cmp_condition, cmp_action));
156-
}
157-
158143
PHCALL_I CPHCommander::find_call(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action)
159144
{
160-
return find_call(cmp_condition, cmp_action, m_calls);
145+
return std::find_if(m_calls.begin(), m_calls.end(), SFEqualPred(cmp_condition, cmp_action));
161146
}
162147

163148
bool CPHCommander::has_call(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action)
164149
{
165150
return find_call(cmp_condition, cmp_action) != m_calls.end();
166151
}
167152

168-
void CPHCommander::remove_call(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action, PHCALL_STORAGE& cs)
169-
{
170-
cs.erase(std::remove_if(cs.begin(), cs.end(), SFRemovePred2(cmp_condition, cmp_action)), cs.end());
171-
}
172-
173153
void CPHCommander::remove_call(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action)
174154
{
175-
remove_call(cmp_condition, cmp_action, m_calls);
155+
m_calls.erase(
156+
std::remove_if(m_calls.begin(), m_calls.end(), SFRemovePred2(cmp_condition, cmp_action)), m_calls.end());
176157
}
177158

178-
bool CPHCommander::add_call_unique(CPHCondition* condition, CPHReqComparerV* cmp_condition, CPHAction* action,
179-
CPHReqComparerV* cmp_action, PHCALL_STORAGE& cs)
159+
bool CPHCommander::add_call_unique(
160+
CPHCondition* condition, CPHReqComparerV* cmp_condition, CPHAction* action, CPHReqComparerV* cmp_action)
180161
{
181-
if (cs.end() == find_call(cmp_condition, cmp_action, cs))
162+
if (m_calls.end() == find_call(cmp_condition, cmp_action))
182163
{
183-
add_call(condition, action, cs);
164+
add_call(condition, action);
184165
return true;
185166
}
186167
return false;
187168
}
188-
bool CPHCommander::add_call_unique(
189-
CPHCondition* condition, CPHReqComparerV* cmp_condition, CPHAction* action, CPHReqComparerV* cmp_action)
190-
{
191-
return add_call_unique(condition, cmp_condition, action, cmp_action, m_calls);
192-
}
169+
193170
struct SRemoveRped
194171
{
195172
CPHReqComparerV* cmp_object;
@@ -206,37 +183,18 @@ struct SRemoveRped
206183
}
207184
};
208185

209-
void CPHCommander::remove_calls(CPHReqComparerV* cmp_object, PHCALL_STORAGE& cs)
210-
{
211-
cs.erase(std::remove_if(cs.begin(), cs.end(), SRemoveRped(cmp_object)), cs.end());
212-
}
213186
void CPHCommander::remove_calls_threadsafety(CPHReqComparerV* cmp_object)
214187
{
215188
lock.Enter();
216189
remove_calls(cmp_object);
217190
lock.Leave();
218191
}
219-
void CPHCommander::remove_calls(CPHReqComparerV* cmp_object) { remove_calls(cmp_object, m_calls); }
220-
void CPHCommander::add_call_unique_as(
221-
CPHCondition* condition, CPHReqComparerV* cmp_condition, CPHAction* action, CPHReqComparerV* cmp_action)
222-
{
223-
add_call_unique(condition, cmp_condition, action, cmp_action, m_calls_as_add_buffer);
224-
}
225-
void CPHCommander::add_call_as(CPHCondition* condition, CPHAction* action)
226-
{
227-
add_call(condition, action, m_calls_as_add_buffer);
228-
}
229192

230-
PHCALL_I CPHCommander::find_call_as(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action)
231-
{
232-
return find_call(cmp_condition, cmp_action, m_calls);
233-
}
234-
void CPHCommander::remove_call_as(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action)
193+
void CPHCommander::remove_calls(CPHReqComparerV* cmp_object)
235194
{
236-
remove_call(cmp_condition, cmp_action, m_calls_as_add_buffer);
195+
m_calls.erase(std::remove_if(m_calls.begin(), m_calls.end(), SRemoveRped(cmp_object)), m_calls.end());
237196
}
238-
void CPHCommander::remove_calls_as(CPHReqComparerV* cmp_object) {}
239-
void CPHCommander::update_as() {}
197+
240198
void CPHCommander::phys_shell_relcase(CPhysicsShell* sh)
241199
{
242200
CPHReqComparerHasShell c(sh);

src/xrGame/PHCommander.h

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ class CPHCommander : public IPHWorldUpdateCallbck
7373
{
7474
Lock lock;
7575
PHCALL_STORAGE m_calls;
76-
PHCALL_STORAGE m_calls_as_add_buffer;
77-
PHCALL_STORAGE m_calls_as_remove_buffer;
7876

7977
public:
8078
~CPHCommander();
@@ -94,30 +92,9 @@ class CPHCommander : public IPHWorldUpdateCallbck
9492

9593
void update();
9694
void update_threadsafety();
97-
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
98-
void add_call_unique_as(
99-
CPHCondition* condition, CPHReqComparerV* cmp_condition, CPHAction* action, CPHReqComparerV* cmp_action);
100-
void add_call_as(CPHCondition* condition, CPHAction* action);
101-
102-
void remove_call_as(PHCALL_I i);
103-
PHCALL_I find_call_as(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action);
104-
void remove_call_as(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action);
105-
void remove_calls_as(CPHReqComparerV* cmp_object);
106-
107-
void update_as();
108-
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
95+
10996
void clear();
11097

111-
private:
112-
IC bool add_call_unique(CPHCondition* condition, CPHReqComparerV* cmp_condition, CPHAction* action,
113-
CPHReqComparerV* cmp_action, PHCALL_STORAGE& cs);
114-
IC void add_call(CPHCondition* condition, CPHAction* action, PHCALL_STORAGE& cs);
115-
116-
IC void remove_call(PHCALL_I i, PHCALL_STORAGE& cs);
117-
IC PHCALL_I find_call(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action, PHCALL_STORAGE& cs);
118-
IC void remove_call(CPHReqComparerV* cmp_condition, CPHReqComparerV* cmp_action, PHCALL_STORAGE& cs);
119-
IC void remove_calls(CPHReqComparerV* cmp_object, PHCALL_STORAGE& cs);
120-
12198
private:
12299
virtual void update_step() { update_threadsafety(); }
123100
virtual void phys_shell_relcase(CPhysicsShell* sh);

src/xrGame/PHScriptCall.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
#include "script_callback_ex.h"
77
#include "xrEngine/xr_object.h"
88

9-
// template<>
10-
// IC bool compare_safe(const functor<>& f1,const functor<>& f2)
11-
//{
12-
// f1.typ
13-
//}
14-
159
class CPHScriptCondition : public CPHCondition, public CPHReqComparerV
1610
{
1711
luabind::functor<bool>* m_lua_function;
@@ -24,10 +18,12 @@ class CPHScriptCondition : public CPHCondition, public CPHReqComparerV
2418
virtual bool is_true();
2519
virtual bool obsolete() const;
2620
virtual bool compare(const CPHReqComparerV* v) const { return v->compare(this); }
27-
// XXX: compare values instead of pointers?
28-
virtual bool compare(const CPHScriptCondition* v) const { return v->m_lua_function == m_lua_function; }
29-
/// virtual bool is_equal (CPHReqBase* v) ;
30-
// virtual bool is_relative (CPHReqBase* v) ;
21+
virtual bool compare(const CPHScriptCondition* v) const
22+
{
23+
const auto& lhs = static_cast<const luabind::adl::object&>(*m_lua_function);
24+
const auto& rhs = static_cast<const luabind::adl::object&>(*v->m_lua_function);
25+
return lhs == rhs;
26+
}
3127
};
3228

3329
class CPHScriptAction : public CPHAction, public CPHReqComparerV

src/xrGame/RGD5.cpp

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)