Created
March 26, 2012 12:58
-
-
Save anonymous/2204882 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int y = 0; y < 13; ++y) | |
{ | |
for(int x = 0; x < 13; ++x) | |
{ | |
Uint8 pixelOffset = _ufoTopView->getPixel(x, y); | |
if(pixelOffset == 0) | |
{ | |
continue; | |
} | |
else | |
{ | |
Uint8 radarPixelColor = _window->getPixel(_ufoTopView->getX() + x + 4, _ufoTopView->getY() + y + 4); | |
//std::cout << (unsigned int)radarPixelColor << "\n"; | |
SDL_Color rc = winpal[radarPixelColor]; | |
int colorNo = 0; | |
for(colorNo = Palette::blockOffset(7); colorNo < Palette::blockOffset(7) + 16; ++colorNo) | |
{ | |
SDL_Color bc = batpal[colorNo]; | |
if(bc.r == rc.r) | |
{ | |
break; | |
} | |
} | |
Uint8 color = colorNo - pixelOffset; | |
_battle->setPixel(_ufoTopView->getX() + x, _ufoTopView->getY() + y, color); | |
} | |
} | |
//std::cout << "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment