P
danke, habs jetzt
void loadimg(SDL_Surface *gSurf, int *array, char *path, int width, int height,int aheight,int x = 0, int y = 0)
{
SDL_Surface *temp = SDL_LoadBMP(path);
gSurf = SDL_ConvertSurface(temp, screen->format, SDL_SWSURFACE);
SDL_FreeSurface(temp);
// Lock surface if needed
if (SDL_MUSTLOCK(gSurf))
if (SDL_LockSurface(gSurf)< 0)
return;
int i, j;
for (i = 0; i < height; i++)
{
for (j = 0; j < width; j++)
{
int tileofs = j+(i*width);
int aOfs = i+y+((j+x)*aheight);
array[aOfs] = ((unsigned int*)gSurf->pixels)[tileofs];
}
}
// Unlock if needed
if (SDL_MUSTLOCK(gSurf))
SDL_UnlockSurface(gSurf);
}
dankeschöööön!