Eliminated the format parameter.

TRAC #18714 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@832 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent f749f0e8
......@@ -212,16 +212,16 @@ IDirect3DSurface9 *Image::getSurface()
// Store the pixel rectangle designated by xoffset,yoffset,width,height with pixels stored as format/type at input
// into the target pixel rectangle at output with outputPitch bytes in between each line.
void Image::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
void Image::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum type,
GLint unpackAlignment, const void *input, size_t outputPitch, void *output) const
{
GLsizei inputPitch = -ComputePitch(width, format, type, unpackAlignment);
GLsizei inputPitch = -ComputePitch(width, mFormat, type, unpackAlignment);
input = ((char*)input) - inputPitch * (height - 1);
switch (type)
{
case GL_UNSIGNED_BYTE:
switch (format)
switch (mFormat)
{
case GL_ALPHA:
loadAlphaData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
......@@ -252,7 +252,7 @@ void Image::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height
}
break;
case GL_UNSIGNED_SHORT_5_6_5:
switch (format)
switch (mFormat)
{
case GL_RGB:
loadRGB565Data(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
......@@ -261,7 +261,7 @@ void Image::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height
}
break;
case GL_UNSIGNED_SHORT_4_4_4_4:
switch (format)
switch (mFormat)
{
case GL_RGBA:
loadRGBA4444Data(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
......@@ -270,7 +270,7 @@ void Image::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height
}
break;
case GL_UNSIGNED_SHORT_5_5_5_1:
switch (format)
switch (mFormat)
{
case GL_RGBA:
loadRGBA5551Data(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
......@@ -279,7 +279,7 @@ void Image::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height
}
break;
case GL_FLOAT:
switch (format)
switch (mFormat)
{
// float textures are converted to RGBA, not BGRA, as they're stored that way in D3D
case GL_ALPHA:
......@@ -301,7 +301,7 @@ void Image::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height
}
break;
case GL_HALF_FLOAT_OES:
switch (format)
switch (mFormat)
{
// float textures are converted to RGBA, not BGRA, as they're stored that way in D3D
case GL_ALPHA:
......@@ -1161,7 +1161,7 @@ void Texture::setImage(GLint unpackAlignment, const void *pixels, Image *image)
if (SUCCEEDED(result))
{
image->loadData(0, 0, image->getWidth(), image->getHeight(), image->getFormat(), image->getType(), unpackAlignment, pixels, locked.Pitch, locked.pBits);
image->loadData(0, 0, image->getWidth(), image->getHeight(), image->getType(), unpackAlignment, pixels, locked.Pitch, locked.pBits);
image->unlock();
}
......@@ -1217,7 +1217,7 @@ bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig
if (SUCCEEDED(result))
{
image->loadData(xoffset, transformPixelYOffset(yoffset, height, image->getHeight()), width, height, format, type, unpackAlignment, pixels, locked.Pitch, locked.pBits);
image->loadData(xoffset, transformPixelYOffset(yoffset, height, image->getHeight()), width, height, type, unpackAlignment, pixels, locked.Pitch, locked.pBits);
image->unlock();
}
......
......@@ -66,7 +66,7 @@ class Image
bool isDirty() const {return mSurface && mDirty;}
IDirect3DSurface9 *getSurface();
void loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
void loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum type,
GLint unpackAlignment, const void *input, std::size_t outputPitch, void *output) const;
void loadAlphaData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
......@@ -236,7 +236,7 @@ class Texture2D : public Texture
void subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels);
void copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
virtual bool isComplete() const;
virtual bool isCompressed() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment