mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-24 04:46:48 +01:00
Added the MMAlgos class (and binding) to the build. Also set up it's singleton.
This commit is contained in:
parent
2c3d7cecff
commit
df9099e0ed
17
modules/material_maker/SCsub
Normal file
17
modules/material_maker/SCsub
Normal file
@ -0,0 +1,17 @@
|
||||
import os
|
||||
|
||||
Import('env')
|
||||
|
||||
module_env = env.Clone()
|
||||
|
||||
|
||||
sources = [
|
||||
"register_types.cpp",
|
||||
|
||||
"algos/mm_algos.cpp",
|
||||
"algos/mm_algos_bind.cpp",
|
||||
]
|
||||
|
||||
|
||||
module_env.add_source_files(env.modules_sources, sources)
|
||||
|
@ -1,6 +1,7 @@
|
||||
|
||||
#include "mm_algos_bind.h"
|
||||
|
||||
#include "core/method_bind_ext.gen.inc"
|
||||
#include "mm_algos.h"
|
||||
|
||||
Vector3 _MMAlgos::clampv3(const Vector3 &v, const Vector3 &mi, const Vector3 &ma) {
|
||||
|
18
modules/material_maker/config.py
Normal file
18
modules/material_maker/config.py
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
def can_build(env, platform):
|
||||
return True
|
||||
|
||||
|
||||
def configure(env):
|
||||
pass
|
||||
|
||||
|
||||
def get_doc_classes():
|
||||
return [
|
||||
"MMAlgos",
|
||||
]
|
||||
|
||||
def get_doc_path():
|
||||
return "doc_classes"
|
||||
|
43
modules/material_maker/register_types.cpp
Normal file
43
modules/material_maker/register_types.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright (c) 2022 Péter Magyar
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "register_types.h"
|
||||
|
||||
#include "core/engine.h"
|
||||
|
||||
#include "algos/mm_algos.h"
|
||||
#include "algos/mm_algos_bind.h"
|
||||
|
||||
static _MMAlgos *_mm_algos_singleton = nullptr;
|
||||
|
||||
void register_material_maker_types() {
|
||||
ClassDB::register_class<_MMAlgos>();
|
||||
|
||||
_mm_algos_singleton = memnew(_MMAlgos);
|
||||
Engine::get_singleton()->add_singleton(Engine::Singleton("MMAlgos", _MMAlgos::get_singleton()));
|
||||
}
|
||||
|
||||
void unregister_material_maker_types() {
|
||||
if (_mm_algos_singleton) {
|
||||
memdelete(_mm_algos_singleton);
|
||||
}
|
||||
}
|
24
modules/material_maker/register_types.h
Normal file
24
modules/material_maker/register_types.h
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright (c) 2022 Péter Magyar
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
void register_material_maker_types();
|
||||
void unregister_material_maker_types();
|
Loading…
Reference in New Issue
Block a user