public void SetShapeDescriptor(DataSources surfaceType, ShapeDescriptor shapeDescriptor) { short transferMode; switch (surfaceType) { case DataSources.Ceiling: if (shapeDescriptor.Equals(NativeObject.CeilingTexture)) { // Texture is not different, so exit return; } NativeObject.CeilingTexture = shapeDescriptor; transferMode = NativeObject.CeilingTransferMode; break; case DataSources.Floor: if (shapeDescriptor.Equals(NativeObject.FloorTexture)) { // Texture is not different, so exit return; } NativeObject.FloorTexture = shapeDescriptor; transferMode = NativeObject.FloorTransferMode; break; default: return; } short newTransferMode = 0; if (shapeDescriptor.UsesLandscapeCollection()) { newTransferMode = 9; } else if (transferMode != 9) { newTransferMode = transferMode; } switch (surfaceType) { case DataSources.Ceiling: NativeObject.CeilingTransferMode = newTransferMode; CeilingSurface.ApplyTexture(); break; case DataSources.Floor: NativeObject.FloorTransferMode = newTransferMode; FloorSurface.ApplyTexture(); break; } }
public void SetOffset(DataSources surfaceType, short x, short y, bool rebatch) { switch (surfaceType) { case DataSources.Ceiling: if (NativeObject.CeilingTransferMode == 9 || NativeObject.CeilingTexture.UsesLandscapeCollection() || NativeObject.CeilingTexture.IsEmpty()) { // Don't adjust UVs for landscape surfaces. return; } NativeObject.CeilingOrigin.X = x; NativeObject.CeilingOrigin.Y = y; CeilingSurface.ApplyTextureOffset(rebatchImmediately: rebatch); break; case DataSources.Floor: if (NativeObject.FloorTransferMode == 9 || NativeObject.FloorTexture.UsesLandscapeCollection() || NativeObject.FloorTexture.IsEmpty()) { // Don't adjust UVs for landscape surfaces. return; } NativeObject.FloorOrigin.X = x; NativeObject.FloorOrigin.Y = y; FloorSurface.ApplyTextureOffset(rebatchImmediately: rebatch); break; default: return; } }
public void SetLight(DataSources dataSource, short lightIndex) { switch (dataSource) { case DataSources.Ceiling: if (lightIndex == NativeObject.CeilingLight || NativeObject.CeilingTexture.UsesLandscapeCollection()) { // Light is not different, so exit return; } NativeObject.CeilingLight = lightIndex; CeilingSurface.ApplyLight(); break; case DataSources.Floor: if (lightIndex == NativeObject.FloorLight || NativeObject.FloorTexture.UsesLandscapeCollection()) { // Light is not different, so exit return; } NativeObject.FloorLight = lightIndex; FloorSurface.ApplyLight(); break; default: return; } }