manicdigger/cito — pull request #1 by TobiMob (2014-11-22 15:38:28+00:00)
Title: float constants / field access modifiers

Implemented:
* float constants. Stuff like this works now:
````
public float Calc(float x)
{
return x * 0.5f * 2;
}
````

* non private fields no longer create a error.
I was unable to build ManicDigger with Cito. Cito did not like the internal fields.
So i removed the "fields must be privat" restriction and the build finished.

````
public class HelloCi
{
public int dummyVar;
internal float dummyVarF;

public float Calc(float x)
{
return x * 0.5f * 2;
}
}

(.cs Output)
// Generated automatically with "cito". Do not edit.
public class HelloCi
{

public float Calc(float x)
{
return x * 0.5f * 2;
}
public int dummyVar;
internal float dummyVarF;
}
````

I changed the TerrainChunkTesselatorCi constructor to use float constants.
Here are some outputs from the BuildCito.bat:

````
//Input Cito
public TerrainChunkTesselatorCi()
{
BlockShadow = 0.6f;
DONOTDRAWEDGES = true;
AtiArtifactFix = 0.995f; // 0.995f;
occ = 0.7f; // 0.7f
halfocc = 0.4f; // 0.4f

Yellowness = 1; // lower is yellower//0.7
Blueness = 0.9f; // lower is blue-er
}

//Output Cs
public TerrainChunkTesselatorCi()
{
this.BlockShadow = 0.6f;
this.DONOTDRAWEDGES = true;
this.AtiArtifactFix = 0.995f;
this.occ = 0.7f;
this.halfocc = 0.4f;
this.Yellowness = 1;
this.Blueness = 0.9f;
}

//Output c
static void TerrainChunkTesselatorCi_Construct(TerrainChunkTesselatorCi *self)
{
self->blockShadow = 0.6f;
self->dONOTDRAWEDGES = TRUE;
self->atiArtifactFix = 0.995f;
self->occ = 0.7f;
self->halfocc = 0.4f;
self->yellowness = 1;
self->blueness = 0.9f;
}

//Output java
public TerrainChunkTesselatorCi()
{
this.blockShadow = 0.6f;
this.dONOTDRAWEDGES = true;
this.atiArtifactFix = 0.995f;
this.occ = 0.7f;
this.halfocc = 0.4f;
this.yellowness = 1;
this.blueness = 0.9f;
}

//Output js
function TerrainChunkTesselatorCi()
{
(...)

this.blockShadow = 0.6;
this.dONOTDRAWEDGES = true;
this.atiArtifactFix = 0.995;
this.occ = 0.7;
this.halfocc = 0.4;
this.yellowness = 1;
this.blueness = 0.9;
}
````