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

Pages: [1]
1
Audio / Can't Get Audio To Work in Mac OS
« on: January 11, 2009, 03:55:21 am »
Sorry I keep posting these questions, but I'm trying to port a game to mac and I keep running into snags, and since I know virtually nothing about the platform, these snags are quite difficult to overcome. Thanks for promptly responding to all of my questions so far, Ceylo.

So my new problem is with sfml-audio. I can succesfully run the sample programs that are precompiled, but when I compile them myself, they no longer work. I can get them to compile, but they always crash at runtime. The place they crash is when alSourcei is called in the constructor of sf::Sound (Sound.cpp, line 41). I get the same crash in my own programs. What could be the problem?

Thanks

2
General / Paths and OS X
« on: January 10, 2009, 05:11:06 am »
I'm still fairly new to Mac programming, and I can't seem to figure this one out. When I load an image in a local directory, using something like Image.LoadFromFile("image.png"), the program can load the image when I run it from within Xcode, but when I try running the program outside of Xcode, it no longer finds the local files.

Also, is there some way to find the directory of the Bundle Resources folder in the code? If I hard code it in, than that means if the user changes the program name, the program will no longer work.

3
General / Does My Game Crash For You?
« on: July 28, 2008, 08:01:17 am »
I've had this SFML game on my site for a bit, and it works great on my computer and my brothers computer, but it crashes on three of my friends computers (out of the four that have downloaded the game). I'm looking for someone with a windows who can get the game to crash on their computer so they can hopefully help me debug this.

Game Link: http://lzr.cc/Ovid.htm .

4
Audio / Audio "Clicks" on Linux
« on: July 05, 2008, 03:51:45 am »
I have no idea what is going on, but on every computer I've tested, which is so far 3, the audio in my SFML-based game "clicks" and has general low quality. Has anyone gotten the audio to sound good without glitches? I didn't want to release it until it was finished (the only thing left to fix is the sound), but if you want you can try my game so far and tell me if you get the annoying audio clicks: http://lzr.cc/games/ovidlinux.tar.gz . It's just a little frustrating cause I'm so close to releasing the Linux port of the game, if it wasn't for this one little issue. I'm using a Sound Blaster Live! sound card on my computer, and openal-soft. I also tried a different implementation of openal made specifically for my sound card at one point, but it didn't make a difference. If you do get it or another SFML program to work, which I'm sure has been done, I'd like to know what sound card/openal implementation/anything else that might be useful that you used.

5
General / Windows in Linux
« on: June 30, 2008, 01:08:24 am »
I'm working on compiling my game in Linux and I'm getting weird problems. For some reason, none of the windows I create have title bars. In addition, when I close the windows, whatever was on them lingers until I drag something over it forcing a redraw. When I set a windows to be fullscreen, and then quit, it doesn't automatically return to the original resolution. Lastly, the sound seems to click a lot.

This happens even in the sampl;e programs even if I don't compile anything. I'm running Ubiuntu 8.04, and SFML 1.3.

6
Graphics / Wave in the SVN
« on: June 21, 2008, 10:28:01 am »
Is it just me, or does the wave effect in the postfx not work in the SVN version of SFML. It works fine in 1.2, yet I can't get it to go using the exact same code in the sample program.

7
SFML projects / Ovid the Owl - Freeware Game
« on: May 16, 2008, 02:03:20 am »
This game was a pretty big project for me, and was originally coded with DirectX. In order to get the game to be platform independent, I ported it to SFML. All the new code works, I just have to wait for some features hopefully coming in the next version, plus the mac port.

If you have windows, and DirectX, you can play the current version at http://lzr.cc/Ovid.htm . Hopefully the Mac port of SFML will be finished soon and my game will reach a much broader audience.

EDIT; The port is finished and you no longer need DirectX. You still need Windows, though, because I haven't yet ported the game to Linux or Mac.

The graphics were made with Blender, the music with Logic and a keyboard and microphones, and the game with Visual C++ express edition.

8
Graphics / SetRotationCenter in the SVN
« on: May 11, 2008, 08:39:36 pm »
I just started using the SVN in hopes of getting the latest features, but I can't seem to find the function SetRotationCenter or any equivalent. Did you remove it because you thought no one was using it? In my opinion, this function is both useful and necessary, and you should definately keep it.

9
Graphics / [Solved] Loading Images Inside a Thread
« on: April 30, 2008, 07:50:51 am »
I am in the long process of porting a game from Direct3d/Win32 to SFML, and before I did all my loading on a separate thread, while a loading animation played in the main thread. For some reason, all the images I load while in the separate thread come out as blank, white, boxes. Is there any way to fix this?

10
Feature requests / Loading Subset of Image File
« on: April 27, 2008, 11:49:35 pm »
There are many times in the game I'm porting in which the engine loads a part of an image. The image file to be loaded maybe 256x256, but the game may only load a 64x64 chunk located at (32,128). I can't find any way currently for the engine to do this. The function that comes closest is sf::Image::Resize, but this only let's one specify a size, not a position. This would be a very useful, and fairly easy, feature to program for the future.

Edit: I decided to code the feature myself. If you want, you can add it to the actual code.

Code: [Select]

////////////////////////////////////////////////////////////
/// Resize the image (no offset) - warning : this function does not scale the image,
/// it just adjusts size (add padding or remove pixels)
////////////////////////////////////////////////////////////
bool Image::Resize(unsigned int Width, unsigned int Height, const Color& Col)
{
    return Resize(0, 0, Width, Height, Col);
}

////////////////////////////////////////////////////////////
/// Resize the image (with offset) - warning : this function does not scale the image,
/// it just adjusts size (add padding or remove pixels) and translates the image based on an offset
////////////////////////////////////////////////////////////
bool Image::Resize(unsigned int OffsetX, unsigned int OffsetY, unsigned int Width, unsigned int Height, const Color& Col)
{
    // Check size
    if ((Width == 0) || (Height == 0))
    {
        std::cerr << "Invalid new size for image (width = " << Width << ", height = " << Height << ")" << std::endl;
        return false;
    }

    // Create a new pixel array with the desired size
    std::vector<Color> Pixels(Width * Height, Col);

    // Copy the old pixel buffer into the new one
    for (unsigned int i = OffsetX; i < std::min(Width+OffsetX, myWidth); ++i)
        for (unsigned int j = OffsetY; j < std::min(Height+OffsetY, myHeight); ++j)
            Pixels[(i-OffsetX) + (j-OffsetY) * Width] = myPixels[i + j * myWidth];
    Pixels.swap(myPixels);

    // Store the new texture dimensions
    myWidth  = Width;
    myHeight = Height;

    // We can create the texture
    if (CreateTexture())
    {
        return true;
    }
    else
    {
        // Oops... something failed
        Reset();
        return false;
    }
}

Pages: [1]