This commit is contained in:
Mikulas Florek 2016-03-01 16:48:04 +01:00
parent 93d2b25f4e
commit 12cb67690b
15 changed files with 50 additions and 56 deletions

View file

@ -336,7 +336,7 @@ namespace Lumix
struct AnimationSystemImpl : public IPlugin
{
public:
AnimationSystemImpl(Engine& engine)
explicit AnimationSystemImpl(Engine& engine)
: m_allocator(engine.getAllocator())
, m_engine(engine)
, m_animation_manager(m_allocator)
@ -394,7 +394,7 @@ namespace Lumix
struct AssetBrowserPlugin : AssetBrowser::IPlugin
{
AssetBrowserPlugin(StudioApp& app)
explicit AssetBrowserPlugin(StudioApp& app)
: m_app(app)
{
}
@ -440,7 +440,7 @@ namespace Lumix
struct PropertyGridPlugin : PropertyGrid::IPlugin
{
PropertyGridPlugin(StudioApp& app)
explicit PropertyGridPlugin(StudioApp& app)
: m_app(app)
{
m_is_playing = false;

View file

@ -66,7 +66,7 @@ static void registerProperties(Lumix::IAllocator& allocator)
struct AudioSystemImpl : public AudioSystem
{
AudioSystemImpl(Engine& engine)
explicit AudioSystemImpl(Engine& engine)
: m_engine(engine)
, m_manager(engine.getAllocator())
, m_device(nullptr)
@ -120,7 +120,7 @@ namespace {
struct AssetBrowserPlugin : public AssetBrowser::IPlugin
{
AssetBrowserPlugin(StudioApp& app)
explicit AssetBrowserPlugin(StudioApp& app)
: m_app(app)
, m_browser(*app.getAssetBrowser())
, m_playing_clip(-1)
@ -213,7 +213,7 @@ namespace {
struct StudioAppPlugin : public StudioApp::IPlugin
{
StudioAppPlugin(StudioApp& app)
explicit StudioAppPlugin(StudioApp& app)
: m_app(app)
{
m_filter[0] = 0;
@ -295,7 +295,7 @@ namespace {
struct EditorPlugin : public WorldEditor::Plugin
{
EditorPlugin(WorldEditor& editor)
explicit EditorPlugin(WorldEditor& editor)
: m_editor(editor)
{
}

View file

@ -926,7 +926,6 @@ struct ConvertTask : public Lumix::MT::Task
{
if (info.weights[min] > info.weights[i]) min = i;
}
float old_weight = info.weights[min];
info.weights[min] = weight;
info.bone_indices[min] = bone_index;
}
@ -1412,7 +1411,6 @@ struct ConvertTask : public Lumix::MT::Task
void writeSkeleton(Lumix::FS::OsFile& file)
{
const aiScene* scene = m_dialog.m_importer.GetScene();
Lumix::int32 count = m_nodes.size();
if (count == 1) count = 0;
file.write((const char*)&count, sizeof(count));
@ -1479,7 +1477,6 @@ struct ConvertTask : public Lumix::MT::Task
char filename[Lumix::MAX_PATH_LENGTH];
Lumix::PathUtils::getBasename(filename, sizeof(filename), m_dialog.m_source);
Lumix::catString(filename, ".phy");
auto& fs = m_dialog.m_editor.getEngine().getFileSystem();
PathBuilder phy_path(m_dialog.m_output_dir);
phy_path << "/" << filename;
Lumix::FS::OsFile file;
@ -1670,7 +1667,6 @@ struct ConvertTask : public Lumix::MT::Task
PathBuilder path(m_dialog.m_output_dir);
path << "/" << basename << ".msh";
auto& fs = m_dialog.m_editor.getEngine().getFileSystem();
Lumix::FS::OsFile file;
if (!file.open(path,

View file

@ -85,7 +85,7 @@ struct EndGroupCommand : public IEditorCommand
class SetEntityNameCommand : public IEditorCommand
{
public:
SetEntityNameCommand(WorldEditor& editor)
explicit SetEntityNameCommand(WorldEditor& editor)
: m_new_name(m_editor.getAllocator())
, m_old_name(m_editor.getAllocator())
, m_editor(editor)
@ -166,7 +166,7 @@ private:
class PasteEntityCommand : public IEditorCommand
{
public:
PasteEntityCommand(WorldEditor& editor)
explicit PasteEntityCommand(WorldEditor& editor)
: m_blob(editor.getAllocator())
, m_editor(editor)
, m_entities(editor.getAllocator())
@ -260,7 +260,7 @@ private:
class MoveEntityCommand : public IEditorCommand
{
public:
MoveEntityCommand(WorldEditor& editor)
explicit MoveEntityCommand(WorldEditor& editor)
: m_new_positions(editor.getAllocator())
, m_new_rotations(editor.getAllocator())
, m_old_positions(editor.getAllocator())
@ -416,7 +416,7 @@ private:
class ScaleEntityCommand : public IEditorCommand
{
public:
ScaleEntityCommand(WorldEditor& editor)
explicit ScaleEntityCommand(WorldEditor& editor)
: m_new_scales(editor.getAllocator())
, m_old_scales(editor.getAllocator())
, m_entities(editor.getAllocator())
@ -544,7 +544,7 @@ class RemoveArrayPropertyItemCommand : public IEditorCommand
{
public:
RemoveArrayPropertyItemCommand(WorldEditor& editor)
explicit RemoveArrayPropertyItemCommand(WorldEditor& editor)
: m_old_values(editor.getAllocator())
, m_editor(editor)
{
@ -632,7 +632,7 @@ class AddArrayPropertyItemCommand : public IEditorCommand
{
public:
AddArrayPropertyItemCommand(WorldEditor& editor)
explicit AddArrayPropertyItemCommand(WorldEditor& editor)
: m_editor(editor)
{
}
@ -706,7 +706,7 @@ private:
class SetPropertyCommand : public IEditorCommand
{
public:
SetPropertyCommand(WorldEditor& editor)
explicit SetPropertyCommand(WorldEditor& editor)
: m_editor(editor)
, m_new_value(editor.getAllocator())
, m_old_value(editor.getAllocator())
@ -892,7 +892,7 @@ private:
class AddComponentCommand : public IEditorCommand
{
public:
AddComponentCommand(WorldEditor& editor)
explicit AddComponentCommand(WorldEditor& editor)
: m_editor(static_cast<WorldEditorImpl&>(editor))
, m_entities(editor.getAllocator())
{
@ -1010,7 +1010,7 @@ private:
class DestroyEntitiesCommand : public IEditorCommand
{
public:
DestroyEntitiesCommand(WorldEditor& editor)
explicit DestroyEntitiesCommand(WorldEditor& editor)
: m_editor(static_cast<WorldEditorImpl&>(editor))
, m_entities(editor.getAllocator())
, m_positons_rotations(editor.getAllocator())
@ -1192,7 +1192,7 @@ private:
class DestroyComponentCommand : public IEditorCommand
{
public:
DestroyComponentCommand(WorldEditor& editor)
explicit DestroyComponentCommand(WorldEditor& editor)
: m_editor(static_cast<WorldEditorImpl&>(editor))
, m_old_values(editor.getAllocator())
{
@ -1330,7 +1330,7 @@ private:
class AddEntityCommand : public IEditorCommand
{
public:
AddEntityCommand(WorldEditor& editor)
explicit AddEntityCommand(WorldEditor& editor)
: m_editor(static_cast<WorldEditorImpl&>(editor))
{
m_entity = INVALID_ENTITY;
@ -3214,7 +3214,7 @@ private:
struct ComponentType
{
ComponentType(IAllocator& allocator)
explicit ComponentType(IAllocator& allocator)
: m_name(allocator)
, m_id(allocator)
{

View file

@ -11,7 +11,7 @@ namespace Lumix
class SortedArray
{
public:
SortedArray(IAllocator& allocator)
explicit SortedArray(IAllocator& allocator)
: m_data(allocator)
{}
@ -108,7 +108,7 @@ namespace Lumix
class AssociativeArray
{
public:
AssociativeArray(IAllocator& allocator)
explicit AssociativeArray(IAllocator& allocator)
: m_data(allocator)
{}

View file

@ -463,7 +463,7 @@ public:
private:
struct ComponentType
{
ComponentType(IAllocator& allocator)
explicit ComponentType(IAllocator& allocator)
: m_name(allocator)
, m_id(allocator)
{

View file

@ -14,7 +14,7 @@ namespace PropertyRegister
struct ComponentType
{
ComponentType(IAllocator& allocator)
explicit ComponentType(IAllocator& allocator)
: m_name(allocator)
, m_id(allocator)
{

View file

@ -195,6 +195,7 @@ static int getEntityPosition(lua_State* L)
return 1;
}
static int getEntityDirection(lua_State* L)
{
auto* universe = LuaWrapper::checkArg<Universe*>(L, 1);

View file

@ -51,7 +51,7 @@ namespace Lumix
class LuaScriptSystemImpl : public IPlugin
{
public:
LuaScriptSystemImpl(Engine& engine);
explicit LuaScriptSystemImpl(Engine& engine);
virtual ~LuaScriptSystemImpl();
IAllocator& getAllocator();
@ -102,7 +102,7 @@ namespace Lumix
struct ScriptInstance
{
ScriptInstance(IAllocator& allocator)
explicit ScriptInstance(IAllocator& allocator)
: m_properties(allocator)
{
m_script = nullptr;
@ -1098,7 +1098,7 @@ namespace Lumix
AddScriptCommand(){}
AddScriptCommand(WorldEditor& editor)
explicit AddScriptCommand(WorldEditor& editor)
{
scene = static_cast<LuaScriptSceneImpl*>(editor.getScene(crc32("lua_script")));
}
@ -1150,14 +1150,14 @@ namespace Lumix
struct RemoveScriptCommand : public IEditorCommand
{
RemoveScriptCommand(WorldEditor& editor)
explicit RemoveScriptCommand(WorldEditor& editor)
: blob(editor.getAllocator())
{
scene = static_cast<LuaScriptSceneImpl*>(editor.getScene(crc32("lua_script")));
}
RemoveScriptCommand(IAllocator& allocator)
explicit RemoveScriptCommand(IAllocator& allocator)
: blob(allocator)
{
}
@ -1213,7 +1213,7 @@ namespace Lumix
struct SetPropertyCommand : public IEditorCommand
{
SetPropertyCommand(WorldEditor& editor)
explicit SetPropertyCommand(WorldEditor& editor)
: property_name(editor.getAllocator())
, value(editor.getAllocator())
, old_value(editor.getAllocator())
@ -1339,7 +1339,7 @@ namespace Lumix
PropertyGridPlugin(StudioApp& app)
explicit PropertyGridPlugin(StudioApp& app)
: m_app(app)
{
lua_State* L = app.getWorldEditor()->getEngine().getState();
@ -1473,7 +1473,7 @@ namespace Lumix
struct AssetBrowserPlugin : AssetBrowser::IPlugin
{
AssetBrowserPlugin(StudioApp& app)
explicit AssetBrowserPlugin(StudioApp& app)
: m_app(app)
{
m_text_buffer[0] = 0;

View file

@ -198,7 +198,7 @@ namespace Lumix
struct PhysicsSystemImpl : public PhysicsSystem
{
PhysicsSystemImpl(Engine& engine)
explicit PhysicsSystemImpl(Engine& engine)
: m_allocator(engine.getAllocator())
, m_engine(engine)
, m_manager(*this, engine.getAllocator())
@ -244,7 +244,7 @@ namespace Lumix
struct EditorPlugin : public WorldEditor::Plugin
{
EditorPlugin(WorldEditor& editor)
explicit EditorPlugin(WorldEditor& editor)
: m_editor(editor)
{
}
@ -386,7 +386,7 @@ namespace {
struct StudioAppPlugin : public StudioApp::IPlugin
{
StudioAppPlugin(Lumix::WorldEditor& editor)
explicit StudioAppPlugin(Lumix::WorldEditor& editor)
: m_editor(editor)
{
m_action = LUMIX_NEW(m_editor.getAllocator(), Action)("Physics", "physics");

View file

@ -48,7 +48,7 @@ static const uint32 RENDER_PARAMS_HASH = crc32("render_params");
struct MaterialPlugin : public AssetBrowser::IPlugin
{
MaterialPlugin(StudioApp& app)
explicit MaterialPlugin(StudioApp& app)
: m_app(app)
{
}
@ -317,7 +317,7 @@ struct ModelPlugin : public AssetBrowser::IPlugin
WorldEditor& m_editor;
Entity getEntity() const { return m_entity; }
InsertMeshCommand(WorldEditor& editor)
explicit InsertMeshCommand(WorldEditor& editor)
: m_editor(editor)
{
}
@ -414,7 +414,7 @@ struct ModelPlugin : public AssetBrowser::IPlugin
};
ModelPlugin(StudioApp& app)
explicit ModelPlugin(StudioApp& app)
: m_app(app)
{
m_app.getWorldEditor()->registerEditorCommandCreator("insert_mesh", createInsertMeshCommand);
@ -539,7 +539,7 @@ struct ModelPlugin : public AssetBrowser::IPlugin
struct TexturePlugin : public AssetBrowser::IPlugin
{
TexturePlugin(StudioApp& app)
explicit TexturePlugin(StudioApp& app)
: m_app(app)
{
}
@ -603,7 +603,7 @@ struct TexturePlugin : public AssetBrowser::IPlugin
struct ShaderPlugin : public AssetBrowser::IPlugin
{
ShaderPlugin(StudioApp& app)
explicit ShaderPlugin(StudioApp& app)
: m_app(app)
{
}
@ -713,7 +713,7 @@ static const uint32 PARTICLE_EMITTER_HASH = crc32("particle_emitter");
struct EmitterPlugin : public PropertyGrid::IPlugin
{
EmitterPlugin(StudioApp& app)
explicit EmitterPlugin(StudioApp& app)
: m_app(app)
{
m_particle_emitter_updating = true;
@ -752,7 +752,7 @@ static const uint32 TERRAIN_HASH = crc32("terrain");
struct TerrainPlugin : public PropertyGrid::IPlugin
{
TerrainPlugin(StudioApp& app)
explicit TerrainPlugin(StudioApp& app)
: m_app(app)
{
auto& editor = *app.getWorldEditor();
@ -924,7 +924,7 @@ struct SceneViewPlugin : public StudioApp::IPlugin
};
SceneViewPlugin(StudioApp& app)
explicit SceneViewPlugin(StudioApp& app)
: m_app(app)
{
auto& editor = *app.getWorldEditor();
@ -980,7 +980,7 @@ struct GameViewPlugin : public StudioApp::IPlugin
static GameViewPlugin* s_instance;
GameViewPlugin(StudioApp& app)
explicit GameViewPlugin(StudioApp& app)
: m_app(app)
{
m_width = m_height = -1;
@ -1189,7 +1189,7 @@ GameViewPlugin* GameViewPlugin::s_instance = nullptr;
struct ShaderEditorPlugin : public StudioApp::IPlugin
{
ShaderEditorPlugin(StudioApp& app)
explicit ShaderEditorPlugin(StudioApp& app)
: m_shader_editor(app.getWorldEditor()->getAllocator())
, m_app(app)
{

View file

@ -45,7 +45,7 @@ struct PaintTerrainCommand : public Lumix::IEditorCommand
};
PaintTerrainCommand(Lumix::WorldEditor& editor)
explicit PaintTerrainCommand(Lumix::WorldEditor& editor)
: m_world_editor(editor)
, m_new_data(editor.getAllocator())
, m_old_data(editor.getAllocator())
@ -937,7 +937,6 @@ void TerrainEditor::removeEntities(const Lumix::RayCastModelHit& hit)
if (m_selected_entity_templates.empty()) return;
auto& template_system = m_world_editor.getEntityTemplateSystem();
auto& template_names = template_system.getTemplateNames();
int templates_count = template_names.size();
PROFILE_FUNCTION();
@ -1090,7 +1089,6 @@ void TerrainEditor::paintEntities(const Lumix::RayCastModelHit& hit)
if (m_selected_entity_templates.empty()) return;
auto& template_system = m_world_editor.getEntityTemplateSystem();
auto& template_names = template_system.getTemplateNames();
int templates_count = template_names.size();
static const Lumix::uint32 PAINT_ENTITIES_HASH = Lumix::crc32("paint_entities");
m_world_editor.beginCommandGroup(PAINT_ENTITIES_HASH);

View file

@ -2950,7 +2950,6 @@ public:
for (int i = 0; i < m_point_lights.size(); ++i)
{
PointLight& light = m_point_lights[i];
m_light_influenced_geometry[i].eraseItemFast(component);
}
m_culling_system->removeStatic(component);

View file

@ -452,7 +452,7 @@ static const uint32 CAMERA_HASH = crc32("camera");
struct BGFXAllocator : public bx::AllocatorI
{
BGFXAllocator(Lumix::IAllocator& source)
explicit BGFXAllocator(Lumix::IAllocator& source)
: m_source(source)
{
}
@ -499,7 +499,7 @@ struct RendererImpl : public Renderer
{
struct CallbackStub : public bgfx::CallbackI
{
CallbackStub(RendererImpl& renderer)
explicit CallbackStub(RendererImpl& renderer)
: m_renderer(renderer)
{}
@ -593,7 +593,7 @@ struct RendererImpl : public Renderer
};
RendererImpl(Engine& engine)
explicit RendererImpl(Engine& engine)
: m_engine(engine)
, m_allocator(engine.getAllocator())
, m_texture_manager(m_allocator)

View file

@ -213,7 +213,7 @@ namespace Lumix
m_task.run();
}
ManagerImpl(IAllocator& allocator)
explicit ManagerImpl(IAllocator& allocator)
: m_fails(0)
, m_task(&m_trans_queue, allocator)
, m_in_progress(allocator)