Example #1
0
CoriolisLoad (Coriolis *inst, const LWLoadState *lState)
{
  LWError     err;
  short        fn;

  // Exit if it's not the same version number (defaults will be used). 
  LWLOAD_I2 (lState, &inst->tversion, 1);
  if (inst->tversion != CS_VERSION) {
	 inst->tversion = CS_VERSION;
	 return NULL;
  }

  LWLOAD_I2 (lState, &fn, 1);
  inst->fnoise = (FracNoise) fn;

  if (!(err = (*vpfunc->load) (inst->coriolisscale, lState)))
	 (*vpfunc->getVal) (inst->coriolisscale, 0, NULL, inst->scl);
  else
	 return (err);

  if (!(err = (*vpfunc->load) (inst->coriolistwist, lState)))
	 (*vpfunc->getVal) (inst->coriolistwist, 0, NULL, inst->tws);
  else
	 return (err);

  if (!(err = (*vpfunc->load) (inst->coriolisoffset, lState)))
	 (*vpfunc->getVal) (inst->coriolisoffset, 0, NULL, inst->off);
  else
	 return (err);

  if (!(err = (*vpfunc->load) (inst->increment, lState)))
	 (*vpfunc->getVal) (inst->increment, 0, NULL, inst->inc);
  else
	 return (err);

  if (!(err = (*vpfunc->load) (inst->lacunarity, lState)))
	 (*vpfunc->getVal) (inst->lacunarity, 0, NULL, inst->lac);
  else
	 return (err);

  if (!(err = (*vpfunc->load) (inst->octaves, lState)))
	 (*vpfunc->getVal) (inst->octaves, 0, NULL, inst->oct);
  else
	 return (err);

  return (NULL);
}
Example #2
0
DentedLoad (Dented *inst, const LWLoadState *lState)
{
  LWError     err;
  short	      fn;

  // Exit if it's not the same version number (defaults will be used). 
  LWLOAD_I2 (lState, &inst->tversion, 1);
  if (inst->tversion != DT_VERSION) {
    inst->tversion = DT_VERSION;
    return NULL;
  }

  LWLOAD_I2 (lState, &fn, 1);
  inst->fnoise = (FracNoise) fn;

  if (!(err = (*vpfunc->load) (inst->scale, lState)))
    (*vpfunc->getVal) (inst->scale, 0, NULL, inst->scl);
  else
    return (err);

  if (!(err = (*vpfunc->load) (inst->power, lState)))
    (*vpfunc->getVal) (inst->power, 0, NULL, inst->pwr);
  else
    return (err);

  if (!(err = (*vpfunc->load) (inst->frequency, lState)))
    (*vpfunc->getVal) (inst->frequency, 0, NULL, inst->frq);
  else
    return (err);

  if (!(err = (*vpfunc->load) (inst->octaves, lState)))
    (*vpfunc->getVal) (inst->octaves, 0, NULL, inst->oct);
  else
    return (err);

  return (NULL);
}