version 1.1 | | version 1.2 |
---|
| | |
* Routines for bitblt's. | | * Routines for bitblt's. |
* | | * |
* $Log$ | | * $Log$ |
* Revision 1.1 1999/06/14 21:57:14 donut | | * Revision 1.2 1999/08/05 22:53:40 sekmu |
* Initial revision | | * |
| | * D3D patch(es) from ADB |
| | * |
| | * Revision 1.1.1.1 1999/06/14 21:57:14 donut |
| | * Import of d1x 1.37 source. |
* | | * |
* Revision 1.29 1995/03/14 12:14:28 john | | * Revision 1.29 1995/03/14 12:14:28 john |
* Added code to double horz/vert bitblts. | | * Added code to double horz/vert bitblts. |
| | |
| | |
void gr_bm_ubitblt00_rle(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); | | void gr_bm_ubitblt00_rle(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); |
void gr_bm_ubitblt00m_rle(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); | | void gr_bm_ubitblt00m_rle(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); |
void gr_bm_ubitblt0x_rle(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); | | void gr_bm_ubitblt0x_rle(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest, int masked); |
| | |
void gr_bm_ubitblt01(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); | | void gr_bm_ubitblt01(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); |
void gr_bm_ubitblt02(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); | | void gr_bm_ubitblt02(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest); |
| | |
} | | } |
} | | } |
#endif | | #endif |
| | #ifdef D1XD3D |
| | #include "d3dhelp.h" |
| | #endif |
| | |
void gr_ubitmap00( int x, int y, grs_bitmap *bm ) | | void gr_ubitmap00( int x, int y, grs_bitmap *bm ) |
{ | | { |
| | |
return; | | return; |
#ifdef D1XD3D | | #ifdef D1XD3D |
case BM_DIRECTX: | | case BM_DIRECTX: |
Assert (grd_curcanv->cv_bitmap.bm_data == BM_D3D_RENDER || grd_curcanv->cv_bitmap.bm_data == BM_D3D_DISPLAY); | | Assert ((int)grd_curcanv->cv_bitmap.bm_data == BM_D3D_RENDER || (int)grd_curcanv->cv_bitmap.bm_data == BM_D3D_DISPLAY); |
Win32_BlitLinearToDirectX (bm->bm_w, bm->bm_h, x, y, 0, 0, bm->pvSurface, grd_curcanv->cv_bitmap.bm_data, 0); | | Win32_BlitLinearToDirectX_bm(bm, 0, 0, bm->bm_w, bm->bm_h, x, y, 0); |
return; | | return; |
#endif | | #endif |
#ifdef __MSDOS__ | | #ifdef __MSDOS__ |
case BM_SVGA: | | case BM_SVGA: |
if ( bm->bm_flags & BM_FLAG_RLE ) | | if ( bm->bm_flags & BM_FLAG_RLE ) |
gr_bm_ubitblt0x_rle(bm->bm_w, bm->bm_h, x, y, 0, 0, bm, &grd_curcanv->cv_bitmap ); | | gr_bm_ubitblt0x_rle(bm->bm_w, bm->bm_h, x, y, 0, 0, bm, &grd_curcanv->cv_bitmap, 0 ); |
else | | else |
gr_bm_ubitblt02( bm->bm_w, bm->bm_h, x, y, 0, 0, bm, &grd_curcanv->cv_bitmap); | | gr_bm_ubitblt02( bm->bm_w, bm->bm_h, x, y, 0, 0, bm, &grd_curcanv->cv_bitmap); |
return; | | return; |
| | |
return; | | return; |
#ifdef D1XD3D | | #ifdef D1XD3D |
case BM_DIRECTX: | | case BM_DIRECTX: |
Assert (grd_curcanv->cv_bitmap.bm_data == BM_D3D_RENDER || grd_curcanv->cv_bitmap.bm_data == BM_D3D_DISPLAY); | | if (bm->bm_w < 35 && bm->bm_h < 35) { |
Win32_BlitLinearToDirectX (bm->bm_w, bm->bm_h, x, y, 0, 0, bm->pvSurface, grd_curcanv->cv_bitmap.bm_data, 0); | | // ugly hack needed for reticle |
| | if ( bm->bm_flags & BM_FLAG_RLE ) |
| | gr_bm_ubitblt0x_rle(bm->bm_w, bm->bm_h, x, y, 0, 0, bm, &grd_curcanv->cv_bitmap, 1 ); |
| | else |
| | gr_ubitmapGENERICm(x, y, bm); |
| | return; |
| | } |
| | Assert ((int)grd_curcanv->cv_bitmap.bm_data == BM_D3D_RENDER || (int)grd_curcanv->cv_bitmap.bm_data == BM_D3D_DISPLAY); |
| | Win32_BlitLinearToDirectX_bm(bm, 0, 0, bm->bm_w, bm->bm_h, x, y, 1); |
return; | | return; |
#endif | | #endif |
#ifdef __MSDOS__ | | #ifdef __MSDOS__ |
| | |
#ifdef D1XD3D | | #ifdef D1XD3D |
if ( (src->bm_type == BM_LINEAR) && (dest->bm_type == BM_DIRECTX )) | | if ( (src->bm_type == BM_LINEAR) && (dest->bm_type == BM_DIRECTX )) |
{ | | { |
Assert (dest->bm_data == BM_D3D_RENDER || dest->bm_data == BM_D3D_DISPLAY); | | Assert ((int)dest->bm_data == BM_D3D_RENDER || (int)dest->bm_data == BM_D3D_DISPLAY); |
Win32_BlitLinearToDirectX (w, h, dx, dy, sx, sy, src->pvSurface, dest->bm_data, 0); | | Win32_BlitLinearToDirectX_bm (src, sx, sy, w, h, dx, dy, 0); |
return; | | return; |
} | | } |
if ( (src->bm_type == BM_DIRECTX) && (dest->bm_type == BM_LINEAR )) | | if ( (src->bm_type == BM_DIRECTX) && (dest->bm_type == BM_LINEAR )) |
| | |
#endif | | #endif |
| | |
if ( (src->bm_flags & BM_FLAG_RLE ) && (src->bm_type == BM_LINEAR) ) { | | if ( (src->bm_flags & BM_FLAG_RLE ) && (src->bm_type == BM_LINEAR) ) { |
gr_bm_ubitblt0x_rle(w, h, dx, dy, sx, sy, src, dest ); | | gr_bm_ubitblt0x_rle(w, h, dx, dy, sx, sy, src, dest, 0 ); |
return; | | return; |
} | | } |
#ifdef __MSDOS__ | | #ifdef __MSDOS__ |
| | |
#ifdef D1XD3D | | #ifdef D1XD3D |
if ( (src->bm_type == BM_LINEAR) && (dest->bm_type == BM_DIRECTX )) | | if ( (src->bm_type == BM_LINEAR) && (dest->bm_type == BM_DIRECTX )) |
{ | | { |
Assert (dest->bm_data == BM_D3D_RENDER || dest->bm_data == BM_D3D_DISPLAY); | | Assert ((int)dest->bm_data == BM_D3D_RENDER || (int)dest->bm_data == BM_D3D_DISPLAY); |
Win32_BlitLinearToDirectX (w, h, dx, dy, sx, sy, src->pvSurface, dest->bm_data, 1); | | Win32_BlitLinearToDirectX_bm (src, sx, sy, w, h, dx, dy, 1); |
return; | | return; |
} | | } |
if ( (src->bm_type == BM_DIRECTX) && (dest->bm_type == BM_DIRECTX )) | | if ( (src->bm_type == BM_DIRECTX) && (dest->bm_type == BM_DIRECTX )) |
{ | | { |
Assert (src->bm_data == BM_D3D_RENDER || src->bm_data == BM_D3D_DISPLAY); | | Assert ((int)src->bm_data == BM_D3D_RENDER || (int)src->bm_data == BM_D3D_DISPLAY); |
Assert (dest->bm_data == BM_D3D_RENDER || dest->bm_data == BM_D3D_DISPLAY); | | |
// Win32_BlitDirectXToDirectX (w, h, dx, dy, sx, sy, src->bm_data, dest->bm_data, 0); | | // Win32_BlitDirectXToDirectX (w, h, dx, dy, sx, sy, src->bm_data, dest->bm_data, 0); |
return; | | return; |
} | | } |
| | |
| | |
// in rle.c | | // in rle.c |
| | |
extern void gr_rle_expand_scanline_generic( grs_bitmap * dest, int dx, int dy, ubyte *src, int x1, int x2 ); | | extern void gr_rle_expand_scanline_generic( grs_bitmap * dest, int dx, int dy, ubyte *src, |
| | int x1, int x2, int masked ); |
| | |
| | |
void gr_bm_ubitblt0x_rle(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest) | | void gr_bm_ubitblt0x_rle(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, |
| | grs_bitmap * dest, int masked ) |
{ | | { |
int i; | | int i; |
register int y1; | | register int y1; |
| | |
sbits += (int)src->bm_data[4+i]; | | sbits += (int)src->bm_data[4+i]; |
| | |
for (y1=0; y1 < h; y1++ ) { | | for (y1=0; y1 < h; y1++ ) { |
gr_rle_expand_scanline_generic( dest, dx, dy+y1, sbits, sx, sx+w-1 ); | | gr_rle_expand_scanline_generic( dest, dx, dy+y1, sbits, sx, sx+w-1, |
| | masked ); |
sbits += (int)src->bm_data[4+y1+sy]; | | sbits += (int)src->bm_data[4+y1+sy]; |
} | | } |
| | |
} | | } |
| | |
| | |
| | |