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

Pages: 1 ... 18 19 [20] 21
286
Audio / Re: SFML Audio without dlls
« on: February 03, 2015, 05:30:04 pm »
That's a good point because I always separate exes when I'm making them, but once I finish them I could put them all in the same folder and put the dlls in the there. Then again, that would rely on me actually finishing a project rather than just ridiculously over-complicating it until I think of a new idea and make that in a ridiculously over-complicated way.

287
Audio / Re: SFML Audio without dlls
« on: February 03, 2015, 09:20:48 am »
Oh, okay. I ws just trying to replicate something I used to have which was a folder full of loads of exes that did many different things and none of them had any external files, but all of them had both graphics and audio. It just meant that it was really easy to transfer/transport them because there was no chance of losing any important files.

288
Audio / Re: SFML Audio without dlls
« on: February 02, 2015, 10:27:28 pm »
Ah. I have never built a library myself and I must say I wouldn't know where to start. How easy do you reckon it would be to mimic SFML's basic SoundBuffer and Sound classes, just to load and play short sounds from arrays or some other type of container with a library like PortAudio?

289
Audio / SFML Audio without dlls
« on: February 02, 2015, 06:13:58 pm »
Is it possible to include the sfml audio module in my project without also having to have openal32.dll and libnsfile.dll in the folder? Could I, for example, compile them into the exe? I've been trying to make a completely portable exe where only one file is necessary for it to run successfully and I'd rather not have to use a different audio library because the sfml one is by far the best and easiest to use that I've found. I'm using SFML 2.1 at the moment because when I tried to upgrade it crashed, but if SFML 2.2 can do it and 2.1 can't then I'll see if I can link to that instead.

290
Graphics / Re: sf::Texture load from memory
« on: January 28, 2015, 03:41:00 pm »
So it might be better in c++14? That would be nice, though as far as I know I can only use the version of MinGW that codeblocks was compiled with so I'll have to wait until it is remade.

291
Graphics / Re: sf::Texture load from memory
« on: January 28, 2015, 02:53:46 pm »
IT WORKS!!!!!  :)  :)  :)
I turned them all into unsigned chars, I got rid of the 0xfffffff and now it works!!!!

292
Graphics / Re: sf::Texture load from memory
« on: January 28, 2015, 02:23:04 pm »
eXpl0it3r:
The image code (ButtonImages.hpp)
(click to show/hide)

The function that applies the image (Images.hpp)
(click to show/hide)

The use of the function:
(click to show/hide)

Hapax: I've tried converting it to unsigned char and that stops most of the Wnarrowing, though it does still display it once per array, but also comes up with large values being truncated (Woverflow)

Jester Juhl: I only turned warnings off because I actually couldn't compile it before because it took far too long to go through all the warnings

293
Graphics / Re: sf::Texture load from memory
« on: January 27, 2015, 10:11:48 pm »
Ah sorry, I need to remember never to quote my code if it isn't right in front of me but I didn't have access to it at the time and I'd been looking at it for so long I thought I could remember it. Those double-quotes are from the method I was using for storing small images (gimp exported c source code) and they were at the start and end of every line. I got rid of them when I started using const char arrays instead. Other than the quotes, the code I posted is what I've got at the moment apart from the fact that they aren't static (I've just checked). I've disabled all warnings on my compiler and now and it isn't coming up with the -Wnarrowing, but warnings are useful for other things so I would prefer to fix it rather than leave it with the compiler just ignoring it and other potential problems. Sorry for being such a persistent problem, I just want to get this to work.

294
Graphics / Re: sf::Texture load from memory
« on: January 27, 2015, 09:14:42 pm »
Sorry for not being specific. My code goes like this:
static const char image[]
{
    "0x83, 0x91, 0x23, ...
(rest of image here)
     ... , 0xffffff"
};
My compiler then comes up with approximately one thousand Wnarrowing warnings of converting from int to const char* all said to be on the line of the closing curly brace, in the first column.

295
Graphics / Re: sf::Texture load from memory
« on: January 27, 2015, 06:48:46 pm »
What about the -Wnarrowing warnings? Is that just something that I need to put up with an wait a few minutes for it to compile every time I add a new image, or is there something I can do about it?

296
Graphics / Re: sf::Texture load from memory
« on: January 27, 2015, 05:59:37 pm »
Just tried removing the 0xfffffff and it hasn't helped, yes I've looked at the header because I've taken the code out of it and put in in my own header alongside some other image code. Lots of warnings is 750. The compiler log says that the warnings are all on the line of the curly brace that closes the array.

EDIT: I've realised that I was using img.create rather than loadFromMemory and changing that has got rid of the errors. I'm not sure why that gets rid of errors in the header file containing the image data, not the one with the img.loadFromMemory but it seems to have done.

EDIT2: No, it turns out my compiler was just not warning me about things it had warned me about before. When I added another image with exactly the same syntax as before it came out with another 1000 warnings.

297
Graphics / Re: sf::Texture load from memory
« on: January 27, 2015, 05:38:12 pm »
Just been using the converter to convert the images into const char arrays and I'm getting lots of warnings of narrowing conversion from 'int to 'const char' is ill-formed in c++ 11. Is there any way around that? I've tried converting the array into int but then img.create doesn't work.

298
Graphics / Re: Bomberman's deplacement style
« on: January 26, 2015, 11:00:04 pm »
I was actually about to post the same thing. Another way of doing it is having two signed char (or other numeric type) variables, one to store vertical and one horizontal. This can sometimes be useful for either acceleration, or to stop the character trying to move both up and down at the same time.

299
Graphics / Re: sf::Texture load from memory
« on: January 26, 2015, 09:36:22 pm »
I'm already doing that, I have several images that are about 500 x 1000 and I was already splitting each into 10. I read on stack overflow that you can convert it into a hex array, but I don't know how to do that or how to use it with sfml. Is this where I'd use Laurent's earlier post about a converter? I must confess when I first read it I didn't understand it and I hadn't been back through this discussion.

300
Graphics / Re: sf::Texture load from memory
« on: January 26, 2015, 09:29:25 pm »
Thanks, that's been working really well with my 4x4, 8x8 and 16x16 images. However I now need to include my 500x100 images into my code and when I export them from Gimp, the code is literally 10800 lines long, per image, and c++ doesn't allow strings that long. Is there any way around that?

Pages: 1 ... 18 19 [20] 21
anything