From 396c12ee73193f4ac3665ecac2f634fc0b046697 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Thu, 8 Dec 2011 16:46:21 +0000 Subject: Fixes for unsafe string handling, variable scoping errors. --- nGenEx/Color.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nGenEx/Color.cpp') diff --git a/nGenEx/Color.cpp b/nGenEx/Color.cpp index 41657eb..05f5fa2 100644 --- a/nGenEx/Color.cpp +++ b/nGenEx/Color.cpp @@ -465,11 +465,11 @@ Color::SetPalette(PALETTEENTRY* pal, int palsize, BYTE* invpal) palette[i] = pal[i]; if (invpal) { - for (i = 0; i < 32768; i++) + for (int i = 0; i < 32768; i++) table[i] = invpal[i]; } else { - for (i = 0; i < 32768; i++) { + for (int i = 0; i < 32768; i++) { BYTE r = (i >> 10) & 0x1f; BYTE g = (i >> 5) & 0x1f; BYTE b = (i ) & 0x1f; @@ -483,7 +483,7 @@ Color::SetPalette(PALETTEENTRY* pal, int palsize, BYTE* invpal) // set up formatted palette: UseFormat(format); - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) UseTextureFormat(texture_format[i], i); // set up shade table: @@ -603,8 +603,8 @@ Color::SaveShadeTable(const char* basename) BYTE clut[256*256]; BYTE* pc = clut; - - for (int i = 0; i < SHADE_LEVELS*2; i++) + int i; + for (i = 0; i < SHADE_LEVELS*2; i++) for (int j = 0; j < 256; j++) *pc++ = (BYTE) ColorIndex::shade_table[i*256+j]; -- cgit v1.1