mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- allow allocating constructor of TArray to also reserve the allocated data and use this to properly handle the precalc arrays for the texture resizer.
This commit is contained in:
parent
8104ef5189
commit
fafc636476
2 changed files with 4 additions and 4 deletions
|
@ -93,8 +93,8 @@ void FHardwareTexture::Resize(int width, int height, unsigned char *src_data, un
|
|||
// down we will need to gather a grid of pixels of the size of the scale
|
||||
// factor in each direction and then do an averaging of the pixels.
|
||||
|
||||
TArray<BoxPrecalc> vPrecalcs(height);
|
||||
TArray<BoxPrecalc> hPrecalcs(width);
|
||||
TArray<BoxPrecalc> vPrecalcs(height, true);
|
||||
TArray<BoxPrecalc> hPrecalcs(width, true);
|
||||
|
||||
ResampleBoxPrecalc(vPrecalcs, texheight);
|
||||
ResampleBoxPrecalc(hPrecalcs, texwidth);
|
||||
|
|
|
@ -132,10 +132,10 @@ public:
|
|||
Count = 0;
|
||||
Array = NULL;
|
||||
}
|
||||
TArray (int max)
|
||||
TArray (int max, bool reserve = false)
|
||||
{
|
||||
Most = max;
|
||||
Count = 0;
|
||||
Count = reserve? max : 0;
|
||||
Array = (T *)M_Malloc (sizeof(T)*max);
|
||||
}
|
||||
TArray (const TArray<T,TT> &other)
|
||||
|
|
Loading…
Reference in a new issue