Update gameloop so it sets gear to neutral on shutdown. Add enum for gears.

This commit is contained in:
Paul Dino Jones 2024-08-06 10:06:24 -04:00
parent aff76a3dd9
commit fda4c0dbcd
2 changed files with 18 additions and 3 deletions

View File

@ -223,7 +223,7 @@ int clilooper(SimDevice* devices, int numdevices, Parameters* p, SimData* simdat
simdata->velocity = 0;
simdata->rpms = 100;
simdata->gear = -1;
simdata->gear = MONOCOQUE_GEAR_NEUTRAL;
for (int x = 0; x < numdevices; x++)
{
if (devices[x].initialized == true)
@ -338,7 +338,7 @@ int tester(SimDevice* devices, int numdevices)
tcsetattr(0, TCSANOW, &newsettings);
fprintf(stdout, "\n");
simdata->gear = 0;
simdata->gear = MONOCOQUE_GEAR_NEUTRAL;
simdata->velocity = 16;
simdata->rpms = 100;
simdata->maxrpm = 8000;
@ -543,7 +543,7 @@ int tester(SimDevice* devices, int numdevices)
simdata->velocity = 0;
simdata->rpms = 100;
simdata->gear = -1;
simdata->gear = MONOCOQUE_GEAR_NEUTRAL;
for (int x = 0; x < numdevices; x++)
{
if (devices[x].initialized == true)

View File

@ -72,6 +72,21 @@ typedef enum
}
MotorPosition;
typedef enum
{
MONOCOQUE_GEAR_REVERSE = 0,
MONOCOQUE_GEAR_NEUTRAL = 1,
MONOCOQUE_GEAR_ONE = 2,
MONOCOQUE_GEAR_TWO = 3,
MONOCOQUE_GEAR_THREE = 4,
MONOCOQUE_GEAR_FOUR = 5,
MONOCOQUE_GEAR_FIVE = 6,
MONOCOQUE_GEAR_SIX = 7,
MONOCOQUE_GEAR_SEVEN = 8,
MONOCOQUE_GEAR_EIGHT = 9,
}
MonocoqueGear;
typedef enum
{
MONOCOQUE_ERROR_NONE = 0,