aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-31 17:15:45 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-31 17:15:45 -0800
commitac0972ebf6cb8ff17f1bbbf01526d29fd2d2f420 (patch)
tree499dd06881cddf43520b40cc62b51276ca411c60 /src/library_sdl.js
parent64c779641a2a9587613cc65ad7251890f18e25c3 (diff)
parent375eb145c8a6c1627a8b93f81d40fd1aa7fc899b (diff)
Merge branch 'incoming'
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r--src/library_sdl.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 712ec290..cfab6410 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -483,7 +483,7 @@ var LibrarySDL = {
// correct.
SDL.buttonState |= 1 << event.button;
} else if (event.type == 'mouseup') {
- SDL.buttonState = 0;
+ SDL.buttonState &= ~(1 << event.button);
}
// fall through
case 'mousemove': {
@@ -883,7 +883,7 @@ var LibrarySDL = {
SDL_GetMouseState: function(x, y) {
if (x) {{{ makeSetValue('x', '0', 'SDL.mouseX', 'i32') }}};
if (y) {{{ makeSetValue('y', '0', 'SDL.mouseY', 'i32') }}};
- return 0;
+ return SDL.buttonState;
},
SDL_WarpMouse: function(x, y) {
@@ -1260,9 +1260,9 @@ var LibrarySDL = {
// Get the audio element associated with the ID
var info = SDL.audios[id];
- if (!info) return 0;
+ if (!info) return -1;
var audio = info.audio;
- if (!audio) return 0;
+ if (!audio) return -1;
// If the user asks us to allocate a channel automatically, get the first
// free one.