- Ja carrega els patch, pero les textures es veuen mal. Arreglant mil coses del motor que tenia a foc pintar textures de 64x64
This commit is contained in:
15
draw.cpp
15
draw.cpp
@@ -99,6 +99,21 @@ namespace draw
|
||||
return surf->pixels[x+y*surf->w];
|
||||
}
|
||||
|
||||
void putpsurf(surface_t *dest, int x, int y, uint8_t color)
|
||||
{
|
||||
if (x<0 || y<0 || x>=dest->w || y>=dest->h) return;
|
||||
dest->pixels[x+y*dest->w] = color;
|
||||
}
|
||||
|
||||
void drawsurf(int x, int y, surface_t *src, surface_t *dst)
|
||||
{
|
||||
int w = src->w; if (x+w > dst->w) w = dst->w-x;
|
||||
int h = src->h; if (y+h > dst->h) h = dst->h-y;
|
||||
for (int py=0;py<h;++py)
|
||||
for (int px=0;px<w;++px)
|
||||
dst->pixels[(px+x)+(py+y)*dst->w] = src->pixels[x+y*src->w];
|
||||
}
|
||||
|
||||
void line(int x1, int y1, int x2, int y2, Uint8 color)
|
||||
{
|
||||
float dx = float(x2-x1);
|
||||
|
||||
Reference in New Issue
Block a user