<string name="traitsinfo_base_max_hp">Max HP:</string>
<string name="traitsinfo_base_max_ap">Max AP:</string>
<string name="menu_save_saving_not_allowed_in_combat">Cannot save the game while in combat.</string>
+
+ <string name="preferences_optimized_drawing_title">Optimized drawing</string>
+ <string name="preferences_optimized_drawing">Disable this if you see graphical artifacts. Enabling this option will make the game only redraw changed parts of the screen every frame.</string>
+
</resources>
android:defaultValue="1.0f"
android:entries="@array/preferences_display_scaling_factor"
android:entryValues="@array/preferences_display_scaling_factor_values" />
+ <CheckBoxPreference
+ android:title="@string/preferences_optimized_drawing_title"
+ android:defaultValue="false"
+ android:summary="@string/preferences_optimized_drawing"
+ android:key="optimized_drawing" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/preferences_dialog_category">
public float scalingFactor = 1.0f;\r
public int dpadPosition;\r
public boolean dpadMinimizeable = true;\r
+ public boolean optimizedDrawing = false;\r
\r
public static void read(final Context androidContext, AndorsTrailPreferences dest) {\r
try {\r
dest.scalingFactor = Float.parseFloat(prefs.getString("scaling_factor", "1.0f"));\r
dest.dpadPosition = Integer.parseInt(prefs.getString("dpadposition", Integer.toString(DPAD_POSITION_DISABLED)));\r
dest.dpadMinimizeable = prefs.getBoolean("dpadMinimizeable", true);\r
+ dest.optimizedDrawing = prefs.getBoolean("optimized_drawing", false);\r
\r
// This might be implemented as a skill in the future.\r
//dest.movementAggressiveness = Integer.parseInt(prefs.getString("movementaggressiveness", Integer.toString(MOVEMENTAGGRESSIVENESS_NORMAL)));\r
dest.scalingFactor = 1.0f;\r
dest.dpadPosition = DPAD_POSITION_DISABLED;\r
dest.dpadMinimizeable = true;\r
+ dest.optimizedDrawing = false;\r
}\r
}\r
\r
package com.gpl.rpg.AndorsTrail.view;
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
+import com.gpl.rpg.AndorsTrail.AndorsTrailPreferences;
import com.gpl.rpg.AndorsTrail.context.ViewContext;
import com.gpl.rpg.AndorsTrail.controller.InputController;
import com.gpl.rpg.AndorsTrail.controller.VisualEffectController.VisualEffectAnimation;
private final TileStore tiles;
private final ViewContext view;
private final InputController inputController;
+ private final AndorsTrailPreferences preferences;
private final SurfaceHolder holder;
private final Paint mPaint = new Paint();
this.tiles = app.world.tileStore;
this.tileSize = tiles.tileSize;
this.inputController = view.inputController;
+ this.preferences = app.preferences;
holder.addCallback(this);
public void redrawAll(int why) {
redrawArea_(mapViewArea);
- }
+ }
public void redrawTile(final Coord p, int why) {
p1x1.topLeft.set(p);
redrawArea_(p1x1);
- //redrawAll(why);
}
public void redrawArea(final CoordRect area, int why) {
redrawArea_(area);
- //redrawAll(why);
}
- private void redrawArea_(final CoordRect area) {
+ private void redrawArea_(CoordRect area) {
if (!hasSurface) return;
+ if (!preferences.optimizedDrawing) area = mapViewArea;
+
final PredefinedMap currentMap = model.currentMap;
boolean b = currentMap.isOutside(area);
if (b) return;
-
+
calculateRedrawRect(area);
Canvas c = null;
try {
}
private final Rect redrawRect = new Rect();
- public void redrawAreaWithEffect(final CoordRect area, final VisualEffectAnimation effect) {
+ public void redrawAreaWithEffect(CoordRect area, final VisualEffectAnimation effect) {
if (!hasSurface) return;
+ if (!preferences.optimizedDrawing) area = mapViewArea;
+
final PredefinedMap currentMap = model.currentMap;
if (currentMap.isOutside(area)) return;