Ejemplo n.º 1
0
 static void M_DrawPic (int x, int y, wad.qpic_t pic)
 {
     draw.Draw_Pic((int)(x + ((screen.vid.width - 320) >> 1)), y, pic);
 }
Ejemplo n.º 2
0
        static void M_DrawTransPicTranslate(int x, int y, wad.qpic_t pic)
        {
	        draw.Draw_TransPicTranslate ((int)(x + ((screen.vid.width - 320)>>1)), y, pic, translationTable);
        }
Ejemplo n.º 3
0
        /*
        =============
        Draw_TransPicTranslate
        =============
        */
        public static void Draw_TransPicTranslate(int x, int y, wad.qpic_t pic, Uint8Array translation)
        {
            int         	dest, source;
            byte            tbyte;
            int				v, u;

            if (x < 0 || (uint)(x + pic.width) > screen.vid.width || y < 0 ||
                 (uint)(y + pic.height) > screen.vid.height)
            {
                sys_linux.Sys_Error ("Draw_TransPic: bad coordinates");
            }

            source = 0;

            dest = (int)(y * screen.vid.rowbytes + x);

            if ((pic.width & 7) != 0)
            {	// general
                for (v=0 ; v<pic.height ; v++)
                {
                    for (u=0 ; u<pic.width ; u++)
                        if ( (tbyte=pic.data[source+u]) != TRANSPARENT_COLOR)
                            screen.vid.buffer[dest+u] = translation[tbyte];

                    dest += (int)screen.vid.rowbytes;
                    source += pic.width;
                }
            }
            else
            {	// unwound
                for (v=0 ; v<pic.height ; v++)
                {
                    for (u=0 ; u<pic.width ; u+=8)
                    {
                        if ( (tbyte=pic.data[source+u]) != TRANSPARENT_COLOR)
                            screen.vid.buffer[dest+u] = translation[tbyte];
                        if ( (tbyte=pic.data[source+u+1]) != TRANSPARENT_COLOR)
                            screen.vid.buffer[dest+u+1] = translation[tbyte];
                        if ( (tbyte=pic.data[source+u+2]) != TRANSPARENT_COLOR)
                            screen.vid.buffer[dest+u+2] = translation[tbyte];
                        if ( (tbyte=pic.data[source+u+3]) != TRANSPARENT_COLOR)
                            screen.vid.buffer[dest+u+3] = translation[tbyte];
                        if ( (tbyte=pic.data[source+u+4]) != TRANSPARENT_COLOR)
                            screen.vid.buffer[dest+u+4] = translation[tbyte];
                        if ( (tbyte=pic.data[source+u+5]) != TRANSPARENT_COLOR)
                            screen.vid.buffer[dest+u+5] = translation[tbyte];
                        if ( (tbyte=pic.data[source+u+6]) != TRANSPARENT_COLOR)
                            screen.vid.buffer[dest+u+6] = translation[tbyte];
                        if ( (tbyte=pic.data[source+u+7]) != TRANSPARENT_COLOR)
                            screen.vid.buffer[dest+u+7] = translation[tbyte];
                    }
                    dest += (int)screen.vid.rowbytes;
                    source += pic.width;
                }
            }
        }
Ejemplo n.º 4
0
 /*
 =============
 Sbar_DrawTransPic
 =============
 */
 static void Sbar_DrawTransPic(int x, int y, wad.qpic_t pic)
 {
     if (client.cl.gametype == net.GAME_DEATHMATCH)
         draw.Draw_TransPic(x /*+ ((screen.vid.width - 320)>>1)*/, (int)(y + (screen.vid.height - SBAR_HEIGHT)), pic);
     else
         draw.Draw_TransPic((int)(x + ((screen.vid.width - 320) >> 1)), (int)(y + (screen.vid.height - SBAR_HEIGHT)), pic);
 }
Ejemplo n.º 5
0
        /*
        =============
        Draw_Pic
        =============
        */
        public static void Draw_Pic(int x, int y, wad.qpic_t pic)
        {
            Uint8Array      dest, source;
            int				v, u;

            if ((x < 0) ||
                (x + pic.width > screen.vid.width) ||
                (y < 0) ||
                (y + pic.height > screen.vid.height))
            {
                sys_linux.Sys_Error ("Draw_Pic: bad coordinates");
            }

            source = pic.data;

            dest = screen.vid.buffer;

            int srcofs = 0;
            int dstofs = (int)(y * screen.vid.rowbytes + x);
            for (v=0 ; v<pic.height ; v++)
            {
                Buffer.BlockCopy(source, srcofs, dest, dstofs, pic.width);
                dstofs += (int)screen.vid.rowbytes;
                srcofs += pic.width;
            }
        }