Yet another 16-bit fix for BGI and GRX. GrColor is not used in libbcc.h because including the grx headers is not and should not be a requirement for using GRX's BGI and the GrColor type may be unavailable. Compiled and tested with BCC / DOS only. What if I try to port GRX to BCC / WIN32 after -pre4?
diff -Nru3 grx245-1/include/grx20.h grx/include/grx20.h --- grx245-1/include/grx20.h Mon Jun 17 23:13:06 2002 +++ grx/include/grx20.h Wed Jul 10 09:54:56 2002 @@ -135,7 +135,7 @@ /* ================================================================== */
/* need unsigned 32 bit integer for color stuff */ -#ifdef __TURBOC__ +#if defined(__TURBOC__) && defined(__MSDOS__) /* TCC && BCC are 16 bit compilers */ typedef unsigned long int GrColor; #else diff -Nru3 grx245-1/include/libbcc.h grx/include/libbcc.h --- grx245-1/include/libbcc.h Wed Jul 10 10:03:20 2002 +++ grx/include/libbcc.h Wed Jul 10 09:59:36 2002 @@ -339,7 +339,11 @@ extern int __gr_color; /* drawing color */ extern int __gr_colorbg; /* background color */ extern int __gr_colorfill; /* fill color */ -extern int __gr_WR; /* Write mode */ +#if defined(__TURBOC__) && defined(__MSDOS__) +extern unsigned long __gr_WR; /* Write mode, type */ +#else +extern unsigned int __gr_WR; /* must match GrColor */ +#endif extern int __gr_Xasp; /* Aspect ratio */ extern int __gr_Yasp; extern int __gr_fpatno; diff -Nru3 grx245-1/src/bgi/bccgrx.c grx/src/bgi/bccgrx.c --- grx245-1/src/bgi/bccgrx.c Wed Jul 10 10:03:20 2002 +++ grx/src/bgi/bccgrx.c Wed Jul 10 09:59:36 2002 @@ -42,7 +42,7 @@ int __gr_color; /* drawing color */ int __gr_colorbg; /* background color */ int __gr_colorfill; /* fill color */ -int __gr_WR = GrWRITE; /* Write mode */ +GrColor __gr_WR = GrWRITE; /* Write mode */ int __gr_lstyle = SOLID_LINE; /* Actual line style */ int __gr_fpatno = SOLID_FILL; /* Actual filling pattern */ int __gr_Xasp = 10000; /* Aspect ratio */ diff -Nru3 grx245-1/src/bgi/putimage.c grx/src/bgi/putimage.c --- grx245-1/src/bgi/putimage.c Sat Dec 22 14:02:42 2001 +++ grx/src/bgi/putimage.c Wed Jul 10 09:49:54 2002 @@ -40,7 +40,7 @@ void putimage(int left, int top, void *bitmap, int op) { GrContext *gc; - int gr_op; + GrColor gr_op;
_DO_INIT_CHECK; GrSetContext(NULL);