Compare commits
9 Commits
22.3.0.0-a
...
master
Author | SHA1 | Date |
---|---|---|
Natty | 0ece56a871 | |
Natty | 88c966974c | |
Natty | 29e9f42bde | |
Natty | 54ade78b1d | |
Natty | 6ba1dfa2cb | |
Natty | 27f4882fcc | |
Natty | d178a303bd | |
Natty | c1c248be87 | |
Natty | cbab0a8153 |
|
@ -0,0 +1,35 @@
|
|||
SOFTWARE LICENSING
|
||||
==================
|
||||
While PlutoEngine is licensed under the MIT license, see
|
||||
individual libraries and their license requirements.
|
||||
|
||||
MEDIA LICENSING
|
||||
===============
|
||||
This repository contains some first-party media files, such as audio,
|
||||
fonts and images. See "Third party media within this repository" for
|
||||
exceptions.
|
||||
|
||||
Unless specified otherwise:
|
||||
This content may be freely used under the https://creativecommons.org/publicdomain/zero/1.0/ license
|
||||
as long as it is used within an application based on PlutoEngine and does not misrepresent
|
||||
PlutoEngine or any of the PlutoEngine authors and does not remove this restriction.
|
||||
|
||||
OR
|
||||
|
||||
This content may be freely used under the https://creativecommons.org/licenses/by-nd/4.0/ license
|
||||
with no further restrictions.
|
||||
|
||||
OR
|
||||
|
||||
This content may be freely used under the https://creativecommons.org/licenses/by-sa/4.0/ license
|
||||
with no further restrictions.
|
||||
|
||||
|
||||
|
||||
Third party media within this repository
|
||||
========================================
|
||||
file "engine-demo/jsr-clone/mods/tefek.srclone/default/sound/game_st.ogg":
|
||||
"Safehouse" by Selulance
|
||||
https://www.youtube.com/watch?v=-kNx6sqReFk
|
||||
|
||||
Licensed under https://creativecommons.org/licenses/by/3.0/
|
|
@ -19,7 +19,7 @@ repositories {
|
|||
|
||||
maven {
|
||||
name = "Vega"
|
||||
url = uri("https://vega.botdiril.com/")
|
||||
url = uri("https://vega.botdiril.com/releases")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ repositories {
|
|||
|
||||
maven {
|
||||
name = "Vega"
|
||||
url = uri("https://vega.botdiril.com/")
|
||||
url = uri("https://vega.botdiril.com/releases")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,10 +47,9 @@ dependencies {
|
|||
|
||||
### Licensing
|
||||
|
||||
While all code of PlutoEngine is licensed under MIT, some media in this repository
|
||||
is licensed under different terms:
|
||||
The code of PlutoEngine is licensed under the MIT license.
|
||||
|
||||
* Music in the **jsr-clone** demo is made by Selulance, licensed under **CC - BY 3.0**
|
||||
See [LICENSING_INFO](https://github.com/493msi/plutoengine/blob/master/LICENSING_INFO.txt) for further information.
|
||||
|
||||
### Versioning
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
## 22.3.0.0-alpha.1
|
||||
* `[PlutoComponent]` Removing components using a token should have the same semantics as removing individual components
|
||||
* `[PlutoComponent]` Made the addition and removal of components hookable before mount events are fired
|
||||
|
||||
## 22.3.0.0-alpha.0
|
||||
* `[SDK]` **Combined `PlutoFramebuffer`, `PlutoMesher`, `PlutoShader` and `PlutoTexture`
|
||||
into `PlutoRender`**
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.plutoengine
|
||||
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
import org.gradle.api.JavaVersion
|
||||
|
||||
object Versions {
|
||||
|
@ -28,7 +27,7 @@ object Versions {
|
|||
|
||||
const val isPrerelease = true
|
||||
const val prereleaseName = "alpha"
|
||||
const val prerealeaseUpdate = 0
|
||||
const val prerealeaseUpdate = 1
|
||||
|
||||
val versionFull =
|
||||
if (isPrerelease)
|
||||
|
|
|
@ -26,3 +26,6 @@
|
|||
|
||||
/bin
|
||||
/*/bin
|
||||
|
||||
/out
|
||||
/*/out
|
|
@ -45,7 +45,7 @@ subprojects {
|
|||
repositories {
|
||||
maven {
|
||||
name = "Vega"
|
||||
url = uri("https://vega.botdiril.com/")
|
||||
url = uri("https://vega.botdiril.com/releases")
|
||||
credentials {
|
||||
val vegaUsername: String? by project
|
||||
val vegaPassword: String? by project
|
||||
|
|
|
@ -87,7 +87,7 @@ abstract class AudioDoubleBufferedSource extends AudioSource
|
|||
if (this.closed)
|
||||
return false;
|
||||
|
||||
var state = AL10.alGetSourcei(this.id, AL10.AL_SOURCE_STATE);
|
||||
var state = this.getState();
|
||||
|
||||
return switch (state)
|
||||
{
|
||||
|
@ -147,7 +147,11 @@ abstract class AudioDoubleBufferedSource extends AudioSource
|
|||
}
|
||||
|
||||
return unqueued;
|
||||
}
|
||||
|
||||
private int getState()
|
||||
{
|
||||
return AL10.alGetSourcei(this.id, AL10.AL_SOURCE_STATE);
|
||||
}
|
||||
|
||||
public boolean update()
|
||||
|
@ -158,7 +162,9 @@ abstract class AudioDoubleBufferedSource extends AudioSource
|
|||
var unqueued = this.unqueueBuffers();
|
||||
unqueued.forEach(this::stream);
|
||||
|
||||
if (AL10.alGetSourcei(this.id, AL10.AL_SOURCE_STATE) == AL10.AL_STOPPED)
|
||||
var sourceState = this.getState();
|
||||
|
||||
if (sourceState == AL10.AL_STOPPED)
|
||||
{
|
||||
if (this.audioBufferDepleted)
|
||||
return false;
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.apache.commons.collections4.MultiValuedMap;
|
|||
import org.apache.commons.collections4.multimap.ArrayListValuedHashMap;
|
||||
import org.apache.commons.collections4.multimap.HashSetValuedHashMap;
|
||||
import org.apache.commons.lang3.ClassUtils;
|
||||
import org.jetbrains.annotations.MustBeInvokedByOverriders;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
|
@ -74,6 +75,14 @@ public class ComponentManager<R extends AbstractComponent<R>>
|
|||
this.components.put(token, component);
|
||||
this.tokens.put(component, token);
|
||||
|
||||
this.onComponentAdded(component);
|
||||
|
||||
return component;
|
||||
}
|
||||
|
||||
@MustBeInvokedByOverriders
|
||||
protected void onComponentAdded(R component)
|
||||
{
|
||||
try
|
||||
{
|
||||
component.initialize(this);
|
||||
|
@ -82,8 +91,6 @@ public class ComponentManager<R extends AbstractComponent<R>>
|
|||
{
|
||||
throw new RuntimeException("An exception has occured while mounting the component", e);
|
||||
}
|
||||
|
||||
return component;
|
||||
}
|
||||
|
||||
public Class<R> getComponentBase()
|
||||
|
@ -130,6 +137,12 @@ public class ComponentManager<R extends AbstractComponent<R>>
|
|||
|
||||
classes.forEach(clazz -> this.implementationProviders.removeMapping(clazz, component));
|
||||
|
||||
this.onComponentRemoved(component);
|
||||
}
|
||||
|
||||
@MustBeInvokedByOverriders
|
||||
protected void onComponentRemoved(R component)
|
||||
{
|
||||
try
|
||||
{
|
||||
component.destroy(this);
|
||||
|
@ -151,14 +164,7 @@ public class ComponentManager<R extends AbstractComponent<R>>
|
|||
|
||||
classes.forEach(clazz -> this.implementationProviders.removeMapping(clazz, component));
|
||||
|
||||
try
|
||||
{
|
||||
component.onUnmount();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new RuntimeException("An exception has occured whiile unmounting the component", e);
|
||||
}
|
||||
this.onComponentRemoved(component);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,13 +25,12 @@
|
|||
package org.plutoengine.graphics.fbo;
|
||||
|
||||
import org.lwjgl.opengl.GL33;
|
||||
import org.plutoengine.logger.Logger;
|
||||
import org.plutoengine.logger.SmartSeverity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.plutoengine.logger.Logger;
|
||||
import org.plutoengine.logger.SmartSeverity;
|
||||
|
||||
public class Framebuffer
|
||||
{
|
||||
private int id;
|
||||
|
|
|
@ -28,3 +28,6 @@
|
|||
/*/bin
|
||||
|
||||
/*/logs
|
||||
|
||||
/out
|
||||
/*/out
|
|
@ -4,5 +4,3 @@ Selulance - Safehouse
|
|||
https://www.youtube.com/watch?v=-kNx6sqReFk
|
||||
|
||||
Licensed under https://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
Thank you
|
|
@ -186,7 +186,7 @@ public class Game
|
|||
|
||||
var scoreFont = new TextStyleOptions(24)
|
||||
.setPaint(LiPaint.solidColor(Color.WHITE));
|
||||
ImmediateFontRenderer.drawString(5.0f, 5.0f, ("S %010.0f").formatted(this.entityPlayer.getScore()), SRCloneMod.srCloneFont, scoreFont);
|
||||
ImmediateFontRenderer.drawString(5.0f, 5.0f, "S %010.0f".formatted(this.entityPlayer.getScore()), SRCloneMod.srCloneFont, scoreFont);
|
||||
|
||||
if (this.deathScreenAnimation > 1.0f)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.plutoengine.libra.text.shaping.TextStyleOptions;
|
|||
import org.plutoengine.math.ProjectionMatrix;
|
||||
import org.plutoengine.graphics.shader.uniform.auto.AutomaticUniforms;
|
||||
import org.plutoengine.util.color.Color;
|
||||
import org.plutoengine.util.color.RGBA;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -47,6 +48,7 @@ public class Main extends PlutoApplication
|
|||
var cfg = new PlutoApplication.StartupConfig();
|
||||
cfg.windowInitialDimensions(1280, 720);
|
||||
cfg.windowName("jsr-clone");
|
||||
cfg.clearColor(new RGBA(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
// cfg.vsync(1);
|
||||
app.run(args, cfg);
|
||||
}
|
||||
|
@ -71,9 +73,6 @@ public class Main extends PlutoApplication
|
|||
GL33.glEnable(GL33.GL_BLEND);
|
||||
GL33.glBlendFunc(GL33.GL_SRC_ALPHA, GL33.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL33.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
GL33.glClear(GL33.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
var projection = ProjectionMatrix.createOrtho2D(this.display.getWidth(), this.display.getHeight());
|
||||
AutomaticUniforms.VIEWPORT_PROJECTION.fire(projection);
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import cz.tefek.srclone.Game;
|
|||
import cz.tefek.srclone.SRCloneMod;
|
||||
import cz.tefek.srclone.ammo.EnumAmmo;
|
||||
import cz.tefek.srclone.entity.pickup.EntityBox;
|
||||
import cz.tefek.srclone.util.AngleUtil;
|
||||
|
||||
public class EntityEnemyScout extends EntityEnemy
|
||||
{
|
||||
|
@ -128,10 +129,42 @@ public class EntityEnemyScout extends EntityEnemy
|
|||
{
|
||||
float w = 128, h = 128;
|
||||
|
||||
RectangleRenderer2D.draw(SRCloneMod.centeredQuad)
|
||||
.at(this.getRenderX(), this.getRenderY(), w, h)
|
||||
.sprite(SRCloneMod.enemyScout.getSideFromAngle(this.rotation))
|
||||
.flush();
|
||||
float engineOffset = 20;
|
||||
|
||||
float engineX = this.getRenderX() - (float) (Math.sin(this.rotation) * engineOffset);
|
||||
float engineY = this.getRenderY() - (float) (Math.cos(this.rotation) * engineOffset);
|
||||
|
||||
float nozzleRot = (float) (-this.rotation + Math.PI / 4.0f * 3.0f);
|
||||
|
||||
if (Math.cos(this.rotation) > 0.3f)
|
||||
{
|
||||
RectangleRenderer2D.draw(SRCloneMod.centeredQuad)
|
||||
.at(engineX, engineY, w, h)
|
||||
.rotate(AngleUtil.snapToDirections(nozzleRot, SRCloneMod.enemyScout.getSideCount()))
|
||||
.recolor(1.0f, 0.0f, 1.0f, 0.3f)
|
||||
.texture(SRCloneMod.rocketNozzle)
|
||||
.flush();
|
||||
|
||||
RectangleRenderer2D.draw(SRCloneMod.centeredQuad)
|
||||
.at(this.getRenderX(), this.getRenderY(), w, h)
|
||||
.sprite(SRCloneMod.enemyScout.getSideFromAngle(this.rotation))
|
||||
.flush();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
RectangleRenderer2D.draw(SRCloneMod.centeredQuad)
|
||||
.at(this.getRenderX(), this.getRenderY(), w, h)
|
||||
.sprite(SRCloneMod.enemyScout.getSideFromAngle(this.rotation))
|
||||
.flush();
|
||||
|
||||
RectangleRenderer2D.draw(SRCloneMod.centeredQuad)
|
||||
.at(engineX, engineY, w, h)
|
||||
.rotate(AngleUtil.snapToDirections(nozzleRot, SRCloneMod.enemyScout.getSideCount()))
|
||||
.recolor(1.0f, 0.0f, 1.0f, 0.3f)
|
||||
.texture(SRCloneMod.rocketNozzle)
|
||||
.flush();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -124,10 +124,42 @@ public class EntityEnemySmallBomber extends EntityEnemy
|
|||
{
|
||||
float w = 128, h = 128;
|
||||
|
||||
RectangleRenderer2D.draw(SRCloneMod.centeredQuad)
|
||||
.at(this.getRenderX(), this.getRenderY(), w, h)
|
||||
.sprite(SRCloneMod.enemySmallBomber.getSideFromAngle(this.rotation))
|
||||
.flush();
|
||||
float engineOffset = 15;
|
||||
|
||||
float engineX = this.getRenderX() - (float) (Math.sin(this.rotation) * engineOffset);
|
||||
float engineY = this.getRenderY() - (float) (Math.cos(this.rotation) * engineOffset);
|
||||
|
||||
float nozzleRot = (float) (-this.rotation + Math.PI / 4.0f * 3.0f);
|
||||
|
||||
if (Math.cos(this.rotation) > 0.3f)
|
||||
{
|
||||
RectangleRenderer2D.draw(SRCloneMod.centeredQuad)
|
||||
.at(engineX, engineY, w, h)
|
||||
.rotate(AngleUtil.snapToDirections(nozzleRot, SRCloneMod.enemySmallBomber.getSideCount()))
|
||||
.recolor(1.0f, 0.0f, 1.0f, 0.3f)
|
||||
.texture(SRCloneMod.rocketNozzle)
|
||||
.flush();
|
||||
|
||||
RectangleRenderer2D.draw(SRCloneMod.centeredQuad)
|
||||
.at(this.getRenderX(), this.getRenderY(), w, h)
|
||||
.sprite(SRCloneMod.enemySmallBomber.getSideFromAngle(this.rotation))
|
||||
.flush();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
RectangleRenderer2D.draw(SRCloneMod.centeredQuad)
|
||||
.at(this.getRenderX(), this.getRenderY(), w, h)
|
||||
.sprite(SRCloneMod.enemySmallBomber.getSideFromAngle(this.rotation))
|
||||
.flush();
|
||||
|
||||
RectangleRenderer2D.draw(SRCloneMod.centeredQuad)
|
||||
.at(engineX, engineY, w, h)
|
||||
.rotate(AngleUtil.snapToDirections(nozzleRot, SRCloneMod.enemySmallBomber.getSideCount()))
|
||||
.recolor(1.0f, 0.0f, 1.0f, 0.3f)
|
||||
.texture(SRCloneMod.rocketNozzle)
|
||||
.flush();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,7 +30,7 @@ import cz.tefek.srclone.EnumTeam;
|
|||
import cz.tefek.srclone.SRCloneMod;
|
||||
import cz.tefek.srclone.ammo.EnumAmmo;
|
||||
|
||||
public class EntityProjectileEnemyHeatStar extends EntityProjectileHeatStar
|
||||
public class EntityProjectileEnemyHeatStar extends EntityProjectileAmmo
|
||||
{
|
||||
public EntityProjectileEnemyHeatStar()
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@ import cz.tefek.srclone.EnumTeam;
|
|||
import cz.tefek.srclone.SRCloneMod;
|
||||
import cz.tefek.srclone.ammo.EnumAmmo;
|
||||
|
||||
public class EntityProjectileEnemyLaserBeam extends EntityProjectileLaserBeam
|
||||
public class EntityProjectileEnemyLaserBeam extends EntityProjectileAmmo
|
||||
{
|
||||
public EntityProjectileEnemyLaserBeam()
|
||||
{
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2022 493msi
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package cz.tefek.srclone.entity.projectile;
|
||||
|
||||
import cz.tefek.srclone.ammo.EnumAmmo;
|
||||
|
||||
public class EntityProjectileHeatStar extends EntityProjectileAmmo
|
||||
{
|
||||
|
||||
protected EntityProjectileHeatStar(EnumAmmo ammo)
|
||||
{
|
||||
super(ammo);
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2022 493msi
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package cz.tefek.srclone.entity.projectile;
|
||||
|
||||
import cz.tefek.srclone.ammo.EnumAmmo;
|
||||
|
||||
public class EntityProjectileLaserBeam extends EntityProjectileAmmo
|
||||
{
|
||||
protected EntityProjectileLaserBeam(EnumAmmo ammo)
|
||||
{
|
||||
super(ammo);
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ import cz.tefek.srclone.EnumTeam;
|
|||
import cz.tefek.srclone.SRCloneMod;
|
||||
import cz.tefek.srclone.ammo.EnumAmmo;
|
||||
|
||||
public class EntityProjectilePlayerLaserBeam extends EntityProjectileLaserBeam
|
||||
public class EntityProjectilePlayerLaserBeam extends EntityProjectileAmmo
|
||||
{
|
||||
public EntityProjectilePlayerLaserBeam()
|
||||
{
|
||||
|
|
|
@ -38,4 +38,9 @@ public class AngleUtil
|
|||
|
||||
return angle;
|
||||
}
|
||||
|
||||
public static float snapToDirections(float angle, int directions)
|
||||
{
|
||||
return (float) (2.0f * Math.PI * Math.round(angle / 2.0f / Math.PI * directions) / directions);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,3 +26,7 @@
|
|||
|
||||
/bin
|
||||
/*/bin
|
||||
|
||||
|
||||
/out
|
||||
/*/out
|
|
@ -46,7 +46,7 @@ subprojects {
|
|||
repositories {
|
||||
maven {
|
||||
name = "Vega"
|
||||
url = uri("https://vega.botdiril.com/")
|
||||
url = uri("https://vega.botdiril.com/releases")
|
||||
credentials {
|
||||
val vegaUsername: String? by project
|
||||
val vegaPassword: String? by project
|
||||
|
|
2
libra
2
libra
|
@ -1 +1 @@
|
|||
Subproject commit 96217baf8fc9510444c20dbe1872339f798096e7
|
||||
Subproject commit 12bfe6a1eb4c92f7ec12da42c12014d63922655d
|
Loading…
Reference in New Issue