Ticket #31974: patch-src_mac_MacHIDManager.cpp.diff

File patch-src_mac_MacHIDManager.cpp.diff, 2.4 KB (added by marin.saric@…, 13 years ago)
  • src/mac/MacHIDManager.cpp

     
    11/*
    22 The zlib/libpng License
    33 
    4  Copyright (c) 2006 Phillip Castaneda
     4 Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
    55 
    66 This software is provided 'as-is', without any express or implied warranty. In no event will
    77 the authors be held liable for any damages arising from the use of this software.
    88 
    9  Permission is granted to anyone to use this software for any purpose, including commercial 
     9 Permission is granted to anyone to use this software for any purpose, including commercial
    1010 applications, and to alter it and redistribute it freely, subject to the following
    1111 restrictions:
    1212 
    13  1. The origin of this software must not be misrepresented; you must not claim that 
    14  you wrote the original software. If you use this software in a product, 
    15  an acknowledgment in the product documentation would be appreciated but is 
     13 1. The origin of this software must not be misrepresented; you must not claim that
     14 you wrote the original software. If you use this software in a product,
     15 an acknowledgment in the product documentation would be appreciated but is
    1616 not required.
    1717 
    18  2. Altered source versions must be plainly marked as such, and must not be 
     18 2. Altered source versions must be plainly marked as such, and must not be
    1919 misrepresented as being the original software.
    2020 
    2121 3. This notice may not be removed or altered from any source distribution.
     
    403403        {
    404404                if((*it)->inUse == false && (*it)->type == iType && (vendor == "" || (*it)->combinedKey == vendor))
    405405                {
     406            int totalDevs = totalDevices(iType);
     407            int freeDevs = freeDevices(iType);
     408            int devID = totalDevs - freeDevs;
    406409                        switch(iType)
    407410                        {
    408411                                case OISJoyStick:
    409                                         int totalDevs = totalDevices(iType);
    410                                         int freeDevs = freeDevices(iType);
    411                                         int devID = totalDevs - freeDevs;
    412                                        
    413                                         obj = new MacJoyStick((*it)->combinedKey, bufferMode, *it, creator, devID);
    414                                         (*it)->inUse = true;
    415                                         return obj;
     412                {
     413                    obj = new MacJoyStick((*it)->combinedKey, bufferMode, *it, creator, devID);
     414                    (*it)->inUse = true;
     415                    return obj;
     416                }
    416417                                case OISTablet:
    417418                                        //Create MacTablet
    418419                                        break;