support PC shareware files in full version build, make game data loading code easier to follow

This commit is contained in:
kreatordxx 2008-02-11 12:12:57 +00:00
parent 8d025c7aef
commit 3a188fa14d
16 changed files with 447 additions and 316 deletions

View file

@ -1,5 +1,9 @@
D1X-Rebirth Changelog
20080211
--------
d1x-rebirth.xcodeproj, include/strutil.h, main/bm.c, main/bm.h, main/bmread.c, main/digiobj.c, main/inferno.c, main/piggy.c, main/piggy.h, main/polyobj.c, main/songs.c, main/text.c, main/text.h, misc/strutil.c, SConstruct: support PC shareware files in full version build
20080129
--------
SConstruct, arch/include/digi_audio.h, arch/include/digi_mixer.h, arch/include/digi_mixer_music.h, arch/include/event.h, arch/include/joy.h, arch/include/joystick.h, arch/include/jukebox.h, arch/include/key.h, arch/include/mouse.h, arch/linux/include/music.h, arch/ogl/gr.c, arch/ogl/ogl.c, arch/ogl/sdlgl.c, arch/sdl/mouse.c, include/internal.h, include/loadgl.h, include/ogl_init.h, main/kconfig.c: Cleanung up arch/ a little bit; Added mouse delta time interval for more more accurate reading at high FPS

View file

@ -25,7 +25,6 @@ profiler = int(ARGUMENTS.get('profiler', 0))
sdl_only = int(ARGUMENTS.get('sdl_only', 0))
asm = int(ARGUMENTS.get('asm', 0))
editor = int(ARGUMENTS.get('editor', 0))
shareware = int(ARGUMENTS.get('shareware', 0))
sdlmixer = int(ARGUMENTS.get('sdlmixer', 0))
arm = int(ARGUMENTS.get('arm', 0))
ipv6 = int(ARGUMENTS.get('ipv6', 0))
@ -142,6 +141,7 @@ common_sources = [
'main/robot.c',
'main/scores.c',
'main/slew.c',
'main/snddecom.c',
'main/songs.c',
'main/state.c',
'main/switch.c',
@ -426,11 +426,6 @@ if (editor == 1):
env.Append(CPPPATH = ['include/editor'])
common_sources += editor_sources
#shareware build?
if (shareware == 1):
env.Append(CPPDEFINES = ['SHAREWARE'])
common_sources += ['main/snddecom.c']
# IPv6 compability?
if (ipv6 == 1):
env.Append(CPPDEFINES = ['IPv6'])
@ -465,7 +460,6 @@ Help(PROGRAM_NAME + ', SConstruct file help:' +
'sharepath=DIR' (*NIX only) use DIR for shared game data. (default: /usr/local/share/games/d1x-rebirth)
'sdl_only=1' don't include OpenGL, use SDL-only instead
'sdlmixer=1' (*NIX only) use SDL_Mixer for sound (includes external music support)
'shareware=1' build SHAREWARE version
'asm=1' use ASSEMBLER code (only with sdl_only=1, requires NASM and x86)
'debug=1' build DEBUG binary which includes asserts, debugging output, cheats and more output
'profiler=1' do profiler build

View file

@ -277,6 +277,13 @@
67F6FED3066B13B400443922 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 67F6FED1066B13B400443922 /* SDLMain.m */; };
67F6FED4066B13B400443922 /* SDLMain.h in Headers */ = {isa = PBXBuildFile; fileRef = 67F6FED0066B13B400443922 /* SDLMain.h */; };
67F6FED5066B13B400443922 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 67F6FED1066B13B400443922 /* SDLMain.m */; };
EB3319850D50A6B200C799B0 /* bmread.c in Sources */ = {isa = PBXBuildFile; fileRef = EBC652010890D632004FCAA3 /* bmread.c */; };
EB33198F0D50A70600C799B0 /* snddecom.c in Sources */ = {isa = PBXBuildFile; fileRef = EBEEB2680D2B364300FF39B4 /* snddecom.c */; };
EB3319FD0D5335E600C799B0 /* netdrv_udp.c in Sources */ = {isa = PBXBuildFile; fileRef = EB3319FB0D5335E500C799B0 /* netdrv_udp.c */; };
EB3319FE0D5335E600C799B0 /* netdrv_udp.h in Headers */ = {isa = PBXBuildFile; fileRef = EB3319FC0D5335E600C799B0 /* netdrv_udp.h */; };
EB3319FF0D5335E600C799B0 /* netdrv_udp.c in Sources */ = {isa = PBXBuildFile; fileRef = EB3319FB0D5335E500C799B0 /* netdrv_udp.c */; };
EB331A000D5335E600C799B0 /* netdrv_udp.h in Headers */ = {isa = PBXBuildFile; fileRef = EB3319FC0D5335E600C799B0 /* netdrv_udp.h */; };
EB331A0C0D53578800C799B0 /* snddecom.c in Sources */ = {isa = PBXBuildFile; fileRef = EBEEB2680D2B364300FF39B4 /* snddecom.c */; };
EB92BE600CDD693C0045A32C /* digi_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = EB92BE5C0CDD693C0045A32C /* digi_audio.c */; };
EB92BE610CDD693C0045A32C /* digi_mixer_music.c in Sources */ = {isa = PBXBuildFile; fileRef = EB92BE5D0CDD693C0045A32C /* digi_mixer_music.c */; };
EB92BE620CDD693C0045A32C /* digi_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = EB92BE5E0CDD693C0045A32C /* digi_mixer.c */; };
@ -377,10 +384,6 @@
EBEEB0B90D2A2B4500FF39B4 /* globvars.h in Headers */ = {isa = PBXBuildFile; fileRef = EBEEB0B70D2A2B4500FF39B4 /* globvars.h */; };
EBEEB0BA0D2A2B4500FF39B4 /* clipper.h in Headers */ = {isa = PBXBuildFile; fileRef = EBEEB0B60D2A2B4500FF39B4 /* clipper.h */; };
EBEEB0BB0D2A2B4500FF39B4 /* globvars.h in Headers */ = {isa = PBXBuildFile; fileRef = EBEEB0B70D2A2B4500FF39B4 /* globvars.h */; };
EBEEB0F40D2A2FC800FF39B4 /* udp.c in Sources */ = {isa = PBXBuildFile; fileRef = EBEEB0F10D2A2FC800FF39B4 /* udp.c */; };
EBEEB0F50D2A2FC800FF39B4 /* udp.h in Headers */ = {isa = PBXBuildFile; fileRef = EBEEB0F20D2A2FC800FF39B4 /* udp.h */; };
EBEEB0F70D2A2FC800FF39B4 /* udp.c in Sources */ = {isa = PBXBuildFile; fileRef = EBEEB0F10D2A2FC800FF39B4 /* udp.c */; };
EBEEB0F80D2A2FC800FF39B4 /* udp.h in Headers */ = {isa = PBXBuildFile; fileRef = EBEEB0F20D2A2FC800FF39B4 /* udp.h */; };
EBEEB1050D2A307300FF39B4 /* scanline.h in Headers */ = {isa = PBXBuildFile; fileRef = EBEEB1030D2A307300FF39B4 /* scanline.h */; };
EBEEB1060D2A307300FF39B4 /* texmapl.h in Headers */ = {isa = PBXBuildFile; fileRef = EBEEB1040D2A307300FF39B4 /* texmapl.h */; };
EBEEB1070D2A307300FF39B4 /* scanline.h in Headers */ = {isa = PBXBuildFile; fileRef = EBEEB1030D2A307300FF39B4 /* scanline.h */; };
@ -438,7 +441,6 @@
676AC04E0668A814007173EB /* gr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = gr.c; sourceTree = "<group>"; };
676AC0510668A814007173EB /* ogl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ogl.c; sourceTree = "<group>"; };
676AC0520668A814007173EB /* sdlgl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = sdlgl.c; sourceTree = "<group>"; };
676AC26F0668A939007173EB /* d1x.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = d1x.app; sourceTree = BUILT_PRODUCTS_DIR; };
676AC31D0668A939007173EB /* d1xgl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = d1xgl.app; sourceTree = BUILT_PRODUCTS_DIR; };
6791CE4F0668852C00056A5A /* byteswap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = byteswap.h; sourceTree = "<group>"; };
6791CE500668852C00056A5A /* rle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = rle.h; sourceTree = "<group>"; };
@ -637,6 +639,21 @@
EB0421040A341042002CC961 /* ai.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ai.h; sourceTree = "<group>"; };
EB0421050A341042002CC961 /* controls.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = controls.h; sourceTree = "<group>"; };
EB0421060A341042002CC961 /* config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
EB1283BE0D59D94800A991A3 /* d1x.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = d1x.app; path = build/Development/d1x.app; sourceTree = "<group>"; };
EB3319E70D53341900C799B0 /* digi_audio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = digi_audio.h; sourceTree = "<group>"; };
EB3319E80D53341900C799B0 /* digi_mixer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = digi_mixer.h; sourceTree = "<group>"; };
EB3319E90D53341900C799B0 /* digi_mixer_music.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = digi_mixer_music.h; sourceTree = "<group>"; };
EB3319EA0D53341900C799B0 /* event.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = event.h; sourceTree = "<group>"; };
EB3319EB0D53341900C799B0 /* joy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = joy.h; sourceTree = "<group>"; };
EB3319EC0D53341900C799B0 /* joystick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = joystick.h; sourceTree = "<group>"; };
EB3319ED0D53341900C799B0 /* jukebox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = jukebox.h; sourceTree = "<group>"; };
EB3319EE0D53341900C799B0 /* key.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = key.h; sourceTree = "<group>"; };
EB3319EF0D53341900C799B0 /* mouse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mouse.h; sourceTree = "<group>"; };
EB3319F00D5334B600C799B0 /* internal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = "<group>"; };
EB3319F10D53351600C799B0 /* loadgl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = loadgl.h; sourceTree = "<group>"; };
EB3319F20D53351600C799B0 /* ogl_init.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ogl_init.h; sourceTree = "<group>"; };
EB3319FB0D5335E500C799B0 /* netdrv_udp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = netdrv_udp.c; sourceTree = "<group>"; };
EB3319FC0D5335E600C799B0 /* netdrv_udp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = netdrv_udp.h; sourceTree = "<group>"; };
EB92BE5C0CDD693C0045A32C /* digi_audio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = digi_audio.c; sourceTree = "<group>"; };
EB92BE5D0CDD693C0045A32C /* digi_mixer_music.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = digi_mixer_music.c; sourceTree = "<group>"; };
EB92BE5E0CDD693C0045A32C /* digi_mixer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = digi_mixer.c; sourceTree = "<group>"; };
@ -724,8 +741,6 @@
EBEEB0AC0D2A2AEE00FF39B4 /* linear.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = linear.h; sourceTree = "<group>"; };
EBEEB0B60D2A2B4500FF39B4 /* clipper.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = clipper.h; sourceTree = "<group>"; };
EBEEB0B70D2A2B4500FF39B4 /* globvars.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = globvars.h; sourceTree = "<group>"; };
EBEEB0F10D2A2FC800FF39B4 /* udp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = udp.c; sourceTree = "<group>"; };
EBEEB0F20D2A2FC800FF39B4 /* udp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = udp.h; sourceTree = "<group>"; };
EBEEB1030D2A307300FF39B4 /* scanline.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = scanline.h; sourceTree = "<group>"; };
EBEEB1040D2A307300FF39B4 /* texmapl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = texmapl.h; sourceTree = "<group>"; };
EBEEB1090D2A30BA00FF39B4 /* lfile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = lfile.c; sourceTree = "<group>"; };
@ -770,35 +785,16 @@
EBEEB2200D2B34DE00FF39B4 /* joystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = joystick.c; sourceTree = "<group>"; };
EBEEB2210D2B34DE00FF39B4 /* mono.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mono.c; sourceTree = "<group>"; };
EBEEB2220D2B34DE00FF39B4 /* ukali.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ukali.c; sourceTree = "<group>"; };
EBEEB2280D2B351400FF39B4 /* joystick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = joystick.h; sourceTree = "<group>"; };
EBEEB2290D2B351400FF39B4 /* music.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = music.h; sourceTree = "<group>"; };
EBEEB22A0D2B351400FF39B4 /* ukali.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ukali.h; sourceTree = "<group>"; };
EBEEB22C0D2B353C00FF39B4 /* digi_audio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = digi_audio.h; sourceTree = "<group>"; };
EBEEB22D0D2B353C00FF39B4 /* digi_mixer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = digi_mixer.h; sourceTree = "<group>"; };
EBEEB22E0D2B353C00FF39B4 /* digi_mixer_music.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = digi_mixer_music.h; sourceTree = "<group>"; };
EBEEB22F0D2B353C00FF39B4 /* event.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = event.h; sourceTree = "<group>"; };
EBEEB2350D2B353C00FF39B4 /* joy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = joy.h; sourceTree = "<group>"; };
EBEEB2360D2B353C00FF39B4 /* joystick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = joystick.h; sourceTree = "<group>"; };
EBEEB2370D2B353C00FF39B4 /* jukebox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = jukebox.h; sourceTree = "<group>"; };
EBEEB2380D2B353C00FF39B4 /* key.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = key.h; sourceTree = "<group>"; };
EBEEB2390D2B353C00FF39B4 /* mouse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mouse.h; sourceTree = "<group>"; };
EBEEB23A0D2B353C00FF39B4 /* music.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = music.h; sourceTree = "<group>"; };
EBEEB2420D2B358D00FF39B4 /* d_conv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = d_conv.h; sourceTree = "<group>"; };
EBEEB2450D2B358D00FF39B4 /* d_slash.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = d_slash.h; sourceTree = "<group>"; };
EBEEB2480D2B358D00FF39B4 /* modex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = modex.h; sourceTree = "<group>"; };
EBEEB2490D2B358D00FF39B4 /* vesa.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = vesa.h; sourceTree = "<group>"; };
EBEEB24B0D2B35B000FF39B4 /* d1x.ico */ = {isa = PBXFileReference; lastKnownFileType = image.ico; path = d1x.ico; sourceTree = "<group>"; };
EBEEB24C0D2B35B000FF39B4 /* d1x_res.rc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = d1x_res.rc; sourceTree = "<group>"; };
EBEEB24D0D2B35B000FF39B4 /* descent.ico */ = {isa = PBXFileReference; lastKnownFileType = image.ico; path = descent.ico; sourceTree = "<group>"; };
EBEEB24E0D2B35B000FF39B4 /* hmpfile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = hmpfile.c; sourceTree = "<group>"; };
EBEEB2500D2B35B000FF39B4 /* hmpfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hmpfile.h; sourceTree = "<group>"; };
EBEEB2510D2B35B000FF39B4 /* joy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = joy.h; sourceTree = "<group>"; };
EBEEB2520D2B35B000FF39B4 /* key_arch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = key_arch.h; sourceTree = "<group>"; };
EBEEB2530D2B35B000FF39B4 /* mouse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mouse.h; sourceTree = "<group>"; };
EBEEB2540D2B35B000FF39B4 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = "<group>"; };
EBEEB2550D2B35B000FF39B4 /* wsipx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = wsipx.h; sourceTree = "<group>"; };
EBEEB2570D2B35B000FF39B4 /* joydefs.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = joydefs.c; sourceTree = "<group>"; };
EBEEB2580D2B35B000FF39B4 /* key_arch.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = key_arch.c; sourceTree = "<group>"; };
EBEEB2590D2B35B000FF39B4 /* mono.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mono.c; sourceTree = "<group>"; };
EBEEB25B0D2B364300FF39B4 /* altsound.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = altsound.c; sourceTree = "<group>"; };
EBEEB25C0D2B364300FF39B4 /* altsound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = altsound.h; sourceTree = "<group>"; };
@ -814,8 +810,6 @@
EBEEB2680D2B364300FF39B4 /* snddecom.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = snddecom.c; sourceTree = "<group>"; };
EBEEB2690D2B364300FF39B4 /* snddecom.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = snddecom.h; sourceTree = "<group>"; };
EBEEB29B0D2B378B00FF39B4 /* compare.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = compare.c; sourceTree = "<group>"; };
EBEEB2EC0D2B51BF00FF39B4 /* loadgl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = loadgl.h; sourceTree = "<group>"; };
EBEEB2ED0D2B51BF00FF39B4 /* ogl_init.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ogl_init.h; sourceTree = "<group>"; };
EBEEB4F90D2C955F00FF39B4 /* netdrv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = netdrv.c; sourceTree = "<group>"; };
EBEEB51F0D2C975200FF39B4 /* netdrv_ipx.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = netdrv_ipx.c; sourceTree = "<group>"; };
EBEEB5200D2C975200FF39B4 /* netdrv_kali.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = netdrv_kali.c; sourceTree = "<group>"; };
@ -880,8 +874,8 @@
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
676AC26F0668A939007173EB /* d1x.app */,
676AC31D0668A939007173EB /* d1xgl.app */,
EB1283BE0D59D94800A991A3 /* d1x.app */,
);
name = Products;
sourceTree = "<group>";
@ -907,7 +901,6 @@
67B44137066878B300DF26D8 /* 2d */,
67B441740668792300DF26D8 /* 3d */,
67B441EC06687A3F00DF26D8 /* arch */,
EBEEB1E00D2B30C200FF39B4 /* cfile */,
EBC6507E0890C882004FCAA3 /* editor */,
67B441F806687A9E00DF26D8 /* iff */,
67B448AC0668803500DF26D8 /* include */,
@ -942,7 +935,6 @@
67603357066B3AE0008A67A3 /* include */ = {
isa = PBXGroup;
children = (
EBEEB2280D2B351400FF39B4 /* joystick.h */,
EBEEB2290D2B351400FF39B4 /* music.h */,
EBEEB22A0D2B351400FF39B4 /* ukali.h */,
);
@ -1035,7 +1027,6 @@
67B441D306687A0200DF26D8 /* digi.c */,
67B441D406687A0200DF26D8 /* event.c */,
67B441D506687A0200DF26D8 /* gr.c */,
EBEEB22B0D2B353C00FF39B4 /* include */,
67B441D706687A0200DF26D8 /* joy.c */,
67B441D806687A0200DF26D8 /* joydefs.c */,
EB92BE5F0CDD693C0045A32C /* jukebox.c */,
@ -1051,6 +1042,7 @@
isa = PBXGroup;
children = (
EBAFC268088E508D006329AD /* carbon */,
EB3319E60D53341900C799B0 /* include */,
67B44193066879B000DF26D8 /* linux */,
676AC04B0668A814007173EB /* ogl */,
67B441D106687A0200DF26D8 /* sdl */,
@ -1119,6 +1111,7 @@
EBEEB1F60D2B320B00FF39B4 /* multipow.c */,
EBEEB2660D2B364300FF39B4 /* mute.c */,
EBEEB4F90D2C955F00FF39B4 /* netdrv.c */,
EB3319FB0D5335E500C799B0 /* netdrv_udp.c */,
EBEEB1F80D2B320B00FF39B4 /* netlist.c */,
EBEEB1F90D2B320B00FF39B4 /* netpkt.c */,
676032DF066B399A008A67A3 /* network.c */,
@ -1144,7 +1137,6 @@
67B4477D06687CF400DF26D8 /* texmerge.c */,
67B4477F06687CF500DF26D8 /* text.c */,
67B4478206687CF500DF26D8 /* titles.c */,
EBEEB0F10D2A2FC800FF39B4 /* udp.c */,
67B4478406687CF500DF26D8 /* vclip.c */,
67B4478706687CF500DF26D8 /* wall.c */,
67B4478906687CF500DF26D8 /* weapon.c */,
@ -1195,6 +1187,7 @@
EB0420E70A341042002CC961 /* multibot.h */,
EBEEB1F70D2B320B00FF39B4 /* multipow.h */,
EBEEB2670D2B364300FF39B4 /* mute.h */,
EB3319FC0D5335E600C799B0 /* netdrv_udp.h */,
EBEEB1FA0D2B320B00FF39B4 /* netpkt.h */,
EB0420E00A341042002CC961 /* network.h */,
EB01AFA90A65323200EA4C7C /* newdemo.h */,
@ -1227,7 +1220,6 @@
EB0420C70A341042002CC961 /* text.h */,
EB0420C60A341042002CC961 /* textures.h */,
EB0420C50A341042002CC961 /* titles.h */,
EBEEB0F20D2A2FC800FF39B4 /* udp.h */,
EB0420C40A341042002CC961 /* vclip.h */,
EB0420C30A341042002CC961 /* vers_id.h */,
EB0420C20A341042002CC961 /* wall.h */,
@ -1302,11 +1294,14 @@
6791CF35066887FE00056A5A /* ibitblt.h */,
6791D0BD06688AE800056A5A /* iff.h */,
EBAC994E0D4250320017D4BC /* ignorecase.h */,
EB3319F00D5334B600C799B0 /* internal.h */,
EB3319F10D53351600C799B0 /* loadgl.h */,
6791D08F06688A9C00056A5A /* maths.h */,
EBEEB2480D2B358D00FF39B4 /* modex.h */,
6791CE650668854700056A5A /* mono.h */,
EBEEB7F90D34D4BF00FF39B4 /* netdrv.h */,
EBC6525B0890F79B004FCAA3 /* nocfile.h */,
EB3319F20D53351600C799B0 /* ogl_init.h */,
6791CF4E0668883900056A5A /* palette.h */,
6791CF620668885500056A5A /* pcx.h */,
EBAC99500D4250320017D4BC /* physfsx.h */,
@ -1325,6 +1320,23 @@
path = include;
sourceTree = SOURCE_ROOT;
};
EB3319E60D53341900C799B0 /* include */ = {
isa = PBXGroup;
children = (
EB3319E70D53341900C799B0 /* digi_audio.h */,
EB3319E80D53341900C799B0 /* digi_mixer.h */,
EB3319E90D53341900C799B0 /* digi_mixer_music.h */,
EB3319EA0D53341900C799B0 /* event.h */,
EB3319EB0D53341900C799B0 /* joy.h */,
EB3319EC0D53341900C799B0 /* joystick.h */,
EB3319ED0D53341900C799B0 /* jukebox.h */,
EB3319EE0D53341900C799B0 /* key.h */,
EB3319EF0D53341900C799B0 /* mouse.h */,
);
name = include;
path = arch/include;
sourceTree = "<group>";
};
EBAFC268088E508D006329AD /* carbon */ = {
isa = PBXGroup;
children = (
@ -1434,40 +1446,11 @@
path = editor;
sourceTree = "<group>";
};
EBEEB1E00D2B30C200FF39B4 /* cfile */ = {
isa = PBXGroup;
children = (
);
path = cfile;
sourceTree = "<group>";
};
EBEEB22B0D2B353C00FF39B4 /* include */ = {
isa = PBXGroup;
children = (
EBEEB22C0D2B353C00FF39B4 /* digi_audio.h */,
EBEEB22D0D2B353C00FF39B4 /* digi_mixer.h */,
EBEEB22E0D2B353C00FF39B4 /* digi_mixer_music.h */,
EBEEB22F0D2B353C00FF39B4 /* event.h */,
EBEEB2350D2B353C00FF39B4 /* joy.h */,
EBEEB2360D2B353C00FF39B4 /* joystick.h */,
EBEEB2370D2B353C00FF39B4 /* jukebox.h */,
EBEEB2380D2B353C00FF39B4 /* key.h */,
EBEEB2390D2B353C00FF39B4 /* mouse.h */,
EBEEB23A0D2B353C00FF39B4 /* music.h */,
);
path = include;
sourceTree = "<group>";
};
EBEEB24A0D2B35B000FF39B4 /* win32 */ = {
isa = PBXGroup;
children = (
EBEEB24B0D2B35B000FF39B4 /* d1x.ico */,
EBEEB24C0D2B35B000FF39B4 /* d1x_res.rc */,
EBEEB24D0D2B35B000FF39B4 /* descent.ico */,
EBEEB24E0D2B35B000FF39B4 /* hmpfile.c */,
EBEEB24F0D2B35B000FF39B4 /* include */,
EBEEB2570D2B35B000FF39B4 /* joydefs.c */,
EBEEB2580D2B35B000FF39B4 /* key_arch.c */,
EBEEB2590D2B35B000FF39B4 /* mono.c */,
);
name = win32;
@ -1478,9 +1461,6 @@
isa = PBXGroup;
children = (
EBEEB2500D2B35B000FF39B4 /* hmpfile.h */,
EBEEB2510D2B35B000FF39B4 /* joy.h */,
EBEEB2520D2B35B000FF39B4 /* key_arch.h */,
EBEEB2530D2B35B000FF39B4 /* mouse.h */,
EBEEB2540D2B35B000FF39B4 /* resource.h */,
EBEEB2550D2B35B000FF39B4 /* wsipx.h */,
);
@ -1490,8 +1470,6 @@
EBEEB2EB0D2B51BF00FF39B4 /* include */ = {
isa = PBXGroup;
children = (
EBEEB2EC0D2B51BF00FF39B4 /* loadgl.h */,
EBEEB2ED0D2B51BF00FF39B4 /* ogl_init.h */,
);
path = include;
sourceTree = "<group>";
@ -1535,7 +1513,6 @@
EBEEB0B40D2A2AEF00FF39B4 /* linear.h in Headers */,
EBEEB0BA0D2A2B4500FF39B4 /* clipper.h in Headers */,
EBEEB0BB0D2A2B4500FF39B4 /* globvars.h in Headers */,
EBEEB0F80D2A2FC800FF39B4 /* udp.h in Headers */,
EBEEB1070D2A307300FF39B4 /* scanline.h in Headers */,
EBEEB1080D2A307300FF39B4 /* texmapl.h in Headers */,
EBEEB1EA0D2B317800FF39B4 /* custom.h in Headers */,
@ -1545,6 +1522,7 @@
EBEEB2060D2B320C00FF39B4 /* netpkt.h in Headers */,
EBEEB2090D2B320C00FF39B4 /* script.h in Headers */,
EBEEB20A0D2B320C00FF39B4 /* settings.h in Headers */,
EB3319FE0D5335E600C799B0 /* netdrv_udp.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1584,7 +1562,6 @@
EBEEB0B00D2A2AEE00FF39B4 /* linear.h in Headers */,
EBEEB0B80D2A2B4500FF39B4 /* clipper.h in Headers */,
EBEEB0B90D2A2B4500FF39B4 /* globvars.h in Headers */,
EBEEB0F50D2A2FC800FF39B4 /* udp.h in Headers */,
EBEEB1050D2A307300FF39B4 /* scanline.h in Headers */,
EBEEB1060D2A307300FF39B4 /* texmapl.h in Headers */,
EBEEB1EF0D2B317800FF39B4 /* custom.h in Headers */,
@ -1594,6 +1571,7 @@
EBEEB2120D2B320C00FF39B4 /* netpkt.h in Headers */,
EBEEB2150D2B320C00FF39B4 /* script.h in Headers */,
EBEEB2160D2B320C00FF39B4 /* settings.h in Headers */,
EB331A000D5335E600C799B0 /* netdrv_udp.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1616,7 +1594,7 @@
name = d1x;
productInstallPath = "$(HOME)/Applications";
productName = d2x;
productReference = 676AC26F0668A939007173EB /* d1x.app */;
productReference = EB1283BE0D59D94800A991A3 /* d1x.app */;
productType = "com.apple.product-type.application";
};
676AC2710668A939007173EB /* d1xgl */ = {
@ -1852,7 +1830,6 @@
EB92BE670CDD693C0045A32C /* jukebox.c in Sources */,
EB92BEA80CDD6A570045A32C /* dl_list.c in Sources */,
EB92BEA90CDD6A570045A32C /* hmp2mid.c in Sources */,
EBEEB0F70D2A2FC800FF39B4 /* udp.c in Sources */,
EBEEB10B0D2A30BA00FF39B4 /* lfile.c in Sources */,
EBEEB1E90D2B317800FF39B4 /* custom.c in Sources */,
EBEEB1EB0D2B317800FF39B4 /* d_conv.c in Sources */,
@ -1868,6 +1845,8 @@
EBEEB5240D2C975200FF39B4 /* netdrv_kali.c in Sources */,
EBAC98FD0D42497F0017D4BC /* ignorecase.c in Sources */,
EBC58E720D489E19007C8ABF /* args.c in Sources */,
EB3319FD0D5335E600C799B0 /* netdrv_udp.c in Sources */,
EB331A0C0D53578800C799B0 /* snddecom.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1991,7 +1970,6 @@
EB92BE630CDD693C0045A32C /* jukebox.c in Sources */,
EB92BEA60CDD6A570045A32C /* dl_list.c in Sources */,
EB92BEA70CDD6A570045A32C /* hmp2mid.c in Sources */,
EBEEB0F40D2A2FC800FF39B4 /* udp.c in Sources */,
EBEEB1EE0D2B317800FF39B4 /* custom.c in Sources */,
EBEEB1F00D2B317800FF39B4 /* d_conv.c in Sources */,
EBEEB1F10D2B317800FF39B4 /* d_gamecv.c in Sources */,
@ -2004,6 +1982,9 @@
EBEEB4FB0D2C955F00FF39B4 /* netdrv.c in Sources */,
EBAC98FB0D42497F0017D4BC /* ignorecase.c in Sources */,
EBC58E710D489E19007C8ABF /* args.c in Sources */,
EB3319850D50A6B200C799B0 /* bmread.c in Sources */,
EB33198F0D50A70600C799B0 /* snddecom.c in Sources */,
EB3319FF0D5335E600C799B0 /* netdrv_udp.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View file

@ -25,6 +25,9 @@ void strlwr( char *s1 );
void strrev( char *s1 );
// remove extension from filename, doesn't work with paths.
void removeext(const char *filename, char *out);
//give a filename a new extension
extern void change_filename_extension( char *dest, char *src, char *new_ext );

View file

@ -121,7 +121,6 @@ int First_multi_bitmap_num=-1;
bitmap_index ObjBitmaps[MAX_OBJ_BITMAPS];
ushort ObjBitmapPtrs[MAX_OBJ_BITMAPS]; // These point back into ObjBitmaps, since some are used twice.
#ifndef SHAREWARE
#ifdef FAST_FILE_IO
#define tmap_info_read_n(ti, n, fp) cfread(ti, TMAP_INFO_SIZE, n, fp)
#else
@ -161,17 +160,24 @@ int player_ship_read(player_ship *ps, CFILE *fp)
}
//-----------------------------------------------------------------
// Initializes all bitmaps from BITMAPS.TBL file.
int bm_init()
// Initializes game properties data (including texture caching system) and sound data.
int gamedata_init()
{
int retval;
init_polygon_models();
init_endlevel();//adb: added, is also in bm_init_use_tbl
piggy_init(); // This calls bm_read_all
piggy_read_sounds();
init_endlevel();//adb: added, is also in bm_init_use_tbl (Chris: *Was* in bm_init_use_tbl)
retval = properties_init(); // This calls properties_read_cmp if appropriate
if (retval)
gamedata_read_tbl(retval == PIGGY_PC_SHAREWARE);
piggy_read_sounds(retval == PIGGY_PC_SHAREWARE);
return 0;
}
void bm_read_all(CFILE * fp)
// Read compiled properties data from descent.pig
void properties_read_cmp(CFILE * fp)
{
int i;
@ -262,5 +268,4 @@ void bm_read_all(CFILE * fp)
#endif
}
#endif

View file

@ -263,15 +263,9 @@ extern tmap_info TmapInfo[MAX_TEXTURES];
extern int Dying_modelnums[];
extern int Dead_modelnums[];
// Initializes the palette, bitmap system...
#ifdef SHAREWARE
int bm_init_use_tbl();
#else
int bm_init();
#ifdef EDITOR
int bm_init_use_tbl();
#endif
#endif
// Initializes properties, bitmap system, sounds...
int gamedata_read_tbl(int pc_shareware);
int gamedata_init();
void bm_close();
// Initializes the Texture[] array of bmd_bitmap structures.

View file

@ -19,12 +19,11 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "settings.h"
#if defined(EDITOR) || defined(SHAREWARE)
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include "pstypes.h"
#include "inferno.h"
@ -60,26 +59,26 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "cntrlcen.h"
#include "compbit.h"
#include "args.h"
#include "d_io.h"
#include "text.h"
#ifdef EDITOR
#include "editor/texpage.h"
#endif
void bm_read_eclip();
void bm_read_gauges();
void bm_read_wclip();
void bm_read_vclip();
void bm_read_sound();
void bm_read_robot_ai();
void bm_read_robot();
void bm_read_object();
void bm_read_player_ship();
void bm_read_some_file();
void bm_read_weapon(int unused_flag);
void bm_read_eclip(int skip);
void bm_read_gauges(int skip);
void bm_read_wclip(int skip);
void bm_read_vclip(int skip);
void bm_read_sound(int skip, int pc_shareware);
void bm_read_robot_ai(int skip);
void bm_read_robot(int skip);
void bm_read_object(int skip);
void bm_read_player_ship(int skip);
void bm_read_some_file(int skip);
void bm_read_weapon(int skip, int unused_flag);
void bm_read_powerup(int unused_flag);
void bm_read_hostage();
void bm_read_hostage_face();
void bm_read_hostage_face(int skip, int pc_shareware);
void verify_textures();
#define BM_NONE -1
@ -109,7 +108,6 @@ char Powerup_names[MAX_POWERUP_TYPES][POWERUP_NAME_LENGTH];
char Robot_names[MAX_ROBOT_TYPES][ROBOT_NAME_LENGTH];
//---------------- Internal variables ---------------------------
static int Registered_only = 0; // Gets set by ! in column 1.
static int SuperX = -1;
static int Installed=0;
static char *arg;
@ -119,7 +117,7 @@ static short clip_count = 0;
static short clip_num;
static short sound_num;
static short frames;
static float time;
static float play_time;
static int hit_sound = -1;
static sbyte bm_flag = BM_NONE;
static int abm_flag = 0;
@ -185,7 +183,7 @@ int compute_average_pixel(grs_bitmap *new)
// Loads a bitmap from either the piggy file, a r64 file, or a
// whatever extension is passed.
bitmap_index bm_load_sub( char * filename )
bitmap_index bm_load_sub(int skip, char * filename )
{
bitmap_index bitmap_num;
grs_bitmap * new;
@ -195,12 +193,10 @@ bitmap_index bm_load_sub( char * filename )
bitmap_num.index = 0;
#ifdef SHAREWARE
if (Registered_only) {
if (skip) {
//mprintf( 0, "Skipping registered-only bitmap '%s'\n", filename );
return bitmap_num;
}
#endif
removeext( filename, fname );
@ -233,7 +229,7 @@ bitmap_index bm_load_sub( char * filename )
return bitmap_num;
}
void ab_load( char * filename, bitmap_index bmp[], int *nframes )
void ab_load(int skip, char * filename, bitmap_index bmp[], int *nframes )
{
grs_bitmap * bm[MAX_BITMAPS_PER_BRUSH];
bitmap_index bi;
@ -243,15 +239,13 @@ void ab_load( char * filename, bitmap_index bmp[], int *nframes )
char fname[20];
char tempname[20];
#ifdef SHAREWARE
if (Registered_only) {
if (skip) {
Assert( bogus_bitmap_initialized != 0 );
mprintf(( 0, "Skipping registered-only animation '%s'\n", filename ));
bmp[0] = piggy_register_bitmap(&bogus_bitmap, "bogus", 0);
*nframes = 1;
return;
}
#endif
removeext( filename, fname );
@ -293,19 +287,17 @@ void ab_load( char * filename, bitmap_index bmp[], int *nframes )
}
}
int ds_load( char * filename ) {
int ds_load(int skip, char * filename ) {
int i;
CFILE * cfp;
digi_sound new;
char fname[20];
char rawname[100];
#ifdef SHAREWARE
if (Registered_only) {
if (skip) {
//mprintf( 0, "Skipping registered-only sound '%s'\n", filename );
return piggy_register_sound( &bogus_sound, "bogus", 0 );
}
#endif
removeext( filename, fname );
sprintf( rawname, "%s.raw", fname );
@ -375,15 +367,13 @@ int get_int()
int linenum;
//-----------------------------------------------------------------
// Initializes all bitmaps from BITMAPS.TBL file.
int bm_init_use_tbl()
// Initializes all properties and bitmaps from BITMAPS.TBL file.
int gamedata_read_tbl(int pc_shareware)
{
CFILE * InfoFile;
char inputline[LINEBUF_SIZE];
int i, have_bin_tbl;
init_polygon_models();
ObjType[0] = OL_PLAYER;
ObjId[0] = 0;
Num_total_object_types = 1;
@ -398,10 +388,8 @@ int bm_init_use_tbl()
TmapInfo[i].flags = 0;
}
#ifndef SHAREWARE
for (i=0; i<MAX_HOSTAGES; i++ )
Hostage_face_clip[i].num_frames=0;
#endif
Num_effects = 0;
for (i=0; i<MAX_EFFECTS; i++ ) {
@ -432,13 +420,6 @@ int bm_init_use_tbl()
Installed = 1;
piggy_init();
if (GameArg.EdiNoBm) {
piggy_read_sounds();
return 0;
}
// Open BITMAPS.TBL for reading.
have_bin_tbl = 0;
InfoFile = cfopen( "BITMAPS.TBL", "rb" );
@ -455,6 +436,7 @@ int bm_init_use_tbl()
while (cfgets(inputline, LINEBUF_SIZE, InfoFile)) {
int l;
char *temp_ptr;
int skip;
linenum++;
@ -486,9 +468,9 @@ int bm_init_use_tbl()
arg = strtok( inputline, space );
if (arg && arg[0] == '@') {
arg++;
Registered_only = 1;
skip = pc_shareware;
} else
Registered_only = 0;
skip = 0;
while (arg != NULL )
{
@ -497,7 +479,7 @@ int bm_init_use_tbl()
IFTOK("$COCKPIT") bm_flag = BM_COCKPIT;
else IFTOK("$GAUGES") {bm_flag = BM_GAUGES; clip_count = 0;}
else IFTOK("$SOUND") bm_read_sound();
else IFTOK("$SOUND") bm_read_sound(skip, pc_shareware);
else IFTOK("$DOOR_ANIMS") bm_flag = BM_WALL_ANIMS;
else IFTOK("$WALL_ANIMS") bm_flag = BM_WALL_ANIMS;
else IFTOK("$TEXTURES") bm_flag = BM_TEXTURES;
@ -531,7 +513,7 @@ int bm_init_use_tbl()
else IFTOK("crit_flag") crit_flag = get_int();
else IFTOK("sound_num") sound_num = get_int();
else IFTOK("frames") frames = get_int();
else IFTOK("time") time = get_float();
else IFTOK("time") play_time = get_float();
else IFTOK("obj_eclip") obj_eclip = get_int();
else IFTOK("hit_sound") hit_sound = get_int();
else IFTOK("abm_flag") abm_flag = get_int();
@ -544,17 +526,17 @@ int bm_init_use_tbl()
else IFTOK("explodes") wall_explodes = get_int();
else IFTOK("blastable") wall_blastable = get_int();
else IFTOK("hidden") wall_hidden = get_int();
else IFTOK("$ROBOT_AI") bm_read_robot_ai();
else IFTOK("$ROBOT_AI") bm_read_robot_ai(skip);
else IFTOK("$POWERUP") {bm_read_powerup(0); continue;}
else IFTOK("$POWERUP_UNUSED") {bm_read_powerup(1); continue;}
else IFTOK("$HOSTAGE") {bm_read_hostage(); continue;}
else IFTOK("$HOSTAGE_FACE") {bm_read_hostage_face();continue;}
else IFTOK("$ROBOT") {bm_read_robot(); continue;}
else IFTOK("$WEAPON") {bm_read_weapon(0); continue;}
else IFTOK("$WEAPON_UNUSED") {bm_read_weapon(1); continue;}
else IFTOK("$OBJECT") {bm_read_object(); continue;}
else IFTOK("$PLAYER_SHIP") {bm_read_player_ship(); continue;}
else IFTOK("$HOSTAGE_FACE") {bm_read_hostage_face(skip, pc_shareware);continue;}
else IFTOK("$ROBOT") {bm_read_robot(skip); continue;}
else IFTOK("$WEAPON") {bm_read_weapon(skip, 0); continue;}
else IFTOK("$WEAPON_UNUSED") {bm_read_weapon(skip, 1); continue;}
else IFTOK("$OBJECT") {bm_read_object(skip); continue;}
else IFTOK("$PLAYER_SHIP") {bm_read_player_ship(skip); continue;}
else { //not a special token, must be a bitmap!
@ -564,7 +546,7 @@ int bm_init_use_tbl()
// Otherwise, 'arg' is apparently a bitmap filename.
// Load bitmap and process it below:
bm_read_some_file();
bm_read_some_file(skip);
}
@ -582,8 +564,6 @@ int bm_init_use_tbl()
Assert(N_robot_types == Num_robot_ais); //should be one ai info per robot
init_endlevel(); //this is here so endlevel bitmaps go into pig
verify_textures();
//check for refereced but unused clip count
@ -605,8 +585,6 @@ int bm_init_use_tbl()
}
#endif
piggy_read_sounds();
#ifdef EDITOR
piggy_dump_all();
#endif
@ -673,7 +651,7 @@ void set_texture_name(char *name)
REMOVE_DOTS(TmapInfo[texture_count].filename);
}
void bm_read_eclip()
void bm_read_eclip(int skip)
{
bitmap_index bitmap;
@ -685,11 +663,11 @@ void bm_read_eclip()
Effects[clip_num].flags = 0;
if (!abm_flag) {
bitmap = bm_load_sub(arg);
bitmap = bm_load_sub(skip, arg);
Effects[clip_num].vc.play_time = fl2f(time);
Effects[clip_num].vc.play_time = fl2f(play_time);
Effects[clip_num].vc.num_frames = frames;
Effects[clip_num].vc.frame_time = fl2f(time)/frames;
Effects[clip_num].vc.frame_time = fl2f(play_time)/frames;
Assert(clip_count < frames);
Effects[clip_num].vc.frames[clip_count] = bitmap;
@ -716,10 +694,10 @@ void bm_read_eclip()
bitmap_index bm[MAX_BITMAPS_PER_BRUSH];
abm_flag = 0;
ab_load( arg, bm, &Effects[clip_num].vc.num_frames );
ab_load(skip, arg, bm, &Effects[clip_num].vc.num_frames );
//printf("EC%d.", clip_num);
Effects[clip_num].vc.play_time = fl2f(time);
Effects[clip_num].vc.play_time = fl2f(play_time);
Effects[clip_num].vc.frame_time = Effects[clip_num].vc.play_time/Effects[clip_num].vc.num_frames;
clip_count = 0;
@ -769,7 +747,7 @@ void bm_read_eclip()
if (!strcasecmp(TmapInfo[i].filename,short_name))
break;
if (i==texture_count) {
Textures[texture_count] = bm_load_sub(dest_bm);
Textures[texture_count] = bm_load_sub(skip, dest_bm);
strcpy( TmapInfo[texture_count].filename, short_name);
texture_count++;
Assert(texture_count < MAX_TEXTURES);
@ -797,20 +775,20 @@ void bm_read_eclip()
}
void bm_read_gauges()
void bm_read_gauges(int skip)
{
bitmap_index bitmap;
int i, num_abm_frames;
if (!abm_flag) {
bitmap = bm_load_sub(arg);
bitmap = bm_load_sub(skip, arg);
Assert(clip_count < MAX_GAUGE_BMS);
Gauges[clip_count] = bitmap;
clip_count++;
} else {
bitmap_index bm[MAX_BITMAPS_PER_BRUSH];
abm_flag = 0;
ab_load( arg, bm, &num_abm_frames );
ab_load(skip, arg, bm, &num_abm_frames );
for (i=clip_count; i<clip_count+num_abm_frames; i++) {
Assert(i < MAX_GAUGE_BMS);
Gauges[i] = bm[i-clip_count];
@ -819,7 +797,7 @@ void bm_read_gauges()
}
}
void bm_read_wclip()
void bm_read_wclip(int skip)
{
bitmap_index bitmap;
Assert(clip_num < MAX_WALL_ANIMS);
@ -832,12 +810,12 @@ void bm_read_wclip()
if (tmap1_flag) WallAnims[clip_num].flags |= WCF_TMAP1;
if (!abm_flag) {
bitmap = bm_load_sub(arg);
bitmap = bm_load_sub(skip, arg);
if ( (WallAnims[clip_num].num_frames>-1) && (clip_count==0) )
Error( "Wall Clip %d is already used!", clip_num );
WallAnims[clip_num].play_time = fl2f(time);
WallAnims[clip_num].play_time = fl2f(play_time);
WallAnims[clip_num].num_frames = frames;
//WallAnims[clip_num].frame_time = fl2f(time)/frames;
//WallAnims[clip_num].frame_time = fl2f(play_time)/frames;
Assert(clip_count < frames);
WallAnims[clip_num].frames[clip_count++] = texture_count;
WallAnims[clip_num].open_sound = wall_open_sound;
@ -855,11 +833,11 @@ void bm_read_wclip()
if ( (WallAnims[clip_num].num_frames>-1) )
Error( "AB_Wall clip %d is already used!", clip_num );
abm_flag = 0;
ab_load( arg, bm, &nframes );
ab_load(skip, arg, bm, &nframes );
WallAnims[clip_num].num_frames = nframes;
//printf("WC");
WallAnims[clip_num].play_time = fl2f(time);
//WallAnims[clip_num].frame_time = fl2f(time)/nframes;
WallAnims[clip_num].play_time = fl2f(play_time);
//WallAnims[clip_num].frame_time = fl2f(play_time)/nframes;
WallAnims[clip_num].open_sound = wall_open_sound;
WallAnims[clip_num].close_sound = wall_close_sound;
@ -885,7 +863,7 @@ void bm_read_wclip()
}
}
void bm_read_vclip()
void bm_read_vclip(int skip)
{
bitmap_index bi;
Assert(clip_num < VCLIP_MAXNUM);
@ -893,10 +871,10 @@ void bm_read_vclip()
if (!abm_flag) {
if ( (Vclip[clip_num].num_frames>-1) && (clip_count==0) )
Error( "Vclip %d is already used!", clip_num );
bi = bm_load_sub(arg);
Vclip[clip_num].play_time = fl2f(time);
bi = bm_load_sub(skip, arg);
Vclip[clip_num].play_time = fl2f(play_time);
Vclip[clip_num].num_frames = frames;
Vclip[clip_num].frame_time = fl2f(time)/frames;
Vclip[clip_num].frame_time = fl2f(play_time)/frames;
Vclip[clip_num].light_value = fl2f(vlighting);
Vclip[clip_num].sound_num = sound_num;
set_lighting_flag(&GameBitmaps[bi.index].bm_flags);
@ -912,7 +890,7 @@ void bm_read_vclip()
abm_flag = 0;
if ( (Vclip[clip_num].num_frames>-1) )
Error( "AB_Vclip %d is already used!", clip_num );
ab_load( arg, bm, &Vclip[clip_num].num_frames );
ab_load(skip, arg, bm, &Vclip[clip_num].num_frames );
if (rod_flag) {
//int i;
@ -920,8 +898,8 @@ void bm_read_vclip()
Vclip[clip_num].flags |= VF_ROD;
}
//printf("VC");
Vclip[clip_num].play_time = fl2f(time);
Vclip[clip_num].frame_time = fl2f(time)/Vclip[clip_num].num_frames;
Vclip[clip_num].play_time = fl2f(play_time);
Vclip[clip_num].frame_time = fl2f(play_time)/Vclip[clip_num].num_frames;
Vclip[clip_num].light_value = fl2f(vlighting);
Vclip[clip_num].sound_num = sound_num;
set_lighting_flag(&GameBitmaps[bm[clip_count].index].bm_flags);
@ -986,17 +964,13 @@ void clear_to_end_of_line(void)
arg = strtok( NULL, space );
}
void bm_read_sound()
void bm_read_sound(int skip, int pc_shareware)
{
int sound_num;
int alt_sound_num;
sound_num = get_int();
#ifdef SHAREWARE
alt_sound_num = sound_num;
#else
alt_sound_num = get_int();
#endif
alt_sound_num = pc_shareware ? sound_num : get_int();
if ( sound_num>=MAX_SOUNDS )
Error( "Too many sound files.\n" );
@ -1006,7 +980,7 @@ void bm_read_sound()
arg = strtok(NULL, space);
Sounds[sound_num] = ds_load(arg);
Sounds[sound_num] = ds_load(skip, arg);
if ( alt_sound_num == 0 )
AltSounds[sound_num] = sound_num;
@ -1020,7 +994,7 @@ void bm_read_sound()
}
// ------------------------------------------------------------------------------
void bm_read_robot_ai()
void bm_read_robot_ai(int skip)
{
char *robotnum_text;
int robotnum;
@ -1033,13 +1007,11 @@ void bm_read_robot_ai()
Assert(robotnum == Num_robot_ais); //make sure valid number
#ifdef SHAREWARE
if (Registered_only) {
if (skip) {
Num_robot_ais++;
clear_to_end_of_line();
return;
}
#endif
Num_robot_ais++;
@ -1063,7 +1035,7 @@ void bm_read_robot_ai()
//this will load a bitmap for a polygon models. it puts the bitmap into
//the array ObjBitmaps[], and also deals with animating bitmaps
//returns a pointer to the bitmap
grs_bitmap *load_polymodel_bitmap(char *name)
grs_bitmap *load_polymodel_bitmap(int skip, char *name)
{
Assert(N_ObjBitmaps < MAX_OBJ_BITMAPS);
@ -1084,7 +1056,7 @@ grs_bitmap *load_polymodel_bitmap(char *name)
return NULL;
}
else {
ObjBitmaps[N_ObjBitmaps] = bm_load_sub(name);
ObjBitmaps[N_ObjBitmaps] = bm_load_sub(skip, name);
ObjBitmapPtrs[N_ObjBitmapPtrs++] = N_ObjBitmaps;
N_ObjBitmaps++;
return &GameBitmaps[ObjBitmaps[N_ObjBitmaps-1].index];
@ -1094,7 +1066,7 @@ grs_bitmap *load_polymodel_bitmap(char *name)
#define MAX_MODEL_VARIANTS 4
// ------------------------------------------------------------------------------
void bm_read_robot()
void bm_read_robot(int skip)
{
char *model_name[MAX_MODEL_VARIANTS];
int n_models,i;
@ -1122,15 +1094,13 @@ void bm_read_robot()
Assert(N_robot_types < MAX_ROBOT_TYPES);
#ifdef SHAREWARE
if (Registered_only) {
if (skip) {
Robot_info[N_robot_types].model_num = -1;
N_robot_types++;
Num_total_object_types++;
clear_to_end_of_line();
return;
}
#endif
model_name[0] = strtok( NULL, space );
first_bitmap_num[0] = N_ObjBitmapPtrs;
@ -1201,7 +1171,7 @@ void bm_read_robot()
mprintf( (1, "Invalid parameter, %s=%s in bitmaps.tbl\n", arg, equal_ptr ));
}
} else { // Must be a texture specification...
load_polymodel_bitmap(arg);
load_polymodel_bitmap(skip, arg);
}
arg = strtok( NULL, space );
}
@ -1265,7 +1235,7 @@ void bm_read_robot()
}
//read a polygon object of some sort
void bm_read_object()
void bm_read_object(int skip)
{
char *model_name, *model_name_dead=NULL;
int first_bitmap_num, first_bitmap_num_dead=0, n_normal_bitmaps;
@ -1321,7 +1291,7 @@ void bm_read_object()
mprintf( (1, "Invalid parameter, %s=%s in bitmaps.tbl\n", arg, equal_ptr ));
}
} else { // Must be a texture specification...
load_polymodel_bitmap(arg);
load_polymodel_bitmap(skip, arg);
}
arg = strtok( NULL, space );
}
@ -1358,7 +1328,7 @@ void bm_read_object()
}
void bm_read_player_ship()
void bm_read_player_ship(int skip)
{
char *model_name_dying=NULL;
char *model_name[MAX_MODEL_VARIANTS];
@ -1432,7 +1402,7 @@ void bm_read_player_ship()
}
else // Must be a texture specification...
load_polymodel_bitmap(arg);
load_polymodel_bitmap(skip, arg);
arg = strtok( NULL, space );
}
@ -1504,13 +1474,13 @@ void bm_read_player_ship()
}
void bm_read_some_file()
void bm_read_some_file(int skip)
{
switch (bm_flag) {
case BM_COCKPIT: {
bitmap_index bitmap;
bitmap = bm_load_sub(arg);
bitmap = bm_load_sub(skip, arg);
Assert( Num_cockpits < N_COCKPIT_BITMAPS );
cockpit_bitmap[Num_cockpits++] = bitmap;
@ -1518,20 +1488,20 @@ void bm_read_some_file()
}
break;
case BM_GAUGES:
bm_read_gauges();
bm_read_gauges(skip);
break;
case BM_WEAPON:
bm_read_weapon(0);
bm_read_weapon(skip, 0);
break;
case BM_VCLIP:
bm_read_vclip();
bm_read_vclip(skip);
break;
case BM_ECLIP:
bm_read_eclip();
bm_read_eclip(skip);
break;
case BM_TEXTURES: {
bitmap_index bitmap;
bitmap = bm_load_sub(arg);
bitmap = bm_load_sub(skip, arg);
Assert(tmap_count < MAX_TEXTURES);
TmapList[tmap_count++] = texture_count;
Textures[texture_count] = bitmap;
@ -1542,7 +1512,7 @@ void bm_read_some_file()
}
break;
case BM_WCLIP:
bm_read_wclip();
bm_read_wclip(skip);
break;
default:
break;
@ -1551,7 +1521,7 @@ void bm_read_some_file()
// ------------------------------------------------------------------------------
// If unused_flag is set, then this is just a placeholder. Don't actually reference vclips or load bbms.
void bm_read_weapon(int unused_flag)
void bm_read_weapon(int skip, int unused_flag)
{
int i,n;
int n_models=0;
@ -1571,12 +1541,10 @@ void bm_read_weapon(int unused_flag)
return;
}
#ifdef SHAREWARE
if (Registered_only) {
if (skip) {
clear_to_end_of_line();
return;
}
#endif
// Initialize weapon array
Weapon_info[n].render_type = WEAPON_RENDER_NONE; // 0=laser, 1=blob, 2=object
@ -1632,13 +1600,13 @@ void bm_read_weapon(int unused_flag)
if (!strcasecmp( arg, "laser_bmp" )) {
// Load bitmap with name equal_ptr
Weapon_info[n].bitmap = bm_load_sub(equal_ptr); //load_polymodel_bitmap(equal_ptr);
Weapon_info[n].bitmap = bm_load_sub(skip, equal_ptr); //load_polymodel_bitmap(equal_ptr);
Weapon_info[n].render_type = WEAPON_RENDER_LASER;
} else if (!strcasecmp( arg, "blob_bmp" )) {
// Load bitmap with name equal_ptr
Weapon_info[n].bitmap = bm_load_sub(equal_ptr); //load_polymodel_bitmap(equal_ptr);
Weapon_info[n].bitmap = bm_load_sub(skip, equal_ptr); //load_polymodel_bitmap(equal_ptr);
Weapon_info[n].render_type = WEAPON_RENDER_BLOB;
} else if (!strcasecmp( arg, "weapon_vclip" )) {
@ -1648,7 +1616,7 @@ void bm_read_weapon(int unused_flag)
Weapon_info[n].weapon_vclip = atoi(equal_ptr);
} else if (!strcasecmp( arg, "none_bmp" )) {
Weapon_info[n].bitmap = bm_load_sub(equal_ptr);
Weapon_info[n].bitmap = bm_load_sub(skip, equal_ptr);
Weapon_info[n].render_type = WEAPON_RENDER_NONE;
} else if (!strcasecmp( arg, "weapon_pof" )) {
@ -1729,7 +1697,7 @@ void bm_read_weapon(int unused_flag)
} else if (!strcasecmp(arg, "destroyable" )) {
Weapon_info[n].destroyable = atoi(equal_ptr);
} else if (!strcasecmp(arg, "picture" )) {
Weapon_info[n].picture = bm_load_sub(equal_ptr);
Weapon_info[n].picture = bm_load_sub(skip, equal_ptr);
} else if (!strcasecmp(arg, "homing" )) {
Weapon_info[n].homing_flag = !!atoi(equal_ptr);
} else {
@ -1738,7 +1706,7 @@ void bm_read_weapon(int unused_flag)
} else { // Must be a texture specification...
grs_bitmap *bm;
bm = load_polymodel_bitmap(arg);
bm = load_polymodel_bitmap(skip, arg);
if (bm && ! lighted)
bm->bm_flags |= BM_FLAG_NO_LIGHTING;
@ -1885,7 +1853,7 @@ void bm_read_hostage()
}
void bm_read_hostage_face()
void bm_read_hostage_face(int skip, int pc_shareware)
{
char *abm_name,*equal_ptr;
int clip_num=-1,sound_num=-1;
@ -1914,19 +1882,18 @@ void bm_read_hostage_face()
arg = strtok( NULL, space );
}
#ifndef SHAREWARE
if (!pc_shareware)
{
Assert(clip_num>=0 && clip_num<MAX_HOSTAGES);
Assert(clip_num>=0 && clip_num<MAX_HOSTAGES);
ab_load(skip, abm_name, Hostage_face_clip[clip_num].frames, &Hostage_face_clip[clip_num].num_frames );
ab_load( abm_name, Hostage_face_clip[clip_num].frames, &Hostage_face_clip[clip_num].num_frames );
Assert(Hostage_face_clip[clip_num].num_frames < MAX_BITMAPS_PER_BRUSH);
Assert(Hostage_face_clip[clip_num].num_frames < MAX_BITMAPS_PER_BRUSH);
Hostage_face_clip[clip_num].play_time = time;
Hostage_face_clip[clip_num].sound_num = sound_num;
Hostage_face_clip[clip_num].frame_time = time/Hostage_face_clip[clip_num].num_frames;
#endif
Hostage_face_clip[clip_num].play_time = time;
Hostage_face_clip[clip_num].sound_num = sound_num;
Hostage_face_clip[clip_num].frame_time = time/Hostage_face_clip[clip_num].num_frames;
}
}
void bm_write_all(FILE *fp)
@ -1998,4 +1965,3 @@ void bm_write_all(FILE *fp)
fwrite( &destroyed_exit_modelnum, sizeof(int), 1, fp );
}
#endif

View file

@ -109,7 +109,9 @@ int digi_xlat_sound(int soundno)
return -1;
}
Assert(Sounds[soundno] != 255); //if hit this, probably using undefined sound
//Assert(Sounds[soundno] != 255); //if hit this, probably using undefined sound
if (Sounds[soundno] == 255)
return -1;
return Sounds[soundno];
}

View file

@ -338,18 +338,7 @@ int main(int argc,char *argv[])
gamefont_init(); // must load after palette data loaded.
songs_play_song( SONG_TITLE, 1 );
#ifdef SHAREWARE
bm_init_use_tbl();
#else
#ifdef EDITOR
if (!GameArg.EdiNoBm)
bm_init_use_tbl();
else
bm_init();
#else
bm_init();
#endif
#endif
gamedata_init();
if (GameArg.DbgNoRun)
return(0);

View file

@ -44,9 +44,7 @@ static char rcsid[] = "$Id: piggy.c,v 1.2 2006/03/18 23:08:13 michaelstather Exp
#include "u_dpmi.h"
#endif
#ifdef SHAREWARE
#include "snddecom.h"
#endif
#include "piggy.h"
#include "texmerge.h"
@ -150,9 +148,7 @@ void DiskSoundHeader_read(DiskSoundHeader *dsh, CFILE *fp)
}
#endif // FAST_FILE_IO
#ifdef SHAREWARE
static int SoundCompressed[ MAX_SOUND_FILES ];
#endif
//#define BUILD_PSX_DATA 1
@ -320,13 +316,15 @@ grs_bitmap bogus_bitmap;
ubyte bogus_bitmap_initialized=0;
digi_sound bogus_sound;
extern void bm_read_all(CFILE * fp);
extern void properties_read_cmp(CFILE * fp);
void piggy_read_sounds(int pc_shareware);
#ifdef EDITOR
extern void bm_write_all(FILE * fp);
#endif
int piggy_init()
int properties_init()
{
int pcshare = 0;
int sbytes = 0;
char temp_name_read[16];
char temp_name[16];
@ -338,6 +336,8 @@ int piggy_init()
int i,size, length;
int read_sounds = 1;
int Pigdata_start;
int pigsize;
int retval;
hashtable_init( &AllBitmapsNames, MAX_BITMAP_FILES );
hashtable_init( &AllDigiSndNames, MAX_SOUND_FILES );
@ -398,21 +398,46 @@ int piggy_init()
}
Piggy_fp = PHYSFSX_openDataFile(DEFAULT_PIGFILE_REGISTERED);
if (Piggy_fp==NULL) return 0;
#ifdef SHAREWARE
Pigdata_start = 0;
#else
Pigdata_start = cfile_read_int(Piggy_fp);
#ifdef EDITOR
if (GameArg.EdiNoBm)
#endif
if (Piggy_fp==NULL)
{
bm_read_all( Piggy_fp ); // Note connection to above if!!!
if (!cfexist("BITMAPS.TBL") && !cfexist("BITMAPS.BIN"))
Error("Cannot find " DEFAULT_PIGFILE_REGISTERED " or BITMAPS.TBL");
return 1; // need to run gamedata_read_tbl
}
pigsize = cfilelength(Piggy_fp);
switch (pigsize) {
case D1_SHARE_BIG_PIGSIZE:
case D1_SHARE_10_PIGSIZE:
case D1_SHARE_PIGSIZE:
case D1_10_BIG_PIGSIZE:
case D1_10_PIGSIZE:
pcshare = 1;
Pigdata_start = 0;
break;
default:
Warning("Unknown size for " DEFAULT_PIGFILE_REGISTERED);
Int3();
// fall through
case D1_MAC_PIGSIZE:
case D1_MAC_SHARE_PIGSIZE:
case D1_PIGSIZE:
case D1_OEM_PIGSIZE:
Pigdata_start = cfile_read_int(Piggy_fp );
break;
}
if (pcshare)
retval = PIGGY_PC_SHAREWARE; // run gamedata_read_tbl in shareware mode
else if (GameArg.EdiNoBm || (!cfexist("BITMAPS.TBL") && !cfexist("BITMAPS.BIN")))
{
properties_read_cmp( Piggy_fp ); // Note connection to above if!!!
for (i = 0; i < MAX_BITMAP_FILES; i++)
GameBitmapXlat[i] = cfile_read_short(Piggy_fp);
retval = 0; // don't run gamedata_read_tbl
}
#endif
else
retval = 1; // run gamedata_read_tbl
cfseek( Piggy_fp, Pigdata_start, SEEK_SET );
size = cfilelength(Piggy_fp) - Pigdata_start;
@ -472,9 +497,8 @@ int piggy_init()
//end this section addition - VR
temp_sound.data = (ubyte *)(sndh.offset + header_size + (sizeof(int)*2)+Pigdata_start);
SoundOffset[Num_sound_files] = sndh.offset + header_size + (sizeof(int)*2)+Pigdata_start;
#ifdef SHAREWARE
SoundCompressed[Num_sound_files] = sndh.data_length;
#endif
if (pcshare)
SoundCompressed[Num_sound_files] = sndh.data_length;
memcpy( temp_name_read, sndh.name, 8 );
temp_name_read[8] = 0;
piggy_register_sound( &temp_sound, temp_name_read, 1 );
@ -484,10 +508,10 @@ int piggy_init()
}
SoundBits = d_malloc( sbytes + 16 );
if ( SoundBits == NULL )
Error( "Not enough memory to load DESCENT.PIG sounds\n");
if ( SoundBits == NULL )
Error( "Not enough memory to load DESCENT.PIG sounds\n");
#ifdef EDITOR
#if 1 //def EDITOR
Piggy_bitmap_cache_size = size - header_size - sbytes + 16;
Assert( Piggy_bitmap_cache_size > 0 );
#else
@ -512,7 +536,7 @@ int piggy_init()
// mprintf( (0, "\n (USed %d / %d KB)\n", Piggy_bitmap_cache_next/1024, (size - header_size - sbytes + 16)/1024 ));
// key_getch();
return 0;
return retval;
}
int piggy_is_needed(int soundnum)
@ -528,25 +552,26 @@ int piggy_is_needed(int soundnum)
return 0;
}
void piggy_read_sounds()
void piggy_read_sounds(int pc_shareware)
{
ubyte * ptr;
int i, sbytes;
#ifdef SHAREWARE
int lastsize = 0;
ubyte * lastbuf = NULL;
#endif
ptr = SoundBits;
sbytes = 0;
for (i=0; i<Num_sound_files; i++ ) {
for (i=0; i<Num_sound_files; i++ )
{
digi_sound *snd = &GameSounds[i];
if ( SoundOffset[i] > 0 ) {
if ( piggy_is_needed(i) ) {
if ( SoundOffset[i] > 0 )
{
if ( piggy_is_needed(i) )
{
cfseek( Piggy_fp, SoundOffset[i], SEEK_SET );
// Read in the sound data!!!
snd->data = ptr;
#ifdef ALLEGRO
@ -556,29 +581,28 @@ void piggy_read_sounds()
ptr += snd->length;
sbytes += snd->length;
#endif
//Arne's decompress for shareware on all soundcards - Tim@Rikers.org
#ifdef SHAREWARE
if (lastsize < SoundCompressed[i]) {
if (lastbuf) d_free(lastbuf);
lastbuf = d_malloc(SoundCompressed[i]);
//Arne's decompress for shareware on all soundcards - Tim@Rikers.org
if (pc_shareware)
{
if (lastsize < SoundCompressed[i]) {
if (lastbuf) d_free(lastbuf);
lastbuf = d_malloc(SoundCompressed[i]);
}
cfread( lastbuf, SoundCompressed[i], 1, Piggy_fp );
sound_decompress( lastbuf, SoundCompressed[i], snd->data );
}
cfread( lastbuf, SoundCompressed[i], 1, Piggy_fp );
sound_decompress( lastbuf, SoundCompressed[i], snd->data );
#else
else
#ifdef ALLEGRO
cfread( snd->data, snd->len, 1, Piggy_fp );
cfread( snd->data, snd->len, 1, Piggy_fp );
#else
cfread( snd->data, snd->length, 1, Piggy_fp );
#endif
cfread( snd->data, snd->length, 1, Piggy_fp );
#endif
}
}
}
}
mprintf(( 0, "\nActual Sound usage: %d KB\n", sbytes/1024 ));
#ifdef SHAREWARE
if (lastbuf)
d_free(lastbuf);
#endif
}
extern int descent_critical_error;
@ -682,7 +706,7 @@ void piggy_bitmap_page_in( bitmap_index bitmap )
Piggy_bitmap_cache_next+=bmp->bm_h*bmp->bm_w;
}
#ifdef BITMAP_SELECTOR
#ifdef BITMAP_SELECTOR
if ( bmp->bm_selector ) {
if (!dpmi_modify_selector_base( bmp->bm_selector, bmp->bm_data ))
Error( "Error modifying selector base in piggy.c\n" );

View file

@ -83,6 +83,16 @@
#include "sounds.h"
#include "settings.h"
#define D1_SHARE_BIG_PIGSIZE 5092871 // v1.0 - 1.4 before RLE compression
#define D1_SHARE_10_PIGSIZE 2529454 // v1.0 - 1.2
#define D1_SHARE_PIGSIZE 2509799 // v1.4
#define D1_10_BIG_PIGSIZE 7640220 // v1.0 before RLE compression
#define D1_10_PIGSIZE 4520145 // v1.0
#define D1_PIGSIZE 4920305 // v1.4 - 1.5 (Incl. OEM v1.4a)
#define D1_OEM_PIGSIZE 5039735 // v1.0
#define D1_MAC_PIGSIZE 3975533
#define D1_MAC_SHARE_PIGSIZE 2714487
typedef struct bitmap_index
{
ushort index;
@ -99,7 +109,7 @@ extern ubyte bogus_bitmap_initialized;
extern digi_sound bogus_sound;
int piggy_init ();
int properties_init ();
void piggy_close ();
@ -131,13 +141,13 @@ void piggy_load_level_data ();
#endif /*
*/
#define PIGGY_PC_SHAREWARE 2
//moved to sounds.h - extern digi_sound GameSounds[MAX_SOUND_FILES];
extern grs_bitmap GameBitmaps[MAX_BITMAP_FILES];
void piggy_read_sounds ();
#ifdef PIGGY_USE_PAGING
extern void piggy_bitmap_page_in (bitmap_index bmp);
extern void piggy_bitmap_page_out_all ();

View file

@ -149,13 +149,28 @@ void pof_read_string(char *buf,int max, ubyte *bufp)
void pof_read_vecs(vms_vector *vecs,int n,ubyte *bufp)
{
int i;
// cfread(vecs,sizeof(vms_vector),n,f);
memcpy(vecs, &bufp[Pof_addr], n*sizeof(*vecs));
Pof_addr += n*sizeof(*vecs);
for (i = 0; i < n; i++)
{
vecs[i].x = pof_read_int(bufp);
vecs[i].y = pof_read_int(bufp);
vecs[i].z = pof_read_int(bufp);
}
}
void pof_read_angvecs(vms_angvec *vecs,int n,ubyte *bufp)
{
int i;
// cfread(vecs,sizeof(vms_vector),n,f);
if (Pof_addr > MODEL_BUF_SIZE)
Int3();
for (i = 0; i < n; i++)
{
vecs[i].p = pof_read_short(bufp);
vecs[i].b = pof_read_short(bufp);
vecs[i].h = pof_read_short(bufp);
}
}
#define ID_OHDR 0x5244484f // 'RDHO' //Object header
@ -379,7 +394,7 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r)
for (m=0;m<pm->n_models;m++)
for (f=0;f<n_frames;f++)
pof_cfread(&anim_angs[f][m],1,sizeof(vms_angvec),model_buf);
pof_read_angvecs(&anim_angs[f][m], 1, model_buf);
robot_set_angles(r,pm,anim_angs);
@ -429,7 +444,10 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r)
#ifdef WORDS_NEED_ALIGNMENT
align_polygon_model_data(pm);
#endif
#ifdef WORDS_BIGENDIAN
swap_polygon_model_data(pm->model_data);
#endif
return pm;
}

View file

@ -64,18 +64,6 @@ int cGameSongsAvailable = 0;
void songs_init()
{
#ifdef SHAREWARE
int i;
for (i = 0; i < SONG_LEVEL_MUSIC + NUM_GAME_SONGS; i++) {
strcpy(Songs[i].melodic_bank_file, "melodic.bnk");
strcpy(Songs[i].drum_bank_file, "drum.bnk");
if (i >= SONG_LEVEL_MUSIC)
sprintf(Songs[i].filename, "game%d.hmp", i - SONG_LEVEL_MUSIC);
}
strcpy(Songs[SONG_TITLE].filename, "descent.hmp");
strcpy(Songs[SONG_BRIEFING].filename, "briefing.hmp");
strcpy(Songs[SONG_CREDITS].filename, "credits.hmp");
cGameSongsAvailable = NUM_GAME_SONGS;
#else
int i;
char inputline[80+1];
@ -85,7 +73,22 @@ void songs_init()
fp = cfopen( "descent.sng", "rb" );
if ( fp == NULL ) {
Error( "Couldn't open descent.sng" );
int i;
printf("Using Shareware songs only\n");
for (i = 0; i < SONG_LEVEL_MUSIC + NUM_GAME_SONGS; i++) {
strcpy(Songs[i].melodic_bank_file, "melodic.bnk");
strcpy(Songs[i].drum_bank_file, "drum.bnk");
if (i >= SONG_LEVEL_MUSIC)
sprintf(Songs[i].filename, "game%d.hmp", i - SONG_LEVEL_MUSIC);
}
strcpy(Songs[SONG_TITLE].filename, "descent.hmp");
strcpy(Songs[SONG_BRIEFING].filename, "briefing.hmp");
strcpy(Songs[SONG_CREDITS].filename, "credits.hmp");
strcpy(Songs[SONG_ENDLEVEL].filename, "endlevel.hmp"); // can't find it? give a warning
strcpy(Songs[SONG_ENDGAME].filename, "endgame.hmp"); // ditto
cGameSongsAvailable = NUM_GAME_SONGS;
return;
}
i = 0;

View file

@ -99,6 +99,115 @@ void load_text()
int len,i, have_binary = 0;
char *tptr;
char *filename="descent.tex";
char *extra_strings[] = {
"done",
"I am a",
"CHEATER!",
"Loading Data",
"ALT-F2\t Save Game",
"ALT-F3\t Load Game",
"Only in Registered version!",
"Concussion",
"Homing",
"ProxBomb",
"Smart",
"Mega",
"Mission '%s' not found.\nYou must have this mission\nfile in order to playback\nthis demo.",
"All player callsigns on screen",
"There is already a game\nin progress with that name",
"This mission is designated\nAnarchy-only",
"Force level start",
"Quitting now means ending the\nentire netgame\n\nAre you sure?",
"The mission for that netgame\nis not installed on your\nsystem. Cannot join.",
"Start Multiplayer Game\n\nSelect mission",
"Error loading mission file",
"Custom (return to set)",
"Base address (in Hex)",
"IRQ Number",
"Reset to Default",
"Valid IRQ values are 2-7",
"No UART was detected\nat those settings",
"You will pay dearly for that!",
"Revenge is mine!!",
"Man I'm good!",
"Its almost too easy!",
" Mission:",
"+/- Changes viewing distance",
"Alternate exit found!\n\nProceeding to Secret Level!",
"Show all players on automap",
"Killed by a robot",
"Baud",
"A consistency error has been\ndetected in your network connection.\nCheck you hardware and re-join",
"Press any key to continue (Print Screen to save screenshot)",
"An error occured while writing\ndemo. Demo is likely corrupted.\nEnter demo name now or\npress ESC to delete demo.",
"The main reactor is invulnerable for",
"The level being loaded is not\navailable in Destination Saturn.\nUnable to continue demo playback.\n\nPress any key to continue.",
"Reactor life",
"min",
"Current IPX Socket is default",
"This program requires MS-DOS 5.0 or higher.\nYou are using MS-DOS",
"You can use the -nodoscheck command line\nswitch to override this check, but it\nmay have unpredictable results, namely\nwith DOS file error handling.\n",
"Not enough file handles!",
"of the necessary file handles\nthat Descent requires to execute properly. You will\nneed to increase the FILES=n line in your config.sys.",
"If you are running with a clean boot, then you will need\nto create a CONFIG.SYS file in your root directory, with\nthe line FILES=15 in it. If you need help with this,\ncontact Interplay technical support.",
"You may also run with the -nofilecheck command line option\nthat will disable this check, but you might get errors\nwhen loading saved games or playing demos.",
"Available memory",
"more bytes of DOS memory needed!",
"more bytes of virtual memory needed. Reconfigure VMM.",
"more bytes of extended/expanded memory needed!",
"Or else you you need to use virtual memory (See README.TXT)",
"more bytes of physical memory needed!",
"Check to see that your virtual memory settings allow\nyou to use all of your physical memory (See README.TXT)",
"Initializing DPMI services",
"Initializing critical error handler",
"Enables Virtual I/O Iglasses! stereo display",
"Enables Iglasses! head tracking via COM port",
"Enables Kasan's 3dMax stereo display in low res.",
"3DBios must be installed for 3dMax operation.",
"Enables Kasan's 3dMax stereo display in high res",
"Press any key for more options...",
"Enables dynamic socket changing",
"Disables the file handles check",
"Getting settings from DESCENT.CFG...",
"Initializing timer system...",
"Initializing keyboard handler...",
"Initializing mouse handler...",
"Mouse support disabled...",
"Initializing joystick handler...",
"Slow joystick reading enabled...",
"Polled joystick reading enabled...",
"BIOS joystick reading enabled...",
"Joystick support disabled...",
"Initializing divide by zero handler...",
"Initializing network...",
"Using IPX network support on channel",
"No IPX compatible network found.",
"Error opening socket",
"Not enough low memory for IPX buffers.",
"Error initializing IPX. Error code:",
"Network support disabled...",
"Initializing graphics system...",
"SOUND: Error opening",
"SOUND: Error locking down instruments",
"SOUND: (HMI)",
"SOUND: Error locking down drums",
"SOUND: Error locking midi track map!",
"SOUND: Error locking midi callback function!",
"Using external control:",
"Invalid serial port parameter for -itrak!",
"Initializing i-glasses! head tracking on serial port %d",
"Make sure the glasses are turned on!",
"Press ESC to abort",
"Failed to open serial port. Status =",
"Message",
"Macro",
"Error locking serial interrupt routine!",
"Error locking serial port data!",
"Robots are normal",
"Robots move fast, fire seldom",
"Robot painting OFF",
"Robot painting with texture %d"
};
if (GameArg.DbgAltTex)
filename = GameArg.DbgAltTex;
@ -148,13 +257,27 @@ void load_text()
char *p;
char *buf;
if (!tptr && i >= N_TEXT_STRINGS_SHAREWARE) // account for shareware text file
{
Text_string[i] = extra_strings[i - N_TEXT_STRINGS_SHAREWARE];
continue;
}
Text_string[i] = tptr;
tptr = strchr(tptr,'\n');
if (!tptr)
Error("Not enough strings in text file - expecting %d, found %d",N_TEXT_STRINGS,i);
{
if (i == N_TEXT_STRINGS_SHAREWARE)
{
Text_string[i] = extra_strings[0];
continue;
}
else
Error("Not enough strings in text file - expecting %d (or at least %d), found %d",N_TEXT_STRINGS,N_TEXT_STRINGS_SHAREWARE,i);
}
if ( tptr ) *tptr++ = 0;
if (have_binary) {

View file

@ -542,7 +542,6 @@ extern char *Text_string[];
#define TXT_NET_SYNC_FAILED Text_string[513]
#ifdef SHAREWARE
#define N_TEXT_STRINGS 514
#define TXT_DONE "Done"
#define TXT_I_AM_A "I am a"
#define TXT_CHEATER "CHEATER!"
@ -735,10 +734,11 @@ extern char *Text_string[];
#define TXT_ROBOT_PAINTING_OFF Text_string[619]
#define TXT_ROBOT_PAINTING_ON Text_string[620]
#define N_TEXT_STRINGS 621
#endif
#define N_TEXT_STRINGS_SHAREWARE 514
#define N_TEXT_STRINGS 621
// Weapon names.
#define PRIMARY_WEAPON_NAMES(weapon_num) (*(&TXT_W_LASER + (weapon_num)))
#define SECONDARY_WEAPON_NAMES(weapon_num) (*(&TXT_W_C_MISSILE + (weapon_num)))

View file

@ -149,6 +149,21 @@ void strrev( char *s1 )
}
#endif
// remove extension from filename, doesn't work with paths.
void removeext(const char *filename, char *out)
{
char *p;
if ((p = strrchr(filename, '.')))
{
strncpy(out, filename, p - filename);
out[p - filename] = 0;
}
else
strcpy(out, filename);
}
//give a filename a new extension
void change_filename_extension( char *dest, char *src, char *ext )
{