SetPalette() => GFX2_SetPalette()
This commit is contained in:
		
							parent
							
								
									3d53a91046
								
							
						
					
					
						commit
						6550e704fc
					
				@ -54,11 +54,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#if defined(__macosx__)
 | 
					#if defined(__macosx__)
 | 
				
			||||||
#import <CoreFoundation/CoreFoundation.h>
 | 
					#import <CoreFoundation/CoreFoundation.h>
 | 
				
			||||||
/* defining __QD__ is a cheat to avoid :
 | 
					 | 
				
			||||||
screen.h:58: error: conflicting types for 'SetPalette'
 | 
					 | 
				
			||||||
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Palettes.h:150: error: previous declaration of 'SetPalette' was here
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
#define __QD__
 | 
					 | 
				
			||||||
#import <ApplicationServices/ApplicationServices.h>
 | 
					#import <ApplicationServices/ApplicationServices.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -2241,7 +2241,7 @@ static int Color_cycling(void)
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    SetPalette(palette, 0, 256);
 | 
					    GFX2_SetPalette(palette, 0, 256);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -168,8 +168,6 @@ word Count_used_colors_area(dword* usage, word start_x, word start_y,
 | 
				
			|||||||
// It is not always Main_palette ! (for example during a preview)
 | 
					// It is not always Main_palette ! (for example during a preview)
 | 
				
			||||||
// external code must not modify this array but use Set_palette() / Set_color()
 | 
					// external code must not modify this array but use Set_palette() / Set_color()
 | 
				
			||||||
// Get_current_palette() offers a READ-ONLY access.
 | 
					// Get_current_palette() offers a READ-ONLY access.
 | 
				
			||||||
// TODO : Color cycling code use directly SDL_SetPalette() we should check
 | 
					 | 
				
			||||||
//        wether it should call Set_palette() instead.
 | 
					 | 
				
			||||||
static T_Palette Current_palette;
 | 
					static T_Palette Current_palette;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const T_Components * Get_current_palette(void)
 | 
					const T_Components * Get_current_palette(void)
 | 
				
			||||||
@ -188,7 +186,7 @@ void Set_palette(T_Palette palette)
 | 
				
			|||||||
    palette[i].G = Round_palette_component(palette[i].G);
 | 
					    palette[i].G = Round_palette_component(palette[i].G);
 | 
				
			||||||
    palette[i].B = Round_palette_component(palette[i].B);
 | 
					    palette[i].B = Round_palette_component(palette[i].B);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  SetPalette(palette,0,256);
 | 
					  GFX2_SetPalette(palette, 0, 256);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Set_color(byte color, byte red, byte green, byte blue)
 | 
					void Set_color(byte color, byte red, byte green, byte blue)
 | 
				
			||||||
@ -196,7 +194,7 @@ void Set_color(byte color, byte red, byte green, byte blue)
 | 
				
			|||||||
  Current_palette[color].R = red;
 | 
					  Current_palette[color].R = red;
 | 
				
			||||||
  Current_palette[color].G = green;
 | 
					  Current_palette[color].G = green;
 | 
				
			||||||
  Current_palette[color].B = blue;
 | 
					  Current_palette[color].B = blue;
 | 
				
			||||||
  SetPalette(Current_palette + color, color, 1);
 | 
					  GFX2_SetPalette(Current_palette + color, color, 1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Wait_end_of_click(void)
 | 
					void Wait_end_of_click(void)
 | 
				
			||||||
 | 
				
			|||||||
@ -58,7 +58,7 @@ void Update_rect(short x, short y, unsigned short width, unsigned short height);
 | 
				
			|||||||
void Flush_update(void);
 | 
					void Flush_update(void);
 | 
				
			||||||
void Update_status_line(short char_pos, short width);
 | 
					void Update_status_line(short char_pos, short width);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int SetPalette(const T_Components * colors, int firstcolor, int ncolors);
 | 
					int GFX2_SetPalette(const T_Components * colors, int firstcolor, int ncolors);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
///
 | 
					///
 | 
				
			||||||
/// Clears the parts of screen that are outside of the editing area.
 | 
					/// Clears the parts of screen that are outside of the editing area.
 | 
				
			||||||
 | 
				
			|||||||
@ -469,7 +469,7 @@ void Get_SDL_Palette(const SDL_Palette * sdl_palette, T_Palette palette)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int SetPalette(const T_Components * colors, int firstcolor, int ncolors)
 | 
					int GFX2_SetPalette(const T_Components * colors, int firstcolor, int ncolors)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  int i;
 | 
					  int i;
 | 
				
			||||||
  SDL_Color PaletteSDL[256];
 | 
					  SDL_Color PaletteSDL[256];
 | 
				
			||||||
 | 
				
			|||||||
@ -636,7 +636,7 @@ void Update_status_line(short char_pos, short width)
 | 
				
			|||||||
              width*8*Menu_factor_X, 8*Menu_factor_Y);
 | 
					              width*8*Menu_factor_X, 8*Menu_factor_Y);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int SetPalette(const T_Components * colors, int firstcolor, int ncolors)
 | 
					int GFX2_SetPalette(const T_Components * colors, int firstcolor, int ncolors)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  int i;
 | 
					  int i;
 | 
				
			||||||
  RGBQUAD rgb[256];
 | 
					  RGBQUAD rgb[256];
 | 
				
			||||||
 | 
				
			|||||||
@ -240,7 +240,7 @@ void Screen_FillRect(int x, int y, int w, int h, byte color)
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int SetPalette(const T_Components * colors, int firstcolor, int ncolors)
 | 
					int GFX2_SetPalette(const T_Components * colors, int firstcolor, int ncolors)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  if (screen == NULL) return 0;
 | 
					  if (screen == NULL) return 0;
 | 
				
			||||||
  memcpy(screen->palette + firstcolor, colors, ncolors * sizeof(T_Components));
 | 
					  memcpy(screen->palette + firstcolor, colors, ncolors * sizeof(T_Components));
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user