From 0be25a41ca793c3c03814f529890492adfac8ad5 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Thu, 9 Nov 2017 22:50:32 +0300 Subject: Resolve weird crash caused by Tetris inside ADLMIDI2 and other changes - Move most of inline classes methods into own CC file - Move Input into own header with own CC file to share it with the puzzle game - Created virtual destructors and resolved weak vtable trouble between of Tetris's classes - Remove static declarisons of Tetris class. Instead, let it be member of UserInterface - Fixed forgot note-offs while sorting events row with zero length notes - Fixed crash caused by unsafe access by reference to element of array that was modified/reallocated one or multiple times - Stabilize dealing with zero-length notes --- utils/adlmidi-2/input.hpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 utils/adlmidi-2/input.hpp (limited to 'utils/adlmidi-2/input.hpp') diff --git a/utils/adlmidi-2/input.hpp b/utils/adlmidi-2/input.hpp new file mode 100644 index 0000000..dba4229 --- /dev/null +++ b/utils/adlmidi-2/input.hpp @@ -0,0 +1,46 @@ +#ifndef _WIN32 +#include +#endif + +#ifdef _WIN32 +# include +# define WIN32_LEAN_AND_MEAN +# ifndef NOMINMAX +# define NOMINMAX //To don't damage std::min and std::max +# endif +# include +#endif + +#ifdef __DJGPP__ +#include +#include +#include +#include +#include +#include +#include +#define BIOStimer _farpeekl(_dos_ds, 0x46C) +static const unsigned NewTimerFreq = 209; +#elif !defined(_WIN32) || defined(__CYGWIN__) +# include +# include +# include +# include +#endif + +class xInput +{ + #ifdef _WIN32 + void *inhandle; + #endif + #if (!defined(_WIN32) || defined(__CYGWIN__)) && !defined(__DJGPP__) + struct termio back; + #endif +public: + xInput(); + ~xInput(); + + char PeekInput(); +}; + +extern xInput Input; -- cgit v1.2.3