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

Pages: [1]
1
General / Re: Wrong position in View
« on: April 11, 2015, 12:15:25 pm »
The offset is needed for the current tile-position.
I copy a rectangle, then i paste it at mouse position.
So i copying tile for tile from old rect to new rect. In my array all is right, but i need to set the new Vertexarray position and this fails when i have moved the view or zoomed.

Here I paste you the full function:
(click to show/hide)

2
General / Wrong position in View
« on: April 11, 2015, 02:18:12 am »
Hi, I am currently working on a tile-map-editor (copy function), but I can not set up the right Sprite position in my MapView. Here is my Code i am currently using,  it is working UNTIL i change the View (move, zoom ...) and i do not get it working by myself or with google research.
Do you have some suggestions for me?

//Get the window mouse position
                                sf::Vector2f worldCoords = _window.mapPixelToCoords(mousePosition,_mapView);

                                //Convert to tile Position (chunksize = tilesize)
                                worldCoords.x = static_cast<int>((worldCoords.x / chunksize))*chunksize;
                                worldCoords.y = static_cast<int>((worldCoords.y / chunksize))*chunksize;

                                //Add offset (ix, iy) on converted tile-paste-position
                                worldCoords.x += (ix*chunksize);
                                worldCoords.y += (iy*chunksize);

                                //Set new position
                                newTile.setPosition(worldCoords);
 

3
General / SFML Game Development Book (Scennode Pattern with 65k tiles)
« on: February 21, 2015, 10:46:57 pm »
Hey guys,
currently i am in programming a map editor for a project and i programming it along with the SFML Game Development Book.
My problem is that when i load 65k tiles then my FPS is equal 1 ~ 2 ...
In my TileNode class i already checked if my tiles intersec with our view an it is working
void TileSprite::drawCurrent(sf::RenderTarget& target, sf::RenderStates states) const {
//Not the best way i know...
        sf::Vector2u wSize = target.getSize();
        sf::Vector2f vPos = target.getView().getCenter();
        sf::FloatRect rect{
                vPos.x - (wSize.x / 2.f), vPos.y - (wSize.y / 2.f), (float) wSize.x, (float) wSize.y
        };
        if (getBoundingRect().intersects(rect)) {
                target.draw(mSprite, states);
                target.draw(*mLayerDisplay, states);
                target.draw(*mPositionDisplay, states);
                target.draw(*mBlockDisplay, states);
        }
}

I really doesn't know why this FPS lag is occuring, but i can think it could happen from the derived class function:
void SceneNode::draw(sf::RenderTarget& target, sf::RenderStates states) const {
        // Apply transform of current node
        states.transform *= getTransform();
       
        // Draw node and children with changed transform
        drawCurrent(target, states);
        drawChildren(target, states);

        // Draw bounding rectangle - disabled by default
        drawBoundingRect(target, states);      
}

Can sombody help me to fix this?
I'm really saddened :S

4
General / Re: CMake GNUtoMS building error
« on: February 16, 2015, 09:32:10 pm »
Thanks, it worked now :)

5
General / [SOLVED]CMake GNUtoMS building error
« on: February 16, 2015, 07:33:46 pm »
Hello guys,
i cloned the Git master SFML repository.
Now i want to build it with cmake & mingw32_make.
(I followed: http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php)
This is my %PATH% Variable:
C:\Program Files (x86)\CMake\bin;C:\Microsoft Visual Studio 2013 Ultimate\VC\bin;C:\MinGW\bin;
I always run cmd in Admin mode!

My Problem looks like this (but only if i checked GNUtoMS because i want .lib prefix)

I dont know what to do here :S (googled and searched a lot)
Please help

Dreamflask

6
SFML projects / SFML 2.2 Visual Studio Project Template
« on: January 11, 2015, 07:23:09 pm »
Hey guys i want to share my project template with you.
I used Microsoft Visual Studio 2013, i do not know if it works with lower versions. Feel free to test :)

Basic Installation
Download SFML 2.2 32-bit and 64-bit: http://www.sfml-dev.org/download/sfml/2.2/
Extract the Folder from the 32-bit Zip File to C:\SFML\ . (Create this Folder "SFML" if not exist!)
Now it should look like this: C:\SFML\SFML-2.2\(bin, lib folders ...)
Create a new Folder in C:\SFML, name it SFML-2.2_x64.
Now open the 64-bit Zip File and enter the SFML 2.2 Folder (in the Zip file) and extract the whole data into
C:\SFML\SFML-2.2_x64.
Now it should look like this: C:\SFML\SFML-2.2_x64\(bin, lib folders ...)

Now download my Template files: https://dl.dropboxusercontent.com/u/42682951/SFML/VS2013%20Template/SFML-2.2%20Game.zip
(VirusTotal: https://www.virustotal.com/de/file/c66c9b677fdbccba54d1f346fb80efdeefabbfdb4434c8bb318d9b2b10a33818/analysis/1421000359/)

Now you have 2 Options:
Option 1: You want to have a Category like   (New Project)->Visual C++ -> SFML -> SFML 2.2 Game
Option 2: You want it without a category like (New Project)->Visual C++ -> (Scroll down and find) SFML 2.2 Game

Installation for Option 1:
Search your Visual Studio installation Path.
Go to  {InstallationPath}\VC\vcprojects.
Now create a Folder and name it SFML.
Extract my ZIP file to this new SFML Folder and delete the Mytemplate.vstemplate File.
If you will not delete it you will have 2 Template Items instead of 1.
Done :) Have fun.

Installation for Option 2:
Copy my Zip file (NOT the Data in the ZIP) to :
C:\Users\{YOUR USERNAME}\Documents\Visual Studio 2013\Templates\ProjectTemplates
The example above is the standard path...
Done :) Have fun.

If you have Questions, feel free to ask.

7
General discussions / Re: Templates for SFML 2.1 In Visual Studio 2013
« on: August 19, 2014, 03:23:07 pm »
I'm using this...
Works great for me  :)

Link:
http://en.sfml-dev.org/forums/index.php?topic=13010.0

8
General / Re: ERROR: building and compiling SFML for Android
« on: August 12, 2014, 01:07:50 am »
Hey RunRanger

I have the same problem.
I used this links:

https://github.com/SFML/SFML/wiki/Building-SFML-for-Android
and
http://en.sfml-dev.org/forums/index.php?topic=13716.0

CMD Command i used:
(click to show/hide)

System:
Windows 8.1 - 64Bit
Programms:
CMake 3.0.0
Android NDK r10
Android SDK Tools rev 22.6.4
Android SDK Plattform-Tools rev 19.0.2
Visual Studio 2013 Ultimate

Errors from VS 2013 Ultimate
(click to show/hide)

Dont know why he show's me this /Wno-psabi as invalid not numeric Argument, 7 times.

Pages: [1]