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

Pages: 1 [2] 3
16
Graphics / Sprite hit area, how to?
« on: October 03, 2010, 12:04:57 pm »

17
Graphics / Trying to change cursor
« on: September 28, 2010, 08:37:27 pm »
The function you need is sf::Image::CreateMaskFromColor().

18
Window / SFML Debug/Release with VC+ 2010 errors
« on: September 28, 2010, 07:34:27 am »
Download the source for SFML 1.6. Open the solution file and let VS convert it to  VS2010 format. Batch build all.

Yes, it'll work with VS Express.

19
Graphics / How format and draw variables on screen
« on: September 27, 2010, 07:54:53 pm »
Quote from: "panithadrum"
(with 1000 hares)

That's a whole lot of bunnies!  :D

20
Window / SFML Debug/Release with VC+ 2010 errors
« on: September 27, 2010, 07:51:14 pm »
Have you compiled the libraries yourself? The libraries that are provided with SFML 1.6 are for MSVS2008 only, they don't work with 2010.

21
General / Main Menu in SFML need tips
« on: September 26, 2010, 11:09:12 am »
If you want to easily be able to change the text of the buttons. I suggest you make an image a button, load it, display it and then place the text you want on top of it.

22
General / Having trouble loading an image
« on: September 26, 2010, 11:06:49 am »
In the toolbar of VS2010 there's combo box where you can switch between Debug and Release. In the top left of the properties windows you can select if you want to set the properties for Debug or Release (or All configurations).

I suggest that you add all SFML libraries to your projects. Then you don't have to risk missing one.

23
General / just another VS2010 linking question
« on: September 26, 2010, 11:01:03 am »
I believe that vc100.pdb is related to the MSVC runtime libraries and not SFML. I get a whole bunch of messages regarding missing .pdb files when I run my projects. But none of those are SFML ones. I get the correct debug symbols for SFML.

24
General discussions / Linker Error
« on: September 25, 2010, 06:12:52 pm »
There are three possible solutions to this problem:

1) Link with sfml-main.lib.
2) Build the project as a console application instead of a windows application.
3) Rename main() to WinMain().

25
Graphics / A quick question about my sprite manager class..
« on: September 23, 2010, 06:56:06 pm »
It's looking good. But I feel the name is a bit misleading since it doesn't actually manage sprites, but images.

And you don't really need the temporary image pointer.
Code: [Select]
  for(std::map<string, sf::Image*>::iterator it = m_Images.begin(); it != m_Images.end(); ++it)
   {
      sf::Image* temp = (*it).second;
      delete temp;
   }

You can delete it directly:
Code: [Select]
delete (*it).second;

26
Graphics / A quick question about my sprite manager class..
« on: September 23, 2010, 04:02:21 pm »
If you fail to load an image from file you need to delete the temporary image. Otherwise you're leaking memory.

27
Graphics / A quick question about my sprite manager class..
« on: September 23, 2010, 07:48:56 am »
Quote from: "Leprosy"
Init is called from the main program, it is called just not shown in the code.


Then you'll need to call init() everytime you call loadImage(). Why not do it like this:
Code: [Select]
sf::Image* spriteManager::loadImage(string filename){
   if(m_Images.find(filename) == m_Images.end()){
      m_Temp = new sf::Image();
      if (!m_Temp->LoadFromFile(filename)){
         delete m_Temp;
         LOG("[ERROR]: Loading sprite failed");
      }else{
         m_Images[filename] = m_Temp;
         m_Temp = NULL;
      }
   }
   return m_Images[filename];
}

28
SFML projects / Zombie Outrage 2
« on: September 23, 2010, 07:34:29 am »
Nice lighting/shadowing. Would you care to explain how you do it?

29
Graphics / A quick question about my sprite manager class..
« on: September 22, 2010, 06:45:21 pm »
Code: [Select]
sf::Image*& loadImage(string filename);
Looks a bit weird. Should it really return a reference to a pointer?

I don't see you calling init() to initialize the m_Temp pointer. Every time you load a new image from disc you need to allocate a new sf::Image to store it in.

Your destructor doesn't free the allocated memory.

And I'm not sure that an object can delete itself.

30
Network / my first network program
« on: September 16, 2010, 08:34:42 am »
It could be that you're missing packets. Can you try switching to TCP and see if it works?

(I'm only guessing though)

Pages: 1 [2] 3
anything