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

Pages: [1]
1
General / Re: Top-Down Roguelike Game, some doubts and thoughts.
« on: May 18, 2014, 04:12:13 pm »
Looking through the code, it appears that your collision bug is a result of only handling x or y collisions but never both.  I'd suggest the following fix:
       
        if (matchesCategories(pair, Category::Character, Category::UnwalkableTile))
        {
            auto& character         = static_cast<Character&>(*pair.first);
            auto& tile              = static_cast<Tile&>(*pair.second);
            auto characterBounds    = character.getBoundingRect();
            auto characterPosition  = character.getPosition();        
            auto tileBounds         = tile.getBoundingRect();
            auto tilePosition       = tile.getPosition();

            // check X axis penetration through left or right
            auto penetrationX       = std::min(std::abs(tileBounds.left + tileBounds.width - characterBounds.left)
                                                , std::abs(characterBounds.left + characterBounds.width - tileBounds.left));
            // check Y axis penetration through up or down
            auto penetrationY       = std::min(std::abs(tileBounds.top + tileBounds.height - characterBounds.top)
                                                , std::abs(characterBounds.top + characterBounds.height - tileBounds.top));

            // Only correct if the difference is large enough
            if (penetrationX > 0.05)
            {
                // Colliding Left
                if (characterPosition.x > tilePosition.x)
                    character.setPosition(characterPosition.x + penetrationX, characterPosition.y);
                // Colliding Right
                else
                    character.setPosition(characterPosition.x - penetrationX, characterPosition.y);
            }
           
            // Correct Y if the penetration depth is large enough
            if(penetrationY > 0.05)
            {
                // Colliding Top
                if (characterPosition.y > tilePosition.y)
                    character.setPosition(characterPosition.x, characterPosition.y + penetrationY);
                // Colliding Bottom
                else
                    character.setPosition(characterPosition.x, characterPosition.y - penetrationY);
            }      
        }
 

Edit
Note the 0.05 can be tuned to work, it was just a value I pulled from the ether.

2
SFML projects / Re: Looking for a newby partner(s)
« on: July 17, 2012, 07:09:44 pm »
Hi All,

I would be interested in joining this project.  I have an average knowledge of C/C++ and SFML and minor media(graphics, sound) skills.   Probably will not have a lot of time - a few hours a week - but it sounds like fun.

If needed I have a personal/private server with redmine (issue tracker, forum, wiki, news, files, documents, etc) and svn.

-Chris.

3
SFML projects / SFGUI
« on: January 08, 2012, 04:38:09 am »
Elgan,
Your initial unhandled exception sounds very similar to the problem that I was having.  Please try defining
Code: [Select]

_HAS_ITERATOR_DEBUGGING=0

under the project properties as a C++ preprocessor define and see if that fixes your problems.

4
SFML projects / SFGUI
« on: January 05, 2012, 11:32:02 pm »
I managed to fix all of my debugging problems.  I am able to link to the released dynamic libs from the nightly build as well - and still be able to debug.  The solution was to use the following define:
Code: [Select]

_HAS_ITERATOR_DEBUGGING=0

5
SFML projects / SFGUI
« on: January 05, 2012, 10:10:54 pm »
Linking to the debug libs appears to be a misdirection as I still have problems in other parts of SFGUI - specifically the Entry::GetPositionFromMouseX causes a segfault on line 70, where the m_visible_string is checked (this internally fails at the _Compare() function since the _Ptr points to 0xFFFFFFFF).

All my searches for the problems I am having indicate that the variables are not initialized.

6
SFML projects / SFGUI
« on: January 05, 2012, 04:46:57 pm »
I am using VC++ 2010 Version 10.0.30319.1 RTMRel.

I was under the impression that all libs build with VS2010 would work with any version of VS2010.  Is that wrong?

What version was used to build the libs supplied in the nightly builds?

[Edit 1]
I built SFML and SFGUI myself and linked them against my ButtonTest application.  I still get the same problems in debug mode.

[Edit 2]
When I link against the sfgui debug libs (build with the Debug target in the SFGUI solution), the test program works just fine.

7
SFML projects / SFGUI
« on: January 05, 2012, 04:32:52 am »
Here is ButtonTest.cpp (the only cpp file in the above archive)
Code: [Select]

#include <SFGUI/Window.hpp>
#include <SFGUI/Desktop.hpp>
#include <SFGUI/Box.hpp>
#include <SFGUI/Table.hpp>
#include <SFGUI/Label.hpp>
#include <SFGUI/Entry.hpp>
#include <SFGUI/Button.hpp>
#include <SFGUI/Context.hpp>
#include <SFGUI/Engine.hpp>
#include <SFML/Graphics.hpp>

#include <string>
#include <sstream>
#include <cstdlib>


sf::RenderWindow* screen;


void OnButtonClicked()
{
}


int main(int argc, char* argv[])
{

// Initialize the time
screen = new sf::RenderWindow();
screen->Create(sf::VideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP), "Button Test");

// Create two buttons, one Client and one Server
sfg::Button::Ptr cbutton( sfg::Button::Create( "Test" ) );
cbutton->OnClick.Connect( &OnButtonClicked );


// Create a vertical box layout width 5 pixels spacing and add the label
// and button to it.
sfg::Box::Ptr box( sfg::Box::Create( sfg::Box::VERTICAL, 5.f ) );
box->Pack( cbutton, false );

// Create a window and add the box layouter to it. Also set some properties.
sfg::Window::Ptr window( sfg::Window::Create() );
window->Add( box );
window->SetTitle( "Testing" );
window->SetStyle( 3 ); // Title and Background

window->SetPosition(
sf::Vector2f(
static_cast<float>( screen->GetWidth() / 2 ) - window->GetAllocation().Width / 2.f,
static_cast<float>( screen->GetHeight() / 2 ) - window->GetAllocation().Height / 2.f
)
);

// Create a desktop and add the window to it. We need to specify the desktop
// area we want to use. In this case we use SFML window's whole area and
// therefore give it our render window to use its size.
sfg::Desktop desktop( *screen );

desktop.Add( window );

// Main loop!
sf::Event event;

while( ButtonClicked == 0 )
{
// Event processing.
while( screen->PollEvent( event ) )
{
desktop.HandleEvent( event );

// If window is about to be closed, leave program.
if( event.Type == sf::Event::Closed )
{
screen->Close();
}
}

// Rendering.
screen->Clear();
desktop.Expose( *screen );
screen->Display();
}

screen->Clear();

return 0;
}


This is the output of the debugger:
Code: [Select]

'ButtonTestd.exe': Loaded 'C:\Users\Terohnon\Downloads\ButtonTest\bin\ButtonTestd.exe', Symbols loaded.
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Users\Terohnon\Downloads\ButtonTest\bin\sfml-graphics-2.dll', Binary was not built with debug information.
'ButtonTestd.exe': Loaded 'C:\Users\Terohnon\Downloads\ButtonTest\bin\sfml-window-2.dll', Binary was not built with debug information.
'ButtonTestd.exe': Loaded 'C:\Users\Terohnon\Downloads\ButtonTest\bin\sfml-system-2.dll', Binary was not built with debug information.
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msvcp100.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msvcr100.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Users\Terohnon\Downloads\ButtonTest\bin\sfgui.dll', Binary was not built with debug information.
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\apphelp.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\AppPatch\AcLayers.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\userenv.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\profapi.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\winspool.drv', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\mpr.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\atiglpxx.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\atioglxx.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\atigktxx.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\aticfx32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\atiadlxy.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\wtsapi32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Unloaded 'C:\Windows\SysWOW64\atigktxx.dll'
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\atigktxx.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\dinput.dll', Cannot find or open the PDB file
'ButtonTestd.exe': Loaded 'C:\Windows\SysWOW64\hid.dll', Cannot find or open the PDB file
First-chance exception at 0x61ea980b in ButtonTestd.exe: 0xC0000005: Access violation reading location 0xbaadf011.
Unhandled exception at 0x77a115ee in ButtonTestd.exe: 0xC0000005: Access violation reading location 0xbaadf011.
The program '[2420] ButtonTestd.exe: Native' has exited with code -1073741819 (0xc0000005).


Note:  This was done on a 64bit Windows 7 System, but the error is the same as the 32 bit system.

8
SFML projects / Debug Build Problems
« on: January 04, 2012, 07:25:13 pm »
I am using one of the nightly builds from a few weeks ago (I tested with an updated version and still have the same problem) and when I try to debug, I get an access violation.  However, when I run in release mode, it works fine.

I am running on Windows 7 32bit with VS2010.

The exact error I get is below:
Code: [Select]

First-chance exception at 0x0f8b980b in ButtonTestd.exe: 0xC0000005: Access violation reading location 0xbaadf011.
Unhandled exception at 0x0f8b980b in ButtonTestd.exe: 0xC0000005: Access violation reading location 0xbaadf011.
The program '[2776] ButtonTestd.exe: Native' has exited with code -1073741819 (0xc0000005).


My project is located here: http://dl.dropbox.com/u/8892717/ButtonTest.zip
It uses premake, you'll need to run:
Code: [Select]
premake4 vs2010

Do I have some linker directive wrong?  I was thinking it might be possibly the string encoding.

[Edit]
Digging further, my problem appears to be that a private member variable, m_delegates, of the public member OnClick in the button class is non Null after the create method call on line 42 in ButtonTest.cpp - only when debugging.  Creating a different signal and assigning it to the OnClick variable results in the test app working.

9
SFML projects / SFGUI
« on: December 16, 2011, 07:14:23 pm »
What version of MinGW / GCC combo is used for these builds?

10
SFML projects / SFGUI
« on: December 10, 2011, 05:19:37 pm »
:oops:  I removed what I had on my HD and re-cloned the git repo and everything is fine.

11
SFML projects / SFGUI Git does not build.
« on: December 09, 2011, 06:07:53 pm »
It appears that the current git is broken.  There are still references to std::shared_ptr<>, ResizeWindow no longer exists, AllocateSize calls, etc.

Pages: [1]
anything