src/table/industry_land.h
branchcpp_gui
changeset 6308 646711c5feaa
parent 6307 f40e88cff863
child 7245 f868248ecf83
equal deleted inserted replaced
6307:f40e88cff863 6308:646711c5feaa
     1 /* $Id$ */
     1 /* $Id$ */
     2 
     2 
     3 /** @file industry_land.h */
     3 /** @file industry_land.h */
     4 
     4 
     5 struct DrawIndustrySpec1Struct {
     5 /**
     6 	byte x;
     6  * This is used to gather some data about animation
     7 	byte image_1;
     7  * drawing in the industry code
     8 	byte image_2;
     8  * Image_1-2-3 are in fact only offset in the sprites
     9 	byte image_3;
     9  * used by the industry.
       
    10  * To specify an invalid one, either 255 or 0 is used,
       
    11  * depending of the industry.
       
    12  */
       
    13 struct DrawIndustryAnimationStruct {
       
    14 	int x;        ///< coordinate x of the first image offset
       
    15 	byte image_1; ///< image offset 1
       
    16 	byte image_2; ///< image offset 2
       
    17 	byte image_3; ///< image offset 3
    10 };
    18 };
    11 
    19 
    12 struct DrawIndustrySpec4Struct {
    20 /**
    13 	byte image_1;
    21  * Simple structure gathering x,y coordinates for
    14 	byte image_2;
    22  * industries animations
    15 	byte image_3;
    23  */
       
    24 struct DrawIndustryCoordinates {
       
    25 	byte x;  ///< coordinate x of the pair
       
    26 	byte y;  ///< coordinate y of the pair
    16 };
    27 };
    17 
       
    18 
    28 
    19 /**
    29 /**
    20  * Macro to ease the declaration of the array
    30  * Macro to ease the declaration of the array
    21  * @param s1 sprite ID of ground sprite
    31  * @param s1 sprite ID of ground sprite
    22  * @param p1 palette ID of ground sprite
    32  * @param p1 palette ID of ground sprite
   732 	M(     0xf8d, PAL_NONE,     0x12a5 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE,  0,  0, 16, 16,  50, 1),
   742 	M(     0xf8d, PAL_NONE,     0x12a5 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE,  0,  0, 16, 16,  50, 1),
   733 	M(     0xf8d, PAL_NONE,     0x12a5 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE,  0,  0, 16, 16,  50, 1),
   743 	M(     0xf8d, PAL_NONE,     0x12a5 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE,  0,  0, 16, 16,  50, 1),
   734 	M(     0xf8d, PAL_NONE,     0x12a5 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE,  0,  0, 16, 16,  50, 1),
   744 	M(     0xf8d, PAL_NONE,     0x12a5 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE,  0,  0, 16, 16,  50, 1),
   735 	M(     0xf8d, PAL_NONE,     0x12a5 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE,  0,  0, 16, 16,  50, 1),
   745 	M(     0xf8d, PAL_NONE,     0x12a5 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE,  0,  0, 16, 16,  50, 1),
   736 };
   746 };
       
   747 #undef M
   737 
   748 
   738 /* this is ONLY used for Sugar Mine*/
   749 /* this is ONLY used for Sugar Mine*/
   739 static const DrawIndustrySpec1Struct _draw_industry_spec1[96] = {
   750 static const DrawIndustryAnimationStruct _draw_industry_spec1[96] = {
   740 	{  8,   4,   0,   0},
   751 	{  8,   4,   0,   0},
   741 	{  6,   0,   1,   0},
   752 	{  6,   0,   1,   0},
   742 	{  4,   0,   2,   0},
   753 	{  4,   0,   2,   0},
   743 	{  6,   0,   3,   0},
   754 	{  6,   0,   3,   0},
   744 	{  8,   0,   4,   0},
   755 	{  8,   0,   4,   0},
   834 	{ 12,   4,   0,   4},
   845 	{ 12,   4,   0,   4},
   835 	{ 10,   4,   0,   4},
   846 	{ 10,   4,   0,   4},
   836 };
   847 };
   837 
   848 
   838 /* this is ONLY used for Sugar Mine*/
   849 /* this is ONLY used for Sugar Mine*/
   839 static const byte _drawtile_proc1_x[5] = {
   850 static const DrawIndustryCoordinates _drawtile_proc1[5] = {
   840 	22, 17, 14, 10, 8
   851 	{22, 73},
       
   852 	{17, 70},
       
   853 	{14, 69},
       
   854 	{10, 66},
       
   855 	{ 8, 41},
   841 };
   856 };
   842 
   857 
   843 /* this is ONLY used for Sugar Mine*/
   858 /** this is ONLY used for Toy Factory.
   844 static const byte _drawtile_proc1_y[5] = {
   859  * 255 means no drawing
   845 	73, 70, 69, 66, 41
   860  * @param img1 offset from base sprite SPR_IT_SUGAR_MINE_SIEVE
       
   861  * @param img2 offset from base sprite SPR_IT_SUGAR_MINE_CLOUDS
       
   862  * @param img3 offset from base sprite SPR_IT_SUGAR_MINE_PILE
       
   863  */
       
   864 #define MD( img1, img2, img3) { (50 - img1 * 2), img1, img2, img3 }
       
   865 static const DrawIndustryAnimationStruct _industry_anim_offs_toys[] = {
       
   866 	MD(255, 255,   0),
       
   867 	MD(  0, 255,   0),
       
   868 	MD(  1, 255,   0),
       
   869 	MD(  2, 255,   0),
       
   870 	MD(  3, 255,   0),
       
   871 	MD(  4, 255,   0),
       
   872 	MD(  5, 255,   0),
       
   873 	MD(  6, 255,   0),
       
   874 	MD(  7, 255,   0),
       
   875 	MD(  8, 255,   0),
       
   876 	MD(  9, 255,   0),
       
   877 	MD( 10, 255,   0),
       
   878 	MD( 11, 255,   0),
       
   879 	MD( 12, 255,   0),
       
   880 	MD( 13, 255,   0),
       
   881 	MD( 14, 255,   0),
       
   882 	MD( 15, 255,   0),
       
   883 	MD( 16, 255,   0),
       
   884 	MD( 17, 255,   0),
       
   885 	MD( 18, 255,   0),
       
   886 	MD( 18, 255,   1),
       
   887 	MD( 18, 255,   2),
       
   888 	MD( 18, 255,   4),
       
   889 	MD( 18, 255,   6),
       
   890 	MD( 18, 255,   8),
       
   891 	MD( 18, 255,  11),
       
   892 	MD( 18, 255,  14),
       
   893 	MD( 18, 255,  17),
       
   894 	MD( 18, 255,  20),
       
   895 	MD( 18, 255,  24),
       
   896 	MD(255,   0,  29),
       
   897 	MD(255,   0,  24),
       
   898 	MD(255,   0,  20),
       
   899 	MD(255,   0,  17),
       
   900 	MD(255,   0,  14),
       
   901 	MD(255,   0,  11),
       
   902 	MD(255,   0,   8),
       
   903 	MD(255,   0,   6),
       
   904 	MD(255,   0,   4),
       
   905 	MD(255,   0,   2),
       
   906 	MD(255,   0,   1),
       
   907 	MD(255,   1,   0),
       
   908 	MD(255,   2,   0),
       
   909 	MD(255,   3,   0),
       
   910 	MD(255,   4,   0),
       
   911 	MD(255,   5,   0),
       
   912 	MD(255,   6,   0),
       
   913 	MD(255,   7,   0),
       
   914 	MD(255,   8,   0),
       
   915 	MD(255, 255,   0),
   846 };
   916 };
   847 
   917 #undef MD
   848 /* this is ONLY used for Toy Factory*/
       
   849 static const DrawIndustrySpec4Struct _industry_anim_offs_3[] = {
       
   850 	{255, 255,   0},
       
   851 	{  0, 255,   0},
       
   852 	{  1, 255,   0},
       
   853 	{  2, 255,   0},
       
   854 	{  3, 255,   0},
       
   855 	{  4, 255,   0},
       
   856 	{  5, 255,   0},
       
   857 	{  6, 255,   0},
       
   858 	{  7, 255,   0},
       
   859 	{  8, 255,   0},
       
   860 	{  9, 255,   0},
       
   861 	{ 10, 255,   0},
       
   862 	{ 11, 255,   0},
       
   863 	{ 12, 255,   0},
       
   864 	{ 13, 255,   0},
       
   865 	{ 14, 255,   0},
       
   866 	{ 15, 255,   0},
       
   867 	{ 16, 255,   0},
       
   868 	{ 17, 255,   0},
       
   869 	{ 18, 255,   0},
       
   870 	{ 18, 255,   1},
       
   871 	{ 18, 255,   2},
       
   872 	{ 18, 255,   4},
       
   873 	{ 18, 255,   6},
       
   874 	{ 18, 255,   8},
       
   875 	{ 18, 255,  11},
       
   876 	{ 18, 255,  14},
       
   877 	{ 18, 255,  17},
       
   878 	{ 18, 255,  20},
       
   879 	{ 18, 255,  24},
       
   880 	{255,   0,  29},
       
   881 	{255,   0,  24},
       
   882 	{255,   0,  20},
       
   883 	{255,   0,  17},
       
   884 	{255,   0,  14},
       
   885 	{255,   0,  11},
       
   886 	{255,   0,   8},
       
   887 	{255,   0,   6},
       
   888 	{255,   0,   4},
       
   889 	{255,   0,   2},
       
   890 	{255,   0,   1},
       
   891 	{255,   1,   0},
       
   892 	{255,   2,   0},
       
   893 	{255,   3,   0},
       
   894 	{255,   4,   0},
       
   895 	{255,   5,   0},
       
   896 	{255,   6,   0},
       
   897 	{255,   7,   0},
       
   898 	{255,   8,   0},
       
   899 	{255, 255,   0},
       
   900 };
       
   901 
   918 
   902 /* this is ONLY used for Toffee Quarry*/
   919 /* this is ONLY used for Toffee Quarry*/
   903 static const byte _industry_anim_offs[] = {
   920 static const byte _industry_anim_offs_toffee[] = {
   904 	255,   0,   0,   0,   2,   4,   6,   8,  10,   9,
   921 	255,   0,   0,   0,   2,   4,   6,   8,  10,   9,
   905 	  7,   5,   3,   1, 255,   0,   0,   0,   2,   4,
   922 	  7,   5,   3,   1, 255,   0,   0,   0,   2,   4,
   906 	  6,   8,  10,   9,   7,   5,   3,   1, 255,   0,
   923 	  6,   8,  10,   9,   7,   5,   3,   1, 255,   0,
   907 	  0,   0,   2,   4,   6,   8,  10,   9,   7,   5,
   924 	  0,   0,   2,   4,   6,   8,  10,   9,   7,   5,
   908 	  3,   1, 255,   0,   0,   0,   2,   4,   6,   8,
   925 	  3,   1, 255,   0,   0,   0,   2,   4,   6,   8,
   909 	 10,   9,   7,   5,   3,   1, 255,   0,   0,   0,
   926 	 10,   9,   7,   5,   3,   1, 255,   0,   0,   0,
   910 	  2,   4,   6,   8,  10,   9,   7,   5,   3,   1
   927 	  2,   4,   6,   8,  10,   9,   7,   5,   3,   1
   911 };
   928 };
   912 
   929 
   913 /* this is ONLY used for the Bubble Generator*/
   930 /* this is ONLY used for the Bubble Generator*/
   914 static const byte _industry_anim_offs_2[] = {
   931 static const byte _industry_anim_offs_bubbles[] = {
   915 	68, 69, 71, 74, 77, 80, 83, 85, 86, 86,
   932 	68, 69, 71, 74, 77, 80, 83, 85, 86, 86,
   916 	86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
   933 	86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
   917 	86, 86, 85, 84, 83, 82, 81, 80, 79, 78,
   934 	86, 86, 85, 84, 83, 82, 81, 80, 79, 78,
   918 	77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
   935 	77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
   919 };
   936 };
   920 
   937 
   921 /* those are ONLY used for Power Station*/
   938 /**
   922 static const byte _coal_plant_sparks_x[] = {11, 11, 14, 13, 18, 15};
   939  * Movement of the sparks , only used for Power Station
   923 static const byte _coal_plant_sparks_y[] = {23, 11,  6,  3,  1,  0};
   940  */
       
   941 static const DrawIndustryCoordinates _coal_plant_sparks[] = {
       
   942 	{11, 23},
       
   943 	{11, 11},
       
   944 	{14,  6},
       
   945 	{13,  3},
       
   946 	{18,  1},
       
   947 	{15,  0},
       
   948 };
       
   949