Skip to content

Commit a4039ce

Browse files
committed
fix the return of getRowView and import the vector api into examples
1 parent fc37f5d commit a4039ce

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

examples/build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ java {
1818
}
1919

2020
tasks.withType<JavaExec> {
21-
jvmArgs("--enable-native-access=ALL-UNNAMED")
21+
jvmArgs("--enable-native-access=ALL-UNNAMED", "--add-modules", "jdk.incubator.vector")
2222
}
2323

24-
tasks.compileJava {
24+
tasks.withType<JavaCompile> {
25+
options.compilerArgs.addAll(listOf(
26+
"--add-modules", "jdk.incubator.vector"
27+
))
28+
2529
val processorOutput = rootProject.layout.buildDirectory.dir("classes/java/processor").get().asFile
2630
options.annotationProcessorPath = files(processorOutput) + rootProject.configurations.runtimeClasspath.get()
2731
}

src/main/java/com/github/elebras1/flecs/Table.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ public void resetColumn(Class<?> componentClass) {
264264
}
265265
}
266266

267-
public ComponentRowView getRowView(Class<?> componentClass) {
267+
@SuppressWarnings("unchecked")
268+
public <V extends ComponentRowView> V getRowView(Class<?> componentClass) {
268269
int col = this.columnIndex(componentClass);
269270
if (col == -1) {
270271
return null;
@@ -273,7 +274,7 @@ public ComponentRowView getRowView(Class<?> componentClass) {
273274
if (columnSeg.address() == 0) {
274275
return null;
275276
}
276-
ComponentRowView view = this.world.viewCache().getComponentRowView(componentClass);
277+
V view = (V) this.world.viewCache().getComponentRowView(componentClass);
277278
view.setSegment(columnSeg);
278279
view.setCount(this.count());
279280
return view;

0 commit comments

Comments
 (0)