Search in sources :

Example 1 with RealTimeGameLoop

use of eidolons.game.module.dungeoncrawl.explore.RealTimeGameLoop in project Eidolons by IDemiurge.

the class DungeonScreen method renderMain.

public void renderMain(float delta) {
    guiStage.act(delta);
    gridStage.act(delta);
    cameraShift();
    // cam.update();
    if (canShowScreen()) {
        if (DC_Game.game != null)
            if (DC_Game.game.getGameLoop() instanceof RealTimeGameLoop) {
                // if (realTimeGameLoop != null)        realTimeGameLoop.act(delta);
                ((RealTimeGameLoop) Eidolons.game.getGameLoop()).act(delta);
            }
        if (backTexture != null) {
            if (OptionsMaster.getGraphicsOptions().getBooleanValue(GRAPHIC_OPTION.SPRITE_CACHE_ON)) {
                TextureManager.drawFromSpriteCache(TextureManager.getBackgroundId());
            } else {
                guiStage.getBatch().begin();
                float colorBits = GdxColorMaster.WHITE.toFloatBits();
                if (guiStage.getBatch().getColor().toFloatBits() != colorBits)
                    // damned alpha...
                    guiStage.getBatch().setColor(colorBits);
                guiStage.getBatch().draw(backTexture, 0, 0, GdxMaster.getWidth(), GdxMaster.getHeight());
                guiStage.getBatch().end();
            }
        }
        gridStage.setDebugAll(false);
        gridStage.draw();
        guiStage.setDebugAll(false);
        guiStage.draw();
        if (dialogsStage != null) {
            dialogsStage.setDebugAll(false);
            dialogsStage.act(delta);
            if (dialogsStage.isDone()) {
                final ChainedStage dialogsStage = this.dialogsStage;
                this.dialogsStage = null;
                dialogsStage.dispose();
                updateInputController();
            } else {
                dialogsStage.draw();
            }
        }
        if (gridPanel.getFpsLabel() != null)
            if (gridPanel != null)
                gridPanel.getFpsLabel().setText(new Float(1 / delta) + "");
        try {
            soundMaster.doPlayback(delta);
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
    }
}
Also used : ChainedStage(eidolons.libgdx.stage.ChainedStage) RealTimeGameLoop(eidolons.game.module.dungeoncrawl.explore.RealTimeGameLoop)

Aggregations

RealTimeGameLoop (eidolons.game.module.dungeoncrawl.explore.RealTimeGameLoop)1 ChainedStage (eidolons.libgdx.stage.ChainedStage)1