aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/lib/projectM
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-06 15:10:33 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-06 15:10:33 +0000
commit91b8d206affb6c40cd874d17174a789414f6d4a9 (patch)
tree0d7f9ba699c4cac2be10ddb8d5d24bce3bf673be /Game/Code/lib/projectM
parent6949672f37c3b05f8930b132574740ec8ed03ed0 (diff)
downloadusdx-91b8d206affb6c40cd874d17174a789414f6d4a9.tar.gz
usdx-91b8d206affb6c40cd874d17174a789414f6d4a9.tar.xz
usdx-91b8d206affb6c40cd874d17174a789414f6d4a9.zip
support for projectM 1.2
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1221 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/lib/projectM/cwrapper/projectM-cwrapper.cpp6
-rw-r--r--Game/Code/lib/projectM/cwrapper/projectM-cwrapper.h14
-rw-r--r--Game/Code/lib/projectM/cwrapper/projectM-cwrapper.vcproj4
-rw-r--r--Game/Code/lib/projectM/projectM-1_0.inc19
-rw-r--r--Game/Code/lib/projectM/projectM.pas4
5 files changed, 31 insertions, 16 deletions
diff --git a/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.cpp b/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.cpp
index 4b81130d..ebf43554 100644
--- a/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.cpp
+++ b/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.cpp
@@ -2,7 +2,7 @@
#define PM_CLASS(pm) ((projectM*)pm)
-#if (PROJECTM_VERSION_INT >= 1010000)
+#if (PROJECTM_VERSION_INT > 1000000)
#define PM_PCM(pm) (PM_CLASS(pm)->pcm())
#else
#define PM_PCM(pm) (PM_CLASS(pm)->pcm)
@@ -13,7 +13,7 @@ projectM_ptr projectM_create1(char* config_file)
return projectM_ptr(new projectM(config_file));
}
-#if (PROJECTM_VERSION_INT < 1010000)
+#if (PROJECTM_VERSION_INT < 1000000)
projectM_ptr projectM_create2(int gx, int gy, int fps, int texsize,
int width, int height, char* preset_url,
char* title_fonturl, char* title_menuurl)
@@ -80,7 +80,7 @@ void PCM_addPCM8_512(projectM_ptr pm, const unsigned char pcm_data[2][512])
#define COPY_FIELD(c_ptr, s, fld) (c_ptr->fld = s.fld)
-#if (PROJECTM_VERSION_INT >= 1010000)
+#if (PROJECTM_VERSION_INT > 1000000)
void projectM_settings(projectM_ptr pm, Settings* settings)
{
const projectM::Settings& pmSettings = PM_CLASS(pm)->settings();
diff --git a/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.h b/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.h
index 630becbb..43f36ef4 100644
--- a/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.h
+++ b/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.h
@@ -3,17 +3,19 @@
#include "projectM.hpp"
-#define PROJECTM_VERSION_1_00_00 1000000 // 1.00.00 = 1.0 or 1.01
-#define PROJECTM_VERSION_1_10_00 1010000 // 1.10.00 = 1.1
+// PROJECTM_VERSION define is not very helpful, lets create our own
+#define PROJECTM_VERSION_1_00_00 1000000 // 1.00.00 = 1.0 or 1.01 (same version number for 1.0 and 1.01)
+#define PROJECTM_VERSION_1_10_00 1010000 // 1.10.00 = 1.1 (bigger than 1.2 due to strange versioning)
+#define PROJECTM_VERSION_1_02_00 1002000 // 1.02.00 = 1.2
// version of projectM to wrap (see PROJECTM_VERSION)
#ifndef PROJECTM_VERSION_INT
-#define PROJECTM_VERSION_INT PROJECTM_VERSION_1_10_00
+#define PROJECTM_VERSION_INT PROJECTM_VERSION_1_02_00
#endif
extern "C" {
- #if (PROJECTM_VERSION_INT >= 1010000)
+ #if (PROJECTM_VERSION_INT > 1000000)
struct Settings {
int meshX;
int meshY;
@@ -36,7 +38,7 @@ extern "C" {
typedef void* projectM_ptr;
DLLEXPORT projectM_ptr projectM_create1(char* config_file);
- #if (PROJECTM_VERSION_INT < 1010000)
+ #if (PROJECTM_VERSION_INT < 1000000)
DLLEXPORT projectM_ptr projectM_create2(int gx, int gy, int fps, int texsize,
int width, int height, char* preset_url,
char* title_fonturl, char* title_menuurl);
@@ -57,7 +59,7 @@ extern "C" {
DLLEXPORT void PCM_addPCM8(projectM_ptr pm, unsigned char [2][1024]);
DLLEXPORT void PCM_addPCM8_512(projectM_ptr pm, const unsigned char [2][512]);
- #if (PROJECTM_VERSION_INT >= 1010000)
+ #if (PROJECTM_VERSION_INT > 1000000)
DLLEXPORT void projectM_settings(projectM_ptr pm, Settings* settings);
#endif
}
diff --git a/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.vcproj b/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.vcproj
index 013bc6b7..c0902099 100644
--- a/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.vcproj
+++ b/Game/Code/lib/projectM/cwrapper/projectM-cwrapper.vcproj
@@ -118,7 +118,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;D:\daten\ultrastar\libprojectM\libprojectM-1.1\projectM&quot;;&quot;D:\daten\ultrastar\libprojectM\libs\pthreads\Pre-built.2\include&quot;"
+ AdditionalIncludeDirectories="&quot;D:\daten\ultrastar\libprojectM\libprojectM-1.2.0\projectM&quot;;&quot;D:\daten\ultrastar\libprojectM\libs\pthreads\Pre-built.2\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PROJECTMCWRAPPER_EXPORTS"
ExceptionHandling="1"
RuntimeLibrary="2"
@@ -140,7 +140,7 @@
Name="VCLinkerTool"
AdditionalDependencies="libprojectM.lib"
LinkIncremental="1"
- AdditionalLibraryDirectories="&quot;D:\daten\ultrastar\libprojectM\libprojectM-1.1\projectM\Release&quot;"
+ AdditionalLibraryDirectories="&quot;D:\daten\ultrastar\libprojectM\libprojectM-1.2.0\projectM\Release&quot;"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
diff --git a/Game/Code/lib/projectM/projectM-1_0.inc b/Game/Code/lib/projectM/projectM-1_0.inc
index 47d7f406..1b03f17c 100644
--- a/Game/Code/lib/projectM/projectM-1_0.inc
+++ b/Game/Code/lib/projectM/projectM-1_0.inc
@@ -1,5 +1,18 @@
//uses
+(**
+ * Note: be careful with ProjectM's versioning scheme.
+ *
+ * Version | Version in pkg-config .pc file
+ * ---------+--------------------------------------------
+ * 1.00 | 1.00
+ * 1.01 | 1.00
+ * 1.1 | 1.10
+ * 1.2 | 1.2 (= 1.02)
+ *
+ * So the version number of 1.1 is bigger than that of 1.2.
+ *)
+
const
{$IFDEF MSWINDOWS}
// Note: static linking is not possible with delphi because it does neither
@@ -21,7 +34,7 @@ type
{ projectM.hpp declarations }
function _projectM_create1(config_file: PChar): _PProjectM; cdecl; external libprojectM_cwrapper name 'projectM_create1';
-{$IF PROJECTM_VERSION < 1010000}
+{$IF PROJECTM_VERSION < 1000000} // 0.9x
function _projectM_create2(gx: cint; gy: cint; fps: cint;
texsize: cint; width: cint; height: cint;
preset_url: PChar; title_fonturl: PChar; title_menuurl: PChar): _PProjectM; cdecl; external libprojectM_cwrapper name 'projectM_create2';
@@ -37,7 +50,7 @@ procedure _projectM_free(pm: _PProjectM); cdecl; external libprojectM_cwrapper n
procedure _projectM_key_handler(pm: _PProjectM; event: TProjectMEvent;
keycode: TProjectMKeycode; modifier: TProjectMModifier); cdecl; external libprojectM_cwrapper name 'projectM_key_handler';
-{$IF PROJECTM_VERSION >= 1010000}
+{$IF PROJECTM_VERSION > 1000000} // > 1.01
procedure _projectM_settings(pm: _PProjectM; settings: PSettings); cdecl; external libprojectM_cwrapper name 'projectM_settings';
{$IFEND}
@@ -157,7 +170,7 @@ begin
KeyHandler(PROJECTM_KEYDOWN, PROJECTM_K_F3, PROJECTM_KMOD_LSHIFT);
end;
-{$IF PROJECTM_VERSION >= 1010000}
+{$IF PROJECTM_VERSION > 1000000} // > 1.01
procedure TProjectM.Settings(var settings: TSettings);
begin
_projectM_settings(data, @settings);
diff --git a/Game/Code/lib/projectM/projectM.pas b/Game/Code/lib/projectM/projectM.pas
index 29e9a60c..4adba17d 100644
--- a/Game/Code/lib/projectM/projectM.pas
+++ b/Game/Code/lib/projectM/projectM.pas
@@ -178,7 +178,7 @@ type
private
data: Pointer;
public
- {$IF PROJECTM_VERSION < 1000000}
+ {$IF PROJECTM_VERSION < 1000000} // 0.9x
constructor Create(gx, gy: integer; fps: integer;
texsize: integer; width, height: integer;
const presetsDir, fontsDir: string;
@@ -214,7 +214,7 @@ type
keycode: TProjectMKeycode;
modifier: TProjectMModifier);
- {$IF PROJECTM_VERSION >= 1010000}
+ {$IF PROJECTM_VERSION > 1000000} // > 1.01
procedure Settings(var settings: TSettings);
{$IFEND}