godot/editor/editor_export_godot3.h
Rémi Verschelde 1b0e2b0c39 Refactoring: rename tools/editor/ to editor/
The other subfolders of tools/ had already been moved to either
editor/, misc/ or thirdparty/, so the hiding the editor code that
deep was no longer meaningful.

(Manual redo of 49c065d29c)
2017-03-18 23:45:45 +01:00

70 lines
1.7 KiB
C++

#ifndef EDITOR_EXPORT_GODOT3_H
#define EDITOR_EXPORT_GODOT3_H
#include "scene/main/node.h"
#include "editor/editor_file_system.h"
#include "io/export_data.h"
class EditorExportGodot3 {
Map<String,int> pack_names;
HashMap<Variant,int,VariantHasher> pack_values;
int _pack_name(const String& p_name) {
if (pack_names.has(p_name)) {
return pack_names[p_name];
}
int idx = pack_names.size();
pack_names[p_name]=idx;
return idx;
}
int _pack_value(const Variant& p_value) {
if (pack_values.has(p_value)) {
return pack_values[p_value];
}
int idx = pack_values.size();
pack_values[p_value]=idx;
return idx;
}
Map<String,String> prop_rename_map;
Map<String,String> type_rename_map;
Map<String,String> signal_rename_map;
Map<String,String> resource_replace_map;
String _replace_resource(const String& p_res) {
if (resource_replace_map.has(p_res))
return resource_replace_map[p_res];
else
return p_res;
}
Error _get_property_as_text(const Variant& p_variant,String&p_string);
void _save_text(const String& p_path,ExportData &resource);
void _save_binary_property(const Variant& p_property,FileAccess *f);
void _save_binary(const String& p_path,ExportData &resource);
void _save_config(const String &p_path);
void _rename_properties(const String& p_type,List<ExportData::PropertyData> *p_props);
void _convert_resources(ExportData &resource);
void _unpack_packed_scene(ExportData &resource);
void _pack_packed_scene(ExportData &resource);
void _find_files(EditorFileSystemDirectory *p_dir, List<String> * r_files);
public:
Error export_godot3(const String& p_path);
EditorExportGodot3();
};
#endif // EDITOR_EXPORT_GODOT3_H