diff --git a/doc/doc_files/getactormaterialtype.html b/doc/doc_files/getactormaterialtype.html index ae96d78..1f4aaf2 100644 --- a/doc/doc_files/getactormaterialtype.html +++ b/doc/doc_files/getactormaterialtype.html @@ -88,7 +88,40 @@ MATERIAL_TYPE_ONETEXTURE_BLEND 
  • - MATERIAL_TYPE_FORCE_32BIT  + FX_MATERIAL_TYPE_NORMAL_BLEND +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION2 +
  • +
  • + FX_MATERIAL_TYPE_GOOCH +
  • +
  • + FX_MATERIAL_TYPE_PLASTIC +
  • +
  • + FX_MATERIAL_TYPE_TANGENT +
  • +
  • + FX_MATERIAL_TYPE_SPEAKER +
  • +
  • + FX_MATERIAL_TYPE_PHONG_TEXTURE +
  • +
  • + FX_MATERIAL_TYPE_STYLE +
  • +
  • + FX_MATERIAL_TYPE_STYLE2 +
  • +
  • + FX_MATERIAL_TYPE_STYLE3 +
  • +
  • + FX_MATERIAL_TYPE_STYLE4

  • Related: diff --git a/doc/doc_files/getmaterialantialiasing.html b/doc/doc_files/getmaterialantialiasing.html index 25a6797..91bd19d 100644 --- a/doc/doc_files/getmaterialantialiasing.html +++ b/doc/doc_files/getmaterialantialiasing.html @@ -16,25 +16,25 @@


    Related: diff --git a/doc/doc_files/getmaterialconstant.html b/doc/doc_files/getmaterialconstant.html index 8a8120c..544eb65 100644 --- a/doc/doc_files/getmaterialconstant.html +++ b/doc/doc_files/getmaterialconstant.html @@ -11,6 +11,9 @@

    Gets the constant value of an FX material

    +

    + NOTE: To see a list of constants for each material type, reference SetMaterialConstant() +


    Related: SetMaterialConstant

    diff --git a/doc/doc_files/getmaterialtype.html b/doc/doc_files/getmaterialtype.html index b040404..cbba247 100644 --- a/doc/doc_files/getmaterialtype.html +++ b/doc/doc_files/getmaterialtype.html @@ -88,7 +88,40 @@ MATERIAL_TYPE_ONETEXTURE_BLEND 
  • - MATERIAL_TYPE_FORCE_32BIT  + FX_MATERIAL_TYPE_NORMAL_BLEND +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION2 +
  • +
  • + FX_MATERIAL_TYPE_GOOCH +
  • +
  • + FX_MATERIAL_TYPE_PLASTIC +
  • +
  • + FX_MATERIAL_TYPE_TANGENT +
  • +
  • + FX_MATERIAL_TYPE_SPEAKER +
  • +
  • + FX_MATERIAL_TYPE_PHONG_TEXTURE +
  • +
  • + FX_MATERIAL_TYPE_STYLE +
  • +
  • + FX_MATERIAL_TYPE_STYLE2 +
  • +
  • + FX_MATERIAL_TYPE_STYLE3 +
  • +
  • + FX_MATERIAL_TYPE_STYLE4

  • Related: diff --git a/doc/doc_files/serenity_api_meshes.html b/doc/doc_files/serenity_api_meshes.html index e3a2862..49dd75b 100644 --- a/doc/doc_files/serenity_api_meshes.html +++ b/doc/doc_files/serenity_api_meshes.html @@ -185,6 +185,17 @@

    + Function Serenity_GetMeshAnimationIDByName(mesh_index, animation_name$) +

    + +

    +
    +

    +

    \ No newline at end of file diff --git a/doc/doc_files/setactormaterialtype.html b/doc/doc_files/setactormaterialtype.html index d0d5809..533e71f 100644 --- a/doc/doc_files/setactormaterialtype.html +++ b/doc/doc_files/setactormaterialtype.html @@ -91,7 +91,40 @@ MATERIAL_TYPE_ONETEXTURE_BLEND 

  • - MATERIAL_TYPE_FORCE_32BIT  + FX_MATERIAL_TYPE_NORMAL_BLEND +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION2 +
  • +
  • + FX_MATERIAL_TYPE_GOOCH +
  • +
  • + FX_MATERIAL_TYPE_PLASTIC +
  • +
  • + FX_MATERIAL_TYPE_TANGENT +
  • +
  • + FX_MATERIAL_TYPE_SPEAKER +
  • +
  • + FX_MATERIAL_TYPE_PHONG_TEXTURE +
  • +
  • + FX_MATERIAL_TYPE_STYLE +
  • +
  • + FX_MATERIAL_TYPE_STYLE2 +
  • +
  • + FX_MATERIAL_TYPE_STYLE3 +
  • +
  • + FX_MATERIAL_TYPE_STYLE4

  • Related: diff --git a/doc/doc_files/setmaterialantialiasing.html b/doc/doc_files/setmaterialantialiasing.html index b8a2218..c0dd5e8 100644 --- a/doc/doc_files/setmaterialantialiasing.html +++ b/doc/doc_files/setmaterialantialiasing.html @@ -16,25 +16,25 @@


    Related: diff --git a/doc/doc_files/setmaterialconstant.html b/doc/doc_files/setmaterialconstant.html index 5e01075..1d73ecd 100644 --- a/doc/doc_files/setmaterialconstant.html +++ b/doc/doc_files/setmaterialconstant.html @@ -11,6 +11,186 @@

    Sets the constant value of an FX material

    +

    + NOTE: Each constant can ve of type Float, Vec2, Vec3, or Vec4. The ones listed as defined are set internally by the runtime. +

    +

    + FX_MATERIAL_TYPE_NORMAL_BLEND Possible Constants +

    + +

    + FX_MATERIAL_TYPE_REFRACTION Possible Constants +

    + +

    + FX_MATERIAL_TYPE_REFRACTION2 Possible Constants +

    + +

    + FX_MATERIAL_TYPE_GOOCH Possible Constants +

    + +

    + FX_MATERIAL_TYPE_PLASTIC Possible Constants +

    + +

    + FX_MATERIAL_TYPE_TANGENT Possible Constants +

    + +

    + FX_MATERIAL_TYPE_SPEAKER Possible Constants +

    + +

    + FX_MATERIAL_TYPE_PHONG_TEXTURE Possible Constants +

    + +

    + FX_MATERIAL_TYPE_STYLE Possible Constants +

    + +

    + FX_MATERIAL_TYPE_STYLE2 Possible Constants +

    + +

    + FX_MATERIAL_TYPE_STYLE3 Possible Constants +

    + +

    + FX_MATERIAL_TYPE_STYLE4 Possible Constants +

    +

    Related: GetMaterialConstant

    diff --git a/doc/doc_files/setmaterialtype.html b/doc/doc_files/setmaterialtype.html index 5029ffa..9fe2b62 100644 --- a/doc/doc_files/setmaterialtype.html +++ b/doc/doc_files/setmaterialtype.html @@ -88,7 +88,40 @@ MATERIAL_TYPE_ONETEXTURE_BLEND 
  • - MATERIAL_TYPE_FORCE_32BIT  + FX_MATERIAL_TYPE_NORMAL_BLEND +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION2 +
  • +
  • + FX_MATERIAL_TYPE_GOOCH +
  • +
  • + FX_MATERIAL_TYPE_PLASTIC +
  • +
  • + FX_MATERIAL_TYPE_TANGENT +
  • +
  • + FX_MATERIAL_TYPE_SPEAKER +
  • +
  • + FX_MATERIAL_TYPE_PHONG_TEXTURE +
  • +
  • + FX_MATERIAL_TYPE_STYLE +
  • +
  • + FX_MATERIAL_TYPE_STYLE2 +
  • +
  • + FX_MATERIAL_TYPE_STYLE3 +
  • +
  • + FX_MATERIAL_TYPE_STYLE4

  • Related: diff --git a/doc/files/getmaterialconstant.txt b/doc/files/getmaterialconstant.txt index d78ef3b..6ac4940 100644 --- a/doc/files/getmaterialconstant.txt +++ b/doc/files/getmaterialconstant.txt @@ -3,4 +3,6 @@ Gets the constant value of an FX material +NOTE: To see a list of constants for each material type, reference SetMaterialConstant() + #ref SetMaterialConstant diff --git a/doc/files/setmaterialconstant.txt b/doc/files/setmaterialconstant.txt index b7da217..47b3c28 100644 --- a/doc/files/setmaterialconstant.txt +++ b/doc/files/setmaterialconstant.txt @@ -3,4 +3,115 @@ Sets the constant value of an FX material + +NOTE: Each constant can ve of type Float, Vec2, Vec3, or Vec4. The ones listed as defined are set internally by the runtime. + +FX_MATERIAL_TYPE_NORMAL_BLEND +Possible Constants +#list ul +#li [Float] Alpha +#/list + + +FX_MATERIAL_TYPE_REFRACTION +Possible Constants +#list ul +#li [Vec3] BaseColor +#li [Float] Depth +#li [Float] MixRatio +#li [Float] FrameWidth +#li [Float] FrameHeight +#li [-Defined-] EnvMap +#li [-Defined-] RefractionMap +#/list + + +FX_MATERIAL_TYPE_REFRACTION2 +Possible Constants +#list ul +#li NONE +#/list + +FX_MATERIAL_TYPE_GOOCH +Possible Constants +#list ul +#li [Vec3] SurfaceColor +#li [Vec3] WarmColor +#li [Vec3] CoolColor +#li [Float] DiffuseWarm +#li [Float] DiffuseCool +#/list + +FX_MATERIAL_TYPE_PLASTIC +Possible Constants +#list ul +#li [Vec4] Color +#li [Float] Intensity +#/list + + +FX_MATERIAL_TYPE_TANGENT +Possible Constants +#list ul +#li [Float] BViewSpace +#li [Defined] MatView +#/list + + +FX_MATERIAL_TYPE_SPEAKER +Possible Constants +#list ul +#li [Float] PulseSharpness +#li [Float] Beat +#li [Float] Amplitude +#li [Float] BassFrequency +#li [Defined] Base +#li [Defined] View_Proj_Matrix +#li [Defined] View_Matrix +#li [Defined] Time_0_X +#/list + + +FX_MATERIAL_TYPE_PHONG_TEXTURE +Possible Constants +#list ul +#li [Vec4] fvAmbient +#li [Vec4] fvSpecular +#li [Vec4] fvDiffuse +#li [Float] fSpecularPower +#li [-Defined-] BaseMap +#li [-Defined-] fvEyePosition +#/list + + +FX_MATERIAL_TYPE_STYLE +Possible Constants +#list ul +#li [-Defined-] LightPos +#/list + + +FX_MATERIAL_TYPE_STYLE2 +Possible Constants +#list ul +#li [-Defined-] BaseMap +#/list + + +FX_MATERIAL_TYPE_STYLE3 +Possible Constants +#list ul +#li NONE +#/list + +FX_MATERIAL_TYPE_STYLE4 +Possible Constants +#list ul +#li [Float] SilhouetteThreshold +#li [Vec4] SilhouetteColor +#li [Float] EnableLighting +#li [-Defined-] Tex +#/list + + #ref GetMaterialConstant diff --git a/doc/serenity_docs/serenity_api_meshes.html b/doc/serenity_docs/serenity_api_meshes.html index e3a2862..49dd75b 100644 --- a/doc/serenity_docs/serenity_api_meshes.html +++ b/doc/serenity_docs/serenity_api_meshes.html @@ -185,6 +185,17 @@

    + Function Serenity_GetMeshAnimationIDByName(mesh_index, animation_name$) +

    + +

    +
    +

    +

    \ No newline at end of file diff --git a/doc/serenity_docs/serenity_api_meshes.txt b/doc/serenity_docs/serenity_api_meshes.txt index 4e07024..20560a4 100644 --- a/doc/serenity_docs/serenity_api_meshes.txt +++ b/doc/serenity_docs/serenity_api_meshes.txt @@ -95,3 +95,9 @@ #li Returns the RCBasic mesh animation id #/list
    + +Function Serenity_GetMeshAnimationIDByName(mesh_index, animation_name$) +#list ul +#li Returns the RCBasic mesh animation id +#/list +
    diff --git a/doc/serenity_docs/update_doc.sh b/doc/serenity_docs/update_doc.sh old mode 100644 new mode 100755 diff --git a/rcbasic_build/main.cpp b/rcbasic_build/main.cpp index bba132c..0b57e47 100755 --- a/rcbasic_build/main.cpp +++ b/rcbasic_build/main.cpp @@ -959,7 +959,7 @@ int main(int argc, char * argv[]) if(rc_filename.compare("--version")==0) { - cout << "RCBASIC Compiler v4.3" << endl; + cout << "RCBASIC Compiler v4.4" << endl; return 0; } diff --git a/rcbasic_build/rcbasic_build.layout b/rcbasic_build/rcbasic_build.layout index c73737d..bd41c27 100755 --- a/rcbasic_build/rcbasic_build.layout +++ b/rcbasic_build/rcbasic_build.layout @@ -2,52 +2,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -55,9 +12,52 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rcbasic_runtime/main.cpp b/rcbasic_runtime/main.cpp index 8cc4b89..5d2ddb5 100755 --- a/rcbasic_runtime/main.cpp +++ b/rcbasic_runtime/main.cpp @@ -4398,7 +4398,7 @@ int main(int argc, char * argv[]) if(rc_filename.compare("--version")==0) { - cout << "RCBASIC Runtime v4.3" << endl; + cout << "RCBASIC Runtime v4.4" << endl; return 0; } @@ -4452,15 +4452,15 @@ int main(int argc, char * argv[]) //ogles2 test #ifdef RC_TESTING - //rc_intern_dirChange("/home/n00b/test/SpriteShapeTest"); + rc_intern_dirChange("/home/n00b/Desktop/tutorial/sn_video_tutorial/SN_Tutorial"); //rc_intern_dirChange(""); rc_filename = "main.cbc"; //rc_intern_dirChange("/home/n00b/Pictures/UNTITLED"); //rc_filename = "nv_test.cbc"; - rc_intern_dirChange("/home/n00b/Experimental/android-project/app/src/main/assets"); - rc_filename = "main.cbc"; + //rc_intern_dirChange("/home/n00b/Experimental/android-project/app/src/main/assets"); + //rc_filename = "main.cbc"; #endif //--------------- diff --git a/rcbasic_runtime/rc_actor_material.h b/rcbasic_runtime/rc_actor_material.h index c84370f..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) { @@ -236,6 +239,7 @@ void rc_setActorMaterial(int actor, int material_num, int material_id) { if(rc_material[material_id].shader) { + rc_actor[actor].mesh_node->getMaterial(material_num) = rc_material[material_id].mat; rc_actor[actor].mesh_node->getMaterial(material_num).MaterialType = (video::E_MATERIAL_TYPE)rc_material[material_id].shader->getMaterial(); rc_material[material_id].shader->setObjectNode(rc_actor[actor].mesh_node); diff --git a/rcbasic_runtime/rc_fx_materials.h b/rcbasic_runtime/rc_fx_materials.h index c1fb5d2..b48a551 100755 --- a/rcbasic_runtime/rc_fx_materials.h +++ b/rcbasic_runtime/rc_fx_materials.h @@ -665,8 +665,6 @@ void rc_setMaterialConstant(int material_id, std::string m_constant, double n1, if(!rc_material[material_id].isFX) return; - float m_constant_value[] = {n1, n2, n3, n4}; - m_constant = rc_intern_trim(rc_intern_lcase(m_constant)); for(int i = 0; i < rc_material[material_id].shader->getUniformVariableCount(); i++) @@ -675,7 +673,38 @@ void rc_setMaterialConstant(int material_id, std::string m_constant, double n1, u_var = rc_intern_trim(rc_intern_lcase(u_var)); if(u_var.compare(m_constant)==0) { - rc_material[material_id].shader->getUniformVariable(i)->value = m_constant_value; + switch(rc_material[material_id].shader->getUniformVariable(i)->type) + { + case ESVT_FLOAT: + { + rc_material[material_id].shader->getUniformVariable(i)->value[0] = n1; + } + break; + + case ESVT_VEC2: + { + rc_material[material_id].shader->getUniformVariable(i)->value[0] = n1; + rc_material[material_id].shader->getUniformVariable(i)->value[1] = n2; + } + break; + + case ESVT_VEC3: + { + rc_material[material_id].shader->getUniformVariable(i)->value[0] = n1; + rc_material[material_id].shader->getUniformVariable(i)->value[1] = n2; + rc_material[material_id].shader->getUniformVariable(i)->value[2] = n3; + } + break; + + case ESVT_VEC4: + { + rc_material[material_id].shader->getUniformVariable(i)->value[0] = n1; + rc_material[material_id].shader->getUniformVariable(i)->value[1] = n2; + rc_material[material_id].shader->getUniformVariable(i)->value[2] = n3; + rc_material[material_id].shader->getUniformVariable(i)->value[3] = n4; + } + break; + } break; } } diff --git a/rcbasic_runtime/rcbasic_runtime.depend b/rcbasic_runtime/rcbasic_runtime.depend index 4c13ba6..9429f95 100755 --- a/rcbasic_runtime/rcbasic_runtime.depend +++ b/rcbasic_runtime/rcbasic_runtime.depend @@ -1,5 +1,5 @@ # depslib dependency file v1.0 -1754545071 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/main.cpp +1755890851 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/main.cpp "rc_os_defines.h" @@ -33,7 +33,7 @@ "rc_func130_cases.h" -1753538775 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_os_defines.h +1755890765 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_os_defines.h 1754605794 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_defines.h @@ -2527,7 +2527,7 @@ 1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_base_actor.h "ProjectiveTextures.h" -1752028340 /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 @@ -2559,7 +2559,7 @@ -1755137987 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_fx_materials.h +1755890976 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_fx_materials.h "CShader.h" "rc_fx_shaders.h" @@ -2571,7 +2571,7 @@ 1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_fx_shaders.h -1748042868 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 09883fd..fa8dd68 100755 --- a/rcbasic_runtime/rcbasic_runtime.layout +++ b/rcbasic_runtime/rcbasic_runtime.layout @@ -2,54 +2,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -57,81 +12,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -142,99 +22,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -242,9 +32,149 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -252,9 +182,29 @@ - + - + + + + + + + + + + + + + + + + + + + + + @@ -262,4 +212,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +