Skip to content

Commit

Permalink
Updated Allegro to version 4.9.21
Browse files Browse the repository at this point in the history
  • Loading branch information
RosaryMala committed Jul 18, 2010
1 parent 9106204 commit 2fc5d2f
Show file tree
Hide file tree
Showing 71 changed files with 1,644 additions and 383 deletions.
69 changes: 31 additions & 38 deletions Block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ void Block::Draw(){
if(x == ownerSegment->x || x == ownerSegment->x + ownerSegment->sizex - 1) return;
if(y == ownerSegment->y || y == ownerSegment->y + ownerSegment->sizey - 1) return;
}*/
int op, src, dst, alpha_op, alpha_src, alpha_dst;
ALLEGRO_COLOR color;
al_get_separate_blender(&op, &src, &dst, &alpha_op, &alpha_src, &alpha_dst, &color);
int32_t drawx = x;
int32_t drawy = y;
int32_t drawz = z; //- ownerSegment->sizez + 1;
Expand Down Expand Up @@ -160,19 +157,19 @@ void Block::Draw(){
}
}

//draw surf
if(eff_oceanwave > 0)
{
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color*al_map_rgba(255, 255, 255, (255*eff_oceanwave)/100));
al_draw_bitmap(sprite_oceanwave, drawx, drawy - (WALLHEIGHT), 0);
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color);
}
if(eff_webing > 0)
{
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color*al_map_rgba(255, 255, 255, (255*eff_webing)/100));
al_draw_bitmap(sprite_webing, drawx, drawy - (WALLHEIGHT), 0);
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color);
}
////draw surf
//if(eff_oceanwave > 0)
//{
// al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color*al_map_rgba(255, 255, 255, (255*eff_oceanwave)/100));
// al_draw_tinted_bitmap(sprite_oceanwave, drawx, drawy - (WALLHEIGHT), 0);
// al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color);
//}
//if(eff_webing > 0)
//{
// al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color*al_map_rgba(255, 255, 255, (255*eff_webing)/100));
// al_draw_tinted_bitmap(sprite_webing, drawx, drawy - (WALLHEIGHT), 0);
// al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color);
//}
//Draw Ramp
if(ramp.type > 0){
spriteobject = GetBlockSpriteMap(ramp.type, material, consForm);
Expand All @@ -196,19 +193,19 @@ void Block::Draw(){
{
if(snowlevel > 75)
{
DrawSpriteFromSheet( 20, IMGObjectSheet, drawx, drawy );
DrawSpriteFromSheet( 20, IMGObjectSheet, al_map_rgb(255,255,255), drawx, drawy );
}
else if(snowlevel > 50)
{
DrawSpriteFromSheet( 21, IMGObjectSheet, drawx, drawy );
DrawSpriteFromSheet( 21, IMGObjectSheet, al_map_rgb(255,255,255), drawx, drawy );
}
else if(snowlevel > 25)
{
DrawSpriteFromSheet( 22, IMGObjectSheet, drawx, drawy );
DrawSpriteFromSheet( 22, IMGObjectSheet, al_map_rgb(255,255,255), drawx, drawy );
}
else if(snowlevel > 0)
{
DrawSpriteFromSheet( 23, IMGObjectSheet, drawx, drawy );
DrawSpriteFromSheet( 23, IMGObjectSheet, al_map_rgb(255,255,255), drawx, drawy );
}
}

Expand All @@ -224,7 +221,7 @@ void Block::Draw(){
//shadow
if (shadow > 0)
{
DrawSpriteFromSheet( BASE_SHADOW_TILE + shadow - 1, IMGObjectSheet, drawx, (ramp.type > 0)?(drawy - (WALLHEIGHT/2)):drawy );
DrawSpriteFromSheet( BASE_SHADOW_TILE + shadow - 1, IMGObjectSheet, al_map_rgb(255,255,255), drawx, (ramp.type > 0)?(drawy - (WALLHEIGHT/2)):drawy );
}

//Building
Expand Down Expand Up @@ -302,22 +299,22 @@ void Block::Draw(){

//if(waterlevel == 7) waterlevel--;

ALLEGRO_COLOR spatter;
if(water.type == 0)
{
if(bloodlevel == 0)
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color*al_map_rgb(168,248,248));
spatter = al_map_rgb(168,248,248);
else if(bloodlevel <= 255)
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color*partialBlend(al_map_rgb(168,248,248), bloodcolor, (bloodlevel*100/255)));
spatter = partialBlend(al_map_rgb(168,248,248), bloodcolor, (bloodlevel*100/255));
else
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color*bloodcolor);
spatter = bloodcolor;
spriteNum = SPRITEOBJECT_WATERLEVEL1 + waterlevel - 1;
}
else
{
spriteNum = SPRITEOBJECT_WATERLEVEL1_LAVA + waterlevel - 1;
}
DrawSpriteFromSheet( spriteNum, IMGObjectSheet, drawx, drawy );
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color);
DrawSpriteFromSheet( spriteNum, IMGObjectSheet, spatter, drawx, drawy );
}

// creature
Expand All @@ -333,15 +330,15 @@ void Block::Draw(){
{
if(snowlevel > 75)
{
DrawSpriteFromSheet( 24, IMGObjectSheet, drawx, drawy );
DrawSpriteFromSheet( 24, IMGObjectSheet, al_map_rgb(255,255,255), drawx, drawy );
}
else if(snowlevel > 50)
{
DrawSpriteFromSheet( 25, IMGObjectSheet, drawx, drawy );
DrawSpriteFromSheet( 25, IMGObjectSheet, al_map_rgb(255,255,255), drawx, drawy );
}
else if(snowlevel > 25)
{
DrawSpriteFromSheet( 26, IMGObjectSheet, drawx, drawy );
DrawSpriteFromSheet( 26, IMGObjectSheet, al_map_rgb(255,255,255), drawx, drawy );
}
}

Expand Down Expand Up @@ -391,7 +388,6 @@ void Block::Draw(){
//{
// draw_particle_cloud(eff_smoke, drawx, drawy - (SPRITEHEIGHT/2), SPRITEWIDTH, SPRITEHEIGHT, sprite_smoke);
//}
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color);
}

void Block::Drawcreaturetext(){
Expand Down Expand Up @@ -513,6 +509,7 @@ void drawFloorBlood ( Block *b, int32_t drawx, int32_t drawy )
t_occupancy occ = b->occ;
t_SpriteWithOffset sprite;

ALLEGRO_COLOR spatter;
int x = b->x, y = b->y, z = b->z;


Expand Down Expand Up @@ -564,20 +561,16 @@ void drawFloorBlood ( Block *b, int32_t drawx, int32_t drawy )
else
sprite.sheetIndex = 8;
}
int op, src, dst, alpha_op, alpha_src, alpha_dst;
ALLEGRO_COLOR color;
al_get_separate_blender(&op, &src, &dst, &alpha_op, &alpha_src, &alpha_dst, &color);
if(b->bloodlevel <=255)
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, al_map_rgba_f(b->bloodcolor.r, b->bloodcolor.g, b->bloodcolor.b, (b->bloodlevel/255.0f)));
spatter = al_map_rgba_f(b->bloodcolor.r, b->bloodcolor.g, b->bloodcolor.b, (b->bloodlevel/255.0f));
else
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, b->bloodcolor);
spatter = b->bloodcolor;

int sheetOffsetX = TILEWIDTH * (sprite.sheetIndex % SHEET_OBJECTSWIDE),
sheetOffsetY = 0;

al_draw_bitmap_region( IMGBloodSheet, sheetOffsetX, sheetOffsetY, TILEWIDTH, TILEHEIGHT+FLOORHEIGHT, drawx, drawy, 0);
al_set_separate_blender(op, src, dst, alpha_op, alpha_src, alpha_dst, color);
al_draw_bitmap_region( IMGBloodSheet, sheetOffsetX, sheetOffsetY+TILEHEIGHT+FLOORHEIGHT, TILEWIDTH, TILEHEIGHT+FLOORHEIGHT, drawx, drawy, 0);
al_draw_tinted_bitmap_region( IMGBloodSheet, spatter, sheetOffsetX, sheetOffsetY, TILEWIDTH, TILEHEIGHT+FLOORHEIGHT, drawx, drawy, 0);
al_draw_tinted_bitmap_region( IMGBloodSheet, al_map_rgb(255,255,255), sheetOffsetX, sheetOffsetY+TILEHEIGHT+FLOORHEIGHT, TILEWIDTH, TILEHEIGHT+FLOORHEIGHT, drawx, drawy, 0);
}
}

4 changes: 2 additions & 2 deletions Block.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ class Block
int16_t eff_smoke;
int16_t eff_dragonfire;
int16_t eff_fire;
int16_t eff_boiling;*/
int16_t eff_boiling;
int16_t eff_webing;
int16_t eff_oceanwave;
int16_t eff_oceanwave;*/
struct {
t_building info;
vector<c_sprite> sprites;
Expand Down
1 change: 0 additions & 1 deletion Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ void parseConfigLine( string line ){
if( line.find("[SEGMENTSIZE_Z") != -1){
int value = parseIntFromLine( "SEGMENTSIZE_Z", line );
if(value < 1) value = DEFAULT_SEGMENTSIZE_Z;
if(value > 255) value = 255;
config.segmentSize.z = value;
}

Expand Down
10 changes: 3 additions & 7 deletions Creatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,6 @@ bool IsCreatureVisible( t_creature* c ){
}

void DrawCreature(int drawx, int drawy, t_creature* creature ){
int op, src, dst, alpha_op, alpha_src, alpha_dst;
ALLEGRO_COLOR color;
al_get_separate_blender(&op, &src, &dst, &alpha_op, &alpha_src, &alpha_dst, &color);

vector<int> statusIcons;

//if(config.show_creature_happiness)
Expand Down Expand Up @@ -288,7 +284,7 @@ void DrawCreatureText(int drawx, int drawy, t_creature* creature ){
if( config.show_creature_names )
if (creature->name.nickname[0] && config.names_use_nick)
{
draw_textf_border(font, drawx, drawy-(WALLHEIGHT+al_get_font_line_height(font)), 0,
draw_textf_border(font, al_map_rgb(255,255,255), drawx, drawy-(WALLHEIGHT+al_get_font_line_height(font)), 0,
"%s", creature->name.nickname );
}
else if (creature->name.first_name[0])
Expand All @@ -298,14 +294,14 @@ void DrawCreatureText(int drawx, int drawy, t_creature* creature ){
buffer[127]=0;
ALLEGRO_USTR* temp = bufferToUstr(buffer, 128);
al_ustr_set_chr(temp, 0, charToUpper(al_ustr_get(temp, 0)));
draw_ustr_border(font, drawx, drawy-(WALLHEIGHT+al_get_font_line_height(font)), 0,
draw_ustr_border(font, al_map_rgb(255,255,255), drawx, drawy-(WALLHEIGHT+al_get_font_line_height(font)), 0,
temp );
al_ustr_free(temp);
}
else if (config.names_use_species)
{
if(!config.skipCreatureTypes)
draw_textf_border(font, drawx, drawy-(WALLHEIGHT+al_get_font_line_height(font)), 0,
draw_textf_border(font, al_map_rgb(255,255,255), drawx, drawy-(WALLHEIGHT+al_get_font_line_height(font)), 0,
"[%s]", contentLoader.Mats->race.at(creature->race).id);
}
}
Expand Down
Loading

0 comments on commit 2fc5d2f

Please sign in to comment.