diff --git a/osx/Scenario Editor/Blades of Exile Graphics b/osx/Scenario Editor/Blades of Exile Graphics index 1612f017..e1ef2a7c 100644 Binary files a/osx/Scenario Editor/Blades of Exile Graphics and b/osx/Scenario Editor/Blades of Exile Graphics differ diff --git a/osx/boe.graphics.cpp b/osx/boe.graphics.cpp index 729a75bb..20605ca6 100644 --- a/osx/boe.graphics.cpp +++ b/osx/boe.graphics.cpp @@ -2185,35 +2185,35 @@ void place_trim(short q,short r,location where,unsigned short ter_type) unsigned short to_right = coord_to_ter(where.x + 1,where.y); unsigned short below = coord_to_ter(where.x,where.y + 1); if (is_wall(to_left) && is_wall(above) && is_ground(to_right) && is_ground(below)) - draw_trim(q,r,11,ter_type); + draw_trim(q,r,11,to_right); if (is_wall(to_left) && is_wall(below) && is_ground(to_right) && is_ground(above)) - draw_trim(q,r,9,ter_type); + draw_trim(q,r,9,to_right); if (is_wall(to_right) && is_wall(above) && is_ground(to_left) && is_ground(below)) - draw_trim(q,r,10,ter_type); + draw_trim(q,r,10,to_left); if (is_wall(to_right) && is_wall(below) && is_ground(to_left) && is_ground(above)) - draw_trim(q,r,8,ter_type); + draw_trim(q,r,8,to_left); if (is_ground(to_left) && is_ground(above) && is_ground(to_right) && is_wall(below)) { - draw_trim(q,r,8,ter_type); - draw_trim(q,r,9,ter_type); + draw_trim(q,r,8,to_right); + draw_trim(q,r,9,to_right); } if (is_wall(to_left) && is_ground(below) && is_ground(to_right) && is_ground(above)) { - draw_trim(q,r,9,ter_type); - draw_trim(q,r,11,ter_type); + draw_trim(q,r,9,to_right); + draw_trim(q,r,11,to_right); } if (is_ground(to_right) && is_wall(above) && is_ground(to_left) && is_ground(below)) { - draw_trim(q,r,10,ter_type); - draw_trim(q,r,11,ter_type); + draw_trim(q,r,10,to_left); + draw_trim(q,r,11,to_left); } if (is_wall(to_right) && is_ground(below) && is_ground(to_left) && is_ground(above)) { - draw_trim(q,r,8,ter_type); - draw_trim(q,r,10,ter_type); + draw_trim(q,r,8,to_left); + draw_trim(q,r,10,to_left); } // } } @@ -2258,18 +2258,17 @@ void draw_trim(short q,short r,short which_trim,unsigned short ground_ter) OffsetRect(&trim_rects[11],98,18); int i; for(i = 0; i < 12; i++) OffsetRect(&trim_rects[i],112,36); - for(i = 0; i < 8 ; i++) OffsetRect(&walkway_rects[i],i*28,(i/4)*36); + for(i = 0; i < 8 ; i++) OffsetRect(&walkway_rects[i],(i%4)*28,(i/4)*36); OffsetRect(&walkway_rects[8],196,0); } - PixMapHandle store1,store2,store3; RGBColor test_color = {0,0,0}, store_color; if (frills_on == false) return; // if current ground is grass, forget trim - if ((current_ground == 2) && (which_trim < 3)) - return; +// if ((current_ground == 2) && (which_trim < 3)) +// return; terrain_there[q][r] = -1; GetBackColor(&store_color); @@ -2285,7 +2284,7 @@ void draw_trim(short q,short r,short which_trim,unsigned short ground_ter) unsigned short pic = scenario.ter_types[ground_ter].picture; if(pic < 400){ from_gworld = terrain_gworld[pic / 50]; - pic /= 50; + pic %= 50; OffsetRect(&from_rect,28 * (pic % 10), 36 * (pic / 10)); }else if(pic < 1000){ from_gworld = anim_gworld; @@ -2297,27 +2296,41 @@ void draw_trim(short q,short r,short which_trim,unsigned short ground_ter) from_rect = get_custom_rect(pic); } if(which_trim < 50) mask_rect = trim_rects[which_trim]; - else mask_rect = walkway_rects[which_trim]; + else mask_rect = walkway_rects[which_trim - 50]; to_rect = coord_to_rect(q,r); // to_rect.right = to_rect.left + trim_rects[which_mode].right; // to_rect.left = to_rect.left + trim_rects[which_mode].left; // to_rect.bottom = to_rect.top + trim_rects[which_mode].bottom; // to_rect.top = to_rect.top + trim_rects[which_mode].top; -// OffsetRect(&to_rect,-61,-37); + // OffsetRect(&to_rect,-61,-37); + if(which_trim == 0 || which_trim == 4 || which_trim == 6 || which_trim == 8 || which_trim == 10){ + from_rect.right -= 14; + to_rect.right -= 14; + }else if(which_trim == 1 || which_trim == 5 || which_trim == 7 || which_trim == 9 || which_trim == 11){ + from_rect.left += 14; + to_rect.left += 14; + } + if(which_trim == 2 || which_trim == 4 || which_trim == 5 || which_trim == 8 || which_trim == 9){ + from_rect.bottom -= 18; + to_rect.bottom -= 18; + }else if(which_trim == 3 || which_trim == 6 || which_trim == 7 || which_trim == 10 || which_trim == 11){ + from_rect.top += 18; + to_rect.top += 18; + } - store1 = GetPortPixMap(from_gworld); - store2 = GetPortPixMap(roads_gworld); - store3 = GetPortPixMap(terrain_screen_gworld); - LockPixels(store3); - LockPixels(store2); - LockPixels(store1); - CopyMask ((BitMap*) *store1, - (BitMap*) *store2, - (BitMap*) *store3, + PixMapHandle from_bits = GetPortPixMap(from_gworld); + PixMapHandle mask_bits = GetPortPixMap(roads_gworld); + PixMapHandle to_bits = GetPortPixMap(terrain_screen_gworld); + LockPixels(to_bits); + LockPixels(mask_bits); + LockPixels(from_bits); + CopyMask ((BitMap*) *from_bits, + (BitMap*) *mask_bits, + (BitMap*) *to_bits, &from_rect, &mask_rect, &to_rect); - UnlockPixels(store1); - UnlockPixels(store2); - UnlockPixels(store3); + UnlockPixels(from_bits); + UnlockPixels(mask_bits); + UnlockPixels(to_bits); RGBBackColor(&store_color); } diff --git a/osx/boe.graphutil.cpp b/osx/boe.graphutil.cpp index 66c52a29..5988db73 100644 --- a/osx/boe.graphutil.cpp +++ b/osx/boe.graphutil.cpp @@ -863,8 +863,8 @@ bool is_ground(unsigned short ter_type) return false; if(scenario.ter_types[ter_type].block_horse) return false; - if(scenario.ter_types[ter_type].trim_type == TRIM_WALKWAY) - return false; +// if(scenario.ter_types[ter_type].trim_type == TRIM_WALKWAY) +// return false; return true; // short pic; // diff --git a/osx/boe.specials.cpp b/osx/boe.specials.cpp index c8bc84bc..a41900a7 100644 --- a/osx/boe.specials.cpp +++ b/osx/boe.specials.cpp @@ -307,23 +307,29 @@ bool check_special_terrain(location where_check,short mode,short which_pc,short add_string_to_buf(" It doesn't affect you."); goto LBL_NO_DAMAGE; } + break; case DAMAGE_COLD: add_string_to_buf(" You feel cold!"); pic_type = 4; + break; case DAMAGE_MAGIC: case DAMAGE_UNBLOCKABLE: add_string_to_buf(" Something shocks you!"); pic_type = 1; + break; case DAMAGE_WEAPON: add_string_to_buf(" You feel pain!"); pic_type = 3; + break; case DAMAGE_POISON: add_string_to_buf(" You suddenly feel very ill for a moment..."); pic_type = 2; + break; case DAMAGE_UNDEAD: case DAMAGE_DEMON: add_string_to_buf(" A dark wind blows through you!"); pic_type = 1; // TODO: Verify that this is correct + break; } r1 = get_ran(ter_flag2,dam_type,ter_flag1); if (mode < 2) diff --git a/osx/classes/terrain.cpp b/osx/classes/terrain.cpp index 6d350a95..47a9de95 100644 --- a/osx/classes/terrain.cpp +++ b/osx/classes/terrain.cpp @@ -96,6 +96,22 @@ cTerrain& cTerrain::operator = (legacy::terrain_type_type& old){ }; picture = old.picture; blockage = old.blockage; + if(picture >= 260) combat_arena = 1; + else combat_arena = arenas[picture]; + if(picture < 260){ + ground_type = ground[picture]; + trim_type = (eTrimType) trims[picture]; + trim_ter = trim_ters[picture]; + }else if(picture >= 400 && picture < 1000){ + ground_type = ground[picture - 140]; + trim_type = (eTrimType) trims[picture - 140]; + trim_ter = trim_ters[picture - 140]; + }else{ // TODO: Implement new-style road and walkway handling, and deprecate picture 216. + ground_type = 255; + trim_type = TRIM_NONE; + trim_ter = 0; + } + if(trim_ter == 99) trim_ter = 0; flag1 = old.flag1; flag2 = old.flag2; switch(old.special){ @@ -238,22 +254,6 @@ cTerrain& cTerrain::operator = (legacy::terrain_type_type& old){ light_radius = old.light_radius; step_sound = old.step_sound; shortcut_key = old.shortcut_key; - if(picture >= 260) combat_arena = 1; - else combat_arena = arenas[picture]; - if(picture < 260){ - ground_type = ground[picture]; - trim_type = (eTrimType) trims[picture]; - trim_ter = trim_ters[picture]; - }else if(picture >= 400 && picture < 1000){ - ground_type = ground[picture - 140]; - trim_type = (eTrimType) trims[picture - 140]; - trim_ter = trim_ters[picture - 140]; - }else{ // TODO: Implement new-style road and walkway handling, and deprecate picture 216. - ground_type = 255; - trim_type = TRIM_NONE; - trim_ter = 0; - } - if(trim_ter == 99) trim_ter = 0; switch(picture){ // Rubbles, plus pentagram as a bonus case 68: