Skip to content

Commit

Permalink
Update lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Ealrann committed Jul 13, 2020
1 parent 0b4d880 commit e0f59b8
Show file tree
Hide file tree
Showing 38 changed files with 111 additions and 102 deletions.
Empty file modified .gitignore
100755 → 100644
Empty file.
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,21 @@ subprojects {

apply plugin: 'java-library'

version "1.3.6"
version "1.4.0"

sourceCompatibility = 14
targetCompatibility = 14

tasks.withType(JavaCompile) {
options.compilerArgs += "--enable-preview"
}
tasks.withType(Test) {
jvmArgs += "--enable-preview"
}
tasks.withType(JavaExec) {
jvmArgs += "--enable-preview"
}

java {
modularity.inferModulePath = true
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions org.sheepy.vsand.model/model/VSand.genmodel
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.sheepy.vsand.model/src/generated/java" creationSubmenus="true"
editDirectory="/org.sheepy.vsand.model.edit/src/generated/java" editorDirectory="/org.sheepy.vsand.model.editor/src/generated/java"
modelPluginID="org.sheepy.vsand.model" modelName="VSand" rootExtendsInterface="org.sheepy.lily.core.api.adapter.ILilyEObject"
rootExtendsClass="org.sheepy.lily.core.api.adapter.LilyEObject" testsDirectory=""
modelPluginID="org.sheepy.vsand.model" modelName="VSand" rootExtendsInterface="org.sheepy.lily.core.api.model.ILilyEObject"
rootExtendsClass="org.sheepy.lily.core.api.model.LilyEObject" testsDirectory=""
booleanFlagsField="" importerID="org.eclipse.emf.importer.ecore" complianceLevel="11.0"
language="en" usedGenPackages="../../org.sheepy.lily.vulkan.extra.model/model/Extra.genmodel#//nuklear ../../org.sheepy.lily.core.model/model/Lily.genmodel#//ui ../../org.sheepy.lily.core.model/model/Lily.genmodel#//presentation ../../org.sheepy.lily.core.model/model/Lily.genmodel#//application ../../org.sheepy.lily.core.model/model/Lily.genmodel#//variable ../../org.sheepy.lily.core.model/model/Lily.genmodel#//types ../../org.sheepy.lily.core.model/model/Lily.genmodel#//inference ../../org.sheepy.lily.core.model/model/Lily.genmodel#//maintainer ../../org.sheepy.lily.core.model/model/Lily.genmodel#//cadence ../../org.sheepy.lily.core.model/model/Lily.genmodel#//action ../../org.sheepy.lily.vulkan.model/model/LilyVulkan.genmodel#//process ../../org.sheepy.lily.vulkan.model/model/LilyVulkan.genmodel#//resource ../../org.sheepy.lily.vulkan.model/model/LilyVulkan.genmodel#//model ../../org.sheepy.vulkan.model/model/Vulkan.genmodel#//barrier ../../org.sheepy.vulkan.model/model/Vulkan.genmodel#//enumeration ../../org.sheepy.vulkan.model/model/Vulkan.genmodel#//image ../../org.sheepy.vulkan.model/model/Vulkan.genmodel#//pipeline ../../org.sheepy.lily.core.model/model/Lily.genmodel#//resource"
operationReflection="true" importOrganizing="true" decoration="Live" cleanup="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*/
package org.sheepy.vsand.model;

import org.sheepy.lily.core.api.adapter.ILilyEObject;
import org.sheepy.lily.core.api.model.ILilyEObject;

/**
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*/
package org.sheepy.vsand.model;

import org.sheepy.lily.core.api.adapter.ILilyEObject;
import org.sheepy.lily.core.api.model.ILilyEObject;

/**
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*/
package org.sheepy.vsand.model;

import org.sheepy.lily.core.api.adapter.ILilyEObject;
import org.sheepy.lily.core.api.model.ILilyEObject;
import org.sheepy.lily.core.model.resource.Sound;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.eclipse.emf.common.util.EList;

import org.sheepy.lily.core.api.adapter.ILilyEObject;
import org.sheepy.lily.core.api.model.ILilyEObject;

/**
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package org.sheepy.vsand.model;

import org.eclipse.emf.common.util.EList;
import org.sheepy.lily.core.api.adapter.ILilyEObject;
import org.sheepy.lily.core.api.model.ILilyEObject;

/**
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package org.sheepy.vsand.model;

import org.eclipse.emf.common.util.EList;
import org.sheepy.lily.core.api.adapter.ILilyEObject;
import org.sheepy.lily.core.api.model.ILilyEObject;

/**
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.sheepy.lily.core.api.adapter.LilyEObject;
import org.sheepy.lily.core.api.model.LilyEObject;
import org.sheepy.vsand.model.DrawCircle;
import org.sheepy.vsand.model.Material;
import org.sheepy.vsand.model.VSandPackage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.sheepy.lily.core.api.adapter.LilyEObject;
import org.sheepy.lily.core.api.model.LilyEObject;
import org.sheepy.vsand.model.DrawLine;
import org.sheepy.vsand.model.Material;
import org.sheepy.vsand.model.VSandPackage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.sheepy.lily.core.api.adapter.LilyEObject;
import org.sheepy.lily.core.api.model.LilyEObject;
import org.sheepy.vsand.model.DrawSquare;
import org.sheepy.vsand.model.Material;
import org.sheepy.vsand.model.VSandPackage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.sheepy.lily.core.api.adapter.LilyEObject;
import org.sheepy.lily.core.api.model.LilyEObject;

import org.sheepy.vsand.model.InputMaterialProvider;
import org.sheepy.vsand.model.Materials;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.sheepy.lily.core.api.adapter.LilyEObject;
import org.sheepy.lily.core.api.model.LilyEObject;
import org.sheepy.lily.core.model.resource.Sound;
import org.sheepy.vsand.model.Material;
import org.sheepy.vsand.model.VSandPackage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import org.eclipse.emf.ecore.util.EObjectResolvingEList;

import org.sheepy.lily.core.api.adapter.LilyEObject;
import org.sheepy.lily.core.api.model.LilyEObject;

import org.sheepy.vsand.model.Material;
import org.sheepy.vsand.model.MaterialProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import org.sheepy.lily.core.api.adapter.LilyEObject;
import org.sheepy.lily.core.api.model.LilyEObject;
import org.sheepy.vsand.model.Material;
import org.sheepy.vsand.model.Materials;
import org.sheepy.vsand.model.VSandPackage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.sheepy.lily.core.api.adapter.LilyEObject;
import org.sheepy.lily.core.api.model.LilyEObject;

import org.sheepy.vsand.model.Material;
import org.sheepy.vsand.model.MaterialProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.sheepy.lily.core.api.adapter.LilyEObject;
import org.sheepy.lily.core.api.model.LilyEObject;
import org.sheepy.vsand.model.Material;
import org.sheepy.vsand.model.Transformation;
import org.sheepy.vsand.model.VSandPackage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import org.sheepy.lily.core.api.adapter.LilyEObject;
import org.sheepy.lily.core.api.model.LilyEObject;
import org.sheepy.vsand.model.ITransformation;
import org.sheepy.vsand.model.Transformations;
import org.sheepy.vsand.model.VSandPackage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class VSandApplicationLauncher
{
private static final String APPLICATION_PATH = "Application.vsand";
private static final String APPLICATION_VERSION = "1.3.6";
private static final String APPLICATION_VERSION = "1.4.0";

private static final IResourceLoader resourceLoader = IResourceLoader.INSTANCE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void start(Material material)
if (paintSound != null)
{
final var pitch = material.getPitch();
final var soundAdapter = paintSound.allocationHandle(IAudioAllocation.class).get();
final var soundAdapter = paintSound.adapt(IAudioAllocation.class);
audioHandle = soundAdapter.play(audioConfig.builder().pitch(pitch).build());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
import org.lwjgl.system.MemoryUtil;
import org.sheepy.lily.core.api.adapter.annotation.Adapter;
import org.sheepy.lily.core.api.adapter.annotation.Dispose;
import org.sheepy.lily.core.api.adapter.annotation.Load;
import org.sheepy.lily.core.api.cadence.Tick;
import org.sheepy.lily.core.api.extender.ModelExtender;
import org.sheepy.lily.core.api.input.IInputManager;
import org.sheepy.lily.core.api.util.ModelUtil;
import org.sheepy.lily.vulkan.api.engine.IVulkanEngineAdapter;
import org.sheepy.lily.vulkan.api.input.IVulkanInputManager;
import org.sheepy.lily.vulkan.api.resource.buffer.IConstantBufferUpdater;
import org.sheepy.lily.vulkan.model.VulkanEngine;
import org.sheepy.lily.vulkan.model.resource.ConstantBuffer;
import org.sheepy.vsand.model.PixelConstantBuffer;
import org.sheepy.vsand.model.VSandApplication;
Expand All @@ -28,27 +25,16 @@ public final class PixelConstantBufferAdapter implements IConstantBufferUpdater

private final PixelConstantBuffer constantBuffer;
private final VSandApplication application;

private ByteBuffer buffer = null;

private IVulkanInputManager inputManager;
private final ByteBuffer buffer;
private final IInputManager inputManager;

private PixelConstantBufferAdapter(PixelConstantBuffer constantBuffer)
{
this.constantBuffer = constantBuffer;

application = (VSandApplication) ModelUtil.getApplication(constantBuffer);
}

@Load
private void load()
{
inputManager = application.adapt(IInputManager.class);
buffer = MemoryUtil.memAlloc(BYTE_SIZE);

final var vulkanEngine = (VulkanEngine) application.getEngines().get(0);
final var engineAdapter = vulkanEngine.adapt(IVulkanEngineAdapter.class);
inputManager = engineAdapter.getInputManager();

updateBuffer();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import java.nio.ByteBuffer;

import org.sheepy.lily.core.api.adapter.IAdapter;
import org.sheepy.lily.core.api.extender.IExtender;
import org.sheepy.vsand.model.DrawCommand;

public interface IDrawCommandAdapter<T extends DrawCommand> extends IAdapter
public interface IDrawCommandAdapter<T extends DrawCommand> extends IExtender
{
void fillBuffer(T command, ByteBuffer buffer);
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.sheepy.vsand.input;

import org.sheepy.lily.core.api.adapter.IAdapter;
import org.sheepy.lily.core.api.extender.IExtender;
import org.sheepy.lily.core.api.input.IInputManager;
import org.sheepy.vsand.audio.MaterialSoundManager;
import org.sheepy.vsand.draw.DrawManager;
import org.sheepy.vsand.model.Material;
import org.sheepy.vsand.model.VSandApplication;
import org.sheepy.vsand.util.BoardUtil;

abstract class AbstractDrawer implements IAdapter
abstract class AbstractDrawer implements IExtender
{
private final MaterialSoundManager soundManager = new MaterialSoundManager();
private final DrawManager drawManager = new DrawManager();
Expand All @@ -21,7 +21,7 @@ abstract class AbstractDrawer implements IAdapter
public AbstractDrawer(VSandApplication application)
{
this.application = application;
inputManager = IInputManager.get(application).orElseThrow();
inputManager = IInputManager.get(application);
inputManager.listen(this::afterPollInputs, IInputManager.Features.AfterPollInputs);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.sheepy.vsand.input;

import org.eclipse.emf.common.util.EList;
import org.sheepy.lily.core.api.adapter.IAdapter;
import org.sheepy.lily.core.api.adapter.annotation.Adapter;
import org.sheepy.lily.core.api.extender.IExtender;
import org.sheepy.lily.core.api.extender.ModelExtender;
import org.sheepy.lily.core.api.input.IInputManager;
import org.sheepy.lily.core.api.input.event.KeyEvent;
Expand All @@ -13,7 +13,7 @@

@ModelExtender(scope = VSandApplication.class)
@Adapter(lazy = false)
public final class InputManager implements IAdapter
public final class InputManager implements IExtender
{
private final VSandApplication application;
private final IInputManager inputManager;
Expand All @@ -24,7 +24,7 @@ public InputManager(VSandApplication application)
{
this.application = application;

inputManager = IInputManager.get(application).orElseThrow();
inputManager = IInputManager.get(application);
inputManager.showCursor(inputManager.isMouseOnUI());
inputManager.listen(this::onMouseOverUI, IInputManager.Features.MouseOverUIEvent);
inputManager.listen(this::onKeyEvent, IInputManager.Features.KeyEvent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PrimaryDrawer(final VSandApplication application)
{
super(application);

final var inputManager = IInputManager.get(application).orElseThrow();
final var inputManager = IInputManager.get(application);
inputManager.listen(this::onMouseClickEvent, IInputManager.Features.MouseClickEvent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public SecondaryDrawer(final VSandApplication application)
{
super(application);

final var inputManager = IInputManager.get(application).orElseThrow();
final var inputManager = IInputManager.get(application);
inputManager.listen(this::onMouseClickEvent, IInputManager.Features.MouseClickEvent);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.sheepy.vsand.loader;

import org.lwjgl.system.MemoryUtil;
import org.sheepy.lily.core.api.adapter.IAdapter;
import org.sheepy.lily.core.api.adapter.annotation.Adapter;
import org.sheepy.lily.core.api.adapter.annotation.Dispose;
import org.sheepy.lily.core.api.adapter.annotation.Load;
import org.sheepy.lily.core.api.extender.IExtender;
import org.sheepy.lily.core.api.extender.ModelExtender;
import org.sheepy.lily.core.api.util.ModelUtil;
import org.sheepy.lily.vulkan.model.resource.Buffer;
Expand All @@ -14,7 +14,7 @@

@ModelExtender(scope = Buffer.class, name = "Board Buffer 1")
@Adapter(singleton = true, lazy = false)
public final class Board1BufferLoader implements IAdapter
public final class Board1BufferLoader implements IExtender
{
@Load
private static void load(Buffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
import java.nio.ByteBuffer;

import org.lwjgl.system.MemoryUtil;
import org.sheepy.lily.core.api.adapter.IAdapter;
import org.sheepy.lily.core.api.adapter.annotation.Adapter;
import org.sheepy.lily.core.api.adapter.annotation.Dispose;
import org.sheepy.lily.core.api.adapter.annotation.Load;
import org.sheepy.lily.core.api.extender.IExtender;
import org.sheepy.lily.core.api.extender.ModelExtender;
import org.sheepy.lily.core.api.util.ModelUtil;
import org.sheepy.lily.vulkan.model.resource.Buffer;
import org.sheepy.vsand.model.VSandApplication;

@ModelExtender(scope = Buffer.class, name = "Board Buffer 2")
@Adapter(singleton = true, lazy = false)
public final class Board2BufferLoader implements IAdapter
public final class Board2BufferLoader implements IExtender
{
@Load
private static void load(Buffer buffer)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.sheepy.vsand.loader;

import org.sheepy.lily.core.api.adapter.IAdapter;
import org.sheepy.lily.core.api.adapter.annotation.Adapter;
import org.sheepy.lily.core.api.adapter.annotation.Load;
import org.sheepy.lily.core.api.extender.IExtender;
import org.sheepy.lily.core.api.extender.ModelExtender;
import org.sheepy.lily.core.api.util.ModelUtil;
import org.sheepy.lily.vulkan.model.resource.StaticImage;
Expand All @@ -11,7 +11,7 @@

@ModelExtender(scope = StaticImage.class, name = "Board Image")
@Adapter(singleton = true, lazy = false)
public final class BoardImageLoader implements IAdapter
public final class BoardImageLoader implements IExtender
{
@Load
private static void load(StaticImage image)
Expand Down
Loading

0 comments on commit e0f59b8

Please sign in to comment.