Zzip and SDL_RWoops

im trying to use zzip and SDL_RWoops to load a bmp from zip files but i cant
i am using VS6 in w32
i put SDL_rwops_zzip.h and SDL_rwops_zzip.c in my project… in
my source code… y put #include “SDL_rwops_zzip.h” at the top and replace

temp2 = SDL_LoadBMP(“data/back.bmp”);

with…

SDL_RWops *rw;
rw = SDL_RWFromZZIP(“data/back.bmp”, “r”);
temp2 = SDL_LoadBMP_RW(rw, 0);
SDL_FreeRW(rw);

its the only things that i want to do… i missing something? i am linking
with the dinamic library of zziplib and zzip (zziplib.lib and libz.a)
i think thats what i want to do is simple… but i can do it…
any suggest?
Fede!

From looking at the source code I guess it is a good idea to change

rw = SDL_RWFromZZIP(“data/back.bmp”, “r”);

to

rw = SDL_RWFromZZIP(“data/back.bmp”, “rb”);

If that does not help, please explain the problem: does your source compile
at all? is the program crashing? does the result look ugly?

Huib-Jan> ----- Original Message -----

From: berardi@ssdfe.com.ar (Federico Berardi)
To:
Sent: Wednesday, December 11, 2002 10:37 AM
Subject: [SDL] zzip and SDL_RWoops

im trying to use zzip and SDL_RWoops to load a bmp from zip files but i cant
i am using VS6 in w32
i put SDL_rwops_zzip.h and SDL_rwops_zzip.c in my project… in
my source code… y put #include “SDL_rwops_zzip.h” at the top and replace

temp2 = SDL_LoadBMP(“data/back.bmp”);

with…

SDL_RWops *rw;
rw = SDL_RWFromZZIP(“data/back.bmp”, “r”);
temp2 = SDL_LoadBMP_RW(rw, 0);
SDL_FreeRW(rw);

its the only things that i want to do… i missing something? i am linking
with the dinamic library of zziplib and zzip (zziplib.lib and libz.a)
i think thats what i want to do is simple… but i can do it…
any suggest?
Fede!

Which version of zzip are you using?

I was able to include rwops/zzip-support for zzip 0.10.66
in my project (SDL1.2.5, W32, msvc6), but it wasnt easy.

To get it working, I had to recompile zzip + modify the
header files to get a DLL+LIB and be able to compile/link without
errors.

There are also some bugs in 0.10.66 (its a preview). But I think
the most important (for me) I was able to correct.
With earlier versions of zzip compiling seemed even more difficult
for me, so this was the reason I tried the 0.10.66.

If you want to give 0.10.66 a try, I can send some tips+fixes.

Thomas> ----- Original Message -----

From: Federico Berardi
To:
Sent: Wednesday, December 11, 2002 10:37 AM
Subject: [SDL] zzip and SDL_RWoops

im trying to use zzip and SDL_RWoops to load a bmp from zip files but i
cant
i am using VS6 in w32
i put SDL_rwops_zzip.h and SDL_rwops_zzip.c in my project… in
my source code… y put #include “SDL_rwops_zzip.h” at the top and replace

temp2 = SDL_LoadBMP(“data/back.bmp”);

with…

SDL_RWops *rw;
rw = SDL_RWFromZZIP(“data/back.bmp”, “r”);
temp2 = SDL_LoadBMP_RW(rw, 0);
SDL_FreeRW(rw);

its the only things that i want to do… i missing something? i am linking
with the dinamic library of zziplib and zzip (zziplib.lib and libz.a)
i think thats what i want to do is simple… but i can do it…
any suggest?
Fede!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

the error

SDL_rwops_zzip.c
c:\program\sdl_rwops_zzip.c(53) : error C2039: ‘_read’ : is not a member of
’SDL_RWops’
c:\sdl-1.2.4\include\sdl_rwops.h(47) : see declaration of
’SDL_RWops’
Error executing cl.exe.

From looking at the source code I guess it is a good idea to change

rw = SDL_RWFromZZIP(“data/back.bmp”, “r”);

to

rw = SDL_RWFromZZIP(“data/back.bmp”, “rb”);

If that does not help, please explain the problem: does your source
compile> at all? is the program crashing? does the result look ugly?

Huib-Jan

----- Original Message -----
From: Federico Berardi
To:
Sent: Wednesday, December 11, 2002 10:37 AM
Subject: [SDL] zzip and SDL_RWoops

im trying to use zzip and SDL_RWoops to load a bmp from zip files but i
cant
i am using VS6 in w32
i put SDL_rwops_zzip.h and SDL_rwops_zzip.c in my project… in
my source code… y put #include “SDL_rwops_zzip.h” at the top and replace

temp2 = SDL_LoadBMP(“data/back.bmp”);

with…

SDL_RWops *rw;
rw = SDL_RWFromZZIP(“data/back.bmp”, “r”);
temp2 = SDL_LoadBMP_RW(rw, 0);
SDL_FreeRW(rw);

its the only things that i want to do… i missing something? i am linking
with the dinamic library of zziplib and zzip (zziplib.lib and libz.a)
i think thats what i want to do is simple… but i can do it…
any suggest?
Fede!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

i use the 0.10.66 version… please… send me what you have to
@Federico_Berardi
thanks>

Which version of zzip are you using?

I was able to include rwops/zzip-support for zzip 0.10.66
in my project (SDL1.2.5, W32, msvc6), but it wasnt easy.

To get it working, I had to recompile zzip + modify the
header files to get a DLL+LIB and be able to compile/link without
errors.

There are also some bugs in 0.10.66 (its a preview). But I think
the most important (for me) I was able to correct.
With earlier versions of zzip compiling seemed even more difficult
for me, so this was the reason I tried the 0.10.66.

If you want to give 0.10.66 a try, I can send some tips+fixes.

Thomas

----- Original Message -----
From: Federico Berardi
To:
Sent: Wednesday, December 11, 2002 10:37 AM
Subject: [SDL] zzip and SDL_RWoops

im trying to use zzip and SDL_RWoops to load a bmp from zip files but i
cant
i am using VS6 in w32
i put SDL_rwops_zzip.h and SDL_rwops_zzip.c in my project… in
my source code… y put #include “SDL_rwops_zzip.h” at the top and
replace

temp2 = SDL_LoadBMP(“data/back.bmp”);

with…

SDL_RWops *rw;
rw = SDL_RWFromZZIP(“data/back.bmp”, “r”);
temp2 = SDL_LoadBMP_RW(rw, 0);
SDL_FreeRW(rw);

its the only things that i want to do… i missing something? i am
linking

with the dinamic library of zziplib and zzip (zziplib.lib and libz.a)
i think thats what i want to do is simple… but i can do it…
any suggest?
Fede!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

see zzip-conf.h why it happens. Perhaps just reorder includes.

I’ll fix this next time around, but it would be great if someone
with a copy of MSVC could help in the process of validating an
update release of zziplib. I don’t have access to a license at
the moment, and definitly not over christmas holidays, but for
the widespread use of zziplib on win32/msvc it should be tested
and cleaned throughly for that environment. – have fun, guido

Federico Berardi wrote:> the error

SDL_rwops_zzip.c
c:\program\sdl_rwops_zzip.c(53) : error C2039: ‘_read’ : is not a member of
’SDL_RWops’
c:\sdl-1.2.4\include\sdl_rwops.h(47) : see declaration of
’SDL_RWops’
Error executing cl.exe.

From looking at the source code I guess it is a good idea to change

rw = SDL_RWFromZZIP(“data/back.bmp”, “r”);

to

rw = SDL_RWFromZZIP(“data/back.bmp”, “rb”);

If that does not help, please explain the problem: does your source

compile

at all? is the program crashing? does the result look ugly?

Huib-Jan

----- Original Message -----
From: Federico Berardi
To:
Sent: Wednesday, December 11, 2002 10:37 AM
Subject: [SDL] zzip and SDL_RWoops

im trying to use zzip and SDL_RWoops to load a bmp from zip files but i

cant

i am using VS6 in w32
i put SDL_rwops_zzip.h and SDL_rwops_zzip.c in my project… in
my source code… y put #include “SDL_rwops_zzip.h” at the top and replace

temp2 = SDL_LoadBMP(“data/back.bmp”);

with…

SDL_RWops *rw;
rw = SDL_RWFromZZIP(“data/back.bmp”, “r”);
temp2 = SDL_LoadBMP_RW(rw, 0);
SDL_FreeRW(rw);

its the only things that i want to do… i missing something? i am linking
with the dinamic library of zziplib and zzip (zziplib.lib and libz.a)
i think thats what i want to do is simple… but i can do it…
any suggest?
Fede!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

To be able to compile with MSVC6/CPP I had to modify the following files:

zzip-conf.h, uncomment lines 86-88 (=prevent redefinition read > _read)

SDL_rwops_zzip.c,
function _zzip_read: add (char ) cast:
return zzip_read(SDL_RWOPS_ZZIP_FILE(context), (char
) ptr,
size*maxnum);

function SDL_RWFromZZIP:
  change the line
    SDL_RWOPS_ZZIP_FILE(rwops) = zzip_file;
  to
    rwops->hidden.unknown.data1 = zzip_file;--

Thomas