aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/psp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/psp')
-rw-r--r--backends/platform/psp/Makefile1
-rw-r--r--backends/platform/psp/README.PSP1
-rw-r--r--backends/platform/psp/README.PSP.in1
-rw-r--r--backends/platform/psp/display_manager.cpp1
-rw-r--r--backends/platform/psp/dummy.cpp2
-rw-r--r--backends/platform/psp/image_viewer.cpp4
-rw-r--r--backends/platform/psp/image_viewer.h2
-rw-r--r--backends/platform/psp/input.cpp2
-rw-r--r--backends/platform/psp/memory.h2
-rw-r--r--backends/platform/psp/mp3.cpp6
-rw-r--r--backends/platform/psp/mp3.h4
-rw-r--r--backends/platform/psp/png_loader.cpp10
-rw-r--r--backends/platform/psp/png_loader.h4
-rw-r--r--backends/platform/psp/portdefs.h2
-rw-r--r--backends/platform/psp/pspkeyboard.cpp2
-rw-r--r--backends/platform/psp/rtc.cpp1
-rw-r--r--backends/platform/psp/thread.cpp1
-rw-r--r--backends/platform/psp/thread.h2
-rw-r--r--backends/platform/psp/trace.cpp1
19 files changed, 14 insertions, 35 deletions
diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile
index 899bf37e80..7f4f20446e 100644
--- a/backends/platform/psp/Makefile
+++ b/backends/platform/psp/Makefile
@@ -201,4 +201,3 @@ SCEkxploit: $(TARGET).elf $(PSP_EBOOT_SFO)
$(PACK_PBP) "%__SCE__$(TARGET)/$(PSP_EBOOT)" $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON) \
$(PSP_EBOOT_ICON1) $(PSP_EBOOT_PIC0) $(PSP_EBOOT_PIC1) \
$(PSP_EBOOT_SND0) NULL $(PSP_EBOOT_PSAR)
-
diff --git a/backends/platform/psp/README.PSP b/backends/platform/psp/README.PSP
index dcfa30898c..a101481dca 100644
--- a/backends/platform/psp/README.PSP
+++ b/backends/platform/psp/README.PSP
@@ -169,4 +169,3 @@ Joost Peters (joostp@scummvm.org)
Paolo Costabel (paoloc@pacbell.net)
Thomas Mayer (tommybear@internode.on.net)
Yotam Barnoy (yotambarnoy@gmail.com)
-
diff --git a/backends/platform/psp/README.PSP.in b/backends/platform/psp/README.PSP.in
index 978f8a60bd..1ee99db84b 100644
--- a/backends/platform/psp/README.PSP.in
+++ b/backends/platform/psp/README.PSP.in
@@ -169,4 +169,3 @@ Joost Peters (joostp@scummvm.org)
Paolo Costabel (paoloc@pacbell.net)
Thomas Mayer (tommybear@internode.on.net)
Yotam Barnoy (yotambarnoy@gmail.com)
-
diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp
index 422805714f..cdb130e2a0 100644
--- a/backends/platform/psp/display_manager.cpp
+++ b/backends/platform/psp/display_manager.cpp
@@ -479,4 +479,3 @@ Common::List<Graphics::PixelFormat> DisplayManager::getSupportedPixelFormats() c
return list;
}
-
diff --git a/backends/platform/psp/dummy.cpp b/backends/platform/psp/dummy.cpp
index 748ac8cbf3..998ecf1488 100644
--- a/backends/platform/psp/dummy.cpp
+++ b/backends/platform/psp/dummy.cpp
@@ -53,4 +53,4 @@
getsockopt(0, 0, 0, NULL, NULL);
return i;
-} \ No newline at end of file
+}
diff --git a/backends/platform/psp/image_viewer.cpp b/backends/platform/psp/image_viewer.cpp
index 1ed7698bc8..98205ddee9 100644
--- a/backends/platform/psp/image_viewer.cpp
+++ b/backends/platform/psp/image_viewer.cpp
@@ -69,7 +69,7 @@ bool ImageViewer::load(int imageNum) {
assert(_renderer);
// Load a PNG into our buffer and palette. Size it by the actual size of the image
- PngLoader image(file, *_buffer, *_palette, Buffer::kSizeBySourceSize);
+ PngLoader image(*file, *_buffer, *_palette, Buffer::kSizeBySourceSize);
PngLoader::Status status = image.allocate(); // allocate the buffers for the file
@@ -321,4 +321,4 @@ void ImageViewer::handleEvent(uint32 event) {
PSP_ERROR("Unknown event %d\n", event);
break;
}
-} \ No newline at end of file
+}
diff --git a/backends/platform/psp/image_viewer.h b/backends/platform/psp/image_viewer.h
index ad188536a3..91a70b85cc 100644
--- a/backends/platform/psp/image_viewer.h
+++ b/backends/platform/psp/image_viewer.h
@@ -99,4 +99,4 @@ public:
void setDisplayManager(DisplayManager *displayManager) { _displayManager = displayManager; }
};
-#endif /* PSP_IMAGE_VIEWER_H */ \ No newline at end of file
+#endif /* PSP_IMAGE_VIEWER_H */
diff --git a/backends/platform/psp/input.cpp b/backends/platform/psp/input.cpp
index a9ad441b4d..5e20fb1e43 100644
--- a/backends/platform/psp/input.cpp
+++ b/backends/platform/psp/input.cpp
@@ -566,5 +566,3 @@ void InputHandler::setButtonsForImageViewer() {
_nub.getPad().getButton(ButtonPad::BTN_RIGHT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_RIGHT,
PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_STOP);
}
-
-
diff --git a/backends/platform/psp/memory.h b/backends/platform/psp/memory.h
index b5e29af634..5b728460fc 100644
--- a/backends/platform/psp/memory.h
+++ b/backends/platform/psp/memory.h
@@ -122,5 +122,3 @@ public:
};
#endif /* PSP_INCLUDE_SWAP */
-
-
diff --git a/backends/platform/psp/mp3.cpp b/backends/platform/psp/mp3.cpp
index 266e31e445..3dbf31112a 100644
--- a/backends/platform/psp/mp3.cpp
+++ b/backends/platform/psp/mp3.cpp
@@ -179,8 +179,7 @@ bool Mp3PspStream::loadStartAudioModule(const char *modname, int partition){
// TODO: make parallel function for unloading the 1.50 modules
Mp3PspStream::Mp3PspStream(Common::SeekableReadStream *inStream, DisposeAfterUse::Flag dispose) :
- _inStream(inStream),
- _disposeAfterUse(dispose),
+ _inStream(inStream, dispose),
_pcmLength(0),
_posInFrame(0),
_state(MP3_STATE_INIT),
@@ -274,9 +273,6 @@ Mp3PspStream::~Mp3PspStream() {
deinitStream();
releaseStreamME(); // free the memory used for this stream
-
- if (_disposeAfterUse == DisposeAfterUse::YES)
- delete _inStream;
}
void Mp3PspStream::deinitStream() {
diff --git a/backends/platform/psp/mp3.h b/backends/platform/psp/mp3.h
index 8b01fe4872..f7bfdda254 100644
--- a/backends/platform/psp/mp3.h
+++ b/backends/platform/psp/mp3.h
@@ -23,6 +23,7 @@
#ifndef SOUND_MP3_PSP_H
#define SOUND_MP3_PSP_H
+#include "common/ptr.h"
#include "common/types.h"
#include "common/scummsys.h"
@@ -48,8 +49,7 @@ protected:
byte _codecInBuffer[3072] __attribute__((aligned(64))); // the codec always needs alignment
unsigned long _codecParams[65]__attribute__((aligned(64))); // TODO: change to struct
- Common::SeekableReadStream *_inStream;
- DisposeAfterUse::Flag _disposeAfterUse;
+ Common::DisposablePtr<Common::SeekableReadStream> _inStream;
uint32 _pcmLength; // how many pcm samples we have for this type of file (x2 this for stereo)
diff --git a/backends/platform/psp/png_loader.cpp b/backends/platform/psp/png_loader.cpp
index 16377539c8..4de13d1e73 100644
--- a/backends/platform/psp/png_loader.cpp
+++ b/backends/platform/psp/png_loader.cpp
@@ -78,7 +78,7 @@ PngLoader::Status PngLoader::allocate() {
bool PngLoader::load() {
DEBUG_ENTER_FUNC();
// Try to load the image
- _file->seek(0); // Go back to start
+ _file.seek(0); // Go back to start
if (!loadImageIntoBuffer()) {
PSP_DEBUG_PRINT("failed to load image\n");
@@ -99,11 +99,9 @@ void PngLoader::warningFn(png_structp png_ptr, png_const_charp warning_msg) {
// Read function for png library to be able to read from our SeekableReadStream
//
void PngLoader::libReadFunc(png_structp pngPtr, png_bytep data, png_size_t length) {
- Common::SeekableReadStream *file;
+ Common::SeekableReadStream &file = *(Common::SeekableReadStream *)pngPtr->io_ptr;
- file = (Common::SeekableReadStream *)pngPtr->io_ptr;
-
- file->read(data, length);
+ file.read(data, length);
}
bool PngLoader::basicImageLoad() {
@@ -120,7 +118,7 @@ bool PngLoader::basicImageLoad() {
return false;
}
// Set the png lib to use our read function
- png_set_read_fn(_pngPtr, (void *)_file, libReadFunc);
+ png_set_read_fn(_pngPtr, &_file, libReadFunc);
unsigned int sig_read = 0;
diff --git a/backends/platform/psp/png_loader.h b/backends/platform/psp/png_loader.h
index 0ff9d8a65d..48a3220d78 100644
--- a/backends/platform/psp/png_loader.h
+++ b/backends/platform/psp/png_loader.h
@@ -34,7 +34,7 @@ private:
static void warningFn(png_structp png_ptr, png_const_charp warning_msg);
static void libReadFunc(png_structp pngPtr, png_bytep data, png_size_t length);
- Common::SeekableReadStream *_file;
+ Common::SeekableReadStream &_file;
Buffer *_buffer;
Palette *_palette;
@@ -57,7 +57,7 @@ public:
BAD_FILE
};
- PngLoader(Common::SeekableReadStream *file, Buffer &buffer, Palette &palette,
+ PngLoader(Common::SeekableReadStream &file, Buffer &buffer, Palette &palette,
Buffer::HowToSize sizeBy = Buffer::kSizeByTextureSize) :
_file(file), _buffer(&buffer), _palette(&palette),
_width(0), _height(0), _paletteSize(0),
diff --git a/backends/platform/psp/portdefs.h b/backends/platform/psp/portdefs.h
index feb0c944ee..e8a28b31e2 100644
--- a/backends/platform/psp/portdefs.h
+++ b/backends/platform/psp/portdefs.h
@@ -53,5 +53,3 @@
//#define printf pspDebugScreenPrintf
#endif /* PORTDEFS_H */
-
-
diff --git a/backends/platform/psp/pspkeyboard.cpp b/backends/platform/psp/pspkeyboard.cpp
index 43c4cada15..66efe9145d 100644
--- a/backends/platform/psp/pspkeyboard.cpp
+++ b/backends/platform/psp/pspkeyboard.cpp
@@ -298,7 +298,7 @@ bool PSPKeyboard::load() {
goto ERROR;
}
- PngLoader image(file, _buffers[i], _palettes[i]);
+ PngLoader image(*file, _buffers[i], _palettes[i]);
if (image.allocate() != PngLoader::OK) {
PSP_ERROR("Failed to allocate memory for keyboard image %s\n", _guiStrings[i]);
diff --git a/backends/platform/psp/rtc.cpp b/backends/platform/psp/rtc.cpp
index 6c8e919986..cbbb7d3f80 100644
--- a/backends/platform/psp/rtc.cpp
+++ b/backends/platform/psp/rtc.cpp
@@ -83,4 +83,3 @@ uint32 PspRtc::getMicros() {
return ticks[0];
}
-
diff --git a/backends/platform/psp/thread.cpp b/backends/platform/psp/thread.cpp
index 5f38a54ab7..57370f7685 100644
--- a/backends/platform/psp/thread.cpp
+++ b/backends/platform/psp/thread.cpp
@@ -228,4 +228,3 @@ void PspCondition::wait(PspMutex &externalMutex) {
externalMutex.lock(); // must lock external mutex here for continuation
}
-
diff --git a/backends/platform/psp/thread.h b/backends/platform/psp/thread.h
index a2f3b5eda2..ca94b8c82c 100644
--- a/backends/platform/psp/thread.h
+++ b/backends/platform/psp/thread.h
@@ -105,5 +105,3 @@ enum StackSizes {
};
#endif /* PSP_THREADS_H */
-
-
diff --git a/backends/platform/psp/trace.cpp b/backends/platform/psp/trace.cpp
index b799b4e870..008b508b7e 100644
--- a/backends/platform/psp/trace.cpp
+++ b/backends/platform/psp/trace.cpp
@@ -148,4 +148,3 @@ void mipsBacktrace(uint32 levels, void **addresses) {
}
}
}
-