- Arreglats errors ambs el viewport
- Els fades van mes lentos
This commit is contained in:
@@ -52,6 +52,9 @@ namespace draw
|
||||
// Creem la superficie "screen" i la establim com a superficie destinació
|
||||
screen = createSurface(width, height);
|
||||
destination = screen;
|
||||
viewport.x = viewport.y = 0;
|
||||
viewport.w = width;
|
||||
viewport.h = height;
|
||||
sel_color = transparent = 0;
|
||||
for (int i=0;i<256;++i) color_indices[i] = i;
|
||||
|
||||
@@ -257,7 +260,7 @@ namespace draw
|
||||
surface->pixels[(viewport.x+x) + (y+viewport.y) * surface->w] = color_indices[color];
|
||||
} else {
|
||||
// Si no es destinations, mirem que estiga dins de la surface, i sinó fora!
|
||||
if (x >= 0 && y >= 0 && x < destination->w && y < destination->h)
|
||||
if (x >= 0 && y >= 0 && x < surface->w && y < surface->h)
|
||||
surface->pixels[x + y * surface->w] = color_indices[color];
|
||||
}
|
||||
}
|
||||
@@ -271,7 +274,7 @@ namespace draw
|
||||
return surface->pixels[(viewport.x + x) + (viewport.y + y) * surface->w];
|
||||
} else {
|
||||
// Si no es "destination", si la coordenada està dins del rang que abarca la superficie,
|
||||
if (x >= 0 && y >= 0 && x < destination->w && y < destination->h)
|
||||
if (x >= 0 && y >= 0 && x < surface->w && y < surface->h)
|
||||
return surface->pixels[x + y * surface->w];
|
||||
}
|
||||
|
||||
@@ -404,13 +407,13 @@ namespace draw
|
||||
}
|
||||
}
|
||||
fading_in = false;
|
||||
for (int i=0; i<256; ++i) if (incPalEntry(i, 16)) fading_in = true;
|
||||
for (int i=0; i<256; ++i) if (incPalEntry(i, 8)) fading_in = true;
|
||||
}
|
||||
|
||||
void fadeout()
|
||||
{
|
||||
fading_out = false;
|
||||
for (int i=0; i<256; ++i) if (decPalEntry(i, 16)) fading_out = true;
|
||||
for (int i=0; i<256; ++i) if (decPalEntry(i, 8)) fading_out = true;
|
||||
}
|
||||
|
||||
// Refresca la pantalla
|
||||
|
||||
Reference in New Issue
Block a user