Skip to content

Commit

Permalink
Performance improvements and Android
Browse files Browse the repository at this point in the history
Android changes:

You can now pause the game
Adding and deleting notes now works
EZ Spam now works

General changes:
Added TANKMAN ASCEND
Maybe fixed a memory leak related to ScoreTxt?
Fixed a bug where notes that caused a miss if hit counted to totalNotes
Added additional debug details
  • Loading branch information
JordanSantiagoYT committed Oct 21, 2023
1 parent 910ef8e commit 29e52eb
Show file tree
Hide file tree
Showing 11 changed files with 249 additions and 11 deletions.
20 changes: 20 additions & 0 deletions source/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class ClientPrefs { //default settings if it can't find a save file containing y
public static var moreMaxHP:Bool = false;
public static var songPercentage:Bool = true;
public static var autosaveInterval:Float = 5.0;
public static var noteMotionBlur:Bool = false;
public static var noteMBMult:Float = 1;
public static var comboMultLimit:Float = 5;
public static var minCGBMS:Int = 5;
public static var maxCGBMS:Int = 5;
Expand All @@ -68,13 +70,15 @@ class ClientPrefs { //default settings if it can't find a save file containing y
public static var resultsScreen:Bool = true;
public static var botTxtFade:Bool = true;
public static var hideHud:Bool = false;
public static var debugInfo:Bool = false;
public static var hideScore:Bool = false;
public static var voiidTrollMode:Bool = false;
public static var compactNumbers:Bool = false;
public static var ezSpam:Bool = false;
public static var longFCName:Bool = false;
public static var holdNoteHits:Bool = false;
public static var comboScoreEffect:Bool = false;
public static var noGunsRNG:Bool = false;
public static var comboMultiType:String = 'osu!';
public static var noteOffset:Int = 0;
public static var arrowHSV:Array<Array<Int>> = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]];
Expand Down Expand Up @@ -219,6 +223,7 @@ class ClientPrefs { //default settings if it can't find a save file containing y
FlxG.save.data.noteSplashes = noteSplashes;
FlxG.save.data.oppNoteSplashes = oppNoteSplashes;
FlxG.save.data.songLoading = songLoading;
FlxG.save.data.debugInfo = debugInfo;
FlxG.save.data.lowQuality = lowQuality;
FlxG.save.data.shaders = shaders;
FlxG.save.data.ezSpam = ezSpam;
Expand All @@ -227,6 +232,7 @@ class ClientPrefs { //default settings if it can't find a save file containing y
//FlxG.save.data.cursing = cursing;
//FlxG.save.data.violence = violence;
FlxG.save.data.progAudioLoad = progAudioLoad;
FlxG.save.data.noGunsRNG = noGunsRNG;
FlxG.save.data.camZooms = camZooms;
FlxG.save.data.daMenuMusic = daMenuMusic;
FlxG.save.data.maxSplashLimit = maxSplashLimit;
Expand All @@ -237,6 +243,8 @@ class ClientPrefs { //default settings if it can't find a save file containing y
FlxG.save.data.fasterChartLoad = fasterChartLoad;
FlxG.save.data.longFCName = longFCName;
FlxG.save.data.botTxtFade = botTxtFade;
FlxG.save.data.noteMotionBlur = noteMotionBlur;
FlxG.save.data.noteMBMult = noteMBMult;
FlxG.save.data.showNotes = showNotes;
FlxG.save.data.skipResultsScreen = skipResultsScreen;
FlxG.save.data.timeBounce = timeBounce;
Expand Down Expand Up @@ -378,6 +386,9 @@ class ClientPrefs { //default settings if it can't find a save file containing y
if(FlxG.save.data.flashing != null) {
flashing = FlxG.save.data.flashing;
}
if(FlxG.save.data.debugInfo != null) {
debugInfo = FlxG.save.data.debugInfo;
}
if(FlxG.save.data.ezSpam != null) {
ezSpam = FlxG.save.data.ezSpam;
}
Expand All @@ -396,6 +407,9 @@ class ClientPrefs { //default settings if it can't find a save file containing y
if(FlxG.save.data.communityGameBot != null) {
communityGameBot = FlxG.save.data.communityGameBot;
}
if(FlxG.save.data.noGunsRNG != null) {
noGunsRNG = FlxG.save.data.noGunsRNG;
}
if(FlxG.save.data.showRamUsage != null) {
showRamUsage = FlxG.save.data.showRamUsage;
}
Expand Down Expand Up @@ -441,6 +455,12 @@ class ClientPrefs { //default settings if it can't find a save file containing y
if(FlxG.save.data.rainbowNotes != null) {
rainbowNotes = FlxG.save.data.rainbowNotes;
}
if(FlxG.save.data.noteMotionBlur != null) {
noteMotionBlur = FlxG.save.data.noteMotionBlur;
}
if(FlxG.save.data.noteMBMult != null) {
noteMBMult = FlxG.save.data.noteMBMult;
}
if(FlxG.save.data.comboMultLimit != null) {
comboMultLimit = FlxG.save.data.comboMultLimit;
}
Expand Down
9 changes: 9 additions & 0 deletions source/ColorSwap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ class ColorSwapShader extends FlxShader {

uniform bool hasTransform;
uniform bool hasColorTransform;
uniform bool blurEnabled;
uniform int passes;
uniform float x;
uniform float y;
uniform bool isNote;

vec4 flixel_texture2D(sampler2D bitmap, vec2 coord)
{
Expand Down Expand Up @@ -213,5 +218,9 @@ class ColorSwapShader extends FlxShader {
public function new()
{
super();
var motion_blur = ClientPrefs.noteMotionBlur;
this.blurEnabled.value = [motion_blur];
this.y.value = [0.0075];
this.passes.value = [10];
}
}
2 changes: 2 additions & 0 deletions source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class Main extends Sprite {
public static var fpsVar:FPS;
public static var changeID:Int = 0;

public static var textGenerations:Int = 0;

public static var __superCoolErrorMessagesArray:Array<String> = [
"A fatal error has occ- wait what?",
"missigno.",
Expand Down
30 changes: 30 additions & 0 deletions source/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class Paths
public static var currentTrackedAssets:Map<String, FlxGraphic> = [];
static public function image(key:String, ?library:String = null, ?allowGPU:Bool = true):FlxGraphic
{
if (ClientPrefs.cacheOnGPU) {
var bitmap:BitmapData = null;
var file:String = null;

Expand Down Expand Up @@ -333,6 +334,35 @@ class Paths

trace('oh no its returning null NOOOO ($file)');
return null;
} else {
#if MODS_ALLOWED
var modKey:String = modsImages(key);
if(FileSystem.exists(modKey)) {
if(!currentTrackedAssets.exists(modKey)) {
var newBitmap:BitmapData = BitmapData.fromFile(modKey);
var newGraphic:FlxGraphic = FlxGraphic.fromBitmapData(newBitmap, false, modKey);
newGraphic.persist = true;
currentTrackedAssets.set(modKey, newGraphic);
}
localTrackedAssets.push(modKey);
return currentTrackedAssets.get(modKey);
}
#end

var path = getPath('images/$key.png', IMAGE, library);
//trace(path);
if (OpenFlAssets.exists(path, IMAGE)) {
if(!currentTrackedAssets.exists(path)) {
var newGraphic:FlxGraphic = FlxG.bitmap.add(path, false, path);
newGraphic.persist = true;
currentTrackedAssets.set(path, newGraphic);
}
localTrackedAssets.push(path);
return currentTrackedAssets.get(path);
}
trace('oh no its returning null NOOOO (' + modKey + ')');
return null;
}
}

static public function getTextFromFile(key:String, ?ignoreMods:Bool = false):String
Expand Down
Loading

3 comments on commit 29e52eb

@Stefan2008Git
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold on. Where did you used to show states and substates on FPS?

@JordanSantiagoYT
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that’s from your engine LOL

@Stefan2008Git
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that’s from your engine LOL

Credit me next time or i am gonna take you down if you do not that. Actually you need to credit me for results screen and for debug info option for FPS counter and you are good. I will leave you alone if you credit me

Please sign in to comment.