Elin Modding Docs Doc
Loading...
Searching...
No Matches
RenderDataTile.cs
1using System;
2
3// Token: 0x020001A4 RID: 420
5{
6 // Token: 0x06000BFB RID: 3067 RVA: 0x0004A598 File Offset: 0x00048798
7 public override void Draw(RenderParam p)
8 {
9 if (this.useOffsetBack)
10 {
11 this._offset = ((p.dir % 4 >= 2) ? this.offsetBack : this.offset);
12 }
13 int num = (p.tile % 2f == 1f || p.tile < 0f || !this.symmetry) ? 1 : -1;
14 int num2 = (p.tile < 0f) ? -1 : 1;
15 MeshBatch meshBatch = this.pass.batches[this.pass.batchIdx];
16 meshBatch.matrices[this.pass.idx].m03 = p.x + this._offset.x * (float)num;
17 meshBatch.matrices[this.pass.idx].m13 = p.y + this._offset.y;
18 meshBatch.matrices[this.pass.idx].m23 = p.z + this._offset.z;
19 meshBatch.tiles[this.pass.idx] = p.tile + (float)(this.liquid ? (p.liquidLv * 10000 * num2) : 0);
20 meshBatch.colors[this.pass.idx] = p.color;
21 meshBatch.matColors[this.pass.idx] = p.matColor;
22 this.pass.idx++;
23 if (this.pass.idx == this.pass.batchSize)
24 {
25 this.pass.NextBatch();
26 }
27 if (this.multiSize)
28 {
29 meshBatch.matrices[this.pass.idx].m03 = p.x + this._offset.x * (float)num;
30 meshBatch.matrices[this.pass.idx].m13 = p.y + this._offset.y + this.pass.pmesh.size.y;
31 meshBatch.matrices[this.pass.idx].m23 = p.z + this._offset.z + RenderData.renderSetting.vFix.z;
32 meshBatch.tiles[this.pass.idx] = p.tile - this.pass.pmesh.tiling.x + (float)(this.liquid ? (p.liquidLv * 10000 * num2) : 0);
33 meshBatch.colors[this.pass.idx] = p.color;
34 meshBatch.matColors[this.pass.idx] = p.matColor;
35 this.pass.idx++;
36 if (this.pass.idx == this.pass.batchSize)
37 {
38 this.pass.NextBatch();
39 }
40 }
41 if (p.snow && this.hasSnowPass)
42 {
43 MeshPass snowPass = this.pass.snowPass;
44 meshBatch = snowPass.batches[snowPass.batchIdx];
45 meshBatch.colors[snowPass.idx] = p.color;
46 meshBatch.matrices[snowPass.idx].m03 = p.x + this._offset.x * (float)num;
47 meshBatch.matrices[snowPass.idx].m13 = p.y + this._offset.y;
48 meshBatch.matrices[snowPass.idx].m23 = p.z + this._offset.z + this.snowZ;
49 meshBatch.tiles[snowPass.idx] = p.tile + (float)(p.liquidLv * 10000 * num2);
50 meshBatch.matColors[snowPass.idx] = 104025f;
51 snowPass.idx++;
52 if (snowPass.idx == snowPass.batchSize)
53 {
54 snowPass.NextBatch();
55 }
56 }
57 }
58
59 // Token: 0x06000BFC RID: 3068 RVA: 0x0004A9D4 File Offset: 0x00048BD4
60 public override void DrawWithRotation(RenderParam p, float angle)
61 {
62 MeshPass subPass = this.pass.subPass;
63 p.NewVector3 + this.offset;
64 }
65
66 // Token: 0x06000BFD RID: 3069 RVA: 0x0004A9F4 File Offset: 0x00048BF4
67 private void OnValidate()
68 {
69 this._offset = this.offset;
70 }
71
72 // Token: 0x04000AE5 RID: 2789
73 public bool liquid;
74
75 // Token: 0x04000AE6 RID: 2790
76 public float snowZ = -0.01f;
77}