summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2020-08-03 00:03:24 +0200
committerGitHub <noreply@github.com>2020-08-03 00:03:24 +0200
commit4b614333c6778ae49cef688f6ef691dd58384d13 (patch)
treeced50966eaaf373f8733547046baf2bdc558662d
parentcleanup (diff)
parentMove sdk and eax (diff)
downloadre3-4b614333c6778ae49cef688f6ef691dd58384d13.tar
re3-4b614333c6778ae49cef688f6ef691dd58384d13.tar.gz
re3-4b614333c6778ae49cef688f6ef691dd58384d13.tar.bz2
re3-4b614333c6778ae49cef688f6ef691dd58384d13.tar.lz
re3-4b614333c6778ae49cef688f6ef691dd58384d13.tar.xz
re3-4b614333c6778ae49cef688f6ef691dd58384d13.tar.zst
re3-4b614333c6778ae49cef688f6ef691dd58384d13.zip
-rw-r--r--.appveyor.yml2
-rw-r--r--.gitmodules12
-rw-r--r--README.md8
-rw-r--r--dxsdk/Include/Msvidctl.tlbbin108028 -> 0 bytes
-rw-r--r--dxsdk/Include/Tuner.tlbbin53292 -> 0 bytes
m---------librw0
-rw-r--r--libsndfile.32/ChangeLog (renamed from libsndfile/ChangeLog)0
-rw-r--r--libsndfile.32/NEWS (renamed from libsndfile/NEWS)0
-rw-r--r--libsndfile.32/dist/libsndfile-1.dll (renamed from libsndfile/dist/libsndfile-1.dll)bin1679360 -> 1679360 bytes
-rw-r--r--libsndfile.32/include/sndfile.h (renamed from libsndfile/include/sndfile.h)0
-rw-r--r--libsndfile.32/include/sndfile.hh (renamed from libsndfile/include/sndfile.hh)0
-rw-r--r--libsndfile.32/lib/libsndfile-1.def (renamed from libsndfile/lib/libsndfile-1.def)0
-rw-r--r--libsndfile.32/lib/libsndfile-1.lib (renamed from libsndfile/lib/libsndfile-1.lib)bin9948 -> 9948 bytes
-rw-r--r--libsndfile.32/lib/pkgconfig/sndfile.pc (renamed from libsndfile/lib/pkgconfig/sndfile.pc)0
-rw-r--r--libsndfile.64/ChangeLog9764
-rw-r--r--libsndfile.64/NEWS199
-rw-r--r--libsndfile.64/dist/libsndfile-1.dllbin0 -> 1748992 bytes
-rw-r--r--libsndfile.64/include/sndfile.h857
-rw-r--r--libsndfile.64/include/sndfile.hh446
-rw-r--r--libsndfile.64/lib/libsndfile-1.def47
-rw-r--r--libsndfile.64/lib/libsndfile-1.libbin0 -> 9760 bytes
-rw-r--r--libsndfile.64/lib/pkgconfig/sndfile.pc12
-rw-r--r--mpg123.32/dist/libmpg123.dll (renamed from mpg123/dist/libmpg123.dll)bin150528 -> 150528 bytes
-rw-r--r--mpg123.32/include/mpg123.h (renamed from mpg123/include/mpg123.h)0
-rw-r--r--mpg123.32/lib/libmpg123.lib (renamed from mpg123/lib/libmpg123.lib)bin19996 -> 19996 bytes
-rw-r--r--mpg123.64/dist/libmpg123.dllbin0 -> 345088 bytes
-rw-r--r--mpg123.64/include/fmt123.h159
-rw-r--r--mpg123.64/include/mpg123.h1697
-rw-r--r--mpg123.64/lib/libmpg123.libbin0 -> 33342 bytes
m---------ogg0
m---------opus0
m---------opusfile0
-rw-r--r--premake5.lua105
-rw-r--r--sdk/dx8sdk/Include/Amvideo.h (renamed from dxsdk/Include/Amvideo.h)0
-rw-r--r--sdk/dx8sdk/Include/Bdatif.h (renamed from dxsdk/Include/Bdatif.h)0
-rw-r--r--sdk/dx8sdk/Include/DShow.h (renamed from dxsdk/Include/DShow.h)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/Bdatif.idl (renamed from dxsdk/Include/DShowIDL/Bdatif.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/Mpeg2Data.idl (renamed from dxsdk/Include/DShowIDL/Mpeg2Data.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/Mpeg2Structs.idl (renamed from dxsdk/Include/DShowIDL/Mpeg2Structs.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/Mstvca.idl (renamed from dxsdk/Include/DShowIDL/Mstvca.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/Mstvgs.idl (renamed from dxsdk/Include/DShowIDL/Mstvgs.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/Msvidctl.idl (renamed from dxsdk/Include/DShowIDL/Msvidctl.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/Segment.idl (renamed from dxsdk/Include/DShowIDL/Segment.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/Videoacc.idl (renamed from dxsdk/Include/DShowIDL/Videoacc.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/Vmrender.idl (renamed from dxsdk/Include/DShowIDL/Vmrender.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/amstream.idl (renamed from dxsdk/Include/DShowIDL/amstream.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/austream.idl (renamed from dxsdk/Include/DShowIDL/austream.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/axcore.idl (renamed from dxsdk/Include/DShowIDL/axcore.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/axextend.idl (renamed from dxsdk/Include/DShowIDL/axextend.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/bdaiface.idl (renamed from dxsdk/Include/DShowIDL/bdaiface.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/control.odl (renamed from dxsdk/Include/DShowIDL/control.odl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/ddstream.idl (renamed from dxsdk/Include/DShowIDL/ddstream.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/devenum.idl (renamed from dxsdk/Include/DShowIDL/devenum.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/dmodshow.idl (renamed from dxsdk/Include/DShowIDL/dmodshow.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/dshowasf.idl (renamed from dxsdk/Include/DShowIDL/dshowasf.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/dvdif.idl (renamed from dxsdk/Include/DShowIDL/dvdif.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/dxtrans.idl (renamed from dxsdk/Include/DShowIDL/dxtrans.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/dyngraph.idl (renamed from dxsdk/Include/DShowIDL/dyngraph.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/mediaobj.idl (renamed from dxsdk/Include/DShowIDL/mediaobj.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/medparam.idl (renamed from dxsdk/Include/DShowIDL/medparam.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/mixerocx.idl (renamed from dxsdk/Include/DShowIDL/mixerocx.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/mmstream.idl (renamed from dxsdk/Include/DShowIDL/mmstream.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/mstve.idl (renamed from dxsdk/Include/DShowIDL/mstve.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/qedit.idl (renamed from dxsdk/Include/DShowIDL/qedit.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/regbag.idl (renamed from dxsdk/Include/DShowIDL/regbag.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/sbe.idl (renamed from dxsdk/Include/DShowIDL/sbe.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/strmif.idl (renamed from dxsdk/Include/DShowIDL/strmif.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/tuner.idl (renamed from dxsdk/Include/DShowIDL/tuner.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/tvratings.idl (renamed from dxsdk/Include/DShowIDL/tvratings.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/vidcap.idl (renamed from dxsdk/Include/DShowIDL/vidcap.idl)0
-rw-r--r--sdk/dx8sdk/Include/DShowIDL/vmr9.idl (renamed from dxsdk/Include/DShowIDL/vmr9.idl)0
-rw-r--r--sdk/dx8sdk/Include/DxDiag.h (renamed from dxsdk/Include/DxDiag.h)0
-rw-r--r--sdk/dx8sdk/Include/Iwstdec.h (renamed from dxsdk/Include/Iwstdec.h)0
-rw-r--r--sdk/dx8sdk/Include/Mpeg2Bits.h (renamed from dxsdk/Include/Mpeg2Bits.h)0
-rw-r--r--sdk/dx8sdk/Include/Mpeg2Error.h (renamed from dxsdk/Include/Mpeg2Error.h)0
-rw-r--r--sdk/dx8sdk/Include/Mstvca.h (renamed from dxsdk/Include/Mstvca.h)0
-rw-r--r--sdk/dx8sdk/Include/Mstve.h (renamed from dxsdk/Include/Mstve.h)0
-rw-r--r--sdk/dx8sdk/Include/Msvidctl.h (renamed from dxsdk/Include/Msvidctl.h)0
-rw-r--r--sdk/dx8sdk/Include/PixPlugin.h (renamed from dxsdk/Include/PixPlugin.h)0
-rw-r--r--sdk/dx8sdk/Include/Segment.h (renamed from dxsdk/Include/Segment.h)0
-rw-r--r--sdk/dx8sdk/Include/activecf.h (renamed from dxsdk/Include/activecf.h)0
-rw-r--r--sdk/dx8sdk/Include/amaudio.h (renamed from dxsdk/Include/amaudio.h)0
-rw-r--r--sdk/dx8sdk/Include/amparse.h (renamed from dxsdk/Include/amparse.h)0
-rw-r--r--sdk/dx8sdk/Include/amstream.h (renamed from dxsdk/Include/amstream.h)0
-rw-r--r--sdk/dx8sdk/Include/amva.h (renamed from dxsdk/Include/amva.h)0
-rw-r--r--sdk/dx8sdk/Include/atsmedia.h (renamed from dxsdk/Include/atsmedia.h)0
-rw-r--r--sdk/dx8sdk/Include/audevcod.h (renamed from dxsdk/Include/audevcod.h)0
-rw-r--r--sdk/dx8sdk/Include/austream.h (renamed from dxsdk/Include/austream.h)0
-rw-r--r--sdk/dx8sdk/Include/aviriff.h (renamed from dxsdk/Include/aviriff.h)0
-rw-r--r--sdk/dx8sdk/Include/bdaiface.h (renamed from dxsdk/Include/bdaiface.h)0
-rw-r--r--sdk/dx8sdk/Include/bdamedia.h (renamed from dxsdk/Include/bdamedia.h)0
-rw-r--r--sdk/dx8sdk/Include/bdatypes.h (renamed from dxsdk/Include/bdatypes.h)0
-rw-r--r--sdk/dx8sdk/Include/comlite.h (renamed from dxsdk/Include/comlite.h)0
-rw-r--r--sdk/dx8sdk/Include/control.h (renamed from dxsdk/Include/control.h)0
-rw-r--r--sdk/dx8sdk/Include/d3d.h (renamed from dxsdk/Include/d3d.h)0
-rw-r--r--sdk/dx8sdk/Include/d3d8.h (renamed from dxsdk/Include/d3d8.h)0
-rw-r--r--sdk/dx8sdk/Include/d3d8caps.h (renamed from dxsdk/Include/d3d8caps.h)0
-rw-r--r--sdk/dx8sdk/Include/d3d8types.h (renamed from dxsdk/Include/d3d8types.h)0
-rw-r--r--sdk/dx8sdk/Include/d3d9.h (renamed from dxsdk/Include/d3d9.h)0
-rw-r--r--sdk/dx8sdk/Include/d3d9caps.h (renamed from dxsdk/Include/d3d9caps.h)0
-rw-r--r--sdk/dx8sdk/Include/d3d9types.h (renamed from dxsdk/Include/d3d9types.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dcaps.h (renamed from dxsdk/Include/d3dcaps.h)0
-rw-r--r--sdk/dx8sdk/Include/d3drm.h (renamed from dxsdk/Include/d3drm.h)0
-rw-r--r--sdk/dx8sdk/Include/d3drmdef.h (renamed from dxsdk/Include/d3drmdef.h)0
-rw-r--r--sdk/dx8sdk/Include/d3drmobj.h (renamed from dxsdk/Include/d3drmobj.h)0
-rw-r--r--sdk/dx8sdk/Include/d3drmwin.h (renamed from dxsdk/Include/d3drmwin.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dtypes.h (renamed from dxsdk/Include/d3dtypes.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dvec.inl (renamed from dxsdk/Include/d3dvec.inl)0
-rw-r--r--sdk/dx8sdk/Include/d3dx.h (renamed from dxsdk/Include/d3dx.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx8.h (renamed from dxsdk/Include/d3dx8.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx8core.h (renamed from dxsdk/Include/d3dx8core.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx8effect.h (renamed from dxsdk/Include/d3dx8effect.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx8math.h (renamed from dxsdk/Include/d3dx8math.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx8math.inl (renamed from dxsdk/Include/d3dx8math.inl)0
-rw-r--r--sdk/dx8sdk/Include/d3dx8mesh.h (renamed from dxsdk/Include/d3dx8mesh.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx8shape.h (renamed from dxsdk/Include/d3dx8shape.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx8tex.h (renamed from dxsdk/Include/d3dx8tex.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9.h (renamed from dxsdk/Include/d3dx9.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9anim.h (renamed from dxsdk/Include/d3dx9anim.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9core.h (renamed from dxsdk/Include/d3dx9core.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9effect.h (renamed from dxsdk/Include/d3dx9effect.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9math.h (renamed from dxsdk/Include/d3dx9math.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9math.inl (renamed from dxsdk/Include/d3dx9math.inl)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9mesh.h (renamed from dxsdk/Include/d3dx9mesh.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9shader.h (renamed from dxsdk/Include/d3dx9shader.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9shape.h (renamed from dxsdk/Include/d3dx9shape.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9tex.h (renamed from dxsdk/Include/d3dx9tex.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dx9xof.h (renamed from dxsdk/Include/d3dx9xof.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dxcore.h (renamed from dxsdk/Include/d3dxcore.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dxerr.h (renamed from dxsdk/Include/d3dxerr.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dxmath.h (renamed from dxsdk/Include/d3dxmath.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dxmath.inl (renamed from dxsdk/Include/d3dxmath.inl)0
-rw-r--r--sdk/dx8sdk/Include/d3dxshapes.h (renamed from dxsdk/Include/d3dxshapes.h)0
-rw-r--r--sdk/dx8sdk/Include/d3dxsprite.h (renamed from dxsdk/Include/d3dxsprite.h)0
-rw-r--r--sdk/dx8sdk/Include/ddraw.h (renamed from dxsdk/Include/ddraw.h)0
-rw-r--r--sdk/dx8sdk/Include/ddstream.h (renamed from dxsdk/Include/ddstream.h)0
-rw-r--r--sdk/dx8sdk/Include/dinput.h (renamed from dxsdk/Include/dinput.h)0
-rw-r--r--sdk/dx8sdk/Include/dinputd.h (renamed from dxsdk/Include/dinputd.h)0
-rw-r--r--sdk/dx8sdk/Include/dls1.h (renamed from dxsdk/Include/dls1.h)0
-rw-r--r--sdk/dx8sdk/Include/dls2.h (renamed from dxsdk/Include/dls2.h)0
-rw-r--r--sdk/dx8sdk/Include/dmdls.h (renamed from dxsdk/Include/dmdls.h)0
-rw-r--r--sdk/dx8sdk/Include/dmerror.h (renamed from dxsdk/Include/dmerror.h)0
-rw-r--r--sdk/dx8sdk/Include/dmksctrl.h (renamed from dxsdk/Include/dmksctrl.h)0
-rw-r--r--sdk/dx8sdk/Include/dmo.h (renamed from dxsdk/Include/dmo.h)0
-rw-r--r--sdk/dx8sdk/Include/dmodshow.h (renamed from dxsdk/Include/dmodshow.h)0
-rw-r--r--sdk/dx8sdk/Include/dmoimpl.h (renamed from dxsdk/Include/dmoimpl.h)0
-rw-r--r--sdk/dx8sdk/Include/dmoreg.h (renamed from dxsdk/Include/dmoreg.h)0
-rw-r--r--sdk/dx8sdk/Include/dmort.h (renamed from dxsdk/Include/dmort.h)0
-rw-r--r--sdk/dx8sdk/Include/dmplugin.h (renamed from dxsdk/Include/dmplugin.h)0
-rw-r--r--sdk/dx8sdk/Include/dmusbuff.h (renamed from dxsdk/Include/dmusbuff.h)0
-rw-r--r--sdk/dx8sdk/Include/dmusicc.h (renamed from dxsdk/Include/dmusicc.h)0
-rw-r--r--sdk/dx8sdk/Include/dmusicf.h (renamed from dxsdk/Include/dmusicf.h)0
-rw-r--r--sdk/dx8sdk/Include/dmusici.h (renamed from dxsdk/Include/dmusici.h)0
-rw-r--r--sdk/dx8sdk/Include/dmusics.h (renamed from dxsdk/Include/dmusics.h)0
-rw-r--r--sdk/dx8sdk/Include/dpaddr.h (renamed from dxsdk/Include/dpaddr.h)0
-rw-r--r--sdk/dx8sdk/Include/dplay.h (renamed from dxsdk/Include/dplay.h)0
-rw-r--r--sdk/dx8sdk/Include/dplay8.h (renamed from dxsdk/Include/dplay8.h)0
-rw-r--r--sdk/dx8sdk/Include/dplobby.h (renamed from dxsdk/Include/dplobby.h)0
-rw-r--r--sdk/dx8sdk/Include/dplobby8.h (renamed from dxsdk/Include/dplobby8.h)0
-rw-r--r--sdk/dx8sdk/Include/dpnathlp.h (renamed from dxsdk/Include/dpnathlp.h)0
-rw-r--r--sdk/dx8sdk/Include/dsconf.h (renamed from dxsdk/Include/dsconf.h)0
-rw-r--r--sdk/dx8sdk/Include/dsetup.h (renamed from dxsdk/Include/dsetup.h)0
-rw-r--r--sdk/dx8sdk/Include/dshowasf.h (renamed from dxsdk/Include/dshowasf.h)0
-rw-r--r--sdk/dx8sdk/Include/dsound.h (renamed from dxsdk/Include/dsound.h)0
-rw-r--r--sdk/dx8sdk/Include/dv.h (renamed from dxsdk/Include/dv.h)0
-rw-r--r--sdk/dx8sdk/Include/dvdevcod.h (renamed from dxsdk/Include/dvdevcod.h)0
-rw-r--r--sdk/dx8sdk/Include/dvdmedia.h (renamed from dxsdk/Include/dvdmedia.h)0
-rw-r--r--sdk/dx8sdk/Include/dvoice.h (renamed from dxsdk/Include/dvoice.h)0
-rw-r--r--sdk/dx8sdk/Include/dvp.h (renamed from dxsdk/Include/dvp.h)0
-rw-r--r--sdk/dx8sdk/Include/dx7todx8.h (renamed from dxsdk/Include/dx7todx8.h)0
-rw-r--r--sdk/dx8sdk/Include/dxerr8.h (renamed from dxsdk/Include/dxerr8.h)0
-rw-r--r--sdk/dx8sdk/Include/dxerr9.h (renamed from dxsdk/Include/dxerr9.h)0
-rw-r--r--sdk/dx8sdk/Include/dxfile.h (renamed from dxsdk/Include/dxfile.h)0
-rw-r--r--sdk/dx8sdk/Include/dxtrans.h (renamed from dxsdk/Include/dxtrans.h)0
-rw-r--r--sdk/dx8sdk/Include/dxva.h (renamed from dxsdk/Include/dxva.h)0
-rw-r--r--sdk/dx8sdk/Include/edevctrl.h (renamed from dxsdk/Include/edevctrl.h)0
-rw-r--r--sdk/dx8sdk/Include/edevdefs.h (renamed from dxsdk/Include/edevdefs.h)0
-rw-r--r--sdk/dx8sdk/Include/errors.h (renamed from dxsdk/Include/errors.h)0
-rw-r--r--sdk/dx8sdk/Include/evcode.h (renamed from dxsdk/Include/evcode.h)0
-rw-r--r--sdk/dx8sdk/Include/il21dec.h (renamed from dxsdk/Include/il21dec.h)0
-rw-r--r--sdk/dx8sdk/Include/ks.h (renamed from dxsdk/Include/ks.h)0
-rw-r--r--sdk/dx8sdk/Include/ksguid.h (renamed from dxsdk/Include/ksguid.h)0
-rw-r--r--sdk/dx8sdk/Include/ksmedia.h (renamed from dxsdk/Include/ksmedia.h)0
-rw-r--r--sdk/dx8sdk/Include/ksproxy.h (renamed from dxsdk/Include/ksproxy.h)0
-rw-r--r--sdk/dx8sdk/Include/ksuuids.h (renamed from dxsdk/Include/ksuuids.h)0
-rw-r--r--sdk/dx8sdk/Include/mediaerr.h (renamed from dxsdk/Include/mediaerr.h)0
-rw-r--r--sdk/dx8sdk/Include/mediaobj.h (renamed from dxsdk/Include/mediaobj.h)0
-rw-r--r--sdk/dx8sdk/Include/medparam.h (renamed from dxsdk/Include/medparam.h)0
-rw-r--r--sdk/dx8sdk/Include/mixerocx.h (renamed from dxsdk/Include/mixerocx.h)0
-rw-r--r--sdk/dx8sdk/Include/mmstream.h (renamed from dxsdk/Include/mmstream.h)0
-rw-r--r--sdk/dx8sdk/Include/mpconfig.h (renamed from dxsdk/Include/mpconfig.h)0
-rw-r--r--sdk/dx8sdk/Include/mpeg2data.h (renamed from dxsdk/Include/mpeg2data.h)0
-rw-r--r--sdk/dx8sdk/Include/mpegtype.h (renamed from dxsdk/Include/mpegtype.h)0
-rw-r--r--sdk/dx8sdk/Include/multimon.h (renamed from dxsdk/Include/multimon.h)0
-rw-r--r--sdk/dx8sdk/Include/playlist.h (renamed from dxsdk/Include/playlist.h)0
-rw-r--r--sdk/dx8sdk/Include/qedit.h (renamed from dxsdk/Include/qedit.h)0
-rw-r--r--sdk/dx8sdk/Include/qnetwork.h (renamed from dxsdk/Include/qnetwork.h)0
-rw-r--r--sdk/dx8sdk/Include/regbag.h (renamed from dxsdk/Include/regbag.h)0
-rw-r--r--sdk/dx8sdk/Include/rmxfguid.h (renamed from dxsdk/Include/rmxfguid.h)0
-rw-r--r--sdk/dx8sdk/Include/rmxftmpl.h (renamed from dxsdk/Include/rmxftmpl.h)0
-rw-r--r--sdk/dx8sdk/Include/sbe.h (renamed from dxsdk/Include/sbe.h)0
-rw-r--r--sdk/dx8sdk/Include/strmif.h (renamed from dxsdk/Include/strmif.h)0
-rw-r--r--sdk/dx8sdk/Include/strsafe.h (renamed from dxsdk/Include/strsafe.h)0
-rw-r--r--sdk/dx8sdk/Include/tune.h (renamed from dxsdk/Include/tune.h)0
-rw-r--r--sdk/dx8sdk/Include/tuner.h (renamed from dxsdk/Include/tuner.h)0
-rw-r--r--sdk/dx8sdk/Include/tvratings.h (renamed from dxsdk/Include/tvratings.h)0
-rw-r--r--sdk/dx8sdk/Include/uuids.h (renamed from dxsdk/Include/uuids.h)0
-rw-r--r--sdk/dx8sdk/Include/vfwmsgs.h (renamed from dxsdk/Include/vfwmsgs.h)0
-rw-r--r--sdk/dx8sdk/Include/vidcap.h (renamed from dxsdk/Include/vidcap.h)0
-rw-r--r--sdk/dx8sdk/Include/videoacc.h (renamed from dxsdk/Include/videoacc.h)0
-rw-r--r--sdk/dx8sdk/Include/vmr9.h (renamed from dxsdk/Include/vmr9.h)0
-rw-r--r--sdk/dx8sdk/Include/vpconfig.h (renamed from dxsdk/Include/vpconfig.h)0
-rw-r--r--sdk/dx8sdk/Include/vpnotify.h (renamed from dxsdk/Include/vpnotify.h)0
-rw-r--r--sdk/dx8sdk/Include/vptype.h (renamed from dxsdk/Include/vptype.h)0
-rw-r--r--sdk/dx8sdk/Include/xprtdefs.h (renamed from dxsdk/Include/xprtdefs.h)0
-rw-r--r--sdk/dx8sdk/Lib/DxErr8.lib (renamed from dxsdk/Lib/DxErr8.lib)bin1083572 -> 1083572 bytes
-rw-r--r--sdk/dx8sdk/Lib/DxErr9.lib (renamed from dxsdk/Lib/DxErr9.lib)bin3901404 -> 3901404 bytes
-rw-r--r--sdk/dx8sdk/Lib/amstrmid.lib (renamed from dxsdk/Lib/amstrmid.lib)bin272820 -> 272820 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3d8.lib (renamed from dxsdk/Lib/d3d8.lib)bin2466 -> 2466 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3d9.lib (renamed from dxsdk/Lib/d3d9.lib)bin4988 -> 4988 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3dx.lib (renamed from dxsdk/Lib/d3dx.lib)bin614522 -> 614522 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3dx8.lib (renamed from dxsdk/Lib/d3dx8.lib)bin2151212 -> 2151212 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3dx8d.lib (renamed from dxsdk/Lib/d3dx8d.lib)bin53414 -> 53414 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3dx8dt.lib (renamed from dxsdk/Lib/d3dx8dt.lib)bin2467156 -> 2467156 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3dx9.lib (renamed from dxsdk/Lib/d3dx9.lib)bin5959648 -> 5959648 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3dx9d.lib (renamed from dxsdk/Lib/d3dx9d.lib)bin82586 -> 82586 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3dx9dt.lib (renamed from dxsdk/Lib/d3dx9dt.lib)bin6948164 -> 6948164 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3dxd.lib (renamed from dxsdk/Lib/d3dxd.lib)bin565570 -> 565570 bytes
-rw-r--r--sdk/dx8sdk/Lib/d3dxof.lib (renamed from dxsdk/Lib/d3dxof.lib)bin1722 -> 1722 bytes
-rw-r--r--sdk/dx8sdk/Lib/ddraw.lib (renamed from dxsdk/Lib/ddraw.lib)bin4540 -> 4540 bytes
-rw-r--r--sdk/dx8sdk/Lib/dinput.lib (renamed from dxsdk/Lib/dinput.lib)bin17790 -> 17790 bytes
-rw-r--r--sdk/dx8sdk/Lib/dinput8.lib (renamed from dxsdk/Lib/dinput8.lib)bin19978 -> 19978 bytes
-rw-r--r--sdk/dx8sdk/Lib/dmoguids.lib (renamed from dxsdk/Lib/dmoguids.lib)bin18408 -> 18408 bytes
-rw-r--r--sdk/dx8sdk/Lib/dplayx.lib (renamed from dxsdk/Lib/dplayx.lib)bin3142 -> 3142 bytes
-rw-r--r--sdk/dx8sdk/Lib/dsetup.lib (renamed from dxsdk/Lib/dsetup.lib)bin5998 -> 5998 bytes
-rw-r--r--sdk/dx8sdk/Lib/dsound.lib (renamed from dxsdk/Lib/dsound.lib)bin4042 -> 4042 bytes
-rw-r--r--sdk/dx8sdk/Lib/dxguid.lib (renamed from dxsdk/Lib/dxguid.lib)bin107734 -> 107734 bytes
-rw-r--r--sdk/dx8sdk/Lib/dxtrans.lib (renamed from dxsdk/Lib/dxtrans.lib)bin3700 -> 3700 bytes
-rw-r--r--sdk/dx8sdk/Lib/encapi.lib (renamed from dxsdk/Lib/encapi.lib)bin1522 -> 1522 bytes
-rw-r--r--sdk/dx8sdk/Lib/ksproxy.lib (renamed from dxsdk/Lib/ksproxy.lib)bin3054 -> 3054 bytes
-rw-r--r--sdk/dx8sdk/Lib/ksuser.lib (renamed from dxsdk/Lib/ksuser.lib)bin196016 -> 196016 bytes
-rw-r--r--sdk/dx8sdk/Lib/msdmo.lib (renamed from dxsdk/Lib/msdmo.lib)bin4620 -> 4620 bytes
-rw-r--r--sdk/dx8sdk/Lib/quartz.lib (renamed from dxsdk/Lib/quartz.lib)bin2370 -> 2370 bytes
-rw-r--r--sdk/dx8sdk/Lib/strmiids.lib (renamed from dxsdk/Lib/strmiids.lib)bin272820 -> 272820 bytes
-rw-r--r--sdk/milessdk/include/mss.h (renamed from milessdk/include/mss.h)0
-rw-r--r--sdk/milessdk/lib/mss32.lib (renamed from milessdk/lib/mss32.lib)bin15316 -> 15316 bytes
-rw-r--r--sdk/rwsdk/include/d3d8/baaplylt.c (renamed from rwsdk/include/d3d8/baaplylt.c)0
-rw-r--r--sdk/rwsdk/include/d3d8/errcom.def (renamed from rwsdk/include/d3d8/errcom.def)0
-rw-r--r--sdk/rwsdk/include/d3d8/errcore.def (renamed from rwsdk/include/d3d8/errcore.def)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpanisot.h (renamed from rwsdk/include/d3d8/rpanisot.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpanisot.rpe (renamed from rwsdk/include/d3d8/rpanisot.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpcollis.h (renamed from rwsdk/include/d3d8/rpcollis.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpcollis.rpe (renamed from rwsdk/include/d3d8/rpcollis.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpcriter.h (renamed from rwsdk/include/d3d8/rpcriter.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpdbgerr.c (renamed from rwsdk/include/d3d8/rpdbgerr.c)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpdbgerr.h (renamed from rwsdk/include/d3d8/rpdbgerr.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpdmorph.h (renamed from rwsdk/include/d3d8/rpdmorph.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpdmorph.rpe (renamed from rwsdk/include/d3d8/rpdmorph.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rperror.h (renamed from rwsdk/include/d3d8/rperror.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rphanim.h (renamed from rwsdk/include/d3d8/rphanim.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rphanim.rpe (renamed from rwsdk/include/d3d8/rphanim.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rplodatm.h (renamed from rwsdk/include/d3d8/rplodatm.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rplodatm.rpe (renamed from rwsdk/include/d3d8/rplodatm.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rplogo.h (renamed from rwsdk/include/d3d8/rplogo.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rplogo.rpe (renamed from rwsdk/include/d3d8/rplogo.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpltmap.h (renamed from rwsdk/include/d3d8/rpltmap.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpltmap.rpe (renamed from rwsdk/include/d3d8/rpltmap.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpmatfx.h (renamed from rwsdk/include/d3d8/rpmatfx.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpmatfx.rpe (renamed from rwsdk/include/d3d8/rpmatfx.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpmipkl.h (renamed from rwsdk/include/d3d8/rpmipkl.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpmipkl.rpe (renamed from rwsdk/include/d3d8/rpmipkl.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpmorph.h (renamed from rwsdk/include/d3d8/rpmorph.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpmorph.rpe (renamed from rwsdk/include/d3d8/rpmorph.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rppatch.h (renamed from rwsdk/include/d3d8/rppatch.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rppatch.rpe (renamed from rwsdk/include/d3d8/rppatch.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpprtstd.h (renamed from rwsdk/include/d3d8/rpprtstd.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpprtstd.rpe (renamed from rwsdk/include/d3d8/rpprtstd.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpptank.h (renamed from rwsdk/include/d3d8/rpptank.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpptank.rpe (renamed from rwsdk/include/d3d8/rpptank.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rppvs.h (renamed from rwsdk/include/d3d8/rppvs.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rppvs.rpe (renamed from rwsdk/include/d3d8/rppvs.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rprandom.h (renamed from rwsdk/include/d3d8/rprandom.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rprandom.rpe (renamed from rwsdk/include/d3d8/rprandom.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpskin.h (renamed from rwsdk/include/d3d8/rpskin.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpskin.rpe (renamed from rwsdk/include/d3d8/rpskin.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpspline.h (renamed from rwsdk/include/d3d8/rpspline.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpspline.rpe (renamed from rwsdk/include/d3d8/rpspline.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpstereo.h (renamed from rwsdk/include/d3d8/rpstereo.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpstereo.rpe (renamed from rwsdk/include/d3d8/rpstereo.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpusrdat.h (renamed from rwsdk/include/d3d8/rpusrdat.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpusrdat.rpe (renamed from rwsdk/include/d3d8/rpusrdat.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpworld.h (renamed from rwsdk/include/d3d8/rpworld.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rpworld.rpe (renamed from rwsdk/include/d3d8/rpworld.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rt2d.h (renamed from rwsdk/include/d3d8/rt2d.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rt2d.rpe (renamed from rwsdk/include/d3d8/rt2d.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rt2danim.h (renamed from rwsdk/include/d3d8/rt2danim.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rt2danim.rpe (renamed from rwsdk/include/d3d8/rt2danim.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtbary.h (renamed from rwsdk/include/d3d8/rtbary.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtbary.rpe (renamed from rwsdk/include/d3d8/rtbary.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtbezpat.h (renamed from rwsdk/include/d3d8/rtbezpat.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtbezpat.rpe (renamed from rwsdk/include/d3d8/rtbezpat.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtbmp.h (renamed from rwsdk/include/d3d8/rtbmp.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtbmp.rpe (renamed from rwsdk/include/d3d8/rtbmp.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtcharse.h (renamed from rwsdk/include/d3d8/rtcharse.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtcharse.rpe (renamed from rwsdk/include/d3d8/rtcharse.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtimport.h (renamed from rwsdk/include/d3d8/rtimport.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtimport.rpe (renamed from rwsdk/include/d3d8/rtimport.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtintel.h (renamed from rwsdk/include/d3d8/rtintel.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtintel.rpe (renamed from rwsdk/include/d3d8/rtintel.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtintsec.h (renamed from rwsdk/include/d3d8/rtintsec.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtintsec.rpe (renamed from rwsdk/include/d3d8/rtintsec.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtltmap.h (renamed from rwsdk/include/d3d8/rtltmap.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtltmap.rpe (renamed from rwsdk/include/d3d8/rtltmap.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtmipk.h (renamed from rwsdk/include/d3d8/rtmipk.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtmipk.rpe (renamed from rwsdk/include/d3d8/rtmipk.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtpick.h (renamed from rwsdk/include/d3d8/rtpick.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtpick.rpe (renamed from rwsdk/include/d3d8/rtpick.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtpitexd.h (renamed from rwsdk/include/d3d8/rtpitexd.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtpitexd.rpe (renamed from rwsdk/include/d3d8/rtpitexd.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtpng.h (renamed from rwsdk/include/d3d8/rtpng.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtpng.rpe (renamed from rwsdk/include/d3d8/rtpng.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtquat.h (renamed from rwsdk/include/d3d8/rtquat.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtquat.rpe (renamed from rwsdk/include/d3d8/rtquat.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtras.h (renamed from rwsdk/include/d3d8/rtras.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtras.rpe (renamed from rwsdk/include/d3d8/rtras.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtray.h (renamed from rwsdk/include/d3d8/rtray.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtray.rpe (renamed from rwsdk/include/d3d8/rtray.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtslerp.h (renamed from rwsdk/include/d3d8/rtslerp.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtslerp.rpe (renamed from rwsdk/include/d3d8/rtslerp.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtsplpvs.h (renamed from rwsdk/include/d3d8/rtsplpvs.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtsplpvs.rpe (renamed from rwsdk/include/d3d8/rtsplpvs.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rttiff.h (renamed from rwsdk/include/d3d8/rttiff.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rttiff.rpe (renamed from rwsdk/include/d3d8/rttiff.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rttilerd.h (renamed from rwsdk/include/d3d8/rttilerd.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rttilerd.rpe (renamed from rwsdk/include/d3d8/rttilerd.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rttoc.h (renamed from rwsdk/include/d3d8/rttoc.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rttoc.rpe (renamed from rwsdk/include/d3d8/rttoc.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtvcat.h (renamed from rwsdk/include/d3d8/rtvcat.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtvcat.rpe (renamed from rwsdk/include/d3d8/rtvcat.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtworld.h (renamed from rwsdk/include/d3d8/rtworld.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rtworld.rpe (renamed from rwsdk/include/d3d8/rtworld.rpe)0
-rw-r--r--sdk/rwsdk/include/d3d8/rwcore.h (renamed from rwsdk/include/d3d8/rwcore.h)0
-rw-r--r--sdk/rwsdk/include/d3d8/rwplcore.h (renamed from rwsdk/include/d3d8/rwplcore.h)0
-rw-r--r--src/animation/AnimBlendClumpData.h2
-rw-r--r--src/animation/FrameUpdate.cpp6
-rw-r--r--src/animation/RpAnimBlend.cpp2
-rw-r--r--src/audio/AudioLogic.cpp129
-rw-r--r--src/audio/AudioManager.cpp4
-rw-r--r--src/audio/AudioManager.h4
-rw-r--r--src/audio/eax/eax-util.cpp (renamed from eax/eax-util.cpp)0
-rw-r--r--src/audio/eax/eax-util.h (renamed from eax/eax-util.h)0
-rw-r--r--src/audio/eax/eax.h (renamed from eax/eax.h)0
-rw-r--r--src/audio/oal/aldlist.cpp3
-rw-r--r--src/audio/oal/stream.cpp127
-rw-r--r--src/audio/sampman.h135
-rw-r--r--src/audio/sampman_miles.cpp17
-rw-r--r--src/audio/sampman_oal.cpp71
-rw-r--r--src/control/CarAI.cpp8
-rw-r--r--src/control/GameLogic.cpp12
-rw-r--r--src/control/Garages.cpp7
-rw-r--r--src/control/Phones.cpp89
-rw-r--r--src/control/Phones.h7
-rw-r--r--src/control/Pickups.cpp33
-rw-r--r--src/control/Record.cpp6
-rw-r--r--src/control/Record.h6
-rw-r--r--src/control/Replay.cpp10
-rw-r--r--src/control/Restart.cpp8
-rw-r--r--src/control/SceneEdit.cpp8
-rw-r--r--src/control/Script.cpp99
-rw-r--r--src/core/Cam.cpp4
-rw-r--r--src/core/Camera.cpp14
-rw-r--r--src/core/CdStreamPosix.cpp16
-rw-r--r--src/core/Collision.cpp233
-rw-r--r--src/core/Collision.h32
-rw-r--r--src/core/Directory.cpp3
-rw-r--r--src/core/FileLoader.cpp12
-rw-r--r--src/core/FileMgr.cpp49
-rw-r--r--src/core/FileMgr.h6
-rw-r--r--src/core/Fire.cpp7
-rw-r--r--src/core/Frontend.cpp43
-rw-r--r--src/core/Frontend.h6
-rw-r--r--src/core/Game.cpp24
-rw-r--r--src/core/Game.h2
-rw-r--r--src/core/General.h2
-rw-r--r--src/core/Pad.cpp29
-rw-r--r--src/core/Pad.h2
-rw-r--r--src/core/PlayerInfo.cpp4
-rw-r--r--src/core/Radar.cpp6
-rw-r--r--src/core/Stats.cpp4
-rw-r--r--src/core/Stats.h4
-rw-r--r--src/core/Streaming.cpp37
-rw-r--r--src/core/Streaming.h12
-rw-r--r--src/core/SurfaceTable.h10
-rw-r--r--src/core/TempColModels.cpp6
-rw-r--r--src/core/Wanted.cpp36
-rw-r--r--src/core/World.cpp2
-rw-r--r--src/core/Zones.cpp8
-rw-r--r--src/core/common.h5
-rw-r--r--src/core/config.h15
-rw-r--r--src/core/main.cpp18
-rw-r--r--src/core/patcher.cpp94
-rw-r--r--src/core/patcher.h144
-rw-r--r--src/core/re3.cpp22
-rw-r--r--src/entities/Building.cpp2
-rw-r--r--src/entities/Entity.cpp6
-rw-r--r--src/entities/Physical.cpp2
-rw-r--r--src/extras/frontendoption.cpp13
-rw-r--r--src/fakerw/fake.cpp78
-rw-r--r--src/fakerw/rphanim.h12
-rw-r--r--src/math/Matrix.h8
-rw-r--r--src/math/maths.h2
-rw-r--r--src/modelinfo/ModelInfo.cpp4
-rw-r--r--src/modelinfo/PedModelInfo.cpp4
-rw-r--r--src/modelinfo/VehicleModelInfo.h2
-rw-r--r--src/peds/CivilianPed.cpp90
-rw-r--r--src/peds/CopPed.cpp2
-rw-r--r--src/peds/EmergencyPed.cpp6
-rw-r--r--src/peds/Ped.cpp780
-rw-r--r--src/peds/Ped.h42
-rw-r--r--src/peds/PedStats.cpp2
-rw-r--r--src/peds/PedType.cpp2
-rw-r--r--src/peds/PlayerPed.cpp2
-rw-r--r--src/peds/Population.cpp10
-rw-r--r--src/render/Credits.cpp148
-rw-r--r--src/render/Draw.cpp6
-rw-r--r--src/render/Fluff.cpp2
-rw-r--r--src/render/Glass.cpp16
-rw-r--r--src/render/MBlur.cpp16
-rw-r--r--src/render/Renderer.cpp43
-rw-r--r--src/render/Shadows.cpp3
-rw-r--r--src/render/Sprite.cpp4
-rw-r--r--src/rw/NodeName.cpp2
-rw-r--r--src/rw/RwHelper.cpp42
-rw-r--r--src/rw/RwHelper.h10
-rw-r--r--src/rw/RwMatFX.cpp113
-rw-r--r--src/rw/RwPS2AlphaTest.cpp247
-rw-r--r--src/rw/VisibilityPlugins.cpp4
-rw-r--r--src/rw/VisibilityPlugins.h6
-rw-r--r--src/save/GenericGameStorage.cpp7
-rw-r--r--src/skel/crossplatform.cpp129
-rw-r--r--src/skel/crossplatform.h30
-rw-r--r--src/skel/glfw/glfw.cpp30
-rw-r--r--src/skel/platform.h4
-rw-r--r--src/skel/win/win.cpp114
-rw-r--r--src/skel/win/win.h22
-rw-r--r--src/text/Text.cpp18
-rw-r--r--src/text/Text.h8
-rw-r--r--src/vehicles/Automobile.cpp8
-rw-r--r--src/vehicles/Boat.cpp54
-rw-r--r--src/vehicles/Boat.h23
-rw-r--r--src/vehicles/CarGen.cpp9
-rw-r--r--src/vehicles/Floater.cpp4
-rw-r--r--src/vehicles/Heli.cpp19
-rw-r--r--src/vehicles/Plane.cpp33
-rw-r--r--src/vehicles/Vehicle.cpp4
-rw-r--r--src/weapons/Weapon.cpp2
-rw-r--r--src/weapons/WeaponInfo.cpp2
457 files changed, 15744 insertions, 1519 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index 20adee80..1cf0c676 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -24,7 +24,7 @@ install:
- cmd: >-
git submodule update --init --recursive
- premake5 vs2019 --with-librw --glewdir=%APPVEYOR_BUILD_FOLDER%/%GLEW_BASE% --glfwdir=%APPVEYOR_BUILD_FOLDER%/%GLFW_BASE%
+ premake5 vs2019 --with-librw --glewdir=%APPVEYOR_BUILD_FOLDER%/%GLEW_BASE% --glfwdir32=%APPVEYOR_BUILD_FOLDER%/%GLFW_BASE%
build:
project: build/re3.sln
diff --git a/.gitmodules b/.gitmodules
index fec30cac..bf1e33a5 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,15 @@
[submodule "librw"]
path = librw
url = https://github.com/aap/librw
+[submodule "opus"]
+ path = opus
+ url = https://github.com/xiph/opus.git
+ branch = master
+[submodule "opusfile"]
+ path = opusfile
+ url = https://github.com/xiph/opusfile.git
+ branch = master
+[submodule "ogg"]
+ path = ogg
+ url = https://github.com/xiph/ogg.git
+ branch = master
diff --git a/README.md b/README.md
index 3dcc9f58..5d336435 100644
--- a/README.md
+++ b/README.md
@@ -21,8 +21,6 @@ such that we have a working game at all times.
## Preparing the environment for building
-Currently only building on VS2015/2017/2019 (Windows) and GCC (Linux) is tested.
-
- Clone the repo.
- Run `git submodule init` and `git submodule update`.
- Point GTA_III_RE_DIR environment variable to GTA3 root folder.
@@ -30,8 +28,12 @@ Currently only building on VS2015/2017/2019 (Windows) and GCC (Linux) is tested.
- On Windows: one of the `premake-vsXXXX.cmd` variants on root folder
- On Linux: proceed to [Building on Linux](https://github.com/GTAmodding/re3/wiki/Building-on-Linux).
- There are various settings at the very bottom of [config.h](https://github.com/GTAmodding/re3/tree/master/src/core/config.h), you may want to take a look there. i.e. FIX_BUGS define fixes the bugs we've come across.
+- **If you use 64-bit D3D9**: We don't ship 64-bit Dx9 SDK. You need to download it from Microsoft if you don't have it(although it should come pre-installed after some Windows version)
+
+
+> :information_source: **If you choose OpenAL on Windows** You must read [Running OpenAL build on Windows](https://github.com/GTAmodding/re3/wiki/Running-OpenAL-build-on-Windows).
-> :information_source: **Rendering engine** re3 uses completely homebrew RenderWare-replacement rendering engine; [librw](https://github.com/aap/librw/). librw comes as submodule of re3, but you also can use LIBRW enviorenment variable to specify path to your own librw.
+> :information_source: **Did you notice librw?** re3 uses completely homebrew RenderWare-replacement rendering engine; [librw](https://github.com/aap/librw/). librw comes as submodule of re3, but you also can use LIBRW enviorenment variable to specify path to your own librw.
## Contributing
diff --git a/dxsdk/Include/Msvidctl.tlb b/dxsdk/Include/Msvidctl.tlb
deleted file mode 100644
index b501106c..00000000
--- a/dxsdk/Include/Msvidctl.tlb
+++ /dev/null
Binary files differ
diff --git a/dxsdk/Include/Tuner.tlb b/dxsdk/Include/Tuner.tlb
deleted file mode 100644
index c90fc4ec..00000000
--- a/dxsdk/Include/Tuner.tlb
+++ /dev/null
Binary files differ
diff --git a/librw b/librw
-Subproject 556f6af1b5a15d5ba1a2254a95076578cd16018
+Subproject 99c15d5ed78cc112e1055cc89452dd57df28da5
diff --git a/libsndfile/ChangeLog b/libsndfile.32/ChangeLog
index 62576177..62576177 100644
--- a/libsndfile/ChangeLog
+++ b/libsndfile.32/ChangeLog
diff --git a/libsndfile/NEWS b/libsndfile.32/NEWS
index d8f549f4..d8f549f4 100644
--- a/libsndfile/NEWS
+++ b/libsndfile.32/NEWS
diff --git a/libsndfile/dist/libsndfile-1.dll b/libsndfile.32/dist/libsndfile-1.dll
index 95ce5bd0..95ce5bd0 100644
--- a/libsndfile/dist/libsndfile-1.dll
+++ b/libsndfile.32/dist/libsndfile-1.dll
Binary files differ
diff --git a/libsndfile/include/sndfile.h b/libsndfile.32/include/sndfile.h
index 8a60fb09..8a60fb09 100644
--- a/libsndfile/include/sndfile.h
+++ b/libsndfile.32/include/sndfile.h
diff --git a/libsndfile/include/sndfile.hh b/libsndfile.32/include/sndfile.hh
index 0e1c1c20..0e1c1c20 100644
--- a/libsndfile/include/sndfile.hh
+++ b/libsndfile.32/include/sndfile.hh
diff --git a/libsndfile/lib/libsndfile-1.def b/libsndfile.32/lib/libsndfile-1.def
index 4194ff3e..4194ff3e 100644
--- a/libsndfile/lib/libsndfile-1.def
+++ b/libsndfile.32/lib/libsndfile-1.def
diff --git a/libsndfile/lib/libsndfile-1.lib b/libsndfile.32/lib/libsndfile-1.lib
index cc266ecd..cc266ecd 100644
--- a/libsndfile/lib/libsndfile-1.lib
+++ b/libsndfile.32/lib/libsndfile-1.lib
Binary files differ
diff --git a/libsndfile/lib/pkgconfig/sndfile.pc b/libsndfile.32/lib/pkgconfig/sndfile.pc
index 428d708a..428d708a 100644
--- a/libsndfile/lib/pkgconfig/sndfile.pc
+++ b/libsndfile.32/lib/pkgconfig/sndfile.pc
diff --git a/libsndfile.64/ChangeLog b/libsndfile.64/ChangeLog
new file mode 100644
index 00000000..62576177
--- /dev/null
+++ b/libsndfile.64/ChangeLog
@@ -0,0 +1,9764 @@
+2013-04-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Makefile.am
+ Make sure checkprograms are built as part of 'make test-tarball'.
+ Closes: https://github.com/erikd/libsndfile/issues/37
+
+2013-03-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/dft_cmp.c
+ Fix a buffer overflow detected using GCC 4.8's -fsantiize=address runtime
+ error checking functionality. This was a buffer overflow in libsndfile's
+ test suite, not in the actual library code.
+
+2013-03-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * M4/gcc_version.m4
+ Fix to work with OpenBSD's sed.
+
+2013-03-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ALAC/alac_encoder.c
+ Patch from Michael Pruett (author of libaudiofile) to add correct byte
+ swapping for the mChannelLayoutTag field.
+
+2013-03-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/bugs.html
+ Bugs should bt reported on the github issue tracker.
+
+2013-02-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Improve sanitization of FLAC_CFLAGS value.
+
+2013-02-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/Makefile.am
+ Call python interpreter instead of using '#!' in script. Thanks to Jan
+ Stary for reporting this.
+
+ * doc/index.html doc/FAQ.html
+ Make internal links relative. Patch from Jan Stary.
+
+2013-02-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/test_endswap.def src/test_endswap.tpl
+ Add tests for psf_put_be32() and psf_put_be64().
+
+ * src/sfendian.h src/test_endswap.(def|tpl)
+ Add functions psf_get_be(16|32|64) with tests.
+ These are needed for platforms where un-aligned accesses cause bus faults.
+
+ * src/ALAC/ag_enc.c src/ALAC/alac_decoder.c
+ Replace all un-aligned accesses with safe alternatives.
+ Closes: https://github.com/erikd/libsndfile/issues/19
+
+2013-02-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sfendian.h
+ Add big endian versions of H2BE_16 and H2BE_32.
+
+2013-02-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ALAC/
+ Replace Apple endswap routines with ones from libsndfile.
+
+ * merge from libsndfile-cart repo
+ Add ability to set and get a cart chunk with WAV and RF64.
+ Orignal patch by Chris Roberts <c.roberts@csrfm.com> required a number of
+ tweaks.
+
+2013-02-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Bump SF_HEADER_LEN from 8192 to 12292, the value it was in the 1.0.25
+ release.
+
+2013-02-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/alac.c
+ Fix segfault when encoding 8 channel files.
+ Closes: https://github.com/erikd/libsndfile/issues/30
+
+2013-02-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ALAC/EndianPortable.c
+ Fall back to compiler's __BYTE_ORDER__ for endian-ness detection.
+
+2013-02-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/common.h src/ima_adpcm.c src/ms_adpcm.c src/paf.c
+ Drop tests for and #ifdef hackery for C99 struct flexible array feature.
+ libsndfile assumes the compiler supports most of the ISO C99 standard.
+
+ * src/alac.c
+ Fix valgrind invalid realloc. Reported by nu774.
+ Closes: https://github.com/erikd/libsndfile/issues/31
+
+2013-02-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/alac.c
+ The 'pakt' chunk header should now be written correctly.
+ Closes: https://github.com/erikd/libsndfile/issues/24
+
+ * configure.ac Makefile.am
+ Use PKG_INSTALLDIR when it exists. Suggestion from Christoph Thompson.
+ Closes: https://github.com/erikd/libsndfile/pull/28
+
+2013-02-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/caf.c
+ Read the ALAC 'pakt' header and stash the values.
+
+ * src/sfendian.h
+ Add functions psf_put_be64() and psf_put_be32().
+
+ * src/alac.c
+ Start work on filling on the 'pakt' chunk header.
+
+2013-02-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Add missing opening <P> tag.
+
+ * src/alac.c
+ Increase ALAC_BYTE_BUFFER_SIZE to 82000.
+
+2013-01-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Improve question #8.
+
+2013-01-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ogg_opus.c
+ Add skeleton implementation so someone else can run with it.
+
+2012-12-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/dwd.c src/rx2.c src/txw.c
+ Fix for compiling when configured with --enable-experimental. Thanks to
+ Eric Wong for reporting this.
+
+2012-12-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac programs/sndfile-play.c
+ OS X 10.8 uses a different audio API to previous versions.
+ Fix compile failure on by disabling sndfile-play on this version.
+ Someone needs to supply code for the new API.
+
+2012-11-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Octave/Makefile.am Octave/octave_test.sh
+ Fix 'make distcheck'.
+
+2012-10-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * M4/octave.m4
+ Relax constraints on Octave version.
+
+2012-10-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/utils.tpl
+ Improve compare_*_or_die() functions.
+
+ * src/command.c
+ Fix bug reported by Keiler Florian. When reading short or int data from a
+ file containing float data, and setting SFC_SET_SCALE_FLOAT_INT_READ to
+ SF_TRUE would fail 3, 5, 7 and other channels counts. Problem was that
+ psf_calc_signal_max() was not calculating the signal max correctly.
+ Calculation of the signal max was failing because it was trying to read
+ a sample count that was not an integer multiple of the channel count.
+
+ * tests/channel_test.c tests/Makefile.am tests/test_wrapper.sh.in
+ Add test for the above.
+
+2012-09-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.hh
+ Added a constructor to allow the use of SF_VIRTUAL_IO. Patch from
+ DannyDaemonic : https://github.com/erikd/libsndfile/pull/20
+
+2012-08-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/octave.html
+ Fix link to octave.sourceforge.net. Thanks to IOhannes m zmoelnig.
+
+ * src/mat5.c
+ Allow reading of mat5 files without a specified sample rate (default to
+ 44.1kHz). Thanks to IOhannes m zmoelnig.
+
+2012-08-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/paf.c
+ Error out if channel count is zero. Bug report from William ELla via
+ launchpad:
+ https://bugs.launchpad.net/ubuntu/+source/libsndfile/+bug/1036831
+
+2012-08-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac programs/sndfile-play.c
+ Patch from Ricci Adams to use OSX's AudioQueues on OSX 10.7 and greater.
+
+2012-07-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/common.c
+ Accept "ogg" as a file extention for Ogg/Vorbis files.
+
+2012-06-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c
+ Make sure any previously allocated FLAC stream encoder and stream decoder
+ objects are deleted before a new one is allocated.
+
+2012-06-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/utils.tpl
+ Rename gen_lowpass_noise_float() to gen_lowpass_signal_float() and add a
+ sine wave component so that different FLAC compression levels can be
+ tested.
+
+ * src/sndfile.h.in doc/command.html
+ Add SFC_SET_COMPRESSION_LEVEL and document it.
+
+ * src/sndfile.c
+ Catch SFC_SET_VBR_ENCODING_QUALITY command and implement it as the inverse
+ of SFC_SET_COMPRESSION_LEVEL.
+
+ * src/ogg_vorbis.c src/flac.c
+ Implement SFC_SET_COMPRESSION_LEVEL command.
+
+ * tests/test_wrapper.sh.in tests/compression_size_test.c
+ Use the compression_size_test on FLAC as well.
+
+2012-06-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/
+ Rename vorbis_test.c -> compression_size_test.c so it can be extended to
+ test FLAC as well.
+
+2012-06-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/broadcast.c
+ Fix a bug where a file with a 'bext' chunk with a zero length coding
+ history field would get corrupted when the file was closed.
+ Reported by Paul Davis of the Ardour project.
+
+ * src/test_broadcast_var.c
+ Add a test for the above.
+
+2012-05-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ sf_format_check: For SF_FORMAT_AIFF, reject endian-ness setttings for
+ non-PCM formats.
+
+2012-04-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fix regression in handling of odd length SSND chunks.
+ Thanks Olivier Tristan for the example file.
+
+ * src/aiff.c src/wav.c
+ Exit parser loop when marker == 0.
+
+2012-04-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Fix text. Thanks to Richard Collins.
+
+2012-03-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/caf.c
+ Exit parse loop if the marker is zero. Pass jump offsets as size_t instead
+ of int.
+
+2012-03-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/alac.c
+ Fix segfault when decoding CAF/ALAC file with more than 4 channels.
+ Fixes github issue #8 reported by Charles Van Winkle.
+
+2012-03-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Change 'typedef SF_CHUNK_ITERATOR { ... } SF_CHUNK_ITERATOR' into 'struct
+ SF_CHUNK_ITERATOR { ... }' to prevent older compilers from complaining of
+ re-typedef-ing of SF_CHUNK_ITERATOR.
+
+ * configure.ac
+ Fix if test for empty $prefix.
+
+2012-03-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c tests/chunk_test.c
+ Reworking of custom chunk handling code.
+ - Memory for the iterator is now attached to the SF_PRIVATE struct and
+ freed one sf_close().
+ - Rename sf_create_chunk_iterator() -> sf_get_chunk_iterator().
+ - Each SNDFILE handle never has more than one SF_CHUNK_ITERATOR handle.
+
+ * tests/string_test.c
+ Fix un-initialised char buffer.
+
+2012-03-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c tests/chunk_test.c
+ Add improved handling of custom chunk getting and settings. Set of patches
+ from IOhannes m zmoelnig submitted via github pull request #6.
+
+ * src/alac.c
+ Fix calculated frame count for files with zero block length.
+
+2012-03-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/avr.c
+ Remove double assignment to psf->endian. Thanks Kao Dome.
+
+ * src/gsm610.c
+ Fix clearing of buffers. Thanks Kao Dome.
+
+ * src/paf.c
+ Remove duplicate code. Thanks Kao Dome.
+
+ * src/test_strncpy_crlf.c
+ Fix minor error in test. Thanks Kao Dome.
+
+ * src/common.h src/*.c
+ Fix a bunch of valgrind errors.
+
+2012-03-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fix typo in error string 'Uknown' -> 'Unknown'.
+
+ * tests/fix_this.c
+ Fix potential int overflow.
+
+2012-03-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/alac.c
+ Fix decoding of last block so that the decode length is not a multiple of
+ the block length. Fixes github issue #4 reported by Charles Van Winkle.
+
+ * src/sfconfig.h src/sfendian.h
+ Fix for MinGW cross compiling. Use '#if (defined __*66__)' instead of
+ '#if __*86__' because the MinGW header use '#ifdef __x86_64__'.
+
+2012-03-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ALAC/ src/alac.c
+ Unify the interface between libsndfile and Apple ALAC codec. Regardless of
+ file bit width samples are now passed between the two as int32_t that are
+ justified towards the most significant bit. Without this modification, 16
+ conversion functions would have been needed between the libsndfile (short,
+ int, float, double) types and the ALAC types (16, 20, 24 and 32 bit). With
+ this mod, only 4 are needed.
+
+ * tests/floating_point_test.tpl tests/write_read_test.(def|tpl)
+ Add tests for 20 and 24 bit ALAC/CAF files.
+
+ * src/command.c
+ Add ALAC/CAF to the SFC_GET_FORMAT_* commands. Fixes github issue #5.
+
+ * configure.ac
+ Only use automake AM_SLIENT_RULES where supported. Thanks Dave Yeo.
+
+ * tests/pipe_test.tpl
+ Disable tests on OS/2. Thanks Dave Yeo.
+
+2012-03-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/sfconfig.h src/sfendian.h
+ For GCC, use inline assembler for endian swapping. This should work with
+ older versions of GCC like the one currently used in OS/2.
+
+2012-03-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/alac.c
+ Make sure temp file gets opened in binary mode.
+
+ * src/alac.c src/common.c src/common.h
+ Fix function alac_write16_d().
+
+ * tests/floating_point_test.tpl
+ Add tests for 16 bit ALAC/CAF.
+
+ * src/alac.c src/common.c src/common.h
+ Add support for 32 bit ALAC/CAF files.
+
+ * tests/floating_point_test.tpl tests/write_read_test.tpl
+ Add tests for 32 bit ALAC/CAF files.
+
+2012-03-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/
+ Refactor chunk storage so it work on big as well as little endian CPUs.
+
+ * tests/chunk_test.c
+ Clean up error messages.
+
+ * src/sfendian.h src/*.c
+ Rename endian swapping macros and add ENDSWAP_64 and BE2H_64.
+
+ * configure.ac
+ Detect presence of <x86intrin.h> header file.
+
+ * src/sfendian.h
+ Use <x86intrin.h> intrinsics (ie for MinGW) when <byteswap.h> is not
+ present.
+ Make ENDSWAP_64() work with i686-w64-mingw32 compiler.
+
+ * src/ALAC/EndianPortable.c
+ Add support for __powerpc__.
+
+ * src/sfconfig.h
+ Make sure HAVE_X86INTRIN_H is either 1 or 0.
+
+2012-03-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ALAC/*
+ Big dump of code for Apple's ALAC file format. The copyyright to this code
+ is owned by Apple who have released it under an Apache style license. A few
+ small modifications were made to allow this to be integrated into libsndfile
+ but unfortunately the history of those changes were lost because they were
+ developed in a Bzr tree and during that time libsndfile moved to Git.
+
+ * src/alac.c src/caf.c src/common.[ch] src/Makefile.am src/sndfile.h.in
+ src/sndfile.c
+ Hook new ALAC codec in.
+
+ * programs/sndfile-convert.c
+ Add support for alac codec.
+
+ * tests/write_read_test.tpl
+ Expand tests to cover ALAC.
+
+2012-03-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c src/wav.c
+ Fix a couple of regressions from version 1.0.25.
+
+2012-03-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/strings.c
+ Minor refactoring. Make sure that the memory allocation size if always > 0
+ to avoid undefined behaviour.
+
+2012-02-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/chunk.c
+ Fix buffer overrun introduced in recently added chunk logging. This chunk
+ logging has not yet made it to a libsndfile release version. Thanks to
+ Olivier Tristan for providing an example file.
+
+ * src/wav.c
+ Fix handling of odd sized chunks which was causing the parser to lose some
+ chunks. Thanks to Olivier Tristan for providing an example file.
+
+2012-02-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/util.tpl
+ Used gnu_printf format checking with mingw-w64 compiler.
+
+ * tests/header_test.tpl
+ Printf format fixes.
+
+2012-02-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * M4/extra_pkg.m4
+ Update PKG_CHECK_MOD_VERSION macro to add an AC_TRY_LINK step. This fix
+ allows the configure process to catch attempts to link incompatible
+ libraries. For example, linking 32 bit version of eg libFLAC to a 64 bit
+ version of libsndfile will now fail. Similarly, when cross compiling
+ libsndfile from Linux to Windows linking the Linux versions of a library
+ to the Windows version of libsndfile will now also fail.
+
+ * src/sndfile.h.in src/sndfile.c src/common.h src/create_symbols_file.py
+ Add API function sf_current_byterate().
+
+ * src/dwvw.c src/flac.c src/ogg_vorbis.c src/sds.c
+ Add codec specific handlers for current byterate.
+
+ * tests/floating_point_test.tpl
+ Add initial test for sf_current_byterate().
+
+2012-02-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.[ch]
+ Add function psf_decode_frame_count().
+
+ * src/dwvw.c
+ Fix a termnation bug that caused the decoder to go into an infinite loop.
+
+2012-02-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fix a regression in the WAV header parser. Thanks to Olivier Tristan for
+ bug report and the example file.
+
+2012-02-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Return error when SF_BROADCAST_INFO struct has bad coding_history_size.
+ Thanks to Alex Weiss for the report.
+
+2012-02-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/au.c src/flac.c src/g72x.c src/ogg_vorbis.c src/wav_w64.c
+ Don't fake psf->bytewidth values.
+
+2012-02-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/string_test.c
+ Fix valgrind warnings.
+
+ * src/common.h src/sndfile.c src/strings.c
+ Make string storage dynamically allocated.
+
+ * src/sndfile.c
+ Add extra validation for custom chunk handling.
+
+2012-02-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Improve handlling unknown chunk types. Thanks to Olivier Tristan for sending
+ example files.
+
+ * src/utils.tpl
+ Add GCC specific testing for format string parameters for exit_if_true().
+
+ * tests/*.c tests/*.tpl
+ Fix all printf format warnings.
+
+ * programs/sndfile-play.c
+ Remove un-needed OSX include <Carbon.h>. Thanks jamesfmilne for github
+ issue #3.
+
+ * tests/chunk_test.c
+ Extend custom chunk test.
+
+2012-02-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Jump over some more chunk types while parsing.
+
+2012-02-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/strings.c
+ Change way strings are stored in SF_PRIVATE in preparation for dynamically
+ allocating the storage.
+
+2012-02-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src*.c
+ Improve encapsulation of string data in SF_PRIVATE.
+
+2012-02-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src*.c
+ Remove the buffer union from SF_PRIVATE. Most uses of this have been
+ replaced with a BUF_UNION that is allocated on the stack.
+
+2012-01-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src*.c
+ Rename logbuffer field of SF_PRIVATE to parselog and reduce its size.
+ Put the parselog buffer and the index inside a struct within SF_PRIVATE.
+
+2012-01-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Fix typo, FLAC_CLFAGS -> FLAC_CFLAGS. Thanks to Jeremy Friesner.
+
+2012-01-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/ogg.c
+ Fix misleading error message when trying to create an SF_FORMAT_OGG file
+ with anything other than SF_FORMAT_FILE. Thanks to Charles Van Winkle for
+ the bug report. Github issue #1.
+
+2012-01-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/wav.c
+ Allow files opened in RDWR mode with string data in the tailer to be
+ extended. Thanks to Bodo for the patch.
+
+ * tests/string_test.c
+ Add tests for the above changes (patch from Bodo).
+
+2012-01-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Refactor reading of chunk size and use of psf_store_read_chunk().
+
+ * src/(caf|wav).c
+ Correct storing of chunk offset.
+
+2012-01-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c src/wav.c src/common.h
+ Refactor common code into src/common.h.
+
+ * src/caf.c
+ Make custom chunks work for CAF files.
+
+ * tests/chunk_test.c tests/test_wrapper.sh.in
+ Test CAF files with custom chunks.
+
+ * src/sndfile.c
+ Prevent psf->codec_close() being called more than once.
+
+2012-01-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-cmp.c
+ Catch the case where the second file has more frames than the first.
+
+2012-01-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/create_symbols_file.py
+ Add sf_set_chunk/sf_get_chunk_size/sf_get_chunk_data.
+
+2011-12-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/chunk_test.c tests/Makefile.am
+ New test for custom chunks.
+
+ * src/aiff.c src/chunk.c src/common.h src/sndfile.c
+ Make custom chunks work on AIFF files.
+
+ * src/wav.c
+ Make custom chunks work on WAV files (includes refactoring).
+
+2011-11-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/common.h src/sndfile.c
+ Start working on setting/getting chunks.
+
+2011-11-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/binheader_writef_check.py src/create_symbols_file.py
+ Make it work for Python 2 and 3. Thanks Michael.
+
+2011-11-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * libsndfile.spec.in
+ Change field name 'URL' to 'Url'.
+
+ * src/sndfile.h.in
+ Add SF_SEEK_SET/CUR/END.
+
+2011-11-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/id3.c
+ Fix a stack overflow that can occur when parsing a file with multiple
+ ID3 headers which would cause libsndfile to go into an infinite recursion
+ until it blew the stack. Thanks to Anders Svensson for supplying an example
+ file.
+
+2011-10-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/double64.c src/float32.c src/common.h
+ Make (float32|double_64)_(be|le)_read() functions const correct.
+
+2011-10-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sfendian.h
+ Minor tweaking of types. Cast to ptr to correct final type rather void*.
+
+ * programs/sndfile-play.c tests/utils.tpl
+ Fix compiler warnings with latest MinGW cross compiler.
+
+2011-10-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Use the non-deprecated resource fork name on OSX. Thanks to Olivier Tristan.
+
+2011-10-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Jump over the 'olym' chunks when parsing.
+
+2011-10-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.tpl
+ Remove windows only truncate() implementation.
+
+2011-09-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sd2.c src/sndfile.c
+ Make sure 23 bit PCM SD2 files are readable/writeable.
+
+ * tests/write_read_test.tpl
+ Add tests for 32 bit PCM SD2 files.
+
+2011-08-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Use AC_SYS_LARGEFILE instead of AC_SYS_EXTRA_LARGEFILE as suggested by
+ Jan Willies.
+
+2011-08-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac Makefile.am
+ Move ACLOCAL_AMFLAGS setup to Makefile.am.
+
+2011-07-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/command.html
+ Merge two separate blocks of SFC_SET_VBR_ENCODING_QUALITY documentation.
+
+ * src/paf.c
+ Replace ppaf24->samplesperblock with a compile time constant.
+
+2011-07-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ogg_vorbis.c
+ Fix return value of SFC_SET_VBR_ENCODING_QUALITY command.
+
+ * doc/command.html
+ Document SFC_SET_VBR_ENCODING_QUALITY, SFC_GET/SET_LOOP_INFO and
+ SFC_GET_INSTRUMENT.
+
+ * NEWS README configure.ac doc/*.html
+ Updates for 1.0.25.
+
+2011-07-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sfconfig.h
+ Add handling for HAVE_SYS_WAIT_H.
+
+ * Makefile.am src/Makefile.am tests/Makefile.am
+ Add 'checkprograms' target.
+
+2011-07-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/sndfile.c
+ Purge SF_ASSERT macro. Use standard C assert instead.
+
+ * src/paf.c src/common.h src/sndfile.c
+ Fix for Secunia Advisory SA45125, heap overflow (heap gets overwritten with
+ byte value of 0) due to integer overflow if PAF file handler.
+
+ * src/ima_adpcm.c src/ms_adpcm.c src/paf.c
+ Use calloc instead of malloc followed by memset.
+
+ * tests/utils.tpl
+ Clean up use of memset.
+
+2011-07-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ogg.c
+ Fix log message.
+
+ * tests/format_check_test.c
+ Fix compiler warnings.
+
+2011-07-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fix error message for erro code SFE_ZERO_MINOR_FORMAT.
+
+ * tests/format_check_test.c
+ Add a test to for SF_FINFO format field validation.
+
+ * src/ogg.c src/ogg_vorbis.c src/ogg.h src/ogg_pcm.c src/ogg_speex.c
+ src/common.h src/Makefile.am
+ Move vorbis specific code to ogg_vorbis.c, add new files for handling PCM
+ and Speex codecs in an Ogg container. The later two are only enabled with
+ ENABLE_EXPERIMENTAL_CODE config variable.
+
+2011-06-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/strings.c
+ Clean up and refactor storage of SF_STR_SOFTWARE.
+
+2011-06-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in doc/api.html
+ Fix definition of SF_STR_LAST and update SF_STR_* related docs. Thanks to
+ Tim van der Molen for the patch.
+
+2011-06-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-interleave.c
+ Fix handling of argc. Thanks to Marius Hennecke.
+
+ * src/wav_w64.c
+ Accept broken WAV files with blockalign == 0. Thanks to Olivier Tristan for
+ providing example files.
+
+ * src/wav.c
+ Jump over 'FLLR' chunks.
+
+2011-06-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Fix -Wundef warning due to ENABLE_SNDFILE_WINDOWS_PROTOTYPES.
+
+ * configure.ac
+ Add -Wundef to CFLAGS.
+
+ * src/ogg.c
+ Fix -Wunder warning.
+
+2011-05-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Use int64_t instead of off_t when they are the same size.
+
+ * src/Makefile.am tests/Makefile.am
+ Use check_PROGRAMS instead of noinst_PROGRAMS where appropriate.
+
+2011-05-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Don't allow unknown and/or un-editable chunks to prevent the file from being
+ opened in SFM_RDWR mode.
+
+2011-04-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/format_check_test.c
+ Fix segfault in test program.
+
+2011-04-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/format_check_test.c
+ New test program to check to make sure that sf_open() and sf_check_format()
+ agree as to what is a valid program.
+
+ * tests/Makefile.am tests/test_wrapper.sh.in
+ Hook into build and test runner.
+
+ * src/sndfile.c
+ Fix some sf_format_check() problems. Thanks to Charles Van Winkle for the
+ notification.
+
+2011-04-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/caf.c
+ Add validation to size of 'data' chunk and fix size of written 'data'
+ chunk. Thanks to Michael Pruett for reporting this.
+
+2011-03-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/* tests/* programs/*
+ Fix a bunch of compiler warnings with gcc-4.6.
+
+2011-03-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/util.tpl
+ Add NOT macro to util.h.
+
+ * src/strings.c
+ Fix handling of SF_STR_SOFTWARE that resulted in a segfault due to calling
+ strlen() on an unterminated string. Thanks to Francois Thibaud for reporting
+ this problem.
+
+ * tests/string_test.c
+ Add test for SF_STR_SOFTWARE segfault bug.
+
+ * configure.ac
+ Sanitize FLAC_CFLAGS value supplied by pkg-config which returns a value of
+ '-I${includedir}/FLAC'. However FLAC also provides an include file
+ <assert.h> which clashes with the Standard C header of the same name. The
+ solution is strip the 'FLAC' part off the end and include all FLAC headers
+ as <FLAC/header.h>.
+
+ * configure.ac src/Makefile.am
+ Use non-recursive make in src/ directory.
+
+2011-03-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * NEWS README docs/*.html
+ Updates for 1.0.24 release.
+
+2011-03-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Fix up usage of sed (should not assume GNU sed).
+
+ * M4/add_(c|cxx)flags.m4
+ Test flags in isolation.
+
+ * tests/cpp_test.cc
+ Fix a broken test (test segfaults). Report by Dave Flogeras.
+
+2011-03-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/common.[ch]
+ Add function program_name() which returns the program name minus the path
+ from argv [0].
+
+ * programs/*.c programs/Makefile.am
+ Use program_name() where appropriate. Fix build.
+
+2011-03-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ For u-law and A-law files, write an 18 byte 'fmt ' chunk instead of a 16
+ byte one. Win98 accepts files with a 16 but not 18 byte 'fmt' chunk. Later
+ version accept 18 byte but not 16 byte.
+
+2011-03-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Add examples for question 12.
+
+ * doc/libsndfile.css.in
+ Add tweaks for h4 element.
+
+ * doc/api.html
+ Add documentation for virtual I/O functionality. Thanks to Uli Franke.
+
+ * tests/util.tpl
+ Add static inline functions sf_info_clear() and sf_info_setup().
+
+ * tests/(alaw|dwvw|ulaw)_test.c
+ Use functions sf_info_clear() and sf_info_setup().
+
+2011-03-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Fail more gracefully if pkg-config is missing. Suggestion from Brian
+ Willoughby.
+
+2011-02-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Use size_t instead of int for size params with varargs.
+
+2011-02-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Update supported platforms with more Debian platforms and Android.
+
+2011-01-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.hh
+ Add an LPCWSTR version of the SndfileHandle constructor to the SndfileHandle
+ class definition. Thanks to Eric Eizenman for pointing out this was missing.
+
+ * tests/cpp_test.cc
+ Add test for LPCWSTR version of the SndfileHandle constructor.
+
+2011-01-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-play.c
+ Remove cruft.
+
+2010-12-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.hh
+ Add methods rawHandle() and takeOwnership(). Thanks to Tim Blechmann for
+ the patch.
+
+ * tests/cpp_test.cc
+ Add tests for above two methods. Also supplied by Tim Blechmann.
+
+2010-11-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html
+ Add mention of use of sf_strerror() when sf_open() fails.
+
+2010-11-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Make TYPEOF_SF_COUNT_T int64_t where possible. This may fix problems where
+ people are compiling on a 64 bit system with the GCC -m32 flag.
+
+ * src/sndfile.h.in
+ Fix comments on sf_count_t.
+
+2010-10-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Handle non-zero offset field in SSND chunk. Thanks to Michael Chinen.
+
+2010-10-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Sed fix for FreeBSD. Thanks Tony Theodore.
+
+2010-10-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * shave.in M4/shave.m4
+ Fix shave invocation of windres compiler. Thanks Damien Lespiau (upstream
+ shave author).
+
+ * configure.ac M4/shave.m4 shave-libtool.in shave.in
+ Switch from shave to automake-1.11's AM_SILENT_RULES.
+
+2010-10-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * shave-libtool.in shave.in
+ Sync to upstream version.
+
+ * src/rf64.c
+ More work to make the parser more robust and accepting of mal-formed files.
+
+2010-10-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Add functions psf_strlcpy() and psf_strlcat().
+
+ * src/broadcast.c src/sndfile.c src/strings.c src/test_main.c
+ src/test_main.h src/test_strncpy_crlf.c
+ Use functions psf_strlcpy() and psf_strlcat() as appropriate.
+
+ * tests/string_test.c
+ Add tests for SF_STR_GENRE and SF_STR_TRACKNUMBER.
+
+ * src/rf64.c
+ Fix size of 'ds64' chunk when writing RF64.
+
+2010-10-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/*.c
+ Add the libsndfile version to the usage message of all programs.
+
+2010-10-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/version-metadata.rc.in src/Makefile.am
+ Add version string resources to the windows DLL.
+
+ * doc/api.html
+ Update to add missing SF_FORMAT_* values. Closed Debian bug #545257.
+
+ * NEWS README configure.ac doc/*.html
+ Updates for 1.0.23 release.
+
+2010-10-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/pedantic-header-test.sh.in
+ Handle unusual values of CC environment variable.
+
+ * src/rf64.c
+ Minor tweaks and additional sanity checking.
+
+ * src/Makefile.am src/binheader_writef_check.py
+ Use python 2.6.
+
+2010-10-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.hh
+ Add a missing 'inline' before a constructor defintion.
+
+2010-10-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Add macro NOT.
+
+ * src/rf64.c
+ Minor tweaks.
+
+ * Makefile.am */Makefile.am
+ Add *~ to CLEANFILES.
+
+2010-10-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fix a typo in the error string for SFE_OPEN_PIPE_RDWR. Thanks to Charles
+ Van Winkle for the report.
+
+2010-10-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c src/ogg.c src/sndfile.h.in src/strings.c src/wav.c
+ Add ability to read/write tracknumber and genre to flac/ogg/wav files.
+ Thanks to Matti Nykyri for the patch.
+
+ * src/common.h src/broadcast.c src/strings.c
+ Add function psf_safe_strncpy() and use where appropriate.
+
+2010-10-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * NEWS README configure.ac doc/*.html
+ Updates for 1.0.22 release.
+
+2010-10-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/broadcast.c src/rf64.c src/sndfile.c src/wav.c
+ Rewrite of SF_BROADCAST_INFO handling.
+
+ * src/test_broadcast_var.c tests/command_test.c
+ Tweak SF_BROADCAST_INFO tests.
+
+ * src/test_broadcast_var.c
+ Fix OSX stack check error.
+
+2010-09-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sds.c
+ Set sustain_loop_end to 0 as suggested by Brian Lewis.
+
+2010-09-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sds.c
+ Make sure the correct frame count gets written into the header.
+
+ * tests/write_read_test.tpl
+ Don't allow SDS files to have a long frame count.
+
+2010-09-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sds.c
+ Apply a pair of patches from Brian Lewis to fix the packet number location
+ and the checksum.
+
+2010-09-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c src/file_io.c src/ogg.c src/rf64.c src/sndfile.c
+ src/strings.c src/test_audio_detect.c src/test_strncpy_crlf.c
+ src/wav.c tests/pcm_test.tpl
+ Fix a bunch of minor issues found using static analysis.
+
+2010-08-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/test_broadcast_var.c
+ New file containing tests for broadcast_set_var().
+
+ * src/Makefile.am src/test_main.[ch]
+ Hook test_broadcast_var.c into tests.
+
+2010-08-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/broadcast.c src/common.(c|h)
+ Move function strncpy_crlf() to src/common.c so the function can be tested
+ in isolation.
+
+ * src/test_strncpy_crlf.c
+ New file.
+
+ * src/Makefile.am src/test_main.[ch]
+ Hook test_strncpy_crlf.c into tests.
+
+2010-08-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Move code around to make comments make sense.
+
+ * src/broadcast.c
+ Add debugging code that is disabled by default.
+
+2010-08-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c
+ When the file meta data says the file has zero frames set psf->sf.frames
+ to SF_COUNT_MAX. Fixes Debian bug #590752.
+
+ * programs/sndfile-info.c
+ Print 'unknown' if frame count == SF_COUNT_MAX.
+
+2010-06-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Only support writing mono SVX files. Multichannel SVX files are not
+ interleaved and there is no support infrastructure to cache and write
+ multiple channels to create a non-interleaved file.
+
+ * src/file_io.c
+ Don't call close() on a file descriptor of -1. Thanks to Jeremy Friesner
+ for the bug report.
+
+2010-06-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Add macro SF_ASSERT.
+
+ * src/sndfile.c
+ Use SF_ASSERT to ensure sizeof (sf_count_t) == 8.
+
+ * src/svx.c
+ Add support for reading and writing stereo SVX files.
+
+2010-05-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ When compiling with x86_64-w64-mingw32-gcc link with -static-libgcc flags.
+
+ * programs/common.c programs/sndfile-metadata-set.c
+ Update metadata after the audio data is copied. Other minor fixes. Patch
+ from Marius Hennecke.
+
+2010-05-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/nist.c
+ Fix a regression reported by Hugh Secker-Walker.
+
+ * src/api.html
+ Add comment about sf_open_fd() not working on Windows if the application
+ and the libsndfile DLL are linked to different versions of the Microsoft
+ C runtime DLL.
+
+2010-04-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/pedantic-header-test.sh.in
+ Fix 'make distcheck'.
+
+2010-04-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/pedantic-header-test.sh.in
+ New file to test whether sndfile.h can be compiled with gcc's -pedantic
+ flag.
+
+ * configure.ac tests/test_wrapper.sh.in
+ Hook pedantic-header-test into test suite.
+
+ * src/sndfile.h.in
+ Fix -pedantic warning.
+
+2010-04-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-salvage.c programs/Makefile.am
+ New program to salvage the audio data from WAV/WAVEX/AIFF files which are
+ greater than 4Gig in size.
+
+2010-04-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-convert.c
+ Fix valgrind warning.
+
+2010-04-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-cmp.c
+ When files differ in the PCM data, also print the difference offset.
+ Minor cleanup.
+
+2010-03-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Don't use the 'twos' marker for 24 and 32 bit PCM, use 'in24' and 'in32'
+ instead. Thanks to Paul Davis (Ardour) for this suggestion.
+
+2010-02-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Clean up configure report.
+
+ * tests/utils.tpl
+ Add functions test_read_raw_or_die and test_write_raw_or_die.
+
+ * tests/rdwr_test.(def|tpl) tests/Makefile.am
+ Add new test program and hook into build.
+
+ * src/sndfile.c
+ Fix minor issues with sf_read/write_raw(). Bug reported by Milan Křápek.
+
+ * tests/test_wrapper.sh.in
+ Add rdwr_test to the test wrapper script.
+
+2010-02-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Remove -fpascal-strings from OSX's OS_SPECIFIC_CFLAGS.
+
+ * programs/common.[ch] programs/sndfile-metadata-set.c
+ Apply a patch from Robin Gareus allowing the setting of the time reference
+ field of the BEXT chunk.
+
+2010-02-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ima_adpcm.c
+ Add a fix from Jonatan Liljedahl to handle predictor overflow when decoding
+ IMA4.
+
+2010-01-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.hh
+ Add a constructor which takes an existing file descriptor and then calls
+ sf_open_fd(). Patch from Sakari Bergen.
+
+2010-01-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-deinterleave.c programs/sndfile-interleave.c
+ Improve usage messages.
+
+2010-01-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/id3.c src/Makefile.am
+ Add new file src/id3.c and hook into build.
+
+ * src/sndfile.c src/common.h
+ Detect and skip and ID3 header at the start of the file.
+
+2010-01-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/common.c
+ Fix update_strings() copyright, comment, album and license are correctly
+ written. Thanks to Todd Allen for reporting this.
+
+ * man/Makefile.am
+ Change GNU makeism to something more widely supported. Thanks to Christian
+ Weisgerber for reporting this.
+
+ * configure.ac programs/Makefile.am programs/sndfile-play.c
+ Apply patch from Christian Weisgerber and Jacob Meuserto add support for
+ OpenBSD's sndio.
+
+2010-01-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html
+ Discourage the use of sf_read/write_raw().
+
+2009-12-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Test for Unix pipe() and waitpid() functions.
+
+ * src/sfconfig.h tests/pipe_test.tpl
+ Disable pipe_test if pipe() and waitpid() aren't available.
+
+2009-12-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/Makefile.am src/create_symbols_file.py
+ src/make-static-lib-hidden-privates.sh
+ Change name of generated file src/Symbols.linux to Symbols.gnu-binutils and
+ and use the same symbols file for other systems which use GNU binutils like
+ Debian's kfreebsd.
+
+ * M4/shave.m4 shave.in
+ Update shave files from upstream.
+
+2009-12-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * man/sndfile-metadata-get.1
+ Fix typo.
+
+ * man/sndfile-interleave.1 man/Makefile.am
+ New man page.
+
+2009-12-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ogg.c
+ When decoding to short or int, clip the decoded signal to [-1.0, 1.0] if
+ its too hot. Thanks to Dmitry Baikov for suggesting this.
+
+ * NEWS README doc/*.html
+ Updates for 1.0.21.
+
+2009-12-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-jackplay.c man/sndfile-jackplay.1
+ Remove these which will now be in found in the sndfile-tools package.
+
+ * programs/Makefile.am man/Makefile.am
+ Remove build rules for sndfile-jackplay.
+
+ * configure.ac
+ Remove detection of JACK Audio Connect Kit.
+
+ * programs/sndfile-concat.c man/sndfile-concat.1
+ Add new program with man page.
+
+ * man/Makefile.am programs/Makefile.am
+ Hook sndfile-concat into build system.
+
+2009-12-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/error_test.c
+ Don't terminate when sf_close() returns zero in error_close_test().
+ It seems that Windows 7 behaves differently from earlier versions of
+ Windows.
+
+2009-12-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac M4/*.m4
+ Rename all custom macros from AC_* to MN_*.
+
+ * programs/sndfile-interleave.c
+ Make it actually work.
+
+2009-12-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/*.html configure.ac
+ Corrections and clarifications courtesy of Robin Forder.
+
+ * programs/sndfile-convert.c programs/common.[ch]
+ Move some code from convert to common for reuse.
+
+ * programs/sndfile-interleave.c programs/sndfile-interleave.c
+ Add new programs sndfile-interleave and sndfile-deinterleave.
+
+ * programs/Makefile.am
+ Hook new programs into build.
+
+2009-12-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/create_symbols_file.py tests/stdio_test.c tests/win32_test.c
+ Minor OS/2 tweaks as suggested by David Yeo.
+
+ * tests/multi_file_test.c
+ Fix file creation flags on windows. Thanks to Bruce Sharpe.
+
+ * src/sf_unistd.h
+ Set all group and other file create permssions to zero.
+
+ * tests/win32_test.c
+ Add a new test.
+
+2009-11-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/print.css doc/*.html
+ Add a print stylesheet and update all HTML documents to reference it.
+ Thanks to Aditya Bhargava for suggesting this.
+
+ * doc/index.html
+ Minor corrections.
+
+2009-11-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * sndfile.pc.in
+ Add a Libs.private entry to assist with static linking.
+
+2009-11-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/make-static-lib-hidden-privates.sh src/Makefile.am
+ Add a script to hide all non-public symbols in the libsndfile.a static
+ library.
+
+2009-11-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/locale_test.c
+ Correct usage of ENABLE_SNDFILE_WINDOWS_PROTOTYPES.
+
+2009-11-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/windows.c
+ Correct usage of ENABLE_SNDFILE_WINDOWS_PROTOTYPES.
+
+2009-11-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-convert.c
+ Allow the program to read from stdin by specifying '-' on the command line
+ as the input file.
+
+ * src/sndfile.h.in
+ Hash define ENABLE_SNDFILE_WINDOWS_PROTOTYPES to 1 for greater safety.
+
+ * tests/virtual_io_test.c
+ Add a PAF/PCM_24 test and verify the file length is not negative
+ immediately after openning the file for write.
+
+2009-10-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ When writing loop lengths, adjust the end position by one to make up for
+ Microsoft's screwed up spec. Thanks to Olivier Tristan for the patch.
+
+2009-10-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c
+ Apply patch from Uli Franke allowing FLAC files to be encoded at any sample
+ rate.
+
+2009-10-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/nist.c
+ Fix parsing of odd ulaw encoded file provided by Jan Silovsky.
+
+ * configure.ac
+ Insist on libvorbis >= 1.2.3. Earlier verions have bugs that cause the
+ libsndfile test suite to fail on MIPS, PowerPC and others.
+ See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549899
+
+2009-10-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * man/sndfile-convert.1
+ Fix warning from Debian's lintian checks.
+
+ * man/sndfile-cmp.1 man/sndfile-jackplay.1 man/sndfile-metadata-get.1
+ man/Makefile.am
+ Add three new minimal manpages and hook into build.
+
+2009-10-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/test_wrapper.sh.in
+ Don't run cpp_test on x86_64-w64-mingw32.
+
+2009-09-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/utils.tpl
+ On windows, make sure the open() function doesn't get called with a third
+ parameter of 0 which fails for no good reason. Also make sure this third
+ parameter doesn't get called with S_IRGRP when compiling for windows because
+ Wine complains.
+
+ * src/sndfile.hh
+ Add a SndfileHandle constructor for windows that takes a 'const wchar_t *'
+ string.
+
+ * doc/FAQ.html
+ Add Q/A : I'm cross compiling libsndfile for another platform. How can I
+ run the test suite?
+
+ * src/create_symbols_file.py src/Makefile.am
+ Add Symbols.static target, a list of symbols, one per line.
+
+2009-09-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/test_wrapper.sh.in
+ Update to allow all tests to be gathered up into a testsuite tarball and
+ then be run using this script.
+
+ * build-test-tarball.mk.in
+ Add a Make script to build a tarball of all the test binaries and the test
+ wrapper script. This is useful for cross compiling; you can build the
+ binaries, build test test tarball and transfer the test tarball to the
+ target machine for testing.
+
+2009-09-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/*.c
+ Modify SF_FILE struct to allow it to carry either 8-bit or 16-bit strings
+ for the file path, directory and name. Fixes for this change throughout.
+
+ * src/windows.c src/Makefile.am
+ New file defining new windows only public function sf_wchar_open() which
+ takes a 'const wchar_t *' string (LPCWSTR) for the file name parameter.
+
+ * src/sndfile.h.in
+ Add SF_CHANNEL_MAP_ABISONIC_* entries.
+ Add windows only defintion for sf_wchar_open().
+
+ * src/create_symbols_file.py
+ Add sf_wchar_open() to the list of public symbols (windows only).
+
+ * tests/locale_test.c
+ Add a wchar_test() to test sf_wchar_open().
+
+2009-09-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/*.c
+ Split file stuff into PSF_FILE struct within the SF_PRIVATE struct.
+
+2009-09-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c src/voc.c
+ When a byte is needed, use unsigned char.
+
+ * src/ima_oki_adpcm.c src/broadcast.c src/test_ima_oki_adpcm.c
+ Include sfconfig.h to prevent compile errors with MinGW compilers.
+
+ * configure.ac
+ Remove AM_CONFIG_HEADER due to warnings from autoconf 2.64.
+
+ * tests/locale_test.c
+ Update to work with xx_XX.UTF-8 style locales. Refactoring.
+
+2009-09-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Set __USE_MINGW_ANSI_STDIO to 1 when compiling using MinGW compilers.
+ Remove unneeded AC_SUBST.
+ Report Host CPU/OS/vendor.
+
+2009-09-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fix error message string.
+
+ * src/flac.c
+ Add 88200 to the list of supported sample rates.
+
+ * src/ogg.c
+ Fix compiler warning when using gcc-4.5.0.
+
+ * programs/sndfile-info.c tests/utils.tpl
+ Remove WIN32 snprintf #define.
+
+ * src/ima_adpcm.c
+ Fix minor bug in aiff_ima_encode_block. Thanks to Denis Fileev for finding
+ this.
+
+2009-09-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/caf.c
+ Use the correct C99 format specifier for int64_t.
+
+ * M4/endian.m4
+ Fix detection of CPU endian-ness when cross compiling. Thanks to Pierre
+ Ossman for the bug report.
+
+ * src/caf.c src/sndfile.c
+ Fix reading and writing of PEAK chunks in CAF files.
+
+ * tests/peak_chunk_test.c tests/test_wrapper.sh.in
+ Run peak_chunk_test on CAF files.
+
+2009-09-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c src/wav.c
+ Use the correct C99 format specifier for int64_t.
+
+2009-08-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/rf64.c src/sndfile.c src/wav.c src/wav_w64.h
+ Apply a patch (massaged slightly) from Uli Franke adding handling of the
+ BEXT chunk in RF64 files.
+
+ * tests/command_test.c
+ Update channel_map_test() function so WAV test passes.
+
+ * src/rf64.c
+ Add channel mapping and ambisonic support.
+
+ * src/sndfile.h
+ Add comments showing correspondance between libsndfile channel map
+ defintiions and those used by Apple and MS.
+
+ Add handling of reading/writing channel map info.
+
+ * tests/command_test.c tests/test_wrapper.sh.in
+ Update channel map tests.
+
+2009-07-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Add function psf_isprint() a replacement for the standard C isprint()
+ function which ignores any locale settings and treats all input as ASCII.
+
+ * src/(aiff|common|rf64|sd2|strings|svx|wav).c
+ Use psf_isprint() instead of isprint().
+
+2009-07-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/command.c
+ Add string descriptions for SF_FORMAT_RF64 and SF_FORMAT_MPC2K.
+
+2009-06-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-play.c
+ Allow use of Open Sound System audio output under FreeBSD.
+
+2009-06-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Add patch from Conrad Parker to add --disable-jack.
+
+2009-05-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/alaw.c src/float32.c src/htk.c src/pcm.c src/sds.c src/ulaw.c
+ Fix bugs where invalid files can cause a divide by zero error (SIGFPE).
+ Thanks to Sami Liedes for reporting this a Debian bug #530831.
+
+2009-05-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/chanmap.[ch]
+ New files for channel map decoding/encoding.
+
+2009-05-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/sndfile.h.in
+ Fix MSVC definition of sf_count_t.
+
+2009-05-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_w64.[ch]
+ Add wavex_channelmask to WAV_PRIVATE struct and add a function to convert
+ an array of SF_CHANNEL_MASK_* values into a bit mask for use in WAV files.
+
+ * src/wav.c
+ Add ability to write the channel mask.
+
+2009-05-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-info.c
+ Add -c command line option to dump the channel map information.
+
+ * src/wav_w64.c
+ Don't bail from parser if channel map bitmask is faulty.
+
+ * src/common.h src/sndfile.c
+ Remove error code SFE_W64_BAD_CHANNEL_MAP which is not needed any more.
+
+ * src/sndfile.c
+ On SFC_SET_CHANNEL_MAP_INFO pass the channel map command down to container's
+ command handler.
+
+2009-05-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/common.h src/sndfile.c src/wav_w64.c
+ Apply a patch from Lennart Poettering (PulseAudio) to allow reading of
+ channel data in WAV and W64 files.
+ Add a test for the above.
+
+2009-05-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FAQ.html
+ Update the section about pre-compiled binaries for Win64.
+
+2009-05-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/test_conversions.c
+ Be more careful when including <stdint.h> so compiling on pre-C99 platforms
+ (hello Slowlaris) might actually work.
+
+ * NEWS README doc/*.html
+ Updates for 1.0.20.
+
+2009-04-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/voc.c
+ Fix a bug whereby opening a specially crafted VOC file could result in a
+ heap overflow. Thanks to Tobias Klein (http://www.trapkit.de) for reporting
+ this issue.
+
+ * src/aiff.c
+ Fix potential (heap) buffer overflow when parsing 'MARK' chunk.
+
+2009-04-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/stdin_test.c
+ Check psf->error after opening file.
+
+ * src/file_io.c
+ Fix obscure seeking bug reported by Hugh Secker-Walker.
+
+ * tests/utils.tpl
+ Add check of sf_error to test_open_file_or_die().
+
+ * src/sndfile.c
+ Clear error if opening resource fork fails.
+
+2009-04-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/alaw_test.c tests/locale_test.c tests/ulaw_test.c
+ Cleanup output.
+
+2009-03-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/float32.c
+ Fix f2s_clip_array.
+
+2009-03-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/float32.c
+ In host_read_f2s call convert instead of f2s_array.
+
+ * src/ima_adpcm.c
+ Remove dead code.
+
+ * src/test_ima_oki_adpcm.c examples/generate.c tests/dither_test.c
+ tests/dwvw_test.c tests/fix_this.c tests/generate.c
+ tests/multi_file_test.c
+ Minor fixes.
+
+2009-03-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * M4/shave.m4 shave.in
+ Pulled update from upstream.
+
+2009-03-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html
+ Add pointers to example programs in source code tarball.
+
+2009-03-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Define SF_PLATFORM_S64 for non-gcc compilers with 'long long' type.
+
+ * configure.ac
+ Add documentation for --disable-external-libs and improve error handling
+ for that option.
+
+ * src/sndfile.c src/sndfile.h.in src/create_symbols_file.py
+ Add public function sf_version_string.
+
+ * tests/sfversion.c
+ Test function sf_version_string.
+
+ * M4/shave.m4 shave-libtool.in shave.in
+ Add new files from 'git clone git://git.lespiau.name/shave'.
+
+ * configure.ac
+ Enable shave.
+
+ * src/Makefile.am src/binheader_writef_check.py Octave/*
+ Shave related tweaks.
+
+2009-03-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/caf.c src/sndfile.c
+ Add SF_MAX_CHANNELS (set to 256) and use it.
+
+ * src/sndfile.h.in
+ Check for either _MSCVER or _MSC_VER being defined.
+
+2009-03-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/vorbis_test.c
+ Relax test slighly to allow test to pass on more CPUs etc.
+
+2009-03-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Detect vorbis_version_string() correctly.
+
+2009-03-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Add a 'See Also' section with a link to sndfile-tools.
+
+ * NEWS README doc/*.html
+ Updates for 1.0.19 release.
+
+ * configure.ac
+ Fix --enable-external-libs logic.
+
+2009-03-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fix resource leak and potential read beyond end of buffer.
+
+ * src/nist.c
+ Fix reading of header value sample_n_bytes.
+
+ * src/sd2.c src/wav.c
+ Fix potential read beyond end of buffer.
+
+ * src/sndfile.c src/svx.c
+ Check return values of file_io functions.
+
+ * tests/win32_test.c
+ Fix resource leak.
+
+ * configure.ac
+ Detect the presence/absence of vorbis_version_string() in libvorbis.
+
+ * src/ogg.c
+ Only call vorbis_version_string() from libvorbis if present.
+
+2009-02-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/win32_test.c
+ Don't use sprintf, even on windows.
+
+ * src/aiff.c src/rf64.c src/wav.c
+ Eliminate dead code, more validation of data read from file.
+
+2009-02-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ima_adpcm.c
+ Clamp values to a valid range before indexing ima_step_size array.
+
+ * src/GSM610/*.c tests/*c programs/*.c src/audio_detect.c
+ Don't include un-needed headers.
+
+ * programs/sndfile-info.c
+ Remove dead code.
+
+ * tests/test_wrapper.sh.in
+ Add 'set -e' so the script exits on error.
+
+ * src/test_ima_oki_adpcm.c
+ Fix read beyond end of array.
+
+ * tests/win32_test.c
+ Add missing close on file descriptor.
+
+ * src/nist.c programs/sndfile-metadata-set.c
+ Fix 'unused variable' warnings.
+
+ * src/aiff.c
+ Fix potential memory leak in handling of 'MARK' chunk.
+ Remove un-needed test (unsigned > 0).
+
+ * src/sd2.c
+ Improve handling of heap allocated buffer.
+
+ * src/sndfile.c
+ Remove un-needed test (always true).
+
+ * src/wav.c src/rf64.c
+ Ifdef out dead code that will be resurected some time in the future.
+
+ * src/wav.c src/w64.c src/xi.c
+ Handle error return values from psf_ftell.
+
+ * src/wav_w64.c
+ Fix handling and error checking of MSADPCM coefficient arrays.
+
+ * regtest/*.c
+ Bunch of fixes.
+
+ * src/test_file_io.c
+ Use snprintf instead of strncpy in test program.
+
+2009-02-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sd2.c
+ Validate data before using.
+
+ * src/caf.c
+ Validate channels per frame value before using, fixing a possible integer
+ overflow bug, leading to a possible heap overflow. Found by Alin Rad Pop of
+ Secunia Research (CVE-2009-0186).
+
+2009-02-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Octave/octave_test.sh
+ Unset TERM environment variable and export LD_LIBRARY_PATH.
+
+2009-02-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ In windows code, cast LPVOID to 'char*' in printf.
+
+2009-02-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * M4/octave.m4
+ Clear the TERM environment before evaluating anything in Octave. This works
+ around problems that might occur if a users TERM settings are incorrect.
+ Thanks to Rob Til Freedmen for helping to debug this.
+
+ * src/wav.c
+ Handle four zero bytes as a marker within a LIST or INFO chunk.
+ Thanks to Rogério Brito for supplying an example file.
+
+2009-02-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/*.c
+ Use C99 snprintf everywhere.
+
+2009-02-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/test_wrapper.sh.in
+ New file to act as the template for the test wrapper script.
+
+ * configure.ac
+ Generate tests/test_wrapper.sh from the template.
+
+ * tests/Makefile.am
+ Replace all tests with a single invocation of the test wrapper script.
+
+2009-02-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ogg.c
+ Record vorbis library version string.
+
+ * configure.ac
+ Require libvorbis >= 1.2.2.
+
+ * M4/endian.m4
+ Fix bracketing of function for autoconf 2.63. Thanks to Richard Ash.
+
+ * M4/octave.m4 M4/mkoctfile_version.m4
+ Clean up AC_WITH_ARG usage using AC_HELP_STRING.
+
+2009-02-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Octave/Makefile.am
+ Use $(top_buildir) instead of $(builddir) which may not be defined.
+
+ * M4/octave.m4
+ Improve logic and status reporting.
+
+2009-02-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac AUTHORS NEWS README doc/*.html
+ Final tweaks for 1.0.18 release.
+
+2009-02-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-convert.c
+ Add 'htk' to the list of convert formats.
+
+ * programs/sndfile-info.c
+ Simplify get_signal_max using SFC_CALC_SIGNAL_MAX command.
+ Increase size of files for which signal max will be calculated.
+
+2009-01-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Fix links for SoX and WavPlay. Thanks to Daniel Griscom.
+
+2009-01-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-metadata-get.c
+ Make valgrind clean.
+ Clean up temp string array usage.
+ Error out if trying to update coding history in RDWR mode.
+
+2009-01-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Fix links to versions of the LGPL.
+
+2008-12-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/string_test.c
+ Add test for RDWR mode where the file ends up shorter than when it was
+ opened.
+
+ * src/wav.c
+ Truncate the file on close for RDWR mode where the file ends up shorter
+ than when it was opened.
+
+2008-11-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * M4/add_cflags.m4
+ Fix problem with quoting of '#include'.
+
+ * M4/add_cxxflags.m4 configure.ac
+ Add new file M4/add_cxxflags.m4 and use it in configure.ac.
+
+2008-11-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-info.c
+ Apply patch from Conrad Parker to calculate and display total duration when
+ more than one file is dumped.
+
+2008-11-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/Makefile.am
+ Tweaks to generation of Symbols files.
+
+ * tests/win32_ordinal_test.c
+ Update tests for above changes.
+
+2008-11-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/common.c
+ When merging broadcast info, make sure to clear the destination field
+ before copying in the new data.
+
+ * programs/test-sndfile-metadata-set.py
+ Add test for the above.
+
+ * src/broadcast.c
+ Fix checking of required coding_history_size.
+
+2008-10-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/command_test.c
+ Add test to detect if coding history is truncated.
+
+ * src/broadcast.c
+ Fix truncation of coding history.
+
+2008-10-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/command_test.c
+ Add broadcast_coding_history_size test.
+
+ * programs/*.[ch]
+ Use SF_BROADCAST_INFO_VAR to manipulate larger 'bext' chunks.
+
+ * src/rf64.c
+ Add code to prevent infinite loop on malformed file.
+
+ * src/common.h src/sndfile.c src/w64.c src/wav_w64.c
+ Rationalize and improve error handling when parsing 'fmt ' chunk.
+
+ * M4/octave.m4
+ Simplify and remove cruft.
+ Check for correct Octave version.
+
+ * Octave/*
+ Reduce 3 C++ files to one, fix build for octave 3.0, fix build.
+
+ * Octave/sndfile.cc Octave/PKG_ADD
+ Add Octave function sfversion which returns the libsndfile version that the
+ module is linked against.
+
+ * Octave/Makefile.am
+ Bunch of build and 'make distcheck' fixes.
+
+2008-10-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/common.c
+ Return 1 if SFC_SET_BROADCAST_INFO fails.
+
+ * programs/test-sndfile-metadata-set.py
+ Update for new programs directory, exit on any error.
+
+ * tests/error_test.c
+ Fix failure behaviour in error_number_test.
+
+ * src/common.h src/sndfile.c
+ Add error number SFE_BAD_BROADCAST_INFO_SIZE.
+
+ * src/*
+ Reimplement handling of broadcast extentioon chunk in WAV/WAVEX files.
+
+ * src/broadcast.c
+ Fix generation of added coding history.
+
+2008-10-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * programs/sndfile-metadata-get.c programs/sndfile-info.c
+ Exit with non-zero on errors.
+
+2008-10-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-to-text.c examples/Makefile.am
+ Add a new example program and hook it into the build.
+
+ * examples/ programs/
+ Add a new directory programs and move sndfile-info, sndfile-play and other
+ real programs to the new directory, leaving example programs where they
+ were.
+
+2008-10-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/Makefile.am
+ Automake 1.10 MinGW cross compiling fixes.
+
+2008-10-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Remove call to deprecated function snd_pcm_sw_params_get_xfer_align.
+ Fix gcc-4.3 compiler warnings.
+
+ * tests/command_test.c
+ Fix a valgrind warning.
+
+ * tests/error_test.c tests/multi_file_test.c tests/peak_chunk_test.c
+ tests/pipe_test.tpl tests/stdio_test.c tests/win32_test.c
+ Fix gcc-4.3 compiler warnings.
+
+2008-10-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/broadcast.c
+ Fix termination of desitination string in strncpy_crlf.
+ When copying BROADCAST_INFO chunk, make sure destination gets correct line
+ endings.
+
+ * examples/common.c
+ Fix copying of BROADCAST_INFO coding_history field.
+
+2008-10-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/command_test.c
+ Add test function instrument_rw_test, but don't hook it into the testing
+ yet.
+
+ * src/common.h src/command.c src/sndfile.c src/flac.c
+ Error code rationalization.
+
+ * src/common.h src/sndfile.c
+ Set psf->error to SFE_CMD_HAS_DATA when adding metadata via sf_command()
+ fails due to psf->have_written being true.
+
+ * doc/command.html
+ Document the SFC_GET/SET_BROADCAST_INFO comamnds.
+
+2008-10-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/command_test.c
+ Improve error reporting when '\0' is found in coding history.
+ Fix false failure.
+
+2008-10-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/broadcast.c
+ Convert all coding history line endings to \r\n.
+
+ * tests/command_test.c
+ Add test to make sure all line endings are converted to \r\n.
+
+2008-10-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/broadcast.c
+ Changed the order of coding history fields.
+
+ * tests/command_test.c
+ Update bextch test to cope with previous change.
+
+ * examples/common.c
+ Add extra length check when copying broadcast info data.
+
+2008-10-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/utils.tpl tests/pcm_test.tpl
+ Update check_file_hash_or_die to use 64 bit hash.
+
+ * tests/checksum_test.c tests/Makefile.am
+ Add new checksum_test specifically for lossy compression of headerless
+ files.
+
+2008-10-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/gsm610.c
+ Seek to psf->dataoffset before decoding first block.
+
+ * src/sndfile.c
+ Fix detection of mpc2k files on big endian systems.
+
+2008-10-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/broadcast.c
+ Use '\r\n' newlines in Coding History as required by spec.
+
+2008-10-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/test_conversions.c
+ Use int64_t instead of 'long long'.
+
+2008-10-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-metadata-set.c
+ Remove --bext-coding-history-append command line option because it didn't
+ really make sense.
+
+ * examples/sndfile-metadata-(get|set).c
+ Add usage messages.
+
+ * examples/test-sndfile-metadata-set.py
+ Start work on test coding history.
+
+2008-09-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * README doc/win32.html
+ Bring these up to date.
+
+ * src/aiff.c
+ Fix parsing of REX files.
+
+2008-09-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Use intptr_t instead of long for return value of _get_osfhandle.
+
+ * src/test_conversions.c src/test_endswap.tpl
+ Fix printing of int64_t values.
+
+ * examples/sndfile-play.c
+ Fix win64 issues.
+
+ * tests/win32_ordinal_test.c
+ Fix calling of GetProcAddress with ordinal under win64.
+
+ * tests/utils.tpl
+ Fix win64 issues.
+
+2008-09-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/*
+ Rename copy_data.[ch] to common.[ch]. Fix build.
+ Move code from sndfile-metadata-set.c to common.c.
+
+ * examples/Makefile.am tests/Makefile.am regtest/Makefile.am
+ Clean paths.
+
+2008-09-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/tutorial.html doc/Makefile.am
+ Add file doc/tutorial.html and hook into build/dist system.
+
+2008-09-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-metadata-set.c
+ Clean up handling of bext command line params.
+
+2008-09-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/w64.c
+ Add handling/skipping of a couple of new chunk types.
+
+2008-09-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Add -funsigned-char to CFLAGS if the compiler supports it.
+
+ * examples/sndfile-metadata-(get|set).c
+ Add handling for more metadata types.
+
+2008-09-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Add macros SF_CONTAINER, SF_CODEC and SF_ENDIAN useful for splitting format
+ field of SF_INFO into component parts.
+
+ * src/*.c
+ Use new macros everywhere it is appropriate.
+
+2008-09-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-bwf-set.c
+ Massive reworking.
+
+2008-08-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-bwf-set.c
+ Add --info-auto-create-date command line option.
+
+ * examples/sndfile-metadata-set.c examples/sndfile-metadata-get.c
+ examples/Makefile.am examples/test-sndfile-bwf-set.py
+ Rename sndfile-bwf-(set|get).c to sndfile-metadata-(set|get).c.
+ Change command line args.
+
+2008-08-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Allow 'PAD ' chunk to be modified in RDWR mode.
+
+ * src/sndfile.h.in src/sndfile.c
+ Add handling (incomplete) for SFC_SET_ADD_HEADER_PAD_CHUNK.
+
+ * tests/Makefile.am tests/write_read_test.tpl tests/header_test.tpl
+ tests/misc_test.c
+ Add tests for RF64.
+
+ * src/rf64.c
+ Fixes to make sure all tests pass.
+
+ * tests/Makefile.am tests/string_test.c
+ Add string tests (not yet passing).
+
+2008-08-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/rf64.c
+ First pass at writing RF64 now working.
+
+2008-08-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Add SF_FORMAT_RF64 to format_map.
+
+ * src/common.h src/sndfile.c
+ More RF64 support code.
+
+ * examples/sndfile-bwf-set.c
+ Fix the month number in autogenerated date string and use hypen in date
+ instead of slash.
+
+ * examples/test-sndfile-bwf-set.py
+ Update tests.
+
+ * examples/sndfile-info.c
+ When called with -i or -b option, operate on all files on command line, not
+ just the first.
+
+2008-08-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/rf64.c
+ New file to handle RF64 (WAV like format supportting > 4Gig files).
+
+ * src/sndfile.h.in src/common.h src/sndfile.c src/Makefile.am
+ Hook the above into build so hacking can begin.
+
+ * src/pcm.c
+ Improve log message when pcm_init fails.
+
+ * src/sndfile-info.c
+ Only calculate and print 'Signal Max' if file is less than 10 megabytes in
+ length.
+
+2008-08-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/string_test.c
+ Polish string_multi_set_test.
+
+ * src/wav.c
+ In RDWR mode, pad the header if necessary (ie LIST chunk has moved or
+ length has changed).
+ Minor fixes in wav_write_strings.
+ Write PAD chunk with default endian-ness, not a specific endian-ness.
+
+ * examples/test-sndfile-bwf-set.py
+ Add Python script to test sndfile-bwf-set/get.
+
+ * examples/sndfile-bwf-set.c
+ Clean up and fixes.
+
+ * src/wav.c
+ Merge function wavex_write_header into wav_write_header, deleting about 70
+ lines of code.
+
+ * src/common.h
+ Double value of SF_MAX_STRINGS.
+
+ * tests/string_test.c
+ Add string tests for WAVEX and RIFX files.
+
+ * tests/command_test.c
+ Add broadcast test for WAVEX files.
+
+2008-08-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/string_test.c
+ Add a new string_rdwr_test (currently failing for WAV).
+ Add a new string_multi_set_test (currently failing).
+
+ * tests/command_test.c
+ Add new broadcast_rdwr_test (currently failing).
+
+ * src/wav.c
+ Fix to WAV parser to allow 'bext' chunk to be updated in place.
+ In wav_write_tailer, seek to psf->dataend if its greater than zero.
+
+ * src/sndfile.c
+ Make sure psf->have_written gets set correctly in mode SFM_RDWR.
+
+ * configure.ac
+ Test for <sys/time.h> and gettimeofday.
+
+ * src/common.c
+ Use gettimeofday() to initialize psf_rand_int32.
+
+ * src/common.h src/sndfile.c
+ Add unique_id field to SF_PRIVATE struct.
+
+ * src/common.h src/sndfile.c src/wav.c src/wav_w64.[ch]
+ Move wavex_ambisonic field from SF_PRIVATE struct to WAV_PRIVATE struct.
+
+ * src/common.h src/strings.c
+ Add function psf_location_string_count.
+
+2008-08-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Test for localtime and localtime_r.
+
+ * examples/sndfile-convert.c
+ In function copy_metadata(), copy broadcast info if present.
+
+ * examples/copy_data.[ch] examples/Makefile.am
+ Break some functionality out of sndfile-convert.c so it can be used in
+ examples/sndfile-bwf-set.c.
+
+ * tests/utils.tpl
+ Add new function create_short_sndfile().
+
+ * examples/sndfile-bwf-set.c examples/sndfile-bwf-get.c
+ examples/Makefile.am
+ Add new files and hook into build.
+
+2008-08-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Fix comments. Patch from Mark Glines.
+
+2008-07-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/misc_test.c
+ Use zero_data_test on Ogg/Vorbis files.
+
+ * src/ogg.c
+ Fix segfault when closing an Ogg/Vorbis file that has been opened for write
+ but had no actual data written to it. Bug reported by Chinoy Gupta.
+
+ * tests/Makefile.am
+ Make sure to run mist_test on Ogg/Vorbis files.
+
+2008-07-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * regtest/Makefile.am
+ Use SQLITE3_CFLAGS to locate sqlite headers.
+
+2008-07-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html doc/FAQ.html
+ Add notes about which versions of windows libsndfile works on.
+
+2008-07-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/misc_test.c
+ Add a test for correct handling of Ambisonic files. Thanks to Fons
+ Adriaensen for the test.
+
+ * src/wav.c src/wav_w64.c
+ Fix handling of Ambisonic files. Thanks to Fons Adriaensen for the patch.
+
+2008-06-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Fix detection/enabling of external libs.
+
+ * M4/extra_pkg.m4 M4/Makefile.am
+ Add m4 macro PKG_CHECK_MOD_VERSION which is a hacked version
+ PKG_CHECK_MODULES. The new macro prints the version number of the package
+ it is searching for.
+
+2008-06-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Apply a fix from Axel Röbel where if the second loop in the instrument
+ chunk is none, the loop mode is written into the first loop.
+
+2008-05-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/test_float.c src/test_main.(c|h) src/Makefile.am
+ Add new file to test functions float32_(le|be)_(read|write) and
+ double64_(le|be)_(read|write). Hook into build and testsuite.
+
+ * src/double64.c src/float32.c
+ Fix bugs in functions found by test added above. Thanks to Nicolas Castagne
+ for reporting this bug.
+
+ * src/sndfile.h.in
+ Change time_reference_(low|high) entries of SF_BROADCAST_INFO struct to
+ unsigned.
+
+ * examples/sndfile-info.c
+ Print out the BEXT time reference in a sensible format.
+
+2008-05-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c
+ Fuzz fixes.
+
+ * src/ogg.c
+ Add call to ogg_stream_clear to fix valgrind warning.
+
+ * src/aiff.c
+ Fix x86_64 compile issue.
+
+ * configure.ac src/Makefile.am src/flac.c src/ogg.c
+ Link to external versions of FLAC, Ogg and Vorbis.
+
+ * tests/lossy_comp_test.c tests/ogg_test.c tests/string_test.c
+ tests/vorbis_test.c tests/write_read_test.tpl
+ Fix tests when configured with --disable-external-libs.
+
+ * tests/external_libs_test.c tests/Makefile.am
+ Add new test and hook into build and test suite.
+
+ * src/command.c
+ Use HAVE_EXTERNAL_LIBS to ensure that the SFC_GET_FORMAT_* commands return
+ the right data when external libs are disabled.
+
+2008-05-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.tpl
+ Add a test for extending a file during write by seeking past the current
+ end of file.
+
+ * src/sndfile.c
+ Allow seeking past end of file during write.
+
+2008-05-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html doc/command.html
+ Move all information about the sf_command function to command.html and add
+ a link from documentation of the sf_read/write_raw function to the
+ SFC_RAW_NEEDS_ENDSWAP command.
+
+ * doc/index.html doc/FAQ.html doc/libsndfile.css
+ Minor documentation tweaks.
+
+2008-05-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Add AM_PROG_CC_C_O.
+
+2008-04-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/error_test.c
+ Add a test to make sure if file opened with sf_open_fd, and then the file
+ descriptor is closed, then sf_close will return an error code. Thanks to
+ Dave Flogeras for the bug report.
+
+ * src/sndfile.c
+ Make sf_close return an error is the file descriptor is already closed.
+
+2008-04-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Set object format to aout for OS/2. Thanks to David Yeo.
+
+ * src/mpc2k.c src/sndfile.c src/sndfile.h.in src/common.h src/Makefile.am
+ Add ability to read MPC 2000 file.
+
+ * tests/write_read_test.tpl tests/misc_test.c tests/header_test.tpl
+ tests/Makefile.am
+ Add tests for MPC 2000 file format.
+
+ * examples/sndfile-convert.c
+ Allow conversion to MPC 2000 file format.
+
+2008-04-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/VORBIS/lib/codebook.c
+ Sync from upstream SVN.
+
+ * autogen.sh configure.ac
+ Minor tweaks.
+
+2008-04-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ogg.c
+ Add a patch that fixes finding the length in samples of an Ogg/Vorbis file.
+ The patch as supplied segfaulted and required many hours of debugging.
+
+ * src/OGG/bitwise.c
+ Sync from upstream SVN.
+
+2008-04-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fix up handling of 'APPL' chunk. Thanks to Axel Röbel for bringing up
+ this issue.
+
+2008-04-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/*.c
+ Add calls to sf_close() where needed.
+
+ * tests/utils.tpl tests/multi_file_test.c
+ Always pass 0 as the third argument to open when OS_IS_WIN32.
+
+2008-04-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/test_*
+ Add files test_main.[ch].
+ Collapse all tests into a single executable.
+
+2008-03-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC
+ Sync to upstream CVS.
+
+2008-03-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Make SF_MIN and SF_MAX macros MinGW friendly.
+
+ * examples/sndfile-(info|play).c
+ Use Sleep function from <windows.h> instead of _sleep.
+
+ * tests/locale_test.c
+ Disable some tests when OS_IS_WIN32.
+
+ * src/FLAC/src/share/replaygain_anal/replaygain_analysis.c
+ src/FLAC/src/share/utf8/utf8.c
+ MinGW fixes.
+
+2008-03-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Tweaks to pcm16 <-> float conversion answer.
+
+2008-02-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/OGG
+ Sync to SVN upstream.
+
+ * Makefile.am
+ Add 'DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror'.
+
+2008-02-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-jackplay.c
+ Minor tweaks to warning message printed when compiled without libjack.
+
+2008-01-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/peak_chunk_test.c
+ Improve read_write_peak_test to find more errors. Inspired by example
+ provided by Nicolas Castagne.
+
+ * src/aiff.c
+ Another SFM_RDWR fix shown up by above test.
+
+2008-01-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fix reading of COMM encoding string.
+
+ * src/chunk.c src/common.h src/Makefile.am
+ New file for storing and retrieving info about header chunks. Hook into
+ build.
+
+ * src/aiff.c
+ Use new chunk logging to fix problem with AIFF in RDWR mode.
+
+2008-01-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/command.c
+ Add WVE to the list of major formats.
+
+ * tests/aiff_rw_test.c
+ Fix error reporting.
+
+2008-01-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.[ch]
+ Add internal functions str_of_major_format, str_of_minor_format,
+ str_of_open_mode and str_of_endianness.
+
+ * tests/write_read_test.tpl
+ Fix reporting of errors in new_rdwr_XXXX_test.
+
+2008-01-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Apply patch from Yair K. to fix compiles with OSS v4.
+
+ * src/common.h src/float32.c src/double64.c
+ Rename psf->float_enswap to psf->data_endswap.
+
+ * src/sndfile.h.in src/sndfile.c src/pcm.c
+ Add command SFC_RAW_NEEDS_ENDSWAP.
+
+ * tests/command.c
+ Add test for SFC_RAW_NEEDS_ENDSWAP.
+
+ * doc/command.html
+ Document SFC_RAW_NEEDS_ENDSWAP.
+
+ * tests/peak_chunk_test.c
+ Add test function read_write_peak_test. Thanks to Nicolas Castagne for the
+ bug report.
+
+2008-01-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-cmp.c
+ Add new example program contributed by Conrad Parker.
+
+ * examples/Makefile.am
+ Hook into build.
+
+ * doc/development.html
+ Change use or reconfigure.mk to autogen.sh.
+
+2008-01-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/win32_test.c
+ Add another win32 test.
+
+ * tests/util.tpl
+ Add function file_length_fd which wraps fstat.
+
+ * tests/Makefile.am
+ Run the multi_file_test on AU files.
+
+ * tests/multi_file_test.c
+ Use function file_length_fd() instead of file_length() to overcome stupid
+ win32 bug. Fscking hell Microsoft sucks so much.
+
+2008-01-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sd2.c
+ Fix a rsrc parsing bug. Example file supplied by Uli Franke.
+
+2007-12-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Allow use of either LGPL v2.1 or LGPL v3.
+
+ * tests/header_test.tpl
+ Add header_shrink_test from Axel Röbel.
+
+ * src/wav.c
+ Add fix from Axel Röbel for writing files with float data but no peak
+ chunk (ie peak chunk gets removed after the file is opened).
+
+ * src/aiff.c tests/header_test.tpl
+ Apply similar fix to above for AIFF files.
+
+ * src/wav.c tests/header_test.tpl
+ Apply similar fix to above for WAVEX files.
+
+ * src/command.c
+ Add Ogg/Vorbis to 'get format' commands.
+
+2007-12-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ogg.c
+ Fix seeking on multichannel Ogg Vorbis files. Reported by Bodo.
+ Set the default encoding quality to 0.4 instead of 4.0 (Bodo again).
+
+ * tests/ogg_test.c
+ Add stereo seek tests.
+
+2007-12-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/ogg_test.c
+ Add a test (currently failing) for stereo seeking on Ogg Vorbis files. Test
+ case supplied by Bodo.
+
+ * tests/utils.(def|tpl)
+ Add compare_XXX_or_die functions.
+
+2007-12-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fix a bug where ignoring ssnd_fmt.offset and ssnd_fmt.blocksize caused
+ misaligned reading of 24 bit data. Thanks to Uli Franke for reporting this.
+
+2007-12-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/vox_adpcm.c src/ima_oki_adpcm.[ch] src/Makefile.am
+ Merge in code from the vox-patch branch. Thanks to Robs for the patch
+ which fixes a long standing bug in the VOX codec.
+
+2007-12-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Fix handling of -override-sample-rate=X option.
+
+2007-11-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ogg.c src/VORBIS
+ Merge in Ogg Vorbis support from John ffitch of the Csound project.
+
+2007-11-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Recognise files with 'vox6' extension as 6kHz OKI VOX ADPCM files. Also
+ recognise 'vox8' as and 'vox' as 8kHz files.
+
+ * configure.ac
+ Detect libjack (JACK Audio Connect Kit).
+
+ * examples/sndfile-jackplay.c examples/Makefile.am
+ Add new example program to play sound files using the JACK audio server.
+ Thanks to Jonatan Liljedahl for allowing this to be included.
+
+2007-11-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Update support table with SD2 and FLAC.
+
+2007-11-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fix calculation of internal value psf->read_current when attempting to read
+ past end of audio data.
+ Remove redundant code.
+
+ * tests/lossy_comp_test.c
+ Add read_raw_test to check that raw reads do not go past the end of the
+ audio data section.
+ Clean up error output messages.
+
+ * src/sndfile.c
+ Add code to prevent sf_read_raw from reading past the end of the audio data.
+
+ * tests/Makefile.am
+ Add the wav_pcm lossy_comp_test.
+
+2007-11-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/Makefile.am src/create_symbols_file.py
+ More OS/2 fixes from David Yeo.
+
+2007-11-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c tests/utils.tpl tests/benchmark.tpl
+ Improve handling of requirements for O_BINARY as suggested by Ed Schouten.
+
+2007-11-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Fix symbol class when SF_MIN is nested inside SF_MAX or vice versa.
+
+ * src/create_symbols_file.py
+ Add support for OS/2 contributed by David Yeo.
+
+2007-11-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * M4/gcc_version.m4
+ Add macro AC_GCC_VERSION to detect GCC_MAJOR_VERSION and GCC_MINOR_VERSION.
+
+ * configure.ac
+ Use AC_GCC_VERSION to work around gcc-4.2 inline warning stupidity.
+ See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33995
+ Use -fgnu-inline to prevent stupid warnings.
+
+2007-11-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/util.tpl
+ Increase the printing width for print_test_name().
+
+ * tests/command_test.c tests/Makefile.am
+ Add tests for correct updating of broadcast WAV coding history.
+
+ * examples/sndfilehandle.cc examples/Makefile.am
+ Add example program using the C++ SndfileHandle class.
+
+2007-10-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/sndfile.c
+ Add error codes SFE_ZERO_MAJOR_FORMAT and SFE_ZERO_MINOR_FORMAT.
+
+2007-10-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sd2.c
+ Identify sample-rate/sample-size/channels by resource id.
+
+2007-10-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/broadcast.c src/common.h src/sndfile.c
+ Improvements to handling of broadcast info in WAV files. Thanks to Frederic
+ Cornu and other for their input.
+
+2007-10-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC/include/share/alloc.h
+ Mingw fix for SIZE_T_MAX from Uli Franke.
+
+2007-10-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/open_fail_test.c tests/error_test.c tests/Makefile.am
+ Move tests from open_fail_test.c to error_test.c and remove the former.
+
+2007-10-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/scale_clip_test.(def|tpl)
+ Add tests for SFC_SET_INT_FLOAT_WRITE command.
+
+ * doc/command.html
+ Add docs for SFC_SET_INT_FLOAT_WRITE command.
+
+ * examples/sndfile-play.c tests/dft_cmp.c
+ Fix gcc-4.2 warning messages.
+
+2007-10-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/sndfile.c
+ Add command SFC_GET_CURRENT_SF_INFO.
+
+ * src/sndfile.h.in src/sndfile.c src/create_symbols_file.py
+ Remove function sf_get_info (only ever in pre-release code).
+
+ * tests/command_test.c
+ Add test for SFC_GET_CURRENT_SF_INFO.
+
+2007-10-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Add parsing of 'exif' chunks. Originally coded by Trent Apted.
+
+ * configure.ac
+ Put config stuff in Cfg directory.
+ Remove check for inttypes.h.
+
+2007-10-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/w64.c
+ Fix writing of 'riff' chunk length and check for correct value in parser.
+
+2007-09-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Link to MP3 FAQ entry.
+
+2007-09-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c
+ Move the blocksize check to an earlier stage of flac_buffer_copy.
+
+2007-09-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC
+ Huge merge from FLAC upstream.
+
+2007-09-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/*.c
+ Change license to all example programs to BSD.
+
+2007-09-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC/include/FLAC/metadata.h
+ Include <sys/types.h> to prevent compile error on OSX.
+
+ * Octave/octave_test.sh
+ Disable test on OSX. Can't get it to work.
+
+ * src/flac.c
+ Check the blocksize returned from the FLAC decoder to prevent buffer
+ overruns. Reported by Jeremy Friesner. Thanks.
+
+2007-09-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Makefile.am M4/octave.m4
+ Fix build when Octave headers are not present.
+
+2007-08-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/development.html
+ Add note about bzr repository directory looking empty.
+
+2007-08-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac Octave/* M4/octave_*
+ Bunch of changes to add ability to build GNU Octave modules to read/write
+ sound files using libsndfile from Octave.
+
+2007-08-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * acinclude.m4 configure.ac ...
+ Get rid of acinclude.m4 and replace it with an M4 directory.
+
+2007-08-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Remove crufty Metrowerks compiler support. Allow header file to be compiled
+ on windows with both GCC and microsoft compiler.
+
+2007-08-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/dft_cmp.[ch] tests/floating_point_test.tpl
+ Clean up floating point tests.
+
+2007-08-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fix segfault when COMM chunk length is byte swapped.
+
+2007-08-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/mat4.c src/mat5.c src/sndfile.c
+ Add a generic SFE_CHANNEL_COUNT_ZERO error, remove format specific errors.
+
+ * src/au.c
+ Fix crash on AU files with zero channel count. Reported by Ben Alison.
+
+2007-08-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/voc.c
+ Fix bug in handling file supplied by Matt Olenik.
+
+2007-07-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/OGG
+ Merge from OGG upstream sources.
+
+2007-07-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC
+ Merge from FLAC upstream sources.
+
+2007-07-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c
+ Fix memory leak; set copy parameter to FALSE in call to
+ FLAC__metadata_object_vorbiscomment_append_comment.
+
+ * src/common.[ch]
+ Add function psf_rand_int32().
+
+2007-07-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC
+ Merge from FLAC upstream sources.
+
+ * src/strings.c tests/string_test.c tests/Makefile.am
+ Make sure string tests for SF_STR_LICENSE actually works.
+
+2007-07-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/string_test.c
+ Add ability to test strings stored in metadata secion of FLAC files.
+
+ * src/string.c
+ Fix logic for testing if audio data has been written and string is added.
+ Make sure SF_STR_ALBUM actually works.
+
+ * src/flac.c
+ Finalize reading/writing string metadata. Tests pass.
+
+ * src/sndfile.h.in tests/string_test.c src/flac.c
+ Add string type SF_STR_LICENSE, update test and use for FLAC files.
+
+ * src/sndfile.h.in
+ Add definition for SFC_SET_SCALE_FLOAT_INT_WRITE command.
+
+ * src/common.h src/double64.c src/float32.c src/sndfile.c
+ Add support for SFC_SET_SCALE_FLOAT_INT_WRITE (still needs testing).
+
+2007-07-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c
+ Apply patch from Ed Schouten to read artist and title metadata from FLAC
+ files.
+ Improve reporting of FLAC metadata.
+
+ * src/sndfile.h.in tests/string_test.c src/flac.c
+ Add string type SF_STR_ALBUM, update test and use for FLAC files.
+
+2007-06-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC/*
+ Merge from upstream CVS.
+
+2007-06-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC/*
+ Update from upstream CVS.
+
+2007-06-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/cpp_test.cc
+ Add extra tests for when the SndfileHandle constructor fails.
+
+ * src/sndfile.hh
+ Make sure failure to open the file in the constructor does not allow later
+ calls to other methods to fail.
+
+2007-06-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/util.tpl
+ Add function write_mono_file.
+
+ * tests/generate.[ch] tests/Makefile.am
+ Add files generate.[ch] and hook into build.
+
+ * tests/write_read_test.tpl
+ Add multi_seek_test.
+
+ * src/flac.c
+ Fix buffer overflow bug. Test provided by Jeremy Friesner and fix provided
+ by David Viens.
+
+2007-06-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Minor update.
+
+ * configure.ac src/FLAC/src/libFLAC/ia32/Makefile.am src/Makefile.am
+ Apply patch from Trent Apted make it compile on Intel MacOSX. Thanks Trent.
+
+2007-05-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fix writing of MSGUID subtypes. Thanks to Bruce Sharpe.
+
+2007-05-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fix array indexing bug raised by Bruce Sharpe.
+
+2007-05-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC/src/share/getopt/getopt.c
+ Fix Mac OSX / PowerPC compile warnings.
+
+ * configure.ac
+ Make sure WORDS_BIGENDIAN gets correctly defined for FLAC code.
+
+2007-05-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Add Q/A about MP3 support.
+
+2007-05-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/new_file_type.HOWTO
+ Minor updates.
+
+2007-05-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wve.c
+ Fix a couple bad parameters with psf_log_printf.
+
+ * src/pcm.c
+ Improve error reporting.
+
+ * src/common.h src/common.c
+ Constify psf_hexdump.
+
+2007-04-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC
+ Ditch and re-import required FLAC code.
+
+ * configure.ac
+ Force FLAC__HAS_OGG variable to 1.
+
+ * src/FLAC/src/libFLAC/stream_encoder.c
+ Fix compiler warnings.
+
+2007-04-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac tests/win32_ordinal_test.c
+ Detect if win32 DLL is beging generated and only run win32_ordinal_test if
+ true.
+
+ * src/G72x/Makefile.am src/Makefile.am
+ Use $(EXEEXT) where possible.
+
+2007-04-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wve.c src/common.h src/sndfile.c
+ Complete definition of SfE_WVE_NO_WVE error message.
+
+ * src/wve.c
+ Fix error in files generated on big endian systems. Robustify parsing.
+
+2007-04-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/double64.c
+ Fix clipping of double to short conversions on 64 bit systems.
+
+ * src/flac.c regtest/database.c tests/cpp_test.cc
+ Fix compile warnings for 64 bit systems.
+
+2007-04-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c src/wav_w64.c
+ Use audio detect function when 'fmt ' chunk data is suspicious.
+
+ * configure.ac
+ Add ugly hack to remove -Werror from some Makefiles.
+
+2007-04-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/GSM610/long_term.c src/macbinary3.c tests/cpp_test.cc
+ Add patch from André Pang to clean up compiles on OSX.
+
+ * src/wve.c src/common.h src/sndfile.c src/sndfile.h.in
+ examples/sndfile-convert.c
+ Merge changes from Reuben Thomas to improve WVE support.
+
+ * tests/lossy_comp_test.c tests/Makefile.am
+ Add tests for WVE files.
+
+2007-04-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.hh
+ Add a static SndfileHandle::formatCheck method as suggested by Jorge
+ Jiménez.
+
+2007-04-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed a bug in sf_error() where the function itself was being compared
+ against zero. Add a check for a NULL return from peak_info_calloc. Fix a
+ possible NULL dereference.
+
+2007-04-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c
+ Turn off seekable flag when writing, return SFE_BAD_RDWR_FORMAT when
+ opening file for RDWR.
+
+ * src/sndfile.c
+ Improve error message for SFE_BAD_RDWR_FORMAT.
+
+ * src/mat4.c
+ Fix array indexing issue. Thanks to Ben Allison (Nullsoft) for alerting me.
+
+2007-03-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Add Q/A 19 on project files.
+
+2007-03-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Guard agains MacOSX universal binary compiles.
+
+ * doc/FAQ.html
+ Add Q/A 18 and clean up Q3.
+
+2007-02-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Add support for 'in24' files.
+
+2007-02-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c src/wav_w64.c src/wav_w64.h
+ Start work towards detecting ausio codec type from the actual audio data.
+
+ * src/audio_detect.c src/test_audio_detect.c
+ Add new file and its unit test.
+
+2007-02-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/cooledit-fixer.c examples/Makefile.am
+ Remove old broken example program.
+
+2007-02-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/sndfile.h.in src/create_symbols_file.py
+ Add function sf_get_info.
+
+2007-01-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ For ALSA, use the 'default' device instead of 'plughw:0'.
+
+2007-01-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Allow writing of WAV/WAVEX 'BEXT' chunks in SFM_RDWR mode.
+
+2007-01-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/development.html doc/embedded_files.html man/sndfile-play.1
+ Minor documentation fixes. Thanks Reuben Thomas.
+
+2006-12-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Add -override-sample-rate command line option.
+
+2006-11-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/misc_test.c
+ Force errno to zero at start of some tests.
+
+ * src/sndfile.c
+ Minor clean up of error handling.
+
+ * configure.ac
+ Remove an assembler test which was failing on OSX.
+
+2006-11-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Fix the definition of SF_PLATFORM_S64 for MinGW.
+
+ * src/FLAC/Makefile.am src/FLAC/share/grabbag/Makefile.am
+ Fix path problems for MinGW.
+
+2006-11-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sfendian.h
+ Add include guard.
+
+ * src/Makefile.am src/flac.c
+ Clean up include paths.
+
+ * src/test_conversions.c
+ New file to test psf_binheader_readf/writef functions.
+
+ * src/Makefile.am src/test_file_io.c src/test_log_printf.c src/common.c
+ Clean up unit testing.
+
+ * src/common.c
+ Fix a bug reading/writing 64 bit header fields. Thanks to Jonathan Woithe
+ for reporting this.
+
+ * src/test_conversions.c
+ Complete unit test for above fix.
+
+2006-11-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ More refactoring to clean up psf_open_file() and vairous sf_open()
+ functions.
+
+2006-11-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Apply a patch from Jonathan Woithe to allow opening of (malformed) WAV
+ files of over 4 gigabytes.
+
+2006-11-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Refactor function psf_open_file() to provide a single return point.
+
+ * tests/misc_test.c
+ Fix permission_test to ensure that read only file can be created.
+
+2006-11-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Add SF_PLATFORM_S64 macro as a platform independant way of doing signed 64
+ bit integers.
+
+ * src/aiff.c src/svx.c src/wav.c
+ Add warning in log if files are larger than 4 gigabytes in size.
+
+2006-11-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/FLAC src/OGG confgure.ac src/Makefile.am
+ Pull in all required FLAC and OGG code so external libraries are not
+ needed. This makes compiling on stupid fscking Windoze easier.
+
+2006-10-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sd2.c
+ Add workaround for switched sample rate and sample size.
+
+ * src/wav.c
+ Add workaround for excessively long coding history in the 'bext' chunk.
+
+2006-10-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/sndfile.c src/wav.c doc/command.html
+ Use SF_AMBISONIC_* instead of SF_TRUE/SF_FALSE.
+
+2006-10-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/wav.c src/wav_w64.c src/common.h doc/command.html
+ Apply a patch from Fons Adriaensen to allow writing on WAVEX Ambisonic
+ files. Still needs a little tweaking before its ready for release.
+
+ * src/*.c
+ Use the UNUSED macro to prevent compiler warnings.
+
+2006-10-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fix a bug in parsing AIFF files with a slightly unusual 'basc' chunk. Thanks
+ to David Viens for providing two example files.
+
+ * src/common.(c|h) src/aiff.c
+ Add a function psf_sanitize_string and use it in aiff.c.
+
+2006-10-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_w64.c
+ Apply a patch from Fons Adriaensen which fixes a minor WAVEX GUID issue.
+
+2006-10-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/Makefile.am
+ Fix problem related to recent test coverage changes.
+
+2006-10-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac tests/Makefile.am
+ Add --enable-test-coverage configure option.
+
+2006-10-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.hh
+ Add an std::string SndfileHandle constructor.
+
+ * tests/scale_clip_test.tpl
+ Fix the 'make distcheck' target.
+
+2006-10-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/double64.c src/float32.c
+ Add optional clipping on float file data to int read data conversions.
+
+ * tests/tests/scale_clip_test.(def|tpl)
+ Add test for above new code.
+
+2006-09-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/aiff_rw_test.c
+ Add 'MARK' chunks to make sure they are parsed correctly.
+
+2006-09-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fix parsing of MARK chunks. Many thanks to Sciss for generating files to
+ help debug the problem.
+
+2006-09-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Make the SF_MIN and SF_MAX macros at least partially type safe.
+
+ * tests/lossy_comp_test.c
+ Fix overflow problems when ensuring that signalis not zero.
+
+2006-08-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac docs/*.html
+ Changes for release 1.0.17.
+
+2006-08-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c
+ Remove inline from functions called by pointer. Thanks to Sampo Savolainen
+ for notifying me of this.
+
+2006-07-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.hh
+ Add writeSync method.
+ Add copy constructor and assignment operator (thanks Daniel Schmitt).
+ Add methods readRaw and writeRaw.
+ Make read/write/readf/writef simple overlaods instead of templates (thanks
+ to Trent Apted for suggesting this).
+
+ * tests/cpp_test.cc
+ Cleanup. Add tests.
+
+2006-07-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.hh
+ Templatize the read/write/readf/writef methods as suggested by Lars Luthman.
+ Prevent the potential leak of SNDFILE* pointers in the openRead/openWrite/
+ openReadWrite methods.
+ Add const to SF_INFO pointer in Sndfile constructor.
+ Make the destrictor call the close() method.
+
+ * tests/cpp_test.cc
+ Add more tests.
+
+2006-07-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/cpp_test.cc
+ Remove the generated file so "make distcheck" passes.
+
+ * src/Makefile.am
+ Add sndfile.hh to distributed header files.
+
+ * src/sndfile.hh
+ Change the license for the C++ wrapper to modified BSD.
+
+2006-07-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.hh
+ Complete it.
+
+ * tests/cpp_test.cc
+ Add more tests.
+
+2006-07-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/utils.tpl
+ Add extern C to generated header file.
+
+ * src/sndfile.hh
+ Work towards completing this.
+
+ * tests/cpp_test.cc tests/Makefile.am
+ Add a C++ test and hook into build.
+
+ * configure.ac
+ Add appropriate CXXFLAGS.
+
+2006-07-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Test if compiler supports -Wpointer-arith.
+
+ * src/common.c
+ Fix a warning resulting from -Wpointer-arith.
+
+2006-07-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Explicitly set endian-ness as well as setting 16 bit output.
+
+ * examples/sndfile-info.c
+ Make sure to parse info if file fails to open.
+
+ * src/sndfile.c
+ Handle parse error a little better.
+
+ * src/wav_w64.[ch]
+ Minor clean up, add detection of IPP ITU G723.1.
+
+2006-06-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Make sure psf->dataoffset gets reset to zero when openning headersless
+ files based on the file name extension.
+
+2006-06-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/(command|lossy_comp|pcm|scale_clip)_test.c tests/fix_this.c
+ tests/write_read_test.(tpl|def)
+ Fix gcc-4.1 compiler warnings about "dereferencing type-punned pointer will
+ break strict-aliasing rules".
+
+ * examples/cooledit-fixer.c
+ More fixes like above.
+
+2006-06-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Fix a windows bug where the syserr string of SF_PRIVATE was not being set
+ correctly.
+
+ * src/sndfile.c
+ Fixed a logic bug in sf_seek(). Thanks to Paul Davis for finding this.
+
+2006-06-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Fixed detection of S_IRGRP.
+
+2006-05-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * sndfile-convert.c
+ Add conversion SF_INSTRUMENT data when present.
+
+2006-05-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/development.html
+ Removed references to tla on windows.
+
+ * src/common.h src/sndfile.c
+ Add separate void pointers for file containter and file codec data to
+ SF_PRIVATE struct. Still need to move all existing fdata pointers.
+
+ * tests/write_read_test.tpl
+ Change the order of some tests.
+
+ * src/aiff.c
+ When writing 'AIFC' files, make sure get an 'FVER' gets added.
+
+ * src/common.h src/(dwvw|flac|g72x|gsm610|ima_adpcm|ms_adpcm|paf|sds).c
+ src/(sndfile|voc|vox_adpcm|xi).c
+ Remove fdata field from SF_PRIVATE struct and replace it with codec_data.
+
+2006-05-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/testprog.c Win32/Makefile.am
+ Add a minimal win32 test program.
+
+ * Win32/README-precompiled-dll.txt Mingw-make-dist.sh
+ Update readme and Mingw build script.
+
+2006-05-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac acinclude.m4
+ Minor fixes for Solaris.
+
+2006-05-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/test_endswap.(def|tpl)
+ Fix printf formatting for int64_t on 64 bit machines.
+
+2006-05-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/binhead_check.py
+ New file to check for bad parameters passed to psf_binheader_writef().
+
+ * src/Makefile.am
+ Hook into test suite.
+
+ * src/voc.c src/caf.c src/wav.c src/mat5.c src/mat4.c
+ Fix bugs found by new test program.
+
+ * src/double64.c
+ Clean up double64_get_capability().
+
+2006-05-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_w64.c
+ Fix a bug on x86_64 where an int was being passed via stdargs and being
+ read using size_t which is 64 bits. Thenks to John ffitch for giving me a
+ login on his box.
+
+2006-05-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/caf.c src/double64.c examples/sndfile-info.c tests/virtual_io_test.c
+ tests/utils.tpl
+ Fix a couple of signed/unsigned problems.
+
+2006-05-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/command_test.c
+ Add channel map tests.
+
+ * src/common.h src/sndfile.c
+ Add a pointer to the SF_PRIVATE struct and make sure it gets freed in
+ sf_close().
+
+2006-04-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac doc/(command|index|api).html NEWS README
+ Updates for 1.0.16 release.
+
+ * src/sndfile.h.in
+ Define enums for channel mapping.
+
+ * examples/sndfile-info.c
+ Clean up usage of SF_INFO struct.
+
+2006-04-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/util.tpl
+ Add function testing function exit_if_true().
+
+ * tests/floating_point_test.tpl
+ Fix a problem where the test program was not exiting when the test failed.
+
+2006-04-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/sndfile.c src/common.h src/command.c
+ Implement new commands SFC_GET_SIGNAL_MAX and SFC_GET_MAX_ALL_CHANNELS.
+
+ * doc/commands.html
+ Document new commands. Other minor updates.
+
+ * tests/peak_chunk_test.c
+ Update tests for new commands.
+
+2006-04-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/peak_chunk_test.c
+ Add test for RIFX and WAVEX files.
+ Try and confuse the PEAK chunk writing by enabling and disabling it.
+
+ * src/sndfile.c
+ Fix a bug where enabling and disabling PEAK chunk was screwing up.
+
+2006-03-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Add the block of 190 reserved bytes into this struct to allow for
+ future expansion.
+
+ * src/wav.c src/sndfile.c src/broadcast.c
+ Significant cleanup of broadcast wave stuff.
+
+ * examples/sndfile-info.c
+ Fix print message.
+
+ * tests/command_test.c tests/Makefile.am
+ Complete bext tests, hook test in test suite.
+
+2006-03-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Make coding_history field of SF_BROADCAST_INFO struct a char array instead
+ of a char pointer.
+
+ * src/sndfile.c src/common.h src/wav.c
+ Clean up knock on effects of above chnage.
+
+ * examples/sndfile-info.c
+ Add -b command line option to usage message.
+ Clean up output of broadcast wave info.
+
+ * src/wav.c
+ Ignore and skip the 'levl' chunk.
+
+2006-03-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Fix handling of --enable and --disable configure args. Thanks to Diego
+ 'Flameeyes' Pettenò who sent the patch.
+
+2006-03-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/win32.html
+ Make it really clear that although the MSVC++ cannot compile libsndfile,
+ the precompiled DLL can be used in C++ programs compiled with MSVC++.
+
+2006-03-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fix bug in writing of INST chunk in AIFF files.
+ Fix potential bug in writing MARK chunks.
+
+ * src/sndfile.c
+ Make sure the instrument chunk can only be written at the start of the file.
+
+ * tests/command_test.c
+ Add check of log buffer.
+
+ * tests/utils.tpl
+ Add usage of space character to psf_binheader_writef.
+
+2006-03-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/Makefile.am tests/Makefile.am
+ Remove --source-time argument from autogen command lines.
+
+ * src/broadcast.c
+ New file for EBU Broadcast chunk in WAV files.
+
+ * src/sndfile.c src/sndfile.h.in src/wav.c src/common.h
+ Add patch from Paul Davis implementing read/write of the BEXT chunk.
+
+2006-03-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/README-precompiled-dll.txt
+ New file descibing how to use the precompiled DLL.
+
+ * Win32/Makefile.am
+ Add Win32/README-precompiled-dll.txt to EXTRA_DIST files.
+
+ * configure.ac
+ Bump version to 1.0.15.
+
+2006-03-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ On read, only add the endian flag if the file is big endian.
+
+ * src/ms_adpcm.c
+ Fixed writing of APDCM coeffs in RIFX files.
+
+ * tests/write_read_test.tpl tests/lossy_comp_test.c
+ Add tests for RIFX files.
+
+2006-03-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Mingw-make-dist.sh
+ Bunch of improvements.
+
+ * doc/win32.html
+ Update MinGW program versions.
+
+2006-03-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/create_symbols_file.py
+ Fix the library name in created win32 DEF file. Add correct DLL name for
+ Cygwin DLL.
+
+ * Win32/Makefile.am tests/Makefile.am
+ Remove redundant files, add win32_ordinal_test to test suite.
+
+ * tests/win32_ordinal_test.c
+ Update to do test in cygsndfile-1.dll as well.
+
+ * doc/win32.html
+ Fix typo, mention that -mno-cygwin with the Cygwin compiler does not work.
+
+ * src/wav.c src/wav_w64.c src/sndfile.c src/sndfile.h.in
+ Apply large patch from Jesse Chappell which adds support for RIFX files.
+
+2006-03-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Makefile.am
+ Add Mingw-make-dist.sh to the extra dist files.
+
+ * configure.ac
+ Fix setting SHLIB_VERSION_ARG for MinGW.
+
+ * tests/win32_ordinal_test.c
+ New test program to test that the win32 DLL ordinals agree with the DEF
+ file.
+
+2006-03-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Add a static inline function to convert an int to a size_t. This will be
+ a compile to nothing on 32 bit CPUs and a sign extension on 64 bit CPUs.
+
+ * src/aiff.c src/avr.c src/common.c src/xi.c src/gsm610.c
+ Fix an ia64 problem where a varargs function was being passed an int in
+ some places and a size_t in other places.
+
+ * src/sd2.c
+ Add a workaround for situations where OSX seems to add an extra 0x52 bytes
+ to the start of the resource fork.
+
+2006-02-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Mingw-make-dist.sh
+ Add a shell script to build the windows binary/source ZIP file.
+
+ * doc/index.html
+ Add download link for windows binary/source ZIP file. Add links for GPG
+ signatures.
+
+ * doc/win32.html
+ Remove info about building using microsoft compiler.
+
+ * configure.ac
+ Bump version to 1.0.14.
+
+2006-02-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sd2.c
+ Improve logging of errors in resource fork parser.
+
+2006-01-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/Makefile.msvc
+ Replace au_g72x.* with g72x.*. Thanks to ussell Borogove.
+
+2006-01-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Make sure return values are initialised header buffer is full.
+
+ * src/wav.c
+ Add workarounds for messed up WAV files.
+
+2006-01-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/config.h
+ Undef HAVE_INTTYPES_H for win32.
+
+ * tests/command_test.c
+ Don't exit on error in instrument test for XI files.
+
+ * configure.ac
+ Bump version to 1.0.13.
+
+ * doc/*.html NEWS README
+ Update version numbers.
+
+2006-01-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/xi.c
+ Start work on add read/write of instrument chunks.
+
+ * src/command_test.c
+ Add tests for XI instrument chunk.
+
+ * tests/largefile_test.c tests/Makefile.am
+ Add new test and hook it into the build system. This test will not be run
+ automatically because it requires 3 Gig of disk space and takes 3 minutes
+ to run.
+
+2006-01-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Fix calculation of samples remaining in win32 code. Thanks Axel Röbel.
+
+ * src/common.h
+ Make sure length of header buffer can hold header plus strings. Thanks Axel
+ Röbel.
+
+2006-01-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/aiff.c src/wav.c
+ Apply a patch from John ffitch (Csound project).
+ Add detune field to SF_INSTRUMENT struct.
+ Add reading/writing instrument chunks to WAV files.
+
+ * tests/command_test.c
+ Update SF_INSTRUMENT tests.
+
+ * tests/Makefile.am
+ Hook instrument tests into test suite.
+
+2006-01-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Check for <inttypes.h> because some broken systems (like Solaris) don't have
+ <stdint.h> which is the 1999 ISO C standard file containing int64_t.
+
+ * src/sfendian.h src/common.h
+ Use <inttypes.h> if <stdint.h> is not available.
+
+2005-12-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/peak_chunk_test.c
+ Extend and clean up tests.
+
+ * src/sndfile.c
+ Fix a bug that prevented the turning off of PEAK chunks.
+
+2005-12-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/error_test.c
+ Make the test distclean correct.
+
+ * src/file_io.c
+ Fix an SD2 MacOSX bug (reported by vince schwarzinger).
+
+2005-12-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c tests/command_test.c
+ Apply a big patch from John ffitch (Csound project) to add reading and
+ writing of instrument chunks to AIFF files. Also update the test.
+
+2005-12-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/aiff_rw_test.c tests/virtual_io_test.c tests/utils.tpl
+ Move test function dump_data_to_file() to utils.tpl.
+
+ * tests/error_test.c tests/Makefile.am
+ Updates, including a new test to test that sf_error() returns a valid error
+ number.
+
+2005-12-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/list_formats.c
+ Make sure the SF_INFO struct is memset to all zero before being used.
+ Thanks to Stephen F. Booth.
+
+ * src/sndfile.c
+ Make the return value of sf_error() match the API documentation.
+
+2005-11-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Allow conversion to raw gsm610.
+
+ * src/common.h src/sndfile.c src/au.c
+ Remove au_nh_open() and all references to it (wasn't working anyway).
+
+ * tests/headerless_test.c
+ Add new test for file extension based detection.
+
+ * src/sndfile.c
+ Rejig file extension based file type detection.
+
+2005-11-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Add "gsm" as a recognised file extension when no magic number can be found.
+
+ * tests/lossy_comp_test.c tests/Makefile.am
+ Test headerless GSM610.
+
+2005-11-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html
+ Fix a minor typo and a minor error. Thanks Christoph Kobe and John Pavel.
+
+2005-10-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_w64.c
+ Add more reporting of 'fmt ' chunk for G721 encoded files.
+
+ * src/wav.c
+ Gernerate a more correct 20 byte 'fmt ' chunk rather than a 16 byte one.
+
+2005-10-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/G72x/g72x.[ch]
+ Minor cleanup of interface.
+
+2005-10-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ogg.c
+ Removed the horribly broken and non-functional OGG implementation when
+ --enable-experimental was enabled. When OGG does finally work it will be
+ merged.
+
+ * src/caf.c
+ Fix a memory leak.
+
+2005-10-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/g72x.c src/G72x/*.(c|h) src/common.h src/sndfile.c src/wav.c src/au.c
+ Add support for G721 encoded WAV files.
+
+ * doc/index.html
+ Update support matrix.
+
+ * tests/lossy_comp_test.c
+ For file formats that support it, add string data after the audio data and
+ make sure it isn't treated as audio data on read.
+
+ * src/gsm610.c
+ Add code to ensure that the container close function (ie for WAV files) gets
+ called after the codec's close function. This allows GSM610 encoded WAV files
+ to have string data following the audio data.
+ Add an AIFF specific check on psf->datalength.
+
+ * src/wav.c
+ Simplify wav_close function.
+
+ * src/aiff.c
+ Make sure the tailer data gets written at an even file offset. Pad if
+ necessary.
+
+ * src/common.h
+ Replace the close function pointer in SF_PRIVATE with separate functions
+ codec_close and container_close. The former is always called first.
+
+ * src/*.c
+ Fix knock on effects of above.
+
+2005-10-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-info.c
+ Complete dumping SF_INSTRUMENT data.
+
+ * src/dwvw.c src/ima_adpcm.c src/gsm610.c src/ms_adpcm.c
+ Add extra checks in *_init function.
+
+ * tests/lossy_comp_test.c
+ Add a string comment to the end of the files to make sure that the decoder
+ doesn't decode beyond the end of the audio data section.
+
+2005-10-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-info.c
+ Minor code cleanup.
+ Start work on dumping SF_INSTRUMENT data.
+
+2005-10-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/common.h src/common.c
+ Update definition of SF_INSTRUMENT struct and create a function to allocate
+ and initialize the struct (input from David Viens).
+ Clean up definition of SF_INSTRUMENT struct.
+
+ * src/wav.c src/wav_w64.c
+ Add support for Ambisoncs B WAVEX files (David Viens).
+
+ * src/aiff.c src/wav.c src/wav_w64.c
+ Start work on reading/writing the SF_INSTRUMENT data.
+
+ * src/sndfile.c
+ Add code to get and set SF_INSTRUMENT data.
+
+ * tests/command_test.* tests/Makefile.am
+ Add test for set and getof SF_INSTRUMENT data.
+ The file command_test.c is no longer autogen generated.
+
+2005-10-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/gsm610.c
+ Minor cleanup.
+
+2005-10-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/lossy_comp_test.c
+ Minor cleanup.
+
+2005-10-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c
+ Ensure sfconfig.h is included before any other header file.
+
+ * src/file_io.c
+ Add comments documenting the three sections of the file.
+
+ * src/gsm610.c
+ Make sure SF_FORMAT_WAVEX are handled correctly.
+
+2005-10-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Add options to allow disabling of FLAC and ALSA. Suggested by Ben Greear.
+
+2005-09-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/locale_test.c
+ Modify the way the unicode strings were encoded so that older compilers
+ do not complain. Thanks Axel Röbel.
+
+ * configure.ac
+ Bump the version to 1.0.12 for release.
+
+ * NEWS README Win32/config.h doc/(FAQ|index.html|command|api).html
+ Update version numbers.
+
+2005-09-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c
+ Fix valgrind error and minor cleanup.
+
+2005-09-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/(au|paf|aiff|w64|wav|svx).c
+ Make sure structs are initialised.
+
+2005-09-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Make -Wdeclaration-after-statement work with --enable-gcc-werror configure
+ option.
+ Add -std=gnu99 (C99 plus posix style stuff like gmtime_r) to CFLAGS if the
+ compiler supports it.
+
+2005-09-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac acinclude.m4
+ Add -Wdeclaration-after-statement to CFLAGS if the compilers supports it.
+
+2005-09-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/util.(tpl|def)
+ Make the test_write_*_or_die() functions const safe.
+
+2005-09-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/nist.c
+ Make sure the data offset is read from the file header. Thanks to
+ David A. van Leeuwen for a patch.
+
+2005-09-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/sfconfig.h
+ Check for <locale.h> and the function setlocale().
+ Set config variables to zero if not found.
+
+ * tests/locale_test.c tests/Makefile.am
+ Add new test program and hook into build/test system.
+
+2005-09-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/file_io.c
+ On windows, use windows specific types for file handles.
+ Add functions psf_init_files() and psf_use_rsrc().
+
+ * src/sd2.c
+ Make resource fork handling independant of file desciptor/handles.
+
+ * src/sndfile.c src/test_file_io.c
+ Fix knock on effects.
+
+2005-09-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/float_cast.h
+ The lrint and lrintf implementations in Cygwin are both buggy and slow.
+ Add replacements which were pulled from the Public Domain MinGW math.h
+ header file.
+
+2005-09-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/(lossy_comp_test|virtual_io_test).c
+ More Valgrind fixups.
+
+ * configure.ac
+ Simplify and correct configuring for Cygwin.
+
+ * Win32/config.h Win32/sndfile.h Win32/Makefile.msvc
+ Update build for MSVC.
+
+2005-09-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/lossy_comp_test.c
+ Make sure to close SNDFILE when exiting test when file format is not seekable.
+
+ * tests/(aiff_rw_test|virtual_io_test).c
+ Do a few valgrind fix ups.
+
+2005-09-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/float32.c src/double64.c
+ Replace floating point equality comparisons with greater/less comparisons.
+ Found by John Pavel using the Intel compiler.
+
+ * src/sfconfig.h
+ New file to clean up issues surrounding autoconf generated preprocessor
+ symbols.
+
+ * src/*.(c|h) tests/*.(c|tpl) examples/*.c
+ Fixed a bunch of other stuff found by John Pavel using the Intel compiler.
+
+ * src/file_io.c
+ Remove Mac OS9 Metrowerks compiler specific hacks.
+
+2005-08-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/w64.c
+ Cast integer literal to sf_count_t in call to psf_binheader_writef() to
+ prevent Valgrind error.
+
+2005-08-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/command.html
+ Improve documentation of SF_GET_FORMAT_SUBTYPE.
+
+2005-08-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Allow files to be converted to SD2 format.
+
+ * src/sd2.c
+ Fix a bug in reading and writing of SD2 files on little endian CPUs.
+ Thanks to Matthew Willis for finding this.
+
+2005-08-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html
+ Update Note2 to point to SFC_SET_SCALE_FLOAT_INT_READ.
+
+2005-08-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Use $host_os instead of $target_os (thanks to Mo De Jong).
+
+2005-08-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/Makefile.am
+ Apply a patch from Mo DeJong to allow building outside of the source dir.
+
+ * src/file_io.c
+ Fix psf_fsync() for win32.
+
+ * src/wav.c src/wav_w64.(c|h)
+ Move some code from wav.c to wav_w64.c to improve the log output of files of
+ type WAVE_FORMAT_EXTENSIBLE.
+
+2005-08-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/create_symbols_file.py
+ Make sure sf_write_fsync is an exported symbol.
+
+ * examples/sndfile-convert.c
+ Add support for writing VOX adpcm files.
+
+2005-07-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html
+ Document the new function sf_write_sync().
+
+ * doc/FAQ.html
+ Do you plan to support XYZ codec.
+
+2005-07-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/sndfile.c
+ Add function sf_write_sync() to the API.
+
+ * src/common.h src/file_io.c
+ Low level implementation (win32 not done yet).
+
+ * tests/write_read_test.tpl
+ Use the new function in the tests.
+
+2005-07-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/double64.c src/float32.c src/sndfile.c
+ Change the way PEAK chunk info is stored. Peaks now stored as an sf_count_t
+ for position and a double as the value.
+
+ * src/aiff.c src/caf.c src/wav.c
+ Fix knock on effects of above changes.
+
+ * src/caf.c
+ Implement 'peak' chunk for file wuth data in SF_FORMAT_FLOAT or
+ SF_FORMAT_DOUBLE format.
+
+2005-07-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/nist.c
+ Fix a bug where a variable was being used without being initialized.
+
+ * src/flac.c
+ Add extra debug in sf_flac_meta_callback.
+ Make a bunch of private functions static.
+
+ * src/aiff.c src/wav.c
+ Fix allocation for PEAK_CHUNK (bug found using valgrind).
+
+2005-07-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Move the peak_loc field of SF_PRIVATE to the PEAK_CHUNK struct.
+ Remove had_peak field of SF_PRIVATE, use pchunk != NULL instead.
+ Rename PEAK_CHUNK and PEAK_POS to PEAK_CHUNK_32 and PEAK_POS_32.
+
+ * src/aiff.c src/caf.c src/wav.c src/float32.c src/double64.c
+ Fix knock on effects from above.
+
+2005-07-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Prevent files with unknown chunks from being opened read/write.
+
+2005-07-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/flac.c
+ Do not use psf->end_of_file because it never gets set to anything.
+
+ * src/common.h
+ Remove unused SF_PRIVATE field end_of_file.
+
+2005-07-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Change the 'S' format specifier of psf_binheader_writef() to write AIFF
+ style strings (no terminating character).
+
+ * src/aiff.c
+ Move to new (correct) AIFF string style. Thanks to Axel Röbel for being
+ so persistent on this issue.
+
+2005-07-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Allow SFE_UNSUPPORTED_FORMAT as an error from sf_open().
+
+ * doc/api.html doc/command.html
+ Documentation updates (thanks to Kyroz for promoting these updates).
+
+ * src/mat5.c
+ Modify the way the header is written.
+
+2005-07-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/caf.c
+ Add a 'free' chunk to the written file so that the audio data starts at
+ an offset of 0x1000.
+
+ * src/sndfile.c
+ Allow SFE_UNSUPPORTED_FORMAT as an error from sf_open().
+
+2005-07-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/caf.c src/sndfile.c
+ Add support for signed 8 bit integers.
+
+ * tests/write_read_test.tpl
+ Add test for signed 8 bit integers in CAF files.
+
+ * doc/index.html
+ Update matrix for signed 8 bit integers in CAF files.
+
+2005-07-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Update sf_check_format() to support CAF.
+
+ * examples/sndfile-convert.c
+ Add support for ".caf" file extension.
+
+ * doc/index.html
+ Add Apple CAF to the support matrix.
+
+ * src/caf.c
+ Add file write support.
+
+ * src/common.c
+ Fix printing of Frames.
+
+ * tests/Makefile.am tests/write_read_test.tpl tests/lossy_comp_test.c
+ tests/header_test.tpl misc_test.c
+ Add tests for CAF files.
+
+2005-07-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Fix Q/A about reading/writing memory buffers.
+
+ * src/caf.c
+ Bunch of work to support reading of CAF files.
+
+2005-07-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/(aiff|ima_adpcm|mat4|mat5|ms_adpcm).c examples/sndfile-play.c
+ Fix sign conversion errors reported by gcc-4.0.
+
+ * src/caf.c
+ New file for Apple's Core Audio File format.
+
+ * src/sndfile.c src/common.h src/sndfile.h.in src/Makefile.am
+ Hook new file into build system.
+
+2005-06-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src_wav_w64.c
+ Fix handling of stupidly large 'fmt ' chunks. Thanks to Vadim Berezniker
+ for supplying an example file.
+
+ * src/common.h src/sndfile.c
+ Remove redundant error code SFE_WAV_FMT_TOO_BIG.
+
+2005-06-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/common.h src/sndfile.c
+ Add public error value SF_ERR_MALFORMED_FILE.
+
+ * src/sndfile.c
+ When parsing a file header fails and we don't have a system error, then set
+ the error number to SF_ERR_MALFORMED_FILE (suggested by Kyroz).
+
+ * configure.ac
+ Allow sqlite support to be disabled in configure script.
+
+ * regtest/database.c regtest/sndfile-regtest.c
+ Fix compiling when sqlite is missing.
+
+2005-06-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Fix psf_is_pipe() and return value of psf_fread() when using virtual i/o.
+
+ * src/sndfile.c
+ Fix VALIDATE_AND_ASSIGN_PSF macro for virtual i/o.
+
+ * tests/virtual_io_test.c
+ Fill in skeleton test program.
+
+ * tests/Makefile.am
+ Move virtual i/o tests to end of tests with stdio/pipe tests.
+
+ * src/(sndfile.h.in|file_io.c|common.h|sndfile.c) tests/virtual_io_test.c
+ Rename some of the virtual i/o functions and data types.
+
+2005-06-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fix the return values of sf_commands : SFC_SET_NORM_DOUBLE,
+ SFC_SET_NORM_FLOAT, SFC_GET_LIB_VERSION and SFC_GET_LOG_INFO. Thanks to
+ Kyroz for pointing out these errors.
+
+ * doc/command.html
+ Correct documented return values for SFC_SET_NORM_DOUBLE and
+ SFC_SET_NORM_FLOAT. Thanks to Kyroz again.
+
+2005-05-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * regtest/*
+ Add new files for sndfile-regtest program.
+
+ * configure.ac Makefile.am
+ Hook regetest into build.
+
+ * src/wav.c src/common.c
+ Fix a regression where long ICMT chunks were causing the WAV parser
+ to exit.
+
+2005-05-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * libsndfile.spec.in
+ Add html docs to the files section as suggested by Karsten Jeppesen.
+
+ * src/aiff.c
+ Fix parsing of odd length ANNO chunks.
+
+2005-05-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Change the include guard to prevent clashes with other code.
+
+2005-05-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Improve error handling in code for playback under Linux/ALSA.
+
+2005-05-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ircam.c
+ Fix writing of IRCAM files on big endian systems (thanks to Axel Röbel).
+
+ * src/wav.c
+ Add workaround for files created by the Peak audio editor on Mac which can
+ produce files with very short LIST chunks (thanks to Jonathan Segel who
+ supplied the file).
+
+2005-04-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Apply a patch From David Viens to make the parsing of basc chunks more
+ robust.
+
+ * src/wav.c
+ Another patch from David Viens to write correct wavex channel masks for
+ the most common channel configurations.
+
+2005-04-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/command.c
+ Only allow FLAC in the format arrays if FLAC is enabled. Thanks to
+ Leigh Smith.
+
+2005-03-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Add a directory field for storing the file directory to the SF_PRIVATE
+ struct.
+
+ * src/sndfile.c
+ Grab the directory name when copying the file path.
+
+ * src/file_io.c
+ Cleanup psf_open_rsrc() and also check for resource fork in
+ .AppleDouble/filename.
+
+2005-03-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/svx.c
+ Fix a bug in the printing of the channel count. Bug reported by Michael
+ Schwendt. Thanks.
+
+2005-01-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/paf.c
+ Fix a seek bug for 24 bit PAF files.
+
+ * tests/write_read_test.tpl
+ Update write_read_test to trigger the previously hidden PAF seek bug.
+
+2005-01-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c src/w64.c src/wav.c
+ Do not return a header parse error when the log buffer overflows.
+ Continuing parsing works even on files where the log buffer does overflow.
+ This avoids a bug on some weirdo WAV (and other) files.
+
+ * src/common.h src/sndfile.c
+ Remove SFE_LOG_OVERRIN error and its associated error message.
+
+ * src/file_io.c
+ Fix a rsrc fork problem on MacOSX.
+
+2004-12-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile-play.c
+ In the ALSA output code, added call to snd_pcm_drain() just before
+ snd_pcm_close() as suggested by Thomas Kaeding.
+ In the OSS output code, added two ioctls (SNDCTL_DSP_POST and
+ SNDCTL_DSP_SYNC) just before the close of the audio device.
+
+ * tests/virtual_io_test.c tests/Makefile.am
+ Add a new test program (currently empty) and add it to the build.
+
+2004-12-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/sndfile.h src/common.h src/file_io.c
+ src/create_symbols_file.py
+ Apply patch from Steve Baker which is the beginnings of a virtual
+ I/O interface.
+
+2004-12-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c src/sndfile.h.in
+ Const-ify the write path throughout the library.
+
+2004-12-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/development.html
+ Minor improvements.
+
+2004-11-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/bugs.html
+ Minor improvements.
+
+2004-11-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Add workaround for Logic Platinum AIFF files with broken COMT chunks.
+
+2004-11-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Remove some ambiguities in the SD2 FAQ answer.
+
+2004-11-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/sndfile.h Win32/config.h MacOS9/sndfile.h MacOS9/config.h
+ Updates from autoconfig versions.
+
+2004-11-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fix parsing of COMT chunks. Store SF_STR_COMMENT data in ANNO chunks
+ instead of COMT chunk.
+
+2004-11-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c src/common.h
+ Change the ptr argument to psf_write() from "void*" to a "const void*".
+ Thanks to Tobias Gehrig for suggesting this.
+
+2004-10-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c src/common.h
+ Add functions psf_close_rsrc() and read length of resourse fork into
+ rsrclength field of SF_PRIVATE.
+
+ * src/sd2.c
+ Make sure resource fork gets closed.
+
+ * tests/util.tpl
+ Add functions to check for file descriptor leakage.
+
+ * src/write_read_test.tpl
+ Use the file descriptor leak checks.
+
+ * src/sndfile.h.in
+ Add SFC_GET_LOOP_INFO and SF_LOOP_INFO struct.
+
+ * src/common.h
+ Add SF_LOOP_INFO pointer to SF_PRIVATE.
+
+ * src/wav.c src/aiff.c
+ Improve and add parsing of 'ACID' and 'basc' chunks, filling in
+ SF_LOOP_INFO data in SF_PRIVATE.
+
+2004-10-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sd2.c
+ Further cleanup: remove printfs, change snprintf to LSF_SNPRINTF.
+
+ * Win32/config.h Win32/sndfile.h
+ Updates.
+
+ * tests/util.tpl
+ Add win32 macro for snprintf.
+
+2004-10-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sfendian.h
+ Add macros : H2BE_SHORT, H2BE_INT, H2LE_SHORT and H2LE_INT.
+
+ * src/sd2.c
+ Use macros to make sure writing SD2 files on little endian machines works
+ correctly.
+
+ * tests/util.tpl
+ Add a delete_file() function which also deletes the resource fork of SD2
+ files.
+
+ * tests/write_read_test.tpl
+ Use delete_file() so that "make distcheck" works.
+
+2004-10-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/file_io.c
+ Move resource filename construction and testing to psf_open_rsrc().
+
+ * src/common.h src/sndfile.c
+ Add error SFE_SD2_FD_DISALLOWED.
+
+ * tests/util.tpl tests/*.(c|tpl)
+ Add and allow_fd parameter to test_open_file_or_die() so that use of
+ sf_open_fd() can be avoided when opening SD2 files.
+
+2004-10-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Update ACID chunk parsing.
+
+ * src/sd2.c
+ More fixes for files with large resource forks.
+
+2004-10-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/sndfile.c
+ Add error numbers and messages for sd2 files.
+
+ * src/sd2.c
+ Reading of sd2 (resource fork version) now seems to be working.
+
+2004-10-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.h
+ Update file_io.c to include win32 psf_rsrc_open().
+
+ * tests/floating_point_test.tpl
+ Remove use of __func__ in test programs (MSVC++ doesn't grok this).
+
+ * Win32/(config|sndfile).h MacOS9/(config|sndfile).h
+ Updates.
+
+2004-10-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sfendian.h
+ Fix endswap_int64_t_(array|copy).
+
+ * src/test_endswap.(tpl|def)
+ Add tests for above and inprove all tests.
+
+2004-10-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sfendian.h
+ Improve type safety, add endswap_double_array().
+
+ * src/double64.c
+ Use endswap_double_array() instead of endswap_long_array().
+
+ * src/test_endswap.(tpl|def) src/Makefile.am
+ Add preliminary endswap tests and hook into build system.
+
+2004-10-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/configure.ac src/makefile.am
+ Finally fix the bulding of DLLs on Win32/MinGW.
+
+ * tests/makefile.am
+ Fix running of tests on Win32/MinGW.
+
+2004-10-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/sndfile.c tests/floating_point_test.tpl
+ Rename SFC_SET_FLOAT_INT_MULTIPLIER to SFC_SET_SCALE_FLOAT_INT_READ.
+
+ * doc/command.html
+ Document SFC_SET_SCALE_FLOAT_INT_READ.
+
+2004-09-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/floating_point_test.(tpl|def)
+ Derived from floating_point_test.c.
+ Add (float|double)_(short|int)_test functions.
+
+ * tests/util.(tpl|def)
+ Make separate float and double versions of gen_windowed_sine().
+
+ * tests/write_read_test.tpl
+ Fix after changes to gen_windowed_sine().
+
+ * src/(float32|double64).c
+ Implement SFC_SET_FLOAT_INT_MULTIPPLIER.
+
+2004-09-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * acinclude.m4
+ Fix warnings from automake 1.8 and later.
+
+ * examples/sndfile-info.c
+ Add a "fflush (stdout)" after printing Win32 message.
+
+2004-09-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/Makefile.mingw.in
+ Add a "make install" target.
+
+2004-09-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/common.h src/sndfile.c src/command.c
+ Start work on adding command SFC_SET_FLOAT_INT_MULTIPLIER.
+
+2004-09-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Fix a bug converting stereo integer PCM files to float.
+
+2004-09-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Appy patch from Conrad Parker to make Mac OSX error messages more
+ consistent and informative.
+
+ * doc/api.html
+ Fix a HTML HREF which was wrong.
+
+ * doc/win32.html
+ Add information about when nmake fails.
+
+2004-09-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Another patch from Denis Cote to prevent race conditions.
+
+2004-09-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/ms_adpcm.c src/ima_adpcm.c
+ Fix alternative to ISO standard flexible struct array feature for broken
+ compilers.
+
+2004-08-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/string.c src/sndfile.c
+ Make sf_set_string() return an error if trying to set a string when in
+ read mode.
+
+2004-08-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Change the unnamed union into a named union so gcc-2.95 will compile it.
+
+ * src/*.c
+ Fixes to allow for the above change.
+
+2004-08-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Fixes for Win32. Thanks to Denis Cote.
+
+ * Win32/Win32/Makefile.(msvc|mingw.in)
+ Fix build system after removal of sfendian.h.
+ Build sndfile-convert.
+
+ * src/Makefile.am
+ Remove sfendian.c from dependancies.
+
+2004-08-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Fix typo in comments (thanks Tommi Sakari Uimonen).
+
+2004-07-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/(a|u)law_test.c
+ Minor cleanup.
+
+2004-07-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/(pcm|float|double64|ulaw|alaw|xi).c
+ Optimise read/write loops by removing a redundant variable.
+
+2004-07-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Remove call to fsync() in psf_close().
+
+2004-07-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pcm.c
+ Inline x2y_array() functions where possible.
+
+ * configure.ac
+ Detect presence of type int64_t.
+
+ * src/sfendian.c src/sfendian.h
+ Move functions in the first file to the sfendian.h as static inline
+ functions.
+ Improve endswap_long_*() where possible.
+
+2004-07-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pcm.c
+ When converting from unsigned char to float or double, subtract 128 before
+ converting to float/double rather than after to save a floating point
+ operation as suggested by Stefan Briesenick.
+
+ * src/(pcm|sfendian|alaw|ulaw|double64|float32).c
+ Optimize inner loops by changing the loop counting slightly as suggested
+ by Stefan Briesenick.
+
+ * configure.ac
+ Detect presence of <byteswap.h>.
+
+ * src/sfendian.h
+ Use <byteswap.h> if present as suggested by Stefan Briesenick.
+
+ * src/pcm.c
+ Update bytewapping.
+
+2004-07-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/*.c
+ Change the psf->buffer field of SF_PRIVATE into a more type safe union with
+ double, float, int etc elements.
+
+2004-06-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Merge slightly modifed patch from Stanko Juzbasic which allows playback of
+ mono files on MacOSX.
+
+2004-06-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Move copy_metadata() after the second sf_open().
+
+2004-06-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Fix a bug which caused the program to go into an infinite loop if the source
+ file has no meta-data. Thanks to Ron Parker for reporting this.
+
+ * src/sndfile.h.in
+ Add SF_STR_FIRST and SF_STR_LAST to allow enumeration of string types.
+
+ * Win32/sndfile.h MacOS9/sndfile.h
+ Update these as per the above file.
+
+2004-06-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/common.h src/ogg.c src/sndfile.c src/sndfile.h.in
+ src/Makefile.am
+ Apply large patch from Conrad Parker implementing Ogg Vorbis, Ogg Speex and
+ Annodex support via liboggz and libfishsound. Thanks Conrad.
+
+2004-06-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/avr.c src/ircam.c src/nist.c src/paf.c src/xi.c
+ Add cast to size_t for some parameters passed to psf_binheader_writef. This
+ is Debian bug number 253490. Thanks to Anand Kumria and Andreas Jochens.
+
+ * src/w64.c
+ Found and fixed a bug resulting from use of size_t when writing W64 'fmt '
+ chunk.
+
+2004-06-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Bump version to 1.0.10 ready for release.
+
+ * Makefile.am
+ Remove redundant files (check_libsndfile.py libsndfile_version_convert.py)
+ from distribution tarball.
+
+ * tests/header_test.tpl
+ Fix uninitialised variable.
+
+ * src/GSM610/short_term.c
+ Fix compiler warning on MSVC++.
+
+2004-05-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Improve record keeping of chunks seen and return an error if a file with
+ unusual chunks is opened in mode SFM_RDWR.
+
+ * src/mmreg.h
+ This file not needed so remove it.
+
+2004-05-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/header_test.tpl
+ Add extra_header_test().
+
+ * src/common.h src/sndfile.c
+ Add SFE_RDWR_BAD_HEADER error number and string.
+
+2004-05-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/utils.tpl tests/*.c tests/*.tpl
+ Add a line number argument to check_log_buffer_or_die() and update all
+ files that use that function.
+
+ * tests/header_test.tpl
+ Modify/update tests for files opened SFM_RDWR and SFC_UPDATE_HEADER_AUTO.
+
+ * src/aiff.c src/wav.c
+ Fix another bug in AIFF and WAV files opened in SFM_RDWR and using
+ SFC_UPDATE_HEADER_AUTO.
+
+ * src/test_file_io.c
+ Add a test for psf_ftruncate() function.
+
+2004-05-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fix another weird corner case bug found by Martin Rumori. Thanks.
+
+ * tests/header_test.(tpl|def)
+ Two new files to test for the absence of the above bug and include tests
+ moved from tests/misc_test.c.
+
+ * tests/Makefile.am
+ Hook new tests into build/test system.
+
+ * tests/misc_test.c
+ Remove update_header_test() which has been moved to the new files above.
+
+2004-05-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fixed a bug reported by Martin Rumori on the LAD list. If a file created
+ with a format of SF_FORMAT_FLOAT and then closed before any data is written
+ to it, the header can get screwed up (PEAK chunk gets overwritten).
+
+ * tests/write_read_test.tpl
+ Add a test (empty_file_test) for the above bug.
+
+2004-05-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/Makefile.mingw.in
+ Added a Makefile for MinGW (needs to be processed by configure).
+
+ * src/mmsystem.h src/mmreg.h
+ Add files from the Wine project (under the LGPL) to allow build of
+ sndfile-play.exe under MinGW.
+
+2004-05-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/GSM610/gsm610_priv.h
+ Replace ugly macros with inline functions.
+
+ * src/GSM610/*.c
+ Remove temporary variables used by macros and other minor fixes required by
+ above change.
+
+2004-05-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/pipe_test.tpl tests/stdio_test.c Win32/Makefile.msvc
+ Make sure these programs compile (even though they do nothing) on Win32
+ and add them to the "make check" target.
+
+ * src/sfendian.h
+ Fix warning on Sparc CPU and code cleanup.
+
+2004-05-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Fix warning messages when compiling under MinGW.
+
+2004-05-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Set HAVE_FLEXIBLE_ARRAY in src/config.h depending on whether the compiler
+ accepts the flexible array struct member as per 1999 ISO C standard.
+
+ * src/common.h src/ima_adpcm.c src/paf.c src/ms_adpcm.c
+ Added ugly #if HAVE_FLEXIBLE_ARRAY and provided a non-standards compliant
+ hack for non 1999 ISO C compliant compilers.
+
+2004-04-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/strings.c
+ If adding an SF_STR_SOFTWARE string, only append libsndfile-X.Y.Z if the
+ string does not already have libsndfile in the string. Thanks to Conrad
+ Parker.
+
+ * tests/string_test.c
+ Add test to verify the above.
+
+ * examples/sndfile-convert.c
+ Add ability to transcode meta data as well (Conrad Parker).
+
+2004-04-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/command.html
+ Fix minor error. Thanks to Simon Burton.
+
+ * doc/win32.html
+ Started adding instructions for compiling libsndfile under MinGW.
+
+ * configure.ac
+ Add --enable-bow-docs to enable black text on a white background HTML docs.
+
+ * doc/libsndfile.css.in
+ This is now a template file for configure which sets the foreground and
+ background colours.
+
+2004-04-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Do some MinGW fixes.
+
+ * configure.ac doc/Makefile.am
+ Install HTML docs when doing make install.
+
+2004-04-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-info.c
+ Print out the dB level with the signal max.
+
+2004-04-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Define S_ISSOCK in src/file_io.c if required.
+
+2004-04-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Improve printout configuration summary (as suggested by Axel Röbel).
+
+ * doc/index.html
+ Add link to pre-release location.
+
+ * src/sndfile.h.in
+ Remove comma after last element of enum.
+
+ * src/float32.c src/double64.c
+ Fix read/write of float/double encoded raw files to/from pipes.
+
+ * tests/pipe_test.c tests/pipe_test.tpl tests/pipe_test.def
+ Turn pipe_test.c into an autogenerated file and add tests for reading/
+ writing floats and doubles.
+
+ * tests/Makefile.am
+ Hook tests/pipe_test.* into build system.
+
+2004-04-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac acinclude.m4
+ Rename AC_C_STRUCT_HACK macro to AC_C99_FLEXIBLE_ARRAY.
+
+2004-03-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/misc_test.c
+ Perform update_header_test in RDWR mode as well.
+
+ * src/aiff.c
+ Fix problems when updating header in RDWR mode.
+
+2004-03-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c src/w64.c src/wav_w64.c
+ Integrate code supplied by David Viens for supporting microsoft's
+ WAVEFORMATEXTENSIBLE stuff. Thanks David for supplying this.
+
+ * configure.ac doc/*.html
+ Bump version to 1.0.9.
+
+2004-03-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/command.c src/sndfile.c src/sndfile.h.in src/wav.c
+ Started work on supporting microsoft's WAVEFORMATEXTENSIBLE gunk.
+
+2004-03-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/avr.c
+ New file to handle Audio Visual Resaerch files.
+
+ * src/sndfile.h.in src/common.h src/sndfile.c src/command.c
+ Hook AVR into everything else.
+
+ * tests/Makefile.am tests/write_read_test.tpl tests/misc_test.c
+ Add testing for AVR files.
+
+2004-03-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Fix psf_set_file() for win32. Thanks to Vincent Trussart (Plogue Art et
+ Technologie) for coming up with the solution.
+
+2004-03-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.tpl
+ Fixed a bug that was causing valgrind to report a memory leak. The bug was
+ in the test code itself, not the library.
+
+2004-03-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/generate.cs
+ An example showing how to use libsndfile from C#. Thanks to James Robson
+ for providing this.
+
+2004-03-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Fix problems with WAV files containing large chunks after the 'data'
+ chunk. Thanks to Koen Tanghe for providing a sample file.
+
+2004-03-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Detect presense of ALSA (Advanced Linux Sound Architecture).
+
+ * examples/sndfile-play.c
+ Add ALSA output support.
+
+ * examples/Makefile.am
+ Add ALSA_LIBS to link line of sndfile-play.c.
+
+2004-03-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * acinclude.m4
+ Add new macro (AC_C_STRUCT_HACK) to detect whether the C compiler allows
+ the use of the what is known as the struct hack introduced by the 1999 ISO
+ C Standard.
+
+ * configure.ac
+ The last release would not compile with gcc-2.95 due to the use of features
+ (ie struct hack) introduced by the 1999 ISO C Standard.
+ Add check to make sure compiler handles this and bomb out if it doesn't.
+
+2004-03-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.tpl
+ Fix compiler warning on Win32.
+
+ * src/file_io.c
+ Fix use of an un-initialised variable in Win32 stuff.
+
+ * Win32/config.h examples/sndfile-play.c
+ Win32 fixes.
+
+2004-03-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Fix bug which occurres when configuring for MinGW.
+ If compiler is gcc and cross compiling use -nostdinc.
+
+2004-03-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/aiff.c src/wav.c src/float32.c src/double64.c
+ src/sndfile.c
+ Fix a bug with PEAK chunk handling for files with more than 16 channels.
+ Thanks to Remy Bruno for finding this.
+
+2004-03-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Fix a bug which was preventing WAV files being openned correctly if the
+ file had a very large header. Thanks to Eldad Zack for finding this.
+
+2004-03-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/file_io.c
+ Fix cross-compiling from Linux to Win32 using the MinGW tools.
+
+2004-03-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/create_symbols_file.sh
+ Christian Weisgerber pointed out that the shell script did not run on a
+ real Bourne shell although it did run under Bash in Bourne shell mode.
+
+ * src/create_symbols_file.py
+ Rewrite of above in Python. Also add support for writing Win32 .def files.
+ The Python script generates Symbols.linux, Symbols.darwin and
+ libsndfile.def (Win32 version). These files get shipped with the tarball
+ so there should not be necessary to run the Python script when building
+ the code from the tarball.
+
+ * configure.ac src/Makefile.am Win32/Makefile.am
+ Hook new Python script into the build system.
+
+2004-02-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/configure.ac
+ Add --enable-gcc-werror option and move GCC specific stuff down.
+
+2004-02-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * acinclude.m4 configure.ac
+ Fix clip mode detection (tested in one of HP's testdrive Itanium II boxes).
+
+ * src/file_io.c
+ Added check for sizeof (off_t) != sizeof (sf_count_t) to prevent recurrence
+ of missing large file support on Linux and Solaris.
+
+2004-02-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Fix a MacOSX specific bug which was caused by a space being inserted in
+ the middle of a file name.
+
+ * configure.ac src/Makefile.am examples/Makefile.am
+ Fix a couple of MacOSX build issues.
+
+2004-02-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/command.html
+ Document SFC_SET_CLIPPING and SFC_GET_CLIPPING.
+
+2004-02-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/*.html
+ Applied patch from Frank Neumann (author of lakai) which fixes many minor
+ typos in documentation. Thanks Frank.
+
+2004-02-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * ChangeLog
+ Changed my email address throughout source and docs.
+
+2004-02-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Make sure config.h is included before stdio.h to make sure large file
+ support is enabled on Linux (and Solaris).
+
+ * tests/misc_test.c
+ Disable update_header test on Win32. This should work but doesn't and
+ I'm not sure why.
+
+ * Make.bat Win32/Makefile.msvc
+ Updates.
+
+2004-01-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Changed logindex, headindex and headend files of SF_PRIVATE from unsigned
+ int to int to prevent weird arithmetic bugs.
+
+ * src/common.c src/aiff.c src/wav.c src/w64.c
+ Fixed compiler warnings resulting from above change.
+
+2004-01-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Fixed a bug in header reader for some files with data after the sample data.
+
+2003-12-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/lossy_comp_test.c tests/Makefile.am
+ Add tests for AIFF/IMA files.
+
+2003-12-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/macbinary3.c src/macos.c
+ Two new files required for handling SD2 files.
+
+ * src/common.h
+ Add prototypes for functions in above two files.
+
+ * src/Makefile.am
+ Hook new files into build system.
+
+2003-12-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Add checks for mmap() and getpagesize() which might be used at some time
+ for faster file reads.
+ Add detection of MacOSX.
+
+2003-12-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Minor mods to pkg-config section.
+
+2003-12-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/create_symbols_file.sh
+ Andre Pang (also known as Ozone) pointed out that on MacOSX, all non
+ static symbols are exported causing troubles when trying to link
+ libsndfile with another library which has any of the same symbols.
+ He fixed this by supplying the MacOSX linker with a file containing
+ all the public symbols so that only they would be exported and then
+ supplied a patch for libsndfile.
+ This wasn't quite ideal, because I would have to maintain two (3 if
+ you include Win32) separate files containing the exported symbols.
+ A better solution was to create this script which can generate a
+ Symbols file for Linux, MacoSX and any other OS that supports
+ minimising the number of exported symbols.
+
+ * configure.ac src/Makefile.am
+ Hook the new script into the build process.
+
+2003-12-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Added comments about Steve Dekorte's SoundConverter scam.
+
+2003-12-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Axel Röbel pointed out that on Mac OSX a pipe is not considered a fifo
+ (S_ISFIFO (st.st_mode) is false) but a socket (S_ISSOCK (st.st_mode) is
+ true). The test has therefore been changed to is S_ISREG and anything
+ which which does not return true for S_ISREG is considered a pipe.
+
+2003-11-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/misc_test.c
+ Fix update_header_test to pass SDS.
+
+ * src/sds.c
+ More minor fixes.
+
+ * tests/floating_point_test.c
+ Add test for SDS files.
+
+ * src/command.c
+ Add SDS to major_formats array.
+
+2003-11-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.tpl tests/misc_test.c
+ Add tests for SDS files.
+
+ * src/sds.c
+ Fix a bug in header update code.
+
+2003-11-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sds.c
+ Get file write working.
+
+ * src/paf.c
+ Fix a potential bug in paf24_seek().
+
+2003-11-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Add Q/A about u-law encoded WAV files.
+
+ * Win32/*.h
+ Updated so it compiles on Win32.
+
+2003-11-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Add -alaw and -ulaw command line arguments.
+
+ * configure.ac
+ Add library versioning comments.
+ Add arguments to AC_INIT.
+
+2003-10-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Ross Bencina has contributed code to replace all of the (mostly broken)
+ Win32 POSIX emulation calls with calls the native Win32 file I/O API.
+ This code still needs testing but is likely to be a huge improvemnt
+ of support for Win32. Thanks Ross.
+
+2003-10-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/dwvw.c
+ Removed filedes field from the DWVW_PRIVATE struct.
+
+ * src/file_io.c
+ Change psf_fopen() so it returns psf->error instead of the file descriptor.
+ Add new functions psf_set_stdio() and psf_set_file().
+
+ * src/sndfile.c
+ Change these to work with changed psf_fopen() return value.
+ Remove all uses of psf->filedes from sndfile, making it easier to slot native
+ Win32 API file handling functions.
+
+ * src/test_file_io.c
+ Minor changes to make it compile with new file_io.c stuff.
+
+2003-10-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/gsm610.h
+ Rename a variable from true to true_flag. As Ross Bencina points out,
+ true is defined in the C99 header <stdbool.h>.
+
+ * src/file_io.c
+ If fstat() fails, return SF_TRUE instead of -1 (Ross Bencina).
+
+2003-10-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Increase the size of SF_BUFFER_LEN and SF_HEADER_LEN.
+
+ * src/sndfile.c
+ Fix sf_read/write_raw which were dividing by psf->bytwidth and
+ psf->blockwidth which can both be zero.
+
+ * examples/sndfile-info.c
+ Increase size of BUFFER_LEN.
+
+2003-09-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Add checks for <sys/wait.h> and ssize_t.
+ Other Win32/MinGW checks.
+
+ * src/aiff.c src/au_g72x.c src/file_io.c src/gsm610.c src/interleave.c
+ src/paf.c src/sds.c src/svx.c src/voc.c src/w64.c src/wav.c src/xi.c
+ Fix compiler warnings.
+
+2003-09-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/scale_clip_test.tpl
+ Add definition of M_PI if needed.
+
+2003-09-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Detect if S_IRGRP is declared in <unistd.h>.
+
+ * src/file_io.c tests/*.tpl tests/*.c
+ More fixes for Win32/MSVC++ and MinGW. MinGW does have <unistd.h> but that
+ file doesn't declare S_IRGRP.
+
+2003-10-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/config.h.in
+ Add comment stating that the sf_count_t typedef is determined when
+ libsndfile is being compiled.
+
+ * tests/utils.tpl
+ Modified so that utils.c gets one copy of the GPL and not two.
+
+
+2003-09-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/unistd.h src/sf_unistd.h
+ Move first file to the second. This will help for Win32/MSVC++ and MinGW.
+
+ * Win32/Makefile.am src/Makefile.am
+ Changed in line with above.
+
+ * Win32/Makefile.msvc
+ Removed "/I Win32" which is no longer required.
+
+ * src/file_io.c src/test_file_io.c tests/*.tpl tests/*.c
+ If HAVE_UNISTD_H include <unistd.h> else include <sf_unistd.h>. This should
+ work for Win32, MinGW and other fakes Unix-like OSes.
+
+ * src/*.c
+ Removed #include <unistd.h> from files which didn't need it.
+
+2003-09-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * libsndfile.spec.in
+ Apply fix from Andrew Schultz.
+
+2003-09-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/vox_adpcm.c
+ Only set psf->sf.samplerate if the existing value is invalid.
+
+2003-09-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Started adding support for ALSA output.
+
+2003-09-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Removed <stdlib.h> from sndfile.h.
+
+ * src/*.c examples/*.c tests/*.c tests/*.tpl
+ Added <stdlib.h> where needed.
+
+2003-09-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Added ARRAY_LEN, SF_MAX and SF_MIN macros.
+
+2003-08-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Remove statements about alternative licensing arrangements.
+
+2003-08-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * MacOS MacOS9 Makefile.am configure.ac
+ Change directory name from MacOS to MacOS9
+
+ * MacOS9/MacOS9-readme.txt
+ Change name to make it really obvious, add text to top of file to make it
+ still more obvious again.
+
+2003-08-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/test_log_printf.c
+ Add tests for %u conversions.
+
+ * src/common.c
+ Fix psf_log_printf() %u conversions.
+
+2003-08-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fixed a bug where opening a file with a non-trival header in SFM_RDWR mode
+ would over-write part of the header. Thanks to Axel Röbel for pointing
+ this out. Axel also provided a patch to fix this but I came up with a
+ neater and more general solution.
+ Return error when openning an AIFF file with data after the SSND chunk
+ (Thanks Axel Röbel).
+
+ * tests/aiff_rw_test.c
+ Improvements to test program which will later allow it to be generalised to
+ test WAV, SVX and others as required.
+
+2003-08-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/pipe_test.c
+ Add useek_pipe_rw_test() submitted by Russell Francis.
+
+ * src/sndfile.c
+ In sf_open_fd(), check if input file descriptor is a pipe.
+
+ * src/sndfile.[ch]
+ Fix typo in variable name do_not_close_descriptor.
+
+2003-08-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/test_log_printf.c
+ Improve the tests for %d and %s conversions.
+
+ * src/common.c
+ Fixed a few problems in psf_log_printf() found using new tests.
+
+2003-08-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Add -Wwrite-strings warning to CFLAGS if the compiler is GCC. Thanks to
+ Peter Miller (Aegis author) for suggesting this and supplying a patch.
+
+ * src/*.c examples/*.c tests/*.c
+ Fix all compiler warnings arising from the above.
+
+2003-08-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/aiff_rw_test.c tests/Makefile.am
+ New test program to check for errors re-writing the headers of AIFC files
+ opened in mode SFM_RDWR.
+
+2003-07-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Applied a patch from Tero Pelander to allow this program to run on systems
+ using devfs which used /dev/sound/dsp instead of /dev/dsp.
+
+2003-07-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/new_file_type.HOWTO
+ Updated document. Still incomplete.
+
+2003-06-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fix VALIDATE_SNDFILE_AND_ASSIGN_PSF which was returning an error rather
+ than saving it and returning zero.
+
+2003-06-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Two fixes for Mac OS9.
+ Fix all casts from sf_count_t to ssize_t (not size_t).
+
+2003-06-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fix for reading files with RIFF length of 8 and data length of 0.
+
+2003-06-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c tests/*.c tests/*.tpl
+ Added comments to mark code for removal when make Lite version of
+ libsndfile.
+
+2003-06-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Add extra error checking for unrecognised arguments.
+
+2003-06-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ima_adpcm.c
+ Started adding code to write IMA ADPCM encoded AIFF files.
+
+ * src/test_log_printf.c src/Makefile.am
+ New file to test psf_log_printf() function and add hooks into build system.
+
+ * src/common.c
+ Move psf_log_printf() function to top of the file and only compile the rest
+ of the file if if PSF_LOG_PRINTF_ONLY is not defined.
+
+2003-06-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/config.h Win32/sndfile.h
+ Updated with new config variables.
+
+ * Win32/unistd.h src/file_io.c
+ Added implementation of S_ISFIFO macro which Win32 seems to lack and is
+ used in src/file_io.c.
+
+ * tests/utils.tpl
+ Added #include <unitstd.h> to pull in Win32/unistd.h so it compiles for
+ Win32.
+
+ * src/Makefile.msvc
+ Added src\test_file_io.exe build target and run this as the very first
+ test.
+
+ * tests/win32_test.c
+ Add support for testing Cygwin32.
+
+ * configure.ac
+ Detect POSIX fsync() and fdatasync() functions.
+
+ * src/file_io.c
+ If compiling for Cygwin, call fsync() before calling fstat() to retrieve
+ file length.
+
+ * tests/pcm_test.tpl
+ Add a test for lrintf() function. This was required to detect a really
+ broken lrint() and lrintf() on Cygwin.
+
+ * tests/misc_test.c
+ Don't run permission test when compiling under Cygwin.
+
+ * src/float_cast.h
+ Fix fallback macro for lrint() and lrintf() to cast to long instead of int
+ to match official function prototypes.
+
+2003-06-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-convert.c
+ Modifications to improve accuracy of conversions; use double data for
+ floating point and int for everything else.
+
+ * src/ima_apdcm.c
+ Completed work on decoding IMA ADPCM encoded AIFF files. Still need to
+ get encoding working.
+
+2003-05-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c src/ima_adpcm.c
+ Start working on getting IMA ADPCM encoded AIFF files working.
+
+2003-05-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Fixed the touch command for when the autogen program is not found (Matt
+ Flax).
+
+ * src/ulaw.c src/alaw.c
+ Made these pipe-able.
+
+2003-05-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/paf.c src/ircam.c
+ Fixed writing to pipe.
+
+ * src/wav.c src/aiff.c src/nist.c src/mat*.c src/svx.c src/w64.c
+ Return SFE_NO_PIPE_WRITE if an attempt is made to write to a pipe.
+
+2003-05-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-info.c
+ Modified to detect unknown file lengths.
+
+ * src/mat4.c
+ Fix reading from a pipe.
+
+2003-05-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/pipe_test.c
+ Add more file types to tests.
+
+ * src/mat4.c
+ Removed explicit setting of psf->sf.seekable to SF_TRUE.
+
+ * tests/utils.tpl
+ Add macro for generating and check data in the stdio and pipe tests.
+
+ * tests/stdout_test.c tests/stdin_test.c
+ Use the above macro to generate known data on output and check data on
+ input.
+
+ * src/voc.c src/htk.c common.h sndfile.c
+ Disallow reading/writing VOC and HTK files from/to pipes be returning new
+ error values.
+
+ * src/w64.c
+ Fixes to allow reading from a pipe.
+
+2003-05-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac src/sndfile.h.in
+ When the configure script determines the sizeof (sf_count_t), also set the
+ value of SF_COUNT_MAX in sndfile.h.
+
+ * configure.ac
+ Remove -pedantic flag from default GCC compiler flags.
+
+ * tests/pipe_test.c
+ Add a pipe_read_test() before doing pipe_write_test().
+
+ * tests/scale_clip_test.c
+ Add test to make sure non-normalized values also clip in the right way.
+
+2003-05-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Add test to detect processor clipping capabilities.
+
+ * tests/stdin_test.c tests/stdout_test.c
+ Fix a pair of compiler warnings.
+
+ * src/common.h
+ Add new pipeoffset field to SF_PRIVATE. This will contain the current file
+ offset when operating on a pipe.
+
+ * src/common.c
+ Removed direct calls to psf_fread()/psf_fseek()/psf_fgets() etc from
+ psf_binheader_readf and redirect them to new buffered versions
+ header_read(), header_seek() and header_gets().
+ Add "G" format specifier to emulate fgets() functionality with buffering.
+ This will allow reading some file types from pipes.
+
+ * src/file_io.c
+ When the file descriptor is a pipe, manintain psf->pipeoffset.
+
+ * src/pvf.c
+ Change use of psf_fgets() to psf_binheader_readf() as required but changes to header re
+
+ * src/au.c
+ Fix reading from a pipe.
+
+2003-05-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pcm.c
+ Add clipping versions of the f2XXX_array() functions to allow option of
+ clipping data that would otherwise overflow.
+
+ * tests/scale_clip_test.tpl tests/scale_clip_test.def
+ New files test that clipping option does actually work.
+
+2003-05-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Fixed a typo ("OS(" instead of "OS9").
+
+2003-05-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/open_fail_test.c
+ Include <string.h> to prevent warning message of missing declaration of
+ memset().
+
+2003-05-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Add new "add_clipping" field to SF_PRIVATE.
+
+ * src/sndfile.h.in src/sndfile.c
+ Add command SFC_SET_CLIPPING which sets/resets add_clipping field.
+
+2003-05-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html
+ Add docs for sf_set_string() and sf_get_string().
+
+ * src/common.h src/sndfile.c
+ Add new SFE_STR_BAD_STRING error.
+
+ * tests/stdin_test.c tests/stdout_test.c
+ Removed all non-error print statements.
+
+ * tests/stdio_test.c tests/pipe_test.c tests/Makefile.am
+ Add print statements removed from two files above.
+
+2003-05-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * libsndfile.spec.in
+ Fixed a coulpe of minor errors discovered by someone calling themselves
+ Agent Smith.
+
+ * src/common.c src/common.h src/file_io.h
+ Added is_pipe field to SF_PRIVATE and declaration of psf_is_pipe()
+ function. (Axel Röbel)
+
+ * src/sndfile.c
+ Fixed determination of whether the file is a pipe. (Axel Röbel)
+
+ * src/paf.c
+ Force paf24 to start with undefined mode. (Axel Röbel)
+
+ * tests/pipe_test.c
+ Mods to make this test work and actually do the test on RAW files. (Axel
+ Röbel).
+
+2003-05-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed a potential bug where psf->sf.seekable was being set to FALSE when
+ operating on stdin or stdout but then the default initialiser was reseting
+ it to TRUE. Thanks to Axel Röbel.
+
+ * src/aiff.c
+ Fixed a bug in the header parser where it was not handling an odd length
+ COMM chunk correctly. Thanks to Axel Röbel.
+
+ * src/test_file_io.c
+ Add more tests.
+
+ * tests/win32_test.c
+ New file for showing the bugs in the Win32 implementation of the POSIX API.
+ It also runs on Linux for sanity checking.
+
+ * tests/Makefile.am Win32/Makefile.msvc
+ Hook the new test program into the build system.
+
+2003-05-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/test_file_io.c
+ New test program to test operation of functions defined in file_io.c. This
+ should make supporting win32 significantly easier.
+
+ * src/Makefile.am
+ Hook new test program into the build system.
+
+ * src/file_io.c
+ Add compile/run time check that sizeof statbuf.st_size and sf_count_t are
+ the same.
+
+ * src/common.h src/sndfile.c
+ Added new error code and error message for new check.
+
+ * tests/benchmark.tpl
+ Fix to use frames instead of samples in SF_INFO.
+
+2003-05-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ More stuffing about working around PLAIN OLD-FASHIONED **BUGS** in Win32.
+
+ * examples/sndfile-info.c
+ Applied patch from Conrad Parker to add "--help" and "-h" options as
+ well as an improved usage message.
+
+2003-05-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/au.c
+ Added embedded file support.
+
+ * tests/multi_file_test.c
+ Added tests for embedded AU files.
+ Added verbose testing mode.
+
+ * src/common.h src/sndfile.c
+ Added an embedded AU specific error code and message.
+
+ * src/wav.c
+ Added patch from Conrad Parker which filled in a little more information
+ about ACIDized WAV files.
+
+2003-04-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Fixed Win32 version of psf_fseek() which was calling psf_get_filelen()
+ which was in turn calling psf_fseek() which in the end blew the stack.
+ Now of course this would have been easy to find on Linux, but this blow
+ up was happening in kernel32.dll and the fscking MSVC++ debugger couldn't
+ figure out what call caused this (it couldn't even tell me the stack had
+ overflowed) and was absolutley useless for this debugging exercise.
+ On top of that, the reason I got into this mess was that windoze doesn't
+ have a working fstat() function which can return file lengths > 2 Gig. It
+ HAS a fscking _fstati64() but the file length value is only updated AFTER
+ the bloody file is closed. That makes it completely useless.
+ How the hell do people stand working on this crap excuse of an OS?
+
+2003-04-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/unistd.h src/file_io.c
+ Moved definitions of S_IGRP etc from file_io.c to unistd.h so that these
+ can be used in the test programs.
+
+ * Win32/libsndfile.def
+ Added sf_open_fd.
+
+ * Win32/sndfile.h
+ Updated to match src/sndfile.h.in.
+
+ * Win32/Makefile.msvc
+ Added dither.c and htk.c to libsndfile.dll target.
+
+2003-04-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ First attempt at getting the Win32 versions of the these functions working.
+ They still need to be tested.
+
+2003-04-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/strings.c
+ Found and fixed a bug which was causing psf_store_string() to fail on
+ Motorola 68k processors. Many thanks to Joshua Haberman (Debian maintainer
+ of libsndfile) for compiling and running debug code to help me debug the
+ problem.
+
+2003-04-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/file_io.c src/wav.c src/aiff.c
+ Much hacking to get reading and writing of embedded files working (ie sound
+ files at a non-zero files offset).
+
+ * doc/embedded_files.html
+ First pass atempt at documenting reading/writing embedded files.
+
+2003-04-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Updated answer to "Why doesn't libsndfile do interleaving/de-interleaving?"
+
+2003-04-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c src/aiff.c
+ Fix retrieving and storing of string data from files. Need to be careful
+ about using psf->buffer for strings.
+
+2003-04-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Fix psf_fseek() for seeks withing embedded files.
+
+2003-04-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Changed the definition of SNDFILE slightly to produce warnings when it isn't
+ used correctly. This should have zero affect in code which uses the SNDFILE
+ type correctly.
+
+ * src/sndfile.c
+ Fixed a few compiler warnings cause by the changes to the SNDFILE type.
+
+2003-04-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Added question and answer to the question "How about adding the ability
+ to write/read sound files to/from memory buffers?".
+
+2003-04-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.tpl
+ Removed un-needed enums declaring TRUE and FALSE and replaced usage of
+ these with SF_TRUE and SF_FALSE.
+
+ * tests/multi_file_test.c
+ New test program to test sf_open_fd() on files containing data other than
+ a single sound file.
+
+2003-04-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ When creating files, set the readable by others flag. This still allows
+ further restrictions to be enforced by use of the user's umask. Fix
+ suggested by Eric Lyon.
+
+2003-04-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/sndfile.c
+ Changed sf_open_fd(). Dropped offset parameter and added a close_desc
+ parameter. If close desc is TRUE, the file descritpor passed into the
+ library will be closed when sf_close() is called.
+
+ * tests/utils.tpl
+ Modified call to sf_open_fd() to set close_desc parameter to SF_TRUE.
+
+2003-04-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.tpl
+ Add a string (using sf_set_string() function) before and after data section
+ of all files. This will make sure that if string data can be added, it
+ doesn't overwrite real audio data.
+
+2003-04-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Started work on supporting a non-zero offset parameter for sf_open_fd ().
+
+ * src/<file header parsers>.c
+ Removed many uses of psf_fseek (SEEK_END) which to allow for future use of
+ sf_open_fd() with non-zero offset.
+ Associated refactoring.
+
+ * src/aiff.c
+ Implemented functionality required to get sf_get_string() and
+ sf_set_string() working for AIFF files.
+
+2003-04-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/utils.tpl
+ Modified test_open_file_or_die() to alternately use sf_open() and
+ sf_open_fd().
+
+ * src/svx.c
+ Fixed a bug which occurred when openning an existing file for read/write
+ using sf_open_fd(). In this case, the existing NAME chunk needs to be
+ read into psf->filename.
+ Fixed printing of sf_count_t types to logbuffer.
+
+2003-03-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Added prototype for new function sf_open_fd().
+
+ * src/sndfile.c
+ Moved most of the code in sf_open() to a new function psf_open_file().
+ Created new function sf_open_fd() which also uses psf_open_file() but
+ does not currently support the offset parameter.
+
+ * doc/api.html
+ Document sf_open_fd().
+
+2003-03-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed a memory leak reported by Evgeny Karpov. Memory leak only occurred
+ when an attempt was made to read and the open() call fails.
+
+2003-03-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/open_fail_test.c
+ New test program to check for memory leaks when sf_open fails on a valid
+ file. Currently this must be run manually under valgrid.
+
+ * tests/Makefile.am
+ Hook new test program into build.
+
+2003-03-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Octave/sndfile_save.m Octave/sndfile_play.m
+ Added a -mat-binary option to the octave save command to force the output
+ to binary mode even if the user has set ascii data as the default. Found
+ by Christopher Moore.
+
+2003-02-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/dither.html
+ New file which will document the interface which allows the addition of
+ audio dither when sample word sizes are being reduced.
+
+ * src/dither.c
+ More work.
+
+2003-02-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/misc_test.c
+ In update_header_test(), make HTK files a special case.
+
+ * doc/index.html
+ Added HTK to the feature matrix.
+
+2003-02-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/htk.c
+ New file for reading/writing HMM Tool Kit files.
+
+ * src/sndfile.h.in src/sndfile.c src/command.c src/Makefile.am
+ Hook in htk.c
+
+ * tests/write_read_test.tpl tests/misc_test.c tests/Makefile.am
+ Add tests for HTK files.
+
+2003-02-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fixed a bug where the LIST chunk length was being written incorrectly.
+
+ * tests/string_test.c
+ Added call to check_log_buffer().
+ Minor cleanups.
+
+2003-02-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_w64.h
+ Applied patch from Antoine Mathys to add extra WAV format definitions and
+ a G72x_ADPCM_WAV_FMT struct definition.
+
+ * src/wav_w64.c
+ Applied patch from Antoine Mathys which converts wav_w64_format_str() from
+ one huge inefficient switch statement to a binary search.
+
+ * tests/string_test.c
+ Dump log buffer if tests fail.
+
+2003-02-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/string_test.c
+ David Viens supplied some modifications to this file which showed up a bug
+ when using sf_set_string() and the sf_writef_float() functions.
+
+ * src/sndfile.c
+ Fixed the above bug.
+
+2003-02-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Added Q and A on how to detect libsndfile in configure.in (at the suggestion
+ of Davy Durham).
+
+2003-02-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Add enums and typedefs for dither.
+ Deprecate SFC_SET_ADD_DITHER_ON_WRITE and SFC_SET_ADD_DITHER_ON_READ, to be
+ replaced with SFC_SET_DITHER_ON_WRITE and SFC_SET_DITHER_ON_READ which will
+ allow different dither algorithms to be enabled.
+ Added SFC_GET_DITHER_INFO_COUNT and SFC_GET_DITHER_INFO.
+
+ * src/sndfile.h.in src/Version_script.in Win32/libsndfile.def.
+ Added public sf_dither_*() functions.
+
+ * src/sndfile.c
+ Implement commands above.
+
+ * src/dither.c
+ More work. Framework and external hooks into dither algorithms complete.
+
+2003-02-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/version-1.html libsndfile_version_convert.py
+ Remove redundant files.
+
+ * doc/index.html doc/api.html
+ Remove links to version-1.html.
+
+ * src/dither.c
+ New file to allow the addition of audio dither on input and output.
+
+ * src/common.h
+ Add prototype for dither_init() function.
+
+ * Makefile.am doc/Makefile.am
+ Changes for added and removed files.
+
+2003-02-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/Makefile.msvc
+ Changes to force example binaries to be placed in the top level directory
+ instead of the examples/ directory.
+ Add src/strings.c and src/xi.c to the build.
+ Add string_test to build and to tests on WAV files.
+
+ * doc/index.html
+ Added XI to support matrix.
+
+2003-01-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Added prototypes for sf_get_string() and sf_set_string() and SF_STR_*
+ enum values.
+
+ * src/sndfile.c
+ Added public interface to sf_get_string() and sf_set_string().
+
+ * src/wav.c
+ Added code for setting and getting strings in WAV files.
+
+ * tests/string_test.c
+ New test program for sf_get_string() and sf_set_string() functionality.
+
+ * tests/Makefile.am
+ Hook new test program into build and test framework.
+
+2003-01-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Added fields to SF_PRIVATE for string data needed to implement
+ sf_get_string() and sf_set_string().
+
+ * src/strings.c
+ New file for storing and retrieving strings to/from files.
+
+ * src/Makefile.am
+ Added strings.c to build.
+
+2003-01-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/xi.c
+ Read seems to be working so looking at write.
+
+ * src/sndfile.h.in
+ Added SF_FORMAT_XI, SF_FORMAT_DPCM_8 and SF_FORMAT_DPCM_16 enum values.
+
+ * tests/floating_point_test.c tests/lossy_comp_test.c tests/Makefile.am
+ Added test for 8 and 16 bit XI format files.
+
+2003-01-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Added a non-lawyer readable summary of the licensing provisions as
+ suggested by Steve Dekorte.
+
+2003-01-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fixed a compiler warning found by Alexander Lerch.
+
+2003-01-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Fixed the multiple linking of libm.
+
+2003-01-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/Makefile.mcvs
+ Added comments on the correct way to set up the MSVCDir environment
+ variable.
+
+ * doc/win32.html
+ Add on how to set up the MSVCDir environment variable.
+
+2003-01-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c examples/sndfile-info.c
+ When run on Win32 without any command line parameters print a message and
+ then sleep for 5 seconds. This means the when somebody double clicks on
+ these programs in explorer the user will actually see the message.
+
+2003-01-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/misc_test.c
+ Bypass permission test if running as root because root is allowed to open
+ a readonly file for write.
+
+2003-01-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/Makefile.msvc
+ Added pvf.c and xi.c source files to project.
+
+ * src/sndfile.h
+ Updated for PVF files.
+
+2003-01-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Modified validate_sfinfo() to force samplerate, channels and sections
+ to be >= 1.
+ In format_from_extension() replaced calls to does_extension_match()
+ with strcmp().
+
+ * src/xi.c
+ More work.
+
+2003-01-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/Makefile.am
+ Added octave.html which had been left out. Found by Jan Weil.
+
+2003-01-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pvf.c src/common.h src/sndfile.c
+ Fixed error handling for PVF files.
+
+ * src/xi.c
+ New file for handling Fasttracker 2 Extended Instrument files. Not working
+ yet and included when configured with --enable-experimental.
+
+ * src/sndfile.c src/common.h
+ Hooked in new file xi.c.
+
+2002-12-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/rx2.c
+ Added a patch from Marek Peteraj which sheds a little more light on the
+ slices within an RX2 file. Still need to find out data encoding.
+
+2002-12-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Started work on decoding 'acid' and 'strc' chunks.
+
+2002-12-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/peak_check_test.c
+ Minor cleanup.
+
+2002-12-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.tpl
+ Added check to make sure no error was generated when an attempt was made to
+ read past the end of the file.
+
+2002-12-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/lists.html
+ Added "mailto" links for all three lists.
+
+ * src/pvf.c
+ New file for Portable Voice Format files.
+
+ * src/sndfile.h.in src/sndfile.c src/common.h src/command.c src/Makefile.am
+ Added hooks for SF_FORMAT_PVF format files.
+
+ * tests/write_read_test.tpl tests/std*.c
+ Add tests for SF_FORMAT_PVF.
+
+ * doc/index.html
+ Add PVF to the compatibility matrix.
+
+ * src/pcm.c src/alaw.c src/ulaw.c src/float32.c src/double64.c
+ Previously, attempts to read beyond the end of a file would set psf->error
+ to SFE_SHORT_ERROR. This behaviour diverged from the behaviour of the POSIX
+ read() call but has now been fixed.
+ Attempts to read beyond the end of the file will return a short read count
+ but will not longer set any error.
+
+2002-12-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Add more sanity checking when opening a RAW file for read. When format is
+ not RAW, zero out all members of the SF_INFO struct.
+
+ * tests/raw_test.c
+ Add bad_raw_test() to check for above problem.
+
+ * tests/stdin_test.c examples/sndfile-info.c
+ Set the format field of the SF_INFO struct to zero before calling
+ sf_open().
+
+ * doc/api.html
+ Add information about the need to set the format field of the SF_INFO struct
+ to zero when opening non-RAW files for read.
+
+ * configure.ac
+ Removed use of conversion script on Solaris. Not all Solaris versions
+ support it.
+
+ * doc/lists.html
+ New file containg details of the mailing lists.
+
+ * doc/index.html
+ Add a link to the above new file.
+
+2002-12-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/dft_cmp.c
+ Fixed a SIGFPE on Alpha caused by a log10 (0.0). Thanks to Joshua Haberman
+ for providing the gdb traceback.
+
+2002-11-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Added more capabilities to 'smpl' chunk parser.
+
+ * src/sndfile.c
+ Fixed some (not all) possible problems found with Flawfinder.
+
+2002-11-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed a bug in sf_seek(). This bug could only occur when an attempt was
+ made to read beyond the end and then sf_seek() was called with a whence
+ parameter of SEEK_CUR.
+
+ * src/file_io.c
+ Win32's _fstati64() does not work, it returns BS. Re-implemented
+ psf_get_filelen() in terms of psf_fseek().
+
+ * tests/write_read_test.tpl
+ Add a test to detect above bug.
+
+ * src/float_cast.h
+ Modification to prevent compiler warnings on Mac OS X.
+
+ * src/file_io.c
+ Fixes for windows (what a f**ked OS).
+
+2002-11-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.ac
+ Disable use of native lrint()/lrintf() on Mac OSX. These functions exist on
+ Mac OSX 10.2 but not on 10.1. Forcing the use of the versions in
+ src/float_cast.h means that a library compiled on 10.2 will still work on
+ 10.1.
+
+2002-11-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in configure.ac
+ Renamed configure.in to configure.ac as expected by later versions of
+ autoconf.
+ Slight hacking of configure.ac to work with version 2.54 of autoconf.
+ Changed to using -dumpversion instead of --version for determining GCC
+ version numer as suggested by Anand Kumria.
+
+ * src/G72x/Makefile.am
+ Slight hacking required for operation with automake 1.6.3.
+
+2002-11-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ In psf_binheader_readf() changed type parameter type "b" type from size_t
+ to int to prevent errors on IA64 CPU where sizeof (size_t) != sizeof (int).
+ Thanks to Enrique Robledo Arnuncio for debugging this.
+
+2002-11-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * test/command_test.tpl
+ Changed test value so test would pass on Solaris.
+
+ * src/Version_script.in
+ Modified version numbering so that later versions of 1.0.X can replace
+ earlier versions without recompilation.
+
+ * src/vox_adpcm.c
+ Fixed bug causing short reads.
+
+2002-11-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * test/floating_point_test.c
+ Code cleanup using functions from util.c.
+ Add test for IEEE replacement floats and doubles.
+
+2002-11-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fixed a possible divide by zero error when read the 'smpl' chunk. Thanks to
+ Serg Repalov for the example file.
+
+ * tests/pcm_test.tpl
+ Used sf_command (SFC_TEST_IEEE_FLOAT_REPLACE) to test IEEE replacement code.
+ Clean up pcm_double_test().
+
+ * src/float32.c src/double64.c
+ Force use of IEEE replacement code using psf->ieee_replace is TRUE,
+ Print message to log_buffer as well.
+ Rename all broken_read_* and broken_write* functions to replace_read_* and
+ replace_write_*.
+
+ * tests/util.tpl
+ Added string_in_log_buffer().
+
+ * tests/pcm_test.tpl
+ Use string_in_log_buffer() to ensure that IEEE replacement code has been
+ used.
+
+ * configure.in
+ Removed --enable-force-broken-float option. IEEE replacement code is now
+ always tested.
+
+2002-10-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/double64.c
+ Implement code for read/writing IEEE doubles on platforms where the native
+ double format is not IEEE.
+
+ * src/float32.c src/common.h
+ Remove float32_read() and float32_write(). Replace with float32_le_read(),
+ float32_be_read(), float32_le_write() and float32_be_write() to match stuff
+ in src/double64.c.
+
+ * src/common.c
+ Fix all usage of float32_write().
+
+ * src/sndfile.h.in
+ Added SFC_TEST_IEEE_FLOAT_REPLACE command (testing only).
+
+ * src/common.h
+ Added SF_PRIVATE field ieee_replace.
+
+ * src/sndfile.c
+ In sf_command() set/reset psf->ieee_replace.
+
+2002-10-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/pcm_test.tpl
+ Fixed a problem when testing with --enable-force-broken-float. The test was
+ generating a value of negative zero and the broken float code is not able
+ to write negative zero. Removing the negative zero fixed the test.
+
+2002-10-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Added fix for Cygwin (suggested by Maros Michalik).
+
+2002-10-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Improved error detection and handling.
+
+ * src/file_io.c src/common.h
+ Removed functions psf_ferror() and psf_clearerr() which were redundant
+ after above improvements.
+
+ * src/aiff.c src/svx.c src/w64.c src/wav.c
+ Removed all use of psf_ferror() and psf_clearerr().
+
+ * src/sndfile.c
+ Removed #include of <stdio.h>, <unistd.h>, <fcntl.h> and <math.h> which
+ are no longer needed.
+
+ * tests/misc_test.c
+ Added test to make sure the correct error message is returned with an
+ existing read-only file is openned for write.
+
+2002-10-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html doc/api.html
+ Updated for OKI Dialogic ADPCM files.
+
+ * src/command.c
+ Added VOX ADPCM to sub_fomats.
+
+2002-10-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/vox_adpcm.c src/Makefile.am
+ New file for handling OKI Dialogic ADPCM files.
+
+ * src/sndfile.h
+ Add new subtype SF_FORMAT_VOX_ADPCM.
+
+ * src/sndfile.c
+ Renamed function is_au_snd_file () to format_from_extenstion () and expanded
+ its functionality to detect headerless VOX files.
+
+ * src/raw.c
+ Added hooks for SF_FORMAT_VOX_ADPCM.
+
+ * examples/sndfile-info.c
+ Print out file duration (suggested by Conrad Parker).
+
+ * libsndfile.spec.in
+ Force installation of sndfile.pc file (found by John Thompson).
+
+ * tests/Makefile.am tests/lossy_comp_test.c tests/floating_point_test.c
+ Add tests for SF_FORMAT_VOX_ADPCM.
+
+2002-10-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/misc_test.c
+ Add test which attempts to write to /dev/full (on Linux anyway) to check
+ for correct handling of writing to a full filesystem.
+
+ * src/sndfile.c
+ Return correct error message if the header cannot be written because the
+ filesystem is full.
+
+ * tests/util.tpl
+ Corrected printing of file mode in error reporting.
+
+ * src/mat5.c
+ Fixed a bug where a MAT5 file written by libsndfile could not be opened by
+ Octave 2.1.36.
+
+2002-10-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/file_io.c
+ All low level file I/O have been modified to be better able to report
+ system errors resulting from calling system level open/read/write etc.
+
+ * src/*.c
+ Updated for compatibility with above changes.
+
+ * examples/cooledit-fixer.c
+ New example program which fixes badly broken file created by Syntrillium's
+ Cooledit which are marked as containing PCM samples but actually contain
+ floating point data.
+
+ * examples/Makefile.am
+ Hooked cooledit-fixer into the build system.
+
+2002-10-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/command.html
+ Document SFC_GET_FORMAT_INFO.
+
+2002-10-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/wav32_aiff24.c examples/sndfile2oct.c examples/sfhexdump.c
+ examples/sfdump.c
+ Removed these files because they weren't interesting.
+
+ * examples/sfconvert.c examples/sndfile-convert.c
+ Renamed the first to the latter.
+
+ * examples/Makefile.am
+ Added sndfile-convert to the bin_PROGRAMS, so it is installed when the lib
+ is installed.
+ Removed old programs wav32_aiff24 and sndfile2oct.
+
+ * man/sndfile-convert.1
+ New man page.
+
+ * examples/sndfile-convert.c
+ Added some gloss now that sndfile-convert.c is an installed program.
+
+ * src/sndfile.h.in src/sndfile.c src/common.h src/command.h
+ Added command SFC_GET_FORMAT_INFO.
+
+ * tests/command_test.c
+ Added tests form SFC_GET_FORMAT_INFO.
+
+2002-10-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ In sf_format_check() return error if samplerate < 0.
+
+2002-10-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fixed bug in handling of COMM chunks with a 4 byte encoding byte but no
+ encoding string.
+
+2002-10-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed repeated word in an error message.
+
+2002-10-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Improved advertising in Features section.
+
+2002-10-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Added decoding of 'labl' chunks within 'LIST' chunks.
+
+ * src/common.h
+ Added (experimental only) SF_FORMAT_OGG and SF_FORMAT_VORBIS and definition
+ of ogg_open(). This is nowhere near working yet.
+
+ * src/sndfile.c
+ Added detection of 'OggS' file marker and added call to ogg_open() to
+ switch statement.
+
+ * src/ogg.c
+ New file. Very early start of Ogg Vorbis support.
+
+ * src/wav.c
+ Added handling of brain-damaged and broken Cooledit "32 bit 24.0 float
+ type 1" files. These files are marked as being 24 bit WAVE_FORMAT_PCM with
+ a block alignment of 4 times the numbers of channels but are in fact 32 bit
+ floating point.
+
+2002-10-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Modified option --enable-experimental to set ENABLE_EXPERIMENTAL_CODE in
+ config.h to either 0 or 1.
+
+ * src/sndfile.c
+ Modify sf_command (SFC_GET_LIB_VERSION) to append "-exp" to the version
+ string if experimental code has been enabled.
+
+2002-10-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/Makefile.am
+ Added -lm to libsndfile_la_LIBADD. This means that -lm is not longer needed
+ in the link line when linking something to libsndfile.
+
+ * tests/Makefile.am examples/Makefile.am
+ Removed -lm from all link lines.
+
+ * sndfile.pc.in
+ Removed -lm from Libs line.
+
+2002-09-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Removed all perror() calls.
+
+ * src/nist.c
+ Removed calls to exit() function.
+ Added check to detect NIST files dammaged from Unix CR -> Win32 CRLF
+ conversion process.
+
+2002-09-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/sndfile.c
+ New function sf_strerror() which will eventually replace functions
+ sf_perror() and sf_error_str().
+ Function sf_error_number() has also been changed, but this was documented
+ as being for testing only.
+
+ * doc/api.html
+ Documented above changes.
+
+ * tests/*.c examples/*.c
+ Changed to new error functions.
+
+2002-09-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Detect GCC version, and print a warning message about writeable strings
+ it GCC major version number is less than 3.
+
+2002-09-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in doc/api.html
+ Documentation fixes.
+
+2002-09-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/Version_script.in src/Makefile.am configure.in
+ Use the version script to prevent the exporting of all non public symbols.
+ This currently only works with Linux. Will test on Solaris as well.
+
+ * src/float_cast.h
+ Added #ifndef to prevent the #warning directives killing the SGI MIPSpro
+ compiler.
+
+ * src/au_g72x.c src/double64.c src/float32.c src/gsm610.c src/ima_adpcm.c
+ src/ms_adpcm.c
+ Fix benign compiler warnings arising from previously added compiler
+ flags.
+
+2002-09-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed a bug in sf_error_str() where errnum was used as the index instead
+ of k. Found by Tim Hockin.
+
+ * examples/sndfile-play.c
+ Fixed a compiler warning resulting from a variable shadowing a previously
+ defined local.
+
+2002-09-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in src/sndfile.c
+ Added command SFC_SET_RAW_START_OFFSET.
+
+ * doc/command.html
+ Document SFC_SET_RAW_START_OFFSET.
+
+ * tests/raw_test.c tests/Makefile.am
+ Add new file for testing SF_FORMAT_RAW specific functionality.
+
+ * tests/dwvw_test.c
+ Updates.
+
+2002-09-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Modified reading of 'smpl' chunk to take account of the sampler data field.
+
+ * tests/utils.tpl tests/utils.h
+ Added function print_test_name().
+
+ * tests/misc_test.c tests/write_read_test.tpl tests/lossy_comp_test.c
+ tests/pcm_test.tpl tests/command_test.tpl tests/floating_point_test.c
+ Convert to use function print_test_name().
+
+2002-09-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/octave.html
+ Added a link to some other Octave scripts for reading and writing sound
+ files.
+
+ * src/paf.c
+ Change type of dummy data field to int. This should fix a benign compiler
+ warning on some CPUs.
+ Removed superfluous casts resulting from the above change.
+
+ * src/rx2.c
+ More hacking.
+
+2002-09-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/mat5.c src/common.c
+ Changed usage of snprintf() to LSF_SNPRINTF().
+
+ * Win32/Makefile.msvc
+ Updated to include new files and add new tests.
+
+ * Win32/config.h Win32/sndfile.h
+ Updated.
+
+ * doc/api.html
+ Added note about the possibility of "missing" features actually being
+ implemented as an sf_command().
+
+2002-09-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/misc_test.c
+ Added previously missing update_header_test and zero_data_tests for PAF,
+ MAT4 and MAT5 formats.
+
+ * src/paf.c src/mat4.c src/mat5.c
+ Fixed bugs uncovered by new tests above.
+
+ * src/mat5.c
+ Generalised parsing of name fields of MAT5 files.
+
+ * src/mat5.c src/sndfile.c
+ Added support for unsigned 8 bit PCM MAT5 files.
+
+ * tests/write_read_test.tpl
+ Added test for unsigned 8 bit PCM MAT5 files.
+
+ * doc/index.html
+ Added unsigned 8 bit PCM MAT5 to capabilities matrix.
+
+2002-09-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * test/update_header_test.c tests/misc_test.c
+ Renamed update_header_test.c to misc_test.c.
+ Added zero_data_test() to check for case where file is opened for write and
+ closed immediately. The resulting file can be left in a state where
+ libsndfile cannot open it. Problem reported by Werner Schweer, the author
+ of Muse.
+
+ * src/aiff.c
+ Removed superfluous cast.
+
+ * src/wav.c src/svx.c
+ Fixed case of file generated with no data.
+ Removed superfluous cast.
+
+ * src/sndfile.c
+ Fixed error on IA64 platform caused by incorrect termination of
+ SndfileErrors struct array. This problem was found in the Debian buildd
+ logs (http://buildd.debian.org/).
+
+ * configure.in
+ Added Octave directory.
+
+ * Octave/Makefile.ma
+ New Makfile.am for Octave directory.
+
+ * Octave/sndfile_load.m Octave/sndfile_save.m Octave/sndfile_play.m
+ New files for working with Octave.
+
+ * doc/octave.html
+ Document explaining the use of the above three Octave scripts.
+
+2002-09-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed bug in RDWR mode.
+
+2002-09-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Fixed psf_get_date_str() for systems which don't have gmtime_r() or
+ gmtime().
+
+ * src/file_io.c
+ Added #include <io.h> for Win32. Reported by Koen Tanghe.
+
+2002-09-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Added 'S' format specifier for psf_binheader_writef() which writes a C
+ string, including single null terminator to the header.
+ Added 'j' format specifier to allow jumping forwards or backwards in the
+ header.
+ Added function psf_get_date_str().
+
+ * src/mat5.c
+ Complete read and write support.
+
+ * doc/index.html
+ Added entries for MAT4 and MAT5 in capabilities matrix.
+
+2002-09-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/mat4.c
+ Completed read and write support.
+
+ * src/common.h src/sndfile.c
+ Added MAT4 and MAT5 specific error messages.
+
+ * tests/write_read_test.tpl tests/Makefile.am
+ Added tests for MAT4 and MAT5 files.
+
+ * tests/stdio_test.c tests/stdout_test.c tests/stdin_test.c
+ Added tests for MAT4 and MAT5 files.
+
+2002-09-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/command.c
+ Added elements for SF_FORMAT_MAT4 and SF_FORMAT_MAT5 to major_formats
+ array.
+
+ * examples/sfconvert.c
+ Added mat4 and mat5 output targets.
+
+2002-09-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Added check to prevent errors openning read only formats for read/write.
+
+ * src/interleave.c
+ New file for interleaving non-interleaved data. Non-interleaved data is
+ only supported on read.
+
+ * src/Makefile.am
+ Added src/interleave.c to build.
+
+2002-09-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/double64.c src/common.h
+ Added double64_be_read(), double64_le_read(), double64_be_write() and
+ double64_le_write() which replace double64_read() and double64_write().
+
+ * src/common.c
+ Cleanup of psf_binheader_readf() and add ability to read big and little
+ endian doubles (required by mat4.c and mat5.c).
+ Add ability for psf_binheader_writef() to write doubles to sound file
+ headers.
+
+2002-09-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/mat5.c
+ New file for reading Matlab (tm) version 5 data files. This is also the
+ native binary file format for version 2.1.X of GNU Octave which will be
+ used for testing.
+ Not complete yet.
+
+ * src/mat4.c
+ New file for reading Matlab (tm) version 4.2 data files. This is also the
+ native binary file format for version 2.0.X of GNU Octave which will be
+ used for testing.
+ Not complete yet.
+
+ * src/sndfile.h.in src/sndfile.c src/common.h src/command.c src/Makefile.am
+ Mods to add Matlab files.
+
+ * src/common.[ch]
+ Added readf_endian field to SF_PRIVATE struct allowing endianness to
+ remembered across calls to sf_binheader_readf().
+ Fixed bug in width_specifier behaviour for printing hex values.
+
+2002-08-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Check return value of close() call in psf_fclose().
+
+2002-08-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ms_adpcm.c
+ Commented out some code where 0x10000 was being subtracted from a short
+ and the result assigned to a short again. Andrew Zaja found this.
+
+2002-08-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/command.html
+ Fixed typo found by Tommi Ilmonen.
+
+ * src/ima_adpcm.c
+ Changed type of diff from short to int to prevent errors which can occur
+ during very rare circumstances. Thanks to FUWAFUWA.
+
+2002-08-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/floating_point_test.c
+ Disable testing on machines without lrintf().
+
+ * Win32/Makefile.msvc
+ Added dwd.c and wve.c to build.
+
+ * configure.in
+ Bumped version to 1.0.0.
+
+2002-08-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Add a #include for Mac OS 9. Thanks to Stephane Letz.
+
+ * src/wav.c
+ Changed an snprintf to LSF_SNPRINTF.
+
+ * doc/Makefile.am
+ Added version-1.html.
+
+2002-08-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Bumped version to 1.0.rc6.
+
+ * src/*.c
+ Modified scaling of normalised floats and doubles to integers. Until now
+ this has been done by multiplying by 0x8000 for short output, 0x80000000
+ for 32 bit ints and so on. Unfortunately this can cause an overflow and
+ wrap around in the target value. All thes values have therefore been
+ reduced to 0x7FFF, 0x7FFFFFFF and so on. The conversion from ints to
+ normalised floats and doubles remains unchanged. This does mean that for
+ repeated conversions normalised float -> pcm16 -> normalised float would
+ result in a decrease in amplitude of 0x7FFF/0x8000 on every round trip.
+ This is undesirable but less undesireable than the wrap around I am trying
+ to avoid.
+
+ * tests/floating_point_test.c
+ Removed file hash checking because new float scaling procedure introduced
+ above prevented the ability to crate a has on both x86 and PowerPC systems.
+
+2002-08-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/txw.c
+ Completed reading of TXW files. Seek doesn't work yet.
+
+ * src/file_io.c
+ Added a MacOS 9 replacement for ftruncate().
+
+ * MacOS/sndfile.h
+ Added MacOS 9 header file. This should be copied into src/ to compile
+ libsndfile for MacOS9.
+
+2002-08-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed commands SF_SET_NORM_DOUBLE and SFC_SET_NORM_FLOAT to return their
+ values after being set. Reported by Jussi Laako.
+
+ * configure.in
+ If autogen is not found, touch all .c and .h files in tests/.
+
+ * src/common.c
+ Added format width specifier to psf_log_printf() for %u, %d, %D and %X.
+
+ * src/dwd.c
+ Completed implementation of read only access to these files.
+
+ * src/common.h src/*.c src/pcm.c
+ Removed redundant field chars from SF_PRIVATE struct and modified
+ pcm_init() to do without it.
+
+2002-08-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wve.c
+ New file implementing read of Psion Alaw files. This will be a read only
+ format. Implementation complete.
+
+ * src/dwd/c
+ Started implementation of DiamondWare Digitized files. Also read only, not
+ complete.
+
+ * src/wav.c
+ Add parsing of 'smpl' chunk.
+
+ * src/paf.c
+ Fixed reading on un-normalized doubles and floats from 24 bit PAF files.
+ This brings it into line with the reading of 8 bit files into
+ un-normalized doubles which returns values in the range [-128, 127].
+
+ * src/common.c
+ Modified psf_log_printf() to accept the %% conversion specifier to allow
+ printing of a single '%'.
+
+ * src/sds.c
+ Read only of 16 bit samples is working. Need to build a test harness for
+ this and other read only formats.
+
+2002-08-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Added --enable-experimental configure option.
+ Removed pkg-config message at the end of the configure process.
+
+ * src/sds.c src/txw.c src/rx2.c src/sd2.c
+ Moved all the code in these files inside #if ENABLE_EXPERIMENTAL_CODE
+ blocks and added new *_open() function for the case where experimental is
+ not enabled. These new functions just return SFE_UNIMPLMENTED.
+
+ * Win32/sndfile.h src/sndfile.h.in src/common.h
+ Removed un-necessary #pragma pack commands.
+
+ * src/file_io.c
+ Implemented psf_ftruncate() and much other hacking for Win32.
+
+ * Win32/Makefile.msvc
+ Updated.
+
+ * doc/win32.html
+ Updated to include the copying of the sndfile.h file from the Win32/
+ directory to the src/ directory.
+
+ * Make.bat
+ Batch file to make compiling on Wi32 a little easier. Implements "make" and
+ "make check".
+
+2002-08-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ Add place holder for ftruncate() on Win32 which doesn't have ftruncate().
+ This will need to be fixed later.
+
+ * src/sndfile.h.in
+ New file (copy of sndfile.h) with sets up @TYPEOF_SF_COUNT_T@ which will be
+ replaced by the correct type during configure.
+
+ * configure.in
+ Modified to find a good type for TYPEOF_SF_COUNT_T.
+
+ * src/aiff.c
+ Fixed a bug when reading malformed headers.
+
+ * src/common.c
+ Set read values to zero before performing read.
+
+2002-08-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/command.html
+ Fixed some HTML tags which were not allowing jumps to links within the
+ page.
+
+ * src/sds.c
+ Massive hacking on this.
+
+ * src/wav.c
+ Added recognition of 'clm ' tag.
+
+2002-08-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Added beginning of a capabilities list beyond simple file formats which
+ can be read/written.
+
+ * src/aiff.c
+ Added parsing of INST and MARK chunks of AIFF files. At the moment this
+ data is simply recorded in the log buffer. Later it will be possible to
+ read this data from an application using sf_command().
+
+ * src/wav.c
+ Added parsing of 'cue ' chunk which contains loop information in WAV files.
+
+ * exampes/sndfile-info.c
+ Changed reporting of Samples to Frames.
+
+ * src/wav.c src/w64.c src/aiff.c src/wav_w64.h
+ Moved from a samples to a frames nomenclature to avoid confusion.
+
+ * doc/FAQ.html
+ What's the best format for storing temporary files?
+
+ * src/sds.c
+ New file for reading/writing Midi Sample Dump Standard files.
+
+ * src/Makefile.am src/sndfile.c src/common.[ch]
+ Added hooks for sds.c.
+
+ * examples/sndfile-info.c
+ Changed from using sf_perror() to using sf_error_str().
+
+2002-08-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html
+ Added explanation of mode parameter for sf_open().
+ Added explanation of usage of SFM_* values in sf_seek().
+
+ * src/sndfile.[ch] src/command.c src/file_io.c src/common.h
+ Implemented SFC_FILE_TRUNCATE to allow a file to be truncated. File
+ truncation was suggested by James McCartney.
+
+ * src/command.html
+ Documented SFC_FILE_TRUNCATE.
+
+ * tests/command_test.c
+ Add tests for SFC_FILE_TRUNCATE.
+
+ * src/sndfile.c
+ Added a thrid parameter to the VALIDATE_SNDFILE_AND_ASSIGN_PSF macro to
+ make resetting the error number optional. All uses of the macro other than
+ in error reporting functions were changed to reset the error number.
+
+ * src/pcm.c
+ Fixed a bug were sf_read_* was logging an SFE_SHORT_READ even when no error
+ occurred.
+
+ * tests/write_read_test.tpl
+ Added tests of internal error state.
+
+2002-08-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/GSM610/private.h src/GSM610/*.c src/GSM610/Makefile.am
+ Renamed private.h to gsm610_priv.h to prevent clash with other headers
+ named private.h in other directories. (Probably only a problem on MacOS 9).
+
+ * src/G72x/private.h src/G72x/*.c src/G72x/Makefile.am
+ Renamed private.h to g72x_priv.h to prevent clash with other headers
+ named private.h in other directories. (Probably only a problem on MacOS 9).
+
+ * MacOS/config.h
+ Changed values of HAVE_LRINT and HAVE_LRINTF to force use of code in
+ float_cash.h.
+
+ * src/sndfile.h
+ Changes the name of samples field of the SF_INFO to frames. The old name
+ had caused too much confusion and it simply had to be changed. There will
+ be at least one more pre-release.
+
+2002-08-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/index.html
+ Updated formats matrix to include RAW (header-less) GSM 6.10.
+ Fix specificaltion of table and spelling mistakes.
+
+ * src/sndfile.c src/command.c
+ Fixed bug in SFC_CALC_MAX_SIGNAL family and psf_calc_signal_max ().
+
+ * tests/command.c
+ Removed cruft.
+ Added test for SFC_CALC_MAX_SIGNAL and SFC_CALC_NORM_MAX_SIGNAL.
+
+ * configure.in
+ Update version to 1.0.0rc5.
+
+ * sfendian.h
+ Removed inclusion of un-necessary header.
+
+2002-08-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Minor fixes of info written to log buffer.
+
+ * src/float_cast.h
+ Add definition of HAVE_LRINT_REPLACEMENT.
+
+ * tests/floating_point_test.c
+ Fix file hash check on systems without lrint/lrintf.
+
+ * tests/dft_cmp.c
+ Limit SNR to less than -500.0dB.
+
+ * examples/sndfile2oct.c
+ Fixed compiler warnings.
+
+ * doc/api.html
+ Fixed error where last parameter of sf_error_str() was sf_count_t instead
+ of size_t.
+
+2002-08-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ Why doesn't libsndfile do interleaving/de-interleaving.
+
+ * tests/pcm_test.tpl
+ On Win32 do not perform hash check on files containing doubles.
+
+2002-08-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Defined SF_COUNT_MAX_POSITIVE() macro, a portable way of setting variables
+ of type sf_count_t to their maximum positive value.
+
+ * src/dwvw.c src/w64.c
+ Used SF_COUNT_MAX_POSITIVE().
+
+2002-07-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/paf.c
+ Fixed bug in reading/writing of 24 bit PCM PAF files on big endian systems.
+
+ * tests/floating_point_tests.c
+ Fixed hash values for 24 bit PCM PAF files.
+ Disabled file has check if lrintf() function is not available and added
+ warning.
+ Decreased level of signal from a peak of 1.0 to a value of 0.95 to prevent
+ problems on platforms without lrintf() ie Solaris.
+
+2002-07-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fixed a problem with two different kinds of mal-formed WAV file header. The
+ first had the 'fact' chunk before the 'fmt ' chunk, the other had an
+ incomplete 'INFO' chunk at the end of the file.
+
+ * src/w64.c
+ Added fix to allow differentiation between W64 files and ACID files.
+
+ * src/au_g72x.c src/common.h src/sndfile.c
+ Added error for G72x encoded files with more than one channel.
+
+ * tests/pcm_test.tpl tests/utils.tpl
+ Moved function check_file_hash_or_die() to utils.tpl. Function was then
+ modified to calculate the has of the whole file.
+
+ * src/wav.c
+ Fixed problem writing the 'fact' chunk on big endian systems.
+
+ * tests/sfconvert.c
+ Fixed bug where .paf files were being written as Sphere NIST.
+
+2002-07-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/voc.c
+ Fix for reading headers generated using SFC_UPDATE_HEADER_NOW.
+
+ * doc/command.html
+ Add docs for SFC_UPDATE_HEADER_NOW and SFC_SET_UPDATE_HEADER_AUTO.
+
+2002-07-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * man/sndfile-info.1 man/sndfile-play.1
+ Added manpages supplied by Joshua Haberman the Debian maintainer for
+ libsndfile. Additional tweaks by me.
+
+ * configure.in man/Makefile.am
+ Hooked manpages into autoconf/automake system.
+
+ * src/sndfile.c
+ Added hooks for SFC_SET_UPDATE_HEADER_AUTO.
+
+ * tests/update_header_test.c
+ Improved rigor of testing.
+
+ * src/*.c
+ Fixed problem with *_write_header() functions.
+
+2002-07-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/*.html
+ Updates to documentation to fix problems found by wdg-html-validator.
+
+ * src/common.h src/command.c
+ Added normalize parameter to calls to psf_calc_signal_max() and
+ psf_calc_max_all_channels().
+
+ * src/sndfile.c
+ Added handling for commands SFC_CALC_NORM_SIGNAL_MAX and
+ SFC_CALC_NORM_MAX_ALL_CHANNELS.
+
+ * doc/command.html
+ Added entry for SFC_CALC_NORM_SIGNAL_MAX and SFC_CALC_NORM_MAX_ALL_CHANNELS.
+
+2002-07-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c Win32/Makefile.msvc
+ Get sndfile-play program working on Win32. The Win32 PCM sample I/O API
+ sucks. The sndfile-play program now works on Linux, MacOSX, Solaris and
+ Win32.
+
+2002-07-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/FAQ.html
+ New file for frequently asked questsions.
+
+2002-07-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html
+ Documentation fixes.
+
+ * src/au.[ch] src/au_g72x.c src/G72x/g72x.h
+ Add support of 40kbps G723 ADPCM encoding.
+
+ * tests/lossy_comp_test.c tests/floating_point_test.c
+ Add tests for 40kbps G723 ADPCM encoding.
+
+ * doc/index.html
+ Update support matrix.
+
+2002-07-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/command.html
+ Documented SFC_GET_SIMPLE_FORMAT_COUNT, SFC_GET_SIMPLE_FORMAT,
+ SFC_GET_FORMAT_* and SFC_SET_ADD_PEAK_CHUNK.
+
+ * src/sndfile.c src/pcm.c
+ Add ability to turn on and off the addition of a PEAK chunk for floating
+ point WAV and AIFF files.
+
+ * src/sndfile.[ch] src/common.h src/command.c
+ Added sf_command SFC_CALC_MAX_ALL_CHANNELS. Implemented by Maurizio Umberto
+ Puxeddu.
+
+ * doc/command.html
+ Docs for SFC_CALC_MAX_ALL_CHANNELS (assisted by Maurizio Umberto Puxeddu).
+
+2002-07-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/gsm610.c
+ Finalised support for GSM 6.10 AIFF files and added support for GSM 6.10
+ encoded RAW (header-less) files.
+
+ * src/wav.c
+ Add support for IBM_FORMAT_MULAW and IBM_FORMAT_ALAW encodings.
+
+ * src/api.html
+ Fixed more documentation bugs.
+
+2002-07-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h src/common.h
+ Moved some yet-to-be-implelmented values for SF_FORMAT_* from the public
+ header file sndfile.h to the private header file common.h to avoid
+ confusion about the actual capabilities of libsndfile.
+
+2002-07-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c src/wav.c
+ Fixed file parsing for WAV and AIFF files containing non-audio data after
+ the data chunk.
+
+ * src/aiff.c src/sndfile.c
+ Add support for GSM 6.10 encoded AIFF files.
+
+ * tests/lossy_comp_test.c tests/Makefile.am
+ Add tests for GSM 6.10 encoded AIFF files.
+
+ * src/*.c
+ Fix compiler warnings.
+
+2002-07-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/command_test.c
+ For SFC_SET_NORM_* tests, change the file format from SF_FORMAT_WAV to
+ SF_FORMAT_RAW.
+
+ * src/sndfile.c
+ Added sf_command(SFC_TEST_ADD_TRAILING_DATA) to allow testing of reading
+ from AIFF and WAV files with non-audio data after the audio chunk.
+
+ * src/common.h
+ Add test commands SFC_TEST_WAV_ADD_INFO_CHUNK and
+ SFC_TEST_AIFF_ADD_INST_CHUNK. When these commands are working, they will be
+ moved to src/sndfile.h
+
+ * src/aiff.c src/wav.c
+ Begin implementation of XXXX_command() hook for sf_command().
+
+ * tests/write_read_test.tpl
+ Added sf_command (SFC_TEST_ADD_TRAILING_DATA) to ensure above new code was
+ working.
+
+2002-07-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/update_header_test.c
+ Allow read sample count == write sample count - 1 to fix problems with VOC
+ files.
+
+ * tests/write_read_test.tpl tests/pcm_test.tpl
+ Fixed some problems in the test suite discovered by using Valgrind.
+
+2002-07-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/utils.[ch] tests/*.c
+ Renamed check_log_buffer() to check_log_buffer_or_die().
+
+ * src/sndfile.c
+ SFC_UPDATE_HEADER_NOW and SFC_SETUPDATE_HEADER_AUTO almost finished. Works
+ for all file formats other than VOC.
+
+2002-07-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.[ch] src/common.h
+ Started adding functionality to allow the file header to be updated before
+ the file is closed on files open for SFM_WRITE. This was requested by
+ Maurizio Umberto Puxeddu who is using libsndfile for file I/O in iCSound.
+
+ * tests/update_header_test.c
+ New test program to test that the above functionality is working correctly.
+
+ * tests/peak_chunk_test.c tests/floating_point_test.c
+ Cleanups.
+
+2002-07-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sfendian.[ch]
+ Changed length count parameters for all endswap_XXX() functions from
+ sf_count_t (which can be 64 bit even on 32 bit architectures) to int. These
+ functions are only called frin inside the library, are always called with
+ integer parameters and doing the actual calculation on 64 bit values is
+ slow in comparision to doing it on ints.
+
+ * examples/sndfile-play.c
+ More playback hacking for Win32.
+
+2002-07-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ In psf_log_printf(), changed %D format conversion specifier to %M (marker) and
+ added %D specifier for printing the sf_count_t type.
+
+ * src/*.c
+ Changed all usage of psf_log_printf() with %D format conversion specifiers
+ to use %M conversion instead.
+
+ * tests/pcm_test.tpl tests/pcm_test.def
+ New files to autogen pcm_test.c.
+
+ * src/pcm.c
+ Fixed bug in scaling floats and doubles to 24 bit PCM and vice versa.
+
+2002-07-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Fix setup of $ac_cv_sys_largefile_CFLAGS so that sndfile.pc gets valid
+ values for CFLAGS.
+
+ * examples/sndfile-play.c
+ Start adding playback support for Win32.
+
+2002-07-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c
+ Worked to removed compiler warnings.
+ Extensive refactoring.
+
+ * src/common.[ch]
+ Added function psf_memset() which works like the standard C function memset
+ but takes and sf_count_t as the length parameter.
+
+ * src/sndfile.c
+ Replaced calls to memset(0 with calls to psf_memset() as required.
+
+2002-07-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Added "libsndfile : " to the start of all error messages. This was suggested
+ by Conrad Parker author of Sweep ( http://sweep.sourceforge.net/ ).
+
+ * src/sfendian.[ch]
+ Added endswap_XXXX_copy() functions.
+
+ * src/pcm.c src/float32.c src/double64.c
+ Use endswap_XXXX_copy() functions and removed dead code.
+ Cleanups and optimisations.
+
+2002-07-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/sndfile.h
+ Gave values to all the SFC_* enum values to allow better control of the
+ interface as commands are added and removed.
+ Added new command SFC_SET_ADD_PEAK_CHUNK.
+
+ * src/wav.c src/aiff.c
+ Modified wav_write_header and aiff_write_header to make addition of a PEAK
+ chunk optional, even on floating point files.
+
+ * tests/benchmark.tpl
+ Added call to sf_command(SFC_SET_ADD_PEAK_CHUNK) to turn off addition of a
+ PEAK chunk for the benchmark where we are trying to miximize speed.
+
+ * src.pcm.c
+ Changed tribyte typedef to something more sensible.
+ Further conversion speed ups.
+
+2002-07-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/command.c
+ In major_formats rename "Sphere NIST" to "NIST Sphere".
+
+ * src/common.c src/sfendian.c
+ Moved all endswap_XXX_array() functions to sfendian.c. These functions will
+ be tweaked to provide maximum performance. Since maximum performance on one
+ platform does not guarantee maximum performance on another, a small set of
+ functions will be written and the optimal one chosen at compile time.
+
+ * src/common.h src/sfendian.h
+ Declarations of all endswap_XXX_array() functions moved to sfendian.h.
+
+ * src/Makefile.am
+ Add sfendian.c to build targets.
+
+2002-07-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pcm.c src/sfendian.h
+ Re-coded PCM encoders and decoders to match or better the speed of
+ libsndfile version 0.0.28.
+
+2002-06-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Add checking for WAVPACK data in standard PCM WAV file. Return error if
+ found. This WAVPACK is *WAY* broken. It uses the same PCM WAV file header
+ and then stores non-PCM data.
+
+ * tests/benchmark.tpl
+ Added more tests.
+
+2002-06-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/benchmark.tpl
+ Added conditional definition of M_PI.
+ For Win32, set WRITE_PERMS to 0777.
+
+ * Win32/Makefile.msvc
+ Added target to make generate program on Win32.
+
+ * src/samplitude.c
+ Removed handler for Samplitude RAP file format. This file type seems rarer
+ than hens teeth and is completely undocumented.
+
+ * src/common.h src/sndfile.c src/Makefile.am Win32/Makefile.msvc
+ Removed references to sampltiude RAP format.
+
+ * tests/benchmark.tpl
+ Benchmark program now prints the libsndfile version number when run. This
+ program was also backported to version 0 to compare results. Version
+ 1.0.0rc2 is faster than version 0.0.28 on most conversions but slower on
+ some. The slow ones need to be fixed before final release.
+
+2002-06-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/benchmark.def tests/benchmark.tpl
+ New files which generate tests/benchmark.c using Autogen. Added int ->
+ SF_FORMAT_PCM_24 test.
+
+ * tests/benchmark.c
+ Now and Autogen output file.
+
+ * tests/Makefile.am
+ Updated for above changes.
+
+2002-06-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/benchmark.c
+ Basic benchmark program complete. Need to convert it to Autogen.
+
+ * Win32/Makefile.msvc
+ Added benchmark.exe target.
+
+2002-06-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/generate.c
+ New program to generate a number of different output file formats from a
+ single input file. This allows testing of the created files.
+
+ * tests/benchmark.c
+ New test program to benchmark libsndfile. Nowhere near complete yet.
+
+ * examples/Makefile.am tests/Makefile.am
+ New make rules for the two new programs.
+
+2002-06-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/libsndfile.def
+ Removed definition for sf_signal_max().
+
+ * src/sndfile.c
+ Removed cruft.
+
+ * doc/index.html
+ A number of documentation bugs were fixed. Thanks to Anand Kumria.
+
+ * doc/version-1.html
+ Minor doc updates.
+
+ * configure.in
+ Bumped version to 1.0.0rc2.
+
+ * src/sf_command.h src/Makefile.am
+ Removed the header file as it was no longer being used. Thanks to Anand
+ Kunria for spotting this.
+
+ * doc/index.html
+ A number of documentation bugs were fixed. Thanks to Anand Kumria.
+
+2002-06-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Test for Win32 before testing SIZEOF_OFF_T so that it works correctly
+ on Win32..
+
+ * src/file_io.c
+ Win32 fixes to ensure O_BINARY is used for file open.
+
+ * doc/win32.html
+ New file documenting the building libsndfile on Win32.
+
+ * doc/*.html
+ Updating of documentation.
+
+2002-06-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/pcm_test.c
+ Minor changes to allow easier determination of test file name.
+
+ * src/sndfile.[ch]
+ Removed function sf_signal_max().
+
+ * examples/sndfile-play.c
+ Changed call to sf_signal_max() to a call to sf_command().
+
+2002-06-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/format.c src/command.c
+ Renamed format.c to command.c which will now include code for sf_command()
+ calls to perform operations other than format commands.
+
+ * src/sndfile.c src/sndfile.h
+ Removed function sf_get_signal_max() which is replaced by commands passed
+ to sf_command().
+
+ * src/command.c
+ Implement commands SFC_CALC_SIGNAL_MAX.
+
+ * doc/command.html
+ Documented SFC_CALC_SIGNAL_MAX.
+
+2002-06-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-play.c
+ Mods to make sndfile-play work on Solaris. The program sndfile-play now
+ runs on Linux, MaxOSX and Solaris. Win32 to come.
+
+ * src/format.c
+ Added SF_FORMAT_DWVW_* to subtype_formats array.
+
+ * src/nist.c
+ Added support for 8 bit NIST Sphere files. Example file supplied by Anand
+ Kumria.
+
+2002-06-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sndfile-info.c
+ Tidy up of output format.
+
+ * examnples/sndfile-play.c
+ Mods to make sndfile-play work on MacOSX using Apple's CoreAudio API.
+
+ * configure.in
+ Add new variables OS_SPECIFIC_INCLUDES and OS_SPECIFIC_LINKS which were
+ required to supply extra include paths and link parameters to get
+ sndfile-play working on MacOSX.
+
+ * examples/Makefile.am
+ Use OS_SPOECIFIC_INCLUDES and OS_SPECIFIC_LINKS to build commands for
+ sndfile-play.
+
+2002-06-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/nist.c
+ Added ability to read/write new NIST Sphere file types (A-law, u-law).
+ Header parser was re-written from scratch. Example files supplied by Anand
+ Kumria.
+
+ * src/sndfile.c
+ Support for A-law and u-law NIST files.
+
+ * tests/Makefile.am tests/lossy_comp_test.c
+ Tests for A-law and u-law NIST files.
+
+2002-06-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/utils.c
+ Fixed an error in error string.
+
+2002-06-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * acinclude.m4
+ Removed exit command to allow cross-compiling.
+
+ * Win32/unistd.h src/file_io.c
+ Moved contents of first file into the second file (enclosed in #ifdef).
+ Win32/unistd.h is now an empty file but still must be there for libsndfile
+ to compile on Win32.
+
+ * src/sd2.c, src/sndfile.c:
+ Fixes for Sound Designer II files on big endian systems.
+
+2002-06-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Modified to work around problems with crappy MacOSX version of sed.
+ Added sanity check for proper values for CFLAGS.
+
+2002-06-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Code clean up in sf_open ().
+
+ * Win32/Makefile.msvc
+ Michael Fink's contributed MSVC++ makefile was hacked to bits and put back
+ together in a new improved form.
+
+ * src/file_io.c
+ Fixes for Win32; _lseeki64() returns an invalid argument for calls like
+ _lseeki64(fd, 0, SEEK_CUR) so need to use _telli64 (fd) instead.
+
+ * src/common.h src/sndfile.c src/wav.c src/aiff.c
+ Added SFE_LOG_OVERRUN error.
+ Added termination for potential infinite loop when parsing file headers.
+
+ * src/wav.c src/w64.c
+ Fixed bug casuing incorrect header generation when opening file read/write.
+
+2002-06-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/api.html
+ Improved the documentation to make it clearer that the file read method
+ and the underlying file format are completely disconnected. Suggested
+ by Josh Green.
+
+ * doc/command.html
+ Started correcting docs to take into account changes made to the
+ operations of the sf_command () function. Not complete yet.
+
+ * src/sndfile.c
+ Reverted some changes which had broken the partially working SDII header
+ parsing. Now have access to an iBook with OS X so reading and writing SDII
+ files on all platforms should be a reality in the near future. On Mac this
+ will involve reading the resource fork via the standard MacOS API. To move
+ a file from Mac to another OS, the resource and data forks will need to be
+ combined before transfer. The combined file will be read on both Mac and
+ other OSes like any other file.
+
+2002-06-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * ltmain.sh
+ Applied a patch from http://fink.sourceforge.net/doc/porting/libtool.php
+ which allows libsndfile to compile on MacOSX 10.1. This patch should not
+ interfere with compiling on other OSes.
+
+ * src/GSM610/private.h
+ Changes to fix compile problems on MacOSX (see src/GSM610/ChangeLog).
+
+ * src/float_cast.h
+ Added MacOSX replacements for lrint() and lrintf().
+
+2002-06-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Replaced the code to print the filename to the log buffer when a file is
+ opened. This code seems to have been left out during the merge of
+ sf_open_read() and sf_open_write() to make a single functions sf_open().
+
+2002-06-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fixed a bug where the WAV header parser was going into an infinite loop
+ on a badly formed LIST chunk. File supplied by David Viens.
+
+2002-05-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Added a message at the end of the configuration process to warn about the
+ need for the use of pkg-config when linking programs against version 1 of
+ libsndfile.
+
+ * doc/pkg-config.html
+ New documentation file containing details of how to use pkg-config to
+ retrieve settings for CFLAGS and library locations for linking files
+ against version 1 of libsndfile.
+
+2002-05-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fixed minor bug in handling of so-called ACIDized WAV files.
+
+2002-05-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/libsndfile.def Win32/Makefile.msvc
+ Two new files contributed by Michael Fink (from the winLAME project)
+ which allows libsndfile to be built on windows in a MSDOS box by doing
+ "nmake -f Makefile.msvc". Way cool!
+
+2002-05-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ MacOSX is SSSOOOOOOO screwed up!!! I can't believe how hard it is to
+ generate a tarball which will configure and compile on that platform.
+ Joined the libtool mailing list to try and get some answers.
+
+2002-05-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Changed to autoconf version 2.50. MacOSX uses autoconf version 2.53 which
+ is incompatible with with version 2.13 which had been using until now.
+ The AC_SYS_LARGE_FILE macro distributed withe autoconf 2.50 is missing a
+ few features so AC_SYS_EXTRA_LARGE file was defined to replace it.
+
+ * configure.in
+ Changed to automake version 1.5 to try and make a tarball which will
+ work on MacOSX.
+
+2002-05-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_gsm610.c
+ Changed name to gsm610.c. Added reading/writing of headerless files.
+
+ * src/sndfile.c src/raw.c
+ Added ability to read/write headerless (SF_FORMAT_RAW) GSM 6.10 files.
+
+2002-05-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/lossy_comp_test.c
+ Clean up in preparation for Autogen-ing this file.
+
+ * src/GSM610/*.[ch]
+ Code cleanup and prepartion forgetting file seek working. Details in
+ src/GSM610/ChangeLog.
+
+ * sndfile.pc.in
+ Testing complete. Is sndfile.m4 still needed?
+
+2002-05-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.tpl tests/rdwr_test.tpl
+ Merged tests from these two programs into write_read_test.tpl and deleted
+ rdwr_test.tpl.
+
+2002-05-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/w64.c src/svx.c src/paf.c
+ Fixed bugs in read/write mode.
+
+2002-05-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/Makefile.am
+ Renamed sfplay.c to sndfile-play.c and sndfile_info.c to sndfile-info.c for
+ consistency when these programs become part of the Debian package
+ sndfile-programs.
+
+ * sndfile.pc.in
+ New file to replace sndfile-config.in. Libsndfile now uses the pkg-config
+ model for providing installation parameters to dependant programs.
+
+ * src/sndfile.c
+ Cleanup of code in sf_open().
+
+2002-05-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/utils.tpl tests/write_read_test.tpl
+ More conversion to Autogen fixes and enchancements.
+
+ * src/*.c
+ Read/write mode is now working for 16, 24 and 32 bit PCM as well as 32
+ bit float and 64 bit double data. More tests still required.
+
+ * src/Makefile.am
+ Added DISTCLEANFILES target to remove config.status and config.last.
+
+ * Win32/Makefile.am MacOS/Makefile.am
+ Added DISTCLEANFILES target to remove Makefile.
+
+2002-05-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.[ch] tests/rdwr_test.c
+ More verifying workings of read/write mode. Fixing bugs found.
+
+ * tests/utils.[ch]
+ Made these files Autogen generated files.
+
+ * tests/util.tpl tests/util.def
+ New Autogen files to generate utils.[ch]. Moved some generic test functions
+ into this file. Autogen is such a great tool!
+
+2002-05-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pcm.c src/float_cast.h Win32/config.h
+ Fixed a couple of Win32 specific bugs pointed out by Michael Fink
+ (maintainer of WinLAME) and David Viens.
+
+ * tests/check_log_buffer.[ch] tests/utils.[ch]
+ Moved check_log_buffer() to utils.[ch] and deleted old file.
+
+2002-05-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.[ch] src/sndfile.c
+ New function psf_default_seek() which will be the default seek function
+ for things like PCM and floating point data. This default is set for
+ both read and write in sf_open() but can be over-ridden by any codec
+ during it's initialisation.
+
+2002-05-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/au.c
+ AU files use a data size value of -1 to mean unknown. Fixed au_open_read()
+ to allow opening files like this.
+
+ * tests/rdwr_test .c
+ Added more tests.
+
+ * src/sndfile.c
+ Fixed bugs in read/write mode found due to improvements in the test
+ program.
+
+2002-04-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/rdwr_test .c
+ New file for testing read/write mode.
+
+2002-04-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * m4/*
+ Removed all m4 macros from this directory as they get concatenated to form
+ the file aclocal.m4 anyway.
+
+ * sndfile.m4
+ Moved this from the m4 directory to the root directory asn this is part of
+ the distribution and is installed during "make install".
+
+2002-04-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/float32.c
+ Removed logging of peaks for all file formats other than AIFF and WAV.
+
+ * tests/write_read_test.tpl tests/write_read_test.def
+ New files which autogen uses to generate write_read_test.c. Doing it this
+ way makes write_read_test.c far easier to maintain. Other test programs
+ will be converted to autogen in the near future.
+
+ * src/*.c
+ Fixed a few bugs found when testing on Sparc (bug endian) Solaris.
+
+2002-04-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * doc/*.html
+ Fixed documention versioning.
+
+ * configure.in
+ Fixed a bug in the routines which search for Large File Support on systems
+ which have large file support by defualt.
+
+2002-04-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.[ch]
+ Found and fixed an issue which can cause a bug in other software (I was
+ porting Conrad Parker's Sweep program from version 0 of the library to
+ version 1). When opening a file for write, the libsndfile code would
+ set the sfinfo.samples field to a maximum value.
+
+ * tests/write_read_test.c
+ Added tests to detect the above problem.
+
+2002-04-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.[ch]
+ Finished base implementation of read/write mode. Much more testing still
+ needed.
+
+ * m4/largefile.m4
+ Macro for detecting Large File Standard capabilities. This macro was ripped
+ out of the aclocal.m4 file of GNU tar-1.13.
+
+ * configure.in
+ Added detection of large file support. Files larger than 2 Gigabytes should
+ now be supported on 64 bit platforms and many 32 bit platforms including
+ Linux (2.4 kernel, glibc-2.2), *BSD, MacOS, Win32.
+
+ * libsndfile_convert_version.py
+ A Python script which attempts to autoconvert code written to use version 0
+ to version 1.
+
+2002-04-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.[ch]
+ Finished base implementation of read/write mode. Much more testing still
+ needed.
+
+ * tests/write_read_test.c
+ Preliminary tests for read/write mode added. More needed.
+
+2002-04-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.[ch]
+ Removed sf_open_read() and sf_open_write() functions,replacting them with
+ sf_open() which takes an extra mode parameter (SF_OPEN_READ, SF_OPEN_WRITE,
+ or SF_OPEN_RDWR). This new function sf_open can now be modified to allow
+ opening a file formodification (RDWR).
+
+2002-04-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c
+ Completed merging of separate xxx_open_read() and xxx_open_write()
+ functions. All tests pass.
+
+2002-04-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/au.c
+ Massive refactoring required to merge au_open_read() with au_open_write()
+ to create au_open().
+
+2002-04-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c
+ Started changes required to allow a sound file to be opened in read/write
+ mode, with separate file pointers for read and write. This involves merging
+ of encoder/decoder functions like pcm_read_init() and pcm_write_init()
+ int a new function pcm_init() as well as doing something similar for all
+ the file type specific functions ie aiff_open_read() and aiff_open_write()
+ were merged to make the function aiff_open().
+
+2002-04-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/file_io.c
+ New file containing psf_fopen(), psf_fread(), psf_fwrite(), psf_fseek() and
+ psf_ftell() functions. These function will replace use of fopen/fread/fwrite
+ etc and allow access to files larger than 2 gigabytes on a number of 32 bit
+ OSes (Linux on x86, 32 bit Solaris user space apps, Win32 and MacOS).
+
+ * src/*.c
+ Replaced all instances of fopen with psf_open, fread with psd_read, fwrite
+ with psf_write and so on.
+
+2002-03-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/dwvw.c
+ Finally fixed all known problems with 12, 16 and 24 bit DWVW encoding.
+
+ * tests/floating_point_test.c
+ Added tests for 12, 16 and 24 bit DWVW encoding.
+
+2002-03-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * m4/endian.m4
+ Defines a new m4 macro AC_C_FIND_ENDIAN, for determining the endian-ness of
+ the target CPU. It first checks for the definition of BYTE_ORDER in
+ <endian.h>, then in <sys/types.h> and <sys/param.h>. If none of these work
+ and the C compiler is not a cross compiler it compiles and runs a program
+ to test for endian-ness. If the compiler is a cross compiler it makes a
+ guess based on $target_cpu.
+
+ * configure.in
+ Modified to use AC_C_FIND_ENDIAN.
+
+ * src/sfendian.h
+ Simplified.
+
+2002-02-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/floating_point_test.c
+ Tests completely rewritten using the dft_cmp function. Now able to
+ calculate a quick guesstimate of the Signal to Noise Ratio of the encoder.
+
+2002-02-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/dft_cmp.[ch]
+ New files containing functions for comparing pre and post lossily
+ compressed data using a quickly hacked DFT.
+
+ * tests/utils.[ch]
+ New files containing functions for saving pre and post encoded data in a
+ file readable by the GNU Octave package.
+
+2002-02-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * m4/lrint.m4 m4/lrintf.m4
+ Fixed m4 macros to define HAVE_LRINT and HAVE_LRINTF even when the test
+ is cached.
+
+2002-02-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/floating_point_test.c
+ Fixed improper use of strncat ().
+
+2002-02-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/headerless_test.c
+ New test program to test the ability to open and read a known file type as a
+ RAW header-less file.
+
+2002-02-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/losy_comp_test.c
+ Added a test to ensure that the data read from a file is not all zeros.
+
+ * examples/sfconvert.c
+ Added "-gsm610" encoding types.
+
+2002-01-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sfconvert.c
+ Added "-dwvw12", "-dwvw16" and "-dwvw24" encoding types.
+
+ * tests/dwvw_test.c
+ New file for testing DWVW encoder/decoder.
+
+2002-01-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/dwvw.c
+ Implemented writing of DWVW. 12 bit seems to work, 16 and 24 bit still broken.
+
+ * src/aiff.c
+ Improved reporting of encoding types.
+
+ * src/voc.c
+ Clean up.
+
+2002-01-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/dwvw.c
+ New file implementing lossless Delta Word Variable Width (DWVW) encoding.
+ Reading 12 bit DWVW is now working.
+
+ * src/aiff.c common.h sndfile.c
+ Added hooks for DWVW encoded AIFF and RAW files.
+
+2002-01-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/w64.c
+ Robustify header parsing.
+
+ * src/wav_w64.h
+ Header file wav.h was renamed to wav_w64.h to signify sharing of
+ definitions across the two file types.
+
+ * src/wav.c src/w64.c src/wav_w64.c
+ Refactoring.
+ Modified and moved functions with a high degree of similarity between
+ wav.c and w64.c to wav_w64.c.
+
+2002-01-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/w64.c
+ Completed work on getting read and write working.
+
+ * examples/sfplay.c
+ Added code to scale floating point data so it plays at a reasonable volume.
+
+ * tests/Makefile.am tests/write_read_test.c
+ Added tests for W64 files.
+
+2002-01-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c
+ Modded all code in file header writing routines to use
+ psf_new_binheader_writef().
+ Removed psf_binheader_writef() from src/common.c.
+ Globally replaced psf_new_binheader_writef with psf_binheader_writef.
+
+2002-01-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c
+ Modded all code in file parsing routines to use psf_new_binheader_readf().
+ Removed psf_binheader_readf() from src/common.c.
+ Globally replaced psf_new_binheader_readf with psf_binheader_readf.
+
+ * src/common.[ch]
+ Added new function psf_new_binheader_writef () which will soon replace
+ psf_binheader_writef (). The new function has basically the same function
+ as the original but has a more flexible and capable interface. It also
+ allows the writing of 64 bit integer values for files contains 64 bit file
+ offsets.
+
+2002-01-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/formats.c src/sndfile.c src/sndfile.h
+ Added code allowing full enumeration of supported file formats via the
+ sf_command () interface.
+ This feature will allow applications to avoid needing recompilation when
+ support for new file formats are added to libsndfile.
+
+ * tests/command_test.c
+ Added test code for the above feature.
+
+ * examples/list_formats.c
+ New file. An example of the use of the supported file enumeration
+ interface. This program lists all the major formats and for each major
+ format the supported subformats.
+
+2002-01-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.[ch] tests/*.c
+ Changed command parameter of sf_command () function from a test string to
+ an int. The valid values for the command parameter begin with SFC_ and are
+ listed in src/sndfile.h.
+
+2001-12-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/formats.c src/sndfile.c
+ Added an way of enumerating a set of common file formats using the
+ sf_command () interface. This interface was suggested by Dominic Mazzoni,
+ one of the main authors of Audacity (http://audacity.sourceforge.net/).
+
+2001-12-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Added checking of filename parameter in sf_open_read (). Previousy, if a
+ NULL pointer was passed the library would segfault.
+
+2001-12-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c src/common.h
+ Changed the len parameter of the endswap_*_array () functions from type
+ int to type long.
+
+ * src/pcm.c
+ Fixed a problem which
+
+2001-12-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Added conditional #include <sys/types.h> for EMX/gcc on OS/2. Thanks to
+ Paul Hartman for pointing this out.
+
+ * tests/lossy_comp_test.c tests/floating_point_test.c
+ Added definitions for M_PI for when it isn't defined in <math.h>.
+
+2001-11-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ircam.c
+ Re-implemented the header reader. Old version was making incorrect
+ assumptions about the endian-ness of the file from the magic number at the
+ start of the file. The new code looks at the integer which holds the
+ number of channels and determines the endian-ness from that.
+
+2001-11-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Added support for other AIFC types ('raw ', 'in32', '23ni').
+ Further work on IMA ADPCM encoding.
+
+2001-11-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ima_adpcm.c
+ Renamed from wav_ima_adpcm.c. This file will soon handle IMA ADPCM
+ encodings for both WAV and AIFF files.
+
+ * src/aiff.c
+ Started adding IMA ADPCM support.
+
+2001-11-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/double.c
+ New file for handling double precision floating point (SF_FORMAT_DOUBLE)
+ data.
+
+ * src/wav.c src/aiff.c src/au.c src/raw.c
+ Added support for SF_FORMAT_DOUBLE data.
+
+ * src/common.[ch]
+ Addition of endswap_long_array () for endian swapping 64 bit integers. This
+ function will work correctly on processors with 32 bit and 64 bit longs.
+ Optimised endswap_short_array () and endswap_int_array ().
+
+ * tests/pcm_test.c
+ Added and extra check. After the first file of each type is written to disk
+ a checksum is performed of the first 64 bytes and checked against a pre-
+ calculated value. This will work whatever the endian-ness of the host
+ machine.
+
+2001-11-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Added handling of u-law, A-law encoded AIFF files. Thanks to Tom Erbe for
+ supplying example files.
+
+ * tests/lossy_comp_test.c
+ Added tests for above.
+
+ * src/common.h src/*.c
+ Removed function typedefs from common.h and function pointer casting in all
+ the other files. This allows the compiler to perform proper type checking.
+ Hopefully this will prevernt problems like the sf_seek bug for OpenBSD,
+ BeOS etc.
+
+ * src/common.[ch]
+ Added new function psf_new_binheader_readf () which will eventually replace
+ psf_binheader_readf (). The new function has basically the same function as
+ the original but has a more flexible and capable interface. It also allows
+ the reading of 64 bit integer values for files contains 64 bit file
+ offsets.
+
+2001-11-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/voc.c
+ Completed implementation of VOC file handling. Can now handle 8 and 16 bit
+ PCM, u-law and A-law files with one or two channels.
+
+ * src/write_read_test.c tests/lossy_comp_test.c
+ Added tests for VOC files.
+
+2001-11-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/float_cast.h
+ Added inline asm version of lrint/lrintf for MacOS. Solution provided by
+ Stephane Letz.
+
+ * src/voc.c
+ More work on this braindamaged format. The VOC files produced by SoX also
+ have a number of inconsistencies.
+
+2001-11-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/paf.c
+ Added support for 8 bit PCM PAF files.
+
+ * tests/write_read_test.c
+ Added tests for 8 bit PAF files.
+
+2001-11-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/pcm_test.c
+ New test program to test for correct scaling of integer values between
+ different sized integer containers (ie short -> int).
+ The new specs for libsndfile state that when the source and destination
+ containers are of a different size, the most significant bit of the source
+ value becomes the most significant bit of the destination container.
+
+ * src/pcm.c src/paf.c
+ Modified to pass the above test program.
+
+ * tests/write_read_test.c tests/lossy_comp_test.c
+ Modified to work with the new scaling rules.
+
+2001-11-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/raw.c tests/write_read_test.c tests/write_read_test.c
+ Added ability to do raw reads/writes of float, u-law and A-law files.
+
+ * src/*.[ch] examples/*.[ch] tests/*.[ch]
+ Removed dependance on pcmbitwidth field of SF_INFO struct and moved to new
+ SF_FORMAT_* types and use of SF_ENDIAN_BIG/LITTLE/CPU.
+
+2001-11-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.[ch]
+ Started implmentation of major changes documented in doc/version1.html.
+
+ Removed all usage of off_t which is not part of the ISO C standard. All
+ places which were using it are now using type long which is the type of
+ the offset parameter for the fseek function.
+ This should fix problems on BeOS, MacOS and *BSD like systems which were
+ failing "make check" because sizeof (long) != sizeof (off_t).
+
+--------------------------------------------------------------------------------
+This is the boundary between version 1 of the library above and version 0 below.
+--------------------------------------------------------------------------------
+
+2001-11-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sfplay_beos.cpp
+ Added BeOS version of sfplay.c. This needs to be compiled using a C++
+ compiler so is therefore not built by default. Thanks to Marcus Overhagen
+ for providing this.
+
+2001-11-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sfplay.c
+ New example file showing how libsndfile can be used to read and play a
+ sound file.
+ At the moment on Linux is supported. Others will follow in the near future.
+
+2001-11-09 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pcm.c
+ Fixed problem with normalisation code where a value of 1.0 could map to
+ a value greater than MAX_SHORT or MAX_INT. Thanks to Roger Dannenberg for
+ pointing this out.
+
+2001-11-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pcm.c
+ Fixed scaling issue when reading/writing 8 bit files using
+ sf_read/sf_write_short ().
+ On read, values are scaled so that the most significant bit in the char
+ ends up in the most significant bit of the short. On write, values are
+ scaled so that most significant bit in the short ends up as the most
+ significant bit in the char.
+
+2001-11-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/au.c src/sndfile.c
+ Added support for 32 bit float data in big and little endian AU files.
+
+ * tests/write_read_test.c
+ Added tests for 32 bit float data in AU files.
+
+2001-11-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/lossy_comp_test.c
+ Finalised testing of stereo files where possible.
+
+2001-11-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_ms_adpcm.c
+ Fixed bug in writing stereo MS ADPCM WAV files. Thanks to Xu Xin for
+ pointing out this problem.
+
+2001-10-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_ms_adpcm.c
+ Modified function srate2blocksize () to handle 44k1Hz stereo files.
+
+2001-10-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/w64.c
+ Added support for Sonic Foundry 64 bit WAV format. As Linux (my main
+ development platform) does not yet support 64 bit file offsets by default,
+ current handling of this file format treats everything as 32 bit and fails
+ openning the file, if it finds anything that goes beyond 32 bit values.
+
+ * src/sndfile.[hc] src/common.h src/Makefile.am
+ Added hooks for W64 support.
+
+2001-10-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Added more warnings options to CFLAGS when the gcc compiler is detected.
+
+ * src/*.[ch] tests/*.c examples/*.c
+ Started fixing the warning messages due to the new CFLASG.
+
+ * src/voc.c
+ More work on VOC file read/writing.
+
+ * src/paf.c
+ Found that PAF files were not checking the normalisation flag when reading
+ or writing floats and doubles. Fixed it.
+
+ * tests/floating_point_test.c
+ Added specific test for the above problem.
+
+ * src/float_cast.h src/pcm.c
+ Added a section for Win32 to define lrint () and lrintf () in the header
+ and implement it in the pcm.c
+
+2001-10-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * sndfile-config.in m4/sndfile.m4
+ These files were donated by Conrad Parker who also provided instructions
+ on how to install them using autoconf/automake.
+
+ * src/float_cast.h
+ Fiddled around with this file some more. On Linux and other gcc supported
+ OSes use the C99 functions lrintf() and lrint() for casting from floating
+ point to int without incurring the huge perfromance penalty (particularly
+ on the i386 family) caused by the regular C cast from float to int.
+ These new C99 functions replace the FLOAT_TO_* and DOUBLE_TO_* macros which
+ I had been playing with.
+
+ * configure.in m4/lrint.m4 m4/lrintf.m4
+ Add detection of these functions.
+
+2001-10-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/voc.c
+ Completed code for reading VOC files containing a single audio data
+ segment.
+ Started implementing code to handle files with multiple VOC_SOUND_DATA
+ segments but couldn't be bothered finishing it. Multiple segment files can
+ have different sample rates for different sections and other nasties like
+ silence and repeat segments.
+
+2001-10-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/*.c
+ Removed SF_PRIVATE struct field fdata and replaced it with extra_data.
+
+ * src/voc.c
+ Further development of the read part of this woefult file format.
+
+2001-10-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/float_cast.h
+ Implemented gcc and i386 floating point to int cast macros. Standard cast
+ will be used when not on gcc for i385.
+
+ * src/pcm.c
+ Modified all uses of FLOAT/DOUBLE_TO_INT and FLOAT/DOUBLE_TO_SHORT casts to
+ comply with macros in float_cast.h.
+
+2001-10-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/voc.c
+ Changed the TYPE_xxx enum names to VOC_TYPE_xxx to prevent name clashes
+ on MacOS with CodeWarrior 6.0.
+
+ * MacOS/MacOS-readme.txt
+ Updated the compile instructions. Probably still need work as I don't have
+ access to a Mac.
+
+2001-10-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c src/aiff.c common.c
+ Changed all references to snprintf to LSF_SNPRINTF and all vsnprintf to
+ LSF_VSNPRINTF. LSF_VSNPRINTF and LSF_VSNPRINTF are defined in common.h.
+
+ * src/common.h
+ Added checking of HAVE_SNPRINTF and HAVE_VSNPRINTF and defining
+ LSF_VSNPRINTF and LSF_VSNPRINTF to appropriate values.
+
+ * src/missing.c
+ New file containing a minimal implementation of snprintf and vsnprintf
+ functions named missing_snprintf and missing_vsnprintf respectively. These
+ are only compliled into the binary if snprintf and/or vsnprintf are not
+ available.
+
+2001-09-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ircam.c
+ New file to handle Berkeley/IRCAM/CARL files.
+
+ * src/sndfile.c src/common.h
+ Modified for IRCAM handling.
+
+ * tests/*.c
+ Added tests for IRCAM files.
+
+2001-09-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Apparently microsoft windows (tm) doesn't like ulaw and Alaw WAV files with
+ 20 byte format chunks (contrary to ms's own documentation). Fixed the WAV
+ header writing code to generate smaller ms compliant ulaw and Alaw WAV
+ files.
+
+2001-09-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/stdio_test.sh tests/stdio_test.c
+ Shell script was rewritten as a C program due to incompatibilities of the
+ sh shell on Linux and Solaris.
+
+2001-09-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/stdio_test.sh tests/stdout_test.c tests/stdin_test.c
+ New test programs to verify the correct operation of reading from stdin and
+ writing to stdout.
+
+ * src/sndfile.c wav.c au.c nist.c paf.c
+ Fixed a bugs uncovered by the new test programs above.
+
+2001-09-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c wav.c
+ Fixed a bug preventing reading a file from stdin. Found by T. Narita.
+
+2001-09-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Fixed a problem on OpenBSD 2.9 which was causing sf_seek() to fail on IMA
+ WAV files. Root cause was the declaration of the func_seek typedef not
+ matching the functions it was actually being used to point to. In OpenBSD
+ sizeof (off_t) != sizeof (int). Thanks to Heikki Korpela for allowing me
+ to log into his OpenBSD machine to debug this problem.
+
+2001-09-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Implemented sf_command ("norm float").
+
+ * src/*.c
+ Implemented handling of sf_command ("set-norm-float"). Float normalization
+ can now be turned on and off.
+
+ * tests/double_test.c
+ Renamed to floating_point_test.c. Modified to include tests for all scaled
+ reads and writes of floats and doubles.
+
+ * src/au_g72x.c
+ Fixed bug in normalization code found with improved floating_point_test
+ program.
+
+ * src/wav.c
+ Added code for parsing 'INFO' and 'LIST' chunks. Will be used for extract
+ text annotations from WAV files.
+
+ * src/aiff.c
+ Added code for parsing '(c) ' and 'ANNO' chunks. Will be used for extract
+ text annotations from WAV files.
+
+2001-09-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sf_info.c example/Makefile.am
+ Renamed to sndfile_info.c. The program sndfile_info will now be installed
+ when the library is installed.
+
+ * src/float_cast.h
+ New file defining floating point to short and int casts. These casts will
+ eventually replace all flot and double casts to short and int. See comments
+ at the top of the file for the reasoning.
+
+ * src/*.c
+ Changed all default float and double casts to short or int with macros
+ defined in floatcast.h. At the moment these casts do nothing. They will be
+ replaced with faster float to int cast operations in the near future.
+
+2001-08-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/command_test.c
+ New file for testing sf_command () functionality.
+
+ * src/sndfile.c
+ Revisiting of error return values of some functions.
+ Started implementing sf_command () a new function will allow on-the-fly
+ modification of library behaviour, or instance, sample value scaling.
+
+ * src/common.h
+ Added hook for format specific sf_command () calls to SNDFILE struct.
+
+ * doc/api.html
+ Updated and errors corrected.
+
+ * doc/command.html
+ New documentation file explaining new sf_command () function.
+
+2001-08-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed error return values from sf_read*() and sf_write*(). There were
+ numerous instances of -1 being returned through size_t. These now all set
+ error int the SF_PRIVATE struct and return 0. Thanks to David Viens for
+ spotting this.
+
+2001-08-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Fixed use of va_arg() calls that were causing warning messages with the
+ latest version of gcc (thanks Maurizio Umberto Puxeddu).
+
+2001-07-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c src/sfendian.h
+ Moved definition of MAKE_MARKER macro to sfendian.h
+
+2001-07-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Modified sf_get_lib_version () so that version string will be visible using
+ the Unix strings command.
+
+ * examples/Makefile.am examples/sfinfo.c
+ Renamed sfinfo program and source code to sf_info. This prevents a name
+ clash with the program included with libaudiofile.
+
+2001-07-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/read_seek_test.c tests/lossy_comp_test.c
+ Added tests for sf_read_float () and sf_readf_float ().
+
+ * src/voc.c
+ New files for handling Creative Voice files (not complete).
+
+ * src/samplitude.c
+ New files for handling Samplitude files (not complete).
+
+2001-07-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c src/au.c src/paf.c src/svx.c src/wav.c
+ Converted these files to using psf_binheader_readf() function. Will soon be
+ ready to attempt to make reading writing from pipes work reliably.
+
+ * src/*.[ch]
+ Added code for sf_read_float () and sf_readf_float () methods of accessing
+ file data.
+
+2001-07-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/paf.c src/wav_gsm610.c
+ Removed two printf()s which had escaped notice for some time (thanks
+ Sigbjørn Skjæret).
+
+2001-07-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_gsm610.c
+ Fixed a bug which prevented GSM 6.10 encoded WAV files generated by
+ libsndfile from being played in Windoze (thanks klay).
+
+2001-07-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.[ch]
+ Implemented psf_binheader_readf() which will do for file header reading what
+ psf_binheader_writef() did for writing headers. Will eventually allow
+ libsndfile to read and write from pipes, including named pipes.
+
+2001-07-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * MacOS/config.h Win32/config.h
+ Attempted to bring these two files uptodate with src/config.h. As I don't
+ have access to either of these systems support for them may be completely
+ broken.
+
+2001-06-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/float32.c
+ Fixed bug for big endian processors that can't read 32 bit IEEE floats. Now
+ tested on Intel x86 and UltraSparc processors.
+
+2001-06-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Modified to allow REX files (from Propellorhead's Recycle and Reason
+ programs) to be read.
+ REX files are basically an AIFF file with slightly unusual sequence of
+ chunks (AIFF files are supposed to allow any sequence) and some extra
+ application specific information.
+ Not yet able to write a REX file as the details of the application specific
+ data is unknown.
+
+2001-06-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fixed endian bug when reading PEAK chunk on big endian machines.
+
+ * src/common.c
+ Fixed endian bug when reading PEAK chunk on big endian machines with
+ --enable-force-broken-float configure option.
+ Fix psf_binheader_writef for (FORCE_BROKEN_FLOAT ||______)
+
+2001-06-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in src/config.h.in
+ Removed old CAN_READ_WRITE_x86_IEEE configure variable now that float
+ capabilities are detected at run time.
+ Added FORCE_BROKEN_FLOAT to allow testing of broken float code on machines
+ where the processor can in fact handle floats correctly.
+
+ * src/float32.c
+ Rejigged code reading and writing of floats on broken processors.
+
+ * m4/
+ Removed this directory and all its files as they are no longer needed.
+
+2001-06-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/peak_chunk_test.c
+ New test to validate reading and writing of peak chunk.
+
+ * examples/sfconvert
+ Added -float32 option.
+
+ * src/*.c
+ Changed all error return values to negative values (ie the negative of what
+ they were).
+
+ * src/sndfile.c tests/error_test.c
+ Modified to take account of the previous change.
+
+2001-06-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/float32.c
+ File renamed from wav_float.c and renamed function to something more
+ general.
+ Added runtime detection of floating point capabilities.
+ Added recording of peaks during write for generation of PEAK chunk.
+
+ * src/wav.c src/aiff.c
+ Added handing for PEAK chunk for floating point files. PEAK is read when the
+ file headers are read and generated when the file is closed. Logic is in
+ place for adding PEAK chunk to end of file when writing to a pipe (reading
+ and writing from/to pipe to be implemented soon).
+
+ * src/sndfile.c
+ Modified sf_signal_max () to use PEAK values if present.
+
+2001-06-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c
+ Added pcm_read_init () and pcm_write_init () to src/pcm.c and removed all
+ other calls to functions in this file from the filetype specific files.
+
+ * src/*.c
+ Added alaw_read_init (), alaw_write_int (), ulaw_read_init () and
+ ulaw_write_init () and removed all other calls to functions in alaw.c and
+ ulaw.c from the filetype specific files.
+
+ * tests/write_read_test.c
+ Added tests to validate sf_seek () on all file types.
+
+ * src/raw.c
+ Implemented raw_seek () function to fix a bug where
+ sf_seek (file, 0, SEEK_SET) on a RAW file failed.
+
+ * src/paf.c
+ Fixed a bug in paf24_seek () found due to added seeks tests in
+ tests/write_read_test.c
+
+2001-06-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/read_seek_test.c
+ Fixed a couple of broken binary files.
+
+ * src/aiff.c src/wav.c
+ Added handling of PEAK chunks on file read.
+
+2001-05-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * check_libsndfile.py
+ New file for the regression testing of libsndfile.
+ check_libsndfile.py is a Python script which reads in a file containing
+ filenames of audio files. Each file is checked by running the examples/sfinfo
+ program on them and checking for error or warning messages in the libsndfile
+ log buffer.
+
+ * check_libsndfile.list
+ This is an example list of audio files for use with check_libsndfile.py
+
+ * tests/lossy_comp_test.c
+ Changed the defined value of M_PI for math header files which don't have it.
+ This fixed validation test failures on MetroWerks compilers. Thanks to Lord
+ Praetor Satanus of Acheron for bringing this to my attention.
+
+2001-05-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.[ch]
+ Removed psf_header_setf () which was no longer required after refactoring
+ and simplification of header writing.
+ Added 'z' format specifier to psf_binheader_writef () for zero filling header
+ with N bytes. Used by paf.c and nist.c
+
+ * tests/check_log_buffer.c
+ New file implementing check_log_buffer () which reads the log buffer of a
+ SNDFILE* object and searches for error and warning messages. Calls exit ()
+ if any are found.
+
+ * tests/*.c
+ Added calls to check_log_buffer () after each call to sf_open_XXX ().
+
+2001-05-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c src/wav_ms_adpcm.c src/wav_gsm610.c
+ Major rehack of header writing using psf_binheader_writef ().
+
+2001-05-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c src/wav_ima_adpcm.c
+ Major rehack of header writing using psf_binheader_writef ().
+
+2001-05-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Changed return type of get_encoding_str () to prevent compiler warnings on
+ Mac OSX.
+
+ * src/aiff.c src/au.c
+ Major rehack of header writing using psf_binheader_writef ().
+
+2001-05-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h src/common.c
+ Added comments.
+ Name of log buffer changed from strbuffer to logbuffer.
+ Name of log buffer index variable changed from strindex to logindex.
+
+ * src/*.[ch]
+ Changed name of internal logging function from psf_sprintf () to
+ psf_log_printf ().
+ Changed name of internal header generation functions from
+ psf_[ab]h_printf () to psf_asciiheader_printf () and
+ psf_binheader_writef ().
+ Changed name of internal header manipulation function psf_hsetf () to
+ psf_header_setf ().
+
+2001-05-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/nist.c
+ Fixed reading and writing of sample_byte_format header. "01" means little
+ endian and "10" means big endian regardless of bit width.
+
+ * configure.in
+ Detect Mac OSX and disable -Wall and -pedantic gcc options. Mac OSX is
+ way screwed up and spews out buckets of warning messages from the system
+ headers.
+ Added --disable-gcc-opt configure option (sets gcc optimisation to -O0 ) for
+ easier debugging.
+ Made decision to harmonise source code version number and .so library
+ version number. Future releases will stick to this rule.
+
+ * doc/new_file_type.HOWTO
+ New file to document the addition of new file types to libsndfile.
+
+2001-05-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/nist.c
+ New file for reading/writing Sphere NIST audio file format.
+ Originally requested by Elis Pomales in 1999.
+ Retrieved from unstable (and untouched for 18 months) branch of libsndfile.
+ Some vital information gleaned from the source code to Bill Schottstaedt's
+ sndlib library : ftp://ccrma-ftp.stanford.edu/pub/Lisp/sndlib.tar.gz
+ Currently reading and writing 16, 24 and 32 bit, big-endian and little
+ endian, stereo and mono files.
+
+ * src/common.h src/common.c
+ Added psf_ah_printf () function to help construction of ASCII headers (ie NIST).
+
+ * configure.in
+ Added test for vsnprintf () required by psf_ah_printf ().
+
+ * tests/write_read_test.c
+ Added tests for supported NIST files.
+
+2001-05-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.c
+ Added tests for little endian AIFC files.
+
+ * src/aiff.c
+ Minor re-working of aiff_open_write ().
+ Added write support for little endian PCM encoded AIFC files.
+
+2001-05-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Minor re-working of aiff_open_read ().
+ Added read support for little endian PCM encoded AIFC files from the Mac
+ OSX CD ripper program. Guillaume Lessard provided a couple of sample files
+ and a working patch.
+ The patch was not used as is but gave a good guide as to what to do.
+
+2001-05-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h
+ Fixed comments about endian-ness of WAV and AIFF files. Guillaume Lessard
+ pointed out the error.
+
+2001-04-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/make_sine.c
+ Re-write of this example using sample rate and required frequency in Hz.
+
+2001-02-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed bug that prevented known file types from being read as RAW PCM data.
+
+2000-12-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Added handing of COMT chunk.
+
+2000-11-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sfconvert.c
+ Fixed bug in normalisatio code. Pointed out by Johnny Wu.
+
+2000-11-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/config.h
+ Fixed the incorrect setting of HAVE_ENDIAN_H parameter. Win32 only issue.
+
+2000-10-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/Makefile.am
+ Added -lm for write_read_test_LDADD.
+
+2000-10-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/au.c
+ Fixed bug which prevented writing of G723 24kbps AU files.
+
+ * tests/lossy_comp_test.c
+ Corrrection to options for G723 tests.
+
+ * configure.in
+ Added --disable-gcc-pipe option for DJGPP compiler (gcc on MS-DOS) which
+ doesn't allow gcc -pipe option.
+
+2000-09-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ulaw.c src/alaw.c src/wav_imaadpcm.c src/msadpcm.c src/wav_gsm610.c
+ Fixed normailsation bugs shown up by new double_test program.
+
+2000-08-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pcm.c
+ Fixed bug in normalisation code (spotted by Steve Lhomme).
+
+ * tests/double_test.c
+ New file to test scaled and unscaled sf_read_double() and sf_write_double()
+ functions.
+
+2000-08-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * COPYING
+ Changed to the LGPL COPYING file (spotted by H. S. Teoh).
+
+2000-08-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h
+ Removed prototype of unimplemented function sf_get_info(). Added prototype
+ for sf_error_number() Thanks to Sigbjørn Skjæret for spotting these.
+
+2000-08-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/newpcm.h
+ New file to contain a complete rewrite of the PCM data handling.
+
+2000-08-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed a leak of FILE* pointers in sf_open_write(). Thanks to Sigbjørn
+ Skjæret for spotting this one.
+
+2000-08-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/au_g72x.c src/G72x/g72x.c
+ Added G723 encoded AU file support.
+
+ * tests/lossy_comp_test.c
+ Added tests for G721 and G723 encoded AU files.
+
+2000-08-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * all files
+ Changed the license to LGPL. Albert Faber who had copyright on
+ Win32/unistd.h gave his permission to change the license on that file. All
+ other files were either copyright erikd AT mega-nerd DOT com or copyright
+ under a GPL/LGPL compatible license.
+
+2000-08-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/lossy_comp_test.c
+ Fixed incorrect error message.
+
+ * src/au_g72x.c src/G72x/*
+ G721 encoded AU files now working.
+
+ * Win32/README-Win32.txt
+ Replaced this file with a new one which gives a full explanation
+ of how to build libsndfile under Win32. Thanks to Mike Ricos.
+
+2000-08-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.[ch]
+ Removed double leading underscores from the start of all variable and
+ function names. Identifiers with a leading underscores are reserved
+ for use by the compiler.
+
+ * src/au_g72x.c src/G72x/*
+ Continued work on G721 encoded AU files.
+
+2000-07-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/G72x/*
+ New files for reading/writing G721 and G723 ADPCM audio. These files
+ are from a Sun Microsystems reference implementation released under a
+ free software licence.
+ Extensive changes to this code to make it fit in with libsndfile.
+ See the ChangeLog in this directory for details.
+
+ * src/au_g72x.c
+ New file for G721 encoded AU files.
+
+2000-07-08 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * libsndfile.spec.in
+ Added a spec file for making RPMs. Thanks to Josh Green for supplying this.
+
+2000-06-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/sndfile.h
+ Add checking for and handling of header-less u-law encoded AU/SND files.
+ Any file with a ".au" or ".snd" file extension and without the normal
+ AU file header is treated as an 8kHz, u-law encoded file.
+
+ * src/au.h
+ New function for opening a headerless u-law encoded file for read.
+
+2000-06-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/paf.c
+ Add checking for files shorter than minimal PAF file header length.
+
+2000-06-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.c
+ Added extra sf_perror() calls when sf_write_XXXX fails.
+
+2000-05-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Modified usage of va_arg() macro to work correctly on PowerPC
+ Linux. Thanks to Kyle Wheeler for giving me ssh access to his
+ machine while I was trying to track this down.
+
+ * configure.in src/*.[ch]
+ Sorted out some endian-ness issues brought up by PowerPC Linux.
+
+ * tests/read_seek_test.c
+ Added extra debugging for when tests fail.
+
+2000-05-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Fixed bug in GSM 6.10 handling for big-endian machines. Thanks
+ to Sigbjørn Skjæret for reporting this.
+
+2000-04-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/wav.c src/wav_gsm610.c
+ Finallised writing of GSM 6.10 WAV files.
+
+ * tests/lossy_comp_test.c
+ Wrote new test code for GSM 6.10 files.
+
+ * examples/sfinfo.c
+ Fixed incorrect format in printf() statement.
+
+2000-04-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h.in
+ Fixed comments about sf_perror () and sf_error_str ().
+
+2000-03-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Fixed --enable-justsrc option.
+
+2000-03-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * wav.c
+ Fixed checking of bytespersec field of header. Still some weirdness
+ with some files.
+
+2000-03-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/lossy_comp_test.c
+ Added option to test PCM WAV files (sanity check).
+ Fixed bug in sf_seek() tests.
+
+2000-02-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/wav.c
+ Minor changes to allow writing of GSM 6.10 WAV files.
+
+2000-02-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in Makefile.am src/Makefile.am
+ Finally got around to figuring out how to build a single library from
+ multiple source directories.
+ Reading GSM 6.10 files now seems to work.
+
+2000-01-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Added more error reporting in read_fmt_chunk().
+
+1999-12-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sfinfo.c
+ Modified program to accept multiple filenames from the command line.
+
+1999-11-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_ima_adpcm.c
+ Moved code around in preparation to adding ability to read/write IMA ADPCM
+ encoded AIFF files.
+
+1999-11-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Fixed put_int() and put_short() macros used by _psf_hprintf() which were
+ causing seg. faults on Sparc Solaris.
+
+1999-11-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.c
+ Added string.h to includes. Thanks to Sigbjxrn Skjfret.
+
+ * src/svx.c
+ Fixed __svx_close() function to ensure FORM and BODY chunks are correctly
+ set.
+
+1999-10-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/au.c
+ Fixed handling of incorrect size field in AU header on read. Thanks to
+ Christoph Lauer for finding this problem.
+
+1999-09-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fixed a bug with incorrect SSND chunk length being written. This also lead
+ to finding an minor error in AIFF header parsing. Thanks to Dan Timis for
+ pointing this out.
+
+1999-09-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/paf.c
+ Fixed a bug with reading and writing 24 bit stereo PAF files. This problem
+ came to light when implementing tests for the new functions which operate
+ in terms of frames rather than items.
+
+1999-09-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Modified file type detection to use first 12 bytes of file rather than
+ file name extension. Required this because NIST files use the same
+ filename extension as Microsoft WAV files.
+
+ * src/sndfile.c src/sndfile.h
+ Added short, int and double read/write functions which work in frames
+ rather than items. This was originally suggested by Maurizio Umberto
+ Puxeddu.
+
+1999-09-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/svx.c
+ Finished off implementation of write using __psf_hprintf().
+
+1999-09-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/common.h
+ Added a buffer to SF_PRIVATE for writing the header. This is required
+ to make generating headers for IFF/SVX files easier as well as making
+ it easier to do re-write the headers which will be required when
+ sf_rewrite_header() is implemented.
+
+ * src/common.c
+ Implemented __psf_hprintf() function. This is an internal function
+ which is documented briefly just above the code.
+
+1999-09-05 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed a bug in sf_write_raw() where it was returning incorrect values
+ (thanks to Richard Dobson for finding this one). Must put in a test
+ routine for sf_read_raw and sf_write_raw.
+
+ * src/aiff.c
+ Fixed default FORMsize in __aiff_open_write ().
+
+ * src/sndfile.c
+ Added copy of filename to internal data structure. IFF/SVX files
+ contain a NAME header chunk. Both sf_open_read() and sf_open_write()
+ copy the file name (less the leading path information) to the
+ filename field.
+
+ * src/svx.c
+ Started implementing writing of files.
+
+1999-08-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/svx.c
+ New file for reading/writing 8SVX and 16SVX files.
+
+ * src/sndfile.[ch] src/common.h
+ Changes for SVX files.
+
+ * src/aiff.c
+ Fixed header parsing when unknown chunk is found.
+
+1999-08-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/paf.c
+ New file for reading/writing Ensoniq PARIS audio file format.
+
+ * src/sndfile.[ch] src/common.h
+ Changes for PAF files.
+
+ * src/sndfile.[ch]
+ Added stuff for sf_get_lib_version() function.
+
+
+1999-07-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h MacOS/config.h
+ Fixed minor MacOS configuration issues.
+
+1999-07-30 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * MacOS/
+ Added a new directory for the MacOS config.h file and the
+ readme file.
+
+ * src/aiff.c
+ Fixed calculation of datalength when reading SSND chunk. Thanks to
+ Sigbjørn Skjæret for pointing out this error.
+
+1999-07-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/sndfile.h src/raw.c
+ Further fixing of #includes for MacOS.
+
+1999-07-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c src/aiff.c
+ Added call to ferror () in main header parsing loop of __XXX_open_read
+ functions. This should fix problems on platforms (MacOS, AmigaOS) where
+ fseek()ing or fread()ing beyond the end of the file puts the FILE*
+ stream in an error state until clearerr() is called.
+
+ * tests/write_read_test.c
+ Added tests for RAW header-less PCM files.
+
+ * src/common.h
+ Moved definition of struct tribyte to pcm.c which is the only place
+ which needs it.
+
+ * src/pcm.c
+ Modified all code which assumed sizeof (struct tribyte) == 3. This code
+ did not work on MacOS. Thanks to Ben "Jacobs" for pointing this out.
+
+ * src/au.c
+ Removed <sys/stat.h> from list of #includes (not being used).
+
+ * src/sndfile.c
+ Added MacOS specific #ifdef to replace <sys/stat.h>.
+
+ * src/sndfile.h
+ Added MacOS specific #ifdef to replace <sys/stat.h>.
+
+ * src/sndfile.h
+ Added MacOS specific typedef for off_t.
+
+ * MacOS-readme.txt
+ New file with instructions for building libsndfile under MacOS. Thanks
+ to Ben "Jacobs" for supplying these instructions.
+
+1999-07-24 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Removed sndfile.h from generated file list as there were no longer
+ any autoconf substitutions being made.
+
+ * src/raw.c
+ New file for handling raw header-less PCM files. In order to open these
+ for read, the user must specify format, pcmbitwidth and channels in the
+ SF_INFO struct when calling sf_open_read ().
+
+ * src/sndfile.c
+ Added support for raw header-less PCM files.
+
+1999-07-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * examples/sfinfo.c
+ Removed options so the sfinfo program always prints out all the information.
+
+1999-07-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/alaw.c
+ New file for A-law encoding (similar to u-law).
+
+ * tests/alaw_test.c
+ New test program to test the A-law encode/decode lookup tables.
+
+ * tests/lossy_comp_test.c
+ Added tests for a-law encoded WAV, AU and AULE files.
+
+1999-07-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c src/au.c
+ Removed second "#include <unistd.h>". Thanks to Ben "Jacobs" for pointing
+ this out.
+
+1999-07-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/ulaw_test.c
+ New test program to test the u-law encode/decode lookup tables.
+
+1999-07-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.h
+ Made corrections to comments on the return values from sf_seek ().
+
+ * src/sndfile.c
+ Fixed boundary condition checking bug and accounting bug in sf_read_raw ().
+
+1999-07-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/au.c src/ulaw.c
+ Finished implementation of u-law encoded AU files.
+
+ * src/wav.c
+ Implemented reading and writing of u-law encoded WAV files.
+
+ * tests/
+ Changed name of adpcm_test.c to lossy_comp_test.c. This test program
+ will now be used to test Ulaw and Alaw encoding as well as APDCM.
+ Added tests for Ulaw encoded WAV files.
+
+1999-07-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/adpcm_test.c
+ Initialised amp variable in gen_signal() to remove compiler warning.
+
+1999-07-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ In __aiff_open_read () prevented fseek()ing beyond end of file which
+ was causing trouble on MacOS with the MetroWerks compiler. Thanks to
+ Ben "Jacobs" for pointing this out.
+
+ *src/wav.c
+ Fixed as above in __wav_open_read ().
+
+1999-07-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_ms_adpcm.c
+ Implemented MS ADPCM encoding. Code cleanup of decoder.
+
+ * tests/adpcm_test.c
+ Added tests for MS ADPCM WAV files.
+
+ * src/wav_ima_adpcm.c
+ Fixed incorrect parameter in call to srate2blocksize () from
+ __ima_writer_init ().
+
+1999-06-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/read_seek_test.c
+ Added test for 8 bit AIFF files.
+
+1999-06-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.c
+ Removed test for IMA ADPCM WAV files which is now done in adpcm_test.c
+
+ * configure.in
+ Added -Wconversion to CFLAGS.
+
+ * src/*.c tests/*.c examples/*.c
+ Fixed all warnings resulting from use of -Wconversion.
+
+1999-06-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Added fact chunk handling on read and write for all non WAVE_FORMAT_PCM
+ WAV files.
+
+ * src/wav_ima.c
+ Changed block alignment to be dependant on sample rate. This should make
+ WAV files created with libsndfile compatible with the MS Windows media
+ players.
+
+ * tests/adpcm_test.c
+ Reimplemented adpcm_test_short and implemented adpcm_test_int and
+ adpcm_test_double.
+ Now have full testing of IMA ADPCM WAV file read, write and seek.
+
+1999-06-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_float.c
+ Fixed function prototype for x86f2d_array () which was causing ocassional
+ seg. faults on Sparc Solaris machines.
+
+1999-06-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c
+ Fixed bug in __aiff_close where the length fields in the header were
+ not being correctly calculated before writing.
+
+ * tests/write_read_test.c
+ Modified to detect the above bug in WAV, AIFF and AU files.
+
+1999-06-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * Win32/*
+ Added a contribution from Albert Faber to allow libsndfile to compile
+ under Win32 systems. libsndfile will now be used as part of LAME the
+ the MPEG 1 Layer 3 encoder (http://internet.roadrunner.com/~mt/mp3/).
+
+1999-06-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in
+ Changed to reflect previous changes.
+
+ * src/wav_ima_adpcm.c
+ Fixed incorrect calculation of bytespersec header field (IMA ADPCM only).
+
+ Fixed bug when writing from int or double data to IMA ADPCM file. Will need
+ to write test code for this.
+
+ Fixed bug in __ima_write () whereby the length of the current block was
+ calculated incorrectly. Thanks to Jongcheon Park for pointing this out.
+
+1999-03-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/*.c
+ Changed all read/write/lseek function calls to fread/fwrite/
+ fseek/ftell and added error checking of return values from
+ fread and fwrite in critical areas of the code.
+
+ * src/au.c
+ Fixed incorrect datasize element in AU header on write.
+
+ * tests/error_test.c
+ Add new test to check all error values have an associated error
+ string. This will avoid embarrassing real world core dumps.
+
+1999-03-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c src/aiff.c
+ Added handling for unknown chunk markers in the file.
+
+1999-03-22 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Filled in missing error strings in SndfileErrors array. Missing entries
+ can cause core dumps when calling sf_error-str (). Thanks to Sam
+ <mrsam at-sign geocities.com> for finding this problem.
+
+1999-03-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav_ima_adpcm.c
+ Work on wav_ms_adpcm.c uncovered a bug in __ima_read () when reading
+ stereo files. Caused by not adjusting offset into buffer of decoded
+ samples for 2 channels. A similar bug existed in __ima_write ().
+ Need a test for stereo ADPCM files.
+
+ * src/wav_ms_adpcm.c
+ Decoder working correctly.
+
+1999-03-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * configure.in Makefile.am
+ Added --enable-justsrc configuration variable sent by Sam
+ <mrsam at-sign geocities.com>.
+
+ * src/wav_ima_adpcm.c
+ Fixed bug when reading beyond end of data section due to not
+ checking pima->blockcount.
+ This uncovered __ima_seek () bug due to pima->blockcount being set
+ before calling __ima_init_block ().
+
+1999-03-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Started implementing MS ADPCM decoder.
+ If file is WAVE_FORMAT_ADPCM and length of data chunk is odd, this
+ encoder seems to add an extra byte. Why not just give an even data
+ length?
+
+1999-03-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Split code out of wav.c to create wav_float.c and wav_ima_adpcm.c.
+ This will make it easier to add and debug other kinds of WAV files
+ in future.
+
+1999-03-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/
+ Added adpcm_test.c which implements test functions for
+ IMA ADPCM reading/writing/seeking etc.
+
+ * src/wav.c
+ Fixed many bugs in IMA ADPCM encoder and decoder.
+
+1999-03-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Finished implementing IMA ADPCM encoder and decoder (what a bitch!).
+
+1999-03-03 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/wav.c
+ Started implementing IMA ADPCM decoder.
+
+1999-03-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Fixed bug where the sf_read_XXX functions were returning a
+ incorrect read count when reading past end of file.
+ Fixed bug in sf_seek () when seeking backwards from end of file.
+
+ * tests/read_seek_test.c
+ Added multiple read test to short_test(), int_test () and
+ double_test ().
+ Added extra chunk to all test WAV files to test that reading
+ stops at end of 'data' chunk.
+
+1999-02-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.c
+ Added tests for little DEC endian AU files.
+
+ * src/au.c
+ Add handling for DEC format little endian AU files.
+
+1999-02-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c src/au.c src/wav.c
+ Add __psf_sprintf calls during header parsing.
+
+ * src/sndfile.c src/common.c
+ Implement sf_header_info (sndfile.c) function and __psf_sprintf (common.c).
+
+ * tests/write_read_test.c
+ Added tests for 8 bit PCM files (WAV, AIFF and AU).
+
+ * src/au.c src/aiff.c
+ Add handling of 8 bit PCM data format.
+
+ * src/aiff.c
+ On write, set blocksize in SSND chunk to zero like everybody else.
+
+1999-02-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pcm.c:
+ Fixed bug in let2s_array (cptr was not being initialised).
+
+ * src/sndfile.c:
+ Fixed bug in sf_read_raw and sf_write_raw. sf_seek should
+ now work when using these functions.
+
+1999-02-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * tests/write_read_test.c:
+ Force test_buffer array to be double aligned. Sparc Solaris
+ requires this.
+
+1999-02-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/pcm.c:
+ Fixed a bug which was causing errors in the reading
+ and writing of 24 bit PCM files.
+
+ * doc/api.html
+ Finished of preliminary documentaion.
+
+1999-02-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/aiff.c:
+ Changed reading of 'COMM' chunk to avoid reading an int
+ which overlaps an int (4 byte) boundary.
diff --git a/libsndfile.64/NEWS b/libsndfile.64/NEWS
new file mode 100644
index 00000000..d8f549f4
--- /dev/null
+++ b/libsndfile.64/NEWS
@@ -0,0 +1,199 @@
+Version 1.0.28 (2017-04-02)
+ * Fix buffer overruns in FLAC and ID3 handling code.
+ * Move to variable length header storage.
+ * Fix detection of Large File Support for 32 bit systems.
+ * Remove large stack allocations in ALAC handling code.
+ * Remove all use of Variable Length Arrays.
+ * Minor bug fixes and improvements.
+
+Version 1.0.27 (2016-06-19)
+ * Fix an SF_INFO seekable flag regression introduced in 1.0.26.
+ * Fix potential infinite loops on malformed input files.
+ * Add string metadata read/write for CAF and RF64.
+ * Add handling of CUE chunks.
+ * Fix endian-ness issues in PAF files.
+ * Minor bug fixes and improvements.
+
+Version 1.0.26 (2015-11-22)
+ * Fix for CVE-2014-9496, SD2 buffer read overflow.
+ * Fix for CVE-2014-9756, file_io.c divide by zero.
+ * Fix for CVE-2015-7805, AIFF heap write overflow.
+ * Add support for ALAC encoder in a CAF container.
+ * Add support for Cart chunks in WAV files.
+ * Minor bug fixes and improvements.
+
+Version 1.0.25 (2011-07-13)
+ * Fix for Secunia Advisory SA45125, heap overflow in PAF file handler.
+ * Accept broken WAV files with blockalign == 0.
+ * Minor bug fixes and improvements.
+
+Version 1.0.24 (2011-03-23)
+ * WAV files now have an 18 byte u-law and A-law fmt chunk.
+ * Document virtual I/O functionality.
+ * Two new methods rawHandle() and takeOwnership() in sndfile.hh.
+ * AIFF fix for non-zero offset value in SSND chunk.
+ * Minor bug fixes and improvements.
+
+Version 1.0.23 (2010-10-10)
+ * Add version metadata to Windows DLL.
+ * Add a missing 'inline' to sndfile.hh.
+ * Update docs.
+ * Minor bug fixes and improvements.
+
+Version 1.0.22 (2010-10-04)
+ * Couple of fixes for SDS file writer.
+ * Fixes arising from static analysis.
+ * Handle FLAC files with ID3 meta data at start of file.
+ * Handle FLAC files which report zero length.
+ * Other minor bug fixes and improvements.
+
+Version 1.0.21 (2009-12-13)
+ * Add a couple of new binary programs to programs/ dir.
+ * Remove sndfile-jackplay (now in sndfile-tools package).
+ * Add windows only function sf_wchar_open().
+ * Bunch of minor bug fixes.
+
+Version 1.0.20 (2009-05-14)
+ * Fix potential heap overflow in VOC file parser (Tobias Klein, http://www.trapkit.de/).
+
+Version 1.0.19 (2009-03-02)
+ * Fix for CVE-2009-0186 (Alin Rad Pop, Secunia Research).
+ * Huge number of minor bug fixes as a result of static analysis.
+
+Version 1.0.18 (2009-02-07)
+ * Add Ogg/Vorbis support (thanks to John ffitch).
+ * Remove captive FLAC library.
+ * Many new features and bug fixes.
+ * Generate Win32 and Win64 pre-compiled binaries.
+
+Version 1.0.17 (2006-08-31)
+ * Add sndfile.hh C++ wrapper.
+ * Update Win32 MinGW build instructions.
+ * Minor bug fixes and cleanups.
+
+Version 1.0.16 (2006-04-30)
+ * Add support for Broadcast (BEXT) chunks in WAV files.
+ * Implement new commands SFC_GET_SIGNAL_MAX and SFC_GET_MAX_ALL_CHANNELS.
+ * Add support for RIFX (big endian WAV variant).
+ * Fix configure script bugs.
+ * Fix bug in INST and MARK chunk writing for AIFF files.
+
+Version 1.0.15 (2006-03-16)
+ * Fix some ia64 issues.
+ * Fix precompiled DLL.
+ * Minor bug fixes.
+
+Version 1.0.14 (2006-02-19)
+ * Really fix MinGW compile problems.
+ * Minor bug fixes.
+
+Version 1.0.13 (2006-01-21)
+ * Fix for MinGW compiler problems.
+ * Allow readin/write of instrument chunks from WAV and AIFF files.
+ * Compile problem fix for Solaris compiler.
+ * Minor cleanups and bug fixes.
+
+Version 1.0.12 (2005-09-30)
+ * Add support for FLAC and Apple's Core Audio Format (CAF).
+ * Add virtual I/O interface (still needs docs).
+ * Cygwin and other Win32 fixes.
+ * Minor bug fixes and cleanups.
+
+Version 1.0.11 (2004-11-15)
+ * Add support for SD2 files.
+ * Add read support for loop info in WAV and AIFF files.
+ * Add more tests.
+ * Improve type safety.
+ * Minor optimisations and bug fixes.
+
+Version 1.0.10 (2004-06-15)
+ * Fix AIFF read/write mode bugs.
+ * Add support for compiling Win32 DLLS using MinGW.
+ * Fix problems resulting in failed compiles with gcc-2.95.
+ * Improve test suite.
+ * Minor bug fixes.
+
+Version 1.0.9 (2004-03-30)
+ * Add handling of AVR (Audio Visual Research) files.
+ * Improve handling of WAVEFORMATEXTENSIBLE WAV files.
+ * Fix for using pipes on Win32.
+
+Version 1.0.8 (2004-03-14)
+ * Correct peak chunk handing for files with > 16 tracks.
+ * Fix for WAV files with huge number of CUE chunks.
+
+Version 1.0.7 (2004-02-25)
+ * Fix clip mode detection on ia64, MIPS and other CPUs.
+ * Fix two MacOSX build problems.
+
+Version 1.0.6 (2004-02-08)
+ * Added support for native Win32 file access API (Ross Bencina).
+ * New mode to add clippling then a converting from float/double to integer
+ would otherwise wrap around.
+ * Fixed a bug in reading/writing files > 2Gig on Linux, Solaris and others.
+ * Many minor bug fixes.
+ * Other random fixes for Win32.
+
+Version 1.0.5 (2003-05-03)
+ * Added support for HTK files.
+ * Added new function sf_open_fd() to allow for secure opening of temporary
+ files as well as reading/writing sound files embedded within larger
+ container files.
+ * Added string support for AIFF files.
+ * Minor bug fixes and code cleanups.
+
+Version 1.0.4 (2003-02-02)
+ * Added suport of PVF and XI files.
+ * Added functionality for setting and retreiving strings from sound files.
+ * Minor code cleanups and bug fixes.
+
+Version 1.0.3 (2002-12-09)
+ * Minor bug fixes.
+
+Version 1.0.2 (2002-11-24)
+ * Added support for VOX ADPCM.
+ * Improved error reporting.
+ * Added version scripting on Linux and Solaris.
+ * Minor bug fixes.
+
+Version 1.0.1 (2002-09-14)
+ * Added MAT and MAT5 file formats.
+ * Minor bug fixes.
+
+Version 1.0.0 (2002-08-16)
+ * Final release for 1.0.0.
+
+Version 1.0.0rc6 (2002-08-14)
+ * Release candidate 6 for the 1.0.0 series.
+ * MacOS9 fixes.
+
+Version 1.0.0rc5 (2002-08-10)
+ * Release candidate 5 for the 1.0.0 series.
+ * Changed the definition of sf_count_t which was causing problems when
+ libsndfile was compiled with other libraries (ie WxWindows).
+ * Minor bug fixes.
+ * Documentation cleanup.
+
+Version 1.0.0rc4 (2002-08-03)
+ * Release candidate 4 for the 1.0.0 series.
+ * Minor bug fixes.
+ * Fix broken Win32 "make check".
+
+Version 1.0.0rc3 (2002-08-02)
+ * Release candidate 3 for the 1.0.0 series.
+ * Fix bug where libsndfile was reading beyond the end of the data chunk.
+ * Added on-the-fly header updates on write.
+ * Fix a couple of documentation issues.
+
+Version 1.0.0rc2 (2002-06-24)
+ * Release candidate 2 for the 1.0.0 series.
+ * Fix compile problem for Win32.
+
+Version 1.0.0rc1 (2002-06-24)
+ * Release candidate 1 for the 1.0.0 series.
+
+Version 0.0.28 (2002-04-27)
+ * Last offical release of 0.0.X series of the library.
+
+Version 0.0.8 (1999-02-16)
+ * First offical release.
diff --git a/libsndfile.64/dist/libsndfile-1.dll b/libsndfile.64/dist/libsndfile-1.dll
new file mode 100644
index 00000000..9817e8b0
--- /dev/null
+++ b/libsndfile.64/dist/libsndfile-1.dll
Binary files differ
diff --git a/libsndfile.64/include/sndfile.h b/libsndfile.64/include/sndfile.h
new file mode 100644
index 00000000..8a60fb09
--- /dev/null
+++ b/libsndfile.64/include/sndfile.h
@@ -0,0 +1,857 @@
+/*
+** Copyright (C) 1999-2016 Erik de Castro Lopo <erikd@mega-nerd.com>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU Lesser General Public License as published by
+** the Free Software Foundation; either version 2.1 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+/*
+** sndfile.h -- system-wide definitions
+**
+** API documentation is in the doc/ directory of the source code tarball
+** and at http://www.mega-nerd.com/libsndfile/api.html.
+*/
+
+#ifndef SNDFILE_H
+#define SNDFILE_H
+
+/* This is the version 1.0.X header file. */
+#define SNDFILE_1
+
+#include <stdio.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* The following file types can be read and written.
+** A file type would consist of a major type (ie SF_FORMAT_WAV) bitwise
+** ORed with a minor type (ie SF_FORMAT_PCM). SF_FORMAT_TYPEMASK and
+** SF_FORMAT_SUBMASK can be used to separate the major and minor file
+** types.
+*/
+
+enum
+{ /* Major formats. */
+ SF_FORMAT_WAV = 0x010000, /* Microsoft WAV format (little endian default). */
+ SF_FORMAT_AIFF = 0x020000, /* Apple/SGI AIFF format (big endian). */
+ SF_FORMAT_AU = 0x030000, /* Sun/NeXT AU format (big endian). */
+ SF_FORMAT_RAW = 0x040000, /* RAW PCM data. */
+ SF_FORMAT_PAF = 0x050000, /* Ensoniq PARIS file format. */
+ SF_FORMAT_SVX = 0x060000, /* Amiga IFF / SVX8 / SV16 format. */
+ SF_FORMAT_NIST = 0x070000, /* Sphere NIST format. */
+ SF_FORMAT_VOC = 0x080000, /* VOC files. */
+ SF_FORMAT_IRCAM = 0x0A0000, /* Berkeley/IRCAM/CARL */
+ SF_FORMAT_W64 = 0x0B0000, /* Sonic Foundry's 64 bit RIFF/WAV */
+ SF_FORMAT_MAT4 = 0x0C0000, /* Matlab (tm) V4.2 / GNU Octave 2.0 */
+ SF_FORMAT_MAT5 = 0x0D0000, /* Matlab (tm) V5.0 / GNU Octave 2.1 */
+ SF_FORMAT_PVF = 0x0E0000, /* Portable Voice Format */
+ SF_FORMAT_XI = 0x0F0000, /* Fasttracker 2 Extended Instrument */
+ SF_FORMAT_HTK = 0x100000, /* HMM Tool Kit format */
+ SF_FORMAT_SDS = 0x110000, /* Midi Sample Dump Standard */
+ SF_FORMAT_AVR = 0x120000, /* Audio Visual Research */
+ SF_FORMAT_WAVEX = 0x130000, /* MS WAVE with WAVEFORMATEX */
+ SF_FORMAT_SD2 = 0x160000, /* Sound Designer 2 */
+ SF_FORMAT_FLAC = 0x170000, /* FLAC lossless file format */
+ SF_FORMAT_CAF = 0x180000, /* Core Audio File format */
+ SF_FORMAT_WVE = 0x190000, /* Psion WVE format */
+ SF_FORMAT_OGG = 0x200000, /* Xiph OGG container */
+ SF_FORMAT_MPC2K = 0x210000, /* Akai MPC 2000 sampler */
+ SF_FORMAT_RF64 = 0x220000, /* RF64 WAV file */
+
+ /* Subtypes from here on. */
+
+ SF_FORMAT_PCM_S8 = 0x0001, /* Signed 8 bit data */
+ SF_FORMAT_PCM_16 = 0x0002, /* Signed 16 bit data */
+ SF_FORMAT_PCM_24 = 0x0003, /* Signed 24 bit data */
+ SF_FORMAT_PCM_32 = 0x0004, /* Signed 32 bit data */
+
+ SF_FORMAT_PCM_U8 = 0x0005, /* Unsigned 8 bit data (WAV and RAW only) */
+
+ SF_FORMAT_FLOAT = 0x0006, /* 32 bit float data */
+ SF_FORMAT_DOUBLE = 0x0007, /* 64 bit float data */
+
+ SF_FORMAT_ULAW = 0x0010, /* U-Law encoded. */
+ SF_FORMAT_ALAW = 0x0011, /* A-Law encoded. */
+ SF_FORMAT_IMA_ADPCM = 0x0012, /* IMA ADPCM. */
+ SF_FORMAT_MS_ADPCM = 0x0013, /* Microsoft ADPCM. */
+
+ SF_FORMAT_GSM610 = 0x0020, /* GSM 6.10 encoding. */
+ SF_FORMAT_VOX_ADPCM = 0x0021, /* OKI / Dialogix ADPCM */
+
+ SF_FORMAT_G721_32 = 0x0030, /* 32kbs G721 ADPCM encoding. */
+ SF_FORMAT_G723_24 = 0x0031, /* 24kbs G723 ADPCM encoding. */
+ SF_FORMAT_G723_40 = 0x0032, /* 40kbs G723 ADPCM encoding. */
+
+ SF_FORMAT_DWVW_12 = 0x0040, /* 12 bit Delta Width Variable Word encoding. */
+ SF_FORMAT_DWVW_16 = 0x0041, /* 16 bit Delta Width Variable Word encoding. */
+ SF_FORMAT_DWVW_24 = 0x0042, /* 24 bit Delta Width Variable Word encoding. */
+ SF_FORMAT_DWVW_N = 0x0043, /* N bit Delta Width Variable Word encoding. */
+
+ SF_FORMAT_DPCM_8 = 0x0050, /* 8 bit differential PCM (XI only) */
+ SF_FORMAT_DPCM_16 = 0x0051, /* 16 bit differential PCM (XI only) */
+
+ SF_FORMAT_VORBIS = 0x0060, /* Xiph Vorbis encoding. */
+
+ SF_FORMAT_ALAC_16 = 0x0070, /* Apple Lossless Audio Codec (16 bit). */
+ SF_FORMAT_ALAC_20 = 0x0071, /* Apple Lossless Audio Codec (20 bit). */
+ SF_FORMAT_ALAC_24 = 0x0072, /* Apple Lossless Audio Codec (24 bit). */
+ SF_FORMAT_ALAC_32 = 0x0073, /* Apple Lossless Audio Codec (32 bit). */
+
+ /* Endian-ness options. */
+
+ SF_ENDIAN_FILE = 0x00000000, /* Default file endian-ness. */
+ SF_ENDIAN_LITTLE = 0x10000000, /* Force little endian-ness. */
+ SF_ENDIAN_BIG = 0x20000000, /* Force big endian-ness. */
+ SF_ENDIAN_CPU = 0x30000000, /* Force CPU endian-ness. */
+
+ SF_FORMAT_SUBMASK = 0x0000FFFF,
+ SF_FORMAT_TYPEMASK = 0x0FFF0000,
+ SF_FORMAT_ENDMASK = 0x30000000
+} ;
+
+/*
+** The following are the valid command numbers for the sf_command()
+** interface. The use of these commands is documented in the file
+** command.html in the doc directory of the source code distribution.
+*/
+
+enum
+{ SFC_GET_LIB_VERSION = 0x1000,
+ SFC_GET_LOG_INFO = 0x1001,
+ SFC_GET_CURRENT_SF_INFO = 0x1002,
+
+
+ SFC_GET_NORM_DOUBLE = 0x1010,
+ SFC_GET_NORM_FLOAT = 0x1011,
+ SFC_SET_NORM_DOUBLE = 0x1012,
+ SFC_SET_NORM_FLOAT = 0x1013,
+ SFC_SET_SCALE_FLOAT_INT_READ = 0x1014,
+ SFC_SET_SCALE_INT_FLOAT_WRITE = 0x1015,
+
+ SFC_GET_SIMPLE_FORMAT_COUNT = 0x1020,
+ SFC_GET_SIMPLE_FORMAT = 0x1021,
+
+ SFC_GET_FORMAT_INFO = 0x1028,
+
+ SFC_GET_FORMAT_MAJOR_COUNT = 0x1030,
+ SFC_GET_FORMAT_MAJOR = 0x1031,
+ SFC_GET_FORMAT_SUBTYPE_COUNT = 0x1032,
+ SFC_GET_FORMAT_SUBTYPE = 0x1033,
+
+ SFC_CALC_SIGNAL_MAX = 0x1040,
+ SFC_CALC_NORM_SIGNAL_MAX = 0x1041,
+ SFC_CALC_MAX_ALL_CHANNELS = 0x1042,
+ SFC_CALC_NORM_MAX_ALL_CHANNELS = 0x1043,
+ SFC_GET_SIGNAL_MAX = 0x1044,
+ SFC_GET_MAX_ALL_CHANNELS = 0x1045,
+
+ SFC_SET_ADD_PEAK_CHUNK = 0x1050,
+ SFC_SET_ADD_HEADER_PAD_CHUNK = 0x1051,
+
+ SFC_UPDATE_HEADER_NOW = 0x1060,
+ SFC_SET_UPDATE_HEADER_AUTO = 0x1061,
+
+ SFC_FILE_TRUNCATE = 0x1080,
+
+ SFC_SET_RAW_START_OFFSET = 0x1090,
+
+ SFC_SET_DITHER_ON_WRITE = 0x10A0,
+ SFC_SET_DITHER_ON_READ = 0x10A1,
+
+ SFC_GET_DITHER_INFO_COUNT = 0x10A2,
+ SFC_GET_DITHER_INFO = 0x10A3,
+
+ SFC_GET_EMBED_FILE_INFO = 0x10B0,
+
+ SFC_SET_CLIPPING = 0x10C0,
+ SFC_GET_CLIPPING = 0x10C1,
+
+ SFC_GET_CUE_COUNT = 0x10CD,
+ SFC_GET_CUE = 0x10CE,
+ SFC_SET_CUE = 0x10CF,
+
+ SFC_GET_INSTRUMENT = 0x10D0,
+ SFC_SET_INSTRUMENT = 0x10D1,
+
+ SFC_GET_LOOP_INFO = 0x10E0,
+
+ SFC_GET_BROADCAST_INFO = 0x10F0,
+ SFC_SET_BROADCAST_INFO = 0x10F1,
+
+ SFC_GET_CHANNEL_MAP_INFO = 0x1100,
+ SFC_SET_CHANNEL_MAP_INFO = 0x1101,
+
+ SFC_RAW_DATA_NEEDS_ENDSWAP = 0x1110,
+
+ /* Support for Wavex Ambisonics Format */
+ SFC_WAVEX_SET_AMBISONIC = 0x1200,
+ SFC_WAVEX_GET_AMBISONIC = 0x1201,
+
+ /*
+ ** RF64 files can be set so that on-close, writable files that have less
+ ** than 4GB of data in them are converted to RIFF/WAV, as per EBU
+ ** recommendations.
+ */
+ SFC_RF64_AUTO_DOWNGRADE = 0x1210,
+
+ SFC_SET_VBR_ENCODING_QUALITY = 0x1300,
+ SFC_SET_COMPRESSION_LEVEL = 0x1301,
+
+ /* Cart Chunk support */
+ SFC_SET_CART_INFO = 0x1400,
+ SFC_GET_CART_INFO = 0x1401,
+
+ /* Following commands for testing only. */
+ SFC_TEST_IEEE_FLOAT_REPLACE = 0x6001,
+
+ /*
+ ** SFC_SET_ADD_* values are deprecated and will disappear at some
+ ** time in the future. They are guaranteed to be here up to and
+ ** including version 1.0.8 to avoid breakage of existing software.
+ ** They currently do nothing and will continue to do nothing.
+ */
+ SFC_SET_ADD_DITHER_ON_WRITE = 0x1070,
+ SFC_SET_ADD_DITHER_ON_READ = 0x1071
+} ;
+
+
+/*
+** String types that can be set and read from files. Not all file types
+** support this and even the file types which support one, may not support
+** all string types.
+*/
+
+enum
+{ SF_STR_TITLE = 0x01,
+ SF_STR_COPYRIGHT = 0x02,
+ SF_STR_SOFTWARE = 0x03,
+ SF_STR_ARTIST = 0x04,
+ SF_STR_COMMENT = 0x05,
+ SF_STR_DATE = 0x06,
+ SF_STR_ALBUM = 0x07,
+ SF_STR_LICENSE = 0x08,
+ SF_STR_TRACKNUMBER = 0x09,
+ SF_STR_GENRE = 0x10
+} ;
+
+/*
+** Use the following as the start and end index when doing metadata
+** transcoding.
+*/
+
+#define SF_STR_FIRST SF_STR_TITLE
+#define SF_STR_LAST SF_STR_GENRE
+
+enum
+{ /* True and false */
+ SF_FALSE = 0,
+ SF_TRUE = 1,
+
+ /* Modes for opening files. */
+ SFM_READ = 0x10,
+ SFM_WRITE = 0x20,
+ SFM_RDWR = 0x30,
+
+ SF_AMBISONIC_NONE = 0x40,
+ SF_AMBISONIC_B_FORMAT = 0x41
+} ;
+
+/* Public error values. These are guaranteed to remain unchanged for the duration
+** of the library major version number.
+** There are also a large number of private error numbers which are internal to
+** the library which can change at any time.
+*/
+
+enum
+{ SF_ERR_NO_ERROR = 0,
+ SF_ERR_UNRECOGNISED_FORMAT = 1,
+ SF_ERR_SYSTEM = 2,
+ SF_ERR_MALFORMED_FILE = 3,
+ SF_ERR_UNSUPPORTED_ENCODING = 4
+} ;
+
+
+/* Channel map values (used with SFC_SET/GET_CHANNEL_MAP).
+*/
+
+enum
+{ SF_CHANNEL_MAP_INVALID = 0,
+ SF_CHANNEL_MAP_MONO = 1,
+ SF_CHANNEL_MAP_LEFT, /* Apple calls this 'Left' */
+ SF_CHANNEL_MAP_RIGHT, /* Apple calls this 'Right' */
+ SF_CHANNEL_MAP_CENTER, /* Apple calls this 'Center' */
+ SF_CHANNEL_MAP_FRONT_LEFT,
+ SF_CHANNEL_MAP_FRONT_RIGHT,
+ SF_CHANNEL_MAP_FRONT_CENTER,
+ SF_CHANNEL_MAP_REAR_CENTER, /* Apple calls this 'Center Surround', Msft calls this 'Back Center' */
+ SF_CHANNEL_MAP_REAR_LEFT, /* Apple calls this 'Left Surround', Msft calls this 'Back Left' */
+ SF_CHANNEL_MAP_REAR_RIGHT, /* Apple calls this 'Right Surround', Msft calls this 'Back Right' */
+ SF_CHANNEL_MAP_LFE, /* Apple calls this 'LFEScreen', Msft calls this 'Low Frequency' */
+ SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER, /* Apple calls this 'Left Center' */
+ SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER, /* Apple calls this 'Right Center */
+ SF_CHANNEL_MAP_SIDE_LEFT, /* Apple calls this 'Left Surround Direct' */
+ SF_CHANNEL_MAP_SIDE_RIGHT, /* Apple calls this 'Right Surround Direct' */
+ SF_CHANNEL_MAP_TOP_CENTER, /* Apple calls this 'Top Center Surround' */
+ SF_CHANNEL_MAP_TOP_FRONT_LEFT, /* Apple calls this 'Vertical Height Left' */
+ SF_CHANNEL_MAP_TOP_FRONT_RIGHT, /* Apple calls this 'Vertical Height Right' */
+ SF_CHANNEL_MAP_TOP_FRONT_CENTER, /* Apple calls this 'Vertical Height Center' */
+ SF_CHANNEL_MAP_TOP_REAR_LEFT, /* Apple and MS call this 'Top Back Left' */
+ SF_CHANNEL_MAP_TOP_REAR_RIGHT, /* Apple and MS call this 'Top Back Right' */
+ SF_CHANNEL_MAP_TOP_REAR_CENTER, /* Apple and MS call this 'Top Back Center' */
+
+ SF_CHANNEL_MAP_AMBISONIC_B_W,
+ SF_CHANNEL_MAP_AMBISONIC_B_X,
+ SF_CHANNEL_MAP_AMBISONIC_B_Y,
+ SF_CHANNEL_MAP_AMBISONIC_B_Z,
+
+ SF_CHANNEL_MAP_MAX
+} ;
+
+
+/* A SNDFILE* pointer can be passed around much like stdio.h's FILE* pointer. */
+
+typedef struct SNDFILE_tag SNDFILE ;
+
+/* The following typedef is system specific and is defined when libsndfile is
+** compiled. sf_count_t will be a 64 bit value when the underlying OS allows
+** 64 bit file offsets.
+** On windows, we need to allow the same header file to be compiler by both GCC
+** and the Microsoft compiler.
+*/
+
+#if (defined (_MSCVER) || defined (_MSC_VER) && (_MSC_VER < 1310))
+typedef __int64 sf_count_t ;
+#define SF_COUNT_MAX 0x7fffffffffffffffi64
+#else
+typedef __int64 sf_count_t ;
+#define SF_COUNT_MAX 0x7FFFFFFFFFFFFFFFLL
+#endif
+
+
+/* A pointer to a SF_INFO structure is passed to sf_open () and filled in.
+** On write, the SF_INFO structure is filled in by the user and passed into
+** sf_open ().
+*/
+
+struct SF_INFO
+{ sf_count_t frames ; /* Used to be called samples. Changed to avoid confusion. */
+ int samplerate ;
+ int channels ;
+ int format ;
+ int sections ;
+ int seekable ;
+} ;
+
+typedef struct SF_INFO SF_INFO ;
+
+/* The SF_FORMAT_INFO struct is used to retrieve information about the sound
+** file formats libsndfile supports using the sf_command () interface.
+**
+** Using this interface will allow applications to support new file formats
+** and encoding types when libsndfile is upgraded, without requiring
+** re-compilation of the application.
+**
+** Please consult the libsndfile documentation (particularly the information
+** on the sf_command () interface) for examples of its use.
+*/
+
+typedef struct
+{ int format ;
+ const char *name ;
+ const char *extension ;
+} SF_FORMAT_INFO ;
+
+/*
+** Enums and typedefs for adding dither on read and write.
+** See the html documentation for sf_command(), SFC_SET_DITHER_ON_WRITE
+** and SFC_SET_DITHER_ON_READ.
+*/
+
+enum
+{ SFD_DEFAULT_LEVEL = 0,
+ SFD_CUSTOM_LEVEL = 0x40000000,
+
+ SFD_NO_DITHER = 500,
+ SFD_WHITE = 501,
+ SFD_TRIANGULAR_PDF = 502
+} ;
+
+typedef struct
+{ int type ;
+ double level ;
+ const char *name ;
+} SF_DITHER_INFO ;
+
+/* Struct used to retrieve information about a file embedded within a
+** larger file. See SFC_GET_EMBED_FILE_INFO.
+*/
+
+typedef struct
+{ sf_count_t offset ;
+ sf_count_t length ;
+} SF_EMBED_FILE_INFO ;
+
+/*
+** Struct used to retrieve cue marker information from a file
+*/
+
+typedef struct
+{ int32_t indx ;
+ uint32_t position ;
+ int32_t fcc_chunk ;
+ int32_t chunk_start ;
+ int32_t block_start ;
+ uint32_t sample_offset ;
+ char name [256] ;
+} SF_CUE_POINT ;
+
+#define SF_CUES_VAR(count) \
+ struct \
+ { uint32_t cue_count ; \
+ SF_CUE_POINT cue_points [count] ; \
+ }
+
+typedef SF_CUES_VAR (100) SF_CUES ;
+
+/*
+** Structs used to retrieve music sample information from a file.
+*/
+
+enum
+{ /*
+ ** The loop mode field in SF_INSTRUMENT will be one of the following.
+ */
+ SF_LOOP_NONE = 800,
+ SF_LOOP_FORWARD,
+ SF_LOOP_BACKWARD,
+ SF_LOOP_ALTERNATING
+} ;
+
+typedef struct
+{ int gain ;
+ char basenote, detune ;
+ char velocity_lo, velocity_hi ;
+ char key_lo, key_hi ;
+ int loop_count ;
+
+ struct
+ { int mode ;
+ uint32_t start ;
+ uint32_t end ;
+ uint32_t count ;
+ } loops [16] ; /* make variable in a sensible way */
+} SF_INSTRUMENT ;
+
+
+
+/* Struct used to retrieve loop information from a file.*/
+typedef struct
+{
+ short time_sig_num ; /* any positive integer > 0 */
+ short time_sig_den ; /* any positive power of 2 > 0 */
+ int loop_mode ; /* see SF_LOOP enum */
+
+ int num_beats ; /* this is NOT the amount of quarter notes !!!*/
+ /* a full bar of 4/4 is 4 beats */
+ /* a full bar of 7/8 is 7 beats */
+
+ float bpm ; /* suggestion, as it can be calculated using other fields:*/
+ /* file's length, file's sampleRate and our time_sig_den*/
+ /* -> bpms are always the amount of _quarter notes_ per minute */
+
+ int root_key ; /* MIDI note, or -1 for None */
+ int future [6] ;
+} SF_LOOP_INFO ;
+
+
+/* Struct used to retrieve broadcast (EBU) information from a file.
+** Strongly (!) based on EBU "bext" chunk format used in Broadcast WAVE.
+*/
+#define SF_BROADCAST_INFO_VAR(coding_hist_size) \
+ struct \
+ { char description [256] ; \
+ char originator [32] ; \
+ char originator_reference [32] ; \
+ char origination_date [10] ; \
+ char origination_time [8] ; \
+ uint32_t time_reference_low ; \
+ uint32_t time_reference_high ; \
+ short version ; \
+ char umid [64] ; \
+ char reserved [190] ; \
+ uint32_t coding_history_size ; \
+ char coding_history [coding_hist_size] ; \
+ }
+
+/* SF_BROADCAST_INFO is the above struct with coding_history field of 256 bytes. */
+typedef SF_BROADCAST_INFO_VAR (256) SF_BROADCAST_INFO ;
+
+struct SF_CART_TIMER
+{ char usage [4] ;
+ int32_t value ;
+} ;
+
+typedef struct SF_CART_TIMER SF_CART_TIMER ;
+
+#define SF_CART_INFO_VAR(p_tag_text_size) \
+ struct \
+ { char version [4] ; \
+ char title [64] ; \
+ char artist [64] ; \
+ char cut_id [64] ; \
+ char client_id [64] ; \
+ char category [64] ; \
+ char classification [64] ; \
+ char out_cue [64] ; \
+ char start_date [10] ; \
+ char start_time [8] ; \
+ char end_date [10] ; \
+ char end_time [8] ; \
+ char producer_app_id [64] ; \
+ char producer_app_version [64] ; \
+ char user_def [64] ; \
+ int32_t level_reference ; \
+ SF_CART_TIMER post_timers [8] ; \
+ char reserved [276] ; \
+ char url [1024] ; \
+ uint32_t tag_text_size ; \
+ char tag_text [p_tag_text_size] ; \
+ }
+
+typedef SF_CART_INFO_VAR (256) SF_CART_INFO ;
+
+/* Virtual I/O functionality. */
+
+typedef sf_count_t (*sf_vio_get_filelen) (void *user_data) ;
+typedef sf_count_t (*sf_vio_seek) (sf_count_t offset, int whence, void *user_data) ;
+typedef sf_count_t (*sf_vio_read) (void *ptr, sf_count_t count, void *user_data) ;
+typedef sf_count_t (*sf_vio_write) (const void *ptr, sf_count_t count, void *user_data) ;
+typedef sf_count_t (*sf_vio_tell) (void *user_data) ;
+
+struct SF_VIRTUAL_IO
+{ sf_vio_get_filelen get_filelen ;
+ sf_vio_seek seek ;
+ sf_vio_read read ;
+ sf_vio_write write ;
+ sf_vio_tell tell ;
+} ;
+
+typedef struct SF_VIRTUAL_IO SF_VIRTUAL_IO ;
+
+
+/* Open the specified file for read, write or both. On error, this will
+** return a NULL pointer. To find the error number, pass a NULL SNDFILE
+** to sf_strerror ().
+** All calls to sf_open() should be matched with a call to sf_close().
+*/
+
+SNDFILE* sf_open (const char *path, int mode, SF_INFO *sfinfo) ;
+
+
+/* Use the existing file descriptor to create a SNDFILE object. If close_desc
+** is TRUE, the file descriptor will be closed when sf_close() is called. If
+** it is FALSE, the descriptor will not be closed.
+** When passed a descriptor like this, the library will assume that the start
+** of file header is at the current file offset. This allows sound files within
+** larger container files to be read and/or written.
+** On error, this will return a NULL pointer. To find the error number, pass a
+** NULL SNDFILE to sf_strerror ().
+** All calls to sf_open_fd() should be matched with a call to sf_close().
+
+*/
+
+SNDFILE* sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
+
+SNDFILE* sf_open_virtual (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ;
+
+
+/* sf_error () returns a error number which can be translated to a text
+** string using sf_error_number().
+*/
+
+int sf_error (SNDFILE *sndfile) ;
+
+
+/* sf_strerror () returns to the caller a pointer to the current error message for
+** the given SNDFILE.
+*/
+
+const char* sf_strerror (SNDFILE *sndfile) ;
+
+
+/* sf_error_number () allows the retrieval of the error string for each internal
+** error number.
+**
+*/
+
+const char* sf_error_number (int errnum) ;
+
+
+/* The following two error functions are deprecated but they will remain in the
+** library for the foreseeable future. The function sf_strerror() should be used
+** in their place.
+*/
+
+int sf_perror (SNDFILE *sndfile) ;
+int sf_error_str (SNDFILE *sndfile, char* str, size_t len) ;
+
+
+/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */
+
+int sf_command (SNDFILE *sndfile, int command, void *data, int datasize) ;
+
+
+/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */
+
+int sf_format_check (const SF_INFO *info) ;
+
+
+/* Seek within the waveform data chunk of the SNDFILE. sf_seek () uses
+** the same values for whence (SEEK_SET, SEEK_CUR and SEEK_END) as
+** stdio.h function fseek ().
+** An offset of zero with whence set to SEEK_SET will position the
+** read / write pointer to the first data sample.
+** On success sf_seek returns the current position in (multi-channel)
+** samples from the start of the file.
+** Please see the libsndfile documentation for moving the read pointer
+** separately from the write pointer on files open in mode SFM_RDWR.
+** On error all of these functions return -1.
+*/
+
+enum
+{ SF_SEEK_SET = SEEK_SET,
+ SF_SEEK_CUR = SEEK_CUR,
+ SF_SEEK_END = SEEK_END
+} ;
+
+sf_count_t sf_seek (SNDFILE *sndfile, sf_count_t frames, int whence) ;
+
+
+/* Functions for retrieving and setting string data within sound files.
+** Not all file types support this features; AIFF and WAV do. For both
+** functions, the str_type parameter must be one of the SF_STR_* values
+** defined above.
+** On error, sf_set_string() returns non-zero while sf_get_string()
+** returns NULL.
+*/
+
+int sf_set_string (SNDFILE *sndfile, int str_type, const char* str) ;
+
+const char* sf_get_string (SNDFILE *sndfile, int str_type) ;
+
+
+/* Return the library version string. */
+
+const char * sf_version_string (void) ;
+
+/* Return the current byterate at this point in the file. The byte rate in this
+** case is the number of bytes per second of audio data. For instance, for a
+** stereo, 18 bit PCM encoded file with an 16kHz sample rate, the byte rate
+** would be 2 (stereo) * 2 (two bytes per sample) * 16000 => 64000 bytes/sec.
+** For some file formats the returned value will be accurate and exact, for some
+** it will be a close approximation, for some it will be the average bitrate for
+** the whole file and for some it will be a time varying value that was accurate
+** when the file was most recently read or written.
+** To get the bitrate, multiple this value by 8.
+** Returns -1 for unknown.
+*/
+int sf_current_byterate (SNDFILE *sndfile) ;
+
+/* Functions for reading/writing the waveform data of a sound file.
+*/
+
+sf_count_t sf_read_raw (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
+sf_count_t sf_write_raw (SNDFILE *sndfile, const void *ptr, sf_count_t bytes) ;
+
+
+/* Functions for reading and writing the data chunk in terms of frames.
+** The number of items actually read/written = frames * number of channels.
+** sf_xxxx_raw read/writes the raw data bytes from/to the file
+** sf_xxxx_short passes data in the native short format
+** sf_xxxx_int passes data in the native int format
+** sf_xxxx_float passes data in the native float format
+** sf_xxxx_double passes data in the native double format
+** All of these read/write function return number of frames read/written.
+*/
+
+sf_count_t sf_readf_short (SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
+sf_count_t sf_writef_short (SNDFILE *sndfile, const short *ptr, sf_count_t frames) ;
+
+sf_count_t sf_readf_int (SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
+sf_count_t sf_writef_int (SNDFILE *sndfile, const int *ptr, sf_count_t frames) ;
+
+sf_count_t sf_readf_float (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
+sf_count_t sf_writef_float (SNDFILE *sndfile, const float *ptr, sf_count_t frames) ;
+
+sf_count_t sf_readf_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
+sf_count_t sf_writef_double (SNDFILE *sndfile, const double *ptr, sf_count_t frames) ;
+
+
+/* Functions for reading and writing the data chunk in terms of items.
+** Otherwise similar to above.
+** All of these read/write function return number of items read/written.
+*/
+
+sf_count_t sf_read_short (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
+sf_count_t sf_write_short (SNDFILE *sndfile, const short *ptr, sf_count_t items) ;
+
+sf_count_t sf_read_int (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
+sf_count_t sf_write_int (SNDFILE *sndfile, const int *ptr, sf_count_t items) ;
+
+sf_count_t sf_read_float (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
+sf_count_t sf_write_float (SNDFILE *sndfile, const float *ptr, sf_count_t items) ;
+
+sf_count_t sf_read_double (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
+sf_count_t sf_write_double (SNDFILE *sndfile, const double *ptr, sf_count_t items) ;
+
+
+/* Close the SNDFILE and clean up all memory allocations associated with this
+** file.
+** Returns 0 on success, or an error number.
+*/
+
+int sf_close (SNDFILE *sndfile) ;
+
+
+/* If the file is opened SFM_WRITE or SFM_RDWR, call fsync() on the file
+** to force the writing of data to disk. If the file is opened SFM_READ
+** no action is taken.
+*/
+
+void sf_write_sync (SNDFILE *sndfile) ;
+
+
+
+/* The function sf_wchar_open() is Windows Only!
+** Open a file passing in a Windows Unicode filename. Otherwise, this is
+** the same as sf_open().
+**
+** In order for this to work, you need to do the following:
+**
+** #include <windows.h>
+** #define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1
+** #including <sndfile.h>
+*/
+
+#if (defined (ENABLE_SNDFILE_WINDOWS_PROTOTYPES) && ENABLE_SNDFILE_WINDOWS_PROTOTYPES)
+SNDFILE* sf_wchar_open (LPCWSTR wpath, int mode, SF_INFO *sfinfo) ;
+#endif
+
+
+
+
+/* Getting and setting of chunks from within a sound file.
+**
+** These functions allow the getting and setting of chunks within a sound file
+** (for those formats which allow it).
+**
+** These functions fail safely. Specifically, they will not allow you to overwrite
+** existing chunks or add extra versions of format specific reserved chunks but
+** should allow you to retrieve any and all chunks (may not be implemented for
+** all chunks or all file formats).
+*/
+
+struct SF_CHUNK_INFO
+{ char id [64] ; /* The chunk identifier. */
+ unsigned id_size ; /* The size of the chunk identifier. */
+ unsigned datalen ; /* The size of that data. */
+ void *data ; /* Pointer to the data. */
+} ;
+
+typedef struct SF_CHUNK_INFO SF_CHUNK_INFO ;
+
+/* Set the specified chunk info (must be done before any audio data is written
+** to the file). This will fail for format specific reserved chunks.
+** The chunk_info->data pointer must be valid until the file is closed.
+** Returns SF_ERR_NO_ERROR on success or non-zero on failure.
+*/
+int sf_set_chunk (SNDFILE * sndfile, const SF_CHUNK_INFO * chunk_info) ;
+
+/*
+** An opaque structure to an iterator over the all chunks of a given id
+*/
+typedef struct SF_CHUNK_ITERATOR SF_CHUNK_ITERATOR ;
+
+/* Get an iterator for all chunks matching chunk_info.
+** The iterator will point to the first chunk matching chunk_info.
+** Chunks are matching, if (chunk_info->id) matches the first
+** (chunk_info->id_size) bytes of a chunk found in the SNDFILE* handle.
+** If chunk_info is NULL, an iterator to all chunks in the SNDFILE* handle
+** is returned.
+** The values of chunk_info->datalen and chunk_info->data are ignored.
+** If no matching chunks are found in the sndfile, NULL is returned.
+** The returned iterator will stay valid until one of the following occurs:
+** a) The sndfile is closed.
+** b) A new chunk is added using sf_set_chunk().
+** c) Another chunk iterator function is called on the same SNDFILE* handle
+** that causes the iterator to be modified.
+** The memory for the iterator belongs to the SNDFILE* handle and is freed when
+** sf_close() is called.
+*/
+SF_CHUNK_ITERATOR *
+sf_get_chunk_iterator (SNDFILE * sndfile, const SF_CHUNK_INFO * chunk_info) ;
+
+/* Iterate through chunks by incrementing the iterator.
+** Increments the iterator and returns a handle to the new one.
+** After this call, iterator will no longer be valid, and you must use the
+** newly returned handle from now on.
+** The returned handle can be used to access the next chunk matching
+** the criteria as defined in sf_get_chunk_iterator().
+** If iterator points to the last chunk, this will free all resources
+** associated with iterator and return NULL.
+** The returned iterator will stay valid until sf_get_chunk_iterator_next
+** is called again, the sndfile is closed or a new chunk us added.
+*/
+SF_CHUNK_ITERATOR *
+sf_next_chunk_iterator (SF_CHUNK_ITERATOR * iterator) ;
+
+
+/* Get the size of the specified chunk.
+** If the specified chunk exists, the size will be returned in the
+** datalen field of the SF_CHUNK_INFO struct.
+** Additionally, the id of the chunk will be copied to the id
+** field of the SF_CHUNK_INFO struct and it's id_size field will
+** be updated accordingly.
+** If the chunk doesn't exist chunk_info->datalen will be zero, and the
+** id and id_size fields will be undefined.
+** The function will return SF_ERR_NO_ERROR on success or non-zero on
+** failure.
+*/
+int
+sf_get_chunk_size (const SF_CHUNK_ITERATOR * it, SF_CHUNK_INFO * chunk_info) ;
+
+/* Get the specified chunk data.
+** If the specified chunk exists, up to chunk_info->datalen bytes of
+** the chunk data will be copied into the chunk_info->data buffer
+** (allocated by the caller) and the chunk_info->datalen field
+** updated to reflect the size of the data. The id and id_size
+** field will be updated according to the retrieved chunk
+** If the chunk doesn't exist chunk_info->datalen will be zero, and the
+** id and id_size fields will be undefined.
+** The function will return SF_ERR_NO_ERROR on success or non-zero on
+** failure.
+*/
+int
+sf_get_chunk_data (const SF_CHUNK_ITERATOR * it, SF_CHUNK_INFO * chunk_info) ;
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* SNDFILE_H */
+
diff --git a/libsndfile.64/include/sndfile.hh b/libsndfile.64/include/sndfile.hh
new file mode 100644
index 00000000..0e1c1c20
--- /dev/null
+++ b/libsndfile.64/include/sndfile.hh
@@ -0,0 +1,446 @@
+/*
+** Copyright (C) 2005-2012 Erik de Castro Lopo <erikd@mega-nerd.com>
+**
+** All rights reserved.
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the author nor the names of any contributors may be used
+** to endorse or promote products derived from this software without
+** specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+** The above modified BSD style license (GPL and LGPL compatible) applies to
+** this file. It does not apply to libsndfile itself which is released under
+** the GNU LGPL or the libsndfile test suite which is released under the GNU
+** GPL.
+** This means that this header file can be used under this modified BSD style
+** license, but the LGPL still holds for the libsndfile library itself.
+*/
+
+/*
+** sndfile.hh -- A lightweight C++ wrapper for the libsndfile API.
+**
+** All the methods are inlines and all functionality is contained in this
+** file. There is no separate implementation file.
+**
+** API documentation is in the doc/ directory of the source code tarball
+** and at http://www.mega-nerd.com/libsndfile/api.html.
+*/
+
+#ifndef SNDFILE_HH
+#define SNDFILE_HH
+
+#include <sndfile.h>
+
+#include <string>
+#include <new> // for std::nothrow
+
+class SndfileHandle
+{ private :
+ struct SNDFILE_ref
+ { SNDFILE_ref (void) ;
+ ~SNDFILE_ref (void) ;
+
+ SNDFILE *sf ;
+ SF_INFO sfinfo ;
+ int ref ;
+ } ;
+
+ SNDFILE_ref *p ;
+
+ public :
+ /* Default constructor */
+ SndfileHandle (void) : p (NULL) {} ;
+ SndfileHandle (const char *path, int mode = SFM_READ,
+ int format = 0, int channels = 0, int samplerate = 0) ;
+ SndfileHandle (std::string const & path, int mode = SFM_READ,
+ int format = 0, int channels = 0, int samplerate = 0) ;
+ SndfileHandle (int fd, bool close_desc, int mode = SFM_READ,
+ int format = 0, int channels = 0, int samplerate = 0) ;
+ SndfileHandle (SF_VIRTUAL_IO &sfvirtual, void *user_data, int mode = SFM_READ,
+ int format = 0, int channels = 0, int samplerate = 0) ;
+
+#ifdef ENABLE_SNDFILE_WINDOWS_PROTOTYPES
+ SndfileHandle (LPCWSTR wpath, int mode = SFM_READ,
+ int format = 0, int channels = 0, int samplerate = 0) ;
+#endif
+
+ ~SndfileHandle (void) ;
+
+ SndfileHandle (const SndfileHandle &orig) ;
+ SndfileHandle & operator = (const SndfileHandle &rhs) ;
+
+ /* Mainly for debugging/testing. */
+ int refCount (void) const { return (p == NULL) ? 0 : p->ref ; }
+
+ operator bool () const { return (p != NULL) ; }
+
+ bool operator == (const SndfileHandle &rhs) const { return (p == rhs.p) ; }
+
+ sf_count_t frames (void) const { return p ? p->sfinfo.frames : 0 ; }
+ int format (void) const { return p ? p->sfinfo.format : 0 ; }
+ int channels (void) const { return p ? p->sfinfo.channels : 0 ; }
+ int samplerate (void) const { return p ? p->sfinfo.samplerate : 0 ; }
+
+ int error (void) const ;
+ const char * strError (void) const ;
+
+ int command (int cmd, void *data, int datasize) ;
+
+ sf_count_t seek (sf_count_t frames, int whence) ;
+
+ void writeSync (void) ;
+
+ int setString (int str_type, const char* str) ;
+
+ const char* getString (int str_type) const ;
+
+ static int formatCheck (int format, int channels, int samplerate) ;
+
+ sf_count_t read (short *ptr, sf_count_t items) ;
+ sf_count_t read (int *ptr, sf_count_t items) ;
+ sf_count_t read (float *ptr, sf_count_t items) ;
+ sf_count_t read (double *ptr, sf_count_t items) ;
+
+ sf_count_t write (const short *ptr, sf_count_t items) ;
+ sf_count_t write (const int *ptr, sf_count_t items) ;
+ sf_count_t write (const float *ptr, sf_count_t items) ;
+ sf_count_t write (const double *ptr, sf_count_t items) ;
+
+ sf_count_t readf (short *ptr, sf_count_t frames) ;
+ sf_count_t readf (int *ptr, sf_count_t frames) ;
+ sf_count_t readf (float *ptr, sf_count_t frames) ;
+ sf_count_t readf (double *ptr, sf_count_t frames) ;
+
+ sf_count_t writef (const short *ptr, sf_count_t frames) ;
+ sf_count_t writef (const int *ptr, sf_count_t frames) ;
+ sf_count_t writef (const float *ptr, sf_count_t frames) ;
+ sf_count_t writef (const double *ptr, sf_count_t frames) ;
+
+ sf_count_t readRaw (void *ptr, sf_count_t bytes) ;
+ sf_count_t writeRaw (const void *ptr, sf_count_t bytes) ;
+
+ /**< Raw access to the handle. SndfileHandle keeps ownership. */
+ SNDFILE * rawHandle (void) ;
+
+ /**< Take ownership of handle, if reference count is 1. */
+ SNDFILE * takeOwnership (void) ;
+} ;
+
+/*==============================================================================
+** Nothing but implementation below.
+*/
+
+inline
+SndfileHandle::SNDFILE_ref::SNDFILE_ref (void)
+: sf (NULL), sfinfo (), ref (1)
+{}
+
+inline
+SndfileHandle::SNDFILE_ref::~SNDFILE_ref (void)
+{ if (sf != NULL) sf_close (sf) ; }
+
+inline
+SndfileHandle::SndfileHandle (const char *path, int mode, int fmt, int chans, int srate)
+: p (NULL)
+{
+ p = new (std::nothrow) SNDFILE_ref () ;
+
+ if (p != NULL)
+ { p->ref = 1 ;
+
+ p->sfinfo.frames = 0 ;
+ p->sfinfo.channels = chans ;
+ p->sfinfo.format = fmt ;
+ p->sfinfo.samplerate = srate ;
+ p->sfinfo.sections = 0 ;
+ p->sfinfo.seekable = 0 ;
+
+ p->sf = sf_open (path, mode, &p->sfinfo) ;
+ } ;
+
+ return ;
+} /* SndfileHandle const char * constructor */
+
+inline
+SndfileHandle::SndfileHandle (std::string const & path, int mode, int fmt, int chans, int srate)
+: p (NULL)
+{
+ p = new (std::nothrow) SNDFILE_ref () ;
+
+ if (p != NULL)
+ { p->ref = 1 ;
+
+ p->sfinfo.frames = 0 ;
+ p->sfinfo.channels = chans ;
+ p->sfinfo.format = fmt ;
+ p->sfinfo.samplerate = srate ;
+ p->sfinfo.sections = 0 ;
+ p->sfinfo.seekable = 0 ;
+
+ p->sf = sf_open (path.c_str (), mode, &p->sfinfo) ;
+ } ;
+
+ return ;
+} /* SndfileHandle std::string constructor */
+
+inline
+SndfileHandle::SndfileHandle (int fd, bool close_desc, int mode, int fmt, int chans, int srate)
+: p (NULL)
+{
+ if (fd < 0)
+ return ;
+
+ p = new (std::nothrow) SNDFILE_ref () ;
+
+ if (p != NULL)
+ { p->ref = 1 ;
+
+ p->sfinfo.frames = 0 ;
+ p->sfinfo.channels = chans ;
+ p->sfinfo.format = fmt ;
+ p->sfinfo.samplerate = srate ;
+ p->sfinfo.sections = 0 ;
+ p->sfinfo.seekable = 0 ;
+
+ p->sf = sf_open_fd (fd, mode, &p->sfinfo, close_desc) ;
+ } ;
+
+ return ;
+} /* SndfileHandle fd constructor */
+
+inline
+SndfileHandle::SndfileHandle (SF_VIRTUAL_IO &sfvirtual, void *user_data, int mode, int fmt, int chans, int srate)
+: p (NULL)
+{
+ p = new (std::nothrow) SNDFILE_ref () ;
+
+ if (p != NULL)
+ { p->ref = 1 ;
+
+ p->sfinfo.frames = 0 ;
+ p->sfinfo.channels = chans ;
+ p->sfinfo.format = fmt ;
+ p->sfinfo.samplerate = srate ;
+ p->sfinfo.sections = 0 ;
+ p->sfinfo.seekable = 0 ;
+
+ p->sf = sf_open_virtual (&sfvirtual, mode, &p->sfinfo, user_data) ;
+ } ;
+
+ return ;
+} /* SndfileHandle std::string constructor */
+
+inline
+SndfileHandle::~SndfileHandle (void)
+{ if (p != NULL && --p->ref == 0)
+ delete p ;
+} /* SndfileHandle destructor */
+
+
+inline
+SndfileHandle::SndfileHandle (const SndfileHandle &orig)
+: p (orig.p)
+{ if (p != NULL)
+ ++p->ref ;
+} /* SndfileHandle copy constructor */
+
+inline SndfileHandle &
+SndfileHandle::operator = (const SndfileHandle &rhs)
+{
+ if (&rhs == this)
+ return *this ;
+ if (p != NULL && --p->ref == 0)
+ delete p ;
+
+ p = rhs.p ;
+ if (p != NULL)
+ ++p->ref ;
+
+ return *this ;
+} /* SndfileHandle assignment operator */
+
+inline int
+SndfileHandle::error (void) const
+{ return sf_error (p->sf) ; }
+
+inline const char *
+SndfileHandle::strError (void) const
+{ return sf_strerror (p->sf) ; }
+
+inline int
+SndfileHandle::command (int cmd, void *data, int datasize)
+{ return sf_command (p->sf, cmd, data, datasize) ; }
+
+inline sf_count_t
+SndfileHandle::seek (sf_count_t frame_count, int whence)
+{ return sf_seek (p->sf, frame_count, whence) ; }
+
+inline void
+SndfileHandle::writeSync (void)
+{ sf_write_sync (p->sf) ; }
+
+inline int
+SndfileHandle::setString (int str_type, const char* str)
+{ return sf_set_string (p->sf, str_type, str) ; }
+
+inline const char*
+SndfileHandle::getString (int str_type) const
+{ return sf_get_string (p->sf, str_type) ; }
+
+inline int
+SndfileHandle::formatCheck (int fmt, int chans, int srate)
+{
+ SF_INFO sfinfo ;
+
+ sfinfo.frames = 0 ;
+ sfinfo.channels = chans ;
+ sfinfo.format = fmt ;
+ sfinfo.samplerate = srate ;
+ sfinfo.sections = 0 ;
+ sfinfo.seekable = 0 ;
+
+ return sf_format_check (&sfinfo) ;
+}
+
+/*---------------------------------------------------------------------*/
+
+inline sf_count_t
+SndfileHandle::read (short *ptr, sf_count_t items)
+{ return sf_read_short (p->sf, ptr, items) ; }
+
+inline sf_count_t
+SndfileHandle::read (int *ptr, sf_count_t items)
+{ return sf_read_int (p->sf, ptr, items) ; }
+
+inline sf_count_t
+SndfileHandle::read (float *ptr, sf_count_t items)
+{ return sf_read_float (p->sf, ptr, items) ; }
+
+inline sf_count_t
+SndfileHandle::read (double *ptr, sf_count_t items)
+{ return sf_read_double (p->sf, ptr, items) ; }
+
+inline sf_count_t
+SndfileHandle::write (const short *ptr, sf_count_t items)
+{ return sf_write_short (p->sf, ptr, items) ; }
+
+inline sf_count_t
+SndfileHandle::write (const int *ptr, sf_count_t items)
+{ return sf_write_int (p->sf, ptr, items) ; }
+
+inline sf_count_t
+SndfileHandle::write (const float *ptr, sf_count_t items)
+{ return sf_write_float (p->sf, ptr, items) ; }
+
+inline sf_count_t
+SndfileHandle::write (const double *ptr, sf_count_t items)
+{ return sf_write_double (p->sf, ptr, items) ; }
+
+inline sf_count_t
+SndfileHandle::readf (short *ptr, sf_count_t frame_count)
+{ return sf_readf_short (p->sf, ptr, frame_count) ; }
+
+inline sf_count_t
+SndfileHandle::readf (int *ptr, sf_count_t frame_count)
+{ return sf_readf_int (p->sf, ptr, frame_count) ; }
+
+inline sf_count_t
+SndfileHandle::readf (float *ptr, sf_count_t frame_count)
+{ return sf_readf_float (p->sf, ptr, frame_count) ; }
+
+inline sf_count_t
+SndfileHandle::readf (double *ptr, sf_count_t frame_count)
+{ return sf_readf_double (p->sf, ptr, frame_count) ; }
+
+inline sf_count_t
+SndfileHandle::writef (const short *ptr, sf_count_t frame_count)
+{ return sf_writef_short (p->sf, ptr, frame_count) ; }
+
+inline sf_count_t
+SndfileHandle::writef (const int *ptr, sf_count_t frame_count)
+{ return sf_writef_int (p->sf, ptr, frame_count) ; }
+
+inline sf_count_t
+SndfileHandle::writef (const float *ptr, sf_count_t frame_count)
+{ return sf_writef_float (p->sf, ptr, frame_count) ; }
+
+inline sf_count_t
+SndfileHandle::writef (const double *ptr, sf_count_t frame_count)
+{ return sf_writef_double (p->sf, ptr, frame_count) ; }
+
+inline sf_count_t
+SndfileHandle::readRaw (void *ptr, sf_count_t bytes)
+{ return sf_read_raw (p->sf, ptr, bytes) ; }
+
+inline sf_count_t
+SndfileHandle::writeRaw (const void *ptr, sf_count_t bytes)
+{ return sf_write_raw (p->sf, ptr, bytes) ; }
+
+inline SNDFILE *
+SndfileHandle::rawHandle (void)
+{ return (p ? p->sf : NULL) ; }
+
+inline SNDFILE *
+SndfileHandle::takeOwnership (void)
+{
+ if (p == NULL || (p->ref != 1))
+ return NULL ;
+
+ SNDFILE * sf = p->sf ;
+ p->sf = NULL ;
+ delete p ;
+ p = NULL ;
+ return sf ;
+}
+
+#ifdef ENABLE_SNDFILE_WINDOWS_PROTOTYPES
+
+inline
+SndfileHandle::SndfileHandle (LPCWSTR wpath, int mode, int fmt, int chans, int srate)
+: p (NULL)
+{
+ p = new (std::nothrow) SNDFILE_ref () ;
+
+ if (p != NULL)
+ { p->ref = 1 ;
+
+ p->sfinfo.frames = 0 ;
+ p->sfinfo.channels = chans ;
+ p->sfinfo.format = fmt ;
+ p->sfinfo.samplerate = srate ;
+ p->sfinfo.sections = 0 ;
+ p->sfinfo.seekable = 0 ;
+
+ p->sf = sf_wchar_open (wpath, mode, &p->sfinfo) ;
+ } ;
+
+ return ;
+} /* SndfileHandle const wchar_t * constructor */
+
+#endif
+
+#endif /* SNDFILE_HH */
+
diff --git a/libsndfile.64/lib/libsndfile-1.def b/libsndfile.64/lib/libsndfile-1.def
new file mode 100644
index 00000000..4194ff3e
--- /dev/null
+++ b/libsndfile.64/lib/libsndfile-1.def
@@ -0,0 +1,47 @@
+; Auto-generated by create_symbols_file.py
+
+LIBRARY libsndfile-1.dll
+EXPORTS
+
+sf_command @1
+sf_open @2
+sf_close @3
+sf_seek @4
+sf_error @7
+sf_perror @8
+sf_error_str @9
+sf_error_number @10
+sf_format_check @11
+sf_read_raw @16
+sf_readf_short @17
+sf_readf_int @18
+sf_readf_float @19
+sf_readf_double @20
+sf_read_short @21
+sf_read_int @22
+sf_read_float @23
+sf_read_double @24
+sf_write_raw @32
+sf_writef_short @33
+sf_writef_int @34
+sf_writef_float @35
+sf_writef_double @36
+sf_write_short @37
+sf_write_int @38
+sf_write_float @39
+sf_write_double @40
+sf_strerror @50
+sf_get_string @60
+sf_set_string @61
+sf_version_string @68
+sf_open_fd @70
+sf_wchar_open @71
+sf_open_virtual @80
+sf_write_sync @90
+sf_set_chunk @100
+sf_get_chunk_size @101
+sf_get_chunk_data @102
+sf_get_chunk_iterator @103
+sf_next_chunk_iterator @104
+sf_current_byterate @110
+
diff --git a/libsndfile.64/lib/libsndfile-1.lib b/libsndfile.64/lib/libsndfile-1.lib
new file mode 100644
index 00000000..56546a20
--- /dev/null
+++ b/libsndfile.64/lib/libsndfile-1.lib
Binary files differ
diff --git a/libsndfile.64/lib/pkgconfig/sndfile.pc b/libsndfile.64/lib/pkgconfig/sndfile.pc
new file mode 100644
index 00000000..428d708a
--- /dev/null
+++ b/libsndfile.64/lib/pkgconfig/sndfile.pc
@@ -0,0 +1,12 @@
+prefix=c:/devel/target/libsndfile
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: sndfile
+Description: A library for reading and writing audio files
+Requires:
+Version: 1.0.28
+Libs: -L${libdir} -lsndfile
+Libs.private: Ext/libflac.la Ext/libvorbis.la Ext/libogg.la
+Cflags: -I${includedir}
diff --git a/mpg123/dist/libmpg123.dll b/mpg123.32/dist/libmpg123.dll
index ccb429bf..ccb429bf 100644
--- a/mpg123/dist/libmpg123.dll
+++ b/mpg123.32/dist/libmpg123.dll
Binary files differ
diff --git a/mpg123/include/mpg123.h b/mpg123.32/include/mpg123.h
index 03cf9197..03cf9197 100644
--- a/mpg123/include/mpg123.h
+++ b/mpg123.32/include/mpg123.h
diff --git a/mpg123/lib/libmpg123.lib b/mpg123.32/lib/libmpg123.lib
index e3555655..e3555655 100644
--- a/mpg123/lib/libmpg123.lib
+++ b/mpg123.32/lib/libmpg123.lib
Binary files differ
diff --git a/mpg123.64/dist/libmpg123.dll b/mpg123.64/dist/libmpg123.dll
new file mode 100644
index 00000000..545c9de3
--- /dev/null
+++ b/mpg123.64/dist/libmpg123.dll
Binary files differ
diff --git a/mpg123.64/include/fmt123.h b/mpg123.64/include/fmt123.h
new file mode 100644
index 00000000..dcabf5e0
--- /dev/null
+++ b/mpg123.64/include/fmt123.h
@@ -0,0 +1,159 @@
+/*
+ libmpg123: MPEG Audio Decoder library
+
+ separate header just for audio format definitions not tied to
+ library code
+
+ copyright 1995-2020 by the mpg123 project
+ free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+*/
+
+#ifndef MPG123_ENC_H
+#define MPG123_ENC_H
+
+/** \file fmt123.h Audio format definitions. */
+
+/** \defgroup mpg123_enc mpg123 PCM sample encodings
+ * These are definitions for audio formats used by libmpg123 and
+ * libout123.
+ *
+ * @{
+ */
+
+/** An enum over all sample types possibly known to mpg123.
+ * The values are designed as bit flags to allow bitmasking for encoding
+ * families.
+ * This is also why the enum is not used as type for actual encoding variables,
+ * plain integers (at least 16 bit, 15 bit being used) cover the possible
+ * combinations of these flags.
+ *
+ * Note that (your build of) libmpg123 does not necessarily support all these.
+ * Usually, you can expect the 8bit encodings and signed 16 bit.
+ * Also 32bit float will be usual beginning with mpg123-1.7.0 .
+ * What you should bear in mind is that (SSE, etc) optimized routines may be
+ * absent for some formats. We do have SSE for 16, 32 bit and float, though.
+ * 24 bit integer is done via postprocessing of 32 bit output -- just cutting
+ * the last byte, no rounding, even. If you want better, do it yourself.
+ *
+ * All formats are in native byte order. If you need different endinaness, you
+ * can simply postprocess the output buffers (libmpg123 wouldn't do anything
+ * else). The macro MPG123_SAMPLESIZE() can be helpful there.
+ */
+enum mpg123_enc_enum
+{
+/* 0000 0000 0000 1111 Some 8 bit integer encoding. */
+ MPG123_ENC_8 = 0x00f
+/* 0000 0000 0100 0000 Some 16 bit integer encoding. */
+, MPG123_ENC_16 = 0x040
+/* 0100 0000 0000 0000 Some 24 bit integer encoding. */
+, MPG123_ENC_24 = 0x4000
+/* 0000 0001 0000 0000 Some 32 bit integer encoding. */
+, MPG123_ENC_32 = 0x100
+/* 0000 0000 1000 0000 Some signed integer encoding. */
+, MPG123_ENC_SIGNED = 0x080
+/* 0000 1110 0000 0000 Some float encoding. */
+, MPG123_ENC_FLOAT = 0xe00
+/* 0000 0000 1101 0000 signed 16 bit */
+, MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10)
+/* 0000 0000 0110 0000 unsigned 16 bit */
+, MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20)
+/* 0000 0000 0000 0001 unsigned 8 bit */
+, MPG123_ENC_UNSIGNED_8 = 0x01
+/* 0000 0000 1000 0010 signed 8 bit */
+, MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02)
+/* 0000 0000 0000 0100 ulaw 8 bit */
+, MPG123_ENC_ULAW_8 = 0x04
+/* 0000 0000 0000 1000 alaw 8 bit */
+, MPG123_ENC_ALAW_8 = 0x08
+/* 0001 0001 1000 0000 signed 32 bit */
+, MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000
+/* 0010 0001 0000 0000 unsigned 32 bit */
+, MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000
+/* 0101 0000 1000 0000 signed 24 bit */
+, MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000
+/* 0110 0000 0000 0000 unsigned 24 bit */
+, MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000
+/* 0000 0010 0000 0000 32bit float */
+, MPG123_ENC_FLOAT_32 = 0x200
+/* 0000 0100 0000 0000 64bit float */
+, MPG123_ENC_FLOAT_64 = 0x400
+/* Any possibly known encoding from the list above. */
+, MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16
+ | MPG123_ENC_UNSIGNED_8 | MPG123_ENC_SIGNED_8
+ | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8
+ | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32
+ | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24
+ | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 )
+};
+
+/** Get size of one PCM sample with given encoding.
+ * This is included both in libmpg123 and libout123. Both offer
+ * an API function to provide the macro results from library
+ * compile-time, not that of you application. This most likely
+ * does not matter as I do not expect any fresh PCM sample
+ * encoding to appear. But who knows? Perhaps the encoding type
+ * will be abused for funny things in future, not even plain PCM.
+ * And, by the way: Thomas really likes the ?: operator.
+ * \param enc the encoding (mpg123_enc_enum value)
+ * \return size of one sample in bytes
+ */
+#define MPG123_SAMPLESIZE(enc) ( \
+ (enc) < 1 \
+ ? 0 \
+ : ( (enc) & MPG123_ENC_8 \
+ ? 1 \
+ : ( (enc) & MPG123_ENC_16 \
+ ? 2 \
+ : ( (enc) & MPG123_ENC_24 \
+ ? 3 \
+ : ( ( (enc) & MPG123_ENC_32 \
+ || (enc) == MPG123_ENC_FLOAT_32 ) \
+ ? 4 \
+ : ( (enc) == MPG123_ENC_FLOAT_64 \
+ ? 8 \
+ : 0 \
+) ) ) ) ) )
+
+/** Representation of zero in differing encodings.
+ * This exists to define proper silence in various encodings without
+ * having to link to libsyn123 to do actual conversions at runtime.
+ * You have to handle big/little endian order yourself, though.
+ * This takes the shortcut that any signed encoding has a zero with
+ * all-zero bits. Unsigned linear encodings just have the highest bit set
+ * (2^(n-1) for n bits), while the nonlinear 8-bit ones are special.
+ * \param enc the encoding (mpg123_enc_enum value)
+ * \param siz bytes per sample (return value of MPG123_SAMPLESIZE(enc))
+ * \param off byte (octet) offset counted from LSB
+ * \return unsigned byte value for the designated octet
+ */
+#define MPG123_ZEROSAMPLE(enc, siz, off) ( \
+ (enc) == MPG123_ENC_ULAW_8 \
+ ? (off == 0 ? 0xff : 0x00) \
+ : ( (enc) == MPG123_ENC_ALAW_8 \
+ ? (off == 0 ? 0xd5 : 0x00) \
+ : ( (((enc) & (MPG123_ENC_SIGNED|MPG123_ENC_FLOAT)) || (siz) != ((off)+1)) \
+ ? 0x00 \
+ : 0x80 \
+ ) ) )
+
+/** Structure defining an audio format.
+ * Providing the members as individual function arguments to define a certain
+ * output format is easy enough. This struct makes is more comfortable to deal
+ * with a list of formats.
+ * Negative values for the members might be used to communicate use of default
+ * values.
+ */
+struct mpg123_fmt
+{
+ long rate; /**< sampling rate in Hz */
+ int channels; /**< channel count */
+ /** encoding code, can be single value or bitwise or of members of
+ * mpg123_enc_enum */
+ int encoding;
+};
+
+/* @} */
+
+#endif
+
diff --git a/mpg123.64/include/mpg123.h b/mpg123.64/include/mpg123.h
new file mode 100644
index 00000000..7b0a8495
--- /dev/null
+++ b/mpg123.64/include/mpg123.h
@@ -0,0 +1,1697 @@
+/*
+ libmpg123: MPEG Audio Decoder library (version 1.26.3)
+
+ copyright 1995-2015 by the mpg123 project
+ free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+*/
+
+#ifndef MPG123_LIB_H
+#define MPG123_LIB_H
+
+#include <fmt123.h>
+
+/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */
+
+/** A macro to check at compile time which set of API functions to expect.
+ * This should be incremented at least each time a new symbol is added
+ * to the header.
+ */
+#define MPG123_API_VERSION 45
+
+#ifndef MPG123_EXPORT
+/** Defines needed for MS Visual Studio(tm) DLL builds.
+ * Every public function must be prefixed with MPG123_EXPORT. When building
+ * the DLL ensure to define BUILD_MPG123_DLL. This makes the function accessible
+ * for clients and includes it in the import library which is created together
+ * with the DLL. When consuming the DLL ensure to define LINK_MPG123_DLL which
+ * imports the functions from the DLL.
+ */
+#ifdef BUILD_MPG123_DLL
+/* The dll exports. */
+#define MPG123_EXPORT __declspec(dllexport)
+#else
+#ifdef LINK_MPG123_DLL
+/* The exe imports. */
+#define MPG123_EXPORT __declspec(dllimport)
+#else
+/* Nothing on normal/UNIX builds */
+#define MPG123_EXPORT
+#endif
+#endif
+#endif
+
+/* This is for Visual Studio, so this header works as distributed in the binary downloads */
+#if defined(_MSC_VER) && !defined(MPG123_DEF_SSIZE_T)
+#define MPG123_DEF_SSIZE_T
+#include <stddef.h>
+typedef ptrdiff_t ssize_t;
+#endif
+
+#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */
+#include <stdlib.h>
+#include <sys/types.h>
+
+/* Simplified large file handling.
+ I used to have a check here that prevents building for a library with conflicting large file setup
+ (application that uses 32 bit offsets with library that uses 64 bits).
+ While that was perfectly fine in an environment where there is one incarnation of the library,
+ it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the
+ correct header matching the 32 bit library (where large files need explicit support) or
+ the 64 bit library (where there is no distinction).
+
+ New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support,
+ and thus functions with added suffix (mpg123_open_64).
+ Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when
+ building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now.
+ Link failure is not the expected outcome of any half-sane usage anymore.
+
+ More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names.
+*/
+
+/*
+ Now, the renaming of large file aware functions.
+ By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME.
+*/
+#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX))
+
+/* Need some trickery to concatenate the value(s) of the given macro(s). */
+#define MPG123_MACROCAT_REALLY(a, b) a ## b
+#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b)
+#ifndef MPG123_LARGESUFFIX
+#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS)
+#endif
+#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX)
+
+#define mpg123_open_fixed MPG123_LARGENAME(mpg123_open_fixed)
+#define mpg123_open MPG123_LARGENAME(mpg123_open)
+#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd)
+#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle)
+#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode)
+#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame)
+#define mpg123_tell MPG123_LARGENAME(mpg123_tell)
+#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe)
+#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream)
+#define mpg123_seek MPG123_LARGENAME(mpg123_seek)
+#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek)
+#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame)
+#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe)
+#define mpg123_index MPG123_LARGENAME(mpg123_index)
+#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index)
+#define mpg123_position MPG123_LARGENAME(mpg123_position)
+#define mpg123_length MPG123_LARGENAME(mpg123_length)
+#define mpg123_framelength MPG123_LARGENAME(mpg123_framelength)
+#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize)
+#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader)
+#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle)
+#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos)
+
+#endif /* largefile hackery */
+
+#endif /* MPG123_NO_CONFIGURE */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** \defgroup mpg123_init mpg123 library and handle setup
+ *
+ * Functions to initialise and shutdown the mpg123 library and handles.
+ * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-)
+ * Tip: Use a RVA setting...
+ *
+ * @{
+ */
+
+/** Opaque structure for the libmpg123 decoder handle. */
+struct mpg123_handle_struct;
+
+/** Opaque structure for the libmpg123 decoder handle.
+ * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner.
+ */
+typedef struct mpg123_handle_struct mpg123_handle;
+
+/** Function to initialise the mpg123 library.
+ * This should be called once in a non-parallel context. It is not explicitly
+ * thread-safe, but repeated/concurrent calls still _should_ be safe as static
+ * tables are filled with the same values anyway.
+ *
+ * \return MPG123_OK if successful, otherwise an error number.
+ */
+MPG123_EXPORT int mpg123_init(void);
+
+/** Superfluous Function to close down the mpg123 library.
+ * This was created with the thought that there sometime will be cleanup code
+ * to be run after library use. This never materialized. You can forget about
+ * this function and it is only here for old programs that do call it.
+ */
+MPG123_EXPORT void mpg123_exit(void);
+
+/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()).
+ * and optional retrieval of an error code to feed to mpg123_plain_strerror().
+ * Optional means: Any of or both the parameters may be NULL.
+ *
+ * \param decoder optional choice of decoder variant (NULL for default)
+ * \param error optional address to store error codes
+ * \return Non-NULL pointer to fresh handle when successful.
+ */
+MPG123_EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error);
+
+/** Delete handle, mh is either a valid mpg123 handle or NULL.
+ * \param mh handle
+ */
+MPG123_EXPORT void mpg123_delete(mpg123_handle *mh);
+
+/** Free plain memory allocated within libmpg123.
+ * This is for library users that are not sure to use the same underlying
+ * memory allocator as libmpg123. It is just a wrapper over free() in
+ * the underlying C library.
+ */
+MPG123_EXPORT void mpg123_free(void *ptr);
+
+/** Enumeration of the parameters types that it is possible to set/get. */
+enum mpg123_parms
+{
+ MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */
+ MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */
+ MPG123_ADD_FLAGS, /**< add some flags (integer) */
+ MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */
+ MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */
+ MPG123_RVA, /**< one of the RVA choices above (integer) */
+ MPG123_DOWNSPEED, /**< play a frame N times (integer) */
+ MPG123_UPSPEED, /**< play every Nth frame (integer) */
+ MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */
+ MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */
+ MPG123_ICY_INTERVAL, /**< Stream contains ICY metadata with this interval (integer).
+ Make sure to set this _before_ opening a stream.*/
+ MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */
+ MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */
+ MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */
+ MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */
+ MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */
+ ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/
+ ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */
+ ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */
+ ,MPG123_FREEFORMAT_SIZE /**< Tell the parser a free-format frame size to
+ * avoid read-ahead to get it. A value of -1 (default) means that the parser
+ * will determine it. The parameter value is applied during decoder setup
+ * for a freshly opened stream only.
+ */
+};
+
+/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */
+enum mpg123_param_flags
+{
+ MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */
+ ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */
+ ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */
+ ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */
+ ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */
+ ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */
+ ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */
+ ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */
+ ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */
+ ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */
+ ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */
+ ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */
+ ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */
+ ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */
+ ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */
+ ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */
+ ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */
+ ,MPG123_PICTURE = 0x10000 /**< 17th bit: Enable storage of pictures from tags (ID3v2 APIC). */
+ ,MPG123_NO_PEEK_END = 0x20000 /**< 18th bit: Do not seek to the end of
+ * the stream in order to probe
+ * the stream length and search for the id3v1 field. This also means
+ * the file size is unknown unless set using mpg123_set_filesize() and
+ * the stream is assumed as non-seekable unless overridden.
+ */
+ ,MPG123_FORCE_SEEKABLE = 0x40000 /**< 19th bit: Force the stream to be seekable. */
+ ,MPG123_STORE_RAW_ID3 = 0x80000 /**< store raw ID3 data (even if skipping) */
+ ,MPG123_FORCE_ENDIAN = 0x100000 /**< Enforce endianess of output samples.
+ * This is not reflected in the format codes. If this flag is set along with
+ * MPG123_BIG_ENDIAN, MPG123_ENC_SIGNED16 means s16be, without
+ * MPG123_BIG_ENDIAN, it means s16le. Normal operation without
+ * MPG123_FORCE_ENDIAN produces output in native byte order.
+ */
+ ,MPG123_BIG_ENDIAN = 0x200000 /**< Choose big endian instead of little. */
+ ,MPG123_NO_READAHEAD = 0x400000 /**< Disable read-ahead in parser. If
+ * you know you provide full frames to the feeder API, this enables
+ * decoder output from the first one on, instead of having to wait for
+ * the next frame to confirm that the stream is healthy. It also disables
+ * free format support unless you provide a frame size using
+ * MPG123_FREEFORMAT_SIZE.
+ */
+ ,MPG123_FLOAT_FALLBACK = 0x800000 /**< Consider floating point output encoding only after
+ * trying other (possibly downsampled) rates and encodings first. This is to
+ * support efficient playback where floating point output is only configured for
+ * an external resampler, bypassing that resampler when the desired rate can
+ * be produced directly. This is enabled by default to be closer to older versions
+ * of libmpg123 which did not enable float automatically at all. If disabled,
+ * float is considered after the 16 bit default and higher-bit integer encodings
+ * for any rate. */
+ ,MPG123_NO_FRANKENSTEIN = 0x1000000 /**< Disable support for Frankenstein streams
+ * (different MPEG streams stiched together). Do not accept serious change of MPEG
+ * header inside a single stream. With this flag, the audio output format cannot
+ * change during decoding unless you open a new stream. This also stops decoding
+ * after an announced end of stream (Info header contained a number of frames
+ * and this number has been reached). This makes your MP3 files behave more like
+ * ordinary media files with defined structure, rather than stream dumps with
+ * some sugar. */
+};
+
+/** choices for MPG123_RVA */
+enum mpg123_param_rva
+{
+ MPG123_RVA_OFF = 0 /**< RVA disabled (default). */
+ ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */
+ ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */
+ ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */
+};
+
+/** Set a specific parameter, for a specific mpg123_handle, using a parameter
+ * type key chosen from the mpg123_parms enumeration, to the specified value.
+ * \param mh handle
+ * \param type parameter choice
+ * \param value integer value
+ * \param fvalue floating point value
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_param( mpg123_handle *mh
+, enum mpg123_parms type, long value, double fvalue );
+
+/** Get a specific parameter, for a specific mpg123_handle.
+ * See the mpg123_parms enumeration for a list of available parameters.
+ * \param mh handle
+ * \param type parameter choice
+ * \param value integer value return address
+ * \param fvalue floating point value return address
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getparam( mpg123_handle *mh
+, enum mpg123_parms type, long *value, double *fvalue );
+
+/** Feature set available for query with mpg123_feature. */
+enum mpg123_feature_set
+{
+ MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */
+ ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */
+ ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */
+ ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */
+ ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */
+ ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */
+ ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */
+ ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */
+ ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */
+ ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */
+ ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */
+ ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */
+ ,MPG123_FEATURE_PARSE_ICY /**< ICY support */
+ ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */
+ ,MPG123_FEATURE_EQUALIZER /**< tunable equalizer */
+ ,MPG123_FEATURE_MOREINFO /**< more info extraction (for frame analyzer) */
+ ,MPG123_FEATURE_OUTPUT_FLOAT32 /**< 32 bit float output */
+ ,MPG123_FEATURE_OUTPUT_FLOAT64 /**< 64 bit float output (usually never) */
+};
+
+/** Query libmpg123 features.
+ * \param key feature selection
+ * \return 1 for success, 0 for unimplemented functions
+ */
+MPG123_EXPORT int mpg123_feature(const enum mpg123_feature_set key);
+
+/** Query libmpg123 features with better ABI compatibility
+ *
+ * This is the same as mpg123_feature(), but this time not using
+ * the enum as argument. Compilers don't have to agree on the size of
+ * enums and hence they are not safe in public API.
+ *
+ * \param key feature selection
+ * \return 1 for success, 0 for unimplemented functions
+ */
+MPG123_EXPORT int mpg123_feature2(int key);
+
+/* @} */
+
+
+/** \defgroup mpg123_error mpg123 error handling
+ *
+ * Functions to get text version of the error numbers and an enumeration
+ * of the error codes returned by libmpg123.
+ *
+ * Most functions operating on a mpg123_handle simply return MPG123_OK (0)
+ * on success and MPG123_ERR (-1) on failure, setting the internal error
+ * variable of the handle to the specific error code. If there was not a valid
+ * (non-NULL) handle provided to a function operating on one, MPG123_BAD_HANDLE
+ * may be returned if this can not be confused with a valid positive return
+ * value.
+ * Meaning: A function expected to return positive integers on success will
+ * always indicate error or a special condition by returning a negative one.
+ *
+ * Decoding/seek functions may also return message codes MPG123_DONE,
+ * MPG123_NEW_FORMAT and MPG123_NEED_MORE (all negative, see below on how to
+ * react). Note that calls to those can be nested, so generally watch out
+ * for these codes after initial handle setup.
+ * Especially any function that needs information about the current stream
+ * to work will try to at least parse the beginning if that did not happen
+ * yet.
+ *
+ * On a function that is supposed to return MPG123_OK on success and
+ * MPG123_ERR on failure, make sure you check for != MPG123_OK, not
+ * == MPG123_ERR, as the error code could get more specific in future,
+ * or there is just a special message from a decoding routine as indicated
+ * above.
+ *
+ * @{
+ */
+
+/** Enumeration of the message and error codes and returned by libmpg123 functions. */
+enum mpg123_errors
+{
+ MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */
+ MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */
+ MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */
+ MPG123_ERR=-1, /**< Generic Error */
+ MPG123_OK=0, /**< Success */
+ MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */
+ MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */
+ MPG123_BAD_RATE, /**< Invalid sample rate specified. */
+ MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */
+ MPG123_BAD_PARAM, /**< Bad parameter id! */
+ MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */
+ MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */
+ MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */
+ MPG123_BAD_DECODER, /**< Invalid decoder choice. */
+ MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */
+ MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */
+ MPG123_BAD_RVA, /**< Invalid RVA mode. */
+ MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */
+ MPG123_NO_SPACE, /**< Not enough buffer space. */
+ MPG123_BAD_TYPES, /**< Incompatible numeric data types. */
+ MPG123_BAD_BAND, /**< Bad equalizer band. */
+ MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */
+ MPG123_ERR_READER, /**< Error reading the stream. */
+ MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */
+ MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/
+ MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */
+ MPG123_BAD_FILE, /**< File access error. */
+ MPG123_NO_SEEK, /**< Seek not supported by stream. */
+ MPG123_NO_READER, /**< No stream opened. */
+ MPG123_BAD_PARS, /**< Bad parameter handle. */
+ MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */
+ MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */
+ MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */
+ MPG123_NO_8BIT, /**< No 8bit encoding possible. */
+ MPG123_BAD_ALIGN, /**< Stack aligmnent error */
+ MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */
+ MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */
+ MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */
+ MPG123_BAD_KEY, /**< Bad key value given. */
+ MPG123_NO_INDEX, /**< No frame index in this build. */
+ MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */
+ MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */
+ MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */
+ ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */
+ ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */
+ ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */
+ ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */
+ ,MPG123_INT_OVERFLOW /**< Some integer overflow. */
+};
+
+/** Look up error strings given integer code.
+ * \param errcode integer error code
+ * \return string describing what that error error code means
+ */
+MPG123_EXPORT const char* mpg123_plain_strerror(int errcode);
+
+/** Give string describing what error has occured in the context of handle mh.
+ * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via
+ * char *errmsg = mpg123_strerror(mh)
+ * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE.
+ * \param mh handle
+ * \return error message
+ */
+MPG123_EXPORT const char* mpg123_strerror(mpg123_handle *mh);
+
+/** Return the plain errcode intead of a string.
+ * \param mh handle
+ * \return error code recorded in handle or MPG123_BAD_HANDLE
+ */
+MPG123_EXPORT int mpg123_errcode(mpg123_handle *mh);
+
+/*@}*/
+
+
+/** \defgroup mpg123_decoder mpg123 decoder selection
+ *
+ * Functions to list and select the available decoders.
+ * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is).
+ *
+ * @{
+ */
+
+/** Get available decoder list.
+ * \return NULL-terminated array of generally available decoder names (plain 8bit ASCII)
+ */
+MPG123_EXPORT const char **mpg123_decoders(void);
+
+/** Get supported decoder list.
+ * \return NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII)
+ */
+MPG123_EXPORT const char **mpg123_supported_decoders(void);
+
+/** Set the active decoder.
+ * \param mh handle
+ * \param decoder_name name of decoder
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name);
+
+/** Get the currently active decoder name.
+ * The active decoder engine can vary depening on output constraints,
+ * mostly non-resampling, integer output is accelerated via 3DNow & Co. but for
+ * other modes a fallback engine kicks in.
+ * Note that this can return a decoder that is only active in the hidden and not
+ * available as decoder choice from the outside.
+ * \param mh handle
+ * \return The decoder name or NULL on error.
+ */
+MPG123_EXPORT const char* mpg123_current_decoder(mpg123_handle *mh);
+
+/*@}*/
+
+
+/** \defgroup mpg123_output mpg123 output audio format
+ *
+ * Functions to get and select the format of the decoded audio.
+ *
+ * Before you dive in, please be warned that you might get confused by this.
+ * This seems to happen a lot, therefore I am trying to explain in advance.
+ * If you do feel confused and just want to decode your normal MPEG audio files that
+ * don't alter properties in the middle, just use mpg123_open_fixed() with a fixed encoding
+ * and channel count and forget about a matrix of audio formats. If you want to get funky,
+ * read ahead ...
+ *
+ * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including optimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again).
+ *
+ * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness.
+ *
+ * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation.
+ *
+ * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format.
+ *
+ * @{
+ */
+
+/** They can be combined into one number (3) to indicate mono and stereo... */
+enum mpg123_channelcount
+{
+ MPG123_MONO = 1 /**< mono */
+ ,MPG123_STEREO = 2 /**< stereo */
+};
+
+/** An array of supported standard sample rates
+ * These are possible native sample rates of MPEG audio files.
+ * You can still force mpg123 to resample to a different one, but by
+ * default you will only get audio in one of these samplings.
+ * This list is in ascending order.
+ * \param list Store a pointer to the sample rates array there.
+ * \param number Store the number of sample rates there. */
+MPG123_EXPORT void mpg123_rates(const long **list, size_t *number);
+
+/** An array of supported audio encodings.
+ * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED).
+ * \param list Store a pointer to the encodings array there.
+ * \param number Store the number of encodings there. */
+MPG123_EXPORT void mpg123_encodings(const int **list, size_t *number);
+
+/** Return the size (in bytes) of one mono sample of the named encoding.
+ * \param encoding The encoding value to analyze.
+ * \return positive size of encoding in bytes, 0 on invalid encoding. */
+MPG123_EXPORT int mpg123_encsize(int encoding);
+
+/** Configure a mpg123 handle to accept no output format at all,
+ * use before specifying supported formats with mpg123_format
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_format_none(mpg123_handle *mh);
+
+/** Configure mpg123 handle to accept all formats
+ * (also any custom rate you may set) -- this is default.
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_format_all(mpg123_handle *mh);
+
+/** Set the audio format support of a mpg123_handle in detail:
+ * \param mh handle
+ * \param rate The sample rate value (in Hertz).
+ * \param channels A combination of MPG123_STEREO and MPG123_MONO.
+ * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here.
+ * \return MPG123_OK on success, MPG123_ERR if there was an error. */
+MPG123_EXPORT int mpg123_format( mpg123_handle *mh
+, long rate, int channels, int encodings );
+
+/** Set the audio format support of a mpg123_handle in detail:
+ * \param mh handle
+ * \param rate The sample rate value (in Hertz). Special value 0 means
+ * all rates (the reason for this variant of mpg123_format()).
+ * \param channels A combination of MPG123_STEREO and MPG123_MONO.
+ * \param encodings A combination of accepted encodings for rate and channels,
+ * p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support).
+ * Please note that some encodings may not be supported in the library build
+ * and thus will be ignored here.
+ * \return MPG123_OK on success, MPG123_ERR if there was an error. */
+MPG123_EXPORT int mpg123_format2( mpg123_handle *mh
+, long rate, int channels, int encodings );
+
+/** Check to see if a specific format at a specific rate is supported
+ * by mpg123_handle.
+ * \param mh handle
+ * \param rate sampling rate
+ * \param encoding encoding
+ * \return 0 for no support (that includes invalid parameters), MPG123_STEREO,
+ * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */
+MPG123_EXPORT int mpg123_format_support( mpg123_handle *mh
+, long rate, int encoding );
+
+/** Get the current output format written to the addresses given.
+ * If the stream is freshly loaded, this will try to parse enough
+ * of it to give you the format to come. This clears the flag that
+ * would otherwise make the first decoding call return
+ * MPG123_NEW_FORMAT.
+ * \param mh handle
+ * \param rate sampling rate return address
+ * \param channels channel count return address
+ * \param encoding encoding return address
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getformat( mpg123_handle *mh
+, long *rate, int *channels, int *encoding );
+
+/** Get the current output format written to the addresses given.
+ * This differs from plain mpg123_getformat() in that you can choose
+ * _not_ to clear the flag that would trigger the next decoding call
+ * to return MPG123_NEW_FORMAT in case of a new format arriving.
+ * \param mh handle
+ * \param rate sampling rate return address
+ * \param channels channel count return address
+ * \param encoding encoding return address
+ * \param clear_flag if true, clear internal format flag
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getformat2( mpg123_handle *mh
+, long *rate, int *channels, int *encoding, int clear_flag );
+
+/*@}*/
+
+
+/** \defgroup mpg123_input mpg123 file input and decoding
+ *
+ * Functions for input bitstream and decoding operations.
+ * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!).
+ * @{
+ */
+
+/** Open a simple MPEG file with fixed properties.
+ *
+ * This function shall simplify the common use case of a plain MPEG
+ * file on disk that you want to decode, with one fixed sample
+ * rate and channel count, and usually a length defined by a Lame/Info/Xing
+ * tag. It will:
+ *
+ * - set the MPG123_NO_FRANKENSTEIN flag
+ * - set up format support according to given parameters,
+ * - open the file,
+ * - query audio format,
+ * - fix the audio format support table to ensure the format stays the same,
+ * - call mpg123_scan() if there is no header frame to tell the track length.
+ *
+ * From that on, you can call mpg123_getformat() for querying the sample
+ * rate (and channel count in case you allowed both) and mpg123_length()
+ * to get a pretty safe number for the duration.
+ * Only the sample rate is left open as that indeed is a fixed property of
+ * MPEG files. You could set MPG123_FORCE_RATE beforehand, but that may trigger
+ * low-quality resampling in the decoder, only do so if in dire need.
+ * The library will convert mono files to stereo for you, and vice versa.
+ * If any constraint cannot be satisified (most likely because of a non-default
+ * build of libmpg123), you get MPG123_ERR returned and can query the detailed
+ * cause from the handle. Only on MPG123_OK there will an open file that you
+ * then close using mpg123_close(), or implicitly on mpg123_delete() or the next
+ * call to open another file.
+ *
+ * So, for your usual CD rip collection, you could use
+ *
+ * mpg123_open_fixed(mh, path, MPG123_STEREO, MPG123_ENC_SIGNED_16)
+ *
+ * and be happy calling mpg123_getformat() to verify 44100 Hz rate, then just
+ * playing away with mpg123_read(). The occasional mono file, or MP2 file,
+ * will also be decoded without you really noticing. Just the speed could be
+ * wrong if you do not care about sample rate at all.
+ * \param mh handle
+ * \param path filesystem path
+ * \param channels allowed channel count, either 1 (MPG123_MONO) or
+ * 2 (MPG123_STEREO), or bitwise or of them, but then you're halfway back to
+ * calling mpg123_format() again;-)
+ * \param encoding a definite encoding from enum mpg123_enc_enum
+ * or a bitmask like for mpg123_format(), defeating the purpose somewhat
+ */
+MPG123_EXPORT int mpg123_open_fixed(mpg123_handle *mh, const char *path
+, int channels, int encoding);
+
+/** Open and prepare to decode the specified file by filesystem path.
+ * This does not open HTTP urls; libmpg123 contains no networking code.
+ * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed().
+ * \param mh handle
+ * \param path filesystem path
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path);
+
+/** Use an already opened file descriptor as the bitstream input
+ * mpg123_close() will _not_ close the file descriptor.
+ * \param mh handle
+ * \param fd file descriptor
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd);
+
+/** Use an opaque handle as bitstream input. This works only with the
+ * replaced I/O from mpg123_replace_reader_handle()!
+ * mpg123_close() will call the cleanup callback for your handle (if you gave one).
+ * \param mh handle
+ * \param iohandle your handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle);
+
+/** Open a new bitstream and prepare for direct feeding
+ * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream.
+ * Also, you are expected to handle ICY metadata extraction yourself. This
+ * input method does not handle MPG123_ICY_INTERVAL. It does parse ID3 frames, though.
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_open_feed(mpg123_handle *mh);
+
+/** Closes the source, if libmpg123 opened it.
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_close(mpg123_handle *mh);
+
+/** Read from stream and decode up to outmemsize bytes.
+ *
+ * Note: The type of outmemory changed to a void pointer in mpg123 1.26.0
+ * (API version 45).
+ *
+ * \param mh handle
+ * \param outmemory address of output buffer to write to
+ * \param outmemsize maximum number of bytes to write
+ * \param done address to store the number of actually decoded bytes to
+ * \return MPG123_OK or error/message code
+ */
+MPG123_EXPORT int mpg123_read(mpg123_handle *mh
+, void *outmemory, size_t outmemsize, size_t *done );
+
+/** Feed data for a stream that has been opened with mpg123_open_feed().
+ * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples.
+ * \param mh handle
+ * \param in input buffer
+ * \param size number of input bytes
+ * \return MPG123_OK or error/message code.
+ */
+MPG123_EXPORT int mpg123_feed( mpg123_handle *mh
+, const unsigned char *in, size_t size );
+
+/** Decode MPEG Audio from inmemory to outmemory.
+ * This is very close to a drop-in replacement for old mpglib.
+ * When you give zero-sized output buffer the input will be parsed until
+ * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it)
+ * without taking decoded data.
+ * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-).
+ * You can actually always decide if you want those specialized functions in separate steps or one call this one here.
+ *
+ * Note: The type of outmemory changed to a void pointer in mpg123 1.26.0
+ * (API version 45).
+ *
+ * \param mh handle
+ * \param inmemory input buffer
+ * \param inmemsize number of input bytes
+ * \param outmemory output buffer
+ * \param outmemsize maximum number of output bytes
+ * \param done address to store the number of actually decoded bytes to
+ * \return error/message code (watch out especially for MPG123_NEED_MORE)
+ */
+MPG123_EXPORT int mpg123_decode( mpg123_handle *mh
+, const unsigned char *inmemory, size_t inmemsize
+, void *outmemory, size_t outmemsize, size_t *done );
+
+/** Decode next MPEG frame to internal buffer
+ * or read a frame and return after setting a new format.
+ * \param mh handle
+ * \param num current frame offset gets stored there
+ * \param audio This pointer is set to the internal buffer to read the decoded audio from.
+ * \param bytes number of output bytes ready in the buffer
+ * \return MPG123_OK or error/message code
+ */
+MPG123_EXPORT int mpg123_decode_frame( mpg123_handle *mh
+, off_t *num, unsigned char **audio, size_t *bytes );
+
+/** Decode current MPEG frame to internal buffer.
+ * Warning: This is experimental API that might change in future releases!
+ * Please watch mpg123 development closely when using it.
+ * \param mh handle
+ * \param num last frame offset gets stored there
+ * \param audio this pointer is set to the internal buffer to read the decoded audio from.
+ * \param bytes number of output bytes ready in the buffer
+ * \return MPG123_OK or error/message code
+ */
+MPG123_EXPORT int mpg123_framebyframe_decode( mpg123_handle *mh
+, off_t *num, unsigned char **audio, size_t *bytes );
+
+/** Find, read and parse the next mp3 frame
+ * Warning: This is experimental API that might change in future releases!
+ * Please watch mpg123 development closely when using it.
+ * \param mh handle
+ * \return MPG123_OK or error/message code
+ */
+MPG123_EXPORT int mpg123_framebyframe_next(mpg123_handle *mh);
+
+/** Get access to the raw input data for the last parsed frame.
+ * This gives you a direct look (and write access) to the frame body data.
+ * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()).
+ * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present.
+ * You can provide NULL for a parameter pointer when you are not interested in the value.
+ *
+ * \param mh handle
+ * \param header the 4-byte MPEG header
+ * \param bodydata pointer to the frame body stored in the handle (without the header)
+ * \param bodybytes size of frame body in bytes (without the header)
+ * \return MPG123_OK if there was a yet un-decoded frame to get the
+ * data from, MPG123_BAD_HANDLE or MPG123_ERR otherwise (without further
+ * explanation, the error state of the mpg123_handle is not modified by
+ * this function).
+ */
+MPG123_EXPORT int mpg123_framedata( mpg123_handle *mh
+, unsigned long *header, unsigned char **bodydata, size_t *bodybytes );
+
+/** Get the input position (byte offset in stream) of the last parsed frame.
+ * This can be used for external seek index building, for example.
+ * It just returns the internally stored offset, regardless of validity --
+ * you ensure that a valid frame has been parsed before!
+ * \param mh handle
+ * \return byte offset in stream
+ */
+MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh);
+
+/*@}*/
+
+
+/** \defgroup mpg123_seek mpg123 position and seeking
+ *
+ * Functions querying and manipulating position in the decoded audio bitstream.
+ * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions.
+ * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-)
+ * The general usage is modelled after stdlib's ftell() and fseek().
+ * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h:
+ * - SEEK_SET: set position to (or near to) specified offset
+ * - SEEK_CUR: change position by offset from now
+ * - SEEK_END: set position to offset from end
+ *
+ * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise.
+ * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)!
+ * Short: When you care about the sample position, don't mess with those parameters;-)
+ * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it).
+ * And yet another caveat: If the stream is concatenated out of differing pieces (Frankenstein stream), seeking may suffer, too.
+ *
+ * @{
+ */
+
+/** Returns the current position in samples.
+ * On the next successful read, you'd get that sample.
+ * \param mh handle
+ * \return sample offset or MPG123_ERR (null handle)
+ */
+MPG123_EXPORT off_t mpg123_tell(mpg123_handle *mh);
+
+/** Returns the frame number that the next read will give you data from.
+ * \param mh handle
+ * \return frame offset or MPG123_ERR (null handle)
+ */
+MPG123_EXPORT off_t mpg123_tellframe(mpg123_handle *mh);
+
+/** Returns the current byte offset in the input stream.
+ * \param mh handle
+ * \return byte offset or MPG123_ERR (null handle)
+ */
+MPG123_EXPORT off_t mpg123_tell_stream(mpg123_handle *mh);
+
+/** Seek to a desired sample offset.
+ * Usage is modelled afer the standard lseek().
+ * \param mh handle
+ * \param sampleoff offset in PCM samples
+ * \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
+ * \return The resulting offset >= 0 or error/message code
+ */
+MPG123_EXPORT off_t mpg123_seek( mpg123_handle *mh
+, off_t sampleoff, int whence );
+
+/** Seek to a desired sample offset in data feeding mode.
+ * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position.
+ * \param mh handle
+ * \param sampleoff offset in PCM samples
+ * \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
+ * \param input_offset The position it expects to be at the
+ * next time data is fed to mpg123_decode().
+ * \return The resulting offset >= 0 or error/message code */
+MPG123_EXPORT off_t mpg123_feedseek( mpg123_handle *mh
+, off_t sampleoff, int whence, off_t *input_offset );
+
+/** Seek to a desired MPEG frame offset.
+ * Usage is modelled afer the standard lseek().
+ * \param mh handle
+ * \param frameoff offset in MPEG frames
+ * \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
+ * \return The resulting offset >= 0 or error/message code */
+MPG123_EXPORT off_t mpg123_seek_frame( mpg123_handle *mh
+, off_t frameoff, int whence );
+
+/** Return a MPEG frame offset corresponding to an offset in seconds.
+ * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only.
+ * \return frame offset >= 0 or error/message code */
+MPG123_EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec);
+
+/** Give access to the frame index table that is managed for seeking.
+ * You are asked not to modify the values... Use mpg123_set_index to set the
+ * seek index
+ * \param mh handle
+ * \param offsets pointer to the index array
+ * \param step one index byte offset advances this many MPEG frames
+ * \param fill number of recorded index offsets; size of the array
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_index( mpg123_handle *mh
+, off_t **offsets, off_t *step, size_t *fill );
+
+/** Set the frame index table
+ * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets
+ * to NULL and fill to 0 will clear the index and free the allocated memory used by the index.
+ * \param mh handle
+ * \param offsets pointer to the index array
+ * \param step one index byte offset advances this many MPEG frames
+ * \param fill number of recorded index offsets; size of the array
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_set_index( mpg123_handle *mh
+, off_t *offsets, off_t step, size_t fill );
+
+/** An old crutch to keep old mpg123 binaries happy.
+ * WARNING: This function is there only to avoid runtime linking errors with
+ * standalone mpg123 before version 1.23.0 (if you strangely update the
+ * library but not the end-user program) and actually is broken
+ * for various cases (p.ex. 24 bit output). Do never use. It might eventually
+ * be purged from the library.
+ */
+MPG123_EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left);
+
+/*@}*/
+
+
+/** \defgroup mpg123_voleq mpg123 volume and equalizer
+ *
+ * @{
+ */
+
+/** another channel enumeration, for left/right choice */
+enum mpg123_channels
+{
+ MPG123_LEFT=0x1 /**< The Left Channel. */
+ ,MPG123_RIGHT=0x2 /**< The Right Channel. */
+ ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */
+};
+
+/** Set the 32 Band Audio Equalizer settings.
+ * \param mh handle
+ * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both.
+ * \param band The equaliser band to change (from 0 to 31)
+ * \param val The (linear) adjustment factor.
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_eq( mpg123_handle *mh
+, enum mpg123_channels channel, int band, double val );
+
+/** Get the 32 Band Audio Equalizer settings.
+ * \param mh handle
+ * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both.
+ * \param band The equaliser band to change (from 0 to 31)
+ * \return The (linear) adjustment factor (zero for pad parameters) */
+MPG123_EXPORT double mpg123_geteq(mpg123_handle *mh
+ , enum mpg123_channels channel, int band);
+
+/** Reset the 32 Band Audio Equalizer settings to flat
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_reset_eq(mpg123_handle *mh);
+
+/** Set the absolute output volume including the RVA setting,
+ * vol<0 just applies (a possibly changed) RVA setting.
+ * \param mh handle
+ * \param vol volume value (linear factor)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_volume(mpg123_handle *mh, double vol);
+
+/** Adjust output volume including the RVA setting by chosen amount
+ * \param mh handle
+ * \param change volume value (linear factor increment)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_volume_change(mpg123_handle *mh, double change);
+
+/** Return current volume setting, the actual value due to RVA, and the RVA
+ * adjustment itself. It's all as double float value to abstract the sample
+ * format. The volume values are linear factors / amplitudes (not percent)
+ * and the RVA value is in decibels.
+ * \param mh handle
+ * \param base return address for base volume (linear factor)
+ * \param really return address for actual volume (linear factor)
+ * \param rva_db return address for RVA value (decibels)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db);
+
+/* TODO: Set some preamp in addition / to replace internal RVA handling? */
+
+/*@}*/
+
+
+/** \defgroup mpg123_status mpg123 status and information
+ *
+ * @{
+ */
+
+/** Enumeration of the mode types of Variable Bitrate */
+enum mpg123_vbr {
+ MPG123_CBR=0, /**< Constant Bitrate Mode (default) */
+ MPG123_VBR, /**< Variable Bitrate Mode */
+ MPG123_ABR /**< Average Bitrate Mode */
+};
+
+/** Enumeration of the MPEG Versions */
+enum mpg123_version {
+ MPG123_1_0=0, /**< MPEG Version 1.0 */
+ MPG123_2_0, /**< MPEG Version 2.0 */
+ MPG123_2_5 /**< MPEG Version 2.5 */
+};
+
+
+/** Enumeration of the MPEG Audio mode.
+ * Only the mono mode has 1 channel, the others have 2 channels. */
+enum mpg123_mode {
+ MPG123_M_STEREO=0, /**< Standard Stereo. */
+ MPG123_M_JOINT, /**< Joint Stereo. */
+ MPG123_M_DUAL, /**< Dual Channel. */
+ MPG123_M_MONO /**< Single Channel. */
+};
+
+
+/** Enumeration of the MPEG Audio flag bits */
+enum mpg123_flags {
+ MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */
+ MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */
+ MPG123_PRIVATE=0x4, /**< The private bit has been set. */
+ MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */
+};
+
+/** Data structure for storing information about a frame of MPEG Audio */
+struct mpg123_frameinfo
+{
+ enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */
+ int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */
+ long rate; /**< The sampling rate in Hz. */
+ enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */
+ int mode_ext; /**< The mode extension bit flag. */
+ int framesize; /**< The size of the frame (in bytes, including header). */
+ enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */
+ int emphasis; /**< The emphasis type. */
+ int bitrate; /**< Bitrate of the frame (kbps). */
+ int abr_rate; /**< The target average bitrate. */
+ enum mpg123_vbr vbr; /**< The VBR mode. */
+};
+
+/** Data structure for even more detailed information out of the decoder,
+ * for MPEG layer III only.
+ * This was added to support the frame analyzer by the Lame project and
+ * just follows what was used there before. You know what the fields mean
+ * if you want use this structure. */
+struct mpg123_moreinfo
+{
+ double xr[2][2][576];
+ double sfb[2][2][22]; /* [2][2][SBMAX_l] */
+ double sfb_s[2][2][3*13]; /* [2][2][3*SBMAX_s] */
+ int qss[2][2];
+ int big_values[2][2];
+ int sub_gain[2][2][3];
+ int scalefac_scale[2][2];
+ int preflag[2][2];
+ int blocktype[2][2];
+ int mixed[2][2];
+ int mainbits[2][2];
+ int sfbits[2][2];
+ int scfsi[2];
+ int maindata;
+ int padding;
+};
+
+/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure.
+ * \param mh handle
+ * \param mi address of existing frameinfo structure to write to
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi);
+
+/** Trigger collection of additional decoder information while decoding.
+ * \param mh handle
+ * \param mi pointer to data storage (NULL to disable collection)
+ * \return MPG123_OK if the collection was enabled/disabled as desired, MPG123_ERR
+ * otherwise (e.g. if the feature is disabled)
+ */
+MPG123_EXPORT int mpg123_set_moreinfo( mpg123_handle *mh
+, struct mpg123_moreinfo *mi );
+
+/** Get the safe output buffer size for all cases
+ * (when you want to replace the internal buffer)
+ * \return safe buffer size
+ */
+MPG123_EXPORT size_t mpg123_safe_buffer(void);
+
+/** Make a full parsing scan of each frame in the file. ID3 tags are found. An
+ * accurate length value is stored. Seek index will be filled. A seek back to
+ * current position is performed. At all, this function refuses work when
+ * stream is not seekable.
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_scan(mpg123_handle *mh);
+
+/** Return, if possible, the full (expected) length of current track in
+ * MPEG frames.
+ * \param mh handle
+ * \return length >= 0 or MPG123_ERR if there is no length guess possible.
+ */
+MPG123_EXPORT off_t mpg123_framelength(mpg123_handle *mh);
+
+/** Return, if possible, the full (expected) length of current
+ * track in samples (PCM frames).
+ *
+ * This relies either on an Info frame at the beginning or a previous
+ * call to mpg123_scan() to get the real number of MPEG frames in a
+ * file. It will guess based on file size if neither Info frame nor
+ * scan data are present. In any case, there is no guarantee that the
+ * decoder will not give you more data, for example in case the open
+ * file gets appended to during decoding.
+ * \param mh handle
+ * \return length >= 0 or MPG123_ERR if there is no length guess possible.
+ */
+MPG123_EXPORT off_t mpg123_length(mpg123_handle *mh);
+
+/** Override the value for file size in bytes.
+ * Useful for getting sensible track length values in feed mode or for HTTP streams.
+ * \param mh handle
+ * \param size file size in bytes
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size);
+
+/** Get MPEG frame duration in seconds.
+ * \param mh handle
+ * \return frame duration in seconds, <0 on error
+ */
+MPG123_EXPORT double mpg123_tpf(mpg123_handle *mh);
+
+/** Get MPEG frame duration in samples.
+ * \param mh handle
+ * \return samples per frame for the most recently parsed frame; <0 on errors
+ */
+MPG123_EXPORT int mpg123_spf(mpg123_handle *mh);
+
+/** Get and reset the clip count.
+ * \param mh handle
+ * \return count of clipped samples
+ */
+MPG123_EXPORT long mpg123_clip(mpg123_handle *mh);
+
+
+/** The key values for state information from mpg123_getstate(). */
+enum mpg123_state
+{
+ MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true). */
+ ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */
+ ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files. Seeking may yield unexpected results (also with MPG123_ACCURATE, it may be confused). */
+ ,MPG123_FRESH_DECODER /**< Decoder structure has been updated, possibly indicating changed stream (integer value, 0 if false, 1 if true). Flag is cleared after retrieval. */
+ ,MPG123_ENC_DELAY /** Encoder delay read from Info tag (layer III, -1 if unknown). */
+ ,MPG123_ENC_PADDING /** Encoder padding read from Info tag (layer III, -1 if unknown). */
+ ,MPG123_DEC_DELAY /** Decoder delay (for layer III only, -1 otherwise). */
+};
+
+/** Get various current decoder/stream state information.
+ * \param mh handle
+ * \param key the key to identify the information to give.
+ * \param val the address to return (long) integer values to
+ * \param fval the address to return floating point values to
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getstate( mpg123_handle *mh
+, enum mpg123_state key, long *val, double *fval );
+
+/*@}*/
+
+
+/** \defgroup mpg123_metadata mpg123 metadata handling
+ *
+ * Functions to retrieve the metadata from MPEG Audio files and streams.
+ * Also includes string handling functions.
+ *
+ * @{
+ */
+
+/** Data structure for storing strings in a safer way than a standard C-String.
+ * Can also hold a number of null-terminated strings. */
+typedef struct
+{
+ char* p; /**< pointer to the string data */
+ size_t size; /**< raw number of bytes allocated */
+ size_t fill; /**< number of used bytes (including closing zero byte) */
+} mpg123_string;
+
+/** Allocate and intialize a new string.
+ * \param val optional initial string value (can be NULL)
+ */
+MPG123_EXPORT mpg123_string* mpg123_new_string(const char* val);
+
+/** Free memory of contents and the string structure itself.
+ * \param sb string handle
+ */
+MPG123_EXPORT void mpg123_delete_string(mpg123_string* sb);
+
+/** Initialize an existing mpg123_string structure to {NULL, 0, 0}.
+ * If you hand in a NULL pointer here, your program should crash. The other
+ * string functions are more forgiving, but this one here is too basic.
+ * \param sb string handle (address of existing structure on your side)
+ */
+MPG123_EXPORT void mpg123_init_string(mpg123_string* sb);
+
+/** Free-up memory of the contents of an mpg123_string (not the struct itself).
+ * This also calls mpg123_init_string() and hence is safe to be called
+ * repeatedly.
+ * \param sb string handle
+ */
+MPG123_EXPORT void mpg123_free_string(mpg123_string* sb);
+
+/** Change the size of a mpg123_string
+ * \param sb string handle
+ * \param news new size in bytes
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news);
+
+/** Increase size of a mpg123_string if necessary (it may stay larger).
+ * Note that the functions for adding and setting in current libmpg123
+ * use this instead of mpg123_resize_string().
+ * That way, you can preallocate memory and safely work afterwards with
+ * pieces.
+ * \param sb string handle
+ * \param news new minimum size
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news);
+
+/** Copy the contents of one mpg123_string string to another.
+ * Yes the order of arguments is reversed compated to memcpy().
+ * \param from string handle
+ * \param to string handle
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to);
+
+/** Move the contents of one mpg123_string string to another.
+ * This frees any memory associated with the target and moves over the
+ * pointers from the source, leaving the source without content after
+ * that. The only possible error is that you hand in NULL pointers.
+ * If you handed in a valid source, its contents will be gone, even if
+ * there was no target to move to. If you hand in a valid target, its
+ * original contents will also always be gone, to be replaced with the
+ * source's contents if there was some.
+ * \param from source string handle
+ * \param to target string handle
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_move_string(mpg123_string* from, mpg123_string* to);
+
+/** Append a C-String to an mpg123_string
+ * \param sb string handle
+ * \param stuff to append
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff);
+
+/** Append a C-substring to an mpg123 string
+ * \param sb string handle
+ * \param stuff content to copy
+ * \param from offset to copy from
+ * \param count number of characters to copy (a null-byte is always appended)
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_add_substring( mpg123_string *sb
+, const char *stuff, size_t from, size_t count );
+
+/** Set the content of a mpg123_string to a C-string
+ * \param sb string handle
+ * \param stuff content to copy
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff);
+
+/** Set the content of a mpg123_string to a C-substring
+ * \param sb string handle
+ * \param stuff the future content
+ * \param from offset to copy from
+ * \param count number of characters to copy (a null-byte is always appended)
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_set_substring( mpg123_string *sb
+, const char *stuff, size_t from, size_t count );
+
+/** Count characters in a mpg123 string (non-null bytes or Unicode points).
+ * This function is of limited use, as it does just count code points
+ * encoded in an UTF-8 string, only loosely related to the count of visible
+ * characters. Get your full Unicode handling support elsewhere.
+ * \param sb string handle
+ * \param utf8 a flag to tell if the string is in utf8 encoding
+ * \return character count
+*/
+MPG123_EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8);
+
+/** Remove trailing \\r and \\n, if present.
+ * \param sb string handle
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_chomp_string(mpg123_string *sb);
+
+/** Determine if two strings contain the same data.
+ * This only returns 1 if both given handles are non-NULL and
+ * if they are filled with the same bytes.
+ * \param a first string handle
+ * \param b second string handle
+ * \return 0 for different strings, 1 for identical
+ */
+MPG123_EXPORT int mpg123_same_string(mpg123_string *a, mpg123_string *b);
+
+/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */
+enum mpg123_text_encoding
+{
+ mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */
+ ,mpg123_text_utf8 = 1 /**< UTF-8 */
+ ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */
+ ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */
+ ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */
+ ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules.
+ * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when
+ * you don't mess with the reserved code points. If you want to decode little endian data
+ * without BOM you need to prepend 0xff 0xfe yourself. */
+ ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */
+ ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality,
+ * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123
+ * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16
+ * types (we expect a BOM before real data there), not so for utf16be!*/
+ ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */
+};
+
+/** The encoding byte values from ID3v2. */
+enum mpg123_id3_enc
+{
+ mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */
+ ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */
+ ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */
+ ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */
+ ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */
+};
+
+/** Convert ID3 encoding byte to mpg123 encoding index.
+ * \param id3_enc_byte the ID3 encoding code
+ * \return the mpg123 encoding index
+ */
+
+MPG123_EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte);
+
+/** Store text data in string, after converting to UTF-8 from indicated encoding
+ * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing).
+ * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that).
+ * \param sb target string
+ * \param enc mpg123 text encoding value
+ * \param source source buffer with plain unsigned bytes (you might need to cast from signed char)
+ * \param source_size number of bytes in the source buffer
+ * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb)
+ */
+MPG123_EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size);
+
+/** Sub data structure for ID3v2, for storing various text fields (including comments).
+ * This is for ID3v2 COMM, TXXX and all the other text fields.
+ * Only COMM, TXXX and USLT may have a description, only COMM and USLT
+ * have a language.
+ * You should consult the ID3v2 specification for the use of the various text fields
+ * ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */
+typedef struct
+{
+ char lang[3]; /**< Three-letter language code (not terminated). */
+ char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */
+ mpg123_string description; /**< Empty for the generic comment... */
+ mpg123_string text; /**< ... */
+} mpg123_text;
+
+/** The picture type values from ID3v2. */
+enum mpg123_id3_pic_type
+{
+ mpg123_id3_pic_other = 0 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_icon = 1 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_other_icon = 2 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_front_cover = 3 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_back_cover = 4 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_leaflet = 5 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_media = 6 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_lead = 7 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_artist = 8 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_conductor = 9 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_orchestra = 10 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_composer = 11 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_lyricist = 12 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_location = 13 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_recording = 14 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_performance = 15 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_video = 16 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_fish = 17 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_illustration = 18 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_artist_logo = 19 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_publisher_logo = 20 /**< see ID3v2 docs */
+};
+
+/** Sub data structure for ID3v2, for storing picture data including comment.
+ * This is for the ID3v2 APIC field. You should consult the ID3v2 specification
+ * for the use of the APIC field ("frames" in ID3v2 documentation, I use "fields"
+ * here to separate from MPEG frames). */
+typedef struct
+{
+ char type; /**< mpg123_id3_pic_type value */
+ mpg123_string description; /**< description string */
+ mpg123_string mime_type; /**< MIME type */
+ size_t size; /**< size in bytes */
+ unsigned char* data; /**< pointer to the image data */
+} mpg123_picture;
+
+/** Data structure for storing IDV3v2 tags.
+ * This structure is not a direct binary mapping with the file contents.
+ * The ID3v2 text frames are allowed to contain multiple strings.
+ * So check for null bytes until you reach the mpg123_string fill.
+ * All text is encoded in UTF-8. */
+typedef struct
+{
+ unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */
+ mpg123_string *title; /**< Title string (pointer into text_list). */
+ mpg123_string *artist; /**< Artist string (pointer into text_list). */
+ mpg123_string *album; /**< Album string (pointer into text_list). */
+ mpg123_string *year; /**< The year as a string (pointer into text_list). */
+ mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */
+ mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */
+ /* Encountered ID3v2 fields are appended to these lists.
+ There can be multiple occurences, the pointers above always point to the last encountered data. */
+ mpg123_text *comment_list; /**< Array of comments. */
+ size_t comments; /**< Number of comments. */
+ mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */
+ size_t texts; /**< Numer of text fields. */
+ mpg123_text *extra; /**< The array of extra (TXXX) fields. */
+ size_t extras; /**< Number of extra text (TXXX) fields. */
+ mpg123_picture *picture; /**< Array of ID3v2 pictures fields (APIC).
+ Only populated if MPG123_PICTURE flag is set! */
+ size_t pictures; /**< Number of picture (APIC) fields. */
+} mpg123_id3v2;
+
+/** Data structure for ID3v1 tags (the last 128 bytes of a file).
+ * Don't take anything for granted (like string termination)!
+ * Also note the change ID3v1.1 did: comment[28] = 0; comment[29] = track_number
+ * It is your task to support ID3v1 only or ID3v1.1 ...*/
+typedef struct
+{
+ char tag[3]; /**< Always the string "TAG", the classic intro. */
+ char title[30]; /**< Title string. */
+ char artist[30]; /**< Artist string. */
+ char album[30]; /**< Album string. */
+ char year[4]; /**< Year string. */
+ char comment[30]; /**< Comment string. */
+ unsigned char genre; /**< Genre index. */
+} mpg123_id3v1;
+
+#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */
+#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */
+#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/
+#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */
+
+/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future).
+ * \param mh handle
+ * \return combination of flags, 0 on error (same as "nothing new")
+ */
+MPG123_EXPORT int mpg123_meta_check(mpg123_handle *mh);
+
+/** Clean up meta data storage (ID3v2 and ICY), freeing memory.
+ * \param mh handle
+ */
+MPG123_EXPORT void mpg123_meta_free(mpg123_handle *mh);
+
+/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call.
+ * v1 and/or v2 can be set to NULL when there is no corresponding data.
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_id3( mpg123_handle *mh
+, mpg123_id3v1 **v1, mpg123_id3v2 **v2 );
+
+/** Return pointers to and size of stored raw ID3 data if storage has
+ * been configured with MPG123_RAW_ID3 and stream parsing passed the
+ * metadata already. Null value with zero size is a possibility!
+ * The storage can change at any next API call.
+ * \param v1 address to store pointer to v1 tag
+ * \param v1_size size of v1 data in bytes
+ * \param v2 address to store pointer to v2 tag
+ * \param v2_size size of v2 data in bytes
+ * \return MPG123_OK or MPG123_ERR. Only on MPG123_OK the output
+ * values are set.
+ */
+MPG123_EXPORT int mpg123_id3_raw( mpg123_handle *mh
+, unsigned char **v1, size_t *v1_size
+, unsigned char **v2, size_t *v2_size );
+
+/** Point icy_meta to existing data structure wich may change on any next read/decode function call.
+ * \param mh handle
+ * \param icy_meta return address for ICY meta string (set to NULL if nothing there)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta);
+
+/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8.
+ * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) .
+ * \param icy_text The input data in ICY encoding
+ * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */
+MPG123_EXPORT char* mpg123_icy2utf8(const char* icy_text);
+
+
+/* @} */
+
+
+/** \defgroup mpg123_advpar mpg123 advanced parameter API
+ *
+ * Direct access to a parameter set without full handle around it.
+ * Possible uses:
+ * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE).
+ * - Use one set of parameters for multiple handles.
+ *
+ * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt()
+ * family) directly return a fully qualified mpg123 error code, the ones
+ * operating on full handles normally MPG123_OK or MPG123_ERR, storing the
+ * specific error code itseld inside the handle.
+ *
+ * @{
+ */
+
+/** Opaque structure for the libmpg123 decoder parameters. */
+struct mpg123_pars_struct;
+
+/** Opaque structure for the libmpg123 decoder parameters. */
+typedef struct mpg123_pars_struct mpg123_pars;
+
+/** Create a handle with preset parameters.
+ * \param mp parameter handle
+ * \param decoder decoder choice
+ * \param error error code return address
+ * \return mpg123 handle
+ */
+MPG123_EXPORT mpg123_handle *mpg123_parnew( mpg123_pars *mp
+, const char* decoder, int *error );
+
+/** Allocate memory for and return a pointer to a new mpg123_pars
+ * \param error error code return address
+ * \return new parameter handle
+ */
+MPG123_EXPORT mpg123_pars *mpg123_new_pars(int *error);
+
+/** Delete and free up memory used by a mpg123_pars data structure
+ * \param mp parameter handle
+ */
+MPG123_EXPORT void mpg123_delete_pars(mpg123_pars* mp);
+
+/** Configure mpg123 parameters to accept no output format at all,
+ * use before specifying supported formats with mpg123_format
+ * \param mp parameter handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_fmt_none(mpg123_pars *mp);
+
+/** Configure mpg123 parameters to accept all formats
+ * (also any custom rate you may set) -- this is default.
+ * \param mp parameter handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_fmt_all(mpg123_pars *mp);
+
+/** Set the audio format support of a mpg123_pars in detail:
+ * \param mp parameter handle
+ * \param rate The sample rate value (in Hertz).
+ * \param channels A combination of MPG123_STEREO and MPG123_MONO.
+ * \param encodings A combination of accepted encodings for rate and channels,
+ * p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no
+ * support).
+ * \return MPG123_OK on success
+*/
+MPG123_EXPORT int mpg123_fmt(mpg123_pars *mp
+, long rate, int channels, int encodings);
+
+/** Set the audio format support of a mpg123_pars in detail:
+ * \param mp parameter handle
+ * \param rate The sample rate value (in Hertz). Special value 0 means
+ * all rates (reason for this variant of mpg123_fmt).
+ * \param channels A combination of MPG123_STEREO and MPG123_MONO.
+ * \param encodings A combination of accepted encodings for rate and channels,
+ * p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no
+ * support).
+ * \return MPG123_OK on success
+*/
+MPG123_EXPORT int mpg123_fmt2(mpg123_pars *mp
+, long rate, int channels, int encodings);
+
+/** Check to see if a specific format at a specific rate is supported
+ * by mpg123_pars.
+ * \param mp parameter handle
+ * \param rate sampling rate
+ * \param encoding encoding
+ * \return 0 for no support (that includes invalid parameters), MPG123_STEREO,
+ * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */
+MPG123_EXPORT int mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding);
+
+/** Set a specific parameter, for a specific mpg123_pars, using a parameter
+ * type key chosen from the mpg123_parms enumeration, to the specified value.
+ * \param mp parameter handle
+ * \param type parameter choice
+ * \param value integer value
+ * \param fvalue floating point value
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_par( mpg123_pars *mp
+, enum mpg123_parms type, long value, double fvalue );
+
+/** Get a specific parameter, for a specific mpg123_pars.
+ * See the mpg123_parms enumeration for a list of available parameters.
+ * \param mp parameter handle
+ * \param type parameter choice
+ * \param value integer value return address
+ * \param fvalue floating point value return address
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getpar( mpg123_pars *mp
+, enum mpg123_parms type, long *value, double *fvalue);
+
+/* @} */
+
+
+/** \defgroup mpg123_lowio mpg123 low level I/O
+ * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket...
+ *
+ * @{ */
+
+/** Replace default internal buffer with user-supplied buffer.
+ * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio.
+ * Note that the required buffer size could be bigger than expected from output
+ * encoding if libmpg123 has to convert from primary decoder output (p.ex. 32 bit
+ * storage for 24 bit output).
+ *
+ * Note: The type of data changed to a void pointer in mpg123 1.26.0
+ * (API version 45).
+ *
+ * \param mh handle
+ * \param data pointer to user buffer
+ * \param size of buffer in bytes
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_replace_buffer(mpg123_handle *mh
+, void *data, size_t size);
+
+/** The max size of one frame's decoded output with current settings.
+ * Use that to determine an appropriate minimum buffer size for decoding one frame.
+ * \param mh handle
+ * \return maximum decoded data size in bytes
+ */
+MPG123_EXPORT size_t mpg123_outblock(mpg123_handle *mh);
+
+/** Replace low-level stream access functions; read and lseek as known in POSIX.
+ * You can use this to make any fancy file opening/closing yourself,
+ * using mpg123_open_fd() to set the file descriptor for your read/lseek
+ * (doesn't need to be a "real" file descriptor...).
+ * Setting a function to NULL means that the default internal read is
+ * used (active from next mpg123_open call on).
+ * Note: As it would be troublesome to mess with this while having a file open,
+ * this implies mpg123_close().
+ * \param mh handle
+ * \param r_read callback for reading (behaviour like POSIX read)
+ * \param r_lseek callback for seeking (like POSIX lseek)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_replace_reader( mpg123_handle *mh
+, ssize_t (*r_read) (int, void *, size_t)
+, off_t (*r_lseek)(int, off_t, int)
+);
+
+/** Replace I/O functions with your own ones operating on some kind of
+ * handle instead of integer descriptors.
+ * The handle is a void pointer, so you can pass any data you want...
+ * mpg123_open_handle() is the call you make to use the I/O defined here.
+ * There is no fallback to internal read/seek here.
+ * Note: As it would be troublesome to mess with this while having a file open,
+ * this mpg123_close() is implied here.
+ * \param mh handle
+ * \param r_read callback for reading (behaviour like POSIX read)
+ * \param r_lseek callback for seeking (like POSIX lseek)
+ * \param cleanup A callback to clean up an I/O handle on mpg123_close,
+ * can be NULL for none (you take care of cleaning your handles).
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_replace_reader_handle( mpg123_handle *mh
+, ssize_t (*r_read) (void *, void *, size_t)
+, off_t (*r_lseek)(void *, off_t, int)
+, void (*cleanup)(void*) );
+
+/* @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/mpg123.64/lib/libmpg123.lib b/mpg123.64/lib/libmpg123.lib
new file mode 100644
index 00000000..0b778c2b
--- /dev/null
+++ b/mpg123.64/lib/libmpg123.lib
Binary files differ
diff --git a/ogg b/ogg
new file mode 160000
+Subproject 1e8d7cce266df61afc9d35db0283bbacc0237ab
diff --git a/opus b/opus
new file mode 160000
+Subproject 8aa7767207b1e3633004c26aecbb67d1c511848
diff --git a/opusfile b/opusfile
new file mode 160000
+Subproject eb252537f374e30f7b68b84223c5a2303c05eca
diff --git a/premake5.lua b/premake5.lua
index 2331c0b3..c8190e15 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -6,10 +6,17 @@ newoption {
}
newoption {
- trigger = "glfwdir",
+ trigger = "glfwdir64",
value = "PATH",
description = "Directory of glfw",
- default = "glfw-3.3.2.bin.WIN32"
+ default = "glfw-3.3.2.bin.WIN64",
+}
+
+newoption {
+ trigger = "glfwdir32",
+ value = "PATH",
+ description = "Directory of glfw",
+ default = "glfw-3.3.2.bin.WIN32",
}
newoption {
@@ -17,6 +24,11 @@ newoption {
description = "Build and use librw from this solution"
}
+newoption {
+ trigger = "with-opus",
+ description = "Build with opus"
+}
+
if(_OPTIONS["with-librw"]) then
Librw = "librw"
else
@@ -54,6 +66,8 @@ workspace "re3"
"win-x86-RW33_d3d8-oal",
"win-x86-librw_d3d9-oal",
"win-x86-librw_gl3_glfw-oal",
+ "win-amd64-librw_d3d9-oal",
+ "win-amd64-librw_gl3_glfw-oal",
}
filter { "system:linux" }
@@ -88,16 +102,21 @@ workspace "re3"
filter { "platforms:*librw_d3d9*" }
defines { "RW_D3D9" }
if(not _OPTIONS["with-librw"]) then
- libdirs { path.join(Librw, "lib/win-x86-d3d9/%{cfg.buildcfg}") }
+ libdirs { path.join(Librw, "lib/win-%{getarch(cfg.architecture)}-d3d9/%{cfg.buildcfg}") }
end
filter "platforms:*librw_gl3_glfw*"
defines { "RW_GL3" }
- includedirs { path.join(_OPTIONS["glfwdir"], "include") }
includedirs { path.join(_OPTIONS["glewdir"], "include") }
if(not _OPTIONS["with-librw"]) then
libdirs { path.join(Librw, "lib/%{getsys(cfg.system)}-%{getarch(cfg.architecture)}-gl3/%{cfg.buildcfg}") }
end
+
+ filter "platforms:*x86-librw_gl3_glfw*"
+ includedirs { path.join(_OPTIONS["glfwdir32"], "include") }
+
+ filter "platforms:*amd64-librw_gl3_glfw*"
+ includedirs { path.join(_OPTIONS["glfwdir64"], "include") }
filter "platforms:win*librw_gl3_glfw*"
defines { "GLEW_STATIC" }
@@ -144,7 +163,8 @@ project "re3"
files { addSrcFiles("src") }
files { addSrcFiles("src/animation") }
- files { addSrcFiles("src/audio") }
+ files { addSrcFiles("src/audio") }
+ files { addSrcFiles("src/audio/eax") }
files { addSrcFiles("src/audio/oal") }
files { addSrcFiles("src/control") }
files { addSrcFiles("src/core") }
@@ -162,11 +182,11 @@ project "re3"
files { addSrcFiles("src/vehicles") }
files { addSrcFiles("src/weapons") }
files { addSrcFiles("src/extras") }
- files { addSrcFiles("eax") }
includedirs { "src" }
includedirs { "src/animation" }
- includedirs { "src/audio" }
+ includedirs { "src/audio" }
+ includedirs { "src/audio/eax" }
includedirs { "src/audio/oal" }
includedirs { "src/control" }
includedirs { "src/core" }
@@ -184,12 +204,26 @@ project "re3"
includedirs { "src/vehicles" }
includedirs { "src/weapons" }
includedirs { "src/extras" }
- includedirs { "eax" }
+ if _OPTIONS["with-opus"] then
+ includedirs { "ogg/include" }
+ includedirs { "opus/include" }
+ includedirs { "opusfile/include" }
+ end
+
filter "platforms:*mss"
defines { "AUDIO_MSS" }
- includedirs { "milessdk/include" }
- libdirs { "milessdk/lib" }
+ includedirs { "sdk/milessdk/include" }
+ libdirs { "sdk/milessdk/lib" }
+
+ if _OPTIONS["with-opus"] then
+ filter "platforms:win*"
+ libdirs { "ogg/win32/VS2015/Win32/%{cfg.buildcfg}" }
+ libdirs { "opus/win32/VS2015/Win32/%{cfg.buildcfg}" }
+ libdirs { "opusfile/win32/VS2015/Win32/Release-NoHTTP" }
+ filter {}
+ defines { "AUDIO_OPUS" }
+ end
filter "platforms:*oal"
defines { "AUDIO_OAL" }
@@ -205,22 +239,37 @@ project "re3"
linkoptions "/SAFESEH:NO"
characterset ("MBCS")
targetextension ".exe"
-
- filter "platforms:win*oal"
+
+ filter "platforms:win-x86*oal"
includedirs { "openal-soft/include" }
- includedirs { "libsndfile/include" }
- includedirs { "mpg123/include" }
+ includedirs { "libsndfile.32/include" }
+ includedirs { "mpg123.32/include" }
+ libdirs { "mpg123.32/lib" }
+ libdirs { "libsndfile.32/lib" }
libdirs { "openal-soft/libs/Win32" }
- libdirs { "libsndfile/lib" }
- libdirs { "mpg123/lib" }
+
+ filter "platforms:win-amd64*oal"
+ includedirs { "openal-soft/include" }
+ includedirs { "libsndfile.64/include" }
+ includedirs { "mpg123.64/include" }
+ libdirs { "mpg123.64/lib" }
+ libdirs { "libsndfile.64/lib" }
+ libdirs { "openal-soft/libs/Win64" }
filter "platforms:linux*oal"
links { "openal", "mpg123", "sndfile", "pthread" }
+
+ if _OPTIONS["with-opus"] then
+ filter {}
+ links { "libogg" }
+ links { "opus" }
+ links { "opusfile" }
+ end
filter "platforms:*RW33*"
staticruntime "on"
- includedirs { "rwsdk/include/d3d8" }
- libdirs { "rwsdk/lib/d3d8/release" }
+ includedirs { "sdk/rwsdk/include/d3d8" }
+ libdirs { "sdk/rwsdk/lib/d3d8/release" }
links { "rwcore", "rpworld", "rpmatfx", "rpskin", "rphanim", "rtbmp", "rtquat", "rtcharse" }
defines { "RWLIBS" }
linkoptions "/SECTION:_rwcseg,ER!W /MERGE:_rwcseg=.text"
@@ -235,16 +284,24 @@ project "re3"
end
links { "rw" }
- filter "platforms:*d3d*"
- includedirs { "dxsdk/include" }
- libdirs { "dxsdk/lib" }
-
filter "platforms:*d3d9*"
links { "d3d9" }
- filter "platforms:win*gl3_glfw*"
+ filter "platforms:*x86*d3d*"
+ includedirs { "sdk/dx8sdk/include" }
+ libdirs { "sdk/dx8sdk/lib" }
+
+ filter "platforms:*amd64*d3d9*"
+ defines { "USE_D3D9" }
+
+ filter "platforms:win-x86*gl3_glfw*"
libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/Win32") }
- libdirs { path.join(_OPTIONS["glfwdir"], "lib-" .. string.gsub(_ACTION or '', "vs", "vc")) }
+ libdirs { path.join(_OPTIONS["glfwdir32"], "lib-" .. string.gsub(_ACTION or '', "vs", "vc")) }
+ links { "opengl32", "glew32s", "glfw3" }
+
+ filter "platforms:win-amd64*gl3_glfw*"
+ libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/x64") }
+ libdirs { path.join(_OPTIONS["glfwdir64"], "lib-" .. string.gsub(_ACTION or '', "vs", "vc")) }
links { "opengl32", "glew32s", "glfw3" }
filter "platforms:linux*gl3_glfw*"
diff --git a/dxsdk/Include/Amvideo.h b/sdk/dx8sdk/Include/Amvideo.h
index 89339266..89339266 100644
--- a/dxsdk/Include/Amvideo.h
+++ b/sdk/dx8sdk/Include/Amvideo.h
diff --git a/dxsdk/Include/Bdatif.h b/sdk/dx8sdk/Include/Bdatif.h
index 9ea62f09..9ea62f09 100644
--- a/dxsdk/Include/Bdatif.h
+++ b/sdk/dx8sdk/Include/Bdatif.h
diff --git a/dxsdk/Include/DShow.h b/sdk/dx8sdk/Include/DShow.h
index 54b6fbfb..54b6fbfb 100644
--- a/dxsdk/Include/DShow.h
+++ b/sdk/dx8sdk/Include/DShow.h
diff --git a/dxsdk/Include/DShowIDL/Bdatif.idl b/sdk/dx8sdk/Include/DShowIDL/Bdatif.idl
index bc94db40..bc94db40 100644
--- a/dxsdk/Include/DShowIDL/Bdatif.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/Bdatif.idl
diff --git a/dxsdk/Include/DShowIDL/Mpeg2Data.idl b/sdk/dx8sdk/Include/DShowIDL/Mpeg2Data.idl
index 6762c49c..6762c49c 100644
--- a/dxsdk/Include/DShowIDL/Mpeg2Data.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/Mpeg2Data.idl
diff --git a/dxsdk/Include/DShowIDL/Mpeg2Structs.idl b/sdk/dx8sdk/Include/DShowIDL/Mpeg2Structs.idl
index e04353f4..e04353f4 100644
--- a/dxsdk/Include/DShowIDL/Mpeg2Structs.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/Mpeg2Structs.idl
diff --git a/dxsdk/Include/DShowIDL/Mstvca.idl b/sdk/dx8sdk/Include/DShowIDL/Mstvca.idl
index a9b257d8..a9b257d8 100644
--- a/dxsdk/Include/DShowIDL/Mstvca.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/Mstvca.idl
diff --git a/dxsdk/Include/DShowIDL/Mstvgs.idl b/sdk/dx8sdk/Include/DShowIDL/Mstvgs.idl
index 7ce83f13..7ce83f13 100644
--- a/dxsdk/Include/DShowIDL/Mstvgs.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/Mstvgs.idl
diff --git a/dxsdk/Include/DShowIDL/Msvidctl.idl b/sdk/dx8sdk/Include/DShowIDL/Msvidctl.idl
index d1a4d94e..d1a4d94e 100644
--- a/dxsdk/Include/DShowIDL/Msvidctl.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/Msvidctl.idl
diff --git a/dxsdk/Include/DShowIDL/Segment.idl b/sdk/dx8sdk/Include/DShowIDL/Segment.idl
index a9895cbd..a9895cbd 100644
--- a/dxsdk/Include/DShowIDL/Segment.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/Segment.idl
diff --git a/dxsdk/Include/DShowIDL/Videoacc.idl b/sdk/dx8sdk/Include/DShowIDL/Videoacc.idl
index 6c55aa73..6c55aa73 100644
--- a/dxsdk/Include/DShowIDL/Videoacc.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/Videoacc.idl
diff --git a/dxsdk/Include/DShowIDL/Vmrender.idl b/sdk/dx8sdk/Include/DShowIDL/Vmrender.idl
index ed5e50ec..ed5e50ec 100644
--- a/dxsdk/Include/DShowIDL/Vmrender.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/Vmrender.idl
diff --git a/dxsdk/Include/DShowIDL/amstream.idl b/sdk/dx8sdk/Include/DShowIDL/amstream.idl
index f52db99e..f52db99e 100644
--- a/dxsdk/Include/DShowIDL/amstream.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/amstream.idl
diff --git a/dxsdk/Include/DShowIDL/austream.idl b/sdk/dx8sdk/Include/DShowIDL/austream.idl
index 4987aa08..4987aa08 100644
--- a/dxsdk/Include/DShowIDL/austream.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/austream.idl
diff --git a/dxsdk/Include/DShowIDL/axcore.idl b/sdk/dx8sdk/Include/DShowIDL/axcore.idl
index 4aceea78..4aceea78 100644
--- a/dxsdk/Include/DShowIDL/axcore.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/axcore.idl
diff --git a/dxsdk/Include/DShowIDL/axextend.idl b/sdk/dx8sdk/Include/DShowIDL/axextend.idl
index 257fb19a..257fb19a 100644
--- a/dxsdk/Include/DShowIDL/axextend.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/axextend.idl
diff --git a/dxsdk/Include/DShowIDL/bdaiface.idl b/sdk/dx8sdk/Include/DShowIDL/bdaiface.idl
index e1d27ca9..e1d27ca9 100644
--- a/dxsdk/Include/DShowIDL/bdaiface.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/bdaiface.idl
diff --git a/dxsdk/Include/DShowIDL/control.odl b/sdk/dx8sdk/Include/DShowIDL/control.odl
index 4fba88cf..4fba88cf 100644
--- a/dxsdk/Include/DShowIDL/control.odl
+++ b/sdk/dx8sdk/Include/DShowIDL/control.odl
diff --git a/dxsdk/Include/DShowIDL/ddstream.idl b/sdk/dx8sdk/Include/DShowIDL/ddstream.idl
index 30fa0475..30fa0475 100644
--- a/dxsdk/Include/DShowIDL/ddstream.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/ddstream.idl
diff --git a/dxsdk/Include/DShowIDL/devenum.idl b/sdk/dx8sdk/Include/DShowIDL/devenum.idl
index 257193f4..257193f4 100644
--- a/dxsdk/Include/DShowIDL/devenum.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/devenum.idl
diff --git a/dxsdk/Include/DShowIDL/dmodshow.idl b/sdk/dx8sdk/Include/DShowIDL/dmodshow.idl
index 246f5ae6..246f5ae6 100644
--- a/dxsdk/Include/DShowIDL/dmodshow.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/dmodshow.idl
diff --git a/dxsdk/Include/DShowIDL/dshowasf.idl b/sdk/dx8sdk/Include/DShowIDL/dshowasf.idl
index 8add5111..8add5111 100644
--- a/dxsdk/Include/DShowIDL/dshowasf.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/dshowasf.idl
diff --git a/dxsdk/Include/DShowIDL/dvdif.idl b/sdk/dx8sdk/Include/DShowIDL/dvdif.idl
index 4ad2bca1..4ad2bca1 100644
--- a/dxsdk/Include/DShowIDL/dvdif.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/dvdif.idl
diff --git a/dxsdk/Include/DShowIDL/dxtrans.idl b/sdk/dx8sdk/Include/DShowIDL/dxtrans.idl
index 6395d325..6395d325 100644
--- a/dxsdk/Include/DShowIDL/dxtrans.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/dxtrans.idl
diff --git a/dxsdk/Include/DShowIDL/dyngraph.idl b/sdk/dx8sdk/Include/DShowIDL/dyngraph.idl
index 569def6e..569def6e 100644
--- a/dxsdk/Include/DShowIDL/dyngraph.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/dyngraph.idl
diff --git a/dxsdk/Include/DShowIDL/mediaobj.idl b/sdk/dx8sdk/Include/DShowIDL/mediaobj.idl
index 6852ced9..6852ced9 100644
--- a/dxsdk/Include/DShowIDL/mediaobj.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/mediaobj.idl
diff --git a/dxsdk/Include/DShowIDL/medparam.idl b/sdk/dx8sdk/Include/DShowIDL/medparam.idl
index b45eab97..b45eab97 100644
--- a/dxsdk/Include/DShowIDL/medparam.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/medparam.idl
diff --git a/dxsdk/Include/DShowIDL/mixerocx.idl b/sdk/dx8sdk/Include/DShowIDL/mixerocx.idl
index 5e45b459..5e45b459 100644
--- a/dxsdk/Include/DShowIDL/mixerocx.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/mixerocx.idl
diff --git a/dxsdk/Include/DShowIDL/mmstream.idl b/sdk/dx8sdk/Include/DShowIDL/mmstream.idl
index b94f1ed1..b94f1ed1 100644
--- a/dxsdk/Include/DShowIDL/mmstream.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/mmstream.idl
diff --git a/dxsdk/Include/DShowIDL/mstve.idl b/sdk/dx8sdk/Include/DShowIDL/mstve.idl
index 07383041..07383041 100644
--- a/dxsdk/Include/DShowIDL/mstve.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/mstve.idl
diff --git a/dxsdk/Include/DShowIDL/qedit.idl b/sdk/dx8sdk/Include/DShowIDL/qedit.idl
index b75a3e35..b75a3e35 100644
--- a/dxsdk/Include/DShowIDL/qedit.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/qedit.idl
diff --git a/dxsdk/Include/DShowIDL/regbag.idl b/sdk/dx8sdk/Include/DShowIDL/regbag.idl
index 103aff17..103aff17 100644
--- a/dxsdk/Include/DShowIDL/regbag.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/regbag.idl
diff --git a/dxsdk/Include/DShowIDL/sbe.idl b/sdk/dx8sdk/Include/DShowIDL/sbe.idl
index 246b148c..246b148c 100644
--- a/dxsdk/Include/DShowIDL/sbe.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/sbe.idl
diff --git a/dxsdk/Include/DShowIDL/strmif.idl b/sdk/dx8sdk/Include/DShowIDL/strmif.idl
index 87da1d8b..87da1d8b 100644
--- a/dxsdk/Include/DShowIDL/strmif.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/strmif.idl
diff --git a/dxsdk/Include/DShowIDL/tuner.idl b/sdk/dx8sdk/Include/DShowIDL/tuner.idl
index 75f1beb4..75f1beb4 100644
--- a/dxsdk/Include/DShowIDL/tuner.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/tuner.idl
diff --git a/dxsdk/Include/DShowIDL/tvratings.idl b/sdk/dx8sdk/Include/DShowIDL/tvratings.idl
index 5bf80214..5bf80214 100644
--- a/dxsdk/Include/DShowIDL/tvratings.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/tvratings.idl
diff --git a/dxsdk/Include/DShowIDL/vidcap.idl b/sdk/dx8sdk/Include/DShowIDL/vidcap.idl
index 523bfde3..523bfde3 100644
--- a/dxsdk/Include/DShowIDL/vidcap.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/vidcap.idl
diff --git a/dxsdk/Include/DShowIDL/vmr9.idl b/sdk/dx8sdk/Include/DShowIDL/vmr9.idl
index ae9245f2..ae9245f2 100644
--- a/dxsdk/Include/DShowIDL/vmr9.idl
+++ b/sdk/dx8sdk/Include/DShowIDL/vmr9.idl
diff --git a/dxsdk/Include/DxDiag.h b/sdk/dx8sdk/Include/DxDiag.h
index 602c88f0..602c88f0 100644
--- a/dxsdk/Include/DxDiag.h
+++ b/sdk/dx8sdk/Include/DxDiag.h
diff --git a/dxsdk/Include/Iwstdec.h b/sdk/dx8sdk/Include/Iwstdec.h
index 40007a86..40007a86 100644
--- a/dxsdk/Include/Iwstdec.h
+++ b/sdk/dx8sdk/Include/Iwstdec.h
diff --git a/dxsdk/Include/Mpeg2Bits.h b/sdk/dx8sdk/Include/Mpeg2Bits.h
index 45debbb6..45debbb6 100644
--- a/dxsdk/Include/Mpeg2Bits.h
+++ b/sdk/dx8sdk/Include/Mpeg2Bits.h
diff --git a/dxsdk/Include/Mpeg2Error.h b/sdk/dx8sdk/Include/Mpeg2Error.h
index e2731fb3..e2731fb3 100644
--- a/dxsdk/Include/Mpeg2Error.h
+++ b/sdk/dx8sdk/Include/Mpeg2Error.h
diff --git a/dxsdk/Include/Mstvca.h b/sdk/dx8sdk/Include/Mstvca.h
index b840f3e4..b840f3e4 100644
--- a/dxsdk/Include/Mstvca.h
+++ b/sdk/dx8sdk/Include/Mstvca.h
diff --git a/dxsdk/Include/Mstve.h b/sdk/dx8sdk/Include/Mstve.h
index 4cee53a6..4cee53a6 100644
--- a/dxsdk/Include/Mstve.h
+++ b/sdk/dx8sdk/Include/Mstve.h
diff --git a/dxsdk/Include/Msvidctl.h b/sdk/dx8sdk/Include/Msvidctl.h
index 82e1e1e3..82e1e1e3 100644
--- a/dxsdk/Include/Msvidctl.h
+++ b/sdk/dx8sdk/Include/Msvidctl.h
diff --git a/dxsdk/Include/PixPlugin.h b/sdk/dx8sdk/Include/PixPlugin.h
index 4825cd3a..4825cd3a 100644
--- a/dxsdk/Include/PixPlugin.h
+++ b/sdk/dx8sdk/Include/PixPlugin.h
diff --git a/dxsdk/Include/Segment.h b/sdk/dx8sdk/Include/Segment.h
index da51f252..da51f252 100644
--- a/dxsdk/Include/Segment.h
+++ b/sdk/dx8sdk/Include/Segment.h
diff --git a/dxsdk/Include/activecf.h b/sdk/dx8sdk/Include/activecf.h
index 5efd8cfc..5efd8cfc 100644
--- a/dxsdk/Include/activecf.h
+++ b/sdk/dx8sdk/Include/activecf.h
diff --git a/dxsdk/Include/amaudio.h b/sdk/dx8sdk/Include/amaudio.h
index cd6d0532..cd6d0532 100644
--- a/dxsdk/Include/amaudio.h
+++ b/sdk/dx8sdk/Include/amaudio.h
diff --git a/dxsdk/Include/amparse.h b/sdk/dx8sdk/Include/amparse.h
index ce7a388d..ce7a388d 100644
--- a/dxsdk/Include/amparse.h
+++ b/sdk/dx8sdk/Include/amparse.h
diff --git a/dxsdk/Include/amstream.h b/sdk/dx8sdk/Include/amstream.h
index 421fb80e..421fb80e 100644
--- a/dxsdk/Include/amstream.h
+++ b/sdk/dx8sdk/Include/amstream.h
diff --git a/dxsdk/Include/amva.h b/sdk/dx8sdk/Include/amva.h
index fd46164f..fd46164f 100644
--- a/dxsdk/Include/amva.h
+++ b/sdk/dx8sdk/Include/amva.h
diff --git a/dxsdk/Include/atsmedia.h b/sdk/dx8sdk/Include/atsmedia.h
index 3e268a55..3e268a55 100644
--- a/dxsdk/Include/atsmedia.h
+++ b/sdk/dx8sdk/Include/atsmedia.h
diff --git a/dxsdk/Include/audevcod.h b/sdk/dx8sdk/Include/audevcod.h
index 98dfbfc2..98dfbfc2 100644
--- a/dxsdk/Include/audevcod.h
+++ b/sdk/dx8sdk/Include/audevcod.h
diff --git a/dxsdk/Include/austream.h b/sdk/dx8sdk/Include/austream.h
index b6ed5c27..b6ed5c27 100644
--- a/dxsdk/Include/austream.h
+++ b/sdk/dx8sdk/Include/austream.h
diff --git a/dxsdk/Include/aviriff.h b/sdk/dx8sdk/Include/aviriff.h
index 5ba2990c..5ba2990c 100644
--- a/dxsdk/Include/aviriff.h
+++ b/sdk/dx8sdk/Include/aviriff.h
diff --git a/dxsdk/Include/bdaiface.h b/sdk/dx8sdk/Include/bdaiface.h
index 5b149029..5b149029 100644
--- a/dxsdk/Include/bdaiface.h
+++ b/sdk/dx8sdk/Include/bdaiface.h
diff --git a/dxsdk/Include/bdamedia.h b/sdk/dx8sdk/Include/bdamedia.h
index 92389192..92389192 100644
--- a/dxsdk/Include/bdamedia.h
+++ b/sdk/dx8sdk/Include/bdamedia.h
diff --git a/dxsdk/Include/bdatypes.h b/sdk/dx8sdk/Include/bdatypes.h
index 2c44f1ba..2c44f1ba 100644
--- a/dxsdk/Include/bdatypes.h
+++ b/sdk/dx8sdk/Include/bdatypes.h
diff --git a/dxsdk/Include/comlite.h b/sdk/dx8sdk/Include/comlite.h
index 5fc91932..5fc91932 100644
--- a/dxsdk/Include/comlite.h
+++ b/sdk/dx8sdk/Include/comlite.h
diff --git a/dxsdk/Include/control.h b/sdk/dx8sdk/Include/control.h
index 906fbc4f..906fbc4f 100644
--- a/dxsdk/Include/control.h
+++ b/sdk/dx8sdk/Include/control.h
diff --git a/dxsdk/Include/d3d.h b/sdk/dx8sdk/Include/d3d.h
index eea7dff4..eea7dff4 100644
--- a/dxsdk/Include/d3d.h
+++ b/sdk/dx8sdk/Include/d3d.h
diff --git a/dxsdk/Include/d3d8.h b/sdk/dx8sdk/Include/d3d8.h
index adf91ebf..adf91ebf 100644
--- a/dxsdk/Include/d3d8.h
+++ b/sdk/dx8sdk/Include/d3d8.h
diff --git a/dxsdk/Include/d3d8caps.h b/sdk/dx8sdk/Include/d3d8caps.h
index 6af8e6c4..6af8e6c4 100644
--- a/dxsdk/Include/d3d8caps.h
+++ b/sdk/dx8sdk/Include/d3d8caps.h
diff --git a/dxsdk/Include/d3d8types.h b/sdk/dx8sdk/Include/d3d8types.h
index 5d622af4..5d622af4 100644
--- a/dxsdk/Include/d3d8types.h
+++ b/sdk/dx8sdk/Include/d3d8types.h
diff --git a/dxsdk/Include/d3d9.h b/sdk/dx8sdk/Include/d3d9.h
index 85bd9579..85bd9579 100644
--- a/dxsdk/Include/d3d9.h
+++ b/sdk/dx8sdk/Include/d3d9.h
diff --git a/dxsdk/Include/d3d9caps.h b/sdk/dx8sdk/Include/d3d9caps.h
index 6489f0ef..6489f0ef 100644
--- a/dxsdk/Include/d3d9caps.h
+++ b/sdk/dx8sdk/Include/d3d9caps.h
diff --git a/dxsdk/Include/d3d9types.h b/sdk/dx8sdk/Include/d3d9types.h
index 4c2108fd..4c2108fd 100644
--- a/dxsdk/Include/d3d9types.h
+++ b/sdk/dx8sdk/Include/d3d9types.h
diff --git a/dxsdk/Include/d3dcaps.h b/sdk/dx8sdk/Include/d3dcaps.h
index 6066c7ab..6066c7ab 100644
--- a/dxsdk/Include/d3dcaps.h
+++ b/sdk/dx8sdk/Include/d3dcaps.h
diff --git a/dxsdk/Include/d3drm.h b/sdk/dx8sdk/Include/d3drm.h
index 143c0e05..143c0e05 100644
--- a/dxsdk/Include/d3drm.h
+++ b/sdk/dx8sdk/Include/d3drm.h
diff --git a/dxsdk/Include/d3drmdef.h b/sdk/dx8sdk/Include/d3drmdef.h
index 9da4b18a..9da4b18a 100644
--- a/dxsdk/Include/d3drmdef.h
+++ b/sdk/dx8sdk/Include/d3drmdef.h
diff --git a/dxsdk/Include/d3drmobj.h b/sdk/dx8sdk/Include/d3drmobj.h
index 45ad81dd..45ad81dd 100644
--- a/dxsdk/Include/d3drmobj.h
+++ b/sdk/dx8sdk/Include/d3drmobj.h
diff --git a/dxsdk/Include/d3drmwin.h b/sdk/dx8sdk/Include/d3drmwin.h
index d051ef48..d051ef48 100644
--- a/dxsdk/Include/d3drmwin.h
+++ b/sdk/dx8sdk/Include/d3drmwin.h
diff --git a/dxsdk/Include/d3dtypes.h b/sdk/dx8sdk/Include/d3dtypes.h
index 79490418..79490418 100644
--- a/dxsdk/Include/d3dtypes.h
+++ b/sdk/dx8sdk/Include/d3dtypes.h
diff --git a/dxsdk/Include/d3dvec.inl b/sdk/dx8sdk/Include/d3dvec.inl
index ff7fdfea..ff7fdfea 100644
--- a/dxsdk/Include/d3dvec.inl
+++ b/sdk/dx8sdk/Include/d3dvec.inl
diff --git a/dxsdk/Include/d3dx.h b/sdk/dx8sdk/Include/d3dx.h
index 7a511e3f..7a511e3f 100644
--- a/dxsdk/Include/d3dx.h
+++ b/sdk/dx8sdk/Include/d3dx.h
diff --git a/dxsdk/Include/d3dx8.h b/sdk/dx8sdk/Include/d3dx8.h
index 31927a27..31927a27 100644
--- a/dxsdk/Include/d3dx8.h
+++ b/sdk/dx8sdk/Include/d3dx8.h
diff --git a/dxsdk/Include/d3dx8core.h b/sdk/dx8sdk/Include/d3dx8core.h
index 46552a95..46552a95 100644
--- a/dxsdk/Include/d3dx8core.h
+++ b/sdk/dx8sdk/Include/d3dx8core.h
diff --git a/dxsdk/Include/d3dx8effect.h b/sdk/dx8sdk/Include/d3dx8effect.h
index 97c44df9..97c44df9 100644
--- a/dxsdk/Include/d3dx8effect.h
+++ b/sdk/dx8sdk/Include/d3dx8effect.h
diff --git a/dxsdk/Include/d3dx8math.h b/sdk/dx8sdk/Include/d3dx8math.h
index 9c8f2030..9c8f2030 100644
--- a/dxsdk/Include/d3dx8math.h
+++ b/sdk/dx8sdk/Include/d3dx8math.h
diff --git a/dxsdk/Include/d3dx8math.inl b/sdk/dx8sdk/Include/d3dx8math.inl
index a64e5c54..a64e5c54 100644
--- a/dxsdk/Include/d3dx8math.inl
+++ b/sdk/dx8sdk/Include/d3dx8math.inl
diff --git a/dxsdk/Include/d3dx8mesh.h b/sdk/dx8sdk/Include/d3dx8mesh.h
index 5408cd31..5408cd31 100644
--- a/dxsdk/Include/d3dx8mesh.h
+++ b/sdk/dx8sdk/Include/d3dx8mesh.h
diff --git a/dxsdk/Include/d3dx8shape.h b/sdk/dx8sdk/Include/d3dx8shape.h
index b7ab6378..b7ab6378 100644
--- a/dxsdk/Include/d3dx8shape.h
+++ b/sdk/dx8sdk/Include/d3dx8shape.h
diff --git a/dxsdk/Include/d3dx8tex.h b/sdk/dx8sdk/Include/d3dx8tex.h
index dd9fe9d0..dd9fe9d0 100644
--- a/dxsdk/Include/d3dx8tex.h
+++ b/sdk/dx8sdk/Include/d3dx8tex.h
diff --git a/dxsdk/Include/d3dx9.h b/sdk/dx8sdk/Include/d3dx9.h
index 822f0a81..822f0a81 100644
--- a/dxsdk/Include/d3dx9.h
+++ b/sdk/dx8sdk/Include/d3dx9.h
diff --git a/dxsdk/Include/d3dx9anim.h b/sdk/dx8sdk/Include/d3dx9anim.h
index fedb1dbe..fedb1dbe 100644
--- a/dxsdk/Include/d3dx9anim.h
+++ b/sdk/dx8sdk/Include/d3dx9anim.h
diff --git a/dxsdk/Include/d3dx9core.h b/sdk/dx8sdk/Include/d3dx9core.h
index bc65377c..bc65377c 100644
--- a/dxsdk/Include/d3dx9core.h
+++ b/sdk/dx8sdk/Include/d3dx9core.h
diff --git a/dxsdk/Include/d3dx9effect.h b/sdk/dx8sdk/Include/d3dx9effect.h
index 3359a1d5..3359a1d5 100644
--- a/dxsdk/Include/d3dx9effect.h
+++ b/sdk/dx8sdk/Include/d3dx9effect.h
diff --git a/dxsdk/Include/d3dx9math.h b/sdk/dx8sdk/Include/d3dx9math.h
index 2ba4a606..2ba4a606 100644
--- a/dxsdk/Include/d3dx9math.h
+++ b/sdk/dx8sdk/Include/d3dx9math.h
diff --git a/dxsdk/Include/d3dx9math.inl b/sdk/dx8sdk/Include/d3dx9math.inl
index ecf52f96..ecf52f96 100644
--- a/dxsdk/Include/d3dx9math.inl
+++ b/sdk/dx8sdk/Include/d3dx9math.inl
diff --git a/dxsdk/Include/d3dx9mesh.h b/sdk/dx8sdk/Include/d3dx9mesh.h
index ba2bd47d..ba2bd47d 100644
--- a/dxsdk/Include/d3dx9mesh.h
+++ b/sdk/dx8sdk/Include/d3dx9mesh.h
diff --git a/dxsdk/Include/d3dx9shader.h b/sdk/dx8sdk/Include/d3dx9shader.h
index cae915a7..cae915a7 100644
--- a/dxsdk/Include/d3dx9shader.h
+++ b/sdk/dx8sdk/Include/d3dx9shader.h
diff --git a/dxsdk/Include/d3dx9shape.h b/sdk/dx8sdk/Include/d3dx9shape.h
index 4c230915..4c230915 100644
--- a/dxsdk/Include/d3dx9shape.h
+++ b/sdk/dx8sdk/Include/d3dx9shape.h
diff --git a/dxsdk/Include/d3dx9tex.h b/sdk/dx8sdk/Include/d3dx9tex.h
index 0d62b699..0d62b699 100644
--- a/dxsdk/Include/d3dx9tex.h
+++ b/sdk/dx8sdk/Include/d3dx9tex.h
diff --git a/dxsdk/Include/d3dx9xof.h b/sdk/dx8sdk/Include/d3dx9xof.h
index c513f0fc..c513f0fc 100644
--- a/dxsdk/Include/d3dx9xof.h
+++ b/sdk/dx8sdk/Include/d3dx9xof.h
diff --git a/dxsdk/Include/d3dxcore.h b/sdk/dx8sdk/Include/d3dxcore.h
index da1e9893..da1e9893 100644
--- a/dxsdk/Include/d3dxcore.h
+++ b/sdk/dx8sdk/Include/d3dxcore.h
diff --git a/dxsdk/Include/d3dxerr.h b/sdk/dx8sdk/Include/d3dxerr.h
index 155005b7..155005b7 100644
--- a/dxsdk/Include/d3dxerr.h
+++ b/sdk/dx8sdk/Include/d3dxerr.h
diff --git a/dxsdk/Include/d3dxmath.h b/sdk/dx8sdk/Include/d3dxmath.h
index 42f00d1a..42f00d1a 100644
--- a/dxsdk/Include/d3dxmath.h
+++ b/sdk/dx8sdk/Include/d3dxmath.h
diff --git a/dxsdk/Include/d3dxmath.inl b/sdk/dx8sdk/Include/d3dxmath.inl
index 05f04319..05f04319 100644
--- a/dxsdk/Include/d3dxmath.inl
+++ b/sdk/dx8sdk/Include/d3dxmath.inl
diff --git a/dxsdk/Include/d3dxshapes.h b/sdk/dx8sdk/Include/d3dxshapes.h
index 765c59f5..765c59f5 100644
--- a/dxsdk/Include/d3dxshapes.h
+++ b/sdk/dx8sdk/Include/d3dxshapes.h
diff --git a/dxsdk/Include/d3dxsprite.h b/sdk/dx8sdk/Include/d3dxsprite.h
index a08b4a99..a08b4a99 100644
--- a/dxsdk/Include/d3dxsprite.h
+++ b/sdk/dx8sdk/Include/d3dxsprite.h
diff --git a/dxsdk/Include/ddraw.h b/sdk/dx8sdk/Include/ddraw.h
index e66314bf..e66314bf 100644
--- a/dxsdk/Include/ddraw.h
+++ b/sdk/dx8sdk/Include/ddraw.h
diff --git a/dxsdk/Include/ddstream.h b/sdk/dx8sdk/Include/ddstream.h
index 49c3171e..49c3171e 100644
--- a/dxsdk/Include/ddstream.h
+++ b/sdk/dx8sdk/Include/ddstream.h
diff --git a/dxsdk/Include/dinput.h b/sdk/dx8sdk/Include/dinput.h
index 5aac2563..5aac2563 100644
--- a/dxsdk/Include/dinput.h
+++ b/sdk/dx8sdk/Include/dinput.h
diff --git a/dxsdk/Include/dinputd.h b/sdk/dx8sdk/Include/dinputd.h
index f5343538..f5343538 100644
--- a/dxsdk/Include/dinputd.h
+++ b/sdk/dx8sdk/Include/dinputd.h
diff --git a/dxsdk/Include/dls1.h b/sdk/dx8sdk/Include/dls1.h
index fc88a317..fc88a317 100644
--- a/dxsdk/Include/dls1.h
+++ b/sdk/dx8sdk/Include/dls1.h
diff --git a/dxsdk/Include/dls2.h b/sdk/dx8sdk/Include/dls2.h
index 30cec23a..30cec23a 100644
--- a/dxsdk/Include/dls2.h
+++ b/sdk/dx8sdk/Include/dls2.h
diff --git a/dxsdk/Include/dmdls.h b/sdk/dx8sdk/Include/dmdls.h
index c5072681..c5072681 100644
--- a/dxsdk/Include/dmdls.h
+++ b/sdk/dx8sdk/Include/dmdls.h
diff --git a/dxsdk/Include/dmerror.h b/sdk/dx8sdk/Include/dmerror.h
index a0a61ffc..a0a61ffc 100644
--- a/dxsdk/Include/dmerror.h
+++ b/sdk/dx8sdk/Include/dmerror.h
diff --git a/dxsdk/Include/dmksctrl.h b/sdk/dx8sdk/Include/dmksctrl.h
index f53e714b..f53e714b 100644
--- a/dxsdk/Include/dmksctrl.h
+++ b/sdk/dx8sdk/Include/dmksctrl.h
diff --git a/dxsdk/Include/dmo.h b/sdk/dx8sdk/Include/dmo.h
index 30cc2e9d..30cc2e9d 100644
--- a/dxsdk/Include/dmo.h
+++ b/sdk/dx8sdk/Include/dmo.h
diff --git a/dxsdk/Include/dmodshow.h b/sdk/dx8sdk/Include/dmodshow.h
index 48b323d8..48b323d8 100644
--- a/dxsdk/Include/dmodshow.h
+++ b/sdk/dx8sdk/Include/dmodshow.h
diff --git a/dxsdk/Include/dmoimpl.h b/sdk/dx8sdk/Include/dmoimpl.h
index 8ba6e3a8..8ba6e3a8 100644
--- a/dxsdk/Include/dmoimpl.h
+++ b/sdk/dx8sdk/Include/dmoimpl.h
diff --git a/dxsdk/Include/dmoreg.h b/sdk/dx8sdk/Include/dmoreg.h
index 6c6c22f7..6c6c22f7 100644
--- a/dxsdk/Include/dmoreg.h
+++ b/sdk/dx8sdk/Include/dmoreg.h
diff --git a/dxsdk/Include/dmort.h b/sdk/dx8sdk/Include/dmort.h
index cfe25a4a..cfe25a4a 100644
--- a/dxsdk/Include/dmort.h
+++ b/sdk/dx8sdk/Include/dmort.h
diff --git a/dxsdk/Include/dmplugin.h b/sdk/dx8sdk/Include/dmplugin.h
index 3f3e1414..3f3e1414 100644
--- a/dxsdk/Include/dmplugin.h
+++ b/sdk/dx8sdk/Include/dmplugin.h
diff --git a/dxsdk/Include/dmusbuff.h b/sdk/dx8sdk/Include/dmusbuff.h
index 54884538..54884538 100644
--- a/dxsdk/Include/dmusbuff.h
+++ b/sdk/dx8sdk/Include/dmusbuff.h
diff --git a/dxsdk/Include/dmusicc.h b/sdk/dx8sdk/Include/dmusicc.h
index 3084d110..3084d110 100644
--- a/dxsdk/Include/dmusicc.h
+++ b/sdk/dx8sdk/Include/dmusicc.h
diff --git a/dxsdk/Include/dmusicf.h b/sdk/dx8sdk/Include/dmusicf.h
index 195edd7e..195edd7e 100644
--- a/dxsdk/Include/dmusicf.h
+++ b/sdk/dx8sdk/Include/dmusicf.h
diff --git a/dxsdk/Include/dmusici.h b/sdk/dx8sdk/Include/dmusici.h
index d985806b..d985806b 100644
--- a/dxsdk/Include/dmusici.h
+++ b/sdk/dx8sdk/Include/dmusici.h
diff --git a/dxsdk/Include/dmusics.h b/sdk/dx8sdk/Include/dmusics.h
index 8f1e45d8..8f1e45d8 100644
--- a/dxsdk/Include/dmusics.h
+++ b/sdk/dx8sdk/Include/dmusics.h
diff --git a/dxsdk/Include/dpaddr.h b/sdk/dx8sdk/Include/dpaddr.h
index 6e3fccf6..6e3fccf6 100644
--- a/dxsdk/Include/dpaddr.h
+++ b/sdk/dx8sdk/Include/dpaddr.h
diff --git a/dxsdk/Include/dplay.h b/sdk/dx8sdk/Include/dplay.h
index d91c0a5e..d91c0a5e 100644
--- a/dxsdk/Include/dplay.h
+++ b/sdk/dx8sdk/Include/dplay.h
diff --git a/dxsdk/Include/dplay8.h b/sdk/dx8sdk/Include/dplay8.h
index c6799a9d..c6799a9d 100644
--- a/dxsdk/Include/dplay8.h
+++ b/sdk/dx8sdk/Include/dplay8.h
diff --git a/dxsdk/Include/dplobby.h b/sdk/dx8sdk/Include/dplobby.h
index c91d3238..c91d3238 100644
--- a/dxsdk/Include/dplobby.h
+++ b/sdk/dx8sdk/Include/dplobby.h
diff --git a/dxsdk/Include/dplobby8.h b/sdk/dx8sdk/Include/dplobby8.h
index e63a5aac..e63a5aac 100644
--- a/dxsdk/Include/dplobby8.h
+++ b/sdk/dx8sdk/Include/dplobby8.h
diff --git a/dxsdk/Include/dpnathlp.h b/sdk/dx8sdk/Include/dpnathlp.h
index 720e43ad..720e43ad 100644
--- a/dxsdk/Include/dpnathlp.h
+++ b/sdk/dx8sdk/Include/dpnathlp.h
diff --git a/dxsdk/Include/dsconf.h b/sdk/dx8sdk/Include/dsconf.h
index 018f65a0..018f65a0 100644
--- a/dxsdk/Include/dsconf.h
+++ b/sdk/dx8sdk/Include/dsconf.h
diff --git a/dxsdk/Include/dsetup.h b/sdk/dx8sdk/Include/dsetup.h
index 0f4e3b0e..0f4e3b0e 100644
--- a/dxsdk/Include/dsetup.h
+++ b/sdk/dx8sdk/Include/dsetup.h
diff --git a/dxsdk/Include/dshowasf.h b/sdk/dx8sdk/Include/dshowasf.h
index 14d19487..14d19487 100644
--- a/dxsdk/Include/dshowasf.h
+++ b/sdk/dx8sdk/Include/dshowasf.h
diff --git a/dxsdk/Include/dsound.h b/sdk/dx8sdk/Include/dsound.h
index 8020a660..8020a660 100644
--- a/dxsdk/Include/dsound.h
+++ b/sdk/dx8sdk/Include/dsound.h
diff --git a/dxsdk/Include/dv.h b/sdk/dx8sdk/Include/dv.h
index d0fe0485..d0fe0485 100644
--- a/dxsdk/Include/dv.h
+++ b/sdk/dx8sdk/Include/dv.h
diff --git a/dxsdk/Include/dvdevcod.h b/sdk/dx8sdk/Include/dvdevcod.h
index 15b47931..15b47931 100644
--- a/dxsdk/Include/dvdevcod.h
+++ b/sdk/dx8sdk/Include/dvdevcod.h
diff --git a/dxsdk/Include/dvdmedia.h b/sdk/dx8sdk/Include/dvdmedia.h
index 132c5bab..132c5bab 100644
--- a/dxsdk/Include/dvdmedia.h
+++ b/sdk/dx8sdk/Include/dvdmedia.h
diff --git a/dxsdk/Include/dvoice.h b/sdk/dx8sdk/Include/dvoice.h
index 000ac511..000ac511 100644
--- a/dxsdk/Include/dvoice.h
+++ b/sdk/dx8sdk/Include/dvoice.h
diff --git a/dxsdk/Include/dvp.h b/sdk/dx8sdk/Include/dvp.h
index c40dc793..c40dc793 100644
--- a/dxsdk/Include/dvp.h
+++ b/sdk/dx8sdk/Include/dvp.h
diff --git a/dxsdk/Include/dx7todx8.h b/sdk/dx8sdk/Include/dx7todx8.h
index a513d693..a513d693 100644
--- a/dxsdk/Include/dx7todx8.h
+++ b/sdk/dx8sdk/Include/dx7todx8.h
diff --git a/dxsdk/Include/dxerr8.h b/sdk/dx8sdk/Include/dxerr8.h
index 8b7813da..8b7813da 100644
--- a/dxsdk/Include/dxerr8.h
+++ b/sdk/dx8sdk/Include/dxerr8.h
diff --git a/dxsdk/Include/dxerr9.h b/sdk/dx8sdk/Include/dxerr9.h
index 3fc6fba3..3fc6fba3 100644
--- a/dxsdk/Include/dxerr9.h
+++ b/sdk/dx8sdk/Include/dxerr9.h
diff --git a/dxsdk/Include/dxfile.h b/sdk/dx8sdk/Include/dxfile.h
index 8b5995a5..8b5995a5 100644
--- a/dxsdk/Include/dxfile.h
+++ b/sdk/dx8sdk/Include/dxfile.h
diff --git a/dxsdk/Include/dxtrans.h b/sdk/dx8sdk/Include/dxtrans.h
index 8df2ff77..8df2ff77 100644
--- a/dxsdk/Include/dxtrans.h
+++ b/sdk/dx8sdk/Include/dxtrans.h
diff --git a/dxsdk/Include/dxva.h b/sdk/dx8sdk/Include/dxva.h
index 05d46680..05d46680 100644
--- a/dxsdk/Include/dxva.h
+++ b/sdk/dx8sdk/Include/dxva.h
diff --git a/dxsdk/Include/edevctrl.h b/sdk/dx8sdk/Include/edevctrl.h
index 07510447..07510447 100644
--- a/dxsdk/Include/edevctrl.h
+++ b/sdk/dx8sdk/Include/edevctrl.h
diff --git a/dxsdk/Include/edevdefs.h b/sdk/dx8sdk/Include/edevdefs.h
index 16af462d..16af462d 100644
--- a/dxsdk/Include/edevdefs.h
+++ b/sdk/dx8sdk/Include/edevdefs.h
diff --git a/dxsdk/Include/errors.h b/sdk/dx8sdk/Include/errors.h
index cee756fb..cee756fb 100644
--- a/dxsdk/Include/errors.h
+++ b/sdk/dx8sdk/Include/errors.h
diff --git a/dxsdk/Include/evcode.h b/sdk/dx8sdk/Include/evcode.h
index 32cc1958..32cc1958 100644
--- a/dxsdk/Include/evcode.h
+++ b/sdk/dx8sdk/Include/evcode.h
diff --git a/dxsdk/Include/il21dec.h b/sdk/dx8sdk/Include/il21dec.h
index a2c7fc67..a2c7fc67 100644
--- a/dxsdk/Include/il21dec.h
+++ b/sdk/dx8sdk/Include/il21dec.h
diff --git a/dxsdk/Include/ks.h b/sdk/dx8sdk/Include/ks.h
index 4f766b9f..4f766b9f 100644
--- a/dxsdk/Include/ks.h
+++ b/sdk/dx8sdk/Include/ks.h
diff --git a/dxsdk/Include/ksguid.h b/sdk/dx8sdk/Include/ksguid.h
index 42cd2c70..42cd2c70 100644
--- a/dxsdk/Include/ksguid.h
+++ b/sdk/dx8sdk/Include/ksguid.h
diff --git a/dxsdk/Include/ksmedia.h b/sdk/dx8sdk/Include/ksmedia.h
index 136c5ccd..136c5ccd 100644
--- a/dxsdk/Include/ksmedia.h
+++ b/sdk/dx8sdk/Include/ksmedia.h
diff --git a/dxsdk/Include/ksproxy.h b/sdk/dx8sdk/Include/ksproxy.h
index 62be50ec..62be50ec 100644
--- a/dxsdk/Include/ksproxy.h
+++ b/sdk/dx8sdk/Include/ksproxy.h
diff --git a/dxsdk/Include/ksuuids.h b/sdk/dx8sdk/Include/ksuuids.h
index 816fff26..816fff26 100644
--- a/dxsdk/Include/ksuuids.h
+++ b/sdk/dx8sdk/Include/ksuuids.h
diff --git a/dxsdk/Include/mediaerr.h b/sdk/dx8sdk/Include/mediaerr.h
index 74c242a5..74c242a5 100644
--- a/dxsdk/Include/mediaerr.h
+++ b/sdk/dx8sdk/Include/mediaerr.h
diff --git a/dxsdk/Include/mediaobj.h b/sdk/dx8sdk/Include/mediaobj.h
index d90d0943..d90d0943 100644
--- a/dxsdk/Include/mediaobj.h
+++ b/sdk/dx8sdk/Include/mediaobj.h
diff --git a/dxsdk/Include/medparam.h b/sdk/dx8sdk/Include/medparam.h
index db38cac8..db38cac8 100644
--- a/dxsdk/Include/medparam.h
+++ b/sdk/dx8sdk/Include/medparam.h
diff --git a/dxsdk/Include/mixerocx.h b/sdk/dx8sdk/Include/mixerocx.h
index fd7814e3..fd7814e3 100644
--- a/dxsdk/Include/mixerocx.h
+++ b/sdk/dx8sdk/Include/mixerocx.h
diff --git a/dxsdk/Include/mmstream.h b/sdk/dx8sdk/Include/mmstream.h
index ec91bc0b..ec91bc0b 100644
--- a/dxsdk/Include/mmstream.h
+++ b/sdk/dx8sdk/Include/mmstream.h
diff --git a/dxsdk/Include/mpconfig.h b/sdk/dx8sdk/Include/mpconfig.h
index 49f8cf10..49f8cf10 100644
--- a/dxsdk/Include/mpconfig.h
+++ b/sdk/dx8sdk/Include/mpconfig.h
diff --git a/dxsdk/Include/mpeg2data.h b/sdk/dx8sdk/Include/mpeg2data.h
index f3301c69..f3301c69 100644
--- a/dxsdk/Include/mpeg2data.h
+++ b/sdk/dx8sdk/Include/mpeg2data.h
diff --git a/dxsdk/Include/mpegtype.h b/sdk/dx8sdk/Include/mpegtype.h
index 4e79fcb0..4e79fcb0 100644
--- a/dxsdk/Include/mpegtype.h
+++ b/sdk/dx8sdk/Include/mpegtype.h
diff --git a/dxsdk/Include/multimon.h b/sdk/dx8sdk/Include/multimon.h
index 88e2862a..88e2862a 100644
--- a/dxsdk/Include/multimon.h
+++ b/sdk/dx8sdk/Include/multimon.h
diff --git a/dxsdk/Include/playlist.h b/sdk/dx8sdk/Include/playlist.h
index 1a796f3a..1a796f3a 100644
--- a/dxsdk/Include/playlist.h
+++ b/sdk/dx8sdk/Include/playlist.h
diff --git a/dxsdk/Include/qedit.h b/sdk/dx8sdk/Include/qedit.h
index 947c8a08..947c8a08 100644
--- a/dxsdk/Include/qedit.h
+++ b/sdk/dx8sdk/Include/qedit.h
diff --git a/dxsdk/Include/qnetwork.h b/sdk/dx8sdk/Include/qnetwork.h
index 2df21946..2df21946 100644
--- a/dxsdk/Include/qnetwork.h
+++ b/sdk/dx8sdk/Include/qnetwork.h
diff --git a/dxsdk/Include/regbag.h b/sdk/dx8sdk/Include/regbag.h
index 6cb54d78..6cb54d78 100644
--- a/dxsdk/Include/regbag.h
+++ b/sdk/dx8sdk/Include/regbag.h
diff --git a/dxsdk/Include/rmxfguid.h b/sdk/dx8sdk/Include/rmxfguid.h
index d3326ccc..d3326ccc 100644
--- a/dxsdk/Include/rmxfguid.h
+++ b/sdk/dx8sdk/Include/rmxfguid.h
diff --git a/dxsdk/Include/rmxftmpl.h b/sdk/dx8sdk/Include/rmxftmpl.h
index e0018d04..e0018d04 100644
--- a/dxsdk/Include/rmxftmpl.h
+++ b/sdk/dx8sdk/Include/rmxftmpl.h
diff --git a/dxsdk/Include/sbe.h b/sdk/dx8sdk/Include/sbe.h
index 0fcc4011..0fcc4011 100644
--- a/dxsdk/Include/sbe.h
+++ b/sdk/dx8sdk/Include/sbe.h
diff --git a/dxsdk/Include/strmif.h b/sdk/dx8sdk/Include/strmif.h
index 600105e7..600105e7 100644
--- a/dxsdk/Include/strmif.h
+++ b/sdk/dx8sdk/Include/strmif.h
diff --git a/dxsdk/Include/strsafe.h b/sdk/dx8sdk/Include/strsafe.h
index 061b3c4d..061b3c4d 100644
--- a/dxsdk/Include/strsafe.h
+++ b/sdk/dx8sdk/Include/strsafe.h
diff --git a/dxsdk/Include/tune.h b/sdk/dx8sdk/Include/tune.h
index 63920f90..63920f90 100644
--- a/dxsdk/Include/tune.h
+++ b/sdk/dx8sdk/Include/tune.h
diff --git a/dxsdk/Include/tuner.h b/sdk/dx8sdk/Include/tuner.h
index cd08a15c..cd08a15c 100644
--- a/dxsdk/Include/tuner.h
+++ b/sdk/dx8sdk/Include/tuner.h
diff --git a/dxsdk/Include/tvratings.h b/sdk/dx8sdk/Include/tvratings.h
index 53e6cfea..53e6cfea 100644
--- a/dxsdk/Include/tvratings.h
+++ b/sdk/dx8sdk/Include/tvratings.h
diff --git a/dxsdk/Include/uuids.h b/sdk/dx8sdk/Include/uuids.h
index c713d0df..c713d0df 100644
--- a/dxsdk/Include/uuids.h
+++ b/sdk/dx8sdk/Include/uuids.h
diff --git a/dxsdk/Include/vfwmsgs.h b/sdk/dx8sdk/Include/vfwmsgs.h
index 57852e9f..57852e9f 100644
--- a/dxsdk/Include/vfwmsgs.h
+++ b/sdk/dx8sdk/Include/vfwmsgs.h
diff --git a/dxsdk/Include/vidcap.h b/sdk/dx8sdk/Include/vidcap.h
index 23d810bb..23d810bb 100644
--- a/dxsdk/Include/vidcap.h
+++ b/sdk/dx8sdk/Include/vidcap.h
diff --git a/dxsdk/Include/videoacc.h b/sdk/dx8sdk/Include/videoacc.h
index 7121ff46..7121ff46 100644
--- a/dxsdk/Include/videoacc.h
+++ b/sdk/dx8sdk/Include/videoacc.h
diff --git a/dxsdk/Include/vmr9.h b/sdk/dx8sdk/Include/vmr9.h
index 0a4e1fe4..0a4e1fe4 100644
--- a/dxsdk/Include/vmr9.h
+++ b/sdk/dx8sdk/Include/vmr9.h
diff --git a/dxsdk/Include/vpconfig.h b/sdk/dx8sdk/Include/vpconfig.h
index 776d99f5..776d99f5 100644
--- a/dxsdk/Include/vpconfig.h
+++ b/sdk/dx8sdk/Include/vpconfig.h
diff --git a/dxsdk/Include/vpnotify.h b/sdk/dx8sdk/Include/vpnotify.h
index 2e1d1b6b..2e1d1b6b 100644
--- a/dxsdk/Include/vpnotify.h
+++ b/sdk/dx8sdk/Include/vpnotify.h
diff --git a/dxsdk/Include/vptype.h b/sdk/dx8sdk/Include/vptype.h
index b03baae6..b03baae6 100644
--- a/dxsdk/Include/vptype.h
+++ b/sdk/dx8sdk/Include/vptype.h
diff --git a/dxsdk/Include/xprtdefs.h b/sdk/dx8sdk/Include/xprtdefs.h
index 7bdde244..7bdde244 100644
--- a/dxsdk/Include/xprtdefs.h
+++ b/sdk/dx8sdk/Include/xprtdefs.h
diff --git a/dxsdk/Lib/DxErr8.lib b/sdk/dx8sdk/Lib/DxErr8.lib
index c22ccde6..c22ccde6 100644
--- a/dxsdk/Lib/DxErr8.lib
+++ b/sdk/dx8sdk/Lib/DxErr8.lib
Binary files differ
diff --git a/dxsdk/Lib/DxErr9.lib b/sdk/dx8sdk/Lib/DxErr9.lib
index 3f039fa2..3f039fa2 100644
--- a/dxsdk/Lib/DxErr9.lib
+++ b/sdk/dx8sdk/Lib/DxErr9.lib
Binary files differ
diff --git a/dxsdk/Lib/amstrmid.lib b/sdk/dx8sdk/Lib/amstrmid.lib
index 8d921239..8d921239 100644
--- a/dxsdk/Lib/amstrmid.lib
+++ b/sdk/dx8sdk/Lib/amstrmid.lib
Binary files differ
diff --git a/dxsdk/Lib/d3d8.lib b/sdk/dx8sdk/Lib/d3d8.lib
index 828ed30d..828ed30d 100644
--- a/dxsdk/Lib/d3d8.lib
+++ b/sdk/dx8sdk/Lib/d3d8.lib
Binary files differ
diff --git a/dxsdk/Lib/d3d9.lib b/sdk/dx8sdk/Lib/d3d9.lib
index 9e08d863..9e08d863 100644
--- a/dxsdk/Lib/d3d9.lib
+++ b/sdk/dx8sdk/Lib/d3d9.lib
Binary files differ
diff --git a/dxsdk/Lib/d3dx.lib b/sdk/dx8sdk/Lib/d3dx.lib
index e9450b1b..e9450b1b 100644
--- a/dxsdk/Lib/d3dx.lib
+++ b/sdk/dx8sdk/Lib/d3dx.lib
Binary files differ
diff --git a/dxsdk/Lib/d3dx8.lib b/sdk/dx8sdk/Lib/d3dx8.lib
index 8305ff4c..8305ff4c 100644
--- a/dxsdk/Lib/d3dx8.lib
+++ b/sdk/dx8sdk/Lib/d3dx8.lib
Binary files differ
diff --git a/dxsdk/Lib/d3dx8d.lib b/sdk/dx8sdk/Lib/d3dx8d.lib
index 70ac0e3a..70ac0e3a 100644
--- a/dxsdk/Lib/d3dx8d.lib
+++ b/sdk/dx8sdk/Lib/d3dx8d.lib
Binary files differ
diff --git a/dxsdk/Lib/d3dx8dt.lib b/sdk/dx8sdk/Lib/d3dx8dt.lib
index 755e2901..755e2901 100644
--- a/dxsdk/Lib/d3dx8dt.lib
+++ b/sdk/dx8sdk/Lib/d3dx8dt.lib
Binary files differ
diff --git a/dxsdk/Lib/d3dx9.lib b/sdk/dx8sdk/Lib/d3dx9.lib
index ffc9f0d8..ffc9f0d8 100644
--- a/dxsdk/Lib/d3dx9.lib
+++ b/sdk/dx8sdk/Lib/d3dx9.lib
Binary files differ
diff --git a/dxsdk/Lib/d3dx9d.lib b/sdk/dx8sdk/Lib/d3dx9d.lib
index feacd895..feacd895 100644
--- a/dxsdk/Lib/d3dx9d.lib
+++ b/sdk/dx8sdk/Lib/d3dx9d.lib
Binary files differ
diff --git a/dxsdk/Lib/d3dx9dt.lib b/sdk/dx8sdk/Lib/d3dx9dt.lib
index 8d6d32a9..8d6d32a9 100644
--- a/dxsdk/Lib/d3dx9dt.lib
+++ b/sdk/dx8sdk/Lib/d3dx9dt.lib
Binary files differ
diff --git a/dxsdk/Lib/d3dxd.lib b/sdk/dx8sdk/Lib/d3dxd.lib
index bf370d3c..bf370d3c 100644
--- a/dxsdk/Lib/d3dxd.lib
+++ b/sdk/dx8sdk/Lib/d3dxd.lib
Binary files differ
diff --git a/dxsdk/Lib/d3dxof.lib b/sdk/dx8sdk/Lib/d3dxof.lib
index c7e51781..c7e51781 100644
--- a/dxsdk/Lib/d3dxof.lib
+++ b/sdk/dx8sdk/Lib/d3dxof.lib
Binary files differ
diff --git a/dxsdk/Lib/ddraw.lib b/sdk/dx8sdk/Lib/ddraw.lib
index d7d0583e..d7d0583e 100644
--- a/dxsdk/Lib/ddraw.lib
+++ b/sdk/dx8sdk/Lib/ddraw.lib
Binary files differ
diff --git a/dxsdk/Lib/dinput.lib b/sdk/dx8sdk/Lib/dinput.lib
index 3abb4540..3abb4540 100644
--- a/dxsdk/Lib/dinput.lib
+++ b/sdk/dx8sdk/Lib/dinput.lib
Binary files differ
diff --git a/dxsdk/Lib/dinput8.lib b/sdk/dx8sdk/Lib/dinput8.lib
index 3fad62fb..3fad62fb 100644
--- a/dxsdk/Lib/dinput8.lib
+++ b/sdk/dx8sdk/Lib/dinput8.lib
Binary files differ
diff --git a/dxsdk/Lib/dmoguids.lib b/sdk/dx8sdk/Lib/dmoguids.lib
index ad5fbfb2..ad5fbfb2 100644
--- a/dxsdk/Lib/dmoguids.lib
+++ b/sdk/dx8sdk/Lib/dmoguids.lib
Binary files differ
diff --git a/dxsdk/Lib/dplayx.lib b/sdk/dx8sdk/Lib/dplayx.lib
index d8e42998..d8e42998 100644
--- a/dxsdk/Lib/dplayx.lib
+++ b/sdk/dx8sdk/Lib/dplayx.lib
Binary files differ
diff --git a/dxsdk/Lib/dsetup.lib b/sdk/dx8sdk/Lib/dsetup.lib
index 8acfa3ea..8acfa3ea 100644
--- a/dxsdk/Lib/dsetup.lib
+++ b/sdk/dx8sdk/Lib/dsetup.lib
Binary files differ
diff --git a/dxsdk/Lib/dsound.lib b/sdk/dx8sdk/Lib/dsound.lib
index 6e9604d3..6e9604d3 100644
--- a/dxsdk/Lib/dsound.lib
+++ b/sdk/dx8sdk/Lib/dsound.lib
Binary files differ
diff --git a/dxsdk/Lib/dxguid.lib b/sdk/dx8sdk/Lib/dxguid.lib
index f251a925..f251a925 100644
--- a/dxsdk/Lib/dxguid.lib
+++ b/sdk/dx8sdk/Lib/dxguid.lib
Binary files differ
diff --git a/dxsdk/Lib/dxtrans.lib b/sdk/dx8sdk/Lib/dxtrans.lib
index 20a49952..20a49952 100644
--- a/dxsdk/Lib/dxtrans.lib
+++ b/sdk/dx8sdk/Lib/dxtrans.lib
Binary files differ
diff --git a/dxsdk/Lib/encapi.lib b/sdk/dx8sdk/Lib/encapi.lib
index 0e3d774d..0e3d774d 100644
--- a/dxsdk/Lib/encapi.lib
+++ b/sdk/dx8sdk/Lib/encapi.lib
Binary files differ
diff --git a/dxsdk/Lib/ksproxy.lib b/sdk/dx8sdk/Lib/ksproxy.lib
index 4f362460..4f362460 100644
--- a/dxsdk/Lib/ksproxy.lib
+++ b/sdk/dx8sdk/Lib/ksproxy.lib
Binary files differ
diff --git a/dxsdk/Lib/ksuser.lib b/sdk/dx8sdk/Lib/ksuser.lib
index 7aba7bd7..7aba7bd7 100644
--- a/dxsdk/Lib/ksuser.lib
+++ b/sdk/dx8sdk/Lib/ksuser.lib
Binary files differ
diff --git a/dxsdk/Lib/msdmo.lib b/sdk/dx8sdk/Lib/msdmo.lib
index 290e308f..290e308f 100644
--- a/dxsdk/Lib/msdmo.lib
+++ b/sdk/dx8sdk/Lib/msdmo.lib
Binary files differ
diff --git a/dxsdk/Lib/quartz.lib b/sdk/dx8sdk/Lib/quartz.lib
index 47fcd1d2..47fcd1d2 100644
--- a/dxsdk/Lib/quartz.lib
+++ b/sdk/dx8sdk/Lib/quartz.lib
Binary files differ
diff --git a/dxsdk/Lib/strmiids.lib b/sdk/dx8sdk/Lib/strmiids.lib
index 8d921239..8d921239 100644
--- a/dxsdk/Lib/strmiids.lib
+++ b/sdk/dx8sdk/Lib/strmiids.lib
Binary files differ
diff --git a/milessdk/include/mss.h b/sdk/milessdk/include/mss.h
index 38371eb9..38371eb9 100644
--- a/milessdk/include/mss.h
+++ b/sdk/milessdk/include/mss.h
diff --git a/milessdk/lib/mss32.lib b/sdk/milessdk/lib/mss32.lib
index f97091c7..f97091c7 100644
--- a/milessdk/lib/mss32.lib
+++ b/sdk/milessdk/lib/mss32.lib
Binary files differ
diff --git a/rwsdk/include/d3d8/baaplylt.c b/sdk/rwsdk/include/d3d8/baaplylt.c
index ad518e6a..ad518e6a 100644
--- a/rwsdk/include/d3d8/baaplylt.c
+++ b/sdk/rwsdk/include/d3d8/baaplylt.c
diff --git a/rwsdk/include/d3d8/errcom.def b/sdk/rwsdk/include/d3d8/errcom.def
index 25f44e1e..25f44e1e 100644
--- a/rwsdk/include/d3d8/errcom.def
+++ b/sdk/rwsdk/include/d3d8/errcom.def
diff --git a/rwsdk/include/d3d8/errcore.def b/sdk/rwsdk/include/d3d8/errcore.def
index c71eed5a..c71eed5a 100644
--- a/rwsdk/include/d3d8/errcore.def
+++ b/sdk/rwsdk/include/d3d8/errcore.def
diff --git a/rwsdk/include/d3d8/rpanisot.h b/sdk/rwsdk/include/d3d8/rpanisot.h
index 4f4445a4..4f4445a4 100644
--- a/rwsdk/include/d3d8/rpanisot.h
+++ b/sdk/rwsdk/include/d3d8/rpanisot.h
diff --git a/rwsdk/include/d3d8/rpanisot.rpe b/sdk/rwsdk/include/d3d8/rpanisot.rpe
index 5216ec9c..5216ec9c 100644
--- a/rwsdk/include/d3d8/rpanisot.rpe
+++ b/sdk/rwsdk/include/d3d8/rpanisot.rpe
diff --git a/rwsdk/include/d3d8/rpcollis.h b/sdk/rwsdk/include/d3d8/rpcollis.h
index 908fb68e..908fb68e 100644
--- a/rwsdk/include/d3d8/rpcollis.h
+++ b/sdk/rwsdk/include/d3d8/rpcollis.h
diff --git a/rwsdk/include/d3d8/rpcollis.rpe b/sdk/rwsdk/include/d3d8/rpcollis.rpe
index 3e891755..3e891755 100644
--- a/rwsdk/include/d3d8/rpcollis.rpe
+++ b/sdk/rwsdk/include/d3d8/rpcollis.rpe
diff --git a/rwsdk/include/d3d8/rpcriter.h b/sdk/rwsdk/include/d3d8/rpcriter.h
index c1af25b8..c1af25b8 100644
--- a/rwsdk/include/d3d8/rpcriter.h
+++ b/sdk/rwsdk/include/d3d8/rpcriter.h
diff --git a/rwsdk/include/d3d8/rpdbgerr.c b/sdk/rwsdk/include/d3d8/rpdbgerr.c
index 0c83c04e..0c83c04e 100644
--- a/rwsdk/include/d3d8/rpdbgerr.c
+++ b/sdk/rwsdk/include/d3d8/rpdbgerr.c
diff --git a/rwsdk/include/d3d8/rpdbgerr.h b/sdk/rwsdk/include/d3d8/rpdbgerr.h
index 6918469a..6918469a 100644
--- a/rwsdk/include/d3d8/rpdbgerr.h
+++ b/sdk/rwsdk/include/d3d8/rpdbgerr.h
diff --git a/rwsdk/include/d3d8/rpdmorph.h b/sdk/rwsdk/include/d3d8/rpdmorph.h
index 1494bf3d..1494bf3d 100644
--- a/rwsdk/include/d3d8/rpdmorph.h
+++ b/sdk/rwsdk/include/d3d8/rpdmorph.h
diff --git a/rwsdk/include/d3d8/rpdmorph.rpe b/sdk/rwsdk/include/d3d8/rpdmorph.rpe
index a5202425..a5202425 100644
--- a/rwsdk/include/d3d8/rpdmorph.rpe
+++ b/sdk/rwsdk/include/d3d8/rpdmorph.rpe
diff --git a/rwsdk/include/d3d8/rperror.h b/sdk/rwsdk/include/d3d8/rperror.h
index 2a8c5630..2a8c5630 100644
--- a/rwsdk/include/d3d8/rperror.h
+++ b/sdk/rwsdk/include/d3d8/rperror.h
diff --git a/rwsdk/include/d3d8/rphanim.h b/sdk/rwsdk/include/d3d8/rphanim.h
index a9b0438a..a9b0438a 100644
--- a/rwsdk/include/d3d8/rphanim.h
+++ b/sdk/rwsdk/include/d3d8/rphanim.h
diff --git a/rwsdk/include/d3d8/rphanim.rpe b/sdk/rwsdk/include/d3d8/rphanim.rpe
index c60f8591..c60f8591 100644
--- a/rwsdk/include/d3d8/rphanim.rpe
+++ b/sdk/rwsdk/include/d3d8/rphanim.rpe
diff --git a/rwsdk/include/d3d8/rplodatm.h b/sdk/rwsdk/include/d3d8/rplodatm.h
index d4583338..d4583338 100644
--- a/rwsdk/include/d3d8/rplodatm.h
+++ b/sdk/rwsdk/include/d3d8/rplodatm.h
diff --git a/rwsdk/include/d3d8/rplodatm.rpe b/sdk/rwsdk/include/d3d8/rplodatm.rpe
index 649bc3bc..649bc3bc 100644
--- a/rwsdk/include/d3d8/rplodatm.rpe
+++ b/sdk/rwsdk/include/d3d8/rplodatm.rpe
diff --git a/rwsdk/include/d3d8/rplogo.h b/sdk/rwsdk/include/d3d8/rplogo.h
index ed527a29..ed527a29 100644
--- a/rwsdk/include/d3d8/rplogo.h
+++ b/sdk/rwsdk/include/d3d8/rplogo.h
diff --git a/rwsdk/include/d3d8/rplogo.rpe b/sdk/rwsdk/include/d3d8/rplogo.rpe
index f37b6920..f37b6920 100644
--- a/rwsdk/include/d3d8/rplogo.rpe
+++ b/sdk/rwsdk/include/d3d8/rplogo.rpe
diff --git a/rwsdk/include/d3d8/rpltmap.h b/sdk/rwsdk/include/d3d8/rpltmap.h
index 5add9a26..5add9a26 100644
--- a/rwsdk/include/d3d8/rpltmap.h
+++ b/sdk/rwsdk/include/d3d8/rpltmap.h
diff --git a/rwsdk/include/d3d8/rpltmap.rpe b/sdk/rwsdk/include/d3d8/rpltmap.rpe
index 413caf4c..413caf4c 100644
--- a/rwsdk/include/d3d8/rpltmap.rpe
+++ b/sdk/rwsdk/include/d3d8/rpltmap.rpe
diff --git a/rwsdk/include/d3d8/rpmatfx.h b/sdk/rwsdk/include/d3d8/rpmatfx.h
index 9b091dd8..9b091dd8 100644
--- a/rwsdk/include/d3d8/rpmatfx.h
+++ b/sdk/rwsdk/include/d3d8/rpmatfx.h
diff --git a/rwsdk/include/d3d8/rpmatfx.rpe b/sdk/rwsdk/include/d3d8/rpmatfx.rpe
index bbc588e3..bbc588e3 100644
--- a/rwsdk/include/d3d8/rpmatfx.rpe
+++ b/sdk/rwsdk/include/d3d8/rpmatfx.rpe
diff --git a/rwsdk/include/d3d8/rpmipkl.h b/sdk/rwsdk/include/d3d8/rpmipkl.h
index 5b8f7e51..5b8f7e51 100644
--- a/rwsdk/include/d3d8/rpmipkl.h
+++ b/sdk/rwsdk/include/d3d8/rpmipkl.h
diff --git a/rwsdk/include/d3d8/rpmipkl.rpe b/sdk/rwsdk/include/d3d8/rpmipkl.rpe
index 5216ec9c..5216ec9c 100644
--- a/rwsdk/include/d3d8/rpmipkl.rpe
+++ b/sdk/rwsdk/include/d3d8/rpmipkl.rpe
diff --git a/rwsdk/include/d3d8/rpmorph.h b/sdk/rwsdk/include/d3d8/rpmorph.h
index 4177fba8..4177fba8 100644
--- a/rwsdk/include/d3d8/rpmorph.h
+++ b/sdk/rwsdk/include/d3d8/rpmorph.h
diff --git a/rwsdk/include/d3d8/rpmorph.rpe b/sdk/rwsdk/include/d3d8/rpmorph.rpe
index 14b13076..14b13076 100644
--- a/rwsdk/include/d3d8/rpmorph.rpe
+++ b/sdk/rwsdk/include/d3d8/rpmorph.rpe
diff --git a/rwsdk/include/d3d8/rppatch.h b/sdk/rwsdk/include/d3d8/rppatch.h
index eb80663f..eb80663f 100644
--- a/rwsdk/include/d3d8/rppatch.h
+++ b/sdk/rwsdk/include/d3d8/rppatch.h
diff --git a/rwsdk/include/d3d8/rppatch.rpe b/sdk/rwsdk/include/d3d8/rppatch.rpe
index 6d433990..6d433990 100644
--- a/rwsdk/include/d3d8/rppatch.rpe
+++ b/sdk/rwsdk/include/d3d8/rppatch.rpe
diff --git a/rwsdk/include/d3d8/rpprtstd.h b/sdk/rwsdk/include/d3d8/rpprtstd.h
index ad1b87f7..ad1b87f7 100644
--- a/rwsdk/include/d3d8/rpprtstd.h
+++ b/sdk/rwsdk/include/d3d8/rpprtstd.h
diff --git a/rwsdk/include/d3d8/rpprtstd.rpe b/sdk/rwsdk/include/d3d8/rpprtstd.rpe
index df860d45..df860d45 100644
--- a/rwsdk/include/d3d8/rpprtstd.rpe
+++ b/sdk/rwsdk/include/d3d8/rpprtstd.rpe
diff --git a/rwsdk/include/d3d8/rpptank.h b/sdk/rwsdk/include/d3d8/rpptank.h
index 20931f21..20931f21 100644
--- a/rwsdk/include/d3d8/rpptank.h
+++ b/sdk/rwsdk/include/d3d8/rpptank.h
diff --git a/rwsdk/include/d3d8/rpptank.rpe b/sdk/rwsdk/include/d3d8/rpptank.rpe
index 485b5dd8..485b5dd8 100644
--- a/rwsdk/include/d3d8/rpptank.rpe
+++ b/sdk/rwsdk/include/d3d8/rpptank.rpe
diff --git a/rwsdk/include/d3d8/rppvs.h b/sdk/rwsdk/include/d3d8/rppvs.h
index 29fc2343..29fc2343 100644
--- a/rwsdk/include/d3d8/rppvs.h
+++ b/sdk/rwsdk/include/d3d8/rppvs.h
diff --git a/rwsdk/include/d3d8/rppvs.rpe b/sdk/rwsdk/include/d3d8/rppvs.rpe
index dc060cff..dc060cff 100644
--- a/rwsdk/include/d3d8/rppvs.rpe
+++ b/sdk/rwsdk/include/d3d8/rppvs.rpe
diff --git a/rwsdk/include/d3d8/rprandom.h b/sdk/rwsdk/include/d3d8/rprandom.h
index 8690c69a..8690c69a 100644
--- a/rwsdk/include/d3d8/rprandom.h
+++ b/sdk/rwsdk/include/d3d8/rprandom.h
diff --git a/rwsdk/include/d3d8/rprandom.rpe b/sdk/rwsdk/include/d3d8/rprandom.rpe
index 8e267eee..8e267eee 100644
--- a/rwsdk/include/d3d8/rprandom.rpe
+++ b/sdk/rwsdk/include/d3d8/rprandom.rpe
diff --git a/rwsdk/include/d3d8/rpskin.h b/sdk/rwsdk/include/d3d8/rpskin.h
index df446c1b..df446c1b 100644
--- a/rwsdk/include/d3d8/rpskin.h
+++ b/sdk/rwsdk/include/d3d8/rpskin.h
diff --git a/rwsdk/include/d3d8/rpskin.rpe b/sdk/rwsdk/include/d3d8/rpskin.rpe
index 57cecd5e..57cecd5e 100644
--- a/rwsdk/include/d3d8/rpskin.rpe
+++ b/sdk/rwsdk/include/d3d8/rpskin.rpe
diff --git a/rwsdk/include/d3d8/rpspline.h b/sdk/rwsdk/include/d3d8/rpspline.h
index 53fd8484..53fd8484 100644
--- a/rwsdk/include/d3d8/rpspline.h
+++ b/sdk/rwsdk/include/d3d8/rpspline.h
diff --git a/rwsdk/include/d3d8/rpspline.rpe b/sdk/rwsdk/include/d3d8/rpspline.rpe
index 27670751..27670751 100644
--- a/rwsdk/include/d3d8/rpspline.rpe
+++ b/sdk/rwsdk/include/d3d8/rpspline.rpe
diff --git a/rwsdk/include/d3d8/rpstereo.h b/sdk/rwsdk/include/d3d8/rpstereo.h
index 5a8db912..5a8db912 100644
--- a/rwsdk/include/d3d8/rpstereo.h
+++ b/sdk/rwsdk/include/d3d8/rpstereo.h
diff --git a/rwsdk/include/d3d8/rpstereo.rpe b/sdk/rwsdk/include/d3d8/rpstereo.rpe
index b89dde2e..b89dde2e 100644
--- a/rwsdk/include/d3d8/rpstereo.rpe
+++ b/sdk/rwsdk/include/d3d8/rpstereo.rpe
diff --git a/rwsdk/include/d3d8/rpusrdat.h b/sdk/rwsdk/include/d3d8/rpusrdat.h
index 3665e064..3665e064 100644
--- a/rwsdk/include/d3d8/rpusrdat.h
+++ b/sdk/rwsdk/include/d3d8/rpusrdat.h
diff --git a/rwsdk/include/d3d8/rpusrdat.rpe b/sdk/rwsdk/include/d3d8/rpusrdat.rpe
index 31c37fd1..31c37fd1 100644
--- a/rwsdk/include/d3d8/rpusrdat.rpe
+++ b/sdk/rwsdk/include/d3d8/rpusrdat.rpe
diff --git a/rwsdk/include/d3d8/rpworld.h b/sdk/rwsdk/include/d3d8/rpworld.h
index 21fdc31b..21fdc31b 100644
--- a/rwsdk/include/d3d8/rpworld.h
+++ b/sdk/rwsdk/include/d3d8/rpworld.h
diff --git a/rwsdk/include/d3d8/rpworld.rpe b/sdk/rwsdk/include/d3d8/rpworld.rpe
index 080eefa5..080eefa5 100644
--- a/rwsdk/include/d3d8/rpworld.rpe
+++ b/sdk/rwsdk/include/d3d8/rpworld.rpe
diff --git a/rwsdk/include/d3d8/rt2d.h b/sdk/rwsdk/include/d3d8/rt2d.h
index 5bf1faea..5bf1faea 100644
--- a/rwsdk/include/d3d8/rt2d.h
+++ b/sdk/rwsdk/include/d3d8/rt2d.h
diff --git a/rwsdk/include/d3d8/rt2d.rpe b/sdk/rwsdk/include/d3d8/rt2d.rpe
index 1f9f8881..1f9f8881 100644
--- a/rwsdk/include/d3d8/rt2d.rpe
+++ b/sdk/rwsdk/include/d3d8/rt2d.rpe
diff --git a/rwsdk/include/d3d8/rt2danim.h b/sdk/rwsdk/include/d3d8/rt2danim.h
index cd593a8e..cd593a8e 100644
--- a/rwsdk/include/d3d8/rt2danim.h
+++ b/sdk/rwsdk/include/d3d8/rt2danim.h
diff --git a/rwsdk/include/d3d8/rt2danim.rpe b/sdk/rwsdk/include/d3d8/rt2danim.rpe
index 82a9dac9..82a9dac9 100644
--- a/rwsdk/include/d3d8/rt2danim.rpe
+++ b/sdk/rwsdk/include/d3d8/rt2danim.rpe
diff --git a/rwsdk/include/d3d8/rtbary.h b/sdk/rwsdk/include/d3d8/rtbary.h
index 61c39b07..61c39b07 100644
--- a/rwsdk/include/d3d8/rtbary.h
+++ b/sdk/rwsdk/include/d3d8/rtbary.h
diff --git a/rwsdk/include/d3d8/rtbary.rpe b/sdk/rwsdk/include/d3d8/rtbary.rpe
index fdfe3afe..fdfe3afe 100644
--- a/rwsdk/include/d3d8/rtbary.rpe
+++ b/sdk/rwsdk/include/d3d8/rtbary.rpe
diff --git a/rwsdk/include/d3d8/rtbezpat.h b/sdk/rwsdk/include/d3d8/rtbezpat.h
index 8a5960cb..8a5960cb 100644
--- a/rwsdk/include/d3d8/rtbezpat.h
+++ b/sdk/rwsdk/include/d3d8/rtbezpat.h
diff --git a/rwsdk/include/d3d8/rtbezpat.rpe b/sdk/rwsdk/include/d3d8/rtbezpat.rpe
index e49b65b4..e49b65b4 100644
--- a/rwsdk/include/d3d8/rtbezpat.rpe
+++ b/sdk/rwsdk/include/d3d8/rtbezpat.rpe
diff --git a/rwsdk/include/d3d8/rtbmp.h b/sdk/rwsdk/include/d3d8/rtbmp.h
index 37b5c97b..37b5c97b 100644
--- a/rwsdk/include/d3d8/rtbmp.h
+++ b/sdk/rwsdk/include/d3d8/rtbmp.h
diff --git a/rwsdk/include/d3d8/rtbmp.rpe b/sdk/rwsdk/include/d3d8/rtbmp.rpe
index 29dad089..29dad089 100644
--- a/rwsdk/include/d3d8/rtbmp.rpe
+++ b/sdk/rwsdk/include/d3d8/rtbmp.rpe
diff --git a/rwsdk/include/d3d8/rtcharse.h b/sdk/rwsdk/include/d3d8/rtcharse.h
index 4fdc2568..4fdc2568 100644
--- a/rwsdk/include/d3d8/rtcharse.h
+++ b/sdk/rwsdk/include/d3d8/rtcharse.h
diff --git a/rwsdk/include/d3d8/rtcharse.rpe b/sdk/rwsdk/include/d3d8/rtcharse.rpe
index 39c37312..39c37312 100644
--- a/rwsdk/include/d3d8/rtcharse.rpe
+++ b/sdk/rwsdk/include/d3d8/rtcharse.rpe
diff --git a/rwsdk/include/d3d8/rtimport.h b/sdk/rwsdk/include/d3d8/rtimport.h
index cf4e6283..cf4e6283 100644
--- a/rwsdk/include/d3d8/rtimport.h
+++ b/sdk/rwsdk/include/d3d8/rtimport.h
diff --git a/rwsdk/include/d3d8/rtimport.rpe b/sdk/rwsdk/include/d3d8/rtimport.rpe
index d4b7ad2b..d4b7ad2b 100644
--- a/rwsdk/include/d3d8/rtimport.rpe
+++ b/sdk/rwsdk/include/d3d8/rtimport.rpe
diff --git a/rwsdk/include/d3d8/rtintel.h b/sdk/rwsdk/include/d3d8/rtintel.h
index c11329df..c11329df 100644
--- a/rwsdk/include/d3d8/rtintel.h
+++ b/sdk/rwsdk/include/d3d8/rtintel.h
diff --git a/rwsdk/include/d3d8/rtintel.rpe b/sdk/rwsdk/include/d3d8/rtintel.rpe
index bf297ca0..bf297ca0 100644
--- a/rwsdk/include/d3d8/rtintel.rpe
+++ b/sdk/rwsdk/include/d3d8/rtintel.rpe
diff --git a/rwsdk/include/d3d8/rtintsec.h b/sdk/rwsdk/include/d3d8/rtintsec.h
index cb482b17..cb482b17 100644
--- a/rwsdk/include/d3d8/rtintsec.h
+++ b/sdk/rwsdk/include/d3d8/rtintsec.h
diff --git a/rwsdk/include/d3d8/rtintsec.rpe b/sdk/rwsdk/include/d3d8/rtintsec.rpe
index 7b2ce6e1..7b2ce6e1 100644
--- a/rwsdk/include/d3d8/rtintsec.rpe
+++ b/sdk/rwsdk/include/d3d8/rtintsec.rpe
diff --git a/rwsdk/include/d3d8/rtltmap.h b/sdk/rwsdk/include/d3d8/rtltmap.h
index 1a53b185..1a53b185 100644
--- a/rwsdk/include/d3d8/rtltmap.h
+++ b/sdk/rwsdk/include/d3d8/rtltmap.h
diff --git a/rwsdk/include/d3d8/rtltmap.rpe b/sdk/rwsdk/include/d3d8/rtltmap.rpe
index e510d78b..e510d78b 100644
--- a/rwsdk/include/d3d8/rtltmap.rpe
+++ b/sdk/rwsdk/include/d3d8/rtltmap.rpe
diff --git a/rwsdk/include/d3d8/rtmipk.h b/sdk/rwsdk/include/d3d8/rtmipk.h
index c06a3879..c06a3879 100644
--- a/rwsdk/include/d3d8/rtmipk.h
+++ b/sdk/rwsdk/include/d3d8/rtmipk.h
diff --git a/rwsdk/include/d3d8/rtmipk.rpe b/sdk/rwsdk/include/d3d8/rtmipk.rpe
index 24e1fd33..24e1fd33 100644
--- a/rwsdk/include/d3d8/rtmipk.rpe
+++ b/sdk/rwsdk/include/d3d8/rtmipk.rpe
diff --git a/rwsdk/include/d3d8/rtpick.h b/sdk/rwsdk/include/d3d8/rtpick.h
index 5ea78058..5ea78058 100644
--- a/rwsdk/include/d3d8/rtpick.h
+++ b/sdk/rwsdk/include/d3d8/rtpick.h
diff --git a/rwsdk/include/d3d8/rtpick.rpe b/sdk/rwsdk/include/d3d8/rtpick.rpe
index 055ea9ff..055ea9ff 100644
--- a/rwsdk/include/d3d8/rtpick.rpe
+++ b/sdk/rwsdk/include/d3d8/rtpick.rpe
diff --git a/rwsdk/include/d3d8/rtpitexd.h b/sdk/rwsdk/include/d3d8/rtpitexd.h
index 39287bcd..39287bcd 100644
--- a/rwsdk/include/d3d8/rtpitexd.h
+++ b/sdk/rwsdk/include/d3d8/rtpitexd.h
diff --git a/rwsdk/include/d3d8/rtpitexd.rpe b/sdk/rwsdk/include/d3d8/rtpitexd.rpe
index 0650ea5c..0650ea5c 100644
--- a/rwsdk/include/d3d8/rtpitexd.rpe
+++ b/sdk/rwsdk/include/d3d8/rtpitexd.rpe
diff --git a/rwsdk/include/d3d8/rtpng.h b/sdk/rwsdk/include/d3d8/rtpng.h
index 694c8400..694c8400 100644
--- a/rwsdk/include/d3d8/rtpng.h
+++ b/sdk/rwsdk/include/d3d8/rtpng.h
diff --git a/rwsdk/include/d3d8/rtpng.rpe b/sdk/rwsdk/include/d3d8/rtpng.rpe
index 7a6b6cc2..7a6b6cc2 100644
--- a/rwsdk/include/d3d8/rtpng.rpe
+++ b/sdk/rwsdk/include/d3d8/rtpng.rpe
diff --git a/rwsdk/include/d3d8/rtquat.h b/sdk/rwsdk/include/d3d8/rtquat.h
index 05e971d0..05e971d0 100644
--- a/rwsdk/include/d3d8/rtquat.h
+++ b/sdk/rwsdk/include/d3d8/rtquat.h
diff --git a/rwsdk/include/d3d8/rtquat.rpe b/sdk/rwsdk/include/d3d8/rtquat.rpe
index e43bb50c..e43bb50c 100644
--- a/rwsdk/include/d3d8/rtquat.rpe
+++ b/sdk/rwsdk/include/d3d8/rtquat.rpe
diff --git a/rwsdk/include/d3d8/rtras.h b/sdk/rwsdk/include/d3d8/rtras.h
index 0a9064a8..0a9064a8 100644
--- a/rwsdk/include/d3d8/rtras.h
+++ b/sdk/rwsdk/include/d3d8/rtras.h
diff --git a/rwsdk/include/d3d8/rtras.rpe b/sdk/rwsdk/include/d3d8/rtras.rpe
index 3398c3cc..3398c3cc 100644
--- a/rwsdk/include/d3d8/rtras.rpe
+++ b/sdk/rwsdk/include/d3d8/rtras.rpe
diff --git a/rwsdk/include/d3d8/rtray.h b/sdk/rwsdk/include/d3d8/rtray.h
index 4bf0a343..4bf0a343 100644
--- a/rwsdk/include/d3d8/rtray.h
+++ b/sdk/rwsdk/include/d3d8/rtray.h
diff --git a/rwsdk/include/d3d8/rtray.rpe b/sdk/rwsdk/include/d3d8/rtray.rpe
index 27788d94..27788d94 100644
--- a/rwsdk/include/d3d8/rtray.rpe
+++ b/sdk/rwsdk/include/d3d8/rtray.rpe
diff --git a/rwsdk/include/d3d8/rtslerp.h b/sdk/rwsdk/include/d3d8/rtslerp.h
index ec41752c..ec41752c 100644
--- a/rwsdk/include/d3d8/rtslerp.h
+++ b/sdk/rwsdk/include/d3d8/rtslerp.h
diff --git a/rwsdk/include/d3d8/rtslerp.rpe b/sdk/rwsdk/include/d3d8/rtslerp.rpe
index 847ccb00..847ccb00 100644
--- a/rwsdk/include/d3d8/rtslerp.rpe
+++ b/sdk/rwsdk/include/d3d8/rtslerp.rpe
diff --git a/rwsdk/include/d3d8/rtsplpvs.h b/sdk/rwsdk/include/d3d8/rtsplpvs.h
index 38ae118f..38ae118f 100644
--- a/rwsdk/include/d3d8/rtsplpvs.h
+++ b/sdk/rwsdk/include/d3d8/rtsplpvs.h
diff --git a/rwsdk/include/d3d8/rtsplpvs.rpe b/sdk/rwsdk/include/d3d8/rtsplpvs.rpe
index d436b610..d436b610 100644
--- a/rwsdk/include/d3d8/rtsplpvs.rpe
+++ b/sdk/rwsdk/include/d3d8/rtsplpvs.rpe
diff --git a/rwsdk/include/d3d8/rttiff.h b/sdk/rwsdk/include/d3d8/rttiff.h
index 9dbf22c8..9dbf22c8 100644
--- a/rwsdk/include/d3d8/rttiff.h
+++ b/sdk/rwsdk/include/d3d8/rttiff.h
diff --git a/rwsdk/include/d3d8/rttiff.rpe b/sdk/rwsdk/include/d3d8/rttiff.rpe
index f82c7d82..f82c7d82 100644
--- a/rwsdk/include/d3d8/rttiff.rpe
+++ b/sdk/rwsdk/include/d3d8/rttiff.rpe
diff --git a/rwsdk/include/d3d8/rttilerd.h b/sdk/rwsdk/include/d3d8/rttilerd.h
index f11b703b..f11b703b 100644
--- a/rwsdk/include/d3d8/rttilerd.h
+++ b/sdk/rwsdk/include/d3d8/rttilerd.h
diff --git a/rwsdk/include/d3d8/rttilerd.rpe b/sdk/rwsdk/include/d3d8/rttilerd.rpe
index 78222d06..78222d06 100644
--- a/rwsdk/include/d3d8/rttilerd.rpe
+++ b/sdk/rwsdk/include/d3d8/rttilerd.rpe
diff --git a/rwsdk/include/d3d8/rttoc.h b/sdk/rwsdk/include/d3d8/rttoc.h
index 02893aa8..02893aa8 100644
--- a/rwsdk/include/d3d8/rttoc.h
+++ b/sdk/rwsdk/include/d3d8/rttoc.h
diff --git a/rwsdk/include/d3d8/rttoc.rpe b/sdk/rwsdk/include/d3d8/rttoc.rpe
index 796f8de5..796f8de5 100644
--- a/rwsdk/include/d3d8/rttoc.rpe
+++ b/sdk/rwsdk/include/d3d8/rttoc.rpe
diff --git a/rwsdk/include/d3d8/rtvcat.h b/sdk/rwsdk/include/d3d8/rtvcat.h
index 474095e1..474095e1 100644
--- a/rwsdk/include/d3d8/rtvcat.h
+++ b/sdk/rwsdk/include/d3d8/rtvcat.h
diff --git a/rwsdk/include/d3d8/rtvcat.rpe b/sdk/rwsdk/include/d3d8/rtvcat.rpe
index 464ca886..464ca886 100644
--- a/rwsdk/include/d3d8/rtvcat.rpe
+++ b/sdk/rwsdk/include/d3d8/rtvcat.rpe
diff --git a/rwsdk/include/d3d8/rtworld.h b/sdk/rwsdk/include/d3d8/rtworld.h
index fef3e17c..fef3e17c 100644
--- a/rwsdk/include/d3d8/rtworld.h
+++ b/sdk/rwsdk/include/d3d8/rtworld.h
diff --git a/rwsdk/include/d3d8/rtworld.rpe b/sdk/rwsdk/include/d3d8/rtworld.rpe
index bc20947e..bc20947e 100644
--- a/rwsdk/include/d3d8/rtworld.rpe
+++ b/sdk/rwsdk/include/d3d8/rtworld.rpe
diff --git a/rwsdk/include/d3d8/rwcore.h b/sdk/rwsdk/include/d3d8/rwcore.h
index b9214c63..b9214c63 100644
--- a/rwsdk/include/d3d8/rwcore.h
+++ b/sdk/rwsdk/include/d3d8/rwcore.h
diff --git a/rwsdk/include/d3d8/rwplcore.h b/sdk/rwsdk/include/d3d8/rwplcore.h
index b0ff7dfa..b0ff7dfa 100644
--- a/rwsdk/include/d3d8/rwplcore.h
+++ b/sdk/rwsdk/include/d3d8/rwplcore.h
diff --git a/src/animation/AnimBlendClumpData.h b/src/animation/AnimBlendClumpData.h
index 5c511ab8..fc74b42d 100644
--- a/src/animation/AnimBlendClumpData.h
+++ b/src/animation/AnimBlendClumpData.h
@@ -18,7 +18,7 @@ struct AnimBlendFrameData
#ifdef PED_SKIN
union {
RwFrame *frame;
- RpHAnimStdKeyFrame *hanimFrame;
+ RpHAnimStdInterpFrame *hanimFrame;
};
int32 nodeID;
#else
diff --git a/src/animation/FrameUpdate.cpp b/src/animation/FrameUpdate.cpp
index a3a2013a..6e5501cb 100644
--- a/src/animation/FrameUpdate.cpp
+++ b/src/animation/FrameUpdate.cpp
@@ -236,7 +236,7 @@ FrameUpdateCallBackSkinned(AnimBlendFrameData *frame, void *arg)
CVector vec, pos(0.0f, 0.0f, 0.0f);
CQuaternion q, rot(0.0f, 0.0f, 0.0f, 0.0f);
float totalBlendAmount = 0.0f;
- RpHAnimStdKeyFrame *xform = frame->hanimFrame;
+ RpHAnimStdInterpFrame *xform = frame->hanimFrame;
CAnimBlendNode **node;
AnimBlendFrameUpdateData *updateData = (AnimBlendFrameUpdateData*)arg;
@@ -297,7 +297,7 @@ FrameUpdateCallBackWithVelocityExtractionSkinned(AnimBlendFrameData *frame, void
float curx = 0.0f, cury = 0.0f;
float endx = 0.0f, endy = 0.0f;
bool looped = false;
- RpHAnimStdKeyFrame *xform = frame->hanimFrame;
+ RpHAnimStdInterpFrame *xform = frame->hanimFrame;
CAnimBlendNode **node;
AnimBlendFrameUpdateData *updateData = (AnimBlendFrameUpdateData*)arg;
@@ -383,7 +383,7 @@ FrameUpdateCallBackWith3dVelocityExtractionSkinned(AnimBlendFrameData *frame, vo
CVector cur(0.0f, 0.0f, 0.0f);
CVector end(0.0f, 0.0f, 0.0f);
bool looped = false;
- RpHAnimStdKeyFrame *xform = frame->hanimFrame;
+ RpHAnimStdInterpFrame *xform = frame->hanimFrame;
CAnimBlendNode **node;
AnimBlendFrameUpdateData *updateData = (AnimBlendFrameUpdateData*)arg;
diff --git a/src/animation/RpAnimBlend.cpp b/src/animation/RpAnimBlend.cpp
index be70ad66..dcb656ee 100644
--- a/src/animation/RpAnimBlend.cpp
+++ b/src/animation/RpAnimBlend.cpp
@@ -170,7 +170,7 @@ RpAnimBlendClumpInitSkinned(RpClump *clump)
for(i = 0; i < numBones; i++){
frames[i].nodeID = HIERNODEID(hier, i);
frames[i].resetPos = boneTab[i];
- frames[i].hanimFrame = (RpHAnimStdKeyFrame*)rpHANIMHIERARCHYGETINTERPFRAME(hier, i);
+ frames[i].hanimFrame = (RpHAnimStdInterpFrame*)rpHANIMHIERARCHYGETINTERPFRAME(hier, i);
}
clumpData->ForAllFrames(FrameInitCBskin, nil);
clumpData->frames[0].flag |= AnimBlendFrameData::VELOCITY_EXTRACTION;
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 77e3a6b5..7c7e96d2 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -157,7 +157,7 @@ cAudioManager::PostInitialiseGameSpecificSetup()
m_sMissionAudio.m_nSampleIndex = NO_SAMPLE;
m_sMissionAudio.m_nLoadingStatus = LOADING_STATUS_NOT_LOADED;
m_sMissionAudio.m_nPlayStatus = PLAY_STATUS_STOPPED;
- m_sMissionAudio.field_22 = 0;
+ m_sMissionAudio.m_bIsPlaying = false;
m_sMissionAudio.m_bIsPlayed = false;
m_sMissionAudio.m_bPredefinedProperties = true;
m_sMissionAudio.m_nMissionAudioCounter = 0;
@@ -961,15 +961,15 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params)
}
break;
case 'F':
- if (automobile->m_aWheelState[VEHWHEEL_FRONT_LEFT] == WHEEL_STATE_SPINNING)
+ if (automobile->m_aWheelState[CARWHEEL_FRONT_LEFT] == WHEEL_STATE_SPINNING)
traction += 0.1f;
- if (automobile->m_aWheelState[VEHWHEEL_REAR_LEFT] == WHEEL_STATE_SPINNING)
+ if (automobile->m_aWheelState[CARWHEEL_FRONT_RIGHT] == WHEEL_STATE_SPINNING)
traction += 0.1f;
break;
case 'R':
- if (automobile->m_aWheelState[VEHWHEEL_FRONT_RIGHT] == WHEEL_STATE_SPINNING)
+ if (automobile->m_aWheelState[CARWHEEL_REAR_LEFT] == WHEEL_STATE_SPINNING)
traction += 0.1f;
- if (automobile->m_aWheelState[VEHWHEEL_REAR_RIGHT] == WHEEL_STATE_SPINNING)
+ if (automobile->m_aWheelState[CARWHEEL_REAR_RIGHT] == WHEEL_STATE_SPINNING)
traction += 0.1f;
break;
}
@@ -980,7 +980,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params)
relativeGearChange =
Min(1.0f, (params->m_fVelocityChange - transmission->Gears[currentGear].fShiftDownVelocity) / transmission->fMaxVelocity * 2.5f);
if (traction == 0.0f && automobile->GetStatus() != STATUS_SIMPLE &&
- params->m_fVelocityChange >= transmission->Gears[1].fShiftUpVelocity) {
+ params->m_fVelocityChange < transmission->Gears[1].fShiftUpVelocity) {
traction = 0.7f;
}
relativeChange = traction * automobile->m_fGasPedalAudio * 0.95f + (1.0f - traction) * relativeGearChange;
@@ -993,7 +993,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params)
relativeChange = automobile->m_fGasPedalAudio;
}
modificator = relativeChange;
- if (currentGear || !automobile->m_nWheelsOnGround)
+ if (currentGear != 0 || automobile->m_nWheelsOnGround == 0)
freq = 1200 * currentGear + 18000.f * modificator + 14000;
else
freq = 13000.f * modificator + 14000;
@@ -1250,12 +1250,12 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
lostTraction = true;
break;
case 'F':
- if ((automobile->m_aWheelState[VEHWHEEL_FRONT_LEFT] != WHEEL_STATE_NORMAL || automobile->m_aWheelState[VEHWHEEL_REAR_LEFT] != WHEEL_STATE_NORMAL) &&
- (automobile->m_aWheelState[VEHWHEEL_FRONT_RIGHT] != WHEEL_STATE_NORMAL || automobile->m_aWheelState[VEHWHEEL_REAR_RIGHT] != WHEEL_STATE_NORMAL))
+ if ((automobile->m_aWheelState[CARWHEEL_FRONT_LEFT] != WHEEL_STATE_NORMAL || automobile->m_aWheelState[CARWHEEL_FRONT_RIGHT] != WHEEL_STATE_NORMAL) &&
+ (automobile->m_aWheelState[CARWHEEL_REAR_LEFT] != WHEEL_STATE_NORMAL || automobile->m_aWheelState[CARWHEEL_REAR_RIGHT] != WHEEL_STATE_NORMAL))
lostTraction = true;
break;
case 'R':
- if ((automobile->m_aWheelState[VEHWHEEL_FRONT_RIGHT] != WHEEL_STATE_NORMAL) || (automobile->m_aWheelState[VEHWHEEL_REAR_RIGHT] != WHEEL_STATE_NORMAL))
+ if ((automobile->m_aWheelState[CARWHEEL_REAR_LEFT] != WHEEL_STATE_NORMAL) || (automobile->m_aWheelState[CARWHEEL_REAR_RIGHT] != WHEEL_STATE_NORMAL))
lostTraction = true;
break;
}
@@ -1279,7 +1279,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
SampleManager.StopChannel(m_nActiveSamples);
bAccelSampleStopped = true;
}
- if (!automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn || lostTraction)
+ if (automobile->m_nWheelsOnGround == 0 || automobile->bIsHandbrakeOn || lostTraction)
gasPedalAudio = automobile->m_fGasPedalAudio;
else
gasPedalAudio = Min(1.0f, params->m_fVelocityChange / params->m_pTransmission->fMaxReverseVelocity);
@@ -1292,8 +1292,8 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
bAccelSampleStopped = true;
}
nCruising = 0;
- if (!automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn || lostTraction ||
- params->m_fVelocityChange >= 0.01f && automobile->m_fGasPedalAudio > 0.2f) {
+ if (automobile->m_nWheelsOnGround == 0 || automobile->bIsHandbrakeOn || lostTraction ||
+ params->m_fVelocityChange < 0.01f && automobile->m_fGasPedalAudio > 0.2f) {
automobile->m_fGasPedalAudio *= 0.6f;
gasPedalAudio = automobile->m_fGasPedalAudio;
}
@@ -1313,11 +1313,11 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
CurrentPretendGear = Max(1, currentGear);
} else {
while (nCruising == 0) {
- if (accelerateState < 150 || !automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn || lostTraction ||
+ if (accelerateState < 150 || automobile->m_nWheelsOnGround == 0 || automobile->bIsHandbrakeOn || lostTraction ||
currentGear < 2 && velocityChange - automobile->m_fVelocityChangeForAudio < 0.01f) { // here could be used abs
- if (!automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn || lostTraction) {
- if (!automobile->m_nWheelsOnGround && automobile->m_nDriveWheelsOnGround ||
- (automobile->bIsHandbrakeOn && !bHandbrakeOnLastFrame || lostTraction && !bLostTractionLastFrame) && automobile->m_nWheelsOnGround) {
+ if (automobile->m_nWheelsOnGround == 0 || automobile->bIsHandbrakeOn || lostTraction) {
+ if (automobile->m_nWheelsOnGround == 0 && automobile->m_nDriveWheelsOnGround != 0 ||
+ (automobile->bIsHandbrakeOn && !bHandbrakeOnLastFrame || lostTraction && !bLostTractionLastFrame) && automobile->m_nWheelsOnGround != 0) {
automobile->m_fGasPedalAudio *= 0.6f;
}
freqModifier = 0;
@@ -1381,11 +1381,11 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
}
if (nCruising != 0) {
bAccelSampleStopped = true;
- if (accelerateState < 150 || !automobile->m_nWheelsOnGround || automobile->bIsHandbrakeOn || lostTraction ||
+ if (accelerateState < 150 || automobile->m_nWheelsOnGround == 0 || automobile->bIsHandbrakeOn || lostTraction ||
currentGear < params->m_pTransmission->nNumberOfGears - 1) {
nCruising = 0;
} else {
- if (accelerateState >= 220 && 0.001f + params->m_fVelocityChange < automobile->m_fVelocityChangeForAudio) {
+ if (accelerateState >= 220 && params->m_fVelocityChange + 0.001f < automobile->m_fVelocityChangeForAudio) {
if (nCruising < 800)
++nCruising;
} else if (nCruising > 3) {
@@ -1404,7 +1404,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *
bLostTractionLastFrame = lostTraction;
}
-void
+bool
cAudioManager::ProcessVehicleSkidding(cVehicleParams *params)
{
const float SOUND_INTENSITY = 40.0f;
@@ -1416,10 +1416,10 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams *params)
float skidVal = 0.0f;
if (params->m_fDistance >= SQR(SOUND_INTENSITY))
- return;
+ return false;
automobile = (CAutomobile *)params->m_pVehicle;
- if (!automobile->m_nWheelsOnGround)
- return;
+ if (automobile->m_nWheelsOnGround == 0)
+ return true;
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
for (int32 i = 0; i < ARRAY_SIZE(automobile->m_aWheelState); i++) {
if (automobile->m_aWheelState[i] == WHEEL_STATE_NORMAL || automobile->Damage.GetWheelStatus(i) == WHEEL_STATUS_MISSING)
@@ -1459,6 +1459,8 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams *params)
emittingVol /= 4;
m_sQueueSample.m_nFrequency = 13000.f * skidVal + 35000.f;
m_sQueueSample.m_nVolume /= 4;
+ if (m_sQueueSample.m_nVolume == 0)
+ return true;
break;
case SURFACE_GRAVEL:
case SURFACE_MUD_DRY:
@@ -1490,43 +1492,40 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams *params)
AddSampleToRequestedQueue();
}
}
+ return true;
}
float
cAudioManager::GetVehicleDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile, cTransmission *transmission, float velocityChange)
{
- tWheelState wheelState;
- float relativeVelChange;
+ float relativeVelChange = 0.0f;
float gasPedalAudio = automobile->m_fGasPedalAudio;
- float modificator;
float velChange;
float relativeVel;
- wheelState = automobile->m_aWheelState[wheel];
- if (wheelState == WHEEL_STATE_SPINNING && gasPedalAudio > 0.4f) {
- relativeVelChange = (gasPedalAudio - 0.4f) * 1.25f;
-
- } else if (wheelState == WHEEL_STATE_SKIDDING) {
+ switch (automobile->m_aWheelState[wheel])
+ {
+ case WHEEL_STATE_SPINNING:
+ if (gasPedalAudio > 0.4f)
+ relativeVelChange = (gasPedalAudio - 0.4f) * (5.0f / 3.0f) / (4.0f / 3.0f);
+ break;
+ case WHEEL_STATE_SKIDDING:
relativeVelChange = Min(1.0f, Abs(velocityChange) / transmission->fMaxVelocity);
- } else if (wheelState == WHEEL_STATE_FIXED) {
- modificator = 0.4f;
- relativeVelChange = gasPedalAudio;
- if (relativeVelChange > 0.4f) {
- relativeVelChange = relativeVelChange - 0.4f;
- modificator = 5.f / 3.f;
- }
+ break;
+ case WHEEL_STATE_FIXED:
+ relativeVel = gasPedalAudio;
+ if (relativeVel > 0.4f)
+ relativeVel = (gasPedalAudio - 0.4f) * (5.0f / 3.0f);
+
velChange = Abs(velocityChange);
- if (relativeVelChange > 0.4f)
- relativeVelChange = relativeVelChange * modificator;
- if (velChange > 0.04f) {
- relativeVel = Min(1.0f, velChange / transmission->fMaxVelocity);
- } else {
- relativeVel = 0.0f;
- }
- if (relativeVel >= relativeVelChange)
+ if (velChange > 0.04f)
+ relativeVelChange = Min(1.0f, velChange / transmission->fMaxVelocity);
+ if (relativeVel > relativeVelChange)
relativeVelChange = relativeVel;
- } else {
- relativeVelChange = 0.0f;
+
+ break;
+ default:
+ break;
}
return Max(relativeVelChange, Min(1.0f, Abs(automobile->m_vecTurnSpeed.z) * 20.0f));
@@ -1535,12 +1534,10 @@ cAudioManager::GetVehicleDriveWheelSkidValue(uint8 wheel, CAutomobile *automobil
float
cAudioManager::GetVehicleNonDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile, cTransmission *transmission, float velocityChange)
{
- float relativeVelChange;
+ float relativeVelChange = 0.0f;
if (automobile->m_aWheelState[wheel] == WHEEL_STATE_SKIDDING)
relativeVelChange = Min(1.0f, Abs(velocityChange) / transmission->fMaxVelocity);
- else
- relativeVelChange = 0.0f;
return Max(relativeVelChange, Min(1.0f, Abs(automobile->m_vecTurnSpeed.z) * 20.0f));
}
@@ -2426,10 +2423,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params)
AddSampleToRequestedQueue();
}
if (FindPlayerVehicle() == params->m_pVehicle) {
- if (Pads[0].GetAccelerate() <= Pads[0].GetBrake())
- padAccelerate = Pads[0].GetBrake();
- else
- padAccelerate = Pads[0].GetAccelerate();
+ padAccelerate = Max(Pads[0].GetAccelerate(), Pads[0].GetBrake());
padRelativeAccerate = padAccelerate / 255;
emittingVol = (100.f * padRelativeAccerate) + 15;
m_sQueueSample.m_nFrequency = (3000.f * padRelativeAccerate) + 6000;
@@ -2468,10 +2462,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params)
m_sQueueSample.m_bRequireReflection = false;
} else {
if (FindPlayerVehicle() == params->m_pVehicle) {
- if (Pads[0].GetAccelerate() <= Pads[0].GetBrake())
- padAccelerate = Pads[0].GetBrake();
- else
- padAccelerate = Pads[0].GetAccelerate();
+ padAccelerate = Max(Pads[0].GetAccelerate(), Pads[0].GetBrake());
if (padAccelerate <= 20) {
emittingVol = 45 - 45 * padAccelerate / 40;
m_sQueueSample.m_nFrequency = 100 * padAccelerate + 11025;
@@ -2547,7 +2538,7 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams *params)
return true;
velocityChange = Min(0.75f, velocityChange);
- multiplier = (velocityChange - 0.0005f) * 1.3342f;
+ multiplier = (velocityChange - 0.0005f) / (1499.0f / 2000.0f);
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
vol = (30.f * multiplier);
m_sQueueSample.m_nVolume = ComputeVolume(vol, 50.f, m_sQueueSample.m_fDistance);
@@ -2668,7 +2659,7 @@ cAudioManager::ProcessJumbo(cVehicleParams *params)
DoJumboVolOffset();
position = PlanePathPosition[plane->m_nPlaneId];
if (position <= TakeOffPoint) {
- if (plane->m_fSpeed <= 0.10334f) {
+ if (plane->m_fSpeed <= 0.103344f) {
ProcessJumboTaxi();
return;
}
@@ -2680,7 +2671,7 @@ cAudioManager::ProcessJumbo(cVehicleParams *params)
ProcessJumboFlying();
} else {
if (position > LandingPoint) {
- if (plane->m_fSpeed > 0.10334f) {
+ if (plane->m_fSpeed > 0.103344f) {
ProcessJumboDecel(plane);
return;
}
@@ -2710,7 +2701,7 @@ cAudioManager::ProcessJumboAccel(CPlane *plane)
float modificator;
if (SetupJumboFlySound(20)) {
- modificator = (plane->m_fSpeed - 0.10334f) * 1.676f;
+ modificator = (plane->m_fSpeed - 0.103344f) * 1.6760077f;
if (modificator > 1.0f)
modificator = 1.0f;
if (SetupJumboRumbleSound(MAX_VOLUME * modificator) && SetupJumboTaxiSound((1.0f - modificator) * 75.f)) {
@@ -2763,7 +2754,7 @@ void
cAudioManager::ProcessJumboDecel(CPlane *plane)
{
if (SetupJumboFlySound(20) && SetupJumboTaxiSound(75)) {
- const float modificator = Min(1.f, (plane->m_fSpeed - 0.10334f) * 1.676f);
+ const float modificator = Min(1.f, (plane->m_fSpeed - 0.103344f) * 1.6760077f);
SetupJumboEngineSound(MAX_VOLUME * modificator, 6050.f * modificator + 16000);
SetupJumboWhineSound(18, 29500);
}
@@ -8672,11 +8663,11 @@ cAudioManager::PreloadMissionAudio(Const char *name)
m_sMissionAudio.m_nSampleIndex = missionAudioSfx;
m_sMissionAudio.m_nLoadingStatus = LOADING_STATUS_NOT_LOADED;
m_sMissionAudio.m_nPlayStatus = PLAY_STATUS_STOPPED;
- m_sMissionAudio.field_22 = 0;
+ m_sMissionAudio.m_bIsPlaying = false;
m_sMissionAudio.m_nMissionAudioCounter = m_nTimeSpent * SampleManager.GetStreamedFileLength(missionAudioSfx) / 1000;
m_sMissionAudio.m_nMissionAudioCounter *= 4;
m_sMissionAudio.m_bIsPlayed = false;
- m_sMissionAudio.m_bPredefinedProperties = 1;
+ m_sMissionAudio.m_bPredefinedProperties = true;
g_bMissionAudioLoadFailed = false;
}
}
@@ -8726,7 +8717,7 @@ cAudioManager::ClearMissionAudio()
m_sMissionAudio.m_nSampleIndex = NO_SAMPLE;
m_sMissionAudio.m_nLoadingStatus = LOADING_STATUS_NOT_LOADED;
m_sMissionAudio.m_nPlayStatus = PLAY_STATUS_STOPPED;
- m_sMissionAudio.field_22 = 0;
+ m_sMissionAudio.m_bIsPlaying = false;
m_sMissionAudio.m_bIsPlayed = false;
m_sMissionAudio.m_bPredefinedProperties = true;
m_sMissionAudio.m_nMissionAudioCounter = 0;
@@ -8819,7 +8810,7 @@ cAudioManager::ProcessMissionAudio()
m_sMissionAudio.m_nMissionAudioCounter = 0;
}
}
- } else if (m_sMissionAudio.field_22) {
+ } else if (m_sMissionAudio.m_bIsPlaying) {
if (SampleManager.IsStreamPlaying(1) || m_nUserPause || m_nPreviousUserPause) {
if (m_nUserPause)
SampleManager.PauseStream(1, 1);
@@ -8839,7 +8830,7 @@ cAudioManager::ProcessMissionAudio()
break;
nCheckPlayingDelay = 0;
}
- m_sMissionAudio.field_22 = 1;
+ m_sMissionAudio.m_bIsPlaying = true;
}
break;
default:
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index 757254e6..58483602 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -436,7 +436,7 @@ cAudioManager::ServiceSoundEffects()
}
ClearActiveSamples();
}
- m_nActiveSampleQueue = m_nActiveSampleQueue != 1;
+ m_nActiveSampleQueue = m_nActiveSampleQueue == 1 ? 0 : 1;
ProcessReverb();
ProcessSpecial();
ClearRequestedQueue();
@@ -686,7 +686,7 @@ cAudioManager::AddReleasingSounds()
{
bool toProcess[44]; // why not 27?
- int8 queue = m_nActiveSampleQueue == 0;
+ int8 queue = m_nActiveSampleQueue == 0 ? 1 : 0;
for (int32 i = 0; i < m_SampleRequestQueuesStatus[queue]; i++) {
tSound &sample = m_asSamples[queue][m_abSampleQueueIndexTable[queue][i]];
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index 52c26552..363031b7 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -103,7 +103,7 @@ public:
int32 m_nSampleIndex;
uint8 m_nLoadingStatus;
uint8 m_nPlayStatus;
- uint8 field_22; // todo find a name
+ bool m_bIsPlaying;
int32 m_nMissionAudioCounter;
bool m_bIsPlayed;
};
@@ -421,7 +421,7 @@ public:
bool ProcessVehicleReverseWarning(cVehicleParams *params);
bool ProcessVehicleRoadNoise(cVehicleParams *params);
bool ProcessVehicleSirenOrAlarm(cVehicleParams *params);
- void ProcessVehicleSkidding(cVehicleParams *params);
+ bool ProcessVehicleSkidding(cVehicleParams *params);
void ProcessWaterCannon(int32);
void ProcessWeather(int32 id);
bool ProcessWetRoadNoise(cVehicleParams *params);
diff --git a/eax/eax-util.cpp b/src/audio/eax/eax-util.cpp
index 42eef738..42eef738 100644
--- a/eax/eax-util.cpp
+++ b/src/audio/eax/eax-util.cpp
diff --git a/eax/eax-util.h b/src/audio/eax/eax-util.h
index 441f0115..441f0115 100644
--- a/eax/eax-util.h
+++ b/src/audio/eax/eax-util.h
diff --git a/eax/eax.h b/src/audio/eax/eax.h
index b2210936..b2210936 100644
--- a/eax/eax.h
+++ b/src/audio/eax/eax.h
diff --git a/src/audio/oal/aldlist.cpp b/src/audio/oal/aldlist.cpp
index 3e86b1d7..881418c1 100644
--- a/src/audio/oal/aldlist.cpp
+++ b/src/audio/oal/aldlist.cpp
@@ -27,6 +27,7 @@
#ifndef _WIN32
#define _stricmp strcasecmp
#define _strnicmp strncasecmp
+#define _strdup strdup
#endif
#ifdef AUDIO_OAL
@@ -71,7 +72,7 @@ ALDeviceList::ALDeviceList()
if ((bNewName) && (actualDeviceName != NULL) && (strlen(actualDeviceName) > 0)) {
ALDEVICEINFO ALDeviceInfo;
ALDeviceInfo.bSelected = true;
- ALDeviceInfo.strDeviceName = actualDeviceName;
+ ALDeviceInfo.strDeviceName = _strdup(actualDeviceName);
alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(int), &ALDeviceInfo.iMajorVersion);
alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(int), &ALDeviceInfo.iMinorVersion);
diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp
index 34518f54..34080514 100644
--- a/src/audio/oal/stream.cpp
+++ b/src/audio/oal/stream.cpp
@@ -4,8 +4,15 @@
#include "stream.h"
#include "sampman.h"
+#ifdef AUDIO_OPUS
+#include <opusfile.h>
+#else
#ifdef _WIN32
+
+// TODO: This is due to version difference of 32-bit libmpg123 and 64-bit libmpg123, fix it
+#ifndef _WIN64
typedef long ssize_t;
+#endif
#pragma comment( lib, "libsndfile-1.lib" )
#pragma comment( lib, "libmpg123.lib" )
#else
@@ -13,7 +20,9 @@ typedef long ssize_t;
#endif
#include <sndfile.h>
#include <mpg123.h>
+#endif
+#ifndef AUDIO_OPUS
class CSndFile : public IDecoder
{
SNDFILE *m_pfSound;
@@ -166,19 +175,118 @@ public:
size_t size;
int err = mpg123_read(m_pMH, (unsigned char *)buffer, GetBufferSize(), &size);
+#if defined(__LP64__) || defined(_WIN64)
+ assert("We can't handle audio files more then 2 GB yet :shrug:" && (size < UINT32_MAX));
+#endif
if (err != MPG123_OK && err != MPG123_DONE) return 0;
- return size;
+ return (uint32)size;
}
};
+#else
+class COpusFile : public IDecoder
+{
+ OggOpusFile *m_FileH;
+ bool m_bOpened;
+ uint32 m_nRate;
+ uint32 m_nChannels;
+public:
+ COpusFile(const char *path) : m_FileH(nil),
+ m_bOpened(false),
+ m_nRate(0),
+ m_nChannels(0)
+ {
+ int ret;
+ m_FileH = op_open_file(path, &ret);
+
+ if (m_FileH) {
+ m_nChannels = op_head(m_FileH, 0)->channel_count;
+ m_nRate = op_head(m_FileH, 0)->input_sample_rate;
+ const OpusTags *tags = op_tags(m_FileH, 0);
+ for (int i = 0; i < tags->comments; i++) {
+ if (strncmp(tags->user_comments[i], "SAMPLERATE", sizeof("SAMPLERATE")-1) == 0)
+ {
+ sscanf(tags->user_comments[i], "SAMPLERATE=%i", &m_nRate);
+ break;
+ }
+ }
+
+ m_bOpened = true;
+ }
+ }
+
+ ~COpusFile()
+ {
+ if (m_FileH)
+ {
+ op_free(m_FileH);
+ m_FileH = nil;
+ }
+ }
+
+ bool IsOpened()
+ {
+ return m_bOpened;
+ }
+
+ uint32 GetSampleSize()
+ {
+ return sizeof(uint16);
+ }
+
+ uint32 GetSampleCount()
+ {
+ if ( !IsOpened() ) return 0;
+ return op_pcm_total(m_FileH, 0);
+ }
+
+ uint32 GetSampleRate()
+ {
+ return m_nRate;
+ }
+
+ uint32 GetChannels()
+ {
+ return m_nChannels;
+ }
+
+ void Seek(uint32 milliseconds)
+ {
+ if ( !IsOpened() ) return;
+ op_pcm_seek(m_FileH, ms2samples(milliseconds) * GetSampleSize());
+ }
+
+ uint32 Tell()
+ {
+ if ( !IsOpened() ) return 0;
+ return samples2ms(op_pcm_tell(m_FileH)/GetSampleSize());
+ }
+
+ uint32 Decode(void *buffer)
+ {
+ if ( !IsOpened() ) return 0;
+
+ int size = op_read(m_FileH, (opus_int16 *)buffer, GetBufferSamples(), NULL);
+
+ if (size < 0)
+ return 0;
+
+ return size * m_nChannels * GetSampleSize();
+ }
+};
+#endif
void CStream::Initialise()
{
+#ifndef AUDIO_OPUS
mpg123_init();
+#endif
}
void CStream::Terminate()
{
+#ifndef AUDIO_OPUS
mpg123_exit();
+#endif
}
CStream::CStream(char *filename, ALuint &source, ALuint (&buffers)[NUM_STREAMBUFFERS]) :
@@ -196,15 +304,11 @@ CStream::CStream(char *filename, ALuint &source, ALuint (&buffers)[NUM_STREAMBUF
{
// Be case-insensitive on linux (from https://github.com/OneSadCookie/fcaseopen/)
#if !defined(_WIN32)
- FILE *test = fopen(filename, "r");
- if (!test) {
- char *r = (char*)alloca(strlen(filename) + 2);
- if (casepath(filename, r))
- {
- strcpy(m_aFilename, r);
- }
+ char *real = casepath(filename);
+ if (real) {
+ strcpy(m_aFilename, real);
+ free(real);
} else {
- fclose(test);
#else
{
#endif
@@ -213,10 +317,15 @@ CStream::CStream(char *filename, ALuint &source, ALuint (&buffers)[NUM_STREAMBUF
DEV("Stream %s\n", m_aFilename);
+#ifndef AUDIO_OPUS
if (!strcasecmp(&m_aFilename[strlen(m_aFilename) - strlen(".mp3")], ".mp3"))
m_pSoundFile = new CMP3File(m_aFilename);
else if (!strcasecmp(&m_aFilename[strlen(m_aFilename) - strlen(".wav")], ".wav"))
m_pSoundFile = new CSndFile(m_aFilename);
+#else
+ if (!strcasecmp(&m_aFilename[strlen(m_aFilename) - strlen(".opus")], ".opus"))
+ m_pSoundFile = new COpusFile(m_aFilename);
+#endif
else
m_pSoundFile = nil;
ASSERT(m_pSoundFile != nil);
diff --git a/src/audio/sampman.h b/src/audio/sampman.h
index 391e884b..9a94e16f 100644
--- a/src/audio/sampman.h
+++ b/src/audio/sampman.h
@@ -218,8 +218,141 @@ public:
extern cSampleManager SampleManager;
extern uint32 BankStartOffset[MAX_SAMPLEBANKS];
+#ifdef AUDIO_OPUS
+static char StreamedNameTable[][25] = {
+ "AUDIO\\HEAD.OPUS", "AUDIO\\CLASS.OPUS", "AUDIO\\KJAH.OPUS", "AUDIO\\RISE.OPUS", "AUDIO\\LIPS.OPUS", "AUDIO\\GAME.OPUS",
+ "AUDIO\\MSX.OPUS", "AUDIO\\FLASH.OPUS", "AUDIO\\CHAT.OPUS", "AUDIO\\HEAD.OPUS", "AUDIO\\POLICE.OPUS", "AUDIO\\CITY.OPUS",
+ "AUDIO\\WATER.OPUS", "AUDIO\\COMOPEN.OPUS", "AUDIO\\SUBOPEN.OPUS", "AUDIO\\JB.OPUS", "AUDIO\\BET.OPUS", "AUDIO\\L1_LG.OPUS",
+ "AUDIO\\L2_DSB.OPUS", "AUDIO\\L3_DM.OPUS", "AUDIO\\L4_PAP.OPUS", "AUDIO\\L5_TFB.OPUS", "AUDIO\\J0_DM2.OPUS", "AUDIO\\J1_LFL.OPUS",
+ "AUDIO\\J2_KCL.OPUS", "AUDIO\\J3_VH.OPUS", "AUDIO\\J4_ETH.OPUS", "AUDIO\\J5_DST.OPUS", "AUDIO\\J6_TBJ.OPUS", "AUDIO\\T1_TOL.OPUS",
+ "AUDIO\\T2_TPU.OPUS", "AUDIO\\T3_MAS.OPUS", "AUDIO\\T4_TAT.OPUS", "AUDIO\\T5_BF.OPUS", "AUDIO\\S0_MAS.OPUS", "AUDIO\\S1_PF.OPUS",
+ "AUDIO\\S2_CTG.OPUS", "AUDIO\\S3_RTC.OPUS", "AUDIO\\S5_LRQ.OPUS", "AUDIO\\S4_BDBA.OPUS", "AUDIO\\S4_BDBB.OPUS", "AUDIO\\S2_CTG2.OPUS",
+ "AUDIO\\S4_BDBD.OPUS", "AUDIO\\S5_LRQB.OPUS", "AUDIO\\S5_LRQC.OPUS", "AUDIO\\A1_SSO.OPUS", "AUDIO\\A2_PP.OPUS", "AUDIO\\A3_SS.OPUS",
+ "AUDIO\\A4_PDR.OPUS", "AUDIO\\A5_K2FT.OPUS", "AUDIO\\K1_KBO.OPUS", "AUDIO\\K2_GIS.OPUS", "AUDIO\\K3_DS.OPUS", "AUDIO\\K4_SHI.OPUS",
+ "AUDIO\\K5_SD.OPUS", "AUDIO\\R0_PDR2.OPUS", "AUDIO\\R1_SW.OPUS", "AUDIO\\R2_AP.OPUS", "AUDIO\\R3_ED.OPUS", "AUDIO\\R4_GF.OPUS",
+ "AUDIO\\R5_PB.OPUS", "AUDIO\\R6_MM.OPUS", "AUDIO\\D1_STOG.OPUS", "AUDIO\\D2_KK.OPUS", "AUDIO\\D3_ADO.OPUS", "AUDIO\\D5_ES.OPUS",
+ "AUDIO\\D7_MLD.OPUS", "AUDIO\\D4_GTA.OPUS", "AUDIO\\D4_GTA2.OPUS", "AUDIO\\D6_STS.OPUS", "AUDIO\\A6_BAIT.OPUS", "AUDIO\\A7_ETG.OPUS",
+ "AUDIO\\A8_PS.OPUS", "AUDIO\\A9_ASD.OPUS", "AUDIO\\K4_SHI2.OPUS", "AUDIO\\C1_TEX.OPUS", "AUDIO\\EL_PH1.OPUS", "AUDIO\\EL_PH2.OPUS",
+ "AUDIO\\EL_PH3.OPUS", "AUDIO\\EL_PH4.OPUS", "AUDIO\\YD_PH1.OPUS", "AUDIO\\YD_PH2.OPUS", "AUDIO\\YD_PH3.OPUS", "AUDIO\\YD_PH4.OPUS",
+ "AUDIO\\HD_PH1.OPUS", "AUDIO\\HD_PH2.OPUS", "AUDIO\\HD_PH3.OPUS", "AUDIO\\HD_PH4.OPUS", "AUDIO\\HD_PH5.OPUS", "AUDIO\\MT_PH1.OPUS",
+ "AUDIO\\MT_PH2.OPUS", "AUDIO\\MT_PH3.OPUS", "AUDIO\\MT_PH4.OPUS", "AUDIO\\MISCOM.OPUS", "AUDIO\\END.OPUS", "AUDIO\\lib_a1.OPUS",
+ "AUDIO\\lib_a2.OPUS", "AUDIO\\lib_a.OPUS", "AUDIO\\lib_b.OPUS", "AUDIO\\lib_c.OPUS", "AUDIO\\lib_d.OPUS", "AUDIO\\l2_a.OPUS",
+ "AUDIO\\j4t_1.OPUS", "AUDIO\\j4t_2.OPUS", "AUDIO\\j4t_3.OPUS", "AUDIO\\j4t_4.OPUS", "AUDIO\\j4_a.OPUS", "AUDIO\\j4_b.OPUS",
+ "AUDIO\\j4_c.OPUS", "AUDIO\\j4_d.OPUS", "AUDIO\\j4_e.OPUS", "AUDIO\\j4_f.OPUS", "AUDIO\\j6_1.OPUS", "AUDIO\\j6_a.OPUS",
+ "AUDIO\\j6_b.OPUS", "AUDIO\\j6_c.OPUS", "AUDIO\\j6_d.OPUS", "AUDIO\\t4_a.OPUS", "AUDIO\\s1_a.OPUS", "AUDIO\\s1_a1.OPUS",
+ "AUDIO\\s1_b.OPUS", "AUDIO\\s1_c.OPUS", "AUDIO\\s1_c1.OPUS", "AUDIO\\s1_d.OPUS", "AUDIO\\s1_e.OPUS", "AUDIO\\s1_f.OPUS",
+ "AUDIO\\s1_g.OPUS", "AUDIO\\s1_h.OPUS", "AUDIO\\s1_i.OPUS", "AUDIO\\s1_j.OPUS", "AUDIO\\s1_k.OPUS", "AUDIO\\s1_l.OPUS",
+ "AUDIO\\s3_a.OPUS", "AUDIO\\s3_b.OPUS", "AUDIO\\el3_a.OPUS", "AUDIO\\mf1_a.OPUS", "AUDIO\\mf2_a.OPUS", "AUDIO\\mf3_a.OPUS",
+ "AUDIO\\mf3_b.OPUS", "AUDIO\\mf3_b1.OPUS", "AUDIO\\mf3_c.OPUS", "AUDIO\\mf4_a.OPUS", "AUDIO\\mf4_b.OPUS", "AUDIO\\mf4_c.OPUS",
+ "AUDIO\\a1_a.OPUS", "AUDIO\\a3_a.OPUS", "AUDIO\\a5_a.OPUS", "AUDIO\\a4_a.OPUS", "AUDIO\\a4_b.OPUS", "AUDIO\\a4_c.OPUS",
+ "AUDIO\\a4_d.OPUS", "AUDIO\\k1_a.OPUS", "AUDIO\\k3_a.OPUS", "AUDIO\\r1_a.OPUS", "AUDIO\\r2_a.OPUS", "AUDIO\\r2_b.OPUS",
+ "AUDIO\\r2_c.OPUS", "AUDIO\\r2_d.OPUS", "AUDIO\\r2_e.OPUS", "AUDIO\\r2_f.OPUS", "AUDIO\\r2_g.OPUS", "AUDIO\\r2_h.OPUS",
+ "AUDIO\\r5_a.OPUS", "AUDIO\\r6_a.OPUS", "AUDIO\\r6_a1.OPUS", "AUDIO\\r6_b.OPUS", "AUDIO\\lo2_a.OPUS", "AUDIO\\lo6_a.OPUS",
+ "AUDIO\\yd2_a.OPUS", "AUDIO\\yd2_b.OPUS", "AUDIO\\yd2_c.OPUS", "AUDIO\\yd2_c1.OPUS", "AUDIO\\yd2_d.OPUS", "AUDIO\\yd2_e.OPUS",
+ "AUDIO\\yd2_f.OPUS", "AUDIO\\yd2_g.OPUS", "AUDIO\\yd2_h.OPUS", "AUDIO\\yd2_ass.OPUS", "AUDIO\\yd2_ok.OPUS", "AUDIO\\h5_a.OPUS",
+ "AUDIO\\h5_b.OPUS", "AUDIO\\h5_c.OPUS", "AUDIO\\ammu_a.OPUS", "AUDIO\\ammu_b.OPUS", "AUDIO\\ammu_c.OPUS", "AUDIO\\door_1.OPUS",
+ "AUDIO\\door_2.OPUS", "AUDIO\\door_3.OPUS", "AUDIO\\door_4.OPUS", "AUDIO\\door_5.OPUS", "AUDIO\\door_6.OPUS", "AUDIO\\t3_a.OPUS",
+ "AUDIO\\t3_b.OPUS", "AUDIO\\t3_c.OPUS", "AUDIO\\k1_b.OPUS", "AUDIO\\cat1.OPUS"};
+#else
static char StreamedNameTable[][25]=
{
+#ifdef PS2_AUDIO
+ "AUDIO\\MUSIC\\HEAD.VB",
+ "AUDIO\\MUSIC\\CLASS.VB",
+ "AUDIO\\MUSIC\\KJAH.VB",
+ "AUDIO\\MUSIC\\RISE.VB",
+ "AUDIO\\MUSIC\\LIPS.VB",
+ "AUDIO\\MUSIC\\GAME.VB",
+ "AUDIO\\MUSIC\\MSX.VB",
+ "AUDIO\\MUSIC\\FLASH.VB",
+ "AUDIO\\MUSIC\\CHAT.VB",
+ "AUDIO\\MUSIC\\HEAD.VB",
+ "AUDIO\\MUSIC\\POLICE.VB",
+ "AUDIO\\MUSIC\\CITY.VB",
+ "AUDIO\\MUSIC\\WATER.VB",
+ "AUDIO\\MUSIC\\COMOPEN.VB",
+ "AUDIO\\MUSIC\\SUBOPEN.VB",
+ "AUDIO\\OTHER\\JB.VB",
+ "AUDIO\\OTHER\\BET.VB",
+ "AUDIO\\LUIGI\\L1_LG.VB",
+ "AUDIO\\LUIGI\\L2_DSB.VB",
+ "AUDIO\\LUIGI\\L3_DM.VB",
+ "AUDIO\\LUIGI\\L4_PAP.VB",
+ "AUDIO\\LUIGI\\L5_TFB.VB",
+ "AUDIO\\JOEY\\J0_DM2.VB",
+ "AUDIO\\JOEY\\J1_LFL.VB",
+ "AUDIO\\JOEY\\J2_KCL.VB",
+ "AUDIO\\JOEY\\J3_VH.VB",
+ "AUDIO\\JOEY\\J4_ETH.VB",
+ "AUDIO\\JOEY\\J5_DST.VB",
+ "AUDIO\\JOEY\\J6_TBJ.VB",
+ "AUDIO\\TONI\\T1_TOL.VB",
+ "AUDIO\\TONI\\T2_TPU.VB",
+ "AUDIO\\TONI\\T3_MAS.VB",
+ "AUDIO\\TONI\\T4_TAT.VB",
+ "AUDIO\\TONI\\T5_BF.VB",
+ "AUDIO\\SAL\\S0_MAS.VB",
+ "AUDIO\\SAL\\S1_PF.VB",
+ "AUDIO\\SAL\\S2_CTG.VB",
+ "AUDIO\\SAL\\S3_RTC.VB",
+ "AUDIO\\SAL\\S5_LRQ.VB",
+ "AUDIO\\EBALL\\S4_BDBA.VB",
+ "AUDIO\\EBALL\\S4_BDBB.VB",
+ "AUDIO\\SAL\\S2_CTG2.VB",
+ "AUDIO\\SAL\\S4_BDBD.VB",
+ "AUDIO\\SAL\\S5_LRQB.VB",
+ "AUDIO\\SAL\\S5_LRQC.VB",
+ "AUDIO\\ASUKA\\A1_SSO.VB",
+ "AUDIO\\ASUKA\\A2_PP.VB",
+ "AUDIO\\ASUKA\\A3_SS.VB",
+ "AUDIO\\ASUKA\\A4_PDR.VB",
+ "AUDIO\\ASUKA\\A5_K2FT.VB",
+ "AUDIO\\KENJI\\K1_KBO.VB",
+ "AUDIO\\KENJI\\K2_GIS.VB",
+ "AUDIO\\KENJI\\K3_DS.VB",
+ "AUDIO\\KENJI\\K4_SHI.VB",
+ "AUDIO\\KENJI\\K5_SD.VB",
+ "AUDIO\\RAY\\R0_PDR2.VB",
+ "AUDIO\\RAY\\R1_SW.VB",
+ "AUDIO\\RAY\\R2_AP.VB",
+ "AUDIO\\RAY\\R3_ED.VB",
+ "AUDIO\\RAY\\R4_GF.VB",
+ "AUDIO\\RAY\\R5_PB.VB",
+ "AUDIO\\RAY\\R6_MM.VB",
+ "AUDIO\\LOVE\\D1_STOG.VB",
+ "AUDIO\\LOVE\\D2_KK.VB",
+ "AUDIO\\LOVE\\D3_ADO.VB",
+ "AUDIO\\LOVE\\D5_ES.VB",
+ "AUDIO\\LOVE\\D7_MLD.VB",
+ "AUDIO\\LOVE\\D4_GTA.VB",
+ "AUDIO\\LOVE\\D4_GTA2.VB",
+ "AUDIO\\LOVE\\D6_STS.VB",
+ "AUDIO\\ASUKA\\A6_BAIT.VB",
+ "AUDIO\\ASUKA\\A7_ETG.VB",
+ "AUDIO\\ASUKA\\A8_PS.VB",
+ "AUDIO\\ASUKA\\A9_ASD.VB",
+ "AUDIO\\SHOP\\K4_SHI2.VB",
+ "AUDIO\\OTHER\\C1_TEX.VB",
+ "AUDIO\\PHONE\\EL_PH1.VB",
+ "AUDIO\\PHONE\\EL_PH2.VB",
+ "AUDIO\\PHONE\\EL_PH3.VB",
+ "AUDIO\\PHONE\\EL_PH4.VB",
+ "AUDIO\\PHONE\\YD_PH1.VB",
+ "AUDIO\\PHONE\\YD_PH2.VB",
+ "AUDIO\\PHONE\\YD_PH3.VB",
+ "AUDIO\\PHONE\\YD_PH4.VB",
+ "AUDIO\\PHONE\\HD_PH1.VB",
+ "AUDIO\\PHONE\\HD_PH2.VB",
+ "AUDIO\\PHONE\\HD_PH3.VB",
+ "AUDIO\\PHONE\\HD_PH4.VB",
+ "AUDIO\\PHONE\\HD_PH5.VB",
+ "AUDIO\\PHONE\\MT_PH1.VB",
+ "AUDIO\\PHONE\\MT_PH2.VB",
+ "AUDIO\\PHONE\\MT_PH3.VB",
+ "AUDIO\\PHONE\\MT_PH4.VB",
+ "AUDIO\\MUSIC\\MISCOM.VB",
+ "AUDIO\\MUSIC\\END.VB",
+#else
"AUDIO\\HEAD.WAV",
"AUDIO\\CLASS.WAV",
"AUDIO\\KJAH.WAV",
@@ -315,6 +448,7 @@ static char StreamedNameTable[][25]=
"AUDIO\\MT_PH4.MP3",
"AUDIO\\MISCOM.WAV",
"AUDIO\\END.MP3",
+#endif
"AUDIO\\lib_a1.WAV",
"AUDIO\\lib_a2.WAV",
"AUDIO\\lib_a.WAV",
@@ -417,3 +551,4 @@ static char StreamedNameTable[][25]=
"AUDIO\\k1_b.WAV",
"AUDIO\\cat1.WAV"
};
+#endif \ No newline at end of file
diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp
index d625ac35..098b6efa 100644
--- a/src/audio/sampman_miles.cpp
+++ b/src/audio/sampman_miles.cpp
@@ -959,6 +959,15 @@ cSampleManager::Initialise(void)
}
+#ifdef AUDIO_CACHE
+ TRACE("cache");
+ FILE *cacheFile = fopen("audio\\sound.cache", "rb");
+ if (cacheFile) {
+ fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
+ fclose(cacheFile);
+ m_bInitialised = true;
+ }else {
+#endif
TRACE("cdrom");
S32 tatalms;
@@ -1115,7 +1124,13 @@ cSampleManager::Initialise(void)
_bUseHDDAudio = false;
}
#endif
-
+#ifdef AUDIO_CACHE
+ cacheFile = fopen("audio\\sound.cache", "wb");
+ fwrite(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
+ fclose(cacheFile);
+ }
+#endif
+
TRACE("stream");
{
for ( int32 i = 0; i < MAX_STREAMS; i++ )
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp
index 1952f370..0e173152 100644
--- a/src/audio/sampman_oal.cpp
+++ b/src/audio/sampman_oal.cpp
@@ -27,6 +27,9 @@
#include "MusicManager.h"
#include "Frontend.h"
#include "Timer.h"
+#ifdef AUDIO_OPUS
+#include <opusfile.h>
+#endif
//TODO: fix eax3 reverb
//TODO: max channals
@@ -69,7 +72,11 @@ char SampleBankDescFilename[] = "audio/sfx.SDT";
char SampleBankDataFilename[] = "audio/sfx.RAW";
FILE *fpSampleDescHandle;
+#ifdef AUDIO_OPUS
+OggOpusFile *fpSampleDataHandle;
+#else
FILE *fpSampleDataHandle;
+#endif
bool bSampleBankLoaded [MAX_SAMPLEBANKS];
int32 nSampleBankDiscStartOffset [MAX_SAMPLEBANKS];
int32 nSampleBankSize [MAX_SAMPLEBANKS];
@@ -444,6 +451,8 @@ int8 cSampleManager::GetCurrent3DProviderIndex(void)
int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
{
ASSERT( nProvider < m_nNumberOfProviders );
+ if (nProvider >= m_nNumberOfProviders)
+ nProvider = 0;
int savedprovider = curprovider;
if ( nProvider < m_nNumberOfProviders )
@@ -604,7 +613,13 @@ cSampleManager::Initialise(void)
return false;
}
}
-
+#ifdef AUDIO_CACHE
+ FILE *cacheFile = fopen("audio\\sound.cache", "rb");
+ if (cacheFile) {
+ fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
+ fclose(cacheFile);
+ } else
+#endif
{
for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ )
@@ -622,6 +637,11 @@ cSampleManager::Initialise(void)
else
USERERROR("Can't open '%s'\n", StreamedNameTable[i]);
}
+#ifdef AUDIO_CACHE
+ cacheFile = fopen("audio\\sound.cache", "wb");
+ fwrite(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
+ fclose(cacheFile);
+#endif
}
LoadSampleBank(SAMPLEBANK_MAIN);
@@ -743,12 +763,27 @@ cSampleManager::LoadSampleBank(uint8 nBank)
return false;
}
+#ifdef AUDIO_OPUS
+ int samplesRead = 0;
+ int samplesSize = nSampleBankSize[nBank] / 2;
+ op_pcm_seek(fpSampleDataHandle, 0);
+ while (samplesSize > 0) {
+ int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[nBank] + samplesRead), samplesSize, NULL);
+ if (size <= 0) {
+ // huh?
+ //assert(0);
+ break;
+ }
+ samplesRead += size*2;
+ samplesSize -= size;
+ }
+#else
if ( fseek(fpSampleDataHandle, nSampleBankDiscStartOffset[nBank], SEEK_SET) != 0 )
return false;
if ( fread((void *)nSampleBankMemoryStartAddress[nBank], 1, nSampleBankSize[nBank], fpSampleDataHandle) != nSampleBankSize[nBank] )
return false;
-
+#endif
bSampleBankLoaded[nBank] = true;
return true;
@@ -840,13 +875,28 @@ cSampleManager::LoadPedComment(uint32 nComment)
}
}
}
-
+
+#ifdef AUDIO_OPUS
+ int samplesRead = 0;
+ int samplesSize = m_aSamples[nComment].nSize / 2;
+ op_pcm_seek(fpSampleDataHandle, m_aSamples[nComment].nOffset / 2);
+ while (samplesSize > 0) {
+ int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE * nCurrentPedSlot + samplesRead),
+ samplesSize, NULL);
+ if (size <= 0) {
+ return false;
+ }
+ samplesRead += size * 2;
+ samplesSize -= size;
+ }
+#else
if ( fseek(fpSampleDataHandle, m_aSamples[nComment].nOffset, SEEK_SET) != 0 )
return false;
if ( fread((void *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
return false;
-
+
+#endif
nPedSlotSfx[nCurrentPedSlot] = nComment;
alBufferData(pedBuffers[nCurrentPedSlot],
@@ -1376,7 +1426,7 @@ cSampleManager::InitialiseSampleBanks(void)
fpSampleDescHandle = fopen(SampleBankDescFilename, "rb");
if ( fpSampleDescHandle == NULL )
return false;
-
+#ifndef AUDIO_OPUS
fpSampleDataHandle = fopen(SampleBankDataFilename, "rb");
if ( fpSampleDataHandle == NULL )
{
@@ -1389,9 +1439,14 @@ cSampleManager::InitialiseSampleBanks(void)
fseek(fpSampleDataHandle, 0, SEEK_END);
int32 _nSampleDataEndOffset = ftell(fpSampleDataHandle);
rewind(fpSampleDataHandle);
-
+#else
+ int e;
+ fpSampleDataHandle = op_open_file(SampleBankDataFilename, &e);
+#endif
fread(m_aSamples, sizeof(tSample), TOTAL_AUDIO_SAMPLES, fpSampleDescHandle);
-
+#ifdef AUDIO_OPUS
+ int32 _nSampleDataEndOffset = m_aSamples[TOTAL_AUDIO_SAMPLES - 1].nOffset + m_aSamples[TOTAL_AUDIO_SAMPLES - 1].nSize;
+#endif
fclose(fpSampleDescHandle);
fpSampleDescHandle = NULL;
@@ -1409,7 +1464,7 @@ cSampleManager::InitialiseSampleBanks(void)
nSampleBankSize[SAMPLEBANK_MAIN] = nSampleBankDiscStartOffset[SAMPLEBANK_PED] - nSampleBankDiscStartOffset[SAMPLEBANK_MAIN];
nSampleBankSize[SAMPLEBANK_PED] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SAMPLEBANK_PED];
-
+
return true;
}
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp
index b3fc85ae..ab44510d 100644
--- a/src/control/CarAI.cpp
+++ b/src/control/CarAI.cpp
@@ -381,7 +381,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
if (flatSpeed < SQR(0.018f) && CTimer::GetTimeInMilliseconds() - pVehicle->AutoPilot.m_nAntiReverseTimer > 2000){
pVehicle->AutoPilot.m_nTempAction = TEMPACT_REVERSE;
if (pVehicle->AutoPilot.m_nCarMission != MISSION_NONE &&
- pVehicle->AutoPilot.m_nCarMission != MISSION_CRUISE || pVehicle->VehicleCreatedBy == RANDOM_VEHICLE)
+ pVehicle->AutoPilot.m_nCarMission != MISSION_CRUISE || pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 1500;
else
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 750;
@@ -406,7 +406,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 400;
}
}
- if (pVehicle->GetUp().z < 0.7f){
+ if (pVehicle->GetUp().z < -0.7f){
pVehicle->AutoPilot.m_nTempAction = TEMPACT_WAIT;
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 1000;
}
@@ -509,14 +509,14 @@ void CCarAI::AddFiretruckOccupants(CVehicle* pVehicle)
void CCarAI::TellOccupantsToLeaveCar(CVehicle* pVehicle)
{
if (pVehicle->pDriver){
- pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle);
+ pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle);
if (pVehicle->GetModelIndex() == MI_AMBULAN)
pVehicle->pDriver->Say(SOUND_PED_LEAVE_VEHICLE);
}
int timer = 100;
for (int i = 0; i < pVehicle->m_nNumMaxPassengers; i++){
if (pVehicle->pPassengers[i]) {
- pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle);
+ pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle);
}
}
}
diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp
index 04983e30..47b4586b 100644
--- a/src/control/GameLogic.cpp
+++ b/src/control/GameLogic.cpp
@@ -121,8 +121,8 @@ CGameLogic::Update()
CCarCtrl::ClearInterestingVehicleList();
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
CRestart::FindClosestHospitalRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
- CRestart::OverrideHospitalLevel = LEVEL_NONE;
- CRestart::OverridePoliceStationLevel = LEVEL_NONE;
+ CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
+ CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
PassTime(720);
RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat);
SortOutStreamingAndMemory(pPlayerInfo.GetPos());
@@ -200,8 +200,8 @@ CGameLogic::Update()
CCarCtrl::ClearInterestingVehicleList();
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
- CRestart::OverrideHospitalLevel = LEVEL_NONE;
- CRestart::OverridePoliceStationLevel = LEVEL_NONE;
+ CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
+ CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
PassTime(720);
RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat);
pPlayerInfo.m_pPed->ClearWeapons();
@@ -249,8 +249,8 @@ CGameLogic::Update()
CCarCtrl::ClearInterestingVehicleList();
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
- CRestart::OverridePoliceStationLevel = LEVEL_NONE;
- CRestart::OverrideHospitalLevel = LEVEL_NONE;
+ CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
+ CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat);
SortOutStreamingAndMemory(pPlayerInfo.GetPos());
TheCamera.m_fCamShakeForce = 0.0f;
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index e37df8d4..33675ecf 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -141,6 +141,9 @@ void CGarages::Init(void)
MessageStartTime = 0;
PlayerInGarage = false;
BombsAreFree = false;
+#ifdef FIX_BUGS
+ RespraysAreFree = false;
+#endif
CarsCollected = 0;
BankVansCollected = 0;
PoliceCarsCollected = 0;
@@ -390,7 +393,7 @@ void CGarage::Update()
bTakeMoney = true;
FindPlayerPed()->m_pWanted->Reset();
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_GARAGE);
- FindPlayerPed()->m_pWanted->m_bIgnoredByCops = true;
+ FindPlayerPed()->m_pWanted->m_bIgnoredByCops = false;
#ifdef FIX_BUGS
bool bChangedColour = false;
#else
@@ -1175,7 +1178,7 @@ bool CGarage::IsStaticPlayerCarEntirelyInside()
return false;
if (FindPlayerPed()->GetPedState() != PED_DRIVING)
return false;
- if (FindPlayerPed()->m_objective == OBJECTIVE_LEAVE_VEHICLE)
+ if (FindPlayerPed()->m_objective == OBJECTIVE_LEAVE_CAR)
return false;
CVehicle* pVehicle = FindPlayerVehicle();
if (pVehicle->GetPosition().x < m_fX1 || pVehicle->GetPosition().x > m_fX2 ||
diff --git a/src/control/Phones.cpp b/src/control/Phones.cpp
index b89641f9..ad29d4fb 100644
--- a/src/control/Phones.cpp
+++ b/src/control/Phones.cpp
@@ -34,15 +34,14 @@ CPed *CPhoneInfo::pCallBackPed; // ped who picking up the phone (reset after pic
after 60 seconds of last phone pick-up.
*/
-#ifdef TOGGLEABLE_BETA_FEATURES
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
CPed* crimeReporters[NUMPHONES] = {};
bool
isPhoneAvailable(int m_phoneId)
{
- return gPhoneInfo.m_aPhones[m_phoneId].m_nState == PHONE_STATE_FREE &&
- (crimeReporters[m_phoneId] == nil || !crimeReporters[m_phoneId]->IsPointerValid() || !crimeReporters[m_phoneId]->bRunningToPhone || crimeReporters[m_phoneId]->m_objective > OBJECTIVE_IDLE ||
+ return crimeReporters[m_phoneId] == nil || !crimeReporters[m_phoneId]->IsPointerValid() || crimeReporters[m_phoneId]->m_objective > OBJECTIVE_WAIT_ON_FOOT ||
crimeReporters[m_phoneId]->m_nLastPedState != PED_SEEK_POS &&
- (crimeReporters[m_phoneId]->m_nPedState != PED_MAKE_CALL && crimeReporters[m_phoneId]->m_nPedState != PED_FACE_PHONE && crimeReporters[m_phoneId]->m_nPedState != PED_SEEK_POS));
+ (crimeReporters[m_phoneId]->m_nPedState != PED_MAKE_CALL && crimeReporters[m_phoneId]->m_nPedState != PED_FACE_PHONE && crimeReporters[m_phoneId]->m_nPedState != PED_SEEK_POS);
}
#endif
@@ -162,13 +161,14 @@ CPhoneInfo::FindNearestFreePhone(CVector *pos)
int nearestPhoneId = -1;
float nearestPhoneDist = 60.0f;
- for (int phoneId = 0; phoneId < m_nMax; phoneId++) {
+ for (int phoneId = 0; phoneId < m_nMax; phoneId++) {
- if (gPhoneInfo.m_aPhones[phoneId].m_nState == PHONE_STATE_FREE
-#ifdef TOGGLEABLE_BETA_FEATURES
- && isPhoneAvailable(phoneId)
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ if (isPhoneAvailable(phoneId))
+#else
+ if (gPhoneInfo.m_aPhones[phoneId].m_nState == PHONE_STATE_FREE)
#endif
- ) {
+ {
float phoneDist = (m_aPhones[phoneId].m_vecPos - *pos).Magnitude2D();
if (phoneDist < nearestPhoneDist) {
@@ -213,8 +213,42 @@ void
CPhoneInfo::Load(uint8 *buf, uint32 size)
{
INITSAVEBUF
- m_nMax = ReadSaveBuf<int32>(buf);
- m_nScriptPhonesMax = ReadSaveBuf<int32>(buf);
+ int max = ReadSaveBuf<int32>(buf);
+ int scriptPhonesMax = ReadSaveBuf<int32>(buf);
+
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ m_nMax = Min(NUMPHONES, max);
+ m_nScriptPhonesMax = 0;
+
+ bool ignoreOtherPhones = false;
+
+ // We can do it without touching saves. We'll only load script phones, others are already loaded in Initialise
+ for (int i = 0; i < 50; i++) {
+ CPhone phoneToLoad = ReadSaveBuf<CPhone>(buf);
+
+ if (ignoreOtherPhones)
+ continue;
+
+ if (i < scriptPhonesMax) {
+ if (i >= m_nMax) {
+ assert(0 && "Number of phones used by script exceeds the NUMPHONES or the stored phones in save file. Ignoring some phones");
+ ignoreOtherPhones = true;
+ continue;
+ }
+ SwapPhone(phoneToLoad.m_vecPos.x, phoneToLoad.m_vecPos.y, i);
+
+ m_aPhones[i] = phoneToLoad;
+ // It's saved as building pool index in save file, convert it to true entity
+ if (m_aPhones[i].m_pEntity) {
+ m_aPhones[i].m_pEntity = CPools::GetBuildingPool()->GetSlot((uintptr)m_aPhones[i].m_pEntity - 1);
+ }
+ } else
+ ignoreOtherPhones = true;
+ }
+#else
+ m_nMax = max;
+ m_nScriptPhonesMax = scriptPhonesMax;
+
for (int i = 0; i < NUMPHONES; i++) {
m_aPhones[i] = ReadSaveBuf<CPhone>(buf);
// It's saved as building pool index in save file, convert it to true entity
@@ -222,6 +256,7 @@ INITSAVEBUF
m_aPhones[i].m_pEntity = CPools::GetBuildingPool()->GetSlot((uintptr)m_aPhones[i].m_pEntity - 1);
}
}
+#endif
VALIDATESAVEBUF(size)
}
@@ -259,6 +294,31 @@ CPhoneInfo::SetPhoneMessage_Repeatedly(int phoneId, wchar *msg1, wchar *msg2, wc
}
}
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+void
+CPhoneInfo::SwapPhone(float xPos, float yPos, int into)
+{
+ // "into" should be in 0 - m_nScriptPhonesMax range
+ int nearestPhoneId = -1;
+ CVector pos(xPos, yPos, 0.0f);
+ float nearestPhoneDist = 1.0f;
+
+ for (int phoneId = m_nScriptPhonesMax; phoneId < m_nMax; phoneId++) {
+ float phoneDistance = (m_aPhones[phoneId].m_vecPos - pos).Magnitude2D();
+ if (phoneDistance < nearestPhoneDist) {
+ nearestPhoneDist = phoneDistance;
+ nearestPhoneId = phoneId;
+ }
+ }
+ m_aPhones[nearestPhoneId].m_nState = PHONE_STATE_MESSAGE_REMOVED;
+
+ CPhone oldPhone = m_aPhones[into];
+ m_aPhones[into] = m_aPhones[nearestPhoneId];
+ m_aPhones[nearestPhoneId] = oldPhone;
+ m_nScriptPhonesMax++;
+}
+#endif
+
int
CPhoneInfo::GrabPhone(float xPos, float yPos)
{
@@ -300,6 +360,7 @@ CPhoneInfo::Initialise(void)
CBuilding *building = pool->GetSlot(i);
if (building) {
if (building->GetModelIndex() == MI_PHONEBOOTH1) {
+ assert(m_nMax < ARRAY_SIZE(m_aPhones) && "NUMPHONES should be increased");
CPhone *maxPhone = &m_aPhones[m_nMax];
maxPhone->m_nState = PHONE_STATE_FREE;
maxPhone->m_vecPos = building->GetPosition();
@@ -317,7 +378,11 @@ CPhoneInfo::Save(uint8 *buf, uint32 *size)
INITSAVEBUF
WriteSaveBuf(buf, m_nMax);
WriteSaveBuf(buf, m_nScriptPhonesMax);
- for(int phoneId = 0; phoneId < NUMPHONES; phoneId++) {
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ for (int phoneId = 0; phoneId < 50; phoneId++) { // We can do it without touching saves
+#else
+ for (int phoneId = 0; phoneId < NUMPHONES; phoneId++) {
+#endif
CPhone* phone = WriteSaveBuf(buf, m_aPhones[phoneId]);
// Convert entity pointer to building pool index while saving
diff --git a/src/control/Phones.h b/src/control/Phones.h
index 14d47ed1..02c9a928 100644
--- a/src/control/Phones.h
+++ b/src/control/Phones.h
@@ -61,6 +61,9 @@ public:
void Initialise(void);
void Shutdown(void);
void Update(void);
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ void SwapPhone(float xPos, float yPos, int into);
+#endif
};
extern CPhoneInfo gPhoneInfo;
@@ -68,7 +71,7 @@ extern CPhoneInfo gPhoneInfo;
void PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg);
void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg);
-#ifdef TOGGLEABLE_BETA_FEATURES
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
extern CPed *crimeReporters[NUMPHONES];
bool isPhoneAvailable(int);
-#endif \ No newline at end of file
+#endif
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 32bffa17..eb4843c5 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -700,15 +700,9 @@ CPickups::DoPickUpEffects(CEntity *entity)
const CVector &pos = entity->GetPosition();
float colorModifier = ((CGeneral::GetRandomNumber() & 0x1F) * 0.015f + 1.0f) * modifiedSin * 0.15f;
- CShadows::StoreStaticShadow(
- (uintptr)entity,
- SHADOWTYPE_ADDITIVE,
- gpShadowExplosionTex,
- &pos,
- 2.0f, 0.0f, 0.0f, -2.0f,
- 255, // this is 0 on PC which results in no shadow
- aWeaponReds[colorId] * colorModifier, aWeaponGreens[colorId] * colorModifier, aWeaponBlues[colorId] * colorModifier,
- 4.0f, 1.0f, 40.0f, false, 0.0f);
+ CShadows::StoreStaticShadow((uintptr)entity, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &pos, 2.0f, 0.0f, 0.0f, -2.0f, 0,
+ aWeaponReds[colorId] * colorModifier, aWeaponGreens[colorId] * colorModifier, aWeaponBlues[colorId] * colorModifier, 4.0f,
+ 1.0f, 40.0f, false, 0.0f);
float radius = (CGeneral::GetRandomNumber() & 0xF) * 0.1f + 3.0f;
CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f), radius, aWeaponReds[colorId] * modifiedSin / 256.0f, aWeaponGreens[colorId] * modifiedSin / 256.0f, aWeaponBlues[colorId] * modifiedSin / 256.0f, CPointLights::FOG_NONE, true);
@@ -759,11 +753,8 @@ CPickups::DoMineEffects(CEntity *entity)
float s = Sin((float)((CTimer::GetTimeInMilliseconds() + (uintptr)entity) & 0x1FF) * DEGTORAD(360.0f / 0x200));
int32 red = (MAXDIST - dist) * (0.5f * s + 0.5f) / MAXDIST * 64.0f;
- CShadows::StoreStaticShadow((uintptr)entity, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &pos,
- 2.0f, 0.0f, 0.0f, -2.0f,
- 255, // this is 0 on PC which results in no shadow
- red, 0, 0,
- 4.0f, 1.0f, 40.0f, false, 0.0f);
+ CShadows::StoreStaticShadow((uintptr)entity, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &pos, 2.0f, 0.0f, 0.0f, -2.0f, 0, red, 0, 0, 4.0f, 1.0f, 40.0f,
+ false, 0.0f);
CCoronas::RegisterCorona((uintptr)entity, red, 0, 0, 255, pos, 0.6f, 60.0f, CCoronas::TYPE_RING, CCoronas::FLARE_NONE, CCoronas::REFLECTION_OFF, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f);
}
@@ -781,11 +772,8 @@ CPickups::DoMoneyEffects(CEntity *entity)
float s = Sin((float)((CTimer::GetTimeInMilliseconds() + (uintptr)entity) & 0x3FF) * DEGTORAD(360.0f / 0x400));
int32 green = (MAXDIST - dist) * (0.2f * s + 0.3f) / MAXDIST * 64.0f;
- CShadows::StoreStaticShadow((uintptr)entity, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &pos,
- 2.0f, 0.0f, 0.0f, -2.0f,
- 255, // this is 0 on PC which results in no shadow
- 0, green, 0,
- 4.0f, 1.0f, 40.0f, false, 0.0f);
+ CShadows::StoreStaticShadow((uintptr)entity, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &pos, 2.0f, 0.0f, 0.0f, -2.0f, 0, 0, green, 0, 4.0f, 1.0f,
+ 40.0f, false, 0.0f);
CCoronas::RegisterCorona((uintptr)entity, 0, green, 0, 255, pos, 0.4f, 40.0f, CCoronas::TYPE_RING, CCoronas::FLARE_NONE, CCoronas::REFLECTION_OFF, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f);
}
@@ -803,11 +791,8 @@ CPickups::DoCollectableEffects(CEntity *entity)
float s = Sin((float)((CTimer::GetTimeInMilliseconds() + (uintptr)entity) & 0x7FF) * DEGTORAD(360.0f / 0x800));
int32 color = (MAXDIST - dist) * (0.5f * s + 0.5f) / MAXDIST * 255.0f;
- CShadows::StoreStaticShadow((uintptr)entity, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &pos,
- 2.0f, 0.0f, 0.0f, -2.0f,
- 255, // this is 0 on PC which results in no shadow
- color, color, color,
- 4.0f, 1.0f, 40.0f, false, 0.0f);
+ CShadows::StoreStaticShadow((uintptr)entity, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &pos, 2.0f, 0.0f, 0.0f, -2.0f, 0, color, color, color, 4.0f,
+ 1.0f, 40.0f, false, 0.0f);
CCoronas::RegisterCorona((uintptr)entity, color, color, color, 255, pos, 0.6f, 40.0f, CCoronas::TYPE_RING, CCoronas::FLARE_NONE, CCoronas::REFLECTION_OFF, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f);
}
diff --git a/src/control/Record.cpp b/src/control/Record.cpp
index d086543f..8dc0028a 100644
--- a/src/control/Record.cpp
+++ b/src/control/Record.cpp
@@ -426,8 +426,8 @@ void RemoveUnusedCollision(void)
"com_rvroads52", "com_roadsrv", "com_roadkb23", "com_roadkb22"
};
for (int i = 0; i < ARRAY_SIZE(dontDeleteArray); i++)
- CModelInfo::GetModelInfo(dontDeleteArray[i], nil)->GetColModel()->level = LEVEL_NONE;
- CModelInfo::RemoveColModelsFromOtherLevels(LEVEL_NONE);
+ CModelInfo::GetModelInfo(dontDeleteArray[i], nil)->GetColModel()->level = LEVEL_GENERIC;
+ CModelInfo::RemoveColModelsFromOtherLevels(LEVEL_GENERIC);
for (int i = 0; i < ARRAY_SIZE(dontDeleteArray); i++)
CModelInfo::GetModelInfo(dontDeleteArray[i], nil)->GetColModel()->level = LEVEL_COMMERCIAL;
}
@@ -439,8 +439,10 @@ void CRecordDataForChase::StartChaseScene(float startTime)
Status = STATE_PLAYBACK;
AnimTime = startTime;
AnimStartTime = CTimer::GetTimeInMilliseconds();
+#ifndef NO_ISLAND_LOADING
RemoveUnusedCollision();
CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN);
+#endif
CGame::TidyUpMemory(true, true);
CStreaming::ImGonnaUseStreamingMemory();
CFileMgr::SetDir("data\\paths");
diff --git a/src/control/Record.h b/src/control/Record.h
index 7af733ba..8b55b1f4 100644
--- a/src/control/Record.h
+++ b/src/control/Record.h
@@ -17,13 +17,13 @@ public:
int8 forwardY;
int8 forwardZ;
int8 wheel;
- uint8 gas;
- uint8 brake;
+ int8 gas;
+ int8 brake;
bool handbrake;
CVector pos;
};
-extern char gString[256];;
+extern char gString[256];
class CRecordDataForChase
{
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp
index 707f1d87..8276f94a 100644
--- a/src/control/Replay.cpp
+++ b/src/control/Replay.cpp
@@ -164,7 +164,7 @@ static void ApplyPanelDamageToCar(uint32 panels, CAutomobile* vehicle, bool flyi
void PrintElementsInPtrList(void)
{
- for (CPtrNode* node = CWorld::GetBigBuildingList(LEVEL_NONE).first; node; node = node->next) {
+ for (CPtrNode* node = CWorld::GetBigBuildingList(LEVEL_GENERIC).first; node; node = node->next) {
/* Most likely debug print was present here */
}
}
@@ -1124,7 +1124,7 @@ void CReplay::StoreStuffInMem(void)
pWorld1 = new uint8[sizeof(CSector) * NUMSECTORS_X * NUMSECTORS_Y];
memcpy(pWorld1, CWorld::GetSector(0, 0), NUMSECTORS_X * NUMSECTORS_Y * sizeof(CSector));
WorldPtrList = CWorld::GetMovingEntityList().first; // why
- BigBuildingPtrList = CWorld::GetBigBuildingList(LEVEL_NONE).first;
+ BigBuildingPtrList = CWorld::GetBigBuildingList(LEVEL_GENERIC).first;
pPickups = new uint8[sizeof(CPickup) * NUMPICKUPS];
memcpy(pPickups, CPickups::aPickUps, NUMPICKUPS * sizeof(CPickup));
pReferences = new uint8[(sizeof(CReference) * NUMREFERENCES)];
@@ -1170,7 +1170,7 @@ void CReplay::RestoreStuffFromMem(void)
delete[] pWorld1;
pWorld1 = nil;
CWorld::GetMovingEntityList().first = WorldPtrList;
- CWorld::GetBigBuildingList(LEVEL_NONE).first = BigBuildingPtrList;
+ CWorld::GetBigBuildingList(LEVEL_GENERIC).first = BigBuildingPtrList;
memcpy(CPickups::aPickUps, pPickups, sizeof(CPickup) * NUMPICKUPS);
delete[] pPickups;
pPickups = nil;
@@ -1454,7 +1454,7 @@ void CReplay::StreamAllNecessaryCarsAndPeds(void)
for (int slot = 0; slot < NUM_REPLAYBUFFERS; slot++) {
if (BufferStatus[slot] == REPLAYBUFFER_UNUSED)
continue;
- for (int offset = 0; Buffers[slot][offset] != REPLAYPACKET_END; offset += FindSizeOfPacket(Buffers[slot][offset])) {
+ for (size_t offset = 0; Buffers[slot][offset] != REPLAYPACKET_END; offset += FindSizeOfPacket(Buffers[slot][offset])) {
switch (Buffers[slot][offset]) {
case REPLAYPACKET_VEHICLE:
CStreaming::RequestModel(((tVehicleUpdatePacket*)&Buffers[slot][offset])->mi, 0);
@@ -1476,7 +1476,7 @@ void CReplay::FindFirstFocusCoordinate(CVector *coord)
for (int slot = 0; slot < NUM_REPLAYBUFFERS; slot++) {
if (BufferStatus[slot] == REPLAYBUFFER_UNUSED)
continue;
- for (int offset = 0; Buffers[slot][offset] != REPLAYPACKET_END; offset += FindSizeOfPacket(Buffers[slot][offset])) {
+ for (size_t offset = 0; Buffers[slot][offset] != REPLAYPACKET_END; offset += FindSizeOfPacket(Buffers[slot][offset])) {
if (Buffers[slot][offset] == REPLAYPACKET_GENERAL) {
*coord = ((tGeneralPacket*)&Buffers[slot][offset])->player_pos;
return;
diff --git a/src/control/Restart.cpp b/src/control/Restart.cpp
index 5a322cdb..a6482d04 100644
--- a/src/control/Restart.cpp
+++ b/src/control/Restart.cpp
@@ -24,8 +24,8 @@ uint16 CRestart::NumberOfPoliceRestarts;
void
CRestart::Initialise()
{
- OverridePoliceStationLevel = LEVEL_NONE;
- OverrideHospitalLevel = LEVEL_NONE;
+ OverridePoliceStationLevel = LEVEL_GENERIC;
+ OverrideHospitalLevel = LEVEL_GENERIC;
bFadeInAfterNextArrest = true;
bFadeInAfterNextDeath = true;
OverrideHeading = 0.0f;
@@ -86,7 +86,7 @@ CRestart::FindClosestHospitalRestartPoint(const CVector &pos, CVector *outPos, f
// find closest point on this level
for (int i = 0; i < NumberOfHospitalRestarts; i++) {
- if (CTheZones::FindZoneForPoint(HospitalRestartPoints[i]) == (OverrideHospitalLevel != LEVEL_NONE ? OverrideHospitalLevel : curlevel)) {
+ if (CTheZones::FindZoneForPoint(HospitalRestartPoints[i]) == (OverrideHospitalLevel != LEVEL_GENERIC ? OverrideHospitalLevel : curlevel)) {
float dist = (pos - HospitalRestartPoints[i]).MagnitudeSqr();
if (fMinDist >= dist) {
fMinDist = dist;
@@ -133,7 +133,7 @@ CRestart::FindClosestPoliceRestartPoint(const CVector &pos, CVector *outPos, flo
// find closest point on this level
for (int i = 0; i < NumberOfPoliceRestarts; i++) {
- if (CTheZones::FindZoneForPoint(PoliceRestartPoints[i]) == (OverridePoliceStationLevel != LEVEL_NONE ? OverridePoliceStationLevel : curlevel)) {
+ if (CTheZones::FindZoneForPoint(PoliceRestartPoints[i]) == (OverridePoliceStationLevel != LEVEL_GENERIC ? OverridePoliceStationLevel : curlevel)) {
float dist = (pos - PoliceRestartPoints[i]).MagnitudeSqr();
if (fMinDist >= dist) {
fMinDist = dist;
diff --git a/src/control/SceneEdit.cpp b/src/control/SceneEdit.cpp
index be8c5519..154fe603 100644
--- a/src/control/SceneEdit.cpp
+++ b/src/control/SceneEdit.cpp
@@ -631,7 +631,7 @@ void CSceneEdit::ProcessCommand(void)
SelectActor();
if (m_bActorSelected) {
if (pActors[m_nActor]->bInVehicle) {
- pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_VEHICLE);
+ pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_CAR);
Movie[m_nNumMovieCommands].m_nCommandId = MOVIE_GET_OUT_CAR;
Movie[m_nNumMovieCommands++].m_nActorId = m_nActor;
}
@@ -695,7 +695,7 @@ void CSceneEdit::ProcessCommand(void)
case MOVIE_WAIT:
SelectActor();
if (m_bActorSelected) {
- pActors[m_nActor]->SetObjective(OBJECTIVE_IDLE);
+ pActors[m_nActor]->SetObjective(OBJECTIVE_WAIT_ON_FOOT);
Movie[m_nNumMovieCommands].m_nCommandId = MOVIE_WAIT;
Movie[m_nNumMovieCommands++].m_nActorId = m_nActor;
}
@@ -876,7 +876,7 @@ void CSceneEdit::PlayBack(void)
case MOVIE_GET_OUT_CAR:
m_nActor = Movie[m_nCurrentMovieCommand].m_nActorId;
if (pActors[m_nActor]->bInVehicle)
- pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_VEHICLE);
+ pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_CAR);
else
++m_nCurrentMovieCommand;
break;
@@ -895,7 +895,7 @@ void CSceneEdit::PlayBack(void)
break;
case MOVIE_WAIT:
m_nActor = Movie[m_nCurrentMovieCommand].m_nActorId;
- pActors[m_nActor]->SetObjective(OBJECTIVE_IDLE);
+ pActors[m_nActor]->SetObjective(OBJECTIVE_WAIT_ON_FOOT);
++m_nCurrentMovieCommand;
break;
case MOVIE_POSITION_CAMERA:
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 934571ef..6eb802b4 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -348,8 +348,8 @@ const tScriptCommandData commands[] = {
REGISTER_COMMAND(COMMAND_SET_CAR_CRUISE_SPEED, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_SET_CAR_DRIVING_STYLE, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_SET_CAR_MISSION, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_IS_CHAR_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
- REGISTER_COMMAND(COMMAND_IS_CHAR_IN_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
+ REGISTER_COMMAND(COMMAND_IS_CAR_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
+ REGISTER_COMMAND(COMMAND_IS_CAR_IN_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
REGISTER_COMMAND(COMMAND_SPECIAL_0, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_SPECIAL_1, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_SPECIAL_2, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
@@ -1354,9 +1354,9 @@ static void PrintToLog(const char* format, ...)
#endif
va_end(va);
- printf("%s", tmp);
#if SCRIPT_LOG_FILE_LEVEL == 1 || SCRIPT_LOG_FILE_LEVEL == 2
- fwrite(tmp, 1, strlen(tmp), dbg_log);
+ if (dbg_log)
+ fwrite(tmp, 1, strlen(tmp), dbg_log);
#endif
}
@@ -1925,7 +1925,7 @@ void CTheScripts::Init()
dbg_log = fopen("SCRDBG.LOG", "w");
static const char* init_msg = "Starting debug script log\n\n";
PrintToLog(init_msg);
- CFileMgr::SetDir("\\");
+ CFileMgr::SetDir("");
#endif
}
@@ -2028,7 +2028,7 @@ void CTheScripts::Process()
dbg_log = fopen("SCRDBG.LOG", "w");
static const char* init_msg = "Starting debug script log\n\n";
PrintToLog(init_msg);
- CFileMgr::SetDir("\\");
+ CFileMgr::SetDir("");
#endif
PrintToLog("------------------------\n");
PrintToLog("CTheScripts::Process started, CTimer::GetTimeInMilliseconds == %u\n", CTimer::GetTimeInMilliseconds());
@@ -2823,9 +2823,8 @@ int8 CRunningScript::ProcessCommands0To99(int32 command)
UpdateCompareFlag(ped->IsWithinArea(x1, y1, x2, y2));
else
UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, x2, y2));
- if (!ScriptParams[5])
- return 0;
- CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
+ if (ScriptParams[5])
+ CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
return 0;
@@ -2844,9 +2843,8 @@ int8 CRunningScript::ProcessCommands0To99(int32 command)
UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, z1, x2, y2, z2));
else
UpdateCompareFlag(ped->IsWithinArea(x1, y1, z1, x2, y2, z2));
- if (!ScriptParams[7])
- return 0;
- CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
+ if (ScriptParams[7])
+ CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2);
return 0;
@@ -3296,7 +3294,12 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
ped->ClearAll();
int8 path = ScriptParams[1];
if (ScriptParams[1] < 0 || ScriptParams[1] > 7)
+ // Max number GetRandomNumberInRange returns is max-1
+#ifdef FIX_BUGS
+ path = CGeneral::GetRandomNumberInRange(0, 8);
+#else
path = CGeneral::GetRandomNumberInRange(0, 7);
+#endif
ped->SetWanderPath(path);
return 0;
}
@@ -3321,7 +3324,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
script_assert(ped);
ped->bScriptObjectiveCompleted = false;
- ped->SetObjective(OBJECTIVE_IDLE);
+ ped->SetObjective(OBJECTIVE_WAIT_ON_FOOT);
return 0;
}
case COMMAND_GET_CHAR_COORDINATES:
@@ -3420,9 +3423,8 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, x2, y2));
else
UpdateCompareFlag(ped->IsWithinArea(x1, y1, x2, y2));
- if (!ScriptParams[5])
- return 0;
- CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
+ if (ScriptParams[5])
+ CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
return 0;
@@ -3447,9 +3449,8 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, z1, x2, y2, z2));
else
UpdateCompareFlag(ped->IsWithinArea(x1, y1, z1, x2, y2, z2));
- if (!ScriptParams[7])
- return 0;
- CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
+ if (ScriptParams[7])
+ CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2);
return 0;
@@ -3666,9 +3667,8 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
float x2 = *(float*)&ScriptParams[3];
float y2 = *(float*)&ScriptParams[4];
UpdateCompareFlag(vehicle->IsWithinArea(x1, y1, x2, y2));
- if (!ScriptParams[5])
- return 0;
- CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
+ if (ScriptParams[5])
+ CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
return 0;
@@ -3685,9 +3685,8 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
float y2 = *(float*)&ScriptParams[5];
float z2 = *(float*)&ScriptParams[6];
UpdateCompareFlag(vehicle->IsWithinArea(x1, y1, z1, x2, y2, z2));
- if (!ScriptParams[7])
- return 0;
- CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
+ if (ScriptParams[7])
+ CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2);
return 0;
@@ -4424,9 +4423,8 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
float y2 = *(float*)&ScriptParams[4];
UpdateCompareFlag(pVehicle->GetStatus() == STATUS_WRECKED &&
pVehicle->IsWithinArea(x1, y1, x2, y2));
- if (!ScriptParams[5])
- return 0;
- CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
+ if (ScriptParams[5])
+ CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
return 0;
@@ -4444,9 +4442,8 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
float z2 = *(float*)&ScriptParams[6];
UpdateCompareFlag(pVehicle->GetStatus() == STATUS_WRECKED &&
pVehicle->IsWithinArea(x1, y1, z1, x2, y2, z2));
- if (!ScriptParams[7])
- return 0;
- CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
+ if (ScriptParams[7])
+ CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2);
return 0;
@@ -5123,7 +5120,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command)
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
script_assert(pPed);
pPed->bScriptObjectiveCompleted = false;
- pPed->SetObjective(OBJECTIVE_IDLE);
+ pPed->SetObjective(OBJECTIVE_WAIT_ON_FOOT);
return 0;
}
case COMMAND_SET_CHAR_OBJ_FLEE_ON_FOOT_TILL_SAFE:
@@ -5615,7 +5612,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command)
script_assert(pPed);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
pPed->bScriptObjectiveCompleted = false;
- pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle);
+ pPed->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle);
return 0;
}
case COMMAND_SET_CHAR_OBJ_ENTER_CAR_AS_PASSENGER:
@@ -7274,9 +7271,8 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
float x2 = *(float*)&ScriptParams[3];
float y2 = *(float*)&ScriptParams[4];
UpdateCompareFlag(pPed->bIsShooting && pPed->IsWithinArea(x1, y1, x2, y2));
- if (!ScriptParams[5])
- return 0;
- CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
+ if (ScriptParams[5])
+ CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
return 0;
@@ -7291,9 +7287,8 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
float x2 = *(float*)&ScriptParams[3];
float y2 = *(float*)&ScriptParams[4];
UpdateCompareFlag(pPed->bIsShooting && pPed->IsWithinArea(x1, y1, x2, y2));
- if (!ScriptParams[5])
- return 0;
- CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
+ if (ScriptParams[5])
+ CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
if (CTheScripts::DbgFlag)
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
return 0;
@@ -7818,7 +7813,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
script_assert(pPed);
CPed* pTargetPed = CPools::GetPedPool()->GetAt(ScriptParams[1]);
pPed->bScriptObjectiveCompleted = false;
- pPed->SetObjective(OBJECTIVE_FOLLOW_PED_IN_FORMATION, pTargetPed);
+ pPed->SetObjective(OBJECTIVE_FOLLOW_CHAR_IN_FORMATION, pTargetPed);
pPed->SetFormation((eFormation)ScriptParams[2]);
return 0;
}
@@ -8703,7 +8698,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
CEntity* apEntities[16];
CWorld::FindObjectsOfTypeInRange(mi, pos, range, true, &total, 16, apEntities, true, false, false, true, true);
if (total == 0)
- CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(LEVEL_NONE), pos, range, true, &total, 16, apEntities);
+ CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(LEVEL_GENERIC), pos, range, true, &total, 16, apEntities);
if (total == 0)
CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(CTheZones::FindZoneForPoint(pos)), pos, range, true, &total, 16, apEntities);
CEntity* pClosestEntity = nil;
@@ -9455,7 +9450,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
CEntity* apEntities[16];
CWorld::FindObjectsOfTypeInRange(mi1, pos, radius, true, &total, 16, apEntities, true, false, false, false, false);
if (total == 0)
- CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(LEVEL_NONE), pos, radius, true, &total, 16, apEntities);
+ CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(LEVEL_GENERIC), pos, radius, true, &total, 16, apEntities);
if (total == 0)
CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(CTheZones::FindZoneForPoint(pos)), pos, radius, true, &total, 16, apEntities);
CEntity* pClosestEntity = nil;
@@ -10022,11 +10017,15 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
CollectParameters(&m_nIp, 1);
CTimer::Stop();
CGame::currLevel = (eLevelName)ScriptParams[0];
+#ifndef NO_ISLAND_LOADING
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
+#endif
CCollision::SortOutCollisionAfterLoad();
+#ifndef NO_ISLAND_LOADING
CStreaming::RequestIslands(CGame::currLevel);
CStreaming::LoadAllRequestedModels(true);
+#endif
CTimer::Update();
return 0;
}
@@ -10053,7 +10052,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
if (ScriptParams[1])
pVehicle->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pVehicle->GetPosition());
else
- pVehicle->m_nZoneLevel = LEVEL_NONE;
+ pVehicle->m_nZoneLevel = LEVEL_GENERIC;
return 0;
}
case COMMAND_SET_CHAR_STAYS_IN_CURRENT_LEVEL:
@@ -10064,7 +10063,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
if (ScriptParams[1])
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
else
- pPed->m_nZoneLevel = LEVEL_NONE;
+ pPed->m_nZoneLevel = LEVEL_GENERIC;
return 0;
}
case COMMAND_REGISTER_4X4_ONE_TIME:
@@ -10642,18 +10641,24 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
CTimer::Stop();
CGame::currLevel = (eLevelName)ScriptParams[0];
if (CGame::currLevel != CCollision::ms_collisionInMemory) {
+#ifndef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(0);
CPad::StopPadsShaking();
CCollision::LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
+#endif
CPopulation::DealWithZoneChange(CCollision::ms_collisionInMemory, CGame::currLevel, false);
+#ifndef NO_ISLAND_LOADING
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
+#endif
CCollision::SortOutCollisionAfterLoad();
+#ifndef NO_ISLAND_LOADING
CStreaming::RequestIslands(CGame::currLevel);
CStreaming::RequestBigBuildings(CGame::currLevel);
CStreaming::LoadAllRequestedModels(true);
DMAudio.SetEffectsFadeVol(127);
+#endif
}
CTimer::Update();
return 0;
@@ -10865,13 +10870,13 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
script_assert(pVehicle);
if (pVehicle->pDriver) {
pVehicle->pDriver->bScriptObjectiveCompleted = false;
- pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle);
+ pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle);
}
for (int i = 0; i < ARRAY_SIZE(pVehicle->pPassengers); i++)
{
if (pVehicle->pPassengers[i]) {
pVehicle->pPassengers[i]->bScriptObjectiveCompleted = false;
- pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle);
+ pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle);
}
}
return 0;
@@ -13095,7 +13100,7 @@ void CTheScripts::CleanUpThisPed(CPed* pPed)
}
else {
if (pPed->m_pMyVehicle->m_vehType == VEHICLE_TYPE_CAR) {
- pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pPed->m_pMyVehicle);
+ pPed->SetObjective(OBJECTIVE_LEAVE_CAR, pPed->m_pMyVehicle);
pPed->bWanderPathAfterExitingCar = true;
}
}
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index d038c423..fcffce9b 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -1688,7 +1688,7 @@ CCam::Process_BehindCar(const CVector &CameraTarget, float TargetOrientation, fl
if(Length < 0.002f)
Length = 0.002f;
Beta = CGeneral::GetATanOfXY(TargetCoors.x - Source.x, TargetCoors.y - Source.y);
-#ifdef TOGGLEABLE_BETA_FEATURES
+#if 1
// This is completely made up but Bill's cam manipulates an angle before calling this
// and otherwise calculating Beta doesn't make much sense.
Beta += fBillsBetaOffset;
@@ -5060,7 +5060,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
// This is not working on cars as SA
// Because III/VC doesn't have any buttons tied to LeftStick if you're not in Classic Configuration, using Dodo or using GInput/Pad, so :shrug:
if (Abs(pad->GetSteeringUpDown()) > 120.0f) {
- if (car->pDriver && car->pDriver->m_objective != OBJECTIVE_LEAVE_VEHICLE) {
+ if (car->pDriver && car->pDriver->m_objective != OBJECTIVE_LEAVE_CAR) {
yMovement += Abs(pad->GetSteeringUpDown()) * (FOV / 80.0f * 3.f / 70.f) * pad->GetSteeringUpDown() * 0.007f * 0.007f * 0.5;
}
}
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 340dbaee..abe0833e 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -2978,15 +2978,15 @@ CCamera::LoadTrainCamNodes(char const *name)
char token[16] = { 0 };
char filename[16] = { 0 };
uint8 *buf;
- int bufpos = 0;
+ size_t bufpos = 0;
int field = 0;
int tokpos = 0;
char c;
int i;
- int len;
+ size_t len;
strcpy(filename, name);
- len = strlen(filename);
+ len = (int)strlen(filename);
filename[len] = '.';
filename[len+1] = 'd';
filename[len+2] = 'a';
@@ -3587,8 +3587,8 @@ CCamera::CalculateDerivedValues(void)
m_cameraMatrix = Invert(m_matrix);
float hfov = DEGTORAD(CDraw::GetScaledFOV()/2.0f);
- float c = cos(hfov);
- float s = sin(hfov);
+ float c = Cos(hfov);
+ float s = Sin(hfov);
// right plane
m_vecFrustumNormals[0] = CVector(c, -s, 0.0f);
@@ -3622,7 +3622,7 @@ bool
CCamera::IsPointVisible(const CVector &center, const CMatrix *mat)
{
RwV3d c;
- c = *(RwV3d*)&center;
+ c = center;
RwV3dTransformPoints(&c, &c, 1, &mat->m_matrix);
if(c.y < CDraw::GetNearClipZ()) return false;
if(c.y > CDraw::GetFarClipZ()) return false;
@@ -3637,7 +3637,7 @@ bool
CCamera::IsSphereVisible(const CVector &center, float radius, const CMatrix *mat)
{
RwV3d c;
- c = *(RwV3d*)&center;
+ c = center;
RwV3dTransformPoints(&c, &c, 1, &mat->m_matrix);
if(c.y + radius < CDraw::GetNearClipZ()) return false;
if(c.y - radius > CDraw::GetFarClipZ()) return false;
diff --git a/src/core/CdStreamPosix.cpp b/src/core/CdStreamPosix.cpp
index 4d6bcdab..45fd9832 100644
--- a/src/core/CdStreamPosix.cpp
+++ b/src/core/CdStreamPosix.cpp
@@ -189,10 +189,11 @@ GetGTA3ImgSize(void)
realpath(gImgNames[0], path);
if (stat(path, &statbuf) == -1) {
// Try case-insensitivity
- char *r = (char*)alloca(strlen(gImgNames[0]) + 2);
- if (casepath(gImgNames[0], r))
+ char* real = casepath(gImgNames[0], false);
+ if (real)
{
- realpath(r, path);
+ realpath(real, path);
+ free(real);
if (stat(path, &statbuf) != -1)
goto ok;
}
@@ -210,7 +211,6 @@ CdStreamShutdown(void)
{
// Destroying semaphores and free(gpReadInfo) will be done at threads
#ifndef ONE_THREAD_PER_CHANNEL
- free(gChannelRequestQ.items);
gCdStreamThreadStatus = 2;
sem_post(&gCdStreamSema);
#endif
@@ -442,6 +442,7 @@ void *CdStreamThread(void *param)
sem_destroy(&gpReadInfo[i].pDoneSemaphore);
}
sem_destroy(&gCdStreamSema);
+ free(gChannelRequestQ.items);
#else
sem_destroy(&gpReadInfo[channel].pStartSemaphore);
sem_destroy(&gpReadInfo[channel].pDoneSemaphore);
@@ -460,10 +461,11 @@ CdStreamAddImage(char const *path)
// Fix case sensitivity and backslashes.
if (gImgFiles[gNumImages] == -1) {
- char *r = (char*)alloca(strlen(path) + 2);
- if (casepath(path, r))
+ char* real = casepath(path, false);
+ if (real)
{
- gImgFiles[gNumImages] = open(r, _gdwCdStreamFlags);
+ gImgFiles[gNumImages] = open(real, _gdwCdStreamFlags);
+ free(real);
}
}
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp
index 23eaa8dd..99be816f 100644
--- a/src/core/Collision.cpp
+++ b/src/core/Collision.cpp
@@ -38,7 +38,7 @@ void
CCollision::Init(void)
{
ms_colModelCache.Init(NUMCOLCACHELINKS);
- ms_collisionInMemory = LEVEL_NONE;
+ ms_collisionInMemory = LEVEL_GENERIC;
}
void
@@ -59,7 +59,7 @@ CCollision::Update(void)
return;
// hardcode a level if there are no zones
- if(level == LEVEL_NONE){
+ if(level == LEVEL_GENERIC){
if(CGame::currLevel == LEVEL_INDUSTRIAL &&
playerCoors.x < 400.0f){
level = LEVEL_COMMERCIAL;
@@ -78,7 +78,7 @@ CCollision::Update(void)
}
}
}
- if(level != LEVEL_NONE && level != CGame::currLevel)
+ if(level != LEVEL_GENERIC && level != CGame::currLevel)
CGame::currLevel = level;
if(ms_collisionInMemory != CGame::currLevel)
LoadCollisionWhenINeedIt(forceLevelChange);
@@ -95,10 +95,10 @@ GetCollisionInSectorList(CPtrList &list)
for(node = list.first; node; node = node->next){
e = (CEntity*)node->item;
level = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel()->level;
- if(level != LEVEL_NONE)
+ if(level != LEVEL_GENERIC)
return (eLevelName)level;
}
- return LEVEL_NONE;
+ return LEVEL_GENERIC;
}
// Get a level this sector is in based on collision models
@@ -108,15 +108,15 @@ GetCollisionInSector(CSector &sect)
int level;
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS_OVERLAP]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS_OVERLAP]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES_OVERLAP]);
return (eLevelName)level;
}
@@ -133,7 +133,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
int xmin, xmax, ymin, ymax;
int x, y;
- level = LEVEL_NONE;
+ level = LEVEL_GENERIC;
playerCoors = FindPlayerCoors();
sx = CWorld::GetSectorIndexX(playerCoors.x);
@@ -161,8 +161,8 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
for(x = xmin; x <= xmax; x++)
for(y = ymin; y <= ymax; y++){
l = GetCollisionInSector(*CWorld::GetSector(x, y));
- if(l != LEVEL_NONE){
- if(level == LEVEL_NONE)
+ if(l != LEVEL_GENERIC){
+ if(level == LEVEL_GENERIC)
level = l;
if(level != l)
multipleLevels = true;
@@ -173,19 +173,23 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
if(multipleLevels && veh && veh->IsBoat())
for(ei = veh->m_entryInfoList.first; ei; ei = ei->next){
level = GetCollisionInSector(*ei->sector);
- if(level != LEVEL_NONE)
+ if(level != LEVEL_GENERIC)
break;
}
}
if(level == CGame::currLevel || forceChange){
CTimer::Stop();
+#ifndef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(0);
CPad::StopPadsShaking();
LoadCollisionScreen(CGame::currLevel);
DMAudio.Service();
+#endif
CPopulation::DealWithZoneChange(ms_collisionInMemory, CGame::currLevel, false);
+
+#ifndef NO_ISLAND_LOADING
CStreaming::RemoveIslandsNotUsed(LEVEL_INDUSTRIAL);
CStreaming::RemoveIslandsNotUsed(LEVEL_COMMERCIAL);
CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN);
@@ -196,19 +200,27 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
CStreaming::RemoveUnusedModelsInLoadedList();
CGame::TidyUpMemory(true, true);
CFileLoader::LoadCollisionFromDatFile(CGame::currLevel);
+#endif
+
ms_collisionInMemory = CGame::currLevel;
CReplay::EmptyReplayBuffer();
- if(CGame::currLevel != LEVEL_NONE)
+#ifndef NO_ISLAND_LOADING
+ if(CGame::currLevel != LEVEL_GENERIC)
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
CStreaming::RequestBigBuildings(CGame::currLevel);
+#endif
CStreaming::LoadAllRequestedModels(true);
+#ifndef NO_ISLAND_LOADING
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
CGame::TidyUpMemory(true, true);
+#endif
CTimer::Update();
+#ifndef NO_ISLAND_LOADING
DMAudio.SetEffectsFadeVol(127);
+#endif
}
}
@@ -217,10 +229,23 @@ CCollision::SortOutCollisionAfterLoad(void)
{
if(ms_collisionInMemory == CGame::currLevel)
return;
-
+#ifndef NO_ISLAND_LOADING
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
- if(CGame::currLevel != LEVEL_NONE){
+#endif
+ if (CGame::currLevel != LEVEL_GENERIC) {
+#ifdef NO_ISLAND_LOADING
+ static bool bAlreadyLoaded = false;
+ if (bAlreadyLoaded) {
+ ms_collisionInMemory = CGame::currLevel;
+ return;
+ }
+ bAlreadyLoaded = true;
+ CFileLoader::LoadCollisionFromDatFile(LEVEL_INDUSTRIAL);
+ CFileLoader::LoadCollisionFromDatFile(LEVEL_COMMERCIAL);
+ CFileLoader::LoadCollisionFromDatFile(LEVEL_SUBURBAN);
+#else
CFileLoader::LoadCollisionFromDatFile(CGame::currLevel);
+#endif
if(!CGame::playingIntro)
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
}
@@ -370,7 +395,7 @@ CCollision::TestVerticalLineBox(const CColLine &line, const CColBox &box)
}
bool
-CCollision::TestLineTriangle(const CColLine &line, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane)
+CCollision::TestLineTriangle(const CColLine &line, const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane)
{
float t;
CVector normal;
@@ -385,9 +410,9 @@ CCollision::TestLineTriangle(const CColLine &line, const CVector *verts, const C
// find point of intersection
CVector p = line.p0 + (line.p1-line.p0)*t;
- const CVector &va = verts[tri.a];
- const CVector &vb = verts[tri.b];
- const CVector &vc = verts[tri.c];
+ const CVector &va = verts[tri.a].Get();
+ const CVector &vb = verts[tri.b].Get();
+ const CVector &vc = verts[tri.c].Get();
CVector2D vec1, vec2, vec3, vect;
// We do the test in 2D. With the plane direction we
@@ -480,15 +505,16 @@ CCollision::TestLineSphere(const CColLine &line, const CColSphere &sph)
bool
CCollision::TestSphereTriangle(const CColSphere &sphere,
- const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane)
+ const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane)
{
// If sphere and plane don't intersect, no collision
- if(Abs(plane.CalcPoint(sphere.center)) > sphere.radius)
+ float planedist = plane.CalcPoint(sphere.center);
+ if(Abs(planedist) > sphere.radius)
return false;
- const CVector &va = verts[tri.a];
- const CVector &vb = verts[tri.b];
- const CVector &vc = verts[tri.c];
+ const CVector &va = verts[tri.a].Get();
+ const CVector &vb = verts[tri.b].Get();
+ const CVector &vc = verts[tri.c].Get();
// calculate two orthogonal basis vectors for the triangle
CVector vec2 = vb - va;
@@ -512,23 +538,29 @@ CCollision::TestSphereTriangle(const CColSphere &sphere,
int testcase = insideAB + insideAC + insideBC;
float dist = 0.0f;
- if(testcase == 1){
+ switch(testcase){
+ case 1:
// closest to a vertex
if(insideAB) dist = (sphere.center - vc).Magnitude();
else if(insideAC) dist = (sphere.center - vb).Magnitude();
else if(insideBC) dist = (sphere.center - va).Magnitude();
else assert(0);
- }else if(testcase == 2){
+ break;
+ case 2:
// closest to an edge
+ // looks like original game as DistToLine manually inlined
if(!insideAB) dist = DistToLine(&va, &vb, &sphere.center);
else if(!insideAC) dist = DistToLine(&va, &vc, &sphere.center);
else if(!insideBC) dist = DistToLine(&vb, &vc, &sphere.center);
else assert(0);
- }else if(testcase == 3){
+ break;
+ case 3:
// center is in triangle
- return true;
- }else
- assert(0); // front fell off
+ dist = Abs(planedist);
+ break;
+ default:
+ assert(0);
+ }
return dist < sphere.radius;
}
@@ -547,21 +579,24 @@ CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColMod
if(!TestLineBox(newline, model.boundingBox))
return false;
- for(i = 0; i < model.numSpheres; i++)
- if(!ignoreSeeThrough || model.spheres[i].surface != SURFACE_GLASS && model.spheres[i].surface != SURFACE_TRANSPARENT_CLOTH)
- if(TestLineSphere(newline, model.spheres[i]))
- return true;
+ for(i = 0; i < model.numSpheres; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue;
+ if(TestLineSphere(newline, model.spheres[i]))
+ return true;
+ }
- for(i = 0; i < model.numBoxes; i++)
- if(!ignoreSeeThrough || model.boxes[i].surface != SURFACE_GLASS && model.boxes[i].surface != SURFACE_TRANSPARENT_CLOTH)
- if(TestLineBox(newline, model.boxes[i]))
- return true;
+ for(i = 0; i < model.numBoxes; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.boxes[i].surface)) continue;
+ if(TestLineBox(newline, model.boxes[i]))
+ return true;
+ }
CalculateTrianglePlanes(&model);
- for(i = 0; i < model.numTriangles; i++)
- if(!ignoreSeeThrough || model.triangles[i].surface != SURFACE_GLASS && model.triangles[i].surface != SURFACE_TRANSPARENT_CLOTH)
- if(TestLineTriangle(newline, model.vertices, model.triangles[i], model.trianglePlanes[i]))
- return true;
+ for(i = 0; i < model.numTriangles; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+ if(TestLineTriangle(newline, model.vertices, model.triangles[i], model.trianglePlanes[i]))
+ return true;
+ }
return false;
}
@@ -836,16 +871,16 @@ CCollision::ProcessLineSphere(const CColLine &line, const CColSphere &sphere, CC
bool
CCollision::ProcessVerticalLineTriangle(const CColLine &line,
- const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane,
+ const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane,
CColPoint &point, float &mindist, CStoredCollPoly *poly)
{
float t;
CVector normal;
const CVector &p0 = line.p0;
- const CVector &va = verts[tri.a];
- const CVector &vb = verts[tri.b];
- const CVector &vc = verts[tri.c];
+ const CVector &va = verts[tri.a].Get();
+ const CVector &vb = verts[tri.b].Get();
+ const CVector &vc = verts[tri.c].Get();
// early out bound rect test
if(p0.x < va.x && p0.x < vb.x && p0.x < vc.x) return false;
@@ -910,6 +945,7 @@ CCollision::ProcessVerticalLineTriangle(const CColLine &line,
if(CrossProduct2D(vec2-vec1, vect-vec1) < 0.0f) return false;
if(CrossProduct2D(vec3-vec1, vect-vec1) > 0.0f) return false;
if(CrossProduct2D(vec3-vec2, vect-vec2) < 0.0f) return false;
+ if(t >= mindist) return false;
point.point = p;
point.normal = normal;
point.surfaceA = 0;
@@ -935,16 +971,12 @@ CCollision::IsStoredPolyStillValidVerticalLine(const CVector &pos, float z, CCol
return false;
// maybe inlined?
- CColTriangle tri;
- tri.a = 0;
- tri.b = 1;
- tri.c = 2;
CColTrianglePlane plane;
- plane.Set(poly->verts, tri);
+ plane.Set(poly->verts[0], poly->verts[1], poly->verts[2]);
- const CVector &va = poly->verts[tri.a];
- const CVector &vb = poly->verts[tri.b];
- const CVector &vc = poly->verts[tri.c];
+ const CVector &va = poly->verts[0];
+ const CVector &vb = poly->verts[1];
+ const CVector &vc = poly->verts[2];
CVector p0 = pos;
CVector p1(pos.x, pos.y, z);
@@ -1009,7 +1041,7 @@ CCollision::IsStoredPolyStillValidVerticalLine(const CVector &pos, float z, CCol
bool
CCollision::ProcessLineTriangle(const CColLine &line ,
- const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane,
+ const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane,
CColPoint &point, float &mindist)
{
float t;
@@ -1028,9 +1060,9 @@ CCollision::ProcessLineTriangle(const CColLine &line ,
// find point of intersection
CVector p = line.p0 + (line.p1-line.p0)*t;
- const CVector &va = verts[tri.a];
- const CVector &vb = verts[tri.b];
- const CVector &vc = verts[tri.c];
+ const CVector &va = verts[tri.a].Get();
+ const CVector &vb = verts[tri.b].Get();
+ const CVector &vc = verts[tri.c].Get();
CVector2D vec1, vec2, vec3, vect;
switch(plane.dir){
@@ -1076,6 +1108,7 @@ CCollision::ProcessLineTriangle(const CColLine &line ,
if(CrossProduct2D(vec2-vec1, vect-vec1) < 0.0f) return false;
if(CrossProduct2D(vec3-vec1, vect-vec1) > 0.0f) return false;
if(CrossProduct2D(vec3-vec2, vect-vec2) < 0.0f) return false;
+ if(t >= mindist) return false;
point.point = p;
point.normal = normal;
point.surfaceA = 0;
@@ -1088,7 +1121,7 @@ CCollision::ProcessLineTriangle(const CColLine &line ,
bool
CCollision::ProcessSphereTriangle(const CColSphere &sphere,
- const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane,
+ const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane,
CColPoint &point, float &mindistsq)
{
// If sphere and plane don't intersect, no collision
@@ -1097,9 +1130,9 @@ CCollision::ProcessSphereTriangle(const CColSphere &sphere,
if(Abs(planedist) > sphere.radius || distsq > mindistsq)
return false;
- const CVector &va = verts[tri.a];
- const CVector &vb = verts[tri.b];
- const CVector &vc = verts[tri.c];
+ const CVector &va = verts[tri.a].Get();
+ const CVector &vb = verts[tri.b].Get();
+ const CVector &vc = verts[tri.c].Get();
// calculate two orthogonal basis vectors for the triangle
CVector normal;
@@ -1126,25 +1159,31 @@ CCollision::ProcessSphereTriangle(const CColSphere &sphere,
int testcase = insideAB + insideAC + insideBC;
float dist = 0.0f;
CVector p;
- if(testcase == 1){
+ switch(testcase){
+ case 1:
// closest to a vertex
if(insideAB) p = vc;
else if(insideAC) p = vb;
else if(insideBC) p = va;
else assert(0);
dist = (sphere.center - p).Magnitude();
- }else if(testcase == 2){
+ break;
+ case 2:
// closest to an edge
+ // looks like original game as DistToLine manually inlined
if(!insideAB) dist = DistToLine(&va, &vb, &sphere.center, p);
else if(!insideAC) dist = DistToLine(&va, &vc, &sphere.center, p);
else if(!insideBC) dist = DistToLine(&vb, &vc, &sphere.center, p);
else assert(0);
- }else if(testcase == 3){
+ break;
+ case 3:
// center is in triangle
dist = Abs(planedist);
p = sphere.center - normal*planedist;
- }else
- assert(0); // front fell off
+ break;
+ default:
+ assert(0);
+ }
if(dist >= sphere.radius || dist*dist >= mindistsq)
return false;
@@ -1178,18 +1217,21 @@ CCollision::ProcessLineOfSight(const CColLine &line,
return false;
float coldist = mindist;
- for(i = 0; i < model.numSpheres; i++)
- if(!ignoreSeeThrough || model.spheres[i].surface != SURFACE_GLASS && model.spheres[i].surface != SURFACE_TRANSPARENT_CLOTH)
- ProcessLineSphere(newline, model.spheres[i], point, coldist);
+ for(i = 0; i < model.numSpheres; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue;
+ ProcessLineSphere(newline, model.spheres[i], point, coldist);
+ }
- for(i = 0; i < model.numBoxes; i++)
- if(!ignoreSeeThrough || model.boxes[i].surface != SURFACE_GLASS && model.boxes[i].surface != SURFACE_TRANSPARENT_CLOTH)
- ProcessLineBox(newline, model.boxes[i], point, coldist);
+ for(i = 0; i < model.numBoxes; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.boxes[i].surface)) continue;
+ ProcessLineBox(newline, model.boxes[i], point, coldist);
+ }
CalculateTrianglePlanes(&model);
- for(i = 0; i < model.numTriangles; i++)
- if(!ignoreSeeThrough || model.triangles[i].surface != SURFACE_GLASS && model.triangles[i].surface != SURFACE_TRANSPARENT_CLOTH)
- ProcessLineTriangle(newline, model.vertices, model.triangles[i], model.trianglePlanes[i], point, coldist);
+ for(i = 0; i < model.numTriangles; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+ ProcessLineTriangle(newline, model.vertices, model.triangles[i], model.trianglePlanes[i], point, coldist);
+ }
if(coldist < mindist){
point.point = matrix * point.point;
@@ -1218,24 +1260,27 @@ CCollision::ProcessVerticalLine(const CColLine &line,
return false;
float coldist = mindist;
- for(i = 0; i < model.numSpheres; i++)
- if(!ignoreSeeThrough || model.spheres[i].surface != SURFACE_GLASS && model.spheres[i].surface != SURFACE_TRANSPARENT_CLOTH)
- ProcessLineSphere(newline, model.spheres[i], point, coldist);
+ for(i = 0; i < model.numSpheres; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue;
+ ProcessLineSphere(newline, model.spheres[i], point, coldist);
+ }
- for(i = 0; i < model.numBoxes; i++)
- if(!ignoreSeeThrough || model.boxes[i].surface != SURFACE_GLASS && model.boxes[i].surface != SURFACE_TRANSPARENT_CLOTH)
- ProcessLineBox(newline, model.boxes[i], point, coldist);
+ for(i = 0; i < model.numBoxes; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.boxes[i].surface)) continue;
+ ProcessLineBox(newline, model.boxes[i], point, coldist);
+ }
CalculateTrianglePlanes(&model);
TempStoredPoly.valid = false;
- for(i = 0; i < model.numTriangles; i++)
- if(!ignoreSeeThrough || model.triangles[i].surface != SURFACE_GLASS && model.triangles[i].surface != SURFACE_TRANSPARENT_CLOTH)
- ProcessVerticalLineTriangle(newline, model.vertices, model.triangles[i], model.trianglePlanes[i], point, coldist, &TempStoredPoly);
+ for(i = 0; i < model.numTriangles; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+ ProcessVerticalLineTriangle(newline, model.vertices, model.triangles[i], model.trianglePlanes[i], point, coldist, &TempStoredPoly);
+ }
if(coldist < mindist){
point.point = matrix * point.point;
point.normal = Multiply3x3(matrix, point.normal);
- if(poly && TempStoredPoly.valid){
+ if(TempStoredPoly.valid && poly){
*poly = TempStoredPoly;
poly->verts[0] = matrix * poly->verts[0];
poly->verts[1] = matrix * poly->verts[1];
@@ -1934,7 +1979,7 @@ CColLine::Set(const CVector &p0, const CVector &p1)
}
void
-CColTriangle::Set(const CVector *, int a, int b, int c, uint8 surf, uint8 piece)
+CColTriangle::Set(const CompressedVector *, int a, int b, int c, uint8 surf, uint8 piece)
{
this->a = a;
this->b = b;
@@ -1943,12 +1988,8 @@ CColTriangle::Set(const CVector *, int a, int b, int c, uint8 surf, uint8 piece)
}
void
-CColTrianglePlane::Set(const CVector *v, CColTriangle &tri)
+CColTrianglePlane::Set(const CVector &va, const CVector &vb, const CVector &vc)
{
- const CVector &va = v[tri.a];
- const CVector &vb = v[tri.b];
- const CVector &vc = v[tri.c];
-
normal = CrossProduct(vc-va, vb-va);
normal.Normalise();
dist = DotProduct(normal, va);
@@ -2038,7 +2079,7 @@ CColModel::GetLinkPtr(void)
void
CColModel::GetTrianglePoint(CVector &v, int i) const
{
- v = vertices[i];
+ v = vertices[i].Get();
}
CColModel&
@@ -2117,7 +2158,7 @@ CColModel::operator=(const CColModel &other)
if(vertices)
RwFree(vertices);
if(numVerts){
- vertices = (CVector*)RwMalloc(numVerts*sizeof(CVector));
+ vertices = (CompressedVector*)RwMalloc(numVerts*sizeof(CompressedVector));
for(i = 0; i < numVerts; i++)
vertices[i] = other.vertices[i];
}
diff --git a/src/core/Collision.h b/src/core/Collision.h
index 895f012a..d988f0c2 100644
--- a/src/core/Collision.h
+++ b/src/core/Collision.h
@@ -10,6 +10,19 @@
#define MAX_COLLISION_POINTS 32
#endif
+struct CompressedVector
+{
+#ifdef COMPRESSED_COL_VECTORS
+ int16 x, y, z;
+ CVector Get(void) const { return CVector(x, y, z)/128.0f; };
+ void Set(float x, float y, float z) { this->x = x*128.0f; this->y = y*128.0f; this->z = z*128.0f; };
+#else
+ float x, y, z;
+ CVector Get(void) const { return CVector(x, y, z); };
+ void Set(float x, float y, float z) { this->x = x; this->y = y; this->z = z; };
+#endif
+};
+
struct CColSphere
{
CVector center;
@@ -51,7 +64,7 @@ struct CColTriangle
uint16 c;
uint8 surface;
- void Set(const CVector *v, int a, int b, int c, uint8 surf, uint8 piece);
+ void Set(const CompressedVector *v, int a, int b, int c, uint8 surf, uint8 piece);
};
struct CColTrianglePlane
@@ -60,7 +73,8 @@ struct CColTrianglePlane
float dist;
uint8 dir;
- void Set(const CVector *v, CColTriangle &tri);
+ void Set(const CVector &va, const CVector &vb, const CVector &vc);
+ void Set(const CompressedVector *v, CColTriangle &tri) { Set(v[tri.a].Get(), v[tri.b].Get(), v[tri.c].Get()); }
void GetNormal(CVector &n) const { n = normal; }
float CalcPoint(const CVector &v) const { return DotProduct(normal, v) - dist; };
};
@@ -94,11 +108,11 @@ struct CColModel
int16 numBoxes;
int16 numTriangles;
int32 level;
- bool ownsCollisionVolumes;
+ bool ownsCollisionVolumes; // missing on PS2
CColSphere *spheres;
CColLine *lines;
CColBox *boxes;
- CVector *vertices;
+ CompressedVector *vertices;
CColTriangle *triangles;
CColTrianglePlane *trianglePlanes;
@@ -136,18 +150,18 @@ public:
static bool TestSphereBox(const CColSphere &sph, const CColBox &box);
static bool TestLineBox(const CColLine &line, const CColBox &box);
static bool TestVerticalLineBox(const CColLine &line, const CColBox &box);
- static bool TestLineTriangle(const CColLine &line, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane);
+ static bool TestLineTriangle(const CColLine &line, const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane);
static bool TestLineSphere(const CColLine &line, const CColSphere &sph);
- static bool TestSphereTriangle(const CColSphere &sphere, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane);
+ static bool TestSphereTriangle(const CColSphere &sphere, const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane);
static bool TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough);
static bool ProcessSphereSphere(const CColSphere &s1, const CColSphere &s2, CColPoint &point, float &mindistsq);
static bool ProcessSphereBox(const CColSphere &sph, const CColBox &box, CColPoint &point, float &mindistsq);
static bool ProcessLineBox(const CColLine &line, const CColBox &box, CColPoint &point, float &mindist);
- static bool ProcessVerticalLineTriangle(const CColLine &line, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindist, CStoredCollPoly *poly);
- static bool ProcessLineTriangle(const CColLine &line , const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindist);
+ static bool ProcessVerticalLineTriangle(const CColLine &line, const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindist, CStoredCollPoly *poly);
+ static bool ProcessLineTriangle(const CColLine &line , const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindist);
static bool ProcessLineSphere(const CColLine &line, const CColSphere &sphere, CColPoint &point, float &mindist);
- static bool ProcessSphereTriangle(const CColSphere &sph, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindistsq);
+ static bool ProcessSphereTriangle(const CColSphere &sph, const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindistsq);
static bool ProcessLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough);
static bool ProcessVerticalLine(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough, CStoredCollPoly *poly);
static int32 ProcessColModels(const CMatrix &matrixA, CColModel &modelA, const CMatrix &matrixB, CColModel &modelB, CColPoint *spherepoints, CColPoint *linepoints, float *linedists);
diff --git a/src/core/Directory.cpp b/src/core/Directory.cpp
index cc4d65d8..05344065 100644
--- a/src/core/Directory.cpp
+++ b/src/core/Directory.cpp
@@ -30,7 +30,8 @@ CDirectory::ReadDirFile(const char *filename)
bool
CDirectory::WriteDirFile(const char *filename)
{
- int fd, n;
+ int fd;
+ size_t n;
fd = CFileMgr::OpenFileForWriting(filename);
n = CFileMgr::Write(fd, (char*)entries, numEntries*sizeof(DirectoryInfo));
CFileMgr::CloseFile(fd);
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index 3c4ed040..b4da1a5e 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -104,7 +104,9 @@ CFileLoader::LoadLevel(const char *filename)
LoadingScreenLoadingFile(line + 8);
LoadMapZones(line + 8);
}else if(strncmp(line, "SPLASH", 6) == 0){
+#ifndef DISABLE_LOADING_SCREEN
LoadSplash(GetRandomSplashScreen());
+#endif
}else if(strncmp(line, "CDIMAGE", 7) == 0){
CdStreamAddImage(line + 8);
}
@@ -262,12 +264,12 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname)
int32 numVertices = *(int16*)buf;
buf += 4;
if(numVertices > 0){
- model.vertices = (CVector*)RwMalloc(numVertices*sizeof(CVector));
+ model.vertices = (CompressedVector*)RwMalloc(numVertices*sizeof(CompressedVector));
for(i = 0; i < numVertices; i++){
- model.vertices[i] = *(CVector*)buf;
- if(Abs(model.vertices[i].x) >= 256.0f ||
- Abs(model.vertices[i].y) >= 256.0f ||
- Abs(model.vertices[i].z) >= 256.0f)
+ model.vertices[i].Set(*(float*)buf, *(float*)(buf+4), *(float*)(buf+8));
+ if(Abs(*(float*)buf) >= 256.0f ||
+ Abs(*(float*)(buf+4)) >= 256.0f ||
+ Abs(*(float*)(buf+8)) >= 256.0f)
printf("%s:Collision volume too big\n", modelname);
buf += 12;
}
diff --git a/src/core/FileMgr.cpp b/src/core/FileMgr.cpp
index 1939c861..ac51f8de 100644
--- a/src/core/FileMgr.cpp
+++ b/src/core/FileMgr.cpp
@@ -4,6 +4,7 @@
#include <direct.h>
#endif
#include "common.h"
+#include "crossplatform.h"
#include "FileMgr.h"
@@ -31,19 +32,16 @@ static myFILE myfiles[NUMFILES];
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
-#include "crossplatform.h"
#define _getcwd getcwd
// Case-insensitivity on linux (from https://github.com/OneSadCookie/fcaseopen)
void mychdir(char const *path)
{
- char *r = (char*)alloca(strlen(path) + 2);
- if (casepath(path, r))
- {
+ char* r = casepath(path, false);
+ if (r) {
chdir(r);
- }
- else
- {
+ free(r);
+ } else {
errno = ENOENT;
}
}
@@ -73,30 +71,7 @@ found:
*p++ = 'b';
*p = '\0';
-#if !defined(_WIN32)
- char *newPath = strdup(filename);
- // Normally casepath() fixes backslashes, but if the mode is sth other than r/rb it will create new file with backslashes on linux, so fix backslashes here
- char *nextBs;
- while(nextBs = strstr(newPath, "\\")){
- *nextBs = '/';
- }
-#else
- const char *newPath = filename;
-#endif
-
- myfiles[fd].file = fopen(newPath, realmode);
-// Be case-insensitive on linux (from https://github.com/OneSadCookie/fcaseopen/)
-#if !defined(_WIN32)
- if (!myfiles[fd].file) {
- char *r = (char*)alloca(strlen(newPath) + 2);
- if (casepath(newPath, r))
- {
- myfiles[fd].file = fopen(r, realmode);
- }
- }
-
- free(newPath);
-#endif
+ myfiles[fd].file = fcaseopen(filename, realmode);
if(myfiles[fd].file == nil)
return 0;
return fd;
@@ -163,7 +138,7 @@ myfgets(char *buf, int len, int fd)
return buf;
}
-static int
+static size_t
myfread(void *buf, size_t elt, size_t n, int fd)
{
if(myfiles[fd].isText){
@@ -184,7 +159,7 @@ myfread(void *buf, size_t elt, size_t n, int fd)
return fread(buf, elt, n, myfiles[fd].file);
}
-static int
+static size_t
myfwrite(void *buf, size_t elt, size_t n, int fd)
{
if(myfiles[fd].isText){
@@ -265,11 +240,11 @@ CFileMgr::SetDirMyDocuments(void)
mychdir(_psGetUserFilesFolder());
}
-int
+size_t
CFileMgr::LoadFile(const char *file, uint8 *buf, int unused, const char *mode)
{
int fd;
- int n, len;
+ size_t n, len;
fd = myfopen(file, mode);
if(fd == 0)
@@ -298,13 +273,13 @@ CFileMgr::OpenFileForWriting(const char *file)
return OpenFile(file, "wb");
}
-int
+size_t
CFileMgr::Read(int fd, const char *buf, int len)
{
return myfread((void*)buf, 1, len, fd);
}
-int
+size_t
CFileMgr::Write(int fd, const char *buf, int len)
{
return myfwrite((void*)buf, 1, len, fd);
diff --git a/src/core/FileMgr.h b/src/core/FileMgr.h
index 1d0faf50..0ad9daa7 100644
--- a/src/core/FileMgr.h
+++ b/src/core/FileMgr.h
@@ -9,12 +9,12 @@ public:
static void ChangeDir(const char *dir);
static void SetDir(const char *dir);
static void SetDirMyDocuments(void);
- static int LoadFile(const char *file, uint8 *buf, int unused, const char *mode);
+ static size_t LoadFile(const char *file, uint8 *buf, int unused, const char *mode);
static int OpenFile(const char *file, const char *mode);
static int OpenFile(const char *file) { return OpenFile(file, "rb"); }
static int OpenFileForWriting(const char *file);
- static int Read(int fd, const char *buf, int len);
- static int Write(int fd, const char *buf, int len);
+ static size_t Read(int fd, const char *buf, int len);
+ static size_t Write(int fd, const char *buf, int len);
static bool Seek(int fd, int offset, int whence);
static bool ReadLine(int fd, char *buf, int len);
static int CloseFile(int fd);
diff --git a/src/core/Fire.cpp b/src/core/Fire.cpp
index 933c73da..c6dece6a 100644
--- a/src/core/Fire.cpp
+++ b/src/core/Fire.cpp
@@ -128,11 +128,8 @@ CFire::ProcessFire(void)
lightpos.z = m_vecPos.z + 5.0f;
if (!m_pEntity) {
- CShadows::StoreStaticShadow((uintptr)this, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &lightpos,
- 7.0f, 0.0f, 0.0f, -7.0f,
- 255, // this is 0 on PC which results in no shadow
- nRandNumber / 2, nRandNumber / 2, 0,
- 10.0f, 1.0f, 40.0f, 0, 0.0f);
+ CShadows::StoreStaticShadow((uintptr)this, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &lightpos, 7.0f, 0.0f, 0.0f, -7.0f, 0, nRandNumber / 2,
+ nRandNumber / 2, 0, 10.0f, 1.0f, 40.0f, 0, 0.0f);
}
fGreen = nRandNumber / 128;
fRed = nRandNumber / 128;
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 3aefa005..95d5f6e6 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -112,6 +112,10 @@ int8 CMenuManager::m_bFrontEnd_ReloadObrTxtGxt;
int32 CMenuManager::m_PrefsMusicVolume = 102;
int32 CMenuManager::m_PrefsSfxVolume = 102;
+#ifdef CUTSCENE_BORDERS_SWITCH
+bool CMenuManager::m_PrefsCutsceneBorders = true;
+#endif
+
char CMenuManager::m_PrefsSkinFile[256] = DEFAULT_SKIN_NAME;
int32 CMenuManager::m_KeyPressedCode = -1;
@@ -952,10 +956,10 @@ CMenuManager::Draw()
CFont::SetDropShadowPosition(0);
if (!CheckHover(MENU_X(30.0f), MENU_X(30.0f) + CFont::GetStringWidth(backTx), SCREEN_SCALE_FROM_BOTTOM(125.0f), SCREEN_SCALE_FROM_BOTTOM(105.0f))) {
m_nHoverOption = HOVEROPTION_NOT_HOVERING;
- m_nCurrOption = m_nPrevOption = 0;
+ m_nCurrOption = m_nOptionMouseHovering = 0;
} else {
m_nHoverOption = HOVEROPTION_RANDOM_ITEM;
- m_nCurrOption = m_nPrevOption = 1;
+ m_nCurrOption = m_nOptionMouseHovering = 1;
}
return;
}
@@ -1217,8 +1221,10 @@ CMenuManager::Draw()
rightText = option.drawFunc(&isOptionDisabled);
}
}
- } else
+ } else {
+ debug("A- screen:%d option:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, i, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu, option.screen, option.screenOptionOrder);
assert(0 && "Custom frontend options is borked");
+ }
break;
#endif
@@ -1250,7 +1256,7 @@ CMenuManager::Draw()
static int oldOption = -99;
static int oldScreen = m_nCurrScreen;
- m_nPrevOption = rowToCheck;
+ m_nOptionMouseHovering = rowToCheck;
if (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY) {
m_nCurrOption = rowToCheck;
m_bShowMouse = true;
@@ -1974,10 +1980,10 @@ CMenuManager::DrawControllerSetupScreen()
float curOptY = i * rowHeight + yStart;
if (m_nMousePosY > MENU_Y(curOptY) && m_nMousePosY < MENU_Y(rowHeight + curOptY)) {
- if (m_nPrevOption != i && m_nCurrExLayer == HOVEROPTION_LIST)
+ if (m_nOptionMouseHovering != i && m_nCurrExLayer == HOVEROPTION_LIST)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NAVIGATION, 0);
- m_nPrevOption = i;
+ m_nOptionMouseHovering = i;
if (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY) {
m_nCurrExLayer = HOVEROPTION_LIST;
m_nSelectedListRow = i;
@@ -2598,7 +2604,7 @@ CMenuManager::DrawPlayerSetupScreen()
char nameTemp[256];
for (m_pSelectedSkin = m_pSkinListHead.nextSkin; m_pSelectedSkin; m_pSelectedSkin = m_pSelectedSkin->nextSkin) {
// Drop extension
- int oldLength = strlen(m_pSelectedSkin->skinNameDisplayed);
+ int oldLength = (int)strlen(m_pSelectedSkin->skinNameDisplayed);
m_pSelectedSkin->skinNameDisplayed[oldLength - 4] = '\0';
m_pSelectedSkin->skinNameOriginal[oldLength - 4] = '\0';
@@ -2688,7 +2694,7 @@ CMenuManager::DrawPlayerSetupScreen()
if (m_nMousePosX > MENU_X_LEFT_ALIGNED(PLAYERSETUP_LIST_LEFT) && m_nMousePosX < MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT)) {
if (m_nMousePosY > MENU_Y(rowStartY) && m_nMousePosY < MENU_Y(rowEndY)) {
- m_nPrevOption = rowIdx;
+ m_nOptionMouseHovering = rowIdx;
if (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY) {
m_nCurrExLayer = HOVEROPTION_LIST;
}
@@ -3066,7 +3072,6 @@ CMenuManager::InitialiseChangedLanguageSettings()
}
#ifdef CUSTOM_FRONTEND_OPTIONS
- RemoveCustomFrontendOptions();
CustomFrontendOptionsPopulate();
#endif
}
@@ -3217,6 +3222,9 @@ CMenuManager::LoadSettings()
#ifdef FREE_CAM
CFileMgr::Read(fileHandle, (char*)&TheCamera.bFreeCam, 1);
#endif
+#ifdef CUTSCENE_BORDERS_SWITCH
+ CFileMgr::Read(fileHandle, (char *)&CMenuManager::m_PrefsCutsceneBorders, 1);
+#endif
}
}
@@ -3310,6 +3318,9 @@ CMenuManager::SaveSettings()
#ifdef FREE_CAM
CFileMgr::Write(fileHandle, (char*)&TheCamera.bFreeCam, 1);
#endif
+#ifdef CUTSCENE_BORDERS_SWITCH
+ CFileMgr::Write(fileHandle, (char *)&CMenuManager::m_PrefsCutsceneBorders, 1);
+#endif
}
CFileMgr::CloseFile(fileHandle);
@@ -4014,7 +4025,7 @@ CMenuManager::ProcessButtonPresses(void)
if (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action == MENUACTION_RESUME &&
#endif
(m_nHoverOption == HOVEROPTION_RANDOM_ITEM)) {
- m_nCurrOption = m_nPrevOption;
+ m_nCurrOption = m_nOptionMouseHovering;
optionSelected = true;
}
} else if (CPad::GetPad(0)->GetLeftMouseJustDown()) {
@@ -4028,7 +4039,7 @@ CMenuManager::ProcessButtonPresses(void)
OutputDebugString("FRONTEND RADIO STATION CHANGED");
} else if (m_nHoverOption == HOVEROPTION_RANDOM_ITEM
&& aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action != MENUACTION_RESUME) {
- m_nCurrOption = m_nPrevOption;
+ m_nCurrOption = m_nOptionMouseHovering;
optionSelected = true;
}
#else
@@ -4115,7 +4126,7 @@ CMenuManager::ProcessButtonPresses(void)
break;
case HOVEROPTION_RANDOM_ITEM:
if (((m_nCurrOption != 0) || (m_nCurrScreen != MENUPAGE_PAUSE_MENU)) {
- m_nCurrOption = m_nPrevOption;
+ m_nCurrOption = m_nOptionMouseHovering;
optionSelected = true;
}
break;
@@ -4775,8 +4786,10 @@ CMenuManager::ProcessButtonPresses(void)
} else if (option.type == FEOPTION_GOBACK) {
goBack = true;
}
- } else
+ } else {
+ debug("B- screen:%d option:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, m_nCurrOption, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, option.screen, option.screenOptionOrder);
assert(0 && "Custom frontend options are borked");
+ }
break;
#endif
@@ -4998,8 +5011,10 @@ CMenuManager::ProcessButtonPresses(void)
}
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
}
- else
+ else {
+ debug("C- screen:%d option:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, m_nCurrOption, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, option.screen, option.screenOptionOrder);
assert(0 && "Custom frontend options are borked");
+ }
break;
#endif
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index b07f7260..7b0e2f4b 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -518,7 +518,7 @@ public:
int32 m_nHoverOption;
int32 m_nCurrScreen;
int32 m_nCurrOption;
- int32 m_nPrevOption;
+ int32 m_nOptionMouseHovering;
int32 m_nPrevScreen;
uint32 field_558;
int32 m_nCurrSaveSlot;
@@ -582,6 +582,10 @@ public:
static uint8 m_PrefsPlayerGreen;
static uint8 m_PrefsPlayerBlue;
+#ifdef CUTSCENE_BORDERS_SWITCH
+ static bool m_PrefsCutsceneBorders;
+#endif
+
#ifndef MASTER
static bool m_PrefsMarketing;
static bool m_PrefsDisableTutorials;
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index 4c8aaa72..82e6992d 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -149,6 +149,15 @@ CGame::InitialiseOnceBeforeRW(void)
return true;
}
+#ifndef LIBRW
+#ifdef PS2_MATFX
+void ReplaceMatFxCallback();
+#endif // PS2_MATFX
+#ifdef PS2_ALPHA_TEST
+void ReplaceAtomicPipeCallback();
+#endif // PS2_ALPHA_TEST
+#endif // !LIBRW
+
bool
CGame::InitialiseRenderWare(void)
{
@@ -199,7 +208,14 @@ CGame::InitialiseRenderWare(void)
#else
rw::MatFX::modulateEnvMap = false;
#endif
-#endif
+#else
+#ifdef PS2_MATFX
+ ReplaceMatFxCallback();
+#endif // PS2_MATFX
+#ifdef PS2_ALPHA_TEST
+ ReplaceAtomicPipeCallback();
+#endif // PS2_ALPHA_TEST
+#endif // LIBRW
CFont::Initialise();
CHud::Initialise();
@@ -357,9 +373,9 @@ bool CGame::Initialise(const char* datFile)
CStreaming::Init();
CStreaming::LoadInitialVehicles();
CStreaming::LoadInitialPeds();
- CStreaming::RequestBigBuildings(LEVEL_NONE);
+ CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::LoadAllRequestedModels(false);
- printf("Streaming uses %dK of its memory", CStreaming::ms_memoryUsed / 1024);
+ printf("Streaming uses %zuK of its memory", CStreaming::ms_memoryUsed / 1024); // original modifier was %d
LoadingScreen("Loading the Game", "Load animations", GetRandomSplashScreen());
CAnimManager::LoadAnimFiles();
CPed::Initialise();
@@ -511,7 +527,7 @@ void CGame::ReInitGameObjectVariables(void)
CTimeCycle::Initialise();
CDraw::SetFOV(120.0f);
CDraw::ms_fLODDistance = 500.0f;
- CStreaming::RequestBigBuildings(LEVEL_NONE);
+ CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::LoadAllRequestedModels(false);
CPed::Initialise();
CEventList::Initialise();
diff --git a/src/core/Game.h b/src/core/Game.h
index 48f31abc..46e8fc68 100644
--- a/src/core/Game.h
+++ b/src/core/Game.h
@@ -2,7 +2,7 @@
enum eLevelName {
LEVEL_IGNORE = -1, // beware, this is only used in CPhysical's m_nZoneLevel
- LEVEL_NONE = 0,
+ LEVEL_GENERIC = 0,
LEVEL_INDUSTRIAL,
LEVEL_COMMERCIAL,
LEVEL_SUBURBAN
diff --git a/src/core/General.h b/src/core/General.h
index 7ffa99de..dde43c0f 100644
--- a/src/core/General.h
+++ b/src/core/General.h
@@ -108,7 +108,7 @@ public:
if (angle >= TWOPI)
angle -= TWOPI;
- return (int)floorf(angle / DEGTORAD(45.0f));
+ return (int)Floor(angle / DEGTORAD(45.0f));
}
// Unlike usual string comparison functions, these don't care about greater or lesser
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 9065c8ca..7df548aa 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -8,6 +8,7 @@
#include "common.h"
#include "crossplatform.h"
+#include "platform.h"
#ifdef XINPUT
#include <xinput.h>
#pragma comment( lib, "Xinput9_1_0.lib" )
@@ -344,15 +345,14 @@ void AltDodoCheat(void)
#endif
bool
-CControllerState::IsAnyButtonPressed(void)
+CControllerState::CheckForInput(void)
{
return !!RightStickX || !!RightStickY || !!LeftStickX || !!LeftStickY
|| !!DPadUp || !!DPadDown || !!DPadLeft || !!DPadRight
|| !!Triangle || !!Cross || !!Circle || !!Square
|| !!Start || !!Select
|| !!LeftShoulder1 || !!LeftShoulder2 || !!RightShoulder1 || !!RightShoulder2
- || !!LeftShock || !!RightShock
- || !!NetworkTalk;
+ || !!LeftShock || !!RightShock;
}
void
@@ -545,9 +545,9 @@ CMouseControllerState CMousePointerStateHelper::GetMouseSetUp()
void CPad::UpdateMouse()
{
+#if defined RW_D3D9 || defined RWLIBS
if ( IsForegroundApp() )
{
-#if defined RW_D3D9 || defined RWLIBS
if ( PSGLOBAL(mouse) == nil )
_InputInitialiseMouse();
@@ -584,7 +584,10 @@ void CPad::UpdateMouse()
OldMouseControllerState = NewMouseControllerState;
NewMouseControllerState = PCTempMouseControllerState;
}
+ }
#else
+ if ( IsForegroundApp() && PSGLOBAL(cursorIsInWindow) )
+ {
double xpos = 1.0f, ypos;
glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos);
if (xpos == 0.f)
@@ -622,8 +625,8 @@ void CPad::UpdateMouse()
OldMouseControllerState = NewMouseControllerState;
NewMouseControllerState = PCTempMouseControllerState;
-#endif
}
+#endif
}
CControllerState CPad::ReconcileTwoControllersInput(CControllerState const &State1, CControllerState const &State2)
@@ -1073,8 +1076,15 @@ void CPad::UpdatePads(void)
#else
CapturePad(0);
#endif
+
+ // Improve keyboard input latency part 1
+#ifdef FIX_BUGS
+ OldKeyState = NewKeyState;
+ NewKeyState = TempKeyState;
+#endif
+
#ifdef DETECT_PAD_INPUT_SWITCH
- if (GetPad(0)->PCTempJoyState.IsAnyButtonPressed())
+ if (GetPad(0)->PCTempJoyState.CheckForInput())
IsAffectedByController = true;
else {
#endif
@@ -1084,7 +1094,7 @@ void CPad::UpdatePads(void)
#ifdef DETECT_PAD_INPUT_SWITCH
}
- if (IsAffectedByController && (GetPad(0)->PCTempKeyState.IsAnyButtonPressed() || GetPad(0)->PCTempMouseState.IsAnyButtonPressed()))
+ if (IsAffectedByController && (GetPad(0)->PCTempKeyState.CheckForInput() || GetPad(0)->PCTempMouseState.CheckForInput()))
IsAffectedByController = false;
#endif
@@ -1102,8 +1112,11 @@ void CPad::UpdatePads(void)
GetPad(1)->OldState.Clear();
#endif
+ // Improve keyboard input latency part 2
+#ifndef FIX_BUGS
OldKeyState = NewKeyState;
NewKeyState = TempKeyState;
+#endif
}
void CPad::ProcessPCSpecificStuff(void)
@@ -2635,7 +2648,7 @@ void CPad::ResetCheats(void)
char *CPad::EditString(char *pStr, int32 nSize)
{
- int32 pos = strlen(pStr);
+ int32 pos = (int32)strlen(pStr);
// letters
for ( int32 i = 0; i < ('Z' - 'A' + 1); i++ )
diff --git a/src/core/Pad.h b/src/core/Pad.h
index 6f20571f..8c3bc752 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -29,7 +29,7 @@ public:
float GetRightStickX(void) { return RightStickX/32767.0f; };
float GetRightStickY(void) { return RightStickY/32767.0f; };
- bool IsAnyButtonPressed();
+ bool CheckForInput();
void Clear(void);
};
VALIDATE_SIZE(CControllerState, 0x2A);
diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp
index 128b22b4..09b3a499 100644
--- a/src/core/PlayerInfo.cpp
+++ b/src/core/PlayerInfo.cpp
@@ -409,7 +409,7 @@ CPlayerInfo::Process(void)
if (veh->m_vehType != VEHICLE_TYPE_BIKE || veh->m_nDoorLock == CARLOCK_LOCKED_PLAYER_INSIDE) {
if (veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_TRAIN_MOVING && veh->m_nDoorLock != CARLOCK_LOCKED_PLAYER_INSIDE) {
if (veh->m_vecMoveSpeed.Magnitude() < 0.17f && CTimer::GetTimeScale() >= 0.5f && !veh->bIsInWater) {
- m_pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh);
+ m_pPed->SetObjective(OBJECTIVE_LEAVE_CAR, veh);
}
}
} else {
@@ -553,7 +553,7 @@ CPlayerInfo::Process(void)
veh->m_nZoneLevel = LEVEL_IGNORE;
for (int i = 0; i < ARRAY_SIZE(veh->pPassengers); i++) {
if (veh->pPassengers[i])
- veh->pPassengers[i]->m_nZoneLevel = LEVEL_NONE;
+ veh->pPassengers[i]->m_nZoneLevel = LEVEL_GENERIC;
}
CStats::DistanceTravelledInVehicle += veh->m_fDistanceTravelled;
} else {
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 9406f1bd..05002a3f 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -746,8 +746,8 @@ void CRadar::DrawRadarMap()
DrawRadarMask();
// top left ist (0, 0)
- int x = floorf((vec2DRadarOrigin.x - RADAR_MIN_X) / RADAR_TILE_SIZE);
- int y = ceilf((RADAR_NUM_TILES - 1) - (vec2DRadarOrigin.y - RADAR_MIN_Y) / RADAR_TILE_SIZE);
+ int x = Floor((vec2DRadarOrigin.x - RADAR_MIN_X) / RADAR_TILE_SIZE);
+ int y = Ceil((RADAR_NUM_TILES - 1) - (vec2DRadarOrigin.y - RADAR_MIN_Y) / RADAR_TILE_SIZE);
StreamRadarSections(x, y);
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
@@ -1251,7 +1251,7 @@ void CRadar::Shutdown()
void CRadar::StreamRadarSections(const CVector &posn)
{
- StreamRadarSections(floorf((2000.0f + posn.x) / 500.0f), ceilf(7.0f - (2000.0f + posn.y) / 500.0f));
+ StreamRadarSections(Floor((2000.0f + posn.x) / 500.0f), Ceil(7.0f - (2000.0f + posn.y) / 500.0f));
}
void CRadar::StreamRadarSections(int32 x, int32 y)
diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp
index 99274e04..9afd8ac3 100644
--- a/src/core/Stats.cpp
+++ b/src/core/Stats.cpp
@@ -16,8 +16,8 @@ int32 CStats::PedsKilledOfThisType[NUM_PEDTYPES];
int32 CStats::TimesDied;
int32 CStats::TimesArrested;
int32 CStats::KillsSinceLastCheckpoint;
-int32 CStats::DistanceTravelledInVehicle;
-int32 CStats::DistanceTravelledOnFoot;
+float CStats::DistanceTravelledInVehicle;
+float CStats::DistanceTravelledOnFoot;
int32 CStats::ProgressMade;
int32 CStats::TotalProgressInGame;
int32 CStats::CarsExploded;
diff --git a/src/core/Stats.h b/src/core/Stats.h
index ae3c0cb4..5dfcf803 100644
--- a/src/core/Stats.h
+++ b/src/core/Stats.h
@@ -21,8 +21,8 @@ public:
static int32 TimesDied;
static int32 TimesArrested;
static int32 KillsSinceLastCheckpoint;
- static int32 DistanceTravelledInVehicle;
- static int32 DistanceTravelledOnFoot;
+ static float DistanceTravelledInVehicle;
+ static float DistanceTravelledOnFoot;
static int32 CarsExploded;
static int32 PeopleKilledByPlayer;
static int32 ProgressMade;
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index c961f53d..40189844 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -45,7 +45,7 @@ int32 CStreaming::ms_oldSectorX;
int32 CStreaming::ms_oldSectorY;
int32 CStreaming::ms_streamingBufferSize;
int8 *CStreaming::ms_pStreamingBuffer[2];
-int32 CStreaming::ms_memoryUsed;
+size_t CStreaming::ms_memoryUsed;
CStreamingChannel CStreaming::ms_channel[2];
int32 CStreaming::ms_channelError;
int32 CStreaming::ms_numVehiclesLoaded;
@@ -62,7 +62,7 @@ uint16 CStreaming::ms_loadedGangCars;
int32 CStreaming::ms_imageOffsets[NUMCDIMAGES];
int32 CStreaming::ms_lastImageRead;
int32 CStreaming::ms_imageSize;
-uint32 CStreaming::ms_memoryAvailable;
+size_t CStreaming::ms_memoryAvailable;
int32 desiredNumVehiclesLoaded = 12;
@@ -202,14 +202,15 @@ CStreaming::Init2(void)
// PC only, figure out how much memory we got
#ifdef GTA_PC
#define MB (1024*1024)
- extern unsigned long _dwMemAvailPhys;
+
+ extern size_t _dwMemAvailPhys;
ms_memoryAvailable = (_dwMemAvailPhys - 10*MB)/2;
if(ms_memoryAvailable < 50*MB)
ms_memoryAvailable = 50*MB;
- desiredNumVehiclesLoaded = (ms_memoryAvailable/MB - 50)/3 + 12;
+ desiredNumVehiclesLoaded = (int32)((ms_memoryAvailable / MB - 50) / 3 + 12);
if(desiredNumVehiclesLoaded > MAXVEHICLESLOADED)
desiredNumVehiclesLoaded = MAXVEHICLESLOADED;
- debug("Memory allocated to Streaming is %dMB", ms_memoryAvailable/MB);
+ debug("Memory allocated to Streaming is %zuMB", ms_memoryAvailable/MB); // original modifier was %d
#undef MB
#endif
@@ -725,7 +726,11 @@ CStreaming::RequestBigBuildings(eLevelName level)
n = CPools::GetBuildingPool()->GetSize()-1;
for(i = n; i >= 0; i--){
b = CPools::GetBuildingPool()->GetSlot(i);
- if(b && b->bIsBIGBuilding && b->m_level == level)
+ if(b && b->bIsBIGBuilding
+#ifndef NO_ISLAND_LOADING
+ && b->m_level == level
+#endif
+ )
RequestModel(b->GetModelIndex(), BIGBUILDINGFLAGS);
}
RequestIslands(level);
@@ -735,6 +740,7 @@ CStreaming::RequestBigBuildings(eLevelName level)
void
CStreaming::RequestIslands(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
switch(level){
case LEVEL_INDUSTRIAL:
RequestModel(islandLODcomInd, BIGBUILDINGFLAGS);
@@ -750,6 +756,7 @@ CStreaming::RequestIslands(eLevelName level)
break;
default: break;
}
+#endif
}
void
@@ -935,12 +942,14 @@ CStreaming::RemoveBuildings(eLevelName level)
void
CStreaming::RemoveUnusedBigBuildings(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
if(level != LEVEL_INDUSTRIAL)
RemoveBigBuildings(LEVEL_INDUSTRIAL);
if(level != LEVEL_COMMERCIAL)
RemoveBigBuildings(LEVEL_COMMERCIAL);
if(level != LEVEL_SUBURBAN)
RemoveBigBuildings(LEVEL_SUBURBAN);
+#endif
RemoveIslandsNotUsed(level);
}
@@ -960,6 +969,7 @@ DeleteIsland(CEntity *island)
void
CStreaming::RemoveIslandsNotUsed(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
switch(level){
case LEVEL_INDUSTRIAL:
DeleteIsland(pIslandLODindustEntity);
@@ -977,13 +987,16 @@ CStreaming::RemoveIslandsNotUsed(eLevelName level)
DeleteIsland(pIslandLODcomIndEntity);
break;
default:
+#endif // !NO_ISLAND_LOADING
DeleteIsland(pIslandLODindustEntity);
DeleteIsland(pIslandLODcomIndEntity);
DeleteIsland(pIslandLODcomSubEntity);
DeleteIsland(pIslandLODsubIndEntity);
DeleteIsland(pIslandLODsubComEntity);
+#ifndef NO_ISLAND_LOADING
break;
}
+#endif // !NO_ISLAND_LOADING
}
void
@@ -1073,7 +1086,7 @@ CStreaming::RemoveAllUnusedModels(void)
}
bool
-CStreaming::RemoveReferencedTxds(int32 mem)
+CStreaming::RemoveReferencedTxds(size_t mem)
{
CStreamingInfo *si;
int streamId;
@@ -2189,7 +2202,7 @@ CStreaming::DeleteRwObjectsAfterDeath(const CVector &pos)
}
void
-CStreaming::DeleteRwObjectsBehindCamera(int32 mem)
+CStreaming::DeleteRwObjectsBehindCamera(size_t mem)
{
int ix, iy;
int x, y;
@@ -2370,7 +2383,7 @@ CStreaming::DeleteRwObjectsInOverlapSectorList(CPtrList &list, int32 x, int32 y)
}
bool
-CStreaming::DeleteRwObjectsBehindCameraInSectorList(CPtrList &list, int32 mem)
+CStreaming::DeleteRwObjectsBehindCameraInSectorList(CPtrList &list, size_t mem)
{
CPtrNode *node;
CEntity *e;
@@ -2391,7 +2404,7 @@ CStreaming::DeleteRwObjectsBehindCameraInSectorList(CPtrList &list, int32 mem)
}
bool
-CStreaming::DeleteRwObjectsNotInFrustumInSectorList(CPtrList &list, int32 mem)
+CStreaming::DeleteRwObjectsNotInFrustumInSectorList(CPtrList &list, size_t mem)
{
CPtrNode *node;
CEntity *e;
@@ -2418,7 +2431,7 @@ CStreaming::MakeSpaceFor(int32 size)
// the code still happens to work in that case because ms_memoryAvailable is unsigned
// but it's not nice....
- while((uint32)ms_memoryUsed >= ms_memoryAvailable - size)
+ while(ms_memoryUsed >= ms_memoryAvailable - size)
if(!RemoveLeastUsedModel()){
DeleteRwObjectsBehindCamera(ms_memoryAvailable - size);
return;
@@ -2480,7 +2493,7 @@ CStreaming::UpdateForAnimViewer(void)
if (CStreaming::ms_channelError == -1) {
CStreaming::AddModelsToRequestList(CVector(0.0f, 0.0f, 0.0f));
CStreaming::LoadRequestedModels();
- sprintf(gString, "Requested %d, memory size %dK\n", CStreaming::ms_numModelsRequested, 2 * CStreaming::ms_memoryUsed);
+ sprintf(gString, "Requested %d, memory size %zuK\n", CStreaming::ms_numModelsRequested, 2 * CStreaming::ms_memoryUsed); // original modifier was %d
}
else {
CStreaming::RetryLoadFile(CStreaming::ms_channelError);
diff --git a/src/core/Streaming.h b/src/core/Streaming.h
index 84434769..0b2ff124 100644
--- a/src/core/Streaming.h
+++ b/src/core/Streaming.h
@@ -86,7 +86,7 @@ public:
static int32 ms_oldSectorY;
static int32 ms_streamingBufferSize;
static int8 *ms_pStreamingBuffer[2];
- static int32 ms_memoryUsed;
+ static size_t ms_memoryUsed;
static CStreamingChannel ms_channel[2];
static int32 ms_channelError;
static int32 ms_numVehiclesLoaded;
@@ -103,7 +103,7 @@ public:
static int32 ms_imageOffsets[NUMCDIMAGES];
static int32 ms_lastImageRead;
static int32 ms_imageSize;
- static uint32 ms_memoryAvailable;
+ static size_t ms_memoryAvailable;
static void Init(void);
static void Init2(void);
@@ -140,7 +140,7 @@ public:
static bool RemoveLeastUsedModel(void);
static void RemoveAllUnusedModels(void);
static void RemoveUnusedModelsInLoadedList(void);
- static bool RemoveReferencedTxds(int32 mem);
+ static bool RemoveReferencedTxds(size_t mem);
static int32 GetAvailableVehicleSlot(void);
static bool IsTxdUsedByRequestedModels(int32 txdId);
static bool AddToLoadedVehiclesList(int32 modelId);
@@ -176,11 +176,11 @@ public:
static void DeleteFarAwayRwObjects(const CVector &pos);
static void DeleteAllRwObjects(void);
static void DeleteRwObjectsAfterDeath(const CVector &pos);
- static void DeleteRwObjectsBehindCamera(int32 mem);
+ static void DeleteRwObjectsBehindCamera(size_t mem);
static void DeleteRwObjectsInSectorList(CPtrList &list);
static void DeleteRwObjectsInOverlapSectorList(CPtrList &list, int32 x, int32 y);
- static bool DeleteRwObjectsBehindCameraInSectorList(CPtrList &list, int32 mem);
- static bool DeleteRwObjectsNotInFrustumInSectorList(CPtrList &list, int32 mem);
+ static bool DeleteRwObjectsBehindCameraInSectorList(CPtrList &list, size_t mem);
+ static bool DeleteRwObjectsNotInFrustumInSectorList(CPtrList &list, size_t mem);
static void LoadScene(const CVector &pos);
diff --git a/src/core/SurfaceTable.h b/src/core/SurfaceTable.h
index 25b5e57d..1f16843d 100644
--- a/src/core/SurfaceTable.h
+++ b/src/core/SurfaceTable.h
@@ -54,6 +54,16 @@ enum
struct CColPoint;
+inline bool
+IsSeeThrough(uint8 surfType)
+{
+ switch(surfType)
+ case SURFACE_GLASS:
+ case SURFACE_TRANSPARENT_CLOTH:
+ return true;
+ return false;
+}
+
class CSurfaceTable
{
static float ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS];
diff --git a/src/core/TempColModels.cpp b/src/core/TempColModels.cpp
index 1252e2c7..ab73631d 100644
--- a/src/core/TempColModels.cpp
+++ b/src/core/TempColModels.cpp
@@ -36,19 +36,19 @@ CTempColModels::Initialise(void)
#define SET_COLMODEL_SPHERES(colmodel, sphrs)\
colmodel.numSpheres = ARRAY_SIZE(sphrs);\
colmodel.spheres = sphrs;\
- colmodel.level = LEVEL_NONE;\
+ colmodel.level = LEVEL_GENERIC;\
colmodel.ownsCollisionVolumes = false;\
int i;
ms_colModelBBox.boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
ms_colModelBBox.boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0);
- ms_colModelBBox.level = LEVEL_NONE;
+ ms_colModelBBox.level = LEVEL_GENERIC;
for (i = 0; i < ARRAY_SIZE(ms_colModelCutObj); i++) {
ms_colModelCutObj[i].boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
ms_colModelCutObj[i].boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0);
- ms_colModelCutObj[i].level = LEVEL_NONE;
+ ms_colModelCutObj[i].level = LEVEL_GENERIC;
}
// Ped Spheres
diff --git a/src/core/Wanted.cpp b/src/core/Wanted.cpp
index 7508c9f4..909674d0 100644
--- a/src/core/Wanted.cpp
+++ b/src/core/Wanted.cpp
@@ -161,7 +161,11 @@ CWanted::RegisterCrime(eCrimeType type, const CVector &coors, uint32 id, bool po
void
CWanted::RegisterCrime_Immediately(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare)
{
- if(!AddCrimeToQ(type, id, coors, false, policeDoesntCare))
+#if defined FIX_SIGNIFICANT_BUGS || defined PEDS_REPORT_CRIMES_ON_PHONE
+ if (!AddCrimeToQ(type, id, coors, true, policeDoesntCare))
+#else
+ if (!AddCrimeToQ(type, id, coors, false, policeDoesntCare))
+#endif
ReportCrimeNow(type, coors, policeDoesntCare);
}
@@ -219,6 +223,9 @@ CWanted::ReportCrimeNow(eCrimeType type, const CVector &coors, bool policeDoesnt
chaos *= 0.333f;
switch(type){
case CRIME_POSSESSION_GUN:
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ m_nChaos += 5.0f*chaos;
+#endif
break;
case CRIME_HIT_PED:
m_nChaos += 5.0f*chaos;
@@ -440,6 +447,30 @@ CWanted::Reset(void)
Initialise();
}
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+bool
+CrimeShouldBeReportedOnPhone(eCrimeType crime)
+{
+ switch (crime) {
+ case CRIME_POSSESSION_GUN:
+ case CRIME_HIT_PED:
+ case CRIME_HIT_COP:
+ case CRIME_SHOOT_PED:
+ case CRIME_SHOOT_COP:
+ case CRIME_STEAL_CAR:
+ case CRIME_RECKLESS_DRIVING:
+ case CRIME_RUNOVER_PED:
+ case CRIME_RUNOVER_COP:
+ case CRIME_PED_BURNED:
+ case CRIME_COP_BURNED:
+ case CRIME_VEHICLE_BURNED:
+ return true;
+ default:
+ return false;
+ }
+}
+#endif
+
void
CWanted::UpdateCrimesQ(void)
{
@@ -447,6 +478,9 @@ CWanted::UpdateCrimesQ(void)
CCrimeBeingQd &crime = m_aCrimes[i];
if (crime.m_nType != CRIME_NONE) {
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ if (!CrimeShouldBeReportedOnPhone(crime.m_nType))
+#endif
if (CTimer::GetTimeInMilliseconds() > crime.m_nTime + 500 && !crime.m_bReported) {
ReportCrimeNow(crime.m_nType, crime.m_vecPosn, crime.m_bPoliceDoesntCare);
crime.m_bReported = true;
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 8bcce8e7..9f384048 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -1797,7 +1797,7 @@ CWorld::ClearForRestart(void)
CWorld::Remove(pEntity);
delete pEntity;
}
- for(CPtrNode *pNode = GetBigBuildingList(LEVEL_NONE).first; pNode; pNode = pNode->next) {
+ for(CPtrNode *pNode = GetBigBuildingList(LEVEL_GENERIC).first; pNode; pNode = pNode->next) {
CVehicle *pVehicle = (CVehicle *)pNode->item;
if(pVehicle && pVehicle->IsVehicle() && pVehicle->IsPlane()) {
CWorld::Remove(pVehicle);
diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp
index 4f491a49..1556731b 100644
--- a/src/core/Zones.cpp
+++ b/src/core/Zones.cpp
@@ -90,7 +90,7 @@ CTheZones::Init(void)
TotalNumberOfZoneInfos = 1; // why 1?
TotalNumberOfZones = 1;
- m_CurrLevel = LEVEL_NONE;
+ m_CurrLevel = LEVEL_GENERIC;
m_pPlayersZone = &ZoneArray[0];
strcpy(ZoneArray[0].name, "CITYZON");
@@ -100,7 +100,7 @@ CTheZones::Init(void)
ZoneArray[0].maxx = 4000.0f;
ZoneArray[0].maxy = 4000.0f;
ZoneArray[0].maxz = 500.0f;
- ZoneArray[0].level = LEVEL_NONE;
+ ZoneArray[0].level = LEVEL_GENERIC;
for(i = 0; i < NUMMAPZONES; i++){
memset(&MapZoneArray[i], 0, sizeof(CZone));
@@ -116,7 +116,7 @@ CTheZones::Init(void)
MapZoneArray[0].maxx = 4000.0f;
MapZoneArray[0].maxy = 4000.0f;
MapZoneArray[0].maxz = 500.0f;
- MapZoneArray[0].level = LEVEL_NONE;
+ MapZoneArray[0].level = LEVEL_GENERIC;
}
void
@@ -577,7 +577,7 @@ CTheZones::FindZoneForPoint(const CVector &pos)
return LEVEL_COMMERCIAL;
if(PointLiesWithinZone(&pos, GetZone(FindZoneByLabelAndReturnIndex("SUB_ZON"))))
return LEVEL_SUBURBAN;
- return LEVEL_NONE;
+ return LEVEL_GENERIC;
}
void
diff --git a/src/core/common.h b/src/core/common.h
index 4bf1aebd..ebb3acb0 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -17,7 +17,11 @@
#if defined _WIN32 && defined WITHD3D
#include <windows.h>
+#ifndef USE_D3D9
#include <d3d8types.h>
+#else
+#include <d3d9types.h>
+#endif
#endif
#include <rwcore.h>
@@ -37,6 +41,7 @@
#define HIERNODEINFO(hier) ((hier)->pNodeInfo)
#define HIERNODEID(hier, i) ((hier)->pNodeInfo[i].nodeID)
#define HANIMFRAME(anim, i) ((RwUInt8*)(anim)->pFrames + (i)*(anim)->interpInfo->keyFrameSize)
+#define RpHAnimStdInterpFrame RpHAnimStdKeyFrame
#endif
#ifdef RWHALFPIXEL
diff --git a/src/core/config.h b/src/core/config.h
index ed36a493..94a35782 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -158,6 +158,7 @@ enum Config {
#if defined GTA_PS2
# define GTA_PS2_STUFF
# define RANDOMSPLASH
+# define COMPRESSED_COL_VECTORS
#elif defined GTA_PC
# define GTA3_1_1_PATCH
//# define GTA3_STEAM_PATCH
@@ -190,7 +191,6 @@ enum Config {
#endif
#define FIX_BUGS // fixes bugs that we've came across during reversing, TODO: use this more
-#define TOGGLEABLE_BETA_FEATURES // toggleable from debug menu. not too many things
#define MORE_LANGUAGES // Add more translations to the game
#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible
@@ -198,8 +198,12 @@ enum Config {
#define ASPECT_RATIO_SCALE // Not just makes everything scale with aspect ratio, also adds support for all aspect ratios
#define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch)
#define USE_TXD_CDIMAGE // generate and load textures from txd.img
+#define PS2_ALPHA_TEST // emulate ps2 alpha test
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
+#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time
+//#define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
//#define USE_TEXTURE_POOL
+#define CUTSCENE_BORDERS_SWITCH
// Particle
//#define PC_PARTICLE
@@ -264,11 +268,18 @@ enum Config {
// Peds
#define PED_SKIN // support for skinned geometry on peds
#define ANIMATE_PED_COL_MODEL
-#define VC_PED_PORTS // various ports from VC's CPed, mostly subtle
+// #define VC_PED_PORTS // various ports from VC's CPed, mostly subtle
// #define NEW_WALK_AROUND_ALGORITHM // to make walking around vehicles/objects less awkward
#define CANCELLABLE_CAR_ENTER
+//#define PEDS_REPORT_CRIMES_ON_PHONE
// Camera
//#define PS2_CAM_TRANSITION // old way of transitioning between cam modes
#define IMPROVED_CAMERA // Better Debug cam, and maybe more in the future
#define FREE_CAM // Rotating cam
+
+// Audio
+#ifndef AUDIO_OAL // is not working yet for openal
+#define AUDIO_CACHE // cache sound lengths to speed up the cold boot
+#endif
+//#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS \ No newline at end of file
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 1e26381a..a1c64a6d 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -254,7 +254,11 @@ DoFade(void)
fadeColor.a = alpha;
}
- if(TheCamera.m_WideScreenOn){
+ if(TheCamera.m_WideScreenOn
+#ifdef CUTSCENE_BORDERS_SWITCH
+ && CMenuManager::m_PrefsCutsceneBorders
+#endif
+ ){
// what's this?
float y = SCREEN_HEIGHT/2 * TheCamera.m_ScreenReductionPercentage/100.0f;
rect.left = 0.0f;
@@ -467,12 +471,16 @@ ResetLoadingScreenBar()
NumberOfChunksLoaded = 0.0f;
}
-// TODO: compare with PS2
void
LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
{
CSprite2d *splash;
+#ifdef DISABLE_LOADING_SCREEN
+ if (str1 && str2)
+ return;
+#endif
+
#ifndef RANDOMSPLASH
if(CGame::frenchGame || CGame::germanGame || !CGame::nastyGame)
splashscreen = "mainsc2";
@@ -858,7 +866,11 @@ Render2dStuff(void)
CReplay::Display();
CPickups::RenderPickUpText();
- if(TheCamera.m_WideScreenOn)
+ if(TheCamera.m_WideScreenOn
+#ifdef CUTSCENE_BORDERS_SWITCH
+ && CMenuManager::m_PrefsCutsceneBorders
+#endif
+ )
TheCamera.DrawBordersForWideScreen();
CPed *player = FindPlayerPed();
diff --git a/src/core/patcher.cpp b/src/core/patcher.cpp
deleted file mode 100644
index 83e06886..00000000
--- a/src/core/patcher.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-#define WITHWINDOWS
-#include "common.h"
-#include "patcher.h"
-
-#include <algorithm>
-#include <vector>
-
-StaticPatcher *StaticPatcher::ms_head;
-
-StaticPatcher::StaticPatcher(Patcher func)
- : m_func(func)
-{
- m_next = ms_head;
- ms_head = this;
-}
-
-void
-StaticPatcher::Apply()
-{
- StaticPatcher *current = ms_head;
- while(current){
- current->Run();
- current = current->m_next;
- }
- ms_head = nil;
-}
-#ifdef _WIN32
-std::vector<uint32> usedAddresses;
-
-static DWORD protect[2];
-static uint32 protect_address;
-static uint32 protect_size;
-
-void
-Protect_internal(uint32 address, uint32 size)
-{
- protect_address = address;
- protect_size = size;
- VirtualProtect((void*)address, size, PAGE_EXECUTE_READWRITE, &protect[0]);
-}
-
-void
-Unprotect_internal(void)
-{
- VirtualProtect((void*)protect_address, protect_size, protect[0], &protect[1]);
-}
-
-void
-InjectHook_internal(uint32 address, uint32 hook, int type)
-{
- if(std::any_of(usedAddresses.begin(), usedAddresses.end(),
- [address](uint32 value) { return value == address; })) {
- debug("Used address %#06x twice when injecting hook\n", address);
- }
-
- usedAddresses.push_back(address);
-
-
- switch(type){
- case PATCH_JUMP:
- VirtualProtect((void*)address, 5, PAGE_EXECUTE_READWRITE, &protect[0]);
- *(uint8*)address = 0xE9;
- break;
- case PATCH_CALL:
- VirtualProtect((void*)address, 5, PAGE_EXECUTE_READWRITE, &protect[0]);
- *(uint8*)address = 0xE8;
- break;
- default:
- VirtualProtect((void*)(address + 1), 4, PAGE_EXECUTE_READWRITE, &protect[0]);
- break;
- }
-
- *(ptrdiff_t*)(address + 1) = hook - address - 5;
- if(type == PATCH_NOTHING)
- VirtualProtect((void*)(address + 1), 4, protect[0], &protect[1]);
- else
- VirtualProtect((void*)address, 5, protect[0], &protect[1]);
-}
-#else
-void
-Protect_internal(uint32 address, uint32 size)
-{
-}
-
-void
-Unprotect_internal(void)
-{
-}
-
-void
-InjectHook_internal(uint32 address, uint32 hook, int type)
-{
-}
-#endif
diff --git a/src/core/patcher.h b/src/core/patcher.h
deleted file mode 100644
index 2722b6fd..00000000
--- a/src/core/patcher.h
+++ /dev/null
@@ -1,144 +0,0 @@
-#pragma once
-
-#define WRAPPER __declspec(naked)
-#define DEPRECATED __declspec(deprecated)
-#define EAXJMP(a) { _asm mov eax, a _asm jmp eax }
-#define VARJMP(a) { _asm jmp a }
-#define WRAPARG(a) UNREFERENCED_PARAMETER(a)
-
-#include <string.h> //memset
-
-enum
-{
- PATCH_CALL,
- PATCH_JUMP,
- PATCH_NOTHING,
-};
-
-enum
-{
- III_10 = 1,
- III_11,
- III_STEAM,
- VC_10,
- VC_11,
- VC_STEAM
-};
-
-extern int gtaversion;
-
-class StaticPatcher
-{
-private:
- using Patcher = void(*)();
-
- Patcher m_func;
- StaticPatcher *m_next;
- static StaticPatcher *ms_head;
-
- void Run() { m_func(); }
-public:
- StaticPatcher(Patcher func);
- static void Apply();
-};
-
-template<typename T>
-inline T AddressByVersion(uint32_t addressIII10, uint32_t addressIII11, uint32_t addressIIISteam, uint32_t addressvc10, uint32_t addressvc11, uint32_t addressvcSteam)
-{
- if(gtaversion == -1){
- if(*(uint32_t*)0x5C1E75 == 0xB85548EC) gtaversion = III_10;
- else if(*(uint32_t*)0x5C2135 == 0xB85548EC) gtaversion = III_11;
- else if(*(uint32_t*)0x5C6FD5 == 0xB85548EC) gtaversion = III_STEAM;
- else if(*(uint32_t*)0x667BF5 == 0xB85548EC) gtaversion = VC_10;
- else if(*(uint32_t*)0x667C45 == 0xB85548EC) gtaversion = VC_11;
- else if(*(uint32_t*)0x666BA5 == 0xB85548EC) gtaversion = VC_STEAM;
- else gtaversion = 0;
- }
- switch(gtaversion){
- case III_10:
- return (T)addressIII10;
- case III_11:
- return (T)addressIII11;
- case III_STEAM:
- return (T)addressIIISteam;
- case VC_10:
- return (T)addressvc10;
- case VC_11:
- return (T)addressvc11;
- case VC_STEAM:
- return (T)addressvcSteam;
- default:
- return (T)0;
- }
-}
-
-inline bool
-is10(void)
-{
- return gtaversion == III_10 || gtaversion == VC_10;
-}
-
-inline bool
-isIII(void)
-{
- return gtaversion >= III_10 && gtaversion <= III_STEAM;
-}
-
-inline bool
-isVC(void)
-{
- return gtaversion >= VC_10 && gtaversion <= VC_STEAM;
-}
-
-#define PTRFROMCALL(addr) (uint32_t)(*(uint32_t*)((uint32_t)addr+1) + (uint32_t)addr + 5)
-#define INTERCEPT(saved, func, a) \
-{ \
- saved = PTRFROMCALL(a); \
- InjectHook(a, func); \
-}
-
-void InjectHook_internal(uint32 address, uint32 hook, int type);
-void Protect_internal(uint32 address, uint32 size);
-void Unprotect_internal(void);
-
-template<typename T, typename AT> inline void
-Patch(AT address, T value)
-{
- Protect_internal((uint32)address, sizeof(T));
- *(T*)address = value;
- Unprotect_internal();
-}
-
-template<typename AT> inline void
-Nop(AT address, unsigned int nCount)
-{
- Protect_internal((uint32)address, nCount);
- memset((void*)address, 0x90, nCount);
- Unprotect_internal();
-}
-
-template <typename T> inline void
-InjectHook(uintptr_t address, T hook, unsigned int nType = PATCH_NOTHING)
-{
- InjectHook_internal(address, reinterpret_cast<uintptr_t>((void *&)hook), nType);
-}
-
-inline void ExtractCall(void *dst, uint32_t a)
-{
- *(uint32_t*)dst = (uint32_t)(*(uint32_t*)(a+1) + a + 5);
-}
-template<typename T>
-inline void InterceptCall(void *dst, T func, uint32_t a)
-{
- ExtractCall(dst, a);
- InjectHook(a, func);
-}
-template<typename T>
-inline void InterceptVmethod(void *dst, T func, uint32_t a)
-{
- *(uint32_t*)dst = *(uint32_t*)a;
- Patch(a, func);
-}
-
-#define STARTPATCHES static StaticPatcher Patcher([](){
-#define ENDPATCHES });
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index b21bff58..8c0020d0 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -2,7 +2,6 @@
#define WITHWINDOWS
#include "common.h"
#include "crossplatform.h"
-#include "patcher.h"
#include "Renderer.h"
#include "Credits.h"
#include "Camera.h"
@@ -75,7 +74,6 @@ mysrand(unsigned int seed)
void ReloadFrontendOptions(void)
{
- RemoveCustomFrontendOptions();
CustomFrontendOptionsPopulate();
}
@@ -133,10 +131,20 @@ void ToggleFreeCam(int8 action)
}
#endif
+#ifdef CUTSCENE_BORDERS_SWITCH
+void BorderModeChange(int8 displayedValue)
+{
+ CMenuManager::m_PrefsCutsceneBorders = !!displayedValue;
+ FrontEndMenuManager.SaveSettings();
+}
+#endif
+
// Reloaded on language change, so you can use hardcoded wchar* and TheText.Get with peace of mind
void
CustomFrontendOptionsPopulate(void)
{
+ RemoveCustomFrontendOptions(); // if exist
+
#ifdef MORE_LANGUAGES
FrontendOptionSetPosition(MENUPAGE_LANGUAGE_SETTINGS);
FrontendOptionAddDynamic(TheText.Get("FEL_POL"), nil, LangPolSelect, nil);
@@ -160,6 +168,12 @@ CustomFrontendOptionsPopulate(void)
FrontendOptionSetPosition(MENUPAGE_CONTROLLER_PC, 1);
FrontendOptionAddDynamic(text, nil, ToggleFreeCam, nil);
#endif
+
+#ifdef CUTSCENE_BORDERS_SWITCH
+ static const wchar *off_on[] = { TheText.Get("FEM_OFF"), TheText.Get("FEM_ON") };
+ FrontendOptionSetPosition(MENUPAGE_GRAPHICS_SETTINGS, 9);
+ FrontendOptionAddSelect((const wchar *)L"CUTSCENE BORDERS", off_on, 2, (int8 *)&CMenuManager::m_PrefsCutsceneBorders, false, BorderModeChange, nil);
+#endif
}
#endif
@@ -484,11 +498,7 @@ DebugMenuPopulate(void)
#ifdef CUSTOM_FRONTEND_OPTIONS
DebugMenuAddCmd("Debug", "Reload custom frontend options", ReloadFrontendOptions);
#endif
-#ifdef TOGGLEABLE_BETA_FEATURES
DebugMenuAddVarBool8("Debug", "Toggle popping heads on headshot", &CPed::bPopHeadsOnHeadshot, nil);
- DebugMenuAddVarBool8("Debug", "Toggle peds running to phones to report crimes", &CPed::bMakePedsRunToPhonesToReportCrimes, nil);
-#endif
-
DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start);
DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop);
diff --git a/src/entities/Building.cpp b/src/entities/Building.cpp
index 3c096636..00bbb21e 100644
--- a/src/entities/Building.cpp
+++ b/src/entities/Building.cpp
@@ -17,6 +17,6 @@ CBuilding::ReplaceWithNewModel(int32 id)
m_modelIndex = id;
if(bIsBIGBuilding)
- if(m_level == LEVEL_NONE || m_level == CGame::currLevel)
+ if(m_level == LEVEL_GENERIC || m_level == CGame::currLevel)
CStreaming::RequestModel(id, STREAMFLAGS_DONT_REMOVE);
}
diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp
index 31da489f..5e3204b2 100644
--- a/src/entities/Entity.cpp
+++ b/src/entities/Entity.cpp
@@ -332,14 +332,14 @@ CEntity::SetupBigBuilding(void)
bStreamingDontDelete = true;
bUsesCollision = false;
m_level = CTheZones::GetLevelFromPosition(&GetPosition());
- if(m_level == LEVEL_NONE){
+ if(m_level == LEVEL_GENERIC){
if(mi->GetTxdSlot() != CTxdStore::FindTxdSlot("generic")){
mi->SetTexDictionary("generic");
printf("%d:%s txd has been set to generic\n", m_modelIndex, mi->GetName());
}
}
if(mi->m_lodDistances[0] > 2000.0f)
- m_level = LEVEL_NONE;
+ m_level = LEVEL_GENERIC;
}
CRect
@@ -579,7 +579,7 @@ CEntity::UpdateRpHAnim(void)
char buf[256];
if(this == (CEntity*)FindPlayerPed())
for(i = 0; i < hier->numNodes; i++){
- RpHAnimStdKeyFrame *kf = (RpHAnimStdKeyFrame*)rpHANIMHIERARCHYGETINTERPFRAME(hier, i);
+ RpHAnimStdInterpFrame *kf = (RpHAnimStdInterpFrame*)rpHANIMHIERARCHYGETINTERPFRAME(hier, i);
sprintf(buf, "%6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %d %s",
kf->q.imag.x, kf->q.imag.y, kf->q.imag.z, kf->q.real,
kf->t.x, kf->t.y, kf->t.z,
diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp
index e89b4858..49060fe7 100644
--- a/src/entities/Physical.cpp
+++ b/src/entities/Physical.cpp
@@ -70,7 +70,7 @@ CPhysical::CPhysical(void)
#ifdef FIX_BUGS
m_nSurfaceTouched = SURFACE_DEFAULT;
#endif
- m_nZoneLevel = LEVEL_NONE;
+ m_nZoneLevel = LEVEL_GENERIC;
}
CPhysical::~CPhysical(void)
diff --git a/src/extras/frontendoption.cpp b/src/extras/frontendoption.cpp
index 6ab2801c..51814f35 100644
--- a/src/extras/frontendoption.cpp
+++ b/src/extras/frontendoption.cpp
@@ -43,10 +43,13 @@ GetNumberOfMenuOptions(int screen)
return Rows;
}
-// Used before reloading in InitialiseChangedLanguageSettings and debugmenu
+// Used before populating options, but effective in InitialiseChangedLanguageSettings and debugmenu
void
RemoveCustomFrontendOptions()
{
+ if (numCustomFrontendOptions == 0)
+ return;
+
for (int i = 0; i < MENUPAGES; i++) {
for (int j = 0; j < NUM_MENUROWS; j++) {
if (aScreens[i].m_aEntries[j].m_Action == MENUACTION_TRIGGERFUNC) {
@@ -68,9 +71,11 @@ int8 RegisterNewOption(int screen)
{
numCustomFrontendOptions++;
if (numCustomFrontendOptions == 1)
- customFrontendOptions = (FrontendOption*)malloc(numCustomFrontendOptions * sizeof(FrontendOption));
- else
- customFrontendOptions = (FrontendOption*)realloc(customFrontendOptions, numCustomFrontendOptions * sizeof(FrontendOption));
+ customFrontendOptions = (FrontendOption*)malloc(5 * sizeof(FrontendOption));
+ else if (numCustomFrontendOptions % 5 == 1)
+ customFrontendOptions = (FrontendOption*)realloc(customFrontendOptions, (numCustomFrontendOptions + 4) * sizeof(FrontendOption));
+
+ assert(customFrontendOptions != nil && "Custom frontend options can't be allocated");
uint8 nth = GetNumberOfMenuOptions(screen);
if (optionCursor < 0) {
diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp
index f95845a8..b9ff0144 100644
--- a/src/fakerw/fake.cpp
+++ b/src/fakerw/fake.cpp
@@ -35,9 +35,9 @@ RwReal RwV3dLength(const RwV3d * in) { return length(*in); }
//void RwV3dAssign(RwV3d * out, const RwV3d * ina);
void RwV3dAdd(RwV3d * out, const RwV3d * ina, const RwV3d * inb) { *out = add(*ina, *inb); }
void RwV3dSub(RwV3d * out, const RwV3d * ina, const RwV3d * inb) { *out = sub(*ina, *inb); }
-//void RwV3dScale(RwV3d * out, const RwV3d * in, RwReal scalar);
-//void RwV3dIncrementScaled(RwV3d * out, const RwV3d * in, RwReal scalar);
-//void RwV3dNegate(RwV3d * out, const RwV3d * in);
+void RwV3dScale(RwV3d * out, const RwV3d * in, RwReal scalar) { *out = scale(*in, scalar); }
+void RwV3dIncrementScaled(RwV3d * out, const RwV3d * in, RwReal scalar) { *out = add(*out, scale(*in, scalar)); }
+void RwV3dNegate(RwV3d * out, const RwV3d * in) { *out = neg(*in); }
RwReal RwV3dDotProduct(const RwV3d * ina, const RwV3d * inb) { return dot(*ina, *inb); }
//void RwV3dCrossProduct(RwV3d * out, const RwV3d * ina, const RwV3d * inb);
RwV3d *RwV3dTransformPoints(RwV3d * pointsOut, const RwV3d * pointsIn, RwInt32 numPoints, const RwMatrix * matrix)
@@ -83,7 +83,8 @@ RwFrame *RwFrameTranslate(RwFrame * frame, const RwV3d * v, RwOpCombineType comb
RwFrame *RwFrameRotate(RwFrame * frame, const RwV3d * axis, RwReal angle, RwOpCombineType combine) { frame->rotate(axis, angle, (CombineOp)combine); return frame; }
RwFrame *RwFrameScale(RwFrame * frame, const RwV3d * v, RwOpCombineType combine) { frame->scale(v, (CombineOp)combine); return frame; }
RwFrame *RwFrameTransform(RwFrame * frame, const RwMatrix * m, RwOpCombineType combine) { frame->transform(m, (CombineOp)combine); return frame; }
-//RwFrame *RwFrameOrthoNormalize(RwFrame * frame);
+//TODO: actually implement this!
+RwFrame *RwFrameOrthoNormalize(RwFrame * frame) { return frame; }
RwFrame *RwFrameSetIdentity(RwFrame * frame) { frame->matrix.setIdentity(); frame->updateObjects(); return frame; }
//RwFrame *RwFrameCloneHierarchy(RwFrame * root);
//RwBool RwFrameDestroyHierarchy(RwFrame * frame);
@@ -136,7 +137,7 @@ RwCamera *RwCameraCreate(void) { return rw::Camera::create(); }
RwCamera *RwCameraClone(RwCamera * camera) { return camera->clone(); }
RwCamera *RwCameraSetViewOffset(RwCamera *camera, const RwV2d *offset) { camera->setViewOffset(offset); return camera; }
RwCamera *RwCameraSetViewWindow(RwCamera *camera, const RwV2d *viewWindow) { camera->setViewWindow(viewWindow); return camera; }
-RwCamera *RwCameraSetProjection(RwCamera *camera, RwCameraProjection projection);
+RwCamera *RwCameraSetProjection(RwCamera *camera, RwCameraProjection projection) { camera->projection = projection; return camera; }
RwCamera *RwCameraSetNearClipPlane(RwCamera *camera, RwReal nearClip) { camera->setNearPlane(nearClip); return camera; }
RwCamera *RwCameraSetFarClipPlane(RwCamera *camera, RwReal farClip) { camera->setFarPlane(farClip); return camera; }
RwInt32 RwCameraRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor constructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB);
@@ -307,7 +308,7 @@ ConvertTexRaster(rw::Raster *ras)
Image *img = ras->toImage();
ras->destroy();
- img->unindex();
+ img->unpalettize();
ras = Raster::createFromImage(img);
img->destroy();
return ras;
@@ -375,23 +376,19 @@ RwStream *RwStreamOpen(RwStreamType type, RwStreamAccessType accessType, const v
file = rwNewT(StreamFile, 1, 0);
memcpy(file, &fakefile, sizeof(StreamFile));
#ifndef _WIN32
- // Be case-insensitive and fix backslashes (from https://github.com/OneSadCookie/fcaseopen/)
- FILE* first = fopen((char*)pData, "r");
- char *r;
- if (!first) {
- r = (char*)alloca(strlen((char*)pData) + 2);
- // Use default path(and pass error handling to librw) if we can't find any match
- if (!casepath((char*)pData, r))
- r = (char*)pData;
+ char *r = casepath((char*)pData);
+ if (r) {
+ if (file->open((char*)r, mode)) {
+ free(r);
+ return file;
+ }
+ free(r);
} else
- fclose(first);
-
- if(file->open((char*)r, mode))
- return file;
-#else
- if(file->open((char*)pData, mode))
- return file;
#endif
+ {
+ if (file->open((char*)pData, mode))
+ return file;
+ }
rwFree(file);
return nil;
}
@@ -855,12 +852,41 @@ RpSkin *RpSkinGeometryGetSkin( RpGeometry *geometry ) { return Skin::get(geometr
RpAtomic *RpSkinAtomicSetHAnimHierarchy( RpAtomic *atomic, RpHAnimHierarchy *hierarchy ) { Skin::setHierarchy(atomic, hierarchy); return atomic; }
RpHAnimHierarchy *RpSkinAtomicGetHAnimHierarchy( const RpAtomic *atomic ) { return Skin::getHierarchy(atomic); }
+RwImage *
+RtBMPImageWrite(RwImage *image, const RwChar *imageName)
+{
+#ifndef _WIN32
+ char *r = casepath(imageName);
+ if (r) {
+ rw::writeBMP(image, r);
+ free(r);
+ } else {
+ rw::writeBMP(image, imageName);
+ }
+
+#else
+ rw::writeBMP(image, imageName);
+#endif
+ return image;
+}
+RwImage *
+RtBMPImageRead(const RwChar *imageName)
+{
+#ifndef _WIN32
+ RwImage *image;
+ char *r = casepath(imageName);
+ if (r) {
+ image = rw::readBMP(r);
+ free(r);
+ } else {
+ image = rw::readBMP(imageName);
+ }
+ return image;
-
-
-
-RwImage *RtBMPImageWrite(RwImage * image, const RwChar * imageName) { rw::writeBMP(image, imageName); return image; }
-RwImage *RtBMPImageRead(const RwChar * imageName) { return rw::readBMP(imageName); }
+#else
+ return rw::readBMP(imageName);
+#endif
+}
#include "rtquat.h"
diff --git a/src/fakerw/rphanim.h b/src/fakerw/rphanim.h
index 6ece8306..63059800 100644
--- a/src/fakerw/rphanim.h
+++ b/src/fakerw/rphanim.h
@@ -17,7 +17,15 @@ struct RpHAnimStdKeyFrame
RtQuat q;
RwV3d t;
};
-
+// same story, this one only exists in later RW versions
+// but we need it for 64 bit builds because offset and size differs!
+struct RpHAnimStdInterpFrame
+{
+ RpHAnimStdKeyFrame *keyFrame1;
+ RpHAnimStdKeyFrame *keyFrame2;
+ RtQuat q;
+ RwV3d t;
+};
enum RpHAnimHierarchyFlag
{
@@ -56,7 +64,7 @@ RwBool RpHAnimHierarchyUpdateMatrices(RpHAnimHierarchy *hierarchy);
#define rpHANIMHIERARCHYGETINTERPFRAME( hierarchy, nodeIndex ) \
( (void *)( ( (RwUInt8 *)&(hierarchy->interpolator[1]) + \
((nodeIndex) * \
- hierarchy->interpolator->currentAnimKeyFrameSize) ) ) )
+ hierarchy->interpolator->currentInterpKeyFrameSize) ) ) )
RpHAnimAnimation *RpHAnimAnimationCreate(RwInt32 typeID, RwInt32 numFrames, RwInt32 flags, RwReal duration);
diff --git a/src/math/Matrix.h b/src/math/Matrix.h
index d8920a65..c849a5c4 100644
--- a/src/math/Matrix.h
+++ b/src/math/Matrix.h
@@ -259,6 +259,14 @@ public:
m_matrix.at.y = 0.0f;
m_matrix.at.z = 1.0f;
}
+ void SetTranslateOnly(float x, float y, float z) {
+ m_matrix.pos.x = x;
+ m_matrix.pos.y = y;
+ m_matrix.pos.z = z;
+ }
+ void SetTranslateOnly(const CVector& pos) {
+ SetTranslateOnly(pos.x, pos.y, pos.z);
+ }
};
diff --git a/src/math/maths.h b/src/math/maths.h
index 51b0ef10..8d68bf64 100644
--- a/src/math/maths.h
+++ b/src/math/maths.h
@@ -15,3 +15,5 @@ inline float Sqrt(float x) { return sqrtf(x); }
inline float RecipSqrt(float x, float y) { return x/Sqrt(y); }
inline float RecipSqrt(float x) { return RecipSqrt(1.0f, x); }
inline float Pow(float x, float y) { return powf(x, y); }
+inline float Floor(float x) { return floorf(x); }
+inline float Ceil(float x) { return ceilf(x); }
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp
index da09bdfa..d6fb0102 100644
--- a/src/modelinfo/ModelInfo.cpp
+++ b/src/modelinfo/ModelInfo.cpp
@@ -217,6 +217,7 @@ CModelInfo::IsBikeModel(int32 id)
void
CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level)
{
+#ifndef NO_ISLAND_LOADING
int i;
CBaseModelInfo *mi;
CColModel *colmodel;
@@ -225,10 +226,11 @@ CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level)
mi = GetModelInfo(i);
if(mi){
colmodel = mi->GetColModel();
- if(colmodel && colmodel->level != LEVEL_NONE && colmodel->level != level)
+ if(colmodel && colmodel->level != LEVEL_GENERIC && colmodel->level != level)
colmodel->RemoveCollisionVolumes();
}
}
+#endif
}
void
diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp
index 1d8aa4dc..60c63114 100644
--- a/src/modelinfo/PedModelInfo.cpp
+++ b/src/modelinfo/PedModelInfo.cpp
@@ -265,7 +265,7 @@ CPedModelInfo::CreateHitColModel(void)
max.x = max.y = 0.5f;
max.z = 1.2f;
colmodel->boundingBox.Set(min, max, 0, 0);
- colmodel->level = LEVEL_NONE;
+ colmodel->level = LEVEL_GENERIC;
m_hitColModel = colmodel;
}
@@ -349,7 +349,7 @@ CPedModelInfo::CreateHitColModelSkinned(RpClump *clump)
max.x = max.y = 0.5f;
max.z = 1.2f;
colmodel->boundingBox.Set(min, max, 0, 0);
- colmodel->level = LEVEL_NONE;
+ colmodel->level = LEVEL_GENERIC;
m_hitColModel = colmodel;
}
diff --git a/src/modelinfo/VehicleModelInfo.h b/src/modelinfo/VehicleModelInfo.h
index 468ce96d..e6ba576d 100644
--- a/src/modelinfo/VehicleModelInfo.h
+++ b/src/modelinfo/VehicleModelInfo.h
@@ -137,7 +137,7 @@ public:
void SetVehicleComponentFlags(RwFrame *frame, uint32 flags);
void PreprocessHierarchy(void);
void GetWheelPosn(int32 n, CVector &pos);
- CVector &GetFrontSeatPosn(void) { return m_positions[m_vehicleType == VEHICLE_TYPE_BOAT ? BOAT_POS_FRONTSEAT : CAR_POS_FRONTSEAT]; };
+ const CVector &GetFrontSeatPosn(void) { return m_vehicleType == VEHICLE_TYPE_BOAT ? m_positions[BOAT_POS_FRONTSEAT] : m_positions[CAR_POS_FRONTSEAT]; }
int32 ChooseComponent(void);
int32 ChooseSecondComponent(void);
diff --git a/src/peds/CivilianPed.cpp b/src/peds/CivilianPed.cpp
index 2dee0397..2d782a73 100644
--- a/src/peds/CivilianPed.cpp
+++ b/src/peds/CivilianPed.cpp
@@ -10,6 +10,30 @@
#include "Vehicle.h"
#include "SurfaceTable.h"
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+eCrimeType
+EventTypeToCrimeType(eEventType event)
+{
+ eCrimeType crime;
+ switch (event) {
+ case EVENT_ASSAULT: crime = CRIME_HIT_PED; break;
+ case EVENT_RUN_REDLIGHT: crime = CRIME_RUN_REDLIGHT; break;
+ case EVENT_ASSAULT_POLICE: crime = CRIME_HIT_COP; break;
+ case EVENT_GUNSHOT: crime = CRIME_POSSESSION_GUN; break;
+ case EVENT_STEAL_CAR: crime = CRIME_STEAL_CAR; break;
+ case EVENT_HIT_AND_RUN: crime = CRIME_RUNOVER_PED; break;
+ case EVENT_HIT_AND_RUN_COP: crime = CRIME_RUNOVER_COP; break;
+ case EVENT_SHOOT_PED: crime = CRIME_SHOOT_PED; break;
+ case EVENT_SHOOT_COP: crime = CRIME_SHOOT_COP; break;
+ case EVENT_PED_SET_ON_FIRE: crime = CRIME_PED_BURNED; break;
+ case EVENT_COP_SET_ON_FIRE: crime = CRIME_COP_BURNED; break;
+ case EVENT_CAR_SET_ON_FIRE: crime = CRIME_VEHICLE_BURNED; break;
+ default: crime = CRIME_NONE; break;
+ }
+ return crime;
+}
+#endif
+
CCivilianPed::CCivilianPed(ePedType pedtype, uint32 mi) : CPed(pedtype)
{
SetModelIndex(mi);
@@ -113,25 +137,20 @@ CCivilianPed::CivilianAI(void)
investigateDeadPed = false;
}
-#ifdef TOGGLEABLE_BETA_FEATURES
- eCrimeType crime = (((CPed*)m_pEventEntity)->m_ped_flagI40 ?
- (((CPed*)m_pEventEntity)->m_nPedType == PEDTYPE_COP ? CRIME_RUNOVER_COP : CRIME_RUNOVER_PED) :
- (((CPed*)m_pEventEntity)->m_nPedType == PEDTYPE_COP ? CRIME_SHOOT_COP : CRIME_SHOOT_PED));
- bool eligibleToReport = bMakePedsRunToPhonesToReportCrimes && killerOfDeadPed && killerOfDeadPed->IsPed() && ((CPed*)killerOfDeadPed)->IsPlayer() &&
- m_pedStats->m_fear <= m_pedStats->m_lawfulness && m_pedStats->m_temper <= m_pedStats->m_fear;
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ int32 eventId = CheckForPlayerCrimes((CPed*)m_pEventEntity);
+ eCrimeType crime = (eventId == -1 ? CRIME_NONE : EventTypeToCrimeType(gaEvent[eventId].type));
+ bool eligibleToReport = crime != CRIME_NONE && m_pedStats->m_fear <= m_pedStats->m_lawfulness && m_pedStats->m_temper <= m_pedStats->m_fear;
if (IsGangMember() || !eligibleToReport || !RunToReportCrime(crime))
#endif
if (investigateDeadPed)
SetInvestigateEvent(EVENT_DEAD_PED, CVector2D(m_pEventEntity->GetPosition()), 1.0f, 20000, 0.0f);
} else {
-#ifdef TOGGLEABLE_BETA_FEATURES
- CEntity* killerOfDeadPed = ((CPed*)m_pEventEntity)->m_threatEntity;
- eCrimeType crime = (((CPed*)m_pEventEntity)->m_ped_flagI40 ?
- (((CPed*)m_pEventEntity)->m_nPedType == PEDTYPE_COP ? CRIME_RUNOVER_COP : CRIME_RUNOVER_PED) :
- (((CPed*)m_pEventEntity)->m_nPedType == PEDTYPE_COP ? CRIME_SHOOT_COP : CRIME_SHOOT_PED));
- bool eligibleToReport = bMakePedsRunToPhonesToReportCrimes && killerOfDeadPed && killerOfDeadPed->IsPed() && ((CPed*)killerOfDeadPed)->IsPlayer() &&
- m_pedStats->m_fear <= m_pedStats->m_lawfulness && m_pedStats->m_temper <= m_pedStats->m_fear;
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ int32 eventId = CheckForPlayerCrimes((CPed*)m_pEventEntity);
+ eCrimeType crime = (eventId == -1 ? CRIME_NONE : EventTypeToCrimeType(gaEvent[eventId].type));
+ bool eligibleToReport = crime != CRIME_NONE && m_pedStats->m_fear <= m_pedStats->m_lawfulness && m_pedStats->m_temper <= m_pedStats->m_fear;
if(!eligibleToReport || !RunToReportCrime(crime))
#endif
{
@@ -165,29 +184,55 @@ CCivilianPed::CivilianAI(void)
}
}
} else {
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ bool youShouldRunEventually = false;
+ bool dontGoToPhone = false;
+#endif
if (m_threatEntity && m_threatEntity->IsPed()) {
CPed *threatPed = (CPed*)m_threatEntity;
if (m_pedStats->m_fear <= 100 - threatPed->m_pedStats->m_temper && threatPed->m_nPedType != PEDTYPE_COP) {
if (threatPed->GetWeapon(m_currentWeapon).IsTypeMelee() || !GetWeapon()->IsTypeMelee()) {
if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops != 0) {
if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS) {
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ dontGoToPhone = true;
+#endif
SetFindPathAndFlee(m_threatEntity, 10000);
}
} else {
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ dontGoToPhone = true;
+#endif
SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, m_threatEntity);
}
}
} else {
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ youShouldRunEventually = true;
+#else
+ SetFindPathAndFlee(m_threatEntity, 10000, true);
+#endif
+ }
+ }
+
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ if (!dontGoToPhone) {
+ int32 eventId = CheckForPlayerCrimes(nil);
+ eCrimeType crime = (eventId == -1 ? CRIME_NONE : EventTypeToCrimeType(gaEvent[eventId].type));
+ bool eligibleToReport = crime != CRIME_NONE && m_pedStats->m_fear <= m_pedStats->m_lawfulness;
+
+ if ((!eligibleToReport || !RunToReportCrime(crime)) && youShouldRunEventually) {
SetFindPathAndFlee(m_threatEntity, 10000, true);
}
}
+#endif
}
}
void
CCivilianPed::ProcessControl(void)
{
- if (m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory)
+ if (m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
return;
CPed::ProcessControl();
@@ -217,15 +262,18 @@ CCivilianPed::ProcessControl(void)
if (Seek()) {
if ((m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT || m_objective == OBJECTIVE_RUN_TO_AREA) && m_pNextPathNode) {
m_pNextPathNode = nil;
-#ifdef TOGGLEABLE_BETA_FEATURES
- } else if (bRunningToPhone && m_objective < OBJECTIVE_FLEE_TILL_SAFE) {
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ } else if (bRunningToPhone && m_objective < OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE) {
if (!isPhoneAvailable(m_phoneId)) {
RestorePreviousState();
- crimeReporters[m_phoneId] = nil;
+ if (crimeReporters[m_phoneId] == this)
+ crimeReporters[m_phoneId] = nil;
+
m_phoneId = -1;
bRunningToPhone = false;
} else {
crimeReporters[m_phoneId] = this;
+ m_facePhoneStart = true;
m_nPedState = PED_FACE_PHONE;
}
#else
@@ -239,7 +287,7 @@ CCivilianPed::ProcessControl(void)
}
#endif
} else if (m_objective != OBJECTIVE_KILL_CHAR_ANY_MEANS && m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT) {
- if (m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION) {
+ if (m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) {
if (m_moved.Magnitude() == 0.0f) {
if (m_pedInObjective->m_nMoveState == PEDMOVE_STILL)
m_fRotationDest = m_pedInObjective->m_fRotationCur;
@@ -329,13 +377,13 @@ CCivilianPed::ProcessControl(void)
} else {
bWanderPathAfterExitingCar = true;
CWorld::Players[CWorld::PlayerInFocus].m_pHooker = nil;
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
}
} else {
bWanderPathAfterExitingCar = true;
CWorld::Players[CWorld::PlayerInFocus].m_pHooker = nil;
m_pMyVehicle->pDriver->m_fHealth = 125.0f;
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
}
} else {
CWorld::Players[CWorld::PlayerInFocus].m_nNextSexFrequencyUpdateTime = CTimer::GetTimeInMilliseconds() + 3000;
@@ -348,7 +396,7 @@ CCivilianPed::ProcessControl(void)
} else {
bWanderPathAfterExitingCar = true;
CWorld::Players[CWorld::PlayerInFocus].m_pHooker = nil;
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
}
}
diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp
index 99e8c1ae..6d106b0e 100644
--- a/src/peds/CopPed.cpp
+++ b/src/peds/CopPed.cpp
@@ -559,7 +559,7 @@ CCopPed::CopAI(void)
void
CCopPed::ProcessControl(void)
{
- if (m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory)
+ if (m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
return;
CPed::ProcessControl();
diff --git a/src/peds/EmergencyPed.cpp b/src/peds/EmergencyPed.cpp
index cdaee657..8d6999c3 100644
--- a/src/peds/EmergencyPed.cpp
+++ b/src/peds/EmergencyPed.cpp
@@ -44,7 +44,7 @@ CEmergencyPed::InRange(CPed *victim)
void
CEmergencyPed::ProcessControl(void)
{
- if (m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory)
+ if (m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
return;
CPed::ProcessControl();
@@ -188,12 +188,12 @@ CEmergencyPed::MedicAI(void)
}
if (InVehicle()) {
- if (m_pMyVehicle->IsCar() && m_objective != OBJECTIVE_LEAVE_VEHICLE) {
+ if (m_pMyVehicle->IsCar() && m_objective != OBJECTIVE_LEAVE_CAR) {
if (gAccidentManager.FindNearestAccident(m_pMyVehicle->GetPosition(), &distToEmergency)
&& distToEmergency < 25.0f && m_pMyVehicle->m_vecMoveSpeed.Magnitude() < 0.01f) {
m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
Say(SOUND_PED_LEAVE_VEHICLE);
} else if (m_pMyVehicle->pDriver == this && m_nPedState == PED_DRIVING
&& m_pMyVehicle->AutoPilot.m_nCarMission == MISSION_NONE && !(CGeneral::GetRandomNumber() & 31)) {
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index cf254cf4..f52b373e 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -118,9 +118,8 @@ void *CPed::operator new(size_t sz, int handle) { return CPools::GetPedPool()->N
void CPed::operator delete(void *p, size_t sz) { CPools::GetPedPool()->Delete((CPed*)p); }
void CPed::operator delete(void *p, int handle) { CPools::GetPedPool()->Delete((CPed*)p); }
-#ifdef TOGGLEABLE_BETA_FEATURES
+#ifdef DEBUGMENU
bool CPed::bPopHeadsOnHeadshot = false;
-bool CPed::bMakePedsRunToPhonesToReportCrimes = false;
#endif
CPed::~CPed(void)
@@ -384,7 +383,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
weapon.m_nTimer = 0;
}
- m_lastFightMove = FIGHTMOVE_NULL;
+ m_curFightMove = FIGHTMOVE_NULL;
GiveWeapon(WEAPONTYPE_UNARMED, 0);
m_wepAccuracy = 60;
m_lastWepDam = -1;
@@ -472,7 +471,7 @@ CheckForPedsOnGroundToAttack(CPed *attacker, CPed **pedOnGround)
currentPedState = currentPed->m_nPedState;
- if (currentPedState == PED_FALL || currentPedState == PED_GETUP || currentPedState == PED_DIE || currentPedState == PED_DEAD) {
+ if (currentPed->OnGroundOrGettingUp()) {
if (distance < 2.0f && angleDiff < DEGTORAD(65.0f)) {
if (currentPedState == PED_DEAD) {
foundDead = 1;
@@ -571,9 +570,12 @@ CPed::AddWeaponModel(int id)
if (id != -1) {
#ifdef PED_SKIN
- if(IsClumpSkinned(GetClump()))
+ if (IsClumpSkinned(GetClump())) {
+ if (m_pWeaponModel)
+ RemoveWeaponModel(-1);
+
m_pWeaponModel = (RpAtomic*)CModelInfo::GetModelInfo(id)->CreateInstance();
- else
+ } else
#endif
{
atm = (RpAtomic*)CModelInfo::GetModelInfo(id)->CreateInstance();
@@ -683,7 +685,7 @@ CPed::RemoveBodyPart(PedNode nodeId, int8 direction)
if(!IsClumpSkinned(GetClump()))
#endif
{
-#ifdef TOGGLEABLE_BETA_FEATURES
+#ifdef DEBUGMENU
if (bPopHeadsOnHeadshot || nodeId != PED_HEAD)
#else
if (nodeId != PED_HEAD)
@@ -835,7 +837,7 @@ CPed::ClearAimFlag(void)
bIsAimingGun = false;
bIsRestoringGun = true;
m_pedIK.m_flags &= ~CPedIK::AIMS_WITH_ARM;
-#ifdef VC_PED_PORTS
+#if defined VC_PED_PORTS || defined FIX_BUGS
m_lookTimer = 0;
#endif
}
@@ -1944,7 +1946,7 @@ CPed::PlayFootSteps(void)
CVector particlePos = GetPosition() + GetForward() * 0.3f;
particlePos.z -= 1.2f;
- CVector particleDir = m_vecMoveSpeed * 0.75f;
+ CVector particleDir = m_vecMoveSpeed * -0.75f;
particleDir.z = CGeneral::GetRandomNumberInRange(0.01f, 0.03f);
CParticle::AddParticle(PARTICLE_PED_SPLASH, particlePos, particleDir, nil, 0.8f * particleSize, CRGBA(155,155,185,128), 0, 0, 0, 0);
@@ -2014,18 +2016,19 @@ CPed::SortPeds(CPed **list, int min, int max)
void
CPed::BuildPedLists(void)
{
- if ((CTimer::GetFrameCounter() + (m_randomSeed % 256)) % 16) {
+ if ((CTimer::GetFrameCounter() + m_randomSeed) % 16) {
for(int i = 0; i < ARRAY_SIZE(m_nearPeds); ) {
+ bool removePed = false;
if (m_nearPeds[i]) {
if (m_nearPeds[i]->IsPointerValid()) {
float distSqr = (GetPosition() - m_nearPeds[i]->GetPosition()).MagnitudeSqr2D();
- if (distSqr < 900.0f) {
- i++;
- continue;
- }
- }
-
+ if (distSqr > 900.0f)
+ removePed = true;
+ } else
+ removePed = true;
+ }
+ if (removePed) {
// If we arrive here, the ped we're checking isn't "near", so we should remove it.
for (int j = i; j < ARRAY_SIZE(m_nearPeds) - 1; j++) {
m_nearPeds[j] = m_nearPeds[j + 1];
@@ -2033,7 +2036,7 @@ CPed::BuildPedLists(void)
}
// Above loop won't work when it's 9, so we need to empty slot 9.
m_nearPeds[9] = nil;
- m_numNearPeds--;
+ m_numNearPeds--;
} else
i++;
}
@@ -2243,11 +2246,6 @@ CPed::CalculateNewVelocity(void)
CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE);
CAnimBlendAssociation *fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE);
#ifdef VC_PED_PORTS
- if(!fightAssoc)
- fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TIRED);
-
- // There is one more anim in VC.
-
if ((!idleAssoc || idleAssoc->blendAmount < 0.5f) && !fightAssoc && !bIsDucking) {
#else
if ((!idleAssoc || idleAssoc->blendAmount < 0.5f) && !fightAssoc) {
@@ -2405,7 +2403,7 @@ CPed::CanSeeEntity(CEntity *entity, float threshold = CAN_SEE_ENTITY_ANGLE_THRES
bool
CPed::IsTemporaryObjective(eObjective objective)
{
- return objective == OBJECTIVE_LEAVE_VEHICLE || objective == OBJECTIVE_SET_LEADER ||
+ return objective == OBJECTIVE_LEAVE_CAR || objective == OBJECTIVE_SET_LEADER ||
#ifdef VC_PED_PORTS
objective == OBJECTIVE_LEAVE_CAR_AND_DIE ||
#endif
@@ -2438,7 +2436,7 @@ CPed::ForceStoredObjective(eObjective objective)
switch (m_objective)
{
- case OBJECTIVE_FLEE_TILL_SAFE:
+ case OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE:
case OBJECTIVE_KILL_CHAR_ON_FOOT:
case OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE:
case OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS:
@@ -2461,14 +2459,14 @@ CPed::SetStoredObjective(void)
switch (m_objective)
{
- case OBJECTIVE_FLEE_TILL_SAFE:
+ case OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE:
case OBJECTIVE_KILL_CHAR_ON_FOOT:
case OBJECTIVE_KILL_CHAR_ANY_MEANS:
case OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE:
case OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS:
case OBJECTIVE_GOTO_CHAR_ON_FOOT:
- case OBJECTIVE_FOLLOW_PED_IN_FORMATION:
- case OBJECTIVE_LEAVE_VEHICLE:
+ case OBJECTIVE_FOLLOW_CHAR_IN_FORMATION:
+ case OBJECTIVE_LEAVE_CAR:
case OBJECTIVE_ENTER_CAR_AS_PASSENGER:
case OBJECTIVE_ENTER_CAR_AS_DRIVER:
case OBJECTIVE_GOTO_AREA_ON_FOOT:
@@ -2485,17 +2483,17 @@ CPed::RestorePreviousObjective(void)
if (m_objective == OBJECTIVE_NONE)
return;
- if (m_objective != OBJECTIVE_LEAVE_VEHICLE && m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER && m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER
-#ifdef VC_PED_PORTS
+ if (m_objective != OBJECTIVE_LEAVE_CAR && m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER && m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER
+#if defined VC_PED_PORTS || defined FIX_BUGS
&& m_nPedState != PED_CARJACK
#endif
)
m_pedInObjective = nil;
- if (m_objective == OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT) {
+ if (m_objective == OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT) {
m_objective = OBJECTIVE_NONE;
if (m_pMyVehicle)
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
} else {
m_objective = m_prevObjective;
@@ -2534,14 +2532,14 @@ CPed::SetObjective(eObjective newObj, void *entity)
case OBJECTIVE_KILL_CHAR_ON_FOOT:
case OBJECTIVE_KILL_CHAR_ANY_MEANS:
case OBJECTIVE_GOTO_CHAR_ON_FOOT:
- case OBJECTIVE_FOLLOW_PED_IN_FORMATION:
+ case OBJECTIVE_FOLLOW_CHAR_IN_FORMATION:
case OBJECTIVE_GOTO_AREA_ANY_MEANS:
- case OBJECTIVE_FIGHT_CHAR:
+ case OBJECTIVE_GUARD_ATTACK:
if (m_pedInObjective == entity)
return;
break;
- case OBJECTIVE_LEAVE_VEHICLE:
+ case OBJECTIVE_LEAVE_CAR:
case OBJECTIVE_FLEE_CAR:
#ifdef VC_PED_PORTS
case OBJECTIVE_LEAVE_CAR_AND_DIE:
@@ -2550,7 +2548,7 @@ CPed::SetObjective(eObjective newObj, void *entity)
case OBJECTIVE_ENTER_CAR_AS_PASSENGER:
case OBJECTIVE_ENTER_CAR_AS_DRIVER:
case OBJECTIVE_DESTROY_CAR:
- case OBJECTIVE_SOLICIT:
+ case OBJECTIVE_SOLICIT_VEHICLE:
case OBJECTIVE_BUY_ICE_CREAM:
if (m_carInObjective == entity)
return;
@@ -2565,7 +2563,7 @@ CPed::SetObjective(eObjective newObj, void *entity)
break;
}
} else {
- if ((newObj == OBJECTIVE_LEAVE_VEHICLE
+ if ((newObj == OBJECTIVE_LEAVE_CAR
#ifdef VC_PED_PORTS
|| newObj == OBJECTIVE_LEAVE_CAR_AND_DIE
#endif
@@ -2590,7 +2588,7 @@ CPed::SetObjective(eObjective newObj, void *entity)
}
switch (newObj) {
- case OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT:
+ case OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT:
// In this special case, entity parameter isn't CEntity, but int.
SetObjectiveTimer((uintptr)entity);
@@ -2609,17 +2607,17 @@ CPed::SetObjective(eObjective newObj, void *entity)
case OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE:
case OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS:
case OBJECTIVE_GOTO_CHAR_ON_FOOT:
- case OBJECTIVE_FIGHT_CHAR:
+ case OBJECTIVE_GUARD_ATTACK:
m_vecSeekPos = CVector(0.0f, 0.0f, 0.0f);
m_pedInObjective = (CPed*)entity;
m_pedInObjective->RegisterReference((CEntity**)&m_pedInObjective);
break;
- case OBJECTIVE_FOLLOW_PED_IN_FORMATION:
+ case OBJECTIVE_FOLLOW_CHAR_IN_FORMATION:
m_pedInObjective = (CPed*)entity;
m_pedInObjective->RegisterReference((CEntity**)&m_pedInObjective);
m_pedFormation = FORMATION_REAR;
break;
- case OBJECTIVE_LEAVE_VEHICLE:
+ case OBJECTIVE_LEAVE_CAR:
#ifdef VC_PED_PORTS
case OBJECTIVE_LEAVE_CAR_AND_DIE:
#endif
@@ -2648,14 +2646,14 @@ CPed::SetObjective(eObjective newObj, void *entity)
}
// fall through
case OBJECTIVE_DESTROY_CAR:
- case OBJECTIVE_SOLICIT:
+ case OBJECTIVE_SOLICIT_VEHICLE:
case OBJECTIVE_BUY_ICE_CREAM:
m_carInObjective = (CVehicle*)entity;
m_carInObjective->RegisterReference((CEntity**)&m_carInObjective);
m_pSeekTarget = m_carInObjective;
m_pSeekTarget->RegisterReference((CEntity**)&m_pSeekTarget);
m_vecSeekPos = CVector(0.0f, 0.0f, 0.0f);
- if (newObj == OBJECTIVE_SOLICIT) {
+ if (newObj == OBJECTIVE_SOLICIT_VEHICLE) {
m_objectiveTimer = CTimer::GetTimeInMilliseconds() + 10000;
} else if (m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER && CharCreatedBy == MISSION_CHAR &&
(m_carInObjective->GetStatus() == STATUS_PLAYER_DISABLED || CPad::GetPad(CWorld::PlayerInFocus)->ArePlayerControlsDisabled())) {
@@ -2698,7 +2696,7 @@ CPed::SetObjective(eObjective newObj)
return;
if (newObj == OBJECTIVE_NONE) {
- if ((m_objective == OBJECTIVE_LEAVE_VEHICLE || m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER
+ if ((m_objective == OBJECTIVE_LEAVE_CAR || m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER
#ifdef VC_PED_PORTS
|| m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE)
&& !IsPlayer()
@@ -2718,7 +2716,7 @@ CPed::SetObjective(eObjective newObj)
}
*/
- m_objective = newObj;
+ m_objective = OBJECTIVE_NONE;
m_prevObjective = OBJECTIVE_NONE;
} else if (m_prevObjective != newObj || m_prevObjective == OBJECTIVE_NONE) {
SetObjectiveTimer(0);
@@ -3078,47 +3076,106 @@ CPed::CheckAroundForPossibleCollisions(void)
}
}
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+void
+ReportPhonePickUpCB(CAnimBlendAssociation* assoc, void* arg)
+{
+ CPed* ped = (CPed*)arg;
+ ped->m_nMoveState = PEDMOVE_STILL;
+ CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_IDLE_STANCE, 8.0f);
+
+ if (assoc->blendAmount > 0.5f && ped) {
+ CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_PHONE_TALK, 8.0f);
+ }
+}
+
+void
+ReportPhonePutDownCB(CAnimBlendAssociation* assoc, void* arg)
+{
+ assoc->flags |= ASSOC_DELETEFADEDOUT;
+ assoc->blendDelta = -1000.0f;
+ CPed* ped = (CPed*)arg;
+
+ if (ped->m_phoneId != -1 && crimeReporters[ped->m_phoneId] == ped) {
+ crimeReporters[ped->m_phoneId] = nil;
+ gPhoneInfo.m_aPhones[ped->m_phoneId].m_nState = PHONE_STATE_FREE;
+ ped->m_phoneId = -1;
+ }
+
+ if (assoc->blendAmount > 0.5f)
+ ped->bUpdateAnimHeading = true;
+
+ ped->SetWanderPath(CGeneral::GetRandomNumber() & 7);
+}
+#endif
+
bool
CPed::MakePhonecall(void)
{
-#ifdef TOGGLEABLE_BETA_FEATURES
- if (bMakePedsRunToPhonesToReportCrimes)
- if (!IsPlayer() && CTimer::GetTimeInMilliseconds() > m_phoneTalkTimer - 7000 && bRunningToPhone) {
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ if (!IsPlayer() && CTimer::GetTimeInMilliseconds() > m_phoneTalkTimer - 7000 && bRunningToPhone) {
- FindPlayerPed()->m_pWanted->RegisterCrime_Immediately(m_crimeToReportOnPhone, GetPosition(),
- (m_crimeToReportOnPhone == CRIME_POSSESSION_GUN ? (uintptr)m_threatEntity : (uintptr)((CPed*)m_pEventEntity)->m_threatEntity), false);
- bRunningToPhone = false;
- }
+ FindPlayerPed()->m_pWanted->RegisterCrime_Immediately(m_crimeToReportOnPhone, GetPosition(),
+ (m_crimeToReportOnPhone == CRIME_POSSESSION_GUN ? (uintptr)m_threatEntity : (uintptr)m_victimOfPlayerCrime), false);
+
+ if (m_crimeToReportOnPhone != CRIME_POSSESSION_GUN)
+ FindPlayerPed()->m_pWanted->SetWantedLevelNoDrop(1);
+
+ bRunningToPhone = false;
+ }
#endif
if (CTimer::GetTimeInMilliseconds() <= m_phoneTalkTimer)
return false;
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ CAnimBlendAssociation* talkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_PHONE_TALK);
+ if (talkAssoc && talkAssoc->blendAmount > 0.5f) {
+ CAnimBlendAssociation* endAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_PHONE_OUT, 8.0f);
+ endAssoc->flags &= ~ASSOC_DELETEFADEDOUT;
+ endAssoc->SetFinishCallback(ReportPhonePutDownCB, this);
+ }
+#endif
SetIdle();
+
gPhoneInfo.m_aPhones[m_phoneId].m_nState = PHONE_STATE_FREE;
-#ifdef TOGGLEABLE_BETA_FEATURES
- crimeReporters[m_phoneId] = nil;
-#endif
+#ifndef PEDS_REPORT_CRIMES_ON_PHONE
m_phoneId = -1;
+#endif
+
+ // Because SetWanderPath is now done async in ReportPhonePutDownCB
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ return false;
+#else
return true;
+#endif
}
bool
CPed::FacePhone(void)
{
- // FIX: This function was broken since it's left unused early in development.
-#ifdef FIX_BUGS
+ // This function was broken since it's left unused early in development.
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
float phoneDir = CGeneral::GetRadianAngleBetweenPoints(
gPhoneInfo.m_aPhones[m_phoneId].m_vecPos.x, gPhoneInfo.m_aPhones[m_phoneId].m_vecPos.y,
GetPosition().x, GetPosition().y);
- SetLookFlag(phoneDir, false);
- bool turnDone = TurnBody();
- if (turnDone) {
- SetIdle();
+ if (m_facePhoneStart) {
+ m_lookTimer = 0;
+ SetLookFlag(phoneDir, true);
+ m_lookTimer = CTimer::GetTimeInMilliseconds() + 3000;
+ m_facePhoneStart = false;
+ }
+
+ if (bIsLooking && TurnBody()) {
ClearLookFlag();
+ SetIdle();
m_phoneTalkTimer = CTimer::GetTimeInMilliseconds() + 10000;
+ CAnimBlendAssociation* assoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_PHONE_IN, 4.0f);
+ assoc->SetFinishCallback(ReportPhonePickUpCB, this);
+ return true;
}
- return turnDone;
+
+ return false;
#else
float currentRot = RADTODEG(m_fRotationCur);
float phoneDir = CGeneral::GetRadianAngleBetweenPoints(
@@ -3165,6 +3222,63 @@ CPed::CheckForDeadPeds(void)
return nil;
}
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+// returns event id, parameter is optional
+int32
+CPed::CheckForPlayerCrimes(CPed *victim)
+{
+ int i;
+ float dist;
+ float mindist = 60.0f;
+ CPlayerPed *player = FindPlayerPed();
+ int32 victimRef = (victim ? CPools::GetPedRef(victim) : 0);
+ int event = -1;
+
+ for (i = 0; i < NUMEVENTS; i++) {
+ if (gaEvent[i].type == EVENT_NULL || gaEvent[i].type > EVENT_CAR_SET_ON_FIRE)
+ continue;
+
+ // those are already handled in game, also DEAD_PED isn't registered alone, most of the time there is SHOOT_PED etc.
+ if (gaEvent[i].type == EVENT_DEAD_PED || gaEvent[i].type == EVENT_GUNSHOT || gaEvent[i].type == EVENT_EXPLOSION)
+ continue;
+
+ if (victim && gaEvent[i].entityRef != victimRef)
+ continue;
+
+ if (gaEvent[i].criminal != player)
+ continue;
+
+ dist = (GetPosition() - gaEvent[i].posn).Magnitude();
+ if (dist < mindist) {
+ mindist = dist;
+ event = i;
+ }
+ }
+
+ if (event != -1) {
+ if (victim) {
+ m_victimOfPlayerCrime = victim;
+ } else {
+ switch (gaEvent[event].entityType) {
+ case EVENT_ENTITY_PED:
+ m_victimOfPlayerCrime = CPools::GetPed(gaEvent[event].entityRef);
+ break;
+ case EVENT_ENTITY_VEHICLE:
+ m_victimOfPlayerCrime = CPools::GetVehicle(gaEvent[event].entityRef);
+ break;
+ case EVENT_ENTITY_OBJECT:
+ m_victimOfPlayerCrime = CPools::GetObject(gaEvent[event].entityRef);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ return event;
+}
+#endif
+
bool
CPed::CheckForExplosions(CVector2D &area)
{
@@ -3250,9 +3364,7 @@ CPed::CheckForPointBlankPeds(CPed *pedToVerify)
if (neededTurn > PI)
neededTurn = 2*PI - neededTurn;
- PedState nearPedState = nearPed->m_nPedState;
-
- if (nearPedState == PED_FALL || nearPedState == PED_GETUP || nearPedState == PED_DIE || nearPedState == PED_DEAD || nearPedState == PED_DIVE_AWAY)
+ if (nearPed->OnGroundOrGettingUp() || nearPed->m_nPedState == PED_DIVE_AWAY)
return NO_POINT_BLANK_PED;
if (neededTurn < CAN_SEE_ENTITY_ANGLE_THRESHOLD) {
@@ -3538,56 +3650,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
case WEAPONTYPE_BASEBALLBAT:
if (bMeleeProof)
return false;
-#ifdef VC_PED_PORTS
- if (/*method != WEAPONTYPE_KATANA || */
- damagedBy != FindPlayerPed()
- || FindPlayerPed()->m_nPedState != PED_FIGHT
- /*|| FindPlayerPed()->m_lastFightMove != 28 && FindPlayerPed()->m_lastFightMove != 29 */
- || CGeneral::GetRandomNumber() & 3) {
-
- if (m_nPedState == PED_FALL) {
- if (IsPedHeadAbovePos(-0.3f)) {
- dieAnim = NUM_ANIMS;
- } else {
- if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL))
- dieAnim = ANIM_FLOOR_HIT_F;
- else
- dieAnim = ANIM_FLOOR_HIT;
- dieDelta = dieDelta * 2.0f;
- dieSpeed = 0.5f;
- }
- } else if (damagedBy != FindPlayerPed()) { // || FindPlayerPed()->m_lastFightMove != 29)
- //if (damagedBy != FindPlayerPed() || FindPlayerPed()->m_lastFightMove != 30) {
- switch (direction) {
- case 0:
- dieAnim = ANIM_KO_SKID_FRONT;
- break;
- case 1:
- dieAnim = ANIM_KO_SPIN_R;
- break;
- case 2:
- dieAnim = ANIM_KO_SKID_BACK;
- break;
- case 3:
- dieAnim = ANIM_KO_SPIN_L;
- break;
- default:
- break;
- }
- //} else {
- // dieAnim = ANIM_KO_SHOT_STOM;
- //}
- } else {
- dieAnim = ANIM_KO_SHOT_FACE;
- }
- } else {
- dieAnim = ANIM_KO_SHOT_FACE;
- // SpawnFlyingComponent in VC
- RemoveBodyPart(PED_HEAD, direction);
- headShot = true;
- willLinger = true;
- }
-#else
+
if (m_nPedState == PED_FALL) {
if (IsPedHeadAbovePos(-0.3f)) {
dieAnim = NUM_ANIMS;
@@ -3617,7 +3680,6 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
break;
}
}
-#endif
break;
case WEAPONTYPE_COLT45:
case WEAPONTYPE_UZI:
@@ -4092,12 +4154,12 @@ CPed::ClearObjective(void)
if (m_nPedState == PED_DRIVING && m_pMyVehicle) {
if (m_pMyVehicle->pDriver != this) {
-#ifdef VC_PED_PORTS
+#if defined VC_PED_PORTS || defined FIX_BUGS
if(!IsPlayer())
#endif
bWanderPathAfterExitingCar = true;
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
}
#ifdef VC_PED_PORTS
m_nLastPedState = PED_NONE;
@@ -4245,7 +4307,7 @@ CPed::RestorePreviousState(void)
case PED_WANDER_PATH:
m_nPedState = PED_WANDER_PATH;
bIsRunning = false;
- if (!bFindNewNodeAfterStateRestore) {
+ if (bFindNewNodeAfterStateRestore) {
if (m_pNextPathNode) {
CVector diff = m_pNextPathNode->GetPosition() - GetPosition();
if (diff.MagnitudeSqr() < sq(7.0f)) {
@@ -4542,6 +4604,14 @@ CPed::SetEvasiveDive(CPhysical *reason, uint8 onlyRandomJump)
wanted->RegisterCrime_Immediately(CRIME_SPEEDING, GetPosition(), (uintptr)this, false);
}
}
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ else if (reason->IsVehicle()) {
+ if (veh->pDriver && veh->pDriver->IsPlayer()) {
+ CWanted* wanted = FindPlayerPed()->m_pWanted;
+ wanted->RegisterCrime(CRIME_RECKLESS_DRIVING, GetPosition(), (uintptr)this, false);
+ }
+ }
+#endif
}
void
@@ -4731,11 +4801,11 @@ CPed::StartFightAttack(uint8 buttonPressure)
CPed *pedOnGround = nil;
if (IsPlayer() && CheckForPedsOnGroundToAttack(this, &pedOnGround) > PED_IN_FRONT_OF_ATTACKER) {
- m_lastFightMove = FIGHTMOVE_GROUNDKICK;
+ m_curFightMove = FIGHTMOVE_GROUNDKICK;
} else if (m_pedStats->m_flags & STAT_SHOPPING_BAGS) {
- m_lastFightMove = FIGHTMOVE_ROUNDHOUSE;
+ m_curFightMove = FIGHTMOVE_ROUNDHOUSE;
} else {
- m_lastFightMove = FIGHTMOVE_STDPUNCH;
+ m_curFightMove = FIGHTMOVE_STDPUNCH;
}
if (pedOnGround && IsPlayer()) {
@@ -4749,7 +4819,7 @@ CPed::StartFightAttack(uint8 buttonPressure)
SetLookFlag(pedOnGround, true);
SetLookTimer(1500);
}
- animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_lastFightMove].animId, 4.0f);
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_curFightMove].animId, 4.0f);
animAssoc->SetFinishCallback(FinishFightMoveCB, this);
m_fightState = FIGHTSTATE_NO_MOVE;
m_takeAStepAfterAttack = false;
@@ -4769,7 +4839,7 @@ CPed::LoadFightData(void)
CAnimBlendAssociation *animAssoc;
- int bp, buflen;
+ size_t bp, buflen;
int lp, linelen;
buflen = CFileMgr::LoadFile("DATA\\fistfite.dat", work_buff, sizeof(work_buff), "r");
@@ -4877,9 +4947,9 @@ CPed::FightStrike(CVector &touchedNodePos)
for (int i = 0; i < m_numNearPeds; i++) {
nearPed = m_nearPeds[i];
if (GetWeapon()->m_eWeaponType != WEAPONTYPE_UNARMED)
- maxDistanceToBeBeaten = nearPed->GetBoundRadius() + tFightMoves[m_lastFightMove].strikeRadius + 0.1f;
+ maxDistanceToBeBeaten = nearPed->GetBoundRadius() + tFightMoves[m_curFightMove].strikeRadius + 0.1f;
else
- maxDistanceToBeBeaten = nearPed->GetBoundRadius() + tFightMoves[m_lastFightMove].strikeRadius;
+ maxDistanceToBeBeaten = nearPed->GetBoundRadius() + tFightMoves[m_curFightMove].strikeRadius;
if (nearPed->bUsesCollision || nearPed->m_nPedState == PED_DEAD) {
CVector nearPedCentre;
@@ -4895,9 +4965,7 @@ CPed::FightStrike(CVector &touchedNodePos)
ourCol = ((CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex()))->AnimatePedColModelSkinned(GetClump());
else
#endif
- if (nearPed->m_nPedState == PED_FALL
- || nearPed->m_nPedState == PED_DEAD || nearPed->m_nPedState == PED_DIE
- || !nearPed->IsPedHeadAbovePos(-0.3f)) {
+ if (nearPed->OnGround() || !nearPed->IsPedHeadAbovePos(-0.3f)) {
ourCol = &CTempColModels::ms_colModelPedGroundHit;
} else {
#ifdef ANIMATE_PED_COL_MODEL
@@ -4912,7 +4980,7 @@ CPed::FightStrike(CVector &touchedNodePos)
attackDistance = nearPed->GetPosition() + ourCol->spheres[j].center;
attackDistance -= touchedNodePos;
CColSphere *ourPieces = ourCol->spheres;
- float maxDistanceToBeat = ourPieces[j].radius + tFightMoves[m_lastFightMove].strikeRadius;
+ float maxDistanceToBeat = ourPieces[j].radius + tFightMoves[m_curFightMove].strikeRadius;
// We can beat him too
if (sq(maxDistanceToBeat) > attackDistance.MagnitudeSqr()) {
@@ -4933,7 +5001,7 @@ CPed::FightStrike(CVector &touchedNodePos)
float oldVictimHealth = nearPed->m_fHealth;
CVector bloodPos = 0.5f * attackDistance + touchedNodePos;
- int damageMult = tFightMoves[m_lastFightMove].damage * ((CGeneral::GetRandomNumber() & 1) + 2) + 1;
+ int damageMult = tFightMoves[m_curFightMove].damage * ((CGeneral::GetRandomNumber() & 1) + 2) + 1;
CVector2D diff (GetPosition() - nearPed->GetPosition());
int direction = nearPed->GetLocalDirection(diff);
@@ -4945,7 +5013,7 @@ CPed::FightStrike(CVector &touchedNodePos)
}
// Change direction if we used kick.
- if (m_lastFightMove == FIGHTMOVE_KICK) {
+ if (m_curFightMove == FIGHTMOVE_KICK) {
if (CGeneral::GetRandomNumber() & 1) {
direction++;
if (direction > 3)
@@ -4961,16 +5029,16 @@ CPed::FightStrike(CVector &touchedNodePos)
else
unk2 = damageMult;
- nearPed->StartFightDefend(direction, tFightMoves[m_lastFightMove].hitLevel, unk2);
+ nearPed->StartFightDefend(direction, tFightMoves[m_curFightMove].hitLevel, unk2);
PlayHitSound(nearPed);
m_fightState = FIGHTSTATE_JUST_ATTACKED;
- RpAnimBlendClumpGetAssociation(GetClump(), tFightMoves[m_lastFightMove].animId)->speed = 0.6f;
+ RpAnimBlendClumpGetAssociation(GetClump(), tFightMoves[m_curFightMove].animId)->speed = 0.6f;
if (!nearPed->DyingOrDead()) {
nearPed->InflictDamage(this, WEAPONTYPE_UNARMED, damageMult * 3.0f, closestPedPiece, direction);
}
if (CGame::nastyGame
- && tFightMoves[m_lastFightMove].hitLevel > HITLEVEL_MEDIUM
+ && tFightMoves[m_curFightMove].hitLevel > HITLEVEL_MEDIUM
&& nearPed->m_nPedState == PED_DIE
&& nearPed->GetIsOnScreen()) {
@@ -4980,7 +5048,7 @@ CPed::FightStrike(CVector &touchedNodePos)
CParticle::AddParticle(PARTICLE_BLOOD, bloodPos, attackDistance, nil, 0.0f, 0, 0, 0, 0);
}
}
- if (nearPed->m_nPedState != PED_FALL && nearPed->m_nPedState != PED_DIE && nearPed->m_nPedState != PED_DEAD) {
+ if (!nearPed->OnGround()) {
float curVictimHealth = nearPed->m_fHealth;
if (curVictimHealth > 0.0f
&& (curVictimHealth < 40.0f && oldVictimHealth > 40.0f && !nearPed->IsPlayer()
@@ -5000,7 +5068,7 @@ CPed::FightStrike(CVector &touchedNodePos)
nearPed->bIsStanding = false;
float moveMult;
- if (m_lastFightMove == FIGHTMOVE_GROUNDKICK) {
+ if (m_curFightMove == FIGHTMOVE_GROUNDKICK) {
moveMult = Min(damageMult * 0.6f, 4.0f);
} else {
if (nearPed->m_nPedState != PED_DIE || damageMult >= 20) {
@@ -5312,21 +5380,21 @@ CPed::PlayHitSound(CPed *hitTo)
};
// This is why first dimension is between FightMove 1 and 12.
- if (m_lastFightMove == FIGHTMOVE_NULL || m_lastFightMove >= FIGHTMOVE_HITFRONT)
+ if (m_curFightMove == FIGHTMOVE_NULL || m_curFightMove >= FIGHTMOVE_HITFRONT)
return;
uint16 soundId;
// And this is why second dimension is between 13 and 22.
- if (hitTo->m_lastFightMove <= FIGHTMOVE_GROUNDKICK || hitTo->m_lastFightMove >= FIGHTMOVE_IDLE2NORM) {
+ if (hitTo->m_curFightMove > FIGHTMOVE_GROUNDKICK && hitTo->m_curFightMove < FIGHTMOVE_IDLE2NORM) {
+ soundId = hitSoundsByFightMoves[m_curFightMove - FIGHTMOVE_STDPUNCH][hitTo->m_curFightMove - FIGHTMOVE_HITFRONT];
+ } else {
if (hitTo->m_nPedState == PED_DEAD || hitTo->UseGroundColModel()) {
- soundId = hitSoundsByFightMoves[m_lastFightMove - FIGHTMOVE_STDPUNCH][FIGHTMOVE_HITONFLOOR - FIGHTMOVE_HITFRONT];
+ soundId = hitSoundsByFightMoves[m_curFightMove - FIGHTMOVE_STDPUNCH][FIGHTMOVE_HITONFLOOR - FIGHTMOVE_HITFRONT];
} else {
- soundId = hitSoundsByFightMoves[m_lastFightMove - FIGHTMOVE_STDPUNCH][FIGHTMOVE_HITFRONT - FIGHTMOVE_HITFRONT];
+ soundId = hitSoundsByFightMoves[m_curFightMove - FIGHTMOVE_STDPUNCH][FIGHTMOVE_HITFRONT - FIGHTMOVE_HITFRONT];
}
- } else {
- soundId = hitSoundsByFightMoves[m_lastFightMove - FIGHTMOVE_STDPUNCH][hitTo->m_lastFightMove - FIGHTMOVE_HITFRONT];
}
if (soundId != NO_SND)
@@ -5353,12 +5421,12 @@ CPed::CollideWithPed(CPed *collideWith)
if ((!IsPlayer() || ((CPlayerPed*)this)->m_fMoveSpeed <= 1.8f)
&& (IsPlayer() || heIsMissionChar && weAreMissionChar || m_nMoveState != PEDMOVE_RUN && m_nMoveState != PEDMOVE_SPRINT
#ifdef VC_PED_PORTS
- || m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION && m_pedInObjective == collideWith
- || collideWith->m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION && collideWith->m_pedInObjective == this
+ || m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION && m_pedInObjective == collideWith
+ || collideWith->m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION && collideWith->m_pedInObjective == this
#endif
)) {
- if (m_objective != OBJECTIVE_FOLLOW_PED_IN_FORMATION && m_objective != OBJECTIVE_GOTO_CHAR_ON_FOOT) {
+ if (m_objective != OBJECTIVE_FOLLOW_CHAR_IN_FORMATION && m_objective != OBJECTIVE_GOTO_CHAR_ON_FOOT) {
if (CTimer::GetTimeInMilliseconds() > m_nPedStateTimer) {
@@ -5384,61 +5452,15 @@ CPed::CollideWithPed(CPed *collideWith)
SetDirectionToWalkAroundObject(collideWith);
}
} else {
-#ifdef VC_PED_PORTS
- if (FindPlayerPed() != m_pedInObjective
- || m_objective != OBJECTIVE_KILL_CHAR_ANY_MEANS && m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT
- || collideWith == m_pedInObjective) {
-#endif
- if (weAreMissionChar || m_pedStats->m_fear <= 100 - collideWith->m_pedStats->m_temper
- || (collideWith->IsPlayer() || collideWith->m_nMoveState == PEDMOVE_NONE || collideWith->m_nMoveState == PEDMOVE_STILL) &&
- (!collideWith->IsPlayer() || ((CPlayerPed*)collideWith)->m_fMoveSpeed <= 1.0f)) {
- SetDirectionToWalkAroundObject(collideWith);
- if (!weAreMissionChar)
- Say(SOUND_PED_CHAT);
- } else {
- SetEvasiveStep(collideWith, 2);
- }
-#ifdef VC_PED_PORTS
- } else if (collideWith->m_nMoveState != PEDMOVE_STILL && GetWeapon()->IsTypeMelee()
- && collideWith->m_pedInObjective == m_pedInObjective) {
-
- int colliderIsAtPlayerSafePosID = -1;
- int weAreAtPlayerSafePosID = -1;
- for (int i = 0; i < ARRAY_SIZE(((CPlayerPed*)m_pedInObjective)->m_pPedAtSafePos); i++) {
- CPed *pedAtSafePos = ((CPlayerPed*)m_pedInObjective)->m_pPedAtSafePos[i];
- if (pedAtSafePos == this) {
- weAreAtPlayerSafePosID = i;
- } else if (pedAtSafePos == collideWith) {
- colliderIsAtPlayerSafePosID = i;
- }
- }
- bool weAreCloserToTargetThenCollider = false;
- if ((GetPosition() - m_vecSeekPos).MagnitudeSqr2D() < (collideWith->GetPosition() - m_vecSeekPos).MagnitudeSqr2D())
- weAreCloserToTargetThenCollider = true;
-
- if (weAreAtPlayerSafePosID <= 0 || weAreCloserToTargetThenCollider) {
- if (!weAreCloserToTargetThenCollider) {
- int time = 300;
- SetWaitState(WAITSTATE_CROSS_ROAD_LOOK, &time);
- m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + time;
- }
- } else if (colliderIsAtPlayerSafePosID <= 0) {
- if (collideWith->m_pedInObjective == FindPlayerPed()) {
- // VC specific
- // ((CPlayerPed*)m_pedInObjective)->RemovePedFromMeleeList(this);
- int time = 500;
- SetWaitState(WAITSTATE_CROSS_ROAD_LOOK, &time);
- m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + time;
- }
- } else {
- int time = 300;
- SetWaitState(WAITSTATE_CROSS_ROAD_LOOK, &time);
- m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + time;
- }
- } else {
+ if (weAreMissionChar || m_pedStats->m_fear <= 100 - collideWith->m_pedStats->m_temper
+ || (collideWith->IsPlayer() || collideWith->m_nMoveState == PEDMOVE_NONE || collideWith->m_nMoveState == PEDMOVE_STILL) &&
+ (!collideWith->IsPlayer() || ((CPlayerPed*)collideWith)->m_fMoveSpeed <= 1.0f)) {
SetDirectionToWalkAroundObject(collideWith);
+ if (!weAreMissionChar)
+ Say(SOUND_PED_CHAT);
+ } else {
+ SetEvasiveStep(collideWith, 2);
}
-#endif
}
} else {
if (m_pedStats->m_temper <= m_pedStats->m_fear
@@ -5452,12 +5474,20 @@ CPed::CollideWithPed(CPed *collideWith)
} else {
TurnBody();
SetAttack(collideWith);
+#ifdef VC_PED_PORTS
+ m_fRotationCur = 0.3f + m_fRotationCur;
+ m_fRotationDest = m_fRotationCur;
+#endif
}
m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(250, 450);
}
}
} else {
+#ifdef VC_PED_PORTS
+ if (m_pedInObjective && (collideWith == m_pedInObjective || collideWith->m_pedInObjective == m_pedInObjective) && CTimer::GetTimeInMilliseconds() > m_nPedStateTimer) {
+#else
if (m_pedInObjective && collideWith == m_pedInObjective && CTimer::GetTimeInMilliseconds() > m_nPedStateTimer) {
+#endif
if (heLooksToUs) {
SetEvasiveStep(collideWith, 1);
m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 3000;
@@ -5466,7 +5496,11 @@ CPed::CollideWithPed(CPed *collideWith)
if (m_pedStats != collideWith->m_pedStats) {
- if (collideWith->m_pedStats->m_fear <= 100 - m_pedStats->m_temper) {
+ if (collideWith->m_pedStats->m_fear <= 100 - m_pedStats->m_temper
+#ifdef VC_PED_PORTS
+ || collideWith->IsPlayer() || CTimer::GetTimeInMilliseconds() < m_nPedStateTimer
+#endif
+ ) {
if (collideWith->IsPlayer()) {
// He's on our right side
@@ -5476,16 +5510,19 @@ CPed::CollideWithPed(CPed *collideWith)
m_fRotationCur += m_headingRate;
} else {
// He's on our right side
- if (DotProduct(posDiff, GetRight()) <= 0.0f)
- m_fRotationCur -= m_headingRate;
+ if (DotProduct(posDiff, collideWith->GetRight()) <= 0.0f)
+ collideWith->m_fRotationCur -= collideWith->m_headingRate;
else
- m_fRotationCur += m_headingRate;
+ collideWith->m_fRotationCur += collideWith->m_headingRate;
}
} else {
SetLookFlag(collideWith, false);
TurnBody();
animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FIGHT_PPUNCH, 8.0f);
animAssoc->flags |= ASSOC_FADEOUTWHENDONE;
+#ifdef VC_PED_PORTS
+ m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 2000;
+#endif
if (!heIsMissionChar) {
CVector2D posDiff2D(posDiff);
int direction = collideWith->GetLocalDirection(posDiff2D);
@@ -5757,7 +5794,7 @@ CPed::SetChat(CEntity *chatWith, uint32 time)
m_nPedState = PED_CHAT;
SetMoveState(PEDMOVE_STILL);
-#ifdef VC_PED_PORTS
+#if defined VC_PED_PORTS || defined FIX_BUGS
m_lookTimer = 0;
#endif
SetLookFlag(chatWith, true);
@@ -6033,7 +6070,7 @@ CPed::EndFight(uint8 endType)
if (m_nPedState != PED_FIGHT)
return;
- m_lastFightMove = FIGHTMOVE_NULL;
+ m_curFightMove = FIGHTMOVE_NULL;
RestorePreviousState();
CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE);
if (animAssoc)
@@ -6262,24 +6299,27 @@ CPed::Fall(void)
void
CPed::Fight(void)
{
- CAnimBlendAssociation *currentAssoc = nil, *animAssoc;
+ CAnimBlendAssociation *currentAssoc, *animAssoc;
bool hasShoppingBags, punchOnly, canKick, canKneeHead, canRoundhouse;
float angleToFace, nextAngle;
bool goForward = false;
int nextFightMove;
- switch (m_lastFightMove) {
+ switch (m_curFightMove) {
case FIGHTMOVE_NULL:
return;
case FIGHTMOVE_IDLE2NORM:
- m_lastFightMove = FIGHTMOVE_NULL;
+ m_curFightMove = FIGHTMOVE_NULL;
RestorePreviousState();
+
+ // FIX: Uninitialized
+ currentAssoc = nil;
break;
case FIGHTMOVE_IDLE:
- // currentAssoc = nil;
+ currentAssoc = nil;
break;
default:
- currentAssoc = RpAnimBlendClumpGetAssociation(GetClump(), tFightMoves[m_lastFightMove].animId);
+ currentAssoc = RpAnimBlendClumpGetAssociation(GetClump(), tFightMoves[m_curFightMove].animId);
break;
}
@@ -6296,12 +6336,12 @@ CPed::Fight(void)
} else if (currentAssoc && m_fightState > FIGHTSTATE_MOVE_FINISHED) {
float animTime = currentAssoc->currentTime;
- FightMove &curMove = tFightMoves[m_lastFightMove];
+ FightMove &curMove = tFightMoves[m_curFightMove];
if (curMove.hitLevel != HITLEVEL_NULL && animTime > curMove.startFireTime && animTime <= curMove.endFireTime && m_fightState >= FIGHTSTATE_NO_MOVE) {
CVector touchingNodePos(0.0f, 0.0f, 0.0f);
- switch (m_lastFightMove) {
+ switch (m_curFightMove) {
case FIGHTMOVE_STDPUNCH:
case FIGHTMOVE_PUNCHHOOK:
case FIGHTMOVE_BODYBLOW:
@@ -6327,9 +6367,9 @@ CPed::Fight(void)
break;
}
- if (m_lastFightMove == FIGHTMOVE_PUNCHJAB) {
+ if (m_curFightMove == FIGHTMOVE_PUNCHJAB) {
touchingNodePos += 0.1f * GetForward();
- } else if (m_lastFightMove == FIGHTMOVE_PUNCHHOOK) {
+ } else if (m_curFightMove == FIGHTMOVE_PUNCHHOOK) {
touchingNodePos += 0.22f * GetForward();
}
FightStrike(touchingNodePos);
@@ -6349,7 +6389,7 @@ CPed::Fight(void)
if (curMove.comboFollowOnTime > 0.0f && m_fightButtonPressure != 0 && animTime > curMove.comboFollowOnTime) {
// Notice that it increases fight move index, because we're in combo!
- animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[++m_lastFightMove].animId, 8.0f);
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[++m_curFightMove].animId, 8.0f);
animAssoc->SetFinishCallback(FinishFightMoveCB, this);
animAssoc->SetCurrentTime(0.1f * animAssoc->hierarchy->totalLength);
m_fightButtonPressure = 0;
@@ -6357,7 +6397,7 @@ CPed::Fight(void)
}
}
} else {
- if (curMove.startFireTime > 0.0f && m_lastFightMove != FIGHTMOVE_SHUFFLE_F && animTime > curMove.startFireTime) {
+ if (curMove.startFireTime > 0.0f && m_curFightMove != FIGHTMOVE_SHUFFLE_F && animTime > curMove.startFireTime) {
if (IsPlayer())
currentAssoc->speed = 1.3f;
else
@@ -6413,8 +6453,7 @@ CPed::Fight(void)
if (neededTurn > PI)
neededTurn = TWOPI - neededTurn;
- PedState nearPedState = nearPed->m_nPedState;
- if (nearPedState != PED_FALL && nearPedState != PED_GETUP && nearPedState != PED_DIE && nearPedState != PED_DEAD) {
+ if (!nearPed->OnGroundOrGettingUp()) {
if (nearPedDist < 0.8f && neededTurn < DEGTORAD(75.0f) && canKneeHead) {
canAffectMultiplePeople = false;
@@ -6455,7 +6494,7 @@ CPed::Fight(void)
goForward = true;
}
- } else if (nearPedState != PED_DEAD || pedOnGround) {
+ } else if (nearPed->m_nPedState != PED_DEAD || pedOnGround) {
if (!nearPed->IsPedHeadAbovePos(-0.3f)) {
canAffectMultiplePeople = false;
nextFightMove = FIGHTMOVE_GROUNDKICK;
@@ -6509,8 +6548,7 @@ CPed::Fight(void)
nextAngle = CGeneral::LimitRadianAngle(angleToFace);
m_fRotationDest = nextAngle;
m_fRotationCur = m_fRotationDest;
- PedState fightingPedState = m_pedInObjective->m_nPedState;
- if (fightingPedState != PED_FALL && fightingPedState != PED_GETUP && fightingPedState != PED_DIE && fightingPedState != PED_DEAD) {
+ if (!m_pedInObjective->OnGroundOrGettingUp()) {
if (fightingPedDist >= 0.8f || !canKneeHead) {
@@ -6559,8 +6597,8 @@ CPed::Fight(void)
}
if (nextFightMove != FIGHTMOVE_IDLE) {
- m_lastFightMove = nextFightMove;
- animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_lastFightMove].animId, 4.0f);
+ m_curFightMove = nextFightMove;
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_curFightMove].animId, 4.0f);
animAssoc->SetFinishCallback(FinishFightMoveCB, this);
if (m_fightState == FIGHTSTATE_MOVE_FINISHED && animAssoc->currentTime != 0.0f) {
@@ -6570,21 +6608,21 @@ CPed::Fight(void)
m_fightButtonPressure = 0;
}
m_fightState = FIGHTSTATE_NO_MOVE;
- } else if (m_takeAStepAfterAttack && m_lastFightMove != FIGHTMOVE_SHUFFLE_F
+ } else if (m_takeAStepAfterAttack && m_curFightMove != FIGHTMOVE_SHUFFLE_F
#ifndef FIX_BUGS
&& CheckForPedsOnGroundToAttack(this, nil) == 4) {
#else
&& CheckForPedsOnGroundToAttack(this, nil) == PED_IN_FRONT_OF_ATTACKER) {
#endif
- m_lastFightMove = FIGHTMOVE_SHUFFLE_F;
- animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), tFightMoves[m_lastFightMove].animId);
+ m_curFightMove = FIGHTMOVE_SHUFFLE_F;
+ animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), tFightMoves[m_curFightMove].animId);
if (animAssoc) {
animAssoc->SetCurrentTime(0.0f);
animAssoc->blendDelta = 4.0f;
animAssoc->SetRun();
} else {
- animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_lastFightMove].animId, 32.0f);
+ animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_curFightMove].animId, 32.0f);
}
animAssoc->SetFinishCallback(FinishFightMoveCB, this);
m_fightState = FIGHTSTATE_NO_MOVE;
@@ -6594,13 +6632,13 @@ CPed::Fight(void)
} else if (m_takeAStepAfterAttack) {
EndFight(ENDFIGHT_FAST);
- } else if (m_lastFightMove == FIGHTMOVE_IDLE) {
+ } else if (m_curFightMove == FIGHTMOVE_IDLE) {
if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) {
EndFight(ENDFIGHT_NORMAL);
}
} else {
- m_lastFightMove = FIGHTMOVE_IDLE;
+ m_curFightMove = FIGHTMOVE_IDLE;
if (IsPlayer())
m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 500;
else
@@ -6690,7 +6728,7 @@ CPed::FinishFightMoveCB(CAnimBlendAssociation *animAssoc, void *arg)
{
CPed *ped = (CPed*)arg;
- if (tFightMoves[ped->m_lastFightMove].animId == animAssoc->animId) {
+ if (tFightMoves[ped->m_curFightMove].animId == animAssoc->animId) {
ped->m_fightState = FIGHTSTATE_MOVE_FINISHED;
animAssoc->blendDelta = -1000.0f;
}
@@ -7160,7 +7198,7 @@ CPed::Seek(void)
if (m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER) {
if (m_nPedState != PED_EXIT_TRAIN && m_nPedState != PED_ENTER_TRAIN && m_nPedState != PED_SEEK_IN_BOAT &&
- m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER && m_objective != OBJECTIVE_SOLICIT && !bDuckAndCover) {
+ m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER && m_objective != OBJECTIVE_SOLICIT_VEHICLE && !bDuckAndCover) {
if ((!m_pedInObjective || !m_pedInObjective->bInVehicle)
&& !((CTimer::GetFrameCounter() + (m_randomSeed % 256) + 17) & 7)) {
@@ -7188,14 +7226,14 @@ CPed::Seek(void)
float seekPosDist = (m_vecSeekPos - GetPosition()).Magnitude2D();
if (seekPosDist < 2.0f || m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT) {
- if (m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION) {
+ if (m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) {
if (m_pedInObjective->m_nMoveState != PEDMOVE_STILL)
nextMove = m_pedInObjective->m_nMoveState;
} else
nextMove = PEDMOVE_WALK;
- } else if (m_objective != OBJECTIVE_FOLLOW_PED_IN_FORMATION) {
+ } else if (m_objective != OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) {
if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS || m_objective == OBJECTIVE_RUN_TO_AREA || bIsRunning)
nextMove = PEDMOVE_RUN;
@@ -7285,7 +7323,7 @@ CPed::Seek(void)
return false;
}
- if ((m_objective != OBJECTIVE_FOLLOW_PED_IN_FORMATION || m_pedInObjective->m_nMoveState == PEDMOVE_STILL) && m_nMoveState != PEDMOVE_STILL) {
+ if ((m_objective != OBJECTIVE_FOLLOW_CHAR_IN_FORMATION || m_pedInObjective->m_nMoveState == PEDMOVE_STILL) && m_nMoveState != PEDMOVE_STILL) {
m_nPedStateTimer = 0;
m_actionX = 0;
m_actionY = 0;
@@ -7436,9 +7474,9 @@ CPed::Flee(void)
if (!m_collidingEntityWhileFleeing)
return;
- double damagingThingPriorityMult = (double)(m_collidingThingTimer - CTimer::GetTimeInMilliseconds()) * 2.0 / 2500;
+ double collidingThingPriorityMult = (double)(m_collidingThingTimer - CTimer::GetTimeInMilliseconds()) * 2.0 / 2500;
- if (damagingThingPriorityMult <= 1.5) {
+ if (collidingThingPriorityMult <= 1.5) {
double angleToFleeEntity = CGeneral::GetRadianAngleBetweenPoints(
GetPosition().x,
@@ -7447,35 +7485,34 @@ CPed::Flee(void)
m_collidingEntityWhileFleeing->GetPosition().y);
angleToFleeEntity = CGeneral::LimitRadianAngle(angleToFleeEntity);
- // It includes projectiles, but is everything collides with us included?
- double angleToFleeDamagingThing = CGeneral::GetRadianAngleBetweenPoints(
+ double angleToFleeCollidingThing = CGeneral::GetRadianAngleBetweenPoints(
m_vecDamageNormal.x,
m_vecDamageNormal.y,
0.0f,
0.0f);
- angleToFleeDamagingThing = CGeneral::LimitRadianAngle(angleToFleeDamagingThing);
+ angleToFleeCollidingThing = CGeneral::LimitRadianAngle(angleToFleeCollidingThing);
- if (angleToFleeEntity - PI > angleToFleeDamagingThing)
- angleToFleeDamagingThing += TWOPI;
- else if (PI + angleToFleeEntity < angleToFleeDamagingThing)
- angleToFleeDamagingThing -= TWOPI;
+ if (angleToFleeEntity - PI > angleToFleeCollidingThing)
+ angleToFleeCollidingThing += TWOPI;
+ else if (PI + angleToFleeEntity < angleToFleeCollidingThing)
+ angleToFleeCollidingThing -= TWOPI;
- if (damagingThingPriorityMult <= 1.0f) {
+ if (collidingThingPriorityMult <= 1.0f) {
// Range [0.0, 1.0]
- float angleToFleeBoth = (angleToFleeDamagingThing + angleToFleeEntity) * 0.5f;
+ float angleToFleeBoth = (angleToFleeCollidingThing + angleToFleeEntity) * 0.5f;
if (m_fRotationDest - PI > angleToFleeBoth)
angleToFleeBoth += TWOPI;
else if (PI + m_fRotationDest < angleToFleeBoth)
angleToFleeBoth -= TWOPI;
- m_fRotationDest = (1.0f - damagingThingPriorityMult) * m_fRotationDest + damagingThingPriorityMult * angleToFleeBoth;
+ m_fRotationDest = (1.0f - collidingThingPriorityMult) * m_fRotationDest + collidingThingPriorityMult * angleToFleeBoth;
} else {
// Range (1.0, 1.5]
- double adjustedMult = (damagingThingPriorityMult - 1.0f) * 2.0f;
- m_fRotationDest = angleToFleeEntity * (1.0 - adjustedMult) + adjustedMult * angleToFleeDamagingThing;
+ double adjustedMult = (collidingThingPriorityMult - 1.0f) * 2.0f;
+ m_fRotationDest = angleToFleeEntity * (1.0 - adjustedMult) + adjustedMult * angleToFleeCollidingThing;
}
} else {
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(
@@ -8423,10 +8460,6 @@ CPed::KillPedWithCar(CVehicle *car, float impulse)
if (car->pDriver) {
CEventList::RegisterEvent((m_nPedType == PEDTYPE_COP ? EVENT_HIT_AND_RUN_COP : EVENT_HIT_AND_RUN), EVENT_ENTITY_PED, this, car->pDriver, 1000);
-#ifdef TOGGLEABLE_BETA_FEATURES
- if (bMakePedsRunToPhonesToReportCrimes)
- m_ped_flagI40 = true;
-#endif
}
ePedPieceTypes pieceToDamage;
@@ -8477,8 +8510,7 @@ CPed::KillPedWithCar(CVehicle *car, float impulse)
CPed::InflictDamage(car, WEAPONTYPE_RAMMEDBYCAR, damage, PEDPIECE_TORSO, fallDirection);
CPed::SetFall(1000, (AnimationId)(fallDirection + ANIM_KO_SKID_FRONT), true);
- if ((m_nPedState == PED_FALL || m_nPedState == PED_DIE || m_nPedState == PED_DEAD)
- && !m_pCollidingEntity &&
+ if (OnGround() && !m_pCollidingEntity &&
(!IsPlayer() || bHasHitWall || car->GetModelIndex() == MI_TRAIN || m_vecDamageNormal.z < -0.8f)) {
m_pCollidingEntity = car;
@@ -8966,7 +8998,11 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
return;
if (!ped->EnteringCar()) {
- ped->QuitEnteringCar();
+#ifdef VC_PED_PORTS
+ if (ped->m_nPedState != PED_DRIVING)
+#endif
+ ped->QuitEnteringCar();
+
return;
}
if (ped->m_fHealth == 0.0f) {
@@ -9086,7 +9122,7 @@ CPed::ProcessControl(void)
CColPoint foundCol;
CEntity *foundEnt = nil;
- if (m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory)
+ if (m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
return;
int alpha = CVisibilityPlugins::GetClumpAlpha(GetClump());
@@ -9313,7 +9349,7 @@ CPed::ProcessControl(void)
m_collidingEntityWhileFleeing = collidingEnt;
m_collidingEntityWhileFleeing->RegisterReference((CEntity **) &m_collidingEntityWhileFleeing);
- uint8 currentDir = floorf((PI + m_fRotationCur) / DEGTORAD(45.0f));
+ uint8 currentDir = Floor((PI + m_fRotationCur) / DEGTORAD(45.0f));
uint8 nextDir;
ThePaths.FindNextNodeWandering(PATH_PED, GetPosition(), &m_pLastPathNode, &m_pNextPathNode, currentDir, &nextDir);
@@ -9787,7 +9823,7 @@ CPed::ProcessControl(void)
|| (!bIsStanding && !bWasStanding && m_nPedState == PED_FALL)
#endif
) {
- if (m_nPedStateTimer <= 1000 && m_nPedStateTimer) {
+ if (m_nPedStateTimer > 0 && m_nPedStateTimer <= 1000) {
forceDir = GetPosition() - m_vecHitLastPos;
} else {
m_nPedStateTimer = 0;
@@ -9982,7 +10018,7 @@ CPed::ProcessControl(void)
bStartWanderPathOnFoot = false;
} else if (m_nPedState == PED_DRIVING) {
bWanderPathAfterExitingCar = true;
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
}
}
@@ -10132,19 +10168,34 @@ CPed::ProcessControl(void)
int vehAnim = m_pVehicleAnim->animId;
+ static bool cancelJack = false;
int16 padWalkX = pad->GetPedWalkLeftRight();
int16 padWalkY = pad->GetPedWalkUpDown();
if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) {
if (vehAnim == ANIM_CAR_OPEN_LHS || vehAnim == ANIM_CAR_OPEN_RHS || vehAnim == ANIM_COACH_OPEN_L || vehAnim == ANIM_COACH_OPEN_R ||
vehAnim == ANIM_VAN_OPEN_L || vehAnim == ANIM_VAN_OPEN) {
+
+ if (!m_pMyVehicle->pDriver) {
+ cancelJack = false;
+ bCancelEnteringCar = true;
+ } else
+ cancelJack = true;
+ } else if (vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f) {
+ cancelJack = true;
+ } else if (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS) {
bCancelEnteringCar = true;
- } else if (vehAnim == ANIM_CAR_QJACK) {
- if (m_pVehicleAnim->GetTimeLeft() > 0.69f && m_pVehicleAnim->GetTimeLeft() < 0.72f) {
- QuitEnteringCar();
- RestorePreviousObjective();
- }
+ cancelJack = false;
}
}
+ if (cancelJack && vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f && m_pVehicleAnim->GetTimeLeft() < 0.78f) {
+ cancelJack = false;
+ QuitEnteringCar();
+ RestorePreviousObjective();
+ }
+ if (cancelJack && (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS)) {
+ cancelJack = false;
+ bCancelEnteringCar = true;
+ }
#endif
break;
}
@@ -10480,14 +10531,14 @@ CPed::PedAnimDoorCloseCB(CAnimBlendAssociation *animAssoc, void *arg)
} else if (ped->m_vehEnterType == CAR_DOOR_RF
&& (veh->m_nGettingInFlags & CAR_DOOR_FLAG_LF ||
(veh->pDriver != nil &&
- (veh->pDriver->m_objective != OBJECTIVE_LEAVE_VEHICLE
+ (veh->pDriver->m_objective != OBJECTIVE_LEAVE_CAR
#ifdef VC_PED_PORTS
&& veh->pDriver->m_objective != OBJECTIVE_LEAVE_CAR_AND_DIE
#endif
|| !veh->IsRoomForPedToLeaveCar(CAR_DOOR_LF, nil))))) {
if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER
-#ifdef VC_PED_PORTS
+#if defined VC_PED_PORTS || defined FIX_BUGS
|| ped->m_nPedState == PED_CARJACK
#endif
)
@@ -10496,7 +10547,7 @@ CPed::PedAnimDoorCloseCB(CAnimBlendAssociation *animAssoc, void *arg)
ped->m_objective = OBJECTIVE_ENTER_CAR_AS_PASSENGER;
PedSetInCarCB(nil, ped);
- ped->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh);
+ ped->SetObjective(OBJECTIVE_LEAVE_CAR, veh);
if (!ped->IsPlayer())
ped->bFleeAfterExitingCar = true;
@@ -10558,7 +10609,11 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg)
return;
if (!ped->EnteringCar()) {
- ped->QuitEnteringCar();
+#ifdef VC_PED_PORTS
+ if (ped->m_nPedState != PED_DRIVING)
+#endif
+ ped->QuitEnteringCar();
+
return;
}
@@ -10730,7 +10785,7 @@ void
CPed::SetJump(void)
{
if (!bInVehicle &&
-#ifdef VC_PED_PORTS
+#if defined VC_PED_PORTS || defined FIX_BUGS
m_nPedState != PED_JUMP && !RpAnimBlendClumpGetAssociation(GetClump(), ANIM_JUMP_LAUNCH) &&
#endif
(m_nSurfaceTouched != SURFACE_STEEP_CLIFF || DotProduct(GetForward(), m_vecDamageNormal) >= 0.0f)) {
@@ -10860,7 +10915,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg)
CPed *driver = veh->pDriver;
if (driver && (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || ped->m_nPedState == PED_CARJACK)) {
if (veh->bIsBus) {
- driver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh);
+ driver->SetObjective(OBJECTIVE_LEAVE_CAR, veh);
if (driver->IsPlayer()) {
veh->bIsHandbrakeOn = true;
veh->SetStatus(STATUS_PLAYER_DISABLED);
@@ -10871,7 +10926,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg)
if (ped->m_nPedType == PEDTYPE_COP
|| ped->m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT
|| ped->m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS) {
- ped->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh);
+ ped->SetObjective(OBJECTIVE_LEAVE_CAR, veh);
}
ped->m_leaveCarTimer = CTimer::GetTimeInMilliseconds() + 400;
return;
@@ -10895,7 +10950,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg)
}
if ((ped->m_nPedType != PEDTYPE_EMERGENCY || veh->pDriver->m_nPedType != PEDTYPE_EMERGENCY)
&& (ped->m_nPedType != PEDTYPE_COP || veh->pDriver->m_nPedType != PEDTYPE_COP)) {
- veh->pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh);
+ veh->pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, veh);
veh->pDriver->Say(SOUND_PED_CAR_JACKED);
#ifdef VC_PED_PORTS
veh->pDriver->SetRadioStation();
@@ -10948,6 +11003,15 @@ CPed::PedAnimPullPedOutCB(CAnimBlendAssociation* animAssoc, void* arg)
if (!ped->IsNotInWreckedVehicle())
return;
+#ifdef CANCELLABLE_CAR_ENTER
+ if (ped->bCancelEnteringCar) {
+ ped->QuitEnteringCar();
+ ped->RestorePreviousObjective();
+ ped->bCancelEnteringCar = false;
+ return;
+ }
+#endif
+
bool isLow = !!veh->bLowVehicle;
int padNo;
@@ -11320,7 +11384,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
#ifdef VC_PED_PORTS
// Situation of entering car as a driver while there is already a driver exiting atm.
CPed *driver = veh->pDriver;
- if (driver && driver->m_nPedState == PED_DRIVING && !veh->bIsBus && driver->m_objective == OBJECTIVE_LEAVE_VEHICLE
+ if (driver && driver->m_nPedState == PED_DRIVING && !veh->bIsBus && driver->m_objective == OBJECTIVE_LEAVE_CAR
&& (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || ped->m_nPedState == PED_CARJACK)) {
if (!ped->IsPlayer() && (ped->CharCreatedBy != MISSION_CHAR || driver->IsPlayer())) {
@@ -11360,7 +11424,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
}
}
if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER
-#ifdef VC_PED_PORTS
+#if defined VC_PED_PORTS || defined FIX_BUGS
|| ped->m_nPedState == PED_CARJACK
#endif
)
@@ -11374,7 +11438,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
if (veh->IsBoat()) {
if (ped->IsPlayer()) {
-#if defined(FIX_BUGS) || defined(VC_PED_PORTS)
+#if defined VC_PED_PORTS || defined FIX_BUGS
CCarCtrl::RegisterVehicleOfInterest(veh);
#endif
if (veh->GetStatus() == STATUS_SIMPLE) {
@@ -11421,7 +11485,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
for (int i = 0; i < veh->m_nNumMaxPassengers; ++i) {
CPed *passenger = veh->pPassengers[i];
if (passenger && passenger->CharCreatedBy == RANDOM_CHAR) {
- passenger->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh);
+ passenger->SetObjective(OBJECTIVE_LEAVE_CAR, veh);
#ifdef VC_PED_PORTS
passenger->m_leaveCarTimer = CTimer::GetTimeInMilliseconds();
#endif
@@ -11429,13 +11493,13 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
}
}
// This shouldn't happen at all. Passengers can't enter with PED_CARJACK. Even though they did, we shouldn't call AddPassenger in here and SetDriver in below.
-#ifndef VC_PED_PORTS
+#if !defined VC_PED_PORTS && !defined FIX_BUGS
else if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER) {
if (ped->m_nPedState == PED_CARJACK) {
veh->AddPassenger(ped, 0);
ped->m_nPedState = PED_DRIVING;
ped->RestorePreviousObjective();
- ped->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh);
+ ped->SetObjective(OBJECTIVE_LEAVE_CAR, veh);
} else if (veh->pDriver && ped->CharCreatedBy == RANDOM_CHAR) {
veh->AutoPilot.m_nCruiseSpeed = 17;
}
@@ -11520,7 +11584,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
switch (ped->m_objective) {
case OBJECTIVE_KILL_CHAR_ON_FOOT:
case OBJECTIVE_KILL_CHAR_ANY_MEANS:
- case OBJECTIVE_LEAVE_VEHICLE:
+ case OBJECTIVE_LEAVE_CAR:
case OBJECTIVE_FOLLOW_CAR_IN_CAR:
case OBJECTIVE_GOTO_AREA_ANY_MEANS:
case OBJECTIVE_GOTO_AREA_ON_FOOT:
@@ -11589,16 +11653,21 @@ CPed::PedStaggerCB(CAnimBlendAssociation* animAssoc, void* arg)
*/
}
-// It's "CPhoneInfo::ProcessNearestFreePhone" in PC IDB, but it's not true, someone made it up.
+// It's "CPhoneInfo::ProcessNearestFreePhone" in PC IDB but that's not true, someone made it up.
bool
CPed::RunToReportCrime(eCrimeType crimeToReport)
{
-#ifdef TOGGLEABLE_BETA_FEATURES
- if (!bMakePedsRunToPhonesToReportCrimes)
- return false;
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ if (bRunningToPhone) {
+ if (!isPhoneAvailable(m_phoneId)) {
+ m_phoneId = -1;
+ bIsRunning = false;
+ ClearSeek(); // clears bRunningToPhone
+ return false;
+ }
- if (bRunningToPhone)
return true;
+ }
#else
// They changed true into false to make this function unusable. So running to phone actually starts but first frame after that cancels it.
if (m_nPedState == PED_SEEK_POS)
@@ -11612,11 +11681,13 @@ CPed::RunToReportCrime(eCrimeType crimeToReport)
return false;
CPhone *phone = &gPhoneInfo.m_aPhones[phoneId];
+#ifndef PEDS_REPORT_CRIMES_ON_PHONE
if (phone->m_nState != PHONE_STATE_FREE)
return false;
+#endif
bRunningToPhone = true;
- SetSeek(phone->m_pEntity->GetPosition() - phone->m_pEntity->GetForward(), 1.3f); // original: phone.m_vecPos, 0.3f
+ SetSeek(phone->m_pEntity->GetMatrix() * -phone->m_pEntity->GetForward(), 1.0f); // original: phone.m_vecPos, 0.3f
SetMoveState(PEDMOVE_RUN);
bIsRunning = true; // not there in original
m_phoneId = phoneId;
@@ -11782,7 +11853,7 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg)
if (veh && veh->IsBoat())
ped->ApplyMoveSpeed();
- if (ped->m_objective == OBJECTIVE_LEAVE_VEHICLE)
+ if (ped->m_objective == OBJECTIVE_LEAVE_CAR)
ped->RestorePreviousObjective();
#ifdef VC_PED_PORTS
else if (ped->m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) {
@@ -11938,7 +12009,7 @@ CPed::ReplaceWeaponWhenExitingVehicle(void)
// If it's Uzi, we may have stored weapon. Uzi is the only gun we can use in car.
if (IsPlayer() && weaponType == WEAPONTYPE_UZI) {
- if (m_storedWeapon != WEAPONTYPE_UNIDENTIFIED) {
+ if (/*IsPlayer() && */ m_storedWeapon != WEAPONTYPE_UNIDENTIFIED) {
SetCurrentWeapon(m_storedWeapon);
m_storedWeapon = WEAPONTYPE_UNIDENTIFIED;
}
@@ -12448,20 +12519,20 @@ CPed::ProcessObjective(void)
case OBJECTIVE_NONE:
case OBJECTIVE_GUARD_AREA:
case OBJECTIVE_FOLLOW_CAR_IN_CAR:
- case OBJECTIVE_FIRE_AT_OBJ_FROM_VEHICLE:
- case OBJECTIVE_DESTROY_OBJ:
- case OBJECTIVE_23:
- case OBJECTIVE_24:
+ case OBJECTIVE_FIRE_AT_OBJECT_FROM_VEHICLE:
+ case OBJECTIVE_DESTROY_OBJECT:
+ case OBJECTIVE_GOTO_AREA_IN_CAR:
+ case OBJECTIVE_FOLLOW_CAR_ON_FOOT_WITH_OFFSET:
case OBJECTIVE_SET_LEADER:
break;
- case OBJECTIVE_IDLE:
+ case OBJECTIVE_WAIT_ON_FOOT:
SetIdle();
m_objective = OBJECTIVE_NONE;
SetMoveState(PEDMOVE_STILL);
break;
- case OBJECTIVE_FLEE_TILL_SAFE:
+ case OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE:
if (InVehicle()) {
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
bFleeAfterExitingCar = true;
} else if (m_nPedState != PED_FLEE_POS) {
SetFlee(GetPosition(), 10000);
@@ -12503,7 +12574,7 @@ CPed::ProcessObjective(void)
case OBJECTIVE_WAIT_IN_CAR:
m_nPedState = PED_DRIVING;
break;
- case OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT:
+ case OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT:
m_nPedState = PED_DRIVING;
break;
case OBJECTIVE_KILL_CHAR_ANY_MEANS:
@@ -12513,7 +12584,7 @@ CPed::ProcessObjective(void)
&& m_nPedType != PEDTYPE_COP && FindPlayerPed()->m_pWanted->m_CurrentCops
&& !bKindaStayInSamePlace) {
- SetObjective(OBJECTIVE_FLEE_TILL_SAFE);
+ SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE);
break;
}
if (InVehicle()) {
@@ -12538,7 +12609,7 @@ CPed::ProcessObjective(void)
|| targetHasVeh && m_pedInObjective->m_pMyVehicle->CanPedExitCar()) {
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
}
}
break;
@@ -12615,7 +12686,7 @@ CPed::ProcessObjective(void)
{
bool killPlayerInNoPoliceZone = false;
if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT && InVehicle()) {
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
break;
}
@@ -12680,7 +12751,7 @@ CPed::ProcessObjective(void)
}
if (m_pedInObjective->IsPlayer() && m_nPedType != PEDTYPE_COP
&& CharCreatedBy != MISSION_CHAR && FindPlayerPed()->m_pWanted->m_CurrentCops) {
- SetObjective(OBJECTIVE_FLEE_TILL_SAFE);
+ SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE);
break;
}
if (m_pedInObjective->m_fHealth <= 0.0f) {
@@ -12971,7 +13042,7 @@ CPed::ProcessObjective(void)
{
if (InVehicle()) {
if (m_nPedState == PED_DRIVING)
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
} else if (m_nPedState != PED_FLEE_ENTITY) {
int time;
if (m_objective == OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS)
@@ -13035,7 +13106,7 @@ CPed::ProcessObjective(void)
}
break;
}
- case OBJECTIVE_FOLLOW_PED_IN_FORMATION:
+ case OBJECTIVE_FOLLOW_CHAR_IN_FORMATION:
{
if (m_pedInObjective) {
CVector posToGo = GetFormationPosition();
@@ -13280,7 +13351,7 @@ CPed::ProcessObjective(void)
if (distWithTarget.MagnitudeSqr() < sq(20.0f)) {
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
ForceStoredObjective(OBJECTIVE_GOTO_AREA_ANY_MEANS);
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
}
break;
}
@@ -13324,7 +13395,7 @@ CPed::ProcessObjective(void)
{
if ((m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT || m_objective == OBJECTIVE_RUN_TO_AREA)
&& InVehicle()) {
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
} else {
distWithTarget = m_nextRoutePointPos - GetPosition();
distWithTarget.z = 0.0f;
@@ -13349,7 +13420,7 @@ CPed::ProcessObjective(void)
break;
}
- case OBJECTIVE_FIGHT_CHAR:
+ case OBJECTIVE_GUARD_ATTACK:
{
if (m_pedInObjective) {
SetLookFlag(m_pedInObjective, true);
@@ -13382,7 +13453,7 @@ CPed::ProcessObjective(void)
SetSeek(m_nextRoutePointPos, 0.8f);
}
break;
- case OBJECTIVE_SOLICIT:
+ case OBJECTIVE_SOLICIT_VEHICLE:
if (m_carInObjective) {
if (m_objectiveTimer <= CTimer::GetTimeInMilliseconds()) {
if (!bInVehicle) {
@@ -13582,7 +13653,7 @@ CPed::ProcessObjective(void)
break;
}
// fall through
- case OBJECTIVE_LEAVE_VEHICLE:
+ case OBJECTIVE_LEAVE_CAR:
if (CTimer::GetTimeInMilliseconds() > m_leaveCarTimer) {
if (InVehicle()
#ifdef VC_PED_PORTS
@@ -13641,7 +13712,7 @@ CPed::ProcessObjective(void)
#endif
}
if (bObjectiveCompleted
- || m_objectiveTimer != 0 && CTimer::GetTimeInMilliseconds() > m_objectiveTimer) {
+ || m_objectiveTimer > 0 && CTimer::GetTimeInMilliseconds() > m_objectiveTimer) {
RestorePreviousObjective();
if (m_objectiveTimer > CTimer::GetTimeInMilliseconds() || !m_objectiveTimer)
m_objectiveTimer = CTimer::GetTimeInMilliseconds() - 1;
@@ -13672,6 +13743,11 @@ CPed::SetSeekCar(CVehicle *car, uint32 doorNode)
if (m_nPedState == PED_SEEK_CAR)
return;
+#ifdef VC_PED_PORTS
+ if (!CanSetPedState() || m_nPedState == PED_DRIVING)
+ return;
+#endif
+
SetStoredState();
m_pSeekTarget = car;
m_pSeekTarget->RegisterReference((CEntity**) &m_pSeekTarget);
@@ -13690,7 +13766,7 @@ void
CPed::SetSeekBoatPosition(CVehicle *boat)
{
if (m_nPedState == PED_SEEK_IN_BOAT || boat->pDriver
-#ifdef VC_PED_PORTS
+#if defined VC_PED_PORTS || defined FIX_BUGS
|| !IsPedInControl()
#endif
)
@@ -13789,14 +13865,13 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
if (m_nMoveState == PEDMOVE_NONE || m_nMoveState == PEDMOVE_STILL)
return;
-#ifdef TOGGLEABLE_BETA_FEATURES
- if (!bMakePedsRunToPhonesToReportCrimes)
+#ifndef PEDS_REPORT_CRIMES_ON_PHONE
+ if (CharCreatedBy != MISSION_CHAR && obj->GetModelIndex() == MI_PHONEBOOTH1) {
+ bool isRunning = m_nMoveState == PEDMOVE_RUN || m_nMoveState == PEDMOVE_SPRINT;
+ SetFindPathAndFlee(obj, 5000, !isRunning);
+ return;
+ }
#endif
- if (CharCreatedBy != MISSION_CHAR && obj->GetModelIndex() == MI_PHONEBOOTH1) {
- bool isRunning = m_nMoveState == PEDMOVE_RUN || m_nMoveState == PEDMOVE_SPRINT;
- SetFindPathAndFlee(obj, 5000, !isRunning);
- return;
- }
CVector2D adjustedColMin(objColMin.x - 0.35f, objColMin.y - 0.35f);
CVector2D adjustedColMax(objColMax.x + 0.35f, objColMax.y + 0.35f);
@@ -13861,7 +13936,7 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
}
if (m_pSeekTarget == obj && obj->IsVehicle()) {
if (m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER
- || m_objective == OBJECTIVE_SOLICIT) {
+ || m_objective == OBJECTIVE_SOLICIT_VEHICLE) {
goingToEnterCar = true;
if (IsPlayer())
checkIntervalInTime = 0.0f;
@@ -14458,8 +14533,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
m_vecDamageNormal = intersectionPoint.normal;
}
}
- // VC code is working perfectly, but we don't want mega jumps to damage us significantly :shrug:
-#if 0 // #ifdef VC_PED_PORTS
+#ifdef VC_PED_PORTS
float upperSpeedLimit = 0.33f;
float lowerSpeedLimit = -0.25f;
float speed = m_vecMoveSpeed.Magnitude2D();
@@ -14467,7 +14541,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
upperSpeedLimit *= 2.0f;
lowerSpeedLimit *= 1.5f;
}
- if (!m_ped_flagA2) {
+ if (!bWasStanding) {
if ((speed <= upperSpeedLimit /* || (bfFlagsL >> 5) & 1 */) && m_vecMoveSpeed.z >= lowerSpeedLimit
|| m_pCollidingEntity == collidingEnt) {
@@ -14863,7 +14937,7 @@ CPed::PreRender(void)
CVector speed = FindPlayerSpeed();
if (Abs(speed.x) <= 0.05f && Abs(speed.y) <= 0.05f) {
- if (m_nPedState != PED_FALL && !DyingOrDead() && m_nPedState != PED_ATTACK && m_nPedState != PED_FIGHT) {
+ if (!OnGround() && m_nPedState != PED_ATTACK && m_nPedState != PED_FIGHT) {
if (!IsPedHeadAbovePos(0.3f) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_TIRED)) {
doSplashUp = false;
}
@@ -15204,7 +15278,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
default:
break;
}
- if (someoneEntersFromOurExitDoor && m_objective == OBJECTIVE_LEAVE_VEHICLE) {
+ if (someoneEntersFromOurExitDoor && m_objective == OBJECTIVE_LEAVE_CAR) {
RestorePreviousObjective();
return;
}
@@ -15561,7 +15635,7 @@ CPed::ScanForInterestingStuff(void)
if (veh->IsVehicleNormal()) {
if (veh->IsCar()) {
if ((GetPosition() - veh->GetPosition()).Magnitude() < 5.0f && veh->IsRoomForPedToLeaveCar(CAR_DOOR_LF, nil)) {
- SetObjective(OBJECTIVE_SOLICIT, veh);
+ SetObjective(OBJECTIVE_SOLICIT_VEHICLE, veh);
Say(SOUND_PED_SOLICIT);
return;
}
@@ -15882,7 +15956,7 @@ CPed::SeekCar(void)
m_fRotationCur = m_fRotationDest;
if (!bVehEnterDoorIsBlocked) {
vehToSeek->bIsStatic = false;
- if (m_objective == OBJECTIVE_SOLICIT) {
+ if (m_objective == OBJECTIVE_SOLICIT_VEHICLE) {
SetSolicit(1000);
} else if (m_objective == OBJECTIVE_BUY_ICE_CREAM) {
SetBuyIceCream();
@@ -16072,7 +16146,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
Say(SOUND_PED_DEFEND);
switch (hitLevel) {
case HITLEVEL_GROUND:
- m_lastFightMove = FIGHTMOVE_HITONFLOOR;
+ m_curFightMove = FIGHTMOVE_HITONFLOOR;
break;
case HITLEVEL_LOW:
#ifndef VC_PED_PORTS
@@ -16089,52 +16163,52 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
return;
}
#endif
- m_lastFightMove = FIGHTMOVE_HITBODY;
+ m_curFightMove = FIGHTMOVE_HITBODY;
break;
case HITLEVEL_HIGH:
switch (direction) {
case 1:
- m_lastFightMove = FIGHTMOVE_HITLEFT;
+ m_curFightMove = FIGHTMOVE_HITLEFT;
break;
case 2:
- m_lastFightMove = FIGHTMOVE_HITBACK;
+ m_curFightMove = FIGHTMOVE_HITBACK;
break;
case 3:
- m_lastFightMove = FIGHTMOVE_HITRIGHT;
+ m_curFightMove = FIGHTMOVE_HITRIGHT;
break;
default:
if (unk <= 5)
- m_lastFightMove = FIGHTMOVE_HITHEAD;
+ m_curFightMove = FIGHTMOVE_HITHEAD;
else
- m_lastFightMove = FIGHTMOVE_HITBIGSTEP;
+ m_curFightMove = FIGHTMOVE_HITBIGSTEP;
break;
}
break;
default:
switch (direction) {
case 1:
- m_lastFightMove = FIGHTMOVE_HITLEFT;
+ m_curFightMove = FIGHTMOVE_HITLEFT;
break;
case 2:
- m_lastFightMove = FIGHTMOVE_HITBACK;
+ m_curFightMove = FIGHTMOVE_HITBACK;
break;
case 3:
- m_lastFightMove = FIGHTMOVE_HITRIGHT;
+ m_curFightMove = FIGHTMOVE_HITRIGHT;
break;
default:
if (unk <= 5)
- m_lastFightMove = FIGHTMOVE_HITCHEST;
+ m_curFightMove = FIGHTMOVE_HITCHEST;
else
- m_lastFightMove = FIGHTMOVE_HITBIGSTEP;
+ m_curFightMove = FIGHTMOVE_HITBIGSTEP;
break;
}
break;
}
if (m_nPedState == PED_GETUP && !IsPedHeadAbovePos(0.0f))
- m_lastFightMove = FIGHTMOVE_HITONFLOOR;
+ m_curFightMove = FIGHTMOVE_HITONFLOOR;
if (m_nPedState == PED_FIGHT) {
- CAnimBlendAssociation *moveAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_lastFightMove].animId, 8.0f);
+ CAnimBlendAssociation *moveAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_curFightMove].animId, 8.0f);
moveAssoc->SetCurrentTime(0.0f);
moveAssoc->SetFinishCallback(FinishFightMoveCB, this);
if (IsPlayer())
@@ -16143,7 +16217,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
m_takeAStepAfterAttack = 0;
m_fightButtonPressure = 0;
} else if (IsPlayer() && m_currentWeapon != WEAPONTYPE_UNARMED) {
- CAnimBlendAssociation *moveAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_lastFightMove].animId, 4.0f);
+ CAnimBlendAssociation *moveAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_curFightMove].animId, 4.0f);
moveAssoc->SetCurrentTime(0.0f);
moveAssoc->speed = 1.3f;
} else {
@@ -16173,7 +16247,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
SetMoveState(PEDMOVE_NONE);
m_nStoredMoveState = PEDMOVE_NONE;
CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_FIGHT_IDLE)->blendAmount = 1.0f;
- CAnimBlendAssociation *moveAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_lastFightMove].animId, 8.0f);
+ CAnimBlendAssociation *moveAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_curFightMove].animId, 8.0f);
moveAssoc->SetFinishCallback(FinishFightMoveCB, this);
m_fightState = FIGHTSTATE_NO_MOVE;
m_takeAStepAfterAttack = false;
@@ -16214,14 +16288,14 @@ CPed::UpdateFromLeader(void)
if (m_leader->m_nPedState == PED_DEAD) {
SetLeader(nil);
- SetObjective(OBJECTIVE_FLEE_TILL_SAFE);
+ SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE);
return;
}
if (!m_leader->bInVehicle) {
if (m_leader->m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER) {
if (bInVehicle) {
- if (m_objective != OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT && m_objective != OBJECTIVE_LEAVE_VEHICLE)
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ if (m_objective != OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT && m_objective != OBJECTIVE_LEAVE_CAR)
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
return;
}
@@ -16236,12 +16310,12 @@ CPed::UpdateFromLeader(void)
}
}
if (bInVehicle || !m_leader->bInVehicle || m_leader->m_nPedState != PED_DRIVING) {
- if (m_leader->m_objective != OBJECTIVE_NONE && (!m_leader->IsPlayer() || m_leader->m_objective != OBJECTIVE_IDLE)
+ if (m_leader->m_objective != OBJECTIVE_NONE && (!m_leader->IsPlayer() || m_leader->m_objective != OBJECTIVE_WAIT_ON_FOOT)
&& m_objective != m_leader->m_objective) {
switch (m_leader->m_objective) {
- case OBJECTIVE_IDLE:
- case OBJECTIVE_FLEE_TILL_SAFE:
+ case OBJECTIVE_WAIT_ON_FOOT:
+ case OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE:
case OBJECTIVE_WAIT_IN_CAR:
case OBJECTIVE_FOLLOW_ROUTE:
SetObjective(m_leader->m_objective);
@@ -16266,7 +16340,7 @@ CPed::UpdateFromLeader(void)
return;
}
break;
- case OBJECTIVE_FIGHT_CHAR:
+ case OBJECTIVE_GUARD_ATTACK:
return;
case OBJECTIVE_HAIL_TAXI:
m_leader = nil;
@@ -16326,7 +16400,7 @@ CPed::UpdateFromLeader(void)
}
}
} else if (bInVehicle) {
- if ((!m_leader->bInVehicle || m_leader->m_nPedState == PED_EXIT_CAR) && m_objective != OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT) {
+ if ((!m_leader->bInVehicle || m_leader->m_nPedState == PED_EXIT_CAR) && m_objective != OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT) {
switch (m_leader->m_objective) {
case OBJECTIVE_ENTER_CAR_AS_PASSENGER:
@@ -16336,11 +16410,11 @@ CPed::UpdateFromLeader(void)
// fall through
default:
- if (m_pMyVehicle && m_objective != OBJECTIVE_LEAVE_VEHICLE) {
+ if (m_pMyVehicle && m_objective != OBJECTIVE_LEAVE_CAR) {
#ifdef VC_PED_PORTS
m_leaveCarTimer = CTimer::GetTimeInMilliseconds() + 250;
#endif
- SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
+ SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
}
break;
@@ -16713,19 +16787,19 @@ CPed::SetObjective(eObjective newObj, CVector dest)
break;
case OBJECTIVE_GUARD_AREA:
case OBJECTIVE_WAIT_IN_CAR:
- case OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT:
+ case OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT:
case OBJECTIVE_KILL_CHAR_ON_FOOT:
case OBJECTIVE_KILL_CHAR_ANY_MEANS:
case OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE:
case OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS:
case OBJECTIVE_GOTO_CHAR_ON_FOOT:
- case OBJECTIVE_FOLLOW_PED_IN_FORMATION:
- case OBJECTIVE_LEAVE_VEHICLE:
+ case OBJECTIVE_FOLLOW_CHAR_IN_FORMATION:
+ case OBJECTIVE_LEAVE_CAR:
case OBJECTIVE_ENTER_CAR_AS_PASSENGER:
case OBJECTIVE_ENTER_CAR_AS_DRIVER:
case OBJECTIVE_FOLLOW_CAR_IN_CAR:
- case OBJECTIVE_FIRE_AT_OBJ_FROM_VEHICLE:
- case OBJECTIVE_DESTROY_OBJ:
+ case OBJECTIVE_FIRE_AT_OBJECT_FROM_VEHICLE:
+ case OBJECTIVE_DESTROY_OBJECT:
case OBJECTIVE_DESTROY_CAR:
break;
case OBJECTIVE_GOTO_AREA_ANY_MEANS:
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 6e536ede..63d8e598 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -153,34 +153,34 @@ enum eWaitState {
enum eObjective : uint32 {
OBJECTIVE_NONE,
- OBJECTIVE_IDLE,
- OBJECTIVE_FLEE_TILL_SAFE,
+ OBJECTIVE_WAIT_ON_FOOT,
+ OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE,
OBJECTIVE_GUARD_SPOT,
OBJECTIVE_GUARD_AREA, // not implemented
OBJECTIVE_WAIT_IN_CAR,
- OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT,
+ OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT,
OBJECTIVE_KILL_CHAR_ON_FOOT,
OBJECTIVE_KILL_CHAR_ANY_MEANS,
OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE,
OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS,
OBJECTIVE_GOTO_CHAR_ON_FOOT,
- OBJECTIVE_FOLLOW_PED_IN_FORMATION,
- OBJECTIVE_LEAVE_VEHICLE,
+ OBJECTIVE_FOLLOW_CHAR_IN_FORMATION,
+ OBJECTIVE_LEAVE_CAR,
OBJECTIVE_ENTER_CAR_AS_PASSENGER,
OBJECTIVE_ENTER_CAR_AS_DRIVER,
- OBJECTIVE_FOLLOW_CAR_IN_CAR, // seems not implemented so far
- OBJECTIVE_FIRE_AT_OBJ_FROM_VEHICLE, // not implemented
- OBJECTIVE_DESTROY_OBJ, // not implemented
+ OBJECTIVE_FOLLOW_CAR_IN_CAR, // not implemented
+ OBJECTIVE_FIRE_AT_OBJECT_FROM_VEHICLE, // not implemented
+ OBJECTIVE_DESTROY_OBJECT, // not implemented
OBJECTIVE_DESTROY_CAR,
OBJECTIVE_GOTO_AREA_ANY_MEANS,
OBJECTIVE_GOTO_AREA_ON_FOOT,
OBJECTIVE_RUN_TO_AREA,
- OBJECTIVE_23, // not implemented
- OBJECTIVE_24, // not implemented
- OBJECTIVE_FIGHT_CHAR,
+ OBJECTIVE_GOTO_AREA_IN_CAR, // not implemented
+ OBJECTIVE_FOLLOW_CAR_ON_FOOT_WITH_OFFSET, // not implemented
+ OBJECTIVE_GUARD_ATTACK,
OBJECTIVE_SET_LEADER,
OBJECTIVE_FOLLOW_ROUTE,
- OBJECTIVE_SOLICIT,
+ OBJECTIVE_SOLICIT_VEHICLE,
OBJECTIVE_HAIL_TAXI,
OBJECTIVE_CATCH_TRAIN,
OBJECTIVE_BUY_ICE_CREAM,
@@ -385,9 +385,8 @@ public:
#ifdef PED_SKIN
uint32 bDontAcceptIKLookAts : 1; // TODO: find uses of this
#endif
- // our own flags
- uint32 m_ped_flagI40 : 1; // bMakePedsRunToPhonesToReportCrimes makes use of this as runover by car indicator
- uint32 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle
+ uint32 m_ped_flagI40 : 1;
+ uint32 m_ped_flagI80 : 1; // originally unused, KANGAROO_CHEAT define makes use of this as cheat toggle
uint8 CharCreatedBy;
eObjective m_objective;
@@ -454,6 +453,10 @@ public:
float m_distanceToCountSeekDone;
bool bRunningToPhone;
int16 m_phoneId;
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ bool m_facePhoneStart;
+ CEntity *m_victimOfPlayerCrime;
+#endif
eCrimeType m_crimeToReportOnPhone;
uint32 m_phoneTalkTimer;
CAccident *m_lastAccident;
@@ -477,7 +480,7 @@ public:
uint8 m_wepAccuracy;
CEntity *m_pPointGunAt;
CVector m_vecHitLastPos;
- uint32 m_lastFightMove;
+ uint32 m_curFightMove;
uint8 m_fightButtonPressure;
FightState m_fightState;
bool m_takeAStepAfterAttack;
@@ -588,6 +591,9 @@ public:
bool MakePhonecall(void);
bool FacePhone(void);
CPed *CheckForDeadPeds(void);
+#ifdef PEDS_REPORT_CRIMES_ON_PHONE
+ int32 CheckForPlayerCrimes(CPed *victim = nil);
+#endif
bool CheckForExplosions(CVector2D &area);
CPed *CheckForGunShots(void);
PointBlankNecessity CheckForPointBlankPeds(CPed*);
@@ -796,6 +802,7 @@ public:
bool Dying(void) { return m_nPedState == PED_DIE; }
bool DyingOrDead(void) { return m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
bool OnGround(void) { return m_nPedState == PED_FALL || m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
+ bool OnGroundOrGettingUp(void) { return OnGround() || m_nPedState == PED_GETUP; }
bool Driving(void) { return m_nPedState == PED_DRIVING; }
bool InVehicle(void) { return bInVehicle && m_pMyVehicle; } // True when ped is sitting/standing in vehicle, not in enter/exit state.
@@ -872,9 +879,8 @@ public:
static bool bPedCheat3;
static CVector2D ms_vec2DFleePosition;
-#ifdef TOGGLEABLE_BETA_FEATURES
+#ifdef DEBUGMENU
static bool bPopHeadsOnHeadshot;
- static bool bMakePedsRunToPhonesToReportCrimes;
#endif
#ifndef MASTER
diff --git a/src/peds/PedStats.cpp b/src/peds/PedStats.cpp
index 06e39039..1f7a95b4 100644
--- a/src/peds/PedStats.cpp
+++ b/src/peds/PedStats.cpp
@@ -47,7 +47,7 @@ CPedStats::LoadPedStats(void)
char *buf;
char line[256];
char name[32];
- int bp, buflen;
+ size_t bp, buflen;
int lp, linelen;
int type;
float fleeDist, headingChangeRate, attackStrength, defendWeakness;
diff --git a/src/peds/PedType.cpp b/src/peds/PedType.cpp
index 8bf4c6e1..397cd71d 100644
--- a/src/peds/PedType.cpp
+++ b/src/peds/PedType.cpp
@@ -43,7 +43,7 @@ CPedType::LoadPedData(void)
char *buf;
char line[256];
char word[32];
- int bp, buflen;
+ size_t bp, buflen;
int lp, linelen;
int type;
uint32 flags;
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 6613ea1b..fa865aec 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -1288,7 +1288,7 @@ CPlayerPed::ProcessControl(void)
SetDead();
return;
}
- if (m_nPedState == PED_DRIVING && m_objective != OBJECTIVE_LEAVE_VEHICLE) {
+ if (m_nPedState == PED_DRIVING && m_objective != OBJECTIVE_LEAVE_CAR) {
if (m_pMyVehicle->IsCar() && ((CAutomobile*)m_pMyVehicle)->Damage.GetDoorStatus(DOOR_FRONT_LEFT) == DOOR_STATUS_SWINGING) {
CAnimBlendAssociation *rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR);
if (!rollDoorAssoc) {
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index e2257a28..1357907d 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -394,7 +394,7 @@ CPopulation::FindCollisionZoneForCoors(CVector *coors, int *safeZoneOut, eLevelN
}
// Then it's transition area
if (*safeZoneOut >= 0)
- *levelOut = LEVEL_NONE;
+ *levelOut = LEVEL_GENERIC;
else
*levelOut = CTheZones::GetLevelFromPosition(coors);
}
@@ -867,7 +867,7 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones()
for (int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) {
CVehicle* veh = CPools::GetVehiclePool()->GetSlot(poolIndex);
- if (veh && veh->m_nZoneLevel == LEVEL_NONE && veh->IsCar()) {
+ if (veh && veh->m_nZoneLevel == LEVEL_GENERIC && veh->IsCar()) {
if(veh->GetStatus() != STATUS_ABANDONED && veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_PLAYER &&
veh->GetStatus() != STATUS_PLAYER_REMOTE) {
@@ -876,7 +876,7 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones()
CPopulation::FindCollisionZoneForCoors(&vehPos, &zone, &level);
// Level 0 is transition zones, and we don't wanna touch cars on transition zones.
- if (level != LEVEL_NONE && level != CCollision::ms_collisionInMemory && vehPos.z > -4.0f) {
+ if (level != LEVEL_GENERIC && level != CCollision::ms_collisionInMemory && vehPos.z > -4.0f) {
if (veh->bIsLocked || !veh->CanBeDeleted()) {
switch (movedVehicleCount & 3) {
case 0:
@@ -913,13 +913,13 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones()
for (int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) {
CPed *ped = CPools::GetPedPool()->GetSlot(poolIndex);
- if (ped && ped->m_nZoneLevel == LEVEL_NONE && !ped->bInVehicle) {
+ if (ped && ped->m_nZoneLevel == LEVEL_GENERIC && !ped->bInVehicle) {
CVector pedPos(ped->GetPosition());
CPopulation::FindCollisionZoneForCoors(&pedPos, &zone, &level);
// Level 0 is transition zones, and we don't wanna touch peds on transition zones.
- if (level != LEVEL_NONE && level != CCollision::ms_collisionInMemory && pedPos.z > -4.0f) {
+ if (level != LEVEL_GENERIC && level != CCollision::ms_collisionInMemory && pedPos.z > -4.0f) {
if (ped->CanBeDeleted()) {
CWorld::Remove(ped);
delete ped;
diff --git a/src/render/Credits.cpp b/src/render/Credits.cpp
index e0134e52..2cfdba90 100644
--- a/src/render/Credits.cpp
+++ b/src/render/Credits.cpp
@@ -129,12 +129,12 @@ CCredits::Render(void)
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED041"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED042"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED043"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED044"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditSpace(2.0f, lineoffset);
@@ -177,14 +177,14 @@ CCredits::Render(void)
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED061"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED062"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED063"), lineoffset, scrolloffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED064"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED065"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED066"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED067"), lineoffset, scrolloffset);
@@ -192,16 +192,16 @@ CCredits::Render(void)
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED069"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED070"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED071"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED072"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED073"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED074"), lineoffset, scrolloffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED075"), lineoffset, scrolloffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED076"), lineoffset, scrolloffset);
@@ -221,16 +221,16 @@ CCredits::Render(void)
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED085"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED086"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED087"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED088"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED089"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED090"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED091"), lineoffset, scrolloffset);
@@ -250,7 +250,7 @@ CCredits::Render(void)
PrintCreditSpace(2.0f, lineoffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED100"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED101"), lineoffset, scrolloffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED102"), lineoffset, scrolloffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED103"), lineoffset, scrolloffset);
@@ -261,82 +261,82 @@ CCredits::Render(void)
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED269"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED107"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED108"), lineoffset, scrolloffset);
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED109"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.5f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED108"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED109"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED110"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED110"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED111"), lineoffset, scrolloffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED112"), lineoffset, scrolloffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED112"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED113"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED113"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED114"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED114"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED115"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED115"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED116"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED116"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED117"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED117"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED118"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED118"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED119"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED119"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED120"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED120"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED121"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED121"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED122"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED122"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED123"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED123"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED124"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED124"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED125"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED125"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED126"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED126"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED127"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED127"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED128"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED128"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED129"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED129"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED130"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED130"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED131"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED131"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED132"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED132"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED133"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED133"), lineoffset, scrolloffset);
if(CMenuManager::m_PrefsLanguage == CMenuManager::LANGUAGE_ITALIAN)
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED134"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED134"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED135"), lineoffset, scrolloffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED136"), lineoffset, scrolloffset);
@@ -349,7 +349,7 @@ CCredits::Render(void)
PrintCreditText(1.7f, 1.7f, TheText.Get("CRD138A"), lineoffset, scrolloffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRD138B"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED139"), lineoffset, scrolloffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED139"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.7f, 1.0f, TheText.Get("CRED140"), lineoffset, scrolloffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRD140A"), lineoffset, scrolloffset);
@@ -359,12 +359,12 @@ CCredits::Render(void)
PrintCreditText(1.7f, 1.7f, TheText.Get("CRD140E"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED141"), lineoffset, scrolloffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED142"), lineoffset, scrolloffset);
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED143"), lineoffset, scrolloffset);
- PrintCreditSpace(1.0, lineoffset);
- PrintCreditText(1.0, 1.0, TheText.Get("CRED144"), lineoffset, scrolloffset);
- PrintCreditSpace(1.0, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED142"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED143"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
+ PrintCreditText(1.0f, 1.0f, TheText.Get("CRED144"), lineoffset, scrolloffset);
+ PrintCreditSpace(1.0f, lineoffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED145"), lineoffset, scrolloffset);
PrintCreditText(1.4f, 1.4f, TheText.Get("CRED146"), lineoffset, scrolloffset);
@@ -441,19 +441,19 @@ CCredits::Render(void)
PrintCreditText(1.4f, 1.4f, TheText.Get("CRED241"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED217"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED218"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRD218A"), lineoffset, scrolloffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRD218B"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED219"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED220"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED221"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED222"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED223"), lineoffset, scrolloffset);
@@ -462,7 +462,7 @@ CCredits::Render(void)
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED226"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
PrintCreditText(1.4f, 0.82f, TheText.Get("CRED227"), lineoffset, scrolloffset);
- PrintCreditSpace(1.5, lineoffset);
+ PrintCreditSpace(1.5f, lineoffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED228"), lineoffset, scrolloffset);
PrintCreditText(1.7f, 1.7f, TheText.Get("CRED229"), lineoffset, scrolloffset);
PrintCreditSpace(2.0f, lineoffset);
diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp
index bb37a3a3..db87e76d 100644
--- a/src/render/Draw.cpp
+++ b/src/render/Draw.cpp
@@ -3,6 +3,7 @@
#include "Draw.h"
#include "Frontend.h"
#include "Camera.h"
+#include "CutsceneMgr.h"
#ifdef ASPECT_RATIO_SCALE
float CDraw::ms_fAspectRatio = DEFAULT_ASPECT_RATIO;
@@ -62,7 +63,10 @@ void
CDraw::SetFOV(float fov)
{
#ifdef ASPECT_RATIO_SCALE
- ms_fScaledFOV = ConvertFOV(fov);
+ if (!CCutsceneMgr::IsRunning())
+ ms_fScaledFOV = ConvertFOV(fov);
+ else
+ ms_fScaledFOV = fov;
#endif
ms_fFOV = fov;
}
diff --git a/src/render/Fluff.cpp b/src/render/Fluff.cpp
index da29daec..f86801bf 100644
--- a/src/render/Fluff.cpp
+++ b/src/render/Fluff.cpp
@@ -614,7 +614,7 @@ void CScrollBar::Update()
break;
}
- m_MessageLength = strlen(m_pMessage);
+ m_MessageLength = (uint32)strlen(m_pMessage);
m_MessageCurrentChar = 0;
}
diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp
index ac892ddb..ee36bad3 100644
--- a/src/render/Glass.cpp
+++ b/src/render/Glass.cpp
@@ -424,10 +424,10 @@ CGlass::RenderEntityInGlass(CEntity *entity)
ASSERT(col!=nil);
if ( col->numTriangles >= 2 )
{
- CVector a = object->GetMatrix() * col->vertices[0];
- CVector b = object->GetMatrix() * col->vertices[1];
- CVector c = object->GetMatrix() * col->vertices[2];
- CVector d = object->GetMatrix() * col->vertices[3];
+ CVector a = object->GetMatrix() * col->vertices[0].Get();
+ CVector b = object->GetMatrix() * col->vertices[1].Get();
+ CVector c = object->GetMatrix() * col->vertices[2].Get();
+ CVector d = object->GetMatrix() * col->vertices[3].Get();
if ( object->bGlassCracked )
{
@@ -613,10 +613,10 @@ CGlass::WindowRespondsToCollision(CEntity *entity, float amount, CVector speed,
CColModel *col = object->GetColModel();
ASSERT(col!=nil);
- CVector a = object->GetMatrix() * col->vertices[0];
- CVector b = object->GetMatrix() * col->vertices[1];
- CVector c = object->GetMatrix() * col->vertices[2];
- CVector d = object->GetMatrix() * col->vertices[3];
+ CVector a = object->GetMatrix() * col->vertices[0].Get();
+ CVector b = object->GetMatrix() * col->vertices[1].Get();
+ CVector c = object->GetMatrix() * col->vertices[2].Get();
+ CVector d = object->GetMatrix() * col->vertices[3].Get();
float minx = Min(Min(a.x, b.x), Min(c.x, d.x));
float maxx = Max(Max(a.x, b.x), Max(c.x, d.x));
diff --git a/src/render/MBlur.cpp b/src/render/MBlur.cpp
index f2b94848..ec811e56 100644
--- a/src/render/MBlur.cpp
+++ b/src/render/MBlur.cpp
@@ -1,5 +1,11 @@
#define WITHWINDOWS
+#ifndef LIBRW
+#define WITHD3D
+#endif
#include "common.h"
+#ifndef LIBRW
+#include <d3d8caps.h>
+#endif
#include "RwHelper.h"
#include "Camera.h"
@@ -15,6 +21,9 @@ bool CMBlur::BlurOn;
static RwIm2DVertex Vertex[4];
static RwImVertexIndex Index[6] = { 0, 1, 2, 0, 2, 3 };
+#ifndef LIBRW
+extern "C" D3DCAPS8 _RwD3D8DeviceCaps;
+#endif
RwBool
CMBlur::MotionBlurOpen(RwCamera *cam)
{
@@ -62,12 +71,11 @@ CMBlur::MotionBlurOpen(RwCamera *cam)
if(BlurOn)
{
- int32 width = Pow(2.0f, int32(log2(RwRasterGetWidth (RwCameraGetRaster(cam))))+1);
- int32 height = Pow(2.0f, int32(log2(RwRasterGetHeight(RwCameraGetRaster(cam))))+1);
- int32 depth = RwRasterGetDepth(RwCameraGetRaster(cam));
+ uint32 width = Pow(2.0f, int32(log2(RwRasterGetWidth (RwCameraGetRaster(cam))))+1);
+ uint32 height = Pow(2.0f, int32(log2(RwRasterGetHeight(RwCameraGetRaster(cam))))+1);
+ uint32 depth = RwRasterGetDepth(RwCameraGetRaster(cam));
#ifndef LIBRW
- extern D3DCAPS8 _RwD3D8DeviceCaps;
extern DWORD _dwMemTotalVideo;
if ( _RwD3D8DeviceCaps.MaxTextureWidth >= width && _RwD3D8DeviceCaps.MaxTextureHeight >= height )
{
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 8a48eb11..88d412c9 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -311,7 +311,11 @@ enum Visbility
VIS_STREAMME
};
+#ifdef FIX_BUGS
+#define LOD_DISTANCE (300.0f*TheCamera.LODDistMultiplier)
+#else
#define LOD_DISTANCE 300.0f
+#endif
#define FADE_DISTANCE 20.0f
#define STREAM_DISTANCE 30.0f
@@ -674,14 +678,7 @@ CRenderer::ScanWorld(void)
poly[2].y = CWorld::GetSectorY(vectors[CORNER_LOD_RIGHT].y);
ScanSectorPoly(poly, 3, ScanSectorList_Subway);
}else{
- if(f <= LOD_DISTANCE){
- poly[0].x = CWorld::GetSectorX(vectors[CORNER_CAM].x);
- poly[0].y = CWorld::GetSectorY(vectors[CORNER_CAM].y);
- poly[1].x = CWorld::GetSectorX(vectors[CORNER_FAR_TOPLEFT].x);
- poly[1].y = CWorld::GetSectorY(vectors[CORNER_FAR_TOPLEFT].y);
- poly[2].x = CWorld::GetSectorX(vectors[CORNER_FAR_TOPRIGHT].x);
- poly[2].y = CWorld::GetSectorY(vectors[CORNER_FAR_TOPRIGHT].y);
- }else{
+ if(f > LOD_DISTANCE){
// priority
poly[0].x = CWorld::GetSectorX(vectors[CORNER_CAM].x);
poly[0].y = CWorld::GetSectorY(vectors[CORNER_CAM].y);
@@ -698,11 +695,27 @@ CRenderer::ScanWorld(void)
poly[1].y = CWorld::GetSectorY(vectors[CORNER_LOD_LEFT].y);
poly[2].x = CWorld::GetSectorX(vectors[CORNER_LOD_RIGHT].x);
poly[2].y = CWorld::GetSectorY(vectors[CORNER_LOD_RIGHT].y);
+ ScanSectorPoly(poly, 3, ScanSectorList);
+ }else{
+ poly[0].x = CWorld::GetSectorX(vectors[CORNER_CAM].x);
+ poly[0].y = CWorld::GetSectorY(vectors[CORNER_CAM].y);
+ poly[1].x = CWorld::GetSectorX(vectors[CORNER_FAR_TOPLEFT].x);
+ poly[1].y = CWorld::GetSectorY(vectors[CORNER_FAR_TOPLEFT].y);
+ poly[2].x = CWorld::GetSectorX(vectors[CORNER_FAR_TOPRIGHT].x);
+ poly[2].y = CWorld::GetSectorY(vectors[CORNER_FAR_TOPRIGHT].y);
+ ScanSectorPoly(poly, 3, ScanSectorList);
}
- ScanSectorPoly(poly, 3, ScanSectorList);
-
+#ifdef NO_ISLAND_LOADING
+ ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_INDUSTRIAL));
+ ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_COMMERCIAL));
+ ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_SUBURBAN));
+#else
+ #ifdef FIX_BUGS
+ if (CCollision::ms_collisionInMemory != LEVEL_GENERIC)
+ #endif
ScanBigBuildingList(CWorld::GetBigBuildingList(CCollision::ms_collisionInMemory));
- ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_NONE));
+#endif
+ ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_GENERIC));
}
}
}
@@ -844,9 +857,9 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL
// prestep x1 and x2 to next integer y
deltaA = CalcNewDelta(&poly[a1], &poly[a2]);
- xA = deltaA * (ceilf(poly[a1].y) - poly[a1].y) + poly[a1].x;
+ xA = deltaA * (Ceil(poly[a1].y) - poly[a1].y) + poly[a1].x;
deltaB = CalcNewDelta(&poly[b1], &poly[b2]);
- xB = deltaB * (ceilf(poly[b1].y) - poly[b1].y) + poly[b1].x;
+ xB = deltaB * (Ceil(poly[b1].y) - poly[b1].y) + poly[b1].x;
if(y != yend){
if(deltaB < 0.0f && (int)xB < xstart)
@@ -891,7 +904,7 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL
xstart = poly[b1].x;
}while(y == (int)poly[b2].y);
deltaB = CalcNewDelta(&poly[b1], &poly[b2]);
- xB = deltaB * (ceilf(poly[b1].y) - poly[b1].y) + poly[b1].x;
+ xB = deltaB * (Ceil(poly[b1].y) - poly[b1].y) + poly[b1].x;
if(deltaB < 0.0f && (int)xB < xstart)
xstart = xB;
}
@@ -927,7 +940,7 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL
xend = poly[a1].x;
}while(y == (int)poly[a2].y);
deltaA = CalcNewDelta(&poly[a1], &poly[a2]);
- xA = deltaA * (ceilf(poly[a1].y) - poly[a1].y) + poly[a1].x;
+ xA = deltaA * (Ceil(poly[a1].y) - poly[a1].y) + poly[a1].x;
if(deltaA >= 0.0f && (int)xA > xend)
xend = xA;
}
diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp
index d07c302a..c169c351 100644
--- a/src/render/Shadows.cpp
+++ b/src/render/Shadows.cpp
@@ -796,6 +796,8 @@ CShadows::RenderStaticShadows(void)
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE);
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)FALSE);
+ SetAlphaTest(0);
+
for ( int32 i = 0; i < MAX_STATICSHADOWS; i++ )
aStaticShadows[i].m_bRendered = false;
@@ -849,6 +851,7 @@ CShadows::RenderStaticShadows(void)
RenderBuffer::RenderStuffInBuffer();
}
}
+ RestoreAlphaTest();
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)TRUE);
diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp
index 0789769a..9ec7b002 100644
--- a/src/render/Sprite.cpp
+++ b/src/render/Sprite.cpp
@@ -29,11 +29,7 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh,
float recip = 1.0f/out->z;
out->x *= SCREEN_WIDTH * recip;
out->y *= SCREEN_HEIGHT * recip;
-#ifdef ASPECT_RATIO_SCALE
- float fov = CDraw::ConvertFOV(DefaultFOV);
-#else
const float fov = DefaultFOV;
-#endif
// this is used to scale correctly if you zoom in with sniper rifle
float fovScale = fov / CDraw::GetFOV();
diff --git a/src/rw/NodeName.cpp b/src/rw/NodeName.cpp
index d62884f7..ad4acffb 100644
--- a/src/rw/NodeName.cpp
+++ b/src/rw/NodeName.cpp
@@ -51,7 +51,7 @@ RwInt32
NodeNameStreamGetSize(const void *object, RwInt32 offsetInObject, RwInt32 sizeInObject)
{
// game checks for null pointer on node name extension but that really happen
- return rwstrlen(NODENAMEEXT(object));
+ return (RwInt32)rwstrlen(NODENAMEEXT(object));
}
bool
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp
index cd2a1bf6..f568532a 100644
--- a/src/rw/RwHelper.cpp
+++ b/src/rw/RwHelper.cpp
@@ -11,7 +11,11 @@
RtCharset *debugCharset;
#endif
-bool gPS2alphaTest = 1;
+#ifdef PS2_ALPHA_TEST
+bool gPS2alphaTest = true;
+#else
+bool gPS2alphaTest = false;
+#endif
#ifndef FINAL
static bool charsetOpen;
@@ -202,7 +206,7 @@ isSkinnedCb(RpAtomic *atomic, void *data)
RpAtomic **pAtomic = (RpAtomic**)data;
if(*pAtomic)
return nil; // already found one
- if(RpSkinGeometryGetSkin(atomic->geometry))
+ if(RpSkinGeometryGetSkin(RpAtomicGetGeometry(atomic)))
*pAtomic = atomic; // we could just return nil here directly...
return atomic;
}
@@ -611,3 +615,37 @@ CameraCreate(RwInt32 width, RwInt32 height, RwBool zBuffer)
WRAPPER void _TexturePoolsInitialise() { EAXJMP(0x598B10); }
WRAPPER void _TexturePoolsShutdown() { EAXJMP(0x598B30); }
#endif
+
+#if defined(FIX_BUGS) && defined(GTA_PC)
+RwUInt32 saved_alphafunc, saved_alpharef;
+
+void
+SetAlphaTest(RwUInt32 alpharef)
+{
+#ifdef LIBRW
+ saved_alphafunc = rw::GetRenderState(rw::ALPHATESTFUNC);
+ saved_alpharef = rw::GetRenderState(rw::ALPHATESTREF);
+
+ rw::SetRenderState(rw::ALPHATESTFUNC, rw::ALPHAGREATEREQUAL);
+ rw::SetRenderState(rw::ALPHATESTREF, 0);
+#else
+ RwD3D8GetRenderState(D3DRS_ALPHAFUNC, &saved_alphafunc);
+ RwD3D8GetRenderState(D3DRS_ALPHAREF, &saved_alpharef);
+
+ RwD3D8SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
+ RwD3D8SetRenderState(D3DRS_ALPHAREF, alpharef);
+#endif
+}
+
+void
+RestoreAlphaTest()
+{
+#ifdef LIBRW
+ rw::SetRenderState(rw::ALPHATESTFUNC, saved_alphafunc);
+ rw::SetRenderState(rw::ALPHATESTREF, saved_alpharef);
+#else
+ RwD3D8SetRenderState(D3DRS_ALPHAFUNC, saved_alphafunc);
+ RwD3D8SetRenderState(D3DRS_ALPHAREF, saved_alpharef);
+#endif
+}
+#endif \ No newline at end of file
diff --git a/src/rw/RwHelper.h b/src/rw/RwHelper.h
index a751ee39..eceaee07 100644
--- a/src/rw/RwHelper.h
+++ b/src/rw/RwHelper.h
@@ -52,4 +52,12 @@ RwCamera *CameraCreate(RwInt32 width,
void _TexturePoolsInitialise();
-void _TexturePoolsShutdown(); \ No newline at end of file
+void _TexturePoolsShutdown();
+
+#if defined(FIX_BUGS) && defined (GTA_PC)
+void SetAlphaTest(RwUInt32 alpharef);
+void RestoreAlphaTest();
+#else
+#define SetAlphaTest(a) (0)
+#define RestoreAlphaTest() (0)
+#endif \ No newline at end of file
diff --git a/src/rw/RwMatFX.cpp b/src/rw/RwMatFX.cpp
index 1e64c560..c8384b0f 100644
--- a/src/rw/RwMatFX.cpp
+++ b/src/rw/RwMatFX.cpp
@@ -2,9 +2,7 @@
#define WITHD3D
#include "common.h"
-#ifdef RWLIBS
-#include "patcher.h"
-#endif
+#include "rpmatfx.h"
struct MatFXNothing { int pad[5]; int effect; };
@@ -47,16 +45,16 @@ struct MatFX
int effects;
};
-#ifdef RWLIBS
extern "C" {
extern int MatFXMaterialDataOffset;
extern int MatFXAtomicDataOffset;
+
void _rpMatFXD3D8AtomicMatFXEnvRender(RxD3D8InstanceData* inst, int flags, int sel, RwTexture* texture, RwTexture* envMap);
+ void _rpMatFXD3D8AtomicMatFXRenderBlack(RxD3D8InstanceData *inst);
+ void _rpMatFXD3D8AtomicMatFXBumpMapRender(RxD3D8InstanceData *inst, int flags, RwTexture *texture, RwTexture *bumpMap, RwTexture *envMap);
+ void _rpMatFXD3D8AtomicMatFXDualPassRender(RxD3D8InstanceData *inst, int flags, RwTexture *texture, RwTexture *dualTexture);
}
-#else
-int &MatFXMaterialDataOffset = *(int*)0x66188C;
-int &MatFXAtomicDataOffset = *(int*)0x66189C;
-#endif
+
#ifdef PS2_MATFX
@@ -218,12 +216,97 @@ _rpMatFXD3D8AtomicMatFXEnvRender_ps2(RxD3D8InstanceData *inst, int flags, int se
RwD3D8SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, 0);
}
-#ifdef RWLIBS
-STARTPATCHES
- InjectHook((uintptr)&_rpMatFXD3D8AtomicMatFXEnvRender, _rpMatFXD3D8AtomicMatFXEnvRender_ps2, PATCH_JUMP);
-ENDPATCHES
-#endif
+void
+_rwD3D8EnableClippingIfNeeded(void *object, RwUInt8 type)
+{
+ int clip;
+ if (type == rpATOMIC)
+ clip = !RwD3D8CameraIsSphereFullyInsideFrustum(RwCameraGetCurrentCameraMacro(), RpAtomicGetWorldBoundingSphere((RpAtomic *)object));
+ else
+ clip = !RwD3D8CameraIsBBoxFullyInsideFrustum(RwCameraGetCurrentCameraMacro(), &((RpWorldSector *)object)->tightBoundingBox);
+ RwD3D8SetRenderState(D3DRS_CLIPPING, clip);
+}
-#endif
+void
+_rwD3D8AtomicMatFXRenderCallback(RwResEntry *repEntry, void *object, RwUInt8 type, RwUInt32 flags)
+{
+ RwBool lighting;
+ RwBool forceBlack;
+ RxD3D8ResEntryHeader *header;
+ RxD3D8InstanceData *inst;
+ RwInt32 i;
+
+ if (flags & rpGEOMETRYPRELIT) {
+ RwD3D8SetRenderState(D3DRS_COLORVERTEX, 1);
+ RwD3D8SetRenderState(D3DRS_EMISSIVEMATERIALSOURCE, D3DMCS_COLOR1);
+ } else {
+ RwD3D8SetRenderState(D3DRS_COLORVERTEX, 0);
+ RwD3D8SetRenderState(D3DRS_EMISSIVEMATERIALSOURCE, D3DMCS_MATERIAL);
+ }
+
+ _rwD3D8EnableClippingIfNeeded(object, type);
+
+ RwD3D8GetRenderState(D3DRS_LIGHTING, &lighting);
+ if (lighting || flags & rpGEOMETRYPRELIT) {
+ forceBlack = FALSE;
+ } else {
+ forceBlack = TRUE;
+ RwD3D8SetTexture(nil, 0);
+ RwD3D8SetRenderState(D3DRS_TEXTUREFACTOR, D3DCOLOR_RGBA(0, 0, 0, 255));
+ RwD3D8SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG2);
+ RwD3D8SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TFACTOR);
+ }
+
+ header = (RxD3D8ResEntryHeader *)(repEntry + 1);
+ inst = (RxD3D8InstanceData *)(header + 1);
+ for (i = 0; i < header->numMeshes; i++) {
+ if (forceBlack)
+ _rpMatFXD3D8AtomicMatFXRenderBlack(inst);
+ else {
+ if (lighting)
+ RwD3D8SetSurfaceProperties(&inst->material->color, &inst->material->surfaceProps, flags & rpGEOMETRYMODULATEMATERIALCOLOR);
+ MatFX *matfx = *RWPLUGINOFFSET(MatFX *, inst->material, MatFXMaterialDataOffset);
+ int effect = matfx ? matfx->effects : rpMATFXEFFECTNULL;
+ switch (effect) {
+ case rpMATFXEFFECTNULL:
+ default:
+ _rpMatFXD3D8AtomicMatFXDefaultRender(inst, flags, inst->material->texture);
+ break;
+ case rpMATFXEFFECTBUMPMAP:
+ _rpMatFXD3D8AtomicMatFXBumpMapRender(inst, flags, inst->material->texture, matfx->fx[0].b.bumpedTex, nil);
+ break;
+ case rpMATFXEFFECTENVMAP:
+ {
+ // TODO: matfx switch in the settings
+ //_rpMatFXD3D8AtomicMatFXEnvRender(inst, flags, 0, inst->material->texture, matfx->fx[0].e.envTex);
+ _rpMatFXD3D8AtomicMatFXEnvRender_ps2(inst, flags, 0, inst->material->texture, matfx->fx[0].e.envTex);
+ break;
+ }
+ case rpMATFXEFFECTBUMPENVMAP:
+ _rpMatFXD3D8AtomicMatFXBumpMapRender(inst, flags, inst->material->texture, matfx->fx[0].b.bumpedTex, matfx->fx[1].e.envTex);
+ break;
+ case rpMATFXEFFECTDUAL:
+ _rpMatFXD3D8AtomicMatFXDualPassRender(inst, flags, inst->material->texture, matfx->fx[0].d.dualTex);
+ break;
+ }
+ }
+ inst++;
+ }
+
+ if (forceBlack) {
+ RwD3D8SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG2);
+ RwD3D8SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
+ }
+}
+
+void
+ReplaceMatFxCallback()
+{
+ RxD3D8AllInOneSetRenderCallBack(
+ RxPipelineFindNodeByName(RpMatFXGetD3D8Pipeline(rpMATFXD3D8ATOMICPIPELINE), RxNodeDefinitionGetD3D8AtomicAllInOne()->name, nil, nil),
+ _rwD3D8AtomicMatFXRenderCallback);
+
+}
+#endif // PS2_MATFX
-#endif
+#endif // !LIBRW
diff --git a/src/rw/RwPS2AlphaTest.cpp b/src/rw/RwPS2AlphaTest.cpp
new file mode 100644
index 00000000..c0d68355
--- /dev/null
+++ b/src/rw/RwPS2AlphaTest.cpp
@@ -0,0 +1,247 @@
+#ifndef LIBRW
+
+#define WITHD3D
+#include "common.h"
+#ifdef PS2_ALPHA_TEST
+#include "rwcore.h"
+
+extern "C" {
+RwBool _rwD3D8RenderStateIsVertexAlphaEnable(void);
+RwBool _rwD3D8RenderStateVertexAlphaEnable(RwBool enable);
+RwRaster *_rwD3D8RWGetRasterStage(RwUInt32 stage);
+}
+
+extern bool gPS2alphaTest;
+
+void
+_rxD3D8DualPassRenderCallback(RwResEntry *repEntry, void *object, RwUInt8 type, RwUInt32 flags)
+{
+ RxD3D8ResEntryHeader *resEntryHeader;
+ RxD3D8InstanceData *instancedData;
+ RwInt32 numMeshes;
+ RwBool lighting;
+ RwBool vertexAlphaBlend;
+ RwBool forceBlack;
+ RwUInt32 ditherEnable;
+ RwUInt32 shadeMode;
+ void *lastVertexBuffer;
+
+ /* Get lighting state */
+ RwD3D8GetRenderState(D3DRS_LIGHTING, &lighting);
+
+ forceBlack = FALSE;
+
+ if (lighting) {
+ if (flags & rxGEOMETRY_PRELIT) {
+ /* Emmisive color from the vertex colors */
+ RwD3D8SetRenderState(D3DRS_COLORVERTEX, TRUE);
+ RwD3D8SetRenderState(D3DRS_EMISSIVEMATERIALSOURCE, D3DMCS_COLOR1);
+ } else {
+ /* Emmisive color from material, set to black in the submit node */
+ RwD3D8SetRenderState(D3DRS_COLORVERTEX, FALSE);
+ RwD3D8SetRenderState(D3DRS_EMISSIVEMATERIALSOURCE, D3DMCS_MATERIAL);
+ }
+ } else {
+ if ((flags & rxGEOMETRY_PRELIT) == 0) {
+ forceBlack = TRUE;
+
+ RwD3D8GetRenderState(D3DRS_DITHERENABLE, &ditherEnable);
+ RwD3D8GetRenderState(D3DRS_SHADEMODE, &shadeMode);
+
+ RwD3D8SetRenderState(D3DRS_TEXTUREFACTOR, 0xff000000);
+ RwD3D8SetRenderState(D3DRS_DITHERENABLE, FALSE);
+ RwD3D8SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT);
+ }
+ }
+
+ /* Enable clipping */
+ if (type == rpATOMIC) {
+ RpAtomic *atomic;
+ RwCamera *cam;
+
+ atomic = (RpAtomic *)object;
+
+ cam = RwCameraGetCurrentCamera();
+ // RWASSERT(cam);
+
+ if (RwD3D8CameraIsSphereFullyInsideFrustum(cam, RpAtomicGetWorldBoundingSphere(atomic))) {
+ RwD3D8SetRenderState(D3DRS_CLIPPING, FALSE);
+ } else {
+ RwD3D8SetRenderState(D3DRS_CLIPPING, TRUE);
+ }
+ } else {
+ RpWorldSector *worldSector;
+ RwCamera *cam;
+
+ worldSector = (RpWorldSector *)object;
+
+ cam = RwCameraGetCurrentCamera();
+ // RWASSERT(cam);
+
+ if (RwD3D8CameraIsBBoxFullyInsideFrustum(cam, RpWorldSectorGetTightBBox(worldSector))) {
+ RwD3D8SetRenderState(D3DRS_CLIPPING, FALSE);
+ } else {
+ RwD3D8SetRenderState(D3DRS_CLIPPING, TRUE);
+ }
+ }
+
+ /* Set texture to NULL if hasn't any texture flags */
+ if ((flags & (rxGEOMETRY_TEXTURED | rpGEOMETRYTEXTURED2)) == 0) {
+ RwD3D8SetTexture(NULL, 0);
+
+ if (forceBlack) {
+ RwD3D8SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG2);
+ RwD3D8SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TFACTOR);
+
+ RwD3D8SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
+ }
+ }
+
+ /* Get vertex alpha Blend state */
+ vertexAlphaBlend = _rwD3D8RenderStateIsVertexAlphaEnable();
+
+ /* Set Last vertex buffer to force the call */
+ lastVertexBuffer = (void *)0xffffffff;
+
+ /* Get the instanced data */
+ resEntryHeader = (RxD3D8ResEntryHeader *)(repEntry + 1);
+ instancedData = (RxD3D8InstanceData *)(resEntryHeader + 1);
+
+ /*
+ * Data shared between meshes
+ */
+
+ /*
+ * Set the Default Pixel shader
+ */
+ RwD3D8SetPixelShader(0);
+
+ /*
+ * Vertex shader
+ */
+ RwD3D8SetVertexShader(instancedData->vertexShader);
+
+ /* Get the number of meshes */
+ numMeshes = resEntryHeader->numMeshes;
+ while (numMeshes--) {
+ // RWASSERT(instancedData->material != NULL);
+
+ if ((flags & (rxGEOMETRY_TEXTURED | rpGEOMETRYTEXTURED2))) {
+ RwD3D8SetTexture(instancedData->material->texture, 0);
+
+ if (forceBlack) {
+ /* Only change the colorop, we need to use the texture alpha channel */
+ RwD3D8SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG2);
+ RwD3D8SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TFACTOR);
+ }
+ }
+
+ if (instancedData->vertexAlpha || (0xFF != instancedData->material->color.alpha)) {
+ if (!vertexAlphaBlend) {
+ vertexAlphaBlend = TRUE;
+
+ _rwD3D8RenderStateVertexAlphaEnable(TRUE);
+ }
+ } else {
+ if (vertexAlphaBlend) {
+ vertexAlphaBlend = FALSE;
+
+ _rwD3D8RenderStateVertexAlphaEnable(FALSE);
+ }
+ }
+
+ if (lighting) {
+ if (instancedData->vertexAlpha) {
+ RwD3D8SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1);
+ } else {
+ RwD3D8SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_MATERIAL);
+ }
+
+ RwD3D8SetSurfaceProperties(&instancedData->material->color, &instancedData->material->surfaceProps, (flags & rxGEOMETRY_MODULATE));
+ }
+
+ /*
+ * Render
+ */
+
+ /* Set the stream source */
+ if (lastVertexBuffer != instancedData->vertexBuffer) {
+ RwD3D8SetStreamSource(0, instancedData->vertexBuffer, instancedData->stride);
+
+ lastVertexBuffer = instancedData->vertexBuffer;
+ }
+ if (!gPS2alphaTest) {
+ /* Set the Index buffer */
+ if (instancedData->indexBuffer != NULL) {
+ RwD3D8SetIndices(instancedData->indexBuffer, instancedData->baseIndex);
+
+ /* Draw the indexed primitive */
+ RwD3D8DrawIndexedPrimitive((D3DPRIMITIVETYPE)instancedData->primType, 0, instancedData->numVertices, 0, instancedData->numIndices);
+ } else {
+ RwD3D8DrawPrimitive((D3DPRIMITIVETYPE)instancedData->primType, instancedData->baseIndex, instancedData->numVertices);
+ }
+ } else {
+ RwD3D8SetIndices(instancedData->indexBuffer, instancedData->baseIndex);
+
+ int hasAlpha, alphafunc, alpharef, zwrite;
+ RwD3D8GetRenderState(D3DRS_ALPHABLENDENABLE, &hasAlpha);
+ RwD3D8GetRenderState(D3DRS_ZWRITEENABLE, &zwrite);
+ if (hasAlpha && zwrite) {
+ RwD3D8GetRenderState(D3DRS_ALPHAFUNC, &alphafunc);
+ RwD3D8GetRenderState(D3DRS_ALPHAREF, &alpharef);
+
+ RwD3D8SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
+ RwD3D8SetRenderState(D3DRS_ALPHAREF, 128);
+
+ if (instancedData->indexBuffer)
+ RwD3D8DrawIndexedPrimitive(instancedData->primType, 0, instancedData->numVertices, 0, instancedData->numIndices);
+ else
+ RwD3D8DrawPrimitive(instancedData->primType, instancedData->baseIndex, instancedData->numVertices);
+
+ RwD3D8SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_LESS);
+ RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
+
+ if (instancedData->indexBuffer)
+ RwD3D8DrawIndexedPrimitive(instancedData->primType, 0, instancedData->numVertices, 0, instancedData->numIndices);
+ else
+ RwD3D8DrawPrimitive(instancedData->primType, instancedData->baseIndex, instancedData->numVertices);
+
+ RwD3D8SetRenderState(D3DRS_ALPHAFUNC, alphafunc);
+ RwD3D8SetRenderState(D3DRS_ALPHAREF, alpharef);
+ RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)TRUE);
+ } else {
+ if (instancedData->indexBuffer)
+ RwD3D8DrawIndexedPrimitive(instancedData->primType, 0, instancedData->numVertices, 0, instancedData->numIndices);
+ else
+ RwD3D8DrawPrimitive(instancedData->primType, instancedData->baseIndex, instancedData->numVertices);
+ }
+ }
+
+ /* Move onto the next instancedData */
+ instancedData++;
+ }
+
+ if (forceBlack) {
+ RwD3D8SetRenderState(D3DRS_DITHERENABLE, ditherEnable);
+ RwD3D8SetRenderState(D3DRS_SHADEMODE, shadeMode);
+
+ if (_rwD3D8RWGetRasterStage(0)) {
+ RwD3D8SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
+ RwD3D8SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
+ } else {
+ RwD3D8SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG2);
+ RwD3D8SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
+ }
+ }
+}
+
+void
+ReplaceAtomicPipeCallback()
+{
+ RxD3D8AllInOneSetRenderCallBack(RxPipelineFindNodeByName(RXPIPELINEGLOBAL(platformAtomicPipeline), RxNodeDefinitionGetD3D8AtomicAllInOne()->name, nil, nil),
+ _rxD3D8DualPassRenderCallback);
+}
+
+#endif // PS2_ALPHA_TEST
+
+#endif // !LIBRW \ No newline at end of file
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index 22edcb68..f6a9c3b5 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -797,12 +797,12 @@ CVisibilityPlugins::FrameCopyConstructor(void *dst, const void *src, int32, int3
}
void
-CVisibilityPlugins::SetFrameHierarchyId(RwFrame *frame, int32 id)
+CVisibilityPlugins::SetFrameHierarchyId(RwFrame *frame, uintptr id)
{
FRAMEEXT(frame)->id = id;
}
-int32
+uintptr
CVisibilityPlugins::GetFrameHierarchyId(RwFrame *frame)
{
return FRAMEEXT(frame)->id;
diff --git a/src/rw/VisibilityPlugins.h b/src/rw/VisibilityPlugins.h
index b367d7ee..dd02f2e1 100644
--- a/src/rw/VisibilityPlugins.h
+++ b/src/rw/VisibilityPlugins.h
@@ -103,10 +103,10 @@ public:
struct FrameExt
{
// BUG: this is abused to hold a pointer by SetClumpModelInfo
- int32 id;
+ uintptr id;
};
- static void SetFrameHierarchyId(RwFrame *frame, int32 id);
- static int32 GetFrameHierarchyId(RwFrame *frame);
+ static void SetFrameHierarchyId(RwFrame *frame, uintptr id);
+ static uintptr GetFrameHierarchyId(RwFrame *frame);
static void *FrameConstructor(void *object, int32 offset, int32 len);
static void *FrameDestructor(void *object, int32 offset, int32 len);
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index eff0f2ff..1e2d5da7 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -489,7 +489,7 @@ CheckDataNotCorrupt(int32 slot, char *name)
char filename[100];
int32 blocknum = 0;
- eLevelName level = LEVEL_NONE;
+ eLevelName level = LEVEL_GENERIC;
CheckSum = 0;
uint32 bytes_processed = 0;
sprintf(filename, "%s%i%s", DefaultPCSaveFileName, slot + 1, ".b");
@@ -562,14 +562,17 @@ RestoreForStartLoad()
ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().x);
ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().y);
ReadDataFromBufferPointer(_buf, TheCamera.GetMatrix().GetPosition().z);
+#ifndef NO_ISLAND_LOADING
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
+#endif
CCollision::SortOutCollisionAfterLoad();
+#ifndef NO_ISLAND_LOADING
CStreaming::RequestBigBuildings(CGame::currLevel);
CStreaming::LoadAllRequestedModels(false);
CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel);
CGame::TidyUpMemory(true, false);
-
+#endif
if (CloseFile(file)) {
return true;
} else {
diff --git a/src/skel/crossplatform.cpp b/src/skel/crossplatform.cpp
index 40f4f053..6188992d 100644
--- a/src/skel/crossplatform.cpp
+++ b/src/skel/crossplatform.cpp
@@ -87,7 +87,7 @@ void FileTimeToSystemTime(time_t* writeTime, SYSTEMTIME* out) {
// Funcs/features from Windows that we need on other platforms
#ifndef _WIN32
char *strupr(char *s) {
- char* tmp = s;
+ char* tmp = s;
for (;*tmp;++tmp) {
*tmp = toupper((unsigned char) *tmp);
@@ -96,7 +96,7 @@ char *strupr(char *s) {
return s;
}
char *strlwr(char *s) {
- char* tmp = s;
+ char* tmp = s;
for (;*tmp;++tmp) {
*tmp = tolower((unsigned char) *tmp);
@@ -116,86 +116,117 @@ char *trim(char *s) {
return s;
}
+FILE* _fcaseopen(char const* filename, char const* mode)
+{
+ FILE* result;
+ char* real = casepath(filename);
+ if (!real)
+ result = fopen(filename, mode);
+ else {
+ result = fopen(real, mode);
+ free(real);
+ }
+ return result;
+}
+
// Case-insensitivity on linux (from https://github.com/OneSadCookie/fcaseopen)
-// r must have strlen(path) + 2 bytes
-int casepath(char const *path, char *r)
+// Returned string should freed manually (if exists)
+char* casepath(char const* path, bool checkPathFirst)
{
+ if (checkPathFirst && access(path, F_OK) != -1) {
+ // File path is correct
+ return nil;
+ }
+
size_t l = strlen(path);
- char *p = (char*)alloca(l + 1);
+ char* p = (char*)alloca(l + 1);
+ char* out = (char*)malloc(l + 3); // for extra ./
strcpy(p, path);
- // my addon: change \'s with /
- char *nextBs;
- while(nextBs = strstr(p, "\\")){
- *nextBs = '/';
- }
-
- // my addon: linux doesn't handle filenames with spaces at the end nicely
- p = trim(p);
+ // my addon: linux doesn't handle filenames with spaces at the end nicely
+ p = trim(p);
size_t rl = 0;
-
- DIR *d;
- if (p[0] == '/')
+
+ DIR* d;
+ if (p[0] == '/' || p[0] == '\\')
{
d = opendir("/");
- p = p + 1;
}
else
{
d = opendir(".");
- r[0] = '.';
- r[1] = 0;
+ out[0] = '.';
+ out[1] = 0;
rl = 1;
}
-
- int last = 0;
- char *c = strsep(&p, "/");
- while (c)
+
+ bool cantProceed = false; // just convert slashes in what's left in string, not case sensitivity
+ bool mayBeTrailingSlash = false;
+ char* c;
+ while (c = strsep(&p, "/\\"))
{
- if (!d)
+ // May be trailing slash(allow), slash at the start(avoid), or multiple slashes(avoid)
+ if (*c == '\0')
{
- return 0;
+ mayBeTrailingSlash = true;
+ continue;
+ } else {
+ mayBeTrailingSlash = false;
}
-
- if (last)
+
+ out[rl] = '/';
+ rl += 1;
+ out[rl] = 0;
+
+ if (cantProceed)
{
- closedir(d);
- return 0;
+ strcpy(out + rl, c);
+ rl += strlen(c);
+ continue;
}
-
- r[rl] = '/';
- rl += 1;
- r[rl] = 0;
-
- struct dirent *e = readdir(d);
- while (e)
+
+ struct dirent* e;
+ while (e = readdir(d))
{
if (strcasecmp(c, e->d_name) == 0)
{
- strcpy(r + rl, e->d_name);
- rl += strlen(e->d_name);
+ strcpy(out + rl, e->d_name);
+ int reportedLen = (int)strlen(e->d_name);
+ rl += reportedLen;
+ assert(reportedLen == strlen(c) && "casepath: This is not good at all");
closedir(d);
- d = opendir(r);
-
+ d = opendir(out);
+
+ // Either it wasn't a folder, or permission error, I/O error etc.
+ if (!d) {
+ cantProceed = true;
+ }
+
break;
}
-
- e = readdir(d);
}
-
+
if (!e)
{
- strcpy(r + rl, c);
+ printf("casepath couldn't find dir/file \"%s\", full path was %s\n", c, path);
+ // No match, add original name and continue converting further slashes.
+ strcpy(out + rl, c);
rl += strlen(c);
- last = 1;
+ cantProceed = true;
}
-
- c = strsep(&p, "/");
}
-
+
if (d) closedir(d);
- return 1;
+ if (mayBeTrailingSlash) {
+ out[rl] = '/'; rl += 1;
+ out[rl] = '\0';
+ }
+
+ if (rl > l + 2) {
+ printf("\n\ncasepath: Corrected path length is longer then original+2:\n\tOriginal: %s (%d chars)\n\tCorrected: %s (%d chars)\n\n", path, l, out, rl);
+ }
+ return out;
}
#endif
diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h
index a21877c1..69600385 100644
--- a/src/skel/crossplatform.h
+++ b/src/skel/crossplatform.h
@@ -3,19 +3,30 @@
// This is the common include for platform/renderer specific skeletons(glfw.cpp, win.cpp etc.) and using cross platform things (like Windows directories wrapper, platform specific global arrays etc.)
// Functions that's different on glfw and win but have same signature, should be located on platform.h.
+enum eWinVersion
+{
+ OS_WIN95 = 0,
+ OS_WIN98,
+ OS_WINNT,
+ OS_WIN2000,
+ OS_WINXP,
+};
+
#ifdef _WIN32
-// This only has <windef.h> as Win header.
+
+// As long as WITHWINDOWS isn't defined / <Windows.h> isn't included, we only need type definitions so let's include <IntSafe.h>.
+// NOTE: It's perfectly fine to include <Windows.h> here, but it can increase build size and time in *some* conditions, and maybe substantially in future if we'll use crossplatform.h more.
+#ifndef _INC_WINDOWS
+ #include <IntSafe.h>
+#endif
+#if defined RW_D3D9 || defined RWLIBS
#include "win.h"
+#endif
extern DWORD _dwOperatingSystemVersion;
+#define fcaseopen fopen
#else
char *strupr(char *str);
char *strlwr(char *str);
-enum {
- OS_WIN98,
- OS_WIN2000,
- OS_WINNT,
- OS_WINXP,
-};
enum {
LANG_OTHER,
@@ -32,7 +43,9 @@ enum {
};
extern long _dwOperatingSystemVersion;
-int casepath(char const *path, char *r);
+char *casepath(char const *path, bool checkPathFirst = true);
+FILE *_fcaseopen(char const *filename, char const *mode);
+#define fcaseopen _fcaseopen
#endif
#ifdef RW_GL3
@@ -42,6 +55,7 @@ typedef struct
RwBool fullScreen;
RwV2d lastMousePos;
double mouseWheel; // glfw doesn't cache it
+ bool cursorIsInWindow;
RwInt8 joy1id;
RwInt8 joy2id;
}
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index 0728f6c2..a1170c61 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -16,7 +16,6 @@
#include "platform.h"
#include "crossplatform.h"
-#include "patcher.h"
#include "main.h"
#include "FileMgr.h"
#include "Text.h"
@@ -64,11 +63,7 @@ static psGlobalType PsGlobal;
#undef MAKEPOINTS
#define MAKEPOINTS(l) (*((POINTS /*FAR*/ *)&(l)))
-#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
-#define JIF(x) if (FAILED(hr=(x))) \
- {debug(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return;}
-
-unsigned long _dwMemAvailPhys;
+size_t _dwMemAvailPhys;
RwUInt32 gGameState;
#ifdef _WIN32
@@ -283,6 +278,7 @@ psInitialize(void)
RsGlobal.ps = &PsGlobal;
PsGlobal.fullScreen = FALSE;
+ PsGlobal.cursorIsInWindow = TRUE;
PsGlobal.joy1id = -1;
PsGlobal.joy2id = -1;
@@ -791,6 +787,7 @@ void keypressCB(GLFWwindow* window, int key, int scancode, int action, int mods)
void resizeCB(GLFWwindow* window, int width, int height);
void scrollCB(GLFWwindow* window, double xoffset, double yoffset);
void cursorCB(GLFWwindow* window, double xpos, double ypos);
+void cursorEnterCB(GLFWwindow* window, int entered);
void joysChangeCB(int jid, int event);
bool IsThisJoystickBlacklisted(int i)
@@ -826,9 +823,10 @@ void _InputInitialiseJoys()
}
}
-void _InputInitialiseMouse()
+long _InputInitialiseMouse()
{
glfwSetInputMode(PSGLOBAL(window), GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
+ return 0;
}
void psPostRWinit(void)
@@ -840,6 +838,7 @@ void psPostRWinit(void)
glfwSetWindowSizeCallback(PSGLOBAL(window), resizeCB);
glfwSetScrollCallback(PSGLOBAL(window), scrollCB);
glfwSetCursorPosCallback(PSGLOBAL(window), cursorCB);
+ glfwSetCursorEnterCallback(PSGLOBAL(window), cursorEnterCB);
glfwSetJoystickCallback(joysChangeCB);
_InputInitialiseJoys();
@@ -1345,13 +1344,18 @@ _InputTranslateShiftKeyUpDown(RsKeyCodes *rs) {
RsKeyboardEventHandler(rshiftStatus ? rsKEYDOWN : rsKEYUP, &(*rs = rsRSHIFT));
}
-// TODO this only works in frontend(and luckily only frontend use this), maybe because of glfw knows that mouse pos is > 32000 in game??
+// TODO this only works in frontend(and luckily only frontend use this). Fun fact: if I get pos manually in game, glfw reports that it's > 32000
void
cursorCB(GLFWwindow* window, double xpos, double ypos) {
FrontEndMenuManager.m_nMouseTempPosX = xpos;
FrontEndMenuManager.m_nMouseTempPosY = ypos;
}
+void
+cursorEnterCB(GLFWwindow* window, int entered) {
+ PSGLOBAL(cursorIsInWindow) = !!entered;
+}
+
/*
*****************************************************************************
*/
@@ -1366,6 +1370,15 @@ WinMain(HINSTANCE instance,
RwInt32 argc;
RwChar** argv;
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
+
+#if 0
+ // TODO: make this an option somewhere
+ AllocConsole();
+ freopen("CONIN$", "r", stdin);
+ freopen("CONOUT$", "w", stdout);
+ freopen("CONOUT$", "w", stderr);
+#endif
+
#else
int
main(int argc, char *argv[])
@@ -1373,7 +1386,6 @@ main(int argc, char *argv[])
#endif
RwV2d pos;
RwInt32 i;
-// StaticPatcher::Apply();
#ifndef _WIN32
struct sigaction act;
diff --git a/src/skel/platform.h b/src/skel/platform.h
index cbb1be28..0f314b9d 100644
--- a/src/skel/platform.h
+++ b/src/skel/platform.h
@@ -1,6 +1,8 @@
#ifndef PLATFORM_H
#define PLATFORM_H
+// Functions that's different on glfw/win etc. but have same signature (but if a function only used in win.cpp you can keep in win.h)
+
#include "rwcore.h"
#include "skeleton.h"
@@ -35,6 +37,8 @@ extern RwBool psInstallFileSystem(void);
extern RwBool psNativeTextureSupport(void);
extern void _InputTranslateShiftKeyUpDown(RsKeyCodes* rs);
+extern long _InputInitialiseMouse(); // returns HRESULT on Windows actually
+extern void _InputInitialiseJoys();
extern void HandleExit();
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 484c6fe8..5c5c7ece 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -19,7 +19,12 @@
#pragma warning( push )
#pragma warning( disable : 4005)
+
+#ifdef USE_D3D9
+#include <d3d9.h>
+#else
#include <d3d8.h>
+#endif
#include <ddraw.h>
#include <dinput.h>
#include <DShow.h>
@@ -27,7 +32,9 @@
#define WM_GRAPHNOTIFY WM_USER+13
+#ifndef USE_D3D9
#pragma comment( lib, "d3d8.lib" )
+#endif
#pragma comment( lib, "ddraw.lib" )
#pragma comment( lib, "Winmm.lib" )
#pragma comment( lib, "dxguid.lib" )
@@ -76,7 +83,6 @@ static psGlobalType PsGlobal;
{debug(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return;}
#include "common.h"
-#include "patcher.h"
#include "main.h"
#include "FileMgr.h"
#include "Text.h"
@@ -103,7 +109,7 @@ IMediaSeeking *pMS = nil;
DWORD dwDXVersion;
SIZE_T _dwMemTotalPhys;
-SIZE_T _dwMemAvailPhys;
+size_t _dwMemAvailPhys;
SIZE_T _dwMemTotalVirtual;
SIZE_T _dwMemAvailVirtual;
DWORD _dwMemTotalVideo;
@@ -306,34 +312,6 @@ psNativeTextureSupport(void)
/*
*****************************************************************************
*/
-static BOOL
-InitApplication(HANDLE instance)
-{
- /*
- * Perform any necessary MS Windows application initialization. Basically,
- * this means registering the window class for this application.
- */
-
- WNDCLASS windowClass;
-
- windowClass.style = CS_BYTEALIGNWINDOW;
- windowClass.lpfnWndProc = (WNDPROC) MainWndProc;
- windowClass.cbClsExtra = 0;
- windowClass.cbWndExtra = 0;
- windowClass.hInstance = (HINSTANCE)instance;
- windowClass.hIcon = nil;
- windowClass.hCursor = LoadCursor(nil, IDC_ARROW);
- windowClass.hbrBackground = nil;
- windowClass.lpszMenuName = NULL;
- windowClass.lpszClassName = AppClassName;
-
- return RegisterClass(&windowClass);
-}
-
-
-/*
- *****************************************************************************
- */
static HWND
InitInstance(HANDLE instance)
{
@@ -450,6 +428,16 @@ DWORD GetDXVersion()
dwDXVersion = 0x700;
pDD7->Release();
+#ifdef USE_D3D9
+ HINSTANCE hD3D9DLL = LoadLibrary("D3D9.DLL");
+ if (hD3D9DLL != nil) {
+ FreeLibrary(hDDrawDLL);
+ FreeLibrary(hD3D9DLL);
+
+ dwDXVersion = 0x900;
+ return dwDXVersion;
+ }
+#endif
//-------------------------------------------------------------------------
// DirectX 8.0 Checks
@@ -499,6 +487,7 @@ DWORD GetDXVersion()
/*
*****************************************************************************
*/
+#ifndef _WIN64
static char cpuvendor[16] = "UnknownVendr";
__declspec(naked) const char * _psGetCpuVendr()
{
@@ -572,6 +561,7 @@ void _psPrintCpuInfo()
if ( FeaturesEx & 0x80000000 )
debug("with 3DNow");
}
+#endif
/*
*****************************************************************************
@@ -647,9 +637,9 @@ psInitialize(void)
gGameState = GS_START_UP;
TRACE("gGameState = GS_START_UP");
-
+#ifndef _WIN64
_psPrintCpuInfo();
-
+#endif
OSVERSIONINFO verInfo;
verInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
@@ -1277,6 +1267,34 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
/*
*****************************************************************************
*/
+static BOOL
+InitApplication(HANDLE instance)
+{
+ /*
+ * Perform any necessary MS Windows application initialization. Basically,
+ * this means registering the window class for this application.
+ */
+
+ WNDCLASS windowClass;
+
+ windowClass.style = CS_BYTEALIGNWINDOW;
+ windowClass.lpfnWndProc = (WNDPROC)MainWndProc;
+ windowClass.cbClsExtra = 0;
+ windowClass.cbWndExtra = 0;
+ windowClass.hInstance = (HINSTANCE)instance;
+ windowClass.hIcon = nil;
+ windowClass.hCursor = LoadCursor(nil, IDC_ARROW);
+ windowClass.hbrBackground = nil;
+ windowClass.lpszMenuName = NULL;
+ windowClass.lpszClassName = AppClassName;
+
+ return RegisterClass(&windowClass);
+}
+
+
+/*
+ *****************************************************************************
+ */
RwBool IsForegroundApp()
{
@@ -1285,8 +1303,11 @@ RwBool IsForegroundApp()
UINT GetBestRefreshRate(UINT width, UINT height, UINT depth)
{
+#ifdef USE_D3D9
+ LPDIRECT3D9 d3d = Direct3DCreate9(D3D_SDK_VERSION);
+#else
LPDIRECT3D8 d3d = Direct3DCreate8(D3D_SDK_VERSION);
-
+#endif
ASSERT(d3d != nil);
UINT refreshRate = INT_MAX;
@@ -1299,14 +1320,21 @@ UINT GetBestRefreshRate(UINT width, UINT height, UINT depth)
else
format = D3DFMT_R5G6B5;
+#ifdef USE_D3D9
+ UINT modeCount = d3d->GetAdapterModeCount(GcurSel, format);
+#else
UINT modeCount = d3d->GetAdapterModeCount(GcurSel);
-
+#endif
+
for ( UINT i = 0; i < modeCount; i++ )
{
D3DDISPLAYMODE mode;
+#ifdef USE_D3D9
+ d3d->EnumAdapterModes(GcurSel, format, i, &mode);
+#else
d3d->EnumAdapterModes(GcurSel, i, &mode);
-
+#endif
if ( mode.Width == width && mode.Height == height && mode.Format == format )
{
if ( mode.RefreshRate == 0 )
@@ -1600,7 +1628,7 @@ CommandLineToArgv(RwChar *cmdLine, RwInt32 *argCount)
RwInt32 i, len;
RwChar *res, *str, **aptr;
- len = strlen(cmdLine);
+ len = (int)strlen(cmdLine);
/*
* Count the number of arguments...
@@ -1688,11 +1716,11 @@ void InitialiseLanguage()
{
WORD primUserLCID = PRIMARYLANGID(GetSystemDefaultLCID());
WORD primSystemLCID = PRIMARYLANGID(GetUserDefaultLCID());
- WORD primLayout = PRIMARYLANGID((DWORD)GetKeyboardLayout(0));
+ WORD primLayout = PRIMARYLANGID((DWORD_PTR)GetKeyboardLayout(0));
WORD subUserLCID = SUBLANGID(GetSystemDefaultLCID());
WORD subSystemLCID = SUBLANGID(GetUserDefaultLCID());
- WORD subLayout = SUBLANGID((DWORD)GetKeyboardLayout(0));
+ WORD subLayout = SUBLANGID((DWORD_PTR)GetKeyboardLayout(0));
if ( primUserLCID == LANG_GERMAN
|| primSystemLCID == LANG_GERMAN
@@ -1926,16 +1954,15 @@ WinMain(HINSTANCE instance,
RwV2d pos;
RwInt32 argc, i;
RwChar **argv;
- StaticPatcher::Apply();
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
-/*
+#if 0
// TODO: make this an option somewhere
AllocConsole();
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
-*/
+#endif
/*
* Initialize the platform independent data.
@@ -2235,6 +2262,11 @@ WinMain(HINSTANCE instance,
CloseClip();
CoUninitialize();
+#ifdef FIX_BUGS
+ // draw one frame because otherwise we'll end up looking at black screen for a while if vsync is on
+ RsCameraShowRaster(Scene.camera);
+#endif
+
#ifdef PS2_MENU
extern char version_name[64];
if ( CGame::frenchGame || CGame::germanGame )
diff --git a/src/skel/win/win.h b/src/skel/win/win.h
index 444e0760..be840898 100644
--- a/src/skel/win/win.h
+++ b/src/skel/win/win.h
@@ -1,5 +1,5 @@
-// DON'T include directly. crossplatform.h includes this if you're on Windows.
+// DON'T include directly. crossplatform.h includes this if you're using D3D9 backend(win.cpp).
#if (!defined(_PLATFORM_WIN_H))
#define _PLATFORM_WIN_H
@@ -8,21 +8,6 @@
#define RSREGSETBREAKALLOC(_name) /* No op */
#endif /* (!defined(RSREGSETBREAKALLOC)) */
-#ifndef _INC_WINDOWS
-#define _X86_
-#include <windef.h>
-#endif
-
-enum eWinVersion
-{
- OS_WIN95 = 0,
- OS_WIN98,
- OS_WINNT,
- OS_WIN2000,
- OS_WINXP,
-};
-
-
#ifdef __DINPUT_INCLUDED__
/* platform specfic global data */
typedef struct
@@ -84,13 +69,8 @@ extern "C"
#endif /* __cplusplus */
#ifdef __DINPUT_INCLUDED__
-extern LRESULT CALLBACK
-MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam);
-
HRESULT _InputInitialise();
-HRESULT _InputInitialiseMouse();
HRESULT CapturePad(RwInt32 padID);
-void _InputInitialiseJoys();
void _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num);
HRESULT _InputAddJoys();
HRESULT _InputGetMouseState(DIMOUSESTATE2 *state);
diff --git a/src/text/Text.cpp b/src/text/Text.cpp
index c9e22a84..1f6cda89 100644
--- a/src/text/Text.cpp
+++ b/src/text/Text.cpp
@@ -23,8 +23,8 @@ CText::Load(void)
{
uint8 *filedata;
char filename[32], type[4];
- int length;
- int offset, sectlen;
+ intptr_t offset, length;
+ size_t sectlen;
Unload();
filedata = new uint8[0x40000];
@@ -176,12 +176,13 @@ CText::UpperCase(wchar *s)
void
-CKeyArray::Load(uint32 length, uint8 *data, int *offset)
+CKeyArray::Load(size_t length, uint8 *data, intptr_t *offset)
{
- uint32 i;
+ size_t i;
uint8 *rawbytes;
- numEntries = length / sizeof(CKeyEntry);
+ // You can make numEntries size_t if you want to exceed 32-bit boundaries, everything else should be ready.
+ numEntries = (int)(length / sizeof(CKeyEntry));
entries = new CKeyEntry[numEntries];
rawbytes = (uint8*)entries;
@@ -255,12 +256,13 @@ CKeyArray::Search(const char *key)
void
-CData::Load(uint32 length, uint8 *data, int *offset)
+CData::Load(size_t length, uint8 *data, intptr_t *offset)
{
- uint32 i;
+ size_t i;
uint8 *rawbytes;
- numChars = length / sizeof(wchar);
+ // You can make numChars size_t if you want to exceed 32-bit boundaries, everything else should be ready.
+ numChars = (int)(length / sizeof(wchar));
chars = new wchar[numChars];
rawbytes = (uint8*)chars;
diff --git a/src/text/Text.h b/src/text/Text.h
index bd6544d2..4be9b6e6 100644
--- a/src/text/Text.h
+++ b/src/text/Text.h
@@ -26,11 +26,11 @@ class CKeyArray
{
public:
CKeyEntry *entries;
- int numEntries;
+ int numEntries; // You can make this size_t if you want to exceed 32-bit boundaries, everything else should be ready.
CKeyArray(void) : entries(nil), numEntries(0) {}
~CKeyArray(void) { Unload(); }
- void Load(uint32 length, uint8 *data, int *offset);
+ void Load(size_t length, uint8 *data, intptr_t *offset);
void Unload(void);
void Update(wchar *chars);
CKeyEntry *BinarySearch(const char *key, CKeyEntry *entries, int16 low, int16 high);
@@ -45,11 +45,11 @@ class CData
{
public:
wchar *chars;
- int numChars;
+ int numChars; // You can make this size_t if you want to exceed 32-bit boundaries, everything else should be ready.
CData(void) : chars(nil), numChars(0) {}
~CData(void) { Unload(); }
- void Load(uint32 length, uint8 *data, int *offset);
+ void Load(size_t length, uint8 *data, intptr_t *offset);
void Unload(void);
};
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index eb1bad97..d2fedbd5 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -230,7 +230,7 @@ CAutomobile::ProcessControl(void)
bWarnedPeds = false;
// skip if the collision isn't for the current level
- if(colModel->level > LEVEL_NONE && colModel->level != CCollision::ms_collisionInMemory)
+ if(colModel->level > LEVEL_GENERIC && colModel->level != CCollision::ms_collisionInMemory)
return;
// Improve grip of vehicles in certain cases
@@ -283,7 +283,7 @@ CAutomobile::ProcessControl(void)
if(!pDriver->IsPlayer() &&
!(pDriver->m_leader && pDriver->m_leader->bInVehicle) &&
pDriver->CharCreatedBy != MISSION_CHAR)
- pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this);
+ pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, this);
}
}else
bDriverLastFrame = false;
@@ -295,7 +295,7 @@ CAutomobile::ProcessControl(void)
if(!pPassengers[i]->IsPlayer() &&
!(pPassengers[i]->m_leader && pPassengers[i]->m_leader->bInVehicle) &&
pPassengers[i]->CharCreatedBy != MISSION_CHAR)
- pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this);
+ pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_CAR, this);
}
CRubbish::StirUp(this);
@@ -3588,7 +3588,7 @@ CAutomobile::AddWheelDirtAndWater(CColPoint *colpoint, uint32 belowEffectSpeed)
)
{
CParticle::AddParticle(
-#ifdef FIX_BUGS
+#if defined(FIX_BUGS) && !defined(PC_PARTICLE) // looks wrong on PC particles
PARTICLE_WHEEL_WATER,
#else
PARTICLE_WATERSPRAY,
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index d86627de..50117690 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -47,7 +47,7 @@ CBoat::CBoat(int mi, uint8 owner) : CVehicle(owner)
m_fBrake = 0.0f;
m_fSteeringLeftRight = 0.0f;
m_nPadID = 0;
- m_fMovingHiRotation = 0.0f;
+ m_fMovingRotation = 0.0f;
SetModelIndex(mi);
pHandling = mod_HandlingManager.GetHandlingData((eHandlingId)minfo->m_handlingId);
@@ -63,11 +63,11 @@ CBoat::CBoat(int mi, uint8 owner) : CVehicle(owner)
m_fGasPedal = 0.0f;
m_fBrakePedal = 0.0f;
- m_fPropellerZ = 0.25f;
- m_fPropellerY = 0.35f;
- m_waterMoveDrag = CVector(0.7f, 0.998f, 0.999f);
- m_waterTurnDrag = CVector(0.85f, 0.96f, 0.96f);
- _unk2 = false;
+ m_fThrustZ = 0.25f;
+ m_fThrustY = 0.35f;
+ m_vecMoveRes = CVector(0.7f, 0.998f, 0.999f);
+ m_vecTurnRes = CVector(0.85f, 0.96f, 0.96f);
+ m_boat_unused3 = false;
m_fVolumeUnderWater = 7.0f;
m_fPrevVolumeUnderWater = 7.0f;
@@ -79,7 +79,7 @@ CBoat::CBoat(int mi, uint8 owner) : CVehicle(owner)
bIsInWater = true;
- m_phys_unused1 = 0.0f;
+ m_boat_unused2 = 0;
m_bIsAnchored = true;
m_fOrientation = INVALID_ORIENTATION;
bTouchingWater = true;
@@ -109,7 +109,7 @@ CBoat::GetComponentWorldPosition(int32 component, CVector &pos)
void
CBoat::ProcessControl(void)
{
- if(m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory)
+ if(m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
return;
bool onLand = m_fDamageImpulse > 0.0f && m_vecDamageNormal.z > 0.1f;
@@ -290,7 +290,7 @@ CBoat::ProcessControl(void)
}
// Handle boat moving forward
- if(Abs(m_fGasPedal) > 0.05f || m_vecMoveSpeed.Magnitude() > 0.01f){
+ if(Abs(m_fGasPedal) > 0.05f || m_vecMoveSpeed.Magnitude2D() > 0.01f){
if(bBoatInWater)
AddWakePoint(GetPosition());
@@ -299,7 +299,7 @@ CBoat::ProcessControl(void)
steerFactor = 1.0f - DotProduct(m_vecMoveSpeed, GetForward())*0.3f;
if(steerFactor < 0.0f) steerFactor = 0.0f;
- CVector propeller(0.0f, -pHandling->Dimension.y*m_fPropellerY, -pHandling->Dimension.z*m_fPropellerZ);
+ CVector propeller(0.0f, -pHandling->Dimension.y*m_fThrustY, -pHandling->Dimension.z*m_fThrustZ);
propeller = Multiply3x3(GetMatrix(), propeller);
CVector propellerWorld = GetPosition() + propeller;
@@ -396,7 +396,7 @@ CBoat::ProcessControl(void)
}
}else if(!onLand){
float force = 50.0f*DotProduct(m_vecMoveSpeed, GetForward());
- if(force > 10.0f) force = 10.0f;
+ force = Min(force, 10.0f);
CVector propellerForce = propellerDepth * Multiply3x3(GetMatrix(), force*CVector(-steerSin, 0.0f, 0.0f));
ApplyMoveForce(propellerForce * CTimer::GetTimeStep()*0.5f);
ApplyTurnForce(propellerForce * CTimer::GetTimeStep()*0.5f, propeller);
@@ -415,9 +415,9 @@ CBoat::ProcessControl(void)
ApplyWaterResistance();
// No idea what exactly is going on here besides drag in YZ
- float fx = Pow(m_waterTurnDrag.x, CTimer::GetTimeStep());
- float fy = Pow(m_waterTurnDrag.y, CTimer::GetTimeStep());
- float fz = Pow(m_waterTurnDrag.z, CTimer::GetTimeStep());
+ float fx = Pow(m_vecTurnRes.x, CTimer::GetTimeStep());
+ float fy = Pow(m_vecTurnRes.y, CTimer::GetTimeStep());
+ float fz = Pow(m_vecTurnRes.z, CTimer::GetTimeStep());
m_vecTurnSpeed = Multiply3x3(m_vecTurnSpeed, GetMatrix()); // invert - to local space
// TODO: figure this out
float magic = 1.0f/(1000.0f * SQR(m_vecTurnSpeed.x) + 1.0f) * fx;
@@ -525,7 +525,7 @@ CBoat::ProcessControl(void)
// is this some inlined CPlaceable method?
CVector pos = GetPosition();
GetMatrix().RotateZ(m_fOrientation - GetForward().Heading());
- GetMatrix().GetPosition() = pos;
+ GetMatrix().SetTranslateOnly(pos);
}
}
@@ -562,12 +562,12 @@ CBoat::ApplyWaterResistance(void)
{
float fwdSpeed = DotProduct(GetMoveSpeed(), GetForward());
// TODO: figure out how this works
- float magic = (SQR(fwdSpeed) + 0.05f) * (0.001f * SQR(m_fVolumeUnderWater) * m_fMass) + 1.0f;
+ float resistance = 0.001f * SQR(m_fVolumeUnderWater) * m_fMass;
+ float magic = (SQR(fwdSpeed) + 0.05f) * resistance + 1.0f;
magic = Abs(magic);
- // FRAMETIME
- float fx = Pow(m_waterMoveDrag.x/magic, 0.5f*CTimer::GetTimeStep());
- float fy = Pow(m_waterMoveDrag.y/magic, 0.5f*CTimer::GetTimeStep());
- float fz = Pow(m_waterMoveDrag.z/magic, 0.5f*CTimer::GetTimeStep());
+ float fx = Pow(m_vecMoveRes.x/magic, 0.5f*CTimer::GetTimeStep());
+ float fy = Pow(m_vecMoveRes.y/magic, 0.5f*CTimer::GetTimeStep());
+ float fz = Pow(m_vecMoveRes.z/magic, 0.5f*CTimer::GetTimeStep());
m_vecMoveSpeed = Multiply3x3(m_vecMoveSpeed, GetMatrix()); // invert - to local space
m_vecMoveSpeed.x *= fx;
@@ -685,7 +685,7 @@ CBoat::BlowUpCar(CEntity *culprit)
dist.Normalise();
if(GetUp().z > 0.0f)
dist += GetUp();
- obj->GetMatrix().GetPosition() += GetUp();
+ obj->GetMatrix().GetPosition() += dist;
CWorld::Add(obj);
@@ -707,7 +707,7 @@ CBoat::Render()
matrix.Attach(RwFrameGetMatrix(m_aBoatNodes[BOAT_MOVING]));
CVector pos = matrix.GetPosition();
- matrix.SetRotateZ(m_fMovingHiRotation);
+ matrix.SetRotateZ(m_fMovingRotation);
matrix.Translate(pos);
matrix.UpdateRW();
@@ -715,20 +715,20 @@ CBoat::Render()
RpAtomicRender((RpAtomic*)GetFirstObject(m_aBoatNodes[BOAT_MOVING]));
}
}
- m_fMovingHiRotation += 0.05f;
+ m_fMovingRotation += 0.05f;
((CVehicleModelInfo*)CModelInfo::GetModelInfo(GetModelIndex()))->SetVehicleColour(m_currentColour1, m_currentColour2);
if (!CVehicle::bWheelsOnlyCheat)
CEntity::Render();
- RwIm3DVertexSetRGBA(&KeepWaterOutVertices[0], 255, 255, 255, 255);
KeepWaterOutIndices[0] = 0;
- RwIm3DVertexSetRGBA(&KeepWaterOutVertices[1], 255, 255, 255, 255);
KeepWaterOutIndices[1] = 2;
- RwIm3DVertexSetRGBA(&KeepWaterOutVertices[2], 255, 255, 255, 255);
KeepWaterOutIndices[2] = 1;
- RwIm3DVertexSetRGBA(&KeepWaterOutVertices[3], 255, 255, 255, 255);
KeepWaterOutIndices[3] = 1;
KeepWaterOutIndices[4] = 2;
KeepWaterOutIndices[5] = 3;
+ RwIm3DVertexSetRGBA(&KeepWaterOutVertices[0], 255, 255, 255, 255);
+ RwIm3DVertexSetRGBA(&KeepWaterOutVertices[1], 255, 255, 255, 255);
+ RwIm3DVertexSetRGBA(&KeepWaterOutVertices[2], 255, 255, 255, 255);
+ RwIm3DVertexSetRGBA(&KeepWaterOutVertices[3], 255, 255, 255, 255);
switch (GetModelIndex()) {
case MI_SPEEDER:
RwIm3DVertexSetPos(&KeepWaterOutVertices[0], -1.15f, 3.61f, 1.03f);
diff --git a/src/vehicles/Boat.h b/src/vehicles/Boat.h
index 3cc3513d..56aff264 100644
--- a/src/vehicles/Boat.h
+++ b/src/vehicles/Boat.h
@@ -6,33 +6,34 @@ enum eBoatNodes
{
BOAT_MOVING = 1,
BOAT_RUDDER,
- BOAT_WINDSCREEN
+ BOAT_WINDSCREEN,
+ NUM_BOAT_NODES
};
class CBoat : public CVehicle
{
public:
// 0x288
- float m_fPropellerZ;
- float m_fPropellerY;
- CVector m_waterMoveDrag;
- CVector m_waterTurnDrag;
- float m_fMovingHiRotation;
- int32 _unk0;
- RwFrame *m_aBoatNodes[4];
+ float m_fThrustZ;
+ float m_fThrustY;
+ CVector m_vecMoveRes;
+ CVector m_vecTurnRes;
+ float m_fMovingRotation;
+ int32 m_boat_unused1;
+ RwFrame *m_aBoatNodes[NUM_BOAT_NODES];
uint8 bBoatInWater : 1;
uint8 bPropellerInWater : 1;
bool m_bIsAnchored;
float m_fOrientation;
- int32 _unk1;
+ int32 m_boat_unused2;
float m_fDamage;
CEntity *m_pSetOnFireEntity;
- bool _unk2;
+ bool m_boat_unused3;
float m_fAccelerate;
float m_fBrake;
float m_fSteeringLeftRight;
uint8 m_nPadID;
- int32 _unk3;
+ int32 m_boat_unused4;
float m_fVolumeUnderWater;
CVector m_vecBuoyancePoint;
float m_fPrevVolumeUnderWater;
diff --git a/src/vehicles/CarGen.cpp b/src/vehicles/CarGen.cpp
index cb21b918..dd727e2b 100644
--- a/src/vehicles/CarGen.cpp
+++ b/src/vehicles/CarGen.cpp
@@ -28,7 +28,7 @@ void CCarGenerator::SwitchOff()
void CCarGenerator::SwitchOn()
{
- m_nUsesRemaining = -1;
+ m_nUsesRemaining = 255;
m_nTimer = CalcNextGen();
++CTheCarGenerators::CurrentActiveCount;
}
@@ -110,8 +110,13 @@ void CCarGenerator::DoInternalProcessing()
m_nVehicleHandle = CPools::GetVehiclePool()->GetIndex(pCar);
}
}
- if (m_nUsesRemaining < -1) /* I don't think this is a correct comparasion */
+#ifdef FIX_BUGS
+ if (m_nUsesRemaining != 0)
--m_nUsesRemaining;
+#else
+ if (m_nUsesRemaining < -1)
+ --m_nUsesRemaining;
+#endif
m_nTimer = CalcNextGen();
if (m_nUsesRemaining == 0)
--CTheCarGenerators::CurrentActiveCount;
diff --git a/src/vehicles/Floater.cpp b/src/vehicles/Floater.cpp
index 1ae1c5c3..4331090d 100644
--- a/src/vehicles/Floater.cpp
+++ b/src/vehicles/Floater.cpp
@@ -9,10 +9,10 @@
cBuoyancy mod_Buoyancy;
-static float fVolMultiplier = 1.0f;
+float fVolMultiplier = 1.0f;
// amount of boat volume in bounding box
// 1.0-volume is the empty space in the bbox
-static float fBoatVolumeDistribution[9] = {
+float fBoatVolumeDistribution[9] = {
// rear
0.75f, 0.9f, 0.75f,
0.95f, 1.0f, 0.95f,
diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp
index 4966a228..2316cbef 100644
--- a/src/vehicles/Heli.cpp
+++ b/src/vehicles/Heli.cpp
@@ -266,7 +266,9 @@ CHeli::ProcessControl(void)
if(fTargetDist > targetHeight)
m_heliStatus = HELI_STATUS_CHASE_PLAYER;
}
- // fall through, BUG?
+#ifdef FIX_BUGS
+ break;
+#endif
case HELI_STATUS_CHASE_PLAYER:{
float targetHeight;
if(m_heliType == HELI_TYPE_CATALINA)
@@ -457,7 +459,7 @@ CHeli::ProcessControl(void)
else if (searchLightDist < 40.0f)
m_fSearchLightIntensity = 1.0f;
else
- m_fSearchLightIntensity = 1.0f - (40.0f - searchLightDist) / 40.0f;
+ m_fSearchLightIntensity = 1.0f - (40.0f - searchLightDist) / (60.0f-40.0f);
if (m_fSearchLightIntensity < 0.9f || sq(FindPlayerCoors().x - m_fSearchLightX) + sq(FindPlayerCoors().y - m_fSearchLightY) > sq(7.0f))
m_nShootTimer = CTimer::GetTimeInMilliseconds();
@@ -796,11 +798,11 @@ GenerateHeli(bool catalina)
heliPos = CVector(-224.0f, 201.0f, 83.0f);
else{
heliPos = FindPlayerCoors();
- float angle = (float)(CGeneral::GetRandomNumber() & 0xFF)/0xFF * 6.28f;
+ float angle = (float)(CGeneral::GetRandomNumber() & 0xFF)/0x100 * 6.28f;
heliPos.x += 250.0f*Sin(angle);
heliPos.y += 250.0f*Cos(angle);
if(heliPos.x < -2000.0f || heliPos.x > 2000.0f || heliPos.y < -2000.0f || heliPos.y > 2000.0f){
- // directly above player
+ heliPos = FindPlayerCoors();
heliPos.x -= 250.0f*Sin(angle);
heliPos.y -= 250.0f*Cos(angle);
}
@@ -811,6 +813,7 @@ GenerateHeli(bool catalina)
heli->GetMatrix().SetRotateZOnly(DEGTORAD(270.0f)); // game actually uses 3.14 here
heli->SetStatus(STATUS_ABANDONED);
+ heli->bIsLocked = true;
int id = -1;
bool found = false;
@@ -938,7 +941,7 @@ CHeli::UpdateHelis(void)
CatalinaHasBeenShotDown = true;
CStats::HelisDestroyed++;
- CStats::PeopleKilledByOthers += 2;
+ CStats::PeopleKilledByPlayer += 2;
CStats::PedsKilledOfThisType[PEDTYPE_COP] += 2;
CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 250;
pos = CWorld::Players[CWorld::PlayerInFocus].m_pPed->GetPosition();
@@ -956,7 +959,7 @@ CHeli::UpdateHelis(void)
TheCamera.CamShake(0.4f, pHelis[i]->GetPosition().x, pHelis[i]->GetPosition().y, pHelis[i]->GetPosition().z);
- CVector pos = pHelis[i]->GetPosition() - 2.5f*pHelis[i]->GetUp();
+ CVector pos = pHelis[i]->GetPosition() - 2.5f*pHelis[i]->GetForward();
CExplosion::AddExplosion(nil, nil, EXPLOSION_HELI, pos, 0);
}else
pHelis[i]->m_fAngularSpeed *= 1.03f;
@@ -972,7 +975,7 @@ CHeli::UpdateHelis(void)
pHelis[i]->m_heliStatus = HELI_STATUS_FLY_AWAY;
}
- // Remove all helis if in a tunnel
+ // Remove all helis if in a tunnel or under water
if(FindPlayerCoors().z < - 2.0f)
for(i = 0; i < NUM_HELIS; i++)
if(pHelis[i] && pHelis[i]->m_heliStatus != HELI_STATUS_SHOT_DOWN)
@@ -1017,7 +1020,7 @@ CHeli::TestBulletCollision(CVector *line0, CVector *line1, CVector *bulletPos, i
float distToHeli = (pHelis[i]->GetPosition() - *line0).Magnitude();
CVector line = (*line1 - *line0);
float lineLength = line.Magnitude();
- *bulletPos = *line0 + line*Max(1.0f, distToHeli-5.0f);
+ *bulletPos = *line0 + line*Max(1.0f, distToHeli-5.0f)/lineLength;
pHelis[i]->m_nBulletDamage += damage;
diff --git a/src/vehicles/Plane.cpp b/src/vehicles/Plane.cpp
index 3bf385a0..b8a957cf 100644
--- a/src/vehicles/Plane.cpp
+++ b/src/vehicles/Plane.cpp
@@ -83,10 +83,10 @@ CPlane::CPlane(int32 id, uint8 CreatedBy)
SetStatus(STATUS_PLANE);
bIsBIGBuilding = true;
- m_level = LEVEL_NONE;
+ m_level = LEVEL_GENERIC;
#ifdef FIX_BUGS
- m_isFarAway = true;
+ m_isFarAway = false;
#endif
}
@@ -154,7 +154,7 @@ CPlane::ProcessControl(void)
int f = ++nFrameGen & 3;
CParticle::AddParticle(PARTICLE_HELI_DEBRIS, GetMatrix() * CVector(0.0f, 0.0f, 0.0f), dir,
nil, CGeneral::GetRandomNumberInRange(0.1f, 1.0f),
- colors[nFrameGen], rotSpeed, 0, f, 0);
+ colors[nFrameGen&7], rotSpeed, 0, f, 0);
}
}
if(frm >= 40 && frm <= 80 && frm & 1){
@@ -197,17 +197,18 @@ CPlane::ProcessControl(void)
colors[6] = CRGBA(0, 0, 0, 255);
colors[7] = CRGBA(252, 66, 66, 255);
+ CVector dir;
for(i = 0; i < 40; i++){
+ dir.x = CGeneral::GetRandomNumberInRange(-2.0f, 2.0f);
+ dir.y = CGeneral::GetRandomNumberInRange(-2.0f, 2.0f);
+ dir.z = CGeneral::GetRandomNumberInRange(0.0f, 2.0f);
int rotSpeed = CGeneral::GetRandomNumberInRange(30.0f, 20.0f);
if(CGeneral::GetRandomNumber() & 1)
rotSpeed = -rotSpeed;
int f = ++nFrameGen & 3;
- CParticle::AddParticle(PARTICLE_HELI_DEBRIS, GetMatrix() * CVector(0.0f, 0.0f, 0.0f),
- CVector(CGeneral::GetRandomNumberInRange(-2.0f, 2.0f),
- CGeneral::GetRandomNumberInRange(-2.0f, 2.0f),
- CGeneral::GetRandomNumberInRange(0.0f, 2.0f)),
+ CParticle::AddParticle(PARTICLE_HELI_DEBRIS, GetMatrix() * CVector(0.0f, 0.0f, 0.0f), dir,
nil, CGeneral::GetRandomNumberInRange(0.1f, 1.0f),
- colors[nFrameGen], rotSpeed, 0, f, 0);
+ colors[nFrameGen&7], rotSpeed, 0, f, 0);
}
}
if(frm >= 40 && frm <= 60 && frm & 1){
@@ -226,7 +227,7 @@ CPlane::ProcessControl(void)
}
if(frm == 30)
bRenderScorched = true;
- if(frm == 61){
+ if(frm == 62){
TheCamera.SetFadeColour(200, 200, 200);
TheCamera.Fade(0.0f, FADE_OUT);
TheCamera.ProcessFade();
@@ -363,7 +364,7 @@ CPlane::ProcessControl(void)
CVector posFront2 = (1.0f - f)*pPathNodes[curPathNodeFront2].p + f*pPathNodes[nextPathNodeFront2].p;
// Now set matrix
- GetMatrix().GetPosition() = (posRear + posFront) / 2.0f;
+ GetMatrix().SetTranslateOnly((posRear + posFront) / 2.0f);
GetMatrix().GetPosition().z += 4.3f;
CVector fwd = posFront - posRear;
fwd.Normalise();
@@ -388,7 +389,7 @@ CPlane::ProcessControl(void)
m_fSpeed = PlanePathSpeed[m_nPlaneId]/60.0f;
m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
- m_isFarAway = !((posFront - TheCamera.GetPosition()).Magnitude2D() < sq(300.0f));
+ m_isFarAway = !((posFront - TheCamera.GetPosition()).MagnitudeSqr2D() < sq(300.0f));
}else{
float planePathPosition;
float totalLengthOfFlightPath;
@@ -484,7 +485,7 @@ CPlane::ProcessControl(void)
f = (pathPositionFront - pathNodes[curPathNodeFront].t)/dist;
CVector posFront = (1.0f - f)*pathNodes[curPathNodeFront].p + f*pathNodes[nextPathNodeFront].p;
- // And for another point 60 units in front of the plane, used to calculate roll
+ // And for another point 30 units in front of the plane, used to calculate roll
float pathPositionFront2 = pathPositionFront + 30.0f;
if(pathPositionFront2 > totalLengthOfFlightPath)
pathPositionFront2 -= totalLengthOfFlightPath;
@@ -515,7 +516,7 @@ CPlane::ProcessControl(void)
CVector posFront2 = (1.0f - f)*pathNodes[curPathNodeFront2].p + f*pathNodes[nextPathNodeFront2].p;
// Now set matrix
- GetMatrix().GetPosition() = (posRear + posFront) / 2.0f;
+ GetMatrix().SetTranslateOnly((posRear + posFront) / 2.0f);
GetMatrix().GetPosition().z += 1.0f;
CVector fwd = posFront - posRear;
fwd.Normalise();
@@ -535,7 +536,7 @@ CPlane::ProcessControl(void)
m_fSpeed = planePathSpeed/60.0f;
m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
- m_isFarAway = !((posFront - TheCamera.GetPosition()).Magnitude2D() < sq(300.0f));
+ m_isFarAway = !((posFront - TheCamera.GetPosition()).MagnitudeSqr2D() < sq(300.0f));
}
}
@@ -697,7 +698,7 @@ CPlane::InitPlanes(void)
aPlaneLineBits[1].time = time;
aPlaneLineBits[1].position = position;
aPlaneLineBits[1].speed = TAXI_SPEED;
- aPlaneLineBits[1].acceleration = 33.0f/32.0f;
+ aPlaneLineBits[1].acceleration = 618.75f/600.0f;
time += 600.0f/((CRUISE_SPEED+TAXI_SPEED)/2.0f);
position += 600.0f;
@@ -716,7 +717,7 @@ CPlane::InitPlanes(void)
aPlaneLineBits[3].time = time;
aPlaneLineBits[3].position = position;
aPlaneLineBits[3].speed = CRUISE_SPEED;
- aPlaneLineBits[3].acceleration = -33.0f/32.0f;
+ aPlaneLineBits[3].acceleration = -618.75f/600.0f;
time += 600.0f/((CRUISE_SPEED+TAXI_SPEED)/2.0f);
position += 600.0f;
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp
index e21ad07c..9aa90845 100644
--- a/src/vehicles/Vehicle.cpp
+++ b/src/vehicles/Vehicle.cpp
@@ -669,12 +669,12 @@ CVehicle::InflictDamage(CEntity* damagedBy, eWeaponType weaponType, float damage
if (pDriver) {
SetStatus(STATUS_ABANDONED);
pDriver->bFleeAfterExitingCar = true;
- pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this);
+ pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, this);
}
for (int i = 0; i < m_nNumMaxPassengers; i++) {
if (pPassengers[i]) {
pPassengers[i]->bFleeAfterExitingCar = true;
- pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this);
+ pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_CAR, this);
}
}
break;
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index 378e621a..aea14f6a 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -874,7 +874,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
if ( victim->IsPed() && ((CPed*)shooter)->m_nPedType != ((CPed*)victim)->m_nPedType || ((CPed*)shooter)->m_nPedType == PEDTYPE_PLAYER2 )
{
CPed *victimPed = (CPed *)victim;
- if ( !victimPed->OnGround() && victim != shooter )
+ if ( !victimPed->DyingOrDead() && victim != shooter )
{
if ( victimPed->DoesLOSBulletHitPed(*point) )
{
diff --git a/src/weapons/WeaponInfo.cpp b/src/weapons/WeaponInfo.cpp
index c4ab75d2..93370a18 100644
--- a/src/weapons/WeaponInfo.cpp
+++ b/src/weapons/WeaponInfo.cpp
@@ -64,7 +64,7 @@ CWeaponInfo::LoadWeaponData(void)
CAnimBlendAssociation *animAssoc;
AnimationId animId;
- int bp, buflen;
+ size_t bp, buflen;
int lp, linelen;
CFileMgr::SetDir("DATA");