void Block::Drawcreaturetext(){ t_SpriteWithOffset sprite; /*if(config.hide_outer_blocks){ if(x == ownerSegment->x || x == ownerSegment->x + ownerSegment->sizex - 1) return; if(y == ownerSegment->y || y == ownerSegment->y + ownerSegment->sizey - 1) return; }*/ int32_t drawx = x; int32_t drawy = y; int32_t drawz = z; //- ownerSegment->sizez + 1; correctBlockForSegmetOffset( drawx, drawy, drawz); correctBlockForRotation( drawx, drawy, drawz, ownerSegment->rotation); pointToScreen((int*)&drawx, (int*)&drawy, drawz); drawx -= TILEWIDTH>>1; // creature // ensure there is *some* creature according to the map data // (no guarantee it is the right one) if(creaturePresent && (config.show_hidden_blocks || !designation.bits.hidden)) { DrawCreatureText(drawx, drawy, creature); } }
void WorldSegment::DrawAllTiles() { if(!loaded) { return; } if(ssConfig.fogenable) { ALLEGRO_BITMAP* temp = al_get_target_bitmap(); if(!fog) { fog = al_create_bitmap(ssState.ScreenW, ssState.ScreenH); al_set_target_bitmap(fog); al_clear_to_color(premultiply(ssConfig.fogcol)); al_set_target_bitmap(temp); } if(!((al_get_bitmap_width(fog) == ssState.ScreenW) && (al_get_bitmap_height(fog) == ssState.ScreenH))) { al_destroy_bitmap(fog); fog = al_create_bitmap(ssState.ScreenW, ssState.ScreenH); al_set_target_bitmap(fog); al_clear_to_color(premultiply(ssConfig.fogcol)); al_set_target_bitmap(temp); } } if (ssConfig.show_osd) { DrawCurrentLevelOutline(true); } if(todraw.size()>0) { al_hold_bitmap_drawing(true); for(int i=0; i<todraw.size(); i++) { if(i%ssConfig.bitmapHolds==0) { al_hold_bitmap_drawing(false); al_hold_bitmap_drawing(true); } switch(todraw[i].type) { case TintedScaledBitmap: al_draw_tinted_scaled_bitmap( (ALLEGRO_BITMAP*) todraw[i].drawobject, todraw[i].tint, todraw[i].sx, todraw[i].sy, todraw[i].sw, todraw[i].sh, todraw[i].dx, todraw[i].dy, todraw[i].dw, todraw[i].dh, todraw[i].flags ); break; case CreatureText: DrawCreatureText( todraw[i].dx, todraw[i].dy, (SS_Unit*) todraw[i].drawobject ); break; } } } if (ssConfig.show_osd) { DrawCurrentLevelOutline(false); } al_hold_bitmap_drawing(false); al_hold_bitmap_drawing(true); }