![]() |
|
Player info |
weapon_S
Member #7,859
October 2006
![]() |
Hi everybody ! Someone said that putpixel and getpixel are really slow. Is this true? [EDIT] Uhhmm... first I thought about posting something else, but I forgot to to rename the post. Sorry! |
HoHo
Member #4,534
April 2004
![]() |
Quote: Someone said that putpixel and getpixel are really slow. Is this true? Yes Quote: And more importantly (for me) does this also go for the explicit _getpixel and _putpixel ? Yes, but it is a bit less slow than regular putpixel Quote: I wanted to replace a (single) whole blit with this. Or should I then resort to something more complicated? Replacing a whole blit with putpixel calls is bad idea. You better describe what you want to achieve, I bet there are better alternative solutions to the problem. __________ |
Tobias Dammers
Member #2,604
August 2002
![]() |
If it's just blitting you want, resort to blit(). --- |
weapon_S
Member #7,859
October 2006
![]() |
Thanks for the answers. I will answer your question: |
Johan Peitz
Member #9
April 2000
![]() |
I'd say go with a quick and easy solution. Before the game starts, predraw all the frames with the new colors (using (_)putpixel) and use the new frames in the game. As long as there aren't zillions of frames and you don't do in in real time there shouldn't be a problem. -- |
HoHo
Member #4,534
April 2004
![]() |
Quote: I could make a copy of the bitmap to be different, but I don't consider it clean... I consider it to be much cleaner than the kind of hacking you propose, especially since copying images would be considerably faster One way of achieving it relatively simple would be this: Using this image you can create several copy's, each one will have its colourcoded areas filled with different colour. As those copies are generated once at loading time I don't see any problems by creating them using plain old get/putpixel. Of course there are other more interesting ways of doing it but that one is the simplest one I came up with __________ |
weapon_S
Member #7,859
October 2006
![]() |
Yeah, you're right... The method I came up with now is kind of hackish... and assumes a char to be 8 bits (or defines a 8 bit struct |
HoHo
Member #4,534
April 2004
![]() |
Quote: I've seen totally different alternate models, but I do not consider it clean to allocate memory for something that's almost exactly the same. Usually they do just that: have alternative skins for the models. When they are really smart they divide the skin to smaller parkts so they can have five identical bodies all with different heads. After all, a single skin doesn't take that much memory. A few megs is not all that much when you consider how much computations you save with it. __________ |
|