fix cmake SDL_FORCEFEEDBACK option removal

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7866 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 829b639d9023de6bd2151c26f8b928150b8fb474
Former-commit-id: 345a07a10d61d30274ab244cd16d84bfdbbd206b
This commit is contained in:
iobyte 2022-01-02 20:01:07 +00:00
parent 6bb2c355ff
commit 48605e270b
4 changed files with 4 additions and 36 deletions

View file

@ -60,14 +60,10 @@
#include <car.h>
#include "humandriver.h"
#if SDL_FORCEFEEDBACK
#include "forcefeedback.h"
extern TGFCLIENT_API ForceFeedbackManager forceFeedback;
#endif
typedef enum { eTransAuto, eTransSeq, eTransGrid, eTransHbox } eTransmission;
typedef enum { eRWD, eFWD, e4WD } eDriveTrain;
@ -124,11 +120,9 @@ typedef struct HumanContext
bool mouseControlUsed;
int lightCmd;
int dashboardCounter;
#if SDL_FORCEFEEDBACK
int lastForceFeedbackIndex;
int lastForceFeedbackLevel;
int lastForceFeedbackDir;
#endif
// simuV4 ...
bool useESP;
@ -754,22 +748,18 @@ void HumanDriver::new_race(int index, tCarElt* car, tSituation *s)
}//for i
#if SDL_FORCEFEEDBACK
//initialize the force feedback
forceFeedback.readConfiguration(car->_carName);
#endif
}
void HumanDriver::pause_race(int index, tCarElt* /*car*/, tSituation* /*s*/)
{
#if SDL_FORCEFEEDBACK
const int idx = index - 1;
//reset force feedback to zero (if set)
if(HCtx[idx]->lastForceFeedbackLevel){
gfctrlJoyConstantForce(HCtx[idx]->lastForceFeedbackIndex, 0, 0);
}
#endif
}
/*
@ -809,7 +799,6 @@ void HumanDriver::resume_race(int index, tCarElt* car, tSituation *s)
}//for i
#if SDL_FORCEFEEDBACK
//restore force feedback effect to the wheel (if was set)
if(HCtx[idx]->lastForceFeedbackLevel) {
if(cmd[CMD_LEFTSTEER].type != GFCTRL_TYPE_KEYBOARD && cmd[CMD_LEFTSTEER].type != GFCTRL_TYPE_MOUSE_AXIS){
@ -822,12 +811,10 @@ void HumanDriver::resume_race(int index, tCarElt* car, tSituation *s)
HCtx[idx]->lastForceFeedbackLevel = 0; // forget force feedback level
}
}
#endif
}
void HumanDriver::end_race(int index, tCarElt* /*car*/, tSituation* /*s*/)
{
#if SDL_FORCEFEEDBACK
const int idx = index - 1;
//reset force feedback to zero (if set)
@ -835,7 +822,6 @@ void HumanDriver::end_race(int index, tCarElt* /*car*/, tSituation* /*s*/)
gfctrlJoyConstantForce(HCtx[idx]->lastForceFeedbackIndex, 0, 0);
HCtx[idx]->lastForceFeedbackLevel = 0; // forget force feedback level
}
#endif
}
@ -1221,8 +1207,6 @@ static void common_drive(const int index, tCarElt* car, tSituation *s)
car->_steerCmd = leftSteer + rightSteer;
#if SDL_FORCEFEEDBACK
//send force feedback effect to the wheel
//dont' even try to do it if steer command is on a keyboard because it somehow manage to crash (unable to identify the joystic to send FF to?)
if(cmd[CMD_LEFTSTEER].type != GFCTRL_TYPE_KEYBOARD && cmd[CMD_LEFTSTEER].type != GFCTRL_TYPE_MOUSE_AXIS){
@ -1237,8 +1221,6 @@ static void common_drive(const int index, tCarElt* car, tSituation *s)
HCtx[idx]->lastForceFeedbackDir );
}
#endif
#define GLANCERATE 3 // speed at which the driver turns his head, ~1/3s to full glance
newGlance = car->_glance;

View file

@ -22,16 +22,13 @@ SET(_SOURCES control.cpp glfeatures.cpp guibutton.cpp guifont.cpp
guiscreen.cpp guieventloop.cpp guiapplication.cpp
musicplayer.cpp musicplayer.h
sdl2musicplayer.cpp sdl2musicplayer.h
glfeatures.h gui.h guiscreen.h guimenu.h tgfclient.h guifont.h)
glfeatures.h gui.h guiscreen.h guimenu.h tgfclient.h guifont.h
forcefeedback.cpp forcefeedback.h)
IF(OPTION_WEBSERVER)
SET(_SOURCES ${_SOURCES} webserver.cpp webserver.h)
ENDIF(OPTION_WEBSERVER)
IF(OPTION_SDL_FORCEFEEDBACK)
SET(_SOURCES ${_SOURCES} forcefeedback.cpp forcefeedback.h)
ENDIF(OPTION_SDL_FORCEFEEDBACK)
SET(_OTHER_SOURCES guimenutest.xml)
#disable developer warning

View file

@ -19,19 +19,14 @@ SET(CONFSCREENS_SOURCES ${CS}/playerconfig.cpp ${CS}/controlconfig.cpp
${CS}/displayconfig.cpp ${CS}/graphconfig.cpp ${CS}/openglconfig.cpp
${CS}/monitorconfig.cpp ${CS}/advancedgraphconfig.cpp
${CS}/simuconfig.cpp ${CS}/soundconfig.cpp ${CS}/aiconfig.cpp
${CS}/hostsettingsmenu.cpp)
${CS}/hostsettingsmenu.cpp ${CS}/forcefeedbackconfig.cpp)
SET(CONFSCREENS_HEADERS ${CS}/confscreens.h ${CS}/advancedgraphconfig.h
${CS}/playerconfig.h ${CS}/controlconfig.h
${CS}/joystickconfig.h ${CS}/mouseconfig.h
${CS}/joy2butconfig.h ${CS}/monitorconfig.h
${CS}/displayconfig.h ${CS}/graphconfig.h ${CS}/openglconfig.h
${CS}/simuconfig.h ${CS}/soundconfig.h ${CS}/aiconfig.h
${CS}/hostsettingsmenu.h)
IF(OPTION_SDL_FORCEFEEDBACK)
SET(CONFSCREENS_SOURCES ${CONFSCREENS_SOURCES} ${CS}/forcefeedbackconfig.cpp)
SET(CONFSCREENS_HEADERS ${CONFSCREENS_HEADERS} ${CS}/forcefeedbackconfig.h)
ENDIF(OPTION_SDL_FORCEFEEDBACK)
${CS}/hostsettingsmenu.h ${CS}/forcefeedbackconfig.h)
SET(RS racescreens)
SET(RACESCREENS_SOURCES ${RS}/raceselectmenu.cpp

View file

@ -31,9 +31,7 @@
#include <playerpref.h>
#include <robot.h>
#if SDL_FORCEFEEDBACK
#include <forcefeedbackconfig.h>
#endif
extern RmProgressiveTimeModifier rmProgressiveTimeModifier;
@ -168,7 +166,6 @@ rmControlsHookInit()
return pvControlsHookHandle;
}
#if SDL_FORCEFEEDBACK
// ForceFeedbackConfig hook ********************************************
static void
rmForceFeedbackConfigHookActivate(void * /* dummy */)
@ -205,7 +202,6 @@ rmForceFeedbackConfigHookInit()
return pvForceFeedbackConfigHookHandle;
}
#endif
// Quit race hook ******************************************************
static void *rmStopScrHandle = 0;
@ -413,11 +409,9 @@ RmStopRaceMenu()
buttonRole[i] = "controls";
screen[i++] = rmControlsHookInit();
#if SDL_FORCEFEEDBACK
buttonRole[i] = "forcefeedback";
screen[i++] = rmForceFeedbackConfigHookInit();
break;
#endif
}
}
#endif