Fix SDL_SetColors && SDL_envets
This commit is contained in:
Родитель
c45cd7c72a
Коммит
2247ff845f
|
@ -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;
|
||||
|
|
|
@ -55,6 +55,7 @@ extern "C" {
|
|||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_NOEVENT = 0,
|
||||
SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */
|
||||
|
||||
/* Application events */
|
||||
|
|
|
@ -42,7 +42,7 @@ int main() {
|
|||
//changing green color
|
||||
//to yellow
|
||||
pal[1].r = 255;
|
||||
SDL_SetColors(screen, pal, 1, 1);
|
||||
SDL_SetColors(screen, &pal[1], 1, 1);
|
||||
|
||||
{
|
||||
SDL_Rect rect = { 300, 200, 300, 200 };
|
||||
|
|
Загрузка…
Ссылка в новой задаче