Ignore:
Timestamp:
Jul 23, 2013, 9:39:21 PM (8 years ago)
Author:
lolbot
Message:

fixed 10 files out of 2754:

  • removed 386 CR characters
  • removed 4 trailing whitespaces
  • replaced 189 tabs with spaces
Location:
trunk/src/platform
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/platform/d3d9/d3d9input.cpp

    r2810 r2812  
    6060            continue;
    6161#if defined LOL_INPUT_V2
    62                 // TODO: we can put more friendly name here, such as LeftAxisX, ButtonX...
    63                 InputDeviceInternal* stick = new InputDeviceInternal(String::Printf("Joystick%d", i+1).C());
    64                 for (int j = 0; j < 4; ++j)
    65                         stick->AddAxis(String::Printf("Axis%d", j+1).C());
    66                 for (int j = 0; j < 16; ++j)
    67                         stick->AddKey(String::Printf("Button%d", j+1).C());
     62        // TODO: we can put more friendly name here, such as LeftAxisX, ButtonX...
     63        InputDeviceInternal* stick = new InputDeviceInternal(String::Printf("Joystick%d", i+1).C());
     64        for (int j = 0; j < 4; ++j)
     65            stick->AddAxis(String::Printf("Axis%d", j+1).C());
     66        for (int j = 0; j < 16; ++j)
     67            stick->AddKey(String::Printf("Button%d", j+1).C());
    6868
    69                 m_data->m_joysticks.Push(i, stick);
     69        m_data->m_joysticks.Push(i, stick);
    7070#else
    7171        Stick *stick = Input::CreateStick();
     
    8787    {
    8888#if defined LOL_INPUT_V2
    89                 delete m_data->m_joysticks[0].m2;
     89        delete m_data->m_joysticks[0].m2;
    9090#else
    91                 Input::DestroyStick(m_data->m_joysticks[0].m2);
     91        Input::DestroyStick(m_data->m_joysticks[0].m2);
    9292#endif // LOL_INPUT_V2
    93                 m_data->m_joysticks.Remove(0);
     93        m_data->m_joysticks.Remove(0);
    9494    }
    9595#endif
     
    120120        for (int b = 0; b < 16; b++)
    121121#if defined LOL_INPUT_V2
    122                         m_data->m_joysticks[i].m2->SetKey(b, ((uint16_t)(state.Gamepad.wButtons) >> b) & 1);
     122            m_data->m_joysticks[i].m2->SetKey(b, ((uint16_t)(state.Gamepad.wButtons) >> b) & 1);
    123123#else
    124                         m_data->m_joysticks[i].m2->SetButton(b, ((uint16_t)(state.Gamepad.wButtons) >> b) & 1);
     124            m_data->m_joysticks[i].m2->SetButton(b, ((uint16_t)(state.Gamepad.wButtons) >> b) & 1);
    125125#endif // LOL_INPUT_V2
    126         }
     126    }
    127127#endif
    128128}
  • trunk/src/platform/sdl/sdlapp.cpp

    r2810 r2812  
    6868
    6969#   ifdef LOL_INPUT_V2
    70         const SDL_VideoInfo* vidinfo = SDL_GetVideoInfo();
    71         int screen_w = vidinfo->current_w;
    72         int screen_h = vidinfo->current_h;
     70    const SDL_VideoInfo* vidinfo = SDL_GetVideoInfo();
     71    int screen_w = vidinfo->current_w;
     72    int screen_h = vidinfo->current_h;
    7373#   endif
    7474
     
    8585    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
    8686#   ifdef LOL_INPUT_V2
    87         // TODO: when implementing fullscreen, be sure to overwrite screen_w and screen_h with the value of vidinfo after the call to SDL_SetVideoMode
     87    // TODO: when implementing fullscreen, be sure to overwrite screen_w and screen_h with the value of vidinfo after the call to SDL_SetVideoMode
    8888#   endif
    8989    SDL_Surface *video = SDL_SetVideoMode(res.x, res.y, 0, SDL_OPENGL);
     
    113113    new SdlInput(video->w, video->h, screen_w, screen_h);
    114114#   else
    115         new SdlInput();
     115    new SdlInput();
    116116#   endif
    117117#endif
  • trunk/src/platform/sdl/sdlinput.cpp

    r2811 r2812  
    5454        m_prevmouse(ivec2(0)),
    5555        m_app_w((float)app_w),
    56         m_app_h((float)app_h), 
     56        m_app_h((float)app_h),
    5757        m_screen_w((float)screen_w),
    5858        m_screen_h((float)screen_h)
     
    240240
    241241#   if !SDL_FORCE_POLL_JOYSTICK
    242 #        ifdef LOL_INPUT_V2
     242#    ifdef LOL_INPUT_V2
    243243        case SDL_JOYAXISMOTION:
    244244            m_joysticks[event.jaxis.which].m2->SetAxis(event.jaxis.axis, (float)event.jaxis.value / 32768.f);
     
    249249            m_joysticks[event.jbutton.which].m2->SetKey(event.jbutton.button, event.jbutton.state);
    250250            break;
    251 #        else // !LOL_INPUT_V2
     251#    else // !LOL_INPUT_V2
    252252        case SDL_JOYAXISMOTION:
    253253            m_joysticks[event.jaxis.which].m2->SetAxis(event.jaxis.axis, (float)event.jaxis.value / 32768.f);
     
    258258            m_joysticks[event.jbutton.which].m2->SetButton(event.jbutton.button, event.jbutton.state);
    259259            break;
    260 #        endif // LOL_INPUT_V2
     260#    endif // LOL_INPUT_V2
    261261#   endif
    262262        }
     
    291291#   else // !LOL_INPUT_V2
    292292    Input::SetMousePos(mouse);
    293 #       endif // LOL_INPUT_V2
     293#    endif // LOL_INPUT_V2
    294294
    295295#   if SDL_VERSION_ATLEAST(1,3,0)
     
    300300
    301301    int keyindex = 0;
    302 #       ifdef LOL_INPUT_V2
    303 #       define KEY_FUNC(name, index) m_keyboard->SetKey(keyindex++, sdlstate[index] != 0);
    304 #       if !defined SDLK_WORLD_0
    305 #        define KEY_DISABLE_WORLD
     302#    ifdef LOL_INPUT_V2
     303#    define KEY_FUNC(name, index) m_keyboard->SetKey(keyindex++, sdlstate[index] != 0);
     304#    if !defined SDLK_WORLD_0
     305#    define KEY_DISABLE_WORLD
    306306#   endif // !SDLK_WORLD_0
    307 #       include "input/keys.h"
    308 #       undef KEY_FUNC
    309 #       else // !LOL_INPUT_V2
     307#    include "input/keys.h"
     308#    undef KEY_FUNC
     309#    else // !LOL_INPUT_V2
    310310
    311311    /* Send the whole keyboard state to the input system */
     
    555555
    556556    UNUSED(seconds);
    557 #       endif // LOL_INPUT_V2
     557#    endif // LOL_INPUT_V2
    558558
    559559#endif // USE_SDL
Note: See TracChangeset for help on using the changeset viewer.