mirror of
https://github.com/NeoFlock/neonucleus.git
synced 2025-09-24 09:03:32 +02:00
experimental implementation of very unsafe function
this needs to be heavily audieted
This commit is contained in:
parent
b51dabad63
commit
9913af75f1
@ -74,6 +74,20 @@ nn_bool_t nn_unsafeReallocateScreenBuffer(nn_screen *screen, int maxWidth, int m
|
||||
return false;
|
||||
}
|
||||
|
||||
for(nn_size_t y = 0; y < maxHeight; y++) {
|
||||
if(y == screen->maxHeight) break;
|
||||
for(nn_size_t x = 0; x < maxWidth; x++) {
|
||||
if(x == screen->maxWidth) break;
|
||||
|
||||
nn_size_t srcIdx = x + y * screen->maxWidth;
|
||||
nn_size_t destIdx = x + y * maxWidth;
|
||||
|
||||
newBuffer[destIdx] = screen->buffer[srcIdx];
|
||||
}
|
||||
}
|
||||
|
||||
nn_dealloc(alloc, screen->buffer, sizeof(nn_scrchr_t) * screen->maxWidth * screen->maxHeight);
|
||||
|
||||
screen->buffer = newBuffer;
|
||||
screen->maxWidth = maxWidth;
|
||||
screen->maxHeight = maxHeight;
|
||||
|
Loading…
x
Reference in New Issue
Block a user