From 047c650ca3a39b2791a3e355636d95e6e272e855 Mon Sep 17 00:00:00 2001 From: ivost Date: Sun, 24 Sep 2006 10:38:29 +0000 Subject: [PATCH] * madopenal sample fixes * libmodplug 0.7 should work with modplug.pas headers now git-svn-id: trunk@4704 - --- packages/extra/modplug/modplug.pas | 13 +++++-------- packages/extra/openal/examples/madopenal.pas | 13 +++++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/packages/extra/modplug/modplug.pas b/packages/extra/modplug/modplug.pas index fe5222197b..64deb5a3fe 100644 --- a/packages/extra/modplug/modplug.pas +++ b/packages/extra/modplug/modplug.pas @@ -115,19 +115,16 @@ type procedure ModPlug_GetSettings(settings: PModPlug_Settings); cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF}; procedure ModPlug_SetSettings(const settings: PModPlug_Settings); cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF}; - -// libc functions -//function _new(s: cuint): pointer; cdecl; -//procedure _delete(p: pointer); cdecl; - implementation -{function _new(s: cuint): pointer; cdecl; +function cppNew(s: cint): pointer; cdecl; public; alias : '_Znaj'; alias : '_Znwj'; begin + GetMem(Result, s); end; -procedure _delete(p: pointer); cdecl; +procedure cppDelete(p: pointer); cdecl; public; alias : '_ZdlPv'; alias : '_ZdaPv'; begin -end;} + FreeMem(p); +end; end. \ No newline at end of file diff --git a/packages/extra/openal/examples/madopenal.pas b/packages/extra/openal/examples/madopenal.pas index 19d507a01a..d5a2837699 100644 --- a/packages/extra/openal/examples/madopenal.pas +++ b/packages/extra/openal/examples/madopenal.pas @@ -3,7 +3,7 @@ program test; {$mode objfpc} uses - classes, sysutils, ctypes, openal, mad, ogg, vorbis, a52, dts, modplug; + classes, sysutils, ctypes, openal, mad, ogg, vorbis, a52, dts, modplug, matroska; var source : TStream; @@ -180,7 +180,7 @@ begin end; // Under windows, AL_LOOPING = AL_TRUE breaks queueing, no idea why - alSourcei(al_source, AL_LOOPING, {AL_FALSE}AL_TRUE); + alSourcei(al_source, AL_LOOPING, AL_FALSE); alSourcePlay(al_source); end; @@ -225,17 +225,18 @@ var tmp: pointer; begin // define codec - {WriteLn('Define codec'); + WriteLn('Define codec'); Writeln(' (1) mp3'); Writeln(' (2) ogg'); Writeln(' (3) ac3'); Writeln(' (4) dts'); Writeln(' (5) xm,mod,it,s3m'); + Writeln(' (6) mka'); Write('Enter: '); ReadLn(codec); - Write('File: '); ReadLn(Filename);} + Write('File: '); ReadLn(Filename); - codec := 4; - Filename := 'test.dts'; + {codec := 4; + Filename := 'test.dts';} // load file