[DEV] set game working
This commit is contained in:
parent
7df6179a53
commit
891f6ba5bc
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
|
||||||
<classpathentry kind="src" path="resources"/>
|
<classpathentry kind="src" path="resources"/>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="src" output="out/eclipse/classes-test" path="test/src">
|
<classpathentry kind="src" output="out/eclipse/classes-test" path="test/src">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="test" value="true"/>
|
<attribute name="test" value="true"/>
|
||||||
|
@ -413,6 +413,8 @@ void setNormalMode(NormalMode _mode) {
|
|||||||
// Log.debug("nb cycle ? : " + tmpppppp);
|
// Log.debug("nb cycle ? : " + tmpppppp);
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Integer> outIndex = new ArrayList<>();
|
||||||
if (this.listPaletteFaces.size() != 0) {
|
if (this.listPaletteFaces.size() != 0) {
|
||||||
FaceIndexing outputIndex = new FaceIndexing();
|
FaceIndexing outputIndex = new FaceIndexing();
|
||||||
//Add palette virtual material:
|
//Add palette virtual material:
|
||||||
@ -481,6 +483,7 @@ void setNormalMode(NormalMode _mode) {
|
|||||||
}
|
}
|
||||||
for(int indice=0 ; indice<nbIndicInFace; indice++) {
|
for(int indice=0 ; indice<nbIndicInFace; indice++) {
|
||||||
outputIndex.index().add(vertexVBOId[indice]);
|
outputIndex.index().add(vertexVBOId[indice]);
|
||||||
|
outIndex.add(vertexVBOId[indice]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -490,6 +493,7 @@ void setNormalMode(NormalMode _mode) {
|
|||||||
this.vao.setPosition(outPosition);
|
this.vao.setPosition(outPosition);
|
||||||
this.vao.setTextureCoordinate(outTexturePosition);
|
this.vao.setTextureCoordinate(outTexturePosition);
|
||||||
this.vao.setColors(outColor);
|
this.vao.setColors(outColor);
|
||||||
|
this.vao.setIndices(outIndex);
|
||||||
this.vao.flush();
|
this.vao.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import org.atriasoft.etk.math.Vector2f;
|
|||||||
import org.atriasoft.etk.math.Vector3f;
|
import org.atriasoft.etk.math.Vector3f;
|
||||||
import org.atriasoft.etk.math.Vector4f;
|
import org.atriasoft.etk.math.Vector4f;
|
||||||
import org.atriasoft.etk.util.Dynamic;
|
import org.atriasoft.etk.util.Dynamic;
|
||||||
|
import org.atriasoft.gale.backend3d.OpenGL.RenderMode;
|
||||||
import org.atriasoft.loader3d.Face;
|
import org.atriasoft.loader3d.Face;
|
||||||
import org.atriasoft.loader3d.FaceIndexing;
|
import org.atriasoft.loader3d.FaceIndexing;
|
||||||
import org.atriasoft.loader3d.NormalMode;
|
import org.atriasoft.loader3d.NormalMode;
|
||||||
@ -54,6 +55,7 @@ enum emfModuleMode {
|
|||||||
// TODO : rework with string line extractor
|
// TODO : rework with string line extractor
|
||||||
public ResourceMeshEmf(Uri _fileName) {
|
public ResourceMeshEmf(Uri _fileName) {
|
||||||
super(_fileName);
|
super(_fileName);
|
||||||
|
mode = RenderMode.TRIANGLE;
|
||||||
this.checkNormal = true;
|
this.checkNormal = true;
|
||||||
this.normalMode = NormalMode.NONE;
|
this.normalMode = NormalMode.NONE;
|
||||||
InputStream fileIOStream = Uri.getStream(_fileName);
|
InputStream fileIOStream = Uri.getStream(_fileName);
|
||||||
|
@ -33,7 +33,7 @@ import org.atriasoft.gale.resource.Resource;
|
|||||||
* example black, or white or orange ...)
|
* example black, or white or orange ...)
|
||||||
*/
|
*/
|
||||||
public class ResourcePaletteFile extends Resource {
|
public class ResourcePaletteFile extends Resource {
|
||||||
private static final int COUNT_MAX_COLOR_PALETTE = 4096;
|
private static final int COUNT_MAX_COLOR_PALETTE = 32;
|
||||||
private static final List<String> PALETTE_ELEMENTS = new ArrayList<>(COUNT_MAX_COLOR_PALETTE);
|
private static final List<String> PALETTE_ELEMENTS = new ArrayList<>(COUNT_MAX_COLOR_PALETTE);
|
||||||
static {
|
static {
|
||||||
PALETTE_ELEMENTS.add("unknown");
|
PALETTE_ELEMENTS.add("unknown");
|
||||||
@ -180,9 +180,21 @@ public class ResourcePaletteFile extends Resource {
|
|||||||
int width = COUNT_MAX_COLOR_PALETTE;
|
int width = COUNT_MAX_COLOR_PALETTE;
|
||||||
int height = 8;
|
int height = 8;
|
||||||
ImageByteRGBA out = new ImageByteRGBA(width, height);
|
ImageByteRGBA out = new ImageByteRGBA(width, height);
|
||||||
|
//ImageByteRGB out = new ImageByteRGB(width, height);
|
||||||
|
// clear the palette:
|
||||||
|
//float val = 0.0f;
|
||||||
|
for (int xxx=0; xxx < width; xxx++) {
|
||||||
|
for (int yyy=0; yyy < 8; yyy++) {
|
||||||
|
out.setColorFloat(xxx, yyy, 1, 1, 1, 1);
|
||||||
|
//out.setColorFloat(xxx, yyy, val, val + 0.125f, val + 0.85f, 1);
|
||||||
|
//val += 0.01f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Entry<String, MaterialBase> it : this.list.entrySet()) {
|
for (Entry<String, MaterialBase> it : this.list.entrySet()) {
|
||||||
int id = getColorId(it.getKey());
|
int id = getColorId(it.getKey());
|
||||||
MaterialBase mat = it.getValue();
|
MaterialBase mat = it.getValue();
|
||||||
|
Log.error("add Material in texture: '" + it.getKey() + "' ==> " + id + " mat=" + mat);
|
||||||
// 2 element this will permit to change color in the future on depend on some parameters...
|
// 2 element this will permit to change color in the future on depend on some parameters...
|
||||||
out.setColorFloat(id, 0, mat.getDiffuseFactor().x(), mat.getDiffuseFactor().y(), mat.getDiffuseFactor().z(), mat.getDiffuseFactor().w());
|
out.setColorFloat(id, 0, mat.getDiffuseFactor().x(), mat.getDiffuseFactor().y(), mat.getDiffuseFactor().z(), mat.getDiffuseFactor().w());
|
||||||
out.setColorFloat(id, 1, mat.getDiffuseFactor().x(), mat.getDiffuseFactor().y(), mat.getDiffuseFactor().z(), mat.getDiffuseFactor().w());
|
out.setColorFloat(id, 1, mat.getDiffuseFactor().x(), mat.getDiffuseFactor().y(), mat.getDiffuseFactor().z(), mat.getDiffuseFactor().w());
|
||||||
|
@ -39,6 +39,12 @@ public class ResourceStaticMesh extends Resource {
|
|||||||
}
|
}
|
||||||
this.vao.render(this.mode);
|
this.vao.render(this.mode);
|
||||||
}
|
}
|
||||||
|
public void renderArrays() {
|
||||||
|
if (this.vao == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.vao.renderArrays(this.mode);
|
||||||
|
}
|
||||||
|
|
||||||
public void setMode(final RenderMode mode) {
|
public void setMode(final RenderMode mode) {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user