📄 oldfill.txt
字号:
{
if(newColor == oldColor)
return;
int tempX, leftX, rightX;
int index=0;
int stackX[500], stackY[500];
stackX[index]= x;
stackY[index]= y;
while(index> -1)
{
y=stackY[index];
tempX=x=stackX[index];
index--;
while(GetColor(x, y) == oldColor && x<MAPWIDTH)
{
FillGrid(&dcMemory, x, y, newColor);
x++;
}
rightX=x;
x=tempX-1;
while(GetColor(x, y) == oldColor && x>0 )
{
FillGrid(&dcMemory, x, y, newColor);
x--;
}
leftX=x;
y++;
while(x<rightX)
{
while(++x<rightX && GetColor(x ,y) != newColor)
;
if(x == rightX)
break;
while(++x<rightX && GetColor(x ,y) == newColor)
index++;
stackX[index]=x;
stackY[index]=y;
}
x=leftX;
y-=2;
while(x<rightX)
{
while(++x<rightX && GetColor(x,y)!=newColor)
;
if(x==rightX)
break;
while(++x<rightX && GetColor(x,y)==newColor)
;
index++;
stackX[index]=x;
stackY[index]=y;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -