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

Pages: 1 ... 3 4 [5] 6 7
61
Feature requests / Getting a sprite's vertices
« on: December 19, 2013, 11:56:10 pm »
It is known that the need to draw sprites individually hurts performance and that one should prefer vertex arrays to that end. It is then a shame that sf::Sprite's internal vertices cannot be accessed.

What I 've found myself doing too often is making a class holding an array of four sf::Vertex, that can be appended to a VertexArray or similar container when it is time to draw. Often, this class will also need a getBounds method, setters for the texture rect and so on, making it similar to a sf::Sprite.

I would propose then that there is a way to use sf::Sprite for this purpose; either

a) sf::Sprite::getVertices() that returns an array of the 4 vertices or
b) sf::Sprite::appendTo() taking as parameter either
    i) a sf::VertexArray
    ii) an output iterator, to accomodate the user's container of sf::Vertex.

62
SFML projects / Re: Kroniax new Version (0.9)
« on: December 12, 2013, 06:43:51 am »
Hello,

I cloned master from github and tried that. To get it to compile, had to change lines 47 and 53 of scriptAction.cpp;  used the asMicroseconds() method on the four instances of sf::Time.

Played some multiplayer on the easy maps server. On the second map (the blue one), my time didn't seem to get saved.

Also in this latest version there was constant screen tearing, pretty harsh on the eyes - it could be my drivers or the change I made above.

63
General discussions / Re: Favorite IDE
« on: November 20, 2013, 12:30:02 pm »
Qt creator on linux (and used it on windows a bit before that)

• debuggers (either gdb or microsoft's one on windows) integrate very well, breakpoints are a given, can check values at any level on the stack
• the usual, auto complete, refactoring, jumping to definition
• customize code style,  syntax highlighting
• easy and full control of the build and run environments
• version control integrated, a git commit is a shortcut away, managing branches etc
• can use either qmake or cmake
• valgrind can also be run from within (though I 'm used to running that from the terminal)

No more hiccups than I had with visual studio.

64
Graphics / Re: OpenGL - clipping with not rectangular shape
« on: October 06, 2013, 11:15:39 am »
If there's a single color outside the curve and you do want to make that transparent, sf::Image::createMaskFromColor is sufficient.

65
Graphics / Re: What is the maximum possible resolution?
« on: October 06, 2013, 01:47:56 am »
Assuming this is the issue, Thor library offers BigSprite and BigTexture classes.

66
General / Re: Team coloring in SFML
« on: September 26, 2013, 07:00:10 pm »
Though I 'm not certain what exactly is it that SDL palette does, I could see manipulating the pixels of a sf::Image instead:

sf::Image trikeImage;
trikeImage.loadFromFile("graphics/Unit_Trike.bmp");
sf::Vector2u trikeSize = trikeImage.getSize();

sf::Image trikeGreen;
trikeGreen.create(trikeSize.x, trikeSize.y);
sf::Image trikeBlue;
trikeBlue.create(trikeSize.x, trikeSize.y);

for (int i=0; i<trikeSize.x; ++i){
    for (int j=0; j<trikeSize.y; ++j){
        sf::Color pixelColor = trikeImage.getPixel(i,j);
        sf::Color bluePixel(pixelColor);
        sf::Color greenPixel(pixelColor);
        if ((pixelColor == sf::Color(125,0,0))
            ||(pixelColor == sf::Color(214,0,0))
            ||(pixelColor == sf::Color(60,0,0))
            ||(pixelColor == sf::Color(89,0,0))
            ||(pixelColor == sf::Color(153,0,0))
            ||(pixelColor == sf::Color(182,0,0))
            )
        {
            greenPixel = sf::Color(0,pixelColor.g+pixelColor.r,pixelColor.b, pixelColor.a);
            bluePixel = sf::Color(0,pixelColor.g,pixelColor.b+pixelColor.r, pixelColor.a);
        }
        trikeGreen.setPixel(i,j,greenPixel);
        trikeBlue.setPixel(i,j,bluePixel);
    }
}
 


67
General / Re: Team coloring in SFML
« on: September 26, 2013, 09:10:13 am »
sf::Color can be constructed from rgb values, therefore it's possible to manipulate the colors via arithmetic.

Alternatively, a simple function like this would do:
sf::Color getColor(const Team& team){
    if (team==Team1) return sf::Color::Red;
    if (team==Team2) return sf::Color::Blue;
    etc
}
 

68
Are you using the exact sources that you posted here?
Did you clean and rebuild the project?

69
It is not a suggestion. Exactly what you describe happens when that line is changed - and the if statement above it commented out.

70
Line 9 in Game.cpp you 're creating a local mainwindow. Change it to

mainWindow.create(sf::VideoMode(800, 800), "Heros of Late - Extreme Pre Alpha");

There's nothing wrong with having the loops in class functions rather than main().


71
Silly me was madly looking into virtual functions and polymorphism and it was just an issue with having to pass pointers :P

No need to go beyond 'thank you'; a comment like this only leaves you looking like a fool.

72
SFML projects / Re: Chesster [SFML Puzzle Game]
« on: September 16, 2013, 05:13:39 am »
Hello,

I played through the first level. The visuals and audio appear very sleek and professional. The gameplay on the other hand I did not find particularly engaging. I must admit, I 'm still fuzzy on the details. A few things to note:

-The tutorial tips come after making moves - and they 're things I 'd have rather known before.
-Queen combos card is available before the first queen appears
-Inability to move same piece twice is never stated and comes as a nasty surprise just when ready to pull a big fat combo off
-The rules for connceted pieces are not entirely clear

Despite being this fuzzy, I got 1305 pts and 3/4 treasures. At no point did I feel I would not make it or that I had to really sink into thought.

73
General / Re: SFML inheritance and sf::Drawable
« on: September 14, 2013, 09:42:37 pm »
You decide what Element is. I have merely observed you doing this:

for (auto && iter : components)
{
    target.draw(iter.second);
}
 

For this to work, the draw function for Element needs to have been implemented.

Since you inherit from it and have it overriden, then you must make sure the function from the derived object is called. In which case, you will need to be storing pointers to Element in your map, or you fall foul of object slicing.


74
General / Re: SFML inheritance and sf::Drawable
« on: September 14, 2013, 09:23:56 pm »
You will need to implement the draw function for Element.

75
SFML projects / Re: Black Wolf - an open source chess gui v0.2
« on: September 05, 2013, 05:56:10 pm »
In the latest version, engine play is disabled. Instead, it will automatically attempt to connect to the server. Switch to the server tab:



The new game button is currently disabled and seeks must be issued manually. The quickest way to get a game is to issue the getgame command.

Pages: 1 ... 3 4 [5] 6 7
anything