Skip to content

Commit

Permalink
Merge pull request #156 from Feodor0090/no-hitsounds
Browse files Browse the repository at this point in the history
Delete hitsounds system from the game
  • Loading branch information
Feodor0090 authored Jun 18, 2023
2 parents e71c1dd + b367129 commit 481bd4c
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 133 deletions.
Binary file removed res/sfx/drum-hitclap.wav
Binary file not shown.
Binary file removed res/sfx/drum-hitfinish.wav
Binary file not shown.
Binary file removed res/sfx/drum-hitnormal.wav
Binary file not shown.
Binary file removed res/sfx/drum-hitwhistle.wav
Binary file not shown.
Binary file removed res/sfx/normal-hitclap.wav
Binary file not shown.
Binary file removed res/sfx/normal-hitfinish.wav
Binary file not shown.
Binary file removed res/sfx/normal-hitnormal.wav
Binary file not shown.
Binary file removed res/sfx/normal-hitwhistle.wav
Binary file not shown.
Binary file removed res/sfx/soft-hitclap.wav
Binary file not shown.
Binary file removed res/sfx/soft-hitfinish.wav
Binary file not shown.
Binary file removed res/sfx/soft-hitnormal.wav
Binary file not shown.
Binary file removed res/sfx/soft-hitwhistle.wav
Binary file not shown.
87 changes: 0 additions & 87 deletions src/nmania/MultiSample.java

This file was deleted.

37 changes: 0 additions & 37 deletions src/nmania/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,6 @@ public Player(Beatmap map, PlayerBootstrapData opts, Skin s, ILogger log, Displa
restart = null;
applause = null;
}
if (Settings.hitSamples) { // ?full
String[] sets = new String[] { "normal", "soft", "drum" }; // ?full
String[] types = new String[] { "normal", "whistle", "finish", "clap" }; // ?full
hitSounds = new MultiSample[3][]; // ?full
for (int i = 0; i < sets.length; i++) { // ?full
hitSounds[i] = new MultiSample[types.length]; // ?full
for (int j = 0; j < types.length; j++) { // ?full
hitSounds[i][j] = new MultiSample(true, "/sfx/" + sets[i] + "-hit" + types[j] + ".wav", "audio/wav", // ?full
4); // ?full
Thread.sleep(1); // ?full
} // ?full
} // ?full
} else { // ?full
hitSounds = null; // ?full
} // ?full
defaultHSSet = map.defaultSampleSet; // ?full

// step 7: cache data for HUD drawing
log.log("Caching service data");
Expand Down Expand Up @@ -489,9 +473,7 @@ private final void UpdateHealthX() {
private final Sample sectionFail;
private final Sample fail = null;
private final Sample restart;
private final MultiSample[][] hitSounds; // ?full
private final String applause;
private final int defaultHSSet; // ?full

public final static String[] judgements = new String[] { "MISS", "MEH", "OK", "GOOD", "GREAT", "PERFECT" };
public final static int[] judgementColors = new int[] { SNUtils.toARGB("0xF00"), SNUtils.toARGB("0xFA0"),
Expand All @@ -503,13 +485,6 @@ private final void UpdateHealthX() {
* Clears allocated samples.
*/
public final void Dispose() {
if (hitSounds != null) { // ?full
for (int i = 0; i < hitSounds.length; i++) { // ?full
for (int j = 0; j < hitSounds[i].length; j++) { // ?full
hitSounds[i][j].Dispose(); // ?full
} // ?full
} // ?full
} // ?full
if (restart != null)
restart.Dispose();
if (combobreak != null)
Expand Down Expand Up @@ -859,10 +834,6 @@ else if (!colKey && lastHoldKeys[column])
+ column + " is hit"); // ?dbg
CountHit(j);
currentNote[column] += 2;
if (hitSounds != null) { // ?full
if (j != 0) // ?full
hitSounds[defaultHSSet][0].Play(); // ?full
} // ?full
break; // loop on HW
}
}
Expand All @@ -882,10 +853,6 @@ else if (!colKey && lastHoldKeys[column])
GL.Log("(detect) Head note at " + columns[column][currentNote[column]] + " c="
+ column + " is hit"); // ?dbg
CountHit(j);
if (hitSounds != null) { // ?full
if (j != 0) // ?full
hitSounds[defaultHSSet][0].Play(); // ?full
} // ?full
holdHeadScored[column] = true;
break; // loop on HW
}
Expand Down Expand Up @@ -920,10 +887,6 @@ else if (!colKey && lastHoldKeys[column])
CountHit(j);
currentNote[column] += 2;
holdHeadScored[column] = false;
if (hitSounds != null) { // ?full
if (j != 0) // ?full
hitSounds[defaultHSSet][2].Play(); // ?full
} // ?full
break;
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/nmania/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ else if (dir.charAt(dir.length() - 1) != '/')
* Are exit/fail/pass/restart samples enabled?
*/
public static boolean gameplaySamples = false;
/**
* Are hit samples enabled?
*/
public static boolean hitSamples = false;
/**
* If hit samples are enabled, do we want to load them from beatmap?
*/
Expand Down Expand Up @@ -148,7 +144,6 @@ public static final String Serialize() {
}
j.accumulate("keys", keys);
j.accumulate("samples", new Boolean(gameplaySamples));
j.accumulate("hitsounds", new Boolean(hitSamples));
j.accumulate("keepmenu", new Boolean(keepMenu));
j.accumulate("drawcounters", new Boolean(drawHUD));
j.accumulate("fullscreenflush", new Boolean(fullScreenFlush));
Expand Down Expand Up @@ -215,7 +210,6 @@ public static final void Load() {
}
}
gameplaySamples = j.optBoolean("samples", true); // ?full
hitSamples = j.optBoolean("hitsounds", false); // ?full
keepMenu = j.optBoolean("keepmenu", true); // ?full
drawHUD = j.optBoolean("drawcounters", true);
final String device = Nmania.GetDevice();
Expand Down
4 changes: 1 addition & 3 deletions src/nmania/ui/ng/AudioSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ public class AudioSettings extends ListScreen implements IListSelectHandler, INu
public AudioSettings() {
SetItems(new ListItem[] { //
new SwitchItem(0, "Play music in menu", this, Settings.musicInMenu), // ?full
new SwitchItem(1, "Enable hitsounds", this, Settings.hitSamples), // ?full
new SwitchItem(2, "Enable feedback samples", this, Settings.gameplaySamples), // ?full
new SwitchItem(3, "Use BMS's sounds", this, Settings.useBmsSamples), // ?full
new DataItem(4, "Clock offset", this, Settings.gameplayOffset + "ms"),
Expand Down Expand Up @@ -36,8 +35,7 @@ public void OnSelect(ListItem item, ListScreen screen, IDisplay display) {
}
break;
case 1:
Settings.hitSamples = !Settings.hitSamples;
((SwitchItem) item).Toggle();
// hitsounds (deleted)
break;
case 2:
Settings.gameplaySamples = !Settings.gameplaySamples;
Expand Down

0 comments on commit 481bd4c

Please sign in to comment.