Rev 6265 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6265 | Rev 6784 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | 3 | ||
4 | #ifndef INCLUDE_MATH_H |
4 | #ifndef INCLUDE_MATH_H |
5 | #include "../lib/math.h" |
5 | #include "../lib/math.h" |
Line 6... | Line 6... | ||
6 | #endif |
6 | #endif |
7 | 7 | ||
8 | #ifndef INCLUDE_FS_H |
8 | #ifndef INCLUDE_IO_H |
Line 9... | Line 9... | ||
9 | #include "../lib/obj/fs.h" |
9 | #include "../lib/io.h" |
Line 178... | Line 178... | ||
178 | byte Cp866ToAnsi(byte s) { |
178 | byte Cp866ToAnsi(byte s) { |
179 | IF(s>=128)&&(s<=175)s+=64; |
179 | IF(s>=128)&&(s<=175)s+=64; |
180 | ELSE IF(s>=224)&&(s<=239)s+=16; |
180 | ELSE IF(s>=224)&&(s<=239)s+=16; |
181 | ELSE IF(s==241)s=184; //e rus with dots (yo) |
181 | ELSE IF(s==241)s=184; //e rus with dots (yo) |
182 | ELSE IF(s==240)s=168; //E rus with dots (yo) |
182 | ELSE IF(s==240)s=168; //E rus with dots (yo) |
183 | ELSE IF(s==242)s='E'; //E urk (ye) |
183 | ELSE IF(s==242)s='E'; //E ukr (ye) |
184 | ELSE IF(s==243)s=186; //e urk (ye) |
184 | ELSE IF(s==243)s=186; //e ukr (ye) |
185 | ELSE IF(s==244)s='I'; //I urk (yi) |
185 | ELSE IF(s==244)s='I'; //I ukr (yi) |
186 | ELSE IF(s==245)s=191; //i urk (yi) |
186 | ELSE IF(s==245)s=191; //i ukr (yi) |
187 | return s; |
187 | return s; |
188 | } |
188 | } |
Line 189... | Line 189... | ||
189 | 189 | ||
190 | :byte LABEL::init(dword font_path) |
190 | :byte LABEL::init(dword font_path) |
191 | { |
191 | { |
192 | lib_init_fs(); |
192 | IO label_io; |
193 | IF(font)free(font); |
193 | IF(font)free(font); |
194 | IF(!fs.read(font_path)) { |
- | |
195 | debug("Error while loading font: "); |
194 | label_io.read(font_path); |
196 | debugln(font_path); |
195 | IF(!EAX) { |
197 | //io.run("/sys/@notify","'Error: Font is not loaded.' -E"); |
196 | notify("'Error: KFONT is not loaded.' -E"); |
198 | return false; |
197 | return false; |
199 | } |
198 | } |
200 | font_begin = font = EAX; |
- | |
201 | EBX = font_begin + ECX; |
199 | font_begin = font = label_io.buffer_data; |
202 | height = DSBYTE[EBX-1]; |
200 | height = DSBYTE[calc(font_begin+label_io.FILES_SIZE)-1]; |
203 | width = DSBYTE[EBX-2]; |
201 | width = DSBYTE[calc(font_begin+label_io.FILES_SIZE)-2]; |
204 | block = math.ceil(height*width/32); |
202 | block = math.ceil(height*width/32); |
205 | smooth = true; |
203 | smooth = true; |
206 | return true; |
204 | return true; |