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 - insa

Pages: [1]
1
General / SFML SVN Snapshots
« on: February 02, 2011, 05:26:33 pm »
Big Thx :)

2
General / SFML SVN Snapshots
« on: February 02, 2011, 05:14:54 pm »
Hey guys, it's been a while but I wanted to continue with my game and since i got a new PC meanwhile I wanted to download SFML2 again, but the link does not seem to work... http://sfml.svn.sourceforge.net/viewvc/sfml/branches/sfml2.tar.gz?view=tar

Any suggestions on how to get that snapshot?

Cheers,
insa

3
General discussions / Benchmark : SDL vs SFML
« on: January 11, 2010, 01:46:41 pm »
Testing Machine: lenovo S10e (Intel Atom N270 @ 1.60GHz, 2GB RAM), Win7

Code: [Select]
1/ Test : sprites
SDL  displayed 27 frames
SFML displayed 48 frames
--> SFML is 1.8x as fast as SDL

2/ Test : alpha-blended sprites
SDL  displayed 12 frames
SFML displayed 53 frames
--> SFML is 4.4x as fast as SDL

3/ Test : rotating sprites
SDL  displayed 6 frames
SFML displayed 51 frames
--> SFML is 8.5x as fast as SDL

4/ Test : static text
SDL  displayed 479 frames
SFML displayed 1110 frames
--> SFML is 2.3x as fast as SDL

5/ Test : dynamic text
SDL  displayed 33 frames
SFML displayed 464 frames
--> SFML is 14.1x as fast as SDL

4
General / const reference Parameter Problem
« on: January 07, 2010, 02:17:39 pm »
The problem was that I was 100% sure that my functions were const... but in fact only the return type was :/

Thanks for the fast answers =)

5
General / const reference Parameter Problem
« on: January 07, 2010, 02:01:48 pm »
This is the Code as intend it to use in the future, at the moment I also pass the two integers (x and y) to initMap() (therefore it expects to get 4 parameters).

And after my four lines of assigning the temporary int/float vals, i do not touch p anymore.

Should i declare the functions I call from p as well as const?


Edit:

I just solved the problem... I thought my functions WERE const, but in fact only the return type was const.

Code: [Select]
const sf::Vector2f& getPosition(); //as i had id before, wrong
Code: [Select]
const sf::Vector2f& getPosition() const; //as i have it now, correct

Anyway, would be a const sf::Vector2f be the better choice for the return type instead of a reference to it (in terms of speed/code size)?

6
General / const reference Parameter Problem
« on: January 07, 2010, 01:35:46 pm »
.cpp

Code: [Select]
void Map::initMap(ImageHandler& ih,const PlayerD& p) {
std::vector<Tile> tmp;
float tmpPosX = p.getPosition().x;
float tmpPosY = p.getPosition().y;
int tmpTileX = p.getActTile().x;
int tmpTileY = p.getActTile().y;
}


.hpp

Code: [Select]

public:
Map(int x,int y,ImageHandler&,const PlayerD&);
private:
void initMap(ImageHandler&,const PlayerD&);

7
General / const reference Parameter Problem
« on: January 07, 2010, 01:13:05 pm »
Hey Guys,

I get this compiler error:

error C2664: 'Map::initMap' : cannot convert parameter 4 from 'const PlayerD' to 'PlayerD &'


on that code:

Code: [Select]
Map::Map(int x,int y,ImageHandler& ih,const PlayerD& p) {
initMap(ih,p);
}


initMap is supposed to take a const PlayerD& as well...

Pages: [1]
anything