summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/re3_msvc_amd64.yml67
-rw-r--r--.github/workflows/re3_msvc_x86.yml68
-rw-r--r--dxsdk/Include/Msvidctl.tlbbin108028 -> 0 bytes
-rw-r--r--dxsdk/Include/Tuner.tlbbin53292 -> 0 bytes
-rw-r--r--mpg123.32/dist/libmpg123-0.dllbin0 -> 343552 bytes
-rw-r--r--mpg123.32/dist/libmpg123.dllbin150528 -> 0 bytes
-rw-r--r--mpg123.32/include/fmt123.h159
-rw-r--r--mpg123.32/include/mpg123.h1209
-rw-r--r--mpg123.32/lib/libmpg123-0.libbin0 -> 34076 bytes
-rw-r--r--mpg123.32/lib/libmpg123.libbin19996 -> 0 bytes
-rw-r--r--mpg123.64/dist/libmpg123-0.dll (renamed from mpg123.64/dist/libmpg123.dll)bin345088 -> 345088 bytes
-rw-r--r--mpg123.64/lib/libmpg123-0.lib (renamed from mpg123.64/lib/libmpg123.lib)bin33342 -> 33342 bytes
-rw-r--r--premake5.lua20
-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/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/stream.cpp7
-rw-r--r--src/control/RoadBlocks.cpp4
-rw-r--r--src/core/Accident.cpp4
-rw-r--r--src/core/Accident.h1
-rw-r--r--src/core/Collision.cpp1118
-rw-r--r--src/core/Collision.h81
-rw-r--r--src/core/EventList.cpp8
-rw-r--r--src/core/Game.cpp3
-rw-r--r--src/core/Pad.cpp2
-rw-r--r--src/core/SurfaceTable.h5
-rw-r--r--src/core/World.cpp5
-rw-r--r--src/core/Zones.cpp5
-rw-r--r--src/core/common.h10
-rw-r--r--src/core/config.h17
-rw-r--r--src/core/main.cpp2
-rw-r--r--src/core/re3.cpp2
-rw-r--r--src/core/vu0Collision.dsm21
-rw-r--r--src/core/vu0Collision_1.s610
-rw-r--r--src/core/vu0Collision_2.s191
-rw-r--r--src/math/Matrix.h1
-rw-r--r--src/math/VuVector.h41
-rw-r--r--src/math/math.cpp128
-rw-r--r--src/peds/CopPed.cpp4
-rw-r--r--src/peds/Population.cpp11
-rw-r--r--src/render/Fluff.cpp5
-rw-r--r--src/render/Font.h2
-rw-r--r--src/render/Renderer.cpp6
-rw-r--r--src/render/Rubbish.h4
-rw-r--r--src/render/Shadows.cpp63
-rw-r--r--src/render/Shadows.h11
-rw-r--r--src/render/Sprite2d.cpp9
-rw-r--r--src/weapons/BulletInfo.cpp39
-rw-r--r--src/weapons/ProjectileInfo.cpp46
-rw-r--r--src/weapons/ShotInfo.cpp20
360 files changed, 3647 insertions, 362 deletions
diff --git a/.github/workflows/re3_msvc_amd64.yml b/.github/workflows/re3_msvc_amd64.yml
new file mode 100644
index 00000000..07b793ba
--- /dev/null
+++ b/.github/workflows/re3_msvc_amd64.yml
@@ -0,0 +1,67 @@
+name: re3_msvc_amd64
+
+on:
+ pull_request:
+ push:
+ release:
+ types: published
+env:
+ GLEW_VER: "2.1.0"
+ GLFW_VER: "3.3.2"
+ GLEW_BASE: "glew-2.1.0"
+ GLFW_BASE: "glfw-3.3.2.bin.WIN64"
+ GLEW_FILE: "glew-2.1.0-win32.zip"
+ GLFW_FILE: "glfw-3.3.2.bin.WIN64.zip"
+ GLEW_URL: "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0-win32.zip"
+ GLFW_URL: "https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.bin.WIN64.zip"
+jobs:
+ build:
+ runs-on: windows-2019
+ strategy:
+ matrix:
+ platform: [win-amd64-librw_d3d9-oal, win-amd64-librw_gl3_glfw-oal]
+ buildtype: [Debug, Release]
+ steps:
+ - name: Add msbuild to PATH
+ uses: microsoft/setup-msbuild@v1.0.1
+ - uses: actions/checkout@v2
+ with:
+ submodules: 'true'
+ - if: ${{ matrix.platform }} == "win-amd64-librw_gl3_glfw-mss"
+ name: Download glew
+ uses: carlosperate/download-file-action@v1.0.3
+ with:
+ file-url: ${{env.GLEW_URL}}
+ - if: ${{ matrix.platform }} == "win-amd64-librw_gl3_glfw-mss"
+ name: Download glfw
+ uses: carlosperate/download-file-action@v1.0.3
+ with:
+ file-url: ${{env.GLFW_URL}}
+ - if: ${{ matrix.platform }} == "win-amd64-librw_gl3_glfw-mss"
+ name: Unpack archives
+ run: |
+ 7z x ${{env.GLEW_FILE}}
+ 7z x ${{env.GLFW_FILE}}
+ - name: Configure build
+ run: |
+ ./premake5 vs2019 --with-librw --glewdir=${{env.GLEW_BASE}} --glfwdir64=${{env.GLFW_BASE}}
+ - name: Build
+ run: |
+ msbuild -m build/re3.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}}
+ - name: Pack artifacts
+ run: |
+ 7z a re3_${{matrix.buildtype}}_${{matrix.platform}}.zip ./bin/${{matrix.platform}}/${{matrix.buildtype}}/*
+ - name: Upload artifact to actions
+ uses: actions/upload-artifact@v2
+ with:
+ name: re3_${{matrix.buildtype}}_${{matrix.platform}}
+ path: ./bin/${{matrix.platform}}/${{matrix.buildtype}}
+# - name: Upload artifact to Bintray
+# uses: hpcsc/upload-bintray-docker-action@v1
+# with:
+# repository: re3
+# package: ${{matrix.buildtype}}_${{matrix.platform}}
+# version: 1.0-$(echo ${GITHUB_SHA}
+# sourcePath: ./bin/${{matrix.platform}}/${{matrix.buildtype}}
+# username: gtamodding
+# apiKey: ${{secrets.BINTRAY_API_KEY}}
diff --git a/.github/workflows/re3_msvc_x86.yml b/.github/workflows/re3_msvc_x86.yml
new file mode 100644
index 00000000..34e892cf
--- /dev/null
+++ b/.github/workflows/re3_msvc_x86.yml
@@ -0,0 +1,68 @@
+name: re3_msvc_x86
+
+on:
+ pull_request:
+ push:
+ release:
+ types: published
+env:
+ GLEW_VER: "2.1.0"
+ GLFW_VER: "3.3.2"
+ GLEW_BASE: "glew-2.1.0"
+ GLFW_BASE: "glfw-3.3.2.bin.WIN32"
+ GLEW_FILE: "glew-2.1.0-win32.zip"
+ GLFW_FILE: "glfw-3.3.2.bin.WIN32.zip"
+ GLEW_URL: "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0-win32.zip"
+ GLFW_URL: "https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.bin.WIN32.zip"
+jobs:
+ build:
+ runs-on: windows-2019
+ strategy:
+ matrix:
+ platform: [win-x86-librw_d3d9-mss, win-x86-librw_gl3_glfw-mss, win-x86-librw_d3d9-oal, win-x86-librw_gl3_glfw-oal]
+ buildtype: [Debug, Release]
+ steps:
+ - name: Add msbuild to PATH
+ uses: microsoft/setup-msbuild@v1.0.1
+ - uses: actions/checkout@v2
+ with:
+ submodules: 'true'
+ - if: ${{ matrix.platform }} == "win-x86-librw_gl3_glfw-mss"
+ name: Download glew
+ uses: carlosperate/download-file-action@v1.0.3
+ with:
+ file-url: ${{env.GLEW_URL}}
+ - if: ${{ matrix.platform }} == "win-x86-librw_gl3_glfw-mss"
+ name: Download glfw
+ uses: carlosperate/download-file-action@v1.0.3
+ with:
+ file-url: ${{env.GLFW_URL}}
+ - if: ${{ matrix.platform }} == "win-x86-librw_gl3_glfw-mss"
+ name: Unpack archives
+ run: |
+ 7z x ${{env.GLEW_FILE}}
+ 7z x ${{env.GLFW_FILE}}
+ - name: Configure build
+ run: |
+ ./premake5 vs2019 --with-librw --glewdir=${{env.GLEW_BASE}} --glfwdir32=${{env.GLFW_BASE}}
+ - name: Build
+ run: |
+ msbuild -m build/re3.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}}
+ - name: Pack artifacts
+ run: |
+ 7z a re3_${{matrix.buildtype}}_${{matrix.platform}}.zip ./bin/${{matrix.platform}}/${{matrix.buildtype}}/*
+ - name: Upload artifact to actions
+ uses: actions/upload-artifact@v2
+ with:
+ name: re3_${{matrix.buildtype}}_${{matrix.platform}}
+ path: re3_${{matrix.buildtype}}_${{matrix.platform}}.zip
+# - name: Upload artifact to Bintray
+# uses: hpcsc/upload-bintray-docker-action@v1
+# with:
+# repository: re3
+# package: ${{matrix.buildtype}}_${{matrix.platform}}
+# version: 1.0-$(echo ${GITHUB_SHA}
+# sourcePath: ./bin/${{matrix.platform}}/${{matrix.buildtype}}
+# username: gtamodding
+# apiKey: ${{secrets.BINTRAY_API_KEY}}
+
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/mpg123.32/dist/libmpg123-0.dll b/mpg123.32/dist/libmpg123-0.dll
new file mode 100644
index 00000000..07bfef0c
--- /dev/null
+++ b/mpg123.32/dist/libmpg123-0.dll
Binary files differ
diff --git a/mpg123.32/dist/libmpg123.dll b/mpg123.32/dist/libmpg123.dll
deleted file mode 100644
index ccb429bf..00000000
--- a/mpg123.32/dist/libmpg123.dll
+++ /dev/null
Binary files differ
diff --git a/mpg123.32/include/fmt123.h b/mpg123.32/include/fmt123.h
new file mode 100644
index 00000000..dcabf5e0
--- /dev/null
+++ b/mpg123.32/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.32/include/mpg123.h b/mpg123.32/include/mpg123.h
index 03cf9197..7b0a8495 100644
--- a/mpg123.32/include/mpg123.h
+++ b/mpg123.32/include/mpg123.h
@@ -1,33 +1,53 @@
/*
- libmpg123: MPEG Audio Decoder library (version 1.13.4)
+ libmpg123: MPEG Audio Decoder library (version 1.26.3)
- copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ 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
-/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */
+#include <fmt123.h>
-/* 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 29
+/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */
-/* These aren't actually in use... seems to work without using libtool. */
+/** 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 EXPORT __declspec(dllexport)
+#define MPG123_EXPORT __declspec(dllexport)
#else
#ifdef LINK_MPG123_DLL
/* The exe imports. */
-#define EXPORT __declspec(dllimport)
+#define MPG123_EXPORT __declspec(dllimport)
#else
/* Nothing on normal/UNIX builds */
-#define EXPORT
+#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>
@@ -63,6 +83,7 @@
#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)
@@ -79,9 +100,11 @@
#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 */
@@ -109,31 +132,47 @@ struct mpg123_handle_struct;
typedef struct mpg123_handle_struct mpg123_handle;
/** Function to initialise the mpg123 library.
- * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the 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.
*/
-EXPORT int mpg123_init(void);
+MPG123_EXPORT int mpg123_init(void);
-/** Function to close down the mpg123 library.
- * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */
-EXPORT void mpg123_exit(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.
*
- * \return Non-NULL pointer when successful.
+ * \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.
*/
-EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error);
+MPG123_EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error);
-/** Delete handle, mh is either a valid mpg123 handle or NULL. */
-EXPORT void mpg123_delete(mpg123_handle *mh);
+/** 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, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */
+ 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) */
@@ -143,13 +182,21 @@ enum mpg123_parms
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) */
+ 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). */
+ 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. */
@@ -170,6 +217,47 @@ enum mpg123_param_flags
,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 */
@@ -181,15 +269,27 @@ enum mpg123_param_rva
,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */
};
-/* TODO: Assess the possibilities and troubles of changing parameters during playback. */
-
/** Set a specific parameter, for a specific mpg123_handle, using a parameter
- * type key chosen from the mpg123_parms enumeration, to the specified value. */
-EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue);
+ * 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. */
-EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval);
+ * 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
@@ -208,10 +308,28 @@ enum mpg123_feature_set
,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 feature, 1 for success, 0 for unimplemented functions. */
-EXPORT int mpg123_feature(const enum mpg123_feature_set key);
+/** 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);
/* @} */
@@ -221,9 +339,28 @@ EXPORT int mpg123_feature(const enum mpg123_feature_set key);
* 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 on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code).
- * 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!).
- * The positive range of return values is used for "useful" values when appropriate.
+ * 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.
*
* @{
*/
@@ -278,19 +415,29 @@ enum mpg123_errors
,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. */
};
-/** Return a string describing that error errcode means. */
-EXPORT const char* mpg123_plain_strerror(int errcode);
+/** 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. */
-EXPORT const char* mpg123_strerror(mpg123_handle *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. */
-EXPORT int mpg123_errcode(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);
/*@}*/
@@ -303,21 +450,33 @@ EXPORT int mpg123_errcode(mpg123_handle *mh);
* @{
*/
-/** Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). */
-EXPORT const char **mpg123_decoders(void);
-
-/** Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). */
-EXPORT const char **mpg123_supported_decoders(void);
+/** Get available decoder list.
+ * \return NULL-terminated array of generally available decoder names (plain 8bit ASCII)
+ */
+MPG123_EXPORT const char **mpg123_decoders(void);
-/** Set the chosen decoder to 'decoder_name' */
-EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name);
+/** 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);
-/** Get the currently active decoder engine 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 ony active in the hidden and not available as decoder choice from the outside.
- \return The decoder name or NULL on error. */
-EXPORT const char* mpg123_current_decoder(mpg123_handle *mh);
+/** 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);
/*@}*/
@@ -326,100 +485,124 @@ EXPORT const char* mpg123_current_decoder(mpg123_handle *mh);
*
* Functions to get and select the format of the decoded audio.
*
- * @{
- */
-
-/** An enum over all sample types possibly known to mpg123.
- * The values are designed as bit flags to allow bitmasking for encoding families.
+ * 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.
*
- * 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.
+ * 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.
*
- * 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).
- * mpg123_encsize() can be helpful there.
+ * 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.
+ *
+ * @{
*/
-enum mpg123_enc_enum
-{
- MPG123_ENC_8 = 0x00f /**< 0000 0000 1111 Some 8 bit integer encoding. */
- ,MPG123_ENC_16 = 0x040 /**< 0000 0100 0000 Some 16 bit integer encoding. */
- ,MPG123_ENC_24 = 0x4000 /**< 0100 0000 0000 0000 Some 24 bit integer encoding. */
- ,MPG123_ENC_32 = 0x100 /**< 0001 0000 0000 Some 32 bit integer encoding. */
- ,MPG123_ENC_SIGNED = 0x080 /**< 0000 1000 0000 Some signed integer encoding. */
- ,MPG123_ENC_FLOAT = 0xe00 /**< 1110 0000 0000 Some float encoding. */
- ,MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) /**< 1101 0000 signed 16 bit */
- ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) /**< 0110 0000 unsigned 16 bit */
- ,MPG123_ENC_UNSIGNED_8 = 0x01 /**< 0000 0001 unsigned 8 bit */
- ,MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) /**< 1000 0010 signed 8 bit */
- ,MPG123_ENC_ULAW_8 = 0x04 /**< 0000 0100 ulaw 8 bit */
- ,MPG123_ENC_ALAW_8 = 0x08 /**< 0000 1000 alaw 8 bit */
- ,MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 /**< 0001 0001 1000 0000 signed 32 bit */
- ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 /**< 0010 0001 0000 0000 unsigned 32 bit */
- ,MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 /**< 0101 0000 1000 0000 signed 24 bit */
- ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 /**< 0110 0000 0000 0000 unsigned 24 bit */
- ,MPG123_ENC_FLOAT_32 = 0x200 /**< 0010 0000 0000 32bit float */
- ,MPG123_ENC_FLOAT_64 = 0x400 /**< 0100 0000 0000 64bit float */
- ,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 ) /**< Any encoding on the list. */
-};
/** They can be combined into one number (3) to indicate mono and stereo... */
enum mpg123_channelcount
{
- MPG123_MONO = 1
- ,MPG123_STEREO = 2
+ 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.
+ * 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. */
-EXPORT void mpg123_rates(const long **list, size_t *number);
+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. */
-EXPORT void mpg123_encodings(const int **list, size_t *number);
+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. */
-EXPORT int mpg123_encsize(int 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 */
-EXPORT int mpg123_format_none(mpg123_handle *mh);
+ * 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. */
-EXPORT int mpg123_format_all(mpg123_handle *mh);
+ * (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 audio decoder handle
+ * \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. */
-EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings);
+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. */
-EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding);
-
-/** Get the current output format written to the addresses givenr. */
-EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding);
+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 );
/*@}*/
@@ -431,47 +614,116 @@ EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *e
* @{
*/
-/* reading samples / triggering decoding, possible return values: */
-/** Enumeration of the error codes returned by libmpg123 functions. */
+/** 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
*/
-EXPORT int mpg123_open(mpg123_handle *mh, const char *path);
+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
*/
-EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd);
+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
*/
-EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle);
+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
*/
-EXPORT int mpg123_open_feed(mpg123_handle *mh);
+MPG123_EXPORT int mpg123_open_feed(mpg123_handle *mh);
-/** Closes the source, if libmpg123 opened it. */
-EXPORT int mpg123_close(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 error/message code (watch out for MPG123_DONE and friends!) */
-EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done);
+ * \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 error/message code. */
-EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size);
+ * \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.
@@ -480,6 +732,11 @@ EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size);
* 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
@@ -487,30 +744,67 @@ EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size);
* \param done address to store the number of actually decoded bytes to
* \return error/message code (watch out especially for MPG123_NEED_MORE)
*/
-EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done);
+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
*/
-EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes);
+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
*/
-EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes);
+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
*/
-EXPORT int mpg123_framebyframe_next(mpg123_handle *mh);
+MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh);
/*@}*/
@@ -530,65 +824,97 @@ EXPORT int mpg123_framebyframe_next(mpg123_handle *mh);
* 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 read, you'd get that sample. */
-EXPORT off_t mpg123_tell(mpg123_handle *mh);
-
-/** Returns the frame number that the next read will give you data from. */
-EXPORT off_t mpg123_tellframe(mpg123_handle *mh);
+ * 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 current byte offset in the input stream. */
-EXPORT off_t mpg123_tell_stream(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);
-/** Seek to a desired sample offset.
- * Set whence to SEEK_SET, SEEK_CUR or SEEK_END.
- * \return The resulting offset >= 0 or error/message code */
-EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence);
+/** 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 */
-EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset);
-
-/** Seek to a desired MPEG frame index.
- * Set whence to SEEK_SET, SEEK_CUR or SEEK_END.
- * \return The resulting offset >= 0 or error/message code */
-EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence);
+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 */
-EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec);
+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 */
-EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill);
+ * \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 */
-EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill);
-
-/** Get information about current and remaining frames/seconds.
- * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123!
- * You provide an offset (in frames) from now and a number of output bytes
- * served by libmpg123 but not yet played. You get the projected current frame
- * and seconds, as well as the remaining frames/seconds. This does _not_ care
- * about skipped samples due to gapless playback. */
-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);
+ * \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);
/*@}*/
@@ -598,6 +924,7 @@ EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffere
* @{
*/
+/** another channel enumeration, for left/right choice */
enum mpg123_channels
{
MPG123_LEFT=0x1 /**< The Left Channel. */
@@ -606,32 +933,55 @@ enum mpg123_channels
};
/** 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. */
-EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val);
+ * \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. */
-EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band);
+ * \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 */
-EXPORT int mpg123_reset_eq(mpg123_handle *mh);
+/** 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. */
-EXPORT int mpg123_volume(mpg123_handle *mh, double vol);
+ * 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 */
-EXPORT int mpg123_volume_change(mpg123_handle *mh, double change);
+/** 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. */
-EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db);
+ * 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? */
@@ -684,7 +1034,7 @@ struct mpg123_frameinfo
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). */
+ 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). */
@@ -692,49 +1042,130 @@ struct mpg123_frameinfo
enum mpg123_vbr vbr; /**< The VBR mode. */
};
-/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. */
-EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi);
+/** 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);
-/** Get the safe output buffer size for all cases (when you want to replace the internal buffer) */
-EXPORT size_t mpg123_safe_buffer(void);
+/** 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 );
-/** 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.
- * \return MPG123_OK or MPG123_ERR.
+/** 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
*/
-EXPORT int mpg123_scan(mpg123_handle *mh);
+MPG123_EXPORT int mpg123_scan(mpg123_handle *mh);
-/** Return, if possible, the full (expected) length of current track in samples.
- * \return length >= 0 or MPG123_ERR if there is no length guess possible. */
-EXPORT off_t mpg123_length(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.
- * \return MPG123_OK or MPG123_ERR */
-EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size);
+ * 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);
-/** Returns the time (seconds) per frame; <0 is error. */
-EXPORT double mpg123_tpf(mpg123_handle *mh);
+/** 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 and reset the clip count. */
-EXPORT long mpg123_clip(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_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 or MPG123_ERR for success
+ * \return MPG123_OK on success
*/
-EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval);
+MPG123_EXPORT int mpg123_getstate( mpg123_handle *mh
+, enum mpg123_state key, long *val, double *fval );
/*@}*/
@@ -756,53 +1187,128 @@ typedef struct
size_t fill; /**< number of used bytes (including closing zero byte) */
} mpg123_string;
-/** Create and allocate memory for a new mpg123_string */
-EXPORT void mpg123_init_string(mpg123_string* sb);
+/** 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);
-/** Free-up mempory for an existing mpg123_string */
-EXPORT void mpg123_free_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
- * \return 0 on error, 1 on success */
-EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news);
+ * \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.
- * \return 0 on error, 1 on success */
-EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news);
+ * 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.
- * \return 0 on error, 1 on success */
-EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to);
+ * 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
- * \return 0 on error, 1 on success */
-EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff);
+ * \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
- * \return 0 on error, 1 on success
+ * \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) */
-EXPORT int mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count);
-
-/** Set the conents of a mpg123_string to a C-string
- * \return 0 on error, 1 on success */
-EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff);
+ * \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 contents of a mpg123_string to a C-substring
+/** 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
- * \param from offset to copy from
- * \param count number of characters to copy (a null-byte is always appended) */
-EXPORT int mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count);
+ */
+MPG123_EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff);
-/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters).
- * \return character count
- * \param sb the string
+/** 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
- * Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes.
+ * \return character count
*/
-EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8);
+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
@@ -834,25 +1340,30 @@ enum mpg123_id3_enc
,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */
};
-/** Convert ID3 encoding byte to mpg123 encoding index. */
-EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_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
- * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb)
+ * 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 char *)
+ * \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
- *
- * 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).
+ * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb)
*/
-EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size);
+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 and TXXX 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). */
+ * 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). */
@@ -861,6 +1372,45 @@ typedef struct
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.
@@ -883,11 +1433,14 @@ typedef struct
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[19] = track_number
+ * 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
{
@@ -906,23 +1459,50 @@ typedef struct
#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).
- The check function returns a combination of flags. */
-EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */
+ * \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 Return value is MPG123_OK or MPG123_ERR, */
-EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2);
+ * \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.
- * \return Return value is MPG123_OK or MPG123_ERR, */
-EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */
+ * \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!) */
-EXPORT char* mpg123_icy2utf8(const char* icy_text);
+MPG123_EXPORT char* mpg123_icy2utf8(const char* icy_text);
/* @} */
@@ -949,44 +1529,95 @@ struct mpg123_pars_struct;
/** Opaque structure for the libmpg123 decoder parameters. */
typedef struct mpg123_pars_struct mpg123_pars;
-/** Create a handle with preset parameters. */
-EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error);
+/** 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 */
-EXPORT mpg123_pars *mpg123_new_pars(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 */
-EXPORT void mpg123_delete_pars(mpg123_pars* mp);
+/** 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 */
-EXPORT int mpg123_fmt_none(mpg123_pars *mp);
+ * 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. */
-EXPORT int mpg123_fmt_all(mpg123_pars *mp);
+ * (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 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 0 on success, -1 if there was an error. /
+ * \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
*/
-EXPORT int mpg123_fmt(mpg123_pars *mh, long rate, int channels, int encodings); /* 0 is good, -1 is error */
+MPG123_EXPORT int mpg123_fmt(mpg123_pars *mp
+, long rate, int channels, int encodings);
-/** Check to see if a specific format at a specific rate is supported
+/** 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. */
-EXPORT int mpg123_fmt_support(mpg123_pars *mh, long rate, int encoding);
+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. */
-EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue);
+ * 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. */
-EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval);
+ * 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);
/* @} */
@@ -997,36 +1628,68 @@ EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, dou
* @{ */
/** 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. */
-EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size);
+ * 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. */
-EXPORT size_t mpg123_outblock(mpg123_handle *mh);
+ * 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...).
+ * 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(). */
-EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int));
+ * 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.
+/** 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 r_read The callback for reading (behaviour like posix read).
- * \param r_lseek The 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). */
-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*));
+ * \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
diff --git a/mpg123.32/lib/libmpg123-0.lib b/mpg123.32/lib/libmpg123-0.lib
new file mode 100644
index 00000000..1dddc020
--- /dev/null
+++ b/mpg123.32/lib/libmpg123-0.lib
Binary files differ
diff --git a/mpg123.32/lib/libmpg123.lib b/mpg123.32/lib/libmpg123.lib
deleted file mode 100644
index e3555655..00000000
--- a/mpg123.32/lib/libmpg123.lib
+++ /dev/null
Binary files differ
diff --git a/mpg123.64/dist/libmpg123.dll b/mpg123.64/dist/libmpg123-0.dll
index 545c9de3..545c9de3 100644
--- a/mpg123.64/dist/libmpg123.dll
+++ b/mpg123.64/dist/libmpg123-0.dll
Binary files differ
diff --git a/mpg123.64/lib/libmpg123.lib b/mpg123.64/lib/libmpg123-0.lib
index 0b778c2b..0b778c2b 100644
--- a/mpg123.64/lib/libmpg123.lib
+++ b/mpg123.64/lib/libmpg123-0.lib
Binary files differ
diff --git a/premake5.lua b/premake5.lua
index ddcfd6a9..c8190e15 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -163,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") }
@@ -181,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" }
@@ -203,7 +204,6 @@ project "re3"
includedirs { "src/vehicles" }
includedirs { "src/weapons" }
includedirs { "src/extras" }
- includedirs { "eax" }
if _OPTIONS["with-opus"] then
includedirs { "ogg/include" }
@@ -213,8 +213,8 @@ project "re3"
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*"
@@ -268,8 +268,8 @@ project "re3"
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"
@@ -288,8 +288,8 @@ project "re3"
links { "d3d9" }
filter "platforms:*x86*d3d*"
- includedirs { "dxsdk/include" }
- libdirs { "dxsdk/lib" }
+ includedirs { "sdk/dx8sdk/include" }
+ libdirs { "sdk/dx8sdk/lib" }
filter "platforms:*amd64*d3d9*"
defines { "USE_D3D9" }
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/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/stream.cpp b/src/audio/oal/stream.cpp
index 34080514..eeaaafb0 100644
--- a/src/audio/oal/stream.cpp
+++ b/src/audio/oal/stream.cpp
@@ -8,13 +8,8 @@
#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" )
+#pragma comment( lib, "libmpg123-0.lib" )
#else
#include "crossplatform.h"
#endif
diff --git a/src/control/RoadBlocks.cpp b/src/control/RoadBlocks.cpp
index ee9ec17e..86b4caf1 100644
--- a/src/control/RoadBlocks.cpp
+++ b/src/control/RoadBlocks.cpp
@@ -105,6 +105,10 @@ CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType
void
CRoadBlocks::GenerateRoadBlocks(void)
{
+#ifdef SQUEEZE_PERFORMANCE
+ if (FindPlayerPed()->m_pWanted->m_RoadblockDensity == 0)
+ return;
+#endif
CMatrix offsetMatrix;
uint32 frame = CTimer::GetFrameCounter() & 0xF;
int16 nRoadblockNode = (int16)(NUMROADBLOCKS * frame) / 16;
diff --git a/src/core/Accident.cpp b/src/core/Accident.cpp
index 1fd6c123..c8611323 100644
--- a/src/core/Accident.cpp
+++ b/src/core/Accident.cpp
@@ -53,6 +53,10 @@ CAccidentManager::ReportAccident(CPed *ped)
void
CAccidentManager::Update()
{
+#ifdef SQUEEZE_PERFORMANCE
+ // Handled after injury registered.
+ return;
+#endif
int32 e;
if (CEventList::GetEvent(EVENT_INJURED_PED, &e)) {
CPed *ped = CPools::GetPed(gaEvent[e].entityRef);
diff --git a/src/core/Accident.h b/src/core/Accident.h
index 949d5fb9..568e1149 100644
--- a/src/core/Accident.h
+++ b/src/core/Accident.h
@@ -1,5 +1,4 @@
#pragma once
-#include "common.h"
#include "config.h"
class CPed;
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp
index 99be816f..6522ff1c 100644
--- a/src/core/Collision.cpp
+++ b/src/core/Collision.cpp
@@ -1,5 +1,6 @@
#include "common.h"
+#include "VuVector.h"
#include "main.h"
#include "Lists.h"
#include "Game.h"
@@ -21,6 +22,346 @@
#include "Lines.h"
#include "Collision.h"
+
+// TODO: where do these go?
+
+#ifdef VU_COLLISION
+
+struct VuTriangle
+{
+ // Compressed int16 but unpacked
+#ifdef GTA_PS2
+ uint128 v0;
+ uint128 v1;
+ uint128 v2;
+ uint128 plane;
+#else
+ int32 v0[4];
+ int32 v1[4];
+ int32 v2[4];
+ int32 plane[4];
+#endif
+};
+
+#ifndef GTA_PS2
+static int16 vi01;
+static CVuVector vf01;
+static CVuVector vf02;
+static CVuVector vf03;
+
+CVuVector
+DistanceBetweenSphereAndLine(const CVuVector &center, const CVuVector &p0, const CVuVector &line)
+{
+ // center VF12
+ // p0 VF14
+ // line VF15
+ CVuVector ret; // VF16
+ CVuVector p1 = p0+line;
+ CVuVector dist0 = center - p0; // VF20
+ CVuVector dist1 = center - p1; // VF25
+ float lenSq = line.MagnitudeSqr(); // VF21
+ float distSq0 = dist0.MagnitudeSqr(); // VF22
+ float distSq1 = dist1.MagnitudeSqr();
+ float dot = DotProduct(dist0, line); // VF23
+ if(dot < 0.0f){
+ // not above line, closest to p0
+ ret = p0;
+ ret.w = distSq0;
+ return ret;
+ }
+ float t = dot/lenSq; // param of nearest point on infinite line
+ if(t > 1.0f){
+ // not above line, closest to p1
+ ret = p1;
+ ret.w = distSq1;
+ return ret;
+ }
+ // closest to line
+ ret = p0 + line*t;
+ ret.w = (ret - center).MagnitudeSqr();
+ return ret;
+}
+inline int SignFlags(const CVector &v)
+{
+ int f = 0;
+ if(v.x < 0.0f) f |= 1;
+ if(v.y < 0.0f) f |= 2;
+ if(v.z < 0.0f) f |= 4;
+ return f;
+}
+#endif
+
+extern "C" void
+LineToTriangleCollision(const CVuVector &p0, const CVuVector &p1,
+ const CVuVector &v0, const CVuVector &v1, const CVuVector &v2,
+ const CVuVector &plane)
+{
+#ifdef GTA_PS2
+ __asm__ volatile (
+ ".set noreorder\n"
+ "lqc2 vf12, 0x0(%0)\n"
+ "lqc2 vf13, 0x0(%1)\n"
+ "lqc2 vf14, 0x0(%2)\n"
+ "lqc2 vf15, 0x0(%3)\n"
+ "lqc2 vf16, 0x0(%4)\n"
+ "lqc2 vf17, 0x0(%5)\n"
+ "vcallms Vu0LineToTriangleCollisionStart\n"
+ ".set reorder\n"
+ :
+ : "r" (&p0), "r" (&p1), "r" (&v0), "r" (&v1), "r" (&v2), "r" (&plane)
+ );
+#else
+ float dot0 = DotProduct(plane, p0);
+ float dot1 = DotProduct(plane, p1);
+ float dist0 = plane.w - dot0;
+ float dist1 = plane.w - dot1;
+
+ // if points are on the same side, no collision
+ if(dist0 * dist1 > 0.0f){
+ vi01 = 0;
+ return;
+ }
+
+ CVuVector diff = p1 - p0;
+ float t = dist0/(dot1 - dot0);
+ CVuVector p = p0 + diff*t;
+ p.w = 0.0f;
+ vf01 = p;
+ vf03.x = t;
+
+ // Check if point is inside
+ CVector cross1 = CrossProduct(p-v0, v1-v0);
+ CVector cross2 = CrossProduct(p-v1, v2-v1);
+ CVector cross3 = CrossProduct(p-v2, v0-v2);
+ // Only check relevant directions
+ int flagmask = 0;
+ if(Abs(plane.x) > 0.5f) flagmask |= 1;
+ if(Abs(plane.y) > 0.5f) flagmask |= 2;
+ if(Abs(plane.z) > 0.5f) flagmask |= 4;
+ int flags1 = SignFlags(cross1) & flagmask;
+ int flags2 = SignFlags(cross2) & flagmask;
+ int flags3 = SignFlags(cross3) & flagmask;
+ // inside if on the same side of all edges
+ if(flags1 != flags2 || flags1 != flags3){
+ vi01 = 0;
+ return;
+ }
+ vi01 = 1;
+ vf02 = plane;
+ return;
+#endif
+}
+
+extern "C" void
+LineToTriangleCollisionCompressed(const CVuVector &p0, const CVuVector &p1, VuTriangle &tri)
+{
+#ifdef GTA_PS2
+ __asm__ volatile (
+ ".set noreorder\n"
+ "lqc2 vf12, 0x0(%0)\n"
+ "lqc2 vf13, 0x0(%1)\n"
+ "lqc2 vf14, 0x0(%2)\n"
+ "lqc2 vf15, 0x10(%2)\n"
+ "lqc2 vf16, 0x20(%2)\n"
+ "lqc2 vf17, 0x30(%2)\n"
+ "vcallms Vu0LineToTriangleCollisionCompressedStart\n"
+ ".set reorder\n"
+ :
+ : "r" (&p0), "r" (&p1), "r" (&tri)
+ );
+#else
+ CVuVector v0, v1, v2, plane;
+ v0.x = tri.v0[0]/128.0f;
+ v0.y = tri.v0[1]/128.0f;
+ v0.z = tri.v0[2]/128.0f;
+ v0.w = tri.v0[3]/128.0f;
+ v1.x = tri.v1[0]/128.0f;
+ v1.y = tri.v1[1]/128.0f;
+ v1.z = tri.v1[2]/128.0f;
+ v1.w = tri.v1[3]/128.0f;
+ v2.x = tri.v2[0]/128.0f;
+ v2.y = tri.v2[1]/128.0f;
+ v2.z = tri.v2[2]/128.0f;
+ v2.w = tri.v2[3]/128.0f;
+ plane.x = tri.plane[0]/4096.0f;
+ plane.y = tri.plane[1]/4096.0f;
+ plane.z = tri.plane[2]/4096.0f;
+ plane.w = tri.plane[3]/128.0f;
+ LineToTriangleCollision(p0, p1, v0, v1, v2, plane);
+#endif
+}
+
+extern "C" void
+SphereToTriangleCollision(const CVuVector &sph,
+ const CVuVector &v0, const CVuVector &v1, const CVuVector &v2,
+ const CVuVector &plane)
+{
+#ifdef GTA_PS2
+ __asm__ volatile (
+ ".set noreorder\n"
+ "lqc2 vf12, 0x0(%0)\n"
+ "lqc2 vf14, 0x0(%1)\n"
+ "lqc2 vf15, 0x0(%2)\n"
+ "lqc2 vf16, 0x0(%3)\n"
+ "lqc2 vf17, 0x0(%4)\n"
+ "vcallms Vu0SphereToTriangleCollisionStart\n"
+ ".set reorder\n"
+ :
+ : "r" (&sph), "r" (&v0), "r" (&v1), "r" (&v2), "r" (&plane)
+ );
+#else
+ float planedist = DotProduct(plane, sph) - plane.w; // VF02
+ if(Abs(planedist) > sph.w){
+ vi01 = 0;
+ return;
+ }
+ // point on plane
+ CVuVector p = sph - planedist*plane;
+ p.w = 0.0f;
+ vf01 = p;
+ planedist = Abs(planedist);
+ // edges
+ CVuVector v01 = v1 - v0;
+ CVuVector v12 = v2 - v1;
+ CVuVector v20 = v0 - v2;
+ // VU code calculates normal again for some weird reason...
+ // Check sides of point
+ CVector cross1 = CrossProduct(p-v0, v01);
+ CVector cross2 = CrossProduct(p-v1, v12);
+ CVector cross3 = CrossProduct(p-v2, v20);
+ // Only check relevant directions
+ int flagmask = 0;
+ if(Abs(plane.x) > 0.1f) flagmask |= 1;
+ if(Abs(plane.y) > 0.1f) flagmask |= 2;
+ if(Abs(plane.z) > 0.1f) flagmask |= 4;
+ int nflags = SignFlags(plane) & flagmask;
+ int flags1 = SignFlags(cross1) & flagmask;
+ int flags2 = SignFlags(cross2) & flagmask;
+ int flags3 = SignFlags(cross3) & flagmask;
+ int testcase = 0;
+ CVuVector closest(0.0f, 0.0f, 0.0f); // VF04
+ if(flags1 == nflags){
+ closest += v2;
+ testcase++;
+ }
+ if(flags2 == nflags){
+ closest += v0;
+ testcase++;
+ }
+ if(flags3 == nflags){
+ closest += v1;
+ testcase++;
+ }
+ if(testcase == 3){
+ // inside triangle - dist to plane already checked
+ vf02 = plane;
+ vf02.w = vf03.x = planedist;
+ vi01 = 1;
+ }else if(testcase == 1){
+ // outside two sides - closest to point opposide inside edge
+ vf01 = closest;
+ vf02 = sph - closest;
+ float distSq = vf02.MagnitudeSqr();
+ vi01 = sph.w*sph.w > distSq;
+ vf03.x = Sqrt(distSq);
+ vf02 *= 1.0f/vf03.x;
+ }else{
+ // inside two sides - closest to third edge
+ if(flags1 != nflags)
+ closest = DistanceBetweenSphereAndLine(sph, v0, v01);
+ else if(flags2 != nflags)
+ closest = DistanceBetweenSphereAndLine(sph, v1, v12);
+ else
+ closest = DistanceBetweenSphereAndLine(sph, v2, v20);
+ vi01 = sph.w*sph.w > closest.w;
+ vf01 = closest;
+ vf02 = sph - closest;
+ vf03.x = Sqrt(closest.w);
+ vf02 *= 1.0f/vf03.x;
+ }
+#endif
+}
+
+extern "C" void
+SphereToTriangleCollisionCompressed(const CVuVector &sph, VuTriangle &tri)
+{
+#ifdef GTA_PS2
+ __asm__ volatile (
+ ".set noreorder\n"
+ "lqc2 vf12, 0x0(%0)\n"
+ "lqc2 vf14, 0x0(%1)\n"
+ "lqc2 vf15, 0x10(%1)\n"
+ "lqc2 vf16, 0x20(%1)\n"
+ "lqc2 vf17, 0x30(%1)\n"
+ "vcallms Vu0SphereToTriangleCollisionCompressedStart\n"
+ ".set reorder\n"
+ :
+ : "r" (&sph), "r" (&tri)
+ );
+#else
+ CVuVector v0, v1, v2, plane;
+ v0.x = tri.v0[0]/128.0f;
+ v0.y = tri.v0[1]/128.0f;
+ v0.z = tri.v0[2]/128.0f;
+ v0.w = tri.v0[3]/128.0f;
+ v1.x = tri.v1[0]/128.0f;
+ v1.y = tri.v1[1]/128.0f;
+ v1.z = tri.v1[2]/128.0f;
+ v1.w = tri.v1[3]/128.0f;
+ v2.x = tri.v2[0]/128.0f;
+ v2.y = tri.v2[1]/128.0f;
+ v2.z = tri.v2[2]/128.0f;
+ v2.w = tri.v2[3]/128.0f;
+ plane.x = tri.plane[0]/4096.0f;
+ plane.y = tri.plane[1]/4096.0f;
+ plane.z = tri.plane[2]/4096.0f;
+ plane.w = tri.plane[3]/128.0f;
+ SphereToTriangleCollision(sph, v0, v1, v2, plane);
+#endif
+}
+
+inline int
+GetVUresult(void)
+{
+#ifdef GTA_PS2
+ int ret;
+ __asm__ volatile (
+ "cfc2.i %0,vi01\n" // .i important! wait for VU0 to finish
+ : "=r" (ret)
+ );
+ return ret;
+#else
+ return vi01;
+#endif
+}
+
+inline int
+GetVUresult(CVuVector &point, CVuVector &normal, float &dist)
+{
+#ifdef GTA_PS2
+ int ret;
+ __asm__ volatile (
+ "cfc2.i %0,vi01\n" // .i important! wait for VU0 to finish
+ "sqc2 vf01,(%1)\n"
+ "sqc2 vf02,(%2)\n"
+ "qmfc2 $12,vf03\n"
+ "sw $12,(%3)\n"
+ : "=r" (ret)
+ : "r" (&point), "r" (&normal), "r" (&dist)
+ : "$12"
+ );
+ return ret;
+#else
+ point = vf01;
+ normal = vf02;
+ dist = vf03.x;
+ return vi01;
+#endif
+}
+
+#endif
+
+
enum Direction
{
DIR_X_POS,
@@ -397,6 +738,20 @@ CCollision::TestVerticalLineBox(const CColLine &line, const CColBox &box)
bool
CCollision::TestLineTriangle(const CColLine &line, const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane)
{
+#ifdef VU_COLLISION
+ // not used in favour of optimized loops
+ VuTriangle vutri;
+ verts[tri.a].Unpack(vutri.v0);
+ verts[tri.b].Unpack(vutri.v1);
+ verts[tri.c].Unpack(vutri.v2);
+ plane.Unpack(vutri.plane);
+
+ LineToTriangleCollisionCompressed(*(CVuVector*)&line.p0, *(CVuVector*)&line.p1, vutri);
+
+ if(GetVUresult())
+ return true;
+ return false;
+#else
float t;
CVector normal;
plane.GetNormal(normal);
@@ -470,6 +825,7 @@ CCollision::TestLineTriangle(const CColLine &line, const CompressedVector *verts
if(CrossProduct2D(vec3-vec1, vect-vec1) > 0.0f) return false;
if(CrossProduct2D(vec3-vec2, vect-vec2) < 0.0f) return false;
return true;
+#endif
}
// Test if line segment intersects with sphere.
@@ -507,6 +863,20 @@ bool
CCollision::TestSphereTriangle(const CColSphere &sphere,
const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane)
{
+#ifdef VU_COLLISION
+ // not used in favour of optimized loops
+ VuTriangle vutri;
+ verts[tri.a].Unpack(vutri.v0);
+ verts[tri.b].Unpack(vutri.v1);
+ verts[tri.c].Unpack(vutri.v2);
+ plane.Unpack(vutri.plane);
+
+ SphereToTriangleCollisionCompressed(*(CVuVector*)&sphere, vutri);
+
+ if(GetVUresult())
+ return true;
+ return false;
+#else
// If sphere and plane don't intersect, no collision
float planedist = plane.CalcPoint(sphere.center);
if(Abs(planedist) > sphere.radius)
@@ -520,7 +890,9 @@ CCollision::TestSphereTriangle(const CColSphere &sphere,
CVector vec2 = vb - va;
float len = vec2.Magnitude();
vec2 = vec2 * (1.0f/len);
- CVector vec1 = CrossProduct(vec2, plane.normal);
+ CVector normal;
+ plane.GetNormal(normal);
+ CVector vec1 = CrossProduct(vec2, normal);
// We know A has local coordinate [0,0] and B has [0,len].
// Now calculate coordinates on triangle for these two vectors:
@@ -563,11 +935,78 @@ CCollision::TestSphereTriangle(const CColSphere &sphere,
}
return dist < sphere.radius;
+#endif
}
bool
CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough)
{
+#ifdef VU_COLLISION
+ CMatrix matTransform;
+ int i;
+
+ // transform line to model space
+ Invert(matrix, matTransform);
+ CVuVector newline[2];
+ TransformPoints(newline, 2, matTransform, (RwV3d*)&line.p0, sizeof(CColLine)/2);
+
+ // If we don't intersect with the bounding box, no chance on the rest
+ if(!TestLineBox(*(CColLine*)newline, model.boundingBox))
+ return false;
+
+ for(i = 0; i < model.numSpheres; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue;
+ if(TestLineSphere(*(CColLine*)newline, model.spheres[i]))
+ return true;
+ }
+
+ for(i = 0; i < model.numBoxes; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.boxes[i].surface)) continue;
+ if(TestLineBox(*(CColLine*)newline, model.boxes[i]))
+ return true;
+ }
+
+ CalculateTrianglePlanes(&model);
+ int lastTest = -1;
+ VuTriangle vutri;
+ for(i = 0; i < model.numTriangles; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+
+ CColTriangle *tri = &model.triangles[i];
+ model.vertices[tri->a].Unpack(vutri.v0);
+ model.vertices[tri->b].Unpack(vutri.v1);
+ model.vertices[tri->c].Unpack(vutri.v2);
+ model.trianglePlanes[i].Unpack(vutri.plane);
+
+ LineToTriangleCollisionCompressed(newline[0], newline[1], vutri);
+ lastTest = i;
+ break;
+ }
+#ifdef FIX_BUGS
+ // no need to check first again
+ i++;
+#endif
+ for(; i < model.numTriangles; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+
+ CColTriangle *tri = &model.triangles[i];
+ model.vertices[tri->a].Unpack(vutri.v0);
+ model.vertices[tri->b].Unpack(vutri.v1);
+ model.vertices[tri->c].Unpack(vutri.v2);
+ model.trianglePlanes[i].Unpack(vutri.plane);
+
+ if(GetVUresult())
+ return true;
+
+ LineToTriangleCollisionCompressed(newline[0], newline[1], vutri);
+ lastTest = i;
+
+ }
+ if(lastTest != -1 && GetVUresult())
+ return true;
+
+ return false;
+#else
static CMatrix matTransform;
int i;
@@ -599,6 +1038,7 @@ CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColMod
}
return false;
+#endif
}
@@ -614,20 +1054,24 @@ CCollision::ProcessSphereSphere(const CColSphere &s1, const CColSphere &s2, CCol
{
CVector dist = s1.center - s2.center;
float d = dist.Magnitude() - s2.radius; // distance from s1's center to s2
- float dc = d < 0.0f ? 0.0f : d; // clamp to zero, i.e. if s1's center is inside s2
+ float depth = s1.radius - d; // sphere overlap
+ if(d < 0.0f) d = 0.0f; // clamp to zero, i.e. if s1's center is inside s2
// no collision if sphere is not close enough
- if(mindistsq <= dc*dc || s1.radius <= dc)
- return false;
- dist.Normalise();
- point.point = s1.center - dist*dc;
- point.normal = dist;
- point.surfaceA = s1.surface;
- point.pieceA = s1.piece;
- point.surfaceB = s2.surface;
- point.pieceB = s2.piece;
- point.depth = s1.radius - d; // sphere overlap
- mindistsq = dc*dc; // collision radius
- return true;
+ if(d*d < mindistsq && d < s1.radius){
+ dist.Normalise();
+ point.point = s1.center - dist*d;
+ point.normal = dist;
+#ifndef VU_COLLISION
+ point.surfaceA = s1.surface;
+ point.pieceA = s1.piece;
+ point.surfaceB = s2.surface;
+ point.pieceB = s2.piece;
+#endif
+ point.depth = depth;
+ mindistsq = d*d; // collision radius
+ return true;
+ }
+ return false;
}
bool
@@ -667,10 +1111,12 @@ CCollision::ProcessSphereBox(const CColSphere &sph, const CColBox &box, CColPoin
if(lensq < mindistsq){
point.normal = dist * (1.0f/Sqrt(lensq));
point.point = sph.center - point.normal;
+#ifndef VU_COLLISION
point.surfaceA = sph.surface;
point.pieceA = sph.piece;
point.surfaceB = box.surface;
point.pieceB = box.piece;
+#endif
// find absolute distance to the closer side in each dimension
float dx = dist.x > 0.0f ?
@@ -710,10 +1156,12 @@ CCollision::ProcessSphereBox(const CColSphere &sph, const CColBox &box, CColPoin
float len = Sqrt(lensq);
point.point = p;
point.normal = dist * (1.0f/len);
+#ifndef VU_COLLISION
point.surfaceA = sph.surface;
point.pieceA = sph.piece;
point.surfaceB = box.surface;
point.pieceB = box.piece;
+#endif
point.depth = sph.radius - len;
mindistsq = lensq;
return true;
@@ -828,10 +1276,12 @@ CCollision::ProcessLineBox(const CColLine &line, const CColBox &box, CColPoint &
point.point = p;
point.normal = normal;
+#ifndef VU_COLLISION
point.surfaceA = 0;
point.pieceA = 0;
point.surfaceB = box.surface;
point.pieceB = box.piece;
+#endif
mindist = mint;
return true;
@@ -861,10 +1311,12 @@ CCollision::ProcessLineSphere(const CColLine &line, const CColSphere &sphere, CC
point.point = line.p0 + v01*t;
point.normal = point.point - sphere.center;
point.normal.Normalise();
+#ifndef VU_COLLISION
point.surfaceA = 0;
point.pieceA = 0;
point.surfaceB = sphere.surface;
point.pieceB = sphere.piece;
+#endif
mindist = t;
return true;
}
@@ -874,6 +1326,17 @@ CCollision::ProcessVerticalLineTriangle(const CColLine &line,
const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane,
CColPoint &point, float &mindist, CStoredCollPoly *poly)
{
+#ifdef VU_COLLISION
+ // not used in favour of optimized loops
+ bool res = ProcessLineTriangle(line, verts, tri, plane, point, mindist);
+ if(res && poly){
+ poly->verts[0] = verts[tri.a].Get();
+ poly->verts[1] = verts[tri.b].Get();
+ poly->verts[2] = verts[tri.c].Get();
+ poly->valid = true;
+ }
+ return res;
+#else
float t;
CVector normal;
@@ -960,11 +1423,40 @@ CCollision::ProcessVerticalLineTriangle(const CColLine &line,
}
mindist = t;
return true;
+#endif
}
bool
CCollision::IsStoredPolyStillValidVerticalLine(const CVector &pos, float z, CColPoint &point, CStoredCollPoly *poly)
{
+#ifdef VU_COLLISION
+ if(!poly->valid)
+ return false;
+
+ CVuVector p0 = pos;
+ CVuVector p1 = pos;
+ p1.z = z;
+
+ CVector v01 = poly->verts[1] - poly->verts[0];
+ CVector v02 = poly->verts[2] - poly->verts[0];
+ CVuVector plane = CrossProduct(v02, v01);
+ plane.Normalise();
+ plane.w = DotProduct(plane, poly->verts[0]);
+
+ LineToTriangleCollision(p0, p1, poly->verts[0], poly->verts[1], poly->verts[2], plane);
+
+ CVuVector pnt;
+ float dist;
+ if(!GetVUresult(pnt, plane, dist))
+#ifdef FIX_BUGS
+ // perhaps not needed but be safe
+ return poly->valid = false;
+#else
+ return false;
+#endif
+ point.point = pnt;
+ return true;
+#else
float t;
if(!poly->valid)
@@ -987,7 +1479,9 @@ CCollision::IsStoredPolyStillValidVerticalLine(const CVector &pos, float z, CCol
return poly->valid = false;
// intersection parameter on line
- t = -plane.CalcPoint(p0) / DotProduct(p1 - p0, plane.normal);
+ CVector normal;
+ plane.GetNormal(normal);
+ t = -plane.CalcPoint(p0) / DotProduct(p1 - p0, normal);
// find point of intersection
CVector p = p0 + (p1-p0)*t;
@@ -1037,13 +1531,36 @@ CCollision::IsStoredPolyStillValidVerticalLine(const CVector &pos, float z, CCol
if(CrossProduct2D(vec3-vec2, vect-vec2) < 0.0f) return poly->valid = false;
point.point = p;
return poly->valid = true;
+#endif
}
bool
-CCollision::ProcessLineTriangle(const CColLine &line ,
+CCollision::ProcessLineTriangle(const CColLine &line,
const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane,
CColPoint &point, float &mindist)
{
+#ifdef VU_COLLISION
+ // not used in favour of optimized loops
+ VuTriangle vutri;
+ verts[tri.a].Unpack(vutri.v0);
+ verts[tri.b].Unpack(vutri.v1);
+ verts[tri.c].Unpack(vutri.v2);
+ plane.Unpack(vutri.plane);
+
+ LineToTriangleCollisionCompressed(*(CVuVector*)&line.p0, *(CVuVector*)&line.p1, vutri);
+
+ CVuVector pnt, normal;
+ float dist;
+ if(GetVUresult(pnt, normal, dist)){
+ if(dist < mindist){
+ point.point = pnt;
+ point.normal = normal;
+ mindist = dist;
+ return true;
+ }
+ }
+ return false;
+#else
float t;
CVector normal;
plane.GetNormal(normal);
@@ -1117,6 +1634,7 @@ CCollision::ProcessLineTriangle(const CColLine &line ,
point.pieceB = 0;
mindist = t;
return true;
+#endif
}
bool
@@ -1124,6 +1642,30 @@ CCollision::ProcessSphereTriangle(const CColSphere &sphere,
const CompressedVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane,
CColPoint &point, float &mindistsq)
{
+#ifdef VU_COLLISION
+ // not used in favour of optimized loops
+ VuTriangle vutri;
+ verts[tri.a].Unpack(vutri.v0);
+ verts[tri.b].Unpack(vutri.v1);
+ verts[tri.c].Unpack(vutri.v2);
+ plane.Unpack(vutri.plane);
+
+ SphereToTriangleCollisionCompressed(*(CVuVector*)&sphere, vutri);
+
+ CVuVector pnt, normal;
+ float dist;
+ if(GetVUresult(pnt, normal, dist) && dist*dist < mindistsq){
+ float depth = sphere.radius - dist;
+ if(depth > point.depth){
+ point.point = pnt;
+ point.normal = normal;
+ point.depth = depth;
+ mindistsq = dist*dist;
+ return true;
+ }
+ }
+ return false;
+#else
// If sphere and plane don't intersect, no collision
float planedist = plane.CalcPoint(sphere.center);
float distsq = planedist*planedist;
@@ -1191,13 +1733,16 @@ CCollision::ProcessSphereTriangle(const CColSphere &sphere,
point.point = p;
point.normal = sphere.center - p;
point.normal.Normalise();
+#ifndef VU_COLLISION
point.surfaceA = sphere.surface;
point.pieceA = sphere.piece;
point.surfaceB = tri.surface;
point.pieceB = 0;
+#endif
point.depth = sphere.radius - dist;
mindistsq = dist*dist;
return true;
+#endif
}
bool
@@ -1205,6 +1750,94 @@ CCollision::ProcessLineOfSight(const CColLine &line,
const CMatrix &matrix, CColModel &model,
CColPoint &point, float &mindist, bool ignoreSeeThrough)
{
+#ifdef VU_COLLISION
+ CMatrix matTransform;
+ int i;
+
+ // transform line to model space
+ Invert(matrix, matTransform);
+ CVuVector newline[2];
+ TransformPoints(newline, 2, matTransform, (RwV3d*)&line.p0, sizeof(CColLine)/2);
+
+ if(mindist < 1.0f)
+ newline[1] = newline[0] + (newline[1] - newline[0])*mindist;
+
+ // If we don't intersect with the bounding box, no chance on the rest
+ if(!TestLineBox(*(CColLine*)newline, model.boundingBox))
+ return false;
+
+ float coldist = 1.0f;
+ for(i = 0; i < model.numSpheres; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue;
+ if(ProcessLineSphere(*(CColLine*)newline, model.spheres[i], point, coldist))
+ point.Set(0, 0, model.spheres[i].surface, model.spheres[i].piece);
+ }
+
+ for(i = 0; i < model.numBoxes; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.boxes[i].surface)) continue;
+ if(ProcessLineBox(*(CColLine*)newline, model.boxes[i], point, coldist))
+ point.Set(0, 0, model.boxes[i].surface, model.boxes[i].piece);
+ }
+
+ CalculateTrianglePlanes(&model);
+ VuTriangle vutri;
+ CColTriangle *lasttri = nil;
+ for(i = 0; i < model.numTriangles; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+
+ CColTriangle *tri = &model.triangles[i];
+ model.vertices[tri->a].Unpack(vutri.v0);
+ model.vertices[tri->b].Unpack(vutri.v1);
+ model.vertices[tri->c].Unpack(vutri.v2);
+ model.trianglePlanes[i].Unpack(vutri.plane);
+
+ LineToTriangleCollisionCompressed(newline[0], newline[1], vutri);
+ lasttri = tri;
+ break;
+ }
+#ifdef FIX_BUGS
+ // no need to check first again
+ i++;
+#endif
+ CVuVector pnt, normal;
+ float dist;
+ for(; i < model.numTriangles; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+
+ CColTriangle *tri = &model.triangles[i];
+ model.vertices[tri->a].Unpack(vutri.v0);
+ model.vertices[tri->b].Unpack(vutri.v1);
+ model.vertices[tri->c].Unpack(vutri.v2);
+ model.trianglePlanes[i].Unpack(vutri.plane);
+
+ if(GetVUresult(pnt, normal, dist))
+ if(dist < coldist){
+ point.point = pnt;
+ point.normal = normal;
+ point.Set(0, 0, lasttri->surface, 0);
+ coldist = dist;
+ }
+
+ LineToTriangleCollisionCompressed(newline[0], newline[1], vutri);
+ lasttri = tri;
+ }
+ if(lasttri && GetVUresult(pnt, normal, dist))
+ if(dist < coldist){
+ point.point = pnt;
+ point.normal = normal;
+ point.Set(0, 0, lasttri->surface, 0);
+ coldist = dist;
+ }
+
+
+ if(coldist < 1.0f){
+ point.point = matrix * point.point;
+ point.normal = Multiply3x3(matrix, point.normal);
+ mindist *= coldist;
+ return true;
+ }
+ return false;
+#else
static CMatrix matTransform;
int i;
@@ -1240,6 +1873,7 @@ CCollision::ProcessLineOfSight(const CColLine &line,
return true;
}
return false;
+#endif
}
bool
@@ -1247,6 +1881,125 @@ CCollision::ProcessVerticalLine(const CColLine &line,
const CMatrix &matrix, CColModel &model,
CColPoint &point, float &mindist, bool ignoreSeeThrough, CStoredCollPoly *poly)
{
+#ifdef VU_COLLISION
+ static CStoredCollPoly TempStoredPoly;
+ CMatrix matTransform;
+ int i;
+
+ // transform line to model space
+ Invert(matrix, matTransform);
+ CVuVector newline[2];
+ TransformPoints(newline, 2, matTransform, (RwV3d*)&line.p0, sizeof(CColLine)/2);
+
+ if(mindist < 1.0f)
+ newline[1] = newline[0] + (newline[1] - newline[0])*mindist;
+
+ if(!TestLineBox(*(CColLine*)newline, model.boundingBox))
+ return false;
+
+ float coldist = 1.0f;
+ for(i = 0; i < model.numSpheres; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue;
+ if(ProcessLineSphere(*(CColLine*)newline, model.spheres[i], point, coldist))
+ point.Set(0, 0, model.spheres[i].surface, model.spheres[i].piece);
+ }
+
+ for(i = 0; i < model.numBoxes; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.boxes[i].surface)) continue;
+ if(ProcessLineBox(*(CColLine*)newline, model.boxes[i], point, coldist))
+ point.Set(0, 0, model.boxes[i].surface, model.boxes[i].piece);
+ }
+
+ CalculateTrianglePlanes(&model);
+ TempStoredPoly.valid = false;
+ if(model.numTriangles){
+ bool registeredCol;
+ CColTriangle *lasttri = nil;
+ VuTriangle vutri;
+ for(i = 0; i < model.numTriangles; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+
+ CColTriangle *tri = &model.triangles[i];
+ model.vertices[tri->a].Unpack(vutri.v0);
+ model.vertices[tri->b].Unpack(vutri.v1);
+ model.vertices[tri->c].Unpack(vutri.v2);
+ model.trianglePlanes[i].Unpack(vutri.plane);
+
+ LineToTriangleCollisionCompressed(newline[0], newline[1], vutri);
+ lasttri = tri;
+ break;
+ }
+#ifdef FIX_BUGS
+ // no need to check first again
+ i++;
+#endif
+ CVuVector pnt, normal;
+ float dist;
+ for(; i < model.numTriangles; i++){
+ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+
+ CColTriangle *tri = &model.triangles[i];
+ model.vertices[tri->a].Unpack(vutri.v0);
+ model.vertices[tri->b].Unpack(vutri.v1);
+ model.vertices[tri->c].Unpack(vutri.v2);
+ model.trianglePlanes[i].Unpack(vutri.plane);
+
+ if(GetVUresult(pnt, normal, dist)){
+ if(dist < coldist){
+ point.point = pnt;
+ point.normal = normal;
+ point.Set(0, 0, lasttri->surface, 0);
+ coldist = dist;
+ registeredCol = true;
+ }else
+ registeredCol = false;
+ }else
+ registeredCol = false;
+
+ if(registeredCol){
+ TempStoredPoly.verts[0] = model.vertices[lasttri->a].Get();
+ TempStoredPoly.verts[1] = model.vertices[lasttri->b].Get();
+ TempStoredPoly.verts[2] = model.vertices[lasttri->c].Get();
+ TempStoredPoly.valid = true;
+ }
+
+ LineToTriangleCollisionCompressed(newline[0], newline[1], vutri);
+ lasttri = tri;
+ }
+ if(lasttri && GetVUresult(pnt, normal, dist)){
+ if(dist < coldist){
+ point.point = pnt;
+ point.normal = normal;
+ point.Set(0, 0, lasttri->surface, 0);
+ coldist = dist;
+ registeredCol = true;
+ }else
+ registeredCol = false;
+ }else
+ registeredCol = false;
+
+ if(registeredCol){
+ TempStoredPoly.verts[0] = model.vertices[lasttri->a].Get();
+ TempStoredPoly.verts[1] = model.vertices[lasttri->b].Get();
+ TempStoredPoly.verts[2] = model.vertices[lasttri->c].Get();
+ TempStoredPoly.valid = true;
+ }
+ }
+
+ if(coldist < 1.0f){
+ point.point = matrix * point.point;
+ point.normal = Multiply3x3(matrix, point.normal);
+ if(TempStoredPoly.valid && poly){
+ *poly = TempStoredPoly;
+ poly->verts[0] = matrix * CVector(poly->verts[0]);
+ poly->verts[1] = matrix * CVector(poly->verts[1]);
+ poly->verts[2] = matrix * CVector(poly->verts[2]);
+ }
+ mindist *= coldist;
+ return true;
+ }
+ return false;
+#else
static CStoredCollPoly TempStoredPoly;
int i;
@@ -1290,6 +2043,7 @@ CCollision::ProcessVerticalLine(const CColLine &line,
return true;
}
return false;
+#endif
}
enum {
@@ -1299,6 +2053,15 @@ enum {
MAXNUMTRIS = 600
};
+#ifdef VU_COLLISION
+#ifdef GTA_PS2
+#define SPR(off) ((uint8*)(0x70000000 + (off)))
+#else
+static uint8 fakeSPR[16*1024];
+#define SPR(off) ((uint8*)(fakeSPR + (off)))
+#endif
+#endif
+
// This checks model A's spheres and lines against model B's spheres, boxes and triangles.
// Returns the number of A's spheres that collide.
// Returned ColPoints are in world space.
@@ -1308,6 +2071,308 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
const CMatrix &matrixB, CColModel &modelB,
CColPoint *spherepoints, CColPoint *linepoints, float *linedists)
{
+#ifdef VU_COLLISION
+ CVuVector *aSpheresA = (CVuVector*)SPR(0x0000);
+ CVuVector *aSpheresB = (CVuVector*)SPR(0x0800);
+ CVuVector *aLinesA = (CVuVector*)SPR(0x1000);
+ int32 *aSphereIndicesA = (int32*)SPR(0x1200);
+ int32 *aSphereIndicesB = (int32*)SPR(0x1400);
+ int32 *aBoxIndicesB = (int32*)SPR(0x1600);
+ int32 *aTriangleIndicesB = (int32*)SPR(0x1680);
+ bool *aCollided = (bool*)SPR(0x1FE0);
+ CMatrix &matAB = *(CMatrix*)SPR(0x1FF0);
+ CMatrix &matBA = *(CMatrix*)SPR(0x2040);
+ int i, j, k;
+
+ // From model A space to model B space
+ Invert(matrixB, matAB);
+ matAB *= matrixA;
+
+ CVuVector bsphereAB; // bounding sphere of A in B space
+ TransformPoint(bsphereAB, matAB, *(RwV3d*)modelA.boundingSphere.center); // inlined
+ bsphereAB.w = modelA.boundingSphere.radius;
+ if(!TestSphereBox(*(CColSphere*)&bsphereAB, modelB.boundingBox))
+ return 0;
+
+ // transform modelA's spheres and lines to B space
+ TransformPoints(aSpheresA, modelA.numSpheres, matAB, (RwV3d*)&modelA.spheres->center, sizeof(CColSphere));
+ for(i = 0; i < modelA.numSpheres; i++)
+ aSpheresA[i].w = modelA.spheres[i].radius;
+ TransformPoints(aLinesA, modelA.numLines*2, matAB, (RwV3d*)&modelA.lines->p0, sizeof(CColLine)/2);
+
+ // Test them against model B's bounding volumes
+ int numSpheresA = 0;
+ for(i = 0; i < modelA.numSpheres; i++)
+ if(TestSphereBox(*(CColSphere*)&aSpheresA[i], modelB.boundingBox))
+ aSphereIndicesA[numSpheresA++] = i;
+ // No collision
+ if(numSpheresA == 0 && modelA.numLines == 0)
+ return 0;
+
+
+ // B to A space
+ Invert(matrixA, matBA);
+ matBA *= matrixB;
+
+ // transform modelB's spheres to A space
+ TransformPoints(aSpheresB, modelB.numSpheres, matBA, (RwV3d*)&modelB.spheres->center, sizeof(CColSphere));
+ for(i = 0; i < modelB.numSpheres; i++)
+ aSpheresB[i].w = modelB.spheres[i].radius;
+
+ // Check model B against A's bounding volumes
+ int numSpheresB = 0;
+ int numBoxesB = 0;
+ int numTrianglesB = 0;
+ for(i = 0; i < modelB.numSpheres; i++)
+ if(TestSphereBox(*(CColSphere*)&aSpheresB[i], modelA.boundingBox))
+ aSphereIndicesB[numSpheresB++] = i;
+ for(i = 0; i < modelB.numBoxes; i++)
+ if(TestSphereBox(*(CColSphere*)&bsphereAB, modelB.boxes[i]))
+ aBoxIndicesB[numBoxesB++] = i;
+ CalculateTrianglePlanes(&modelB);
+ if(modelB.numTriangles){
+ VuTriangle vutri;
+ // process the first triangle
+ CColTriangle *tri = &modelB.triangles[0];
+ modelB.vertices[tri->a].Unpack(vutri.v0);
+ modelB.vertices[tri->b].Unpack(vutri.v1);
+ modelB.vertices[tri->c].Unpack(vutri.v2);
+ modelB.trianglePlanes[0].Unpack(vutri.plane);
+
+ SphereToTriangleCollisionCompressed(bsphereAB, vutri);
+
+ for(i = 1; i < modelB.numTriangles; i++){
+ // set up the next triangle while VU0 is running
+ tri = &modelB.triangles[i];
+ modelB.vertices[tri->a].Unpack(vutri.v0);
+ modelB.vertices[tri->b].Unpack(vutri.v1);
+ modelB.vertices[tri->c].Unpack(vutri.v2);
+ modelB.trianglePlanes[i].Unpack(vutri.plane);
+
+ // check previous result
+ if(GetVUresult())
+ aTriangleIndicesB[numTrianglesB++] = i-1;
+
+ // kick off this one
+ SphereToTriangleCollisionCompressed(bsphereAB, vutri);
+ }
+
+ // check last result
+ if(GetVUresult())
+ aTriangleIndicesB[numTrianglesB++] = i-1;
+ }
+ // No collision
+ if(numSpheresB == 0 && numBoxesB == 0 && numTrianglesB == 0)
+ return 0;
+
+ // We now have the collision volumes in A and B that are worth processing.
+
+ // Process A's spheres against B's collision volumes
+ int numCollisions = 0;
+ spherepoints[numCollisions].depth = -1.0f;
+ for(i = 0; i < numSpheresA; i++){
+ float coldist = 1.0e24f;
+ bool hasCollided = false;
+ CColSphere *sphA = &modelA.spheres[aSphereIndicesA[i]];
+ CVuVector *vusphA = &aSpheresA[aSphereIndicesA[i]];
+
+ for(j = 0; j < numSpheresB; j++)
+ // This actually looks like something was inlined here
+ if(ProcessSphereSphere(*(CColSphere*)vusphA, modelB.spheres[aSphereIndicesB[j]],
+ spherepoints[numCollisions], coldist)){
+ spherepoints[numCollisions].Set(
+ sphA->surface, sphA->piece,
+ modelB.spheres[aSphereIndicesB[j]].surface, modelB.spheres[aSphereIndicesB[j]].piece);
+ hasCollided = true;
+ }
+ for(j = 0; j < numBoxesB; j++)
+ if(ProcessSphereBox(*(CColSphere*)vusphA, modelB.boxes[aBoxIndicesB[j]],
+ spherepoints[numCollisions], coldist)){
+ spherepoints[numCollisions].Set(
+ sphA->surface, sphA->piece,
+ modelB.boxes[aBoxIndicesB[j]].surface, modelB.boxes[aBoxIndicesB[j]].piece);
+ hasCollided = true;
+ }
+ if(numTrianglesB){
+ CVuVector point, normal;
+ float depth;
+ bool registeredCol;
+ CColTriangle *lasttri;
+
+ VuTriangle vutri;
+ // process the first triangle
+ k = aTriangleIndicesB[0];
+ CColTriangle *tri = &modelB.triangles[k];
+ modelB.vertices[tri->a].Unpack(vutri.v0);
+ modelB.vertices[tri->b].Unpack(vutri.v1);
+ modelB.vertices[tri->c].Unpack(vutri.v2);
+ modelB.trianglePlanes[k].Unpack(vutri.plane);
+
+ SphereToTriangleCollisionCompressed(*vusphA, vutri);
+ lasttri = tri;
+
+ for(j = 1; j < numTrianglesB; j++){
+ k = aTriangleIndicesB[j];
+ // set up the next triangle while VU0 is running
+ tri = &modelB.triangles[k];
+ modelB.vertices[tri->a].Unpack(vutri.v0);
+ modelB.vertices[tri->b].Unpack(vutri.v1);
+ modelB.vertices[tri->c].Unpack(vutri.v2);
+ modelB.trianglePlanes[k].Unpack(vutri.plane);
+
+ // check previous result
+ // TODO: this looks inlined but spherepoints[numCollisions] does not...
+ if(GetVUresult(point, normal, depth)){
+ depth = sphA->radius - depth;
+ if(depth > spherepoints[numCollisions].depth){
+ spherepoints[numCollisions].point = point;
+ spherepoints[numCollisions].normal = normal;
+ spherepoints[numCollisions].Set(depth,
+ sphA->surface, sphA->piece, lasttri->surface, 0);
+ registeredCol = true;
+ }else
+ registeredCol = false;
+ }else
+ registeredCol = false;
+
+ if(registeredCol)
+ hasCollided = true;
+
+ // kick off this one
+ SphereToTriangleCollisionCompressed(*vusphA, vutri);
+ lasttri = tri;
+ }
+
+ // check last result
+ // TODO: this looks inlined but spherepoints[numCollisions] does not...
+ if(GetVUresult(point, normal, depth)){
+ depth = sphA->radius - depth;
+ if(depth > spherepoints[numCollisions].depth){
+ spherepoints[numCollisions].point = point;
+ spherepoints[numCollisions].normal = normal;
+ spherepoints[numCollisions].Set(depth,
+ sphA->surface, sphA->piece, lasttri->surface, 0);
+ registeredCol = true;
+ }else
+ registeredCol = false;
+ }else
+ registeredCol = false;
+
+ if(registeredCol)
+ hasCollided = true;
+ }
+
+ if(hasCollided){
+ numCollisions++;
+ if(numCollisions == MAX_COLLISION_POINTS)
+ break;
+ spherepoints[numCollisions].depth = -1.0f;
+ }
+ }
+ for(i = 0; i < numCollisions; i++){
+ // TODO: both VU0 macros
+ spherepoints[i].point = matrixB * spherepoints[i].point;
+ spherepoints[i].normal = Multiply3x3(matrixB, spherepoints[i].normal);
+ }
+
+ // And the same thing for the lines in A
+ for(i = 0; i < modelA.numLines; i++){
+ aCollided[i] = false;
+ CVuVector *lineA = &aLinesA[i*2];
+
+ for(j = 0; j < numSpheresB; j++)
+ if(ProcessLineSphere(*(CColLine*)lineA, modelB.spheres[aSphereIndicesB[j]],
+ linepoints[i], linedists[i])){
+ linepoints[i].Set(0, 0,
+#ifdef FIX_BUGS
+ modelB.spheres[aSphereIndicesB[j]].surface, modelB.spheres[aSphereIndicesB[j]].piece);
+#else
+ modelB.spheres[j].surface, modelB.spheres[j].piece);
+#endif
+ aCollided[i] = true;
+ }
+ for(j = 0; j < numBoxesB; j++)
+ if(ProcessLineBox(*(CColLine*)lineA, modelB.boxes[aBoxIndicesB[j]],
+ linepoints[i], linedists[i])){
+ linepoints[i].Set(0, 0,
+ modelB.boxes[aBoxIndicesB[j]].surface, modelB.boxes[aBoxIndicesB[j]].piece);
+ aCollided[i] = true;
+ }
+ if(numTrianglesB){
+ CVuVector point, normal;
+ float dist;
+ bool registeredCol;
+ CColTriangle *lasttri;
+
+ VuTriangle vutri;
+ // process the first triangle
+ k = aTriangleIndicesB[0];
+ CColTriangle *tri = &modelB.triangles[k];
+ modelB.vertices[tri->a].Unpack(vutri.v0);
+ modelB.vertices[tri->b].Unpack(vutri.v1);
+ modelB.vertices[tri->c].Unpack(vutri.v2);
+ modelB.trianglePlanes[k].Unpack(vutri.plane);
+
+ LineToTriangleCollisionCompressed(lineA[0], lineA[1], vutri);
+ lasttri = tri;
+
+ for(j = 1; j < numTrianglesB; j++){
+ k = aTriangleIndicesB[j];
+ // set up the next triangle while VU0 is running
+ CColTriangle *tri = &modelB.triangles[k];
+ modelB.vertices[tri->a].Unpack(vutri.v0);
+ modelB.vertices[tri->b].Unpack(vutri.v1);
+ modelB.vertices[tri->c].Unpack(vutri.v2);
+ modelB.trianglePlanes[k].Unpack(vutri.plane);
+
+ // check previous result
+ // TODO: this again somewhat looks inlined
+ if(GetVUresult(point, normal, dist)){
+ if(dist < linedists[i]){
+ linepoints[i].point = point;
+ linepoints[i].normal = normal;
+ linedists[i] = dist;
+ linepoints[i].Set(0, 0, lasttri->surface, 0);
+ registeredCol = true;
+ }else
+ registeredCol = false;
+ }else
+ registeredCol = false;
+
+ if(registeredCol)
+ aCollided[i] = true;
+
+ // kick of this one
+ LineToTriangleCollisionCompressed(lineA[0], lineA[1], vutri);
+ lasttri = tri;
+ }
+
+ // check last result
+ if(GetVUresult(point, normal, dist)){
+ if(dist < linedists[i]){
+ linepoints[i].point = point;
+ linepoints[i].normal = normal;
+ linedists[i] = dist;
+ linepoints[i].Set(0, 0, lasttri->surface, 0);
+ registeredCol = true;
+ }else
+ registeredCol = false;
+ }else
+ registeredCol = false;
+
+ if(registeredCol)
+ aCollided[i] = true;
+ }
+
+ if(aCollided[i]){
+ // TODO: both VU0 macros
+ linepoints[i].point = matrixB * linepoints[i].point;
+ linepoints[i].normal = Multiply3x3(matrixB, linepoints[i].normal);
+ }
+ }
+
+ return numCollisions; // sphere collisions
+#else
static int aSphereIndicesA[MAXNUMSPHERES];
static int aLineIndicesA[MAXNUMLINES];
static int aSphereIndicesB[MAXNUMSPHERES];
@@ -1324,14 +2389,16 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
assert(modelA.numLines <= MAXNUMLINES);
// From model A space to model B space
- matAB = Invert(matrixB, matAB) * matrixA;
+ Invert(matrixB, matAB);
+ matAB *= matrixA;
CColSphere bsphereAB; // bounding sphere of A in B space
bsphereAB.Set(modelA.boundingSphere.radius, matAB * modelA.boundingSphere.center);
if(!TestSphereBox(bsphereAB, modelB.boundingBox))
return 0;
// B to A space
- matBA = Invert(matrixA, matBA) * matrixB;
+ matBA = Invert(matrixA, matBA);
+ matBA *= matrixB;
// transform modelA's spheres and lines to B space
for(i = 0; i < modelA.numSpheres; i++){
@@ -1444,6 +2511,7 @@ CCollision::ProcessColModels(const CMatrix &matrixA, CColModel &modelA,
}
return numCollisions; // sphere collisions
+#endif
}
@@ -1987,6 +3055,19 @@ CColTriangle::Set(const CompressedVector *, int a, int b, int c, uint8 surf, uin
this->surface = surf;
}
+#ifdef VU_COLLISION
+void
+CColTrianglePlane::Set(const CVector &va, const CVector &vb, const CVector &vc)
+{
+ CVector norm = CrossProduct(vc-va, vb-va);
+ norm.Normalise();
+ float d = DotProduct(norm, va);
+ normal.x = norm.x*4096.0f;
+ normal.y = norm.y*4096.0f;
+ normal.z = norm.z*4096.0f;
+ dist = d*128.0f;
+}
+#else
void
CColTrianglePlane::Set(const CVector &va, const CVector &vb, const CVector &vc)
{
@@ -2002,6 +3083,7 @@ CColTrianglePlane::Set(const CVector &va, const CVector &vb, const CVector &vc)
else
dir = normal.z < 0.0f ? DIR_Z_NEG : DIR_Z_POS;
}
+#endif
CColModel::CColModel(void)
{
diff --git a/src/core/Collision.h b/src/core/Collision.h
index d988f0c2..d7498ac0 100644
--- a/src/core/Collision.h
+++ b/src/core/Collision.h
@@ -2,9 +2,12 @@
#include "templates.h"
#include "Game.h" // for eLevelName
+#ifdef VU_COLLISION
+#include "VuVector.h"
+#endif
// If you spawn many tanks at once, you will see that collisions of two entity exceeds 32.
-#ifdef FIX_BUGS
+#if defined(FIX_BUGS) && !defined(SQUEEZE_PERFORMANCE)
#define MAX_COLLISION_POINTS 64
#else
#define MAX_COLLISION_POINTS 32
@@ -16,6 +19,28 @@ struct CompressedVector
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; };
+#ifdef GTA_PS2
+ void Unpack(uint128 &qword) const {
+ __asm__ volatile (
+ "lh $8, 0(%1)\n"
+ "lh $9, 2(%1)\n"
+ "lh $10, 4(%1)\n"
+ "pextlw $10, $8\n"
+ "pextlw $2, $9, $10\n"
+ "sq $2, %0\n"
+ : "=m" (qword)
+ : "r" (this)
+ : "$8", "$9", "$10", "$2"
+ );
+ }
+#else
+ void Unpack(int32 *qword) const {
+ qword[0] = x;
+ qword[1] = y;
+ qword[2] = z;
+ qword[3] = 0; // junk
+ }
+#endif
#else
float x, y, z;
CVector Get(void) const { return CVector(x, y, z); };
@@ -25,6 +50,7 @@ struct CompressedVector
struct CColSphere
{
+ // NB: this has to be compatible with a CVuVector
CVector center;
float radius;
uint8 surface;
@@ -47,6 +73,7 @@ struct CColBox
struct CColLine
{
+ // NB: this has to be compatible with two CVuVectors
CVector p0;
int pad0;
CVector p1;
@@ -69,6 +96,39 @@ struct CColTriangle
struct CColTrianglePlane
{
+#ifdef VU_COLLISION
+ CompressedVector normal;
+ int16 dist;
+
+ 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.x = normal.x/4096.0f; n.y = normal.y/4096.0f; n.z = normal.z/4096.0f; }
+ float CalcPoint(const CVector &v) const { CVector n; GetNormal(n); return DotProduct(n, v) - dist/128.0f; };
+#ifdef GTA_PS2
+ void Unpack(uint128 &qword) const {
+ __asm__ volatile (
+ "lh $8, 0(%1)\n"
+ "lh $9, 2(%1)\n"
+ "lh $10, 4(%1)\n"
+ "lh $11, 6(%1)\n"
+ "pextlw $10, $8\n"
+ "pextlw $11, $9\n"
+ "pextlw $2, $11, $10\n"
+ "sq $2, %0\n"
+ : "=m" (qword)
+ : "r" (this)
+ : "$8", "$9", "$10", "$11", "$2"
+ );
+ }
+#else
+ void Unpack(int32 *qword) const {
+ qword[0] = normal.x;
+ qword[1] = normal.y;
+ qword[2] = normal.z;
+ qword[3] = dist;
+ }
+#endif
+#else
CVector normal;
float dist;
uint8 dir;
@@ -77,6 +137,7 @@ struct CColTrianglePlane
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; };
+#endif
};
struct CColPoint
@@ -91,11 +152,29 @@ struct CColPoint
uint8 surfaceB;
uint8 pieceB;
float depth;
+
+ void Set(float depth, uint8 surfA, uint8 pieceA, uint8 surfB, uint8 pieceB) {
+ this->depth = depth;
+ this->surfaceA = surfA;
+ this->pieceA = pieceA;
+ this->surfaceB = surfB;
+ this->pieceB = pieceB;
+ }
+ void Set(uint8 surfA, uint8 pieceA, uint8 surfB, uint8 pieceB) {
+ this->surfaceA = surfA;
+ this->pieceA = pieceA;
+ this->surfaceB = surfB;
+ this->pieceB = pieceB;
+ }
};
struct CStoredCollPoly
{
+#ifdef VU_COLLISION
+ CVuVector verts[3];
+#else
CVector verts[3];
+#endif
bool valid;
};
diff --git a/src/core/EventList.cpp b/src/core/EventList.cpp
index 675040ea..8d69ba78 100644
--- a/src/core/EventList.cpp
+++ b/src/core/EventList.cpp
@@ -8,6 +8,7 @@
#include "Messages.h"
#include "Text.h"
#include "main.h"
+#include "Accident.h"
int32 CEventList::ms_nFirstFreeSlotIndex;
CEvent gaEvent[NUMEVENTS];
@@ -63,6 +64,13 @@ CEventList::RegisterEvent(eEventType type, eEventEntity entityType, CEntity *ent
int ref;
bool copsDontCare;
+#ifdef SQUEEZE_PERFORMANCE
+ if (type == EVENT_INJURED_PED) {
+ gAccidentManager.ReportAccident((CPed*)ent);
+ return;
+ }
+#endif
+
copsDontCare = false;
switch(entityType){
case EVENT_ENTITY_PED:
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index 82e6992d..08623c65 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -106,6 +106,7 @@ int gameTxdSlot;
bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);
void DoRWStuffEndOfFrame(void);
+#ifdef PS2_MENU
void MessageScreen(char *msg)
{
//TODO: stretch_screen
@@ -139,6 +140,7 @@ void MessageScreen(char *msg)
DoRWStuffEndOfFrame();
}
+#endif
bool
CGame::InitialiseOnceBeforeRW(void)
@@ -431,6 +433,7 @@ bool CGame::Initialise(const char* datFile)
if ( !TheMemoryCard.m_bWantToLoad )
{
#endif
+ LoadingScreen("Loading the Game", "Start script", nil);
CTheScripts::StartTestScript();
CTheScripts::Process();
TheCamera.Process();
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 7df548aa..d4ffc5ea 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -1104,7 +1104,9 @@ void CPad::UpdatePads(void)
if ( bUpdate )
{
GetPad(0)->Update(0);
+#ifndef SQUEEZE_PERFORMANCE
GetPad(1)->Update(0);
+#endif
}
#if defined(MASTER) && !defined(XINPUT)
diff --git a/src/core/SurfaceTable.h b/src/core/SurfaceTable.h
index 1f16843d..8ee1724e 100644
--- a/src/core/SurfaceTable.h
+++ b/src/core/SurfaceTable.h
@@ -60,6 +60,11 @@ IsSeeThrough(uint8 surfType)
switch(surfType)
case SURFACE_GLASS:
case SURFACE_TRANSPARENT_CLOTH:
+#if defined(FIX_BUGS) || defined(GTA_PS2)
+ case SURFACE_METAL_CHAIN_FENCE:
+ case SURFACE_TRANSPARENT_STONE:
+ case SURFACE_SCAFFOLD_POLE:
+#endif
return true;
return false;
}
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 9f384048..7f8d8994 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -1941,6 +1941,11 @@ CWorld::Process(void)
} else {
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
CEntity *movingEnt = (CEntity *)node->item;
+#ifdef SQUEEZE_PERFORMANCE
+ if (movingEnt->bRemoveFromWorld) {
+ RemoveEntityInsteadOfProcessingIt(movingEnt);
+ } else
+#endif
if(movingEnt->m_rwObject && RwObjectGetType(movingEnt->m_rwObject) == rpCLUMP &&
RpAnimBlendClumpGetFirstAssociation(movingEnt->GetClump())) {
RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(),
diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp
index 1556731b..2e3e0f6e 100644
--- a/src/core/Zones.cpp
+++ b/src/core/Zones.cpp
@@ -7,6 +7,7 @@
#include "Clock.h"
#include "Text.h"
#include "World.h"
+#include "Timer.h"
eLevelName CTheZones::m_CurrLevel;
CZone *CTheZones::m_pPlayersZone;
@@ -122,6 +123,10 @@ CTheZones::Init(void)
void
CTheZones::Update(void)
{
+#ifdef SQUEEZE_PERFORMANCE
+ if (CTimer::GetFrameCounter() % 5 != 0)
+ return;
+#endif
CVector pos;
pos = FindPlayerCoors();
m_pPlayersZone = FindSmallestZonePosition(&pos);
diff --git a/src/core/common.h b/src/core/common.h
index ebb3acb0..e876c4ec 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -89,6 +89,16 @@ typedef uint16_t wchar;
#include <rpskin.h>
#endif
+#ifdef __GNUC__
+#define TYPEALIGN(n) __attribute__ ((aligned (n)))
+#else
+#ifdef _MSC_VER
+#define TYPEALIGN(n) __declspec(align(n))
+#else
+#define TYPEALIGN(n) // unknown compiler...ignore
+#endif
+#endif
+
#define ALIGNPTR(p) (void*)((((uintptr)(void*)p) + sizeof(void*)-1) & ~(sizeof(void*)-1))
// PDP-10 like byte functions
diff --git a/src/core/config.h b/src/core/config.h
index 94a35782..43fc54fa 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -158,7 +158,7 @@ enum Config {
#if defined GTA_PS2
# define GTA_PS2_STUFF
# define RANDOMSPLASH
-# define COMPRESSED_COL_VECTORS
+# define VU_COLLISION
#elif defined GTA_PC
# define GTA3_1_1_PATCH
//# define GTA3_STEAM_PATCH
@@ -170,6 +170,10 @@ enum Config {
#elif defined GTA_XBOX
#endif
+#ifdef VU_COLLISION
+#define COMPRESSED_COL_VECTORS // current need compressed vectors in this code
+#endif
+
#ifdef MASTER
// only in master builds
#else
@@ -282,4 +286,13 @@ enum Config {
#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
+//#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS
+
+
+//#define SQUEEZE_PERFORMANCE
+#ifdef SQUEEZE_PERFORMANCE
+ #undef PS2_ALPHA_TEST
+ #undef NO_ISLAND_LOADING
+ #define PC_PARTICLE
+ #define VC_PED_PORTS // To not process collisions always. But should be tested if that's really beneficial
+#endif \ No newline at end of file
diff --git a/src/core/main.cpp b/src/core/main.cpp
index a1c64a6d..b63688ec 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -816,7 +816,9 @@ RenderScene(void)
DefinedState();
CWaterLevel::RenderWater();
CRenderer::RenderFadingInEntities();
+#ifndef SQUEEZE_PERFORMANCE
CRenderer::RenderVehiclesButNotBoats();
+#endif
CWeather::RenderRainStreaks();
}
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 8c0020d0..f9be4b51 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -457,9 +457,7 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Spawn", "Spawn Predator", [](){ SpawnCar(MI_PREDATOR); });
DebugMenuAddVarBool8("Render", "Draw hud", &CHud::m_Wants_To_Draw_Hud, nil);
-#ifdef LIBRW
DebugMenuAddVarBool8("Render", "PS2 Alpha test Emu", &gPS2alphaTest, nil);
-#endif
DebugMenuAddVarBool8("Render", "Frame limiter", &FrontEndMenuManager.m_PrefsFrameLimiter, nil);
DebugMenuAddVarBool8("Render", "VSynch", &FrontEndMenuManager.m_PrefsVsync, nil);
DebugMenuAddVar("Render", "Max FPS", &RsGlobal.maxFPS, nil, 1, 1, 1000, nil);
diff --git a/src/core/vu0Collision.dsm b/src/core/vu0Collision.dsm
new file mode 100644
index 00000000..657c8b81
--- /dev/null
+++ b/src/core/vu0Collision.dsm
@@ -0,0 +1,21 @@
+.align 4
+.global Vu0CollisionDmaTag
+Vu0CollisionDmaTag:
+DMAcnt *
+MPG 0, *
+.vu
+.include "vu0Collision_1.s"
+.EndMPG
+.EndDmaData
+DMAend
+
+.global Vu0Collision2DmaTag
+Vu0Collision2DmaTag:
+DMAcnt *
+MPG 0, *
+.vu
+.include "vu0Collision_2.s"
+.EndMPG
+.EndDmaData
+DMAend
+.end
diff --git a/src/core/vu0Collision_1.s b/src/core/vu0Collision_1.s
new file mode 100644
index 00000000..055c8640
--- /dev/null
+++ b/src/core/vu0Collision_1.s
@@ -0,0 +1,610 @@
+QuitAndFail:
+ NOP[E] IADDIU VI01, VI00, 0
+ NOP NOP
+
+
+QuitAndSucceed:
+ NOP[E] IADDIU VI01, VI00, 1
+ NOP NOP
+
+
+; 20 -- unused
+; VF12, VF13 xyz: sphere centers
+; VF14, VF15 x: sphere radii
+; out:
+; VI01: set when collision
+; VF01: supposed to be intersection point?
+; VF02: normal (pointing towards s1, not normalized)
+.globl Vu0SphereToSphereCollision
+Vu0SphereToSphereCollision:
+ SUB.xyz VF02, VF13, VF12 NOP ; dist of centers
+ ADD.x VF04, VF14, VF15 NOP ; s = sum of radii
+ MUL.xyzw VF03, VF02, VF02 NOP ;
+ MUL.x VF04, VF04, VF04 DIV Q, VF14x, VF04x ; square s
+ NOP NOP ;
+ NOP NOP ;
+ MULAx.w ACC, VF00, VF03 NOP ;
+ MADDAy.w ACC, VF00, VF03 NOP ;
+ MADDz.w VF03, VF00, VF03 NOP ; d = DistSq of centers
+ NOP NOP ;
+ MULAw.xyz ACC, VF12, VF00 NOP ;
+ MADDq.xyz VF01, VF02, Q NOP ; intersection, but wrong
+ CLIPw.xyz VF04, VF03 NOP ; compare s and d
+ SUB.xyz VF02, VF00, VF02 NOP ; compute normal
+ NOP NOP ;
+ NOP NOP ;
+ NOP FCAND VI01, 0x3 ; 0x2 cannot be set here
+ NOP[E] NOP ;
+ NOP NOP ;
+
+
+; B8 -- unused
+; VF12:
+; VF13: radius
+; VF14:
+; VF15: box dimensions (?)
+.globl Vu0SphereToAABBCollision
+Vu0SphereToAABBCollision:
+ SUB.xyz VF03, VF12, VF14 LOI 0.5
+ MULi.xyz VF15, VF15, I NOP
+ MUL.x VF13, VF13, VF13 NOP
+ SUB.xyz VF04, VF03, VF15 NOP
+ ADD.xyz VF05, VF03, VF15 MR32.xyzw VF16, VF15
+ CLIPw.xyz VF03, VF16 MR32.xyzw VF17, VF16
+ MUL.xyz VF04, VF04, VF04 NOP
+ MUL.xyz VF05, VF05, VF05 NOP
+ CLIPw.xyz VF03, VF17 MR32.xyzw VF16, VF17
+ NOP FCAND VI01, 0x1
+ MINI.xyz VF04, VF04, VF05 MFIR.x VF09, VI01
+ NOP NOP
+ CLIPw.xyz VF03, VF16 FCAND VI01, 0x4
+ NOP MFIR.y VF09, VI01
+ NOP NOP
+ MULAx.w ACC, VF00, VF00 NOP
+ ADD.xyz VF01, VF00, VF03 FCAND VI01, 0x10
+ NOP MFIR.z VF09, VI01
+ NOP LOI 2
+ NOP FCAND VI01, 0x30
+ SUBAw.xyz ACC, VF00, VF00 IADD VI04, VI00, VI01
+ ITOF0.xyz VF09, VF09 FCAND VI01, 0x300
+ NOP IADD VI03, VI00, VI01
+ NOP FCAND VI01, 0x3000
+ NOP IADD VI02, VI00, VI01
+ MADDi.xyzw VF09, VF09, I NOP
+ NOP IBEQ VI04, VI00, IgnoreZValue
+ NOP NOP
+ MADDAz.w ACC, VF00, VF04 NOP
+ MUL.z VF01, VF09, VF15 NOP
+IgnoreZValue:
+ NOP IBEQ VI03, VI00, IgnoreYValue
+ NOP NOP
+ MADDAy.w ACC, VF00, VF04 NOP
+ MUL.y VF01, VF09, VF15 NOP
+IgnoreYValue:
+ NOP IBEQ VI02, VI00, IgnoreXValue
+ NOP NOP
+ MADDAx.w ACC, VF00, VF04 NOP
+ MUL.x VF01, VF09, VF15 NOP
+IgnoreXValue:
+ MADDx.w VF06, VF00, VF00 NOP
+ SUB.xyz VF02, VF03, VF01 NOP
+ ADD.xyz VF01, VF01, VF14 NOP
+ MULx.w VF01, VF00, VF00 NOP
+ CLIPw.xyz VF13, VF06 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0x1
+QuitMicrocode:
+ NOP[E] NOP
+ NOP NOP
+
+
+; 240
+.globl Vu0LineToSphereCollision
+Vu0LineToSphereCollision:
+ SUB.xyzw VF01, VF13, VF12 NOP
+ SUB.xyzw VF02, VF14, VF12 NOP
+ MUL.xyz VF03, VF01, VF02 NOP
+ MUL.xyz VF04, VF01, VF01 NOP
+ MUL.x VF15, VF15, VF15 NOP
+ MUL.xyz VF02, VF02, VF02 NOP
+ MULAx.w ACC, VF00, VF03 NOP
+ MADDAy.w ACC, VF00, VF03 NOP
+ MADDz.w VF03, VF00, VF03 NOP
+ MULAx.w ACC, VF00, VF04 NOP
+ MADDAy.w ACC, VF00, VF04 NOP
+ MADDz.w VF01, VF00, VF04 NOP
+ MULAx.w ACC, VF00, VF02 NOP
+ MADDAy.w ACC, VF00, VF02 NOP
+ MADDz.w VF02, VF00, VF02 NOP
+ MULA.w ACC, VF03, VF03 NOP
+ MADDAx.w ACC, VF01, VF15 NOP
+ MSUB.w VF05, VF01, VF02 NOP
+ NOP NOP
+ NOP NOP
+ NOP IADDIU VI02, VI00, 0x10
+ NOP FMAND VI01, VI02
+ NOP IBNE VI01, VI00, QuitAndFail
+ NOP NOP
+ CLIPw.xyz VF15, VF02 SQRT Q, VF05w
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0x1
+ NOP IBNE VI00, VI01, LineStartInsideSphere
+ NOP NOP
+ SUBq.w VF05, VF03, Q NOP
+ SUB.w VF05, VF05, VF01 DIV Q, VF05w, VF01w
+ NOP FMAND VI01, VI02
+ NOP IBNE VI01, VI00, QuitAndFail
+ NOP NOP
+ NOP FMAND VI01, VI02
+ NOP IBEQ VI01, VI00, QuitAndFail
+ NOP NOP
+ ADDA.xyz ACC, VF12, VF00 NOP
+ MADDq.xyz VF01, VF01, Q NOP
+ MULx.w VF01, VF00, VF00 NOP
+ SUB.xyz VF02, VF01, VF14 NOP
+ NOP[E] NOP
+ NOP NOP
+LineStartInsideSphere:
+ NOP MOVE.xyzw VF01, VF12
+ NOP[E] IADDIU VI01, VI00, 0x1
+ NOP NOP
+
+
+; 3C0
+.globl Vu0LineToAABBCollision
+Vu0LineToAABBCollision:
+ SUB.xyzw VF08, VF13, VF12 LOI 0.5
+ MULi.xyz VF15, VF15, I IADDIU VI08, VI00, 0x0
+ SUB.xyzw VF12, VF12, VF14 NOP
+ SUB.xyzw VF13, VF13, VF14 NOP
+ NOP DIV Q, VF00w, VF08x
+ NOP MR32.xyzw VF03, VF15
+ SUB.xyz VF06, VF15, VF12 NOP
+ ADD.xyz VF07, VF15, VF12 NOP
+ NOP NOP
+ CLIPw.xyz VF12, VF03 MR32.xyzw VF04, VF03
+ NOP NOP
+ ADDq.x VF09, VF00, Q DIV Q, VF00w, VF08y
+ NOP NOP
+ CLIPw.xyz VF12, VF04 MR32.xyzw VF05, VF04
+ SUB.xyz VF07, VF00, VF07 IADDIU VI06, VI00, 0xCC
+ NOP IADDIU VI07, VI00, 0x30
+ NOP NOP
+ CLIPw.xyz VF12, VF05 FCGET VI02
+ NOP IAND VI02, VI02, VI06
+ ADDq.y VF09, VF00, Q DIV Q, VF00w, VF08z
+ SUB.xyz VF10, VF00, VF10 NOP
+ CLIPw.xyz VF13, VF03 FCGET VI03
+ CLIPw.xyz VF13, VF04 IAND VI03, VI03, VI07
+ CLIPw.xyz VF13, VF05 FCAND VI01, 0x3330
+ NOP IBEQ VI01, VI00, StartPointInsideAABB
+ NOP NOP
+ ADDq.z VF09, VF00, Q FCGET VI04
+ NOP FCGET VI05
+ NOP IAND VI04, VI04, VI06
+ NOP IAND VI05, VI05, VI07
+ MULx.xyz VF17, VF08, VF09 NOP
+ MULy.xyz VF18, VF08, VF09 IADDIU VI07, VI00, 0x80
+ MULz.xyz VF19, VF08, VF09 IAND VI06, VI02, VI07
+ MUL.w VF10, VF00, VF00 IAND VI07, VI04, VI07
+ NOP NOP
+ NOP IBEQ VI06, VI07, CheckMaxXSide
+ NOP NOP
+ MULAx.xyz ACC, VF17, VF07 NOP
+ MADDw.xyz VF16, VF12, VF00 NOP
+ MUL.x VF10, VF07, VF09 NOP
+ CLIPw.xyz VF16, VF04 NOP
+ CLIPw.xyz VF16, VF05 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0x330
+ NOP IBNE VI01, VI00, CheckMaxXSide
+ NOP NOP
+ MULx.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
+ ADD.yz VF02, VF00, VF00 MOVE.xyzw VF01, VF16
+ SUBw.x VF02, VF00, VF00 NOP
+CheckMaxXSide:
+ MULAx.xyz ACC, VF17, VF06 IADDIU VI07, VI00, 0x40
+ MADDw.xyz VF16, VF12, VF00 IAND VI06, VI02, VI07
+ MUL.x VF10, VF06, VF09 IAND VI07, VI04, VI07
+ NOP NOP
+ NOP IBEQ VI06, VI07, CheckMinYSide
+ NOP NOP
+ CLIPw.xyz VF16, VF04 NOP
+ CLIPw.xyz VF16, VF05 NOP
+ CLIPw.xyz VF10, VF10 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0xCC03
+ NOP IBNE VI01, VI00, CheckMinYSide
+ NOP NOP
+ MULx.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
+ ADD.yz VF02, VF00, VF00 MOVE.xyzw VF01, VF16
+ ADDw.x VF02, VF00, VF00 NOP
+CheckMinYSide:
+ MULAy.xyz ACC, VF18, VF07 IADDIU VI07, VI00, 0x8
+ MADDw.xyz VF16, VF12, VF00 IAND VI06, VI02, VI07
+ MUL.y VF10, VF07, VF09 IAND VI07, VI04, VI07
+ NOP NOP
+ NOP IBEQ VI06, VI07, CheckMaxYSide
+ NOP NOP
+ CLIPw.xyz VF16, VF03 NOP
+ CLIPw.xyz VF16, VF05 NOP
+ CLIPw.xyz VF10, VF10 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0x3C0C
+ NOP IBNE VI01, VI00, CheckMaxYSide
+ NOP NOP
+ MULy.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
+ ADD.xz VF02, VF00, VF00 MOVE.xyzw VF01, VF16
+ SUBw.y VF02, VF00, VF00 NOP
+CheckMaxYSide:
+ MULAy.xyz ACC, VF18, VF06 IADDIU VI07, VI00, 0x4
+ MADDw.xyz VF16, VF12, VF00 IAND VI06, VI02, VI07
+ MUL.y VF10, VF06, VF09 IAND VI07, VI04, VI07
+ NOP NOP
+ NOP IBEQ VI06, VI07, CheckMinZSide
+ NOP NOP
+ CLIPw.xyz VF16, VF03 NOP
+ CLIPw.xyz VF16, VF05 NOP
+ CLIPw.xyz VF10, VF10 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0x3C0C
+ NOP IBNE VI01, VI00, CheckMinZSide
+ NOP NOP
+ MULy.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
+ ADD.xz VF02, VF00, VF00 MOVE.xyzw VF01, VF16
+ ADDw.y VF02, VF00, VF00 NOP
+CheckMinZSide:
+ MULAz.xyz ACC, VF19, VF07 IADDIU VI07, VI00, 0x20
+ MADDw.xyz VF16, VF12, VF00 IAND VI06, VI03, VI07
+ MUL.z VF10, VF07, VF09 IAND VI07, VI05, VI07
+ NOP NOP
+ NOP IBEQ VI06, VI07, CheckMaxZSide
+ NOP NOP
+ CLIPw.xyz VF16, VF03 NOP
+ CLIPw.xyz VF16, VF04 NOP
+ CLIPw.xyz VF10, VF10 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0x3330
+ NOP IBNE VI01, VI00, CheckMaxZSide
+ NOP NOP
+ MULz.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
+ ADD.xy VF02, VF00, VF00 MOVE.xyzw VF01, VF16
+ SUBw.z VF02, VF00, VF00 NOP
+CheckMaxZSide:
+ MULAz.xyz ACC, VF19, VF06 IADDIU VI07, VI00, 0x10
+ MADDw.xyz VF16, VF12, VF00 IAND VI06, VI03, VI07
+ MUL.z VF10, VF06, VF09 IAND VI07, VI05, VI07
+ NOP NOP
+ NOP IBEQ VI06, VI07, DoneAllChecks
+ NOP NOP
+ CLIPw.xyz VF16, VF03 NOP
+ CLIPw.xyz VF16, VF04 NOP
+ CLIPw.xyz VF10, VF10 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0x3330
+ NOP IBNE VI01, VI00, DoneAllChecks
+ NOP NOP
+ MULz.w VF10, VF00, VF10 IADDIU VI08, VI00, 0x1
+ ADD.xy VF02, VF00, VF00 MOVE.xyzw VF01, VF16
+ ADDw.z VF02, VF00, VF00 NOP
+DoneAllChecks:
+ ADD.xyz VF01, VF01, VF14 IADD VI01, VI00, VI08
+ NOP[E] NOP
+ NOP NOP
+StartPointInsideAABB:
+ ADD.xyz VF01, VF12, VF14 WAITQ
+ NOP IADDIU VI01, VI00, 0x1
+ NOP[E] NOP
+ NOP NOP
+
+
+; 860
+.globl Vu0LineToTriangleCollisionCompressedStart
+Vu0LineToTriangleCollisionCompressedStart:
+ ITOF0.xyzw VF17, VF17 LOI 0.000244140625 ; 1.0/4096.0
+ ITOF0.xyzw VF14, VF14 NOP
+ ITOF0.xyzw VF15, VF15 NOP
+ ITOF0.xyzw VF16, VF16 NOP
+ MULi.xyz VF17, VF17, I LOI 0.0078125 ; 1.0/128.0
+ MULi.w VF17, VF17, I NOP
+ MULi.xyzw VF14, VF14, I NOP
+ MULi.xyzw VF15, VF15, I NOP
+ MULi.xyzw VF16, VF16, I NOP
+; fall through
+
+; 8A8
+; VF12: point0
+; VF13: point1
+; VF14-16: verts
+; VF17: plane
+; out:
+; VF01: intersection point
+; VF02: triangle normal
+; VF03 x: intersection parameter
+.globl Vu0LineToTriangleCollisionStart
+Vu0LineToTriangleCollisionStart:
+ MUL.xyz VF10, VF17, VF12 LOI 0.5
+ MUL.xyz VF11, VF17, VF13 NOP
+ SUB.xyz VF02, VF13, VF12 NOP ; line dist
+ ADD.xyz VF17, VF17, VF00 NOP
+ MULi.w VF03, VF00, I NOP
+ MULAx.w ACC, VF00, VF10 NOP
+ MADDAy.w ACC, VF00, VF10 IADDIU VI06, VI00, 0xE0
+ MADDz.w VF10, VF00, VF10 FMAND VI05, VI06 ; -- normal sign flags, unused
+ MULAx.w ACC, VF00, VF11 NOP
+ MADDAy.w ACC, VF00, VF11 NOP
+ MADDz.w VF11, VF00, VF11 NOP
+ SUB.w VF09, VF17, VF10 NOP ; plane-pos 0
+ CLIPw.xyz VF17, VF03 NOP ; compare normal against 0.5 to figure out which in which dimension to compare
+ NOP IADDIU VI02, VI00, 0x10 ; Sw flag
+ SUBA.w ACC, VF17, VF11 NOP ; plane-pos 1
+ SUB.w VF08, VF11, VF10 FMAND VI01, VI02
+ NOP NOP
+ NOP NOP
+ NOP FMAND VI02, VI02
+ NOP IBEQ VI01, VI02, QuitAndFail ; if on same side, no collision
+ NOP NOP
+ NOP DIV Q, VF09w, VF08w ; parameter of intersection
+ NOP FCAND VI01, 0x3 ; check x direction
+ NOP IADDIU VI02, VI01, 0x7F
+ NOP IADDIU VI06, VI00, 0x80
+ NOP IAND VI02, VI02, VI06 ; Sx flag
+ NOP FCAND VI01, 0xC ; check y direction
+ NOP IADDIU VI03, VI01, 0x3F
+ MULAw.xyz ACC, VF12, VF00 IADDIU VI06, VI00, 0x40
+ MADDq.xyz VF01, VF02, Q IAND VI03, VI03, VI06 ; point of intersection -- Sy flag
+ MULx.w VF01, VF00, VF00 FCAND VI01, 0x30 ; -- check z direction
+ ADDq.x VF03, VF00, Q IADDIU VI04, VI01, 0x1F ; output parameter
+ SUB.xyz VF05, VF15, VF14 IADDIU VI06, VI00, 0x20 ; edge vectors
+ SUB.xyz VF08, VF01, VF14 IAND VI04, VI04, VI06 ; edge vectors -- Sz flag
+ SUB.xyz VF06, VF16, VF15 IADD VI06, VI02, VI03 ; edge vectors
+ SUB.xyz VF09, VF01, VF15 IADD VI06, VI06, VI04 ; edge vectors -- combine flags
+ SUB.xyz VF07, VF14, VF16 NOP ; edge vectors
+ SUB.xyz VF10, VF01, VF16 NOP ; edge vectors
+ OPMULA.xyz ACC, VF08, VF05 NOP
+ OPMSUB.xyz VF18, VF05, VF08 NOP ; cross1
+ OPMULA.xyz ACC, VF09, VF06 NOP
+ OPMSUB.xyz VF19, VF06, VF09 NOP ; cross2
+ OPMULA.xyz ACC, VF10, VF07 NOP
+ OPMSUB.xyz VF20, VF07, VF10 FMAND VI02, VI06 ; cross3
+ NOP NOP
+ NOP FMAND VI03, VI06
+ NOP NOP
+ NOP FMAND VI04, VI06
+ NOP NOP
+ NOP IBNE VI03, VI02, QuitAndFail ; point has to lie on the same side of all edges (i.e. inside)
+ NOP NOP
+ NOP IBNE VI04, VI02, QuitAndFail
+ NOP NOP
+ MULw.xyz VF02, VF17, VF00 IADDIU VI01, VI00, 0x1 ; success
+ NOP[E] NOP
+ NOP NOP
+
+
+; A68
+; VF12: center
+; VF14: line origin
+; VF15: line vector to other point
+; out: VF16 xyz: nearest point on line; w: distance to that point
+DistanceBetweenSphereAndLine:
+ SUB.xyz VF20, VF12, VF14 NOP
+ MUL.xyz VF21, VF15, VF15 NOP
+ ADDA.xyz ACC, VF14, VF15 NOP
+ MSUBw.xyz VF25, VF12, VF00 NOP ; VF25 = VF12 - (VF14+VF15)
+ MUL.xyz VF22, VF20, VF20 NOP
+ MUL.xyz VF23, VF20, VF15 NOP
+ MULAx.w ACC, VF00, VF21 NOP
+ MADDAy.w ACC, VF00, VF21 NOP
+ MADDz.w VF21, VF00, VF21 NOP ; MagSq VF15 (line length)
+ MULAx.w ACC, VF00, VF23 NOP
+ MADDAy.w ACC, VF00, VF23 NOP
+ MADDz.w VF23, VF00, VF23 NOP ; dot(VF12-VF14, VF15)
+ MULAx.w ACC, VF00, VF22 NOP
+ MADDAy.w ACC, VF00, VF22 NOP
+ MADDz.w VF22, VF00, VF22 IADDIU VI08, VI00, 0x10 ; MagSq VF12-VF14 -- Sw bit
+ MUL.xyz VF25, VF25, VF25 FMAND VI08, VI08
+ NOP DIV Q, VF23w, VF21w
+ NOP IBNE VI00, VI08, NegativeRatio
+ NOP NOP
+ ADDA.xyz ACC, VF00, VF14 NOP
+ MADDq.xyz VF16, VF15, Q WAITQ ; nearest point on infinte line
+ ADDq.x VF24, VF00, Q NOP ; ratio
+ NOP NOP
+ NOP NOP
+ SUB.xyz VF26, VF16, VF12 NOP
+ CLIPw.xyz VF24, VF00 NOP ; compare ratio to 1.0
+ NOP NOP
+ NOP NOP
+ MUL.xyz VF26, VF26, VF26 NOP
+ NOP FCAND VI01, 0x1
+ NOP IBNE VI00, VI01, RatioGreaterThanOne
+ NOP NOP
+ MULAx.w ACC, VF00, VF26 NOP
+ MADDAy.w ACC, VF00, VF26 NOP
+ MADDz.w VF16, VF00, VF26 NOP ; distance
+ NOP JR VI15
+ NOP NOP
+NegativeRatio:
+ ADD.xyz VF16, VF00, VF14 NOP ; return line origin
+ MUL.w VF16, VF00, VF22 NOP ; and DistSq to it
+ NOP JR VI15
+ NOP NOP
+RatioGreaterThanOne:
+ MULAx.w ACC, VF00, VF25 NOP
+ MADDAy.w ACC, VF00, VF25 NOP
+ MADDz.w VF16, VF00, VF25 NOP
+ ADD.xyz VF16, VF14, VF15 NOP ; return toerh line point
+ NOP JR VI15
+ NOP NOP
+
+
+; BE0
+.globl Vu0SphereToTriangleCollisionCompressedStart
+Vu0SphereToTriangleCollisionCompressedStart:
+ ITOF0.xyzw VF17, VF17 LOI 0.000244140625 ; 1.0/4096.0
+ ITOF0.xyzw VF14, VF14 NOP
+ ITOF0.xyzw VF15, VF15 NOP
+ ITOF0.xyzw VF16, VF16 NOP
+ MULi.xyz VF17, VF17, I LOI 0.0078125 ; 1.0/128.0
+ MULi.w VF17, VF17, I NOP
+ MULi.xyzw VF14, VF14, I NOP
+ MULi.xyzw VF15, VF15, I NOP
+ MULi.xyzw VF16, VF16, I NOP
+; fall through
+
+; C28
+; VF12: sphere
+; VF14-16: verts
+; VF17: plane
+; out:
+; VF01: intersection point
+; VF02: triangle normal
+; VF03 x: intersection parameter
+.globl Vu0SphereToTriangleCollisionStart
+Vu0SphereToTriangleCollisionStart:
+ MUL.xyz VF02, VF12, VF17 LOI 0.1
+ ADD.xyz VF17, VF17, VF00 NOP
+ ADDw.x VF13, VF00, VF12 NOP
+ NOP NOP
+ MULAx.w ACC, VF00, VF02 IADDIU VI06, VI00, 0xE0
+ MADDAy.w ACC, VF00, VF02 FMAND VI05, VI06 ; normal sign flags
+ MADDAz.w ACC, VF00, VF02 NOP
+ MSUB.w VF02, VF00, VF17 NOP ; center plane pos
+ MULi.w VF03, VF00, I MOVE.xyzw VF04, VF03
+ NOP NOP
+ NOP NOP
+ CLIPw.xyz VF13, VF02 NOP ; compare dist and radius
+ CLIPw.xyz VF17, VF03 NOP
+ MULAw.xyz ACC, VF12, VF00 IADDIU VI07, VI00, 0x0 ; -- clear test case
+ MSUBw.xyz VF01, VF17, VF02 NOP
+ MULx.w VF01, VF00, VF00 FCAND VI01, 0x3 ; projected center on plane
+ ABS.w VF02, VF02 IBEQ VI00, VI01, QuitAndFail ; no intersection
+ NOP NOP
+ NOP FCAND VI01, 0x3 ; -- check x direction
+ SUB.xyz VF02, VF12, VF01 IADDIU VI02, VI01, 0x7F
+ NOP IADDIU VI06, VI00, 0x80
+ SUB.xyz VF05, VF15, VF14 IAND VI02, VI02, VI06
+ SUB.xyz VF08, VF01, VF14 FCAND VI01, 0xC ; -- check y direction
+ SUB.xyz VF06, VF16, VF15 IADDIU VI03, VI01, 0x3F
+ SUB.xyz VF09, VF01, VF15 IADDIU VI06, VI00, 0x40
+ SUB.xyz VF07, VF14, VF16 IAND VI03, VI03, VI06
+ SUB.xyz VF10, VF01, VF16 FCAND VI01, 0x30 ; -- check z direction
+ MUL.xyz VF03, VF02, VF02 IADDIU VI04, VI01, 0x1F
+ OPMULA.xyz ACC, VF08, VF05 IADDIU VI06, VI00, 0x20
+ OPMSUB.xyz VF18, VF05, VF08 IAND VI04, VI04, VI06
+ OPMULA.xyz ACC, VF09, VF06 NOP
+ OPMSUB.xyz VF19, VF06, VF09 IADD VI06, VI02, VI03
+ OPMULA.xyz ACC, VF10, VF07 IADD VI06, VI06, VI04 ; -- combine flags
+ OPMSUB.xyz VF20, VF07, VF10 FMAND VI02, VI06 ; -- cross 1 flags
+ MULAx.w ACC, VF00, VF03 IAND VI05, VI05, VI06
+ MADDAy.w ACC, VF00, VF03 FMAND VI03, VI06 ; -- cross 2 flags
+ MADDz.w VF03, VF00, VF03 IADDIU VI08, VI00, 0x3
+ NOP FMAND VI04, VI06 ; -- cross 3 flags
+ NOP NOP
+ NOP IBNE VI02, VI05, CheckSide2
+ NOP RSQRT Q, VF00w, VF03w
+ ADD.xyz VF04, VF00, VF16 IADDIU VI07, VI07, 0x1 ; inside side 1
+CheckSide2:
+ NOP IBNE VI03, VI05, CheckSide3
+ NOP NOP
+ ADD.xyz VF04, VF00, VF14 IADDIU VI07, VI07, 0x1 ; inside side 2
+CheckSide3:
+ NOP IBNE VI04, VI05, FinishCheckingSides
+ NOP NOP
+ ADD.xyz VF04, VF00, VF15 IADDIU VI07, VI07, 0x1 ; inside side 3
+ NOP NOP
+ NOP IBEQ VI07, VI08, TotallyInsideTriangle
+ NOP NOP
+FinishCheckingSides:
+ MUL.x VF13, VF13, VF13 IADDIU VI08, VI00, 0x2
+ MULq.xyz VF02, VF02, Q WAITQ
+ NOP IBNE VI07, VI08, IntersectionOutsideTwoSides
+ NOP NOP
+ NOP IBEQ VI02, VI05, CheckDistanceSide2
+ NOP NOP
+ NOP MOVE.xyzw VF15, VF05
+ NOP BAL VI15, DistanceBetweenSphereAndLine
+ NOP NOP
+ NOP B ProcessLineResult
+ NOP NOP
+CheckDistanceSide2:
+ NOP IBEQ VI03, VI05, CheckDistanceSide3
+ NOP NOP
+ NOP MOVE.xyzw VF14, VF15
+ NOP MOVE.xyzw VF15, VF06
+ NOP BAL VI15, DistanceBetweenSphereAndLine
+ NOP NOP
+ NOP B ProcessLineResult
+ NOP NOP
+CheckDistanceSide3:
+ NOP MOVE.xyzw VF14, VF16
+ NOP MOVE.xyzw VF15, VF07
+ NOP BAL VI15, DistanceBetweenSphereAndLine
+ NOP NOP
+ NOP B ProcessLineResult
+ NOP NOP
+IntersectionOutsideTwoSides:
+ SUB.xyz VF05, VF04, VF12 NOP
+ ADD.xyz VF01, VF00, VF04 NOP ; col point
+ SUB.xyz VF02, VF12, VF04 NOP
+ NOP NOP
+ MUL.xyz VF05, VF05, VF05 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ MULAx.w ACC, VF00, VF05 NOP
+ MADDAy.w ACC, VF00, VF05 NOP
+ MADDz.w VF05, VF00, VF05 NOP ; distSq to vertex
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ CLIPw.xyz VF13, VF05 SQRT Q, VF05w ; compare radiusSq and distSq
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0x1
+ ADDq.x VF03, VF00, Q WAITQ ; dist to vertex
+ NOP IBEQ VI00, VI01, QuitAndFail ; too far
+ NOP NOP
+ NOP NOP
+ NOP DIV Q, VF00w, VF03x
+ MULq.xyz VF02, VF02, Q WAITQ ; col normal
+ NOP[E] NOP
+ NOP NOP
+TotallyInsideTriangle:
+ ADDw.x VF03, VF00, VF02 WAITQ
+ MULq.xyz VF02, VF02, Q NOP
+ NOP[E] IADDIU VI01, VI00, 0x1
+ NOP NOP
+ProcessLineResult:
+ CLIPw.xyz VF13, VF16 SQRT Q, VF16w
+ ADD.xyz VF01, VF00, VF16 NOP
+ SUB.xyz VF02, VF12, VF16 NOP
+ NOP NOP
+ NOP FCAND VI01, 0x1
+ ADDq.x VF03, VF00, Q WAITQ
+ NOP IBEQ VI00, VI01, QuitAndFail
+ NOP NOP
+ NOP NOP
+ NOP DIV Q, VF00w, VF03x
+ MULq.xyz VF02, VF02, Q WAITQ
+ NOP[E] NOP
+ NOP NOP
+
+EndOfMicrocode:
diff --git a/src/core/vu0Collision_2.s b/src/core/vu0Collision_2.s
new file mode 100644
index 00000000..716c29ac
--- /dev/null
+++ b/src/core/vu0Collision_2.s
@@ -0,0 +1,191 @@
+QuitAndFail2:
+ NOP[E] IADDIU VI01, VI00, 0x0
+ NOP NOP
+
+
+QuitAndSucceed2:
+ NOP[E] IADDIU VI01, VI00, 0x1
+ NOP NOP
+
+
+; 20
+GetBBVertices:
+ MULw.xy VF02, VF01, VF00 NOP
+ MUL.z VF02, VF01, VF11 NOP
+ MULw.xz VF03, VF01, VF00 NOP
+ MUL.y VF03, VF01, VF11 NOP
+ MULw.x VF04, VF01, VF00 NOP
+ MUL.yz VF04, VF01, VF11 NOP
+ NOP JR VI15
+ NOP NOP
+
+
+; 60
+Vu0OBBToOBBCollision:
+ SUBw.xyz VF11, VF00, VF00 LOI 0.5
+ MULi.xyz VF12, VF12, I NOP
+ MULi.xyz VF13, VF13, I NOP
+ NOP NOP
+ NOP NOP
+ NOP MOVE.xyz VF01, VF12
+ NOP BAL VI15, GetBBVertices
+ NOP NOP
+ MULAx.xyz ACC, VF14, VF01 NOP
+ MADDAy.xyz ACC, VF15, VF01 NOP
+ MADDz.xyz VF01, VF16, VF01 NOP
+ MULAx.xyz ACC, VF14, VF02 NOP
+ MADDAy.xyz ACC, VF15, VF02 NOP
+ MADDz.xyz VF02, VF16, VF02 NOP
+ MULAx.xyz ACC, VF14, VF03 NOP
+ MADDAy.xyz ACC, VF15, VF03 NOP
+ MADDz.xyz VF03, VF16, VF03 NOP
+ MULAx.xyz ACC, VF14, VF04 NOP
+ MADDAy.xyz ACC, VF15, VF04 NOP
+ MADDz.xyz VF04, VF16, VF04 NOP
+ ABS.xyz VF05, VF01 NOP
+ ABS.xyz VF06, VF02 NOP
+ ABS.xyz VF07, VF03 NOP
+ ABS.xyz VF08, VF04 NOP
+ NOP NOP
+ MAX.xyz VF05, VF05, VF06 NOP
+ NOP NOP
+ MAX.xyz VF07, VF07, VF08 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ MAX.xyz VF05, VF05, VF07 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ ADD.xyz VF09, VF05, VF13 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ MULx.w VF05, VF00, VF09 NOP
+ MULy.w VF06, VF00, VF09 NOP
+ MULz.w VF07, VF00, VF09 NOP
+ CLIPw.xyz VF17, VF05 NOP
+ CLIPw.xyz VF17, VF06 NOP
+ CLIPw.xyz VF17, VF07 MOVE.xyz VF01, VF13
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0x3330
+ NOP IBNE VI01, VI00, QuitAndFail2
+ NOP NOP
+ NOP BAL VI15, GetBBVertices
+ NOP NOP
+ MULAx.xyz ACC, VF18, VF01 NOP
+ MADDAy.xyz ACC, VF19, VF01 NOP
+ MADDz.xyz VF01, VF20, VF01 NOP
+ MULAx.xyz ACC, VF18, VF02 NOP
+ MADDAy.xyz ACC, VF19, VF02 NOP
+ MADDz.xyz VF02, VF20, VF02 NOP
+ MULAx.xyz ACC, VF18, VF03 NOP
+ MADDAy.xyz ACC, VF19, VF03 NOP
+ MADDz.xyz VF03, VF20, VF03 NOP
+ MULAx.xyz ACC, VF18, VF04 NOP
+ MADDAy.xyz ACC, VF19, VF04 NOP
+ MADDz.xyz VF04, VF20, VF04 NOP
+ ABS.xyz VF05, VF01 NOP
+ ABS.xyz VF06, VF02 NOP
+ ABS.xyz VF07, VF03 NOP
+ ABS.xyz VF08, VF04 NOP
+ NOP NOP
+ MAX.xyz VF05, VF05, VF06 NOP
+ NOP NOP
+ MAX.xyz VF07, VF07, VF08 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ MAX.xyz VF05, VF05, VF07 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ ADD.xyz VF09, VF05, VF12 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ MULx.w VF05, VF00, VF09 NOP
+ MULy.w VF06, VF00, VF09 NOP
+ MULz.w VF07, VF00, VF09 NOP
+ CLIPw.xyz VF21, VF05 NOP
+ CLIPw.xyz VF21, VF06 NOP
+ CLIPw.xyz VF21, VF07 NOP
+ NOP NOP
+ NOP NOP
+ NOP NOP
+ NOP FCAND VI01, 0x3330
+ NOP IBNE VI01, VI00, QuitAndFail2
+ NOP NOP
+ SUB.xyz VF06, VF02, VF01 NOP
+ SUB.xyz VF07, VF03, VF01 NOP
+ ADD.xyz VF08, VF04, VF01 NOP
+ ADD.x VF09, VF00, VF12 NOP
+ ADD.yz VF09, VF00, VF00 NOP
+ ADD.y VF10, VF00, VF12 NOP
+ ADD.xz VF10, VF00, VF00 NOP
+ ADD.z VF11, VF00, VF12 IADDI VI04, VI00, 0x0
+ ADD.xy VF11, VF00, VF00 IADD VI02, VI00, VI00
+ OPMULA.xyz ACC, VF06, VF09 NOP
+ OPMSUB.xyz VF01, VF09, VF06 NOP
+ OPMULA.xyz ACC, VF06, VF10 NOP
+ OPMSUB.xyz VF02, VF10, VF06 NOP
+ OPMULA.xyz ACC, VF06, VF11 NOP
+ OPMSUB.xyz VF03, VF11, VF06 SQI.xyzw VF01, (VI02++)
+ OPMULA.xyz ACC, VF07, VF09 NOP
+ OPMSUB.xyz VF01, VF09, VF07 SQI.xyzw VF02, (VI02++)
+ OPMULA.xyz ACC, VF07, VF10 NOP
+ OPMSUB.xyz VF02, VF10, VF07 SQI.xyzw VF03, (VI02++)
+ OPMULA.xyz ACC, VF07, VF11 NOP
+ OPMSUB.xyz VF03, VF11, VF07 SQI.xyzw VF01, (VI02++)
+ OPMULA.xyz ACC, VF08, VF09 NOP
+ OPMSUB.xyz VF01, VF09, VF08 SQI.xyzw VF02, (VI02++)
+ OPMULA.xyz ACC, VF08, VF10 NOP
+ OPMSUB.xyz VF02, VF10, VF08 SQI.xyzw VF03, (VI02++)
+ OPMULA.xyz ACC, VF08, VF11 LOI 0.5
+ OPMSUB.xyz VF01, VF11, VF08 SQI.xyzw VF01, (VI02++)
+ MULi.xyz VF06, VF06, I NOP
+ MULi.xyz VF07, VF07, I SQI.xyzw VF02, (VI02++)
+ MULi.xyz VF08, VF08, I NOP
+ MUL.xyz VF02, VF21, VF01 NOP
+ MUL.xyz VF03, VF12, VF01 NOP
+ MUL.xyz VF09, VF06, VF01 NOP
+ MUL.xyz VF10, VF07, VF01 NOP
+ MUL.xyz VF11, VF08, VF01 NOP
+ ABS.xyz VF03, VF03 NOP
+ ADDy.x VF05, VF09, VF09 NOP
+ ADDx.y VF05, VF10, VF10 NOP
+ ADDx.z VF05, VF11, VF11 NOP
+ NOP NOP
+EdgePairLoop:
+ ADDz.x VF05, VF05, VF09 NOP
+ ADDz.y VF05, VF05, VF10 NOP
+ ADDy.z VF05, VF05, VF11 NOP
+ MULAx.w ACC, VF00, VF02 IADD VI03, VI02, VI00
+ MADDAy.w ACC, VF00, VF02 LQD.xyzw VF01, (--VI02)
+ MADDz.w VF02, VF00, VF02 NOP
+ ABS.xyz VF05, VF05 NOP
+ MULAx.w ACC, VF00, VF03 NOP
+ MADDAy.w ACC, VF00, VF03 NOP
+ MADDAz.w ACC, VF00, VF03 NOP
+ MADDAx.w ACC, VF00, VF05 NOP
+ MADDAy.w ACC, VF00, VF05 NOP
+ MADDz.w VF03, VF00, VF05 NOP
+ ADDw.x VF04, VF00, VF02 NOP
+ MUL.xyz VF02, VF21, VF01 NOP
+ MUL.xyz VF03, VF12, VF01 NOP
+ MUL.xyz VF09, VF06, VF01 NOP
+ CLIPw.xyz VF04, VF03 NOP
+ MUL.xyz VF10, VF07, VF01 NOP
+ MUL.xyz VF11, VF08, VF01 NOP
+ ABS.xyz VF03, VF03 NOP
+ ADDy.x VF05, VF09, VF09 FCAND VI01, 0x3
+ ADDx.y VF05, VF10, VF10 IBNE VI01, VI00, QuitAndFail2
+ ADDx.z VF05, VF11, VF11 NOP
+ NOP IBNE VI03, VI00, EdgePairLoop
+ NOP NOP
+ NOP[E] IADDIU VI01, VI00, 0x1
+ NOP NOP
+
+EndOfMicrocode2:
diff --git a/src/math/Matrix.h b/src/math/Matrix.h
index c849a5c4..e2d6b0e0 100644
--- a/src/math/Matrix.h
+++ b/src/math/Matrix.h
@@ -81,6 +81,7 @@ public:
m_matrix.pos.z += rhs.m_matrix.pos.z;
return *this;
}
+ CMatrix& operator*=(CMatrix const &rhs);
CVector &GetPosition(void){ return *(CVector*)&m_matrix.pos; }
CVector &GetRight(void) { return *(CVector*)&m_matrix.right; }
diff --git a/src/math/VuVector.h b/src/math/VuVector.h
new file mode 100644
index 00000000..f90818e0
--- /dev/null
+++ b/src/math/VuVector.h
@@ -0,0 +1,41 @@
+#pragma once
+
+class TYPEALIGN(16) CVuVector : public CVector
+{
+public:
+ float w;
+ CVuVector(void) {}
+ CVuVector(float x, float y, float z) : CVector(x, y, z) {}
+ CVuVector(float x, float y, float z, float w) : CVector(x, y, z), w(w) {}
+ CVuVector(const CVector &v) : CVector(v.x, v.y, v.z) {}
+#ifdef RWCORE_H
+ CVuVector(const RwV3d &v) : CVector(v.x, v.y, v.z) {}
+
+ operator RwV3d (void) const {
+ RwV3d vecRw = { this->x, this->y, this->z };
+ return vecRw;
+ }
+
+ operator RwV3d *(void) {
+ return (RwV3d*)this;
+ }
+#endif
+/*
+ void Normalise(void) {
+ float sq = MagnitudeSqr();
+ // TODO: VU0 code
+ if(sq > 0.0f){
+ float invsqrt = RecipSqrt(sq);
+ x *= invsqrt;
+ y *= invsqrt;
+ z *= invsqrt;
+ }else
+ x = 1.0f;
+ }
+*/
+};
+
+void TransformPoint(CVuVector &out, const CMatrix &mat, const CVuVector &in);
+void TransformPoint(CVuVector &out, const CMatrix &mat, const RwV3d &in);
+void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const RwV3d *in, int stride);
+void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const CVuVector *in);
diff --git a/src/math/math.cpp b/src/math/math.cpp
index 0cfc2ce9..4792fdd0 100644
--- a/src/math/math.cpp
+++ b/src/math/math.cpp
@@ -1,9 +1,124 @@
#include "common.h"
#include "Quaternion.h"
+#include "VuVector.h"
// TODO: move more stuff into here
+
+void TransformPoint(CVuVector &out, const CMatrix &mat, const CVuVector &in)
+{
+#ifdef GTA_PS2
+ __asm__ __volatile__("\n\
+ lqc2 vf01,0x0(%2)\n\
+ lqc2 vf02,0x0(%1)\n\
+ lqc2 vf03,0x10(%1)\n\
+ lqc2 vf04,0x20(%1)\n\
+ lqc2 vf05,0x30(%1)\n\
+ vmulax.xyz ACC, vf02,vf01\n\
+ vmadday.xyz ACC, vf03,vf01\n\
+ vmaddaz.xyz ACC, vf04,vf01\n\
+ vmaddw.xyz vf06,vf05,vf00\n\
+ sqc2 vf06,0x0(%0)\n\
+ ": : "r" (&out) , "r" (&mat) ,"r" (&in): "memory");
+#else
+ out = mat * in;
+#endif
+}
+
+void TransformPoint(CVuVector &out, const CMatrix &mat, const RwV3d &in)
+{
+#ifdef GTA_PS2
+ __asm__ __volatile__("\n\
+ ldr $8,0x0(%2)\n\
+ ldl $8,0x7(%2)\n\
+ lw $9,0x8(%2)\n\
+ pcpyld $10,$9,$8\n\
+ qmtc2 $10,vf01\n\
+ lqc2 vf02,0x0(%1)\n\
+ lqc2 vf03,0x10(%1)\n\
+ lqc2 vf04,0x20(%1)\n\
+ lqc2 vf05,0x30(%1)\n\
+ vmulax.xyz ACC, vf02,vf01\n\
+ vmadday.xyz ACC, vf03,vf01\n\
+ vmaddaz.xyz ACC, vf04,vf01\n\
+ vmaddw.xyz vf06,vf05,vf00\n\
+ sqc2 vf06,0x0(%0)\n\
+ ": : "r" (&out) , "r" (&mat) ,"r" (&in): "memory");
+#else
+ out = mat * in;
+#endif
+}
+
+void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const RwV3d *in, int stride)
+{
+#ifdef GTA_PS3
+ __asm__ __volatile__("\n\
+ paddub $3,%4,$0\n\
+ lqc2 vf02,0x0(%2)\n\
+ lqc2 vf03,0x10(%2)\n\
+ lqc2 vf04,0x20(%2)\n\
+ lqc2 vf05,0x30(%2)\n\
+ ldr $8,0x0(%3)\n\
+ ldl $8,0x7(%3)\n\
+ lw $9,0x8(%3)\n\
+ pcpyld $10,$9,$8\n\
+ qmtc2 $10,vf01\n\
+ 1: vmulax.xyz ACC, vf02,vf01\n\
+ vmadday.xyz ACC, vf03,vf01\n\
+ vmaddaz.xyz ACC, vf04,vf01\n\
+ vmaddw.xyz vf06,vf05,vf00\n\
+ add %3,%3,$3\n\
+ ldr $8,0x0(%3)\n\
+ ldl $8,0x7(%3)\n\
+ lw $9,0x8(%3)\n\
+ pcpyld $10,$9,$8\n\
+ qmtc2 $10,vf01\n\
+ addi %1,%1,-1\n\
+ addiu %0,%0,0x10\n\
+ sqc2 vf06,-0x10(%0)\n\
+ bnez %1,1b\n\
+ ": : "r" (out) , "r" (n), "r" (&mat), "r" (in), "r" (stride): "memory");
+#else
+ while(n--){
+ *out = mat * *in;
+ in = (RwV3d*)((uint8*)in + stride);
+ out++;
+ }
+#endif
+}
+
+void TransformPoints(CVuVector *out, int n, const CMatrix &mat, const CVuVector *in)
+{
+#ifdef GTA_PS2
+ __asm__ __volatile__("\n\
+ lqc2 vf02,0x0(%2)\n\
+ lqc2 vf03,0x10(%2)\n\
+ lqc2 vf04,0x20(%2)\n\
+ lqc2 vf05,0x30(%2)\n\
+ lqc2 vf01,0x0(%3)\n\
+ nop\n\
+ 1: vmulax.xyz ACC, vf02,vf01\n\
+ vmadday.xyz ACC, vf03,vf01\n\
+ vmaddaz.xyz ACC, vf04,vf01\n\
+ vmaddw.xyz vf06,vf05,vf00\n\
+ lqc2 vf01,0x10(%3)\n\
+ addiu %3,%3,0x10\n\
+ addi %1,%1,-1\n\
+ addiu %0,%0,0x10\n\
+ sqc2 vf06,-0x10(%0)\n\
+ bnez %1,1b\n\
+ ": : "r" (out) , "r" (n), "r" (&mat) ,"r" (in): "memory");
+#else
+ while(n--){
+ *out = mat * *in;
+ in++;
+ out++;
+ }
+#endif
+}
+
+
void
CVector2D::Normalise(void)
{
@@ -87,6 +202,7 @@ CMatrix::Reorthogonalise(void)
CMatrix&
Invert(const CMatrix &src, CMatrix &dst)
{
+ // TODO: VU0 code
// GTA handles this as a raw 4x4 orthonormal matrix
// and trashes the RW flags, let's not do that
// actual copy of librw code:
@@ -117,6 +233,7 @@ Invert(const CMatrix &src, CMatrix &dst)
CVector
operator*(const CMatrix &mat, const CVector &vec)
{
+ // TODO: VU0 code
return CVector(
mat.m_matrix.right.x * vec.x + mat.m_matrix.up.x * vec.y + mat.m_matrix.at.x * vec.z + mat.m_matrix.pos.x,
mat.m_matrix.right.y * vec.x + mat.m_matrix.up.y * vec.y + mat.m_matrix.at.y * vec.z + mat.m_matrix.pos.y,
@@ -126,6 +243,7 @@ operator*(const CMatrix &mat, const CVector &vec)
CMatrix
operator*(const CMatrix &m1, const CMatrix &m2)
{
+ // TODO: VU0 code
CMatrix out;
RwMatrix *dst = &out.m_matrix;
const RwMatrix *src1 = &m1.m_matrix;
@@ -145,9 +263,18 @@ operator*(const CMatrix &m1, const CMatrix &m2)
return out;
}
+CMatrix&
+CMatrix::operator*=(CMatrix const &rhs)
+{
+ // TODO: VU0 code
+ *this = *this * rhs;
+ return *this;
+}
+
const CVector
Multiply3x3(const CMatrix &mat, const CVector &vec)
{
+ // TODO: VU0 code
return CVector(
mat.m_matrix.right.x * vec.x + mat.m_matrix.up.x * vec.y + mat.m_matrix.at.x * vec.z,
mat.m_matrix.right.y * vec.x + mat.m_matrix.up.y * vec.y + mat.m_matrix.at.y * vec.z,
@@ -179,6 +306,7 @@ CQuaternion::Slerp(const CQuaternion &q1, const CQuaternion &q2, float theta, fl
w1 = Sin((1.0f - t) * theta) * invSin;
w2 = Sin(t * theta) * invSin;
}
+ // TODO: VU0 code
*this = w1*q1 + w2*q2;
}
}
diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp
index 6d106b0e..f289697e 100644
--- a/src/peds/CopPed.cpp
+++ b/src/peds/CopPed.cpp
@@ -45,7 +45,7 @@ CCopPed::CCopPed(eCopType copType) : CPed(PEDTYPE_COP)
SetCurrentWeapon(WEAPONTYPE_UZI);
m_fArmour = 50.0f;
m_wepSkills = 32; /* TODO: what is this? seems unused */
- m_wepAccuracy = 64;
+ m_wepAccuracy = 68;
break;
case COP_ARMY:
SetModelIndex(MI_ARMY);
@@ -479,7 +479,7 @@ CCopPed::CopAI(void)
SetAttack(playerOrHisVeh);
SetShootTimer(CGeneral::GetRandomNumberInRange(500, 1000));
}
- SetAttackTimer(CGeneral::GetRandomNumberInRange(100, 300));
+ SetAttackTimer(CGeneral::GetRandomNumberInRange(200, 300));
}
SetMoveState(PEDMOVE_STILL);
}
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index 1357907d..0756df38 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -1104,7 +1104,11 @@ CPopulation::ManagePopulation(void)
}
int pedPoolSize = CPools::GetPedPool()->GetSize();
+#ifndef SQUEEZE_PERFORMANCE
for (int poolIndex = pedPoolSize-1; poolIndex >= 0; poolIndex--) {
+#else
+ for (int poolIndex = (pedPoolSize * (frameMod32 + 1) / 32) - 1; poolIndex >= pedPoolSize * frameMod32 / 32; poolIndex--) {
+#endif
CPed *ped = CPools::GetPedPool()->GetSlot(poolIndex);
if (ped && !ped->IsPlayer() && ped->CanBeDeleted() && !ped->bInVehicle) {
@@ -1117,6 +1121,13 @@ CPopulation::ManagePopulation(void)
}
float dist = (ped->GetPosition() - playerPos).Magnitude2D();
+#ifdef SQUEEZE_PERFORMANCE
+ if (dist > 50.f)
+ ped->bUsesCollision = false;
+ else
+ ped->bUsesCollision = true;
+#endif
+
bool pedIsFarAway = false;
if (PedCreationDistMultiplier() * (PED_REMOVE_DIST_SPECIAL * TheCamera.GenerationDistMultiplier) < dist
|| (!ped->bCullExtraFarAway && PedCreationDistMultiplier() * PED_REMOVE_DIST * TheCamera.GenerationDistMultiplier < dist)
diff --git a/src/render/Fluff.cpp b/src/render/Fluff.cpp
index f86801bf..690a1d3f 100644
--- a/src/render/Fluff.cpp
+++ b/src/render/Fluff.cpp
@@ -152,9 +152,9 @@ void CMovingThings::Shutdown()
void CMovingThings::Update()
{
- const int TIME_SPAN = 64; // frames to process all aMovingThings
-
int16 i;
+#ifndef SQUEEZE_PERFORMANCE
+ const int TIME_SPAN = 64; // frames to process all aMovingThings
int block = CTimer::GetFrameCounter() % TIME_SPAN;
@@ -167,6 +167,7 @@ void CMovingThings::Update()
if (aMovingThings[i].m_nHidden == 0)
aMovingThings[i].Update();
}
+#endif
for (i = 0; i < ARRAY_SIZE(aScrollBars); ++i)
{
diff --git a/src/render/Font.h b/src/render/Font.h
index 9b4e7132..48f5703d 100644
--- a/src/render/Font.h
+++ b/src/render/Font.h
@@ -68,8 +68,8 @@ class CFont
static int16 Size[MAX_FONTS][193];
#endif
static int16 NewLine;
- static CSprite2d Sprite[MAX_FONTS];
public:
+ static CSprite2d Sprite[MAX_FONTS];
static CFontDetails Details;
static void Initialise(void);
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 88d412c9..717021a7 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -73,8 +73,12 @@ CRenderer::PreRender(void)
for(i = 0; i < ms_nNoOfVisibleEntities; i++)
ms_aVisibleEntityPtrs[i]->PreRender();
- for(i = 0; i < ms_nNoOfInVisibleEntities; i++)
+ for (i = 0; i < ms_nNoOfInVisibleEntities; i++) {
+#ifdef SQUEEZE_PERFORMANCE
+ if (ms_aInVisibleEntityPtrs[i]->IsVehicle() && ((CVehicle*)ms_aInVisibleEntityPtrs[i])->IsHeli())
+#endif
ms_aInVisibleEntityPtrs[i]->PreRender();
+ }
for(node = CVisibilityPlugins::m_alphaEntityList.head.next;
node != &CVisibilityPlugins::m_alphaEntityList.tail;
diff --git a/src/render/Rubbish.h b/src/render/Rubbish.h
index 2be592fe..37f895f3 100644
--- a/src/render/Rubbish.h
+++ b/src/render/Rubbish.h
@@ -4,7 +4,11 @@ class CVehicle;
enum {
// NB: not all values are allowed, check the code
+#ifdef SQUEEZE_PERFORMANCE
+ NUM_RUBBISH_SHEETS = 32
+#else
NUM_RUBBISH_SHEETS = 64
+#endif
};
class COneSheet
diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp
index c169c351..8c892be3 100644
--- a/src/render/Shadows.cpp
+++ b/src/render/Shadows.cpp
@@ -458,7 +458,7 @@ CShadows::StoreShadowForCar(CAutomobile *pCar)
if ( CTimeCycle::GetShadowStrength() != 0 )
{
CVector CarPos = pCar->GetPosition();
- float fDistToCamSqr = (CarPos - TheCamera.GetPosition()).MagnitudeSqr();
+ float fDistToCamSqr = (CarPos - TheCamera.GetPosition()).MagnitudeSqr2D();
if ( CCutsceneMgr::IsRunning() )
fDistToCamSqr /= SQR(TheCamera.LODDistMultiplier) * 4.0f;
@@ -1027,7 +1027,9 @@ CShadows::CastShadowEntity(CEntity *pEntity, float fStartX, float fStartY, floa
CColTrianglePlane *pColTriPlanes = pCol->trianglePlanes;
ASSERT(pColTriPlanes != NULL);
- if ( Abs(pColTriPlanes[i].normal.z) > 0.1f )
+ CVector normal;
+ pColTriPlanes[i].GetNormal(normal);
+ if ( Abs(normal.z) > 0.1f )
{
CColTriangle *pColTri = pCol->triangles;
ASSERT(pColTri != NULL);
@@ -1578,40 +1580,41 @@ CStaticShadow::Free(void)
void
CShadows::CalcPedShadowValues(CVector vecLightDir,
- float *pfDisplacementX, float *pfDisplacementY,
float *pfFrontX, float *pfFrontY,
- float *pfSideX, float *pfSideY)
+ float *pfSideX, float *pfSideY,
+ float *pfDisplacementX, float *pfDisplacementY)
{
- ASSERT(pfDisplacementX != NULL);
- ASSERT(pfDisplacementY != NULL);
- ASSERT(pfFrontX != NULL);
- ASSERT(pfFrontY != NULL);
- ASSERT(pfSideX != NULL);
- ASSERT(pfSideY != NULL);
+ ASSERT(pfFrontX != nil);
+ ASSERT(pfFrontY != nil);
+ ASSERT(pfSideX != nil);
+ ASSERT(pfSideY != nil);
+ ASSERT(pfDisplacementX != nil);
+ ASSERT(pfDisplacementY != nil);
- *pfDisplacementX = -vecLightDir.x;
- *pfDisplacementY = -vecLightDir.y;
+ *pfFrontX = -vecLightDir.x;
+ *pfFrontY = -vecLightDir.y;
- float fDist = Sqrt(*pfDisplacementY * *pfDisplacementY + *pfDisplacementX * *pfDisplacementX);
+ float fDist = Sqrt(*pfFrontY * *pfFrontY + *pfFrontX * *pfFrontX);
float fMult = (fDist + 1.0f) / fDist;
- *pfDisplacementX *= fMult;
- *pfDisplacementY *= fMult;
-
- *pfFrontX = -vecLightDir.y / fDist;
- *pfFrontY = vecLightDir.x / fDist;
+ *pfFrontX *= fMult;
+ *pfFrontY *= fMult;
- *pfSideX = -vecLightDir.x;
- *pfSideY = -vecLightDir.y;
+ *pfSideX = -vecLightDir.y / fDist;
+ *pfSideY = vecLightDir.x / fDist;
- *pfDisplacementX /= 2;
- *pfDisplacementY /= 2;
+ *pfDisplacementX = -vecLightDir.x;
+ *pfDisplacementY = -vecLightDir.y;
*pfFrontX /= 2;
*pfFrontY /= 2;
*pfSideX /= 2;
*pfSideY /= 2;
+
+ *pfDisplacementX /= 2;
+ *pfDisplacementY /= 2;
+
}
void
@@ -1656,22 +1659,22 @@ CShadows::RenderExtraPlayerShadows(void)
vecLight.y *= fInv;
vecLight.z *= fInv;
- float fDisplacementX, fDisplacementY, fFrontX, fFrontY, fSideX, fSideY;
+ float fFrontX, fFrontY, fSideX, fSideY, fDisplacementX, fDisplacementY;
CalcPedShadowValues(vecLight,
- &fDisplacementX, &fDisplacementY,
- &fFrontX, &fFrontY,
- &fSideX, &fSideY);
+ &fFrontX, &fFrontY,
+ &fSideX, &fSideY,
+ &fDisplacementX, &fDisplacementY);
CVector shadowPos = FindPlayerCoors();
- shadowPos.x += fSideX;
- shadowPos.y += fSideY;
+ shadowPos.x += fDisplacementX;
+ shadowPos.y += fDisplacementY;
StoreShadowToBeRendered(SHADOWTYPE_DARK, gpShadowPedTex, &shadowPos,
- fDisplacementX, fDisplacementY,
fFrontX, fFrontY,
+ fSideX, fSideY,
nColorStrength, 0, 0, 0,
4.0f, false, 1.0f);
}
@@ -1768,7 +1771,7 @@ CShadows::RenderIndicatorShadow(uint32 nID, uint8 ShadowType, RwTexture *pTextur
{
ASSERT(pPosn != NULL);
- C3dMarkers::PlaceMarkerSet(nID, _TODOCONST(4), *pPosn, Max(fFrontX, -fSideY),
+ C3dMarkers::PlaceMarkerSet(nID, MARKERTYPE_CYLINDER, *pPosn, Max(fFrontX, -fSideY),
0, 128, 255, 128,
2048, 0.2f, 0);
}
diff --git a/src/render/Shadows.h b/src/render/Shadows.h
index 63aaaaf2..8c909df3 100644
--- a/src/render/Shadows.h
+++ b/src/render/Shadows.h
@@ -128,21 +128,12 @@ class CPed;
class CShadows
{
public:
-#if 1
static int16 ShadowsStoredToBeRendered;
static CStoredShadow asShadowsStored [MAX_STOREDSHADOWS];
static CPolyBunch aPolyBunches [MAX_POLYBUNCHES];
static CStaticShadow aStaticShadows [MAX_STATICSHADOWS];
static CPolyBunch *pEmptyBunchList;
static CPermanentShadow aPermanentShadows[MAX_PERMAMENTSHADOWS];
-#else
- static int16 &ShadowsStoredToBeRendered;
- static CStoredShadow (&asShadowsStored) [MAX_STOREDSHADOWS];
- static CPolyBunch (&aPolyBunches) [MAX_POLYBUNCHES];
- static CStaticShadow (&aStaticShadows) [MAX_STATICSHADOWS];
- static CPolyBunch *&pEmptyBunchList;
- static CPermanentShadow (&aPermanentShadows)[MAX_PERMAMENTSHADOWS];
-#endif
static void Init (void);
static void Shutdown (void);
@@ -166,7 +157,7 @@ public:
CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue, float fZDistance, float fScale, CPolyBunch **ppPolyBunch);
static void UpdateStaticShadows (void);
static void UpdatePermanentShadows (void);
- static void CalcPedShadowValues (CVector vecLightDir, float *pfDisplacementX, float *pfDisplacementY, float *pfFrontX, float *pfFrontY, float *pfSideX, float *pfSideY);
+ static void CalcPedShadowValues (CVector vecLightDir, float *pfFrontX, float *pfFrontY, float *pfSideX, float *pfSideY, float *pfDisplacementX, float *pfDisplacementY);
static void RenderExtraPlayerShadows (void);
static void TidyUpShadows (void);
static void RenderIndicatorShadow (uint32 nID, uint8 ShadowType, RwTexture *pTexture, CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity);
diff --git a/src/render/Sprite2d.cpp b/src/render/Sprite2d.cpp
index 52b85018..453ed004 100644
--- a/src/render/Sprite2d.cpp
+++ b/src/render/Sprite2d.cpp
@@ -4,6 +4,7 @@
#include "Draw.h"
#include "Camera.h"
#include "Sprite2d.h"
+#include "Font.h"
RwIm2DVertex CSprite2d::maVertices[8];
float CSprite2d::RecipNearClip;
@@ -27,14 +28,18 @@ CSprite2d::InitPerFrame(void)
mCurrentBank = 0;
for(i = 0; i < 10; i++)
mCurrentSprite[i] = 0;
+#ifndef SQUEEZE_PERFORMANCE
for(i = 0; i < 10; i++)
mpBankTextures[i] = nil;
+#endif
}
int32
CSprite2d::GetBank(int32 n, RwTexture *tex)
{
+#ifndef SQUEEZE_PERFORMANCE
mpBankTextures[mCurrentBank] = tex;
+#endif
mCurrentSprite[mCurrentBank] = 0;
mBankStart[mCurrentBank+1] = mBankStart[mCurrentBank] + n;
return mCurrentBank++;
@@ -59,8 +64,12 @@ CSprite2d::DrawBank(int32 bank)
{
if(mCurrentSprite[bank] == 0)
return;
+#ifndef SQUEEZE_PERFORMANCE
RwRenderStateSet(rwRENDERSTATETEXTURERASTER,
mpBankTextures[bank] ? RwTextureGetRaster(mpBankTextures[bank]) : nil);
+#else
+ CFont::Sprite[bank].SetRenderState();
+#endif
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
RwIm2DRenderPrimitive(rwPRIMTYPETRILIST, &maBankVertices[6*mBankStart[bank]], 6*mCurrentSprite[bank]);
diff --git a/src/weapons/BulletInfo.cpp b/src/weapons/BulletInfo.cpp
index 26fc459d..15dde011 100644
--- a/src/weapons/BulletInfo.cpp
+++ b/src/weapons/BulletInfo.cpp
@@ -24,6 +24,10 @@
#include "World.h"
#include "SurfaceTable.h"
+#ifdef SQUEEZE_PERFORMANCE
+uint32 bulletInfoInUse;
+#endif
+
#define BULLET_LIFETIME (1000)
#define NUM_PED_BLOOD_PARTICLES (8)
#define BLOOD_PARTICLE_OFFSET (CVector(0.0f, 0.0f, 0.0f))
@@ -47,6 +51,9 @@ void CBulletInfo::Initialise(void)
gaBulletInfo[i].m_pSource = nil;
}
debug("CBulletInfo ready\n");
+#ifdef SQUEEZE_PERFORMANCE
+ bulletInfoInUse = 0;
+#endif
}
void CBulletInfo::Shutdown(void)
@@ -71,11 +78,19 @@ bool CBulletInfo::AddBullet(CEntity* pSource, eWeaponType type, CVector vecPosit
gaBulletInfo[i].m_vecSpeed = vecSpeed;
gaBulletInfo[i].m_fTimer = CTimer::GetTimeInMilliseconds() + BULLET_LIFETIME;
gaBulletInfo[i].m_bInUse = true;
+
+#ifdef SQUEEZE_PERFORMANCE
+ bulletInfoInUse++;
+#endif
return true;
}
void CBulletInfo::Update(void)
{
+#ifdef SQUEEZE_PERFORMANCE
+ if (bulletInfoInUse == 0)
+ return;
+#endif
bool bAddSound = true;
bPlayerSniperBullet = false;
for (int i = 0; i < NUM_BULLETS; i++) {
@@ -84,8 +99,12 @@ void CBulletInfo::Update(void)
pBullet->m_pSource = nil;
if (!pBullet->m_bInUse)
continue;
- if (CTimer::GetTimeInMilliseconds() > pBullet->m_fTimer)
+ if (CTimer::GetTimeInMilliseconds() > pBullet->m_fTimer) {
pBullet->m_bInUse = false;
+#ifdef SQUEEZE_PERFORMANCE
+ bulletInfoInUse--;
+#endif
+ }
CVector vecOldPos = pBullet->m_vecPosition;
CVector vecNewPos = pBullet->m_vecPosition + pBullet->m_vecSpeed * CTimer::GetTimeStep() * 0.5f;
CWorld::bIncludeCarTyres = true;
@@ -108,6 +127,9 @@ void CBulletInfo::Update(void)
pPed->InflictDamage(pBullet->m_pSource, pBullet->m_eWeaponType, pBullet->m_nDamage, (ePedPieceTypes)point.pieceB, pPed->GetLocalDirection(pPed->GetPosition() - point.point));
CEventList::RegisterEvent(pPed->m_nPedType == PEDTYPE_COP ? EVENT_SHOOT_COP : EVENT_SHOOT_PED, EVENT_ENTITY_PED, pPed, (CPed*)pBullet->m_pSource, 1000);
pBullet->m_bInUse = false;
+#ifdef SQUEEZE_PERFORMANCE
+ bulletInfoInUse--;
+#endif
vecNewPos = point.point;
}
else {
@@ -134,6 +156,9 @@ void CBulletInfo::Update(void)
}
}
pBullet->m_bInUse = false;
+#ifdef SQUEEZE_PERFORMANCE
+ bulletInfoInUse--;
+#endif
vecNewPos = point.point;
}
}
@@ -148,6 +173,9 @@ void CBulletInfo::Update(void)
}
#ifdef FIX_BUGS
pBullet->m_bInUse = false;
+#ifdef SQUEEZE_PERFORMANCE
+ bulletInfoInUse--;
+#endif
vecNewPos = point.point;
#endif
}
@@ -167,6 +195,9 @@ void CBulletInfo::Update(void)
}
#ifdef FIX_BUGS
pBullet->m_bInUse = false;
+#ifdef SQUEEZE_PERFORMANCE
+ bulletInfoInUse--;
+#endif
vecNewPos = point.point;
#endif
}
@@ -217,8 +248,12 @@ void CBulletInfo::Update(void)
}
pBullet->m_vecPosition = vecNewPos;
if (pBullet->m_vecPosition.x < -MAP_BORDER || pBullet->m_vecPosition.x > MAP_BORDER ||
- pBullet->m_vecPosition.y < -MAP_BORDER || pBullet->m_vecPosition.y > MAP_BORDER)
+ pBullet->m_vecPosition.y < -MAP_BORDER || pBullet->m_vecPosition.y > MAP_BORDER) {
pBullet->m_bInUse = false;
+#ifdef SQUEEZE_PERFORMANCE
+ bulletInfoInUse--;
+#endif
+ }
}
}
diff --git a/src/weapons/ProjectileInfo.cpp b/src/weapons/ProjectileInfo.cpp
index 47bc65ac..b56e3a29 100644
--- a/src/weapons/ProjectileInfo.cpp
+++ b/src/weapons/ProjectileInfo.cpp
@@ -13,6 +13,10 @@
#include "Weapon.h"
#include "World.h"
+#ifdef SQUEEZE_PERFORMANCE
+uint32 projectileInUse;
+#endif
+
CProjectileInfo gaProjectileInfo[NUM_PROJECTILES];
CProjectile *CProjectileInfo::ms_apProjectile[NUM_PROJECTILES];
@@ -30,6 +34,10 @@ CProjectileInfo::Initialise()
}
debug("CProjectileInfo ready\n");
+
+#ifdef SQUEEZE_PERFORMANCE
+ projectileInUse = 0;
+#endif
}
void
@@ -154,6 +162,10 @@ CProjectileInfo::AddProjectile(CEntity *entity, eWeaponType weapon, CVector pos,
ms_apProjectile[i]->m_fElasticity = elasticity;
ms_apProjectile[i]->m_nSpecialCollisionResponseCases = SpecialCollisionResponseCase;
+#ifdef SQUEEZE_PERFORMANCE
+ projectileInUse++;
+#endif
+
gaProjectileInfo[i].m_bInUse = true;
CWorld::Add(ms_apProjectile[i]);
@@ -165,6 +177,9 @@ void
CProjectileInfo::RemoveProjectile(CProjectileInfo *info, CProjectile *projectile)
{
RemoveNotAdd(info->m_pSource, info->m_eWeaponType, projectile->GetPosition());
+#ifdef SQUEEZE_PERFORMANCE
+ projectileInUse--;
+#endif
info->m_bInUse = false;
CWorld::Remove(projectile);
@@ -192,6 +207,11 @@ CProjectileInfo::RemoveNotAdd(CEntity *entity, eWeaponType weaponType, CVector p
void
CProjectileInfo::Update()
{
+#ifdef SQUEEZE_PERFORMANCE
+ if (projectileInUse == 0)
+ return;
+#endif
+
for (int i = 0; i < ARRAY_SIZE(gaProjectileInfo); i++) {
if (!gaProjectileInfo[i].m_bInUse) continue;
@@ -200,6 +220,10 @@ CProjectileInfo::Update()
gaProjectileInfo[i].m_pSource = nil;
if (ms_apProjectile[i] == nil) {
+#ifdef SQUEEZE_PERFORMANCE
+ projectileInUse--;
+#endif
+
gaProjectileInfo[i].m_bInUse = false;
continue;
}
@@ -252,6 +276,10 @@ CProjectileInfo::IsProjectileInRange(float x1, float x2, float y1, float y2, flo
if (pos.x >= x1 && pos.x <= x2 && pos.y >= y1 && pos.y <= y2 && pos.z >= z1 && pos.z <= z2) {
result = true;
if (remove) {
+#ifdef SQUEEZE_PERFORMANCE
+ projectileInUse--;
+#endif
+
gaProjectileInfo[i].m_bInUse = false;
CWorld::Remove(ms_apProjectile[i]);
delete ms_apProjectile[i];
@@ -266,8 +294,17 @@ CProjectileInfo::IsProjectileInRange(float x1, float x2, float y1, float y2, flo
void
CProjectileInfo::RemoveAllProjectiles()
{
+#ifdef SQUEEZE_PERFORMANCE
+ if (projectileInUse == 0)
+ return;
+#endif
+
for (int i = 0; i < ARRAY_SIZE(ms_apProjectile); i++) {
if (gaProjectileInfo[i].m_bInUse) {
+#ifdef SQUEEZE_PERFORMANCE
+ projectileInUse--;
+#endif
+
gaProjectileInfo[i].m_bInUse = false;
CWorld::Remove(ms_apProjectile[i]);
delete ms_apProjectile[i];
@@ -278,12 +315,21 @@ CProjectileInfo::RemoveAllProjectiles()
bool
CProjectileInfo::RemoveIfThisIsAProjectile(CObject *object)
{
+#ifdef SQUEEZE_PERFORMANCE
+ if (projectileInUse == 0)
+ return false;
+#endif
+
int i = 0;
while (ms_apProjectile[i++] != object) {
if (i >= ARRAY_SIZE(ms_apProjectile))
return false;
}
+#ifdef SQUEEZE_PERFORMANCE
+ projectileInUse--;
+#endif
+
gaProjectileInfo[i].m_bInUse = false;
CWorld::Remove(ms_apProjectile[i]);
delete ms_apProjectile[i];
diff --git a/src/weapons/ShotInfo.cpp b/src/weapons/ShotInfo.cpp
index f09ae052..c0ab9ac1 100644
--- a/src/weapons/ShotInfo.cpp
+++ b/src/weapons/ShotInfo.cpp
@@ -13,6 +13,9 @@
CShotInfo gaShotInfo[NUMSHOTINFOS];
float CShotInfo::ms_afRandTable[20];
+#ifdef SQUEEZE_PERFORMANCE
+uint32 shotInfoInUse;
+#endif
/*
Used for flamethrower. I don't know why it's name is CShotInfo.
@@ -41,6 +44,9 @@ CShotInfo::Initialise()
nextVal += 0.005f;
}
debug("CShotInfo ready\n");
+#ifdef SQUEEZE_PERFORMANCE
+ shotInfoInUse = 0;
+#endif
}
bool
@@ -54,6 +60,10 @@ CShotInfo::AddShot(CEntity *sourceEntity, eWeaponType weapon, CVector startPos,
if (slot == ARRAY_SIZE(gaShotInfo))
return false;
+#ifdef SQUEEZE_PERFORMANCE
+ shotInfoInUse++;
+#endif
+
gaShotInfo[slot].m_inUse = true;
gaShotInfo[slot].m_weapon = weapon;
gaShotInfo[slot].m_startPos = startPos;
@@ -87,6 +97,10 @@ CShotInfo::Shutdown()
void
CShotInfo::Update()
{
+#ifdef SQUEEZE_PERFORMANCE
+ if (shotInfoInUse == 0)
+ return;
+#endif
for (int slot = 0; slot < ARRAY_SIZE(gaShotInfo); slot++) {
CShotInfo &shot = gaShotInfo[slot];
if (shot.m_sourceEntity && shot.m_sourceEntity->IsPed() && !((CPed*)shot.m_sourceEntity)->IsPointerValid())
@@ -96,8 +110,12 @@ CShotInfo::Update()
continue;
CWeaponInfo *weaponInfo = CWeaponInfo::GetWeaponInfo(shot.m_weapon);
- if (CTimer::GetTimeInMilliseconds() > shot.m_timeout)
+ if (CTimer::GetTimeInMilliseconds() > shot.m_timeout) {
+#ifdef SQUEEZE_PERFORMANCE
+ shotInfoInUse--;
+#endif
shot.m_inUse = false;
+ }
if (weaponInfo->m_bSlowsDown)
shot.m_areaAffected *= pow(0.96, CTimer::GetTimeStep()); // FRAMERATE