static int shadow_tag(uint32_t *output, int olen, const char *attrib, const char *value) { if(!strcasecmp(attrib, "displacement")) return add_one_code(TR_CODE_SHADOW | MIN(atoi(value), 10), output, olen); if(!strcasecmp(attrib, "color")) return add_one_code(TR_CODE_SHADOW_COLOR | makecolor(value), output, olen); return olen; }
static int outline_tag(uint32_t *output, int olen, const char *attrib, const char *value) { if(!strcasecmp(attrib, "size")) return add_one_code(TR_CODE_OUTLINE | MIN(atoi(value), 10), output, olen); if(!strcasecmp(attrib, "color")) return add_one_code(TR_CODE_OUTLINE_COLOR | makecolor(value), output, olen); return olen; }
void terminal_initialize() { terminal_row = 0; terminal_column = 0; terminal_color = makecolor(COLOR_LIGHT_GREY, COLOR_BLACK); terminal_buffer = (TwoBytes*) 0xB8000; for (size_t y = 0; y < VGA_HEIGHT; y++) { for (size_t x = 0; x < VGA_WIDTH; x++) { terminal_buffer[y * VGA_WIDTH + x] = make_vgaentry(' ', terminal_color); }; }; };
static int font_tag(uint32_t *output, int olen, const char *attrib, const char *value) { if(!strcasecmp(attrib, "size")) return add_one_code(TR_CODE_FONT_SIZE | MAX(MIN(atoi(value), 7), 1), output, olen); if(!strcasecmp(attrib, "face")) return add_one_code(TR_CODE_FONT_FAMILY | freetype_family_id(value), output, olen); if(!strcasecmp(attrib, "color")) return add_one_code(TR_CODE_COLOR | makecolor(value), output, olen); return olen; }
/*Cria um passageiro novo com os parametros passados. */ Entity criaPassageiro(Vetor pos, Vetor vel, int mass) { Entity ent; int raio; unsigned long cor; /*Calculamos o raio do passageiro, que e' tido como uma forma circular, e a cor, para entao criar ele...*/ raio = round( (double)mass/10 ); cor = makecolor(rand()%195, rand()%195, rand()%195); ent = criaEntidade(pos, vel, mass, NULL, raio, PASS, cor, updatePassageiro, drawPassageiro, colisaoPassageiro, clearSimpleData ); return ent; }
/*Cria um Bote novo com os parametros passados. */ Entity criaBote( Vetor pos, Vetor vel )/*TESTAR*/ { Entity ent; Rect Medidas; unsigned long cor, raio; Medidas = criaRect(BOTE_BASE, BOTE_ALTURA); raio = getRaioBote( BOTE_BASE, BOTE_ALTURA ); cor = makecolor( 250, 90, 90); ent = criaEntidade(pos, vel, BOTE_MASS, Medidas, raio, BOTE, cor, updateBote, drawBote, colisaoBote, clearSimpleData ); return ent; }