diff --git a/modules/entity_spell_system/data/species/species_instance.cpp b/modules/entity_spell_system/data/species/species_instance.cpp index 1d4e402d0..a64931252 100644 --- a/modules/entity_spell_system/data/species/species_instance.cpp +++ b/modules/entity_spell_system/data/species/species_instance.cpp @@ -115,11 +115,7 @@ Dictionary SpeciesInstance::_to_dict() { return dict; } void SpeciesInstance::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif _id = dict.get("id", 0); set_species_path(dict.get("species_path", "")); diff --git a/modules/entity_spell_system/database/ess_resource_db_folders.cpp b/modules/entity_spell_system/database/ess_resource_db_folders.cpp index 5b64109bb..65cb003b8 100644 --- a/modules/entity_spell_system/database/ess_resource_db_folders.cpp +++ b/modules/entity_spell_system/database/ess_resource_db_folders.cpp @@ -124,7 +124,6 @@ void ESSResourceDBFolders::add_resource(const Ref &resource) { Ref ESSResourceDBFolders::load_resource(const String &path, const String &type_hint) { _ResourceLoader *rl = _ResourceLoader::get_singleton(); -#if VERSION_MAJOR < 4 Ref resl = rl->load_interactive(path, type_hint); ERR_FAIL_COND_V(!resl.is_valid(), Ref()); @@ -132,9 +131,6 @@ Ref ESSResourceDBFolders::load_resource(const String &path, const Stri resl->wait(); return resl->get_resource(); -#else - return rl->load(path, type_hint); -#endif } ESSResourceDBFolders::ESSResourceDBFolders() { diff --git a/modules/entity_spell_system/editor/ess_editor_plugin.cpp b/modules/entity_spell_system/editor/ess_editor_plugin.cpp index aeade8c5a..ac454b09b 100644 --- a/modules/entity_spell_system/editor/ess_editor_plugin.cpp +++ b/modules/entity_spell_system/editor/ess_editor_plugin.cpp @@ -30,11 +30,7 @@ void ESSEditorPlugin::fix_ids(Variant param) { ESSEditorPlugin::ESSEditorPlugin(EditorNode *p_node) { editor = p_node; -#if VERSION_MAJOR > 3 - //editor->add_tool_menu_item("ESS: make ids unique", this, "fix_ids"); -#else editor->add_tool_menu_item("ESS: make ids unique", this, "fix_ids"); -#endif } ESSEditorPlugin::~ESSEditorPlugin() { diff --git a/modules/entity_spell_system/entities/data/entity_data_container.cpp b/modules/entity_spell_system/entities/data/entity_data_container.cpp index 5a7dbaa19..d71dde57f 100644 --- a/modules/entity_spell_system/entities/data/entity_data_container.cpp +++ b/modules/entity_spell_system/entities/data/entity_data_container.cpp @@ -39,11 +39,7 @@ Dictionary EntityDataContainer::_to_dict() { return dict; } void EntityDataContainer::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif } EntityDataContainer::EntityDataContainer() { diff --git a/modules/entity_spell_system/entities/resources/entity_resource.cpp b/modules/entity_spell_system/entities/resources/entity_resource.cpp index 164df12a8..6675b4332 100644 --- a/modules/entity_spell_system/entities/resources/entity_resource.cpp +++ b/modules/entity_spell_system/entities/resources/entity_resource.cpp @@ -286,11 +286,7 @@ Dictionary EntityResource::_to_dict() { return dict; } void EntityResource::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif _dirty = dict.get("dirty", false); _should_process = dict.get("should_process", false); diff --git a/modules/entity_spell_system/infos/spell_cast_info.cpp b/modules/entity_spell_system/infos/spell_cast_info.cpp index 420966876..fb5ef290b 100644 --- a/modules/entity_spell_system/infos/spell_cast_info.cpp +++ b/modules/entity_spell_system/infos/spell_cast_info.cpp @@ -205,11 +205,7 @@ Dictionary SpellCastInfo::to_dict() { return dict; } void SpellCastInfo::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif _has_cast_time = dict.get("has_cast_time", true); _cast_time = dict.get("cast_time", 0); diff --git a/modules/entity_spell_system/pipelines/spell_damage_info.cpp b/modules/entity_spell_system/pipelines/spell_damage_info.cpp index dfa54ac4b..89a97010a 100644 --- a/modules/entity_spell_system/pipelines/spell_damage_info.cpp +++ b/modules/entity_spell_system/pipelines/spell_damage_info.cpp @@ -201,11 +201,7 @@ Dictionary SpellDamageInfo::to_dict() { return dict; } void SpellDamageInfo::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif _immune = dict.get("immune", true); _damage = dict.get("damage", 0); diff --git a/modules/entity_spell_system/pipelines/spell_heal_info.cpp b/modules/entity_spell_system/pipelines/spell_heal_info.cpp index 63aebf536..ab7641ffd 100644 --- a/modules/entity_spell_system/pipelines/spell_heal_info.cpp +++ b/modules/entity_spell_system/pipelines/spell_heal_info.cpp @@ -202,11 +202,7 @@ Dictionary SpellHealInfo::to_dict() { return dict; } void SpellHealInfo::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif _immune = dict.get("immune", true); _heal = dict.get("heal", 0); @@ -237,7 +233,6 @@ SpellHealInfo::~SpellHealInfo() { } void SpellHealInfo::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_immune"), &SpellHealInfo::get_immune); ClassDB::bind_method(D_METHOD("set_immune", "value"), &SpellHealInfo::set_immune); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "immune"), "set_immune", "get_immune"); diff --git a/modules/entity_spell_system/profiles/actionbar/action_bar_button_entry.cpp b/modules/entity_spell_system/profiles/actionbar/action_bar_button_entry.cpp index efd8f4185..3d5b53614 100644 --- a/modules/entity_spell_system/profiles/actionbar/action_bar_button_entry.cpp +++ b/modules/entity_spell_system/profiles/actionbar/action_bar_button_entry.cpp @@ -93,11 +93,7 @@ Dictionary ActionBarButtonEntry::to_dict() const { return dict; } void ActionBarButtonEntry::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif _action_bar_id = dict.get("action_bar_id", 0); _slot_id = dict.get("slot_id", 0); diff --git a/modules/entity_spell_system/profiles/actionbar/action_bar_entry.cpp b/modules/entity_spell_system/profiles/actionbar/action_bar_entry.cpp index 75436527d..06a11583d 100644 --- a/modules/entity_spell_system/profiles/actionbar/action_bar_entry.cpp +++ b/modules/entity_spell_system/profiles/actionbar/action_bar_entry.cpp @@ -117,11 +117,7 @@ Dictionary ActionBarEntry::to_dict() const { return dict; } void ActionBarEntry::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif for (int i = 0; i < _button_entries.size(); ++i) { _button_entries.get(i)->set_owner(NULL); diff --git a/modules/entity_spell_system/profiles/actionbar/action_bar_profile.cpp b/modules/entity_spell_system/profiles/actionbar/action_bar_profile.cpp index bcc902626..d9ef79a25 100644 --- a/modules/entity_spell_system/profiles/actionbar/action_bar_profile.cpp +++ b/modules/entity_spell_system/profiles/actionbar/action_bar_profile.cpp @@ -134,13 +134,8 @@ Dictionary ActionBarProfile::to_dict() const { return dict; } void ActionBarProfile::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - if (dict.is_empty()) - return; -#else if (dict.empty()) return; -#endif for (int i = 0; i < _action_bars.size(); ++i) { _action_bars.get(i)->set_owner(NULL); diff --git a/modules/entity_spell_system/profiles/class_profile.cpp b/modules/entity_spell_system/profiles/class_profile.cpp index 0c78ec8fa..93d365a01 100644 --- a/modules/entity_spell_system/profiles/class_profile.cpp +++ b/modules/entity_spell_system/profiles/class_profile.cpp @@ -127,11 +127,7 @@ Dictionary ClassProfile::to_dict() const { return dict; } void ClassProfile::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif _character_class_name = dict.get("character_class_name", ""); _class_path = dict.get("class_path", ""); diff --git a/modules/entity_spell_system/profiles/player_profile.cpp b/modules/entity_spell_system/profiles/player_profile.cpp index 177ee738a..87fdb9079 100644 --- a/modules/entity_spell_system/profiles/player_profile.cpp +++ b/modules/entity_spell_system/profiles/player_profile.cpp @@ -146,11 +146,7 @@ Dictionary PlayerProfile::to_dict() const { return dict; } void PlayerProfile::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif clear_class_profiles(); diff --git a/modules/entity_spell_system/singletons/ess.cpp b/modules/entity_spell_system/singletons/ess.cpp index 608dd4217..b95a28c8a 100644 --- a/modules/entity_spell_system/singletons/ess.cpp +++ b/modules/entity_spell_system/singletons/ess.cpp @@ -663,7 +663,6 @@ void ESS::material_cache_unref(const uint64_t key) { Ref ESS::load_resource(const String &path, const String &type_hint) { _ResourceLoader *rl = _ResourceLoader::get_singleton(); -#if VERSION_MAJOR < 4 Ref resl = rl->load_interactive(path, type_hint); ERR_FAIL_COND_V(!resl.is_valid(), Ref()); @@ -671,9 +670,6 @@ Ref ESS::load_resource(const String &path, const String &type_hint) { resl->wait(); return resl->get_resource(); -#else - return rl->load(path, type_hint); -#endif } void ESS::_bind_methods() { @@ -910,11 +906,7 @@ ESS::ESS() { #endif #ifdef TEXTURE_PACKER_PRESENT -#if VERSION_MAJOR < 4 _texture_flags = GLOBAL_DEF("ess/material_cache/texture_flags", Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER); -#else - _texture_flags = GLOBAL_DEF("ess/material_cache/texture_flags", 0); -#endif _max_atlas_size = GLOBAL_DEF("ess/material_cache/max_atlas_size", 1024); _keep_original_atlases = GLOBAL_DEF("ess/material_cache/keep_original_atlases", false); diff --git a/modules/entity_spell_system/singletons/profile_manager.cpp b/modules/entity_spell_system/singletons/profile_manager.cpp index 56a1288c0..7bb90982a 100644 --- a/modules/entity_spell_system/singletons/profile_manager.cpp +++ b/modules/entity_spell_system/singletons/profile_manager.cpp @@ -165,11 +165,7 @@ Dictionary ProfileManager::to_dict() const { return dict; } void ProfileManager::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif clears_player_profiles(); diff --git a/modules/entity_spell_system/utility/entity_create_info.cpp b/modules/entity_spell_system/utility/entity_create_info.cpp index 9915835d0..c055e44af 100644 --- a/modules/entity_spell_system/utility/entity_create_info.cpp +++ b/modules/entity_spell_system/utility/entity_create_info.cpp @@ -190,11 +190,7 @@ Dictionary EntityCreateInfo::_to_dict() { return dict; } void EntityCreateInfo::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 - ERR_FAIL_COND(dict.is_empty()); -#else ERR_FAIL_COND(dict.empty()); -#endif _guid = dict.get("guid", 0); _networked = dict.get("networked", false); diff --git a/modules/fastnoise/fastnoise_noise_params.cpp b/modules/fastnoise/fastnoise_noise_params.cpp index f6def3f0f..0e07d7989 100644 --- a/modules/fastnoise/fastnoise_noise_params.cpp +++ b/modules/fastnoise/fastnoise_noise_params.cpp @@ -1,11 +1,5 @@ #include "fastnoise_noise_params.h" -#include "core/version.h" - -#if VERSION_MAJOR >= 4 -#define REAL FLOAT -#endif - void FastnoiseNoiseParams::setup_noise(Ref noise) { noise->set_seed(_seed); noise->set_noise_type(_noise_type); diff --git a/modules/fastnoise/fastnoise_noise_params.h b/modules/fastnoise/fastnoise_noise_params.h index acf8cd6af..94b31938f 100644 --- a/modules/fastnoise/fastnoise_noise_params.h +++ b/modules/fastnoise/fastnoise_noise_params.h @@ -1,13 +1,7 @@ #ifndef FASTNOISE_NOISE_PARAMS_H #define FASTNOISE_NOISE_PARAMS_H -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#else #include "core/resource.h" -#endif #include "noise.h" diff --git a/modules/fastnoise/lib/FastNoise.cpp b/modules/fastnoise/lib/FastNoise.cpp index 41ffd386f..30f9d2cb9 100644 --- a/modules/fastnoise/lib/FastNoise.cpp +++ b/modules/fastnoise/lib/FastNoise.cpp @@ -28,186 +28,1618 @@ #include "FastNoise.h" -#include #include +#include #include #include #include "core/version.h" -#if VERSION_MAJOR >= 4 - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" -#endif - namespace fastnoise { -const FN_DECIMAL GRAD_X[] = -{ +const FN_DECIMAL GRAD_X[] = { 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0 }; -const FN_DECIMAL GRAD_Y[] = -{ +const FN_DECIMAL GRAD_Y[] = { 1, 1, -1, -1, 0, 0, 0, 0, 1, -1, 1, -1 }; -const FN_DECIMAL GRAD_Z[] = -{ +const FN_DECIMAL GRAD_Z[] = { 0, 0, 0, 0, 1, 1, -1, -1, 1, 1, -1, -1 }; -const FN_DECIMAL GRAD_4D[] = -{ - 0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1, - 0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1, - 1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1, - -1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1, - 1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1, - -1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1, - 1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0, - -1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0 +const FN_DECIMAL GRAD_4D[] = { + 0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, + 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, + 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1, + -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1, + 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1, + -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1, + 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0, + -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0 }; -const FN_DECIMAL VAL_LUT[] = -{ - FN_DECIMAL(0.3490196078), FN_DECIMAL(0.4352941176), FN_DECIMAL(-0.4509803922), FN_DECIMAL(0.6392156863), FN_DECIMAL(0.5843137255), FN_DECIMAL(-0.1215686275), FN_DECIMAL(0.7176470588), FN_DECIMAL(-0.1058823529), FN_DECIMAL(0.3960784314), FN_DECIMAL(0.0431372549), FN_DECIMAL(-0.03529411765), FN_DECIMAL(0.3176470588), FN_DECIMAL(0.7254901961), FN_DECIMAL(0.137254902), FN_DECIMAL(0.8588235294), FN_DECIMAL(-0.8196078431), - FN_DECIMAL(-0.7960784314), FN_DECIMAL(-0.3333333333), FN_DECIMAL(-0.6705882353), FN_DECIMAL(-0.3882352941), FN_DECIMAL(0.262745098), FN_DECIMAL(0.3254901961), FN_DECIMAL(-0.6470588235), FN_DECIMAL(-0.9215686275), FN_DECIMAL(-0.5294117647), FN_DECIMAL(0.5294117647), FN_DECIMAL(-0.4666666667), FN_DECIMAL(0.8117647059), FN_DECIMAL(0.3803921569), FN_DECIMAL(0.662745098), FN_DECIMAL(0.03529411765), FN_DECIMAL(-0.6156862745), - FN_DECIMAL(-0.01960784314), FN_DECIMAL(-0.3568627451), FN_DECIMAL(-0.09019607843), FN_DECIMAL(0.7490196078), FN_DECIMAL(0.8352941176), FN_DECIMAL(-0.4039215686), FN_DECIMAL(-0.7490196078), FN_DECIMAL(0.9529411765), FN_DECIMAL(-0.0431372549), FN_DECIMAL(-0.9294117647), FN_DECIMAL(-0.6549019608), FN_DECIMAL(0.9215686275), FN_DECIMAL(-0.06666666667), FN_DECIMAL(-0.4431372549), FN_DECIMAL(0.4117647059), FN_DECIMAL(-0.4196078431), - FN_DECIMAL(-0.7176470588), FN_DECIMAL(-0.8117647059), FN_DECIMAL(-0.2549019608), FN_DECIMAL(0.4901960784), FN_DECIMAL(0.9137254902), FN_DECIMAL(0.7882352941), FN_DECIMAL(-1.0), FN_DECIMAL(-0.4745098039), FN_DECIMAL(0.7960784314), FN_DECIMAL(0.8509803922), FN_DECIMAL(-0.6784313725), FN_DECIMAL(0.4588235294), FN_DECIMAL(1.0), FN_DECIMAL(-0.1843137255), FN_DECIMAL(0.4509803922), FN_DECIMAL(0.1450980392), - FN_DECIMAL(-0.231372549), FN_DECIMAL(-0.968627451), FN_DECIMAL(-0.8588235294), FN_DECIMAL(0.4274509804), FN_DECIMAL(0.003921568627), FN_DECIMAL(-0.003921568627), FN_DECIMAL(0.2156862745), FN_DECIMAL(0.5058823529), FN_DECIMAL(0.7647058824), FN_DECIMAL(0.2078431373), FN_DECIMAL(-0.5921568627), FN_DECIMAL(0.5764705882), FN_DECIMAL(-0.1921568627), FN_DECIMAL(-0.937254902), FN_DECIMAL(0.08235294118), FN_DECIMAL(-0.08235294118), - FN_DECIMAL(0.9058823529), FN_DECIMAL(0.8274509804), FN_DECIMAL(0.02745098039), FN_DECIMAL(-0.168627451), FN_DECIMAL(-0.7803921569), FN_DECIMAL(0.1137254902), FN_DECIMAL(-0.9450980392), FN_DECIMAL(0.2), FN_DECIMAL(0.01960784314), FN_DECIMAL(0.5607843137), FN_DECIMAL(0.2705882353), FN_DECIMAL(0.4431372549), FN_DECIMAL(-0.9607843137), FN_DECIMAL(0.6156862745), FN_DECIMAL(0.9294117647), FN_DECIMAL(-0.07450980392), - FN_DECIMAL(0.3098039216), FN_DECIMAL(0.9921568627), FN_DECIMAL(-0.9137254902), FN_DECIMAL(-0.2941176471), FN_DECIMAL(-0.3411764706), FN_DECIMAL(-0.6235294118), FN_DECIMAL(-0.7647058824), FN_DECIMAL(-0.8901960784), FN_DECIMAL(0.05882352941), FN_DECIMAL(0.2392156863), FN_DECIMAL(0.7333333333), FN_DECIMAL(0.6549019608), FN_DECIMAL(0.2470588235), FN_DECIMAL(0.231372549), FN_DECIMAL(-0.3960784314), FN_DECIMAL(-0.05098039216), - FN_DECIMAL(-0.2235294118), FN_DECIMAL(-0.3725490196), FN_DECIMAL(0.6235294118), FN_DECIMAL(0.7019607843), FN_DECIMAL(-0.8274509804), FN_DECIMAL(0.4196078431), FN_DECIMAL(0.07450980392), FN_DECIMAL(0.8666666667), FN_DECIMAL(-0.537254902), FN_DECIMAL(-0.5058823529), FN_DECIMAL(-0.8039215686), FN_DECIMAL(0.09019607843), FN_DECIMAL(-0.4823529412), FN_DECIMAL(0.6705882353), FN_DECIMAL(-0.7882352941), FN_DECIMAL(0.09803921569), - FN_DECIMAL(-0.6078431373), FN_DECIMAL(0.8039215686), FN_DECIMAL(-0.6), FN_DECIMAL(-0.3254901961), FN_DECIMAL(-0.4117647059), FN_DECIMAL(-0.01176470588), FN_DECIMAL(0.4823529412), FN_DECIMAL(0.168627451), FN_DECIMAL(0.8745098039), FN_DECIMAL(-0.3647058824), FN_DECIMAL(-0.1607843137), FN_DECIMAL(0.568627451), FN_DECIMAL(-0.9921568627), FN_DECIMAL(0.9450980392), FN_DECIMAL(0.5137254902), FN_DECIMAL(0.01176470588), - FN_DECIMAL(-0.1450980392), FN_DECIMAL(-0.5529411765), FN_DECIMAL(-0.5764705882), FN_DECIMAL(-0.1137254902), FN_DECIMAL(0.5215686275), FN_DECIMAL(0.1607843137), FN_DECIMAL(0.3725490196), FN_DECIMAL(-0.2), FN_DECIMAL(-0.7254901961), FN_DECIMAL(0.631372549), FN_DECIMAL(0.7098039216), FN_DECIMAL(-0.568627451), FN_DECIMAL(0.1294117647), FN_DECIMAL(-0.3098039216), FN_DECIMAL(0.7411764706), FN_DECIMAL(-0.8509803922), - FN_DECIMAL(0.2549019608), FN_DECIMAL(-0.6392156863), FN_DECIMAL(-0.5607843137), FN_DECIMAL(-0.3176470588), FN_DECIMAL(0.937254902), FN_DECIMAL(0.9843137255), FN_DECIMAL(0.5921568627), FN_DECIMAL(0.6941176471), FN_DECIMAL(0.2862745098), FN_DECIMAL(-0.5215686275), FN_DECIMAL(0.1764705882), FN_DECIMAL(0.537254902), FN_DECIMAL(-0.4901960784), FN_DECIMAL(-0.4588235294), FN_DECIMAL(-0.2078431373), FN_DECIMAL(-0.2156862745), - FN_DECIMAL(0.7725490196), FN_DECIMAL(0.3647058824), FN_DECIMAL(-0.2392156863), FN_DECIMAL(0.2784313725), FN_DECIMAL(-0.8823529412), FN_DECIMAL(0.8980392157), FN_DECIMAL(0.1215686275), FN_DECIMAL(0.1058823529), FN_DECIMAL(-0.8745098039), FN_DECIMAL(-0.9843137255), FN_DECIMAL(-0.7019607843), FN_DECIMAL(0.9607843137), FN_DECIMAL(0.2941176471), FN_DECIMAL(0.3411764706), FN_DECIMAL(0.1529411765), FN_DECIMAL(0.06666666667), - FN_DECIMAL(-0.9764705882), FN_DECIMAL(0.3019607843), FN_DECIMAL(0.6470588235), FN_DECIMAL(-0.5843137255), FN_DECIMAL(0.05098039216), FN_DECIMAL(-0.5137254902), FN_DECIMAL(-0.137254902), FN_DECIMAL(0.3882352941), FN_DECIMAL(-0.262745098), FN_DECIMAL(-0.3019607843), FN_DECIMAL(-0.1764705882), FN_DECIMAL(-0.7568627451), FN_DECIMAL(0.1843137255), FN_DECIMAL(-0.5450980392), FN_DECIMAL(-0.4980392157), FN_DECIMAL(-0.2784313725), - FN_DECIMAL(-0.9529411765), FN_DECIMAL(-0.09803921569), FN_DECIMAL(0.8901960784), FN_DECIMAL(-0.2862745098), FN_DECIMAL(-0.3803921569), FN_DECIMAL(0.5529411765), FN_DECIMAL(0.7803921569), FN_DECIMAL(-0.8352941176), FN_DECIMAL(0.6862745098), FN_DECIMAL(0.7568627451), FN_DECIMAL(0.4980392157), FN_DECIMAL(-0.6862745098), FN_DECIMAL(-0.8980392157), FN_DECIMAL(-0.7725490196), FN_DECIMAL(-0.7098039216), FN_DECIMAL(-0.2470588235), - FN_DECIMAL(-0.9058823529), FN_DECIMAL(0.9764705882), FN_DECIMAL(0.1921568627), FN_DECIMAL(0.8431372549), FN_DECIMAL(-0.05882352941), FN_DECIMAL(0.3568627451), FN_DECIMAL(0.6078431373), FN_DECIMAL(0.5450980392), FN_DECIMAL(0.4039215686), FN_DECIMAL(-0.7333333333), FN_DECIMAL(-0.4274509804), FN_DECIMAL(0.6), FN_DECIMAL(0.6784313725), FN_DECIMAL(-0.631372549), FN_DECIMAL(-0.02745098039), FN_DECIMAL(-0.1294117647), - FN_DECIMAL(0.3333333333), FN_DECIMAL(-0.8431372549), FN_DECIMAL(0.2235294118), FN_DECIMAL(-0.3490196078), FN_DECIMAL(-0.6941176471), FN_DECIMAL(0.8823529412), FN_DECIMAL(0.4745098039), FN_DECIMAL(0.4666666667), FN_DECIMAL(-0.7411764706), FN_DECIMAL(-0.2705882353), FN_DECIMAL(0.968627451), FN_DECIMAL(0.8196078431), FN_DECIMAL(-0.662745098), FN_DECIMAL(-0.4352941176), FN_DECIMAL(-0.8666666667), FN_DECIMAL(-0.1529411765), +const FN_DECIMAL VAL_LUT[] = { + FN_DECIMAL(0.3490196078), + FN_DECIMAL(0.4352941176), + FN_DECIMAL(-0.4509803922), + FN_DECIMAL(0.6392156863), + FN_DECIMAL(0.5843137255), + FN_DECIMAL(-0.1215686275), + FN_DECIMAL(0.7176470588), + FN_DECIMAL(-0.1058823529), + FN_DECIMAL(0.3960784314), + FN_DECIMAL(0.0431372549), + FN_DECIMAL(-0.03529411765), + FN_DECIMAL(0.3176470588), + FN_DECIMAL(0.7254901961), + FN_DECIMAL(0.137254902), + FN_DECIMAL(0.8588235294), + FN_DECIMAL(-0.8196078431), + FN_DECIMAL(-0.7960784314), + FN_DECIMAL(-0.3333333333), + FN_DECIMAL(-0.6705882353), + FN_DECIMAL(-0.3882352941), + FN_DECIMAL(0.262745098), + FN_DECIMAL(0.3254901961), + FN_DECIMAL(-0.6470588235), + FN_DECIMAL(-0.9215686275), + FN_DECIMAL(-0.5294117647), + FN_DECIMAL(0.5294117647), + FN_DECIMAL(-0.4666666667), + FN_DECIMAL(0.8117647059), + FN_DECIMAL(0.3803921569), + FN_DECIMAL(0.662745098), + FN_DECIMAL(0.03529411765), + FN_DECIMAL(-0.6156862745), + FN_DECIMAL(-0.01960784314), + FN_DECIMAL(-0.3568627451), + FN_DECIMAL(-0.09019607843), + FN_DECIMAL(0.7490196078), + FN_DECIMAL(0.8352941176), + FN_DECIMAL(-0.4039215686), + FN_DECIMAL(-0.7490196078), + FN_DECIMAL(0.9529411765), + FN_DECIMAL(-0.0431372549), + FN_DECIMAL(-0.9294117647), + FN_DECIMAL(-0.6549019608), + FN_DECIMAL(0.9215686275), + FN_DECIMAL(-0.06666666667), + FN_DECIMAL(-0.4431372549), + FN_DECIMAL(0.4117647059), + FN_DECIMAL(-0.4196078431), + FN_DECIMAL(-0.7176470588), + FN_DECIMAL(-0.8117647059), + FN_DECIMAL(-0.2549019608), + FN_DECIMAL(0.4901960784), + FN_DECIMAL(0.9137254902), + FN_DECIMAL(0.7882352941), + FN_DECIMAL(-1.0), + FN_DECIMAL(-0.4745098039), + FN_DECIMAL(0.7960784314), + FN_DECIMAL(0.8509803922), + FN_DECIMAL(-0.6784313725), + FN_DECIMAL(0.4588235294), + FN_DECIMAL(1.0), + FN_DECIMAL(-0.1843137255), + FN_DECIMAL(0.4509803922), + FN_DECIMAL(0.1450980392), + FN_DECIMAL(-0.231372549), + FN_DECIMAL(-0.968627451), + FN_DECIMAL(-0.8588235294), + FN_DECIMAL(0.4274509804), + FN_DECIMAL(0.003921568627), + FN_DECIMAL(-0.003921568627), + FN_DECIMAL(0.2156862745), + FN_DECIMAL(0.5058823529), + FN_DECIMAL(0.7647058824), + FN_DECIMAL(0.2078431373), + FN_DECIMAL(-0.5921568627), + FN_DECIMAL(0.5764705882), + FN_DECIMAL(-0.1921568627), + FN_DECIMAL(-0.937254902), + FN_DECIMAL(0.08235294118), + FN_DECIMAL(-0.08235294118), + FN_DECIMAL(0.9058823529), + FN_DECIMAL(0.8274509804), + FN_DECIMAL(0.02745098039), + FN_DECIMAL(-0.168627451), + FN_DECIMAL(-0.7803921569), + FN_DECIMAL(0.1137254902), + FN_DECIMAL(-0.9450980392), + FN_DECIMAL(0.2), + FN_DECIMAL(0.01960784314), + FN_DECIMAL(0.5607843137), + FN_DECIMAL(0.2705882353), + FN_DECIMAL(0.4431372549), + FN_DECIMAL(-0.9607843137), + FN_DECIMAL(0.6156862745), + FN_DECIMAL(0.9294117647), + FN_DECIMAL(-0.07450980392), + FN_DECIMAL(0.3098039216), + FN_DECIMAL(0.9921568627), + FN_DECIMAL(-0.9137254902), + FN_DECIMAL(-0.2941176471), + FN_DECIMAL(-0.3411764706), + FN_DECIMAL(-0.6235294118), + FN_DECIMAL(-0.7647058824), + FN_DECIMAL(-0.8901960784), + FN_DECIMAL(0.05882352941), + FN_DECIMAL(0.2392156863), + FN_DECIMAL(0.7333333333), + FN_DECIMAL(0.6549019608), + FN_DECIMAL(0.2470588235), + FN_DECIMAL(0.231372549), + FN_DECIMAL(-0.3960784314), + FN_DECIMAL(-0.05098039216), + FN_DECIMAL(-0.2235294118), + FN_DECIMAL(-0.3725490196), + FN_DECIMAL(0.6235294118), + FN_DECIMAL(0.7019607843), + FN_DECIMAL(-0.8274509804), + FN_DECIMAL(0.4196078431), + FN_DECIMAL(0.07450980392), + FN_DECIMAL(0.8666666667), + FN_DECIMAL(-0.537254902), + FN_DECIMAL(-0.5058823529), + FN_DECIMAL(-0.8039215686), + FN_DECIMAL(0.09019607843), + FN_DECIMAL(-0.4823529412), + FN_DECIMAL(0.6705882353), + FN_DECIMAL(-0.7882352941), + FN_DECIMAL(0.09803921569), + FN_DECIMAL(-0.6078431373), + FN_DECIMAL(0.8039215686), + FN_DECIMAL(-0.6), + FN_DECIMAL(-0.3254901961), + FN_DECIMAL(-0.4117647059), + FN_DECIMAL(-0.01176470588), + FN_DECIMAL(0.4823529412), + FN_DECIMAL(0.168627451), + FN_DECIMAL(0.8745098039), + FN_DECIMAL(-0.3647058824), + FN_DECIMAL(-0.1607843137), + FN_DECIMAL(0.568627451), + FN_DECIMAL(-0.9921568627), + FN_DECIMAL(0.9450980392), + FN_DECIMAL(0.5137254902), + FN_DECIMAL(0.01176470588), + FN_DECIMAL(-0.1450980392), + FN_DECIMAL(-0.5529411765), + FN_DECIMAL(-0.5764705882), + FN_DECIMAL(-0.1137254902), + FN_DECIMAL(0.5215686275), + FN_DECIMAL(0.1607843137), + FN_DECIMAL(0.3725490196), + FN_DECIMAL(-0.2), + FN_DECIMAL(-0.7254901961), + FN_DECIMAL(0.631372549), + FN_DECIMAL(0.7098039216), + FN_DECIMAL(-0.568627451), + FN_DECIMAL(0.1294117647), + FN_DECIMAL(-0.3098039216), + FN_DECIMAL(0.7411764706), + FN_DECIMAL(-0.8509803922), + FN_DECIMAL(0.2549019608), + FN_DECIMAL(-0.6392156863), + FN_DECIMAL(-0.5607843137), + FN_DECIMAL(-0.3176470588), + FN_DECIMAL(0.937254902), + FN_DECIMAL(0.9843137255), + FN_DECIMAL(0.5921568627), + FN_DECIMAL(0.6941176471), + FN_DECIMAL(0.2862745098), + FN_DECIMAL(-0.5215686275), + FN_DECIMAL(0.1764705882), + FN_DECIMAL(0.537254902), + FN_DECIMAL(-0.4901960784), + FN_DECIMAL(-0.4588235294), + FN_DECIMAL(-0.2078431373), + FN_DECIMAL(-0.2156862745), + FN_DECIMAL(0.7725490196), + FN_DECIMAL(0.3647058824), + FN_DECIMAL(-0.2392156863), + FN_DECIMAL(0.2784313725), + FN_DECIMAL(-0.8823529412), + FN_DECIMAL(0.8980392157), + FN_DECIMAL(0.1215686275), + FN_DECIMAL(0.1058823529), + FN_DECIMAL(-0.8745098039), + FN_DECIMAL(-0.9843137255), + FN_DECIMAL(-0.7019607843), + FN_DECIMAL(0.9607843137), + FN_DECIMAL(0.2941176471), + FN_DECIMAL(0.3411764706), + FN_DECIMAL(0.1529411765), + FN_DECIMAL(0.06666666667), + FN_DECIMAL(-0.9764705882), + FN_DECIMAL(0.3019607843), + FN_DECIMAL(0.6470588235), + FN_DECIMAL(-0.5843137255), + FN_DECIMAL(0.05098039216), + FN_DECIMAL(-0.5137254902), + FN_DECIMAL(-0.137254902), + FN_DECIMAL(0.3882352941), + FN_DECIMAL(-0.262745098), + FN_DECIMAL(-0.3019607843), + FN_DECIMAL(-0.1764705882), + FN_DECIMAL(-0.7568627451), + FN_DECIMAL(0.1843137255), + FN_DECIMAL(-0.5450980392), + FN_DECIMAL(-0.4980392157), + FN_DECIMAL(-0.2784313725), + FN_DECIMAL(-0.9529411765), + FN_DECIMAL(-0.09803921569), + FN_DECIMAL(0.8901960784), + FN_DECIMAL(-0.2862745098), + FN_DECIMAL(-0.3803921569), + FN_DECIMAL(0.5529411765), + FN_DECIMAL(0.7803921569), + FN_DECIMAL(-0.8352941176), + FN_DECIMAL(0.6862745098), + FN_DECIMAL(0.7568627451), + FN_DECIMAL(0.4980392157), + FN_DECIMAL(-0.6862745098), + FN_DECIMAL(-0.8980392157), + FN_DECIMAL(-0.7725490196), + FN_DECIMAL(-0.7098039216), + FN_DECIMAL(-0.2470588235), + FN_DECIMAL(-0.9058823529), + FN_DECIMAL(0.9764705882), + FN_DECIMAL(0.1921568627), + FN_DECIMAL(0.8431372549), + FN_DECIMAL(-0.05882352941), + FN_DECIMAL(0.3568627451), + FN_DECIMAL(0.6078431373), + FN_DECIMAL(0.5450980392), + FN_DECIMAL(0.4039215686), + FN_DECIMAL(-0.7333333333), + FN_DECIMAL(-0.4274509804), + FN_DECIMAL(0.6), + FN_DECIMAL(0.6784313725), + FN_DECIMAL(-0.631372549), + FN_DECIMAL(-0.02745098039), + FN_DECIMAL(-0.1294117647), + FN_DECIMAL(0.3333333333), + FN_DECIMAL(-0.8431372549), + FN_DECIMAL(0.2235294118), + FN_DECIMAL(-0.3490196078), + FN_DECIMAL(-0.6941176471), + FN_DECIMAL(0.8823529412), + FN_DECIMAL(0.4745098039), + FN_DECIMAL(0.4666666667), + FN_DECIMAL(-0.7411764706), + FN_DECIMAL(-0.2705882353), + FN_DECIMAL(0.968627451), + FN_DECIMAL(0.8196078431), + FN_DECIMAL(-0.662745098), + FN_DECIMAL(-0.4352941176), + FN_DECIMAL(-0.8666666667), + FN_DECIMAL(-0.1529411765), }; -const FN_DECIMAL CELL_2D_X[] = -{ - FN_DECIMAL(-0.6440658039), FN_DECIMAL(-0.08028078721), FN_DECIMAL(0.9983546168), FN_DECIMAL(0.9869492062), FN_DECIMAL(0.9284746418), FN_DECIMAL(0.6051097552), FN_DECIMAL(-0.794167404), FN_DECIMAL(-0.3488667991), FN_DECIMAL(-0.943136526), FN_DECIMAL(-0.9968171318), FN_DECIMAL(0.8740961579), FN_DECIMAL(0.1421139764), FN_DECIMAL(0.4282553608), FN_DECIMAL(-0.9986665833), FN_DECIMAL(0.9996760121), FN_DECIMAL(-0.06248383632), - FN_DECIMAL(0.7120139305), FN_DECIMAL(0.8917660409), FN_DECIMAL(0.1094842955), FN_DECIMAL(-0.8730880804), FN_DECIMAL(0.2594811489), FN_DECIMAL(-0.6690063346), FN_DECIMAL(-0.9996834972), FN_DECIMAL(-0.8803608671), FN_DECIMAL(-0.8166554937), FN_DECIMAL(0.8955599676), FN_DECIMAL(-0.9398321388), FN_DECIMAL(0.07615451399), FN_DECIMAL(-0.7147270565), FN_DECIMAL(0.8707354457), FN_DECIMAL(-0.9580008579), FN_DECIMAL(0.4905965632), - FN_DECIMAL(0.786775944), FN_DECIMAL(0.1079711577), FN_DECIMAL(0.2686638979), FN_DECIMAL(0.6113487322), FN_DECIMAL(-0.530770584), FN_DECIMAL(-0.7837268286), FN_DECIMAL(-0.8558691039), FN_DECIMAL(-0.5726093896), FN_DECIMAL(-0.9830740914), FN_DECIMAL(0.7087766359), FN_DECIMAL(0.6807027153), FN_DECIMAL(-0.08864708788), FN_DECIMAL(0.6704485923), FN_DECIMAL(-0.1350735482), FN_DECIMAL(-0.9381333003), FN_DECIMAL(0.9756655376), - FN_DECIMAL(0.4231433671), FN_DECIMAL(-0.4959787385), FN_DECIMAL(0.1005554325), FN_DECIMAL(-0.7645857281), FN_DECIMAL(-0.5859053796), FN_DECIMAL(-0.9751154306), FN_DECIMAL(-0.6972258572), FN_DECIMAL(0.7907012002), FN_DECIMAL(-0.9109899213), FN_DECIMAL(-0.9584307894), FN_DECIMAL(-0.8269529333), FN_DECIMAL(0.2608264719), FN_DECIMAL(-0.7773760119), FN_DECIMAL(0.7606456974), FN_DECIMAL(-0.8961083758), FN_DECIMAL(-0.9838134719), - FN_DECIMAL(0.7338893576), FN_DECIMAL(0.2161226729), FN_DECIMAL(0.673509891), FN_DECIMAL(-0.5512056873), FN_DECIMAL(0.6899744332), FN_DECIMAL(0.868004831), FN_DECIMAL(0.5897430311), FN_DECIMAL(-0.8950444221), FN_DECIMAL(-0.3595752773), FN_DECIMAL(0.8209486981), FN_DECIMAL(-0.2912360132), FN_DECIMAL(-0.9965011374), FN_DECIMAL(0.9766994634), FN_DECIMAL(0.738790822), FN_DECIMAL(-0.4730947722), FN_DECIMAL(0.8946479441), - FN_DECIMAL(-0.6943628971), FN_DECIMAL(-0.6620468182), FN_DECIMAL(-0.0887255502), FN_DECIMAL(-0.7512250855), FN_DECIMAL(-0.5322986898), FN_DECIMAL(0.5226295385), FN_DECIMAL(0.2296318375), FN_DECIMAL(0.7915307344), FN_DECIMAL(-0.2756485999), FN_DECIMAL(-0.6900234522), FN_DECIMAL(0.07090588086), FN_DECIMAL(0.5981278485), FN_DECIMAL(0.3033429312), FN_DECIMAL(-0.7253142797), FN_DECIMAL(-0.9855874307), FN_DECIMAL(-0.1761843396), - FN_DECIMAL(-0.6438468325), FN_DECIMAL(-0.9956136595), FN_DECIMAL(0.8541580762), FN_DECIMAL(-0.9999807666), FN_DECIMAL(-0.02152416253), FN_DECIMAL(-0.8705983095), FN_DECIMAL(-0.1197138014), FN_DECIMAL(-0.992107781), FN_DECIMAL(-0.9091181546), FN_DECIMAL(0.788610536), FN_DECIMAL(-0.994636402), FN_DECIMAL(0.4211256853), FN_DECIMAL(0.3110430857), FN_DECIMAL(-0.4031127839), FN_DECIMAL(0.7610684239), FN_DECIMAL(0.7685674467), - FN_DECIMAL(0.152271555), FN_DECIMAL(-0.9364648723), FN_DECIMAL(0.1681333739), FN_DECIMAL(-0.3567427907), FN_DECIMAL(-0.418445483), FN_DECIMAL(-0.98774778), FN_DECIMAL(0.8705250765), FN_DECIMAL(-0.8911701067), FN_DECIMAL(-0.7315350966), FN_DECIMAL(0.6030885658), FN_DECIMAL(-0.4149130821), FN_DECIMAL(0.7585339481), FN_DECIMAL(0.6963196535), FN_DECIMAL(0.8332685012), FN_DECIMAL(-0.8086815232), FN_DECIMAL(0.7518116724), - FN_DECIMAL(-0.3490535894), FN_DECIMAL(0.6972110903), FN_DECIMAL(-0.8795676928), FN_DECIMAL(-0.6442331882), FN_DECIMAL(0.6610236811), FN_DECIMAL(-0.9853565782), FN_DECIMAL(-0.590338458), FN_DECIMAL(0.09843602117), FN_DECIMAL(0.5646534882), FN_DECIMAL(-0.6023259233), FN_DECIMAL(-0.3539248861), FN_DECIMAL(0.5132728656), FN_DECIMAL(0.9380385118), FN_DECIMAL(-0.7599270056), FN_DECIMAL(-0.7425936564), FN_DECIMAL(-0.6679610562), - FN_DECIMAL(-0.3018497816), FN_DECIMAL(0.814478266), FN_DECIMAL(0.03777430269), FN_DECIMAL(-0.7514235086), FN_DECIMAL(0.9662556939), FN_DECIMAL(-0.4720194901), FN_DECIMAL(-0.435054126), FN_DECIMAL(0.7091901235), FN_DECIMAL(0.929379209), FN_DECIMAL(0.9997434357), FN_DECIMAL(0.8306320299), FN_DECIMAL(-0.9434019629), FN_DECIMAL(-0.133133759), FN_DECIMAL(0.5048413216), FN_DECIMAL(0.3711995273), FN_DECIMAL(0.98552091), - FN_DECIMAL(0.7401857005), FN_DECIMAL(-0.9999981398), FN_DECIMAL(-0.2144033253), FN_DECIMAL(0.4808624681), FN_DECIMAL(-0.413835885), FN_DECIMAL(0.644229305), FN_DECIMAL(0.9626648696), FN_DECIMAL(0.1833665934), FN_DECIMAL(0.5794129), FN_DECIMAL(0.01404446873), FN_DECIMAL(0.4388494993), FN_DECIMAL(0.5213612322), FN_DECIMAL(-0.5281609948), FN_DECIMAL(-0.9745306846), FN_DECIMAL(-0.9904373013), FN_DECIMAL(0.9100232252), - FN_DECIMAL(-0.9914057719), FN_DECIMAL(0.7892627765), FN_DECIMAL(0.3364421659), FN_DECIMAL(-0.9416099764), FN_DECIMAL(0.7802732656), FN_DECIMAL(0.886302871), FN_DECIMAL(0.6524471291), FN_DECIMAL(0.5762186726), FN_DECIMAL(-0.08987644664), FN_DECIMAL(-0.2177026782), FN_DECIMAL(-0.9720345052), FN_DECIMAL(-0.05722538858), FN_DECIMAL(0.8105983127), FN_DECIMAL(0.3410261032), FN_DECIMAL(0.6452309645), FN_DECIMAL(-0.7810612152), - FN_DECIMAL(0.9989395718), FN_DECIMAL(-0.808247815), FN_DECIMAL(0.6370177929), FN_DECIMAL(0.5844658772), FN_DECIMAL(0.2054070861), FN_DECIMAL(0.055960522), FN_DECIMAL(-0.995827561), FN_DECIMAL(0.893409165), FN_DECIMAL(-0.931516824), FN_DECIMAL(0.328969469), FN_DECIMAL(-0.3193837488), FN_DECIMAL(0.7314755657), FN_DECIMAL(-0.7913517714), FN_DECIMAL(-0.2204109786), FN_DECIMAL(0.9955900414), FN_DECIMAL(-0.7112353139), - FN_DECIMAL(-0.7935008741), FN_DECIMAL(-0.9961918204), FN_DECIMAL(-0.9714163995), FN_DECIMAL(-0.9566188669), FN_DECIMAL(0.2748495632), FN_DECIMAL(-0.4681743221), FN_DECIMAL(-0.9614449642), FN_DECIMAL(0.585194072), FN_DECIMAL(0.4532946061), FN_DECIMAL(-0.9916113176), FN_DECIMAL(0.942479587), FN_DECIMAL(-0.9813704753), FN_DECIMAL(-0.6538429571), FN_DECIMAL(0.2923335053), FN_DECIMAL(-0.2246660704), FN_DECIMAL(-0.1800781949), - FN_DECIMAL(-0.9581216256), FN_DECIMAL(0.552215082), FN_DECIMAL(-0.9296791922), FN_DECIMAL(0.643183699), FN_DECIMAL(0.9997325981), FN_DECIMAL(-0.4606920354), FN_DECIMAL(-0.2148721265), FN_DECIMAL(0.3482070809), FN_DECIMAL(0.3075517813), FN_DECIMAL(0.6274756393), FN_DECIMAL(0.8910881765), FN_DECIMAL(-0.6397771309), FN_DECIMAL(-0.4479080125), FN_DECIMAL(-0.5247665011), FN_DECIMAL(-0.8386507094), FN_DECIMAL(0.3901291416), - FN_DECIMAL(0.1458336921), FN_DECIMAL(0.01624613149), FN_DECIMAL(-0.8273199879), FN_DECIMAL(0.5611100679), FN_DECIMAL(-0.8380219841), FN_DECIMAL(-0.9856122234), FN_DECIMAL(-0.861398618), FN_DECIMAL(0.6398413916), FN_DECIMAL(0.2694510795), FN_DECIMAL(0.4327334514), FN_DECIMAL(-0.9960265354), FN_DECIMAL(-0.939570655), FN_DECIMAL(-0.8846996446), FN_DECIMAL(0.7642113189), FN_DECIMAL(-0.7002080528), FN_DECIMAL(0.664508256), +const FN_DECIMAL CELL_2D_X[] = { + FN_DECIMAL(-0.6440658039), + FN_DECIMAL(-0.08028078721), + FN_DECIMAL(0.9983546168), + FN_DECIMAL(0.9869492062), + FN_DECIMAL(0.9284746418), + FN_DECIMAL(0.6051097552), + FN_DECIMAL(-0.794167404), + FN_DECIMAL(-0.3488667991), + FN_DECIMAL(-0.943136526), + FN_DECIMAL(-0.9968171318), + FN_DECIMAL(0.8740961579), + FN_DECIMAL(0.1421139764), + FN_DECIMAL(0.4282553608), + FN_DECIMAL(-0.9986665833), + FN_DECIMAL(0.9996760121), + FN_DECIMAL(-0.06248383632), + FN_DECIMAL(0.7120139305), + FN_DECIMAL(0.8917660409), + FN_DECIMAL(0.1094842955), + FN_DECIMAL(-0.8730880804), + FN_DECIMAL(0.2594811489), + FN_DECIMAL(-0.6690063346), + FN_DECIMAL(-0.9996834972), + FN_DECIMAL(-0.8803608671), + FN_DECIMAL(-0.8166554937), + FN_DECIMAL(0.8955599676), + FN_DECIMAL(-0.9398321388), + FN_DECIMAL(0.07615451399), + FN_DECIMAL(-0.7147270565), + FN_DECIMAL(0.8707354457), + FN_DECIMAL(-0.9580008579), + FN_DECIMAL(0.4905965632), + FN_DECIMAL(0.786775944), + FN_DECIMAL(0.1079711577), + FN_DECIMAL(0.2686638979), + FN_DECIMAL(0.6113487322), + FN_DECIMAL(-0.530770584), + FN_DECIMAL(-0.7837268286), + FN_DECIMAL(-0.8558691039), + FN_DECIMAL(-0.5726093896), + FN_DECIMAL(-0.9830740914), + FN_DECIMAL(0.7087766359), + FN_DECIMAL(0.6807027153), + FN_DECIMAL(-0.08864708788), + FN_DECIMAL(0.6704485923), + FN_DECIMAL(-0.1350735482), + FN_DECIMAL(-0.9381333003), + FN_DECIMAL(0.9756655376), + FN_DECIMAL(0.4231433671), + FN_DECIMAL(-0.4959787385), + FN_DECIMAL(0.1005554325), + FN_DECIMAL(-0.7645857281), + FN_DECIMAL(-0.5859053796), + FN_DECIMAL(-0.9751154306), + FN_DECIMAL(-0.6972258572), + FN_DECIMAL(0.7907012002), + FN_DECIMAL(-0.9109899213), + FN_DECIMAL(-0.9584307894), + FN_DECIMAL(-0.8269529333), + FN_DECIMAL(0.2608264719), + FN_DECIMAL(-0.7773760119), + FN_DECIMAL(0.7606456974), + FN_DECIMAL(-0.8961083758), + FN_DECIMAL(-0.9838134719), + FN_DECIMAL(0.7338893576), + FN_DECIMAL(0.2161226729), + FN_DECIMAL(0.673509891), + FN_DECIMAL(-0.5512056873), + FN_DECIMAL(0.6899744332), + FN_DECIMAL(0.868004831), + FN_DECIMAL(0.5897430311), + FN_DECIMAL(-0.8950444221), + FN_DECIMAL(-0.3595752773), + FN_DECIMAL(0.8209486981), + FN_DECIMAL(-0.2912360132), + FN_DECIMAL(-0.9965011374), + FN_DECIMAL(0.9766994634), + FN_DECIMAL(0.738790822), + FN_DECIMAL(-0.4730947722), + FN_DECIMAL(0.8946479441), + FN_DECIMAL(-0.6943628971), + FN_DECIMAL(-0.6620468182), + FN_DECIMAL(-0.0887255502), + FN_DECIMAL(-0.7512250855), + FN_DECIMAL(-0.5322986898), + FN_DECIMAL(0.5226295385), + FN_DECIMAL(0.2296318375), + FN_DECIMAL(0.7915307344), + FN_DECIMAL(-0.2756485999), + FN_DECIMAL(-0.6900234522), + FN_DECIMAL(0.07090588086), + FN_DECIMAL(0.5981278485), + FN_DECIMAL(0.3033429312), + FN_DECIMAL(-0.7253142797), + FN_DECIMAL(-0.9855874307), + FN_DECIMAL(-0.1761843396), + FN_DECIMAL(-0.6438468325), + FN_DECIMAL(-0.9956136595), + FN_DECIMAL(0.8541580762), + FN_DECIMAL(-0.9999807666), + FN_DECIMAL(-0.02152416253), + FN_DECIMAL(-0.8705983095), + FN_DECIMAL(-0.1197138014), + FN_DECIMAL(-0.992107781), + FN_DECIMAL(-0.9091181546), + FN_DECIMAL(0.788610536), + FN_DECIMAL(-0.994636402), + FN_DECIMAL(0.4211256853), + FN_DECIMAL(0.3110430857), + FN_DECIMAL(-0.4031127839), + FN_DECIMAL(0.7610684239), + FN_DECIMAL(0.7685674467), + FN_DECIMAL(0.152271555), + FN_DECIMAL(-0.9364648723), + FN_DECIMAL(0.1681333739), + FN_DECIMAL(-0.3567427907), + FN_DECIMAL(-0.418445483), + FN_DECIMAL(-0.98774778), + FN_DECIMAL(0.8705250765), + FN_DECIMAL(-0.8911701067), + FN_DECIMAL(-0.7315350966), + FN_DECIMAL(0.6030885658), + FN_DECIMAL(-0.4149130821), + FN_DECIMAL(0.7585339481), + FN_DECIMAL(0.6963196535), + FN_DECIMAL(0.8332685012), + FN_DECIMAL(-0.8086815232), + FN_DECIMAL(0.7518116724), + FN_DECIMAL(-0.3490535894), + FN_DECIMAL(0.6972110903), + FN_DECIMAL(-0.8795676928), + FN_DECIMAL(-0.6442331882), + FN_DECIMAL(0.6610236811), + FN_DECIMAL(-0.9853565782), + FN_DECIMAL(-0.590338458), + FN_DECIMAL(0.09843602117), + FN_DECIMAL(0.5646534882), + FN_DECIMAL(-0.6023259233), + FN_DECIMAL(-0.3539248861), + FN_DECIMAL(0.5132728656), + FN_DECIMAL(0.9380385118), + FN_DECIMAL(-0.7599270056), + FN_DECIMAL(-0.7425936564), + FN_DECIMAL(-0.6679610562), + FN_DECIMAL(-0.3018497816), + FN_DECIMAL(0.814478266), + FN_DECIMAL(0.03777430269), + FN_DECIMAL(-0.7514235086), + FN_DECIMAL(0.9662556939), + FN_DECIMAL(-0.4720194901), + FN_DECIMAL(-0.435054126), + FN_DECIMAL(0.7091901235), + FN_DECIMAL(0.929379209), + FN_DECIMAL(0.9997434357), + FN_DECIMAL(0.8306320299), + FN_DECIMAL(-0.9434019629), + FN_DECIMAL(-0.133133759), + FN_DECIMAL(0.5048413216), + FN_DECIMAL(0.3711995273), + FN_DECIMAL(0.98552091), + FN_DECIMAL(0.7401857005), + FN_DECIMAL(-0.9999981398), + FN_DECIMAL(-0.2144033253), + FN_DECIMAL(0.4808624681), + FN_DECIMAL(-0.413835885), + FN_DECIMAL(0.644229305), + FN_DECIMAL(0.9626648696), + FN_DECIMAL(0.1833665934), + FN_DECIMAL(0.5794129), + FN_DECIMAL(0.01404446873), + FN_DECIMAL(0.4388494993), + FN_DECIMAL(0.5213612322), + FN_DECIMAL(-0.5281609948), + FN_DECIMAL(-0.9745306846), + FN_DECIMAL(-0.9904373013), + FN_DECIMAL(0.9100232252), + FN_DECIMAL(-0.9914057719), + FN_DECIMAL(0.7892627765), + FN_DECIMAL(0.3364421659), + FN_DECIMAL(-0.9416099764), + FN_DECIMAL(0.7802732656), + FN_DECIMAL(0.886302871), + FN_DECIMAL(0.6524471291), + FN_DECIMAL(0.5762186726), + FN_DECIMAL(-0.08987644664), + FN_DECIMAL(-0.2177026782), + FN_DECIMAL(-0.9720345052), + FN_DECIMAL(-0.05722538858), + FN_DECIMAL(0.8105983127), + FN_DECIMAL(0.3410261032), + FN_DECIMAL(0.6452309645), + FN_DECIMAL(-0.7810612152), + FN_DECIMAL(0.9989395718), + FN_DECIMAL(-0.808247815), + FN_DECIMAL(0.6370177929), + FN_DECIMAL(0.5844658772), + FN_DECIMAL(0.2054070861), + FN_DECIMAL(0.055960522), + FN_DECIMAL(-0.995827561), + FN_DECIMAL(0.893409165), + FN_DECIMAL(-0.931516824), + FN_DECIMAL(0.328969469), + FN_DECIMAL(-0.3193837488), + FN_DECIMAL(0.7314755657), + FN_DECIMAL(-0.7913517714), + FN_DECIMAL(-0.2204109786), + FN_DECIMAL(0.9955900414), + FN_DECIMAL(-0.7112353139), + FN_DECIMAL(-0.7935008741), + FN_DECIMAL(-0.9961918204), + FN_DECIMAL(-0.9714163995), + FN_DECIMAL(-0.9566188669), + FN_DECIMAL(0.2748495632), + FN_DECIMAL(-0.4681743221), + FN_DECIMAL(-0.9614449642), + FN_DECIMAL(0.585194072), + FN_DECIMAL(0.4532946061), + FN_DECIMAL(-0.9916113176), + FN_DECIMAL(0.942479587), + FN_DECIMAL(-0.9813704753), + FN_DECIMAL(-0.6538429571), + FN_DECIMAL(0.2923335053), + FN_DECIMAL(-0.2246660704), + FN_DECIMAL(-0.1800781949), + FN_DECIMAL(-0.9581216256), + FN_DECIMAL(0.552215082), + FN_DECIMAL(-0.9296791922), + FN_DECIMAL(0.643183699), + FN_DECIMAL(0.9997325981), + FN_DECIMAL(-0.4606920354), + FN_DECIMAL(-0.2148721265), + FN_DECIMAL(0.3482070809), + FN_DECIMAL(0.3075517813), + FN_DECIMAL(0.6274756393), + FN_DECIMAL(0.8910881765), + FN_DECIMAL(-0.6397771309), + FN_DECIMAL(-0.4479080125), + FN_DECIMAL(-0.5247665011), + FN_DECIMAL(-0.8386507094), + FN_DECIMAL(0.3901291416), + FN_DECIMAL(0.1458336921), + FN_DECIMAL(0.01624613149), + FN_DECIMAL(-0.8273199879), + FN_DECIMAL(0.5611100679), + FN_DECIMAL(-0.8380219841), + FN_DECIMAL(-0.9856122234), + FN_DECIMAL(-0.861398618), + FN_DECIMAL(0.6398413916), + FN_DECIMAL(0.2694510795), + FN_DECIMAL(0.4327334514), + FN_DECIMAL(-0.9960265354), + FN_DECIMAL(-0.939570655), + FN_DECIMAL(-0.8846996446), + FN_DECIMAL(0.7642113189), + FN_DECIMAL(-0.7002080528), + FN_DECIMAL(0.664508256), }; -const FN_DECIMAL CELL_2D_Y[] = -{ - FN_DECIMAL(0.7649700911), FN_DECIMAL(0.9967722885), FN_DECIMAL(0.05734160033), FN_DECIMAL(-0.1610318741), FN_DECIMAL(0.371395799), FN_DECIMAL(-0.7961420628), FN_DECIMAL(0.6076990492), FN_DECIMAL(-0.9371723195), FN_DECIMAL(0.3324056156), FN_DECIMAL(0.07972205329), FN_DECIMAL(-0.4857529277), FN_DECIMAL(-0.9898503007), FN_DECIMAL(0.9036577593), FN_DECIMAL(0.05162417479), FN_DECIMAL(-0.02545330525), FN_DECIMAL(-0.998045976), - FN_DECIMAL(-0.7021653386), FN_DECIMAL(-0.4524967717), FN_DECIMAL(-0.9939885256), FN_DECIMAL(-0.4875625128), FN_DECIMAL(-0.9657481729), FN_DECIMAL(-0.7432567015), FN_DECIMAL(0.02515761212), FN_DECIMAL(0.4743044842), FN_DECIMAL(0.5771254669), FN_DECIMAL(0.4449408324), FN_DECIMAL(0.3416365773), FN_DECIMAL(0.9970960285), FN_DECIMAL(0.6994034849), FN_DECIMAL(0.4917517499), FN_DECIMAL(0.286765333), FN_DECIMAL(0.8713868327), - FN_DECIMAL(0.6172387009), FN_DECIMAL(0.9941540269), FN_DECIMAL(0.9632339851), FN_DECIMAL(-0.7913613129), FN_DECIMAL(0.847515538), FN_DECIMAL(0.6211056739), FN_DECIMAL(0.5171924952), FN_DECIMAL(-0.8198283277), FN_DECIMAL(-0.1832084353), FN_DECIMAL(0.7054329737), FN_DECIMAL(0.7325597678), FN_DECIMAL(0.9960630973), FN_DECIMAL(0.7419559859), FN_DECIMAL(0.9908355749), FN_DECIMAL(-0.346274329), FN_DECIMAL(0.2192641299), - FN_DECIMAL(-0.9060627411), FN_DECIMAL(-0.8683346653), FN_DECIMAL(0.9949314574), FN_DECIMAL(-0.6445220433), FN_DECIMAL(-0.8103794704), FN_DECIMAL(-0.2216977607), FN_DECIMAL(0.7168515217), FN_DECIMAL(0.612202264), FN_DECIMAL(-0.412428616), FN_DECIMAL(0.285325116), FN_DECIMAL(0.56227115), FN_DECIMAL(-0.9653857009), FN_DECIMAL(-0.6290361962), FN_DECIMAL(0.6491672535), FN_DECIMAL(0.443835306), FN_DECIMAL(-0.1791955706), - FN_DECIMAL(-0.6792690269), FN_DECIMAL(-0.9763662173), FN_DECIMAL(0.7391782104), FN_DECIMAL(0.8343693968), FN_DECIMAL(0.7238337389), FN_DECIMAL(0.4965557504), FN_DECIMAL(0.8075909592), FN_DECIMAL(-0.4459769977), FN_DECIMAL(-0.9331160806), FN_DECIMAL(-0.5710019572), FN_DECIMAL(0.9566512346), FN_DECIMAL(-0.08357920318), FN_DECIMAL(0.2146116448), FN_DECIMAL(-0.6739348049), FN_DECIMAL(0.8810115417), FN_DECIMAL(0.4467718167), - FN_DECIMAL(-0.7196250184), FN_DECIMAL(-0.749462481), FN_DECIMAL(0.9960561112), FN_DECIMAL(0.6600461127), FN_DECIMAL(-0.8465566164), FN_DECIMAL(-0.8525598897), FN_DECIMAL(-0.9732775654), FN_DECIMAL(0.6111293616), FN_DECIMAL(-0.9612584717), FN_DECIMAL(-0.7237870097), FN_DECIMAL(-0.9974830104), FN_DECIMAL(-0.8014006968), FN_DECIMAL(0.9528814544), FN_DECIMAL(-0.6884178931), FN_DECIMAL(-0.1691668301), FN_DECIMAL(0.9843571905), - FN_DECIMAL(0.7651544003), FN_DECIMAL(-0.09355982605), FN_DECIMAL(-0.5200134429), FN_DECIMAL(-0.006202125807), FN_DECIMAL(-0.9997683284), FN_DECIMAL(0.4919944954), FN_DECIMAL(-0.9928084436), FN_DECIMAL(-0.1253880012), FN_DECIMAL(-0.4165383308), FN_DECIMAL(-0.6148930171), FN_DECIMAL(-0.1034332049), FN_DECIMAL(-0.9070022917), FN_DECIMAL(-0.9503958117), FN_DECIMAL(0.9151503065), FN_DECIMAL(-0.6486716073), FN_DECIMAL(0.6397687707), - FN_DECIMAL(-0.9883386937), FN_DECIMAL(0.3507613761), FN_DECIMAL(0.9857642561), FN_DECIMAL(-0.9342026446), FN_DECIMAL(-0.9082419159), FN_DECIMAL(0.1560587169), FN_DECIMAL(0.4921240607), FN_DECIMAL(-0.453669308), FN_DECIMAL(0.6818037859), FN_DECIMAL(0.7976742329), FN_DECIMAL(0.9098610522), FN_DECIMAL(0.651633524), FN_DECIMAL(0.7177318024), FN_DECIMAL(-0.5528685241), FN_DECIMAL(0.5882467118), FN_DECIMAL(0.6593778956), - FN_DECIMAL(0.9371027648), FN_DECIMAL(-0.7168658839), FN_DECIMAL(-0.4757737632), FN_DECIMAL(0.7648291307), FN_DECIMAL(0.7503650398), FN_DECIMAL(0.1705063456), FN_DECIMAL(-0.8071558121), FN_DECIMAL(-0.9951433815), FN_DECIMAL(-0.8253280792), FN_DECIMAL(-0.7982502628), FN_DECIMAL(0.9352738503), FN_DECIMAL(0.8582254747), FN_DECIMAL(-0.3465310238), FN_DECIMAL(0.65000842), FN_DECIMAL(-0.6697422351), FN_DECIMAL(0.7441962291), - FN_DECIMAL(-0.9533555), FN_DECIMAL(0.5801940659), FN_DECIMAL(-0.9992862963), FN_DECIMAL(-0.659820211), FN_DECIMAL(0.2575848092), FN_DECIMAL(0.881588113), FN_DECIMAL(-0.9004043022), FN_DECIMAL(-0.7050172826), FN_DECIMAL(0.369126382), FN_DECIMAL(-0.02265088836), FN_DECIMAL(0.5568217228), FN_DECIMAL(-0.3316515286), FN_DECIMAL(0.991098079), FN_DECIMAL(-0.863212164), FN_DECIMAL(-0.9285531277), FN_DECIMAL(0.1695539323), - FN_DECIMAL(-0.672402505), FN_DECIMAL(-0.001928841934), FN_DECIMAL(0.9767452145), FN_DECIMAL(-0.8767960349), FN_DECIMAL(0.9103515037), FN_DECIMAL(-0.7648324016), FN_DECIMAL(0.2706960452), FN_DECIMAL(-0.9830446035), FN_DECIMAL(0.8150341657), FN_DECIMAL(-0.9999013716), FN_DECIMAL(-0.8985605806), FN_DECIMAL(0.8533360801), FN_DECIMAL(0.8491442537), FN_DECIMAL(-0.2242541966), FN_DECIMAL(-0.1379635899), FN_DECIMAL(-0.4145572694), - FN_DECIMAL(0.1308227633), FN_DECIMAL(0.6140555916), FN_DECIMAL(0.9417041303), FN_DECIMAL(-0.336705587), FN_DECIMAL(-0.6254387508), FN_DECIMAL(0.4631060578), FN_DECIMAL(-0.7578342456), FN_DECIMAL(-0.8172955655), FN_DECIMAL(-0.9959529228), FN_DECIMAL(-0.9760151351), FN_DECIMAL(0.2348380732), FN_DECIMAL(-0.9983612848), FN_DECIMAL(0.5856025746), FN_DECIMAL(-0.9400538266), FN_DECIMAL(-0.7639875669), FN_DECIMAL(0.6244544645), - FN_DECIMAL(0.04604054566), FN_DECIMAL(0.5888424828), FN_DECIMAL(0.7708490978), FN_DECIMAL(-0.8114182882), FN_DECIMAL(0.9786766212), FN_DECIMAL(-0.9984329822), FN_DECIMAL(0.09125496582), FN_DECIMAL(-0.4492438803), FN_DECIMAL(-0.3636982357), FN_DECIMAL(0.9443405575), FN_DECIMAL(-0.9476254645), FN_DECIMAL(-0.6818676535), FN_DECIMAL(-0.6113610831), FN_DECIMAL(0.9754070948), FN_DECIMAL(-0.0938108173), FN_DECIMAL(-0.7029540015), - FN_DECIMAL(-0.6085691109), FN_DECIMAL(-0.08718862881), FN_DECIMAL(-0.237381926), FN_DECIMAL(0.2913423132), FN_DECIMAL(0.9614872426), FN_DECIMAL(0.8836361266), FN_DECIMAL(-0.2749974196), FN_DECIMAL(-0.8108932717), FN_DECIMAL(-0.8913607575), FN_DECIMAL(0.129255541), FN_DECIMAL(-0.3342637104), FN_DECIMAL(-0.1921249337), FN_DECIMAL(-0.7566302845), FN_DECIMAL(-0.9563164339), FN_DECIMAL(-0.9744358146), FN_DECIMAL(0.9836522982), - FN_DECIMAL(-0.2863615732), FN_DECIMAL(0.8337016872), FN_DECIMAL(0.3683701937), FN_DECIMAL(0.7657119102), FN_DECIMAL(-0.02312427772), FN_DECIMAL(0.8875600535), FN_DECIMAL(0.976642191), FN_DECIMAL(0.9374176384), FN_DECIMAL(0.9515313457), FN_DECIMAL(-0.7786361937), FN_DECIMAL(-0.4538302125), FN_DECIMAL(-0.7685604874), FN_DECIMAL(-0.8940796454), FN_DECIMAL(-0.8512462154), FN_DECIMAL(0.5446696133), FN_DECIMAL(0.9207601495), - FN_DECIMAL(-0.9893091197), FN_DECIMAL(-0.9998680229), FN_DECIMAL(0.5617309299), FN_DECIMAL(-0.8277411985), FN_DECIMAL(0.545636467), FN_DECIMAL(0.1690223212), FN_DECIMAL(-0.5079295433), FN_DECIMAL(0.7685069899), FN_DECIMAL(-0.9630140787), FN_DECIMAL(0.9015219132), FN_DECIMAL(0.08905695279), FN_DECIMAL(-0.3423550559), FN_DECIMAL(-0.4661614943), FN_DECIMAL(-0.6449659371), FN_DECIMAL(0.7139388509), FN_DECIMAL(0.7472809229), +const FN_DECIMAL CELL_2D_Y[] = { + FN_DECIMAL(0.7649700911), + FN_DECIMAL(0.9967722885), + FN_DECIMAL(0.05734160033), + FN_DECIMAL(-0.1610318741), + FN_DECIMAL(0.371395799), + FN_DECIMAL(-0.7961420628), + FN_DECIMAL(0.6076990492), + FN_DECIMAL(-0.9371723195), + FN_DECIMAL(0.3324056156), + FN_DECIMAL(0.07972205329), + FN_DECIMAL(-0.4857529277), + FN_DECIMAL(-0.9898503007), + FN_DECIMAL(0.9036577593), + FN_DECIMAL(0.05162417479), + FN_DECIMAL(-0.02545330525), + FN_DECIMAL(-0.998045976), + FN_DECIMAL(-0.7021653386), + FN_DECIMAL(-0.4524967717), + FN_DECIMAL(-0.9939885256), + FN_DECIMAL(-0.4875625128), + FN_DECIMAL(-0.9657481729), + FN_DECIMAL(-0.7432567015), + FN_DECIMAL(0.02515761212), + FN_DECIMAL(0.4743044842), + FN_DECIMAL(0.5771254669), + FN_DECIMAL(0.4449408324), + FN_DECIMAL(0.3416365773), + FN_DECIMAL(0.9970960285), + FN_DECIMAL(0.6994034849), + FN_DECIMAL(0.4917517499), + FN_DECIMAL(0.286765333), + FN_DECIMAL(0.8713868327), + FN_DECIMAL(0.6172387009), + FN_DECIMAL(0.9941540269), + FN_DECIMAL(0.9632339851), + FN_DECIMAL(-0.7913613129), + FN_DECIMAL(0.847515538), + FN_DECIMAL(0.6211056739), + FN_DECIMAL(0.5171924952), + FN_DECIMAL(-0.8198283277), + FN_DECIMAL(-0.1832084353), + FN_DECIMAL(0.7054329737), + FN_DECIMAL(0.7325597678), + FN_DECIMAL(0.9960630973), + FN_DECIMAL(0.7419559859), + FN_DECIMAL(0.9908355749), + FN_DECIMAL(-0.346274329), + FN_DECIMAL(0.2192641299), + FN_DECIMAL(-0.9060627411), + FN_DECIMAL(-0.8683346653), + FN_DECIMAL(0.9949314574), + FN_DECIMAL(-0.6445220433), + FN_DECIMAL(-0.8103794704), + FN_DECIMAL(-0.2216977607), + FN_DECIMAL(0.7168515217), + FN_DECIMAL(0.612202264), + FN_DECIMAL(-0.412428616), + FN_DECIMAL(0.285325116), + FN_DECIMAL(0.56227115), + FN_DECIMAL(-0.9653857009), + FN_DECIMAL(-0.6290361962), + FN_DECIMAL(0.6491672535), + FN_DECIMAL(0.443835306), + FN_DECIMAL(-0.1791955706), + FN_DECIMAL(-0.6792690269), + FN_DECIMAL(-0.9763662173), + FN_DECIMAL(0.7391782104), + FN_DECIMAL(0.8343693968), + FN_DECIMAL(0.7238337389), + FN_DECIMAL(0.4965557504), + FN_DECIMAL(0.8075909592), + FN_DECIMAL(-0.4459769977), + FN_DECIMAL(-0.9331160806), + FN_DECIMAL(-0.5710019572), + FN_DECIMAL(0.9566512346), + FN_DECIMAL(-0.08357920318), + FN_DECIMAL(0.2146116448), + FN_DECIMAL(-0.6739348049), + FN_DECIMAL(0.8810115417), + FN_DECIMAL(0.4467718167), + FN_DECIMAL(-0.7196250184), + FN_DECIMAL(-0.749462481), + FN_DECIMAL(0.9960561112), + FN_DECIMAL(0.6600461127), + FN_DECIMAL(-0.8465566164), + FN_DECIMAL(-0.8525598897), + FN_DECIMAL(-0.9732775654), + FN_DECIMAL(0.6111293616), + FN_DECIMAL(-0.9612584717), + FN_DECIMAL(-0.7237870097), + FN_DECIMAL(-0.9974830104), + FN_DECIMAL(-0.8014006968), + FN_DECIMAL(0.9528814544), + FN_DECIMAL(-0.6884178931), + FN_DECIMAL(-0.1691668301), + FN_DECIMAL(0.9843571905), + FN_DECIMAL(0.7651544003), + FN_DECIMAL(-0.09355982605), + FN_DECIMAL(-0.5200134429), + FN_DECIMAL(-0.006202125807), + FN_DECIMAL(-0.9997683284), + FN_DECIMAL(0.4919944954), + FN_DECIMAL(-0.9928084436), + FN_DECIMAL(-0.1253880012), + FN_DECIMAL(-0.4165383308), + FN_DECIMAL(-0.6148930171), + FN_DECIMAL(-0.1034332049), + FN_DECIMAL(-0.9070022917), + FN_DECIMAL(-0.9503958117), + FN_DECIMAL(0.9151503065), + FN_DECIMAL(-0.6486716073), + FN_DECIMAL(0.6397687707), + FN_DECIMAL(-0.9883386937), + FN_DECIMAL(0.3507613761), + FN_DECIMAL(0.9857642561), + FN_DECIMAL(-0.9342026446), + FN_DECIMAL(-0.9082419159), + FN_DECIMAL(0.1560587169), + FN_DECIMAL(0.4921240607), + FN_DECIMAL(-0.453669308), + FN_DECIMAL(0.6818037859), + FN_DECIMAL(0.7976742329), + FN_DECIMAL(0.9098610522), + FN_DECIMAL(0.651633524), + FN_DECIMAL(0.7177318024), + FN_DECIMAL(-0.5528685241), + FN_DECIMAL(0.5882467118), + FN_DECIMAL(0.6593778956), + FN_DECIMAL(0.9371027648), + FN_DECIMAL(-0.7168658839), + FN_DECIMAL(-0.4757737632), + FN_DECIMAL(0.7648291307), + FN_DECIMAL(0.7503650398), + FN_DECIMAL(0.1705063456), + FN_DECIMAL(-0.8071558121), + FN_DECIMAL(-0.9951433815), + FN_DECIMAL(-0.8253280792), + FN_DECIMAL(-0.7982502628), + FN_DECIMAL(0.9352738503), + FN_DECIMAL(0.8582254747), + FN_DECIMAL(-0.3465310238), + FN_DECIMAL(0.65000842), + FN_DECIMAL(-0.6697422351), + FN_DECIMAL(0.7441962291), + FN_DECIMAL(-0.9533555), + FN_DECIMAL(0.5801940659), + FN_DECIMAL(-0.9992862963), + FN_DECIMAL(-0.659820211), + FN_DECIMAL(0.2575848092), + FN_DECIMAL(0.881588113), + FN_DECIMAL(-0.9004043022), + FN_DECIMAL(-0.7050172826), + FN_DECIMAL(0.369126382), + FN_DECIMAL(-0.02265088836), + FN_DECIMAL(0.5568217228), + FN_DECIMAL(-0.3316515286), + FN_DECIMAL(0.991098079), + FN_DECIMAL(-0.863212164), + FN_DECIMAL(-0.9285531277), + FN_DECIMAL(0.1695539323), + FN_DECIMAL(-0.672402505), + FN_DECIMAL(-0.001928841934), + FN_DECIMAL(0.9767452145), + FN_DECIMAL(-0.8767960349), + FN_DECIMAL(0.9103515037), + FN_DECIMAL(-0.7648324016), + FN_DECIMAL(0.2706960452), + FN_DECIMAL(-0.9830446035), + FN_DECIMAL(0.8150341657), + FN_DECIMAL(-0.9999013716), + FN_DECIMAL(-0.8985605806), + FN_DECIMAL(0.8533360801), + FN_DECIMAL(0.8491442537), + FN_DECIMAL(-0.2242541966), + FN_DECIMAL(-0.1379635899), + FN_DECIMAL(-0.4145572694), + FN_DECIMAL(0.1308227633), + FN_DECIMAL(0.6140555916), + FN_DECIMAL(0.9417041303), + FN_DECIMAL(-0.336705587), + FN_DECIMAL(-0.6254387508), + FN_DECIMAL(0.4631060578), + FN_DECIMAL(-0.7578342456), + FN_DECIMAL(-0.8172955655), + FN_DECIMAL(-0.9959529228), + FN_DECIMAL(-0.9760151351), + FN_DECIMAL(0.2348380732), + FN_DECIMAL(-0.9983612848), + FN_DECIMAL(0.5856025746), + FN_DECIMAL(-0.9400538266), + FN_DECIMAL(-0.7639875669), + FN_DECIMAL(0.6244544645), + FN_DECIMAL(0.04604054566), + FN_DECIMAL(0.5888424828), + FN_DECIMAL(0.7708490978), + FN_DECIMAL(-0.8114182882), + FN_DECIMAL(0.9786766212), + FN_DECIMAL(-0.9984329822), + FN_DECIMAL(0.09125496582), + FN_DECIMAL(-0.4492438803), + FN_DECIMAL(-0.3636982357), + FN_DECIMAL(0.9443405575), + FN_DECIMAL(-0.9476254645), + FN_DECIMAL(-0.6818676535), + FN_DECIMAL(-0.6113610831), + FN_DECIMAL(0.9754070948), + FN_DECIMAL(-0.0938108173), + FN_DECIMAL(-0.7029540015), + FN_DECIMAL(-0.6085691109), + FN_DECIMAL(-0.08718862881), + FN_DECIMAL(-0.237381926), + FN_DECIMAL(0.2913423132), + FN_DECIMAL(0.9614872426), + FN_DECIMAL(0.8836361266), + FN_DECIMAL(-0.2749974196), + FN_DECIMAL(-0.8108932717), + FN_DECIMAL(-0.8913607575), + FN_DECIMAL(0.129255541), + FN_DECIMAL(-0.3342637104), + FN_DECIMAL(-0.1921249337), + FN_DECIMAL(-0.7566302845), + FN_DECIMAL(-0.9563164339), + FN_DECIMAL(-0.9744358146), + FN_DECIMAL(0.9836522982), + FN_DECIMAL(-0.2863615732), + FN_DECIMAL(0.8337016872), + FN_DECIMAL(0.3683701937), + FN_DECIMAL(0.7657119102), + FN_DECIMAL(-0.02312427772), + FN_DECIMAL(0.8875600535), + FN_DECIMAL(0.976642191), + FN_DECIMAL(0.9374176384), + FN_DECIMAL(0.9515313457), + FN_DECIMAL(-0.7786361937), + FN_DECIMAL(-0.4538302125), + FN_DECIMAL(-0.7685604874), + FN_DECIMAL(-0.8940796454), + FN_DECIMAL(-0.8512462154), + FN_DECIMAL(0.5446696133), + FN_DECIMAL(0.9207601495), + FN_DECIMAL(-0.9893091197), + FN_DECIMAL(-0.9998680229), + FN_DECIMAL(0.5617309299), + FN_DECIMAL(-0.8277411985), + FN_DECIMAL(0.545636467), + FN_DECIMAL(0.1690223212), + FN_DECIMAL(-0.5079295433), + FN_DECIMAL(0.7685069899), + FN_DECIMAL(-0.9630140787), + FN_DECIMAL(0.9015219132), + FN_DECIMAL(0.08905695279), + FN_DECIMAL(-0.3423550559), + FN_DECIMAL(-0.4661614943), + FN_DECIMAL(-0.6449659371), + FN_DECIMAL(0.7139388509), + FN_DECIMAL(0.7472809229), }; -const FN_DECIMAL CELL_3D_X[] = -{ - FN_DECIMAL(0.3752498686), FN_DECIMAL(0.687188096), FN_DECIMAL(0.2248135212), FN_DECIMAL(0.6692006647), FN_DECIMAL(-0.4376476931), FN_DECIMAL(0.6139972552), FN_DECIMAL(0.9494563929), FN_DECIMAL(0.8065108882), FN_DECIMAL(-0.2218812853), FN_DECIMAL(0.8484661167), FN_DECIMAL(0.5551817596), FN_DECIMAL(0.2133903499), FN_DECIMAL(0.5195126593), FN_DECIMAL(-0.6440141975), FN_DECIMAL(-0.5192897331), FN_DECIMAL(-0.3697654077), - FN_DECIMAL(-0.07927779647), FN_DECIMAL(0.4187757321), FN_DECIMAL(-0.750078731), FN_DECIMAL(0.6579554632), FN_DECIMAL(-0.6859803838), FN_DECIMAL(-0.6878407087), FN_DECIMAL(0.9490848347), FN_DECIMAL(0.5795829433), FN_DECIMAL(-0.5325976529), FN_DECIMAL(-0.1363699466), FN_DECIMAL(0.417665879), FN_DECIMAL(-0.9108236468), FN_DECIMAL(0.4438605427), FN_DECIMAL(0.819294887), FN_DECIMAL(-0.4033873915), FN_DECIMAL(-0.2817317705), - FN_DECIMAL(0.3969665622), FN_DECIMAL(0.5323450134), FN_DECIMAL(-0.6833017297), FN_DECIMAL(0.3881436661), FN_DECIMAL(-0.7119144767), FN_DECIMAL(-0.2306979838), FN_DECIMAL(-0.9398873022), FN_DECIMAL(0.1701906676), FN_DECIMAL(-0.4261839496), FN_DECIMAL(-0.003712295499), FN_DECIMAL(-0.734675004), FN_DECIMAL(-0.3195046015), FN_DECIMAL(0.7345307424), FN_DECIMAL(0.9766246496), FN_DECIMAL(-0.02003735175), FN_DECIMAL(-0.4824156342), - FN_DECIMAL(0.4245892007), FN_DECIMAL(0.9072427669), FN_DECIMAL(0.593346808), FN_DECIMAL(-0.8911762541), FN_DECIMAL(-0.7657571834), FN_DECIMAL(-0.5268198896), FN_DECIMAL(-0.8801903279), FN_DECIMAL(-0.6296409617), FN_DECIMAL(-0.09492481344), FN_DECIMAL(-0.4920470525), FN_DECIMAL(0.7307666154), FN_DECIMAL(-0.2514540636), FN_DECIMAL(-0.3356210347), FN_DECIMAL(-0.3522787894), FN_DECIMAL(0.87847885), FN_DECIMAL(-0.7424096346), - FN_DECIMAL(0.5757585274), FN_DECIMAL(0.4519299338), FN_DECIMAL(0.6420368628), FN_DECIMAL(-0.1128478447), FN_DECIMAL(0.499874883), FN_DECIMAL(0.5291681739), FN_DECIMAL(-0.5098837195), FN_DECIMAL(0.5639583502), FN_DECIMAL(-0.8456386526), FN_DECIMAL(-0.9657134875), FN_DECIMAL(-0.576437342), FN_DECIMAL(-0.5666013014), FN_DECIMAL(0.5667702405), FN_DECIMAL(-0.481316582), FN_DECIMAL(0.7313389916), FN_DECIMAL(-0.3805628566), - FN_DECIMAL(-0.6512675909), FN_DECIMAL(-0.2787156951), FN_DECIMAL(0.8648059114), FN_DECIMAL(-0.9730216276), FN_DECIMAL(-0.8335820906), FN_DECIMAL(0.2673159641), FN_DECIMAL(0.231150148), FN_DECIMAL(0.01286214638), FN_DECIMAL(0.6774953261), FN_DECIMAL(0.6542885718), FN_DECIMAL(-0.02545450161), FN_DECIMAL(0.2101238586), FN_DECIMAL(-0.5572105885), FN_DECIMAL(0.813705672), FN_DECIMAL(-0.7546026951), FN_DECIMAL(-0.2502500006), - FN_DECIMAL(-0.9979289381), FN_DECIMAL(0.7024037039), FN_DECIMAL(0.08990874624), FN_DECIMAL(0.8170812432), FN_DECIMAL(0.4226980265), FN_DECIMAL(-0.2442153475), FN_DECIMAL(-0.9183326731), FN_DECIMAL(0.6068222411), FN_DECIMAL(0.818676691), FN_DECIMAL(-0.7236735282), FN_DECIMAL(-0.5383903295), FN_DECIMAL(-0.6269337242), FN_DECIMAL(-0.0939331121), FN_DECIMAL(0.9203878539), FN_DECIMAL(-0.7256396824), FN_DECIMAL(0.6292431149), - FN_DECIMAL(0.4234156978), FN_DECIMAL(0.006685688024), FN_DECIMAL(-0.2598694113), FN_DECIMAL(0.6408036421), FN_DECIMAL(0.05899871622), FN_DECIMAL(0.7090281418), FN_DECIMAL(-0.5905222072), FN_DECIMAL(0.3128214264), FN_DECIMAL(-0.691925826), FN_DECIMAL(0.3634019349), FN_DECIMAL(-0.6772511147), FN_DECIMAL(-0.3204583896), FN_DECIMAL(-0.3906740409), FN_DECIMAL(-0.3342190395), FN_DECIMAL(-0.517779592), FN_DECIMAL(-0.6817711267), - FN_DECIMAL(0.6422383105), FN_DECIMAL(0.4388482478), FN_DECIMAL(0.2968562611), FN_DECIMAL(-0.2019778353), FN_DECIMAL(0.6014865048), FN_DECIMAL(0.9519280722), FN_DECIMAL(0.3398889569), FN_DECIMAL(0.8179709354), FN_DECIMAL(0.2365522154), FN_DECIMAL(0.3262175096), FN_DECIMAL(-0.8060715954), FN_DECIMAL(-0.2068642503), FN_DECIMAL(0.6208057279), FN_DECIMAL(-0.5274282502), FN_DECIMAL(-0.3722334928), FN_DECIMAL(-0.8923412971), - FN_DECIMAL(0.5341834201), FN_DECIMAL(-0.3663701513), FN_DECIMAL(-0.6114600319), FN_DECIMAL(0.5026307556), FN_DECIMAL(0.8396151729), FN_DECIMAL(0.9245042467), FN_DECIMAL(-0.7994843957), FN_DECIMAL(-0.5357200589), FN_DECIMAL(-0.6283359739), FN_DECIMAL(-0.61351886), FN_DECIMAL(-0.875632008), FN_DECIMAL(-0.5278879423), FN_DECIMAL(0.9087491985), FN_DECIMAL(-0.03500215466), FN_DECIMAL(-0.261365798), FN_DECIMAL(-0.579523541), - FN_DECIMAL(-0.3765052689), FN_DECIMAL(-0.74398252), FN_DECIMAL(0.4257318052), FN_DECIMAL(-0.1214508921), FN_DECIMAL(0.8561809753), FN_DECIMAL(0.6802835104), FN_DECIMAL(-0.5452131039), FN_DECIMAL(-0.1997156478), FN_DECIMAL(0.4562348357), FN_DECIMAL(-0.811704301), FN_DECIMAL(0.67793962), FN_DECIMAL(-0.9237819106), FN_DECIMAL(0.6973511259), FN_DECIMAL(-0.5189506), FN_DECIMAL(0.5517320032), FN_DECIMAL(-0.396710831), - FN_DECIMAL(0.5493762815), FN_DECIMAL(-0.2507853002), FN_DECIMAL(0.4788634005), FN_DECIMAL(0.387333516), FN_DECIMAL(-0.2176515694), FN_DECIMAL(0.6749832419), FN_DECIMAL(0.2148283022), FN_DECIMAL(-0.7521815872), FN_DECIMAL(0.4697000159), FN_DECIMAL(0.7890593699), FN_DECIMAL(-0.7606162952), FN_DECIMAL(0.01083397843), FN_DECIMAL(0.5254091908), FN_DECIMAL(-0.6748025877), FN_DECIMAL(0.751091524), FN_DECIMAL(0.05259056135), - FN_DECIMAL(0.01889481232), FN_DECIMAL(-0.6037423727), FN_DECIMAL(-0.6542965129), FN_DECIMAL(0.08873301081), FN_DECIMAL(-0.6191345671), FN_DECIMAL(0.4331858488), FN_DECIMAL(-0.3858351946), FN_DECIMAL(-0.1429059747), FN_DECIMAL(0.4118221036), FN_DECIMAL(-0.6247153214), FN_DECIMAL(-0.611423014), FN_DECIMAL(0.5542939606), FN_DECIMAL(-0.9432768808), FN_DECIMAL(-0.4567870451), FN_DECIMAL(-0.7349133547), FN_DECIMAL(0.399304489), - FN_DECIMAL(-0.7474927672), FN_DECIMAL(0.02589419753), FN_DECIMAL(0.783915821), FN_DECIMAL(0.6138668752), FN_DECIMAL(0.4276376047), FN_DECIMAL(-0.4347886353), FN_DECIMAL(0.02947841302), FN_DECIMAL(-0.833742746), FN_DECIMAL(0.3817221742), FN_DECIMAL(-0.8743368359), FN_DECIMAL(-0.3823443796), FN_DECIMAL(-0.6829243811), FN_DECIMAL(-0.3681903049), FN_DECIMAL(-0.367626833), FN_DECIMAL(-0.434583373), FN_DECIMAL(0.235891995), - FN_DECIMAL(-0.6874880269), FN_DECIMAL(-0.5115661773), FN_DECIMAL(-0.5534962601), FN_DECIMAL(0.5632777056), FN_DECIMAL(0.686191532), FN_DECIMAL(-0.05095871588), FN_DECIMAL(-0.06865785057), FN_DECIMAL(-0.5975288531), FN_DECIMAL(-0.6429790056), FN_DECIMAL(-0.3729361548), FN_DECIMAL(0.2237917666), FN_DECIMAL(0.6046773225), FN_DECIMAL(-0.5041542295), FN_DECIMAL(-0.03972191174), FN_DECIMAL(0.7028828406), FN_DECIMAL(-0.5560856498), - FN_DECIMAL(0.5898328456), FN_DECIMAL(-0.9308076766), FN_DECIMAL(0.4617069864), FN_DECIMAL(0.3190983137), FN_DECIMAL(0.9116567753), FN_DECIMAL(-0.45029554), FN_DECIMAL(0.3346334459), FN_DECIMAL(0.8525005645), FN_DECIMAL(0.2528483381), FN_DECIMAL(-0.8306630147), FN_DECIMAL(-0.6880390622), FN_DECIMAL(0.7448684026), FN_DECIMAL(-0.1963355843), FN_DECIMAL(-0.5900257974), FN_DECIMAL(0.9097057294), FN_DECIMAL(-0.2509196808), +const FN_DECIMAL CELL_3D_X[] = { + FN_DECIMAL(0.3752498686), + FN_DECIMAL(0.687188096), + FN_DECIMAL(0.2248135212), + FN_DECIMAL(0.6692006647), + FN_DECIMAL(-0.4376476931), + FN_DECIMAL(0.6139972552), + FN_DECIMAL(0.9494563929), + FN_DECIMAL(0.8065108882), + FN_DECIMAL(-0.2218812853), + FN_DECIMAL(0.8484661167), + FN_DECIMAL(0.5551817596), + FN_DECIMAL(0.2133903499), + FN_DECIMAL(0.5195126593), + FN_DECIMAL(-0.6440141975), + FN_DECIMAL(-0.5192897331), + FN_DECIMAL(-0.3697654077), + FN_DECIMAL(-0.07927779647), + FN_DECIMAL(0.4187757321), + FN_DECIMAL(-0.750078731), + FN_DECIMAL(0.6579554632), + FN_DECIMAL(-0.6859803838), + FN_DECIMAL(-0.6878407087), + FN_DECIMAL(0.9490848347), + FN_DECIMAL(0.5795829433), + FN_DECIMAL(-0.5325976529), + FN_DECIMAL(-0.1363699466), + FN_DECIMAL(0.417665879), + FN_DECIMAL(-0.9108236468), + FN_DECIMAL(0.4438605427), + FN_DECIMAL(0.819294887), + FN_DECIMAL(-0.4033873915), + FN_DECIMAL(-0.2817317705), + FN_DECIMAL(0.3969665622), + FN_DECIMAL(0.5323450134), + FN_DECIMAL(-0.6833017297), + FN_DECIMAL(0.3881436661), + FN_DECIMAL(-0.7119144767), + FN_DECIMAL(-0.2306979838), + FN_DECIMAL(-0.9398873022), + FN_DECIMAL(0.1701906676), + FN_DECIMAL(-0.4261839496), + FN_DECIMAL(-0.003712295499), + FN_DECIMAL(-0.734675004), + FN_DECIMAL(-0.3195046015), + FN_DECIMAL(0.7345307424), + FN_DECIMAL(0.9766246496), + FN_DECIMAL(-0.02003735175), + FN_DECIMAL(-0.4824156342), + FN_DECIMAL(0.4245892007), + FN_DECIMAL(0.9072427669), + FN_DECIMAL(0.593346808), + FN_DECIMAL(-0.8911762541), + FN_DECIMAL(-0.7657571834), + FN_DECIMAL(-0.5268198896), + FN_DECIMAL(-0.8801903279), + FN_DECIMAL(-0.6296409617), + FN_DECIMAL(-0.09492481344), + FN_DECIMAL(-0.4920470525), + FN_DECIMAL(0.7307666154), + FN_DECIMAL(-0.2514540636), + FN_DECIMAL(-0.3356210347), + FN_DECIMAL(-0.3522787894), + FN_DECIMAL(0.87847885), + FN_DECIMAL(-0.7424096346), + FN_DECIMAL(0.5757585274), + FN_DECIMAL(0.4519299338), + FN_DECIMAL(0.6420368628), + FN_DECIMAL(-0.1128478447), + FN_DECIMAL(0.499874883), + FN_DECIMAL(0.5291681739), + FN_DECIMAL(-0.5098837195), + FN_DECIMAL(0.5639583502), + FN_DECIMAL(-0.8456386526), + FN_DECIMAL(-0.9657134875), + FN_DECIMAL(-0.576437342), + FN_DECIMAL(-0.5666013014), + FN_DECIMAL(0.5667702405), + FN_DECIMAL(-0.481316582), + FN_DECIMAL(0.7313389916), + FN_DECIMAL(-0.3805628566), + FN_DECIMAL(-0.6512675909), + FN_DECIMAL(-0.2787156951), + FN_DECIMAL(0.8648059114), + FN_DECIMAL(-0.9730216276), + FN_DECIMAL(-0.8335820906), + FN_DECIMAL(0.2673159641), + FN_DECIMAL(0.231150148), + FN_DECIMAL(0.01286214638), + FN_DECIMAL(0.6774953261), + FN_DECIMAL(0.6542885718), + FN_DECIMAL(-0.02545450161), + FN_DECIMAL(0.2101238586), + FN_DECIMAL(-0.5572105885), + FN_DECIMAL(0.813705672), + FN_DECIMAL(-0.7546026951), + FN_DECIMAL(-0.2502500006), + FN_DECIMAL(-0.9979289381), + FN_DECIMAL(0.7024037039), + FN_DECIMAL(0.08990874624), + FN_DECIMAL(0.8170812432), + FN_DECIMAL(0.4226980265), + FN_DECIMAL(-0.2442153475), + FN_DECIMAL(-0.9183326731), + FN_DECIMAL(0.6068222411), + FN_DECIMAL(0.818676691), + FN_DECIMAL(-0.7236735282), + FN_DECIMAL(-0.5383903295), + FN_DECIMAL(-0.6269337242), + FN_DECIMAL(-0.0939331121), + FN_DECIMAL(0.9203878539), + FN_DECIMAL(-0.7256396824), + FN_DECIMAL(0.6292431149), + FN_DECIMAL(0.4234156978), + FN_DECIMAL(0.006685688024), + FN_DECIMAL(-0.2598694113), + FN_DECIMAL(0.6408036421), + FN_DECIMAL(0.05899871622), + FN_DECIMAL(0.7090281418), + FN_DECIMAL(-0.5905222072), + FN_DECIMAL(0.3128214264), + FN_DECIMAL(-0.691925826), + FN_DECIMAL(0.3634019349), + FN_DECIMAL(-0.6772511147), + FN_DECIMAL(-0.3204583896), + FN_DECIMAL(-0.3906740409), + FN_DECIMAL(-0.3342190395), + FN_DECIMAL(-0.517779592), + FN_DECIMAL(-0.6817711267), + FN_DECIMAL(0.6422383105), + FN_DECIMAL(0.4388482478), + FN_DECIMAL(0.2968562611), + FN_DECIMAL(-0.2019778353), + FN_DECIMAL(0.6014865048), + FN_DECIMAL(0.9519280722), + FN_DECIMAL(0.3398889569), + FN_DECIMAL(0.8179709354), + FN_DECIMAL(0.2365522154), + FN_DECIMAL(0.3262175096), + FN_DECIMAL(-0.8060715954), + FN_DECIMAL(-0.2068642503), + FN_DECIMAL(0.6208057279), + FN_DECIMAL(-0.5274282502), + FN_DECIMAL(-0.3722334928), + FN_DECIMAL(-0.8923412971), + FN_DECIMAL(0.5341834201), + FN_DECIMAL(-0.3663701513), + FN_DECIMAL(-0.6114600319), + FN_DECIMAL(0.5026307556), + FN_DECIMAL(0.8396151729), + FN_DECIMAL(0.9245042467), + FN_DECIMAL(-0.7994843957), + FN_DECIMAL(-0.5357200589), + FN_DECIMAL(-0.6283359739), + FN_DECIMAL(-0.61351886), + FN_DECIMAL(-0.875632008), + FN_DECIMAL(-0.5278879423), + FN_DECIMAL(0.9087491985), + FN_DECIMAL(-0.03500215466), + FN_DECIMAL(-0.261365798), + FN_DECIMAL(-0.579523541), + FN_DECIMAL(-0.3765052689), + FN_DECIMAL(-0.74398252), + FN_DECIMAL(0.4257318052), + FN_DECIMAL(-0.1214508921), + FN_DECIMAL(0.8561809753), + FN_DECIMAL(0.6802835104), + FN_DECIMAL(-0.5452131039), + FN_DECIMAL(-0.1997156478), + FN_DECIMAL(0.4562348357), + FN_DECIMAL(-0.811704301), + FN_DECIMAL(0.67793962), + FN_DECIMAL(-0.9237819106), + FN_DECIMAL(0.6973511259), + FN_DECIMAL(-0.5189506), + FN_DECIMAL(0.5517320032), + FN_DECIMAL(-0.396710831), + FN_DECIMAL(0.5493762815), + FN_DECIMAL(-0.2507853002), + FN_DECIMAL(0.4788634005), + FN_DECIMAL(0.387333516), + FN_DECIMAL(-0.2176515694), + FN_DECIMAL(0.6749832419), + FN_DECIMAL(0.2148283022), + FN_DECIMAL(-0.7521815872), + FN_DECIMAL(0.4697000159), + FN_DECIMAL(0.7890593699), + FN_DECIMAL(-0.7606162952), + FN_DECIMAL(0.01083397843), + FN_DECIMAL(0.5254091908), + FN_DECIMAL(-0.6748025877), + FN_DECIMAL(0.751091524), + FN_DECIMAL(0.05259056135), + FN_DECIMAL(0.01889481232), + FN_DECIMAL(-0.6037423727), + FN_DECIMAL(-0.6542965129), + FN_DECIMAL(0.08873301081), + FN_DECIMAL(-0.6191345671), + FN_DECIMAL(0.4331858488), + FN_DECIMAL(-0.3858351946), + FN_DECIMAL(-0.1429059747), + FN_DECIMAL(0.4118221036), + FN_DECIMAL(-0.6247153214), + FN_DECIMAL(-0.611423014), + FN_DECIMAL(0.5542939606), + FN_DECIMAL(-0.9432768808), + FN_DECIMAL(-0.4567870451), + FN_DECIMAL(-0.7349133547), + FN_DECIMAL(0.399304489), + FN_DECIMAL(-0.7474927672), + FN_DECIMAL(0.02589419753), + FN_DECIMAL(0.783915821), + FN_DECIMAL(0.6138668752), + FN_DECIMAL(0.4276376047), + FN_DECIMAL(-0.4347886353), + FN_DECIMAL(0.02947841302), + FN_DECIMAL(-0.833742746), + FN_DECIMAL(0.3817221742), + FN_DECIMAL(-0.8743368359), + FN_DECIMAL(-0.3823443796), + FN_DECIMAL(-0.6829243811), + FN_DECIMAL(-0.3681903049), + FN_DECIMAL(-0.367626833), + FN_DECIMAL(-0.434583373), + FN_DECIMAL(0.235891995), + FN_DECIMAL(-0.6874880269), + FN_DECIMAL(-0.5115661773), + FN_DECIMAL(-0.5534962601), + FN_DECIMAL(0.5632777056), + FN_DECIMAL(0.686191532), + FN_DECIMAL(-0.05095871588), + FN_DECIMAL(-0.06865785057), + FN_DECIMAL(-0.5975288531), + FN_DECIMAL(-0.6429790056), + FN_DECIMAL(-0.3729361548), + FN_DECIMAL(0.2237917666), + FN_DECIMAL(0.6046773225), + FN_DECIMAL(-0.5041542295), + FN_DECIMAL(-0.03972191174), + FN_DECIMAL(0.7028828406), + FN_DECIMAL(-0.5560856498), + FN_DECIMAL(0.5898328456), + FN_DECIMAL(-0.9308076766), + FN_DECIMAL(0.4617069864), + FN_DECIMAL(0.3190983137), + FN_DECIMAL(0.9116567753), + FN_DECIMAL(-0.45029554), + FN_DECIMAL(0.3346334459), + FN_DECIMAL(0.8525005645), + FN_DECIMAL(0.2528483381), + FN_DECIMAL(-0.8306630147), + FN_DECIMAL(-0.6880390622), + FN_DECIMAL(0.7448684026), + FN_DECIMAL(-0.1963355843), + FN_DECIMAL(-0.5900257974), + FN_DECIMAL(0.9097057294), + FN_DECIMAL(-0.2509196808), }; -const FN_DECIMAL CELL_3D_Y[] = -{ - FN_DECIMAL(-0.6760585049), FN_DECIMAL(-0.09136176499), FN_DECIMAL(0.1681325679), FN_DECIMAL(-0.6688468686), FN_DECIMAL(-0.4822753902), FN_DECIMAL(-0.7891068824), FN_DECIMAL(-0.1877509944), FN_DECIMAL(0.548470914), FN_DECIMAL(-0.463339443), FN_DECIMAL(-0.4050542082), FN_DECIMAL(0.3218158513), FN_DECIMAL(0.2546493823), FN_DECIMAL(-0.3753271935), FN_DECIMAL(0.4745384887), FN_DECIMAL(0.481254652), FN_DECIMAL(-0.8934416489), - FN_DECIMAL(-0.6737085076), FN_DECIMAL(0.7469917228), FN_DECIMAL(0.3826230411), FN_DECIMAL(0.6751013678), FN_DECIMAL(-0.7248119515), FN_DECIMAL(-0.3224276742), FN_DECIMAL(-0.02076190936), FN_DECIMAL(-0.6404268166), FN_DECIMAL(-0.5292028444), FN_DECIMAL(0.7151414636), FN_DECIMAL(-0.6144655059), FN_DECIMAL(-0.369912124), FN_DECIMAL(0.6942067212), FN_DECIMAL(-0.4481558248), FN_DECIMAL(-0.6366894559), FN_DECIMAL(0.5956568471), - FN_DECIMAL(0.564274539), FN_DECIMAL(0.7145584688), FN_DECIMAL(0.6871918316), FN_DECIMAL(0.5657918509), FN_DECIMAL(-0.6275978114), FN_DECIMAL(0.4146983062), FN_DECIMAL(0.2638993789), FN_DECIMAL(-0.792633138), FN_DECIMAL(0.5706133514), FN_DECIMAL(0.8606546462), FN_DECIMAL(0.6490900316), FN_DECIMAL(-0.8242699196), FN_DECIMAL(0.6765819124), FN_DECIMAL(0.1959534069), FN_DECIMAL(-0.8426769757), FN_DECIMAL(-0.5917672797), - FN_DECIMAL(0.7517364266), FN_DECIMAL(0.03252559226), FN_DECIMAL(0.0883617105), FN_DECIMAL(0.4475064813), FN_DECIMAL(-0.1418643552), FN_DECIMAL(0.7343428473), FN_DECIMAL(0.3870192548), FN_DECIMAL(-0.7716703522), FN_DECIMAL(0.4839898327), FN_DECIMAL(0.7437439055), FN_DECIMAL(-0.5989573348), FN_DECIMAL(-0.8357068955), FN_DECIMAL(0.6086049038), FN_DECIMAL(0.9194627258), FN_DECIMAL(0.4718297238), FN_DECIMAL(-0.2650335884), - FN_DECIMAL(-0.6470352599), FN_DECIMAL(-0.5555181303), FN_DECIMAL(0.1222351235), FN_DECIMAL(0.7802044684), FN_DECIMAL(-0.8636947022), FN_DECIMAL(-0.2341352163), FN_DECIMAL(0.683030874), FN_DECIMAL(-0.5005858287), FN_DECIMAL(0.2334616211), FN_DECIMAL(0.2576877608), FN_DECIMAL(0.6666816727), FN_DECIMAL(-0.7663996863), FN_DECIMAL(0.794201982), FN_DECIMAL(0.6189308788), FN_DECIMAL(0.6071033261), FN_DECIMAL(-0.4206058253), - FN_DECIMAL(-0.3957336915), FN_DECIMAL(-0.8170257484), FN_DECIMAL(-0.1043240417), FN_DECIMAL(0.0002167596213), FN_DECIMAL(0.1816339018), FN_DECIMAL(-0.6838094939), FN_DECIMAL(-0.2495341969), FN_DECIMAL(-0.7116756954), FN_DECIMAL(-0.03361673621), FN_DECIMAL(-0.3350836431), FN_DECIMAL(0.2137186039), FN_DECIMAL(0.2557996786), FN_DECIMAL(0.7490117093), FN_DECIMAL(0.4942936549), FN_DECIMAL(-0.352686853), FN_DECIMAL(-0.3952445435), - FN_DECIMAL(-0.0459964767), FN_DECIMAL(-0.7115787471), FN_DECIMAL(0.08022899756), FN_DECIMAL(0.5362268157), FN_DECIMAL(-0.8258613686), FN_DECIMAL(0.1114171723), FN_DECIMAL(0.3882823051), FN_DECIMAL(-0.7915404457), FN_DECIMAL(0.3250957662), FN_DECIMAL(0.6401346464), FN_DECIMAL(-0.2662724517), FN_DECIMAL(-0.6727907114), FN_DECIMAL(-0.994730818), FN_DECIMAL(-0.3596358977), FN_DECIMAL(0.2344610069), FN_DECIMAL(-0.6645215546), - FN_DECIMAL(-0.7107590611), FN_DECIMAL(-0.4646617327), FN_DECIMAL(0.6717191355), FN_DECIMAL(0.5101893498), FN_DECIMAL(0.1185768238), FN_DECIMAL(0.236005093), FN_DECIMAL(-0.7811024061), FN_DECIMAL(0.5089325193), FN_DECIMAL(0.6073187658), FN_DECIMAL(-0.7930732557), FN_DECIMAL(-0.6822767155), FN_DECIMAL(0.3201532885), FN_DECIMAL(0.7545302807), FN_DECIMAL(0.1072664448), FN_DECIMAL(0.6784033173), FN_DECIMAL(-0.6595924967), - FN_DECIMAL(0.7276509498), FN_DECIMAL(0.5586689436), FN_DECIMAL(-0.6498636788), FN_DECIMAL(0.6789333174), FN_DECIMAL(0.7105966551), FN_DECIMAL(-0.2872214155), FN_DECIMAL(0.496746217), FN_DECIMAL(-0.3880337977), FN_DECIMAL(0.7324070604), FN_DECIMAL(-0.9326634749), FN_DECIMAL(-0.5867839255), FN_DECIMAL(0.8003043651), FN_DECIMAL(-0.1631882481), FN_DECIMAL(-0.6796374681), FN_DECIMAL(-0.8066678503), FN_DECIMAL(0.4238177418), - FN_DECIMAL(0.7715863549), FN_DECIMAL(0.5455367347), FN_DECIMAL(-0.03205115397), FN_DECIMAL(-0.6005545066), FN_DECIMAL(-0.5423640002), FN_DECIMAL(0.3569205906), FN_DECIMAL(-0.582071752), FN_DECIMAL(0.6407354361), FN_DECIMAL(0.7777142984), FN_DECIMAL(-0.09956428618), FN_DECIMAL(0.1100002681), FN_DECIMAL(0.8136349123), FN_DECIMAL(0.2923431904), FN_DECIMAL(0.9735794425), FN_DECIMAL(0.8324974864), FN_DECIMAL(-0.6179617717), - FN_DECIMAL(-0.9248386523), FN_DECIMAL(-0.6448780771), FN_DECIMAL(-0.5274402761), FN_DECIMAL(-0.7862170565), FN_DECIMAL(0.2682099744), FN_DECIMAL(-0.5848777694), FN_DECIMAL(-0.6364561467), FN_DECIMAL(-0.7167402514), FN_DECIMAL(-0.8677012494), FN_DECIMAL(0.4205286707), FN_DECIMAL(-0.7007832749), FN_DECIMAL(0.243272451), FN_DECIMAL(-0.1899846085), FN_DECIMAL(-0.6146124977), FN_DECIMAL(-0.8093357692), FN_DECIMAL(-0.03545096987), - FN_DECIMAL(-0.7191590868), FN_DECIMAL(0.7478645848), FN_DECIMAL(0.3623517328), FN_DECIMAL(0.8436992512), FN_DECIMAL(-0.2445711729), FN_DECIMAL(0.6897356637), FN_DECIMAL(-0.1708070787), FN_DECIMAL(0.4639272368), FN_DECIMAL(-0.7917186656), FN_DECIMAL(0.02980025428), FN_DECIMAL(0.6334156172), FN_DECIMAL(-0.9815544807), FN_DECIMAL(-0.2307217304), FN_DECIMAL(0.1080823318), FN_DECIMAL(0.5167601798), FN_DECIMAL(-0.845120016), - FN_DECIMAL(0.441572562), FN_DECIMAL(0.5876789172), FN_DECIMAL(-0.6365908737), FN_DECIMAL(0.68350166), FN_DECIMAL(0.5849723959), FN_DECIMAL(0.1164114357), FN_DECIMAL(-0.7379813884), FN_DECIMAL(-0.9613237178), FN_DECIMAL(-0.9071943084), FN_DECIMAL(-0.7682111105), FN_DECIMAL(0.639074459), FN_DECIMAL(-0.619358298), FN_DECIMAL(0.2807257131), FN_DECIMAL(-0.01800868791), FN_DECIMAL(0.3776607289), FN_DECIMAL(0.7207567823), - FN_DECIMAL(0.5536661486), FN_DECIMAL(-0.9974053117), FN_DECIMAL(-0.02047200006), FN_DECIMAL(-0.6739453804), FN_DECIMAL(-0.5607471297), FN_DECIMAL(0.8815553192), FN_DECIMAL(0.8275977415), FN_DECIMAL(0.3928902456), FN_DECIMAL(0.550991396), FN_DECIMAL(0.4247623676), FN_DECIMAL(-0.3436948871), FN_DECIMAL(-0.3653537677), FN_DECIMAL(0.3181702902), FN_DECIMAL(-0.6067173171), FN_DECIMAL(-0.8984128477), FN_DECIMAL(0.4220839766), - FN_DECIMAL(0.7238407199), FN_DECIMAL(-0.7766913695), FN_DECIMAL(0.6460037842), FN_DECIMAL(0.2544775664), FN_DECIMAL(0.6488840578), FN_DECIMAL(0.805016833), FN_DECIMAL(-0.9183807036), FN_DECIMAL(0.4144046357), FN_DECIMAL(0.270587208), FN_DECIMAL(-0.8813684494), FN_DECIMAL(0.6985971877), FN_DECIMAL(-0.7795603017), FN_DECIMAL(-0.8624480731), FN_DECIMAL(0.5532697017), FN_DECIMAL(0.711179521), FN_DECIMAL(-0.7798160574), - FN_DECIMAL(0.5225859041), FN_DECIMAL(0.1261859368), FN_DECIMAL(0.3398033582), FN_DECIMAL(-0.7472173667), FN_DECIMAL(-0.4032647119), FN_DECIMAL(-0.4246578154), FN_DECIMAL(0.8481212377), FN_DECIMAL(-0.2144838537), FN_DECIMAL(0.3431714491), FN_DECIMAL(0.5310188231), FN_DECIMAL(0.6682978632), FN_DECIMAL(0.3110433206), FN_DECIMAL(0.9263293599), FN_DECIMAL(-0.6155600569), FN_DECIMAL(0.07169784399), FN_DECIMAL(0.8985888773), +const FN_DECIMAL CELL_3D_Y[] = { + FN_DECIMAL(-0.6760585049), + FN_DECIMAL(-0.09136176499), + FN_DECIMAL(0.1681325679), + FN_DECIMAL(-0.6688468686), + FN_DECIMAL(-0.4822753902), + FN_DECIMAL(-0.7891068824), + FN_DECIMAL(-0.1877509944), + FN_DECIMAL(0.548470914), + FN_DECIMAL(-0.463339443), + FN_DECIMAL(-0.4050542082), + FN_DECIMAL(0.3218158513), + FN_DECIMAL(0.2546493823), + FN_DECIMAL(-0.3753271935), + FN_DECIMAL(0.4745384887), + FN_DECIMAL(0.481254652), + FN_DECIMAL(-0.8934416489), + FN_DECIMAL(-0.6737085076), + FN_DECIMAL(0.7469917228), + FN_DECIMAL(0.3826230411), + FN_DECIMAL(0.6751013678), + FN_DECIMAL(-0.7248119515), + FN_DECIMAL(-0.3224276742), + FN_DECIMAL(-0.02076190936), + FN_DECIMAL(-0.6404268166), + FN_DECIMAL(-0.5292028444), + FN_DECIMAL(0.7151414636), + FN_DECIMAL(-0.6144655059), + FN_DECIMAL(-0.369912124), + FN_DECIMAL(0.6942067212), + FN_DECIMAL(-0.4481558248), + FN_DECIMAL(-0.6366894559), + FN_DECIMAL(0.5956568471), + FN_DECIMAL(0.564274539), + FN_DECIMAL(0.7145584688), + FN_DECIMAL(0.6871918316), + FN_DECIMAL(0.5657918509), + FN_DECIMAL(-0.6275978114), + FN_DECIMAL(0.4146983062), + FN_DECIMAL(0.2638993789), + FN_DECIMAL(-0.792633138), + FN_DECIMAL(0.5706133514), + FN_DECIMAL(0.8606546462), + FN_DECIMAL(0.6490900316), + FN_DECIMAL(-0.8242699196), + FN_DECIMAL(0.6765819124), + FN_DECIMAL(0.1959534069), + FN_DECIMAL(-0.8426769757), + FN_DECIMAL(-0.5917672797), + FN_DECIMAL(0.7517364266), + FN_DECIMAL(0.03252559226), + FN_DECIMAL(0.0883617105), + FN_DECIMAL(0.4475064813), + FN_DECIMAL(-0.1418643552), + FN_DECIMAL(0.7343428473), + FN_DECIMAL(0.3870192548), + FN_DECIMAL(-0.7716703522), + FN_DECIMAL(0.4839898327), + FN_DECIMAL(0.7437439055), + FN_DECIMAL(-0.5989573348), + FN_DECIMAL(-0.8357068955), + FN_DECIMAL(0.6086049038), + FN_DECIMAL(0.9194627258), + FN_DECIMAL(0.4718297238), + FN_DECIMAL(-0.2650335884), + FN_DECIMAL(-0.6470352599), + FN_DECIMAL(-0.5555181303), + FN_DECIMAL(0.1222351235), + FN_DECIMAL(0.7802044684), + FN_DECIMAL(-0.8636947022), + FN_DECIMAL(-0.2341352163), + FN_DECIMAL(0.683030874), + FN_DECIMAL(-0.5005858287), + FN_DECIMAL(0.2334616211), + FN_DECIMAL(0.2576877608), + FN_DECIMAL(0.6666816727), + FN_DECIMAL(-0.7663996863), + FN_DECIMAL(0.794201982), + FN_DECIMAL(0.6189308788), + FN_DECIMAL(0.6071033261), + FN_DECIMAL(-0.4206058253), + FN_DECIMAL(-0.3957336915), + FN_DECIMAL(-0.8170257484), + FN_DECIMAL(-0.1043240417), + FN_DECIMAL(0.0002167596213), + FN_DECIMAL(0.1816339018), + FN_DECIMAL(-0.6838094939), + FN_DECIMAL(-0.2495341969), + FN_DECIMAL(-0.7116756954), + FN_DECIMAL(-0.03361673621), + FN_DECIMAL(-0.3350836431), + FN_DECIMAL(0.2137186039), + FN_DECIMAL(0.2557996786), + FN_DECIMAL(0.7490117093), + FN_DECIMAL(0.4942936549), + FN_DECIMAL(-0.352686853), + FN_DECIMAL(-0.3952445435), + FN_DECIMAL(-0.0459964767), + FN_DECIMAL(-0.7115787471), + FN_DECIMAL(0.08022899756), + FN_DECIMAL(0.5362268157), + FN_DECIMAL(-0.8258613686), + FN_DECIMAL(0.1114171723), + FN_DECIMAL(0.3882823051), + FN_DECIMAL(-0.7915404457), + FN_DECIMAL(0.3250957662), + FN_DECIMAL(0.6401346464), + FN_DECIMAL(-0.2662724517), + FN_DECIMAL(-0.6727907114), + FN_DECIMAL(-0.994730818), + FN_DECIMAL(-0.3596358977), + FN_DECIMAL(0.2344610069), + FN_DECIMAL(-0.6645215546), + FN_DECIMAL(-0.7107590611), + FN_DECIMAL(-0.4646617327), + FN_DECIMAL(0.6717191355), + FN_DECIMAL(0.5101893498), + FN_DECIMAL(0.1185768238), + FN_DECIMAL(0.236005093), + FN_DECIMAL(-0.7811024061), + FN_DECIMAL(0.5089325193), + FN_DECIMAL(0.6073187658), + FN_DECIMAL(-0.7930732557), + FN_DECIMAL(-0.6822767155), + FN_DECIMAL(0.3201532885), + FN_DECIMAL(0.7545302807), + FN_DECIMAL(0.1072664448), + FN_DECIMAL(0.6784033173), + FN_DECIMAL(-0.6595924967), + FN_DECIMAL(0.7276509498), + FN_DECIMAL(0.5586689436), + FN_DECIMAL(-0.6498636788), + FN_DECIMAL(0.6789333174), + FN_DECIMAL(0.7105966551), + FN_DECIMAL(-0.2872214155), + FN_DECIMAL(0.496746217), + FN_DECIMAL(-0.3880337977), + FN_DECIMAL(0.7324070604), + FN_DECIMAL(-0.9326634749), + FN_DECIMAL(-0.5867839255), + FN_DECIMAL(0.8003043651), + FN_DECIMAL(-0.1631882481), + FN_DECIMAL(-0.6796374681), + FN_DECIMAL(-0.8066678503), + FN_DECIMAL(0.4238177418), + FN_DECIMAL(0.7715863549), + FN_DECIMAL(0.5455367347), + FN_DECIMAL(-0.03205115397), + FN_DECIMAL(-0.6005545066), + FN_DECIMAL(-0.5423640002), + FN_DECIMAL(0.3569205906), + FN_DECIMAL(-0.582071752), + FN_DECIMAL(0.6407354361), + FN_DECIMAL(0.7777142984), + FN_DECIMAL(-0.09956428618), + FN_DECIMAL(0.1100002681), + FN_DECIMAL(0.8136349123), + FN_DECIMAL(0.2923431904), + FN_DECIMAL(0.9735794425), + FN_DECIMAL(0.8324974864), + FN_DECIMAL(-0.6179617717), + FN_DECIMAL(-0.9248386523), + FN_DECIMAL(-0.6448780771), + FN_DECIMAL(-0.5274402761), + FN_DECIMAL(-0.7862170565), + FN_DECIMAL(0.2682099744), + FN_DECIMAL(-0.5848777694), + FN_DECIMAL(-0.6364561467), + FN_DECIMAL(-0.7167402514), + FN_DECIMAL(-0.8677012494), + FN_DECIMAL(0.4205286707), + FN_DECIMAL(-0.7007832749), + FN_DECIMAL(0.243272451), + FN_DECIMAL(-0.1899846085), + FN_DECIMAL(-0.6146124977), + FN_DECIMAL(-0.8093357692), + FN_DECIMAL(-0.03545096987), + FN_DECIMAL(-0.7191590868), + FN_DECIMAL(0.7478645848), + FN_DECIMAL(0.3623517328), + FN_DECIMAL(0.8436992512), + FN_DECIMAL(-0.2445711729), + FN_DECIMAL(0.6897356637), + FN_DECIMAL(-0.1708070787), + FN_DECIMAL(0.4639272368), + FN_DECIMAL(-0.7917186656), + FN_DECIMAL(0.02980025428), + FN_DECIMAL(0.6334156172), + FN_DECIMAL(-0.9815544807), + FN_DECIMAL(-0.2307217304), + FN_DECIMAL(0.1080823318), + FN_DECIMAL(0.5167601798), + FN_DECIMAL(-0.845120016), + FN_DECIMAL(0.441572562), + FN_DECIMAL(0.5876789172), + FN_DECIMAL(-0.6365908737), + FN_DECIMAL(0.68350166), + FN_DECIMAL(0.5849723959), + FN_DECIMAL(0.1164114357), + FN_DECIMAL(-0.7379813884), + FN_DECIMAL(-0.9613237178), + FN_DECIMAL(-0.9071943084), + FN_DECIMAL(-0.7682111105), + FN_DECIMAL(0.639074459), + FN_DECIMAL(-0.619358298), + FN_DECIMAL(0.2807257131), + FN_DECIMAL(-0.01800868791), + FN_DECIMAL(0.3776607289), + FN_DECIMAL(0.7207567823), + FN_DECIMAL(0.5536661486), + FN_DECIMAL(-0.9974053117), + FN_DECIMAL(-0.02047200006), + FN_DECIMAL(-0.6739453804), + FN_DECIMAL(-0.5607471297), + FN_DECIMAL(0.8815553192), + FN_DECIMAL(0.8275977415), + FN_DECIMAL(0.3928902456), + FN_DECIMAL(0.550991396), + FN_DECIMAL(0.4247623676), + FN_DECIMAL(-0.3436948871), + FN_DECIMAL(-0.3653537677), + FN_DECIMAL(0.3181702902), + FN_DECIMAL(-0.6067173171), + FN_DECIMAL(-0.8984128477), + FN_DECIMAL(0.4220839766), + FN_DECIMAL(0.7238407199), + FN_DECIMAL(-0.7766913695), + FN_DECIMAL(0.6460037842), + FN_DECIMAL(0.2544775664), + FN_DECIMAL(0.6488840578), + FN_DECIMAL(0.805016833), + FN_DECIMAL(-0.9183807036), + FN_DECIMAL(0.4144046357), + FN_DECIMAL(0.270587208), + FN_DECIMAL(-0.8813684494), + FN_DECIMAL(0.6985971877), + FN_DECIMAL(-0.7795603017), + FN_DECIMAL(-0.8624480731), + FN_DECIMAL(0.5532697017), + FN_DECIMAL(0.711179521), + FN_DECIMAL(-0.7798160574), + FN_DECIMAL(0.5225859041), + FN_DECIMAL(0.1261859368), + FN_DECIMAL(0.3398033582), + FN_DECIMAL(-0.7472173667), + FN_DECIMAL(-0.4032647119), + FN_DECIMAL(-0.4246578154), + FN_DECIMAL(0.8481212377), + FN_DECIMAL(-0.2144838537), + FN_DECIMAL(0.3431714491), + FN_DECIMAL(0.5310188231), + FN_DECIMAL(0.6682978632), + FN_DECIMAL(0.3110433206), + FN_DECIMAL(0.9263293599), + FN_DECIMAL(-0.6155600569), + FN_DECIMAL(0.07169784399), + FN_DECIMAL(0.8985888773), }; -const FN_DECIMAL CELL_3D_Z[] = -{ - FN_DECIMAL(-0.6341391283), FN_DECIMAL(-0.7207118346), FN_DECIMAL(0.9597866014), FN_DECIMAL(0.3237504235), FN_DECIMAL(-0.7588642466), FN_DECIMAL(-0.01782410481), FN_DECIMAL(0.2515593809), FN_DECIMAL(0.2207257205), FN_DECIMAL(-0.8579541106), FN_DECIMAL(0.3406410681), FN_DECIMAL(0.7669470462), FN_DECIMAL(-0.9431957648), FN_DECIMAL(0.7676171537), FN_DECIMAL(-0.6000491115), FN_DECIMAL(-0.7062096948), FN_DECIMAL(0.2550207115), - FN_DECIMAL(0.7347325213), FN_DECIMAL(0.5163625202), FN_DECIMAL(-0.5394270162), FN_DECIMAL(0.3336656285), FN_DECIMAL(-0.0638635111), FN_DECIMAL(-0.6503195787), FN_DECIMAL(0.3143356798), FN_DECIMAL(-0.5039217245), FN_DECIMAL(0.6605180464), FN_DECIMAL(-0.6855479011), FN_DECIMAL(-0.6693185756), FN_DECIMAL(0.1832083647), FN_DECIMAL(-0.5666258437), FN_DECIMAL(0.3576482138), FN_DECIMAL(-0.6571949095), FN_DECIMAL(-0.7522101635), - FN_DECIMAL(-0.7238865886), FN_DECIMAL(0.4538887323), FN_DECIMAL(0.2467106257), FN_DECIMAL(0.7274778869), FN_DECIMAL(0.3151170655), FN_DECIMAL(-0.8802293764), FN_DECIMAL(-0.2167232729), FN_DECIMAL(0.5854637865), FN_DECIMAL(0.7019741052), FN_DECIMAL(0.5091756071), FN_DECIMAL(0.1973189533), FN_DECIMAL(0.46743546), FN_DECIMAL(0.05197599597), FN_DECIMAL(0.088354718), FN_DECIMAL(0.5380464843), FN_DECIMAL(-0.6458224544), - FN_DECIMAL(-0.5045952393), FN_DECIMAL(0.419347884), FN_DECIMAL(0.8000823542), FN_DECIMAL(-0.07445020656), FN_DECIMAL(-0.6272881641), FN_DECIMAL(-0.428020311), FN_DECIMAL(-0.2747382083), FN_DECIMAL(-0.08987283726), FN_DECIMAL(0.8699098354), FN_DECIMAL(0.4524761885), FN_DECIMAL(-0.3274603257), FN_DECIMAL(0.4882262167), FN_DECIMAL(-0.7189983256), FN_DECIMAL(0.1746079907), FN_DECIMAL(0.0751772698), FN_DECIMAL(-0.6152927202), - FN_DECIMAL(0.4998474673), FN_DECIMAL(-0.6979677227), FN_DECIMAL(0.7568667263), FN_DECIMAL(-0.6152612058), FN_DECIMAL(0.06447140991), FN_DECIMAL(-0.8155744872), FN_DECIMAL(-0.5229602449), FN_DECIMAL(0.6567836838), FN_DECIMAL(-0.4799905631), FN_DECIMAL(0.03153534591), FN_DECIMAL(0.4724992466), FN_DECIMAL(-0.3026458097), FN_DECIMAL(-0.2191225827), FN_DECIMAL(-0.620692287), FN_DECIMAL(0.3107552588), FN_DECIMAL(0.8235670294), - FN_DECIMAL(0.6474915988), FN_DECIMAL(-0.5047637941), FN_DECIMAL(0.4911488878), FN_DECIMAL(-0.2307138167), FN_DECIMAL(-0.5216800015), FN_DECIMAL(0.6789305939), FN_DECIMAL(0.9403734863), FN_DECIMAL(0.702390397), FN_DECIMAL(0.7347584625), FN_DECIMAL(0.6779567958), FN_DECIMAL(0.9765635805), FN_DECIMAL(-0.9436177661), FN_DECIMAL(-0.358465925), FN_DECIMAL(-0.3058706624), FN_DECIMAL(0.5533414464), FN_DECIMAL(-0.8838306897), - FN_DECIMAL(0.04496841812), FN_DECIMAL(0.01687374963), FN_DECIMAL(-0.9927133148), FN_DECIMAL(-0.211752318), FN_DECIMAL(0.3732015249), FN_DECIMAL(0.9632990593), FN_DECIMAL(-0.07682417004), FN_DECIMAL(-0.07232213047), FN_DECIMAL(0.4733721775), FN_DECIMAL(0.2579229713), FN_DECIMAL(0.7995216286), FN_DECIMAL(0.3928189967), FN_DECIMAL(0.04107517667), FN_DECIMAL(0.1534542912), FN_DECIMAL(0.6468965045), FN_DECIMAL(0.4030684878), - FN_DECIMAL(-0.5617300988), FN_DECIMAL(-0.885463029), FN_DECIMAL(0.693729985), FN_DECIMAL(-0.5736527866), FN_DECIMAL(-0.9911905409), FN_DECIMAL(-0.66451538), FN_DECIMAL(0.2028855685), FN_DECIMAL(0.8019541421), FN_DECIMAL(-0.3903877149), FN_DECIMAL(-0.4888495114), FN_DECIMAL(-0.2753714057), FN_DECIMAL(-0.8915202143), FN_DECIMAL(0.5273119089), FN_DECIMAL(0.9363714773), FN_DECIMAL(-0.5212228249), FN_DECIMAL(-0.31642672), - FN_DECIMAL(0.2409440761), FN_DECIMAL(-0.703776404), FN_DECIMAL(-0.6996810411), FN_DECIMAL(-0.7058714505), FN_DECIMAL(-0.3650566783), FN_DECIMAL(0.1064744278), FN_DECIMAL(0.7985729102), FN_DECIMAL(0.424680257), FN_DECIMAL(-0.6384535592), FN_DECIMAL(0.1540161646), FN_DECIMAL(-0.07702731943), FN_DECIMAL(-0.5627789132), FN_DECIMAL(-0.7667919169), FN_DECIMAL(-0.509815999), FN_DECIMAL(0.4590525092), FN_DECIMAL(0.1552595611), - FN_DECIMAL(0.345402042), FN_DECIMAL(0.7537656024), FN_DECIMAL(0.7906259247), FN_DECIMAL(-0.6218493452), FN_DECIMAL(0.02979350071), FN_DECIMAL(-0.1337893489), FN_DECIMAL(-0.1483818606), FN_DECIMAL(0.549965562), FN_DECIMAL(0.01882482408), FN_DECIMAL(-0.7833783002), FN_DECIMAL(0.4702855809), FN_DECIMAL(0.2435827372), FN_DECIMAL(0.2978428332), FN_DECIMAL(0.2256499906), FN_DECIMAL(0.4885036897), FN_DECIMAL(0.5312962584), - FN_DECIMAL(0.05401156992), FN_DECIMAL(0.1749922158), FN_DECIMAL(-0.7352273018), FN_DECIMAL(0.6058980284), FN_DECIMAL(0.4416079111), FN_DECIMAL(0.4417378638), FN_DECIMAL(0.5455879807), FN_DECIMAL(-0.6681295324), FN_DECIMAL(0.1973431441), FN_DECIMAL(0.4053292055), FN_DECIMAL(0.2220375492), FN_DECIMAL(0.2957118467), FN_DECIMAL(0.6910913512), FN_DECIMAL(0.5940890106), FN_DECIMAL(-0.2014135283), FN_DECIMAL(-0.9172588213), - FN_DECIMAL(-0.4254361401), FN_DECIMAL(-0.6146586825), FN_DECIMAL(-0.7996193253), FN_DECIMAL(-0.3716777111), FN_DECIMAL(-0.9448876842), FN_DECIMAL(-0.2620349924), FN_DECIMAL(0.9615995749), FN_DECIMAL(-0.4679683524), FN_DECIMAL(0.3905937144), FN_DECIMAL(0.613593722), FN_DECIMAL(0.1422937358), FN_DECIMAL(0.1908754211), FN_DECIMAL(0.8189704912), FN_DECIMAL(-0.7300408736), FN_DECIMAL(-0.4108776451), FN_DECIMAL(-0.5319834504), - FN_DECIMAL(-0.8970265651), FN_DECIMAL(-0.5386359045), FN_DECIMAL(0.4082255906), FN_DECIMAL(0.7245356676), FN_DECIMAL(0.5239080873), FN_DECIMAL(-0.8937552226), FN_DECIMAL(-0.553637673), FN_DECIMAL(0.2354455182), FN_DECIMAL(-0.0860293075), FN_DECIMAL(-0.1399373318), FN_DECIMAL(-0.4666323327), FN_DECIMAL(0.5560157407), FN_DECIMAL(0.1772619533), FN_DECIMAL(-0.8893937725), FN_DECIMAL(-0.5632714576), FN_DECIMAL(-0.5666264959), - FN_DECIMAL(-0.3670263736), FN_DECIMAL(-0.06717242579), FN_DECIMAL(0.6205295181), FN_DECIMAL(-0.4110536264), FN_DECIMAL(0.7090054553), FN_DECIMAL(0.183899597), FN_DECIMAL(-0.5605470555), FN_DECIMAL(0.3879565548), FN_DECIMAL(0.7420893903), FN_DECIMAL(-0.2347595118), FN_DECIMAL(-0.8577217497), FN_DECIMAL(0.6325590203), FN_DECIMAL(-0.8736152276), FN_DECIMAL(0.7048011129), FN_DECIMAL(-0.06317948268), FN_DECIMAL(0.8753285574), - FN_DECIMAL(-0.05843650473), FN_DECIMAL(-0.3674922622), FN_DECIMAL(-0.5256624401), FN_DECIMAL(0.7861039337), FN_DECIMAL(0.3287714416), FN_DECIMAL(0.5910593099), FN_DECIMAL(-0.3896960134), FN_DECIMAL(0.6864605361), FN_DECIMAL(0.7164918431), FN_DECIMAL(-0.290014277), FN_DECIMAL(-0.6796169617), FN_DECIMAL(0.1632515592), FN_DECIMAL(0.04485347486), FN_DECIMAL(0.8320545697), FN_DECIMAL(0.01339408056), FN_DECIMAL(-0.2874989857), - FN_DECIMAL(0.615630723), FN_DECIMAL(0.3430367014), FN_DECIMAL(0.8193658136), FN_DECIMAL(-0.5829600957), FN_DECIMAL(0.07911697781), FN_DECIMAL(0.7854296063), FN_DECIMAL(-0.4107442306), FN_DECIMAL(0.4766964066), FN_DECIMAL(-0.9045999527), FN_DECIMAL(-0.1673856787), FN_DECIMAL(0.2828077348), FN_DECIMAL(-0.5902737632), FN_DECIMAL(-0.321506229), FN_DECIMAL(-0.5224513133), FN_DECIMAL(-0.4090169985), FN_DECIMAL(-0.3599685311), +const FN_DECIMAL CELL_3D_Z[] = { + FN_DECIMAL(-0.6341391283), + FN_DECIMAL(-0.7207118346), + FN_DECIMAL(0.9597866014), + FN_DECIMAL(0.3237504235), + FN_DECIMAL(-0.7588642466), + FN_DECIMAL(-0.01782410481), + FN_DECIMAL(0.2515593809), + FN_DECIMAL(0.2207257205), + FN_DECIMAL(-0.8579541106), + FN_DECIMAL(0.3406410681), + FN_DECIMAL(0.7669470462), + FN_DECIMAL(-0.9431957648), + FN_DECIMAL(0.7676171537), + FN_DECIMAL(-0.6000491115), + FN_DECIMAL(-0.7062096948), + FN_DECIMAL(0.2550207115), + FN_DECIMAL(0.7347325213), + FN_DECIMAL(0.5163625202), + FN_DECIMAL(-0.5394270162), + FN_DECIMAL(0.3336656285), + FN_DECIMAL(-0.0638635111), + FN_DECIMAL(-0.6503195787), + FN_DECIMAL(0.3143356798), + FN_DECIMAL(-0.5039217245), + FN_DECIMAL(0.6605180464), + FN_DECIMAL(-0.6855479011), + FN_DECIMAL(-0.6693185756), + FN_DECIMAL(0.1832083647), + FN_DECIMAL(-0.5666258437), + FN_DECIMAL(0.3576482138), + FN_DECIMAL(-0.6571949095), + FN_DECIMAL(-0.7522101635), + FN_DECIMAL(-0.7238865886), + FN_DECIMAL(0.4538887323), + FN_DECIMAL(0.2467106257), + FN_DECIMAL(0.7274778869), + FN_DECIMAL(0.3151170655), + FN_DECIMAL(-0.8802293764), + FN_DECIMAL(-0.2167232729), + FN_DECIMAL(0.5854637865), + FN_DECIMAL(0.7019741052), + FN_DECIMAL(0.5091756071), + FN_DECIMAL(0.1973189533), + FN_DECIMAL(0.46743546), + FN_DECIMAL(0.05197599597), + FN_DECIMAL(0.088354718), + FN_DECIMAL(0.5380464843), + FN_DECIMAL(-0.6458224544), + FN_DECIMAL(-0.5045952393), + FN_DECIMAL(0.419347884), + FN_DECIMAL(0.8000823542), + FN_DECIMAL(-0.07445020656), + FN_DECIMAL(-0.6272881641), + FN_DECIMAL(-0.428020311), + FN_DECIMAL(-0.2747382083), + FN_DECIMAL(-0.08987283726), + FN_DECIMAL(0.8699098354), + FN_DECIMAL(0.4524761885), + FN_DECIMAL(-0.3274603257), + FN_DECIMAL(0.4882262167), + FN_DECIMAL(-0.7189983256), + FN_DECIMAL(0.1746079907), + FN_DECIMAL(0.0751772698), + FN_DECIMAL(-0.6152927202), + FN_DECIMAL(0.4998474673), + FN_DECIMAL(-0.6979677227), + FN_DECIMAL(0.7568667263), + FN_DECIMAL(-0.6152612058), + FN_DECIMAL(0.06447140991), + FN_DECIMAL(-0.8155744872), + FN_DECIMAL(-0.5229602449), + FN_DECIMAL(0.6567836838), + FN_DECIMAL(-0.4799905631), + FN_DECIMAL(0.03153534591), + FN_DECIMAL(0.4724992466), + FN_DECIMAL(-0.3026458097), + FN_DECIMAL(-0.2191225827), + FN_DECIMAL(-0.620692287), + FN_DECIMAL(0.3107552588), + FN_DECIMAL(0.8235670294), + FN_DECIMAL(0.6474915988), + FN_DECIMAL(-0.5047637941), + FN_DECIMAL(0.4911488878), + FN_DECIMAL(-0.2307138167), + FN_DECIMAL(-0.5216800015), + FN_DECIMAL(0.6789305939), + FN_DECIMAL(0.9403734863), + FN_DECIMAL(0.702390397), + FN_DECIMAL(0.7347584625), + FN_DECIMAL(0.6779567958), + FN_DECIMAL(0.9765635805), + FN_DECIMAL(-0.9436177661), + FN_DECIMAL(-0.358465925), + FN_DECIMAL(-0.3058706624), + FN_DECIMAL(0.5533414464), + FN_DECIMAL(-0.8838306897), + FN_DECIMAL(0.04496841812), + FN_DECIMAL(0.01687374963), + FN_DECIMAL(-0.9927133148), + FN_DECIMAL(-0.211752318), + FN_DECIMAL(0.3732015249), + FN_DECIMAL(0.9632990593), + FN_DECIMAL(-0.07682417004), + FN_DECIMAL(-0.07232213047), + FN_DECIMAL(0.4733721775), + FN_DECIMAL(0.2579229713), + FN_DECIMAL(0.7995216286), + FN_DECIMAL(0.3928189967), + FN_DECIMAL(0.04107517667), + FN_DECIMAL(0.1534542912), + FN_DECIMAL(0.6468965045), + FN_DECIMAL(0.4030684878), + FN_DECIMAL(-0.5617300988), + FN_DECIMAL(-0.885463029), + FN_DECIMAL(0.693729985), + FN_DECIMAL(-0.5736527866), + FN_DECIMAL(-0.9911905409), + FN_DECIMAL(-0.66451538), + FN_DECIMAL(0.2028855685), + FN_DECIMAL(0.8019541421), + FN_DECIMAL(-0.3903877149), + FN_DECIMAL(-0.4888495114), + FN_DECIMAL(-0.2753714057), + FN_DECIMAL(-0.8915202143), + FN_DECIMAL(0.5273119089), + FN_DECIMAL(0.9363714773), + FN_DECIMAL(-0.5212228249), + FN_DECIMAL(-0.31642672), + FN_DECIMAL(0.2409440761), + FN_DECIMAL(-0.703776404), + FN_DECIMAL(-0.6996810411), + FN_DECIMAL(-0.7058714505), + FN_DECIMAL(-0.3650566783), + FN_DECIMAL(0.1064744278), + FN_DECIMAL(0.7985729102), + FN_DECIMAL(0.424680257), + FN_DECIMAL(-0.6384535592), + FN_DECIMAL(0.1540161646), + FN_DECIMAL(-0.07702731943), + FN_DECIMAL(-0.5627789132), + FN_DECIMAL(-0.7667919169), + FN_DECIMAL(-0.509815999), + FN_DECIMAL(0.4590525092), + FN_DECIMAL(0.1552595611), + FN_DECIMAL(0.345402042), + FN_DECIMAL(0.7537656024), + FN_DECIMAL(0.7906259247), + FN_DECIMAL(-0.6218493452), + FN_DECIMAL(0.02979350071), + FN_DECIMAL(-0.1337893489), + FN_DECIMAL(-0.1483818606), + FN_DECIMAL(0.549965562), + FN_DECIMAL(0.01882482408), + FN_DECIMAL(-0.7833783002), + FN_DECIMAL(0.4702855809), + FN_DECIMAL(0.2435827372), + FN_DECIMAL(0.2978428332), + FN_DECIMAL(0.2256499906), + FN_DECIMAL(0.4885036897), + FN_DECIMAL(0.5312962584), + FN_DECIMAL(0.05401156992), + FN_DECIMAL(0.1749922158), + FN_DECIMAL(-0.7352273018), + FN_DECIMAL(0.6058980284), + FN_DECIMAL(0.4416079111), + FN_DECIMAL(0.4417378638), + FN_DECIMAL(0.5455879807), + FN_DECIMAL(-0.6681295324), + FN_DECIMAL(0.1973431441), + FN_DECIMAL(0.4053292055), + FN_DECIMAL(0.2220375492), + FN_DECIMAL(0.2957118467), + FN_DECIMAL(0.6910913512), + FN_DECIMAL(0.5940890106), + FN_DECIMAL(-0.2014135283), + FN_DECIMAL(-0.9172588213), + FN_DECIMAL(-0.4254361401), + FN_DECIMAL(-0.6146586825), + FN_DECIMAL(-0.7996193253), + FN_DECIMAL(-0.3716777111), + FN_DECIMAL(-0.9448876842), + FN_DECIMAL(-0.2620349924), + FN_DECIMAL(0.9615995749), + FN_DECIMAL(-0.4679683524), + FN_DECIMAL(0.3905937144), + FN_DECIMAL(0.613593722), + FN_DECIMAL(0.1422937358), + FN_DECIMAL(0.1908754211), + FN_DECIMAL(0.8189704912), + FN_DECIMAL(-0.7300408736), + FN_DECIMAL(-0.4108776451), + FN_DECIMAL(-0.5319834504), + FN_DECIMAL(-0.8970265651), + FN_DECIMAL(-0.5386359045), + FN_DECIMAL(0.4082255906), + FN_DECIMAL(0.7245356676), + FN_DECIMAL(0.5239080873), + FN_DECIMAL(-0.8937552226), + FN_DECIMAL(-0.553637673), + FN_DECIMAL(0.2354455182), + FN_DECIMAL(-0.0860293075), + FN_DECIMAL(-0.1399373318), + FN_DECIMAL(-0.4666323327), + FN_DECIMAL(0.5560157407), + FN_DECIMAL(0.1772619533), + FN_DECIMAL(-0.8893937725), + FN_DECIMAL(-0.5632714576), + FN_DECIMAL(-0.5666264959), + FN_DECIMAL(-0.3670263736), + FN_DECIMAL(-0.06717242579), + FN_DECIMAL(0.6205295181), + FN_DECIMAL(-0.4110536264), + FN_DECIMAL(0.7090054553), + FN_DECIMAL(0.183899597), + FN_DECIMAL(-0.5605470555), + FN_DECIMAL(0.3879565548), + FN_DECIMAL(0.7420893903), + FN_DECIMAL(-0.2347595118), + FN_DECIMAL(-0.8577217497), + FN_DECIMAL(0.6325590203), + FN_DECIMAL(-0.8736152276), + FN_DECIMAL(0.7048011129), + FN_DECIMAL(-0.06317948268), + FN_DECIMAL(0.8753285574), + FN_DECIMAL(-0.05843650473), + FN_DECIMAL(-0.3674922622), + FN_DECIMAL(-0.5256624401), + FN_DECIMAL(0.7861039337), + FN_DECIMAL(0.3287714416), + FN_DECIMAL(0.5910593099), + FN_DECIMAL(-0.3896960134), + FN_DECIMAL(0.6864605361), + FN_DECIMAL(0.7164918431), + FN_DECIMAL(-0.290014277), + FN_DECIMAL(-0.6796169617), + FN_DECIMAL(0.1632515592), + FN_DECIMAL(0.04485347486), + FN_DECIMAL(0.8320545697), + FN_DECIMAL(0.01339408056), + FN_DECIMAL(-0.2874989857), + FN_DECIMAL(0.615630723), + FN_DECIMAL(0.3430367014), + FN_DECIMAL(0.8193658136), + FN_DECIMAL(-0.5829600957), + FN_DECIMAL(0.07911697781), + FN_DECIMAL(0.7854296063), + FN_DECIMAL(-0.4107442306), + FN_DECIMAL(0.4766964066), + FN_DECIMAL(-0.9045999527), + FN_DECIMAL(-0.1673856787), + FN_DECIMAL(0.2828077348), + FN_DECIMAL(-0.5902737632), + FN_DECIMAL(-0.321506229), + FN_DECIMAL(-0.5224513133), + FN_DECIMAL(-0.4090169985), + FN_DECIMAL(-0.3599685311), }; -static int FastFloor(FN_DECIMAL f) { return (f >= 0 ? (int)f : (int)f - 1); } -static int FastRound(FN_DECIMAL f) { return (f >= 0) ? (int)(f + FN_DECIMAL(0.5)) : (int)(f - FN_DECIMAL(0.5)); } +static int FastFloor(FN_DECIMAL f) { + return (f >= 0 ? (int)f : (int)f - 1); +} +static int FastRound(FN_DECIMAL f) { + return (f >= 0) ? (int)(f + FN_DECIMAL(0.5)) : (int)(f - FN_DECIMAL(0.5)); +} //static int FastAbs(int i) { return abs(i); } -static FN_DECIMAL FastAbs(FN_DECIMAL f) { return fabs(f); } -static FN_DECIMAL Lerp(FN_DECIMAL a, FN_DECIMAL b, FN_DECIMAL t) { return a + t * (b - a); } -static FN_DECIMAL InterpHermiteFunc(FN_DECIMAL t) { return t*t*(3 - 2 * t); } -static FN_DECIMAL InterpQuinticFunc(FN_DECIMAL t) { return t*t*t*(t*(t * 6 - 15) + 10); } -static FN_DECIMAL CubicLerp(FN_DECIMAL a, FN_DECIMAL b, FN_DECIMAL c, FN_DECIMAL d, FN_DECIMAL t) -{ +static FN_DECIMAL FastAbs(FN_DECIMAL f) { + return fabs(f); +} +static FN_DECIMAL Lerp(FN_DECIMAL a, FN_DECIMAL b, FN_DECIMAL t) { + return a + t * (b - a); +} +static FN_DECIMAL InterpHermiteFunc(FN_DECIMAL t) { + return t * t * (3 - 2 * t); +} +static FN_DECIMAL InterpQuinticFunc(FN_DECIMAL t) { + return t * t * t * (t * (t * 6 - 15) + 10); +} +static FN_DECIMAL CubicLerp(FN_DECIMAL a, FN_DECIMAL b, FN_DECIMAL c, FN_DECIMAL d, FN_DECIMAL t) { FN_DECIMAL p = (d - c) - (a - b); return t * t * t * p + t * t * ((a - b) - p) + t * (c - a) + b; } -void FastNoise::SetSeed(int seed) -{ +void FastNoise::SetSeed(int seed) { m_seed = seed; std::mt19937_64 gen(seed); @@ -215,9 +1647,8 @@ void FastNoise::SetSeed(int seed) for (int i = 0; i < 256; i++) m_perm[i] = i; - for (int j = 0; j < 256; j++) - { - int rng = (int)(gen() % (256 - j)); + for (int j = 0; j < 256; j++) { + int rng = (int)(gen() % (256 - j)); int k = rng + j; int l = m_perm[j]; m_perm[j] = m_perm[j + 256] = m_perm[k]; @@ -226,20 +1657,17 @@ void FastNoise::SetSeed(int seed) } } -void FastNoise::CalculateFractalBounding() -{ +void FastNoise::CalculateFractalBounding() { FN_DECIMAL amp = m_gain; FN_DECIMAL ampFractal = 1.0f; - for (int i = 1; i < m_octaves; i++) - { + for (int i = 1; i < m_octaves; i++) { ampFractal += amp; amp *= m_gain; } m_fractalBounding = 1.0f / ampFractal; } -void FastNoise::SetCellularDistance2Indices(int cellularDistanceIndex0, int cellularDistanceIndex1) -{ +void FastNoise::SetCellularDistance2Indices(int cellularDistanceIndex0, int cellularDistanceIndex1) { m_cellularDistanceIndex0 = std::min(cellularDistanceIndex0, cellularDistanceIndex1); m_cellularDistanceIndex1 = std::max(cellularDistanceIndex0, cellularDistanceIndex1); @@ -247,34 +1675,27 @@ void FastNoise::SetCellularDistance2Indices(int cellularDistanceIndex0, int cell m_cellularDistanceIndex1 = std::min(std::max(m_cellularDistanceIndex1, 0), FN_CELLULAR_INDEX_MAX); } -void FastNoise::GetCellularDistance2Indices(int& cellularDistanceIndex0, int& cellularDistanceIndex1) const -{ +void FastNoise::GetCellularDistance2Indices(int &cellularDistanceIndex0, int &cellularDistanceIndex1) const { cellularDistanceIndex0 = m_cellularDistanceIndex0; cellularDistanceIndex1 = m_cellularDistanceIndex1; } -unsigned char FastNoise::Index2D_12(unsigned char offset, int x, int y) const -{ +unsigned char FastNoise::Index2D_12(unsigned char offset, int x, int y) const { return m_perm12[(x & 0xff) + m_perm[(y & 0xff) + offset]]; } -unsigned char FastNoise::Index3D_12(unsigned char offset, int x, int y, int z) const -{ +unsigned char FastNoise::Index3D_12(unsigned char offset, int x, int y, int z) const { return m_perm12[(x & 0xff) + m_perm[(y & 0xff) + m_perm[(z & 0xff) + offset]]]; } -unsigned char FastNoise::Index4D_32(unsigned char offset, int x, int y, int z, int w) const -{ +unsigned char FastNoise::Index4D_32(unsigned char offset, int x, int y, int z, int w) const { return m_perm[(x & 0xff) + m_perm[(y & 0xff) + m_perm[(z & 0xff) + m_perm[(w & 0xff) + offset]]]] & 31; } -unsigned char FastNoise::Index2D_256(unsigned char offset, int x, int y) const -{ +unsigned char FastNoise::Index2D_256(unsigned char offset, int x, int y) const { return m_perm[(x & 0xff) + m_perm[(y & 0xff) + offset]]; } -unsigned char FastNoise::Index3D_256(unsigned char offset, int x, int y, int z) const -{ +unsigned char FastNoise::Index3D_256(unsigned char offset, int x, int y, int z) const { return m_perm[(x & 0xff) + m_perm[(y & 0xff) + m_perm[(z & 0xff) + offset]]]; } -unsigned char FastNoise::Index4D_256(unsigned char offset, int x, int y, int z, int w) const -{ +unsigned char FastNoise::Index4D_256(unsigned char offset, int x, int y, int z, int w) const { return m_perm[(x & 0xff) + m_perm[(y & 0xff) + m_perm[(z & 0xff) + m_perm[(w & 0xff) + offset]]]]; } @@ -284,16 +1705,14 @@ unsigned char FastNoise::Index4D_256(unsigned char offset, int x, int y, int z, #define Z_PRIME 6971 #define W_PRIME 1013 -static FN_DECIMAL ValCoord2D(int seed, int x, int y) -{ +static FN_DECIMAL ValCoord2D(int seed, int x, int y) { int n = seed; n ^= X_PRIME * x; n ^= Y_PRIME * y; return (n * n * n * 60493) / FN_DECIMAL(2147483648); } -static FN_DECIMAL ValCoord3D(int seed, int x, int y, int z) -{ +static FN_DECIMAL ValCoord3D(int seed, int x, int y, int z) { int n = seed; n ^= X_PRIME * x; n ^= Y_PRIME * y; @@ -301,8 +1720,7 @@ static FN_DECIMAL ValCoord3D(int seed, int x, int y, int z) return (n * n * n * 60493) / FN_DECIMAL(2147483648); } -static FN_DECIMAL ValCoord4D(int seed, int x, int y, int z, int w) -{ +static FN_DECIMAL ValCoord4D(int seed, int x, int y, int z, int w) { int n = seed; n ^= X_PRIME * x; n ^= Y_PRIME * y; @@ -312,47 +1730,218 @@ static FN_DECIMAL ValCoord4D(int seed, int x, int y, int z, int w) return (n * n * n * 60493) / FN_DECIMAL(2147483648); } -FN_DECIMAL FastNoise::ValCoord2DFast(unsigned char offset, int x, int y) const -{ +FN_DECIMAL FastNoise::ValCoord2DFast(unsigned char offset, int x, int y) const { return VAL_LUT[Index2D_256(offset, x, y)]; } -FN_DECIMAL FastNoise::ValCoord3DFast(unsigned char offset, int x, int y, int z) const -{ +FN_DECIMAL FastNoise::ValCoord3DFast(unsigned char offset, int x, int y, int z) const { return VAL_LUT[Index3D_256(offset, x, y, z)]; } -FN_DECIMAL FastNoise::GradCoord2D(unsigned char offset, int x, int y, FN_DECIMAL xd, FN_DECIMAL yd) const -{ +FN_DECIMAL FastNoise::GradCoord2D(unsigned char offset, int x, int y, FN_DECIMAL xd, FN_DECIMAL yd) const { unsigned char lutPos = Index2D_12(offset, x, y); - return xd*GRAD_X[lutPos] + yd*GRAD_Y[lutPos]; + return xd * GRAD_X[lutPos] + yd * GRAD_Y[lutPos]; } -FN_DECIMAL FastNoise::GradCoord3D(unsigned char offset, int x, int y, int z, FN_DECIMAL xd, FN_DECIMAL yd, FN_DECIMAL zd) const -{ +FN_DECIMAL FastNoise::GradCoord3D(unsigned char offset, int x, int y, int z, FN_DECIMAL xd, FN_DECIMAL yd, FN_DECIMAL zd) const { unsigned char lutPos = Index3D_12(offset, x, y, z); - return xd*GRAD_X[lutPos] + yd*GRAD_Y[lutPos] + zd*GRAD_Z[lutPos]; + return xd * GRAD_X[lutPos] + yd * GRAD_Y[lutPos] + zd * GRAD_Z[lutPos]; } -FN_DECIMAL FastNoise::GradCoord4D(unsigned char offset, int x, int y, int z, int w, FN_DECIMAL xd, FN_DECIMAL yd, FN_DECIMAL zd, FN_DECIMAL wd) const -{ +FN_DECIMAL FastNoise::GradCoord4D(unsigned char offset, int x, int y, int z, int w, FN_DECIMAL xd, FN_DECIMAL yd, FN_DECIMAL zd, FN_DECIMAL wd) const { unsigned char lutPos = Index4D_32(offset, x, y, z, w) << 2; - return xd*GRAD_4D[lutPos] + yd*GRAD_4D[lutPos + 1] + zd*GRAD_4D[lutPos + 2] + wd*GRAD_4D[lutPos + 3]; + return xd * GRAD_4D[lutPos] + yd * GRAD_4D[lutPos + 1] + zd * GRAD_4D[lutPos + 2] + wd * GRAD_4D[lutPos + 3]; } -FN_DECIMAL FastNoise::GetNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::GetNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { x *= m_frequency; y *= m_frequency; z *= m_frequency; - switch (m_noiseType) - { - case Value: - return SingleValue(0, x, y, z); - case ValueFractal: - switch (m_fractalType) - { + switch (m_noiseType) { + case Value: + return SingleValue(0, x, y, z); + case ValueFractal: + switch (m_fractalType) { + case FBM: + return SingleValueFractalFBM(x, y, z); + case Billow: + return SingleValueFractalBillow(x, y, z); + case RigidMulti: + return SingleValueFractalRigidMulti(x, y, z); + default: + return 0; + } + case Perlin: + return SinglePerlin(0, x, y, z); + case PerlinFractal: + switch (m_fractalType) { + case FBM: + return SinglePerlinFractalFBM(x, y, z); + case Billow: + return SinglePerlinFractalBillow(x, y, z); + case RigidMulti: + return SinglePerlinFractalRigidMulti(x, y, z); + default: + return 0; + } + case Simplex: + return SingleSimplex(0, x, y, z); + case SimplexFractal: + switch (m_fractalType) { + case FBM: + return SingleSimplexFractalFBM(x, y, z); + case Billow: + return SingleSimplexFractalBillow(x, y, z); + case RigidMulti: + return SingleSimplexFractalRigidMulti(x, y, z); + default: + return 0; + } + case Cellular: + switch (m_cellularReturnType) { + case CellValue: + case NoiseLookup: + case Distance: + return SingleCellular(x, y, z); + default: + return SingleCellular2Edge(x, y, z); + } + case WhiteNoise: + return GetWhiteNoise(x, y, z); + case Cubic: + return SingleCubic(0, x, y, z); + case CubicFractal: + switch (m_fractalType) { + case FBM: + return SingleCubicFractalFBM(x, y, z); + case Billow: + return SingleCubicFractalBillow(x, y, z); + case RigidMulti: + return SingleCubicFractalRigidMulti(x, y, z); + } + default: + return 0; + } +} + +FN_DECIMAL FastNoise::GetNoise(FN_DECIMAL x, FN_DECIMAL y) const { + x *= m_frequency; + y *= m_frequency; + + switch (m_noiseType) { + case Value: + return SingleValue(0, x, y); + case ValueFractal: + switch (m_fractalType) { + case FBM: + return SingleValueFractalFBM(x, y); + case Billow: + return SingleValueFractalBillow(x, y); + case RigidMulti: + return SingleValueFractalRigidMulti(x, y); + } + case Perlin: + return SinglePerlin(0, x, y); + case PerlinFractal: + switch (m_fractalType) { + case FBM: + return SinglePerlinFractalFBM(x, y); + case Billow: + return SinglePerlinFractalBillow(x, y); + case RigidMulti: + return SinglePerlinFractalRigidMulti(x, y); + } + case Simplex: + return SingleSimplex(0, x, y); + case SimplexFractal: + switch (m_fractalType) { + case FBM: + return SingleSimplexFractalFBM(x, y); + case Billow: + return SingleSimplexFractalBillow(x, y); + case RigidMulti: + return SingleSimplexFractalRigidMulti(x, y); + } + case Cellular: + switch (m_cellularReturnType) { + case CellValue: + case NoiseLookup: + case Distance: + return SingleCellular(x, y); + default: + return SingleCellular2Edge(x, y); + } + case WhiteNoise: + return GetWhiteNoise(x, y); + case Cubic: + return SingleCubic(0, x, y); + case CubicFractal: + switch (m_fractalType) { + case FBM: + return SingleCubicFractalFBM(x, y); + case Billow: + return SingleCubicFractalBillow(x, y); + case RigidMulti: + return SingleCubicFractalRigidMulti(x, y); + } + } + return 0; +} + +// White Noise +FN_DECIMAL FastNoise::GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const { + int32_t *xx = reinterpret_cast(&x); + int32_t *yy = reinterpret_cast(&y); + int32_t *zz = reinterpret_cast(&z); + int32_t *ww = reinterpret_cast(&w); + + return ValCoord4D(m_seed, + *xx ^ (*xx >> 16), + *yy ^ (*yy >> 16), + *zz ^ (*zz >> 16), + *ww ^ (*ww >> 16)); +} + +FN_DECIMAL FastNoise::GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { + int32_t *xx = reinterpret_cast(&x); + int32_t *yy = reinterpret_cast(&y); + int32_t *zz = reinterpret_cast(&z); + + return ValCoord3D(m_seed, + *xx ^ (*xx >> 16), + *yy ^ (*yy >> 16), + *zz ^ (*zz >> 16)); +} + +FN_DECIMAL FastNoise::GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y) const { + int32_t *xx = reinterpret_cast(&x); + int32_t *yy = reinterpret_cast(&y); + + return ValCoord2D(m_seed, + *xx ^ (*xx >> 16), + *yy ^ (*yy >> 16)); +} + +FN_DECIMAL FastNoise::GetWhiteNoiseInt(int x, int y, int z, int w) const { + return ValCoord4D(m_seed, x, y, z, w); +} + +FN_DECIMAL FastNoise::GetWhiteNoiseInt(int x, int y, int z) const { + return ValCoord3D(m_seed, x, y, z); +} + +FN_DECIMAL FastNoise::GetWhiteNoiseInt(int x, int y) const { + return ValCoord2D(m_seed, x, y); +} + +// Value Noise +FN_DECIMAL FastNoise::GetValueFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { + x *= m_frequency; + y *= m_frequency; + z *= m_frequency; + + switch (m_fractalType) { case FBM: return SingleValueFractalFBM(x, y, z); case Billow: @@ -361,215 +1950,15 @@ FN_DECIMAL FastNoise::GetNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const return SingleValueFractalRigidMulti(x, y, z); default: return 0; - } - case Perlin: - return SinglePerlin(0, x, y, z); - case PerlinFractal: - switch (m_fractalType) - { - case FBM: - return SinglePerlinFractalFBM(x, y, z); - case Billow: - return SinglePerlinFractalBillow(x, y, z); - case RigidMulti: - return SinglePerlinFractalRigidMulti(x, y, z); - default: - return 0; - } - case Simplex: - return SingleSimplex(0, x, y, z); - case SimplexFractal: - switch (m_fractalType) - { - case FBM: - return SingleSimplexFractalFBM(x, y, z); - case Billow: - return SingleSimplexFractalBillow(x, y, z); - case RigidMulti: - return SingleSimplexFractalRigidMulti(x, y, z); - default: - return 0; - } - case Cellular: - switch (m_cellularReturnType) - { - case CellValue: - case NoiseLookup: - case Distance: - return SingleCellular(x, y, z); - default: - return SingleCellular2Edge(x, y, z); - } - case WhiteNoise: - return GetWhiteNoise(x, y, z); - case Cubic: - return SingleCubic(0, x, y, z); - case CubicFractal: - switch (m_fractalType) - { - case FBM: - return SingleCubicFractalFBM(x, y, z); - case Billow: - return SingleCubicFractalBillow(x, y, z); - case RigidMulti: - return SingleCubicFractalRigidMulti(x, y, z); - } - default: - return 0; } } -FN_DECIMAL FastNoise::GetNoise(FN_DECIMAL x, FN_DECIMAL y) const -{ - x *= m_frequency; - y *= m_frequency; - - switch (m_noiseType) - { - case Value: - return SingleValue(0, x, y); - case ValueFractal: - switch (m_fractalType) - { - case FBM: - return SingleValueFractalFBM(x, y); - case Billow: - return SingleValueFractalBillow(x, y); - case RigidMulti: - return SingleValueFractalRigidMulti(x, y); - } - case Perlin: - return SinglePerlin(0, x, y); - case PerlinFractal: - switch (m_fractalType) - { - case FBM: - return SinglePerlinFractalFBM(x, y); - case Billow: - return SinglePerlinFractalBillow(x, y); - case RigidMulti: - return SinglePerlinFractalRigidMulti(x, y); - } - case Simplex: - return SingleSimplex(0, x, y); - case SimplexFractal: - switch (m_fractalType) - { - case FBM: - return SingleSimplexFractalFBM(x, y); - case Billow: - return SingleSimplexFractalBillow(x, y); - case RigidMulti: - return SingleSimplexFractalRigidMulti(x, y); - } - case Cellular: - switch (m_cellularReturnType) - { - case CellValue: - case NoiseLookup: - case Distance: - return SingleCellular(x, y); - default: - return SingleCellular2Edge(x, y); - } - case WhiteNoise: - return GetWhiteNoise(x, y); - case Cubic: - return SingleCubic(0, x, y); - case CubicFractal: - switch (m_fractalType) - { - case FBM: - return SingleCubicFractalFBM(x, y); - case Billow: - return SingleCubicFractalBillow(x, y); - case RigidMulti: - return SingleCubicFractalRigidMulti(x, y); - } - } - return 0; -} - -// White Noise -FN_DECIMAL FastNoise::GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const -{ - int32_t* xx = reinterpret_cast(&x); - int32_t* yy = reinterpret_cast(&y); - int32_t* zz = reinterpret_cast(&z); - int32_t* ww = reinterpret_cast(&w); - - return ValCoord4D(m_seed, - *xx ^ (*xx >> 16), - *yy ^ (*yy >> 16), - *zz ^ (*zz >> 16), - *ww ^ (*ww >> 16)); -} - -FN_DECIMAL FastNoise::GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ - int32_t* xx = reinterpret_cast(&x); - int32_t* yy = reinterpret_cast(&y); - int32_t* zz = reinterpret_cast(&z); - - return ValCoord3D(m_seed, - *xx ^ (*xx >> 16), - *yy ^ (*yy >> 16), - *zz ^ (*zz >> 16)); -} - -FN_DECIMAL FastNoise::GetWhiteNoise(FN_DECIMAL x, FN_DECIMAL y) const -{ - int32_t* xx = reinterpret_cast(&x); - int32_t* yy = reinterpret_cast(&y); - - return ValCoord2D(m_seed, - *xx ^ (*xx >> 16), - *yy ^ (*yy >> 16)); -} - -FN_DECIMAL FastNoise::GetWhiteNoiseInt(int x, int y, int z, int w) const -{ - return ValCoord4D(m_seed, x, y, z, w); -} - -FN_DECIMAL FastNoise::GetWhiteNoiseInt(int x, int y, int z) const -{ - return ValCoord3D(m_seed, x, y, z); -} - -FN_DECIMAL FastNoise::GetWhiteNoiseInt(int x, int y) const -{ - return ValCoord2D(m_seed, x, y); -} - -// Value Noise -FN_DECIMAL FastNoise::GetValueFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ - x *= m_frequency; - y *= m_frequency; - z *= m_frequency; - - switch (m_fractalType) - { - case FBM: - return SingleValueFractalFBM(x, y, z); - case Billow: - return SingleValueFractalBillow(x, y, z); - case RigidMulti: - return SingleValueFractalRigidMulti(x, y, z); - default: - return 0; - } -} - -FN_DECIMAL FastNoise::SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = SingleValue(m_perm[0], x, y, z); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -581,14 +1970,12 @@ FN_DECIMAL FastNoise::SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIM return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = FastAbs(SingleValue(m_perm[0], x, y, z)) * 2 - 1; FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -600,14 +1987,12 @@ FN_DECIMAL FastNoise::SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DE return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = 1 - FastAbs(SingleValue(m_perm[0], x, y, z)); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -619,13 +2004,11 @@ FN_DECIMAL FastNoise::SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, F return sum; } -FN_DECIMAL FastNoise::GetValue(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::GetValue(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { return SingleValue(0, x * m_frequency, y * m_frequency, z * m_frequency); } -FN_DECIMAL FastNoise::SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { int x0 = FastFloor(x); int y0 = FastFloor(y); int z0 = FastFloor(z); @@ -634,24 +2017,23 @@ FN_DECIMAL FastNoise::SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL int z1 = z0 + 1; FN_DECIMAL xs, ys, zs; - switch (m_interp) - { - default: - case Linear: - xs = x - (FN_DECIMAL)x0; - ys = y - (FN_DECIMAL)y0; - zs = z - (FN_DECIMAL)z0; - break; - case Hermite: - xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); - ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); - zs = InterpHermiteFunc(z - (FN_DECIMAL)z0); - break; - case Quintic: - xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); - ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); - zs = InterpQuinticFunc(z - (FN_DECIMAL)z0); - break; + switch (m_interp) { + default: + case Linear: + xs = x - (FN_DECIMAL)x0; + ys = y - (FN_DECIMAL)y0; + zs = z - (FN_DECIMAL)z0; + break; + case Hermite: + xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); + zs = InterpHermiteFunc(z - (FN_DECIMAL)z0); + break; + case Quintic: + xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); + zs = InterpQuinticFunc(z - (FN_DECIMAL)z0); + break; } FN_DECIMAL xf00 = Lerp(ValCoord3DFast(offset, x0, y0, z0), ValCoord3DFast(offset, x1, y0, z0), xs); @@ -665,32 +2047,28 @@ FN_DECIMAL FastNoise::SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL return Lerp(yf0, yf1, zs); } -FN_DECIMAL FastNoise::GetValueFractal(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::GetValueFractal(FN_DECIMAL x, FN_DECIMAL y) const { x *= m_frequency; y *= m_frequency; - switch (m_fractalType) - { - case FBM: - return SingleValueFractalFBM(x, y); - case Billow: - return SingleValueFractalBillow(x, y); - case RigidMulti: - return SingleValueFractalRigidMulti(x, y); - default: - return 0; + switch (m_fractalType) { + case FBM: + return SingleValueFractalFBM(x, y); + case Billow: + return SingleValueFractalBillow(x, y); + case RigidMulti: + return SingleValueFractalRigidMulti(x, y); + default: + return 0; } } -FN_DECIMAL FastNoise::SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = SingleValue(m_perm[0], x, y); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -701,14 +2079,12 @@ FN_DECIMAL FastNoise::SingleValueFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = FastAbs(SingleValue(m_perm[0], x, y)) * 2 - 1; FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; amp *= m_gain; @@ -718,14 +2094,12 @@ FN_DECIMAL FastNoise::SingleValueFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = 1 - FastAbs(SingleValue(m_perm[0], x, y)); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -736,34 +2110,31 @@ FN_DECIMAL FastNoise::SingleValueFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) c return sum; } -FN_DECIMAL FastNoise::GetValue(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::GetValue(FN_DECIMAL x, FN_DECIMAL y) const { return SingleValue(0, x * m_frequency, y * m_frequency); } -FN_DECIMAL FastNoise::SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const { int x0 = FastFloor(x); int y0 = FastFloor(y); int x1 = x0 + 1; int y1 = y0 + 1; FN_DECIMAL xs, ys; - switch (m_interp) - { - default: - case Linear: - xs = x - (FN_DECIMAL)x0; - ys = y - (FN_DECIMAL)y0; - break; - case Hermite: - xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); - ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); - break; - case Quintic: - xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); - ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); - break; + switch (m_interp) { + default: + case Linear: + xs = x - (FN_DECIMAL)x0; + ys = y - (FN_DECIMAL)y0; + break; + case Hermite: + xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); + break; + case Quintic: + xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); + break; } FN_DECIMAL xf0 = Lerp(ValCoord2DFast(offset, x0, y0), ValCoord2DFast(offset, x1, y0), xs); @@ -773,33 +2144,29 @@ FN_DECIMAL FastNoise::SingleValue(unsigned char offset, FN_DECIMAL x, FN_DECIMAL } // Perlin Noise -FN_DECIMAL FastNoise::GetPerlinFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::GetPerlinFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { x *= m_frequency; y *= m_frequency; z *= m_frequency; - switch (m_fractalType) - { - case FBM: - return SinglePerlinFractalFBM(x, y, z); - case Billow: - return SinglePerlinFractalBillow(x, y, z); - case RigidMulti: - return SinglePerlinFractalRigidMulti(x, y, z); - default: - return 0; + switch (m_fractalType) { + case FBM: + return SinglePerlinFractalFBM(x, y, z); + case Billow: + return SinglePerlinFractalBillow(x, y, z); + case RigidMulti: + return SinglePerlinFractalRigidMulti(x, y, z); + default: + return 0; } } -FN_DECIMAL FastNoise::SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = SinglePerlin(m_perm[0], x, y, z); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -811,14 +2178,12 @@ FN_DECIMAL FastNoise::SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECI return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = FastAbs(SinglePerlin(m_perm[0], x, y, z)) * 2 - 1; FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -830,14 +2195,12 @@ FN_DECIMAL FastNoise::SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_D return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = 1 - FastAbs(SinglePerlin(m_perm[0], x, y, z)); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -849,13 +2212,11 @@ FN_DECIMAL FastNoise::SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, return sum; } -FN_DECIMAL FastNoise::GetPerlin(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::GetPerlin(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { return SinglePerlin(0, x * m_frequency, y * m_frequency, z * m_frequency); } -FN_DECIMAL FastNoise::SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { int x0 = FastFloor(x); int y0 = FastFloor(y); int z0 = FastFloor(z); @@ -864,24 +2225,23 @@ FN_DECIMAL FastNoise::SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMA int z1 = z0 + 1; FN_DECIMAL xs, ys, zs; - switch (m_interp) - { - default: - case Linear: - xs = x - (FN_DECIMAL)x0; - ys = y - (FN_DECIMAL)y0; - zs = z - (FN_DECIMAL)z0; - break; - case Hermite: - xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); - ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); - zs = InterpHermiteFunc(z - (FN_DECIMAL)z0); - break; - case Quintic: - xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); - ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); - zs = InterpQuinticFunc(z - (FN_DECIMAL)z0); - break; + switch (m_interp) { + default: + case Linear: + xs = x - (FN_DECIMAL)x0; + ys = y - (FN_DECIMAL)y0; + zs = z - (FN_DECIMAL)z0; + break; + case Hermite: + xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); + zs = InterpHermiteFunc(z - (FN_DECIMAL)z0); + break; + case Quintic: + xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); + zs = InterpQuinticFunc(z - (FN_DECIMAL)z0); + break; } FN_DECIMAL xd0 = x - (FN_DECIMAL)x0; @@ -902,32 +2262,28 @@ FN_DECIMAL FastNoise::SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMA return Lerp(yf0, yf1, zs); } -FN_DECIMAL FastNoise::GetPerlinFractal(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::GetPerlinFractal(FN_DECIMAL x, FN_DECIMAL y) const { x *= m_frequency; y *= m_frequency; - switch (m_fractalType) - { - case FBM: - return SinglePerlinFractalFBM(x, y); - case Billow: - return SinglePerlinFractalBillow(x, y); - case RigidMulti: - return SinglePerlinFractalRigidMulti(x, y); - default: - return 0; + switch (m_fractalType) { + case FBM: + return SinglePerlinFractalFBM(x, y); + case Billow: + return SinglePerlinFractalBillow(x, y); + case RigidMulti: + return SinglePerlinFractalRigidMulti(x, y); + default: + return 0; } } -FN_DECIMAL FastNoise::SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = SinglePerlin(m_perm[0], x, y); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -938,14 +2294,12 @@ FN_DECIMAL FastNoise::SinglePerlinFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = FastAbs(SinglePerlin(m_perm[0], x, y)) * 2 - 1; FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -956,14 +2310,12 @@ FN_DECIMAL FastNoise::SinglePerlinFractalBillow(FN_DECIMAL x, FN_DECIMAL y) cons return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = 1 - FastAbs(SinglePerlin(m_perm[0], x, y)); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -974,34 +2326,31 @@ FN_DECIMAL FastNoise::SinglePerlinFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) return sum; } -FN_DECIMAL FastNoise::GetPerlin(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::GetPerlin(FN_DECIMAL x, FN_DECIMAL y) const { return SinglePerlin(0, x * m_frequency, y * m_frequency); } -FN_DECIMAL FastNoise::SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const { int x0 = FastFloor(x); int y0 = FastFloor(y); int x1 = x0 + 1; int y1 = y0 + 1; FN_DECIMAL xs, ys; - switch (m_interp) - { - default: - case Linear: - xs = x - (FN_DECIMAL)x0; - ys = y - (FN_DECIMAL)y0; - break; - case Hermite: - xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); - ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); - break; - case Quintic: - xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); - ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); - break; + switch (m_interp) { + default: + case Linear: + xs = x - (FN_DECIMAL)x0; + ys = y - (FN_DECIMAL)y0; + break; + case Hermite: + xs = InterpHermiteFunc(x - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(y - (FN_DECIMAL)y0); + break; + case Quintic: + xs = InterpQuinticFunc(x - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(y - (FN_DECIMAL)y0); + break; } FN_DECIMAL xd0 = x - (FN_DECIMAL)x0; @@ -1017,33 +2366,29 @@ FN_DECIMAL FastNoise::SinglePerlin(unsigned char offset, FN_DECIMAL x, FN_DECIMA // Simplex Noise -FN_DECIMAL FastNoise::GetSimplexFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::GetSimplexFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { x *= m_frequency; y *= m_frequency; z *= m_frequency; - switch (m_fractalType) - { - case FBM: - return SingleSimplexFractalFBM(x, y, z); - case Billow: - return SingleSimplexFractalBillow(x, y, z); - case RigidMulti: - return SingleSimplexFractalRigidMulti(x, y, z); - default: - return 0; + switch (m_fractalType) { + case FBM: + return SingleSimplexFractalFBM(x, y, z); + case Billow: + return SingleSimplexFractalBillow(x, y, z); + case RigidMulti: + return SingleSimplexFractalRigidMulti(x, y, z); + default: + return 0; } } -FN_DECIMAL FastNoise::SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = SingleSimplex(m_perm[0], x, y, z); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -1055,14 +2400,12 @@ FN_DECIMAL FastNoise::SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DEC return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = FastAbs(SingleSimplex(m_perm[0], x, y, z)) * 2 - 1; FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -1074,14 +2417,12 @@ FN_DECIMAL FastNoise::SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_ return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = 1 - FastAbs(SingleSimplex(m_perm[0], x, y, z)); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -1093,16 +2434,14 @@ FN_DECIMAL FastNoise::SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, return sum; } -FN_DECIMAL FastNoise::GetSimplex(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::GetSimplex(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { return SingleSimplex(0, x * m_frequency, y * m_frequency, z * m_frequency); } static const FN_DECIMAL F3 = 1 / FN_DECIMAL(3); static const FN_DECIMAL G3 = 1 / FN_DECIMAL(6); -FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL t = (x + y + z) * F3; int i = FastFloor(x + t); int j = FastFloor(y + t); @@ -1120,110 +2459,126 @@ FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIM int i1, j1, k1; int i2, j2, k2; - if (x0 >= y0) + if (x0 >= y0) { + if (y0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + i2 = 1; + j2 = 1; + k2 = 0; + } else if (x0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + i2 = 1; + j2 = 0; + k2 = 1; + } else // x0 < z0 + { + i1 = 0; + j1 = 0; + k1 = 1; + i2 = 1; + j2 = 0; + k2 = 1; + } + } else // x0 < y0 { - if (y0 >= z0) + if (y0 < z0) { + i1 = 0; + j1 = 0; + k1 = 1; + i2 = 0; + j2 = 1; + k2 = 1; + } else if (x0 < z0) { + i1 = 0; + j1 = 1; + k1 = 0; + i2 = 0; + j2 = 1; + k2 = 1; + } else // x0 >= z0 { - i1 = 1; j1 = 0; k1 = 0; i2 = 1; j2 = 1; k2 = 0; - } - else if (x0 >= z0) - { - i1 = 1; j1 = 0; k1 = 0; i2 = 1; j2 = 0; k2 = 1; - } - else // x0 < z0 - { - i1 = 0; j1 = 0; k1 = 1; i2 = 1; j2 = 0; k2 = 1; - } - } - else // x0 < y0 - { - if (y0 < z0) - { - i1 = 0; j1 = 0; k1 = 1; i2 = 0; j2 = 1; k2 = 1; - } - else if (x0 < z0) - { - i1 = 0; j1 = 1; k1 = 0; i2 = 0; j2 = 1; k2 = 1; - } - else // x0 >= z0 - { - i1 = 0; j1 = 1; k1 = 0; i2 = 1; j2 = 1; k2 = 0; + i1 = 0; + j1 = 1; + k1 = 0; + i2 = 1; + j2 = 1; + k2 = 0; } } FN_DECIMAL x1 = x0 - i1 + G3; FN_DECIMAL y1 = y0 - j1 + G3; FN_DECIMAL z1 = z0 - k1 + G3; - FN_DECIMAL x2 = x0 - i2 + 2*G3; - FN_DECIMAL y2 = y0 - j2 + 2*G3; - FN_DECIMAL z2 = z0 - k2 + 2*G3; - FN_DECIMAL x3 = x0 - 1 + 3*G3; - FN_DECIMAL y3 = y0 - 1 + 3*G3; - FN_DECIMAL z3 = z0 - 1 + 3*G3; + FN_DECIMAL x2 = x0 - i2 + 2 * G3; + FN_DECIMAL y2 = y0 - j2 + 2 * G3; + FN_DECIMAL z2 = z0 - k2 + 2 * G3; + FN_DECIMAL x3 = x0 - 1 + 3 * G3; + FN_DECIMAL y3 = y0 - 1 + 3 * G3; + FN_DECIMAL z3 = z0 - 1 + 3 * G3; FN_DECIMAL n0, n1, n2, n3; - t = FN_DECIMAL(0.6) - x0*x0 - y0*y0 - z0*z0; - if (t < 0) n0 = 0; - else - { + t = FN_DECIMAL(0.6) - x0 * x0 - y0 * y0 - z0 * z0; + if (t < 0) + n0 = 0; + else { t *= t; - n0 = t*t*GradCoord3D(offset, i, j, k, x0, y0, z0); + n0 = t * t * GradCoord3D(offset, i, j, k, x0, y0, z0); } - t = FN_DECIMAL(0.6) - x1*x1 - y1*y1 - z1*z1; - if (t < 0) n1 = 0; - else - { + t = FN_DECIMAL(0.6) - x1 * x1 - y1 * y1 - z1 * z1; + if (t < 0) + n1 = 0; + else { t *= t; - n1 = t*t*GradCoord3D(offset, i + i1, j + j1, k + k1, x1, y1, z1); + n1 = t * t * GradCoord3D(offset, i + i1, j + j1, k + k1, x1, y1, z1); } - t = FN_DECIMAL(0.6) - x2*x2 - y2*y2 - z2*z2; - if (t < 0) n2 = 0; - else - { + t = FN_DECIMAL(0.6) - x2 * x2 - y2 * y2 - z2 * z2; + if (t < 0) + n2 = 0; + else { t *= t; - n2 = t*t*GradCoord3D(offset, i + i2, j + j2, k + k2, x2, y2, z2); + n2 = t * t * GradCoord3D(offset, i + i2, j + j2, k + k2, x2, y2, z2); } - t = FN_DECIMAL(0.6) - x3*x3 - y3*y3 - z3*z3; - if (t < 0) n3 = 0; - else - { + t = FN_DECIMAL(0.6) - x3 * x3 - y3 * y3 - z3 * z3; + if (t < 0) + n3 = 0; + else { t *= t; - n3 = t*t*GradCoord3D(offset, i + 1, j + 1, k + 1, x3, y3, z3); + n3 = t * t * GradCoord3D(offset, i + 1, j + 1, k + 1, x3, y3, z3); } return 32 * (n0 + n1 + n2 + n3); } -FN_DECIMAL FastNoise::GetSimplexFractal(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::GetSimplexFractal(FN_DECIMAL x, FN_DECIMAL y) const { x *= m_frequency; y *= m_frequency; - switch (m_fractalType) - { - case FBM: - return SingleSimplexFractalFBM(x, y); - case Billow: - return SingleSimplexFractalBillow(x, y); - case RigidMulti: - return SingleSimplexFractalRigidMulti(x, y); - default: - return 0; + switch (m_fractalType) { + case FBM: + return SingleSimplexFractalFBM(x, y); + case Billow: + return SingleSimplexFractalBillow(x, y); + case RigidMulti: + return SingleSimplexFractalRigidMulti(x, y); + default: + return 0; } } -FN_DECIMAL FastNoise::SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = SingleSimplex(m_perm[0], x, y); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -1234,14 +2589,12 @@ FN_DECIMAL FastNoise::SingleSimplexFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = FastAbs(SingleSimplex(m_perm[0], x, y)) * 2 - 1; FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -1252,14 +2605,12 @@ FN_DECIMAL FastNoise::SingleSimplexFractalBillow(FN_DECIMAL x, FN_DECIMAL y) con return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = 1 - FastAbs(SingleSimplex(m_perm[0], x, y)); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -1270,14 +2621,12 @@ FN_DECIMAL FastNoise::SingleSimplexFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) return sum; } -FN_DECIMAL FastNoise::SingleSimplexFractalBlend(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleSimplexFractalBlend(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = SingleSimplex(m_perm[0], x, y); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -1288,8 +2637,7 @@ FN_DECIMAL FastNoise::SingleSimplexFractalBlend(FN_DECIMAL x, FN_DECIMAL y) cons return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::GetSimplex(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::GetSimplex(FN_DECIMAL x, FN_DECIMAL y) const { return SingleSimplex(0, x * m_frequency, y * m_frequency); } @@ -1300,8 +2648,7 @@ static const FN_DECIMAL SQRT3 = FN_DECIMAL(1.7320508075688772935274463415059); static const FN_DECIMAL F2 = FN_DECIMAL(0.5) * (SQRT3 - FN_DECIMAL(1.0)); static const FN_DECIMAL G2 = (FN_DECIMAL(3.0) - SQRT3) / FN_DECIMAL(6.0); -FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL t = (x + y) * F2; int i = FastFloor(x + t); int j = FastFloor(y + t); @@ -1314,71 +2661,67 @@ FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIM FN_DECIMAL y0 = y - Y0; int i1, j1; - if (x0 > y0) - { - i1 = 1; j1 = 0; - } - else - { - i1 = 0; j1 = 1; + if (x0 > y0) { + i1 = 1; + j1 = 0; + } else { + i1 = 0; + j1 = 1; } FN_DECIMAL x1 = x0 - (FN_DECIMAL)i1 + G2; FN_DECIMAL y1 = y0 - (FN_DECIMAL)j1 + G2; - FN_DECIMAL x2 = x0 - 1 + 2*G2; - FN_DECIMAL y2 = y0 - 1 + 2*G2; + FN_DECIMAL x2 = x0 - 1 + 2 * G2; + FN_DECIMAL y2 = y0 - 1 + 2 * G2; FN_DECIMAL n0, n1, n2; - t = FN_DECIMAL(0.5) - x0*x0 - y0*y0; - if (t < 0) n0 = 0; - else - { + t = FN_DECIMAL(0.5) - x0 * x0 - y0 * y0; + if (t < 0) + n0 = 0; + else { t *= t; n0 = t * t * GradCoord2D(offset, i, j, x0, y0); } - t = FN_DECIMAL(0.5) - x1*x1 - y1*y1; - if (t < 0) n1 = 0; - else - { + t = FN_DECIMAL(0.5) - x1 * x1 - y1 * y1; + if (t < 0) + n1 = 0; + else { t *= t; - n1 = t*t*GradCoord2D(offset, i + i1, j + j1, x1, y1); + n1 = t * t * GradCoord2D(offset, i + i1, j + j1, x1, y1); } - t = FN_DECIMAL(0.5) - x2*x2 - y2*y2; - if (t < 0) n2 = 0; - else - { + t = FN_DECIMAL(0.5) - x2 * x2 - y2 * y2; + if (t < 0) + n2 = 0; + else { t *= t; - n2 = t*t*GradCoord2D(offset, i + 1, j + 1, x2, y2); + n2 = t * t * GradCoord2D(offset, i + 1, j + 1, x2, y2); } return 70 * (n0 + n1 + n2); } -FN_DECIMAL FastNoise::GetSimplex(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const -{ +FN_DECIMAL FastNoise::GetSimplex(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const { return SingleSimplex(0, x * m_frequency, y * m_frequency, z * m_frequency, w * m_frequency); } -static const unsigned char SIMPLEX_4D[] = -{ - 0,1,2,3,0,1,3,2,0,0,0,0,0,2,3,1,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,0, - 0,2,1,3,0,0,0,0,0,3,1,2,0,3,2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,3,2,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,2,0,3,0,0,0,0,1,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0,1,2,3,1,0, - 1,0,2,3,1,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,1,0,0,0,0,2,1,3,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 2,0,1,3,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,2,3,0,2,1,0,0,0,0,3,1,2,0, - 2,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,3,1,0,2,0,0,0,0,3,2,0,1,3,2,1,0 +static const unsigned char SIMPLEX_4D[] = { + 0, 1, 2, 3, 0, 1, 3, 2, 0, 0, 0, 0, 0, 2, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, + 0, 2, 1, 3, 0, 0, 0, 0, 0, 3, 1, 2, 0, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 0, 3, 0, 0, 0, 0, 1, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 1, 2, 3, 1, 0, + 1, 0, 2, 3, 1, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 1, 0, 0, 0, 0, 2, 1, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 3, 0, 2, 1, 0, 0, 0, 0, 3, 1, 2, 0, + 2, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 2, 0, 0, 0, 0, 3, 2, 0, 1, 3, 2, 1, 0 }; static const FN_DECIMAL F4 = (sqrt(FN_DECIMAL(5)) - 1) / 4; static const FN_DECIMAL G4 = (5 - sqrt(FN_DECIMAL(5))) / 20; -FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const -{ +FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z, FN_DECIMAL w) const { FN_DECIMAL n0, n1, n2, n3, n4; FN_DECIMAL t = (x + y + z + w) * F4; int i = FastFloor(x + t); @@ -1420,45 +2763,50 @@ FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIM FN_DECIMAL y1 = y0 - j1 + G4; FN_DECIMAL z1 = z0 - k1 + G4; FN_DECIMAL w1 = w0 - l1 + G4; - FN_DECIMAL x2 = x0 - i2 + 2*G4; - FN_DECIMAL y2 = y0 - j2 + 2*G4; - FN_DECIMAL z2 = z0 - k2 + 2*G4; - FN_DECIMAL w2 = w0 - l2 + 2*G4; - FN_DECIMAL x3 = x0 - i3 + 3*G4; - FN_DECIMAL y3 = y0 - j3 + 3*G4; - FN_DECIMAL z3 = z0 - k3 + 3*G4; - FN_DECIMAL w3 = w0 - l3 + 3*G4; - FN_DECIMAL x4 = x0 - 1 + 4*G4; - FN_DECIMAL y4 = y0 - 1 + 4*G4; - FN_DECIMAL z4 = z0 - 1 + 4*G4; - FN_DECIMAL w4 = w0 - 1 + 4*G4; + FN_DECIMAL x2 = x0 - i2 + 2 * G4; + FN_DECIMAL y2 = y0 - j2 + 2 * G4; + FN_DECIMAL z2 = z0 - k2 + 2 * G4; + FN_DECIMAL w2 = w0 - l2 + 2 * G4; + FN_DECIMAL x3 = x0 - i3 + 3 * G4; + FN_DECIMAL y3 = y0 - j3 + 3 * G4; + FN_DECIMAL z3 = z0 - k3 + 3 * G4; + FN_DECIMAL w3 = w0 - l3 + 3 * G4; + FN_DECIMAL x4 = x0 - 1 + 4 * G4; + FN_DECIMAL y4 = y0 - 1 + 4 * G4; + FN_DECIMAL z4 = z0 - 1 + 4 * G4; + FN_DECIMAL w4 = w0 - 1 + 4 * G4; - t = FN_DECIMAL(0.6) - x0*x0 - y0*y0 - z0*z0 - w0*w0; - if (t < 0) n0 = 0; + t = FN_DECIMAL(0.6) - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0; + if (t < 0) + n0 = 0; else { t *= t; n0 = t * t * GradCoord4D(offset, i, j, k, l, x0, y0, z0, w0); } - t = FN_DECIMAL(0.6) - x1*x1 - y1*y1 - z1*z1 - w1*w1; - if (t < 0) n1 = 0; + t = FN_DECIMAL(0.6) - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1; + if (t < 0) + n1 = 0; else { t *= t; n1 = t * t * GradCoord4D(offset, i + i1, j + j1, k + k1, l + l1, x1, y1, z1, w1); } - t = FN_DECIMAL(0.6) - x2*x2 - y2*y2 - z2*z2 - w2*w2; - if (t < 0) n2 = 0; + t = FN_DECIMAL(0.6) - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2; + if (t < 0) + n2 = 0; else { t *= t; n2 = t * t * GradCoord4D(offset, i + i2, j + j2, k + k2, l + l2, x2, y2, z2, w2); } - t = FN_DECIMAL(0.6) - x3*x3 - y3*y3 - z3*z3 - w3*w3; - if (t < 0) n3 = 0; + t = FN_DECIMAL(0.6) - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3; + if (t < 0) + n3 = 0; else { t *= t; n3 = t * t * GradCoord4D(offset, i + i3, j + j3, k + k3, l + l3, x3, y3, z3, w3); } - t = FN_DECIMAL(0.6) - x4*x4 - y4*y4 - z4*z4 - w4*w4; - if (t < 0) n4 = 0; + t = FN_DECIMAL(0.6) - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4; + if (t < 0) + n4 = 0; else { t *= t; n4 = t * t * GradCoord4D(offset, i + 1, j + 1, k + 1, l + 1, x4, y4, z4, w4); @@ -1468,33 +2816,29 @@ FN_DECIMAL FastNoise::SingleSimplex(unsigned char offset, FN_DECIMAL x, FN_DECIM } // Cubic Noise -FN_DECIMAL FastNoise::GetCubicFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::GetCubicFractal(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { x *= m_frequency; y *= m_frequency; z *= m_frequency; - switch (m_fractalType) - { - case FBM: - return SingleCubicFractalFBM(x, y, z); - case Billow: - return SingleCubicFractalBillow(x, y, z); - case RigidMulti: - return SingleCubicFractalRigidMulti(x, y, z); - default: - return 0; + switch (m_fractalType) { + case FBM: + return SingleCubicFractalFBM(x, y, z); + case Billow: + return SingleCubicFractalBillow(x, y, z); + case RigidMulti: + return SingleCubicFractalRigidMulti(x, y, z); + default: + return 0; } } -FN_DECIMAL FastNoise::SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = SingleCubic(m_perm[0], x, y, z); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -1506,14 +2850,12 @@ FN_DECIMAL FastNoise::SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y, FN_DECIM return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = FastAbs(SingleCubic(m_perm[0], x, y, z)) * 2 - 1; FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -1525,14 +2867,12 @@ FN_DECIMAL FastNoise::SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y, FN_DE return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { FN_DECIMAL sum = 1 - FastAbs(SingleCubic(m_perm[0], x, y, z)); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; z *= m_lacunarity; @@ -1544,15 +2884,13 @@ FN_DECIMAL FastNoise::SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y, F return sum; } -FN_DECIMAL FastNoise::GetCubic(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::GetCubic(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { return SingleCubic(0, x * m_frequency, y * m_frequency, z * m_frequency); } const FN_DECIMAL CUBIC_3D_BOUNDING = 1 / (FN_DECIMAL(1.5) * FN_DECIMAL(1.5) * FN_DECIMAL(1.5)); -FN_DECIMAL FastNoise::SingleCubic(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleCubic(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { int x1 = FastFloor(x); int y1 = FastFloor(y); int z1 = FastFloor(z); @@ -1572,60 +2910,56 @@ FN_DECIMAL FastNoise::SingleCubic(unsigned char offset, FN_DECIMAL x, FN_DECIMAL FN_DECIMAL zs = z - (FN_DECIMAL)z1; return CubicLerp( - CubicLerp( - CubicLerp(ValCoord3DFast(offset, x0, y0, z0), ValCoord3DFast(offset, x1, y0, z0), ValCoord3DFast(offset, x2, y0, z0), ValCoord3DFast(offset, x3, y0, z0), xs), - CubicLerp(ValCoord3DFast(offset, x0, y1, z0), ValCoord3DFast(offset, x1, y1, z0), ValCoord3DFast(offset, x2, y1, z0), ValCoord3DFast(offset, x3, y1, z0), xs), - CubicLerp(ValCoord3DFast(offset, x0, y2, z0), ValCoord3DFast(offset, x1, y2, z0), ValCoord3DFast(offset, x2, y2, z0), ValCoord3DFast(offset, x3, y2, z0), xs), - CubicLerp(ValCoord3DFast(offset, x0, y3, z0), ValCoord3DFast(offset, x1, y3, z0), ValCoord3DFast(offset, x2, y3, z0), ValCoord3DFast(offset, x3, y3, z0), xs), - ys), - CubicLerp( - CubicLerp(ValCoord3DFast(offset, x0, y0, z1), ValCoord3DFast(offset, x1, y0, z1), ValCoord3DFast(offset, x2, y0, z1), ValCoord3DFast(offset, x3, y0, z1), xs), - CubicLerp(ValCoord3DFast(offset, x0, y1, z1), ValCoord3DFast(offset, x1, y1, z1), ValCoord3DFast(offset, x2, y1, z1), ValCoord3DFast(offset, x3, y1, z1), xs), - CubicLerp(ValCoord3DFast(offset, x0, y2, z1), ValCoord3DFast(offset, x1, y2, z1), ValCoord3DFast(offset, x2, y2, z1), ValCoord3DFast(offset, x3, y2, z1), xs), - CubicLerp(ValCoord3DFast(offset, x0, y3, z1), ValCoord3DFast(offset, x1, y3, z1), ValCoord3DFast(offset, x2, y3, z1), ValCoord3DFast(offset, x3, y3, z1), xs), - ys), - CubicLerp( - CubicLerp(ValCoord3DFast(offset, x0, y0, z2), ValCoord3DFast(offset, x1, y0, z2), ValCoord3DFast(offset, x2, y0, z2), ValCoord3DFast(offset, x3, y0, z2), xs), - CubicLerp(ValCoord3DFast(offset, x0, y1, z2), ValCoord3DFast(offset, x1, y1, z2), ValCoord3DFast(offset, x2, y1, z2), ValCoord3DFast(offset, x3, y1, z2), xs), - CubicLerp(ValCoord3DFast(offset, x0, y2, z2), ValCoord3DFast(offset, x1, y2, z2), ValCoord3DFast(offset, x2, y2, z2), ValCoord3DFast(offset, x3, y2, z2), xs), - CubicLerp(ValCoord3DFast(offset, x0, y3, z2), ValCoord3DFast(offset, x1, y3, z2), ValCoord3DFast(offset, x2, y3, z2), ValCoord3DFast(offset, x3, y3, z2), xs), - ys), - CubicLerp( - CubicLerp(ValCoord3DFast(offset, x0, y0, z3), ValCoord3DFast(offset, x1, y0, z3), ValCoord3DFast(offset, x2, y0, z3), ValCoord3DFast(offset, x3, y0, z3), xs), - CubicLerp(ValCoord3DFast(offset, x0, y1, z3), ValCoord3DFast(offset, x1, y1, z3), ValCoord3DFast(offset, x2, y1, z3), ValCoord3DFast(offset, x3, y1, z3), xs), - CubicLerp(ValCoord3DFast(offset, x0, y2, z3), ValCoord3DFast(offset, x1, y2, z3), ValCoord3DFast(offset, x2, y2, z3), ValCoord3DFast(offset, x3, y2, z3), xs), - CubicLerp(ValCoord3DFast(offset, x0, y3, z3), ValCoord3DFast(offset, x1, y3, z3), ValCoord3DFast(offset, x2, y3, z3), ValCoord3DFast(offset, x3, y3, z3), xs), - ys), - zs) * CUBIC_3D_BOUNDING; + CubicLerp( + CubicLerp(ValCoord3DFast(offset, x0, y0, z0), ValCoord3DFast(offset, x1, y0, z0), ValCoord3DFast(offset, x2, y0, z0), ValCoord3DFast(offset, x3, y0, z0), xs), + CubicLerp(ValCoord3DFast(offset, x0, y1, z0), ValCoord3DFast(offset, x1, y1, z0), ValCoord3DFast(offset, x2, y1, z0), ValCoord3DFast(offset, x3, y1, z0), xs), + CubicLerp(ValCoord3DFast(offset, x0, y2, z0), ValCoord3DFast(offset, x1, y2, z0), ValCoord3DFast(offset, x2, y2, z0), ValCoord3DFast(offset, x3, y2, z0), xs), + CubicLerp(ValCoord3DFast(offset, x0, y3, z0), ValCoord3DFast(offset, x1, y3, z0), ValCoord3DFast(offset, x2, y3, z0), ValCoord3DFast(offset, x3, y3, z0), xs), + ys), + CubicLerp( + CubicLerp(ValCoord3DFast(offset, x0, y0, z1), ValCoord3DFast(offset, x1, y0, z1), ValCoord3DFast(offset, x2, y0, z1), ValCoord3DFast(offset, x3, y0, z1), xs), + CubicLerp(ValCoord3DFast(offset, x0, y1, z1), ValCoord3DFast(offset, x1, y1, z1), ValCoord3DFast(offset, x2, y1, z1), ValCoord3DFast(offset, x3, y1, z1), xs), + CubicLerp(ValCoord3DFast(offset, x0, y2, z1), ValCoord3DFast(offset, x1, y2, z1), ValCoord3DFast(offset, x2, y2, z1), ValCoord3DFast(offset, x3, y2, z1), xs), + CubicLerp(ValCoord3DFast(offset, x0, y3, z1), ValCoord3DFast(offset, x1, y3, z1), ValCoord3DFast(offset, x2, y3, z1), ValCoord3DFast(offset, x3, y3, z1), xs), + ys), + CubicLerp( + CubicLerp(ValCoord3DFast(offset, x0, y0, z2), ValCoord3DFast(offset, x1, y0, z2), ValCoord3DFast(offset, x2, y0, z2), ValCoord3DFast(offset, x3, y0, z2), xs), + CubicLerp(ValCoord3DFast(offset, x0, y1, z2), ValCoord3DFast(offset, x1, y1, z2), ValCoord3DFast(offset, x2, y1, z2), ValCoord3DFast(offset, x3, y1, z2), xs), + CubicLerp(ValCoord3DFast(offset, x0, y2, z2), ValCoord3DFast(offset, x1, y2, z2), ValCoord3DFast(offset, x2, y2, z2), ValCoord3DFast(offset, x3, y2, z2), xs), + CubicLerp(ValCoord3DFast(offset, x0, y3, z2), ValCoord3DFast(offset, x1, y3, z2), ValCoord3DFast(offset, x2, y3, z2), ValCoord3DFast(offset, x3, y3, z2), xs), + ys), + CubicLerp( + CubicLerp(ValCoord3DFast(offset, x0, y0, z3), ValCoord3DFast(offset, x1, y0, z3), ValCoord3DFast(offset, x2, y0, z3), ValCoord3DFast(offset, x3, y0, z3), xs), + CubicLerp(ValCoord3DFast(offset, x0, y1, z3), ValCoord3DFast(offset, x1, y1, z3), ValCoord3DFast(offset, x2, y1, z3), ValCoord3DFast(offset, x3, y1, z3), xs), + CubicLerp(ValCoord3DFast(offset, x0, y2, z3), ValCoord3DFast(offset, x1, y2, z3), ValCoord3DFast(offset, x2, y2, z3), ValCoord3DFast(offset, x3, y2, z3), xs), + CubicLerp(ValCoord3DFast(offset, x0, y3, z3), ValCoord3DFast(offset, x1, y3, z3), ValCoord3DFast(offset, x2, y3, z3), ValCoord3DFast(offset, x3, y3, z3), xs), + ys), + zs) * + CUBIC_3D_BOUNDING; } - -FN_DECIMAL FastNoise::GetCubicFractal(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::GetCubicFractal(FN_DECIMAL x, FN_DECIMAL y) const { x *= m_frequency; y *= m_frequency; - switch (m_fractalType) - { - case FBM: - return SingleCubicFractalFBM(x, y); - case Billow: - return SingleCubicFractalBillow(x, y); - case RigidMulti: - return SingleCubicFractalRigidMulti(x, y); - default: - return 0; + switch (m_fractalType) { + case FBM: + return SingleCubicFractalFBM(x, y); + case Billow: + return SingleCubicFractalBillow(x, y); + case RigidMulti: + return SingleCubicFractalRigidMulti(x, y); + default: + return 0; } } -FN_DECIMAL FastNoise::SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = SingleCubic(m_perm[0], x, y); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -1636,14 +2970,12 @@ FN_DECIMAL FastNoise::SingleCubicFractalFBM(FN_DECIMAL x, FN_DECIMAL y) const return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = FastAbs(SingleCubic(m_perm[0], x, y)) * 2 - 1; FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -1654,14 +2986,12 @@ FN_DECIMAL FastNoise::SingleCubicFractalBillow(FN_DECIMAL x, FN_DECIMAL y) const return sum * m_fractalBounding; } -FN_DECIMAL FastNoise::SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) const { FN_DECIMAL sum = 1 - FastAbs(SingleCubic(m_perm[0], x, y)); FN_DECIMAL amp = 1; int i = 0; - while (++i < m_octaves) - { + while (++i < m_octaves) { x *= m_lacunarity; y *= m_lacunarity; @@ -1672,8 +3002,7 @@ FN_DECIMAL FastNoise::SingleCubicFractalRigidMulti(FN_DECIMAL x, FN_DECIMAL y) c return sum; } -FN_DECIMAL FastNoise::GetCubic(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::GetCubic(FN_DECIMAL x, FN_DECIMAL y) const { x *= m_frequency; y *= m_frequency; @@ -1682,8 +3011,7 @@ FN_DECIMAL FastNoise::GetCubic(FN_DECIMAL x, FN_DECIMAL y) const const FN_DECIMAL CUBIC_2D_BOUNDING = 1 / (FN_DECIMAL(1.5) * FN_DECIMAL(1.5)); -FN_DECIMAL FastNoise::SingleCubic(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleCubic(unsigned char offset, FN_DECIMAL x, FN_DECIMAL y) const { int x1 = FastFloor(x); int y1 = FastFloor(y); @@ -1698,33 +3026,31 @@ FN_DECIMAL FastNoise::SingleCubic(unsigned char offset, FN_DECIMAL x, FN_DECIMAL FN_DECIMAL ys = y - (FN_DECIMAL)y1; return CubicLerp( - CubicLerp(ValCoord2DFast(offset, x0, y0), ValCoord2DFast(offset, x1, y0), ValCoord2DFast(offset, x2, y0), ValCoord2DFast(offset, x3, y0), xs), - CubicLerp(ValCoord2DFast(offset, x0, y1), ValCoord2DFast(offset, x1, y1), ValCoord2DFast(offset, x2, y1), ValCoord2DFast(offset, x3, y1), xs), - CubicLerp(ValCoord2DFast(offset, x0, y2), ValCoord2DFast(offset, x1, y2), ValCoord2DFast(offset, x2, y2), ValCoord2DFast(offset, x3, y2), xs), - CubicLerp(ValCoord2DFast(offset, x0, y3), ValCoord2DFast(offset, x1, y3), ValCoord2DFast(offset, x2, y3), ValCoord2DFast(offset, x3, y3), xs), - ys) * CUBIC_2D_BOUNDING; + CubicLerp(ValCoord2DFast(offset, x0, y0), ValCoord2DFast(offset, x1, y0), ValCoord2DFast(offset, x2, y0), ValCoord2DFast(offset, x3, y0), xs), + CubicLerp(ValCoord2DFast(offset, x0, y1), ValCoord2DFast(offset, x1, y1), ValCoord2DFast(offset, x2, y1), ValCoord2DFast(offset, x3, y1), xs), + CubicLerp(ValCoord2DFast(offset, x0, y2), ValCoord2DFast(offset, x1, y2), ValCoord2DFast(offset, x2, y2), ValCoord2DFast(offset, x3, y2), xs), + CubicLerp(ValCoord2DFast(offset, x0, y3), ValCoord2DFast(offset, x1, y3), ValCoord2DFast(offset, x2, y3), ValCoord2DFast(offset, x3, y3), xs), + ys) * + CUBIC_2D_BOUNDING; } // Cellular Noise -FN_DECIMAL FastNoise::GetCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::GetCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { x *= m_frequency; y *= m_frequency; z *= m_frequency; - switch (m_cellularReturnType) - { - case CellValue: - case NoiseLookup: - case Distance: - return SingleCellular(x, y, z); - default: - return SingleCellular2Edge(x, y, z); + switch (m_cellularReturnType) { + case CellValue: + case NoiseLookup: + case Distance: + return SingleCellular(x, y, z); + default: + return SingleCellular2Edge(x, y, z); } } -FN_DECIMAL FastNoise::SingleCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { int xr = FastRound(x); int yr = FastRound(y); int zr = FastRound(z); @@ -1734,224 +3060,195 @@ FN_DECIMAL FastNoise::SingleCellular(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) c int yc = 0; int zc = 0; - switch (m_cellularDistanceFunction) - { - case Euclidean: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - for (int zi = zr - 1; zi <= zr + 1; zi++) - { - unsigned char lutPos = Index3D_256(0, xi, yi, zi); + switch (m_cellularDistanceFunction) { + case Euclidean: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + for (int zi = zr - 1; zi <= zr + 1; zi++) { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); - FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; + FN_DECIMAL newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; - if (newDistance < distance) - { - distance = newDistance; - xc = xi; - yc = yi; - zc = zi; + if (newDistance < distance) { + distance = newDistance; + xc = xi; + yc = yi; + zc = zi; + } } } } - } - break; - case Manhattan: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - for (int zi = zr - 1; zi <= zr + 1; zi++) - { - unsigned char lutPos = Index3D_256(0, xi, yi, zi); + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + for (int zi = zr - 1; zi <= zr + 1; zi++) { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); - FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); + FN_DECIMAL newDistance = FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); - if (newDistance < distance) - { - distance = newDistance; - xc = xi; - yc = yi; - zc = zi; + if (newDistance < distance) { + distance = newDistance; + xc = xi; + yc = yi; + zc = zi; + } } } } - } - break; - case Natural: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - for (int zi = zr - 1; zi <= zr + 1; zi++) - { - unsigned char lutPos = Index3D_256(0, xi, yi, zi); + break; + case Natural: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + for (int zi = zr - 1; zi <= zr + 1; zi++) { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); - FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ)) + (vecX * vecX + vecY * vecY + vecZ * vecZ); + FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ)) + (vecX * vecX + vecY * vecY + vecZ * vecZ); - if (newDistance < distance) - { - distance = newDistance; - xc = xi; - yc = yi; - zc = zi; + if (newDistance < distance) { + distance = newDistance; + xc = xi; + yc = yi; + zc = zi; + } } } } - } - break; - default: - break; + break; + default: + break; } unsigned char lutPos; - switch (m_cellularReturnType) - { - case CellValue: - return ValCoord3D(m_seed, xc, yc, zc); + switch (m_cellularReturnType) { + case CellValue: + return ValCoord3D(m_seed, xc, yc, zc); - case NoiseLookup: - assert(m_cellularNoiseLookup); + case NoiseLookup: + assert(m_cellularNoiseLookup); - lutPos = Index3D_256(0, xc, yc, zc); - return m_cellularNoiseLookup->GetNoise(xc + CELL_3D_X[lutPos] * m_cellularJitter, yc + CELL_3D_Y[lutPos] * m_cellularJitter, zc + CELL_3D_Z[lutPos] * m_cellularJitter); + lutPos = Index3D_256(0, xc, yc, zc); + return m_cellularNoiseLookup->GetNoise(xc + CELL_3D_X[lutPos] * m_cellularJitter, yc + CELL_3D_Y[lutPos] * m_cellularJitter, zc + CELL_3D_Z[lutPos] * m_cellularJitter); - case Distance: - return distance; - default: - return 0; + case Distance: + return distance; + default: + return 0; } } -FN_DECIMAL FastNoise::SingleCellular2Edge(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const -{ +FN_DECIMAL FastNoise::SingleCellular2Edge(FN_DECIMAL x, FN_DECIMAL y, FN_DECIMAL z) const { int xr = FastRound(x); int yr = FastRound(y); int zr = FastRound(z); - FN_DECIMAL distance[FN_CELLULAR_INDEX_MAX+1] = { 999999,999999,999999,999999 }; + FN_DECIMAL distance[FN_CELLULAR_INDEX_MAX + 1] = { 999999, 999999, 999999, 999999 }; - switch (m_cellularDistanceFunction) - { - case Euclidean: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - for (int zi = zr - 1; zi <= zr + 1; zi++) - { - unsigned char lutPos = Index3D_256(0, xi, yi, zi); + switch (m_cellularDistanceFunction) { + case Euclidean: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + for (int zi = zr - 1; zi <= zr + 1; zi++) { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); - FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; + FN_DECIMAL newDistance = vecX * vecX + vecY * vecY + vecZ * vecZ; - for (int i = m_cellularDistanceIndex1; i > 0; i--) - distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); - distance[0] = fmin(distance[0], newDistance); + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } } } - } - break; - case Manhattan: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - for (int zi = zr - 1; zi <= zr + 1; zi++) - { - unsigned char lutPos = Index3D_256(0, xi, yi, zi); + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + for (int zi = zr - 1; zi <= zr + 1; zi++) { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); - FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); + FN_DECIMAL newDistance = FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ); - for (int i = m_cellularDistanceIndex1; i > 0; i--) - distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); - distance[0] = fmin(distance[0], newDistance); + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } } } - } - break; - case Natural: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - for (int zi = zr - 1; zi <= zr + 1; zi++) - { - unsigned char lutPos = Index3D_256(0, xi, yi, zi); + break; + case Natural: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + for (int zi = zr - 1; zi <= zr + 1; zi++) { + unsigned char lutPos = Index3D_256(0, xi, yi, zi); - FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_3D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_3D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecZ = zi - z + CELL_3D_Z[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ)) + (vecX * vecX + vecY * vecY + vecZ * vecZ); + FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY) + FastAbs(vecZ)) + (vecX * vecX + vecY * vecY + vecZ * vecZ); - for (int i = m_cellularDistanceIndex1; i > 0; i--) - distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); - distance[0] = fmin(distance[0], newDistance); + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } } } - } - break; - default: - break; + break; + default: + break; } - switch (m_cellularReturnType) - { - case Distance2: - return distance[m_cellularDistanceIndex1]; - case Distance2Add: - return distance[m_cellularDistanceIndex1] + distance[m_cellularDistanceIndex0]; - case Distance2Sub: - return distance[m_cellularDistanceIndex1] - distance[m_cellularDistanceIndex0]; - case Distance2Mul: - return distance[m_cellularDistanceIndex1] * distance[m_cellularDistanceIndex0]; - case Distance2Div: - return distance[m_cellularDistanceIndex0] / distance[m_cellularDistanceIndex1]; - default: - return 0; + switch (m_cellularReturnType) { + case Distance2: + return distance[m_cellularDistanceIndex1]; + case Distance2Add: + return distance[m_cellularDistanceIndex1] + distance[m_cellularDistanceIndex0]; + case Distance2Sub: + return distance[m_cellularDistanceIndex1] - distance[m_cellularDistanceIndex0]; + case Distance2Mul: + return distance[m_cellularDistanceIndex1] * distance[m_cellularDistanceIndex0]; + case Distance2Div: + return distance[m_cellularDistanceIndex0] / distance[m_cellularDistanceIndex1]; + default: + return 0; } } -FN_DECIMAL FastNoise::GetCellular(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::GetCellular(FN_DECIMAL x, FN_DECIMAL y) const { x *= m_frequency; y *= m_frequency; - switch (m_cellularReturnType) - { - case CellValue: - case NoiseLookup: - case Distance: - return SingleCellular(x, y); - default: - return SingleCellular2Edge(x, y); + switch (m_cellularReturnType) { + case CellValue: + case NoiseLookup: + case Distance: + return SingleCellular(x, y); + default: + return SingleCellular2Edge(x, y); } } -FN_DECIMAL FastNoise::SingleCellular(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleCellular(FN_DECIMAL x, FN_DECIMAL y) const { int xr = FastRound(x); int yr = FastRound(y); @@ -1959,199 +3256,175 @@ FN_DECIMAL FastNoise::SingleCellular(FN_DECIMAL x, FN_DECIMAL y) const int xc = 0; int yc = 0; - switch (m_cellularDistanceFunction) - { - default: - case Euclidean: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - unsigned char lutPos = Index2D_256(0, xi, yi); + switch (m_cellularDistanceFunction) { + default: + case Euclidean: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + unsigned char lutPos = Index2D_256(0, xi, yi); - FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = vecX * vecX + vecY * vecY; + FN_DECIMAL newDistance = vecX * vecX + vecY * vecY; - if (newDistance < distance) - { - distance = newDistance; - xc = xi; - yc = yi; + if (newDistance < distance) { + distance = newDistance; + xc = xi; + yc = yi; + } } } - } - break; - case Manhattan: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - unsigned char lutPos = Index2D_256(0, xi, yi); + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + unsigned char lutPos = Index2D_256(0, xi, yi); - FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY)); + FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY)); - if (newDistance < distance) - { - distance = newDistance; - xc = xi; - yc = yi; + if (newDistance < distance) { + distance = newDistance; + xc = xi; + yc = yi; + } } } - } - break; - case Natural: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - unsigned char lutPos = Index2D_256(0, xi, yi); + break; + case Natural: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + unsigned char lutPos = Index2D_256(0, xi, yi); - FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY)) + (vecX * vecX + vecY * vecY); + FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY)) + (vecX * vecX + vecY * vecY); - if (newDistance < distance) - { - distance = newDistance; - xc = xi; - yc = yi; + if (newDistance < distance) { + distance = newDistance; + xc = xi; + yc = yi; + } } } - } - break; + break; } unsigned char lutPos; - switch (m_cellularReturnType) - { - case CellValue: - return ValCoord2D(m_seed, xc, yc); + switch (m_cellularReturnType) { + case CellValue: + return ValCoord2D(m_seed, xc, yc); - case NoiseLookup: - assert(m_cellularNoiseLookup); + case NoiseLookup: + assert(m_cellularNoiseLookup); - lutPos = Index2D_256(0, xc, yc); - return m_cellularNoiseLookup->GetNoise(xc + CELL_2D_X[lutPos] * m_cellularJitter, yc + CELL_2D_Y[lutPos] * m_cellularJitter); + lutPos = Index2D_256(0, xc, yc); + return m_cellularNoiseLookup->GetNoise(xc + CELL_2D_X[lutPos] * m_cellularJitter, yc + CELL_2D_Y[lutPos] * m_cellularJitter); - case Distance: - return distance; - default: - return 0; + case Distance: + return distance; + default: + return 0; } } -FN_DECIMAL FastNoise::SingleCellular2Edge(FN_DECIMAL x, FN_DECIMAL y) const -{ +FN_DECIMAL FastNoise::SingleCellular2Edge(FN_DECIMAL x, FN_DECIMAL y) const { int xr = FastRound(x); int yr = FastRound(y); - FN_DECIMAL distance[FN_CELLULAR_INDEX_MAX + 1] = { 999999,999999,999999,999999 }; + FN_DECIMAL distance[FN_CELLULAR_INDEX_MAX + 1] = { 999999, 999999, 999999, 999999 }; - switch (m_cellularDistanceFunction) - { - default: - case Euclidean: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - unsigned char lutPos = Index2D_256(0, xi, yi); + switch (m_cellularDistanceFunction) { + default: + case Euclidean: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + unsigned char lutPos = Index2D_256(0, xi, yi); - FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = vecX * vecX + vecY * vecY; + FN_DECIMAL newDistance = vecX * vecX + vecY * vecY; - for (int i = m_cellularDistanceIndex1; i > 0; i--) - distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); - distance[0] = fmin(distance[0], newDistance); + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } } - } - break; - case Manhattan: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - unsigned char lutPos = Index2D_256(0, xi, yi); + break; + case Manhattan: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + unsigned char lutPos = Index2D_256(0, xi, yi); - FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = FastAbs(vecX) + FastAbs(vecY); + FN_DECIMAL newDistance = FastAbs(vecX) + FastAbs(vecY); - for (int i = m_cellularDistanceIndex1; i > 0; i--) - distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); - distance[0] = fmin(distance[0], newDistance); + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } } - } - break; - case Natural: - for (int xi = xr - 1; xi <= xr + 1; xi++) - { - for (int yi = yr - 1; yi <= yr + 1; yi++) - { - unsigned char lutPos = Index2D_256(0, xi, yi); + break; + case Natural: + for (int xi = xr - 1; xi <= xr + 1; xi++) { + for (int yi = yr - 1; yi <= yr + 1; yi++) { + unsigned char lutPos = Index2D_256(0, xi, yi); - FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; - FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; + FN_DECIMAL vecX = xi - x + CELL_2D_X[lutPos] * m_cellularJitter; + FN_DECIMAL vecY = yi - y + CELL_2D_Y[lutPos] * m_cellularJitter; - FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY)) + (vecX * vecX + vecY * vecY); + FN_DECIMAL newDistance = (FastAbs(vecX) + FastAbs(vecY)) + (vecX * vecX + vecY * vecY); - for (int i = m_cellularDistanceIndex1; i > 0; i--) - distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); - distance[0] = fmin(distance[0], newDistance); + for (int i = m_cellularDistanceIndex1; i > 0; i--) + distance[i] = fmax(fmin(distance[i], newDistance), distance[i - 1]); + distance[0] = fmin(distance[0], newDistance); + } } - } - break; + break; } - switch (m_cellularReturnType) - { - case Distance2: - return distance[m_cellularDistanceIndex1]; - case Distance2Add: - return distance[m_cellularDistanceIndex1] + distance[m_cellularDistanceIndex0]; - case Distance2Sub: - return distance[m_cellularDistanceIndex1] - distance[m_cellularDistanceIndex0]; - case Distance2Mul: - return distance[m_cellularDistanceIndex1] * distance[m_cellularDistanceIndex0]; - case Distance2Div: - return distance[m_cellularDistanceIndex0] / distance[m_cellularDistanceIndex1]; - default: - return 0; + switch (m_cellularReturnType) { + case Distance2: + return distance[m_cellularDistanceIndex1]; + case Distance2Add: + return distance[m_cellularDistanceIndex1] + distance[m_cellularDistanceIndex0]; + case Distance2Sub: + return distance[m_cellularDistanceIndex1] - distance[m_cellularDistanceIndex0]; + case Distance2Mul: + return distance[m_cellularDistanceIndex1] * distance[m_cellularDistanceIndex0]; + case Distance2Div: + return distance[m_cellularDistanceIndex0] / distance[m_cellularDistanceIndex1]; + default: + return 0; } } -void FastNoise::GradientPerturb(FN_DECIMAL& x, FN_DECIMAL& y, FN_DECIMAL& z) const -{ +void FastNoise::GradientPerturb(FN_DECIMAL &x, FN_DECIMAL &y, FN_DECIMAL &z) const { SingleGradientPerturb(0, m_gradientPerturbAmp, m_frequency, x, y, z); } -void FastNoise::GradientPerturbFractal(FN_DECIMAL& x, FN_DECIMAL& y, FN_DECIMAL& z) const -{ +void FastNoise::GradientPerturbFractal(FN_DECIMAL &x, FN_DECIMAL &y, FN_DECIMAL &z) const { FN_DECIMAL amp = m_gradientPerturbAmp * m_fractalBounding; FN_DECIMAL freq = m_frequency; int i = 0; SingleGradientPerturb(m_perm[0], amp, m_frequency, x, y, z); - while (++i < m_octaves) - { + while (++i < m_octaves) { freq *= m_lacunarity; amp *= m_gain; SingleGradientPerturb(m_perm[i], amp, freq, x, y, z); } } -void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, FN_DECIMAL frequency, FN_DECIMAL& x, FN_DECIMAL& y, FN_DECIMAL& z) const -{ +void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, FN_DECIMAL frequency, FN_DECIMAL &x, FN_DECIMAL &y, FN_DECIMAL &z) const { FN_DECIMAL xf = x * frequency; FN_DECIMAL yf = y * frequency; FN_DECIMAL zf = z * frequency; @@ -2164,24 +3437,23 @@ void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, int z1 = z0 + 1; FN_DECIMAL xs, ys, zs; - switch (m_interp) - { - default: - case Linear: - xs = xf - (FN_DECIMAL)x0; - ys = yf - (FN_DECIMAL)y0; - zs = zf - (FN_DECIMAL)z0; - break; - case Hermite: - xs = InterpHermiteFunc(xf - (FN_DECIMAL)x0); - ys = InterpHermiteFunc(yf - (FN_DECIMAL)y0); - zs = InterpHermiteFunc(zf - (FN_DECIMAL)z0); - break; - case Quintic: - xs = InterpQuinticFunc(xf - (FN_DECIMAL)x0); - ys = InterpQuinticFunc(yf - (FN_DECIMAL)y0); - zs = InterpQuinticFunc(zf - (FN_DECIMAL)z0); - break; + switch (m_interp) { + default: + case Linear: + xs = xf - (FN_DECIMAL)x0; + ys = yf - (FN_DECIMAL)y0; + zs = zf - (FN_DECIMAL)z0; + break; + case Hermite: + xs = InterpHermiteFunc(xf - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(yf - (FN_DECIMAL)y0); + zs = InterpHermiteFunc(zf - (FN_DECIMAL)z0); + break; + case Quintic: + xs = InterpQuinticFunc(xf - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(yf - (FN_DECIMAL)y0); + zs = InterpQuinticFunc(zf - (FN_DECIMAL)z0); + break; } int lutPos0 = Index3D_256(offset, x0, y0, z0); @@ -2221,29 +3493,25 @@ void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, z += Lerp(lz0y, Lerp(lz0x, lz1x, ys), zs) * warpAmp; } -void FastNoise::GradientPerturb(FN_DECIMAL& x, FN_DECIMAL& y) const -{ +void FastNoise::GradientPerturb(FN_DECIMAL &x, FN_DECIMAL &y) const { SingleGradientPerturb(0, m_gradientPerturbAmp, m_frequency, x, y); } -void FastNoise::GradientPerturbFractal(FN_DECIMAL& x, FN_DECIMAL& y) const -{ +void FastNoise::GradientPerturbFractal(FN_DECIMAL &x, FN_DECIMAL &y) const { FN_DECIMAL amp = m_gradientPerturbAmp * m_fractalBounding; FN_DECIMAL freq = m_frequency; int i = 0; SingleGradientPerturb(m_perm[0], amp, m_frequency, x, y); - while (++i < m_octaves) - { + while (++i < m_octaves) { freq *= m_lacunarity; amp *= m_gain; SingleGradientPerturb(m_perm[i], amp, freq, x, y); } } -void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, FN_DECIMAL frequency, FN_DECIMAL& x, FN_DECIMAL& y) const -{ +void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, FN_DECIMAL frequency, FN_DECIMAL &x, FN_DECIMAL &y) const { FN_DECIMAL xf = x * frequency; FN_DECIMAL yf = y * frequency; @@ -2253,21 +3521,20 @@ void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, int y1 = y0 + 1; FN_DECIMAL xs, ys; - switch (m_interp) - { - default: - case Linear: - xs = xf - (FN_DECIMAL)x0; - ys = yf - (FN_DECIMAL)y0; - break; - case Hermite: - xs = InterpHermiteFunc(xf - (FN_DECIMAL)x0); - ys = InterpHermiteFunc(yf - (FN_DECIMAL)y0); - break; - case Quintic: - xs = InterpQuinticFunc(xf - (FN_DECIMAL)x0); - ys = InterpQuinticFunc(yf - (FN_DECIMAL)y0); - break; + switch (m_interp) { + default: + case Linear: + xs = xf - (FN_DECIMAL)x0; + ys = yf - (FN_DECIMAL)y0; + break; + case Hermite: + xs = InterpHermiteFunc(xf - (FN_DECIMAL)x0); + ys = InterpHermiteFunc(yf - (FN_DECIMAL)y0); + break; + case Quintic: + xs = InterpQuinticFunc(xf - (FN_DECIMAL)x0); + ys = InterpQuinticFunc(yf - (FN_DECIMAL)y0); + break; } int lutPos0 = Index2D_256(offset, x0, y0); @@ -2287,10 +3554,3 @@ void FastNoise::SingleGradientPerturb(unsigned char offset, FN_DECIMAL warpAmp, } } // namespace fastnoise - - - -#if VERSION_MAJOR >= 4 - -#pragma GCC diagnostic pop -#endif diff --git a/modules/fastnoise/noise.h b/modules/fastnoise/noise.h index c712a53d7..9007794f0 100644 --- a/modules/fastnoise/noise.h +++ b/modules/fastnoise/noise.h @@ -1,25 +1,12 @@ #ifndef FASTNOISE_NOISE_H #define FASTNOISE_NOISE_H -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" -#include "core/string/ustring.h" -#else #include "core/reference.h" #include "core/ustring.h" -#endif #include "lib/FastNoise.h" -#include "core/version.h" - -#if VERSION_MAJOR < 4 #include "core/pool_vector.h" -#else -typedef PackedInt64Array PoolIntArray; -#endif typedef fastnoise::FastNoise _FastNoise; @@ -33,9 +20,9 @@ public: static const String BINDING_STRING_CELLULAR_DISTANCE_FUNCTION; static const String BINDING_STRING_CELLULAR_RETURN_TYPE; - // Enums Godot-style (same values) + // Enums Godot-style (same values) - enum Type { + enum Type { TYPE_VALUE = _FastNoise::Value, TYPE_VALUE_FRACTAL = _FastNoise::ValueFractal, TYPE_PERLIN = _FastNoise::Perlin, @@ -46,45 +33,45 @@ public: TYPE_WHITE_NOISE = _FastNoise::WhiteNoise, TYPE_CUBIC = _FastNoise::Cubic, TYPE_CUBIC_FRACTAL = _FastNoise::CubicFractal - }; + }; - enum Interpolation { + enum Interpolation { INTERP_LINEAR = _FastNoise::Linear, INTERP_QUINTIC = _FastNoise::Quintic, INTERP_HERMITE = _FastNoise::Hermite - }; + }; - enum FractalType { - FRACTAL_FBM = _FastNoise::FBM, - FRACTAL_BILLOW = _FastNoise::Billow, - FRACTAL_RIGID_MULTI = _FastNoise::RigidMulti - }; + enum FractalType { + FRACTAL_FBM = _FastNoise::FBM, + FRACTAL_BILLOW = _FastNoise::Billow, + FRACTAL_RIGID_MULTI = _FastNoise::RigidMulti + }; - enum CellularDistanceFunction { - DISTANCE_EUCLIDEAN = _FastNoise::Euclidean, - DISTANCE_MANHATTAN = _FastNoise::Manhattan, - DISTANCE_NATURAL = _FastNoise::Natural - }; + enum CellularDistanceFunction { + DISTANCE_EUCLIDEAN = _FastNoise::Euclidean, + DISTANCE_MANHATTAN = _FastNoise::Manhattan, + DISTANCE_NATURAL = _FastNoise::Natural + }; - enum CellularReturnType { - RETURN_CELL_VALUE = _FastNoise::CellValue, - RETURN_NOISE_LOOKUP = _FastNoise::NoiseLookup, + enum CellularReturnType { + RETURN_CELL_VALUE = _FastNoise::CellValue, + RETURN_NOISE_LOOKUP = _FastNoise::NoiseLookup, RETURN_DISTANCE = _FastNoise::Distance, RETURN_DISTANCE_2 = _FastNoise::Distance2, RETURN_DISTANCE_2_ADD = _FastNoise::Distance2Add, RETURN_DISTANCE_2_SUB = _FastNoise::Distance2Sub, RETURN_DISTANCE_2_MUL = _FastNoise::Distance2Mul, RETURN_DISTANCE_2_DIV = _FastNoise::Distance2Div - }; + }; - FastNoise(); + FastNoise(); - // Methods (Godot-style mappings to FastNoise) + // Methods (Godot-style mappings to FastNoise) int get_seed() const { return _noise.GetSeed(); } - void set_seed(int seed) { _noise.SetSeed(seed); } + void set_seed(int seed) { _noise.SetSeed(seed); } - void set_noise_type(Type noise_type) { _noise.SetNoiseType((_FastNoise::NoiseType)noise_type); } + void set_noise_type(Type noise_type) { _noise.SetNoiseType((_FastNoise::NoiseType)noise_type); } Type get_noise_type() const { return (Type)_noise.GetNoiseType(); } void set_interpolation(Interpolation interp) { _noise.SetInterp((_FastNoise::Interp)interp); } @@ -111,7 +98,7 @@ public: void set_cellular_return_type(CellularReturnType ret) { _noise.SetCellularReturnType((_FastNoise::CellularReturnType)ret); } CellularReturnType get_cellular_return_type() const { return (CellularReturnType)_noise.GetCellularReturnType(); } - void set_cellular_noise_lookup(Ref other_noise); + void set_cellular_noise_lookup(Ref other_noise); Ref get_cellular_noise_lookup() const { return _cellular_lookup_ref; } void set_cellular_distance_2_indices(int index0, int index1); @@ -123,46 +110,44 @@ public: void set_gradient_perturbation_amplitude(real_t amp) { _noise.SetGradientPerturbAmp(amp); } real_t get_gradient_perturbation_amplitude() const { return _noise.GetGradientPerturbAmp(); } - // 2D + // 2D - float get_noise_2d(float x, float y) { return _noise.GetNoise(x, y); } + float get_noise_2d(float x, float y) { return _noise.GetNoise(x, y); } - //float get_gradient_2d(float x, float y) { return _noise.GetGradient(x, y); } - //float get_simplex_2d(float x, float y) { return _noise.GetSimplex(x, y); } - //float get_cellular_2d(float x, float y) { return _noise.GetCellular(x, y); } - //float get_cellular_hq_2d(float x, float y) { return _noise.GetCellularHQ(x, y); } - //float get_white_noise_2d(float x, float y) { return _noise.GetWhiteNoise(x, y); } - //float get_value_2d(float x, float y) { return _noise.GetValue(x, y); } + //float get_gradient_2d(float x, float y) { return _noise.GetGradient(x, y); } + //float get_simplex_2d(float x, float y) { return _noise.GetSimplex(x, y); } + //float get_cellular_2d(float x, float y) { return _noise.GetCellular(x, y); } + //float get_cellular_hq_2d(float x, float y) { return _noise.GetCellularHQ(x, y); } + //float get_white_noise_2d(float x, float y) { return _noise.GetWhiteNoise(x, y); } + //float get_value_2d(float x, float y) { return _noise.GetValue(x, y); } - // 3D + // 3D - float get_noise_3d(float x, float y, float z) { return _noise.GetNoise(x, y, z); } + float get_noise_3d(float x, float y, float z) { return _noise.GetNoise(x, y, z); } - //float get_gradient_3d(float x, float y, float z) { return _noise.GetGradient(x, y, z); } - //float get_simplex_3d(float x, float y, float z) { return _noise.GetSimplex(x, y, z); } - //float get_cellular_3d(float x, float y, float z) { return _noise.GetCellular(x, y, z); } - //float get_cellular_hq_3d(float x, float y, float z) { return _noise.GetCellularHQ(x, y, z); } - //float get_white_noise_3d(float x, float y, float z) { return _noise.GetWhiteNoise(x, y, z); } - //float get_value_2d(float x, float y, float z) { return _noise.GetValue(x, y, z); } + //float get_gradient_3d(float x, float y, float z) { return _noise.GetGradient(x, y, z); } + //float get_simplex_3d(float x, float y, float z) { return _noise.GetSimplex(x, y, z); } + //float get_cellular_3d(float x, float y, float z) { return _noise.GetCellular(x, y, z); } + //float get_cellular_hq_3d(float x, float y, float z) { return _noise.GetCellularHQ(x, y, z); } + //float get_white_noise_3d(float x, float y, float z) { return _noise.GetWhiteNoise(x, y, z); } + //float get_value_2d(float x, float y, float z) { return _noise.GetValue(x, y, z); } - // 4D + // 4D - float get_simplex_4d(float x, float y, float z, float w) { return _noise.GetSimplex(x, y, z, w); } - float get_white_noise_4d(float x, float y, float z, float w) { return _noise.GetWhiteNoise(x, y, z, w); } + float get_simplex_4d(float x, float y, float z, float w) { return _noise.GetSimplex(x, y, z, w); } + float get_white_noise_4d(float x, float y, float z, float w) { return _noise.GetWhiteNoise(x, y, z, w); } - // Convenience - - float get_noise_2dv(Vector2 pos) { return _noise.GetNoise(pos.x, pos.y); } - float get_noise_3dv(Vector3 pos) { return _noise.GetNoise(pos.x, pos.y, pos.z); } + // Convenience + float get_noise_2dv(Vector2 pos) { return _noise.GetNoise(pos.x, pos.y); } + float get_noise_3dv(Vector3 pos) { return _noise.GetNoise(pos.x, pos.y, pos.z); } protected: - static void _bind_methods(); + static void _bind_methods(); private: - _FastNoise _noise; - Ref _cellular_lookup_ref; - + _FastNoise _noise; + Ref _cellular_lookup_ref; }; // Make Variant happy with custom enums @@ -172,6 +157,4 @@ VARIANT_ENUM_CAST(FastNoise::Interpolation) VARIANT_ENUM_CAST(FastNoise::CellularDistanceFunction) VARIANT_ENUM_CAST(FastNoise::CellularReturnType) - #endif // FASTNOISE_NOISE_H - diff --git a/modules/fastnoise/register_types.cpp b/modules/fastnoise/register_types.cpp index f18f0f1c3..1bec936ea 100644 --- a/modules/fastnoise/register_types.cpp +++ b/modules/fastnoise/register_types.cpp @@ -2,25 +2,15 @@ #include "core/version.h" -#if VERSION_MAJOR < 4 #include "core/class_db.h" -#else -#include "core/object/class_db.h" -#endif -#include "noise.h" #include "fastnoise_noise_params.h" - +#include "noise.h" void register_fastnoise_types() { - ClassDB::register_class(); ClassDB::register_class(); } - void unregister_fastnoise_types() { - } - - diff --git a/modules/mesh_data_resource/mesh_data_resource.cpp b/modules/mesh_data_resource/mesh_data_resource.cpp index 6c372684c..6fe96e54b 100644 --- a/modules/mesh_data_resource/mesh_data_resource.cpp +++ b/modules/mesh_data_resource/mesh_data_resource.cpp @@ -22,16 +22,7 @@ SOFTWARE. #include "mesh_data_resource.h" -#include "core/version.h" - -#if VERSION_MAJOR >= 4 -#include "core/variant/variant.h" - -#define PoolVector Vector -#define POOL_INT_ARRAY PACKED_INT_ARRAY -#else #include "core/variant.h" -#endif const String MeshDataResource::BINDING_STRING_COLLIDER_TYPE = "None,Trimesh Collision Shape,Single Convex Collision Shape,Multiple Convex Collision Shapes,Approximated Box,Approximated Capsule,Approximated Cylinder,Approximated Sphere"; @@ -85,13 +76,8 @@ int MeshDataResource::get_collision_shape_count() const { Vector MeshDataResource::get_collision_shapes() { Vector r; for (int i = 0; i < _collision_shapes.size(); i++) { -#if VERSION_MAJOR < 4 r.push_back(_collision_shapes[i].transform); r.push_back(_collision_shapes[i].shape.get_ref_ptr()); -#else - r.push_back(_collision_shapes[i].transform); - r.push_back(_collision_shapes[i].shape); -#endif } return r; } @@ -296,12 +282,9 @@ void MeshDataResource::recompute_aabb() { if (vertices_2d.size() > 0) { AABB aabb; -#if VERSION_MAJOR < 4 PoolVector::Read r = vertices_2d.read(); const Vector2 *vtx = r.ptr(); -#else - const Vector2 *vtx = vertices.ptr(); -#endif + int len = vertices_2d.size(); aabb.position = Vector3(vtx[0].x, vtx[0].y, 0); @@ -320,12 +303,8 @@ void MeshDataResource::recompute_aabb() { return; } -#if VERSION_MAJOR < 4 PoolVector::Read r = vertices.read(); const Vector3 *vtx = r.ptr(); -#else - const Vector3 *vtx = vertices.ptr(); -#endif AABB aabb; for (int i = 0; i < len; i++) { diff --git a/modules/mesh_data_resource/mesh_data_resource.h b/modules/mesh_data_resource/mesh_data_resource.h index 65a230596..2abadffc2 100644 --- a/modules/mesh_data_resource/mesh_data_resource.h +++ b/modules/mesh_data_resource/mesh_data_resource.h @@ -22,39 +22,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - - -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#include "core/variant/array.h" -#include "core/variant/variant.h" - -#include "core/math/transform_3d.h" -typedef class Transform3D Transform; - -#define PoolIntArray PackedInt64Array - -#else -#include "core/resource.h" #include "core/array.h" -#include "core/variant.h" #include "core/pool_vector.h" -#endif +#include "core/resource.h" +#include "core/variant.h" #include "core/version.h" #include "scene/resources/mesh.h" -#if VERSION_MAJOR < 4 #include "scene/resources/shape.h" -#else -#include "scene/resources/shape_3d.h" - -#define Shape Shape3D -#endif class MeshDataResource : public Resource { GDCLASS(MeshDataResource, Resource); diff --git a/modules/mesh_data_resource/mesh_data_resource_collection.cpp b/modules/mesh_data_resource/mesh_data_resource_collection.cpp index b6635f423..403507f59 100644 --- a/modules/mesh_data_resource/mesh_data_resource_collection.cpp +++ b/modules/mesh_data_resource/mesh_data_resource_collection.cpp @@ -31,11 +31,7 @@ void MeshDataResourceCollection::add_mdr(Ref mdr) { Vector MeshDataResourceCollection::get_mdrs() { Vector r; for (int i = 0; i < _mdrs.size(); i++) { -#if VERSION_MAJOR < 4 r.push_back(_mdrs[i].get_ref_ptr()); -#else - r.push_back(_mdrs[i]); -#endif } return r; } diff --git a/modules/mesh_data_resource/mesh_data_resource_collection.h b/modules/mesh_data_resource/mesh_data_resource_collection.h index d7db77e1f..31cc4e9bf 100644 --- a/modules/mesh_data_resource/mesh_data_resource_collection.h +++ b/modules/mesh_data_resource/mesh_data_resource_collection.h @@ -22,18 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/io/resource.h" -#include "core/templates/vector.h" -#else #include "core/resource.h" #include "core/vector.h" -#endif #include "mesh_data_resource.h" @@ -53,7 +45,7 @@ protected: static void _bind_methods(); private: - Vector > _mdrs; + Vector> _mdrs; }; #endif diff --git a/modules/mesh_data_resource/nodes/mesh_data_instance.cpp b/modules/mesh_data_resource/nodes/mesh_data_instance.cpp index 6b1b113f6..d2fe777b2 100644 --- a/modules/mesh_data_resource/nodes/mesh_data_instance.cpp +++ b/modules/mesh_data_resource/nodes/mesh_data_instance.cpp @@ -5,15 +5,9 @@ #include "core/version.h" #include "scene/resources/texture.h" -#if VERSION_MAJOR < 4 #include "core/image.h" #define GET_WORLD get_world -#else -#include "core/io/image.h" - -#define GET_WORLD get_world_3d -#endif #if TEXTURE_PACKER_PRESENT #include "../../texture_packer/texture_resource/packer_image_resource.h" @@ -184,11 +178,7 @@ void MeshDataInstance::setup_material_texture() { Ref tex; tex.instance(); -#if VERSION_MAJOR < 4 tex->create_from_image(i, 0); -#else - tex->create_from_image(i); -#endif if (sm.is_valid()) { sm->set_texture(SpatialMaterial::TEXTURE_ALBEDO, tex); @@ -214,9 +204,7 @@ MeshDataInstance::MeshDataInstance() { _snap_to_mesh = false; _snap_axis = Vector3(0, -1, 0); -#if VERSION_MINOR >= 4 set_portal_mode(PORTAL_MODE_GLOBAL); -#endif //set_notify_transform(true); } diff --git a/modules/mesh_data_resource/nodes/mesh_data_instance.h b/modules/mesh_data_resource/nodes/mesh_data_instance.h index 71362cd5a..71737d163 100644 --- a/modules/mesh_data_resource/nodes/mesh_data_instance.h +++ b/modules/mesh_data_resource/nodes/mesh_data_instance.h @@ -22,21 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "core/version.h" #include "scene/resources/texture.h" -#if VERSION_MAJOR < 4 #include "scene/3d/visual_instance.h" -#else -#include "scene/3d/node_3d.h" - -#define SpatialMaterial StandardMaterial3D -#define Spatial Node3D -#define Texture Texture2D -#endif #include "core/math/vector3.h" diff --git a/modules/mesh_data_resource/nodes/mesh_data_instance_2d.cpp b/modules/mesh_data_resource/nodes/mesh_data_instance_2d.cpp index 554a35d99..14ec06c2d 100644 --- a/modules/mesh_data_resource/nodes/mesh_data_instance_2d.cpp +++ b/modules/mesh_data_resource/nodes/mesh_data_instance_2d.cpp @@ -5,11 +5,7 @@ #include "core/version.h" #include "scene/resources/texture.h" -#if VERSION_MAJOR < 4 #include "core/image.h" -#else -#include "core/io/image.h" -#endif #if TEXTURE_PACKER_PRESENT #include "../../texture_packer/texture_resource/packer_image_resource.h" diff --git a/modules/mesh_data_resource/plugin/mdr_import_plugin_base.cpp b/modules/mesh_data_resource/plugin/mdr_import_plugin_base.cpp index bccc187f7..36cd3d2f0 100644 --- a/modules/mesh_data_resource/plugin/mdr_import_plugin_base.cpp +++ b/modules/mesh_data_resource/plugin/mdr_import_plugin_base.cpp @@ -22,10 +22,6 @@ SOFTWARE. #include "mdr_import_plugin_base.h" -#include "core/version.h" - -#if VERSION_MAJOR < 4 - #include "scene/resources/box_shape.h" #include "scene/resources/capsule_shape.h" #include "scene/resources/concave_polygon_shape.h" @@ -34,41 +30,6 @@ SOFTWARE. #include "scene/resources/shape.h" #include "scene/resources/sphere_shape.h" -#else - -#include "scene/resources/box_shape_3d.h" -#include "scene/resources/capsule_shape_3d.h" -#include "scene/resources/concave_polygon_shape_3d.h" -#include "scene/resources/convex_polygon_shape_3d.h" -#include "scene/resources/cylinder_shape_3d.h" -#include "scene/resources/shape_3d.h" -#include "scene/resources/sphere_shape_3d.h" - -#define BoxShape BoxShape3D -#define CapsuleShape CapsuleShape3D -#define ConcavePolygonShape ConcavePolygonShape3D -#define ConvexPolygonShape ConvexPolygonShape3D -#define CylinderShape CylinderShape3D -#define Shape Shape3D -#define SphereShape SphereShape3D - -#define PoolVector3Array PackedVector3Array -#define PoolVector2Array PackedVector2Array -#define PoolColorArray PackedColorArray -#define PoolIntArray PackedInt64Array -#define PoolRealArray PackedFloat32Array -#define PoolByteArray PackedByteArray - -typedef class RenderingServer VisualServer; -typedef class RenderingServer VS; - -template -class Vector; -template -using PoolVector = Vector; - -#endif - #if MESH_UTILS_PRESENT #include "../../mesh_utils/mesh_utils.h" #endif @@ -517,11 +478,7 @@ void MDRImportPluginBase::add_colliders(Ref mdr, Refget_aabb(); Vector3 size = aabb.get_size(); -#if VERSION_MAJOR > 3 - shape->set_size(size * 0.5); -#else shape->set_extents(size * 0.5); -#endif Vector3 pos = aabb.position; pos += size / 2.0; @@ -825,11 +782,7 @@ Ref MDRImportPluginBase::scale_shape(Ref shape, const Vector3 &sca if (Object::cast_to(*shape)) { Ref bs = shape; -#if VERSION_MAJOR > 3 - bs->set_size(bs->get_size() * scale); -#else bs->set_extents(bs->get_extents() * scale); -#endif } if (Object::cast_to(*shape)) { diff --git a/modules/mesh_data_resource/plugin/mdr_import_plugin_base.h b/modules/mesh_data_resource/plugin/mdr_import_plugin_base.h index 6e2deaa7a..3398f10aa 100644 --- a/modules/mesh_data_resource/plugin/mdr_import_plugin_base.h +++ b/modules/mesh_data_resource/plugin/mdr_import_plugin_base.h @@ -27,13 +27,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/string/ustring.h" -#include "core/variant/array.h" -#else #include "core/array.h" #include "core/ustring.h" -#endif #include "../mesh_data_resource_collection.h" #include "core/io/resource_saver.h" @@ -49,21 +44,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR < 4 #include "scene/3d/mesh_instance.h" -#if VERSION_MINOR < 4 -#include "editor/import/editor_scene_importer_gltf.h" -#else #include "../../gltf/editor_scene_importer_gltf.h" -#endif - -#else -#include "../../gltf/editor_scene_importer_gltf.h" -#include "scene/3d/mesh_instance_3d.h" - -#define MeshInstance MeshInstance3D -#endif class MDRImportPluginBase : public EditorImportPlugin { GDCLASS(MDRImportPluginBase, EditorImportPlugin); diff --git a/modules/mesh_data_resource/plugin_gltf/editor_import_gltf_mdr.cpp b/modules/mesh_data_resource/plugin_gltf/editor_import_gltf_mdr.cpp index af7d8366e..e278d8b0c 100644 --- a/modules/mesh_data_resource/plugin_gltf/editor_import_gltf_mdr.cpp +++ b/modules/mesh_data_resource/plugin_gltf/editor_import_gltf_mdr.cpp @@ -60,11 +60,7 @@ Error EditorImportGLTFMdr::import(const String &p_source_file, const String &p_s Error erri; - #if VERSION_MAJOR == 3 && VERSION_MINOR > 4 Node *n = _importer->import_scene(p_source_file, 0, 15, 0, nullptr, &erri); - #else - Node *n = _importer->import_scene(p_source_file, 0, 15, nullptr, &erri); - #endif ERR_FAIL_COND_V(!n, Error::ERR_PARSE_ERROR); diff --git a/modules/mesh_data_resource/plugin_gltf/editor_import_gltf_mdr.h b/modules/mesh_data_resource/plugin_gltf/editor_import_gltf_mdr.h index ce1cb52e6..25a56d7dc 100644 --- a/modules/mesh_data_resource/plugin_gltf/editor_import_gltf_mdr.h +++ b/modules/mesh_data_resource/plugin_gltf/editor_import_gltf_mdr.h @@ -22,18 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/string/ustring.h" -#include "core/variant/array.h" -#else -#include "core/ustring.h" #include "core/array.h" -#endif +#include "core/ustring.h" #include "../plugin/mdr_import_plugin_base.h" @@ -47,26 +37,10 @@ SOFTWARE. #include "core/math/transform.h" -#include "core/version.h" - -#if VERSION_MAJOR < 4 - -#if VERSION_MINOR < 4 -#include "editor/import/editor_scene_importer_gltf.h" -#else #include "../../gltf/editor_scene_importer_gltf.h" -#endif - #include "scene/3d/mesh_instance.h" -#else -#include "../../gltf/editor_scene_importer_gltf.h" -#include "scene/3d/mesh_instance_3d.h" - -#define MeshInstance MeshInstance3D -#endif class EditorImportGLTFMdr : public MDRImportPluginBase { - GDCLASS(EditorImportGLTFMdr, MDRImportPluginBase); public: diff --git a/modules/mesh_data_resource/plugin_gltf/editor_plugin_gltf_mdr.h b/modules/mesh_data_resource/plugin_gltf/editor_plugin_gltf_mdr.h index 110d5e8fb..58f9fc628 100644 --- a/modules/mesh_data_resource/plugin_gltf/editor_plugin_gltf_mdr.h +++ b/modules/mesh_data_resource/plugin_gltf/editor_plugin_gltf_mdr.h @@ -22,23 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/string/ustring.h" -#else #include "core/ustring.h" -#endif #include "editor/editor_plugin.h" #include "editor_import_gltf_mdr.h" class EditorPluginGLTFMdr : public EditorPlugin { - GDCLASS(EditorPluginGLTFMdr, EditorPlugin); public: diff --git a/modules/mesh_utils/fast_quadratic_mesh_simplifier.h b/modules/mesh_utils/fast_quadratic_mesh_simplifier.h index b63d53e5b..212932c8b 100644 --- a/modules/mesh_utils/fast_quadratic_mesh_simplifier.h +++ b/modules/mesh_utils/fast_quadratic_mesh_simplifier.h @@ -27,16 +27,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/ref_counted.h" -#ifndef Reference -#define Reference RefCounted -#endif -#include "core/variant/array.h" -#else -#include "core/reference.h" #include "core/array.h" -#endif +#include "core/reference.h" #include "simplify.h" diff --git a/modules/mesh_utils/mesh_merger.h b/modules/mesh_utils/mesh_merger.h index e820e9cdd..3f31c5b31 100644 --- a/modules/mesh_utils/mesh_merger.h +++ b/modules/mesh_utils/mesh_merger.h @@ -24,26 +24,14 @@ SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" -#include "core/templates/vector.h" -#include "core/math/color.h" -#else +#include "core/color.h" #include "core/reference.h" #include "core/vector.h" -#include "core/color.h" -#endif #include "defines.h" #include pool_vector_h include_pool_vector - #include mesh_instance_h #include "core/math/rect2.h" @@ -62,7 +50,6 @@ include_pool_vector public: struct Vertex { - Vector3 vertex; Color color; Vector3 normal; // normal, binormal, tangent diff --git a/modules/mesh_utils/mesh_utils.h b/modules/mesh_utils/mesh_utils.h index 8d70fd9ba..70f15de0a 100644 --- a/modules/mesh_utils/mesh_utils.h +++ b/modules/mesh_utils/mesh_utils.h @@ -22,17 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - #include "core/variant.h" -#include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/object.h" -#else #include "core/object.h" -#endif #include "scene/resources/texture.h" diff --git a/modules/mesh_utils/register_types.cpp b/modules/mesh_utils/register_types.cpp index 486d31cf8..b9b9ae929 100644 --- a/modules/mesh_utils/register_types.cpp +++ b/modules/mesh_utils/register_types.cpp @@ -26,11 +26,7 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/config/engine.h" -#else #include "core/engine.h" -#endif #include "fast_quadratic_mesh_simplifier.h" #include "mesh_merger.h" diff --git a/modules/mesh_utils/simplify.h b/modules/mesh_utils/simplify.h index 75b0d2f36..651ecad73 100644 --- a/modules/mesh_utils/simplify.h +++ b/modules/mesh_utils/simplify.h @@ -16,13 +16,8 @@ #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/string/ustring.h" -#include "core/variant/array.h" -#else -#include "core/ustring.h" #include "core/array.h" -#endif +#include "core/ustring.h" #include "core/math/vector2.h" #include "core/math/vector3.h" @@ -34,18 +29,7 @@ #include #include -#include "core/version.h" - -#if VERSION_MAJOR < 4 #include "servers/visual_server.h" -#else -#include "servers/rendering_server.h" - -typedef class RenderingServer VisualServer; -typedef class RenderingServer VS; - -#define PoolVector Vector -#endif namespace Simplify { @@ -116,10 +100,13 @@ struct vec3f { vec3f a = v, b = *this; double dot = v.x * x + v.y * y + v.z * z; double len = a.length() * b.length(); - if (len == 0) len = 0.00001f; + if (len == 0) + len = 0.00001f; double input = dot / len; - if (input < -1) input = -1; - if (input > 1) input = 1; + if (input < -1) + input = -1; + if (input > 1) + input = 1; return (double)acos(input); } @@ -127,7 +114,8 @@ struct vec3f { vec3f a = v, b = *this; double dot = a.x * b.x + a.y * b.y + a.z * b.z; double len = a.length() * b.length(); - if (len == 0) len = 1; + if (len == 0) + len = 1; vec3f plane; plane.cross(b, w); @@ -153,12 +141,18 @@ struct vec3f { return *this; } inline void clamp(double min, double max) { - if (x < min) x = min; - if (y < min) y = min; - if (z < min) z = min; - if (x > max) x = max; - if (y > max) y = max; - if (z > max) z = max; + if (x < min) + x = min; + if (y < min) + y = min; + if (z < min) + z = min; + if (x > max) + x = max; + if (y > max) + y = max; + if (z > max) + z = max; } inline vec3f rot_z(double a) { double yy = cos(a) * y + sin(a) * x; @@ -258,7 +252,6 @@ static double min(double v1, double v2) { } class SymetricMatrix { - public: // Constructor @@ -344,7 +337,6 @@ static bool compare_border_vertex(const BorderVertex &i1, const BorderVertex &i2 } class FQMS { - public: struct Triangle { int v[3]; @@ -408,7 +400,8 @@ public: int triangle_count = triangles.size(); for (int iteration = 0; iteration < _max_iteration_count; iteration++) { - if (triangle_count - deleted_triangles <= target_count) break; + if (triangle_count - deleted_triangles <= target_count) + break; // update mesh once in a while if (iteration % 5 == 0) { @@ -448,7 +441,6 @@ public: for (int j = 0; j < 3; ++j) { if (t.err[j] < threshold) { - int i0 = t.v[j]; Vertex &v0 = vertices[i0]; int i1 = t.v[(j + 1) % 3]; @@ -496,7 +488,8 @@ public: if (tcount <= v0.tcount) { // save ram - if (tcount) memcpy(&refs[v0.tstart], &refs[tstart], tcount * sizeof(Ref)); + if (tcount) + memcpy(&refs[v0.tstart], &refs[tstart], tcount * sizeof(Ref)); } else { // append v0.tstart = tstart; @@ -508,7 +501,8 @@ public: } // done? - if (triangle_count - deleted_triangles <= target_count) break; + if (triangle_count - deleted_triangles <= target_count) + break; } } // clean up mesh @@ -604,7 +598,8 @@ public: if (tcount <= v0.tcount) { // save ram - if (tcount) memcpy(&refs[v0.tstart], &refs[tstart], tcount * sizeof(Ref)); + if (tcount) + memcpy(&refs[v0.tstart], &refs[tstart], tcount * sizeof(Ref)); } else { // append v0.tstart = tstart; @@ -628,7 +623,6 @@ public: // Check if a triangle flips when this edge is removed bool flipped(vec3f p, int i0, int i1, Vertex &v0, Vertex &v1, std::vector &deleted) { - for (int k = 0; k < v0.tcount; ++k) { Triangle &t = triangles[refs[v0.tstart + k].tid]; @@ -648,12 +642,14 @@ public: d1.normalize(); vec3f d2 = vertices[id2].p - p; d2.normalize(); - if (fabs(d1.dot(d2)) > 0.999) return true; + if (fabs(d1.dot(d2)) > 0.999) + return true; vec3f n; n.cross(d1, d2); n.normalize(); deleted[k] = 0; - if (n.dot(t.n) < 0.2) return true; + if (n.dot(t.n) < 0.2) + return true; } return false; } @@ -1018,7 +1014,6 @@ public: double error = 0; double det = q.det(0, 1, 2, 1, 4, 5, 2, 5, 7); if (det != 0 && !border) { - // q_delta is invertible p_result.x = -1 / det * (q.det(1, 2, 3, 4, 5, 6, 5, 7, 8)); // vx = A41/det(q_delta) p_result.y = 1 / det * (q.det(0, 2, 3, 1, 5, 6, 2, 7, 8)); // vy = A42/det(q_delta) @@ -1034,9 +1029,12 @@ public: double error2 = vertex_error(q, p2.x, p2.y, p2.z); double error3 = vertex_error(q, p3.x, p3.y, p3.z); error = min(error1, min(error2, error3)); - if (error1 == error) p_result = p1; - if (error2 == error) p_result = p2; - if (error3 == error) p_result = p3; + if (error1 == error) + p_result = p1; + if (error2 == error) + p_result = p2; + if (error3 == error) + p_result = p3; } return error; } diff --git a/modules/props/editor/prop_editor_plugin.cpp b/modules/props/editor/prop_editor_plugin.cpp index 0485305cc..a4c2be0c9 100644 --- a/modules/props/editor/prop_editor_plugin.cpp +++ b/modules/props/editor/prop_editor_plugin.cpp @@ -72,7 +72,6 @@ void PropEditorPlugin::convert_scene(Node *root, const String &path) { } void PropEditorPlugin::find_room_points(Variant param) { -#if VERSION_MINOR >= 4 SceneTree *st = SceneTree::get_singleton(); if (st) { @@ -82,7 +81,6 @@ void PropEditorPlugin::find_room_points(Variant param) { PropUtils::get_singleton()->generate_room_points_node(scene); } } -#endif } void PropEditorPlugin::_quick_convert_button_pressed() { diff --git a/modules/props/singleton/prop_utils.cpp b/modules/props/singleton/prop_utils.cpp index 549e4fc4a..5e21e2bbf 100644 --- a/modules/props/singleton/prop_utils.cpp +++ b/modules/props/singleton/prop_utils.cpp @@ -95,7 +95,6 @@ void PropUtils::_convert_tree(Ref prop_data, Node *node, const Transfo } } } else { -#if VERSION_MINOR >= 4 //only handle the first encountered room per prop if (!prop_data->get_is_room()) { Room *r = Object::cast_to(sp); @@ -108,7 +107,6 @@ void PropUtils::_convert_tree(Ref prop_data, Node *node, const Transfo prop_data->set_room_bounds(points); } } -#endif for (int i = 0; i < node->get_child_count(); ++i) { Node *child = node->get_child(i); @@ -125,7 +123,6 @@ void PropUtils::_convert_tree(Ref prop_data, Node *node, const Transfo } } -#if VERSION_MINOR >= 4 bool PropUtils::generate_room_points_node(Node *node) { ERR_FAIL_COND_V(!ObjectDB::instance_validate(node), false); @@ -448,8 +445,6 @@ void PropUtils::get_mesh_arrays(Node *node, Vector> *arrs) { } } -#endif - int PropUtils::add_processor(const Ref &processor) { ERR_FAIL_COND_V(!processor.is_valid(), 0); diff --git a/modules/props/tiled_wall/tiled_wall.cpp b/modules/props/tiled_wall/tiled_wall.cpp index db0e92dae..39997a10c 100644 --- a/modules/props/tiled_wall/tiled_wall.cpp +++ b/modules/props/tiled_wall/tiled_wall.cpp @@ -279,10 +279,8 @@ TiledWall::TiledWall() { _physics_body_rid = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC); -#if VERSION_MINOR >= 4 //temporary set_portal_mode(PORTAL_MODE_GLOBAL); -#endif _mesher.instance(); } diff --git a/modules/props_2d/editor/prop_2d_editor_plugin.cpp b/modules/props_2d/editor/prop_2d_editor_plugin.cpp index 0c54768be..b3a3c4530 100644 --- a/modules/props_2d/editor/prop_2d_editor_plugin.cpp +++ b/modules/props_2d/editor/prop_2d_editor_plugin.cpp @@ -72,7 +72,6 @@ void Prop2DEditorPlugin::convert_scene(Node *root, const String &path) { } void Prop2DEditorPlugin::find_room_points(Variant param) { -#if VERSION_MINOR >= 4 SceneTree *st = SceneTree::get_singleton(); if (st) { @@ -82,7 +81,6 @@ void Prop2DEditorPlugin::find_room_points(Variant param) { //Prop2DUtils::get_singleton()->generate_room_points_node(scene); } } -#endif } void Prop2DEditorPlugin::_quick_convert_button_pressed() { diff --git a/modules/rtile_map/tile_map.cpp b/modules/rtile_map/tile_map.cpp index 516aab3c8..053deb66e 100644 --- a/modules/rtile_map/tile_map.cpp +++ b/modules/rtile_map/tile_map.cpp @@ -35,12 +35,10 @@ #include "core/os/os.h" #include "scene/2d/area_2d.h" #include "scene/2d/collision_object_2d.h" -#include "servers/physics_2d_server.h" #include "scene/resources/world_2d.h" +#include "servers/physics_2d_server.h" -#if VERSION_MINOR >= 5 #include "servers/navigation_2d_server.h" -#endif int RTileMap::_get_quadrant_size() const { if (y_sort_mode) { @@ -84,11 +82,7 @@ void RTileMap::_notification(int p_what) { Quadrant &q = E->get(); if (navigation) { for (Map::Element *F = q.navpoly_ids.front(); F; F = F->next()) { -#if VERSION_MINOR < 5 - navigation->navpoly_remove(F->get().id); -#else Navigation2DServer::get_singleton()->region_set_map(F->get().region, RID()); -#endif } q.navpoly_ids.clear(); } @@ -172,11 +166,7 @@ void RTileMap::_update_quadrant_transform() { if (navigation) { for (Map::Element *F = q.navpoly_ids.front(); F; F = F->next()) { -#if VERSION_MINOR < 5 - navigation->navpoly_set_transform(F->get().id, nav_rel * F->get().xform); -#else Navigation2DServer::get_singleton()->region_set_transform(F->get().region, nav_rel * F->get().xform); -#endif } } @@ -403,11 +393,7 @@ void RTileMap::update_dirty_quadrants() { if (navigation) { for (Map::Element *E = q.navpoly_ids.front(); E; E = E->next()) { -#if VERSION_MINOR < 5 - navigation->navpoly_remove(E->get().id); -#else Navigation2DServer::get_singleton()->region_set_map(E->get().region, RID()); -#endif } q.navpoly_ids.clear(); } @@ -654,20 +640,12 @@ void RTileMap::update_dirty_quadrants() { xform.set_origin(offset.floor() + q.pos); _fix_cell_transform(xform, c, npoly_ofs, s); -#if VERSION_MINOR < 5 - int pid = navigation->navpoly_add(navpoly, nav_rel * xform); -#else RID region = Navigation2DServer::get_singleton()->region_create(); Navigation2DServer::get_singleton()->region_set_map(region, navigation->get_rid()); Navigation2DServer::get_singleton()->region_set_transform(region, nav_rel * xform); Navigation2DServer::get_singleton()->region_set_navpoly(region, navpoly); -#endif Quadrant::NavPoly np; -#if VERSION_MINOR < 5 - np.id = pid; -#else np.region = region; -#endif np.xform = xform; q.navpoly_ids[E->key()] = np; @@ -861,11 +839,7 @@ void RTileMap::_erase_quadrant(Map::Element *Q) { if (navigation) { for (Map::Element *E = q.navpoly_ids.front(); E; E = E->next()) { -#if VERSION_MINOR < 5 - navigation->navpoly_remove(E->get().id); -#else Navigation2DServer::get_singleton()->region_set_map(E->get().region, RID()); -#endif } q.navpoly_ids.clear(); } diff --git a/modules/rtile_map/tile_map.h b/modules/rtile_map/tile_map.h index 111130702..07f90c11c 100644 --- a/modules/rtile_map/tile_map.h +++ b/modules/rtile_map/tile_map.h @@ -30,15 +30,12 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ - - - #include "core/self_list.h" +#include "core/version.h" #include "core/vset.h" #include "scene/2d/navigation_2d.h" #include "scene/2d/node_2d.h" #include "tile_set.h" -#include "core/version.h" #include "../fastnoise/noise.h" @@ -149,11 +146,7 @@ private: SelfList dirty_list; struct NavPoly { -#if VERSION_MINOR < 5 - int id; -#else RID region; -#endif Transform2D xform; }; diff --git a/modules/rtile_map/tile_map_editor_plugin.cpp b/modules/rtile_map/tile_map_editor_plugin.cpp index f42b2b3ac..7384efeff 100644 --- a/modules/rtile_map/tile_map_editor_plugin.cpp +++ b/modules/rtile_map/tile_map_editor_plugin.cpp @@ -2133,18 +2133,10 @@ void RTileMapEditorPlugin::_notification(int p_what) { if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { switch ((int)EditorSettings::get_singleton()->get("editors/tile_map/editor_side")) { case 0: { // Left. -#if VERSION_MINOR < 5 - CanvasItemEditor::get_singleton()->get_palette_split()->move_child(tile_map_editor, 0); -#else CanvasItemEditor::get_singleton()->move_control_to_left_panel(tile_map_editor); -#endif } break; case 1: { // Right. -#if VERSION_MINOR < 5 - CanvasItemEditor::get_singleton()->get_palette_split()->move_child(tile_map_editor, 1); -#else CanvasItemEditor::get_singleton()->move_control_to_right_panel(tile_map_editor); -#endif } break; } } diff --git a/modules/thread_pool/register_types.cpp b/modules/thread_pool/register_types.cpp index 1f4843d93..5ee88acf9 100644 --- a/modules/thread_pool/register_types.cpp +++ b/modules/thread_pool/register_types.cpp @@ -26,11 +26,7 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/config/engine.h" -#else #include "core/engine.h" -#endif #include "thread_pool.h" #include "thread_pool_execute_job.h" @@ -39,7 +35,6 @@ SOFTWARE. static ThreadPool *thread_pool = NULL; void register_thread_pool_types() { - ClassDB::register_class(); ClassDB::register_class(); diff --git a/modules/ui_extensions/bs_input_event_key.cpp b/modules/ui_extensions/bs_input_event_key.cpp index cf1f33cec..5f4904853 100644 --- a/modules/ui_extensions/bs_input_event_key.cpp +++ b/modules/ui_extensions/bs_input_event_key.cpp @@ -27,27 +27,15 @@ SOFTWARE. void BSInputEventKey::from_input_event_key(const Ref event) { set_device(event->get_device()); -#if VERSION_MAJOR < 4 set_shift(event->get_shift()); set_alt(event->get_alt()); set_control(event->get_control()); set_metakey(event->get_metakey()); set_command(event->get_command()); -#else - set_shift_pressed(event->is_shift_pressed()); - set_alt_pressed(event->is_alt_pressed()); - set_ctrl_pressed(event->is_ctrl_pressed()); - set_meta_pressed(event->is_meta_pressed()); - set_command_pressed(event->is_command_pressed()); -#endif set_pressed(event->is_pressed()); -#if VERSION_MAJOR < 4 set_scancode(event->get_scancode()); -#else - set_keycode(event->get_keycode()); -#endif set_unicode(event->get_unicode()); set_echo(event->is_echo()); @@ -58,13 +46,8 @@ bool BSInputEventKey::action_match(const Ref &p_event, bool p_exact_ if (key.is_null()) return false; -#if VERSION_MAJOR < 4 uint32_t code = get_scancode_with_modifiers(); uint32_t event_code = key->get_scancode_with_modifiers(); -#else - Key code = get_keycode_with_modifiers(); - Key event_code = key->get_keycode_with_modifiers(); -#endif bool match = (code == event_code); if (match) { diff --git a/modules/ui_extensions/bs_input_event_key.h b/modules/ui_extensions/bs_input_event_key.h index 3ae9e9d92..d44a37211 100644 --- a/modules/ui_extensions/bs_input_event_key.h +++ b/modules/ui_extensions/bs_input_event_key.h @@ -27,11 +27,7 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR < 4 #include "core/os/input_event.h" -#else -#include "core/input/input_event.h" -#endif class BSInputEventKey : public InputEventKey { GDCLASS(BSInputEventKey, InputEventKey); diff --git a/modules/ui_extensions/input_map_editor.cpp b/modules/ui_extensions/input_map_editor.cpp index 903e4cd90..1e11aa6f6 100644 --- a/modules/ui_extensions/input_map_editor.cpp +++ b/modules/ui_extensions/input_map_editor.cpp @@ -30,16 +30,10 @@ #include "input_map_editor.h" -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/string/ustring.h" -#else #include "core/global_constants.h" #include "core/project_settings.h" #include "core/translation.h" #include "core/ustring.h" -#endif #include "core/os/keyboard.h" #include "editor/editor_export.h" @@ -49,19 +43,10 @@ #include "core/version.h" -#if VERSION_MAJOR < 4 #include "core/input_map.h" #define CONNECT(sig, obj, target_method_class, method) connect(sig, obj, #method) -#else -#include "core/input/input_map.h" -#define CONNECT(sig, obj, target_method_class, method) connect(sig, callable_mp(obj, &target_method_class::method)) -#endif -#if VERSION_MAJOR < 4 static const char *_button_names[JOY_BUTTON_MAX] = { -#else -static const char *_button_names[static_cast(JoyButton::MAX)] = { -#endif "DualShock Cross, Xbox A, Nintendo B", "DualShock Circle, Xbox B, Nintendo A", "DualShock Square, Xbox X, Nintendo Y", @@ -80,11 +65,7 @@ static const char *_button_names[static_cast(JoyButton::MAX)] = { "D-Pad Right" }; -#if VERSION_MAJOR < 4 static const char *_axis_names[JOY_AXIS_MAX * 2] = { -#else -static const char *_axis_names[static_cast(JoyAxis::MAX) * 2] = { -#endif " (Left Stick Left)", " (Left Stick Right)", " (Left Stick Up)", @@ -112,11 +93,7 @@ void InputMapEditor::_notification(int p_what) { } static bool _validate_action_name(const String &p_name) { -#if VERSION_MAJOR < 4 const CharType *cstr = p_name.c_str(); -#else - const char32_t *cstr = p_name.get_data(); -#endif for (int i = 0; cstr[i]; i++) if (cstr[i] == '/' || cstr[i] == ':' || cstr[i] == '"' || @@ -202,13 +179,8 @@ void InputMapEditor::_device_input_add() { switch (add_type) { case INPUT_MOUSE_BUTTON: { Ref mb; -#if VERSION_MAJOR < 4 mb.instance(); mb->set_button_index(device_index->get_selected() + 1); -#else - mb.instantiate(); - mb->set_button_index(static_cast(device_index->get_selected() + 1)); -#endif mb->set_device(_get_current_device()); for (int i = 0; i < events.size(); i++) { @@ -225,13 +197,8 @@ void InputMapEditor::_device_input_add() { } break; case INPUT_JOY_MOTION: { Ref jm; -#if VERSION_MAJOR < 4 jm.instance(); jm->set_axis(device_index->get_selected() >> 1); -#else - jm.instantiate(); - jm->set_axis(static_cast(device_index->get_selected() >> 1)); -#endif jm->set_axis_value((device_index->get_selected() & 1) ? 1 : -1); jm->set_device(_get_current_device()); @@ -250,13 +217,8 @@ void InputMapEditor::_device_input_add() { } break; case INPUT_JOY_BUTTON: { Ref jb; -#if VERSION_MAJOR < 4 jb.instance(); jb->set_button_index(device_index->get_selected()); -#else - jb.instantiate(); - jb->set_button_index(static_cast(device_index->get_selected())); -#endif jb->set_device(_get_current_device()); for (int i = 0; i < events.size(); i++) { @@ -309,21 +271,12 @@ void InputMapEditor::_press_a_key_confirm() { Ref ie; -#if VERSION_MAJOR < 4 ie.instance(); ie->set_scancode(last_wait_for_key->get_scancode()); ie->set_shift(last_wait_for_key->get_shift()); ie->set_alt(last_wait_for_key->get_alt()); ie->set_control(last_wait_for_key->get_control()); ie->set_metakey(last_wait_for_key->get_metakey()); -#else - ie.instantiate(); - ie->set_keycode(last_wait_for_key->get_keycode()); - ie->set_shift_pressed(last_wait_for_key->is_shift_pressed()); - ie->set_alt_pressed(last_wait_for_key->is_alt_pressed()); - ie->set_ctrl_pressed(last_wait_for_key->is_ctrl_pressed()); - ie->set_meta_pressed(last_wait_for_key->is_meta_pressed()); -#endif String name = add_at; int idx = edit_idx; @@ -337,15 +290,9 @@ void InputMapEditor::_press_a_key_confirm() { if (aie.is_null()) continue; -#if VERSION_MAJOR < 4 if (aie->get_scancode_with_modifiers() == ie->get_scancode_with_modifiers()) { return; } -#else - if (aie->get_keycode_with_modifiers() == ie->get_keycode_with_modifiers()) { - return; - } -#endif } if (idx < 0 || idx >= events.size()) { @@ -370,11 +317,7 @@ void InputMapEditor::_show_last_added(const Ref &p_event, const Stri if (!r) return; -#if VERSION_MAJOR < 4 r = r->get_children(); -#else - r = r->get_first_child(); -#endif if (!r) return; @@ -385,11 +328,7 @@ void InputMapEditor::_show_last_added(const Ref &p_event, const Stri continue; } -#if VERSION_MAJOR < 4 TreeItem *child = r->get_children(); -#else - TreeItem *child = r->get_first_child(); -#endif while (child) { Variant input = child->get_meta("__input"); @@ -413,33 +352,14 @@ void InputMapEditor::_show_last_added(const Ref &p_event, const Stri void InputMapEditor::_wait_for_key(const Ref &p_event) { Ref k = p_event; -#if VERSION_MAJOR < 4 if (k.is_valid() && k->is_pressed() && k->get_scancode() != 0) { -#else - if (k.is_valid() && k->is_pressed() && k->get_keycode() != Key::NONE) { -#endif - last_wait_for_key = p_event; -#if VERSION_MAJOR < 4 const String str = keycode_get_string(k->get_scancode_with_modifiers()); -#else - const String str = keycode_get_string(k->get_keycode_with_modifiers()); -#endif press_a_key_label->set_text(str); - -#if VERSION_MAJOR < 4 press_a_key->get_ok()->set_disabled(false); -#else - press_a_key->get_ok_button()->set_disabled(false); -#endif - -#if VERSION_MAJOR < 4 press_a_key->accept_event(); -#else - press_a_key->set_input_as_handled(); -#endif } } @@ -450,11 +370,7 @@ void InputMapEditor::_add_item(int p_item, Ref p_exiting_event) { case INPUT_KEY: { press_a_key_label->set_text(("Press a Key...")); -#if VERSION_MAJOR < 4 press_a_key->get_ok()->set_disabled(true); -#else - press_a_key->get_ok_button()->set_disabled(true); -#endif last_wait_for_key = Ref(); press_a_key->popup_centered(Size2(250, 80)); @@ -474,36 +390,18 @@ void InputMapEditor::_add_item(int p_item, Ref p_exiting_event) { device_index->add_item(("X Button 1")); device_index->add_item(("X Button 2")); -#if VERSION_MAJOR < 4 device_input->popup_centered_minsize(Size2(350, 95)); -#else - device_input->popup_centered(Size2(350, 95)); -#endif Ref mb = p_exiting_event; if (mb.is_valid()) { -#if VERSION_MAJOR < 4 device_index->select(mb->get_button_index() - 1); -#else - device_index->select(static_cast(mb->get_button_index()) - 1); -#endif - _set_current_device(mb->get_device()); - -#if VERSION_MAJOR < 4 device_input->get_ok()->set_text("Change"); -#else - device_input->get_ok_button()->set_text("Change"); -#endif } else { _set_current_device(0); -#if VERSION_MAJOR < 4 device_input->get_ok()->set_text("Add"); -#else - device_input->get_ok_button()->set_text("Add"); -#endif } } break; @@ -511,45 +409,24 @@ void InputMapEditor::_add_item(int p_item, Ref p_exiting_event) { device_index_label->set_text("Joypad Axis Index:"); device_index->clear(); -#if VERSION_MAJOR < 4 for (int i = 0; i < JOY_AXIS_MAX * 2; i++) { -#else - for (int i = 0; i < static_cast(JoyAxis::MAX) * 2; i++) { -#endif String desc = _axis_names[i]; device_index->add_item("Axis " + itos(i / 2) + " " + ((i & 1) ? "+" : "-") + desc); } -#if VERSION_MAJOR < 4 device_input->popup_centered_minsize(Size2(350, 95)); -#else - device_input->popup_centered(Size2(350, 95)); -#endif Ref jm = p_exiting_event; if (jm.is_valid()) { -#if VERSION_MAJOR < 4 device_index->select(jm->get_axis() * 2 + (jm->get_axis_value() > 0 ? 1 : 0)); -#else - device_index->select(static_cast(jm->get_axis()) * 2 + (jm->get_axis_value() > 0 ? 1 : 0)); -#endif _set_current_device(jm->get_device()); -#if VERSION_MAJOR < 4 device_input->get_ok()->set_text("Change"); -#else - device_input->get_ok_button()->set_text("Change"); -#endif - } else { _set_current_device(0); -#if VERSION_MAJOR < 4 device_input->get_ok()->set_text("Add"); -#else - device_input->get_ok_button()->set_text("Add"); -#endif } } break; @@ -557,42 +434,22 @@ void InputMapEditor::_add_item(int p_item, Ref p_exiting_event) { device_index_label->set_text("Joypad Button Index:"); device_index->clear(); -#if VERSION_MAJOR < 4 for (int i = 0; i < JOY_BUTTON_MAX; i++) { -#else - for (int i = 0; i < static_cast(JoyButton::MAX); i++) { -#endif device_index->add_item(itos(i) + ": " + String(_button_names[i])); } -#if VERSION_MAJOR < 4 device_input->popup_centered_minsize(Size2(350, 95)); -#else - device_input->popup_centered(Size2(350, 95)); -#endif Ref jb = p_exiting_event; if (jb.is_valid()) { -#if VERSION_MAJOR < 4 device_index->select(jb->get_button_index()); -#else - device_index->select(static_cast(jb->get_button_index())); -#endif _set_current_device(jb->get_device()); -#if VERSION_MAJOR < 4 device_input->get_ok()->set_text("Change"); -#else - device_input->get_ok_button()->set_text("Change"); -#endif } else { _set_current_device(0); -#if VERSION_MAJOR < 4 device_input->get_ok()->set_text("Add"); -#else - device_input->get_ok_button()->set_text("Add"); -#endif } } break; @@ -682,11 +539,7 @@ void InputMapEditor::_action_button_pressed(Object *p_obj, int p_column, int p_i Array events = action["events"]; ERR_FAIL_INDEX(idx, events.size()); -#if VERSION_MAJOR < 4 events.remove(idx); -#else - events.remove_at(idx); -#endif action["events"] = events; ProjectSettings::get_singleton()->set(name, action); @@ -729,13 +582,8 @@ void InputMapEditor::_update_actions() { Map collapsed; -#if VERSION_MAJOR < 4 if (input_editor->get_root() && input_editor->get_root()->get_children()) { for (TreeItem *item = input_editor->get_root()->get_children(); item; item = item->get_next()) { -#else - if (input_editor->get_root() && input_editor->get_root()->get_first_child()) { - for (TreeItem *item = input_editor->get_root()->get_first_child(); item; item = item->get_next()) { -#endif collapsed[item->get_text(0)] = item->is_collapsed(); } } @@ -762,11 +610,7 @@ void InputMapEditor::_update_actions() { TreeItem *item = input_editor->create_item(root); item->set_text(0, name); -#if VERSION_MAJOR < 4 item->set_custom_bg_color(0, get_color("prop_subsection", "Editor")); -#else - item->set_custom_bg_color(0, input_editor->get_theme_color("prop_subsection", "Editor")); -#endif if (collapsed.has(name)) item->set_collapsed(collapsed[name]); @@ -776,11 +620,7 @@ void InputMapEditor::_update_actions() { item->set_range_config(1, 0.0, 1.0, 0.01); item->set_range(1, action["deadzone"]); -#if VERSION_MAJOR < 4 item->set_custom_bg_color(1, get_color("prop_subsection", "Editor")); -#else - item->set_custom_bg_color(1, input_editor->get_theme_color("prop_subsection", "Editor")); -#endif item->add_button(2, _add_texture, 1, false, "Add Event"); @@ -793,11 +633,7 @@ void InputMapEditor::_update_actions() { Ref k = event; if (k.is_valid()) { -#if VERSION_MAJOR < 4 const String str = keycode_get_string(k->get_scancode_with_modifiers()); -#else - const String str = keycode_get_string(k->get_keycode_with_modifiers()); -#endif action2->set_text(0, str); action2->set_icon(0, _keyboard_texture); @@ -807,11 +643,7 @@ void InputMapEditor::_update_actions() { if (jb.is_valid()) { String str = _get_device_string(jb->get_device()) + ", Button " + itos(static_cast(jb->get_button_index())); -#if VERSION_MAJOR < 4 if (jb->get_button_index() >= 0 && jb->get_button_index() < JOY_BUTTON_MAX) -#else - if (static_cast(jb->get_button_index()) >= 0 && static_cast(jb->get_button_index()) < static_cast(JoyButton::MAX)) -#endif str += String() + " (" + _button_names[static_cast(jb->get_button_index())] + ")."; else str += "."; @@ -822,7 +654,6 @@ void InputMapEditor::_update_actions() { Ref mb = event; -#if VERSION_MAJOR < 4 if (mb.is_valid()) { String str = _get_device_string(mb->get_device()) + ", "; switch (mb->get_button_index()) { @@ -844,29 +675,6 @@ void InputMapEditor::_update_actions() { default: str += "Button " + itos(mb->get_button_index()) + "."; } -#else - if (mb.is_valid()) { - String str = _get_device_string(mb->get_device()) + ", "; - switch (mb->get_button_index()) { - case MouseButton::LEFT: - str += "Left Button."; - break; - case MouseButton::RIGHT: - str += "Right Button."; - break; - case MouseButton::MIDDLE: - str += "Middle Button."; - break; - case MouseButton::WHEEL_UP: - str += "Wheel Up."; - break; - case MouseButton::WHEEL_DOWN: - str += "Wheel Down."; - break; - default: - str += "Button " + itos(static_cast(mb->get_button_index())) + "."; - } -#endif action2->set_text(0, str); action2->set_icon(0, _mouse_texture); @@ -1103,18 +911,11 @@ InputMapEditor::InputMapEditor() { input_editor->set_column_title(0, "Action"); input_editor->set_column_title(1, "Deadzone"); input_editor->set_column_expand(1, false); -#if VERSION_MAJOR < 4 input_editor->set_column_min_width(1, 80); -#else - input_editor->set_column_custom_minimum_width(1, 80); -#endif input_editor->set_column_expand(2, false); -#if VERSION_MAJOR < 4 input_editor->set_column_min_width(2, 50); -#else - input_editor->set_column_custom_minimum_width(2, 50); -#endif + input_editor->CONNECT("item_edited", this, InputMapEditor, _action_edited); input_editor->CONNECT("item_activated", this, InputMapEditor, _action_activated); input_editor->CONNECT("cell_selected", this, InputMapEditor, _action_selected); @@ -1126,28 +927,19 @@ InputMapEditor::InputMapEditor() { popup_add->CONNECT("id_pressed", this, InputMapEditor, _add_item); press_a_key = memnew(ConfirmationDialog); -#if VERSION_MAJOR < 4 press_a_key->set_focus_mode(FOCUS_ALL); -#endif + add_child(press_a_key); Label *l = memnew(Label); l->set_text("Press a Key..."); - #if VERSION_MAJOR < 4 l->set_align(Label::ALIGN_CENTER); -#else - l->set_vertical_alignment(VerticalAlignment::VERTICAL_ALIGNMENT_CENTER); -#endif -#if VERSION_MAJOR < 4 l->set_anchors_and_margins_preset(Control::PRESET_WIDE); l->set_margin(MARGIN_TOP, 20); l->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 30); press_a_key->get_ok()->set_disabled(true); -#else - press_a_key->get_ok_button()->set_disabled(true); -#endif press_a_key_label = l; press_a_key->add_child(l); @@ -1157,11 +949,7 @@ InputMapEditor::InputMapEditor() { device_input = memnew(ConfirmationDialog); add_child(device_input); -#if VERSION_MAJOR < 4 device_input->get_ok()->set_text("Add"); -#else - device_input->get_ok_button()->set_text("Add"); -#endif device_input->CONNECT("confirmed", this, InputMapEditor, _device_input_add); diff --git a/modules/ui_extensions/touch_button.cpp b/modules/ui_extensions/touch_button.cpp index 6affd6bd1..63ed51355 100644 --- a/modules/ui_extensions/touch_button.cpp +++ b/modules/ui_extensions/touch_button.cpp @@ -64,24 +64,14 @@ void TouchButton::_input(Ref p_event) { get_viewport()->set_input_as_handled(); Ref ev; -#if VERSION_MAJOR < 4 ev.instance(); -#else - ev.instantiate(); -#endif -#if VERSION_MAJOR < 4 ev->set_button_index(BUTTON_LEFT); -#else - ev->set_button_index(MouseButton::LEFT); -#endif ev->set_pressed(b->is_pressed()); ev->set_position(b->get_position()); ev->set_global_position(b->get_position()); -#if VERSION_MAJOR <= 3 BaseButton::_gui_input(ev); -#endif update(); } /* @@ -107,9 +97,7 @@ void TouchButton::_gui_input(Ref p_event) { return; } -#if VERSION_MAJOR <= 3 BaseButton::_gui_input(p_event); -#endif } void TouchButton::_unhandled_input(Ref p_event) { @@ -118,9 +106,7 @@ void TouchButton::_unhandled_input(Ref p_event) { return; } -#if VERSION_MAJOR <= 3 Button::_unhandled_input(p_event); -#endif } void TouchButton::_bind_methods() { diff --git a/modules/ui_extensions/touch_button.h b/modules/ui_extensions/touch_button.h index 005db25f4..2f3eca607 100644 --- a/modules/ui_extensions/touch_button.h +++ b/modules/ui_extensions/touch_button.h @@ -22,16 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - - -#include "core/version.h" - -#if VERSION_MAJOR > 3 -#include "core/config/engine.h" -#else #include "core/engine.h" -#endif #include "core/os/os.h" #include "scene/gui/button.h" diff --git a/modules/voxelman/library/voxel_library_simple.cpp b/modules/voxelman/library/voxel_library_simple.cpp index 20f26661f..05efb269c 100644 --- a/modules/voxelman/library/voxel_library_simple.cpp +++ b/modules/voxelman/library/voxel_library_simple.cpp @@ -77,11 +77,7 @@ void VoxelLibrarySimple::voxel_surface_set(const int index, Ref va } void VoxelLibrarySimple::voxel_surface_remove(const int index) { -#if VERSION_MAJOR <= 3 _voxel_surfaces.remove(index); -#else - _voxel_surfaces.remove_at(index); -#endif } int VoxelLibrarySimple::voxel_surface_get_num() const { diff --git a/modules/voxelman/world/jobs/voxel_prop_job.cpp b/modules/voxelman/world/jobs/voxel_prop_job.cpp index 94ec0af28..bb3073ce6 100644 --- a/modules/voxelman/world/jobs/voxel_prop_job.cpp +++ b/modules/voxelman/world/jobs/voxel_prop_job.cpp @@ -32,8 +32,8 @@ SOFTWARE. #include "../../library/voxel_material_cache.h" #include "../default/voxel_chunk_default.h" -#include "servers/physics_server.h" #include "scene/resources/world.h" +#include "servers/physics_server.h" #ifdef MESH_DATA_RESOURCE_PRESENT #include "../../../mesh_data_resource/mesh_data_resource.h" @@ -96,12 +96,7 @@ void VoxelPropJob::phase_physics_process() { continue; } -#if VERSION_MAJOR < 4 RID body = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC); -#else - RID body = PhysicsServer::get_singleton()->body_create(); - PhysicsServer::get_singleton()->body_set_mode(body, PhysicsServer::BODY_MODE_STATIC); -#endif Transform transform = chunk->mesh_data_resource_get_transform(i); transform *= offset;