Removed Allegro paletteised blitting code.
This commit is contained in:
parent
3c514a445f
commit
fd36feae52
1 changed files with 0 additions and 78 deletions
|
|
@ -4,45 +4,13 @@
|
|||
|
||||
#include "allegro-video.h"
|
||||
|
||||
static PALETTE cgapal=
|
||||
{
|
||||
{0,0,0},{0,42,0},{42,0,0},{42,21,0},
|
||||
{0,0,0},{0,42,42},{42,0,42},{42,42,42},
|
||||
{0,0,0},{21,63,21},{63,21,21},{63,63,21},
|
||||
{0,0,0},{21,63,63},{63,21,63},{63,63,63},
|
||||
|
||||
{0,0,0},{0,0,42},{0,42,0},{0,42,42},
|
||||
{42,0,0},{42,0,42},{42,21,00},{42,42,42},
|
||||
{21,21,21},{21,21,63},{21,63,21},{21,63,63},
|
||||
{63,21,21},{63,21,63},{63,63,21},{63,63,63},
|
||||
|
||||
{0,0,0},{0,21,0},{0,0,42},{0,42,42},
|
||||
{42,0,21},{21,10,21},{42,0,42},{42,0,63},
|
||||
{21,21,21},{21,63,21},{42,21,42},{21,63,63},
|
||||
{63,0,0},{42,42,0},{63,21,42},{41,41,41},
|
||||
|
||||
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
|
||||
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
|
||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
||||
};
|
||||
|
||||
static uint32_t pal_lookup[256];
|
||||
|
||||
static void allegro_blit_memtoscreen(int x, int y, int y1, int y2, int w, int h);
|
||||
static void allegro_blit_memtoscreen_8(int x, int y, int w, int h);
|
||||
static BITMAP *buffer32_vscale;
|
||||
void allegro_video_init()
|
||||
{
|
||||
int c;
|
||||
|
||||
set_color_depth(32);
|
||||
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
|
||||
video_blit_memtoscreen_func = allegro_blit_memtoscreen;
|
||||
video_blit_memtoscreen_8_func = allegro_blit_memtoscreen_8;
|
||||
|
||||
for (c = 0; c < 256; c++)
|
||||
pal_lookup[c] = makecol(cgapal[c].r << 2, cgapal[c].g << 2, cgapal[c].b << 2);
|
||||
|
||||
buffer32_vscale = create_bitmap(2048, 2048);
|
||||
}
|
||||
|
|
@ -83,49 +51,3 @@ static void allegro_blit_memtoscreen(int x, int y, int y1, int y2, int w, int h)
|
|||
}
|
||||
}
|
||||
|
||||
static void allegro_blit_memtoscreen_8(int x, int y, int w, int h)
|
||||
{
|
||||
int xx, yy;
|
||||
int line_double = (winsizey > h) ? 1 : 0;
|
||||
|
||||
if (y < 0)
|
||||
{
|
||||
h += y;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
for (yy = y; yy < y+h; yy++)
|
||||
{
|
||||
int dy = line_double ? yy*2 : yy;
|
||||
if (dy < buffer->h)
|
||||
{
|
||||
if (line_double)
|
||||
{
|
||||
for (xx = x; xx < x+w; xx++)
|
||||
{
|
||||
((uint32_t *)buffer32->line[dy])[xx] =
|
||||
((uint32_t *)buffer32->line[dy + 1])[xx] = pal_lookup[buffer->line[yy][xx]];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (xx = x; xx < x+w; xx++)
|
||||
((uint32_t *)buffer32->line[dy])[xx] = pal_lookup[buffer->line[yy][xx]];
|
||||
}
|
||||
}
|
||||
}
|
||||
video_blit_complete();
|
||||
if (readflash)
|
||||
{
|
||||
if (line_double)
|
||||
rectfill(buffer32, x+SCREEN_W-40, y*2+8, SCREEN_W-8, y*2+14, makecol(255, 255, 255));
|
||||
else
|
||||
rectfill(buffer32, x+SCREEN_W-40, y+8, SCREEN_W-8, y+14, makecol(255, 255, 255));
|
||||
readflash = 0;
|
||||
}
|
||||
|
||||
if (line_double)
|
||||
blit(buffer32, screen, x, y*2, 0, 0, w, h*2);
|
||||
else
|
||||
blit(buffer32, screen, x, y, 0, 0, w, h);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue