]> hackdaworld.org Git - physik/morpheus.git/commitdiff
fixed display bug (looped open of decker.ttf)
authorhackbard <hackbard>
Mon, 14 Apr 2003 14:13:34 +0000 (14:13 +0000)
committerhackbard <hackbard>
Mon, 14 Apr 2003 14:13:34 +0000 (14:13 +0000)
display.c

index 733ae230f3afb94032ff6f71628dc69b36e1e825..9ed5c29a589a8b44472a461b2b347ccaa85b3a5f 100644 (file)
--- 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);