From 1f7482d8330ae0bfd558a13b6a71213c654d9550 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 19 Apr 2015 22:01:42 +0200 Subject: [PATCH] (Emscripten) Integrate header files into actual drivers --- audio/drivers/rwebaudio.c | 16 ++++++++++++++-- camera/drivers/rwebcam.c | 11 ++++++++++- emscripten/RWebAudio.h | 28 ---------------------------- emscripten/RWebCam.h | 24 ------------------------ emscripten/RWebInput.h | 29 ----------------------------- input/drivers/rwebinput_input.c | 16 ++++++++++++++-- 6 files changed, 38 insertions(+), 86 deletions(-) delete mode 100644 emscripten/RWebAudio.h delete mode 100644 emscripten/RWebCam.h delete mode 100644 emscripten/RWebInput.h diff --git a/audio/drivers/rwebaudio.c b/audio/drivers/rwebaudio.c index 803e84c251..702e648183 100644 --- a/audio/drivers/rwebaudio.c +++ b/audio/drivers/rwebaudio.c @@ -13,11 +13,23 @@ * If not, see . */ +#include +#include +#include + #include "../../driver.h" #include "../../general.h" -#include "../../emscripten/RWebAudio.h" - +/* forward declarations */ +unsigned RWebAudioSampleRate(void); +void *RWebAudioInit(unsigned latency); +ssize_t RWebAudioWrite(const void *buf, size_t size); +bool RWebAudioStop(void); +bool RWebAudioStart(void); +void RWebAudioSetNonblockState(bool state); +void RWebAudioFree(void); +size_t RWebAudioWriteAvail(void); +size_t RWebAudioBufferSize(void); static bool rwebaudio_is_paused; static void rwebaudio_free(void *data) diff --git a/camera/drivers/rwebcam.c b/camera/drivers/rwebcam.c index be2437521e..99355355bc 100644 --- a/camera/drivers/rwebcam.c +++ b/camera/drivers/rwebcam.c @@ -13,8 +13,17 @@ * If not, see . */ +#include +#include #include "../../driver.h" -#include "../../emscripten/RWebCam.h" + +/* forward declarations */ +void *RWebCamInit(uint64_t caps, unsigned width, unsigned height); +void RWebCamFree(void *data); +bool RWebCamStart(void *data); +void RWebCamStop(void *data); +bool RWebCamPoll(void *data, retro_camera_frame_raw_framebuffer_t frame_raw_cb, + retro_camera_frame_opengl_texture_t frame_gl_cb); static void *rwebcam_init(const char *device, uint64_t caps, unsigned width, unsigned height) diff --git a/emscripten/RWebAudio.h b/emscripten/RWebAudio.h deleted file mode 100644 index ebce08d1f1..0000000000 --- a/emscripten/RWebAudio.h +++ /dev/null @@ -1,28 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2012-2015 - Michael Lelli - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#include -#include -#include - -unsigned RWebAudioSampleRate(void); -void *RWebAudioInit(unsigned latency); -ssize_t RWebAudioWrite(const void *buf, size_t size); -bool RWebAudioStop(void); -bool RWebAudioStart(void); -void RWebAudioSetNonblockState(bool state); -void RWebAudioFree(void); -size_t RWebAudioWriteAvail(void); -size_t RWebAudioBufferSize(void); diff --git a/emscripten/RWebCam.h b/emscripten/RWebCam.h deleted file mode 100644 index 25c343afd9..0000000000 --- a/emscripten/RWebCam.h +++ /dev/null @@ -1,24 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2012-2015 - Michael Lelli - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#include -#include -#include "../driver.h" - -void *RWebCamInit(uint64_t caps, unsigned width, unsigned height); -void RWebCamFree(void *data); -bool RWebCamStart(void *data); -void RWebCamStop(void *data); -bool RWebCamPoll(void *data, retro_camera_frame_raw_framebuffer_t frame_raw_cb, retro_camera_frame_opengl_texture_t frame_gl_cb); diff --git a/emscripten/RWebInput.h b/emscripten/RWebInput.h deleted file mode 100644 index 923b7ed759..0000000000 --- a/emscripten/RWebInput.h +++ /dev/null @@ -1,29 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2012-2015 - Michael Lelli - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#include - -typedef struct rwebinput_state -{ - uint8_t keys[32]; - int mouse_x; - int mouse_y; - char mouse_l; - char mouse_r; -} rwebinput_state_t; - -int RWebInputInit(void); -rwebinput_state_t *RWebInputPoll(int context); -void RWebInputDestroy(int context); diff --git a/input/drivers/rwebinput_input.c b/input/drivers/rwebinput_input.c index e72422a7e3..317659730e 100644 --- a/input/drivers/rwebinput_input.c +++ b/input/drivers/rwebinput_input.c @@ -19,13 +19,25 @@ #include "../../driver.h" +#include #include #include "../../general.h" #include "../keyboard_line.h" - -#include "../../emscripten/RWebInput.h" #include "../input_joypad.h" +typedef struct rwebinput_state +{ + uint8_t keys[32]; + int mouse_x; + int mouse_y; + char mouse_l; + char mouse_r; +} rwebinput_state_t; + +int RWebInputInit(void); +rwebinput_state_t *RWebInputPoll(int context); +void RWebInputDestroy(int context); + static bool uninited = false; typedef struct rwebinput_input