Week6 pixel fix + more syntax cleanup (#662)
* Fixed some issues with antialiasing not being set like wtf man why isn't it set do false in da code * oops i forgor i was testing smth lol * forcing the note sprites to be non aliased * fine lmao Co-authored-by: Til <89487150+TechnikTil@users.noreply.github.com> * my take * yes i will shut the fuck up now --------- Co-authored-by: Til <89487150+TechnikTil@users.noreply.github.com> Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com>
This commit is contained in:
@@ -18,9 +18,7 @@ static var daPixelZoom = 6;
|
||||
* UI
|
||||
*/
|
||||
function onNoteCreation(event) {
|
||||
if (event.note.strumLine == playerStrums && !pixelNotesForBF) return;
|
||||
if (event.note.strumLine == cpuStrums && !pixelNotesForDad) return;
|
||||
|
||||
if ((event.note.strumLine == playerStrums && !pixelNotesForBF) || (event.note.strumLine == cpuStrums && !pixelNotesForDad)) return;
|
||||
event.cancel();
|
||||
|
||||
var note = event.note;
|
||||
@@ -34,18 +32,14 @@ function onNoteCreation(event) {
|
||||
}
|
||||
note.scale.set(daPixelZoom, daPixelZoom);
|
||||
note.updateHitbox();
|
||||
note.antialiasing = false;
|
||||
}
|
||||
|
||||
function onPostNoteCreation(event) {
|
||||
var splashes = event.note;
|
||||
if (pixelSplashes)
|
||||
splashes.splash = "pixel-default";
|
||||
}
|
||||
function onPostNoteCreation(event) if (pixelSplashes)
|
||||
event.note.splash = "pixel-default";
|
||||
|
||||
function onStrumCreation(event) {
|
||||
if (event.player == 1 && !pixelNotesForBF) return;
|
||||
if (event.player == 0 && !pixelNotesForDad) return;
|
||||
|
||||
if ((event.player == 1 && !pixelNotesForBF) || (event.player == 0 && !pixelNotesForDad)) return;
|
||||
event.cancel();
|
||||
|
||||
var strum = event.strum;
|
||||
@@ -56,6 +50,7 @@ function onStrumCreation(event) {
|
||||
|
||||
strum.scale.set(daPixelZoom, daPixelZoom);
|
||||
strum.updateHitbox();
|
||||
strum.antialiasing = false;
|
||||
}
|
||||
|
||||
function onCountdown(event) {
|
||||
@@ -86,9 +81,9 @@ function onPlayerHit(event:NoteHitEvent) {
|
||||
* CAMERA HACKS!!
|
||||
*/
|
||||
function postCreate() {
|
||||
if (enablePauseMenu) {
|
||||
if (enablePauseMenu)
|
||||
PauseSubState.script = 'data/scripts/week6-pause';
|
||||
}
|
||||
|
||||
if (enableCameraHacks) {
|
||||
camGame.pixelPerfectRender = true;
|
||||
camGame.antialiasing = false;
|
||||
@@ -104,8 +99,8 @@ function postCreate() {
|
||||
}
|
||||
}
|
||||
|
||||
function onStartCountdown() {
|
||||
/*var newNoteCamera = new HudCamera();
|
||||
/*function onStartCountdown() {
|
||||
var newNoteCamera = new HudCamera();
|
||||
newNoteCamera.bgColor = 0; // transparent
|
||||
FlxG.cameras.add(newNoteCamera, false);
|
||||
|
||||
@@ -119,8 +114,8 @@ function onStartCountdown() {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
makeCameraPixely(newNoteCamera);*/
|
||||
}
|
||||
makeCameraPixely(newNoteCamera);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Use this to make any camera pixelly (you wont be able to zoom with it anymore!)
|
||||
@@ -145,33 +140,29 @@ function destroy() {
|
||||
FlxG.game.stage.quality = oldStageQuality;
|
||||
}
|
||||
|
||||
function pixelCam(cam) {
|
||||
function pixelCam(cam)
|
||||
makeCameraPixely(cam);
|
||||
}
|
||||
|
||||
var pixellyCameras = [];
|
||||
var pixellyShaders = [];
|
||||
|
||||
function postUpdate(elapsed) {
|
||||
for(e in pixellyCameras) {
|
||||
if (Std.isOfType(e, HudCamera))
|
||||
e.downscroll = camHUD.downscroll;
|
||||
}
|
||||
if (enableCameraHacks) {
|
||||
for(p in strumLines)
|
||||
p.notes.forEach(function(n) {
|
||||
if(n.isSustainNote) return; // hacky fix for hold
|
||||
n.y -= n.y % daPixelZoom;
|
||||
n.x -= n.x % daPixelZoom;
|
||||
});
|
||||
function postUpdate() {
|
||||
for (e in pixellyCameras) if (Std.isOfType(e, HudCamera))
|
||||
e.downscroll = camHUD.downscroll;
|
||||
|
||||
if (enableCameraHacks) for (p in strumLines) {
|
||||
p.notes.forEach(function(n) {
|
||||
if(n.isSustainNote) return; // hacky fix for hold
|
||||
n.y -= n.y % daPixelZoom;
|
||||
n.x -= n.x % daPixelZoom;
|
||||
});
|
||||
}
|
||||
|
||||
var zoom = 1 / daPixelZoom / Math.min(FlxG.scaleMode.scale.x, FlxG.scaleMode.scale.y);
|
||||
for(e in pixellyCameras) {
|
||||
for (e in pixellyCameras) {
|
||||
if (!e.exists) continue;
|
||||
e.zoom = zoom;
|
||||
}
|
||||
for(e in pixellyShaders) {
|
||||
for (e in pixellyShaders)
|
||||
e.pixelZoom = zoom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user