[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] patch:XaAES:trnfm



-----------------------------------------------------
Use vs_color for pixel-detect again
-----------------------------------------------------


--- src.km/trnfm.c	14 Jan 2010 21:54:54 -0000	1.26.2.2
+++ src.km/trnfm.c	3 Feb 2010 23:05:24 -0000
@@ -40,8 +40,8 @@
 #include "xa_global.h"
 
 /* define this 1 if vs_color works */
-/* vs_color needs phys-handle??? */
-#define  HAVE_VS_COLOR	0
+/* vs_color in libgem broken? */
+#define  HAVE_VS_COLOR	1
 
 #include "trnfm.h"
 #if INCLUDE_UNUSED
@@ -2236,8 +2236,7 @@
 void
 set_syspalette(short vdih, struct rgb_1000 *palette)
 {
-	int i, pens;
-	//if( C.fvdi_version == 0 )	return;	/* as long as this doesn't work reliable */
+	short i, pens, rgb[3];
 
 	if (screen.planes > 8)
 		pens = 256;
@@ -2315,7 +2316,7 @@
 short
 detect_pixel_format(struct xa_vdi_settings *v)
 {
-	short ret = -1;
+	short ret = 8;	/* generic */
 
 	if (screen.planes > 8)
 	{
@@ -2331,6 +2332,7 @@
 		(*v->api->l_ends)(v, 0, 0);
 		(*v->api->l_width)(v, 1);
 #if HAVE_VS_COLOR
+		BLOG((0,"detect_pixel: using vs_color"));
 		vq_color(v->handle, 0, 1, (short *)&srgb);
 // 		display("saved %04d, %04d, %04d", srgb.red, srgb.green, srgb.blue);
 		rgb.red = 1000;
@@ -2341,6 +2343,7 @@
 #else
 		{
 		RECT r = {0,0,v->screen.w,v->screen.h};
+		BLOG((0,"detect_pixel: using vsf_color"));
 		(*v->api->f_color)(v, 6 );	/* yellow */
 		(*v->api->gbar)( v, 0, &r );
 		}