VisualC support and more

Discussion around programming R'n'D, its source code and its tools.

Moderators: Zomis, Flumminator

Post Reply
HerzAusGold
Posts: 326
Joined: Sun Sep 25, 2005 4:41 pm
Location: Germany

VisualC support and more

Post by HerzAusGold » Fri Dec 30, 2005 9:29 pm

http://www.zomis.net/rnd/download.php?id=394

Upload rndTest-0-4.zip

I tested this with Eclipse (Cygwin), MinGw and VisualC.
(for Eclipse you should have 1GB Ram and a 3GHz CPU - better two)

In Cygwin you have to define CYGWIN

In MinGw no define to set.

In VisualC you have to define TRAGET_SDL and VISUAL_CPP.

Its now VisualC compatible. (Exe is 724KB small)

After I look on your scripts and I see how it works. (I learn perl btw.)
I change back the renaming of CONF_xxx files.
It's really not necesary.

The change for VisualC compatible are small.
You have only to search for #HAG#VC

A change log and a readme are included.

May be its a good idea to rename the 'list.c' to 'util.c'.
I do it next time.

BTW: Have you played my Levels? I will never miss my sokoban mode.

> rnd_vc6 -sokomode=1

...and I check the docs what about ANSI-C, C89,C99 ....
And the answer is ... 42 !

User avatar
Holger
Site Admin
Posts: 3231
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger » Sun Jan 15, 2006 6:47 pm

Finally had a look at rndTest-0-4 -- I'll try to add at least those changes to enable VisualC compilation. (A nice thing would be a patch file against 3.1.1 or 3.1.2 that only contains those changes needed to compile with VisualC, but without all other changes... But no big problem to find this out for myself. :-) )

Do your changes already contail full zip support without the need of further libraries? I've seen that "zfile.c", but also a Windows DLL... Just asking because this should also work on Unix and Mac. :-)
Last edited by Holger on Sun Jan 15, 2006 11:09 pm, edited 1 time in total.

HerzAusGold
Posts: 326
Joined: Sun Sep 25, 2005 4:41 pm
Location: Germany

Post by HerzAusGold » Sun Jan 15, 2006 10:10 pm

I have upload a interim version of rndTest.
With changes in fileScanDir and little preparation for zip support,
so it's easier to compare to the version wit transparent zip-support.

http://www.zomis.net/rnd/download.php?id=404

version 0.6 with transparent zip support are soon coming.
cause it is not complete ready I send the (v0.6interim) to your em.

I first want to finish the zip support then then VC support for 3.1.2 is the
next (without other changes).

*edit*
The library with is included is from www.zlib.net and is available for linux too. :wink:
And the answer is ... 42 !

User avatar
Holger
Site Admin
Posts: 3231
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger » Mon Jan 16, 2006 6:15 pm

> The library with is included is from www.zlib.net and is available for linux too.

Ah, yes, that's what I expected! Very good! :-)

HerzAusGold
Posts: 326
Joined: Sun Sep 25, 2005 4:41 pm
Location: Germany

Post by HerzAusGold » Wed Jan 18, 2006 8:13 pm

Upload the interrim version of my transparent zip support.

http://www.zomis.net/rnd/download.php?id=408

BE WARNED! - lost private rnd folder during developing -
no guarantee to any damage.
Only for discussion with Holger.

*edit*
uplad new rndTest05Adevel for easy compare.

http://www.zomis.net/rnd/info.php?f=404

*edit*
all changes marked with #HAG#ZIP#
comparision is easy with case sensitivy off
zip support is implemented in zfile.c - but so many places to check...

Any suggestions where is (may be hidden) file access? (which i not found yet).


*edit*
sorry but i cant reach my email account

*edit*
I come from Beteigeuze and my day have 36 hours but at the moment i have less time. Trying to find 5 minutes to write this post.
I hope i can continue with zip support this month...
Hm It seems Holger comes from a planet with 200 hours I guess... :P
And the answer is ... 42 !

HerzAusGold
Posts: 326
Joined: Sun Sep 25, 2005 4:41 pm
Location: Germany

Need Help

Post by HerzAusGold » Thu Jan 19, 2006 11:51 pm

Upload a new version of unfinished work. :oops:

http://www.zomis.net/rnd/info.php?f=408

Hm, it's load the some artwork but some not completly, so SnakeBite
(put only the zip-File into levels-dir) is loaded but not really playable.
I hope I found out this bug... but if someone want to help... please do it.
Very nasty..
Be warned loading takes the cpu and a lot of time.

Can I dump the graphics or music (size, checksum or something like this...) ??

On to the next I have to write some test progs first - if nobody find the bug or give a hint-.
First I use RWops to load directly from zip, but this doesn't work.
So I use Memory-Read RWops. I think something is wrong with the reading internally. (in my stuff i think...or may be on an other place i never expect)

I load (decompress the whole file and store the whole file in memory), then give the memory pointer to IMG_Load_RW(SDL_RWFromMem(data,size),1). Dont know - should this normally work in this way?
Hmmm. I destroy this memory immediately - wrong?

www.libsdl.org admit to use SDL1.2.9.
I test it with 1.2.8 and 1.2.9 with different effect's. But maybe some memory are overwriten.

On to the next, I want to use another approach of file access.
May be use the zzlib for internal file access. But this cant read dirs in dirs in zip-files. (My stuff can handle this....Hm may be I merge it into zzlib).

It's a long way... :x

Hi Holger any suggestions?

Btw: what about my sokoban mode?
And the answer is ... 42 !

HerzAusGold
Posts: 326
Joined: Sun Sep 25, 2005 4:41 pm
Location: Germany

Post by HerzAusGold » Fri Jan 20, 2006 10:13 pm

Hi, I found the nasty bug in artwork loading (IMG_LOAD).
Hmmpf. the zfile.c is from winuae and is not well documented
- but the sdl and the zzlib are (and fread of course).
fread reads blocks and return blocks not bytes.
so i screw this (bug in zfile.c) and it works with
using RWops to load directly from zip (more exacty from the memory with is inflated).

But now I get a empty playfield with the size of the original.
Hm dont know - level not loaded ? I see some elements in
the editor. If I make an test cave i cant eat the red mushrooms,
but reach the exit.

Any dumping available here? Where are the snake base?

ok I have to check this....
And the answer is ... 42 !

HerzAusGold
Posts: 326
Joined: Sun Sep 25, 2005 4:41 pm
Location: Germany

zip support runs...

Post by HerzAusGold » Sat Jan 21, 2006 12:17 am

ago two or three days I know nothing about the sdl-internals..
now maked a first step....

Found an other bug in zfile.c (but this time it was from me...)
fgetc should return an unsigned char...

Now Snake-Bit and Snake-Bit-Jue run from zip!!

Only WAV-Files not loaded yet. Loading with RWops seems
not supported.
Holger you mentioned that this is possible-so what is to do? :?:
inherit the extern declaration dont helps.
It's seems we have to compile the SDL with a specific define on.
USE_RWOPS (but in v1.30 SDL_mixer - the comment say that this is not included in music.c)

Tape-Files ok
HighScores ok
Any other things i have to check?

Hm. may be a cache is usefull like in zzlib (at least for the zip-directory)
because massive loading cost memory and a lot of cpu.
One question: When is the file (.pcx) closed??
I set freesrc to 1 -> after loading or at exit?

*edit*
Now I can sleep....zzzZZZZzz
And the answer is ... 42 !

Post Reply