|
18 | 18 | /******************************************************************************/ |
19 | 19 | #include "engindrwlst.h" |
20 | 20 |
|
| 21 | +#include "bfbox.h" |
21 | 22 | #include "bfkeybd.h" |
22 | 23 | #include "bfgentab.h" |
23 | 24 | #include "bfsprite.h" |
|
38 | 39 | #include "game_sprts.h" |
39 | 40 | #include "game.h" |
40 | 41 | #include "player.h" |
| 42 | +#include "thing.h" |
41 | 43 | #include "swlog.h" |
42 | 44 | /******************************************************************************/ |
43 | 45 | extern ushort next_screen_point; |
@@ -455,11 +457,11 @@ void draw_sort_sprite1c_sub(ushort a1, short a2, short a3, ubyte a4, ushort a5) |
455 | 457 | : : "a" (a1), "d" (a2), "b" (a3), "c" (a4), "g" (a5)); |
456 | 458 | } |
457 | 459 |
|
458 | | -void draw_sort_sprite1c(ushort a1) |
| 460 | +void draw_sort_sprite1c(ushort sspr) |
459 | 461 | { |
460 | | - struct SortSprite *sspr; |
461 | | - sspr = &game_sort_sprites[a1]; |
462 | | - draw_sort_sprite1c_sub(sspr->Frame, sspr->X, sspr->Y, sspr->Brightness, sspr->Scale); |
| 462 | + struct SortSprite *p_sspr; |
| 463 | + p_sspr = &game_sort_sprites[sspr]; |
| 464 | + draw_sort_sprite1c_sub(p_sspr->Frame, p_sspr->X, p_sspr->Y, p_sspr->Brightness, p_sspr->Scale); |
463 | 465 | } |
464 | 466 |
|
465 | 467 | void check_mouse_over_face(struct PolyPoint *pt1, struct PolyPoint *pt2, |
@@ -1469,21 +1471,54 @@ void draw_phwoar(ushort ph) |
1469 | 1471 | lbDisplay.DrawFlags = 0; |
1470 | 1472 | } |
1471 | 1473 |
|
1472 | | -void draw_sort_sprite_tng(short a1) |
| 1474 | +void draw_sort_sprite_veh_health_bar(short sspr) |
1473 | 1475 | { |
1474 | | -#if 1 |
| 1476 | +#if 0 |
1475 | 1477 | asm volatile ( |
1476 | | - "call ASM_draw_sort_sprite_tng\n" |
1477 | | - : : "a" (a1)); |
| 1478 | + "call ASM_draw_sort_sprite_veh_health_bar\n" |
| 1479 | + : : "a" (sspr)); |
1478 | 1480 | return; |
1479 | 1481 | #endif |
| 1482 | + struct SortSprite *p_sspr; |
| 1483 | + struct Thing *p_thing; |
| 1484 | + ushort max_health; |
| 1485 | + short health; |
| 1486 | + ushort range_x; |
| 1487 | + short level_x; |
| 1488 | + ushort h; |
| 1489 | + |
| 1490 | + p_sspr = &game_sort_sprites[sspr]; |
| 1491 | + p_thing = p_sspr->PThing; |
| 1492 | + |
| 1493 | + max_health = p_thing->U.UVehicle.MaxHealth; |
| 1494 | + health = p_thing->Health; |
| 1495 | + if (max_health == 0) |
| 1496 | + max_health = 1; |
| 1497 | + if (health < 0) |
| 1498 | + health = 0; |
| 1499 | + else if (health > max_health) |
| 1500 | + health = max_health + 1; |
| 1501 | + |
| 1502 | + range_x = (40 * overall_scale) >> 8; |
| 1503 | + if (ingame.PanelPermutation == -3) |
| 1504 | + h = 42; |
| 1505 | + else |
| 1506 | + h = 19; |
| 1507 | + LbDrawBox(p_sspr->X - (range_x >> 1), p_sspr->Y, range_x + 4, 6, h); |
| 1508 | + |
| 1509 | + level_x = range_x * health / max_health; |
| 1510 | + if (ingame.PanelPermutation == -3) |
| 1511 | + h = 33; |
| 1512 | + else |
| 1513 | + h = 15; |
| 1514 | + LbDrawBox(p_sspr->X - (range_x >> 1) + 2, p_sspr->Y + 1, level_x, 4, h); |
1480 | 1515 | } |
1481 | 1516 |
|
1482 | | -void draw_object_face4e(ushort face4) |
| 1517 | +void draw_object_face4_deep_rdr(ushort face4) |
1483 | 1518 | { |
1484 | 1519 | #if 0 |
1485 | 1520 | asm volatile ( |
1486 | | - "call ASM_draw_object_face4e\n" |
| 1521 | + "call ASM_draw_object_face4_deep_rdr\n" |
1487 | 1522 | : : "a" (face4)); |
1488 | 1523 | return; |
1489 | 1524 | #endif |
@@ -1575,11 +1610,11 @@ void draw_object_face4e(ushort face4) |
1575 | 1610 | } |
1576 | 1611 | } |
1577 | 1612 |
|
1578 | | -void draw_object_face1d(ushort face) |
| 1613 | +void draw_object_face3_deep_rdr(ushort face) |
1579 | 1614 | { |
1580 | 1615 | #if 0 |
1581 | 1616 | asm volatile ( |
1582 | | - "call ASM_draw_object_face1d\n" |
| 1617 | + "call ASM_draw_object_face3_deep_rdr\n" |
1583 | 1618 | : : "a" (face)); |
1584 | 1619 | return; |
1585 | 1620 | #endif |
@@ -1664,7 +1699,7 @@ void draw_fire_flame(ushort flm) |
1664 | 1699 | } |
1665 | 1700 | } |
1666 | 1701 |
|
1667 | | -void draw_screen_number(ushort sospr) |
| 1702 | +void draw_sort_sprite_number(ushort sospr) |
1668 | 1703 | { |
1669 | 1704 | char locstr[50]; |
1670 | 1705 | struct SortSprite *p_sospr; |
@@ -1800,19 +1835,19 @@ void draw_drawitem_2(ushort dihead) |
1800 | 1835 | draw_phwoar(itm->Offset); |
1801 | 1836 | break; |
1802 | 1837 | case DrIT_Unkn22: |
1803 | | - draw_sort_sprite_tng(itm->Offset); |
| 1838 | + draw_sort_sprite_veh_health_bar(itm->Offset); |
1804 | 1839 | break; |
1805 | 1840 | case DrIT_Unkn23: |
1806 | | - draw_object_face4e(itm->Offset); |
| 1841 | + draw_object_face4_deep_rdr(itm->Offset); |
1807 | 1842 | break; |
1808 | 1843 | case DrIT_Unkn24: |
1809 | | - draw_object_face1d(itm->Offset); |
| 1844 | + draw_object_face3_deep_rdr(itm->Offset); |
1810 | 1845 | break; |
1811 | 1846 | case DrIT_Unkn25: |
1812 | 1847 | draw_fire_flame(itm->Offset); |
1813 | 1848 | break; |
1814 | 1849 | case DrIT_Unkn26: |
1815 | | - draw_screen_number(itm->Offset); |
| 1850 | + draw_sort_sprite_number(itm->Offset); |
1816 | 1851 | break; |
1817 | 1852 | default: |
1818 | 1853 | break; |
|
0 commit comments