mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e3e94ffd9 | ||
|
|
25e006cffd | ||
|
|
3edd00d85f | ||
|
|
2bfa10411c | ||
|
|
a9eddc1705 |
+2
-3
@@ -66,9 +66,8 @@ Available commands:
|
||||
1. `./<BUILD_DIR>/ce-dat-tool <archive.dat> list [pattern]`
|
||||
2. `ce-dat-tool <archive.dat> info [pattern]`
|
||||
3. `ce-dat-tool <archive.dat> extract [--lower] <output-dir> [pattern]`
|
||||
4. `ce-dat-tool <archive.dat> extract [--lower] (--file-list|--files-from) <list-file> <output-dir>`
|
||||
5. `ce-dat-tool <archive.dat> cat <entry>`
|
||||
6. `ce-dat-tool create <input-dir> <archive.dat>`
|
||||
4. `ce-dat-tool <archive.dat> cat <entry>`
|
||||
5. `ce-dat-tool create <input-dir> <archive.dat>`
|
||||
|
||||
Use `--lower` with `extract` when you want every extracted file and directory name forced to lowercase.
|
||||
For example:
|
||||
|
||||
@@ -144,13 +144,13 @@ In time this stuff will receive in-game interface, right now you have to do it m
|
||||
* Expanded 4-row barter screen
|
||||
* Expanded AP bar
|
||||
* Party members can loot and barter in place of PC
|
||||
* Increased pathfinding nodes 5x for more accurate pathfinding, and use accurate path length for walk vs run
|
||||
* Increased pathfinding nodes 5x for more accurate pathfinding
|
||||
* Ctrl-click to quickly move items when bartering, looting, or stealing
|
||||
* _a_ to select "all" when selecting item quantity, and for `Take All` when looting
|
||||
* When bartering, caps default to the right amount to balance the trade
|
||||
* _a_ to select "all" when selecting item quantity
|
||||
* _a_ to `Take All` when looting
|
||||
* When bartering, caps default to the right amount to balance the trade (if possible)
|
||||
* Music continues playing between maps
|
||||
* Auto open doors
|
||||
* Integrated "HELP" menu
|
||||
* 44.1 kHz stereo sound/music supported, in .ogg and .wav format as well as legacy .acm
|
||||
* Last used save slot is remembered
|
||||
* Item/Corpse/Container/Critter highlighting (configure using [mods/sfall-mods.ini](https://github.com/sfall-team/sfall/blob/master/artifacts/config_files/sfall-mods.ini))
|
||||
|
||||
@@ -53,7 +53,7 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
|
||||
| Perks and traits | set_perk_image<br>set_perk_*<br>set_pyromaniac_mod<br>apply_heaveho_fix<br>set_swiftlearner_mod<br>has/set_fake_perk<br>has/set_fake_trait<br>set_selectable_perk<br>set_perkbox_title<br>show/hide_real_perks<br>perk_add_mode<br>clear_selectable_perks<br>add/remove_trait<br>seq_perk_freq | not implemented | - |
|
||||
| Virtual file system | fs_create<br>fs_copy<br>fs_find<br>fs_read/write_*<br>fs_delete<br>fs_size<br>fs_pos<br>fs_seek<br>fs_resize | đźš« | Open an issue if you have a use case for these |
|
||||
| Combat / Knockback | set_weapon_knockback<br>set_target_knockback<br>set_attacker_knockback<br>remove_weapon_knockback<br>remove_target_knockback<br>remove_attacker_knockback | not implemented | - |
|
||||
| Maps and encounters | in_world_map<br>force_encounter{_with_flags}<br>set_map_time_multi<br>get/set_map_enter_position<br>exec_map_update_scripts<br>get/set_terrain_name<br>set_town_title<br>get/set_can_rest_on_map<br>set_rest_heal_time<br>set_rest_mode<br>set_worldmap_heal_time | implemented: in_world_map, force_encounter, force_encounter_with_flags, set_map_time_multi | - |
|
||||
| Maps and encounters | in_world_map<br>force_encounter<br>force_encounter_with_flags<br>set_map_time_multi<br>get/set_map_enter_position<br>exec_map_update_scripts<br>get/set_terrain_name<br>set_town_title<br>get/set_can_rest_on_map<br>set_rest_heal_time<br>set_rest_mode<br>set_worldmap_heal_time | implemented: in_world_map, force_encounter, force_encounter_with_flags, set_map_time_multi | - |
|
||||
| Maps and encounters / Worldmap | get_world_map_x/y_pos<br>set_world_map_pos | âś… | - |
|
||||
| Audio | play_sfall_sound<br>stop_sfall_sound | âś… | `play_sfall_sound` currently supports `.acm`, `.wav`, `.ogg` formats, and can load from `.dat` archives. `.mp3` is not yet supported. |
|
||||
| Combat / Weapons and ammo | get/set_weapon_ammo_pid<br>get/set_weapon_ammo_count | âś… | - |
|
||||
@@ -63,7 +63,7 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
|
||||
| Lists | list_begin<br>list_next<br>list_end<br>list_as_array<br>party_member_list | âś… | - |
|
||||
| Explosions | set_attack_explosion_pattern<br>set_attack_explosion_art<br>set_attack_explosion_radius<br>set_attack_is_explosion_fire<br>set_explosion_radius<br>set_dynamite_damage<br>set_plastic_damage<br>get_explosion_damage<br>set_explosion_max_targets<br>item_make_explosive | âś… except item_make_explosive | - |
|
||||
| Animations | reg_anim_combat_check<br>reg_anim_destroy<br>reg_anim_animate_and_hide<br>reg_anim_light<br>reg_anim_change_fid<br>reg_anim_take_out<br>reg_anim_turn_towards<br>reg_anim_callback<br>reg_anim_animate_and_move | âś… except reg_anim_callback | - |
|
||||
| Art and appearance | art_exists<br>art_frame_data<br>refresh_pc_art<br>art_cache_clear | âś… | - |
|
||||
| Art and appearance | art_exists<br>refresh_pc_art<br>art_cache_clear<br>set_hero_race<br>set_hero_style | implemented: art_exists, refresh_pc_art, art_cache_clear | - |
|
||||
| Tiles and paths | get_tile_fid<br>tile_under_cursor<br>tile_light<br>tile_get_objs<br>tile_refresh_display<br>obj_blocking_tile<br>tile_by_position<br>get_tile_ground_fid<br>get_tile_roof_fid<br>obj_blocking_line<br>path_find_to<br>objects_in_radius | âś… | - |
|
||||
| Utility | sprintf<br>typeof<br>atoi<br>atof | âś… | - |
|
||||
| Utility / Strings | string_split<br>substr<br>strlen<br>charcode<br>get_string_pointer<br>string_find<br>string_find_from<br>string_format<br>string_format_array<br>string_replace<br>string_to_case<br>string_compare | âś… | `get_string_pointer` is deprecated and intentionally omitted. |
|
||||
@@ -75,18 +75,18 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
|
||||
| Global scripts / Global script functions | set_global_script_repeat<br>set_global_script_type<br>available_global_script_types | âś… except available_global_script_types | - |
|
||||
| Combat | attack_is_aimed<br>block_combat<br>force_aimed_shots<br>disable_aimed_shots<br>get_attack_type<br>get/set_bodypart_hit_modifier<br>combat_data<br>get/set/reset_critical_table<br>get_last_target<br>get_last_attacker<br>set_critter_burst_disable<br>get/set_critter_current_ap<br>set_spray_settings<br>get/set_combat_free_move | âś… except block_combat, force_aimed_shots, disable_aimed_shots, get_last_target, get_last_attacker, set_spray_settings | - |
|
||||
| Car | set_car_current_town<br>car_gas_amount<br>set_car_intface_art | implemented: all except set_car_intface_art | - |
|
||||
| Interface / Windows and images | interface_art_draw<br>interface_print<br>draw_image{_scaled}<br>get_window_under_mouse<br>create_win<br>get_window_attribute<br>message_box<br>set_window_flag<br>win_fill_color<br>interface_overlay<br>dialog_message<br>get_text_width<br>hide_window<br>show_window<br>create_message_window | âś… except interface_print, interface_overlay | - |
|
||||
| Interface / Windows and images | art_frame_data<br>interface_art_draw<br>interface_print<br>draw_image<br>draw_image_scaled<br>get_window_under_mouse<br>create_win<br>get_window_attribute<br>message_box<br>set_window_flag<br>win_fill_color<br>interface_overlay<br>dialog_message<br>get_text_width<br>hide_window<br>show_window<br>create_message_window | implemented: only message_box, get_text_width, show_window, create_message_window | - |
|
||||
| Interface / Outline | outlined_object<br>get_outline<br>set_outline | âś… | - |
|
||||
| Interface / Main interface | intface_is_hidden<br>intface_redraw<br>intface_hide<br>intface_show<br>set_quest_failure_value | implemented: only intface_redraw | `intface_redraw` only supports the zero-argument form; the optional-argument path is explicitly unimplemented. |
|
||||
| Interface / Inventory | display_stats<br>inventory_redraw<br>critter_inven_obj2<br>get_current_inven_size<br>item_weight | âś… except get_current_inven_size | - |
|
||||
| Interface / Inventory | display_stats<br>inventory_redraw<br>critter_inven_obj2<br>get_current_inven_size<br>item_weight | implemented: critter_inven_obj2, item_weight | - |
|
||||
| Interface / Cursor | get/set_cursor_mode | âś… | - |
|
||||
| Locks | lock_is_jammed<br>unjam_lock<br>set_unjam_locks_time | not implemented | - |
|
||||
| INI settings | get_ini_setting<br>get_ini_string<br>get_ini_section<br>get_ini_sections<br>get_ini_config<br>get_ini_config_db<br>set_ini_setting | âś… | `modified_ini` is intentionally omitted as deprecated. |
|
||||
| Objects and scripts | set_self<br>set_dude_obj<br>real_dude_obj<br>remove_script<br>get/set_script<br>obj_is_carrying_obj<br>loot_obj<br>dialog_obj<br>obj_under_cursor<br>get/set_object_data<br>get/set_flags<br>set_unique_id<br>set_scr_name<br>obj_is_openable<br>get/set_proto_data<br>get_object_ai_data | implemented: set_self, real_dude_obj, get/set/remove_script, obj_is_carrying_obj, loot_obj, dialog_obj, obj_under_cursor, get_object_data, get_flags, set_flags, set_unique_id, obj_is_openable, get_proto_data, set_proto_data | get_object_data assumes raw memory offsets which may return different values in CE |
|
||||
| Objects and scripts | set_self<br>set_dude_obj<br>real_dude_obj<br>remove_script<br>get/set_script<br>obj_is_carrying_obj<br>loot_obj<br>dialog_obj<br>obj_under_cursor<br>get/set_object_data<br>get/set_flags<br>set_unique_id<br>set_scr_name<br>obj_is_openable<br>get/set_proto_data<br>get_object_ai_data | implemented: set_self, get/set/remove_script, obj_is_carrying_obj, loot_obj, dialog_obj, obj_under_cursor, get_object_data, get_flags, set_flags, set_unique_id, obj_is_openable, get_proto_data, set_proto_data | - |
|
||||
| Other / Game management | set_movie_path<br>stop/resume_game<br>mark_movie_played<br>game_loaded<br>get_game_mode<br>get_uptime<br>signal_close_game | implemented: game_loaded, get_game_mode, get_uptime, signal_close_game | - |
|
||||
| Gameplay tweaks | set_pickpocket_max<br>set_hit_chance_max<br>set_xp_mod<br>set_critter_hit_chance_mod<br>set_base_hit_chance_mod<br>set_hp_per_level_mod<br>gdialog_get_barter_mod<br>get/set_unspent_ap_bonus<br>get/set_unspent_ap_perk_bonus<br>set_base_pickpocket_mod<br>set_critter_pickpocket_mod<br>get/set_inven_ap_cost<br>set_drugs_data<br>get_kill_counter<br>mod_kill_counter<br>set_pipboy_available | implemented: gdialog_get_barter_mod, get/set_unspent_ap{_perk}_bonus, get/set_inven_ap_cost | - |
|
||||
| NPCs | inc_npc_level<br>get_npc_level<br>npc_engine_level_up | not implemented | - |
|
||||
| Hero Appearance | set_dm/df_model<br>hero_select_win<br>set_hero_race<br>set_hero_style | not implemented | - |
|
||||
| Hero Appearange | set_dm/df_model<br>hero_select_win | not implemented | - |
|
||||
| Events | add_g_timer_event<br>remove_timer_event<br>create_spatial<br>spatial_radius | not implemented | - |
|
||||
| Other | get_year<br>active_hand<br>toggle_active_hand<br>get/set_viewport_x/y<br>get_light_level<br>message_str_game<br>sneak_success<br>unwield_slot<br>add_extra_msg_file<br>get_metarule_table<br>metarule_exist<br> | âś… except get/set_viewport_x/y, sneak_success | `input_funcs_available`, `nb_create_char` are deprecated in sfall and intentionally absent in CE. `add_extra_msg_file` does not support the explicit `fileNumber` form in CE. |
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.4 KiB |
Binary file not shown.
@@ -1 +0,0 @@
|
||||
{0}{}{HELP}
|
||||
@@ -1 +0,0 @@
|
||||
{0}{}{AIDE}
|
||||
@@ -1 +0,0 @@
|
||||
{0}{}{HILFE}
|
||||
@@ -1 +0,0 @@
|
||||
{0}{}{AIUTO}
|
||||
@@ -1 +0,0 @@
|
||||
{0}{}{POMOC}
|
||||
@@ -1 +0,0 @@
|
||||
{0}{}{AJUDA}
|
||||
@@ -1 +0,0 @@
|
||||
{0}{}{ПОМОЩЬ}
|
||||
@@ -1 +0,0 @@
|
||||
{0}{}{AYUDA}
|
||||
@@ -130,8 +130,6 @@ inventory_columns=2
|
||||
;Set to 1 to scale only the main menu background image to fit the screen while maintaining aspect ratio.
|
||||
;Set to 2 to also scale the main menu button panel, red buttons, and button labels with the menu art.
|
||||
main_menu_scale_mode=1
|
||||
;Set to 1 to show a Help option in the in-game options menu which opens the F1 help screen.
|
||||
in_game_menu_help=1
|
||||
|
||||
|
||||
[qol]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "lib.arrays.h" // For arrays_equal, len_array, etc.
|
||||
#include "test_utils.h" // For assertEquals, VALTYPE_STR, report_test_results
|
||||
#include "sfall.h"
|
||||
|
||||
// To test: copy test.ini into the game folder before running
|
||||
procedure ini_test_suite begin
|
||||
@@ -30,15 +29,6 @@ procedure ini_test_suite begin
|
||||
call assertEquals("TC2 get_ini_setting empty int", get_ini_setting("test.ini|ValidSection|EmptyValue"), 0);
|
||||
call assertEquals("TC2 get_ini_string empty string", get_ini_string("test.ini|ValidSection|EmptyValue"), "");
|
||||
|
||||
// Regression: sfall resolves leading-backslash paths relative to the game root.
|
||||
result_array := get_ini_section("\\test.ini", "ValidSection");
|
||||
call assertEquals("TC2B Size", len_array(result_array), 3);
|
||||
call assertEquals("TC2B Key1", result_array["Key1"], "Value1");
|
||||
call assertEquals("TC2B get_ini_setting int", get_ini_setting("\\test.ini|ValidSection|Key2"), 2);
|
||||
call assertEquals("TC2B get_ini_string string", get_ini_string("\\test.ini|ValidSection|Key1"), "Value1");
|
||||
result_array := get_ini_sections("\\test.ini");
|
||||
call assertEquals("TC2B get_ini_sections size", len_array(result_array), 3);
|
||||
|
||||
// INI file not found
|
||||
result_array := get_ini_section("nonexistent.ini", "AnySection");
|
||||
call assertEquals("TC3 Size", len_array(result_array), 0);
|
||||
|
||||
+12
-42
@@ -1,8 +1,5 @@
|
||||
#include "animation.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -40,13 +37,9 @@
|
||||
|
||||
namespace fallout {
|
||||
|
||||
// sfall exposes this as [Misc] AnimationsAtOnceLimit. Keep CE aligned with
|
||||
// sfall's default 64 total / 52 non-reserved slots for now; this can become
|
||||
// configurable later.
|
||||
#define ANIMATION_SEQUENCE_LIST_CAPACITY 64
|
||||
#define ANIMATION_SEQUENCE_LIST_CAPACITY 32
|
||||
#define ANIMATION_DESCRIPTION_LIST_CAPACITY 55
|
||||
#define ANIMATION_SAD_LIST_CAPACITY 64
|
||||
#define ANIMATION_NON_RESERVED_LIST_CAPACITY 52
|
||||
#define ANIMATION_SAD_LIST_CAPACITY 24
|
||||
|
||||
#define ANIMATION_SEQUENCE_FORCED 0x01
|
||||
|
||||
@@ -82,11 +75,6 @@ typedef enum AnimationKind {
|
||||
ANIM_KIND_SET_LIGHT_INTENSITY,
|
||||
} AnimationKind;
|
||||
|
||||
static bool animationKindIsCallback(int kind)
|
||||
{
|
||||
return kind == ANIM_KIND_CALLBACK || kind == ANIM_KIND_CALLBACK3;
|
||||
}
|
||||
|
||||
typedef enum AnimationSequenceFlags {
|
||||
// Specifies that the animation sequence has high priority, it cannot be
|
||||
// cleared.
|
||||
@@ -345,7 +333,7 @@ static AnimationSad gAnimationSads[ANIMATION_SAD_LIST_CAPACITY];
|
||||
static PathNode gClosedPathNodeList[PATH_NODE_CAPACITY];
|
||||
|
||||
// 0x54CC14 anim_set
|
||||
static AnimationSequence gAnimationSequences[ANIMATION_SEQUENCE_LIST_CAPACITY];
|
||||
static AnimationSequence gAnimationSequences[32];
|
||||
|
||||
// 0x561814 seen_tile
|
||||
static unsigned char gPathfinderProcessedTiles[5000];
|
||||
@@ -449,7 +437,7 @@ static int _anim_free_slot(int requestOptions)
|
||||
}
|
||||
|
||||
return -1;
|
||||
} else if ((requestOptions & ANIMATION_REQUEST_RESERVED) != 0 || v2 < ANIMATION_NON_RESERVED_LIST_CAPACITY) {
|
||||
} else if ((requestOptions & ANIMATION_REQUEST_RESERVED) != 0 || v2 < 20) {
|
||||
return v1;
|
||||
}
|
||||
|
||||
@@ -484,7 +472,7 @@ int reg_anim_clear(Object* a1)
|
||||
int animationDescriptionIndex;
|
||||
for (animationDescriptionIndex = 0; animationDescriptionIndex < animationSequence->length; animationDescriptionIndex++) {
|
||||
AnimationDescription* animationDescription = &(animationSequence->animations[animationDescriptionIndex]);
|
||||
if (a1 != animationDescription->owner || animationKindIsCallback(animationDescription->kind)) {
|
||||
if (a1 != animationDescription->owner || animationDescription->kind == 11) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -598,7 +586,7 @@ static int _check_registry(Object* obj)
|
||||
if (animationSequenceIndex != gAnimationSequenceCurrentIndex && animationSequence->step != ANIM_COMPLETE) {
|
||||
for (int animationDescriptionIndex = 0; animationDescriptionIndex < animationSequence->length; animationDescriptionIndex++) {
|
||||
AnimationDescription* animationDescription = &(animationSequence->animations[animationDescriptionIndex]);
|
||||
if (obj == animationDescription->owner && !animationKindIsCallback(animationDescription->kind)) {
|
||||
if (obj == animationDescription->owner && animationDescription->kind != 11) {
|
||||
if ((animationSequence->flags & ANIM_SEQ_INSIGNIFICANT) == 0) {
|
||||
return -1;
|
||||
}
|
||||
@@ -630,7 +618,7 @@ int animationIsBusy(Object* a1)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (animationKindIsCallback(animationDescription->kind)) {
|
||||
if (animationDescription->kind == ANIM_KIND_CALLBACK) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1620,25 +1608,12 @@ static int _anim_set_end(int animationSequenceIndex)
|
||||
}
|
||||
}
|
||||
|
||||
std::array<Object*, ANIMATION_DESCRIPTION_LIST_CAPACITY> destroyedOwners = {};
|
||||
std::size_t destroyedOwnersLength = 0;
|
||||
auto ownerWasDestroyed = [&destroyedOwners, &destroyedOwnersLength](Object* owner) {
|
||||
return std::find(destroyedOwners.begin(), destroyedOwners.begin() + destroyedOwnersLength, owner) != destroyedOwners.begin() + destroyedOwnersLength;
|
||||
};
|
||||
|
||||
for (i = 0; i < animationSequence->length; i++) {
|
||||
animationDescription = &(animationSequence->animations[i]);
|
||||
if (animationDescription->kind == ANIM_KIND_HIDE && ((i < animationSequence->animationIndex) || (animationDescription->extendedFlags & ANIMATION_SEQUENCE_FORCED))) {
|
||||
Object* owner = animationDescription->owner;
|
||||
if (ownerWasDestroyed(owner)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
destroyedOwners[destroyedOwnersLength++] = owner;
|
||||
|
||||
Rect rect;
|
||||
int elevation = owner->elevation;
|
||||
objectDestroy(owner, &rect);
|
||||
int elevation = animationDescription->owner->elevation;
|
||||
objectDestroy(animationDescription->owner, &rect);
|
||||
tileWindowRefreshRect(&rect, elevation);
|
||||
}
|
||||
}
|
||||
@@ -1647,23 +1622,18 @@ static int _anim_set_end(int animationSequenceIndex)
|
||||
animationDescription = &(animationSequence->animations[i]);
|
||||
if (animationDescription->artCacheKey) {
|
||||
artUnlock(animationDescription->artCacheKey);
|
||||
animationDescription->artCacheKey = nullptr;
|
||||
}
|
||||
|
||||
if (!animationKindIsCallback(animationDescription->kind)) {
|
||||
if (animationDescription->kind != 11 && animationDescription->kind != 12) {
|
||||
// TODO: Check.
|
||||
if (animationDescription->kind != ANIM_KIND_PING) {
|
||||
Object* owner = animationDescription->owner;
|
||||
if (ownerWasDestroyed(owner)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (FID_TYPE(owner->fid) == OBJ_TYPE_CRITTER) {
|
||||
int j = 0;
|
||||
for (; j < i; j++) {
|
||||
AnimationDescription* ad = &(animationSequence->animations[j]);
|
||||
if (owner == ad->owner) {
|
||||
if (!animationKindIsCallback(ad->kind)) {
|
||||
if (ad->kind != ANIM_KIND_CALLBACK && ad->kind != ANIM_KIND_CALLBACK3) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3375,7 +3345,7 @@ static unsigned int animationComputeTicksPerFrame(Object* object, int fid)
|
||||
}
|
||||
}
|
||||
|
||||
return std::max(1000 / fps, 1);
|
||||
return 1000 / fps;
|
||||
}
|
||||
|
||||
int animationRegisterSetLightIntensity(Object* owner, int lightDistance, int lightIntensity, int delay)
|
||||
|
||||
+108
-256
File diff suppressed because it is too large
Load Diff
@@ -100,11 +100,6 @@ typedef enum WeaponAnimation {
|
||||
WEAPON_ANIMATION_LASER_RIFLE, // k
|
||||
WEAPON_ANIMATION_MINIGUN, // l
|
||||
WEAPON_ANIMATION_LAUNCHER, // m
|
||||
WEAPON_ANIMATION_SFALL_S, // s
|
||||
WEAPON_ANIMATION_SFALL_O, // o
|
||||
WEAPON_ANIMATION_SFALL_P, // p
|
||||
WEAPON_ANIMATION_SFALL_Q, // q
|
||||
WEAPON_ANIMATION_SFALL_T, // t
|
||||
WEAPON_ANIMATION_COUNT,
|
||||
} WeaponAnimation;
|
||||
|
||||
@@ -133,6 +128,7 @@ void artRender(int fid, unsigned char* dest, int width, int height, int pitch);
|
||||
int art_list_str(int fid, char* name);
|
||||
Art* artLock(int fid, CacheEntry** cache_entry);
|
||||
unsigned char* artLockFrameData(int fid, int frame, int direction, CacheEntry** out_cache_entry);
|
||||
unsigned char* artLockFrameDataReturningSize(int fid, CacheEntry** out_cache_entry, int* widthPtr, int* heightPtr);
|
||||
int artUnlock(CacheEntry* cache_entry);
|
||||
int artCacheFlush();
|
||||
int artCopyFileName(int objectType, int id, char* dest);
|
||||
@@ -144,10 +140,9 @@ int artGetFrameCount(Art* art);
|
||||
int artGetWidth(Art* art, int frame, int direction);
|
||||
int artGetHeight(Art* art, int frame, int direction);
|
||||
int artGetSize(Art* art, int frame, int direction, int* out_width, int* out_height);
|
||||
int artGetFrameOffsets(const Art* art, int frame, int direction, int* xPtr, int* yPtr);
|
||||
int artGetFrameOffsets(Art* art, int frame, int direction, int* xPtr, int* yPtr);
|
||||
int artGetRotationOffsets(Art* art, int rotation, int* out_offset_x, int* out_offset_y);
|
||||
unsigned char* artGetFrameData(Art* art, int frame, int direction);
|
||||
unsigned char* artGetFrameData(const Art* art, int frame, int direction, int* widthPtr, int* heightPtr, int* xOffsetPtr, int* yOffsetPtr);
|
||||
ArtFrame* artGetFrame(const Art* art, int frame, int direction);
|
||||
ConstBuffer2D artGetFrameBuffer(const Art* art, int frame, int direction);
|
||||
bool artExists(int fid);
|
||||
@@ -190,8 +185,8 @@ private:
|
||||
const char* _path = nullptr;
|
||||
};
|
||||
|
||||
// RAII helper for locking one selected frame from FID-backed or path-backed art.
|
||||
// lock/unlock use caches instead of just loading/unloading directly.
|
||||
// A helper for using RAII to read single-frame FRM's.
|
||||
// lock/unlock use the art-cache instead of just loading/unloading directly.
|
||||
class FrmImage {
|
||||
public:
|
||||
FrmImage();
|
||||
@@ -206,19 +201,13 @@ public:
|
||||
|
||||
bool isLocked() const { return _key != nullptr || _namedKey; }
|
||||
bool lock(const FrmId& frmId);
|
||||
bool lock(const FrmId& frmId, int frame, int direction);
|
||||
bool lock(unsigned int fid);
|
||||
bool lock(unsigned int fid, int frame, int direction);
|
||||
bool lock(const char* frmPath);
|
||||
bool lock(const char* frmPath, int frame, int direction);
|
||||
bool lock(ObjectType objType, const char* frmRelativePath);
|
||||
bool lock(ObjectType objType, const char* frmRelativePath, int frame, int direction);
|
||||
void unlock();
|
||||
|
||||
int getWidth() const { return _width; }
|
||||
int getHeight() const { return _height; }
|
||||
int getXOffset() const { return _xOffset; }
|
||||
int getYOffset() const { return _yOffset; }
|
||||
// Returns FRM frame data if locked, nullptr otherwise.
|
||||
unsigned char* getData() const { return _data; }
|
||||
|
||||
@@ -226,15 +215,12 @@ public:
|
||||
|
||||
private:
|
||||
void resetInternal();
|
||||
bool setFrame(const Art* art, int frame, int direction);
|
||||
|
||||
std::shared_ptr<NamedCacheEntry> _namedKey;
|
||||
CacheEntry* _key = nullptr;
|
||||
unsigned char* _data = nullptr;
|
||||
int _width = 0;
|
||||
int _height = 0;
|
||||
int _xOffset = 0;
|
||||
int _yOffset = 0;
|
||||
};
|
||||
|
||||
} // namespace fallout
|
||||
|
||||
+3
-27
@@ -46,13 +46,6 @@ static void _decode_map_data(int elevation);
|
||||
static int automapCreate();
|
||||
static int _copy_file_data(File* stream1, File* stream2, int length);
|
||||
|
||||
static int gAutomapWindow = -1;
|
||||
|
||||
static bool automapEntryIsValid(int map, int elevation)
|
||||
{
|
||||
return map >= 0 && map < AUTOMAP_MAP_COUNT && elevationIsValid(elevation);
|
||||
}
|
||||
|
||||
typedef enum AutomapFrm {
|
||||
AUTOMAP_FRM_BACKGROUND,
|
||||
AUTOMAP_FRM_BUTTON_UP,
|
||||
@@ -298,10 +291,6 @@ int automapSave(File* stream)
|
||||
// 0x41B8B4 automapDisplayMap
|
||||
int _automapDisplayMap(int map)
|
||||
{
|
||||
if (map < 0 || map >= AUTOMAP_MAP_COUNT) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return _displayMapList[map];
|
||||
}
|
||||
|
||||
@@ -337,7 +326,6 @@ void automapShow(bool isInGame, bool isUsingScanner)
|
||||
int automapWindowY = (screenGetHeight() - AUTOMAP_WINDOW_HEIGHT) / 2;
|
||||
// adding WINDOW_TRANSPARENT and WINDOW_DRAGGABLE_BY_BACKGROUND for testing temporarily
|
||||
int window = windowCreate(automapWindowX, automapWindowY, AUTOMAP_WINDOW_WIDTH, AUTOMAP_WINDOW_HEIGHT, color, WINDOW_MODAL | WINDOW_MOVE_ON_TOP | WINDOW_TRANSPARENT | WINDOW_DRAGGABLE_BY_BACKGROUND);
|
||||
gAutomapWindow = window;
|
||||
|
||||
int scannerBtn = buttonCreate(window,
|
||||
111,
|
||||
@@ -505,16 +493,10 @@ void automapShow(bool isInGame, bool isUsingScanner)
|
||||
}
|
||||
|
||||
windowDestroy(window);
|
||||
gAutomapWindow = -1;
|
||||
fontSetCurrent(oldFont);
|
||||
touch_set_touchscreen_mode(false);
|
||||
}
|
||||
|
||||
int automapGetWindow()
|
||||
{
|
||||
return windowGetWindow(gAutomapWindow) != nullptr ? gAutomapWindow : -1;
|
||||
}
|
||||
|
||||
// Renders automap in Map window.
|
||||
//
|
||||
// 0x41BD1C draw_top_down_map
|
||||
@@ -552,13 +534,13 @@ static void automapRenderInMapWindow(int window, int elevation, unsigned char* b
|
||||
continue;
|
||||
}
|
||||
|
||||
if (object->pid == PROTO_ID_EXIT_GRID_MAP_MARKER) {
|
||||
if (object->pid == PROTO_ID_0x2000031) {
|
||||
objectColor = _colorTable[32328];
|
||||
} else if (objectType == OBJ_TYPE_WALL) {
|
||||
objectColor = _colorTable[992];
|
||||
} else if (objectType == OBJ_TYPE_SCENERY
|
||||
&& (flags & AUTOMAP_WTH_HIGH_DETAILS) != 0
|
||||
&& object->pid != PROTO_ID_BLOCK_HEX_AUTO_INVISO) {
|
||||
&& object->pid != PROTO_ID_0x2000158) {
|
||||
objectColor = _colorTable[480];
|
||||
} else if (object == gDude) {
|
||||
objectColor = _colorTable[31744];
|
||||
@@ -705,9 +687,6 @@ int automapSaveCurrent()
|
||||
{
|
||||
int map = mapGetCurrentMap();
|
||||
int elevation = gElevation;
|
||||
if (!automapEntryIsValid(map, elevation)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int entryOffset = gAutomapHeader.offsets[map][elevation];
|
||||
if (entryOffset < 0) {
|
||||
@@ -953,9 +932,6 @@ err:
|
||||
static int automapLoadEntry(int map, int elevation)
|
||||
{
|
||||
gAutomapEntry.compressedData = nullptr;
|
||||
if (!automapEntryIsValid(map, elevation)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
char path[COMPAT_MAX_PATH];
|
||||
snprintf(path, sizeof(path), "%s\\%s", "MAPS", AUTOMAP_DB);
|
||||
@@ -1105,7 +1081,7 @@ static void _decode_map_data(int elevation)
|
||||
int contentType;
|
||||
|
||||
int objectType = FID_TYPE(object->fid);
|
||||
if (objectType == OBJ_TYPE_SCENERY && object->pid != PROTO_ID_BLOCK_HEX_AUTO_INVISO) {
|
||||
if (objectType == OBJ_TYPE_SCENERY && object->pid != PROTO_ID_0x2000158) {
|
||||
contentType = 2;
|
||||
} else if (objectType == OBJ_TYPE_WALL) {
|
||||
contentType = 1;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user