~kxq/widelands/feature-978-partial-training

« back to all changes in this revision

Viewing changes to src/graphic/texture.cc

  • Committer: Teppo Maenpaa \
  • Date: 2013-05-25 06:30:05 UTC
  • mfrom: (6560.1.9 trunk)
  • Revision ID: tm@iki.fi-20130525063005-2ux5rgkpufaedeiv
Merged with changes from trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
                SDL_Surface * const cv = SDL_ConvertSurface(surf, &fmt, 0);
176
176
 
177
177
                // Add the frame
178
 
                m_pixels =
 
178
                uint8_t* new_ptr =
179
179
                        static_cast<uint8_t *>
180
180
                                (realloc
181
181
                                        (m_pixels, TEXTURE_WIDTH * TEXTURE_HEIGHT * (m_nrframes + 1)));
 
182
                if (!new_ptr)
 
183
                        throw wexception("Out of memory.");
 
184
                m_pixels = new_ptr;
 
185
 
 
186
 
182
187
                m_curframe = &m_pixels[TEXTURE_WIDTH * TEXTURE_HEIGHT * m_nrframes];
183
188
                ++m_nrframes;
184
189