-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimized memory usage, batch export and conversion, multi resolution…
… export, new standalone executable for windows and linux.
- Loading branch information
1 parent
97d04f0
commit 0d9a704
Showing
35 changed files
with
1,062 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,8 @@ | |
*.so | ||
*.dll | ||
*.dylib | ||
**/hs_err_pid*.log | ||
**/hs_err_pid*.log | ||
**/.vscode | ||
.classpath | ||
.settings | ||
.project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package tests; | ||
import ddswriter.cli.CLI109; | ||
import ddswriter.delegates.lwjgl2_s3tc.S3tcCLI109Module; | ||
|
||
public class InteractiveCLI{ | ||
public static void main(String[] args) throws Exception { | ||
CLI109.main(new String[]{"--debug","--use_lwjgl","--interactive"}); | ||
// S3tcCLI109Module.class.newInstance(); | ||
CLI109.main(new String[]{"--debug","--interactive","--use-lwjgl"}); | ||
// CLI109.main(new String[]{"--debug","--in","D:\\Assets\\AGEN\\thelab_map\\textures\\Ramp_BaseColorMap.png","--out","C:\\Users\\Win7rb\\AppData\\Local\\Temp\\test.dds","--use-opengl", | ||
// "--format","S3TC_DXT1","--gen-mipmaps" | ||
// }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
./gradlew clean | ||
|
||
if [ "$1" = "travis" ]; | ||
then | ||
if [ "$TRAVIS_TAG" != "" ]; | ||
then | ||
args="-Pin_version=$TRAVIS_TAG" | ||
else | ||
args="-Pin_version=$TRAVIS_COMMIT" | ||
fi | ||
else | ||
args=$@ | ||
fi | ||
|
||
./gradlew build buildBundle $args | ||
cd build/libs | ||
cp -Rvf ../../res/* . | ||
chmod +x *.sh | ||
rm -Rvf dist | ||
if [ "$LINUX" != "" ]; | ||
then | ||
./make-linux-bundle.sh | ||
fi | ||
if [ "$WINDOWS" != "" ]; | ||
then | ||
./make-windows-bundle.sh | ||
fi | ||
./make-generic-bundle.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
package ddswriter; | ||
|
||
import com.jme3.math.Vector4f; | ||
|
||
import ddswriter.Texel.PixelFormat; | ||
|
||
/** | ||
* Pixel | ||
*/ | ||
public class Pixel{ | ||
Vector4f PIXEL=new Vector4f(); | ||
PixelFormat FORMAT; | ||
|
||
public Pixel(PixelFormat format,float r,float g,float b,float a){ | ||
this(format,null); | ||
PIXEL.set(r,g,b,a); | ||
} | ||
|
||
public Pixel(PixelFormat format,Vector4f px){ | ||
if(px!=null)PIXEL.set(px); | ||
FORMAT=format; | ||
} | ||
|
||
public Vector4f getRawPixel() { | ||
return PIXEL; | ||
} | ||
|
||
public float r(PixelFormat toformat) { | ||
return get(toformat,0); | ||
} | ||
|
||
public float g(PixelFormat toformat) { | ||
return get(toformat,1); | ||
} | ||
|
||
public float b(PixelFormat toformat) { | ||
return get(toformat,2); | ||
} | ||
|
||
public float a(PixelFormat toformat) { | ||
return get(toformat,3); | ||
} | ||
|
||
protected float get(PixelFormat to, int p) { | ||
PixelFormat from=FORMAT; | ||
if(from==to) return get(p); | ||
if(from==PixelFormat.FLOAT_NORMALIZED_RGBA){ | ||
switch(to){ | ||
case INT_RGBA:{ | ||
return get(p)*255f; | ||
// Vector4f out = c.clone(); | ||
// out.x = (int) (c.x * 255f); | ||
// out.y = (int) (c.y * 255f); | ||
// out.z = (int) (c.z * 255f); | ||
// out.w = (int) (c.w * 255f); | ||
// return out; | ||
} | ||
case PACKED_ARGB:{ | ||
int x=(int)(get(0)*255f); | ||
int y=(int)(get(1)*255f); | ||
int z=(int)(get(2)*255f); | ||
int w=(int)(get(3)*255f); | ||
|
||
int packed=(int)w<<24|(int)x<<16|(int)y<<8|(int)z; | ||
|
||
// Vector4f out = convert(PixelFormat.FLOAT_NORMALIZED_RGBA, PixelFormat.INT_RGBA, c); | ||
// out = convert(PixelFormat.INT_RGBA, PixelFormat.PACKED_ARGB, out); | ||
return packed; | ||
} | ||
} | ||
}else if(from==PixelFormat.INT_RGBA){ | ||
switch(to){ | ||
case FLOAT_NORMALIZED_RGBA:{ | ||
return get(p)/255f; | ||
} | ||
case PACKED_ARGB:{ | ||
int x=(int)(get(0)); | ||
int y=(int)(get(1)); | ||
int z=(int)(get(2)); | ||
int w=(int)(get(3)); | ||
|
||
int packed=(int)w<<24|(int)x<<16|(int)y<<8|(int)z; | ||
return packed; | ||
// Vector4f out = new Vector4f(); | ||
// int p = (int) c.w << 24 | (int) c.x << 16 | (int) c.y << 8 | (int) c.z; | ||
// out.x = p; | ||
// return out; | ||
} | ||
} | ||
} | ||
throw new UnsupportedOperationException(); | ||
|
||
} | ||
|
||
protected float get(int p) { | ||
switch(p){ | ||
case 0: | ||
return PIXEL.x; | ||
case 1: | ||
return PIXEL.y; | ||
case 2: | ||
return PIXEL.z; | ||
case 3: | ||
return PIXEL.w; | ||
} | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
// protected Vector4f convert(PixelFormat from, PixelFormat to, Vector4f c) { | ||
// if(from==to) return c; | ||
// if(from==PixelFormat.FLOAT_NORMALIZED_RGBA){ | ||
// switch(to){ | ||
// case INT_RGBA:{ | ||
// Vector4f out=c.clone(); | ||
// out.x=(int)(c.x*255f); | ||
// out.y=(int)(c.y*255f); | ||
// out.z=(int)(c.z*255f); | ||
// out.w=(int)(c.w*255f); | ||
// return out; | ||
// } | ||
// case PACKED_ARGB:{ | ||
// Vector4f out=convert(PixelFormat.FLOAT_NORMALIZED_RGBA,PixelFormat.INT_RGBA,c); | ||
// out=convert(PixelFormat.INT_RGBA,PixelFormat.PACKED_ARGB,out); | ||
// return out; | ||
// } | ||
// } | ||
// }else if(from==PixelFormat.INT_RGBA){ | ||
// switch(to){ | ||
// case FLOAT_NORMALIZED_RGBA:{ | ||
// Vector4f out=c.clone(); | ||
// out.x=(c.x/255f); | ||
// out.y=(c.y/255f); | ||
// out.z=(c.z/255f); | ||
// out.w=(c.w/255f); | ||
// return out; | ||
// } | ||
// case PACKED_ARGB:{ | ||
// Vector4f out=new Vector4f(); | ||
// int p=(int)c.w<<24|(int)c.x<<16|(int)c.y<<8|(int)c.z; | ||
// out.x=p; | ||
// return out; | ||
// } | ||
// } | ||
// } | ||
// return null; | ||
// } | ||
|
||
public Vector4f toVector4f(PixelFormat format) { | ||
return new Vector4f(r(format),g(format),b(format),a(format)); | ||
} | ||
public Vector4f toVector4f(PixelFormat format,Vector4f v) { | ||
v.set(r(format),g(format),b(format),a(format)); | ||
return v; | ||
} | ||
} |
Oops, something went wrong.