mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
name dynamic textures
This commit is contained in:
parent
ca6e9716d8
commit
ab86ca2b73
@ -505,7 +505,7 @@ slot_glyph(int x_size, int y_size) {
|
|||||||
// No good; all recorded glyphs are actually in use. We need to
|
// No good; all recorded glyphs are actually in use. We need to
|
||||||
// make a new page.
|
// make a new page.
|
||||||
_preferred_page = _pages.size();
|
_preferred_page = _pages.size();
|
||||||
PT(DynamicTextPage) page = new DynamicTextPage(this);
|
PT(DynamicTextPage) page = new DynamicTextPage(this, _preferred_page);
|
||||||
_pages.push_back(page);
|
_pages.push_back(page);
|
||||||
return page->slot_glyph(x_size, y_size, _texture_margin);
|
return page->slot_glyph(x_size, y_size, _texture_margin);
|
||||||
}
|
}
|
||||||
|
@ -30,12 +30,17 @@ TypeHandle DynamicTextPage::_type_handle;
|
|||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
DynamicTextPage::
|
DynamicTextPage::
|
||||||
DynamicTextPage(DynamicTextFont *font) :
|
DynamicTextPage(DynamicTextFont *font, int page_number) :
|
||||||
_font(font)
|
_font(font)
|
||||||
{
|
{
|
||||||
_x_size = _font->get_page_x_size();
|
_x_size = _font->get_page_x_size();
|
||||||
_y_size = _font->get_page_y_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
|
// Initialize the Texture to an empty, black (transparent) image of
|
||||||
// the appropriate size.
|
// the appropriate size.
|
||||||
_pbuffer = new PixelBuffer(_x_size, _y_size, 1, 1,
|
_pbuffer = new PixelBuffer(_x_size, _y_size, 1, 1,
|
||||||
|
@ -39,7 +39,7 @@ class DynamicTextFont;
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
class EXPCL_PANDA DynamicTextPage : public Texture {
|
class EXPCL_PANDA DynamicTextPage : public Texture {
|
||||||
public:
|
public:
|
||||||
DynamicTextPage(DynamicTextFont *font);
|
DynamicTextPage(DynamicTextFont *font, int page_number);
|
||||||
|
|
||||||
DynamicTextGlyph *slot_glyph(int x_size, int y_size, int margin);
|
DynamicTextGlyph *slot_glyph(int x_size, int y_size, int margin);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user