Skip to content

Commit

Permalink
fix: исправлена сборка майя-плагина.
Browse files Browse the repository at this point in the history
fix #9
  • Loading branch information
abramcumner committed Nov 19, 2019
1 parent 61b8d35 commit d265502
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
4 changes: 2 additions & 2 deletions sources/plugins/maya_tools/maya_export_tools.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ MStatus maya_export_tools::export_object(const char* path, bool selection_only)

MStatus status = MS::kFailure;
if (xr_object* object = create_object(mesh_objs)) {
if (object->save_object(path, m_compressed))
if (object->save_object(path, m_compressed ? compress_options::compress : compress_options::none))
status = MS::kSuccess;
delete object;
}
Expand Down Expand Up @@ -858,7 +858,7 @@ MStatus maya_export_tools::export_skl_object(const char* path, bool selection_on

status = MS::kFailure;
if (xr_object* object = create_skl_object(mesh_obj, skin_obj)) {
if (object->save_object(path, m_compressed))
if (object->save_object(path, m_compressed ? compress_options::compress : compress_options::none))
status = MS::kSuccess;
delete object;
}
Expand Down
13 changes: 4 additions & 9 deletions sources/xray_re/xr_object.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
#include "xr_utils.h"
#include "xr_name_gen.h"

namespace xray_re {
compress_t compress_true{ true };
compress_t compress_false{ false };
}

using namespace xray_re;

xr_object::xr_object(): m_flags(EOF_STATIC),
Expand Down Expand Up @@ -281,25 +276,25 @@ void xr_object::save_object(xr_writer& w) const
w.close_chunk();
}

bool xr_object::save_object(const char* path, compress_t compress) const
bool xr_object::save_object(const char* path, compress_options compress) const
{
xr_memory_writer w;
save_object(w);

xr_memory_writer file;
file.w_raw_chunk(EOBJ_CHUNK_MAIN, w.data(), w.tell(), compress.value);
file.w_raw_chunk(EOBJ_CHUNK_MAIN, w.data(), w.tell(), compress != compress_options::none);

bool status = file.save_to(path);
return status;
}

bool xr_object::save_object(const char* path, const std::string& name, compress_t compress) const
bool xr_object::save_object(const char* path, const std::string& name, compress_options compress) const
{
xr_memory_writer w;
save_object(w);

xr_memory_writer file;
file.w_raw_chunk(EOBJ_CHUNK_MAIN, w.data(), w.tell(), compress.value);
file.w_raw_chunk(EOBJ_CHUNK_MAIN, w.data(), w.tell(), compress != compress_options::none);

bool status = file.save_to(path, name);
return status;
Expand Down
11 changes: 5 additions & 6 deletions sources/xray_re/xr_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ inline size_t hash_value(const xr_raw_surface& surface)
}
#endif

struct compress_t
enum class compress_options
{
const bool value;
none,
compress,
};
extern compress_t compress_true;
extern compress_t compress_false;

class xr_object: public xr_surface_factory {
public:
Expand All @@ -67,8 +66,8 @@ class xr_object: public xr_surface_factory {

virtual bool load_object(const char* path);
virtual void load_object(xr_reader& r);
virtual bool save_object(const char* path, compress_t compress = compress_false) const;
virtual bool save_object(const char* path, const std::string& name, compress_t compress = compress_false) const;
virtual bool save_object(const char* path, compress_options compress = compress_options::none) const;
virtual bool save_object(const char* path, const std::string& name, compress_options compress = compress_options::none) const;
virtual void save_object(xr_writer& w) const;

virtual bool load_bones(const char* path);
Expand Down

0 comments on commit d265502

Please sign in to comment.