2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
/* rasterizer_dummy.cpp */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
|
|
|
/* http://www.godotengine.org */
|
|
|
|
/*************************************************************************/
|
2017-01-01 21:01:57 +00:00
|
|
|
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
2017-04-07 22:45:00 +00:00
|
|
|
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
|
2014-02-10 01:10:30 +00:00
|
|
|
/* */
|
|
|
|
/* 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 "rasterizer_dummy.h"
|
|
|
|
|
|
|
|
/* TEXTURE API */
|
|
|
|
|
|
|
|
RID RasterizerDummy::texture_create() {
|
|
|
|
|
|
|
|
Texture *texture = memnew(Texture);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!texture, RID());
|
|
|
|
return texture_owner.make_rid(texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Texture *texture = texture_owner.get(p_texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!texture);
|
2017-03-18 23:36:26 +00:00
|
|
|
texture->width = p_width;
|
|
|
|
texture->height = p_height;
|
|
|
|
texture->format = p_format;
|
|
|
|
texture->flags = p_flags;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::texture_set_data(RID p_texture, const Image &p_image, VS::CubeMapSide p_cube_side) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Texture *texture = texture_owner.get(p_texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
ERR_FAIL_COND(!texture);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND(texture->format != p_image.get_format());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
texture->image[p_cube_side] = p_image;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Image RasterizerDummy::texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Texture *texture = texture_owner.get(p_texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!texture, Image());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return texture->image[p_cube_side];
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::texture_set_flags(RID p_texture, uint32_t p_flags) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Texture *texture = texture_owner.get(p_texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!texture);
|
|
|
|
uint32_t cube = texture->flags & VS::TEXTURE_FLAG_CUBEMAP;
|
2017-03-18 23:36:26 +00:00
|
|
|
texture->flags = p_flags | cube; // can't remove a cube from being a cube
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
uint32_t RasterizerDummy::texture_get_flags(RID p_texture) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Texture *texture = texture_owner.get(p_texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!texture, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return texture->flags;
|
|
|
|
}
|
|
|
|
Image::Format RasterizerDummy::texture_get_format(RID p_texture) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Texture *texture = texture_owner.get(p_texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!texture, Image::FORMAT_GRAYSCALE);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return texture->format;
|
|
|
|
}
|
|
|
|
uint32_t RasterizerDummy::texture_get_width(RID p_texture) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Texture *texture = texture_owner.get(p_texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!texture, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return texture->width;
|
|
|
|
}
|
|
|
|
uint32_t RasterizerDummy::texture_get_height(RID p_texture) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Texture *texture = texture_owner.get(p_texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!texture, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return texture->height;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RasterizerDummy::texture_has_alpha(RID p_texture) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Texture *texture = texture_owner.get(p_texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!texture, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::texture_set_size_override(RID p_texture, int p_width, int p_height) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Texture *texture = texture_owner.get(p_texture);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
ERR_FAIL_COND(!texture);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND(p_width <= 0 || p_width > 4096);
|
|
|
|
ERR_FAIL_COND(p_height <= 0 || p_height > 4096);
|
2014-02-10 01:10:30 +00:00
|
|
|
//real texture size is in alloc width and height
|
2017-03-18 23:36:26 +00:00
|
|
|
// texture->width=p_width;
|
|
|
|
// texture->height=p_height;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::texture_set_reload_hook(RID p_texture, ObjectID p_owner, const StringName &p_function) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* SHADER API */
|
|
|
|
|
|
|
|
/* SHADER API */
|
|
|
|
|
|
|
|
RID RasterizerDummy::shader_create(VS::ShaderMode p_mode) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Shader *shader = memnew(Shader);
|
|
|
|
shader->mode = p_mode;
|
|
|
|
shader->fragment_line = 0;
|
|
|
|
shader->vertex_line = 0;
|
|
|
|
shader->light_line = 0;
|
2014-02-10 01:10:30 +00:00
|
|
|
RID rid = shader_owner.make_rid(shader);
|
|
|
|
|
|
|
|
return rid;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::shader_set_mode(RID p_shader, VS::ShaderMode p_mode) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_mode, 3);
|
|
|
|
Shader *shader = shader_owner.get(p_shader);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!shader);
|
2017-03-18 23:36:26 +00:00
|
|
|
shader->mode = p_mode;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
VS::ShaderMode RasterizerDummy::shader_get_mode(RID p_shader) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Shader *shader = shader_owner.get(p_shader);
|
|
|
|
ERR_FAIL_COND_V(!shader, VS::SHADER_MATERIAL);
|
2014-02-10 01:10:30 +00:00
|
|
|
return shader->mode;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::shader_set_code(RID p_shader, const String &p_vertex, const String &p_fragment, const String &p_light, int p_vertex_ofs, int p_fragment_ofs, int p_light_ofs) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Shader *shader = shader_owner.get(p_shader);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!shader);
|
2017-03-18 23:36:26 +00:00
|
|
|
shader->fragment_code = p_fragment;
|
|
|
|
shader->vertex_code = p_vertex;
|
|
|
|
shader->light_code = p_light;
|
|
|
|
shader->fragment_line = p_fragment_ofs;
|
|
|
|
shader->vertex_line = p_vertex_ofs;
|
|
|
|
shader->light_line = p_vertex_ofs;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
String RasterizerDummy::shader_get_vertex_code(RID p_shader) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Shader *shader = shader_owner.get(p_shader);
|
|
|
|
ERR_FAIL_COND_V(!shader, String());
|
2014-02-10 01:10:30 +00:00
|
|
|
return shader->vertex_code;
|
|
|
|
}
|
|
|
|
|
|
|
|
String RasterizerDummy::shader_get_fragment_code(RID p_shader) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Shader *shader = shader_owner.get(p_shader);
|
|
|
|
ERR_FAIL_COND_V(!shader, String());
|
2014-02-10 01:10:30 +00:00
|
|
|
return shader->fragment_code;
|
|
|
|
}
|
|
|
|
|
2014-06-28 02:21:45 +00:00
|
|
|
String RasterizerDummy::shader_get_light_code(RID p_shader) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Shader *shader = shader_owner.get(p_shader);
|
|
|
|
ERR_FAIL_COND_V(!shader, String());
|
2014-06-28 02:21:45 +00:00
|
|
|
return shader->light_code;
|
|
|
|
}
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
void RasterizerDummy::shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Shader *shader = shader_owner.get(p_shader);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!shader);
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::shader_set_default_texture_param(RID p_shader, const StringName &p_name, RID p_texture) {
|
2014-12-21 14:42:44 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
RID RasterizerDummy::shader_get_default_texture_param(RID p_shader, const StringName &p_name) const {
|
2014-12-21 14:42:44 +00:00
|
|
|
|
|
|
|
return RID();
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Variant RasterizerDummy::shader_get_default_param(RID p_shader, const StringName &p_name) {
|
2015-01-12 13:19:09 +00:00
|
|
|
|
|
|
|
return Variant();
|
|
|
|
}
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
/* COMMON MATERIAL API */
|
|
|
|
|
|
|
|
RID RasterizerDummy::material_create() {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
return material_owner.make_rid(memnew(Material));
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::material_set_shader(RID p_material, RID p_shader) {
|
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
|
|
|
ERR_FAIL_COND(!material);
|
2017-03-18 23:36:26 +00:00
|
|
|
material->shader = p_shader;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RID RasterizerDummy::material_get_shader(RID p_material) const {
|
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!material, RID());
|
2014-02-10 01:10:30 +00:00
|
|
|
return material->shader;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::material_set_param(RID p_material, const StringName &p_param, const Variant &p_value) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
|
|
|
ERR_FAIL_COND(!material);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
if (p_value.get_type() == Variant::NIL)
|
2014-02-10 01:10:30 +00:00
|
|
|
material->shader_params.erase(p_param);
|
|
|
|
else
|
2017-03-18 23:36:26 +00:00
|
|
|
material->shader_params[p_param] = p_value;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
Variant RasterizerDummy::material_get_param(RID p_material, const StringName &p_param) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!material, Variant());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
if (material->shader_params.has(p_param))
|
|
|
|
return material->shader_params[p_param];
|
|
|
|
else
|
|
|
|
return Variant();
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::material_set_flag(RID p_material, VS::MaterialFlag p_flag, bool p_enabled) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
|
|
|
ERR_FAIL_COND(!material);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_flag, VS::MATERIAL_FLAG_MAX);
|
|
|
|
material->flags[p_flag] = p_enabled;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::material_get_flag(RID p_material, VS::MaterialFlag p_flag) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!material, false);
|
|
|
|
ERR_FAIL_INDEX_V(p_flag, VS::MATERIAL_FLAG_MAX, false);
|
2014-02-10 01:10:30 +00:00
|
|
|
return material->flags[p_flag];
|
|
|
|
}
|
|
|
|
|
2014-06-28 02:21:45 +00:00
|
|
|
void RasterizerDummy::material_set_depth_draw_mode(RID p_material, VS::MaterialDepthDrawMode p_mode) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
|
|
|
ERR_FAIL_COND(!material);
|
2017-03-18 23:36:26 +00:00
|
|
|
material->depth_draw_mode = p_mode;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
VS::MaterialDepthDrawMode RasterizerDummy::material_get_depth_draw_mode(RID p_material) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!material, VS::MATERIAL_DEPTH_DRAW_ALWAYS);
|
2014-06-28 02:21:45 +00:00
|
|
|
return material->depth_draw_mode;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::material_set_blend_mode(RID p_material, VS::MaterialBlendMode p_mode) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
|
|
|
ERR_FAIL_COND(!material);
|
2017-03-18 23:36:26 +00:00
|
|
|
material->blend_mode = p_mode;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
VS::MaterialBlendMode RasterizerDummy::material_get_blend_mode(RID p_material) const {
|
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!material, VS::MATERIAL_BLEND_MODE_ADD);
|
2014-02-10 01:10:30 +00:00
|
|
|
return material->blend_mode;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::material_set_line_width(RID p_material, float p_line_width) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
|
|
|
ERR_FAIL_COND(!material);
|
2017-03-18 23:36:26 +00:00
|
|
|
material->line_width = p_line_width;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
float RasterizerDummy::material_get_line_width(RID p_material) const {
|
|
|
|
|
|
|
|
Material *material = material_owner.get(p_material);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!material, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return material->line_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* MESH API */
|
|
|
|
|
|
|
|
RID RasterizerDummy::mesh_create() {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
return mesh_owner.make_rid(memnew(Mesh));
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::mesh_add_surface(RID p_mesh, VS::PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, bool p_alpha_sort) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!mesh);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_primitive, VS::PRIMITIVE_MAX);
|
|
|
|
ERR_FAIL_COND(p_arrays.size() != VS::ARRAY_MAX);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Surface s;
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
s.format = 0;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
for (int i = 0; i < p_arrays.size(); i++) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
if (p_arrays[i].get_type() == Variant::NIL)
|
2014-02-10 01:10:30 +00:00
|
|
|
continue;
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
s.format |= (1 << i);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
if (i == VS::ARRAY_VERTEX) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Vector3Array v = p_arrays[i];
|
|
|
|
int len = v.size();
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND(len == 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
Vector3Array::Read r = v.read();
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
for (int i = 0; i < len; i++) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
if (i == 0)
|
|
|
|
s.aabb.pos = r[0];
|
2014-02-10 01:10:30 +00:00
|
|
|
else
|
|
|
|
s.aabb.expand_to(r[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND((s.format & VS::ARRAY_FORMAT_VERTEX) == 0); // mandatory
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
s.data = p_arrays;
|
|
|
|
s.morph_data = p_blend_shapes;
|
|
|
|
s.primitive = p_primitive;
|
|
|
|
s.alpha_sort = p_alpha_sort;
|
|
|
|
s.morph_target_count = mesh->morph_target_count;
|
|
|
|
s.morph_format = s.format;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Surface *surface = memnew(Surface);
|
|
|
|
*surface = s;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
mesh->surfaces.push_back(surface);
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::mesh_add_custom_surface(RID p_mesh, const Variant &p_dat) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
ERR_EXPLAIN("Dummy Rasterizer does not support custom surfaces. Running on wrong platform?");
|
|
|
|
ERR_FAIL_V();
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Array RasterizerDummy::mesh_get_surface_arrays(RID p_mesh, int p_surface) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, Array());
|
|
|
|
ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), Array());
|
2014-02-10 01:10:30 +00:00
|
|
|
Surface *surface = mesh->surfaces[p_surface];
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!surface, Array());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return surface->data;
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
Array RasterizerDummy::mesh_get_surface_morph_arrays(RID p_mesh, int p_surface) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, Array());
|
|
|
|
ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), Array());
|
2014-02-10 01:10:30 +00:00
|
|
|
Surface *surface = mesh->surfaces[p_surface];
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!surface, Array());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return surface->morph_data;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::mesh_set_morph_target_count(RID p_mesh, int p_amount) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!mesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND(mesh->surfaces.size() != 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
mesh->morph_target_count = p_amount;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
int RasterizerDummy::mesh_get_morph_target_count(RID p_mesh) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return mesh->morph_target_count;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::mesh_set_morph_target_mode(RID p_mesh, VS::MorphTargetMode p_mode) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_mode, 2);
|
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!mesh);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
mesh->morph_target_mode = p_mode;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VS::MorphTargetMode RasterizerDummy::mesh_get_morph_target_mode(RID p_mesh) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, VS::MORPH_MODE_NORMALIZED);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return mesh->morph_target_mode;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material, bool p_owned) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!mesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_surface, mesh->surfaces.size());
|
2014-02-10 01:10:30 +00:00
|
|
|
Surface *surface = mesh->surfaces[p_surface];
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND(!surface);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
if (surface->material_owned && surface->material.is_valid())
|
|
|
|
free(surface->material);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
surface->material_owned = p_owned;
|
|
|
|
surface->material = p_material;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RID RasterizerDummy::mesh_surface_get_material(RID p_mesh, int p_surface) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, RID());
|
|
|
|
ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), RID());
|
2014-02-10 01:10:30 +00:00
|
|
|
Surface *surface = mesh->surfaces[p_surface];
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!surface, RID());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return surface->material;
|
|
|
|
}
|
|
|
|
|
|
|
|
int RasterizerDummy::mesh_surface_get_array_len(RID p_mesh, int p_surface) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, -1);
|
|
|
|
ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
Surface *surface = mesh->surfaces[p_surface];
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!surface, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Vector3Array arr = surface->data[VS::ARRAY_VERTEX];
|
|
|
|
return arr.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
int RasterizerDummy::mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, -1);
|
|
|
|
ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
Surface *surface = mesh->surfaces[p_surface];
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!surface, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
IntArray arr = surface->data[VS::ARRAY_INDEX];
|
|
|
|
return arr.size();
|
|
|
|
}
|
|
|
|
uint32_t RasterizerDummy::mesh_surface_get_format(RID p_mesh, int p_surface) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, 0);
|
|
|
|
ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
Surface *surface = mesh->surfaces[p_surface];
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!surface, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return surface->format;
|
|
|
|
}
|
|
|
|
VS::PrimitiveType RasterizerDummy::mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, VS::PRIMITIVE_POINTS);
|
|
|
|
ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), VS::PRIMITIVE_POINTS);
|
2014-02-10 01:10:30 +00:00
|
|
|
Surface *surface = mesh->surfaces[p_surface];
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!surface, VS::PRIMITIVE_POINTS);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return surface->primitive;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::mesh_remove_surface(RID p_mesh, int p_index) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!mesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_index, mesh->surfaces.size());
|
2014-02-10 01:10:30 +00:00
|
|
|
Surface *surface = mesh->surfaces[p_index];
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND(!surface);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
memdelete(mesh->surfaces[p_index]);
|
2014-02-10 01:10:30 +00:00
|
|
|
mesh->surfaces.remove(p_index);
|
|
|
|
}
|
|
|
|
int RasterizerDummy::mesh_get_surface_count(RID p_mesh) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return mesh->surfaces.size();
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
AABB RasterizerDummy::mesh_get_aabb(RID p_mesh, RID p_skeleton) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, AABB());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
AABB aabb;
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
for (int i = 0; i < mesh->surfaces.size(); i++) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
if (i == 0)
|
|
|
|
aabb = mesh->surfaces[i]->aabb;
|
2014-02-10 01:10:30 +00:00
|
|
|
else
|
|
|
|
aabb.merge_with(mesh->surfaces[i]->aabb);
|
|
|
|
}
|
|
|
|
|
|
|
|
return aabb;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::mesh_set_custom_aabb(RID p_mesh, const AABB &p_aabb) {
|
2014-05-05 01:50:23 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Mesh *mesh = mesh_owner.get(p_mesh);
|
2014-05-05 01:50:23 +00:00
|
|
|
ERR_FAIL_COND(!mesh);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
mesh->custom_aabb = p_aabb;
|
2014-05-05 01:50:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AABB RasterizerDummy::mesh_get_custom_aabb(RID p_mesh) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Mesh *mesh = mesh_owner.get(p_mesh);
|
|
|
|
ERR_FAIL_COND_V(!mesh, AABB());
|
2014-05-05 01:50:23 +00:00
|
|
|
|
|
|
|
return mesh->custom_aabb;
|
|
|
|
}
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
/* MULTIMESH API */
|
|
|
|
|
|
|
|
RID RasterizerDummy::multimesh_create() {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
return multimesh_owner.make_rid(memnew(MultiMesh));
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::multimesh_set_instance_count(RID p_multimesh, int p_count) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
|
|
|
ERR_FAIL_COND(!multimesh);
|
|
|
|
|
|
|
|
multimesh->elements.clear(); // make sure to delete everything, so it "fails" in all implementations
|
|
|
|
multimesh->elements.resize(p_count);
|
|
|
|
}
|
|
|
|
int RasterizerDummy::multimesh_get_instance_count(RID p_multimesh) const {
|
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!multimesh, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return multimesh->elements.size();
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::multimesh_set_mesh(RID p_multimesh, RID p_mesh) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
|
|
|
ERR_FAIL_COND(!multimesh);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
multimesh->mesh = p_mesh;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::multimesh_set_aabb(RID p_multimesh, const AABB &p_aabb) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
|
|
|
ERR_FAIL_COND(!multimesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
multimesh->aabb = p_aabb;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::multimesh_instance_set_transform(RID p_multimesh, int p_index, const Transform &p_transform) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
|
|
|
ERR_FAIL_COND(!multimesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_index, multimesh->elements.size());
|
|
|
|
multimesh->elements[p_index].xform = p_transform;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::multimesh_instance_set_color(RID p_multimesh, int p_index, const Color &p_color) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
|
|
|
ERR_FAIL_COND(!multimesh)
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_index, multimesh->elements.size());
|
|
|
|
multimesh->elements[p_index].color = p_color;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RID RasterizerDummy::multimesh_get_mesh(RID p_multimesh) const {
|
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!multimesh, RID());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return multimesh->mesh;
|
|
|
|
}
|
|
|
|
AABB RasterizerDummy::multimesh_get_aabb(RID p_multimesh) const {
|
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!multimesh, AABB());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return multimesh->aabb;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Transform RasterizerDummy::multimesh_instance_get_transform(RID p_multimesh, int p_index) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!multimesh, Transform());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX_V(p_index, multimesh->elements.size(), Transform());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return multimesh->elements[p_index].xform;
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
Color RasterizerDummy::multimesh_instance_get_color(RID p_multimesh, int p_index) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!multimesh, Color());
|
|
|
|
ERR_FAIL_INDEX_V(p_index, multimesh->elements.size(), Color());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return multimesh->elements[p_index].color;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::multimesh_set_visible_instances(RID p_multimesh, int p_visible) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
|
|
|
ERR_FAIL_COND(!multimesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
multimesh->visible = p_visible;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int RasterizerDummy::multimesh_get_visible_instances(RID p_multimesh) const {
|
|
|
|
|
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_multimesh);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!multimesh, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
return multimesh->visible;
|
|
|
|
}
|
|
|
|
|
2014-05-29 13:56:39 +00:00
|
|
|
/* IMMEDIATE API */
|
|
|
|
|
|
|
|
RID RasterizerDummy::immediate_create() {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Immediate *im = memnew(Immediate);
|
2014-05-29 13:56:39 +00:00
|
|
|
return immediate_owner.make_rid(im);
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::immediate_begin(RID p_immediate, VS::PrimitiveType p_rimitive, RID p_texture) {
|
2014-05-29 13:56:39 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::immediate_vertex(RID p_immediate, const Vector3 &p_vertex) {
|
2014-05-29 13:56:39 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::immediate_normal(RID p_immediate, const Vector3 &p_normal) {
|
2014-05-29 13:56:39 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::immediate_tangent(RID p_immediate, const Plane &p_tangent) {
|
2014-05-29 13:56:39 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::immediate_color(RID p_immediate, const Color &p_color) {
|
2014-05-29 13:56:39 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::immediate_uv(RID p_immediate, const Vector2 &tex_uv) {
|
2014-05-29 13:56:39 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::immediate_uv2(RID p_immediate, const Vector2 &tex_uv) {
|
2014-05-29 13:56:39 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::immediate_end(RID p_immediate) {
|
2014-05-29 13:56:39 +00:00
|
|
|
}
|
|
|
|
void RasterizerDummy::immediate_clear(RID p_immediate) {
|
|
|
|
}
|
|
|
|
|
|
|
|
AABB RasterizerDummy::immediate_get_aabb(RID p_immediate) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
return AABB(Vector3(-1, -1, -1), Vector3(2, 2, 2));
|
2014-05-29 13:56:39 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::immediate_set_material(RID p_immediate, RID p_material) {
|
2014-05-29 13:56:39 +00:00
|
|
|
|
|
|
|
Immediate *im = immediate_owner.get(p_immediate);
|
|
|
|
ERR_FAIL_COND(!im);
|
2017-03-18 23:36:26 +00:00
|
|
|
im->material = p_material;
|
2014-05-29 13:56:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RID RasterizerDummy::immediate_get_material(RID p_immediate) const {
|
|
|
|
|
|
|
|
const Immediate *im = immediate_owner.get(p_immediate);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!im, RID());
|
2014-05-29 13:56:39 +00:00
|
|
|
return im->material;
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
/* PARTICLES API */
|
|
|
|
|
|
|
|
RID RasterizerDummy::particles_create() {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = memnew(Particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, RID());
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles_owner.make_rid(particles);
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::particles_set_amount(RID p_particles, int p_amount) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND(p_amount < 1);
|
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.amount = p_amount;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int RasterizerDummy::particles_get_amount(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.amount;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::particles_set_emitting(RID p_particles, bool p_emitting) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.emitting = p_emitting;
|
|
|
|
;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
bool RasterizerDummy::particles_is_emitting(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, false);
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.emitting;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_set_visibility_aabb(RID p_particles, const AABB &p_visibility) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.visibility_aabb = p_visibility;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_set_emission_half_extents(RID p_particles, const Vector3 &p_half_extents) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.emission_half_extents = p_half_extents;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
Vector3 RasterizerDummy::particles_get_emission_half_extents(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, Vector3());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return particles->data.emission_half_extents;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_set_emission_base_velocity(RID p_particles, const Vector3 &p_base_velocity) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.emission_base_velocity = p_base_velocity;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Vector3 RasterizerDummy::particles_get_emission_base_velocity(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, Vector3());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return particles->data.emission_base_velocity;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_set_emission_points(RID p_particles, const DVector<Vector3> &p_points) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.emission_points = p_points;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DVector<Vector3> RasterizerDummy::particles_get_emission_points(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, DVector<Vector3>());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return particles->data.emission_points;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_set_gravity_normal(RID p_particles, const Vector3 &p_normal) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.gravity_normal = p_normal;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
Vector3 RasterizerDummy::particles_get_gravity_normal(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, Vector3());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return particles->data.gravity_normal;
|
|
|
|
}
|
|
|
|
|
|
|
|
AABB RasterizerDummy::particles_get_visibility_aabb(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, AABB());
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.visibility_aabb;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_set_variable(RID p_particles, VS::ParticleVariable p_variable, float p_value) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_variable, VS::PARTICLE_VAR_MAX);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.particle_vars[p_variable] = p_value;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
float RasterizerDummy::particles_get_variable(RID p_particles, VS::ParticleVariable p_variable) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.particle_vars[p_variable];
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_set_randomness(RID p_particles, VS::ParticleVariable p_variable, float p_randomness) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.particle_randomness[p_variable] = p_randomness;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
float RasterizerDummy::particles_get_randomness(RID p_particles, VS::ParticleVariable p_variable) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.particle_randomness[p_variable];
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::particles_set_color_phases(RID p_particles, int p_phases) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND(p_phases < 0 || p_phases > VS::MAX_PARTICLE_COLOR_PHASES);
|
|
|
|
particles->data.color_phase_count = p_phases;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
int RasterizerDummy::particles_get_color_phases(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.color_phase_count;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::particles_set_color_phase_pos(RID p_particles, int p_phase, float p_pos) {
|
|
|
|
|
|
|
|
ERR_FAIL_INDEX(p_phase, VS::MAX_PARTICLE_COLOR_PHASES);
|
2017-03-18 23:36:26 +00:00
|
|
|
if (p_pos < 0.0)
|
|
|
|
p_pos = 0.0;
|
|
|
|
if (p_pos > 1.0)
|
|
|
|
p_pos = 1.0;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.color_phases[p_phase].pos = p_pos;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
float RasterizerDummy::particles_get_color_phase_pos(RID p_particles, int p_phase) const {
|
|
|
|
|
|
|
|
ERR_FAIL_INDEX_V(p_phase, VS::MAX_PARTICLE_COLOR_PHASES, -1.0);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.color_phases[p_phase].pos;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_set_color_phase_color(RID p_particles, int p_phase, const Color &p_color) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
ERR_FAIL_INDEX(p_phase, VS::MAX_PARTICLE_COLOR_PHASES);
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.color_phases[p_phase].color = p_color;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
//update alpha
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->has_alpha = false;
|
|
|
|
for (int i = 0; i < VS::MAX_PARTICLE_COLOR_PHASES; i++) {
|
|
|
|
if (particles->data.color_phases[i].color.a < 0.99)
|
|
|
|
particles->has_alpha = true;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Color RasterizerDummy::particles_get_color_phase_color(RID p_particles, int p_phase) const {
|
|
|
|
|
|
|
|
ERR_FAIL_INDEX_V(p_phase, VS::MAX_PARTICLE_COLOR_PHASES, Color());
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, Color());
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.color_phases[p_phase].color;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::particles_set_attractors(RID p_particles, int p_attractors) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND(p_attractors < 0 || p_attractors > VisualServer::MAX_PARTICLE_ATTRACTORS);
|
|
|
|
particles->data.attractor_count = p_attractors;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
int RasterizerDummy::particles_get_attractors(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, -1);
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.attractor_count;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_set_attractor_pos(RID p_particles, int p_attractor, const Vector3 &p_pos) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_attractor, particles->data.attractor_count);
|
|
|
|
particles->data.attractors[p_attractor].pos = p_pos;
|
|
|
|
;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
Vector3 RasterizerDummy::particles_get_attractor_pos(RID p_particles, int p_attractor) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, Vector3());
|
|
|
|
ERR_FAIL_INDEX_V(p_attractor, particles->data.attractor_count, Vector3());
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.attractors[p_attractor].pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::particles_set_attractor_strength(RID p_particles, int p_attractor, float p_force) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_attractor, particles->data.attractor_count);
|
|
|
|
particles->data.attractors[p_attractor].force = p_force;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
float RasterizerDummy::particles_get_attractor_strength(RID p_particles, int p_attractor) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, 0);
|
|
|
|
ERR_FAIL_INDEX_V(p_attractor, particles->data.attractor_count, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.attractors[p_attractor].force;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_set_material(RID p_particles, RID p_material, bool p_owned) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
|
|
|
if (particles->material_owned && particles->material.is_valid())
|
|
|
|
free(particles->material);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->material_owned = p_owned;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->material = p_material;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
RID RasterizerDummy::particles_get_material(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, RID());
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->material;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::particles_set_use_local_coordinates(RID p_particles, bool p_enable) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.local_coordinates = p_enable;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool RasterizerDummy::particles_is_using_local_coordinates(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, false);
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.local_coordinates;
|
|
|
|
}
|
|
|
|
bool RasterizerDummy::particles_has_height_from_velocity(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, false);
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.height_from_velocity;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::particles_set_height_from_velocity(RID p_particles, bool p_enable) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Particles *particles = particles_owner.get(p_particles);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles);
|
2017-03-18 23:36:26 +00:00
|
|
|
particles->data.height_from_velocity = p_enable;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AABB RasterizerDummy::particles_get_aabb(RID p_particles) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Particles *particles = particles_owner.get(p_particles);
|
|
|
|
ERR_FAIL_COND_V(!particles, AABB());
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles->data.visibility_aabb;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SKELETON API */
|
|
|
|
|
|
|
|
RID RasterizerDummy::skeleton_create() {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Skeleton *skeleton = memnew(Skeleton);
|
|
|
|
ERR_FAIL_COND_V(!skeleton, RID());
|
|
|
|
return skeleton_owner.make_rid(skeleton);
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::skeleton_resize(RID p_skeleton, int p_bones) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Skeleton *skeleton = skeleton_owner.get(p_skeleton);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!skeleton);
|
|
|
|
if (p_bones == skeleton->bones.size()) {
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
|
|
|
|
skeleton->bones.resize(p_bones);
|
|
|
|
}
|
|
|
|
int RasterizerDummy::skeleton_get_bone_count(RID p_skeleton) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Skeleton *skeleton = skeleton_owner.get(p_skeleton);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND_V(!skeleton, -1);
|
|
|
|
return skeleton->bones.size();
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::skeleton_bone_set_transform(RID p_skeleton, int p_bone, const Transform &p_transform) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Skeleton *skeleton = skeleton_owner.get(p_skeleton);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!skeleton);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_bone, skeleton->bones.size());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
skeleton->bones[p_bone] = p_transform;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Transform RasterizerDummy::skeleton_bone_get_transform(RID p_skeleton, int p_bone) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Skeleton *skeleton = skeleton_owner.get(p_skeleton);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND_V(!skeleton, Transform());
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX_V(p_bone, skeleton->bones.size(), Transform());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
// something
|
|
|
|
return skeleton->bones[p_bone];
|
|
|
|
}
|
|
|
|
|
|
|
|
/* LIGHT API */
|
|
|
|
|
|
|
|
RID RasterizerDummy::light_create(VS::LightType p_type) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Light *light = memnew(Light);
|
|
|
|
light->type = p_type;
|
2014-02-10 01:10:30 +00:00
|
|
|
return light_owner.make_rid(light);
|
|
|
|
}
|
|
|
|
|
|
|
|
VS::LightType RasterizerDummy::light_get_type(RID p_light) const {
|
|
|
|
|
|
|
|
Light *light = light_owner.get(p_light);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!light, VS::LIGHT_OMNI);
|
2014-02-10 01:10:30 +00:00
|
|
|
return light->type;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_set_color(RID p_light, VS::LightColor p_type, const Color &p_color) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Light *light = light_owner.get(p_light);
|
|
|
|
ERR_FAIL_COND(!light);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_type, 3);
|
|
|
|
light->colors[p_type] = p_color;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
Color RasterizerDummy::light_get_color(RID p_light, VS::LightColor p_type) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Light *light = light_owner.get(p_light);
|
|
|
|
ERR_FAIL_COND_V(!light, Color());
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX_V(p_type, 3, Color());
|
2014-02-10 01:10:30 +00:00
|
|
|
return light->colors[p_type];
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_set_shadow(RID p_light, bool p_enabled) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Light *light = light_owner.get(p_light);
|
|
|
|
ERR_FAIL_COND(!light);
|
2017-03-18 23:36:26 +00:00
|
|
|
light->shadow_enabled = p_enabled;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool RasterizerDummy::light_has_shadow(RID p_light) const {
|
|
|
|
|
|
|
|
Light *light = light_owner.get(p_light);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!light, false);
|
2014-02-10 01:10:30 +00:00
|
|
|
return light->shadow_enabled;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_set_volumetric(RID p_light, bool p_enabled) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Light *light = light_owner.get(p_light);
|
|
|
|
ERR_FAIL_COND(!light);
|
2017-03-18 23:36:26 +00:00
|
|
|
light->volumetric_enabled = p_enabled;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
bool RasterizerDummy::light_is_volumetric(RID p_light) const {
|
|
|
|
|
|
|
|
Light *light = light_owner.get(p_light);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!light, false);
|
2014-02-10 01:10:30 +00:00
|
|
|
return light->volumetric_enabled;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_set_projector(RID p_light, RID p_texture) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Light *light = light_owner.get(p_light);
|
|
|
|
ERR_FAIL_COND(!light);
|
2017-03-18 23:36:26 +00:00
|
|
|
light->projector = p_texture;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
RID RasterizerDummy::light_get_projector(RID p_light) const {
|
|
|
|
|
|
|
|
Light *light = light_owner.get(p_light);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!light, RID());
|
2014-02-10 01:10:30 +00:00
|
|
|
return light->projector;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::light_set_var(RID p_light, VS::LightParam p_var, float p_value) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Light *light = light_owner.get(p_light);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!light);
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_var, VS::LIGHT_PARAM_MAX);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
light->vars[p_var] = p_value;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
float RasterizerDummy::light_get_var(RID p_light, VS::LightParam p_var) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Light *light = light_owner.get(p_light);
|
|
|
|
ERR_FAIL_COND_V(!light, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX_V(p_var, VS::LIGHT_PARAM_MAX, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return light->vars[p_var];
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_set_operator(RID p_light, VS::LightOp p_op) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Light *light = light_owner.get(p_light);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!light);
|
|
|
|
};
|
|
|
|
|
|
|
|
VS::LightOp RasterizerDummy::light_get_operator(RID p_light) const {
|
|
|
|
|
|
|
|
return VS::LightOp(0);
|
|
|
|
};
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
VS::LightOmniShadowMode RasterizerDummy::light_omni_get_shadow_mode(RID p_light) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return VS::LightOmniShadowMode(0);
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_directional_set_shadow_mode(RID p_light, VS::LightDirectionalShadowMode p_mode) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VS::LightDirectionalShadowMode RasterizerDummy::light_directional_get_shadow_mode(RID p_light) const {
|
|
|
|
|
|
|
|
return VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_directional_set_shadow_param(RID p_light, VS::LightDirectionalShadowParam p_param, float p_value) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
float RasterizerDummy::light_directional_get_shadow_param(RID p_light, VS::LightDirectionalShadowParam p_param) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
AABB RasterizerDummy::light_get_aabb(RID p_light) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Light *light = light_owner.get(p_light);
|
|
|
|
ERR_FAIL_COND_V(!light, AABB());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
switch (light->type) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
case VS::LIGHT_SPOT: {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
float len = light->vars[VS::LIGHT_PARAM_RADIUS];
|
|
|
|
float size = Math::tan(Math::deg2rad(light->vars[VS::LIGHT_PARAM_SPOT_ANGLE])) * len;
|
|
|
|
return AABB(Vector3(-size, -size, -len), Vector3(size * 2, size * 2, len));
|
2014-02-10 01:10:30 +00:00
|
|
|
} break;
|
|
|
|
case VS::LIGHT_OMNI: {
|
|
|
|
|
|
|
|
float r = light->vars[VS::LIGHT_PARAM_RADIUS];
|
2017-03-18 23:36:26 +00:00
|
|
|
return AABB(-Vector3(r, r, r), Vector3(r, r, r) * 2);
|
2014-02-10 01:10:30 +00:00
|
|
|
} break;
|
|
|
|
case VS::LIGHT_DIRECTIONAL: {
|
|
|
|
|
|
|
|
return AABB();
|
|
|
|
} break;
|
|
|
|
default: {}
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_V(AABB());
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RID RasterizerDummy::light_instance_create(RID p_light) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Light *light = light_owner.get(p_light);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND_V(!light, RID());
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
LightInstance *light_instance = memnew(LightInstance);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
light_instance->light = p_light;
|
|
|
|
light_instance->base = light;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
return light_instance_owner.make_rid(light_instance);
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_instance_set_transform(RID p_light_instance, const Transform &p_transform) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
LightInstance *lighti = light_instance_owner.get(p_light_instance);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!lighti);
|
2017-03-18 23:36:26 +00:00
|
|
|
lighti->transform = p_transform;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool RasterizerDummy::light_instance_has_shadow(RID p_light_instance) const {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RasterizerDummy::light_instance_assign_shadow(RID p_light_instance) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
Rasterizer::ShadowType RasterizerDummy::light_instance_get_shadow_type(RID p_light_instance) const {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
LightInstance *lighti = light_instance_owner.get(p_light_instance);
|
|
|
|
ERR_FAIL_COND_V(!lighti, Rasterizer::SHADOW_NONE);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
switch (lighti->base->type) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
case VS::LIGHT_DIRECTIONAL: return SHADOW_PSM; break;
|
|
|
|
case VS::LIGHT_OMNI: return SHADOW_DUAL_PARABOLOID; break;
|
|
|
|
case VS::LIGHT_SPOT: return SHADOW_SIMPLE; break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Rasterizer::SHADOW_NONE;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Rasterizer::ShadowType RasterizerDummy::light_instance_get_shadow_type(RID p_light_instance, bool p_far) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return SHADOW_NONE;
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_instance_set_shadow_transform(RID p_light_instance, int p_index, const CameraMatrix &p_camera, const Transform &p_transform, float p_split_near, float p_split_far) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int RasterizerDummy::light_instance_get_shadow_passes(RID p_light_instance) const {
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-06-16 13:22:26 +00:00
|
|
|
bool RasterizerDummy::light_instance_get_pssm_shadow_overlap(RID p_light_instance) const {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::light_instance_set_custom_transform(RID p_light_instance, int p_index, const CameraMatrix &p_camera, const Transform &p_transform, float p_split_near, float p_split_far) {
|
2014-06-16 13:22:26 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
LightInstance *lighti = light_instance_owner.get(p_light_instance);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!lighti);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND(lighti->base->type != VS::LIGHT_DIRECTIONAL);
|
|
|
|
ERR_FAIL_INDEX(p_index, 1);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
lighti->custom_projection = p_camera;
|
|
|
|
lighti->custom_transform = p_transform;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
void RasterizerDummy::shadow_clear_near() {
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RasterizerDummy::shadow_allocate_near(RID p_light) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RasterizerDummy::shadow_allocate_far(RID p_light) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* PARTICLES INSTANCE */
|
|
|
|
|
|
|
|
RID RasterizerDummy::particles_instance_create(RID p_particles) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_COND_V(!particles_owner.owns(p_particles), RID());
|
|
|
|
ParticlesInstance *particles_instance = memnew(ParticlesInstance);
|
|
|
|
ERR_FAIL_COND_V(!particles_instance, RID());
|
|
|
|
particles_instance->particles = p_particles;
|
2014-02-10 01:10:30 +00:00
|
|
|
return particles_instance_owner.make_rid(particles_instance);
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::particles_instance_set_transform(RID p_particles_instance, const Transform &p_transform) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ParticlesInstance *particles_instance = particles_instance_owner.get(p_particles_instance);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!particles_instance);
|
2017-03-18 23:36:26 +00:00
|
|
|
particles_instance->transform = p_transform;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* RENDER API */
|
|
|
|
/* all calls (inside begin/end shadow) are always warranted to be in the following order: */
|
|
|
|
|
|
|
|
RID RasterizerDummy::viewport_data_create() {
|
|
|
|
|
|
|
|
return RID();
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
RID RasterizerDummy::render_target_create() {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return RID();
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::render_target_set_size(RID p_render_target, int p_width, int p_height) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
RID RasterizerDummy::render_target_get_texture(RID p_render_target) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return RID();
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::render_target_renedered_in_frame(RID p_render_target) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::begin_frame() {
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::capture_viewport(Image *r_capture) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::clear_viewport(const Color &p_color){
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::set_viewport(const VS::ViewportRect &p_viewport) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2014-04-15 01:43:44 +00:00
|
|
|
void RasterizerDummy::set_render_target(RID p_render_target, bool p_transparent_bg, bool p_vflip) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::begin_scene(RID p_viewport_data, RID p_env, VS::ScenarioDebugMode p_debug){
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::begin_shadow_map(RID p_light_instance, int p_shadow_pass) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::set_camera(const Transform &p_world, const CameraMatrix &p_projection, bool p_ortho_hint) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::add_light(RID p_light_instance) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::add_mesh(const RID &p_mesh, const InstanceData *p_data) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::add_multimesh(const RID &p_multimesh, const InstanceData *p_data) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::add_particles(const RID &p_particle_instance, const InstanceData *p_data) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::end_scene() {
|
|
|
|
}
|
|
|
|
void RasterizerDummy::end_shadow_map() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::end_frame() {
|
2015-04-02 15:59:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RID RasterizerDummy::canvas_light_occluder_create() {
|
|
|
|
return RID();
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_light_occluder_set_polylines(RID p_occluder, const DVector<Vector2> &p_lines) {
|
2015-04-02 15:59:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RID RasterizerDummy::canvas_light_shadow_buffer_create(int p_width) {
|
|
|
|
|
|
|
|
return RID();
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_light_shadow_buffer_update(RID p_buffer, const Matrix32 &p_light_xform, int p_light_mask, float p_near, float p_far, CanvasLightOccluderInstance *p_occluders, CameraMatrix *p_xform_cache) {
|
2015-04-02 15:59:23 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_debug_viewport_shadows(CanvasLight *p_lights_with_shadow) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* CANVAS API */
|
|
|
|
|
2015-04-02 15:59:23 +00:00
|
|
|
void RasterizerDummy::begin_canvas_bg() {
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
void RasterizerDummy::canvas_begin() {
|
|
|
|
}
|
2014-04-15 01:43:44 +00:00
|
|
|
void RasterizerDummy::canvas_disable_blending() {
|
|
|
|
}
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
void RasterizerDummy::canvas_set_opacity(float p_opacity) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::canvas_set_blend_mode(VS::MaterialBlendMode p_mode) {
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_begin_rect(const Matrix32 &p_transform) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_set_clip(bool p_clip, const Rect2 &p_rect) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::canvas_end_rect() {
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_draw_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_draw_rect(const Rect2 &p_rect, int p_flags, const Rect2 &p_source, RID p_texture, const Color &p_modulate) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_draw_style_box(const Rect2 &p_rect, const Rect2 &p_src_region, RID p_texture, const float *p_margin, bool p_draw_center, const Color &p_modulate) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_draw_primitive(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_draw_polygon(int p_vertex_count, const int *p_indices, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, const RID &p_texture, bool p_singlecolor) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_set_transform(const Matrix32 &p_transform) {
|
2015-01-10 20:35:26 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::canvas_render_items(CanvasItem *p_item_list, int p_z, const Color &p_modulate, CanvasLight *p_light) {
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ENVIRONMENT */
|
|
|
|
|
|
|
|
RID RasterizerDummy::environment_create() {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Environment *env = memnew(Environment);
|
2014-02-10 01:10:30 +00:00
|
|
|
return environment_owner.make_rid(env);
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::environment_set_background(RID p_env, VS::EnvironmentBG p_bg) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_bg, VS::ENV_BG_MAX);
|
|
|
|
Environment *env = environment_owner.get(p_env);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!env);
|
2017-03-18 23:36:26 +00:00
|
|
|
env->bg_mode = p_bg;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
VS::EnvironmentBG RasterizerDummy::environment_get_background(RID p_env) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
const Environment *env = environment_owner.get(p_env);
|
|
|
|
ERR_FAIL_COND_V(!env, VS::ENV_BG_MAX);
|
2014-02-10 01:10:30 +00:00
|
|
|
return env->bg_mode;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::environment_set_background_param(RID p_env, VS::EnvironmentBGParam p_param, const Variant &p_value) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_param, VS::ENV_BG_PARAM_MAX);
|
|
|
|
Environment *env = environment_owner.get(p_env);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!env);
|
2017-03-18 23:36:26 +00:00
|
|
|
env->bg_param[p_param] = p_value;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
Variant RasterizerDummy::environment_get_background_param(RID p_env, VS::EnvironmentBGParam p_param) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX_V(p_param, VS::ENV_BG_PARAM_MAX, Variant());
|
|
|
|
const Environment *env = environment_owner.get(p_env);
|
|
|
|
ERR_FAIL_COND_V(!env, Variant());
|
2014-02-10 01:10:30 +00:00
|
|
|
return env->bg_param[p_param];
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::environment_set_enable_fx(RID p_env, VS::EnvironmentFx p_effect, bool p_enabled) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_effect, VS::ENV_FX_MAX);
|
|
|
|
Environment *env = environment_owner.get(p_env);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!env);
|
2017-03-18 23:36:26 +00:00
|
|
|
env->fx_enabled[p_effect] = p_enabled;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::environment_is_fx_enabled(RID p_env, VS::EnvironmentFx p_effect) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX_V(p_effect, VS::ENV_FX_MAX, false);
|
|
|
|
const Environment *env = environment_owner.get(p_env);
|
|
|
|
ERR_FAIL_COND_V(!env, false);
|
2014-02-10 01:10:30 +00:00
|
|
|
return env->fx_enabled[p_effect];
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::environment_fx_set_param(RID p_env, VS::EnvironmentFxParam p_param, const Variant &p_value) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX(p_param, VS::ENV_FX_PARAM_MAX);
|
|
|
|
Environment *env = environment_owner.get(p_env);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!env);
|
2017-03-18 23:36:26 +00:00
|
|
|
env->fx_param[p_param] = p_value;
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
Variant RasterizerDummy::environment_fx_get_param(RID p_env, VS::EnvironmentFxParam p_param) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ERR_FAIL_INDEX_V(p_param, VS::ENV_FX_PARAM_MAX, Variant());
|
|
|
|
const Environment *env = environment_owner.get(p_env);
|
|
|
|
ERR_FAIL_COND_V(!env, Variant());
|
2014-02-10 01:10:30 +00:00
|
|
|
return env->fx_param[p_param];
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
RID RasterizerDummy::sampled_light_dp_create(int p_width, int p_height) {
|
2014-10-28 01:54:32 +00:00
|
|
|
|
|
|
|
return sampled_light_owner.make_rid(memnew(SampledLight));
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::sampled_light_dp_update(RID p_sampled_light, const Color *p_data, float p_multiplier) {
|
|
|
|
}
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
/*MISC*/
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_texture(const RID &p_rid) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return texture_owner.owns(p_rid);
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_material(const RID &p_rid) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return material_owner.owns(p_rid);
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_mesh(const RID &p_rid) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return mesh_owner.owns(p_rid);
|
|
|
|
}
|
2014-05-29 13:56:39 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_immediate(const RID &p_rid) const {
|
2014-05-29 13:56:39 +00:00
|
|
|
|
|
|
|
return immediate_owner.owns(p_rid);
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_multimesh(const RID &p_rid) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return multimesh_owner.owns(p_rid);
|
|
|
|
}
|
|
|
|
bool RasterizerDummy::is_particles(const RID &p_beam) const {
|
|
|
|
|
|
|
|
return particles_owner.owns(p_beam);
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_light(const RID &p_rid) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return light_owner.owns(p_rid);
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_light_instance(const RID &p_rid) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return light_instance_owner.owns(p_rid);
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_particles_instance(const RID &p_rid) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return particles_instance_owner.owns(p_rid);
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_skeleton(const RID &p_rid) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return skeleton_owner.owns(p_rid);
|
|
|
|
}
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_environment(const RID &p_rid) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return environment_owner.owns(p_rid);
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_canvas_light_occluder(const RID &p_rid) const {
|
2015-04-02 15:59:23 +00:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
bool RasterizerDummy::is_shader(const RID &p_rid) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::free(const RID &p_rid) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
if (texture_owner.owns(p_rid)) {
|
|
|
|
|
|
|
|
// delete the texture
|
|
|
|
Texture *texture = texture_owner.get(p_rid);
|
|
|
|
texture_owner.free(p_rid);
|
|
|
|
memdelete(texture);
|
|
|
|
|
|
|
|
} else if (shader_owner.owns(p_rid)) {
|
|
|
|
|
|
|
|
// delete the texture
|
|
|
|
Shader *shader = shader_owner.get(p_rid);
|
|
|
|
shader_owner.free(p_rid);
|
|
|
|
memdelete(shader);
|
|
|
|
|
|
|
|
} else if (material_owner.owns(p_rid)) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Material *material = material_owner.get(p_rid);
|
2014-02-10 01:10:30 +00:00
|
|
|
material_owner.free(p_rid);
|
|
|
|
memdelete(material);
|
|
|
|
|
|
|
|
} else if (mesh_owner.owns(p_rid)) {
|
|
|
|
|
|
|
|
Mesh *mesh = mesh_owner.get(p_rid);
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
for (int i = 0; i < mesh->surfaces.size(); i++) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
memdelete(mesh->surfaces[i]);
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
mesh->surfaces.clear();
|
|
|
|
mesh_owner.free(p_rid);
|
|
|
|
memdelete(mesh);
|
|
|
|
|
|
|
|
} else if (multimesh_owner.owns(p_rid)) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
MultiMesh *multimesh = multimesh_owner.get(p_rid);
|
|
|
|
multimesh_owner.free(p_rid);
|
|
|
|
memdelete(multimesh);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2014-05-29 13:56:39 +00:00
|
|
|
} else if (immediate_owner.owns(p_rid)) {
|
|
|
|
|
|
|
|
Immediate *immediate = immediate_owner.get(p_rid);
|
|
|
|
immediate_owner.free(p_rid);
|
|
|
|
memdelete(immediate);
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
} else if (particles_owner.owns(p_rid)) {
|
|
|
|
|
|
|
|
Particles *particles = particles_owner.get(p_rid);
|
|
|
|
particles_owner.free(p_rid);
|
|
|
|
memdelete(particles);
|
|
|
|
} else if (particles_instance_owner.owns(p_rid)) {
|
|
|
|
|
|
|
|
ParticlesInstance *particles_isntance = particles_instance_owner.get(p_rid);
|
|
|
|
particles_instance_owner.free(p_rid);
|
|
|
|
memdelete(particles_isntance);
|
|
|
|
|
|
|
|
} else if (skeleton_owner.owns(p_rid)) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Skeleton *skeleton = skeleton_owner.get(p_rid);
|
2014-02-10 01:10:30 +00:00
|
|
|
skeleton_owner.free(p_rid);
|
|
|
|
memdelete(skeleton);
|
|
|
|
|
|
|
|
} else if (light_owner.owns(p_rid)) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Light *light = light_owner.get(p_rid);
|
2014-02-10 01:10:30 +00:00
|
|
|
light_owner.free(p_rid);
|
|
|
|
memdelete(light);
|
|
|
|
|
|
|
|
} else if (light_instance_owner.owns(p_rid)) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
LightInstance *light_instance = light_instance_owner.get(p_rid);
|
2014-02-10 01:10:30 +00:00
|
|
|
light_instance_owner.free(p_rid);
|
2017-03-18 23:36:26 +00:00
|
|
|
memdelete(light_instance);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
} else if (environment_owner.owns(p_rid)) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Environment *env = environment_owner.get(p_rid);
|
2014-02-10 01:10:30 +00:00
|
|
|
environment_owner.free(p_rid);
|
2017-03-18 23:36:26 +00:00
|
|
|
memdelete(env);
|
2014-10-28 01:54:32 +00:00
|
|
|
} else if (sampled_light_owner.owns(p_rid)) {
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
SampledLight *sampled_light = sampled_light_owner.get(p_rid);
|
2014-10-28 01:54:32 +00:00
|
|
|
ERR_FAIL_COND(!sampled_light);
|
|
|
|
|
|
|
|
sampled_light_owner.free(p_rid);
|
2017-03-18 23:36:26 +00:00
|
|
|
memdelete(sampled_light);
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::custom_shade_model_set_shader(int p_model, RID p_shader){
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
RID RasterizerDummy::custom_shade_model_get_shader(int p_model) const {
|
|
|
|
|
|
|
|
return RID();
|
|
|
|
};
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::custom_shade_model_set_name(int p_model, const String &p_name){
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
String RasterizerDummy::custom_shade_model_get_name(int p_model) const {
|
|
|
|
|
|
|
|
return String();
|
|
|
|
};
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::custom_shade_model_set_param_info(int p_model, const List<PropertyInfo> &p_info){
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
void RasterizerDummy::custom_shade_model_get_param_info(int p_model, List<PropertyInfo> *p_info) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
void RasterizerDummy::init() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void RasterizerDummy::finish() {
|
|
|
|
}
|
|
|
|
|
|
|
|
int RasterizerDummy::get_render_info(VS::RenderInfo p_info) {
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RasterizerDummy::needs_to_draw_next_frame() const {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RasterizerDummy::has_feature(VS::Features p_feature) const {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-09-13 02:15:02 +00:00
|
|
|
void RasterizerDummy::restore_framebuffer() {
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
RasterizerDummy::RasterizerDummy(){
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
RasterizerDummy::~RasterizerDummy(){
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
};
|