This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
90 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,66 @@ | ||
package net.opencraft.renderer.scenes; | ||
|
||
import java.awt.Graphics; | ||
import java.awt.image.BufferedImage; | ||
|
||
import net.opencraft.config.GameExperiments; | ||
import net.opencraft.renderer.Renderizable; | ||
import net.opencraft.sound.Sound; | ||
import net.opencraft.sound.SoundManager; | ||
import net.opencraft.util.Resource; | ||
|
||
public abstract class Scene implements Renderizable { | ||
|
||
public static final Scene LOAD_SCENE = LoadScene.getInstance(); | ||
public static final Scene TITLE_SCENE = TitleScene.getInstance(); | ||
|
||
// LOAD_SCREEN(LoadScene.RESOURCE, Sound.NONE), | ||
// TITLE_SCENE(TitleScene.RESOURCE, Sound.MOOG_CITY); | ||
|
||
protected static Scene current = TITLE_SCENE; | ||
protected final Resource res; | ||
protected final Sound snd; | ||
|
||
public Scene(Resource res, Sound snd) { | ||
this.res = res; | ||
this.snd = snd; | ||
} | ||
|
||
public Sound getSound() { | ||
return this.snd; | ||
} | ||
|
||
public static void renderCurrent(BufferedImage bi) { | ||
getCurrent().render(bi); | ||
} | ||
|
||
public static void renderCurrent(Graphics g, int width, int height) { | ||
getCurrent().render(g, width, height); | ||
} | ||
|
||
public static void renderCurrent(Graphics g) { | ||
getCurrent().render(g); | ||
} | ||
|
||
public static Scene getCurrent() { | ||
return current; | ||
} | ||
|
||
public void setCurrent() { | ||
setCurrent(this); | ||
} | ||
|
||
public static Scene setCurrent(Scene scn) { | ||
current = scn; | ||
|
||
if (GameExperiments.PLAY_SOUND_ONCE) | ||
SoundManager.update(); | ||
|
||
return current; | ||
} | ||
|
||
public Resource getResource() { | ||
return res; | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters