1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-25 09:44:02 +00:00

Fix some things/typos that were overlooked

This commit is contained in:
fgenesis 2016-08-07 05:20:04 +02:00
parent 812dc7dd7f
commit 7b702673fe
6 changed files with 27 additions and 40 deletions

View file

@ -1728,19 +1728,6 @@ void DSQ::toggleVersionLabel(bool on)
versionLabel->alpha.interpolateTo(a, 1);
}
void DSQ::toggleInputMode()
{
switch(inputMode)
{
case INPUT_MOUSE:
setInputMode(INPUT_JOYSTICK);
break;
case INPUT_JOYSTICK:
setInputMode(INPUT_MOUSE);
break;
}
}
void DSQ::setInputMode(InputMode mode)
{
inputMode = mode;
@ -1840,11 +1827,6 @@ int DSQ::getEntityTypeIndexByName(std::string s)
return -1;
}
void DSQ::toggleMuffleSound(bool toggle)
{
}
void DSQ::loadModsCallback(const std::string &filename, intptr_t param)
{
@ -2797,17 +2779,13 @@ void DSQ::createSaveSlotPage()
addRenderObject(saveSlots[i], LR_FILEMENU);
}
if (inputMode == INPUT_JOYSTICK)
{
saveSlots[0]->setDirMove(DIR_RIGHT, arrowUp);
saveSlots[1]->setDirMove(DIR_RIGHT, arrowUp);
saveSlots[2]->setDirMove(DIR_RIGHT, arrowDown);
saveSlots[3]->setDirMove(DIR_RIGHT, cancel);
arrowDown->setDirMove(DIR_DOWN, cancel);
cancel->setDirMove(DIR_UP, arrowDown);
cancel->setDirMove(DIR_LEFT, saveSlots[3]);
}
saveSlots[0]->setDirMove(DIR_RIGHT, arrowUp);
saveSlots[1]->setDirMove(DIR_RIGHT, arrowUp);
saveSlots[2]->setDirMove(DIR_RIGHT, arrowDown);
saveSlots[3]->setDirMove(DIR_RIGHT, cancel);
arrowDown->setDirMove(DIR_DOWN, cancel);
cancel->setDirMove(DIR_UP, arrowDown);
cancel->setDirMove(DIR_LEFT, saveSlots[3]);
}
void DSQ::nextSaveSlotPage()

View file

@ -283,8 +283,6 @@ public:
bool modIsSelected;
void toggleMuffleSound(bool toggle);
void toggleInputMode();
void shakeCamera(float mag, float time);
Vector avStart;
Entity *getEntityByName(const std::string &name);

View file

@ -8230,17 +8230,28 @@ luaFunc(getInputMode)
luaReturnInt(dsq->inputMode);
}
static Joystick *_getJoystick(lua_State *L, int idx = 1)
{
int source = lua_tointeger(L, idx) - 1;
if(source < 0)
return core->getJoystick(0); // HACK: FIXME: do something sensible instead
return core->getJoystickForSourceID(source);
}
luaFunc(getJoystickAxisLeft)
{
Vector v;// = core->joystick.position;
assert(false); // FIXME
Vector v;
if(Joystick *j = _getJoystick(L))
v = j->position;
luaReturnVec2(v.x, v.y);
}
luaFunc(getJoystickAxisRight)
{
Vector v;// = core->joystick.rightStick;
assert(false); // FIXME
Vector v;
if(Joystick *j = _getJoystick(L))
v = j->rightStick;
luaReturnVec2(v.x, v.y);
}

View file

@ -3059,9 +3059,9 @@ void Core::clearActionButtons()
actionStatus.clear();
}
Joystick *Core::getJoystickForSourceID(unsigned sourceID)
Joystick *Core::getJoystickForSourceID(int sourceID)
{
if(sourceID < (unsigned)actionStatus.size())
return getJoystick(actionStatus[sourceID]->getJoystickID());
if(unsigned(sourceID+1) < (unsigned)actionStatus.size())
return getJoystick(actionStatus[sourceID+1]->getJoystickID());
return NULL;
}

View file

@ -564,7 +564,7 @@ public:
Joystick *getJoystick(int idx); // warning: may return NULL/contain holes
// not the actual number of joysticks!
size_t getNumJoysticks() const { return joysticks.size(); }
Joystick *getJoystickForSourceID(unsigned sourceID);
Joystick *getJoystickForSourceID(int sourceID);
private:
std::vector<Joystick*> joysticks;
};

View file

@ -64,7 +64,7 @@
#define KEY_G SDL_SCANCODE_G
#define KEY_H SDL_SCANCODE_H
#define KEY_I SDL_SCANCODE_I
#define KEY_J SDL_SCANCODE_K
#define KEY_J SDL_SCANCODE_J
#define KEY_K SDL_SCANCODE_K
#define KEY_L SDL_SCANCODE_L
#define KEY_M SDL_SCANCODE_M