Removed unused memory.h/c

This commit is contained in:
Michaël Lemaire 2013-11-19 16:04:16 +01:00 committed by Michael Lemaire
parent 8a42d7407a
commit 532685f7cb
3 changed files with 0 additions and 67 deletions

View file

@ -29,7 +29,6 @@ SOURCES += main.cpp \
textures/tex_preview.cpp \ textures/tex_preview.cpp \
tools/texture.cpp \ tools/texture.cpp \
tools/parallel.cpp \ tools/parallel.cpp \
tools/memory.cpp \
tools/lighting.cpp \ tools/lighting.cpp \
tools/euclid.cpp \ tools/euclid.cpp \
tools/data.cpp \ tools/data.cpp \
@ -62,7 +61,6 @@ HEADERS += \
textures/private.h \ textures/private.h \
tools/texture.h \ tools/texture.h \
tools/parallel.h \ tools/parallel.h \
tools/memory.h \
tools/lighting.h \ tools/lighting.h \
tools/euclid.h \ tools/euclid.h \
tools/data.h \ tools/data.h \

View file

@ -1,53 +0,0 @@
#include "memory.h"
#include <cstdlib>
#include <cstring>
#include <cassert>
char* memory2dRealloc(char* data, int datasize, int oldxsize, int oldysize, int newxsize, int newysize, int xoffset, int yoffset)
{
int xstart, xend, xlen;
int ystart, yend, y;
char* result = (char*)malloc(datasize * newxsize * newysize);
/* Move remaining part*/
ystart = yoffset;
yend = yoffset + oldysize;
if (yend >= 0 && ystart < newysize)
{
if (ystart < 0)
{
ystart = 0;
}
if (yend > newysize - 1)
{
yend = newysize - 1;
}
xstart = xoffset;
xend = xoffset + oldxsize;
if (xend >= 0 && xstart < newxsize)
{
if (xstart < 0)
{
xstart = 0;
}
if (xend > newxsize - 1)
{
xend = newxsize - 1;
}
xlen = xend - xstart + 1;
if (xlen > 0)
{
for (y = ystart; y <= yend; y++)
{
memcpy(result + (y * newxsize + xstart) * datasize, data + ((y - ystart) * oldxsize) * datasize, xlen * datasize);
}
}
}
}
free(data);
return result;
}

View file

@ -1,12 +0,0 @@
#ifndef _PAYSAGES_TOOLS_MEMORY_H_
#define _PAYSAGES_TOOLS_MEMORY_H_
/*
* Memory tools.
*/
#include "../rendering_global.h"
RENDERINGSHARED_EXPORT char* memory2dRealloc(char* data, int datasize, int oldxsize, int oldysize, int newxsize, int newysize, int xoffset, int yoffset);
#endif