/* * Copyright (C) 2002 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "dosbox.h" #include "video.h" #include "render.h" #define MAX_RES 2048 struct PalData { struct { Bit8u red; Bit8u green; Bit8u blue; Bit8u unused; } rgb[256]; Bitu first; Bitu last; }; static struct { struct { Bitu width; Bitu height; Bitu bpp; Bitu pitch; float ratio; } src; Bitu flags; RENDER_Handler * handler; Bitu stretch_x[MAX_RES]; Bitu stretch_y[MAX_RES]; PalData pal; bool remake; bool enlarge; } render; /* This could go kinda bad with multiple threads */ static void Check_Palette(void) { if (render.pal.first>render.pal.last) return; GFX_SetPalette(render.pal.first,render.pal.last-render.pal.first+1,(GFX_PalEntry *)&render.pal.rgb[render.pal.first]); render.pal.first=256; render.pal.last=0; } static void MakeTables(void) { //The stretching tables Bitu i;Bit32u c,a; c=0;a=(render.src.width<<16)/gfx_info.width; for (i=0;i> 16; } c=0;a=(render.src.height<<16)/gfx_info.height; for (i=0;i>16)*render.src.pitch; } } static void Draw_8_Normal(Bit8u * src_data,Bit8u * dst_data) { for (Bitu y=0;yentry) render.pal.first=entry; if (render.pal.last