mirror of
https://github.com/Relintai/pmlpp.git
synced 2024-11-08 13:12:09 +01:00
Added compatibility macros. Also make FIleAccess work with sfw.
This commit is contained in:
parent
49bfdcdd2c
commit
a516116eec
@ -268,7 +268,11 @@ void MLPPData::set_data_supervised(int k, const String &file_name, Ref<MLPPMatri
|
|||||||
Vector<Vector<real_t>> input_set_tmp;
|
Vector<Vector<real_t>> input_set_tmp;
|
||||||
Vector<real_t> output_set_tmp;
|
Vector<real_t> output_set_tmp;
|
||||||
|
|
||||||
|
#ifdef USING_SFW
|
||||||
|
FileAccess *file = FileAccess::create_and_open(file_name, FileAccess::READ);
|
||||||
|
#else
|
||||||
FileAccess *file = FileAccess::open(file_name, FileAccess::READ);
|
FileAccess *file = FileAccess::open(file_name, FileAccess::READ);
|
||||||
|
#endif
|
||||||
|
|
||||||
ERR_FAIL_COND(!file);
|
ERR_FAIL_COND(!file);
|
||||||
|
|
||||||
@ -300,7 +304,11 @@ void MLPPData::set_data_unsupervised(int k, const String &file_name, Ref<MLPPMat
|
|||||||
Vector<Vector<real_t>> input_set_tmp;
|
Vector<Vector<real_t>> input_set_tmp;
|
||||||
input_set_tmp.resize(k);
|
input_set_tmp.resize(k);
|
||||||
|
|
||||||
|
#ifdef USING_SFW
|
||||||
|
FileAccess *file = FileAccess::create_and_open(file_name, FileAccess::READ);
|
||||||
|
#else
|
||||||
FileAccess *file = FileAccess::open(file_name, FileAccess::READ);
|
FileAccess *file = FileAccess::open(file_name, FileAccess::READ);
|
||||||
|
#endif
|
||||||
|
|
||||||
ERR_FAIL_COND(!file);
|
ERR_FAIL_COND(!file);
|
||||||
|
|
||||||
@ -322,7 +330,11 @@ void MLPPData::set_data_unsupervised(int k, const String &file_name, Ref<MLPPMat
|
|||||||
void MLPPData::set_data_simple(const String &file_name, Ref<MLPPVector> input_set, Ref<MLPPVector> output_set) {
|
void MLPPData::set_data_simple(const String &file_name, Ref<MLPPVector> input_set, Ref<MLPPVector> output_set) {
|
||||||
ERR_FAIL_COND(!input_set.is_valid() || !output_set.is_valid());
|
ERR_FAIL_COND(!input_set.is_valid() || !output_set.is_valid());
|
||||||
|
|
||||||
|
#ifdef USING_SFW
|
||||||
|
FileAccess *file = FileAccess::create_and_open(file_name, FileAccess::READ);
|
||||||
|
#else
|
||||||
FileAccess *file = FileAccess::open(file_name, FileAccess::READ);
|
FileAccess *file = FileAccess::open(file_name, FileAccess::READ);
|
||||||
|
#endif
|
||||||
|
|
||||||
ERR_FAIL_COND(!file);
|
ERR_FAIL_COND(!file);
|
||||||
|
|
||||||
|
@ -19224,4 +19224,6 @@ public:
|
|||||||
|
|
||||||
#line 0
|
#line 0
|
||||||
|
|
||||||
|
#include "sfw_compat.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,23 @@
|
|||||||
|
|
||||||
#ifndef SFW_COMPAT_H
|
#ifndef SFW_COMPAT_H
|
||||||
#define SFW_COMPAT_H
|
#define SFW_COMPAT_H
|
||||||
|
|
||||||
|
class ClassDB {
|
||||||
|
public:
|
||||||
|
static void bind_method(...) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
#define GDCLASS(m_class, m_inherits) SFW_OBJECT(m_class, m_inherits);
|
||||||
|
|
||||||
|
#define VARIANT_ENUM_CAST(...)
|
||||||
|
|
||||||
|
#define BIND_ENUM_CONSTANT(...)
|
||||||
|
|
||||||
|
#define D_METHOD(...) ""
|
||||||
|
|
||||||
|
#define PLOG_MSG LOG_MSG
|
||||||
|
|
||||||
|
#define PropertyInfo(...) ""
|
||||||
|
#define ADD_PROPERTY(...)
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue
Block a user