Additional commit for last revision - didn't selected all files properly
This commit is contained in:
parent
9f6cbc8c6c
commit
e60a7e1bca
|
@ -35,8 +35,6 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
|
|
||||||
static int Transparency_color = TRANSPARENCY_COLOR;
|
static int Transparency_color = TRANSPARENCY_COLOR;
|
||||||
|
|
||||||
#include "scalea.h"
|
|
||||||
|
|
||||||
void rls_stretch_scanline( char * source, char * dest, int XDelta, int YDelta );
|
void rls_stretch_scanline( char * source, char * dest, int XDelta, int YDelta );
|
||||||
void rls_stretch_scanline_setup( int XDelta, int YDelta );
|
void rls_stretch_scanline_setup( int XDelta, int YDelta );
|
||||||
void scale_bitmap_asm(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 );
|
void scale_bitmap_asm(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1 );
|
||||||
|
|
99
2d/scalea.h
99
2d/scalea.h
|
@ -1,99 +0,0 @@
|
||||||
/* $Id: scalea.h,v 1.1.1.1 2006/03/17 19:52:00 zicodxx Exp $ */
|
|
||||||
extern char scale_trans_color;
|
|
||||||
extern int scale_error_term;
|
|
||||||
extern int scale_initial_pixel_count;
|
|
||||||
extern int scale_adj_up;
|
|
||||||
extern int scale_adj_down;
|
|
||||||
extern int scale_final_pixel_count;
|
|
||||||
extern int scale_ydelta_minus_1;
|
|
||||||
extern int scale_whole_step;
|
|
||||||
extern ubyte * scale_source_ptr;
|
|
||||||
extern ubyte * scale_dest_ptr;
|
|
||||||
extern void rls_stretch_scanline_asm();
|
|
||||||
extern void scale_do_cc_scanline();
|
|
||||||
extern void rls_do_cc_setup_asm();
|
|
||||||
|
|
||||||
#ifdef __WATCOMC__
|
|
||||||
void rep_stosb(char *ScreenPtr, int RunLength, int Color);
|
|
||||||
#pragma aux rep_stosb = \
|
|
||||||
" rep stosb" \
|
|
||||||
parm [EDI] [ECX] [EAX]\
|
|
||||||
modify [];
|
|
||||||
|
|
||||||
// esi, edi = source, dest
|
|
||||||
// ecx = width
|
|
||||||
// ebx = u
|
|
||||||
// edx = du
|
|
||||||
|
|
||||||
void scale_row_asm_transparent( ubyte * sbits, ubyte * dbits, int width, fix u, fix du );
|
|
||||||
#pragma aux scale_row_asm_transparent parm [esi] [edi] [ecx] [ebx] [edx] modify exact [edi eax ebx ecx] = \
|
|
||||||
"newpixel: mov eax, ebx " \
|
|
||||||
" shr eax, 16 " \
|
|
||||||
" mov al, [esi+eax] " \
|
|
||||||
" cmp al, 255 " \
|
|
||||||
" je skip_it " \
|
|
||||||
" mov [edi], al " \
|
|
||||||
"skip_it: add ebx, edx " \
|
|
||||||
" inc edi " \
|
|
||||||
" dec ecx " \
|
|
||||||
" jne newpixel "
|
|
||||||
|
|
||||||
void scale_row_asm( ubyte * sbits, ubyte * dbits, int width, fix u, fix du );
|
|
||||||
#pragma aux scale_row_asm parm [esi] [edi] [ecx] [ebx] [edx] modify exact [edi eax ebx ecx] = \
|
|
||||||
"newpixel1: mov eax, ebx " \
|
|
||||||
" shr eax, 16 " \
|
|
||||||
" mov al, [esi+eax] " \
|
|
||||||
" add ebx, edx " \
|
|
||||||
" mov [edi], al " \
|
|
||||||
" inc edi " \
|
|
||||||
" dec ecx " \
|
|
||||||
" jne newpixel1 "
|
|
||||||
|
|
||||||
|
|
||||||
void rep_movsb( ubyte * sbits, ubyte * dbits, int width );
|
|
||||||
#pragma aux rep_movsb parm [esi] [edi] [ecx] modify exact [esi edi ecx] = \
|
|
||||||
"rep movsb"
|
|
||||||
|
|
||||||
#else
|
|
||||||
static inline void rep_stosb(char *ScreenPtr, int RunLength, int Color) {
|
|
||||||
int dummy[2];
|
|
||||||
__asm__ __volatile__ ("cld; rep; stosb"
|
|
||||||
: "=c" (dummy[0]), "=D" (dummy[1]) : "1" (ScreenPtr), "0" (RunLength), "a" (Color) );
|
|
||||||
}
|
|
||||||
static inline void scale_row_asm_transparent( ubyte * sbits, ubyte * dbits, int width, fix u, fix du ) {
|
|
||||||
int dummy[3];
|
|
||||||
__asm__ __volatile__ (
|
|
||||||
"0: movl %%ebx, %%eax;"
|
|
||||||
" shrl $16, %%eax;"
|
|
||||||
" movb (%%esi, %%eax), %%al;"
|
|
||||||
" cmpb $255, %%al;"
|
|
||||||
" je 1f;"
|
|
||||||
" movb %%al, (%%edi);"
|
|
||||||
"1: addl %%edx, %%ebx;"
|
|
||||||
" incl %%edi;"
|
|
||||||
" decl %%ecx;"
|
|
||||||
" jne 0b"
|
|
||||||
: "=c" (dummy[0]), "=b" (dummy[1]), "=D" (dummy[2])
|
|
||||||
: "S" (sbits), "2" (dbits), "0" (width), "1" (u), "d" (du)
|
|
||||||
: "%eax");
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void scale_row_asm( ubyte * sbits, ubyte * dbits, int width, fix u, fix du ) {
|
|
||||||
__asm__ __volatile__ (
|
|
||||||
"0: movl %%ebx,%%eax;"
|
|
||||||
" shrl $16, %%eax;"
|
|
||||||
" movb (%%esi, %%eax), %%al;"
|
|
||||||
" addl %%edx, %%ebx;"
|
|
||||||
" movb %%al, (%%edi);"
|
|
||||||
" incl %%edi;"
|
|
||||||
" decl %%ecx;"
|
|
||||||
" jne 0b"
|
|
||||||
: : "S" (sbits), "D" (dbits), "c" (width), "b" (u), "d" (du)
|
|
||||||
: "%eax", "%ebx", "%ecx", "%edi");
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void rep_movsb( ubyte * sbits, ubyte * dbits, int width ) {
|
|
||||||
__asm__ __volatile__ ("cld; rep; movsb"
|
|
||||||
: : "S" (sbits), "D" (dbits), "c" (width) : "%ecx", "%esi", "%edi");
|
|
||||||
}
|
|
||||||
#endif
|
|
66
2d/scalec.c
66
2d/scalec.c
|
@ -216,56 +216,6 @@ void rls_stretch_scanline( )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
void rls_stretch_scanline()
|
|
||||||
{
|
|
||||||
ubyte c;
|
|
||||||
int i, j, len, ErrorTerm, x;
|
|
||||||
|
|
||||||
// Setup initial variables
|
|
||||||
ErrorTerm = scale_error_term;
|
|
||||||
|
|
||||||
// Draw the first, partial run of pixels
|
|
||||||
|
|
||||||
c = *scale_source_ptr++;
|
|
||||||
if ( c != TRANSPARENCY_COLOR ) {
|
|
||||||
for (i=0; i<scale_initial_pixel_count; i++ )
|
|
||||||
*scale_dest_ptr++ = c;
|
|
||||||
} else {
|
|
||||||
scale_dest_ptr += scale_initial_pixel_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw all full runs
|
|
||||||
|
|
||||||
for (j=0; j<scale_ydelta_minus_1; j++) {
|
|
||||||
len = scale_whole_step; // run is at least this long
|
|
||||||
|
|
||||||
// Advance the error term and add an extra pixel if the error term so indicates
|
|
||||||
if ((ErrorTerm += scale_adj_up) > 0) {
|
|
||||||
len++;
|
|
||||||
ErrorTerm -= scale_adj_down; // reset the error term
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw this run o' pixels
|
|
||||||
c = *scale_source_ptr++;
|
|
||||||
if ( c != TRANSPARENCY_COLOR ) {
|
|
||||||
for (i=len; i>0; i-- )
|
|
||||||
*scale_dest_ptr++ = c;
|
|
||||||
} else {
|
|
||||||
scale_dest_ptr += len;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw the final run of pixels
|
|
||||||
c = *scale_source_ptr++;
|
|
||||||
if ( c != TRANSPARENCY_COLOR ) {
|
|
||||||
for (i=0; i<scale_final_pixel_count; i++ )
|
|
||||||
*scale_dest_ptr++ = c;
|
|
||||||
} else {
|
|
||||||
scale_dest_ptr += scale_final_pixel_count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// old stuff here...
|
// old stuff here...
|
||||||
|
|
||||||
void scale_bitmap_c(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1, int orientation )
|
void scale_bitmap_c(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0, int x1, int y1, fix u0, fix v0, fix u1, fix v1, int orientation )
|
||||||
|
@ -306,20 +256,8 @@ void scale_bitmap_c(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, int y0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void scale_row_asm_transparent( ubyte * sbits, ubyte * dbits, int width, fix u, fix du )
|
void scale_row_transparent( ubyte * sbits, ubyte * dbits, int width, fix u, fix du )
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
int i;
|
|
||||||
ubyte c;
|
|
||||||
|
|
||||||
for (i=0; i<width; i++ ) {
|
|
||||||
c = sbits[ u >> 16 ];
|
|
||||||
if ( c!=TRANSPARENCY_COLOR)
|
|
||||||
*dbits = c;
|
|
||||||
dbits++;
|
|
||||||
u += du;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
int i;
|
int i;
|
||||||
ubyte c;
|
ubyte c;
|
||||||
ubyte *dbits_end = &dbits[width-1];
|
ubyte *dbits_end = &dbits[width-1];
|
||||||
|
@ -416,7 +354,7 @@ void scale_bitmap_c_rle(grs_bitmap *source_bmp, grs_bitmap *dest_bmp, int x0, in
|
||||||
last_row = f2i(v);
|
last_row = f2i(v);
|
||||||
decode_row( source_bmp, last_row );
|
decode_row( source_bmp, last_row );
|
||||||
}
|
}
|
||||||
scale_row_asm_transparent( scale_rle_data, &dest_bmp->bm_data[dest_bmp->bm_rowsize*y+x0], x1-x0+1, u0, du );
|
scale_row_transparent( scale_rle_data, &dest_bmp->bm_data[dest_bmp->bm_rowsize*y+x0], x1-x0+1, u0, du );
|
||||||
v += dv;
|
v += dv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ D2X-Rebirth Changelog
|
||||||
main/game.h, main/gamerend.c, main/gauges.c, main/multi.c, main/multi.h, main/net_udp.c: Introducing new BOUNTY Multiplayer game mode by Matt "1360" Vandermeulen <matt1360@gmail.com>
|
main/game.h, main/gamerend.c, main/gauges.c, main/multi.c, main/multi.h, main/net_udp.c: Introducing new BOUNTY Multiplayer game mode by Matt "1360" Vandermeulen <matt1360@gmail.com>
|
||||||
main/gauges.c, main/multi.c: Fix for showing bounty target in kill list - was not actually checking if player_num == Bounty_target; When Bounty_target player leaves game host must select a new target so the game can proceed
|
main/gauges.c, main/multi.c: Fix for showing bounty target in kill list - was not actually checking if player_num == Bounty_target; When Bounty_target player leaves game host must select a new target so the game can proceed
|
||||||
main/gamerend.c, main/multi.c, main/multi.h, main/net_ipx.c, main/net_udp.c, main/text.h: On NETGAMES list Bounty mode was not shown since MODE_NAMES define was not adjusted - so in the end introduced GMNames and GMNamesShrt Arrays in multi.c for globally displaying full or short Multiplayer game mode names
|
main/gamerend.c, main/multi.c, main/multi.h, main/net_ipx.c, main/net_udp.c, main/text.h: On NETGAMES list Bounty mode was not shown since MODE_NAMES define was not adjusted - so in the end introduced GMNames and GMNamesShrt Arrays in multi.c for globally displaying full or short Multiplayer game mode names
|
||||||
2d/bitmap.c, 2d/bitmap.h, 2d/canvas.c, 2d/font.c, 2d/tmerge.c, SConstruct, arch/linux/alsadigi.c, arch/sdl/digi_audio.c, arch/sdl/digi_mixer.c, include/error.h, include/maths.h, main/fvi_a.h, main/inferno.c, maths/fixc.c, maths/vecmat.c, texmap/scanline.c: Retired most of the Assembler code except the generic i386 scanline renderer; Removed all leftovers of Direct3D implementation; On the way make a some code more similar between D1X-Rebirth and D2X-Rebirth
|
2d/bitmap.c, 2d/bitmap.h, 2d/canvas.c, 2d/font.c, 2d/scale.c, 2d/scalec.c, 2d/tmerge.c, SConstruct, arch/linux/alsadigi.c, arch/sdl/digi_audio.c, arch/sdl/digi_mixer.c, include/error.h, include/maths.h, main/fvi_a.h, main/inferno.c, maths/fixc.c, maths/vecmat.c, texmap/scanline.c: Retired most of the Assembler code except the generic i386 scanline renderer; Removed all leftovers of Direct3D implementation; On the way make a some code more similar between D1X-Rebirth and D2X-Rebirth
|
||||||
|
|
||||||
20110118
|
20110118
|
||||||
--------
|
--------
|
||||||
|
|
Loading…
Reference in a new issue