This site is no longer active and is available for archival purposes only. Registration and login is disabled.

EasyCE clear() function


EasyCE clear() function

Postby GeoffSulcer » Dec 14, 2001 @ 11:09am

<a href="http://gsulcer.blogspot.com">Rampant Futurism Blog</a>
User avatar
GeoffSulcer
pm Member
 
Posts: 51
Joined: Nov 11, 2001 @ 9:33am
Location: Stow, OH


Re: EasyCE clear() function

Postby Digby » Dec 14, 2001 @ 11:59am

Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Re: EasyCE clear() function

Postby Phantom » Dec 14, 2001 @ 11:59am

Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: EasyCE clear() function

Postby GeoffSulcer » Dec 14, 2001 @ 12:02pm

<a href="http://gsulcer.blogspot.com">Rampant Futurism Blog</a>
User avatar
GeoffSulcer
pm Member
 
Posts: 51
Joined: Nov 11, 2001 @ 9:33am
Location: Stow, OH


Re: EasyCE clear() function

Postby Dan East » Dec 14, 2001 @ 1:00pm

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: EasyCE clear() function

Postby Digby » Dec 14, 2001 @ 2:15pm

Yes, good point Dan.  memset is filling on a per-byte basis and if your upper byte isn't the same as your lower byte then you're hosed.<br><br>BTW, you've got a typo in that source you've posted:<br><br>couplet<<16;<br><br>should be<br><br>couplet<<=16;<br><br>
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Re: EasyCE clear() function

Postby Dan East » Dec 14, 2001 @ 2:31pm

How about this? This assumes PIXEL is two bytes:<br>[fixed]<br>void clear(PIXEL color) {<br>  unsigned int couplet=color;<br>  couplet<<=16;<br>  couplet|=color;<br><br>  unsigned int *cur=(unsigned int *)getbuffer();<br>  unsigned int *end=cur+<br>    (320*240*sizeof(color))/sizeof(unsigned int);<br><br>  while (cur<end)<br>    *cur++=couplet;<br>}[/fixed]<br><br>Dan East<br>You would normally see "Last modification..." here, but I'm hiding it from you. :D [color=#3366cc]Last modification: Dan East - 12/14/01 at 11:31:02
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: EasyCE clear() function

Postby Dan East » Dec 14, 2001 @ 2:34pm

Thanks Digby! Those types of errors really suck. I don't know if eVC++ would give you a "this operator has no effect" warning or not.<br><br>The sample code has been corrected...<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: EasyCE clear() function

Postby Phantom » Dec 16, 2001 @ 2:18pm

Hm, pretty stupid mistake I made in that clear function. :) Problem probably is that I never used it with anything else than black. :)
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Return to Phantom's Forum


Sort


Forum Description

Discuss any of Phantom's projects here (Operation Nutcracker, etc.)

Moderators:

sponge, RICoder, Phantom

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron