aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-11-06 11:56:14 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-11-06 11:56:14 -0800
commit7f870cf9c357f6a1138ba612ace7d7249f85e250 (patch)
treeb39b3c6cb644b5c20936de1bae7833c0b95173c7 /src
parent663075274d30ae406734e7eb5ef8b07c9340e9a6 (diff)
parent2247ff845fa862a35fc9d1acf8150eb7e56f41ac (diff)
Merge pull request #1748 from caiiiycuk/fix_sdl_colors
Fix SDL_SetColors && SDL_envets
Diffstat (limited to 'src')
-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 0cf6c97a..5b43b7ab 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -1237,11 +1237,11 @@ var LibrarySDL = {
surfData.colors = new Uint8Array(256 * 3); //256 RGB colors
}
- for (var i = firstColor; i < firstColor + nColors; i++) {
- var index = i *3;
+ for (var i = 0; i < nColors; ++i) {
+ var index = (firstColor + i) * 3;
surfData.colors[index] = {{{ makeGetValue('colors', 'i*4', 'i8', null, true) }}};
- surfData.colors[index +1] = {{{ makeGetValue('colors', 'i*4 +1', 'i8', null, true) }}};
- surfData.colors[index +2] = {{{ makeGetValue('colors', 'i*4 +2', 'i8', null, true) }}};
+ surfData.colors[index + 1] = {{{ makeGetValue('colors', 'i*4 + 1', 'i8', null, true) }}};
+ surfData.colors[index + 2] = {{{ makeGetValue('colors', 'i*4 + 2', 'i8', null, true) }}};
}
return 1;