private void ResetBurshes(RenderContainer renderContainer) { _selectedColorBrush?.Dispose(); _spacingColorBrush?.Dispose(); _notMappedColorBrush?.Dispose(); _gridColorBrush?.Dispose(); RenderTarget target2D = renderContainer.BackBuffer.Target2D; _selectedColorBrush = new SolidColorBrush(target2D, SelectedColor.ToColor4(), null); _spacingColorBrush = new SolidColorBrush(target2D, SpacingColor.ToColor4(), null); _notMappedColorBrush = new SolidColorBrush(target2D, NotMappedColor.ToColor4(), null); _gridColorBrush = new SolidColorBrush(target2D, GridColor.ToColor4(), null); }
public ZertzCupRenderer(RenderContainer rc, int id) { this.ws = new WaterSimulator(GRID_POINTS, GRID_POINTS, 2.0f*HALF_WIDTH/(GRID_POINTS-0x01), 0.3f, 0.05f, 1.0f);//dz=0.12f float c = HALF_WIDTH+0.5f*THICKNESS; this.ztra = new ZertzTileRenderer(c, BORDER_HEIGHT+CORNER_HEIGHT, c); this.ztrb = new ZertzTileRenderer(-c, BORDER_HEIGHT+CORNER_HEIGHT, -c); float alt = (float)(0.5f*Math.Sqrt(5.0f)-0.5f)*ZertzTileRenderer.TILE_HEIGHT; float wid = (ZertzTileRenderer.TILE_HEIGHT-alt); LinuxFlag lfa = new LinuxFlag(8, 8, wid, 250.0f, 0.98f, alt, ZertzTileRenderer.TILE_RADIUS); lfa.Location = new Vector3(c, BORDER_HEIGHT+CORNER_HEIGHT, -c); rc.Add(id, lfa); LinuxFlag lfb = new LinuxFlag(8, 8, wid, 250.0f, 0.98f, alt, ZertzTileRenderer.TILE_RADIUS); lfb.Location = new Vector3(-c, BORDER_HEIGHT+CORNER_HEIGHT, c); rc.Add(id+0x01, lfb); }
public ZertzCupRenderer(RenderContainer rc, int id) { this.ws = new WaterSimulator(GRID_POINTS, GRID_POINTS, 2.0f * HALF_WIDTH / (GRID_POINTS - 0x01), 0.3f, 0.05f, 1.0f); //dz=0.12f float c = HALF_WIDTH + 0.5f * THICKNESS; this.ztra = new ZertzTileRenderer(c, BORDER_HEIGHT + CORNER_HEIGHT, c); this.ztrb = new ZertzTileRenderer(-c, BORDER_HEIGHT + CORNER_HEIGHT, -c); float alt = (float)(0.5f * Math.Sqrt(5.0f) - 0.5f) * ZertzTileRenderer.TILE_HEIGHT; float wid = (ZertzTileRenderer.TILE_HEIGHT - alt); LinuxFlag lfa = new LinuxFlag(8, 8, wid, 250.0f, 0.98f, alt, ZertzTileRenderer.TILE_RADIUS); lfa.Location = new Vector3(c, BORDER_HEIGHT + CORNER_HEIGHT, -c); rc.Add(id, lfa); LinuxFlag lfb = new LinuxFlag(8, 8, wid, 250.0f, 0.98f, alt, ZertzTileRenderer.TILE_RADIUS); lfb.Location = new Vector3(-c, BORDER_HEIGHT + CORNER_HEIGHT, c); rc.Add(id + 0x01, lfb); }
public static ZertzBallRenderer[] GenerateBalls(ZertzBallContainer zbc, RenderContainer rc, ZertzCupRenderer zcr, int offsetid) { int id = offsetid; ZertzBallType zbt; ZertzBallRenderer zbr; ZertzBallRenderer[] list = new ZertzBallRenderer[zbc.Total]; int j = 0x00; for (byte b = 0x00; b < 0x03; b++) { zbt = (ZertzBallType)b; for (int i = 0x00; i < zbc[zbt]; i++) { zbr = new ZertzBallRenderer(zbt); list[j++] = zbr; rc.Add(id++, zbr); zbr.RenderMover = RenderMoveManager.GenerateStaticMover(zcr.CommonContainer.Add(zbr)); } } return(list); }
public static ZertzRingRenderer[] GenerateRings(RenderContainer rc, ZertzBoardRenderer board, ZertzGame game, ZertzCupRenderer cup, HexLocation[] hls, int offsetid) { int n = hls.Length; int id = offsetid; ZertzRingRenderer zrr; ZertzRingRenderer[] list = new ZertzRingRenderer[n]; ZertzTileRenderer ztr; float time = n * TIME_FACTOR + TIME_OFFSET; for (int i = 0x00; i < n; i++) { ztr = cup.MinimalTile; zrr = new ZertzRingRenderer(game, hls[i], ztr.NextVector, ztr.TileEscapeLocation, time); board.PutRing(zrr, hls[i]); ztr.Add(zrr); list[i] = zrr; rc.Add(id++, zrr); time -= TIME_FACTOR; } cup.ClearTiles(); return(list); }
public static ZertzRingRenderer[] GenerateRings(RenderContainer rc, ZertzBoardRenderer board, ZertzGame game, ZertzCupRenderer cup, HexLocation[] hls, int offsetid) { int n = hls.Length; int id = offsetid; ZertzRingRenderer zrr; ZertzRingRenderer[] list = new ZertzRingRenderer[n]; ZertzTileRenderer ztr; float time = n*TIME_FACTOR+TIME_OFFSET; for(int i = 0x00; i < n; i++) { ztr = cup.MinimalTile; zrr = new ZertzRingRenderer(game,hls[i],ztr.NextVector,ztr.TileEscapeLocation,time); board.PutRing(zrr,hls[i]); ztr.Add(zrr); list[i] = zrr; rc.Add(id++,zrr); time -= TIME_FACTOR; } cup.ClearTiles(); return list; }
public static ZertzBallRenderer[] GenerateBalls(ZertzBallContainer zbc, RenderContainer rc, ZertzCupRenderer zcr, int offsetid) { int id = offsetid; ZertzBallType zbt; ZertzBallRenderer zbr; ZertzBallRenderer[] list = new ZertzBallRenderer[zbc.Total]; int j = 0x00; for(byte b = 0x00; b < 0x03; b++) { zbt = (ZertzBallType) b; for(int i = 0x00; i < zbc[zbt]; i++) { zbr = new ZertzBallRenderer(zbt); list[j++] = zbr; rc.Add(id++,zbr); zbr.RenderMover = RenderMoveManager.GenerateStaticMover(zcr.CommonContainer.Add(zbr)); } } return list; }