From: hackbard Date: Mon, 14 Apr 2003 14:13:34 +0000 (+0000) Subject: fixed display bug (looped open of decker.ttf) X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=81759e39f6f84b5e1e31c5a680dec75e4299849b;p=physik%2Fmorpheus.git fixed display bug (looped open of decker.ttf) --- diff --git a/display.c b/display.c index 733ae23..9ed5c29 100644 --- a/display.c +++ b/display.c @@ -12,6 +12,7 @@ int display_init(u32 x,u32 y,u32 z,display *display,cell *cell,int *argc,char ** { #ifdef USE_DFB_API DFBSurfaceDescription surface_dsc; + DFBFontDescription font_dsc; #endif /* store dimensions */ @@ -30,7 +31,10 @@ int display_init(u32 x,u32 y,u32 z,display *display,cell *cell,int *argc,char ** surface_dsc.caps=DSCAPS_PRIMARY|DSCAPS_FLIPPING; display->dfb->CreateSurface(display->dfb,&surface_dsc,&(display->primary_surface)); display->primary_surface->GetSize(display->primary_surface,&(display->screen_width),&(display->screen_height)); - + font_dsc.flags=DFDESC_HEIGHT; + font_dsc.height=display->max_y*(display->screen_height/(display->max_z+display->max_y+DISPLAY_Y_FREE))/10; + display->dfb->CreateFont(display->dfb,DISPLAY_FONT,&font_dsc,&(display->font)); + display->primary_surface->SetFont(display->primary_surface,display->font); #endif return 23; } @@ -68,7 +72,6 @@ int display_draw(display *display,u32 x,u32 y,u32 z) { #ifdef USE_DFB_API int menu_x,menu_y,menu_w,menu_h; /* for the yellow box */ - DFBFontDescription font_dsc; char text[MAX_TXT]; u32 x_c,y_c,z_c; unsigned char r,g,b,a; @@ -141,10 +144,6 @@ int display_draw(display *display,u32 x,u32 y,u32 z) display->primary_surface->SetColor(display->primary_surface,r,g,b,a); display->primary_surface->DrawRectangle(display->primary_surface,menu_x,menu_y,menu_w,menu_h); display->primary_surface->DrawLine(display->primary_surface,menu_x+display_faktor_x*display->max_x/2,menu_y+display_faktor_y,menu_x+display_faktor_x*display->max_x/2,menu_y+display_faktor_y*display->max_y-display_faktor_y); - font_dsc.flags=DFDESC_HEIGHT; - font_dsc.height=menu_h/10; - display->dfb->CreateFont(display->dfb,DISPLAY_FONT,&font_dsc,&(display->font)); - display->primary_surface->SetFont(display->primary_surface,display->font); display->primary_surface->SetColor(display->primary_surface,0x80,0x80,0xff,0xff); sprintf(text,"x: %u",x); display->primary_surface->DrawString(display->primary_surface,text,-1,menu_x+display_faktor_x,menu_y+display_faktor_y+menu_h/10,DSTF_LEFT);