2
0
David Rose 17 жил өмнө
parent
commit
e5d5c295c7

+ 5 - 5
panda/src/tinydisplay/zbuffer.cxx

@@ -142,11 +142,11 @@ static void ZB_copyFrameBuffer5R6G5B(ZBuffer * zb,
                                      void *buf, int linesize) 
                                      void *buf, int linesize) 
 {
 {
     PIXEL *q;
     PIXEL *q;
-    unsigned char *p, *p1;
+    unsigned short *p, *p1;
     int y, n;
     int y, n;
 
 
     q = zb->pbuf;
     q = zb->pbuf;
-    p1 = (unsigned char *) buf;
+    p1 = (unsigned short *) buf;
 
 
     for (y = 0; y < zb->ysize; y++) {
     for (y = 0; y < zb->ysize; y++) {
 	p = p1;
 	p = p1;
@@ -159,7 +159,7 @@ static void ZB_copyFrameBuffer5R6G5B(ZBuffer * zb,
 	    q += 4;
 	    q += 4;
 	    p += 4;
 	    p += 4;
 	} while (--n > 0);
 	} while (--n > 0);
-	p1 = (unsigned char *)((char *)p1 + linesize);
+	p1 = (unsigned short *)((char *)p1 + linesize);
     }
     }
 }
 }
 
 
@@ -222,7 +222,7 @@ void memset_s(void *adr, int val, int count)
 {
 {
     int i, n, v;
     int i, n, v;
     unsigned int *p;
     unsigned int *p;
-    unsigned char *q;
+    unsigned short *q;
 
 
     p = (unsigned int *)adr;
     p = (unsigned int *)adr;
     v = val | (val << 16);
     v = val | (val << 16);
@@ -236,7 +236,7 @@ void memset_s(void *adr, int val, int count)
 	p += 4;
 	p += 4;
     }
     }
 
 
-    q = (unsigned char *) p;
+    q = (unsigned short *) p;
     n = count & 7;
     n = count & 7;
     for (i = 0; i < n; i++)
     for (i = 0; i < n; i++)
 	*q++ = val;
 	*q++ = val;

+ 1 - 1
panda/src/tinydisplay/zgl.h

@@ -208,7 +208,7 @@ void gl_eval_viewport(GLContext *c);
 void gl_vertex_transform(GLContext * c, GLVertex * v);
 void gl_vertex_transform(GLContext * c, GLVertex * v);
 
 
 /* image_util.c */
 /* image_util.c */
-void gl_convertRGB_to_5R6G5B(unsigned char *pixmap,unsigned char *rgb,
+void gl_convertRGB_to_5R6G5B(unsigned short *pixmap,unsigned char *rgb,
                              int xsize,int ysize);
                              int xsize,int ysize);
 void gl_convertRGB_to_8A8R8G8B(unsigned int *pixmap, unsigned char *rgb,
 void gl_convertRGB_to_8A8R8G8B(unsigned int *pixmap, unsigned char *rgb,
                                int xsize, int ysize);
                                int xsize, int ysize);