Fix the twin ball elevator
svn-id: r4020
This commit is contained in:
parent
eb773b477a
commit
db2e803831
3 changed files with 8 additions and 70 deletions
|
@ -702,6 +702,9 @@ void CostumeRenderer::proc_special(Actor *a, byte mask2)
|
||||||
byte shadow4;
|
byte shadow4;
|
||||||
byte shadow5;
|
byte shadow5;
|
||||||
|
|
||||||
|
if(a->costume==153) //Samnmax elevator FIXME
|
||||||
|
return;
|
||||||
|
|
||||||
shadow1=a->shadow_mode & 0x80;
|
shadow1=a->shadow_mode & 0x80;
|
||||||
shadow2=a->shadow_mode & 0x40;
|
shadow2=a->shadow_mode & 0x40;
|
||||||
shadow3=a->shadow_mode & 0x20;
|
shadow3=a->shadow_mode & 0x20;
|
||||||
|
@ -761,7 +764,7 @@ void CostumeRenderer::proc_special(Actor *a, byte mask2)
|
||||||
{
|
{
|
||||||
pcolor=_vm->_proc_special_palette[*dst];
|
pcolor=_vm->_proc_special_palette[*dst];
|
||||||
}
|
}
|
||||||
proc_special_end:; *dst = pcolor;
|
proc_special_end:; *dst = pcolor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dst += 320;
|
dst += 320;
|
||||||
|
|
70
gfx.cpp
70
gfx.cpp
|
@ -2641,131 +2641,67 @@ CHECK_HEAP;
|
||||||
|
|
||||||
|
|
||||||
void Scumm::createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, int16 colorMin, int16 colorMax)
|
void Scumm::createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, int16 colorMin, int16 colorMax)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
byte *palPtr;
|
byte *palPtr;
|
||||||
|
|
||||||
byte *curPtr;
|
byte *curPtr;
|
||||||
|
|
||||||
byte *searchPtr;
|
byte *searchPtr;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
byte colorComp1;
|
byte colorComp1;
|
||||||
|
|
||||||
byte colorComp2;
|
byte colorComp2;
|
||||||
|
|
||||||
byte colorComp3;
|
byte colorComp3;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
byte searchComp1;
|
byte searchComp1;
|
||||||
|
|
||||||
byte searchComp2;
|
byte searchComp2;
|
||||||
|
|
||||||
byte searchComp3;
|
byte searchComp3;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
short int bestResult;
|
short int bestResult;
|
||||||
|
|
||||||
short int currentResult;
|
short int currentResult;
|
||||||
|
|
||||||
byte currentIndex;
|
byte currentIndex;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
palPtr = getPalettePtr();
|
palPtr = getPalettePtr();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(i=colorMin;i<colorMax;i++)
|
for(i=colorMin;i<colorMax;i++)
|
||||||
|
|
||||||
_proc_special_palette[i]=i;
|
_proc_special_palette[i]=i;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
curPtr = palPtr + colorMin*3;
|
curPtr = palPtr + colorMin*3;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(i=colorMin;i<colorMax;i++)
|
for(i=colorMin;i<colorMax;i++)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
//colorComp1=((((*curPtr++)>>2)*c)>>8)&0x7F;
|
||||||
/* colorComp1=((((*curPtr++)>>2)*c)>>8)&0x7F;
|
//colorComp2=((((*curPtr++)>>2)*d)>>8)&0x7F;
|
||||||
|
//colorComp3=((((*curPtr++)>>2)*e)>>8)&0x7F;
|
||||||
colorComp2=((((*curPtr++)>>2)*d)>>8)&0x7F;
|
|
||||||
|
|
||||||
colorComp3=((((*curPtr++)>>2)*e)>>8)&0x7F;*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Yazoo: I can't get the right formula, so I made one that just work fine with SamnMax flashlight */
|
/* Yazoo: I can't get the right formula, so I made one that just work fine with SamnMax flashlight */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
colorComp1=(*curPtr++)+10;
|
colorComp1=(*curPtr++)+10;
|
||||||
|
|
||||||
colorComp2=(*curPtr++)+10;
|
colorComp2=(*curPtr++)+10;
|
||||||
|
|
||||||
colorComp3=(*curPtr++)+10;
|
colorComp3=(*curPtr++)+10;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
searchPtr = palPtr;
|
searchPtr = palPtr;
|
||||||
|
|
||||||
bestResult = 0x7FFF;
|
bestResult = 0x7FFF;
|
||||||
|
|
||||||
currentIndex = 0;
|
currentIndex = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(j=0;j<256;j++)
|
for(j=0;j<256;j++)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
searchComp1 = (*searchPtr++);
|
searchComp1 = (*searchPtr++);
|
||||||
|
|
||||||
searchComp2 = (*searchPtr++);
|
searchComp2 = (*searchPtr++);
|
||||||
|
|
||||||
searchComp3 = (*searchPtr++);
|
searchComp3 = (*searchPtr++);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
currentResult = abs(searchComp1-colorComp1) + abs(searchComp2-colorComp2) + abs(searchComp3-colorComp3);
|
currentResult = abs(searchComp1-colorComp1) + abs(searchComp2-colorComp2) + abs(searchComp3-colorComp3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(currentResult<bestResult)
|
if(currentResult<bestResult)
|
||||||
|
|
||||||
if(currentIndex >= a && currentIndex <= b)
|
if(currentIndex >= a && currentIndex <= b)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
_proc_special_palette[i]=currentIndex;
|
_proc_special_palette[i]=currentIndex;
|
||||||
|
|
||||||
bestResult=currentResult;
|
bestResult=currentResult;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
currentIndex++;
|
currentIndex++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -2812,8 +2812,7 @@ void Scumm::o6_miscOps()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 112: /* palette shift? */
|
case 112: /* palette shift? */
|
||||||
warning("stub o6_miscOps_112(%d,%d,%d,%d,%d,%d,%d)",
|
createSpecialPalette(args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
|
||||||
args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 114: /* palette? */
|
case 114: /* palette? */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue