aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
authorAleksander Guryanov <caiiiycuk@gmail.com>2013-10-30 18:18:29 +0700
committerAleksander Guryanov <caiiiycuk@gmail.com>2013-10-30 18:18:29 +0700
commit2247ff845fa862a35fc9d1acf8150eb7e56f41ac (patch)
tree3f6d7354662d007fd822c5fdd9e638b7d6a7ab62 /src/library_sdl.js
parentc45cd7c72a019f54b0f6ee873641200ecb043a25 (diff)
Fix SDL_SetColors && SDL_envets
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 e652dfc8..024f0c35 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -1231,11 +1231,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;