Menu

#1 setpixels: typo in version 1.94

open
nobody
None
5
2005-01-07
2005-01-07
No

this typo was reported by an anonymous source.

quick-fix: replace function serdisp_setpixels through
the following:

/******clip here ********************/

void serdisp_setpixels(serdisp_t* dd, int x, int y, int w,
int h, byte* data) {
int i,j;

if (dd->colours <= 256)
for (j = 0; j < h; j++)
for (i = 0; i < w; i++)
dd->fp_setpixel(dd, i+x, j+y, data[ j*w + i]);
else /* 4 bytes per colour. never used/tested, but here
for completeness */
for (j = 0; j < h; j++)
for (i = 0; i < w; i++)
/* 4 bytes -> 1 int */
dd->fp_setpixel(dd, i+x, j,+y, data[ 4*j*w +
4*i+0]
+
(data[ 4*j*w +
4*i+1]<<8) +
(data[ 4*j*w +
4*i+2]<<16) +
(data[ 4*j*w +
4*i+3]<<24) );
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.