Changeset 7429 in orxonox.OLD for trunk/src/lib/graphics/text_engine
- Timestamp:
- Apr 29, 2006, 1:21:47 AM (19 years ago)
- Location:
- trunk/src/lib/graphics/text_engine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine/font.cc
r7428 r7429 380 380 &miY, &maY, 381 381 &adv); 382 printf("%c:: %d %d %d %d %d\n", rg->character, miX, maX, miY, maY, adv); 382 383 rg->minX = (float)miX / (float)this->renderSize; 383 384 rg->maxX = (float)maX / (float)this->renderSize; … … 471 472 tmpRect.y = tmp; 472 473 473 tmpGlyph->texCoord[0] = (float)( tmpRect.x)/(float)tmpSurf->w;474 tmpGlyph->texCoord[1] = (float)( tmpRect.x + tmpGlyph->width*(float)this->renderSize)/(float)tmpSurf->w;474 tmpGlyph->texCoord[0] = (float)((float)tmpRect.x + tmpGlyph->minX*(float)this->renderSize)/(float)tmpSurf->w; 475 tmpGlyph->texCoord[1] = (float)((float)tmpRect.x + tmpGlyph->maxX*(float)this->renderSize)/(float)tmpSurf->w; 475 476 tmpGlyph->texCoord[2] = (float)(tmpRect.y)/(float)tmpSurf->w; 476 tmpGlyph->texCoord[3] = (float)( tmpRect.y+this->getMaxHeight())/(float)tmpSurf->w;477 tmpGlyph->texCoord[3] = (float)((float)tmpRect.y+(float)this->getMaxHeight())/(float)tmpSurf->w; 477 478 SDL_FreeSurface(glyphSurf); 478 tmpRect.x += (int)(tmpGlyph->advance * this->renderSize)+1;479 tmpRect.x += glyphSurf->w+1; //(int)(tmpGlyph->advance * this->renderSize); 479 480 480 481 /* … … 492 493 } 493 494 // outputting the GLYPH-table 494 //char outName[1024];495 //sprintf( outName, "%s-glyphs.bmp", this->getName());496 //SDL_SaveBMP(tmpSurf, outName);495 char outName[1024]; 496 sprintf( outName, "%s-glyphs.bmp", this->getName()); 497 SDL_SaveBMP(tmpSurf, outName); 497 498 498 499 if (this->setSurface(tmpSurf)) -
trunk/src/lib/graphics/text_engine/text.cc
r7426 r7429 164 164 { 165 165 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]); 166 glVertex2d(posX+tmpGlyph-> width*this->getSizeY2D(), 0);166 glVertex2d(posX+tmpGlyph->advance*this->getSizeY2D(), 0); 167 167 168 168 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[3]); 169 glVertex2d(posX+tmpGlyph-> width*this->getSizeY2D(), this->getSizeY2D());169 glVertex2d(posX+tmpGlyph->advance*this->getSizeY2D(), this->getSizeY2D()); 170 170 171 171 glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[3]); 172 glVertex2d(posX , this->getSizeY2D());172 glVertex2d(posX+tmpGlyph->minX*this->getSizeY2D(), this->getSizeY2D()); 173 173 174 174 glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[2]); 175 glVertex2d(posX , 0);175 glVertex2d(posX+tmpGlyph->minX*this->getSizeY2D(), 0); 176 176 177 177 posX += tmpGlyph->advance * this->getSizeY2D();
Note: See TracChangeset
for help on using the changeset viewer.