Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8949 in orxonox.OLD


Ignore:
Timestamp:
Jun 30, 2006, 1:45:59 PM (18 years ago)
Author:
stefalie
Message:

mountain_lake: changed saveParams method and MappedWater is now scritable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mountain_lake/src/world_entities/environments/mapped_water.cc

    r8921 r8949  
    2323#include "glgui.h"
    2424#include "shell_command.h"
     25#include "script_class.h"
    2526
    2627CREATE_FACTORY(MappedWater, CL_MAPPED_WATER);
     
    2829SHELL_COMMAND(gui, MappedWater, openGui);
    2930SHELL_COMMAND(output, MappedWater, saveParams);
     31
     32CREATE_SCRIPTABLE_CLASS(MappedWater, CL_MAPPED_WATER,
     33                        addMethod("waterUV", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeWaterUV))
     34                      ->addMethod("waterFlow", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeWaterFlow))
     35                      ->addMethod("shineSize", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeShineSize))
     36                      ->addMethod("shineStrength", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeShineStrength))
     37                      ->addMethod("reflStrength", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeReflStrength))
     38                      ->addMethod("refraction", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeRefraction))
     39                      ->addMethod("waterHeight", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeWaterHeight))
     40                      ->addMethod("waterColor", ExecutorLua4<MappedWater, float, float, float, float>(&MappedWater::fadeWaterColor)));
     41
    3042
    3143/**
     
    324336void MappedWater::saveParams()
    325337{
    326   PRINTF(0)("MappedWater XML Code:\n<MappedWater>\n");
    327 
    328   PRINTF(0)("  <waterpos>%f, %f, %f</waterpos>\n", this->waterVerts[0], this->waterHeight, this->waterVerts[1]);
    329   PRINTF(0)("  <watersize>%f, %f</watersize>\n", this->xWidth, this->zWidth);
    330   PRINTF(0)("  <wateruv>%f</wateruv>\n", this->waterUV);
    331   PRINTF(0)("  <waterflow>%f</waterflow>\n", this->waterFlow);
    332   PRINTF(0)("  <lightpos>%f, %f, %f</lightpos>\n", this->lightPos.x, this->lightPos.y, this->lightPos.z);
    333   PRINTF(0)("  <waterangle>%f</waterangle>\n", this->waterAngle);
    334   PRINTF(0)("  <normalmapscale>%f</normalmapscale>\n", this->kNormalMapScale);
    335   PRINTF(0)("  <shinesize>%f</waterpos>\n", this->shineSize);
    336   PRINTF(0)("  <shinestrength>%f</shinestrength>\n", this->shineStrength);
    337   PRINTF(0)("  <reflstrength>%f</reflstrength>\n", this->reflStrength);
    338   PRINTF(0)("  <refraction>%f</refraction>\n", this->refraction);
    339   PRINTF(0)("  <watercolor>%f, %f, %f</watercolor>\n", this->waterColor.x, this->waterColor.y, this->waterColor.z);
    340 
    341   PRINTF(0)("</MappedWater>\n");
     338  // it's not too nice, but it works fine
     339  PRINTF(0)("\nMappedWater XML Code:\n<MappedWater>\n  <waterpos>%f, %f, %f</waterpos>\n  <watersize>%f, %f</watersize>\n  <wateruv>%f</wateruv>\n  <waterflow>%f</waterflow>\n  <lightpos>%f, %f, %f</lightpos>\n  <waterangle>%f</waterangle>\n  <normalmapscale>%f</normalmapscale>\n  <shinesize>%f</waterpos>\n  <shinestrength>%f</shinestrength>\n  <reflstrength>%f</reflstrength>\n  <refraction>%f</refraction>\n  <watercolor>%f, %f, %f</watercolor>\n</MappedWater>\n", this->waterVerts[0], this->waterHeight, this->waterVerts[1], this->xWidth, this->zWidth, this->waterUV, this->waterFlow, this->lightPos.x, this->lightPos.y, this->lightPos.z, this->waterAngle, this->kNormalMapScale, this->shineSize, this->shineStrength, this->reflStrength, this->refraction, this->waterColor.x, this->waterColor.y, this->waterColor.z);
    342340}
    343341
Note: See TracChangeset for help on using the changeset viewer.