Skip to content

Commit

Permalink
Remove deprecated light master plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Ortham committed Jun 23, 2024
1 parent 59c7710 commit 7046809
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 62 deletions.
20 changes: 1 addition & 19 deletions ffi/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub unsafe extern "C" fn esp_plugin_free(plugin_ptr: *mut Plugin) {
/// * [esp_plugin_count_override_records]
/// * [esp_plugin_do_records_overlap]
/// * [esp_plugin_records_overlap_size]
/// * [esp_plugin_is_valid_as_light_master] / [esp_plugin_is_valid_as_light_plugin]
/// * [esp_plugin_is_valid_as_light_plugin]
/// * [esp_plugin_is_valid_as_override_plugin]
///
/// Returns [ESP_OK] if successful, otherwise an `ESP_ERROR_*` code is returned.
Expand Down Expand Up @@ -229,15 +229,6 @@ pub unsafe extern "C" fn esp_plugin_is_master(
.unwrap_or(ESP_ERROR_PANICKED)
}

#[no_mangle]
#[deprecated = "This has been renamed to esp_plugin_is_light_plugin() for clarity."]
pub unsafe extern "C" fn esp_plugin_is_light_master(
plugin_ptr: *const Plugin,
is_light_master: *mut bool,
) -> u32 {
esp_plugin_is_light_plugin(plugin_ptr, is_light_master)
}

#[no_mangle]
pub unsafe extern "C" fn esp_plugin_is_light_plugin(
plugin_ptr: *const Plugin,
Expand Down Expand Up @@ -491,15 +482,6 @@ pub unsafe extern "C" fn esp_plugin_records_overlap_size(
.unwrap_or(ESP_ERROR_PANICKED)
}

#[no_mangle]
#[deprecated = "This has been renamed to esp_plugin_is_valid_as_light_plugin() for clarity."]
pub unsafe extern "C" fn esp_plugin_is_valid_as_light_master(
plugin_ptr: *const Plugin,
is_valid: *mut bool,
) -> u32 {
esp_plugin_is_valid_as_light_plugin(plugin_ptr, is_valid)
}

#[no_mangle]
pub unsafe extern "C" fn esp_plugin_is_valid_as_light_plugin(
plugin_ptr: *const Plugin,
Expand Down
33 changes: 0 additions & 33 deletions ffi/tests/ffi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,6 @@ void test_esp_plugin_is_master() {
esp_plugin_free(plugin);
}

void test_esp_plugin_is_light_master() {
printf("testing esp_plugin_is_light_master()...\n");
Plugin * plugin;
auto return_code = esp_plugin_new(&plugin, ESP_GAME_FALLOUT4, "../../testing-plugins/Skyrim/Data/Blank.esl");
assert(return_code == ESP_OK);

bool is_light_master;
return_code = esp_plugin_is_light_master(plugin, &is_light_master);
assert(return_code == ESP_OK);
assert(is_light_master);

esp_plugin_free(plugin);
}

void test_esp_plugin_is_light_plugin() {
printf("testing esp_plugin_is_light_plugin()...\n");
Plugin * plugin;
Expand Down Expand Up @@ -294,23 +280,6 @@ void test_esp_plugin_records_overlap_size() {
esp_plugin_free(plugin);
}

void test_esp_plugin_is_valid_as_light_master() {
printf("testing esp_plugin_is_valid_as_light_master()...\n");
Plugin * plugin;
auto return_code = esp_plugin_new(&plugin, ESP_GAME_SKYRIMSE, "../../testing-plugins/SkyrimSE/Data/Blank.esm");
assert(return_code == ESP_OK);

return_code = esp_plugin_parse(plugin, true);
assert(return_code == ESP_OK);

bool is_valid;
return_code = esp_plugin_is_valid_as_light_master(plugin, &is_valid);
assert(return_code == ESP_OK);
assert(is_valid);

esp_plugin_free(plugin);
}

void test_esp_plugin_is_valid_as_light_plugin() {
printf("testing esp_plugin_is_valid_as_light_plugin()...\n");
Plugin * plugin;
Expand Down Expand Up @@ -372,7 +341,6 @@ int main() {
test_esp_plugin_filename();
test_esp_plugin_masters();
test_esp_plugin_is_master();
test_esp_plugin_is_light_master();
test_esp_plugin_is_light_plugin();
test_esp_plugin_is_valid();
test_esp_plugin_description();
Expand All @@ -382,7 +350,6 @@ int main() {
test_esp_plugin_count_override_records();
test_esp_plugin_do_records_overlap();
test_esp_plugin_records_overlap_size();
test_esp_plugin_is_valid_as_light_master();
test_esp_plugin_is_valid_as_light_plugin();
test_esp_plugin_is_valid_as_medium_plugin();
test_esp_plugin_is_valid_as_override_plugin();
Expand Down
10 changes: 0 additions & 10 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,6 @@ impl Plugin {
}
}

#[deprecated = "This has been renamed to Plugin::is_light_plugin() for clarity."]
pub fn is_light_master_file(&self) -> bool {
self.is_light_plugin()
}

pub fn is_light_plugin(&self) -> bool {
if self.game_id.supports_light_plugins() {
if self.game_id == GameId::Starfield {
Expand Down Expand Up @@ -404,11 +399,6 @@ impl Plugin {
}
}

#[deprecated = "This has been renamed to Plugin::is_valid_as_light_plugin() for clarity."]
pub fn is_valid_as_light_master(&self) -> Result<bool, Error> {
self.is_valid_as_light_plugin()
}

pub fn is_valid_as_light_plugin(&self) -> Result<bool, Error> {
if self.game_id.supports_light_plugins() {
match &self.data.record_ids {
Expand Down

0 comments on commit 7046809

Please sign in to comment.