Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by Lapsa. 06/08/26 22:41
Stooq now requires an API key
by VHX. 06/08/26 20:14
ZorroGPT
by TipmyPip. 06/06/26 12:36
Zorro 3.01 recoded MMI function issue
by TipmyPip. 06/04/26 05:44
SGT_FW
by Aku_Aku. 05/31/26 11:05
Issues resuming trades on Demo account
by Martin_HH. 05/22/26 13:31
XTB
by pr0logic. 05/18/26 12:27
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 3,688 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Seraphinang, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Masking error messages [Re: Ch40zzC0d3r] #422958
05/21/13 14:48
05/21/13 14:48
Joined: Sep 2009
Posts: 1,035
Budapest
Aku_Aku Offline OP
Serious User
Aku_Aku  Offline OP
Serious User

Joined: Sep 2009
Posts: 1,035
Budapest
Ch40zzC0d3r thanks for your reply, i noticed it after a fairy long time laugh

I will try this approach, i hope it fits to my requirements.

Edit: At first run, the line beginning with typedef throws a syntax error message.

Last edited by Aku_Aku; 05/21/13 14:54.
Re: Masking error messages [Re: Aku_Aku] #423038
05/23/13 09:02
05/23/13 09:02
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
maybe you have to include windows.h?


POTATO-MAN saves the day! - Random
Re: Masking error messages [Re: Kartoffel] #423050
05/23/13 13:33
05/23/13 13:33
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
As I said in the PM, lite-c doesnt need typedefs.
Just declaire the function as usual.

Re: Masking error messages [Re: jcl] #423995
06/09/13 09:58
06/09/13 09:58
Joined: Sep 2009
Posts: 1,035
Budapest
Aku_Aku Offline OP
Serious User
Aku_Aku  Offline OP
Serious User

Joined: Sep 2009
Posts: 1,035
Budapest
Dear Mr. jcl!
You wrote:
Quote:
That's the problem. An unrecoverable error normally means that internal data has wrong content - so continuing the program can cause a crash sooner or later. You might be lucky. But users of your game might not.

In my application showing a wrong image wouldn't mean an unrecoverable error.
In this case the app throws a message about the error and everything goes on, and doesn't want to show that image, so there is no problem.
Why is this so hard to the 3D GS engine? This situation can be handle without any problem.
I need only a short error handling code in lite-c. If it is a secret, you can send it me in a pm, or if you want i can give you my e-mail address.
Please, Mr. jcl share with me, how should process such errors.
Thanks in advance.

Re: Masking error messages [Re: Aku_Aku] #423999
06/09/13 15:07
06/09/13 15:07
Joined: Jul 2000
Posts: 28,101
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,101
Frankfurt
Hmm, I hoped that problem had been explained, but apparently not.

In a programming language, a function that gets wrong data normally returns with an error code. That just means that the function did not work properly. What you do in that case is completely up to you - you can show a "wrong image", whatever that means.

But when you get a crash, something essential went wrong. An example is loading a file with wrong content that overwrites internal data areas. The function can then not continue and often not even return. It must produce an error message that tells the user that the program crashed. This can not be "masked out" and replaced by a "wrong image", because it's quite possible that your wrong image code will never be reached.

I hope this helps understanding the difference between a recoverable and a not recoverable error.

Re: Masking error messages [Re: jcl] #424003
06/09/13 15:39
06/09/13 15:39
Joined: Sep 2009
Posts: 1,035
Budapest
Aku_Aku Offline OP
Serious User
Aku_Aku  Offline OP
Serious User

Joined: Sep 2009
Posts: 1,035
Budapest
First of all, thanks for your efforts to deal with this problem and with me.
I try to explain myself in other way.
Let's see an imaginery code:
Code:
bmap_1=bmap_create(_chr(str_File));
if(NULL==bmap_1)
	I_Will_not_to_try_anything_with_the_image("Trust me");
	But_send_a_message("Hey your image is wrong");
else
	I_show_the_image_happily();
# Anything was happen, the execution of the code continues here


What wrong can be happen with me, if i handle this way the error?
There is no crash, no end of world or other bad situation...
Moreover, i can not believe a well written code can overwrite internal data area like the stack. Tell me, other applications why does not crash when the user try to open a wrong image? Like Photoshop, Paint, miscellanous image viewers, browsers and so on...

Re: Masking error messages [Re: jcl] #424065
06/10/13 09:46
06/10/13 09:46
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Originally Posted By: jcl
Hmm, I hoped that problem had been explained, but apparently not.

In a programming language, a function that gets wrong data normally returns with an error code. That just means that the function did not work properly. What you do in that case is completely up to you - you can show a "wrong image", whatever that means.

But when you get a crash, something essential went wrong. An example is loading a file with wrong content that overwrites internal data areas. The function can then not continue and often not even return. It must produce an error message that tells the user that the program crashed. This can not be "masked out" and replaced by a "wrong image", because it's quite possible that your wrong image code will never be reached.

I hope this helps understanding the difference between a recoverable and a not recoverable error.


This is called ExceptionHandling, and completely missing in LiteC. Real ExceptionHandling allows you to even handle Doom-Errors in a Userfriendly way, and sometimes even allows you to recover.

A fatal error is not always a crash.


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Masking error messages [Re: Rackscha] #424072
06/10/13 11:43
06/10/13 11:43
Joined: Jul 2000
Posts: 28,101
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,101
Frankfurt
Aku Aku: Certainly they do - especially Photoshop. Depending on where an image file is damaged, you can get the same error message, followed by a program termination.

What we can do for you depends on the file format. If it is loaded in an external module such as DirectX and causes that module to crash, the engine will definitely produce an error message. We can't change that for the mentioned good reasons.

If however it is loaded directly by the engine, like PCX and TGA, additional format checks would theoretically prevent many possible crashes. But how often do you have images in damaged format? Would it not be a lot easier when you just check before loading if the file exists or not - which is probably the most frequent error reason?

Re: Masking error messages [Re: jcl] #424193
06/11/13 17:52
06/11/13 17:52
Joined: Sep 2009
Posts: 1,035
Budapest
Aku_Aku Offline OP
Serious User
Aku_Aku  Offline OP
Serious User

Joined: Sep 2009
Posts: 1,035
Budapest
Thanks for your reply.
OK, i accept in these situations the applications abort their runs.
Quote:
Would it not be a lot easier when you just check before loading if the file exists or not - which is probably the most frequent error reason?

I would happily code an image checker subroutine. But i don't know the engine inside and its source, its code and data structure, its algorithms.
And i need to do exactly the same that the engine does, and how it does. Moreover, i need this in lite-c.
It would be nice, if you provide to me the lite-c source code, how the engine checks an image format, and how decides it is good or bad.
I would appreciate that, and certainly the community of this forum would be also grateful.
Here in this topic or even in the next AUM.
Thanks in advance.

Re: Masking error messages [Re: Aku_Aku] #424195
06/11/13 18:09
06/11/13 18:09
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
It's hardly going to use Lite-C code, and there is more than one method that checks wether an image is "good" or "bad". It actually is quite easy when you make the assumption that, as long as the image is valid and its format is supported, the engine is going to accept it. For png, use libpng to open the image and do some sanity check on it, for bmp you can write a parser on your own since it's pretty much just a flat binary (Wikipedia has the infos on the file format), for tga there is libtga, jpeg is covered via libjpeg and for pcx, dunno, but you can probably google something.

Though, since you are already parsing the images yourself, it would probably make more sense to also load the bitmap data yourself and pass it to the engine, or at least read the whole image into a buffer and add it via add_buffer(), as to avoid redundant I/O operations (opening and reading images is already expensive enough, no need to do it twice or more times).


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Page 2 of 3 1 2 3

Moderated by  old_bill, Tobias 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1