X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fmike.c;h=850c09a6421b1de38d7480327dae2192d7d0bc68;hp=fda18fee5e0da1fad2928a8d995e66ae95160d50;hb=72d7a7e585ed1f35916750ca20e75fdee3141f3c;hpb=95e7797c2bb32a62fada629877a75b86bcf1aba9 diff --git a/src/mike.c b/src/mike.c index fda18fe..850c09a 100644 --- a/src/mike.c +++ b/src/mike.c @@ -141,16 +141,18 @@ static void convert32To16(unsigned int *src32, unsigned short *dst16, unsigned i /* Scale normal with depth and unpack R component (horizontal component) */ static void processNormal() { int scanline; - unsigned int *normalmap = (unsigned int*)background; - normalmap += NORMALMAP_SCANLINE * backgroundW; - unsigned short *dst = normalmap; - displacementMap = (short*)dst; - short *dst2 = displacementMap; float scale; int i; int x; short maxDisplacement = 0; short minDisplacement = 256; + unsigned short *dst; + short *dst2; + unsigned int *normalmap = (unsigned int*)background; + normalmap += NORMALMAP_SCANLINE * backgroundW; + dst = (unsigned short*)normalmap; + displacementMap = (short*)dst; + dst2 = displacementMap; for (scanline = 0; scanline < REFLECTION_HEIGHT; scanline++) { scale = 2.0f - (float)scanline / ((float)REFLECTION_HEIGHT - 1); @@ -203,4 +205,4 @@ static void updateScrollTables(float dt) { scrollTable[i] += scrollSpeedTable[i] * dt; scrollTableRounded[i] = (int)(scrollTable[i] + 0.5f) % scrollModTable[i]; } -} \ No newline at end of file +}