comparison Gui/skin/font.c @ 6145:26cb8736927b

Gui and 64-bit issues patch from Gui and 64-bit issues
author pontscho
date Mon, 20 May 2002 13:39:23 +0000
parents 60cf2bca993f
children dcf195b784bf
comparison
equal deleted inserted replaced
6144:bcb7c2050104 6145:26cb8736927b
122 { 122 {
123 txSample * tmp = NULL; 123 txSample * tmp = NULL;
124 txSample tmp2; 124 txSample tmp2;
125 char p[512]; 125 char p[512];
126 va_list ap; 126 va_list ap;
127 unsigned long * ibuf; 127 unsigned int * ibuf;
128 unsigned long * obuf; 128 unsigned int * obuf;
129 int i,x,y; 129 int i,x,y;
130 int oy = 0, ox = 0, dx = 0; 130 int oy = 0, ox = 0, dx = 0;
131 131
132 va_start( ap,fmt ); 132 va_start( ap,fmt );
133 vsnprintf( p,512,fmt,ap ); 133 vsnprintf( p,512,fmt,ap );
142 tmp->Height=fntTextHeight( id,p ); 142 tmp->Height=fntTextHeight( id,p );
143 tmp->BPP=32; 143 tmp->BPP=32;
144 tmp->ImageSize=tmp->Width * tmp->Height * 4; 144 tmp->ImageSize=tmp->Width * tmp->Height * 4;
145 if ( ( tmp->Image=malloc( tmp->ImageSize ) ) == NULL ) return NULL; 145 if ( ( tmp->Image=malloc( tmp->ImageSize ) ) == NULL ) return NULL;
146 146
147 obuf=(unsigned long *)tmp->Image; 147 obuf=(unsigned int *)tmp->Image;
148 ibuf=(unsigned long *)Fonts[id]->Bitmap.Image; 148 ibuf=(unsigned int *)Fonts[id]->Bitmap.Image;
149 for ( i=0;i < (int)strlen( p );i++ ) 149 for ( i=0;i < (int)strlen( p );i++ )
150 { 150 {
151 char c = p[i]; 151 char c = p[i];
152 if ( Fonts[id]->Fnt[c].x == -1 ) c=32; 152 if ( Fonts[id]->Fnt[c].x == -1 ) c=32;
153 for ( oy=0,y=Fonts[id]->Fnt[c].y;y < Fonts[id]->Fnt[c].y + Fonts[id]->Fnt[c].sy; y++,oy++ ) 153 for ( oy=0,y=Fonts[id]->Fnt[c].y;y < Fonts[id]->Fnt[c].y + Fonts[id]->Fnt[c].sy; y++,oy++ )
161 if ( ( sx > 0 )&&( sx < tmp->Width ) ) 161 if ( ( sx > 0 )&&( sx < tmp->Width ) )
162 { 162 {
163 tmp2.ImageSize=sx * tmp->Height * 4; 163 tmp2.ImageSize=sx * tmp->Height * 4;
164 if ( ( tmp2.Image=malloc( tmp2.ImageSize ) ) == NULL ) { free( tmp->Image ); return NULL; } 164 if ( ( tmp2.Image=malloc( tmp2.ImageSize ) ) == NULL ) { free( tmp->Image ); return NULL; }
165 165
166 obuf=(unsigned long *)tmp->Image; 166 obuf=(unsigned int *)tmp->Image;
167 ibuf=(unsigned long *)tmp2.Image; 167 ibuf=(unsigned int *)tmp2.Image;
168 oy=0; 168 oy=0;
169 169
170 for ( y=0;y < tmp->Height;y++ ) 170 for ( y=0;y < tmp->Height;y++ )
171 { 171 {
172 ox=px; 172 ox=px;