diff --git a/Makefile b/Makefile index 47b67677..8372c853 100644 --- a/Makefile +++ b/Makefile @@ -136,7 +136,7 @@ export CCACHE_COMMENTS=1 # Explicitly let 'char' to be 'signed char' to fix #18776 OTHERS += -fsigned-char -VERSION = CDDA-Breeze-8.2 +VERSION = CDDA-Breeze-8.3 TARGET_NAME = cataclysm TILES_TARGET_NAME = $(TARGET_NAME)-tiles diff --git a/README.md b/README.md index 32a1b0fc..9db281f0 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,6 @@ -# CDDA-微风 +# CDDA-Breeze -CDDA-微风(CDDA-Breeze)是[Cataclysm: Dark Days Ahead](https://github.com/CleverRaven/Cataclysm-DDA)的一个分支,在CDDA-0.G的基础之上进行开发。关于此分支的具体内容可以查看[内容汇总](内容汇总.md)。 - -## Breeze核心发展重点 - -* 游戏的性能优化 - -* 游戏的趣味性 +CDDA-Breeze是[Cataclysm-DDA](https://github.com/CleverRaven/Cataclysm-DDA)的一个分支,在CDDA-0.G的基础之上进行开发,注重游戏的性能优化和趣味性。关于此分支的具体内容可以查看[内容汇总](内容汇总.md)。 ## 表达对此项目的支持 diff --git a/android/app/build.gradle b/android/app/build.gradle index 9fcdb3f8..02560c7b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -245,8 +245,8 @@ android { defaultConfig { minSdkVersion override_minSdkVersion targetSdkVersion override_targetSdkVersion - versionCode 62 - versionName "8.2" + versionCode 63 + versionName "8.3" if (buildAsApplication) { applicationId "WhiteCloud.CDDA_Breeze" setProperty("archivesBaseName", "CDDA-Breeze-" + versionName) diff --git a/android/app/src/main/assets/lang/mo/zh_CN/LC_MESSAGES/cataclysm-dda.mo b/android/app/src/main/assets/lang/mo/zh_CN/LC_MESSAGES/cataclysm-dda.mo index ed2899a6..0d4c8371 100644 Binary files a/android/app/src/main/assets/lang/mo/zh_CN/LC_MESSAGES/cataclysm-dda.mo and b/android/app/src/main/assets/lang/mo/zh_CN/LC_MESSAGES/cataclysm-dda.mo differ diff --git a/android/app/src/main/java/com/cleverraven/cataclysmdda/SplashScreen.java b/android/app/src/main/java/com/cleverraven/cataclysmdda/SplashScreen.java index c93f49f4..163e5d43 100644 --- a/android/app/src/main/java/com/cleverraven/cataclysmdda/SplashScreen.java +++ b/android/app/src/main/java/com/cleverraven/cataclysmdda/SplashScreen.java @@ -38,7 +38,7 @@ public class SplashScreen extends Activity { private AlertDialog accessibilityServicesAlert; public CharSequence[] mSettingsNames; - public boolean[] mSettingsValues = { false, true, true, false }; + public boolean[] mSettingsValues = { false, true, false }; private String getVersionName() { try { @@ -259,7 +259,6 @@ public void onClick(DialogInterface dialog, int id) { mSettingsNames = new CharSequence[] { getString(R.string.softwareRendering), - getString(R.string.forceFullscreen), getString(R.string.trapBackButton), getString(R.string.nativeAndroidUI) }; @@ -275,9 +274,8 @@ public void onClick(DialogInterface dialog, int which, boolean isChecked) { .setPositiveButton(getString(R.string.startGame), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Software rendering", SplashScreen.this.mSettingsValues[0]).commit(); - PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Force fullscreen", SplashScreen.this.mSettingsValues[1]).commit(); - PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Trap Back button", SplashScreen.this.mSettingsValues[2]).commit(); - PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Native Android UI", SplashScreen.this.mSettingsValues[3]).commit(); + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Trap Back button", SplashScreen.this.mSettingsValues[1]).commit(); + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Native Android UI", SplashScreen.this.mSettingsValues[2]).commit(); SplashScreen.this.startGameActivity(false); return; } diff --git a/android/app/src/main/java/org/libsdl/app/SDLActivity.java b/android/app/src/main/java/org/libsdl/app/SDLActivity.java index ceabb622..f40a80af 100644 --- a/android/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -96,6 +96,8 @@ public enum NativeState { Button tabButton; + private static boolean forceFullScreen = true; + public void setExtraButtonVisibility(boolean visible) { this.runOnUiThread(new Runnable() { @@ -118,6 +120,10 @@ public void run() { }); } + public void set_force_full_screen(boolean value) { + forceFullScreen = value; + } + protected static SDLGenericMotionListener_API12 getMotionListener() { if (mMotionListener == null) { if (Build.VERSION.SDK_INT >= 26) { @@ -679,7 +685,6 @@ public void handleMessage(Message msg) { int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE; window.getDecorView().setSystemUiVisibility(flags); Context appContext = context.getApplicationContext(); - boolean forceFullScreen = PreferenceManager.getDefaultSharedPreferences(appContext).getBoolean("Force fullscreen", false); window.addFlags(forceFullScreen ? WindowManager.LayoutParams.FLAG_FULLSCREEN : WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); window.clearFlags(forceFullScreen ? WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN : WindowManager.LayoutParams.FLAG_FULLSCREEN); SDLActivity.mFullscreenModeActive = forceFullScreen; diff --git a/android/gradle.properties b/android/gradle.properties index c656638c..c153b569 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -46,7 +46,7 @@ deps=./deps.zip # This property controls which override version number to use # You can override this from the command line by passing "-Poverride_version=#" -override_version=CDDA-Breeze-8.2 +override_version=CDDA-Breeze-8.3 # This property controls path where overridden version number header should be generated # You can override this from the command line by passing "-Pversion_header_path=#" diff --git a/data/credits/en.credits b/data/credits/en.credits index f6090010..20fb496d 100644 --- a/data/credits/en.credits +++ b/data/credits/en.credits @@ -1,7 +1,7 @@ # Lines longer than 78 characters will be wrapped automatically # The following line is for reference ############################################################################## -CDDA-微风 项目管理者: +CDDA-Breeze 项目管理者: WhiteCloud0123 diff --git a/data/credits/zh_CN.credits b/data/credits/zh_CN.credits index dca0e4dd..2275b129 100644 --- a/data/credits/zh_CN.credits +++ b/data/credits/zh_CN.credits @@ -1,7 +1,7 @@ # 超过78个字符的段落将自动换行 # 下面这行这么长 ############################################################################## -CDDA-微风 项目管理者: +CDDA-Breeze 项目管理者: WhiteCloud0123 diff --git a/lang/mo/zh_CN/LC_MESSAGES/cataclysm-dda.mo b/lang/mo/zh_CN/LC_MESSAGES/cataclysm-dda.mo index ed2899a6..0d4c8371 100644 Binary files a/lang/mo/zh_CN/LC_MESSAGES/cataclysm-dda.mo and b/lang/mo/zh_CN/LC_MESSAGES/cataclysm-dda.mo differ diff --git a/lang/po/zh_CN.po b/lang/po/zh_CN.po index 16cd8a8e..132a5942 100644 --- a/lang/po/zh_CN.po +++ b/lang/po/zh_CN.po @@ -423579,10 +423579,6 @@ msgstr "强制游戏崩溃(测试崩溃处理)" msgid "Activate EOC" msgstr "启用 EOC" -#: src/debug_menu.cpp:446 -msgid "Quit to main menu" -msgstr "退出至主菜单" - #: src/debug_menu.cpp:450 src/debug_menu.cpp:529 msgid "Game…" msgstr "游戏…" diff --git a/src/animation.cpp b/src/animation.cpp index 1679f5c1..ffb662d9 100644 --- a/src/animation.cpp +++ b/src/animation.cpp @@ -712,17 +712,6 @@ void game::draw_weather( const weather_printable &w ) const return; } - if (use_particle_system) { - weather_type_id& id = get_weather().weather_id; - if (id == weather_snowing || id == weather_rain || id == weather_drizzle) { - return; - } - - } - - - - tilecontext->init_draw_weather( w, w.wtype->tiles_animation ); } diff --git a/src/cata_tiles.cpp b/src/cata_tiles.cpp index 6e525444..37b8c06e 100644 --- a/src/cata_tiles.cpp +++ b/src/cata_tiles.cpp @@ -1779,7 +1779,14 @@ void cata_tiles::draw( const point &dest, const tripoint ¢er, int width, int void_line(); } if( do_draw_weather ) { - draw_weather_frame(); + const std::string& id = get_weather().weather_id.str(); + if (use_particle_system && particle_system_weather.is_support_weather(id)) { + particle_system_weather.set_style_for_weather(id, renderer.get()); + particle_system_weather.draw(); + } + else { + draw_weather_frame(); + } void_weather(); } if( do_draw_sct ) { diff --git a/src/debug_menu.cpp b/src/debug_menu.cpp index 2b0bd1a0..050d3dba 100644 --- a/src/debug_menu.cpp +++ b/src/debug_menu.cpp @@ -488,7 +488,7 @@ static int game_uilist() { uilist_entry( debug_menu_index::SHOW_MSG, true, 'd', _( "Show debug message" ) ) }, { uilist_entry( debug_menu_index::CRASH_GAME, true, 'C', _( "Crash game (test crash handling)" ) ) }, { uilist_entry( debug_menu_index::ACTIVATE_EOC, true, 'E', _( "Activate EOC" ) ) }, - { uilist_entry( debug_menu_index::QUIT_NOSAVE, true, 'Q', _( "Quit to main menu" ) ) }, + { uilist_entry( debug_menu_index::QUIT_NOSAVE, true, 'Q', "退出到游戏开始界面")}, { uilist_entry( debug_menu_index::QUICKLOAD, true, 'q', _( "Quickload" ) ) }, }; diff --git a/src/game.cpp b/src/game.cpp index faff3e30..548e1670 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -373,6 +373,7 @@ jmethodID method_id_toast; jmethodID method_id_showToastMessage; jmethodID method_id_getDefaultSetting; jmethodID method_id_getSystemLang; +jmethodID method_id_set_force_full_screen; #endif diff --git a/src/game.h b/src/game.h index 4aedeef9..558c4230 100644 --- a/src/game.h +++ b/src/game.h @@ -59,6 +59,7 @@ extern jmethodID method_id_toast; extern jmethodID method_id_showToastMessage; extern jmethodID method_id_getDefaultSetting; extern jmethodID method_id_getSystemLang; +extern jmethodID method_id_set_force_full_screen; #endif diff --git a/src/main.cpp b/src/main.cpp index 8691ad0f..c2d3db98 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -50,6 +50,7 @@ #include "ordered_static_globals.h" #include "path_info.h" #include "rng.h" +#include "sdltiles.h" #include "system_locale.h" #include "translations.h" #include "type_id.h" @@ -729,14 +730,14 @@ int main( int argc, const char *argv[] ) method_id_showToastMessage = jni_env->GetMethodID(j_class, "showToastMessage", "(Ljava/lang/String;)V"); method_id_getDefaultSetting = jni_env->GetMethodID(j_class, "getDefaultSetting", "(Ljava/lang/String;Z)Z"); method_id_getSystemLang = jni_env->GetMethodID(j_class, "getSystemLang", "()Ljava/lang/String;"); - + method_id_set_force_full_screen = jni_env->GetMethodID(j_class, "set_force_full_screen", "(Z)V"); jni_env->DeleteLocalRef(temp_activity); jni_env->DeleteLocalRef(temp_class); #endif - + particle_system_weather.init_weather_content(); diff --git a/src/npctalk_funcs.cpp b/src/npctalk_funcs.cpp index 8f2a26f5..80106d81 100644 --- a/src/npctalk_funcs.cpp +++ b/src/npctalk_funcs.cpp @@ -1098,16 +1098,22 @@ void talk_function::goto_location( npc &p ) iter->camp_name(), iter->camp_omt_pos().to_string() ); } selection_menu.addentry( i++, true, MENU_AUTOASSIGN, _( "My current location" ) ); + if (!player_character.omt_path.empty()) { + selection_menu.addentry(i++, true, MENU_AUTOASSIGN, "我指定的位置"); + } selection_menu.addentry( i, true, MENU_AUTOASSIGN, _( "Cancel" ) ); selection_menu.selected = 0; selection_menu.query(); int index = selection_menu.ret; - if( index < 0 || index > static_cast( camps.size() + 1 ) || - index == static_cast( camps.size() + 1 ) ) { + if (index < 0 || index >= i) { return; } if( index == static_cast( camps.size() ) ) { destination = player_character.global_omt_location(); + } + else if (index == static_cast(camps.size()) + 1) { + // This looks nuts, but omt_path is emplaced in reverse order. So the front of the vector is our destination + destination = player_character.omt_path.front(); } else { const basecamp *selected_camp = camps[index]; destination = selected_camp->camp_omt_pos(); diff --git a/src/options.cpp b/src/options.cpp index d6518ccc..73e3b6a6 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -1625,8 +1625,8 @@ void options_manager::add_options_interface() add_empty_line(); - add("显示独立角色的图片", "interface", to_translation("显示独立角色的图片"), - to_translation("开启后,在与独立角色进行交谈时,将显示该角色的图片。"), + add("显示特殊NPC的图片", "interface", to_translation("显示特殊NPC的图片"), + to_translation("开启后,在与特殊NPC进行交谈时,将显示该角色的图片。"), true ); add("派系态度以数值显示", "interface", to_translation("派系态度以数值显示"), to_translation("当此选项的值为 是 时,在派系界面,对你的态度会显示具体的数值。"), false); @@ -2012,8 +2012,8 @@ void options_manager::add_options_graphics() }; - add("启用粒子特效", "graphics", to_translation("启用粒子特效"), - to_translation("目前是测试阶段。开启后,将在游戏的一些地方应用粒子特效,同时提高游戏画面的刷新频率。目前已在 细雨、雨、雪 这三种天气上应用。"), + add("启用粒子系统", "graphics", to_translation("启用粒子系统"), + to_translation("目前是测试阶段。开启后,将在游戏的一些地方使用粒子系统。"), false ); @@ -2705,6 +2705,11 @@ void options_manager::add_options_android() android_get_default_setting( "Trap Back button", true ) ); + add("强制全屏", "android", to_translation("强制全屏"), + to_translation("强制全屏。修改后需要重新启动。"), + true + ); + add( "ANDROID_NATIVE_UI", "android", to_translation( "Use native Android UI menus" ), to_translation( "If true, native Android dialogs are used for some in-game menus, " "such as popup messages and yes/no dialogs." ), @@ -3683,7 +3688,7 @@ static void update_options_cache() fov_3d_z_range = ::get_option( "FOV_3D_Z_RANGE" ); keycode_mode = ::get_option( "SDL_KEYBOARD_MODE" ) == "keycode"; use_pinyin_search = ::get_option("USE_PINYIN_SEARCH"); - use_particle_system = ::get_option("启用粒子特效"); + use_particle_system = ::get_option("启用粒子系统"); use_show_creature_hp_bar = ::get_option("显示生物血条"); use_show_player_move_point = ::get_option("显示玩家的剩余行动点"); use_animation =::get_option("ANIMATIONS"); @@ -3724,6 +3729,11 @@ bool options_manager::save() const update_music_volume(); +#if defined(__ANDROID__) + jni_env->CallVoidMethod(j_activity, method_id_set_force_full_screen, ::get_option("强制全屏")); +#endif + + return write_to_file( savefile, [&]( std::ostream & fout ) { JsonOut jout( fout, true ); serialize( jout ); @@ -3740,6 +3750,10 @@ void options_manager::load() update_global_locale(); update_options_cache(); +#if defined(__ANDROID__) + jni_env->CallVoidMethod(j_activity, method_id_set_force_full_screen, ::get_option("强制全屏")); +#endif + #if defined(SDL_SOUND) sounds::sound_enabled = ::get_option( "SOUND_ENABLED" ); #endif diff --git a/src/ParticleSystem.cpp b/src/particle_system.cpp similarity index 89% rename from src/ParticleSystem.cpp rename to src/particle_system.cpp index a17e5534..0e6cf62a 100644 --- a/src/ParticleSystem.cpp +++ b/src/particle_system.cpp @@ -1,4 +1,4 @@ -#include "ParticleSystem.h" +#include "particle_system.h" #include #include #include @@ -89,6 +89,16 @@ void ParticleSystem::resetTotalParticles(int numberOfParticles) } } +void ParticleSystem::init_weather_content() { + w_t_i_str = "null"; + support_weather_id = { "light_drizzle","drizzle" ,"rain","snowing" }; +} + +bool ParticleSystem::is_support_weather(const std::string& id) { + + return support_weather_id.find(id) != support_weather_id.end(); + +} void ParticleSystem::addParticles(int count) { @@ -659,7 +669,7 @@ void ParticleSystem::resumeEmissions() _paused = false; } -void ParticleSystem::set_style(const std::string &id_str , SDL_Texture * texture, SDL_Renderer *renderer) { +void ParticleSystem::set_style_for_weather(const std::string &id_str , SDL_Renderer *renderer) { if (w_t_i_str == id_str) { @@ -684,11 +694,9 @@ void ParticleSystem::set_style(const std::string &id_str , SDL_Texture * texture setEndSpin(90); setStartSpinVar(90); - - std::string gfx_string = PATH_INFO::gfxdir().get_unrelative_path().u8string(); std::string gfx_p_t = gfx_string + "/particle/01.png"; - SDL_Texture *texture = IMG_LoadTexture(renderer, gfx_p_t.c_str()); + SDL_Texture* texture = IMG_LoadTexture(renderer, gfx_p_t.c_str()); setTexture(texture); initWithTotalParticles(700); @@ -765,10 +773,7 @@ void ParticleSystem::set_style(const std::string &id_str , SDL_Texture * texture setStartSpinVar(90); setEndSpin(90); setStartSpinVar(90); - - - - + std::string gfx_string = PATH_INFO::gfxdir().get_unrelative_path().u8string(); std::string gfx_p_t = gfx_string + "/particle/01.png"; SDL_Texture* texture = IMG_LoadTexture(renderer, gfx_p_t.c_str()); @@ -848,8 +853,6 @@ void ParticleSystem::set_style(const std::string &id_str , SDL_Texture * texture setEndSpin(90); setStartSpinVar(90); - - std::string gfx_string = PATH_INFO::gfxdir().get_unrelative_path().u8string(); std::string gfx_p_t = gfx_string + "/particle/01.png"; SDL_Texture* texture = IMG_LoadTexture(renderer, gfx_p_t.c_str()); @@ -917,6 +920,87 @@ void ParticleSystem::set_style(const std::string &id_str , SDL_Texture * texture } + else if (w_t_i_str == "light_drizzle") { + + setRenderer(renderer); // set the renderer + setPosition(TERMX * 0.35 * get_option("FONT_WIDTH"), 0); // set the position +#if defined(__ANDROID__) + + setPosition(WindowWidth * 0.38, 0); + +#endif + setStartSpin(0); + setStartSpinVar(90); + setEndSpin(90); + setStartSpinVar(90); + + std::string gfx_string = PATH_INFO::gfxdir().get_unrelative_path().u8string(); + std::string gfx_p_t = gfx_string + "/particle/01.png"; + SDL_Texture* texture = IMG_LoadTexture(renderer, gfx_p_t.c_str()); + setTexture(texture); + + initWithTotalParticles(800); + + // duration + _duration = DURATION_INFINITY; + + setEmitterMode(Mode::GRAVITY); + + // Gravity Mode: gravity + setGravity(Vec2(10, 10)); + + // Gravity Mode: radial + setRadialAccel(0); + setRadialAccelVar(1); + + // Gravity Mode: tangential + setTangentialAccel(0); + setTangentialAccelVar(1); + + // Gravity Mode: speed of particles + setSpeed(-130); + setSpeedVar(30); + + // angle + _angle = -90; + _angleVar = 5; + + // life of particles + _life = 4.5f; + _lifeVar = 0; + + // size, in pixels + _startSize = 4.0f; + _startSizeVar = 2.0f; + _endSize = START_SIZE_EQUAL_TO_END_SIZE; + + // emits per second + _emissionRate = 20; + + // color of particles + _startColor.r = 0.7f; + _startColor.g = 0.8f; + _startColor.b = 1.0f; + _startColor.a = 1.0f; + _startColorVar.r = 0.0f; + _startColorVar.g = 0.0f; + _startColorVar.b = 0.0f; + _startColorVar.a = 0.0f; + _endColor.r = 0.7f; + _endColor.g = 0.8f; + _endColor.b = 1.0f; + _endColor.a = 0.5f; + _endColorVar.r = 0.0f; + _endColorVar.g = 0.0f; + _endColorVar.b = 0.0f; + _endColorVar.a = 0.0f; + + _posVar = { 1.0f * x_, 0.0f }; + + + + + } else { @@ -928,6 +1012,17 @@ void ParticleSystem::set_style(const std::string &id_str , SDL_Texture * texture +} + + +void ParticleSystem::set_style(const std::string& id_str, SDL_Texture* texture, SDL_Renderer* renderer) { + + + + + + + } diff --git a/src/ParticleSystem.h b/src/particle_system.h similarity index 98% rename from src/ParticleSystem.h rename to src/particle_system.h index 51c8d287..f8cb590e 100644 --- a/src/ParticleSystem.h +++ b/src/particle_system.h @@ -11,6 +11,7 @@ #include #include #include"sdl_wrappers.h" +#include struct Pointf { @@ -124,6 +125,14 @@ emitter.startSpin = 0; class ParticleSystem { + + +private : + + std::string w_t_i_str; + // 粒子系统支持的天气的id + std::unordered_setsupport_weather_id; + public: enum class Mode { @@ -145,9 +154,9 @@ class ParticleSystem public: - std::string w_t_i_str = "null"; - + void init_weather_content(); + bool is_support_weather(const std::string& id); void addParticles(int count); @@ -607,7 +616,10 @@ class ParticleSystem void pauseEmissions(); void resumeEmissions(); - void set_style(const std::string &id_str,SDL_Texture * texture,SDL_Renderer *renderer ); + void set_style_for_weather(const std::string &id_str,SDL_Renderer *renderer ); + + void set_style(const std::string& id_str, SDL_Texture* texture,SDL_Renderer* renderer); + protected: //virtual void updateBlendFunc(); diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 266c131b..b6829ccb 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -73,7 +73,7 @@ #include "string_formatter.h" #include "ui_manager.h" #include "wcwidth.h" -#include "ParticleSystem.h" +#include "particle_system.h" #include "path_info.h" #include "messages.h" @@ -125,7 +125,7 @@ static Font_Ptr font; static Font_Ptr map_font; static Font_Ptr overmap_font; -ParticleSystem particle_system; +ParticleSystem particle_system_weather; SDL_Texture* character_texture = nullptr; @@ -186,7 +186,7 @@ static void InitSDL() { int init_flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER; int ret; - + #if defined(SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING) SDL_SetHint( SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, "1" ); #endif @@ -572,7 +572,9 @@ void draw_character_picture() { void refresh_display() { - + + needupdate = false; + lastupdate = SDL_GetTicks(); if( test_mode ) { @@ -603,24 +605,9 @@ void refresh_display() draw_virtual_joystick(); #endif - - if (use_particle_system && g->is_core_data_loaded()) { - - particle_system.set_style(get_weather().weather_id.str(),display_buffer.get(),renderer.get()); - - particle_system.draw(); - - - - } - else { - - needupdate = false; - - } if ( character_name_breeze != "") { - if (get_option("显示独立角色的图片") && is_in_trading ==false) { + if (get_option("显示特殊NPC的图片") && is_in_trading ==false) { draw_character_picture(); @@ -2776,7 +2763,7 @@ static void CheckMessages() touch_input_context.get_category() )]; // Don't do this logic if we already need an update, otherwise we're likely to overload the game with too much input on hold repeat events - if( !needupdate || use_particle_system) { + if( !needupdate ) { // Check action weightings and auto-add any immediate-surrounding actions as quick shortcuts // This code is based heavily off action.cpp handle_action_menu() which puts common shortcuts at the top diff --git a/src/sdltiles.h b/src/sdltiles.h index f1fe40c2..bc55ec77 100644 --- a/src/sdltiles.h +++ b/src/sdltiles.h @@ -17,6 +17,7 @@ class window; #include "coordinates.h" #include "sdl_wrappers.h" #include "string_id.h" +#include "particle_system.h" #if defined(__APPLE__) // For TARGET_OS_IPHONE macro to test if is on iOS @@ -44,6 +45,7 @@ extern int WindowHeight; extern int fontheight; extern int fontwidth; +extern ParticleSystem particle_system_weather; extern std::string character_name_breeze; extern SDL_Texture* character_texture; extern bool is_in_trading; diff --git a/src/version.cpp b/src/version.cpp index f768c266..56796f84 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -3,7 +3,7 @@ #if (defined(_WIN32) || defined(MINGW)) && !defined(GIT_VERSION) && !defined(CROSS_LINUX) && !defined(_MSC_VER) #ifndef VERSION -#define VERSION "CDDA-Breeze 8.2" +#define VERSION "CDDA-Breeze 8.3" #endif #else diff --git a/src/version.h b/src/version.h index c4a46700..dfcae553 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1,2 @@ // NOLINT(cata-header-guard) -#define VERSION "CDDA-Breeze-8.2" +#define VERSION "CDDA-Breeze-8.3" diff --git "a/\345\206\205\345\256\271\346\261\207\346\200\273.md" "b/\345\206\205\345\256\271\346\261\207\346\200\273.md" index 337e7dfe..5080d8b9 100644 --- "a/\345\206\205\345\256\271\346\261\207\346\200\273.md" +++ "b/\345\206\205\345\256\271\346\261\207\346\200\273.md" @@ -1,4 +1,4 @@ -# Bug修复: +# Bug修复 - 修复了骑乘状态的宠物对幻觉产生反应的问题。 @@ -35,7 +35,7 @@ - 修复当尝试将物品放入宠物身上的包的时候没有考虑包所能容纳的最大长度的问题。 -# 优化: +# 优化 - 优化了身边有大量物品时的制作速度。 @@ -81,6 +81,10 @@ - get_option/get_world_defaults:std::unordered_map -> phmap::flat_hash_map +- 安卓端:缓存了许多频繁调用的选项的值 + +- 安卓端:全局化了JNI操作相关的JNIEnv、jobject、jclass、jmethodID,避免频繁获取、销毁带来的开销 + # 新增特性 - 在设置中的常规选项卡里添加了名为“骑乘状态可以上下楼”的选项。 @@ -132,7 +136,7 @@ 2. 如果是白天,FUNGUS_BIG_BLOSSOM的成功几率为 1/75,其他时间为1/100,喷射范围由12降低到6,强度设定为2。 -- 特效:添加粒子系统系统。在设置的“图形”选项卡下添加名为“启用粒子特效”的选项,目前是测试阶段。开启后,将在游戏的一些地方应用粒子特效,同时提高游戏画面的刷新频率。目前已在 细雨、雨、雪 这三种天气上应用。目前默认为关。 +- 特效:添加粒子系统系统。在设置的“图形”选项卡下添加名为“启用粒子系统”的选项,目前是测试阶段。开启后,将在游戏的一些地方使用粒子系统。目前已在 毛毛雨、细雨、雨、雪 这三种天气上应用。目前默认为关。 - 在主菜单添加了“备份当前世界”的选项,执行过程中自动执行一次保存,之后会在“save”文件夹内生成以当前世界的名称加上"_备份"后缀的世界存档, 如果“save”文件夹内本来就有以当前世界的名称加上“_备份”后缀的世界存档,会首先删除此世界存档,之后再执行备份操作。 @@ -158,7 +162,7 @@ - 添加两个新的CBM到鲁比克的商品里,分别可以获得直升机驾驶和飞行器机械师这两个专长。 -- 为游戏中的独立角色添加立绘。目前已有立绘的独立角色:鲁比克、陈宛。 +- 为游戏中的特殊NPC添加图片。目前已有图片的NPC:鲁比克、陈宛。 - 提高了难民中心的生成优先级。 @@ -232,7 +236,10 @@ - 在设置的“界面”选项卡下添加名为“显示玩家的剩余行动点”的选项。 +- 可以命令npc前往大地图上的指定位置。这个位置需要玩家事先通过自动旅行标记。“[交互]我有些事情想让你做”->“我们来谈谈营地的事情”->“请到这个地方”->“我指定的位置”。 +- 安卓端:可以在设置的“安卓”选项卡里选择是否强制全屏。 + # 其他修改 - 安卓版本启动时,不再弹出无障碍服务选项。