/[gzz]/gzz/gfx/libmosaic/Mosaic.cxx
ViewVC logotype

Diff of /gzz/gfx/libmosaic/Mosaic.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by tjl, Thu Sep 12 15:30:04 2002 UTC revision 1.7 by tjl, Thu Sep 12 15:42:23 2002 UTC
# Line 15  namespace Mosaic { Line 15  namespace Mosaic {
15          DBG(dbg) << "TexId:: allocating\n";          DBG(dbg) << "TexId:: allocating\n";
16          glGenTextures(1, &id);          glGenTextures(1, &id);
17          DBG(dbg) << "TexId:: got "<<id<<"\n";          DBG(dbg) << "TexId:: got "<<id<<"\n";
18          if(this->isGood()) throw InvalidTexture();          if(!this->isGood()) {
19                DBG(dbg) << "Didn't get a texture, bailing out\n";
20                throw InvalidTexture();
21            }
22          DBG(dbg) << "TexId:: allocated\n";          DBG(dbg) << "TexId:: allocated\n";
23      }      }
24    
# Line 130  namespace Mosaic { Line 133  namespace Mosaic {
133      }      }
134    
135      MosaicTile MosaicBuilder::alloc(int w, int h, int border) {      MosaicTile MosaicBuilder::alloc(int w, int h, int border) {
136            DBG(dbg) << "Alloc "<<w<<" "<<h<<" "<<border<<"\n";
137          if(textures.size() == 0) createNew();          if(textures.size() == 0) createNew();
138          int pw = w + 2*border;          int pw = w + 2*border;
139          int ph = h + 2*border;          int ph = h + 2*border;
# Line 138  namespace Mosaic { Line 142  namespace Mosaic {
142          if(!b.valid()) {          if(!b.valid()) {
143              createNew();              createNew();
144              b = textures.back()->talloc->alloc(pw, ph);              b = textures.back()->talloc->alloc(pw, ph);
145              if(!b.valid())              if(!b.valid()) {
146                    std::cerr << "Too large texture\n";
147                  throw TooLarge();                  throw TooLarge();
148                }
149          }          }
150          return MosaicTile(textures.back()->tex,          return MosaicTile(textures.back()->tex,
151                              b.x + border, b.y + border, b.x+b.w - border,                              b.x + border, b.y + border, b.x+b.w - border,

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26