@@ -1,6 +1,7 @@ | |||||
- [X] Improve logging (remove SDL/lws dependency) | - [X] Improve logging (remove SDL/lws dependency) | ||||
- [X] Unify memset/memcpy/free/malloc functions (remove SDL/lws dependency) | - [X] Unify memset/memcpy/free/malloc functions (remove SDL/lws dependency) | ||||
- [ ] Revisit unit tests | - [ ] Revisit unit tests | ||||
- [ ] Implement character sprites + animations | |||||
- [ ] Implement memory pool | - [ ] Implement memory pool | ||||
- [ ] Fix gamepad mapping | - [ ] Fix gamepad mapping | ||||
- [ ] Provide default mapping | - [ ] Provide default mapping | ||||
@@ -1,32 +1,9 @@ | |||||
#ifndef PORTMIDI_MOCK_H | #ifndef PORTMIDI_MOCK_H | ||||
#define PORTMIDI_MOCK_H | #define PORTMIDI_MOCK_H | ||||
#define PORTMIDI_INCLUDED | |||||
#include <portmidi.h> | |||||
#include "../../../src/packages/common/IZ_common.h" | #include "../../../src/packages/common/IZ_common.h" | ||||
typedef i32 PmDeviceID; | |||||
typedef void PortMidiStream; | |||||
typedef i32 PmTimestamp; | |||||
typedef PmTimestamp (*PmTimeProcPtr)(void *time_info); | |||||
typedef i32 PmMessage; | |||||
typedef struct { | |||||
PmMessage message; | |||||
PmTimestamp timestamp; | |||||
} PmEvent; | |||||
typedef struct { | |||||
int structVersion; /**< @brief this internal structure version */ | |||||
const char *interf; /**< @brief underlying MIDI API, e.g. | |||||
"MMSystem" or "DirectX" */ | |||||
char *name; /**< @brief device name, e.g. "USB MidiSport 1x1" */ | |||||
int input; /**< @brief true iff input is available */ | |||||
int output; /**< @brief true iff output is available */ | |||||
int opened; /**< @brief used by generic PortMidi for error checking */ | |||||
int is_virtual; /**< @brief true iff this is/was a virtual device */ | |||||
} PmDeviceInfo; | |||||
#define PmStream PortMidiStream | |||||
static PmDeviceInfo MOCK_DEVICE_INFO = { | static PmDeviceInfo MOCK_DEVICE_INFO = { | ||||
.output = 1, | .output = 1, | ||||
.input = 1, | .input = 1, | ||||
@@ -3,7 +3,7 @@ | |||||
#include "../../common/IZ_common.h" | #include "../../common/IZ_common.h" | ||||
#define IZ_CONTROLS (unsigned char) 16 | |||||
#define IZ_CONTROLS ((u8) 16) | |||||
typedef u16 IZ_Action; | typedef u16 IZ_Action; | ||||
@@ -5,6 +5,7 @@ | |||||
#include <SDL_gamecontroller.h> | #include <SDL_gamecontroller.h> | ||||
#include <SDL_events.h> | #include <SDL_events.h> | ||||
#include <minIni.h> | #include <minIni.h> | ||||
#include "../../common/IZ_common.h" | |||||
#include "../../config/IZ_config.h" | #include "../../config/IZ_config.h" | ||||
#include "../../stdinc/IZ_string.h" | #include "../../stdinc/IZ_string.h" | ||||
#include "../../stdinc/IZ_stdlib.h" | #include "../../stdinc/IZ_stdlib.h" | ||||
@@ -12,7 +13,7 @@ | |||||
typedef u8 IZ_PadButton; | typedef u8 IZ_PadButton; | ||||
static const u16 IZ_DEFAULT_AXIS_THRESHOLD = 8000; | |||||
#define IZ_DEFAULT_AXIS_THRESHOLD ((u16) 8000) | |||||
typedef enum { | typedef enum { | ||||
IZ_JOY_AXIS_DIRECTION_HORIZONTAL1 = 0, | IZ_JOY_AXIS_DIRECTION_HORIZONTAL1 = 0, | ||||
@@ -56,7 +57,7 @@ static const IZ_JoystickState IZ_JOYSTICK_DEFAULT_STATE[IZ_PLAYERS] = { | |||||
13, | 13, | ||||
14, | 14, | ||||
}, | }, | ||||
.axis_threshold = 8000u, | |||||
.axis_threshold = IZ_DEFAULT_AXIS_THRESHOLD, | |||||
.device_id = 0, | .device_id = 0, | ||||
.guid = { | .guid = { | ||||
.data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } | .data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } | ||||
@@ -2,11 +2,7 @@ | |||||
#define IZ_MIDI_H | #define IZ_MIDI_H | ||||
#include <string.h> | #include <string.h> | ||||
#ifndef PORTMIDI_INCLUDED | |||||
#define PORTMIDI_INCLUDED | |||||
#include <portmidi.h> | #include <portmidi.h> | ||||
#endif | |||||
#include <minIni.h> | #include <minIni.h> | ||||
#include "../../config/IZ_config.h" | #include "../../config/IZ_config.h" | ||||