Slick Forums

Discuss the Slick 2D Library
It is currently Sun May 19, 2013 1:30 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu May 31, 2007 10:00 am 
Offline
User avatar

Joined: Fri May 04, 2007 5:58 pm
Posts: 72
I play around with colors a lot and in the trivial (and much much more frequent) case I'm constantly calling Graphics.setColor(<some instance of white>).

To prevent all the extra color.bind without implementing tests in various points of the code, I could use this:

Code:
   /**
    * Set the color to use when rendering to this context
    *
    * @param color The color to use when rendering to this context
    */
   public void setColor(Color color) {
      if (!color.equals(currentColor)) {
         currentColor = color;
         predraw();
         color.bind();
         postdraw(); 
      }
   }


Could be useful for everyone, couldn't it?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 10:07 am 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Yep, will do.

If you're going to post a series of tiny changes like this, could you list them in one bug reports to stop me having to swap page when I'm doing the updates ;)

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 10:14 am 
Offline
User avatar

Joined: Fri May 04, 2007 5:58 pm
Posts: 72
kevglass wrote:
Yep, will do.

If you're going to post a series of tiny changes like this, could you list them in one bug reports to stop me having to swap page when I'm doing the updates ;)

Kev


xDDD Sorry, man. I'll behave. :oops:

P.S.: I'm good for now, some testing to the input refactors -I'll mail them to you and davedes this weekend; minimal changes to the behaviour have let me simplify a lot of classes- and it's time to continue working in my game instead of bugging you. 8)


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 5:55 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Change is in SVN.

Kev


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group