From bdbeeafdb9fc5f44c5e43dcc69038c7f66b39d8a Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Thu, 10 Oct 2002 18:39:45 +0000 Subject: [PATCH] enable TRANSPARENCY_COLOR for assembly --- 2d/Makefile.am | 8 +++++++- 2d/tmerge_a.asm | 18 +++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/2d/Makefile.am b/2d/Makefile.am index 520b4bc3..b93d72db 100644 --- a/2d/Makefile.am +++ b/2d/Makefile.am @@ -7,6 +7,12 @@ else ASM_SRCS = tmerge.c endif +if MACDATA +TRANSPARENCY_COLOR = 0 +else +TRANSPARENCY_COLOR = 255 +endif + lib2d_a_SOURCES = ${ASM_SRCS} \ 2dsline.c box.c disc.c ibitblt.c pcx.c rect.c scalec.c \ bitblt.c canvas.c font.c line.c pixel.c rle.c \ @@ -14,7 +20,7 @@ bitmap.c circle.c gpixel.c palette.c poly.c SUFFIXES = .asm %.o: %.asm - $(NASM) $(NASMFLAGS) $< -o $@ + $(NASM) -dTRANSPARENCY_COLOR=${TRANSPARENCY_COLOR} $(NASMFLAGS) $< -o $@ if USE_ASM lib2d_a_LIBADD = linear.o tmerge_a.o diff --git a/2d/tmerge_a.asm b/2d/tmerge_a.asm index ccd0ed4a..d80b0626 100644 --- a/2d/tmerge_a.asm +++ b/2d/tmerge_a.asm @@ -1,4 +1,4 @@ -; $Id: tmerge_a.asm,v 1.2 2002-07-17 21:55:19 bradleyb Exp $ +; $Id: tmerge_a.asm,v 1.3 2002-10-10 18:39:45 btb Exp $ ;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX ;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO ;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A @@ -7,7 +7,7 @@ ;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE ;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE ;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS -;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. +;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. [BITS 32] @@ -29,7 +29,7 @@ global gr_merge_textures, gr_merge_textures_1, gr_merge_textures_2, gr_merge_tex ; for (y=0; y<64; y++ ) ; for (x=0; x<64; x++ ) { ; c = top_data[ 64*x+(63-y) ]; -; if (c==255) +; if (c==TRANSPARENCY_COLOR) ; c = bottom_data[ 64*y+x ]; ; *dest_data++ = c; ; } @@ -39,7 +39,7 @@ global gr_merge_textures, gr_merge_textures_1, gr_merge_textures_2, gr_merge_tex ; for (y=0; y<64; y++ ) ; for (x=0; x<64; x++ ) { ; c = top_data[ 64*(63-y)+(63-x) ]; -; if (c==255) +; if (c==TRANSPARENCY_COLOR) ; c = bottom_data[ 64*y+x ]; ; *dest_data++ = c; ; } @@ -49,7 +49,7 @@ global gr_merge_textures, gr_merge_textures_1, gr_merge_textures_2, gr_merge_tex ; for (y=0; y<64; y++ ) ; for (x=0; x<64; x++ ) { ; c = top_data[ 64*(63-x)+y ]; -; if (c==255) +; if (c==TRANSPARENCY_COLOR) ; c = bottom_data[ 64*y+x ]; ; *dest_data++ = c; ; } @@ -72,7 +72,7 @@ gr_merge_textures: mov ebp, edx mov edi, ebx - mov bl, 255 + mov bl, TRANSPARENCY_COLOR mov bh, bl and ebx, 0ffffh and edx, 0ffffh @@ -141,7 +141,7 @@ gr_merge_textures_1: mov edx, [esp+24] mov ebx, [esp+28] - mov ch, 255 ; transparent color, stick in a register, is this faster? + mov ch, TRANSPARENCY_COLOR ; transparent color, stick in a register, is this faster? mov esi, 63 ; esi will be the offset to the current pixel mov [row_count], esi @@ -193,7 +193,7 @@ gr_merge_textures_2: mov edx, [esp+24] mov ebx, [esp+28] - mov ch, 255 ; transparent color, stick in a register, is this faster? + mov ch, TRANSPARENCY_COLOR ; transparent color, stick in a register, is this faster? mov esi, 63 + 64*63 ; esi will be the offset to the current pixel @@ -235,7 +235,7 @@ gr_merge_textures_3: mov edx, [esp+24] mov ebx, [esp+28] - mov ch, 255 ; transparent color, stick in a register, is this faster? + mov ch, TRANSPARENCY_COLOR ; transparent color, stick in a register, is this faster? mov esi, 64*63 ; esi will be the offset to the current pixel mov dword [row_count], 64 -- 2.39.2