mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-23 20:09:46 +03:00
SDL/WASM Port
This commit is contained in:
committed by
iProgramInCpp
parent
0b16b2843a
commit
0fbe90752d
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "Controller.hpp"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
bool Controller::isTouchedValues[2];
|
||||
float Controller::stickValuesX[2];
|
||||
float Controller::stickValuesY[2];
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "ControllerTurnInput.hpp"
|
||||
#include "Controller.hpp"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
ITurnInput::Delta ControllerTurnInput::getTurnDelta()
|
||||
{
|
||||
bool isTouched = Controller::isTouched(m_stickNo);
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
/********************************************************************
|
||||
Minecraft: Pocket Edition - Decompilation Project
|
||||
Copyright (C) 2023 iProgramInCpp
|
||||
|
||||
|
||||
The following code is licensed under the BSD 1 clause license.
|
||||
SPDX-License-Identifier: BSD-1-Clause
|
||||
********************************************************************/
|
||||
|
||||
#include "Keyboard.hpp"
|
||||
|
||||
#include "GameMods.hpp"
|
||||
|
||||
std::vector<Keyboard::Input> Keyboard::_inputs;
|
||||
int Keyboard::_index = -1;
|
||||
int Keyboard::_states[256];
|
||||
int Keyboard::_states[KEYBOARD_STATES_SIZE];
|
||||
|
||||
void Keyboard::feed(int down, int key)
|
||||
{
|
||||
#ifndef ORIGINAL_CODE
|
||||
// Prevent Crashes
|
||||
if (key >= KEYBOARD_STATES_SIZE || key < 0) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
Input i;
|
||||
i.field_0 = down;
|
||||
i.field_4 = uint8_t(key);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/********************************************************************
|
||||
Minecraft: Pocket Edition - Decompilation Project
|
||||
Copyright (C) 2023 iProgramInCpp
|
||||
|
||||
|
||||
The following code is licensed under the BSD 1 clause license.
|
||||
SPDX-License-Identifier: BSD-1-Clause
|
||||
********************************************************************/
|
||||
@@ -9,6 +9,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
#define KEYBOARD_STATES_SIZE 256
|
||||
|
||||
class Keyboard
|
||||
{
|
||||
@@ -21,7 +24,7 @@ public:
|
||||
};
|
||||
|
||||
static std::vector<Input> _inputs;
|
||||
static int _states[256];
|
||||
static int _states[KEYBOARD_STATES_SIZE];
|
||||
static int _index;
|
||||
|
||||
// likely inlined
|
||||
|
||||
Reference in New Issue
Block a user