Browse Source

ps3: use network fallback for image files.

legacy
Sam Hocevar sam 12 years ago
parent
commit
4be5ebd8b3
3 changed files with 9 additions and 10 deletions
  1. +6
    -7
      src/image/codec/ps3-image.cpp
  2. +2
    -2
      src/lol/sys/init.h
  3. +1
    -1
      src/sys/init.cpp

+ 6
- 7
src/image/codec/ps3-image.cpp View File

@@ -1,7 +1,7 @@
// //
// Lol Engine // Lol Engine
// //
// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To // modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See // Public License, Version 2, as published by Sam Hocevar. See
@@ -93,12 +93,11 @@ bool Ps3ImageData::Open(char const *path)
/* Create decoder */ /* Create decoder */
CellPngDecSubHandle hsub; CellPngDecSubHandle hsub;


char file[1024];
sprintf(file, "/app_home/c:/Users/s.hocevar/le/%s", path);
String fullpath = String("/app_home/") + String(System::GetDataDir()) + String(path);


CellPngDecSrc dec_src; CellPngDecSrc dec_src;
dec_src.srcSelect = CELL_PNGDEC_FILE; dec_src.srcSelect = CELL_PNGDEC_FILE;
dec_src.fileName = file;
dec_src.fileName = &fullpath[0];
dec_src.fileOffset = 0; dec_src.fileOffset = 0;
dec_src.fileSize = 0; dec_src.fileSize = 0;
dec_src.streamPtr = NULL; dec_src.streamPtr = NULL;
@@ -109,7 +108,7 @@ bool Ps3ImageData::Open(char const *path)
if (err != CELL_OK) if (err != CELL_OK)
{ {
#if !LOL_RELEASE #if !LOL_RELEASE
Log::Error("could not open %s for decoding\n", file);
Log::Error("could not open %s for decoding\n", &fullpath[0]);
#endif #endif
return false; return false;
} }
@@ -119,7 +118,7 @@ bool Ps3ImageData::Open(char const *path)
if (err != CELL_OK) if (err != CELL_OK)
{ {
#if !LOL_RELEASE #if !LOL_RELEASE
Log::Error("could not read image header\n");
Log::Error("could not read image header in %s\n", &fullpath[0]);
#endif #endif
return false; return false;
} }
@@ -154,7 +153,7 @@ bool Ps3ImageData::Open(char const *path)
if (err != CELL_OK) if (err != CELL_OK)
{ {
#if !LOL_RELEASE #if !LOL_RELEASE
Log::Error("could not run PngDec decoder\n");
Log::Error("could not run PngDec decoder on %s\n", &fullpath[0]);
#endif #endif
return false; return false;
} }


+ 2
- 2
src/lol/sys/init.h View File

@@ -43,8 +43,8 @@ namespace System
{ {


extern void Init(int argc, char *argv[], extern void Init(int argc, char *argv[],
String const projectdir = LOL_CONFIG_PROJECTDIR,
String const solutiondir = LOL_CONFIG_SOLUTIONDIR);
String const &projectdir = LOL_CONFIG_PROJECTDIR,
String const &solutiondir = LOL_CONFIG_SOLUTIONDIR);


extern void SetDataDir(char const *dir); extern void SetDataDir(char const *dir);
extern char const *GetDataDir(); extern char const *GetDataDir();


+ 1
- 1
src/sys/init.cpp View File

@@ -36,7 +36,7 @@ namespace System
#endif #endif


void Init(int argc, char *argv[], void Init(int argc, char *argv[],
String const projectdir, String const solutiondir)
String const &projectdir, String const &solutiondir)
{ {
using namespace std; using namespace std;




Loading…
Cancel
Save