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 - TTK-Bandit

Pages: [1] 2
1
Feature requests / More Keys for Press/Release events
« on: March 24, 2008, 02:34:19 am »
yeah, but having it as hex numbers removes the need for drawing all those different characters ingame.

2
Feature requests / More Keys for Press/Release events
« on: March 22, 2008, 02:35:25 pm »
lord delvin, what about this:
could use unicode and have the ascii characters normally bound (32-126)
and those that are not covered by ascii can then be bound by its hex value, i.e. 0x38

3
Feature requests / More Keys for Press/Release events
« on: March 18, 2008, 01:21:48 am »
If its only a different keyboard layout, not a completely different keyboard type, then you can still bind stuff via the menu, just entering it via config or console will be harder, since you need to find the english key for your button.
if you want me to accept chinese as input type, then I have to say that would be hell of a lot work to make it possible, since that is not only the input stuff, but also string and font issues you have to redesign.

4
Feature requests / More Keys for Press/Release events
« on: March 18, 2008, 12:08:05 am »
for text input unicode is good, but for binds ?
would be pretty complex to have all the enums sorted out correctly.

edit: oh just noticed, that there is no unicode translation for text either, I thought there was since sf::Event::TextEntered uses Event.Text.Unicode
Thats definitely something that has to be changed.

5
Window / Display() is decreasing my FPS dramatically
« on: March 18, 2008, 12:06:07 am »
found a solution:
call
timeBeginPeriod( 1 );
at the beginning of the main function and
timeEndPeriod( 1 );
at the end, they need to be in the main function, if you put them in the constructor/destructor of a global object it won't work.

6
Feature requests / More Keys for Press/Release events
« on: March 17, 2008, 11:31:03 pm »
results of my tests are that it kinda sucks to have unicode chars for binds anyway, so you can skip it.
but there still are a few issues I'd like to adress:
1. lower/greater than: VK_OEM_102
2. Tilde is VK_OEM_5 for me, are you sure its VK_OEM_3 on your system ?
3. capslock via VK_CAPITAL, dunno maybe numlock too ?
4. numpad keys for divide, multiply, .. should be unique too.(see 5.)
5. numpad keys should work even if numlock is disabled..
on windows you could add this to the top of VirtualKeyCodeToSF:
Code: [Select]

int hiFlags = HIWORD(Flags);
if ( !(hiFlags & 0x100) ) {
switch( MapVirtualKey(hiFlags & 0xFF, 1) )
{
case VK_INSERT :     return Key::Numpad0;
case VK_END :        return Key::Numpad1;
case VK_DOWN :       return Key::Numpad2;
case VK_NEXT :       return Key::Numpad3;
case VK_LEFT :       return Key::Numpad4;
case VK_CLEAR :      return Key::Numpad5;
case VK_RIGHT :      return Key::Numpad6;
case VK_HOME :       return Key::Numpad7;
case VK_UP :         return Key::Numpad8;
case VK_PRIOR :      return Key::Numpad9;
case VK_DIVIDE:      return Key::NumpadDivide;
case VK_MULTIPLY:    return Key::NumpadMultiply;
case VK_SUBTRACT:    return Key::NumpadSubtract;
case VK_ADD:         return Key::NumpadAdd;
case VK_DELETE:      return Key::NumpadDelete;
case VK_RETURN:      return Key::NumpadReturn;
}
}

7
Feature requests / Platform independent executable calling
« on: March 17, 2008, 10:13:36 pm »
well with the std library you wont get the output, but you can call system("yourcommand.exe");

8
Window / Display() is decreasing my FPS dramatically
« on: March 16, 2008, 11:21:39 am »
laurent no im sure that vsync is off, besides I have a crt with 100hz, so it should be on 100 then, not  62.

9
Window / Display() is decreasing my FPS dramatically
« on: March 15, 2008, 11:08:07 pm »
are you sure you dont call it twice ? if I remove the call to Display, then nothing is drawn.

I noticed this fps bug too, although my fps calculation said it was 62fps.
I found out it was a call to sleep I did, it seems that no matter how small the value is you pass to Sleep, you always sleep for at least 16ms.

edit from msdn :
Quote
The system clock "ticks" at a constant rate. If dwMilliseconds is less than the resolution of the system clock, the thread may sleep for less than the specified length of time. If dwMilliseconds is greater than one tick but less than two, the wait can be anywhere between one and two ticks, and so on.

10
Window / Unable to get any joypad input
« on: March 15, 2008, 08:54:37 pm »
I did not actually test if the input is correct, but I receive button and axis events from my joystick.

11
Window / Unable to get any joypad input
« on: March 15, 2008, 01:01:09 pm »
works
no problem

12
Audio / Linking to static library files instead of dynamic ones
« on: March 15, 2008, 12:11:01 pm »
but we can link them statically if our code is published on the LGPL license, right ?
or is there maybe a problem with the zlib/png license then ?

13
Window / Unable to get any joypad input
« on: March 14, 2008, 04:07:27 pm »
this is what happens:
Joystick::Initialize gets called for the first joystick ( 0 )
it checks the while loop, the loop returns true, so it steps inside,
it checks if there was no error, if so set the properties
then it increases myIndex and checks the loop again.. it fails and the function is done..
but myIndex is now 1, not 0.

so I guess there are 2 fixes for this:
either make the while loop look like this:
Code: [Select]

    for( ; ((myIndex - JOYSTICKID1 <= Index) && (Error = joyGetPosEx(myIndex, &JoyInfo)) != JOYERR_PARMS; myIndex++ )
    {
        // Check if the current joystick is connected
        if (Error == JOYERR_NOERROR)
        {
           ....
        }
    }

or decrease myIndex by one at the end of the function

but in the end, I guess this still wont work with multiple joysticks, it probably has to look like this:
Code: [Select]
void Joystick::Initialize(unsigned int Index)
{
    // Reset state
    myIndex     = JOYSTICKID1;
    myNbAxes    = 0;
    myNbButtons = 0;

    // Get the Index-th connected joystick
    MMRESULT Error;
    JOYINFOEX JoyInfo;
    for( int joysticksFound = 0; (Error = joyGetPosEx(myIndex, &JoyInfo)) != JOYERR_PARMS; myIndex++ )
    {
        // Check if the current joystick is connected
        if (Error == JOYERR_NOERROR) {
if ( joysticksFound == Index ) {
            // Store its caps
JOYCAPS Caps;
joyGetDevCaps(myIndex, &Caps, sizeof(Caps));
myNbAxes    = Caps.wNumAxes;
myNbButtons = Caps.wNumButtons;
return;
}
joysticksFound++;
        }
    }
}

14
Window / Unable to get any joypad input
« on: March 14, 2008, 03:04:03 pm »
I just tested my joystick, and it doesnt work either..

there are two things I had to change to make it work, the first one was more a hack, which probably isnt good if you have 2 joysticks, but I dunno how the whole joystick concept is supposed to work, but hopefully laurent will be able to fix it correctly:
in Joystick::Initialize, myIndex gets too big, since the loop checks for all joysticks, so for joystick index 0 the myIndex for my joystick was set to 1.
you need to break out of the loop at the end of the check for (Error == JOYERR_NOERROR)

the second fix is no hack anymore, there was a check in Joystick::UpdateState:
if ( joyGetDevCaps(myIndex, &Caps, sizeof(Caps)) )
which should be:
if ( joyGetDevCaps(myIndex, &Caps, sizeof(Caps)) == JOYERR_NOERROR )

15
Feature requests / More Keys for Press/Release events
« on: March 13, 2008, 08:21:24 pm »
you could check out the sdl code, I think they have it working pretty well..
on windows, you can use GetKeyboardLayout(), dunno about x11/mac
on the weekend, I'll see if I can get some working code together..

did not know about the F12 debug bind.. never pressed F12 while debugging :D

Pages: [1] 2