mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
4e26c8afa5
## Link to GitHub Issue, if one exists n/a ## Description of change Add plug&play hooks for RGB camera in DRS. ## Testing Seems to work with my crappy Logitech C270 Camera options (brightness etc) seem to work in test menu as well). Tested by another user with realsense camera + logitech camera, both cams were detected correctly.
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "games/game.h"
|
|
#include "touch/touch.h"
|
|
|
|
namespace games::drs {
|
|
|
|
enum DRS_TOUCH_TYPE {
|
|
DRS_DOWN = 0,
|
|
DRS_UP = 1,
|
|
DRS_MOVE = 2,
|
|
};
|
|
|
|
typedef struct drs_touch {
|
|
int type = DRS_UP;
|
|
int id = 0;
|
|
double x = 0.0;
|
|
double y = 0.0;
|
|
double width = 1;
|
|
double height = 1;
|
|
} drs_touch_t;
|
|
|
|
#define DRS_TAPELED_ROWS 49
|
|
#define DRS_TAPELED_COLS 38
|
|
#define DRS_TAPELED_COLS_TOTAL (DRS_TAPELED_ROWS * DRS_TAPELED_COLS)
|
|
|
|
// each r,g,b value is stored in a char but 215 is the highest you'll see from the game at 100% brightness in the test menu
|
|
#define DRS_TAPELED_MAX_VAL 215
|
|
|
|
extern char DRS_TAPELED[DRS_TAPELED_COLS_TOTAL][3];
|
|
extern std::vector<TouchEvent> TOUCH_EVENTS;
|
|
extern bool DISABLE_TOUCH;
|
|
extern bool TRANSPOSE_TOUCH;
|
|
extern bool RGB_CAMERA_HOOK;
|
|
|
|
void fire_touches(drs_touch_t *events, size_t event_count);
|
|
void start_touch();
|
|
|
|
class DRSGame : public games::Game {
|
|
public:
|
|
DRSGame();
|
|
virtual void attach() override;
|
|
virtual void detach() override;
|
|
};
|
|
}
|