Fixes for SDL2 after merge from sdl1-dev branch

This commit is contained in:
Dimitris Panokostas 2017-11-30 14:26:58 +01:00
parent d2c43c114b
commit 709244ad9e
17 changed files with 42 additions and 45 deletions

View file

@ -40,7 +40,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|VisualGDB'">
<ClCompile>
<CPPLanguageStandard>GNUPP14</CPPLanguageStandard>
<AdditionalIncludeDirectories>..\..\src\guisan\include;C:\SysGCC\raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include\c++\4.9;C:\SysGCC\raspberry\arm-linux-gnueabihf\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\SDL2;=/usr/local/include;=/usr/local/include/SDL2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\src\guisan\include;C:/SysGCC/raspberry/arm-linux-gnueabihf/include/c++/6.3.0/include;C:/SysGCC/raspberry/arm-linux-gnueabihf/include/c++/6.3.0;C:/SysGCC/raspberry/arm-linux-gnueabihf/include;=/usr/include;=/usr/include/SDL2;=/usr/local/include;=/usr/local/include/SDL2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUG=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
@ -53,7 +53,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|VisualGDB'">
<ClCompile>
<CPPLanguageStandard>GNUPP14</CPPLanguageStandard>
<AdditionalIncludeDirectories>..\..\src\guisan\include;C:\SysGCC\raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include\c++\4.9;C:\SysGCC\raspberry\arm-linux-gnueabihf\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\SDL2;=/usr/local/include;=/usr/local/include/SDL2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\src\guisan\include;C:/SysGCC/raspberry/arm-linux-gnueabihf/include/c++/6.3.0/include;C:/SysGCC/raspberry/arm-linux-gnueabihf/include/c++/6.3.0;C:/SysGCC/raspberry/arm-linux-gnueabihf/include;=/usr/include;=/usr/include/SDL2;=/usr/local/include;=/usr/local/include/SDL2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG=1;RELEASE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>

View file

@ -613,7 +613,7 @@ static uae_u8 ReadCIAA (unsigned int addr)
return v;
}
case 1:
#if defined(INPUTDEVICE_SIMPLE) && !defined(RASPBERRY)
#if defined(INPUTDEVICE_SIMPLE) && !defined(AMIBERRY)
tmp = (ciaaprb & ciaadrb) | (ciaadrb ^ 0xff);
#else
tmp = handle_parport_joystick (0, ciaaprb, ciaadrb);

View file

@ -57,7 +57,7 @@
#ifndef GCN_SDLGRAPHICS_HPP
#define GCN_SDLGRAPHICS_HPP
#include "SDL2/SDL.h"
#include "SDL.h"
#include "guisan/color.hpp"
#include "guisan/graphics.hpp"

View file

@ -57,7 +57,7 @@
#ifndef GCN_SDLIMAGE_HPP
#define GCN_SDLIMAGE_HPP
#include "SDL2/SDL.h"
#include "SDL.h"
#include <string>

View file

@ -60,7 +60,7 @@
#include "guisan/imageloader.hpp"
#include "guisan/platform.hpp"
#include "SDL2/SDL.h"
#include "SDL.h"
namespace gcn
{

View file

@ -59,7 +59,7 @@
#include <queue>
#include "SDL2/SDL.h"
#include "SDL.h"
#include "guisan/input.hpp"
#include "guisan/keyinput.hpp"

View file

@ -57,7 +57,7 @@
#ifndef GCN_SDLPIXEL_HPP
#define GCN_SDLPIXEL_HPP
#include "SDL2/SDL.h"
#include "SDL.h"
#include "guisan/color.hpp"
namespace gcn

View file

@ -47,7 +47,7 @@
#include <map>
#include <string>
#include <SDL2/SDL_ttf.h>
#include <SDL_ttf.h>
#include "guisan/font.hpp"
#include "guisan/platform.hpp"

View file

@ -2029,7 +2029,7 @@ void JOYTEST (uae_u16 v)
mouse_frame_y[1] = mouse_y[1];
}
#if !defined(INPUTDEVICE_SIMPLE) || defined(RASPBERRY)
#if !defined(INPUTDEVICE_SIMPLE) || defined(AMIBERRY)
static uae_u8 parconvert (uae_u8 v, int jd, int shift)
{
if (jd & DIR_UP)
@ -5557,10 +5557,8 @@ void inputdevice_copyconfig (struct uae_prefs *src, struct uae_prefs *dst)
dst->input_joymouse_speed = src->input_joymouse_speed;
dst->input_mouse_speed = src->input_mouse_speed;
dst->input_autofire_linecnt = src->input_autofire_linecnt;
dst->key_for_menu = src->key_for_menu;
dst->key_for_quit = src->key_for_quit;
//dst->button_for_menu = src->button_for_menu;
//dst->button_for_quit = src->button_for_quit;
strcpy(dst->open_gui,src->open_gui);
strcpy(dst->quit_amiberry,src->quit_amiberry);
dst->amiberry_use_retroarch_quit = src->amiberry_use_retroarch_quit;
dst->amiberry_use_retroarch_menu = src->amiberry_use_retroarch_menu;
dst->amiberry_use_retroarch_reset = src->amiberry_use_retroarch_reset;

View file

@ -184,11 +184,11 @@ const int RemapKeyMapList[] = {
SDLK_F7, SDLK_F8, SDLK_F9, SDLK_F10, SDLK_F11, SDLK_F12,
SDLK_0, SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5,
SDLK_6, SDLK_7, SDLK_8, SDLK_9, SDLK_PAGEUP, SDLK_PAGEDOWN,
SDLK_KP0, SDLK_KP1, SDLK_KP2, SDLK_KP3, SDLK_KP4,
SDLK_KP5, SDLK_KP6, SDLK_KP7, SDLK_KP8, SDLK_KP9,
SDLK_PERIOD, SDLK_CAPSLOCK, SDLK_NUMLOCK, SDLK_BACKSPACE,
SDLK_KP_0, SDLK_KP_1, SDLK_KP_2, SDLK_KP_3, SDLK_KP_4,
SDLK_KP_5, SDLK_KP_6, SDLK_KP_7, SDLK_KP_8, SDLK_KP_9,
SDLK_PERIOD, SDLK_CAPSLOCK, SDLK_NUMLOCKCLEAR, SDLK_BACKSPACE,
// divide
SDLK_ASTERISK, -1, SDLK_PRINT, SDLK_SCROLLOCK,
SDLK_ASTERISK, -1, SDLK_PRINTSCREEN, SDLK_SCROLLLOCK,
// tilde
-1, SDLK_BACKQUOTE,SDLK_PAUSE, SDLK_QUOTE, SDLK_COMMA,
SDLK_MINUS, SDLK_SLASH, SDLK_SEMICOLON,SDLK_EQUALS, SDLK_LEFTPAREN,
@ -687,8 +687,8 @@ static int init_joystick(void)
if (Joysticktable[cpt] != nullptr)
{
if (SDL_JoystickName(cpt) != nullptr)
strncpy(JoystickName[cpt], SDL_JoystickName(cpt), sizeof JoystickName[cpt] - 1);
if (SDL_JoystickNameForIndex(cpt) != nullptr)
strncpy(JoystickName[cpt], SDL_JoystickNameForIndex(cpt), sizeof JoystickName[cpt] - 1);
else
sprintf(JoystickName[cpt], "Joystick%d", cpt);
@ -923,7 +923,7 @@ static void read_joystick(void)
int hostkeyid = currprefs.jports[joyid].id - JSEM_JOYS;
Uint8* keystate = SDL_GetKeyState(nullptr);
const Uint8* keystate = SDL_GetKeyboardState(nullptr);
// cd32 red, blue, green, yellow
setjoybuttonstate(0, 0, keystate[host_keyboard_buttons[hostkeyid].south_button]); // b

View file

@ -94,7 +94,7 @@ void checkInput()
break;
}
}
else if (event.type == SDL_JOYBUTTONDOWN)
else if (msg_event.type == SDL_JOYBUTTONDOWN)
{
if (SDL_JoystickGetButton(GUIjoy,host_input_buttons[0].east_button) ||
@ -111,7 +111,7 @@ void checkInput()
#ifdef ANDROIDSDL
androidsdl_event(event, msg_input);
#else
msg_input->pushInput(event);
msg_input->pushInput(msg_event);
#endif
}
}

View file

@ -222,7 +222,7 @@ static NavigationMap navMap[] =
// active move left move right move up move down
// PanelInput
#ifdef RASPBERRY
#ifdef AMIBERRY
{ "cboPort0", "Input", "cboPort0mode", "cboAutofire", "cboPort1" },
{ "cboPort0mode", "cboPort0", "Input", "cboTapDelay", "cboPort1mode" },
{ "cboPort1", "Input", "cboPort1mode", "cboPort0", "cboPort2" },
@ -465,7 +465,7 @@ bool HandleNavigation(int direction)
return focusTarget != nullptr;
}
void PushFakeKey(SDLKey inKey)
void PushFakeKey(SDL_Keycode inKey)
{ SDL_Event nuevent;
nuevent.type = SDL_KEYDOWN; // and the key up

View file

@ -1,7 +1,7 @@
#include <guichan.hpp>
#include <guisan.hpp>
#include <SDL_ttf.h>
#include <guichan/sdl.hpp>
#include "sdltruetypefont.hpp"
#include <guisan/sdl.hpp>
#include <guisan/sdl/sdltruetypefont.hpp>
#include "SelectorEntry.hpp"
#include "UaeRadioButton.hpp"
#include "UaeDropDown.hpp"
@ -38,7 +38,7 @@ static gcn::Label* lblCustomAction[14];
static gcn::UaeDropDown* cboCustomAction[14];
static gcn::Label* lblPortInput;
static gcn::TextField *txtPortInput;
static gcn::TextField* txtPortInput;
static gcn::Label* lblRetroarch;
static int SelectedPort = 1;
@ -518,7 +518,7 @@ void RefreshPanelCustom(void)
if (changed_prefs.jports[SelectedPort].id > JSEM_JOYS && changed_prefs.jports[SelectedPort].id < JSEM_MICE - 1)
{ hostjoyid = changed_prefs.jports[SelectedPort].id - JSEM_JOYS - 1;
strncpy(tmp, SDL_JoystickName(hostjoyid), 255);
strncpy(tmp, SDL_JoystickNameForIndex(hostjoyid), 255);
for (int n=0 ; n < 14 ; ++n)
{

View file

@ -343,7 +343,7 @@ public:
RefreshPanelInput();
}
#ifdef RASPBERRY
#ifdef AMIBERRY
// mousemap drop-down change
else if (actionEvent.getSource() == cboPort0mousemode)
{
@ -374,7 +374,7 @@ public:
changed_prefs.input_joymouse_multiplier = mousespeed_values[int(sldMouseSpeed->getValue())];
RefreshPanelInput();
}
#ifdef PANDORA
else if (actionEvent.getSource() == cboTapDelay)
{
if(cboTapDelay->getSelected() == 0)
@ -384,7 +384,7 @@ public:
else
changed_prefs.pandora_tapDelay = 2;
}
#endif
else if (actionEvent.getSource() == chkMouseHack)
{
#ifdef ANDROIDSDL
@ -919,7 +919,7 @@ void RefreshPanelInput()
// Set current device in port 0
int idx = 0;
for (i = 0; i < ctrlPortList.getNumberOfElements(); ++i)
for (int i = 0; i < ctrlPortList.getNumberOfElements(); ++i)
{
if (changed_prefs.jports[0].id == portListIDs[i])
{
@ -931,7 +931,7 @@ void RefreshPanelInput()
// Set current device in port 1
idx = 0;
for (i = 0; i < ctrlPortList.getNumberOfElements(); ++i)
for (int i = 0; i < ctrlPortList.getNumberOfElements(); ++i)
{
if (changed_prefs.jports[1].id == portListIDs[i])
{
@ -946,7 +946,7 @@ void RefreshPanelInput()
// Set current device in port 2
idx = 0;
for (i = 0; i < ctrlPortList.getNumberOfElements(); ++i)
for (int i = 0; i < ctrlPortList.getNumberOfElements(); ++i)
{
if (changed_prefs.jports[2].id == portListIDs[i])
{
@ -958,7 +958,7 @@ void RefreshPanelInput()
// Set current device in port 3
idx = 0;
for (i = 0; i < ctrlPortList.getNumberOfElements(); ++i)
for (int i = 0; i < ctrlPortList.getNumberOfElements(); ++i)
{
if (changed_prefs.jports[3].id == portListIDs[i])
{
@ -1033,14 +1033,14 @@ void RefreshPanelInput()
break;
}
}
#ifdef PANDORA
if (changed_prefs.pandora_tapDelay == 10)
cboTapDelay->setSelected(0);
else if (changed_prefs.pandora_tapDelay == 5)
cboTapDelay->setSelected(1);
else
cboTapDelay->setSelected(2);
#endif
chkMouseHack->setSelected(changed_prefs.input_tablet == TABLET_MOUSEHACK);
chkCustomCtrl->setSelected(changed_prefs.customControls);

View file

@ -173,7 +173,7 @@ enum
};
bool HandleNavigation(int direction);
void PushFakeKey(SDLKey inKey);
void PushFakeKey(SDL_Keycode inKey);
#define MAX_HD_DEVICES 5
extern void CreateDefaultDevicename(char* name);

View file

@ -125,7 +125,6 @@ static struct uae_input_device_kbr_default keytrans_amiga[] = {
{ SDLK_COMMA, INPUTEVENT_KEY_COMMA },
{ SDLK_PERIOD, INPUTEVENT_KEY_PERIOD },
{ SDLK_SLASH, INPUTEVENT_KEY_DIV },
{ SDLK_SYSREQ, INPUTEVENT_SPC_SCREENSHOT_CLIPBOARD },
{SDLK_END, INPUTEVENT_SPC_QUALIFIER_SPECIAL },
{SDLK_PAUSE, INPUTEVENT_SPC_PAUSE },

View file

@ -39,20 +39,20 @@ STATIC_INLINE void uae_end_thread (uae_thread_id *tid)
{
}
STATIC_INLINE int uae_start_thread (const TCHAR *name, void *(*f) (void *), void *arg, uae_thread_id *foo)
STATIC_INLINE uae_thread_id uae_start_thread(const TCHAR* name, void*(*f)(void*), void* arg, uae_thread_id* foo)
{
uae_thread_id id = SDL_CreateThread ((int (*)(void *))f, "StartThread", arg);
if(foo != NULL)
*foo = id;
return (int)id;
return id;
}
STATIC_INLINE int uae_start_thread_fast (void *(*f) (void *), void *arg, uae_thread_id *foo)
STATIC_INLINE uae_thread_id uae_start_thread_fast(void*(*f)(void*), void* arg, uae_thread_id* foo)
{
uae_thread_id id = SDL_CreateThread ((int (*)(void *))f, "StartThreadFast", arg);
if(foo != NULL)
*foo = id;
return (int)id;
return id;
}
STATIC_INLINE void uae_wait_thread (uae_thread_id thread)