aboutsummaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-28 17:47:04 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-28 17:47:04 +0000
commit26de26ea9cb80fe303b93fbeb535bae241c2222f (patch)
treea50a09ddf72b46bb3a0c5e46b5eca1f2d2bc18fe /src/base
parente5222f99929e0a893fca4ea0ffe08c3bb90fd5c3 (diff)
downloadusdx-26de26ea9cb80fe303b93fbeb535bae241c2222f.tar.gz
usdx-26de26ea9cb80fe303b93fbeb535bae241c2222f.tar.xz
usdx-26de26ea9cb80fe303b93fbeb535bae241c2222f.zip
one more version of fixing the endian problem in SDL
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1424 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base')
-rw-r--r--src/base/UTexture.pas18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/base/UTexture.pas b/src/base/UTexture.pas
index 17d81687..83ff8239 100644
--- a/src/base/UTexture.pas
+++ b/src/base/UTexture.pas
@@ -319,18 +319,18 @@ begin
if (Typ = TEXTURE_TYPE_TRANSPARENT) or
(Typ = TEXTURE_TYPE_COLORIZED) then
begin
- {$IFDEF FPC_LITTLE_ENDIAN}
- glTexImage2D(GL_TEXTURE_2D, 0, 4, newWidth, newHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, TexSurface.pixels);
- {$ELSE}
+ {$IFDEF FPC_BIG_ENDIAN}
glTexImage2D(GL_TEXTURE_2D, 0, 4, newWidth, newHeight, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, TexSurface.pixels);
+ {$ELSE}
+ glTexImage2D(GL_TEXTURE_2D, 0, 4, newWidth, newHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, TexSurface.pixels);
{$ENDIF}
end
else //if Typ = TEXTURE_TYPE_PLAIN then
begin
- {$IFDEF FPC_LITTLE_ENDIAN}
- glTexImage2D(GL_TEXTURE_2D, 0, 3, newWidth, newHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, TexSurface.pixels);
- {$ELSE}
+ {$IFDEF FPC_BIG_ENDIAN}
glTexImage2D(GL_TEXTURE_2D, 0, 3, newWidth, newHeight, 0, GL_BGR, GL_UNSIGNED_BYTE, TexSurface.pixels);
+ {$ELSE}
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, newWidth, newHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, TexSurface.pixels);
{$ENDIF}
end;
@@ -441,10 +441,10 @@ begin
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- {$IFDEF FPC_LITTLE_ENDIAN}
- glTexImage2D(GL_TEXTURE_2D, 0, 3, Width, Height, 0, GL_RGB, GL_UNSIGNED_BYTE, Data);
- {$ELSE}
+ {$IFDEF FPC_BIG_ENDIAN}
glTexImage2D(GL_TEXTURE_2D, 0, 3, Width, Height, 0, GL_BGR, GL_UNSIGNED_BYTE, Data);
+ {$ELSE}
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, Width, Height, 0, GL_RGB, GL_UNSIGNED_BYTE, Data);
{$ENDIF}
{