コード例 #1
0
ファイル: TouchManager.cs プロジェクト: Gayo/Gayo-CAROT
 public void Draw(Blitter b)
 {
     b.Color = Color.Red;
     b.PushAlpha(0.25f);
     using (Image image = GameEngine.Game.LoadImage("/assembly/WhiteNoise.png"))
         b.StretchBlit(image, rect);
     b.RectFill(rect);
     b.PopAlpha();
 }
コード例 #2
0
ファイル: TileEngine.cs プロジェクト: Gayo/Gayo-CAROT
        private void renderObsLayer(int xo, int yo, Blitter b)
        {
            int xofs = -(xo & 15);
            int yofs = -(yo & 15);
            int xtc = xo >> 4;
            int ytc = yo >> 4;

            int tw = (b.Dest.Width >> 4) + 2;
            int th = (b.Dest.Height >> 4) + 2;

            b.SetColor(255, 255, 255);
            b.PushAlpha(0.5f);
            for(int y = 0; y < th; y++)
                for(int x = 0; x < tw; x++) {
                    if(y + ytc >= m.height || x + xtc >= m.width || x + xtc < 0 || y + ytc < 0) continue;
                    int t = m.logicalLayer.readObs(x + xtc, y + ytc);
                    if(t == 0) continue;
                    b.RectFill(xofs + x * 16, yofs + y * 16, 16, 16);
                }
            b.PopAlpha();
        }
コード例 #3
0
ファイル: TouchManager.cs プロジェクト: Gayo/Gayo-CAROT
 public void Draw(Blitter b)
 {
     b.Color = Color.Red;
     b.PushAlpha(0.25f);
     using (Image image = GameEngine.Game.LoadImage("/assembly/WhiteNoise.png"))
     {
         b.Source = image;
         b.EngageTextureMode();
         TesselateRender(b);
         b.Source = null;
     }
     b.EngineColorMode();
     TesselateRender(b);
     b.PopAlpha();
 }
コード例 #4
0
ファイル: TileEngine.cs プロジェクト: Gayo/Gayo-CAROT
        private void renderLayer(bool bBottom, int xo, int yo, Map.TileLayer l, Blitter b)
        {
            int oxw = (int)((float)xo * l.parallax.X);
            int oyw = (int)((float)yo * l.parallax.Y);
            int xofs = -(oxw & 15);
            int yofs = -(oyw & 15);
            int xtc = oxw >> 4;
            int ytc = oyw >> 4;

            int tw = (b.width >> 4) + 2;
            int th = (b.height >> 4) + 2;

            b.BeginBatch();
            b.PushAlpha((float)((100 - (float)l.lucent) / 100.0));

            if(bBottom)
                for(int y = 0; y < th; y++)
                    for(int x = 0; x < tw; x++) {
                        int t = l.getTile(x + xtc, y + ytc);
                        if(t == 0) continue;
                        if(t == -1) {
                            if(fillLayer != null) {
                                t = fillLayer[(fillLayer.height + ((y + ytc) % fillLayer.height)) % fillLayer.height,
                                            (fillLayer.width + ((x + xtc) % fillLayer.width)) % fillLayer.width];
                            } else continue;
                        }

                        // Overkill: Takes animations into account.
                        t = m.vsp.tileIndex[t];

                        b.BlitSubrectBatched(m.vsp.tiles, (t & 127) << 4, ((t >> 7) << 4), 16, 16, xofs + x * 16, yofs + y * 16);
                    } else
                for(int y = 0; y < th; y++)
                    for(int x = 0; x < tw; x++) {
                        int t = l.getTile(x + xtc, y + ytc);
                        if(t < 1) continue;

                        // Overkill: Takes animations into account.
                        t = m.vsp.tileIndex[t];

                        b.BlitSubrectBatched(m.vsp.tiles, (t & 127) << 4, ((t >> 7) << 4), 16, 16, xofs + x * 16, yofs + y * 16);
                    }

            b.ExecuteSubrectBatch(m.vsp.tiles);
            b.PopAlpha();
        }