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

Pages: [1] 2
1
General / What's the big difference between SFML 2.0 and 1.x?
« on: August 08, 2010, 09:40:17 am »
I was searching around the site, forums, and wiki, and I don't see anything obviously posted on the topic.  What am I missing out on by using 1.6?   :(

2
General / Strange lines between tiles when rendered
« on: August 07, 2010, 02:49:30 pm »
Ughhhh

After a lot of research I figured it was OGL smoothing. Why is this on by default? Is there any way to globally turn it off?

3
General / Strange lines between tiles when rendered
« on: August 07, 2010, 02:20:54 pm »
So here's the visual problem I am having (lines between tiles):




And here's my map code:

Code: [Select]
#include "cMap.h"

cMap::cMap(RenderWindow& A){
App = &A;
mapDims.x = 32;
mapDims.y = 24;

loadTiles();
genMap();
}


cMap::~cMap(){
delete [] tiles;
delete [] imgs;

for(uint16 y=0; y < mapDims.y; y++)
delete [] map[y];
delete [] map;
}


//Load tile images
void cMap::loadTiles(){
imgs = new Image[1];
tiles = new Sprite[1];

//Load tiles
if(imgs[0].LoadFromFile("textures\\grass.png")){
cout << "*Loaded asset: \"grass.png\" (" << imgs[0].GetWidth() << " x " << imgs[0].GetHeight() << ")" << endl;

imgs[0].CreateMaskFromColor(Color(255,0,255,255));
tiles[0].SetImage(imgs[0]);
}else
cout << "*Could not load: \"grass.png\"" << endl;
}


//Generate temp map for dev purposes
void cMap::genMap(){
map = new mTile*[mapDims.y];

for(uint16 y=0; y < mapDims.y; y++){
map[y] = new mTile[mapDims.x];

//Fill data
for(uint16 x=0; x < mapDims.x; x++){
map[y][x].id = 0;
map[y][x].clip = 0;
}
}
}



//Draw the map
void cMap::draw(){
uint16 ymax = (App->GetHeight() / _UNIT_), xmax = (App->GetWidth() / _UNIT_);

for(uint16 y=0; y < ymax; y++){
for(uint16 x=0; x < xmax; x++){
tiles[map[y][x].id].SetPosition((float)(x * _UNIT_), (float)(y * _UNIT_));

App->Draw(tiles[map[y][x].id]);
}
}
}



I'm thinking SFML is setting OGL up to do something strange while rendering things. Unless I'm dumb or just don't understand something here, I checked my math to be correct and believe SFML is doing something to cause this.

Also, I setup my window as such:

Code: [Select]
App.Create(VideoMode(1024,768,32), "Neptune Alpha", Style::Close);

Any info on this? Thanks!  :D

4
Graphics / SFML will not render 32-bit Windows BMPs
« on: August 06, 2010, 11:14:11 am »
Thanks!

5
Graphics / SFML will not render 32-bit Windows BMPs
« on: August 06, 2010, 11:06:41 am »
I tried saving through photoshop as a 32-bit BMP, and it would not render. I don't know if this is a bug or if it is just not supported. I converted it to 24-bit and it seems to work fine. I can live with that.

Any info on this?

6
Graphics / [Solved] Problem with Image::LoadFromFile() & MSVS2010
« on: August 06, 2010, 04:32:35 am »
That was the solution! I just recompiled all the libs and then recompiled my program. Thanks!  :D

7
Graphics / Re: Very strange problem with Image::LoadFromFile() & MS
« on: August 05, 2010, 04:03:30 pm »
Quote from: "Mindiell"
Quote from: "chbrules"
I'm guessing there is something wrong with SFML here and not me ?

Maybe you can try to see if your image is loaded correctly as tutorial indicate it :
Code: [Select]
if (!Image.LoadFromFile("sprite.tga"))
{
    // Error...
}


Since you use the image on the sprite without knowing if it's loaded ;)


It's definitely not that. I have that check in my actual program. This was just a quicky test. The executable is crashing when it attempts to call the function itself. I probably just have to recompile files for MSVS 2010 and Win 7.

8
Graphics / [Solved] Problem with Image::LoadFromFile() & MSVS2010
« on: August 05, 2010, 04:02:24 pm »
Quote from: "Laurent"
Have you recompiled SFML?


No I have not. I will try this later today. I'm about to pass out. Thanks!

9
Graphics / [Solved] Problem with Image::LoadFromFile() & MSVS2010
« on: August 05, 2010, 03:51:21 pm »
I am using Win7 x64 Ultimate and MSVS 2010, compiling in 32-bit.

My code compiles flawlessly. I've linked the debug compile to the debug .lib's and used the debug .dll's, as well as the regular ones for the release compile.

My problem comes in when I try to use Image::LoadFromFile(). I stripped it all down and tried it as well. Cleared my builds, full rebuilds, both debug and release. Nothing.

When I go to run it I get...

Debug:
---------------------------
Neptune.exe - Application Error
---------------------------
The application was unable to start correctly (0xc0150002). Click OK to close the application.
---------------------------
OK  
---------------------------


Release:
I get a program crash, and it goes back and points to the Image::LoadFromFile() line. I can't even debug the debug version. I debug the release version and it says this about the LoadFromFile() line:

"Unhandled exception at 0x73da0149 in Neptune.exe: 0xC0000005: Access violation reading location 0x706d622e."



It's just a simple LoadFromFile() call. I'm not sure what's going on here. So I did a simple test:


Code: [Select]
#include <SFML\Graphics.hpp>

using namespace sf;

void main(){
RenderWindow App(VideoMode(1024,768), "TEST!");

Image img;
img.LoadFromFile("neon.bmp");
Sprite imgSprite(img);

while(App.IsOpened()){
//Process events
Event Event;

        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == Event::Closed)
                App.Close();
        }

App.Draw(imgSprite);

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();

}
}



Again, the debug compile fails to start no matter how I try to run it. The release compilation crashes unexpectedly and says:

"A buffer overrun has occurred in sfml-test.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'."

And catches on some line in gs_report.c inside the compiler.



So I'm stumped. I'm guessing there is something wrong with SFML here and not me? Maybe that, or SFML doesn't play nice with MSVS 2010 and/or Win 7?  :(

10
Graphics / Slices of an image
« on: August 03, 2010, 01:48:04 pm »
Oh wait, I am stupid. I see how to use the sprite's get and set subrect functions to do it. :3

11
Graphics / Slices of an image
« on: August 03, 2010, 01:35:51 pm »
Ok, call me stupid if this blaringly obvious concept exists and I've just totally missed it in the SFML docs, but I'm not seeing a way to make sprites use a "rect" area of a loaded Image (*see how SDL lets you do that).

Basically, what I want to do is load in an image of a pre-defined set of animation frames. Say there's 3 frames of animation for the player facing the four compass directions sequentially all on a single image. I want to be able to "slice" that single image of animation frames up into sprites, or at least have 1 sprite that I can program to sift through the animation sequence on the image for each frame. How might one go about doing that?

Thanks!  :D

12
General / reducing cpu useage?
« on: April 03, 2009, 09:12:54 am »
Quote from: "Ceylo"
Quote from: "chbrules"
Working with SDL lI didn't have this issue.

Certainly because you were using the SDL_WaitEvent() function that blocks your program until it gets an event. SFML only has a function similar to SDL_PollEvent().


Ah, that would probably explain it then. Good to know.

Thanks guys!

13
General / reducing cpu useage?
« on: April 02, 2009, 08:46:22 pm »
Working with SDL lI didn't have this issue. Setting up a similar program that initializes a window and just runs a gameloop would yeild very low (single digit) processor usage.

14
General / reducing cpu useage?
« on: April 02, 2009, 06:10:16 am »
When I create just a window and run a loop to check for a window close event I get 100% CPU usage (50/50 on my dual core system). Why would it be doing this?

15
Window / Question About SFML Internals
« on: April 01, 2009, 01:35:06 am »
Fantastic! I've already been working on a 2.5D RPG adventure game engine with SFML for two weeks now. My inspiration is pokemon diamond/pearl for the design of the maps. I was hoping it was OGL driven so I didn't have to fiddle around blitting 2D stuff to polygon surfaces and all that craziness.

Pages: [1] 2
anything