> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 19:55:23 up 7 days, 19:55,  1 user,  load average: 0.33, 0.26, 0.20
This commit is contained in:
tracer-ics2023
2024-09-25 19:55:23 +08:00
committed by zzy
parent 276756d554
commit b803b02300

View File

@ -6,7 +6,7 @@
void SDL_BlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) {
assert(dst && src);
assert(dst->format->BitsPerPixel == src->format->BitsPerPixel);
assert(dst->format->BitsPerPixel == src->format->BitsPerPixel == 32);
SDL_Rect rect = {
.w = srcrect == NULL ? src->w : srcrect->w,
.h = srcrect == NULL ? src->h : srcrect->h,
@ -15,8 +15,8 @@ void SDL_BlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_
};
for (int i = 0; i < rect.h; i ++) {
memcpy(dst->pixels + (rect.y + i) * dst->w + rect.x,
src->pixels + (srcrect->y + i) * src->w + srcrect->x, rect.w);
memcpy((uint32_t*)dst->pixels + (rect.y + i) * dst->w + rect.x,
(uint32_t*)src->pixels + (srcrect->y + i) * src->w + srcrect->x, rect.w);
}
}