// // OSD_Draw() -- Draw the onscreen display // void OSD_Draw(void) { unsigned topoffs; int row, lines, x, len; if (!osdvisible || !osdinited) return; topoffs = osdhead * osdcols; row = osdrows-1; lines = min( osdlines-osdhead, osdrows ); begindrawing(); clearbackground(osdcols,osdrows+1); for (; lines>0; lines--, row--) { drawosdstr(0,row,osdtext+topoffs,osdcols,osdtextshade,osdtextpal); topoffs+=osdcols; } drawosdchar(2,osdrows,'>',osdpromptshade,osdpromptpal); if (osdeditcaps) drawosdchar(0,osdrows,'C',osdpromptshade,osdpromptpal); if (osdeditshift) drawosdchar(1,osdrows,'H',osdpromptshade,osdpromptpal); len = min(osdcols-1-3, osdeditlen-osdeditwinstart); for (x=0; x<len; x++) drawosdchar(3+x,osdrows,osdeditbuf[osdeditwinstart+x],osdeditshade,osdeditpal); drawosdcursor(3+osdeditcursor-osdeditwinstart,osdrows,osdovertype,keytime); enddrawing(); }
// // showframe() -- update the display // void showframe(int32_t w) { UNREFERENCED_PARAMETER(w); #ifdef USE_OPENGL if (bpp > 8) { if (palfadedelta) fullscreen_tint_gl(palfadergb.r, palfadergb.g, palfadergb.b, palfadedelta); SDL_GL_SwapBuffers(); return; } #endif if (offscreenrendering) return; if (lockcount) { printf("Frame still locked %d times when showframe() called.\n", lockcount); while (lockcount) enddrawing(); } // deferred palette updating if (needpalupdate) { SDL_SetColors(sdl_buffersurface, sdlayer_pal, 0, 256); needpalupdate = 0; } #if !defined SDL_DISABLE_8BIT_BUFFER SDL_BlitSurface(sdl_buffersurface, NULL, sdl_surface, NULL); #endif SDL_Flip(sdl_surface); }