gdraw.c, Makefile.mingw: integrate new xdrawtri.asm to build.

h3 and h5 trees now build using MinGW.  will run-test later..
This commit is contained in:
sezero
2018-08-13 23:24:02 +03:00
parent 49be990209
commit 902edc7a66
4 changed files with 34 additions and 0 deletions

View File

@@ -143,6 +143,14 @@ else
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
ifndef DEBUG
ifeq ($(USE_X86),1)
# the 'naked' grDrawTriangle() func is in xdrawtri.asm:
# C_TRISETUP and GLIDE_DEBUG not defined (see gdraw.c)
override USE_DRAWTRI_ASM = 1
endif
endif
# for cross-builds
# note that with this, fxgasm outputs wrong (20 bytes shorter) SIZEOF_GC and SIZEOF_GrState
# values in fxgasm.h - everything else is the same (compared to fxgasm.h generated by MSVC 6).
@@ -178,6 +186,9 @@ GLIDE_OBJECTS = \
gtexdl.o \
xtexdl_def.o
ifeq ($(USE_DRAWTRI_ASM),1)
GLIDE_OBJECTS += xdrawtri.o
endif
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
cpuid.o \
@@ -276,6 +287,9 @@ xdraw3_3dnow.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
# -D__MINGW32__ is needed for dllexport to work
xdrawtri.o: xdrawtri.asm
$(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $<
$(GLIDE_OBJECTS): fxinline.h fxgasm.h

View File

@@ -283,6 +283,9 @@ GR_ENTRY(grDrawLine, void, (const void *a, const void *b))
/*---------------------------------------------------------------------------
** grDrawTriangle
*/
#if defined(__MINGW32__) && !(GLIDE_USE_C_TRISETUP || GLIDE_DEBUG)
#define HAVE_XDRAWTRI_ASM
#endif
#ifndef HAVE_XDRAWTRI_ASM /* grDrawTriangle() not in asm */
#if defined(_MSC_VER) && !defined(GLIDE_DEBUG) && !(GLIDE_USE_C_TRISETUP)
__declspec( naked )

View File

@@ -163,6 +163,14 @@ else
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
ifndef DEBUG
ifeq ($(USE_X86),1)
# the 'naked' grDrawTriangle() func is in xdrawtri.asm:
# C_TRISETUP and GLIDE_DEBUG not defined (see gdraw.c)
override USE_DRAWTRI_ASM = 1
endif
endif
# for cross-builds
# note that with this, fxgasm outputs wrong (20 bytes shorter) SIZEOF_GC and SIZEOF_GrState
# values in fxgasm.h - everything else is the same (compared to fxgasm.h generated by MSVC 6).
@@ -198,6 +206,9 @@ GLIDE_OBJECTS = \
gtexdl.o \
xtexdl_def.o
ifeq ($(USE_DRAWTRI_ASM),1)
GLIDE_OBJECTS += xdrawtri.o
endif
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
cpuid.o \
@@ -316,6 +327,9 @@ xdraw3_sse.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
xtexdl_sse2.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE2=1 $<
# -D__MINGW32__ is needed for dllexport to work
xdrawtri.o: xdrawtri.asm
$(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $<
$(GLIDE_OBJECTS): fxinline.h fxgasm.h fxbldno.h

View File

@@ -291,6 +291,9 @@ GR_ENTRY(grDrawLine, void, (const void *a, const void *b))
/*---------------------------------------------------------------------------
** grDrawTriangle
*/
#if defined(__MINGW32__) && !(GLIDE_USE_C_TRISETUP || GLIDE_DEBUG)
#define HAVE_XDRAWTRI_ASM
#endif
#if defined(__POWERPC__) && !GLIDE_USE_C_TRISETUP
#define HAVE_XDRAWTRI_ASM
#endif