1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-24 13:39:09 +00:00

Reworked anti-aliasing code (sprites now default to true)

This commit is contained in:
EliteMasterEric 2023-06-25 12:36:00 -04:00
parent 2cae781984
commit 0fac918428
25 changed files with 13 additions and 48 deletions

View file

@ -116,5 +116,6 @@
"target": "html5",
"args": ["-debug", "-watch"]
}
]
],
"cmake.configureOnOpen": false
}

View file

@ -243,8 +243,6 @@ class AlphaCharacter extends FlxSprite
super(x, y);
var tex = Paths.getSparrowAtlas('alphabet');
frames = tex;
antialiasing = true;
}
public function createBold(letter:String)

View file

@ -26,7 +26,6 @@ class ComboMilestone extends FlxTypedSpriteGroup<FlxSprite>
effectStuff.frames = Paths.getSparrowAtlas('comboMilestone');
effectStuff.animation.addByPrefix('funny', 'NOTE COMBO animation', 24, false);
effectStuff.animation.play('funny');
effectStuff.antialiasing = true;
effectStuff.animation.finishCallback = function(nameThing) {
kill();
};
@ -108,7 +107,6 @@ class ComboMilestoneNumber extends FlxSprite
frames = Paths.getSparrowAtlas('comboMilestoneNumbers');
animation.addByPrefix(stringNum, stringNum, 24, false);
animation.play(stringNum);
antialiasing = true;
updateHitbox();
}

View file

@ -338,7 +338,6 @@ class FreeplayState extends MusicBeatSubState
fnfHighscoreSpr.animation.addByPrefix("highscore", "highscore", 24, false);
fnfHighscoreSpr.visible = false;
fnfHighscoreSpr.setGraphicSize(0, Std.int(fnfHighscoreSpr.height * 1));
fnfHighscoreSpr.antialiasing = true;
fnfHighscoreSpr.updateHitbox();
add(fnfHighscoreSpr);

View file

@ -33,15 +33,11 @@ class InitState extends FlxTransitionableState
{
override public function create():Void
{
trace('This is a debug build, loading InitState...');
#if android
FlxG.android.preventDefaultKeys = [flixel.input.android.FlxAndroidKey.BACK];
#end
#if newgrounds
NGio.init();
#end
#if discord_rpc
DiscordClient.initialize();
//
// FLIXEL SETUP
//
// This ain't a pixel art game! (most of the time)
FlxSprite.defaultAntialiasing = true;
Application.current.onExit.add(function(exitCode) {
DiscordClient.shutdown();

View file

@ -42,7 +42,6 @@ class LoadingState extends MusicBeatState
funkay.loadGraphic(Paths.image('funkay'));
funkay.setGraphicSize(0, FlxG.height);
funkay.updateHitbox();
funkay.antialiasing = true;
add(funkay);
funkay.scrollFactor.set();
funkay.screenCenter();

View file

@ -68,7 +68,6 @@ class MainMenuState extends MusicBeatState
bg.setGraphicSize(Std.int(bg.width * 1.2));
bg.updateHitbox();
bg.screenCenter();
bg.antialiasing = true;
add(bg);
camFollow = new FlxObject(0, 0, 1, 1);
@ -82,7 +81,6 @@ class MainMenuState extends MusicBeatState
magenta.x = bg.x;
magenta.y = bg.y;
magenta.visible = false;
magenta.antialiasing = true;
magenta.color = 0xFFfd719b;
if (PreferencesMenu.preferences.get('flashing-menu')) add(magenta);
// magenta.scrollFactor.set();

View file

@ -22,8 +22,6 @@ class NoteSplash extends FlxSprite
setupNoteSplash(x, y, noteData);
antialiasing = true;
// alpha = 0.75;
}

View file

@ -149,7 +149,6 @@ class TitleState extends MusicBeatState
logoBl = new FlxSprite(-150, -100);
logoBl.frames = Paths.getSparrowAtlas('logoBumpin');
logoBl.antialiasing = true;
logoBl.animation.addByPrefix('bump', 'logo bumpin', 24);
logoBl.animation.play('bump');
@ -161,7 +160,6 @@ class TitleState extends MusicBeatState
gfDance.frames = Paths.getSparrowAtlas('gfDanceTitle');
gfDance.animation.addByIndices('danceLeft', 'gfDance', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
gfDance.animation.addByIndices('danceRight', 'gfDance', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
gfDance.antialiasing = true;
add(gfDance);
@ -180,7 +178,6 @@ class TitleState extends MusicBeatState
titleText.frames = Paths.getSparrowAtlas('titleEnter');
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
titleText.antialiasing = true;
titleText.animation.play('idle');
titleText.updateHitbox();
// titleText.screenCenter(X);
@ -223,7 +220,6 @@ class TitleState extends MusicBeatState
ngSpr.updateHitbox();
ngSpr.screenCenter(X);
ngSpr.antialiasing = true;
FlxG.mouse.visible = false;

View file

@ -117,7 +117,6 @@ class ScoreNum extends FlxSprite
this.digit = initDigit;
animation.play(numToString[digit], true);
antialiasing = true;
setGraphicSize(Std.int(width * 0.4));
updateHitbox();

View file

@ -47,7 +47,6 @@ class SongMenuItem extends FlxSpriteGroup
favIcon.frames = Paths.getSparrowAtlas('freeplay/favHeart');
favIcon.animation.addByPrefix('fav', "favorite heart", 24, false);
favIcon.animation.play('fav');
favIcon.antialiasing = true;
favIcon.setGraphicSize(60, 60);
add(favIcon);

View file

@ -42,8 +42,6 @@ class FlxAtlasSprite extends FlxAnimate
throw 'FlxAtlasSprite not initialized properly. Are you sure the path (${path}) exists?';
}
this.antialiasing = true;
onAnimationFinish.add(cleanupAnimation);
// This defaults the sprite to play the first animation in the atlas,

View file

@ -114,7 +114,6 @@ class ResultState extends MusicBeatSubState
soundSystem.animation.play("idle");
soundSystem.visible = true;
});
soundSystem.antialiasing = true;
add(soundSystem);
difficulty = new FlxSprite(555);
@ -132,7 +131,6 @@ class ResultState extends MusicBeatSubState
}
difficulty.loadGraphic(Paths.image("resultScreen/" + diffSpr));
difficulty.antialiasing = true;
add(difficulty);
var fontLetters:String = "AaBbCcDdEeFfGgHhiIJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz:1234567890";
@ -148,7 +146,6 @@ class ResultState extends MusicBeatSubState
songName.text += PlayState.instance.currentSong.songId;
}
songName.antialiasing = true;
songName.letterSpacing = -15;
songName.angle = -4.1;
add(songName);
@ -164,22 +161,18 @@ class ResultState extends MusicBeatSubState
var blackTopBar:FlxSprite = new FlxSprite().loadGraphic(Paths.image("resultScreen/topBarBlack"));
blackTopBar.y = -blackTopBar.height;
FlxTween.tween(blackTopBar, {y: 0}, 0.4, {ease: FlxEase.quartOut, startDelay: 0.5});
blackTopBar.antialiasing = true;
add(blackTopBar);
var resultsAnim:FlxSprite = new FlxSprite(-200, -10);
resultsAnim.frames = Paths.getSparrowAtlas("resultScreen/results");
resultsAnim.animation.addByPrefix("result", "results", 24, false);
resultsAnim.animation.play("result");
resultsAnim.antialiasing = true;
add(resultsAnim);
var ratingsPopin:FlxSprite = new FlxSprite(-150, 120);
ratingsPopin.frames = Paths.getSparrowAtlas("resultScreen/ratingsPopin");
ratingsPopin.animation.addByPrefix("idle", "Categories", 24, false);
// ratingsPopin.animation.play("idle");
ratingsPopin.visible = false;
ratingsPopin.antialiasing = true;
add(ratingsPopin);
var scorePopin:FlxSprite = new FlxSprite(-180, 520);

View file

@ -26,7 +26,6 @@ class NoteSplash extends FlxSprite
setup();
this.alpha = ALPHA;
this.antialiasing = true;
this.animation.finishCallback = this.onAnimationFinished;
}

View file

@ -162,7 +162,6 @@ class NoteSprite extends FlxSprite
setGraphicSize(Strumline.STRUMLINE_SIZE);
updateHitbox();
antialiasing = true;
}
public override function revive():Void

View file

@ -92,8 +92,6 @@ class StrumlineNote extends FlxSprite
this.animation.addByIndices('confirm-hold', 'right confirm', [2, 3, 4, 5], '', 24, true, false, false);
}
this.antialiasing = true;
this.setGraphicSize(Std.int(Strumline.STRUMLINE_SIZE * 1.55));
this.updateHitbox();
this.playStatic();

View file

@ -88,6 +88,8 @@ class SustainTrail extends FlxSprite
super(0, 0, fileName);
antialiasing = true;
// TODO: Why does this reference pixel stuff?
if (fileName == "arrowEnds")
{
endOffset = bottomClip = 1;

View file

@ -171,7 +171,6 @@ class AtlasChar extends FlxSprite
super(x, y);
frames = atlas;
this.char = char;
antialiasing = true;
}
function set_char(value:String)

View file

@ -31,7 +31,6 @@ class ColorsMenu extends Page
add(_effectSpr);
_effectSpr.y = 0;
_effectSpr.x = i * 130;
_effectSpr.antialiasing = true;
_effectSpr.scale.x = _effectSpr.scale.y = 0.7;
// _effectSpr.setGraphicSize();
_effectSpr.height = note.height;

View file

@ -225,7 +225,6 @@ class MenuItem extends FlxSprite
{
super(x, y);
antialiasing = true;
setData(name, callback);
idle();
}

View file

@ -45,6 +45,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
if (PlayState.instance.currentStageId.startsWith('school'))
{
rating.setGraphicSize(Std.int(rating.width * Constants.PIXEL_ART_SCALE * 0.7));
rating.antialiasing = false;
}
else
{
@ -95,6 +96,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
if (PlayState.instance.currentStageId.startsWith('school'))
{
comboSpr.setGraphicSize(Std.int(comboSpr.width * Constants.PIXEL_ART_SCALE * 0.7));
comboSpr.antialiasing = false;
}
else
{
@ -134,11 +136,12 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
if (PlayState.instance.currentStageId.startsWith('school'))
{
numScore.setGraphicSize(Std.int(numScore.width * Constants.PIXEL_ART_SCALE));
numScore.antialiasing = false;
}
else
{
numScore.antialiasing = true;
numScore.setGraphicSize(Std.int(numScore.width * 0.5));
numScore.antialiasing = true;
}
numScore.updateHitbox();

View file

@ -177,8 +177,6 @@ class CheckboxThingie extends FlxSprite
animation.addByPrefix('static', 'Check Box unselected', 24, false);
animation.addByPrefix('checked', 'Check Box selecting animation', 24, false);
antialiasing = true;
setGraphicSize(Std.int(width * 0.7));
updateHitbox();

View file

@ -266,7 +266,6 @@ class StickerSprite extends FlxSprite
super(x, y);
loadGraphic(Paths.image('transitionSwag/' + stickerSet + '/' + stickerName));
updateHitbox();
antialiasing = true;
scrollFactor.set();
}
}

View file

@ -80,7 +80,6 @@ class TallyNumber extends FlxSprite
animation.addByPrefix(Std.string(i), i + " small", 24, false);
animation.play(Std.string(digit));
antialiasing = true;
updateHitbox();
}
}

View file

@ -143,7 +143,6 @@ class DebugBoundingState extends FlxState
addInfo('Width', bf.width);
addInfo('Height', bf.height);
swagOutlines.antialiasing = true;
spriteSheetView.add(swagOutlines);
FlxG.stage.window.onDropFile.add(function(path:String) {