From ab9238cdb87f80e54dfab5cafdcbda514367353b Mon Sep 17 00:00:00 2001 From: n00b87 Date: Fri, 22 Aug 2025 21:19:23 -0500 Subject: [PATCH] FX materials can now use material properties before and after type is set --- rcbasic_runtime/CShader.cpp | 4 +- rcbasic_runtime/rc_actor_material.h | 5 +- rcbasic_runtime/rcbasic_runtime.depend | 4 +- rcbasic_runtime/rcbasic_runtime.layout | 312 ++++++++++++------------- 4 files changed, 164 insertions(+), 161 deletions(-) diff --git a/rcbasic_runtime/CShader.cpp b/rcbasic_runtime/CShader.cpp index 087c7fa..2d0d2f9 100755 --- a/rcbasic_runtime/CShader.cpp +++ b/rcbasic_runtime/CShader.cpp @@ -52,7 +52,7 @@ CShader::CShader(IrrlichtDevice* device, rc_shader_material_obj shader_material) if(gpu) { - std::cout << "Compiling Shader" << std::endl; + //std::cout << "Compiling Shader" << std::endl; //std::cout << shader_material.vert_shader << std::endl << std::endl; //std::cout << shader_material.frag_shader << std::endl << std::endl; p_material = gpu->addHighLevelShaderMaterial( @@ -60,7 +60,7 @@ CShader::CShader(IrrlichtDevice* device, rc_shader_material_obj shader_material) shader_material.frag_shader.c_str(), "pixelMain", video::EPST_PS_4_1, this, video::EMT_SOLID); - std::cout << "Result: " << p_material << std::endl; + //std::cout << "Result: " << p_material << std::endl; } diff --git a/rcbasic_runtime/rc_actor_material.h b/rcbasic_runtime/rc_actor_material.h index 8d925f7..03d96c7 100755 --- a/rcbasic_runtime/rc_actor_material.h +++ b/rcbasic_runtime/rc_actor_material.h @@ -28,7 +28,10 @@ bool createShaderMaterial(int material_id, int fx_material_type) //std::cout << "Shader Index = " << shader_index << std::endl; - rc_material[material_id].shader = new CShader(device, rc_shader_materials[shader_index]); + rc_material[material_id].shader = NULL; + + if(device) + rc_material[material_id].shader = new CShader(device, rc_shader_materials[shader_index]); if(rc_material[material_id].shader) { diff --git a/rcbasic_runtime/rcbasic_runtime.depend b/rcbasic_runtime/rcbasic_runtime.depend index 43715ad..9429f95 100755 --- a/rcbasic_runtime/rcbasic_runtime.depend +++ b/rcbasic_runtime/rcbasic_runtime.depend @@ -2527,7 +2527,7 @@ 1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_base_actor.h "ProjectiveTextures.h" -1755894050 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h +1755897401 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h "rc_fx_materials.h" 1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_animation.h @@ -2571,7 +2571,7 @@ 1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_fx_shaders.h -1755893833 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/CShader.cpp +1755897318 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/CShader.cpp "CShader.h" diff --git a/rcbasic_runtime/rcbasic_runtime.layout b/rcbasic_runtime/rcbasic_runtime.layout index f964fa1..fa8dd68 100755 --- a/rcbasic_runtime/rcbasic_runtime.layout +++ b/rcbasic_runtime/rcbasic_runtime.layout @@ -2,69 +2,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + @@ -72,34 +17,49 @@ - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + @@ -107,14 +67,59 @@ - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -127,59 +132,14 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -187,34 +147,29 @@ - + - + - + - + - + - + - + - + - + - - - - - - + @@ -222,44 +177,89 @@ + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +