Difference between revisions of "Floorplan Object Exchange"

From LinuxMCE
Jump to: navigation, search
 
Line 9: Line 9:
 
Color is stored as "int" (which happens to be 32 bit on 32 bit platforms)
 
Color is stored as "int" (which happens to be 32 bit on 32 bit platforms)
  
If Color is non-zero, OrbiterRenderer::ReplaceColorInRectangle is called to replace the magenta pixers with the new color. Somehow, sometimes the red and blue channels in RGB are flipped, resulting in wrong colors on the floorplan. This method is overridden in OrbiterRenderer_OpenGL and OrbiterRenderer_SDL.
+
If Color is non-zero, OrbiterRenderer::ReplaceColorInRectangle is called to replace the magenta pixers with the new color. Somehow, sometimes the red and blue channels in RGB are flipped, resulting in wrong colors on the floorplan (possibly fixed in SVN rev #22795). This method is overridden in OrbiterRenderer_OpenGL and OrbiterRenderer_SDL.
  
 
In OrbiterRenderer_SDL, there are ifdefs to change behavior on the Nokia N8xx, which uses 16 bits of color, not 32.
 
In OrbiterRenderer_SDL, there are ifdefs to change behavior on the Nokia N8xx, which uses 16 bits of color, not 32.
  
 
The values for rshift, gshift, bshift are defined in src/SDL_Helpers/SDL_Defs.h based on what SDL claims the byte order is.
 
The values for rshift, gshift, bshift are defined in src/SDL_Helpers/SDL_Defs.h based on what SDL claims the byte order is.

Latest revision as of 22:39, 22 February 2010

Notes on how Orbiter exchanges the color of objects in the floorplan

File: src/Orbiter/Orbiter.cpp Function: Orbiter::RenderFloorplan

DCE::CMD_Get_Current_Floorplan is used to retrieve the Floorplan data: Color, Status, OSD, PK_DesignObj_Toolbar

Color is stored as "int" (which happens to be 32 bit on 32 bit platforms)

If Color is non-zero, OrbiterRenderer::ReplaceColorInRectangle is called to replace the magenta pixers with the new color. Somehow, sometimes the red and blue channels in RGB are flipped, resulting in wrong colors on the floorplan (possibly fixed in SVN rev #22795). This method is overridden in OrbiterRenderer_OpenGL and OrbiterRenderer_SDL.

In OrbiterRenderer_SDL, there are ifdefs to change behavior on the Nokia N8xx, which uses 16 bits of color, not 32.

The values for rshift, gshift, bshift are defined in src/SDL_Helpers/SDL_Defs.h based on what SDL claims the byte order is.