diff --git a/AR_Simple/ImageLoader.c b/AR_Simple/ImageLoader.c index b29b2a1..a5fbbb7 100644 --- a/AR_Simple/ImageLoader.c +++ b/AR_Simple/ImageLoader.c @@ -33,7 +33,7 @@ Uint32 getpixel(SDL_Surface *surface, int x, int y) } } -ARUint8* loadImage(char* filename, ARUint8* dataPtr, int* w, int* h) +ARUint8* loadImage(char* filename, int* w, int* h) { SDL_Surface* img = IMG_Load(filename); if (!img) @@ -44,7 +44,7 @@ ARUint8* loadImage(char* filename, ARUint8* dataPtr, int* w, int* h) *w = img->w; // Assigned width and height to the given pointers *h = img->h; - dataPtr = (ARUint8*)calloc(img->w * img->h * 4, sizeof(ARUint8)); // Allocate space for image data + ARUint8* dataPtr = (ARUint8*)calloc(img->w * img->h * 4, sizeof(ARUint8)); // Allocate space for image data // Write image data to the dataPtr variable for (int y = 0; y < img->h; y++) diff --git a/AR_Simple/ImageLoader.h b/AR_Simple/ImageLoader.h index 770a47b..34c72d1 100644 --- a/AR_Simple/ImageLoader.h +++ b/AR_Simple/ImageLoader.h @@ -20,6 +20,6 @@ Uint32 getpixel(SDL_Surface *surface, int x, int y); w: Will be assigned the width of image h: Will be assigned the height of the image */ -ARUint8* loadImage(char* filename, ARUint8* dataPtr, int* w, int* h); +ARUint8* loadImage(char* filename, int* w, int* h); #endif diff --git a/AR_Simple/Main.c b/AR_Simple/Main.c index 560eec5..d6f7861 100644 --- a/AR_Simple/Main.c +++ b/AR_Simple/Main.c @@ -173,7 +173,7 @@ int main(int argc, char **argv) createOutputFile(); // Delete any old output.csv file and create a fresh one for (int i = 1; i < argc; i++) // For each input image { - dataPtr = loadImage(argv[i], dataPtr, &img_width, &img_height); + dataPtr = loadImage(argv[i], &img_width, &img_height); if (dataPtr == NULL) { printf("Failed to load image: '%s' It will be skipped...\n", argv[i]);