Beta release 4.0b
Moderator: Moderators
Doesn't detect errors
To me this looks like it shouldn't compile, but it does (note the last line):
int sum;
for(int i=0; i<10; i++)
{if(i>=5)continue;
sum+=i;
}}}}}}Lorem Ipsum
int sum;
for(int i=0; i<10; i++)
{if(i>=5)continue;
sum+=i;
}}}}}}Lorem Ipsum
Re: Beta release 4.0b
Indeed the compiler does not detect garbage if it comes last in the expression
. I should fix that.

Shouldn't compile?
Maybe it doesn't matter if it's at the end, for example this also goes through (but nothing will be traced if you run it):
int inx,iny;
inx = 10;
} //mistake
inx += 2;
trace (intToStr(inx));
(I just found I posted something similar a long time ago:
viewtopic.php?p=8271#p8271)
int inx,iny;
inx = 10;
} //mistake
inx += 2;
trace (intToStr(inx));
(I just found I posted something similar a long time ago:
viewtopic.php?p=8271#p8271)
Preview Window Malfunctioning
While working with shader components, I noticed the preview window showing weird stuff. The program ran correctly (with f9). After closing the project and restarting the computer, the preview window seemed to function correctly until I changed the fragmentshadersource code.
I then started a new project testing out some mesh stuff, the problem came back but this time on clicking the preview play button this error was thrown: #Access violation at address 006323A4 in module 'ZGameEditor.exe'. Read of address 00000018.
I then started a new project testing out some mesh stuff, the problem came back but this time on clicking the preview play button this error was thrown: #Access violation at address 006323A4 in module 'ZGameEditor.exe'. Read of address 00000018.
- Attachments
-
- meshProb.zgeproj
- (894 Bytes) Downloaded 1126 times
-
- fragsourceProb.zgeproj
- (2.35 KiB) Downloaded 1172 times
Re: Beta release 4.0b
Hi, the meshproblem error is because you need a "MaterialTexture" component to tie the Material and Bitmap together. I should add a test so it gives a better error message.
See modified project below.
The other project just shows a flashing image here. Not sure what the expected result is? Please compare with the sample zgeviz shader projects to get the basic view working.
See modified project below.
The other project just shows a flashing image here. Not sure what the expected result is? Please compare with the sample zgeviz shader projects to get the basic view working.
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" FileVersion="2">
<OnLoaded>
<SpawnModel Model="Model1" SpawnStyle="1"/>
</OnLoaded>
<Content>
<Model Name="Model1">
<OnRender>
<UseMaterial Material="Material1"/>
<RenderMesh Mesh="Mesh1"/>
</OnRender>
</Model>
<Material Name="Material1">
<Textures>
<MaterialTexture Texture="Bitmap1"/>
</Textures>
</Material>
<Mesh Name="Mesh1">
<Producers>
<MeshSphere RadialSamples="50"/>
<MeshNoise Scale="0.3 1 1" NoiseSpeed="1 0 1" NoiseScale="1 1 1"/>
</Producers>
</Mesh>
<Bitmap Name="Bitmap1">
<Producers>
<BitmapNoise Octaves="9" Persistence="0.77" ZHeight="42.08" Color="1"/>
<BitmapPixels NOfPoints="43" Color="1"/>
</Producers>
</Bitmap>
</Content>
</ZApplication>
Re: Beta release 4.0b
Ok, that was my mistake on the meshproblem. Thanks for the clarification.
To replicate the shader preview bug in fragsourceprob:
Preview the project. Should be some random greyscale flashing with a black bar on the right.
Stop the preview.
Comment out lines 18 - 27 in Shader1 fragmentshadersource.
Uncomment line 16 in Shader1 fragmentshadersource.
Compile.
Preview the project. Preview window should show a gradient from white to black but instead shows black.
Run the project with f9 it displays correctly.
To replicate the shader preview bug in fragsourceprob:
Preview the project. Should be some random greyscale flashing with a black bar on the right.
Stop the preview.
Comment out lines 18 - 27 in Shader1 fragmentshadersource.
Uncomment line 16 in Shader1 fragmentshadersource.
Compile.
Preview the project. Preview window should show a gradient from white to black but instead shows black.
Run the project with f9 it displays correctly.
Re: Beta release 4.0b
Ok, I could reproduce that. It seems the Shader component needs the "UpdateVarsOnEachUse" property set. Try that and it should work.
Re: Beta release 4.0b
Nice! Everything works as expected. Thanks for clearing that up, it helps a lot.
Re: Beta release 4.0b
[quote="Rado1"][quote="rrTea"]Pressing "H" in the sound editor brings up Help instead of playing a note. Just a minor inconvenience.[/quote]
I cannot reproduce it on Win7. Do not have you somehow switched Alt on?[/quote]
I discovered how to trigger this: https://streamable.com/xbvpl
Again, just to confirm, this is without Alt. Same glitch does not happen when the window is detached. Sorry for the crappy recording, the lunch break will be over in a minute so this'll have to do ;)
Edit: doesn't always behave like this, no idea what does it depend on.
I cannot reproduce it on Win7. Do not have you somehow switched Alt on?[/quote]
I discovered how to trigger this: https://streamable.com/xbvpl
Again, just to confirm, this is without Alt. Same glitch does not happen when the window is detached. Sorry for the crappy recording, the lunch break will be over in a minute so this'll have to do ;)
Edit: doesn't always behave like this, no idea what does it depend on.
Re: Beta release 4.0b
More about keyboard input leaking: https://streamable.com/lbw5l
Re: Beta release 4.0b
[quote=rrTea post_id=8858 time=1543127745 user_id=221]
More about keyboard input leaking: https://streamable.com/lbw5l
[/quote]
Can confirm, I reproduced this.
More about keyboard input leaking: https://streamable.com/lbw5l
[/quote]
Can confirm, I reproduced this.
Re: Beta release 4.0b
I can reproduce it now too after looking at that video. I will try to figure out what is wrong.