cmontiel
Member
|
Weird textures
(This post was last modified: 10-10-2014 10:42 AM by cmontiel.)
|
|
10-10-2014 10:36 AM |
|
Esenthel
Administrator
|
RE: Weird textures
Can you attach the source image, and describe what exactly is the problem?
|
|
10-10-2014 10:43 AM |
|
cmontiel
Member
|
RE: Weird textures
Sent you a pm with source image. You can see the problem comparing with the link above.
I will make a full merge with latest code, maybe i did something wrong.
(This post was last modified: 10-10-2014 11:01 AM by cmontiel.)
|
|
10-10-2014 11:00 AM |
|
Esenthel
Administrator
|
RE: Weird textures
Hi,
I've made a quick test (on Win for now)
Code:
/******************************************************************************/
ImagePtr logo;
/******************************************************************************/
void InitPre()
{
EE_INIT();
App.flag|=APP_FULL_TOGGLE;
}
bool Init()
{
SupportPVRTC();
logo=UID(2291143500, 1166413659, 2975352728, 2461956582);
Image temp;
logo->copyTry(temp, -1, -1, -1, IMAGE_PVRTC4, IMAGE_2D, 1);
temp.save("d:/0.gfx");
logo="d:/0.gfx";
return true;
}
void Shut()
{
}
/******************************************************************************/
bool Update()
{
if(Kb.bp(KB_ESC))return false;
Gui.update();
return true;
}
void Draw()
{
D.clear(WHITE);
if(logo)logo->drawFs();
Gui.draw();
D.text(0, 0, S+Time.frame());
}
/******************************************************************************/
load the image, save it as PVRTC4, then reload that, and display on screen, and it works ok.
If you still have the issue after full complete rebuild of the engine+editor, please provide steps to reproduce the problem.
Thank you very much
|
|
10-10-2014 11:20 AM |
|
cmontiel
Member
|
RE: Weird textures
The .gfx is well formed, the issue is only on MAC displaying it.
Could you try to draw it on Mac? It will take me a day or 2, to merge all again.
(This post was last modified: 10-10-2014 11:46 AM by cmontiel.)
|
|
10-10-2014 11:25 AM |
|
cmontiel
Member
|
RE: Weird textures
Ok I found where. Image.load(file) and ImageAtlas.load(file) are not working properly on Mac. Tested with last source code, "file" is a EE::File (not Str).
Looks like save(file) and copyTry methods have issues too.
(This post was last modified: 10-11-2014 02:58 AM by cmontiel.)
|
|
10-11-2014 12:52 AM |
|
Esenthel
Administrator
|
RE: Weird textures
Thank you,
I was able to reproduce the issue on Mac, I'll investigate this now.
|
|
10-11-2014 10:21 AM |
|
Esenthel
Administrator
|
RE: Weird textures
Thank you for reporting the issue, I've found and fixed the problem.
|
|
10-11-2014 12:56 PM |
|
cmontiel
Member
|
RE: Weird textures
Image.load(file) ok.
ImageAtlas.load(file) still fails.
(This post was last modified: 10-11-2014 02:18 PM by cmontiel.)
|
|
10-11-2014 02:17 PM |
|
Esenthel
Administrator
|
RE: Weird textures
Hello,
ImageAtlas is based on Image so I think it should work.
Could you try re-creating the ImageAtlas file using the "Create" button in the Editor, or do this manually if you're using your own solution.
If that won't help, please provide a sample project to reproduce the problem, thank you.
|
|
10-12-2014 01:49 AM |
|
cmontiel
Member
|
|
10-12-2014 10:42 AM |
|
Esenthel
Administrator
|
RE: Weird textures
Hello,
If you do
Code:
f.read(pathName);
atlas.load(f);
or
Code:
atlas.load(pathName);
This doesn't matter, because if you go to ImageAtlas.load source from Str name, you will see that it uses File.
I've tested both methods and they gave me the same results.
You wrote to me in PM Quote:It was created manually using .pixel(intx,inty,pixel); and copyTry function.
Perhaps that's the problem?
Are you not using provided ImageAtlas.create?
If you're creating Images manually you need to clear them at start using Image.clear.
|
|
10-12-2014 11:04 AM |
|
cmontiel
Member
|
RE: Weird textures
Fixed image.clear() did the trick.
Now i am curious why was working before the update wihout clear .
Thanks for support and quick answers.
|
|
10-12-2014 11:20 AM |
|
Esenthel
Administrator
|
RE: Weird textures
I recommend not using custom tools/methods for the things that the Engine and Editor already provide working solutions.
Why it may have worked before is that when you're not calling clear, then unitialized memory state is always undefined, so it could have been zero before.
|
|
10-12-2014 11:25 AM |
|