예제 #1
0
        void Autoexec()
        {
            vidmode = 0;
            switch (vidmode)
            {
                case 0: ybase = 0; break;
                case 1: ybase = 20; break;
                case 2: ybase = 30; break;
            }
            //TODO
            //SetClip(0, ybase, 319, 199+ybase, screen);

            //TODO
            //int r = Random(0,5);
            //switch (r)
            //{
            //    case 0:	PlayMusic("music\rain.s3m");
            //    case 1: PlayMusic("music\zcs-02-intro.xm");
            //    case 2: PlayMusic("music\zk-jdood.it");
            //    case 3:	PlayMusic("music\verge6.it");
            //    case 4: PlayMusic("music\lib-grey.xm");
            //    case 5: PlayMusic("music\sully-columns.it");
            //}
            //cursong = r;

            InitTables();
            //HookTimer("MyTimer"); //handled by Update()

            scrollpath = 0;
            nextscroll = systemtime+700;
            nextskew = systemtime+800;

            int i;
            for (i=0; i<100; i++)
                _skewlines[i] = 1;

            var b = new Blitter(bg);
            b.SetColor(Color.Transparent);
            b.RectFill(0, 0, 256, 256);

            //InitScript();
        }
예제 #2
0
        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();
        }