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

Pages: 1 ... 6 7 [8]
106
Graphics / Re: Sprite Source Rectangle Inaccurate?
« on: March 16, 2013, 05:31:24 pm »
Phew, I'm not the only one. I was writing a short example but I couldn't replicate the problem, I guess it was because the lack of smooth camera movement.

However, if I round the View's position to an int, it works in the way that I don't have any "new lines". In my program it only happens at certain points (http://imgur.com/r2WDtvl) but the same lines apear over and over.

I did smooth the texture, and yet it happens.

Any ideas?

107
Graphics / Re: Not having a sf::text crashes my code
« on: March 05, 2013, 04:34:19 am »
I did rebuild, and nothing changed. What I did was I made a template(code::blocks has this integrated), and started working from there.

I had other issues that had nothing to do with sf::Text, but strangely enough, if I erased that line of code, everything went to hell.

In any case, I solved it, yay. 8)

108
Graphics / Re: Not having a sf::text crashes my code
« on: March 04, 2013, 11:08:57 pm »
Thanks for the answer, but I think my code has other issues.
I've been tinkering around since I posted this, and found other problems, which may have caused the error, and somehow it was related to the Text, because now I can remove it.

I guess i'ts solved..?

109
Graphics / [SOLVED] Not having a sf::text crashes my code
« on: March 04, 2013, 08:44:12 pm »
I happened to encounter an unusual thing. I made a Breakout clone, and I wanted to make another game, using the same screens, and changing Texts, etc.
Before I had 3 sf::text and now I want only one. So I erased one(erase all the code concerning that sf::text), and everything works, but when I want to erase the other one it crashes as soon as it loads it. Also, it crashes only on Release mode, so I can't use watches, breakpoints, etc.

This is the error that gives me "Process terminated with status -1073741676", apparently it is a division by 0 error.

Strangely enough, I can remove everything but the .setString() line. Everything else I can remove it and it works, even the window.draw(_textoSetCentradoTitulo) line. (code below)

any ideas?

MenuSeleccion.h
class MenuSeleccion : public GameState{

    private:
    Text _textoPrimerosPasos;
    Text _textoSetCentradoTitulo;

 public:
    MenuSeleccion();

    void eventosYMuevo();
    void update();
    void render();

};

menuSeleccion.cpp
MenuSeleccion::MenuSeleccion(){

    _textoPrimerosPasos.setString("Primeros Pasos:");
    _textoPrimerosPasos.setCharacterSize (pantalla_alto * 7 / 120);
    _textoPrimerosPasos.setColor(myColor);
    _textoPrimerosPasos.setPosition(pantalla_alto * 2 / 15, pantalla_alto / 6);
    _textoPrimerosPasos.setFont(myFont);

    _textoSetCentradoTitulo.setString("Set Centrado:"); ///I can remove everything but this line
    //_textoSetCentradoTitulo.setCharacterSize (pantalla_alto * 7 / 120);
    //_textoSetCentradoTitulo.setColor(myColor);
    //_textoSetCentradoTitulo.setPosition(pantalla_alto * 2 / 15, pantalla_alto * 17 / 30);
   // _textoSetCentradoTitulo.setFont(myFont);

}
...
 

110
Thanks for the replies!

The game is capped at 60 FPS, and it seems to work fine. However, when in fullscreen, the tiles look jagged for a split second. I tried with a small map and it keeps happening, so I guess it wasn't an optimization problem after all.
Strangely it only happens when (in fullscreen) the screen moves (I have a sf::View camera), and if I stay still the game runs smoothly.

EDIT:
Drivers are updated, so that's not an issue

I haven't used Vertex Arrays as I'm having some trouble understanding them haha

111
General / Re: Drawing everything? Checking collision with all solid tiles?
« on: February 28, 2013, 12:00:42 am »
pseudo-code

for(listOfTiles){
window.draw(tile);
}

112
General / Drawing everything? Checking collision with all solid tiles?
« on: February 27, 2013, 11:48:49 pm »
Hi, i've been developing a simple 2d platformer in c++, using SFML, and have some general questions

Do I draw everything or just the things on screen? Drawing everything is easier as it requires less work for me, but it seems that it is a badpractice as it utilizes more resources than what it is actually needed. ( I have a "tiles" list and I go throught it with an iterator + for loop)

Also, Do I check collision with solid tiles? Same as above. It's easier but consumes more resources.

What I mean is this: does checking if something will be on screen or not(so I draw it or not), or if something is near my character or not (collision) waste far less resources than just doing it for everything?

If you want me to clarify some things tell me, and I'll do my best.

113
General / Re: Is it possible to release a game without the DLL?
« on: February 15, 2013, 06:54:42 pm »
Thanks for the quick answer, I don't really know static stuff, so I won't meddle with it right now haha

I will recompile then, and use a file shortcut, so the user doesn't have to enter the bin folder

114
General / [SOLVED] Is it possible to release a game without the DLL?
« on: February 15, 2013, 06:41:35 pm »
Hey guys!

I made a Breakout clone, and when I want to send the game to my friends, I have to include the .dll in the same place as the .exe. Is there any way to avoid this? I know they are ~5-7 MB, but the whole game is less than 20 MB.

If that's not possible, I thought of making a "bin" folder, and put the .exe and .dll there. However, I run into a bit of a problem. I have some resources on a "resource" folder(see NOTE below) that I need to load. I coded so they load "resources/file.png". However if the .exe is in the bin folder, how do I go up a level?

Thanks!
---

NOTE(files I have right now):
resources (images, music, sounds..)
levels (.txt, I made a custom level loader)
.exe and .dll (not in a folder)

115
Graphics / Re: Using the same image with different resolutions?
« on: January 31, 2013, 08:40:51 pm »
Try using texture smoothing. You have to enable it on each texture.

myTexture.setSmooth (true);
 

YESYEsyesys

thank you, it worked!

116
Graphics / Using the same image with different resolutions?
« on: January 31, 2013, 08:20:57 pm »
Hey guys, I've been developing a Breakout clone in 800x600. I wanted to try and make it so people could play on different resolutions.

The problem is that the textures I've been using for the 800x600 version get blurry when the reslolution changes to, for example, 1680x1050. So, I went and made bigger images. However, there is still a problem: when playing on 800x600 now the "HD" textures look blurry.

Is there a way to solve this? How is it normally solved in a game? Do they have the same imagen in a bunch of different resolutions?

images (1, 2 low def; 3, 4 "high def") http://imgur.com/a/OdWgE#0

I was kinda hoping not to use black bars, unless it really simplifies it.

117
Audio / Re: How to check if a music has been loaded?
« on: January 25, 2013, 03:52:42 am »
Well, that does solve it.
I wanted to know if there was some kind of music.isLoaded() or anything of the sort

118
Audio / How to check if a music has been loaded?
« on: January 25, 2013, 02:42:12 am »
Is there a way to check if the music has been loaded before? (without needing a bool variable)

I read the documentation and I don't seem to find it



Pages: 1 ... 6 7 [8]