Skip to content

Commit

Permalink
MorphOS: fix depth
Browse files Browse the repository at this point in the history
  • Loading branch information
BeWorld2018 committed Oct 11, 2023
1 parent 3010577 commit f35c9f2
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/video/morphos/SDL_mosopengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ SDL_bool MOS_GL_AllocBitmap(_THIS, SDL_Window * window)
SDL_VideoData *vd = data->videodata;

if (data->bitmap != NULL) {
D("[%s] FreeBitMap\n", __FUNCTION__);
//D("[%s] FreeBitMap\n", __FUNCTION__);
FreeBitMap(data->bitmap);
data->bitmap = NULL;
}
Expand All @@ -109,26 +109,23 @@ SDL_bool MOS_GL_AllocBitmap(_THIS, SDL_Window * window)
struct BitMap * friend_bitmap;
ULONG depth = 0;
if (data->winflags & SDL_MOS_WINDOW_FULLSCREEN_DESKTOP) {
D("[%s] DESKTOP FULLSCREEN\n", __FUNCTION__);
//D("[%s] DESKTOP FULLSCREEN\n", __FUNCTION__);
w = vd->WScreen->Width;
h = vd->WScreen->Height;
friend_bitmap = data->win->RPort->BitMap;
depth = data->win->RPort->BitMap->Depth;
friend_bitmap = data->win->RPort->BitMap;
} else if (data->winflags & SDL_MOS_WINDOW_FULLSCREEN){
D("[%s] REAL FULLSCREEN\n", __FUNCTION__);
//D("[%s] REAL FULLSCREEN\n", __FUNCTION__);
w = vd->CustomScreen->Width;
h = vd->CustomScreen->Height;
friend_bitmap=vd->CustomScreen->RastPort.BitMap;
depth = vd->CustomScreen->RastPort.BitMap->Depth;
} else {
D("[%s] WINDOWED\n", __FUNCTION__);
//D("[%s] WINDOWED\n", __FUNCTION__);
w = window->w;
h= window->h;
friend_bitmap = data->win->RPort->BitMap;
depth = data->win->RPort->BitMap->Depth;
}

D("[%s] AllocBitMap w=%d h=%d depth=%d\n", __FUNCTION__, w, h, depth);
depth = GetBitMapAttr(friend_bitmap, BMA_DEPTH);
//D("[%s] AllocBitMap w=%d h=%d depth=%d\n", __FUNCTION__, w, h, depth);
return (data->bitmap = AllocBitMap(w, h, depth, BMF_MINPLANES|BMF_DISPLAYABLE|BMF_3DTARGET, friend_bitmap)) != NULL;

}
Expand Down

0 comments on commit f35c9f2

Please sign in to comment.