206 adiline2(
"LTS:%s:%s", _filename, lookedFilename );
208 unsigned char*
source =
stbi_load(lookedFilename, &width, &height, &depth, 0);
237 int count = (width/8)*(height/8);
238 if ( count < (_index+1) ) {
258 int firstTile = _index;
274 for( z=0; z<a; ++z ) {
275 for (y=0; y<(height>>3);++y) {
276 for (x=0; x<(width>>3);++x) {
279 unsigned char * realSource =
source + (y*8) * width * depth + (x*8) * depth;
281 unsigned char fontData[8];
282 memset( fontData, 0, 8 );
284 for(
int yy = 0; yy < 8; ++yy ) {
285 for(
int xx = 0; xx < 8; ++xx ) {
290 rgb.
red = *realSource;
291 rgb.
green = *(realSource + 1);
292 rgb.
blue = *(realSource + 2);
294 rgb.
alpha = *(realSource + 3);
298 if ( rgb.
alpha == 0 ) {
307 int bitmask = 1 << ( 7 - (xx & 0x7) );
310 *( fontData +
offset ) &= ~bitmask;
312 *( fontData +
offset ) |= bitmask;
319 realSource += ( width - 8 ) * depth;
323 if ( _index == -1 ) {
326 if ( firstTile == -1 ) {
337 memcpy( descriptors->
data[_index].
data, fontData, 8 );
355 if ( ( ( width >> 3 ) * ( height >> 3 ) * a ) > 0xffff ) {
367 ( ( width >> 3 ) << 8 ) |
368 ( ( height >> 3 ) << 16 ) |
void cpu_store_32bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 32 bit
Variable * variable_retrieve(Environment *_environment, char *_name)
int tile_allocate(TileDescriptors *_tiles, char *_data)
char * image_roll_y_down(Environment *_environment, char *_source, int _width, int _height)
char * image_flip_y(Environment *_environment, char *_source, int _width, int _height, int _depth)
TileDescriptor * calculate_tile_descriptor(TileData *_tileData)
char * image_roll_x_right(Environment *_environment, char *_source, int _width, int _height)
char * image_flip_x(Environment *_environment, char *_source, int _width, int _height, int _depth)
char * image_enlarge_right(Environment *_environment, char *_source, int _width, int _height, int _delta)
char * resource_load_asserts(Environment *_environment, char *_filename)
Variable * variable_temporary(Environment *_environment, VariableType _type, char *_meaning)
Define a temporary variable.
Offsetting * offsetting_size_count(Environment *_environment, int _size, int _count)
void font_descriptors_init(Environment *_environment, int _embedded_present)
char * image_enlarge_bottom(Environment *_environment, char *_source, int _width, int _height, int _delta)
STBIDEF void stbi_image_free(void *retval_from_stbi_load)
STBIDEF stbi_uc * stbi_load(char const *filename, int *x, int *y, int *channels_in_file, int desired_channels)
TileDescriptors * tilesets[MAX_TILESETS]
int tenLinerRulesEnforced
TileDescriptors * descriptors
TileDescriptor * descriptor[512]
Variable * tiles_load(Environment *_environment, char *_filename, int _flags, char *_tileset, int _index)
Emit code for LOAD TILE(...).
#define CRITICAL_10_LINE_RULES_ENFORCED(v)
struct _RGBi RGBi
Structure to store color components (red, green and blue).
#define CRITICAL_CANNOT_ALLOCATE_MORE_TILE()
struct _TileDescriptors TileDescriptors
struct _Variable Variable
Structure of a single variable.
struct _Environment Environment
Structure of compilation environment.
#define CRITICAL_TILE_LOAD_UNKNOWN_FORMAT(f)
#define CRITICAL_SANDBOX_ENFORCED(v)
#define CRITICAL_TILE_LOAD_ON_NON_TILESET(t)
#define CRITICAL_TILE_INVALID_HEIGHT(h)
#define CRITICAL_TILES_LOAD_IMAGE_TOO_BIG(v)
#define CRITICAL_TILE_INVALID_WIDTH(w)
#define adiline2(s, a, b)