Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - interdpth

Pages: [1]
1
Graphics / Is there a bitblt like function for SFML
« on: January 05, 2011, 06:20:17 am »
I changed from the copy to using sprites
So my draw code is like this

Code: [Select]
for (; x < ex; x++)
{

tile = MainLayer[y][x] & 0xFF;
if (tile)
{
//MessageBox(0, "non-zero tile!", "blah", 0);
r1.Left = (tile & 15) * TileSize;
r1.Top = (tile / 16) * TileSize;


       r2.Left = sx;
r2.Top = sy;

if(sx>0&&sy>0){
tmpSpr.SetImage(tileset);
tmpSpr.SetSubRect(r1);
tmpSpr.SetPosition(sx,sy);

       bbImage.Draw(tmpSpr);

}



}
sx += TileSize;
}
sy += TileSize;
}



Then when I draw

Code: [Select]
bbImage.Display();
sf::Sprite bbS(bbImage.GetImage());
App.Draw(bbS);
App.Display();


bbImage is the RenderImage

2
Graphics / Is there a bitblt like function for SFML
« on: January 04, 2011, 09:39:28 am »
I'm getting the same FPS as I did when I didn't use renderimage unless I'm using it wrong.
Can you show me the proper way?

3
Graphics / Is there a bitblt like function for SFML
« on: January 04, 2011, 09:24:44 am »
I currently copy to a renderimage now...
But Image 2 is image made up of 32x32 tiles, which I then copy to image A based on an index for each tile, I'm working on a game engine so this is kind of needed lol

4
Graphics / Is there a bitblt like function for SFML
« on: January 04, 2011, 06:38:44 am »
Ok...So what would be a better way to copy the images I need to copy during runtime? I'm using SMFL2 btw

5
Graphics / Is there a bitblt like function for SFML
« on: January 03, 2011, 12:29:31 am »
Basically what I need to do is copy a whole bunch of small rects from Image B to Image A. I'm currently using Image::copy() to do it, it works but it is oh so very slow, so I'm hoping someone could show me a faster way to do it then what I have?

If so thank you so much.
tileset and tmp are both sf::Image
Code: [Select]
for (; y < ey; y++)
{
sx = -(ScrollX & (TileSize - 1)) + (2 * TileSize);
//x = ScrollX & (TileSize - 1);
x = ScrollX / TileSize;
ex = x + (ScreenWidth / TileSize) - 4;
//pc = &(BG[ (ScrollX / TileSize) ][y]);
for (; x < ex; x++)
{

tile = MainLayer[y][x] & 0xFF;
if (tile)
{
//MessageBox(0, "non-zero tile!", "blah", 0);
r.Left = (tile & 15) * TileSize;
r.Top = (tile / 16) * TileSize;
r.Width = r.Left + TileSize;
r.Height = r.Top + TileSize;



if(!(sx<0 || sy<0))
tmp.Copy(tileset,sx,sy,r,1);

}
sx += TileSize;
}
sy += TileSize;
}

Pages: [1]