name dynamic textures

This commit is contained in:
David Rose 2004-02-20 00:00:41 +00:00
parent ca6e9716d8
commit ab86ca2b73
3 changed files with 8 additions and 3 deletions

View File

@ -505,7 +505,7 @@ slot_glyph(int x_size, int y_size) {
// No good; all recorded glyphs are actually in use. We need to
// make a new page.
_preferred_page = _pages.size();
PT(DynamicTextPage) page = new DynamicTextPage(this);
PT(DynamicTextPage) page = new DynamicTextPage(this, _preferred_page);
_pages.push_back(page);
return page->slot_glyph(x_size, y_size, _texture_margin);
}

View File

@ -30,12 +30,17 @@ TypeHandle DynamicTextPage::_type_handle;
// Description:
////////////////////////////////////////////////////////////////////
DynamicTextPage::
DynamicTextPage(DynamicTextFont *font) :
DynamicTextPage(DynamicTextFont *font, int page_number) :
_font(font)
{
_x_size = _font->get_page_x_size();
_y_size = _font->get_page_y_size();
// Assign a name to the Texture.
ostringstream strm;
strm << font->get_name() << "_" << page_number;
set_name(strm.str());
// Initialize the Texture to an empty, black (transparent) image of
// the appropriate size.
_pbuffer = new PixelBuffer(_x_size, _y_size, 1, 1,

View File

@ -39,7 +39,7 @@ class DynamicTextFont;
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA DynamicTextPage : public Texture {
public:
DynamicTextPage(DynamicTextFont *font);
DynamicTextPage(DynamicTextFont *font, int page_number);
DynamicTextGlyph *slot_glyph(int x_size, int y_size, int margin);