mirror of
https://github.com/glest/glest-source.git
synced 2025-09-29 00:48:58 +02:00
- added new ini setting to see if this helps fix non power of two texture loading for some ATI video cards, user needs to set this in the ini:
EnableATIHacks=true
This commit is contained in:
@@ -25,11 +25,12 @@
|
||||
#include <jpeglib.h>
|
||||
#include <setjmp.h>
|
||||
#include <memory>
|
||||
|
||||
#include "opengl.h"
|
||||
#include "leak_dumper.h"
|
||||
|
||||
using namespace Shared::Util;
|
||||
using namespace std;
|
||||
using namespace Shared::Graphics::Gl;
|
||||
|
||||
namespace Shared{ namespace Graphics{
|
||||
|
||||
@@ -868,6 +869,24 @@ Pixmap2D::~Pixmap2D() {
|
||||
deletePixels();
|
||||
}
|
||||
|
||||
void Pixmap2D::Scale(int format, int newW, int newH) {
|
||||
int useComponents = this->getComponents();
|
||||
uint8 *newpixels= new uint8[newW * newH * useComponents];
|
||||
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
int error = gluScaleImage( format,
|
||||
w, h, GL_UNSIGNED_BYTE, pixels,
|
||||
newW, newH, GL_UNSIGNED_BYTE, newpixels);
|
||||
if(error != GL_NO_ERROR) {
|
||||
init(newW,newH,this->components);
|
||||
pixels = newpixels;
|
||||
}
|
||||
else {
|
||||
assertGl();
|
||||
}
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
}
|
||||
|
||||
Pixmap2D* Pixmap2D::loadPath(const string& path) {
|
||||
//printf("Loading Pixmap2D [%s]\n",path.c_str());
|
||||
|
||||
|
Reference in New Issue
Block a user