+ }
+
+ } // load icon during rendering?
+
+ if ( ic ) {
+ iconsurface = ic -> i;
+ } else {
+ //pnd_log ( pndn_warning, "WARNING: TBD: Need Missin-icon icon for '%s'\n", IFNULL(appiter -> ref -> title_en,"No Name") );
+
+ // no icon override; was this a pnd-file (show the unknown icon then), or was this generated from
+ // filesystem (file or directory icon)
+ if ( appiter -> ref -> object_flags & PND_DISCO_GENERATED ) {
+ if ( appiter -> ref -> object_type == pnd_object_type_directory ) {
+
+ // is this a subcat, a .., or a filesystem folder?
+ //iconsurface = g_imagecache [ IMG_FOLDER ].i;
+ if ( g_categories [ ui_category ] -> fspath ) {
+ iconsurface = g_imagecache [ IMG_FOLDER ].i;
+ } else if ( strcmp ( appiter -> ref -> title_en, ".." ) == 0 ) {
+ iconsurface = g_imagecache [ IMG_DOTDOTFOLDER ].i;
+ } else {
+ iconsurface = g_imagecache [ IMG_SUBCATFOLDER ].i;
+ }
+
+ } else {
+ iconsurface = g_imagecache [ IMG_EXECBIN ].i;
+ }
+ } else {
+ iconsurface = g_imagecache [ IMG_ICON_MISSING ].i;
+ }
+
+ }
+
+ // got an icon I hope?
+ if ( iconsurface ) {
+ //pnd_log ( pndn_debug, "Got an icon for '%s'\n", IFNULL(appiter -> ref -> title_en,"No Name") );
+
+ src.x = 0;
+ src.y = 0;
+ src.w = 60;
+ src.h = 60;
+ dest -> x = c -> grid_offset_x + ( col * c -> cell_width ) + c -> icon_offset_x + (( c -> icon_max_width - iconsurface -> w ) / 2);
+ dest -> y = c -> grid_offset_y + ( displayrow * c -> cell_height ) + c -> icon_offset_y + (( c -> icon_max_height - iconsurface -> h ) / 2);
+
+ SDL_BlitSurface ( iconsurface, &src, sdl_realscreen, dest );
+
+ // store touch info
+ ui_register_app ( appiter, dest -> x, dest -> y, src.w, src.h );
+
+ dest++;
+
+ }
+
+ // show text
+ if ( appiter -> ref -> title_en ) {
+ SDL_Surface *rtext;
+ rtext = TTF_RenderText_Blended ( g_grid_font, appiter -> ref -> title_en, c -> fontcolor );
+ src.x = 0;
+ src.y = 0;
+ src.w = c -> text_width < rtext -> w ? c -> text_width : rtext -> w;
+ src.h = rtext -> h;
+ if ( rtext -> w > c -> text_width ) {
+ dest -> x = c -> grid_offset_x + ( col * c -> cell_width ) + c -> text_clip_x;
+ } else {
+ dest -> x = c -> grid_offset_x + ( col * c -> cell_width ) + c -> text_offset_x - ( rtext -> w / 2 );
+ }
+ dest -> y = c -> grid_offset_y + ( displayrow * c -> cell_height ) + c -> text_offset_y;
+ SDL_BlitSurface ( rtext, &src, sdl_realscreen, dest );
+ SDL_FreeSurface ( rtext );
+ dest++;
+ }
+
+ } // display now? or scrolled away..
+
+ // next
+ appiter = appiter -> next;
+
+ } // for column 1...X
+
+ if ( row >= ui_rows_scrolled_down ) {
+ displayrow++;
+ }
+
+ row ++;
+
+ // are we done displaying rows?
+ if ( displayrow >= c -> row_max ) {
+ break;
+ }
+
+ } // while
+
+ } // icon view