Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
130 user(s) are online (122 user(s) are browsing Forums)

Members: 1
Guests: 129

rjd324, more...

Support us!

Headlines

 
  Register To Post  

« 1 (2)
Re: another port (was: need little help with big/little endian issues)
Home away from home
Home away from home


See User information
@all
To continue Endianes problem, i need some help again for my lame knowledge :)

Is "bit-shifting" (<< and >>) are endian unaware in end ?

What i mean is i have for example that kind of code:

// A8R8G8B8
struct sVec4;
struct sCompressedVec4
{
    
u32 argb;
 
    
void setA8R8G8B8 u32 value )
    {
        
argb value;
    }
 
    
void setColorf ( const video::SColorf color )
    {
        
argb core::floor32 color.255.f ) << 24 |
                
core::floor32 color.255.f ) << 16 |
                
core::floor32 color.255.f ) << 8  |
                
core::floor32 color.255.f );
    }
 
    
void setVec4 ( const sVec4 );
 
    
// f = a * t + b * ( 1 - t )
    
void interpolate(const sCompressedVec4a, const sCompressedVec4b, const f32 t)
    {
        
argb PixelBlend32 b.argba.argbcore::floor32 256.f ) );
    }
 
 
};


inline void sCompressedVec4::setVec4 ( const sVec4 )
{
    
argb core::floor32 v.255.f ) << 24 |
            
core::floor32 v.255.f ) << 16 |
            
core::floor32 v.255.f ) << 8  |
            
core::floor32 v.255.f );
}


void setA8R8G8B8 u32 argb )
{
        
= ( ( argb 0xFF000000 ) >> 24 ) * ( 1.f 255.f );
        
= ( ( argb 0x00FF0000 ) >> 16 ) * ( 1.f 255.f );
        
= ( ( argb 0x0000FF00 ) >>  ) * ( 1.f 255.f );
        
= ( ( argb 0x000000FF )       ) * ( 1.f 255.f );
}
 
void setR8G8B8 u32 argb )
{
        
= ( ( argb 0x00FF0000 ) >> 16 ) * ( 1.f 255.f );
        
= ( ( argb 0x0000FF00 ) >>  ) * ( 1.f 255.f );
        
= ( ( argb 0x000000FF )       ) * ( 1.f 255.f );
}


How it all should be done for PPC ? I mean all those << and >> seems like that all should be different for us.

Visually, problem with that code (well, i am not 100% sure that is _that_ code, but pretty possible, as only bit-shifting operations i find is those ones), looks like this:

On PPC (os4):

Resized Image

On X86 (win32)

Resized Image

As can be seen "terrain" scene (earth and sky) looks fine, but colors of the textures on the dwarf looks different. That why i think about those functions i quote..

Whole file is here: Vertex.h


Edited by kas1e on 2018/2/2 13:23:38
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: another port (was: need little help with big/little endian issues)
Just popping in
Just popping in


See User information
Hello Kas1e

Are you sure it is ARGB color space used and not RGBA?

I found this on Wikipedia : https://en.wikipedia.org/wiki/RGBA_color_space

Regards,

Go to top
Re: another port (was: need little help with big/little endian issues)
Just can't stay away
Just can't stay away


See User information
@Petrol

If the code is meant to run on little endian CPUs the format it uses is BGRA (little endian equivalent of ARGB).

As far as 32-bit RGB with alpha channel pixel formats go there are actually four different variants: ARGB, RGBA, BGRA and ABGR.

Go to top
Re: another port (was: need little help with big/little endian issues)
Home away from home
Home away from home


See User information
@kas1e

just fix it at load time, or convert it just after loading.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: another port (was: need little help with big/little endian issues)
Just can't stay away
Just can't stay away


See User information
@kas1e

Just sell it as a Shrek game.

Go to top
Re: another port (was: need little help with big/little endian issues)
Home away from home
Home away from home


See User information
@Capehill
:) Its not byte order which is wrong, its shrek ! Its not ports are bad, just they different ! :)

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: another port (was: need little help with big/little endian issues)
Not too shy to talk
Not too shy to talk


See User information
@kas1e

Hi.

I download and test Beret, don't works for me.

After a few seconds the Miggy hangsup, no error or DSI.

Tested some other SDL and GL games and all works fine, with the exception of beret and freedroidrpg, both jangs the computer.

Thanks

Virginio

P.D. Grafx2 2.5 works fine too.

AmigaOne X5000 OS4.1 FEU1 And Lubuntu 10.04
1200 towered with Blizzard PPC - BVision and Mediator
And a new fantastic Chameleon64
Go to top
Re: another port (was: need little help with big/little endian issues)
Home away from home
Home away from home


See User information
@RIBDEVIL
Proper bugreport requered, you know what it mean for sure :) Also you should be sure you use latest os4, with all normal stuff.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: another port (was: need little help with big/little endian issues)
Home away from home
Home away from home


See User information
Dwarf is not Shrek anymore :)

Resized Image

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post
« 1 (2)

 




Currently Active Users Viewing This Thread: 3 ( 0 members and 3 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project