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.


Topics - Tresky

Pages: [1]
1
Graphics / [SOLVED] LoadFromFile Crash
« on: May 20, 2013, 12:35:50 am »
Hey guys!

I have been having particular trouble loading an image. It's never given me trouble before, but now it is.

I have checked to use the correct versions of the library. I am using the pre-compiled VS2012 version of the SDK. I am linking Debug libraries to my Debug project.

I couldn't produce a smaller version of the error. I first created a test program to test and see if it was SFML messing up. Just as I predicted, SFML was not the problem and it is my own doing. Since then, I have not been able to locate the error.

// Load the image of the tileset and store
  // it in the SfTileset.
  string source = "tmw_desert_spacing.png";

  cout << source << endl;
  if (!tileset_image.loadFromFile(source))
  {
    cout << "Failed to load tileset image" << endl;
    return false;
  }
  cout << "Success" << endl;

This code managed to gather the correct source from the XML file, so we can rule out the TinyXML code. I debugged the crash and it occurs directly on the line with the loadFromFile() call. It doesn't send a fail to SFML either because it never gets inside of the if statement or even past it.

The error says:
Unhandled exception at 0x0FB5CCC8 (msvcp110d.dll) in sf_tile_engine.exe: 0xC0000005: Access violation reading location 0x51DF2948.

The call stack says:
>   msvcp110d.dll!std::_Container_base12::_Orphan_all() Line 216
>   sfml-graphics-d-2.dll!0ff5dd9a()
>   [Frames below may be incorrect and/or missing, no symbols loaded for sfml-graphics-d-2.dll]   
>   sfml-graphics-d-2.dll!0ff63ea4()
>   sfml-graphics-d-2.dll!0ff629b9()
>   sf_tile_engine.exe!sftile::SfTileset::Parse(tinyxml2::XMLElement * _element) Line 74 // This is the function that contains the above code.


Any hints?

PS: The image it's trying to load is indeed in the directory and of the type PNG.

Thanks! :)

2
Graphics / View Drawing
« on: April 10, 2013, 08:47:54 pm »
Just a quick question. If I use an sf::View to zoom into a large image and pan around on it, will the View take care of only drawing what is visible so as to maximize performance? Or will I need to use some other abstraction to accomplish this?

Thanks,
Tresky

3
Graphics / Animation Library
« on: July 06, 2012, 07:42:08 pm »
I've seen many animation libraries on this site and made with SFML, but I do not know what exactly to look for in an animation library. Any suggestions?

4
Graphics / Divide By Zero When Drawing
« on: July 05, 2012, 04:54:15 pm »
I don't think it's normal to get a divide by zero error when drawing a sprite. Haha.

Check this out...
for (unsigned i = 0; i < tiles.size(); ++i)
        if (tiles[i]->GetSprites().size() > 0) {
                cout << "Error ";
                cout << tiles[i]->GetSprites()[0].getPosition().x;
                _window->draw(tiles[i]->GetSprites().at(0));
                /// The only thing Tile::GetSprites() does is return the vector of sprites for the tile.
                /// I'm only using the first sprite though.
                cout << " Here!" << endl;
        }

I ran through the code a lot and isolated the error to this section of the code.... drawing my sprites. The output of the program into the console shows that its the drawing that causes the error.
The output is as follows (verbatum):
Quote
Error 32 Here!
Error 64 Here!
Error 96 Here!
Error 128 Here!
Error 160 Here!
Error 192 Here!
Error 224 Here!
Error 256

Unhandled exception at 0x0f6d2382 in TheReverendGUI.exe: 0xC0000094: Integer division by zero.
As you can see, it successfully accesses the sprites in the vector well enough to output their position, but I get this error only on ONE of these sprites... Any idea what this might be?

Windows 7
SFML 2.0

5
Graphics / sf::Sprite in 2
« on: July 02, 2012, 07:44:09 pm »
I can't seem to figure out how the SF::Sprite class changed from 1.6 to 2.0. I had a line of code that had a Sprite being made with an image in the parameters. The constructor has changed to contain a texture now and I'm not sure how to use that. Do all my images need to change to textures? Are they equivalent?

6
General / GUI Question
« on: July 01, 2012, 08:18:57 pm »
I'm working on an RPG Dungeon Crawler and I need to make a GUI for it. Would the best way be to use a GUI System that was made with SFML or simply integrate my game into a Qt widget and make the GUI from Qt?

7
General / SFML and Qt
« on: June 30, 2012, 10:18:19 pm »
Hey guys. I want to use SFML and Qt together but not in the way described in the tutorial. Is there possibly a way to have an SFML window first and put Qt widgets into it to create a GUI rather then he other way?

8
Graphics / Deleting Images
« on: April 12, 2012, 09:01:23 pm »
Hey.
I have a for loop that creates an sf::Image* every time it loops. I want to put those sf::Image*'s into a vector and delete them to free up memory, for I wouldn't be able to access them for deletion later. I understand the sf::Sprite needs the source image around when I stick it in another vector which it why I want to keep the sf::Image*'s in a vector, but the sf::Image*'s lose there data when I copy them into the vector. A white screen is displayed where the image is supposed to be.
Is there a way to safely transfer the images and sprites into vectors?

Pages: [1]
anything