mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-10 18:54:21 +02:00
Update to v094r24 release.
byuu says: Finally!! Compilation works once again on Windows. However, it's pretty buggy. Modality isn't really working right, you can still poke at other windows, but when you select ListView items, they redraw as empty boxes (need to process WM_DRAWITEM before checking modality.) The program crashes when you close it (probably a ruby driver's term() function, that's what it usually is.) The Layout::setEnabled(false) call isn't working right, so you get that annoying chiming sound and cursor movement when mapping keyboard keys to game inputs. The column sizing seems off a bit on first display for the Hotkeys tab. And probably lots more.
This commit is contained in:
@@ -3,18 +3,18 @@
|
||||
|
||||
namespace ruby {
|
||||
|
||||
LRESULT CALLBACK RawInputWindowProc(HWND, UINT, WPARAM, LPARAM);
|
||||
auto CALLBACK RawInputWindowProc(HWND, UINT, WPARAM, LPARAM) -> LRESULT;
|
||||
|
||||
struct RawInput {
|
||||
HANDLE mutex;
|
||||
HWND hwnd;
|
||||
HANDLE mutex = nullptr;
|
||||
HWND hwnd = nullptr;
|
||||
bool ready = false;
|
||||
bool initialized = false;
|
||||
function<void (RAWINPUT*)> updateKeyboard;
|
||||
function<void (RAWINPUT*)> updateMouse;
|
||||
|
||||
struct Device {
|
||||
HANDLE handle;
|
||||
HANDLE handle = nullptr;
|
||||
string path;
|
||||
enum class Type : unsigned { Keyboard, Mouse, Joypad } type;
|
||||
uint16_t vendorID = 0;
|
||||
@@ -23,14 +23,14 @@ struct RawInput {
|
||||
};
|
||||
vector<Device> devices;
|
||||
|
||||
maybe<Device&> find(uint16_t vendorID, uint16_t productID) {
|
||||
auto find(uint16_t vendorID, uint16_t productID) -> maybe<Device&> {
|
||||
for(auto& device : devices) {
|
||||
if(device.vendorID == vendorID && device.productID == productID) return device;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
void scanDevices() {
|
||||
auto scanDevices() -> void {
|
||||
devices.reset();
|
||||
|
||||
unsigned deviceCount = 0;
|
||||
@@ -79,7 +79,7 @@ struct RawInput {
|
||||
delete[] list;
|
||||
}
|
||||
|
||||
LRESULT windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
||||
auto windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -> LRESULT {
|
||||
if(msg != WM_INPUT) return DefWindowProc(hwnd, msg, wparam, lparam);
|
||||
|
||||
unsigned size = 0;
|
||||
@@ -102,7 +102,7 @@ struct RawInput {
|
||||
return result;
|
||||
}
|
||||
|
||||
void main() {
|
||||
auto main() -> void {
|
||||
WNDCLASS wc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
@@ -148,12 +148,12 @@ struct RawInput {
|
||||
|
||||
static RawInput rawinput;
|
||||
|
||||
DWORD WINAPI RawInputThreadProc(void*) {
|
||||
auto WINAPI RawInputThreadProc(void*) -> DWORD {
|
||||
rawinput.main();
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CALLBACK RawInputWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
||||
auto CALLBACK RawInputWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -> LRESULT {
|
||||
return rawinput.windowProc(hwnd, msg, wparam, lparam);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user