aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-21 13:17:41 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-21 13:17:41 +0000
commit87a601cc1528279b675a56131ef1061aa124f732 (patch)
treee42e669ceaf9c0f770a031ac6b5ccba6d630472b /Game/Code
parent65eddc47b3b3fa40292c936af27ede9bc34c5516 (diff)
downloadusdx-87a601cc1528279b675a56131ef1061aa124f732.tar.gz
usdx-87a601cc1528279b675a56131ef1061aa124f732.tar.xz
usdx-87a601cc1528279b675a56131ef1061aa124f732.zip
check if projectm_create1 succeeds
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1285 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/lib/projectM/projectM-1_0.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/Game/Code/lib/projectM/projectM-1_0.inc b/Game/Code/lib/projectM/projectM-1_0.inc
index 1b03f17c..8e84894d 100644
--- a/Game/Code/lib/projectM/projectM-1_0.inc
+++ b/Game/Code/lib/projectM/projectM-1_0.inc
@@ -85,10 +85,12 @@ begin
// we cannot catch C++ exceptions in delphi, so we have to check
// if configFile is valid first
- if (FileExists(configFile)) then
- data := _projectM_create1(PChar(configFile))
- else
+ if (not FileExists(configFile)) then
raise Exception.Create('Invalid file: ' + configFile);
+
+ data := _projectM_create1(PChar(configFile));
+ if (data = nil) then
+ raise Exception.Create('Creation of projectM object failed');
end;
procedure TProjectM.ResetGL(width, height: Integer);