diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-04-24 12:47:09 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-04-24 12:47:09 +0000 |
commit | 0d86a79ad303441af3080f1c744da0c556927425 (patch) | |
tree | 83943097249ee2bf37ac45a64b7db7f1006eb5ab /Game/Code/Classes/UTexture.pas | |
parent | c0e68207b30e23265520b4bc1335d0bf9aea3b11 (diff) | |
download | usdx-0d86a79ad303441af3080f1c744da0c556927425.tar.gz usdx-0d86a79ad303441af3080f1c744da0c556927425.tar.xz usdx-0d86a79ad303441af3080f1c744da0c556927425.zip |
- reverted some stuff that was erroneously commited by one of the last commits.
- moved DEBUG define from config-*.inc back to switches.inc
- APPTYPE is needed by FPC (for Windows) too. Fixed some crashes with Writeln in FPC (Win) if no console is available.
- Moved thread-safe ULog.SafeWriteln() to UCommon.ConsoleWriteln(), this is used by DebugWriteln() now, so this is thread-safe too
- Added log-levels (sorted by severity): DEBUG, INFO, STATUS, WARN, ERROR, CRITICAL. Default log-level is LOG_LEVEL_ERROR, so warnings and less important logs are not printed by default. You can change this by LOG_LEVEL_DEFAULT or Log.SetLogLevel(Level). Please use Log.LogError/Warn/Status/Info/Debug/... instead of DebugWriteln() to avoid spamming the console. See ULog.pas for further info.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1036 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/UTexture.pas')
-rw-r--r-- | Game/Code/Classes/UTexture.pas | 51 |
1 files changed, 6 insertions, 45 deletions
diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas index a56c0096..07dc309f 100644 --- a/Game/Code/Classes/UTexture.pas +++ b/Game/Code/Classes/UTexture.pas @@ -137,48 +137,7 @@ uses ULog, {$IFDEF DARWIN} MacResources, {$ENDIF} - StrUtils, - dialogs; - -const - fmt_rgba: TSDL_Pixelformat = ( - palette: nil; - BitsPerPixel: 32; - BytesPerPixel: 4; - Rloss: 0; - Gloss: 0; - Bloss: 0; - Aloss: 0; - Rshift: 0; - Gshift: 8; - Bshift: 16; - Ashift: 24; - Rmask: $000000ff; - Gmask: $0000ff00; - Bmask: $00ff0000; - Amask: $ff000000; - ColorKey: 0; - Alpha: 255 - ); - fmt_rgb: TSDL_Pixelformat = ( - palette: nil; - BitsPerPixel: 24; - BytesPerPixel: 3; - Rloss: 0; - Gloss: 0; - Bloss: 0; - Aloss: 0; - Rshift: 0; - Gshift: 8; - Bshift: 16; - Ashift: 0; - Rmask: $000000ff; - Gmask: $0000ff00; - Bmask: $00ff0000; - Amask: $00000000; - ColorKey: 0; - Alpha: 255 - ); + StrUtils; Constructor TTextureUnit.Create; begin @@ -530,7 +489,8 @@ begin {$endif} if not assigned(TexSurface) then begin - Log.LogStatus( 'ERROR Could not load texture' , Identifier +' '+ TextureTypeToStr(Typ) ); + Log.LogError('Could not load texture: "' + Identifier +' '+ TextureTypeToStr(Typ) +'"', + 'TTextureUnit.LoadTexture'); Exit; end; @@ -851,7 +811,8 @@ begin Log.LogStatus(' Error creating Cover Thumbnail',' LoadTexture('''+Name+''')'); end else - Log.LogStatus( 'ERROR Could not load texture for Cover Thumbnail: ' , name+' '+ TextureTypeToStr(Typ) ); + Log.LogError('Could not load texture for Cover Thumbnail: "' + name+' '+ TextureTypeToStr(Typ) +'"', + 'TTextureUnit.GetCoverThumbnail'); SDL_FreeSurface(TexSurface); end; @@ -1025,7 +986,7 @@ begin Exit; end; end; - Log.LogError('Unknown texture-type: "' + TypeStr + '"', 'ParseTextureType'); + Log.LogWarn('Unknown texture-type: "' + TypeStr + '"', 'ParseTextureType'); Result := TEXTURE_TYPE_PLAIN; end; |