Path: chuka.playstation.co.uk!news From: "Matt Verran" Newsgroups: scee.yaroze.programming.2d_graphics Subject: font routine hangs Date: Wed, 16 Jun 1999 16:10:45 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 45 Message-ID: <7k8eu8$75r18@chuka.playstation.co.uk> NNTP-Posting-Host: modem-147.name55.dialup.pol.co.uk X-Newsreader: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Help, please! This is driving me NUTS. I have a font routine that takes a string and renders it to the screen. It uses a tim that contains all the letters in the font and adjusts the u and v vaules of a sprite to display the correct one. Sometimes it just hangs inside the below while loop after 8 iterations and sometimes it works fine. This is the same code without any changes or recompilations?? Can anyone see anything in the below while loop that would make it do that? --- while( *text!=0 ) { c = *text; if ( c< start_char || c>end_char ) // if out of range { //printf(" ",c); // print space } else // if in range { c = c - start_char; //printf("%d ::",c); across = c % columns; down = (c-across) / columns; //printf("%d across, %d down \n",across,down); spriteInfo.u = (fntInfo->start_u) + (across*(fntInfo->char_width)); spriteInfo.v = (fntInfo->start_v) + (down*(fntInfo->char_height)); GsSortFastSprite(&spriteInfo, &world_ordering_table[output_buffer_index], 0); } spriteInfo.x = spriteInfo.x + (fntInfo->char_width); // move cursor along text++; printf( "*"); }