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

What's wrong?


What's wrong?

Postby Max » Nov 20, 2001 @ 5:00pm

Max
 


Re: What's wrong?

Postby PepeGG » Nov 20, 2001 @ 9:45pm

<!--The Sourcerer-->
PepeGG
pm Member
 
Posts: 78
Joined: Oct 15, 2001 @ 3:25pm
Location: Spain


Re: What's wrong?

Postby ketamine » Nov 21, 2001 @ 12:34am

yeah, you will definately need to allocate a block of memory equal to the size of the image you are trying to load. if you know that your sprite is a 256*256 image, then:<br><br>// create the block of memory for the sprite<br>PIXEL* source = new PIXEL[256 * 256]; <br><br>once created, load your image to the block of memory you just allocated.  remember to free this block of memory when done:<br><br>// free the memory<br>delete source;<br><br>hope this helps.<br><br>- Ketamien
ketamine
 


Re: What's wrong?

Postby max » Nov 21, 2001 @ 11:50am

is this right?<br><br>(not works too :-))<br><br>void main()<br>{<br>      <br>      unsigned short* buffer = (unsigned short*)getbuffer();<br><br>      PIXEL* dest = new PIXEL[240 * 80]; <br>      <br>      int w = 240;<br>      int h = 80;<br>      ACHAR* file = "sprite.tga";<br><br>      bool tgaload(ACHAR* file, int w, int h, PIXEL *dest);<br><br>      ASprite sprite(240, 80, 240, dest );<br><br><br>      ASprite::settarget( buffer );<br>      sprite.setpos(0,0);<br>      sprite.draw();<br>      update();<br>                        <br><br>      <br>      while (clicked()) { update(); };<br><br>      <br>      while (!clicked()) { update(); };<br><br><br><br>      <br>      <br>}<br>
max
 


Re: What's wrong?

Postby GeoffSulcer » Nov 21, 2001 @ 12:53pm

<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: What's wrong?

Postby max » Nov 21, 2001 @ 2:01pm

max
 


Re: What's wrong?

Postby Phantom » Nov 22, 2001 @ 5:37am

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