21 #include "economy.h" |
21 #include "economy.h" |
22 #include "newgrf_engine.h" |
22 #include "newgrf_engine.h" |
23 #include "vehicle.h" |
23 #include "vehicle.h" |
24 #include "newgrf_text.h" |
24 #include "newgrf_text.h" |
25 #include "table/sprites.h" |
25 #include "table/sprites.h" |
|
26 #include "fontcache.h" |
26 #include "date.h" |
27 #include "date.h" |
27 #include "currency.h" |
28 #include "currency.h" |
28 #include "sound.h" |
29 #include "sound.h" |
29 #include "newgrf_sound.h" |
30 #include "newgrf_sound.h" |
30 #include "newgrf_spritegroup.h" |
31 #include "newgrf_spritegroup.h" |
3033 return; |
3034 return; |
3034 |
3035 |
3035 default: |
3036 default: |
3036 se->file_size = 0; |
3037 se->file_size = 0; |
3037 return; |
3038 return; |
|
3039 } |
|
3040 } |
|
3041 } |
|
3042 |
|
3043 /* Action 0x12 */ |
|
3044 static void LoadFontGlyph(byte *buf, int len) |
|
3045 { |
|
3046 /* <12> <num_def> <font_size> <num_char> <base_char> |
|
3047 * |
|
3048 * B num_def Number of definitions |
|
3049 * B font_size Size of font (0 = normal, 1 = small, 2 = large) |
|
3050 * B num_char Number of consecutive glyphs |
|
3051 * W base_char First character index */ |
|
3052 |
|
3053 uint8 num_def; |
|
3054 uint i; |
|
3055 |
|
3056 buf++; len--; |
|
3057 check_length(len, 1, "LoadFontGlyph"); |
|
3058 |
|
3059 num_def = grf_load_byte(&buf); |
|
3060 |
|
3061 check_length(len, 1 + num_def * 4, "LoadFontGlyph"); |
|
3062 |
|
3063 for (i = 0; i < num_def; i++) { |
|
3064 FontSize size = grf_load_byte(&buf); |
|
3065 uint8 num_char = grf_load_byte(&buf); |
|
3066 uint16 base_char = grf_load_word(&buf); |
|
3067 uint c; |
|
3068 |
|
3069 DEBUG(grf, 7) ("LoadFontGlyph: Loading %u glyph(s) at 0x%04X for size %u", num_char, base_char, size); |
|
3070 |
|
3071 for (c = 0; c < num_char; c++) { |
|
3072 SetUnicodeGlyph(size, base_char + c, _cur_spriteid); |
|
3073 LoadNextSprite(_cur_spriteid++, _file_index); |
|
3074 _nfo_line++; |
3038 } |
3075 } |
3039 } |
3076 } |
3040 } |
3077 } |
3041 |
3078 |
3042 /* 'Action 0xFF' */ |
3079 /* 'Action 0xFF' */ |
3419 /* 0x0D */ { NULL, ParamSet, ParamSet, }, |
3456 /* 0x0D */ { NULL, ParamSet, ParamSet, }, |
3420 /* 0x0E */ { NULL, GRFInhibit, GRFInhibit, }, |
3457 /* 0x0E */ { NULL, GRFInhibit, GRFInhibit, }, |
3421 /* 0x0F */ { NULL, NULL, NULL, }, |
3458 /* 0x0F */ { NULL, NULL, NULL, }, |
3422 /* 0x10 */ { DefineGotoLabel, NULL, NULL, }, |
3459 /* 0x10 */ { DefineGotoLabel, NULL, NULL, }, |
3423 /* 0x11 */ { NULL, NULL, GRFSound, }, |
3460 /* 0x11 */ { NULL, NULL, GRFSound, }, |
|
3461 /* 0x12 */ { NULL, NULL, LoadFontGlyph, }, |
3424 }; |
3462 }; |
3425 |
3463 |
3426 byte* buf; |
3464 byte* buf; |
3427 byte action; |
3465 byte action; |
3428 |
3466 |