diff options
author | b1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-11-23 21:32:44 +0000 |
---|---|---|
committer | b1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-11-23 21:32:44 +0000 |
commit | 80f3f5fe438a48b94a2ec9c70e6ff8475ede4ff3 (patch) | |
tree | 4bc1203e2e017811c215a32b6776cb47c277caac | |
parent | 013d70b12f34ddccdcee5be4a553c6ef2b06be1c (diff) | |
download | usdx-80f3f5fe438a48b94a2ec9c70e6ff8475ede4ff3.tar.gz usdx-80f3f5fe438a48b94a2ec9c70e6ff8475ede4ff3.tar.xz usdx-80f3f5fe438a48b94a2ec9c70e6ff8475ede4ff3.zip |
checking for delta=0 in col2h
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@652 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r-- | Game/Code/Classes/UTexture.pas | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas index 7b537840..445c7d4f 100644 --- a/Game/Code/Classes/UTexture.pas +++ b/Game/Code/Classes/UTexture.pas @@ -427,6 +427,8 @@ procedure TTextureUnit.ColorizeTexture(TexSurface: PSDL_Surface; Col: Cardinal); clr[2]:=(Color and $ff)/255; hls[1]:=maxvalue(clr); delta:=hls[1]-minvalue(clr); + // this is for safety reasons + if delta = 0.0 then delta:=0.000000000001; if clr[0]=hls[1] then hls[0]:=(clr[1]-clr[2])/delta else if clr[1]=hls[1] then hls[0]:=2.0+(clr[2]-clr[0])/delta else if clr[2]=hls[1] then hls[0]:=4.0+(clr[0]-clr[1])/delta; |