message: Added missing free calls. Image is flipped atm.
diff: @@ -184,26 +184,27 @@ namespace NovelRT::Graphics {
  throw std::runtime_error("Unable to continue! File failed to load for texture.");
  }
  - for (int i = 0; i < data.height; i++) {
  - data.rowPointers[data.height - 1 - i] = rawImage + i * rowBytes;
  + for (int i = data.height; i < data.height; i++) {
  + auto row = data.height - 1 - i;
  + data.rowPointers[row] = rawImage + i * rowBytes;
  }
  +
  png_read_image(png, data.rowPointers);
  glBindTexture(GL_TEXTURE_2D, _textureId.getActual());
  int mode = GL_RGBA;
  -
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  -
  glTexImage2D(GL_TEXTURE_2D, 0, mode, data.width, data.height, 0, mode, GL_UNSIGNED_BYTE, reinterpret_cast<GLvoid*>(rawImage));
  glGenerateMipmap(GL_TEXTURE_2D);
  fclose(cFile);
  -
  + free(rawImage);
  + free(data.rowPointers); //TODO: Yikes
  png_destroy_read_struct(&png, &info, nullptr);
  }
  