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

Pages: 1 2 [3] 4 5 ... 8
31
Graphics / Re: GetPixel() in 2.1?
« on: January 18, 2014, 01:50:06 pm »
Seems like you can solve this problem by transforming mouse position:
http://stackoverflow.com/questions/6915555/how-to-transform-mouse-location-in-isometric-tiling-map

33
I updated CSFML in your example and it fixed the problem.
You can download binaries here: https://dl.dropboxusercontent.com/u/14848632/csfml_2014-01-08.7z , but they are x86.

34
Graphics / Re: Need help with render methods for different layers
« on: January 08, 2014, 10:40:03 pm »
I would go with simplest approach.
1. If you want big world, you will definitely need spatial partitioning. Grid would be the easiest. QuadTree sounds fancy, but isn't always better.
2. Tilemaps use spatial partitioning by definition, so you don't have to insert separate tiles to another grid/tree (waste of memory and CPU).
3. Layers 6 - 8 can be IMO grouped as one thing - GUI. Not sure what those text objects are. Console?
4. Layer 1 one is probably tilemap, so see point 2.
5. Layers 2-5 should go into your spatial partitioning structure. Give each object some layerID so you can sort them later. They can be sprites.

Then, every frame:
1. Get visible region of tiles, write them to vertex array and draw (you should reuse one array).
2. Get visible objects from your grid/tree, sort by layer and draw.
3. Draw GUI hovever you want.

Note: try not to change texture between draw calls, use sprite sheets.
Note: group your particles (layer 3) by source so they don't take too much space on grid/tree.

EDIT: I recently updated my spritebatch, which my help. Sprites are quite heavy so usually it's better to generate vertices directly.

35
DotNet / Re: Window only gets focus when clicking on the border
« on: January 08, 2014, 09:29:22 pm »
These are freshly compiled libs* and they work for me.

*vs 2012 x86 release

36
C / CSFML cmake broken?
« on: January 08, 2014, 08:45:13 pm »
I've built CSFML on windows few times and it has never been smooth (as opposed to SFML). This solution sort of works, but is ugly.

My steps:
1. Clone both repos to some folder
2. Configure, build and install SFML to C:\Program Files (x86)\SFML with VS2012 as x86 shared release.
3. Configure CSFML in cmake:
a. add CMAKE_MODULE_PATH as C:\Program Files (x86)\SFML\cmake\Modules
b. Result:  SFML found but some of its dependencies are missing ( FreeType GLEW libjpeg
c. Add SFML_ROOT as C:/Program Files (x86)/SFML - why FindSFML needs standard path?
d. Result: Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY

EDIT: Ok, I get it: SFML should be static, and CSFML shared. Perhaps some helpful message when trying to build shared on shared? And SFML_ROOT should not be needed if library is in default directory.

37
Thanks for the link to the AnimatedSprite class.  My only issue with it is how you have to set up each and every single frame.  In games that have a lot of sprites with a lot of frames that would very quickly become a huge pain.  There has gotta be a simpler, cleaner way of doing that. I'm not sure how Thor does it but I'll look into it later when I have the time.

   
if (!m_isPaused && m_animation)
    {
        // add delta time
        m_currentTime += deltaTime;

        // if current time is bigger then the frame time advance one frame
        if (m_currentTime >= m_frameTime)
        {
 
This code (from AnimatedSprite) does the same thing as the code you posted. Only difference is that they use time directly (which makes perfect sense).

I'm not sure what you mean by "huge pain".

38
General / Re: Not rendering position and rotation accurately
« on: January 06, 2014, 09:16:43 pm »
Some doc i found: http://www.learn-cocos2d.com/api-ref/1.0/Box2D/html/classb2_fixture.html

"const b2AABB & b2Fixture::GetAABB   (   int32    childIndex   )    const [inline]
Get the fixture's AABB. This AABB may be enlarge and/or stale. If you need a more accurate AABB, compute it using the shape and the body transform."

39
VertexArray won't work either,
...
 An alternative is to model the signal's area as the composition of small quadrilaterals, similar to the Riemann integral.
Well, he can put these quads into VertexArray, can't he?

40
Graphics / Re: Creating Large Number Of Stars Efficiently
« on: January 04, 2014, 03:11:50 pm »
My guess is that you are using CircleShape with like thousand of vertices. Try with sprite.

I had similiar solution and it worked well: http://i.imgur.com/j610h.png

41
Graphics / Re: Creating Large Number Of Stars Efficiently
« on: January 03, 2014, 10:47:21 pm »

42
DotNet / Re: Window only gets focus when clicking on the border
« on: January 02, 2014, 06:41:17 pm »
d stands for debug, so you should probably find release version.

43
Feature requests / Re: Getting a sprite's vertices
« on: December 28, 2013, 12:37:23 am »
Okay, here is SpriteBatch I use: SpriteBatch. It's very useful for drawing tilemap and particles (as mentioned before). Kinda necessary on C#, since each native call has big overhead.

I'm not sure if the library should contain such class though, but I see two other solutions:
1. Add Draw methods from SpriteBatch to VertexArray (without Texture ofc.), so we will have something like:
append(Sprite sprite), //tricky, because texture will be ignored
append(FloatRect rec, IntRect src, Color color),
etc.
Now everyone can easily draw particles / tiles and this approach enforces single texture.

2. Integrate SpriteBatch into RenderTarget. Could potentially improve performance without any API changes. I'm not sure though if it's possible to compare two RenderStates fast enough (you have to draw/push buffered vertices each time the state changes).

44
SFML projects / Virtual machines - MIPS and OR1K
« on: December 03, 2013, 10:35:15 pm »
I took some abandoned project of MIPS simulator, ported to SFML and improved a lot. It runs elf files compiled by gcc and has ports for video and keyboard you can use from the inside.

https://bitbucket.org/krzat/mips/overview [C#]
Check the link to download MIPS compiler for windows.

Example code (MIPS.OS) contains some basic graphical code and a console:

45
SFML projects / Re: NetEXT - .NET Extension Library based on Thor
« on: December 01, 2013, 08:40:10 pm »
Seems like you are developing something similiar to mine library: https://bitbucket.org/krzat/sfml.utils .
Feel free to pull some classes (unless the goal is only to port Thor).

Pages: 1 2 [3] 4 5 ... 8
anything