/* ==================================================================== Get nation index (position in list) ==================================================================== */ public static int nation_get_index(Nation nation) { int i; for (i = 0; i < nation_count; i++) if (nation == nations[i]) return i; return 0; }
/* ==================================================================== Get a specific pixel value in a nation's flag. ==================================================================== */ public int nation_get_flag_pixel(Nation nation, int x, int y) { return SDL_Surface.GetPixel(nation_flags, x, nation.flag_offset + y); }
public static SDL_Surface nation_draw_flag(Nation nation, SDL_Surface surf) { if (surf==null){ throw new Exception("the Surface is null"); } SDL_Surface.copy_image(surf,Nation.nation_flags,20,3,Nation.nation_flag_width, Nation.nation_flag_height,0,(Nation.nation_flags.h-nation.flag_offset-Nation.nation_flag_height)); return surf; }