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

Pages: [1] 2
1
Audio / Re: Access violation reading area with :setBuffer (SFML 2)
« on: July 30, 2012, 12:32:46 pm »
The clean solution would be to recompile SFML.

When Visual C++11 (VS 2012) will be officially out, there will be a precompiled release of SFML for it.

I suppose I also get the extra advantage of having a lot more compatibility if I switch to /MDD for runtime libraries this way though.

2
Audio / Re: Access violation reading area with :setBuffer (SFML 2)
« on: July 30, 2012, 10:59:25 am »
I'm guessing you mean the call stack? I'd sort of ignored it since it only pointed me to that line of code, and a bunch of disassembly from some random windows DLL thing, but upon you reminding me of it I looked again and figured that if a DLL is causing it that isn't from SFML it might actually be that.

It turns out that one of the DLLs, I'm guessing it's "ntdll.dll" does not particularly like SFML and throws some exception.

Providing I hadn't done something to mess it up, here's the solution for future viewers:



Change the platform toolset to v100. I'm figuring this is sort of like a compatibility mode that compiles it as if it was VS2010, but I can't say that for certain.

3
Audio / Re: Access violation reading area with :setBuffer (SFML 2)
« on: July 28, 2012, 02:22:46 am »
And also, merely having this line in a class:

sf::SoundBuffer m_soundintrobuffer;

Makes it say:

Unhandled exception at 0x7653A4B9 (ole32.dll) in Viscus Engine.exe: 0xC0000005: Access violation reading location 0xFEEEFEEE.

When I close the program. I'm not even loading anything into the variable, just having it existent. Nothing is ever done to that variable on my side of it, since I commented out both of the lines to load and play a while ago.

4
Audio / Access violation reading area with :setBuffer (SFML 2)
« on: July 27, 2012, 02:01:20 am »
I have this code:

                m_soundintrobuffer.loadFromFile(DataLoader::getSoundPath(1));
                m_soundintroplayer.setBuffer(m_soundintrobuffer);

The file is certainly loading correctly as it gives no console output relating to file loading, and when I comment out the second line the program runs fine.

However the second line is resulting in me getting this output:

First-chance exception at 0x7434364E (sfml-audio-2.dll) in Viscus Engine.exe: 0xC0000005: Access violation reading location 0x3F800011.

Unhandled exception at 0x7434364E (sfml-audio-2.dll) in Viscus Engine.exe: 0xC0000005: Access violation reading location 0x3F800011.

If it helps, after this my IDE (Visual Studio 2012 RC) brings up the file 'free.c' which contains:


/***
*free.c - free an entry in the heap
*
*       Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
*       Defines the following functions:
*           free()     - free a memory block in the heap
*
*******************************************************************************/


#include <cruntime.h>
#include <malloc.h>
#include <winheap.h>
#include <windows.h>
#include <internal.h>
#include <mtdll.h>
#include <dbgint.h>
#include <rtcsup.h>

/***
*void free(pblock) - free a block in the heap
*
*Purpose:
*       Free a memory block in the heap.
*
*       Special ANSI Requirements:
*
*       (1) free(NULL) is benign.
*
*Entry:
*       void *pblock - pointer to a memory block in the heap
*
*Return:
*       <void>
*
*******************************************************************************/


void __cdecl _free_base (void * pBlock)
{

        int retval = 0;


        if (pBlock == NULL)
            return;

        RTCCALLBACK(_RTC_Free_hook, (pBlock, 0));

        retval = HeapFree(_crtheap, 0, pBlock); // <<<< It seems to be dying here
        if (retval == 0)
        {
            errno = _get_errno_from_oserr(GetLastError());
        }
}


64-bit windows 7, Visual Studio 2012 RC, compiling as multithreaded (non-dll) to avoid end users needing redistributables, non-static SFML, all DLLs for SFML, OpenAL and libsnd-file1 or whatever are present.

Sorry if this is some stupid mistake I've made. I hope not. :P

Also the types are right otherwise it'd presumably stop compiling rather than at runtime.

5
General / Re: Collisions Fail at higher speed....
« on: July 24, 2012, 04:56:17 pm »
Expanding on exploiter's post you could do a rectangle where X is the sprite's X position, minus any negative horizontal velocity, Y is the sprite's Y position minus any negative vertical velocity, the width is the sprite's width add any positive horizontal velocity and the height is the sprite's height add any horizontal velocity.

It's not overly efficient, and it requires a bit more math (Although god help your computer if a few basic math expressions make a difference), but in the end of the day it's a simpler solution than some, especially if you're just dealing with regular rectangles like in a pacman game.

6
Graphics / Re: Load image from the internet
« on: June 05, 2012, 02:10:00 pm »
Quote
Using c_str on the body when loading from memory works and the texture loads correctly.
Oh yeah, I missed that:
&avatarResponse.getBody()
This was actually an obvious mistake -- taking the adress of the string instead of its contents :P

All the ampersands and the asterisks are destroying my mind x3

7
Graphics / Re: Load image from the internet
« on: June 05, 2012, 02:01:35 pm »
Ah, thank you, especially for correcting my file code. I'll try remembering that, although most of my mistakes seem obvious and stupid now that I've been shown them.

Yeah, the image outputs perfectly, looks identical to the one found on the site.

Edit
When trying to load the image the error says
Failed to load image from memory. Reason : Image not of any known type or corrupt

Edit

Using c_str on the body when loading from memory works and the texture loads correctly. Thanks! :D

8
Graphics / Re: Load image from the internet
« on: June 05, 2012, 01:43:10 pm »
I've got very little experience with file I/O (I've only ever inputted and outputted basic text files) in C++, but I ended up with this:

        std::ofstream file;
        file.open("test.png", std::ios::binary, std::ios::out | std::ios::in | std::ios::trunc);

        file << avatarResponse.getBody();

        file.close();

And it crashes my program.

Am I using http::Response and http::Request right?

sf::Http::Request avatarRequest("/Internal/Images/Avatars/3.png");
sf::Http::Response avatarResponse = http.sendRequest(avatarRequest);

9
Graphics / Re: Load image from the internet
« on: June 05, 2012, 01:20:13 pm »
Sorry to bother you again

I've got this:
playerTexture.loadFromMemory(&avatarResponse.getBody(), avatarResponse.getBody().size());

But it says I have an invalid image. I think I'm doing it totally wrong but can't imagine a different way of doing it. Any chance you can see what I've done wrong?

10
Graphics / Load image from the internet
« on: June 05, 2012, 01:37:28 am »
Is there any trivial way, perhaps using the HTTP or FTP sub-modules of the networking module, to load an image into a texture or image without actually putting the image onto the local machine?

11
SFML website / Code dropdown box for bbcode
« on: June 04, 2012, 08:41:48 pm »
I suggest you move it slightly, perhaps left of Font Face.

Myself and many others didn't notice it at first, and used teletype or alternatives, which must get irritating after a while.

Admittedly it's more from rushing on our side but I think it'd save you a lot of time if everyone saw the dropdown before they skipped to going teletype.

12
Network / Questions about networking API [SOLVED]
« on: June 02, 2012, 10:02:22 pm »
EDIT

Solved my problem, which was because I was accidentally misusing  and the question (Lots of small packets or one big one) I just decided to use medium sized ones, since it seems to have the best of both worlds. I'll probably split each thing up and give it a packet (Ex one for the map changes, one for entities, etc)

The reason it was going wrong was because I was disconnecting a client that had already been disconnected. I have no idea what I was thinking at the time ^_^, and a second reason was I was trying to move something while iterating on it. ¬_¬
                                                        client.disconnect();
                                                        networkSelector.remove(client);
                                                        clients.remove(&client);

Was my code. I then removed first line and modified the removing system clients and it seems to be flawless with connection and disconnection.

Sorry for posting since I ended up solving it myself.

13
General / Re: Very final step of installation...
« on: June 01, 2012, 10:37:51 pm »
Actually, it seems there's an RC for VS12 now:
http://www.microsoft.com/visualstudio/11/en-us/downloads

Lifesaver. Never would've noticed that. Hope they uncapitalised the menu bar before they released though. I suppose I'll have to wait and see.

14
General / Re: Unhandled exception at 0x7596FEB8 (KernelBase.dll)
« on: May 29, 2012, 09:17:54 pm »
Ah, that's why

I'd changed the runtime library for some reason, and afterwards I must've wanted to change it back, and since it boldens non-default settings, I'd gone through the whole dropdown box and not got an unbolded one so I left it blank (I guess I thought this would make it go back to the default)

Switching it to "Multi-threaded Debug DLL (/MDd)" fixed it again.

Sorry for using your time, Laurent, I should've double checked all this before I asked. Congratulations on making such an awesome library though.

15
General / Re: Unhandled exception at 0x7596FEB8 (KernelBase.dll)
« on: May 29, 2012, 09:13:57 pm »
But it's been working perfectly before now, literally five minutes before I posted the message it was compiling and running fine.

I changed all my external dependencies to try using statics, but I ended up with a couple of (hundred) errors about redefining functions, so I decided I'd stick with dynamic for the time being, and when I removed the -s from all my references, it stopped working as it had been before. :'(

Pages: [1] 2