public override void RenderLate(Device dev, EditorCamera cam) { switch (Act) { case 0: default: return; case 1: texs_ocean = ObjectHelper.GetTextures("PAST01"); break; case 2: texs_ocean = ObjectHelper.GetTextures("PAST02"); break; } List <RenderInfo> result3 = new List <RenderInfo>(); MatrixStack transform = new MatrixStack(); dev.SetRenderState(RenderState.ZWriteEnable, false); for (int o = 0; o < SADXOceanData.WaterSurfaces.Count; o++) { SADXOceanData.WaterSurfaceData water = SADXOceanData.WaterSurfaces[o]; transform.Push(); transform.NJTranslate(water.Center); transform.Push(); for (int i = 0; i < water.WrapX; i++) { for (int z = 0; z < water.WrapZ; z++) { result3.Add(new RenderInfo(water.Meshes[z], 0, transform.Top, SADXOceanData.Material, texs_ocean?[water.TextureWaves], dev.GetRenderState <FillMode>(RenderState.FillMode), water.Bounds)); } transform.NJTranslate(water.WrapXZ, 0, 0); } transform.Pop(); transform.Push(); transform.NJTranslate(0, 1, 0); for (int i = 0; i < water.WrapX; i++) { for (int z = 0; z < water.WrapZ; z++) { result3.Add(new RenderInfo(water.Meshes[z], 0, transform.Top, SADXOceanData.Material, texs_ocean?[water.TextureSea], dev.GetRenderState <FillMode>(RenderState.FillMode), water.Bounds)); } transform.NJTranslate(water.WrapXZ, 0, 0); } transform.Pop(); transform.Pop(); } RenderInfo.Draw(result3, dev, cam); }
private void RenderWater(Device dev, EditorCamera cam) { Texture[] texs_ocean; dev.SetRenderState(RenderState.ZWriteEnable, true); if (!IsMRGarden) { texs_ocean = ObjectHelper.GetTextures("GARDEN00SSOBJ"); } else { texs_ocean = ObjectHelper.GetTextures("GARDEN02MR_DAYTIME"); if (texs_ocean == null) { texs_ocean = ObjectHelper.GetTextures("GARDEN02MR_EVENING"); } if (texs_ocean == null) { texs_ocean = ObjectHelper.GetTextures("GARDEN02MR_NIGHT"); } } List <RenderInfo> result3 = new List <RenderInfo>(); MatrixStack transform = new MatrixStack(); for (int o = 0; o < SADXOceanData.WaterSurfaces.Count; o++) { SADXOceanData.WaterSurfaceData water = SADXOceanData.WaterSurfaces[o]; transform.Push(); transform.NJTranslate(water.Center); transform.Push(); transform.NJTranslate(0, -1, 0); for (int i = 0; i < water.WrapX; i++) { for (int z = 0; z < water.WrapZ; z++) { result3.Add(new RenderInfo(water.Meshes[z], 0, transform.Top, SADXOceanData.Material, texs_ocean?[water.TextureSea], dev.GetRenderState <FillMode>(RenderState.FillMode), water.Bounds)); } transform.NJTranslate(water.WrapXZ, 0, 0); } transform.Pop(); transform.Pop(); } RenderInfo.Draw(result3, dev, cam); }
public override void RenderLate(Device dev, EditorCamera cam) { if (TimeOfDay != 0 || Act > 2) { return; } Texture[] texs_ocean = ObjectHelper.GetTextures("ADV_EC0" + Act.ToString()); List <RenderInfo> result3 = new List <RenderInfo>(); MatrixStack transform = new MatrixStack(); for (int o = 0; o < SADXOceanData.WaterSurfaces.Count; o++) { SADXOceanData.WaterSurfaceData water = SADXOceanData.WaterSurfaces[o]; transform.Push(); transform.NJTranslate(cam.Position.X, 0, cam.Position.Z); transform.NJScale(2.0f, 1.0f, 2.0f); transform.NJTranslate(water.Center); transform.Push(); for (int i = 0; i < water.WrapX; i++) { for (int z = 0; z < water.WrapZ; z++) { result3.Add(new RenderInfo(water.Meshes[z], 0, transform.Top, SADXOceanData.Material, texs_ocean?[water.TextureWaves], dev.GetRenderState <FillMode>(RenderState.FillMode), water.Bounds)); } transform.NJTranslate(water.WrapXZ, 0, 0); } transform.Pop(); transform.Push(); transform.NJTranslate(0, 1, 0); for (int i = 0; i < water.WrapX; i++) { for (int z = 0; z < water.WrapZ; z++) { result3.Add(new RenderInfo(water.Meshes[z], 0, transform.Top, SADXOceanData.Material, texs_ocean?[water.TextureSea], dev.GetRenderState <FillMode>(RenderState.FillMode), water.Bounds)); } transform.NJTranslate(water.WrapXZ, 0, 0); } transform.Pop(); transform.Pop(); } RenderInfo.Draw(result3, dev, cam); }
public override void RenderLate(Device dev, EditorCamera cam) { List <RenderInfo> result3 = new List <RenderInfo>(); MatrixStack transform = new MatrixStack(); dev.SetRenderState(RenderState.ZWriteEnable, false); Texture[] watertex = Act == 3 ? texs_advss03 : texs_advss04; for (int o = 0; o < SADXOceanData.WaterSurfaces.Count; o++) { SADXOceanData.WaterSurfaceData water = SADXOceanData.WaterSurfaces[o]; transform.Push(); transform.NJTranslate(water.Center); transform.Push(); transform.NJTranslate(0, -1, 0); for (int i = 0; i < water.WrapX; i++) { for (int z = 0; z < water.WrapZ; z++) { result3.Add(new RenderInfo(water.Meshes[z], 0, transform.Top, SADXOceanData.Material, watertex?[water.TextureWaves], dev.GetRenderState <FillMode>(RenderState.FillMode), water.Bounds)); } transform.NJTranslate(water.WrapXZ, 0, 0); } transform.Pop(); transform.Push(); for (int i = 0; i < water.WrapX; i++) { for (int z = 0; z < water.WrapZ; z++) { result3.Add(new RenderInfo(water.Meshes[z], 0, transform.Top, SADXOceanData.Material, watertex?[water.TextureSea], dev.GetRenderState <FillMode>(RenderState.FillMode), water.Bounds)); } transform.NJTranslate(water.WrapXZ, 0, 0); } transform.Pop(); transform.Pop(); } RenderInfo.Draw(result3, dev, cam); }