aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/psp
diff options
context:
space:
mode:
authorMax Horn2007-09-18 20:16:33 +0000
committerMax Horn2007-09-18 20:16:33 +0000
commit3abc11611e1d1d93f1cf794df28879de3571bd01 (patch)
treee1ac8a925d1388f8df010a114d7bed471fc9fe3b /backends/platform/psp
parentc3d3aebe87d16d4fc3b7ac8581b99fb97241c9ac (diff)
downloadscummvm-rg350-3abc11611e1d1d93f1cf794df28879de3571bd01.tar.gz
scummvm-rg350-3abc11611e1d1d93f1cf794df28879de3571bd01.tar.bz2
scummvm-rg350-3abc11611e1d1d93f1cf794df28879de3571bd01.zip
Code formatting fixes
svn-id: r28945
Diffstat (limited to 'backends/platform/psp')
-rw-r--r--backends/platform/psp/osys_psp.cpp10
-rw-r--r--backends/platform/psp/osys_psp_gu.cpp32
-rw-r--r--backends/platform/psp/trace.cpp4
3 files changed, 23 insertions, 23 deletions
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 20a50c1b47..5144f5a401 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -235,13 +235,13 @@ void OSystem_PSP::updateScreen() {
}
}
- if(_overlayVisible) {
+ if (_overlayVisible) {
for (int i = 0; i < _screenHeight; ++i) {
for (int j = 0; j < _screenWidth; ++j) {
OverlayColor pixel = _overlayBuffer[(i * _overlayWidth +j)];
- if(pixel & 0x8000)
+ if (pixel & 0x8000)
putPixel(xStart + j, yStart + i, pixel);
}
}
@@ -362,7 +362,7 @@ void OSystem_PSP::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
OverlayColor OSystem_PSP::ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) {
OverlayColor color = RGBToColor(r, g, b);
- if(a == 255)
+ if (a == 255)
color |= 0x8000;
return color;
@@ -370,7 +370,7 @@ OverlayColor OSystem_PSP::ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) {
void OSystem_PSP::colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) {
colorToRGB(color, r, g, b);
- if(color & 0x8000)
+ if (color & 0x8000)
a = 255;
else
a = 0;
@@ -530,7 +530,7 @@ bool OSystem_PSP::pollEvent(Common::Event &event) {
if (newX < 0) newX = 0;
if (newY < 0) newY = 0;
- if(_overlayVisible)
+ if (_overlayVisible)
{
if (newX >= _overlayWidth) newX = _overlayWidth - 1;
if (newY >= _overlayHeight) newY = _overlayHeight - 1;
diff --git a/backends/platform/psp/osys_psp_gu.cpp b/backends/platform/psp/osys_psp_gu.cpp
index a939229c84..bb14d07033 100644
--- a/backends/platform/psp/osys_psp_gu.cpp
+++ b/backends/platform/psp/osys_psp_gu.cpp
@@ -149,7 +149,7 @@ void OSystem_PSP_GU::initSize(uint width, uint height) {
_kbdClut[0] = 0xffff;
_kbdClut[246] = 0x4ccc;
_kbdClut[247] = 0x0000;
- for(int i=1;i<31;i++)
+ for (int i=1;i<31;i++)
_kbdClut[i] = 0xf888;
_mouseVisible = false;
sceKernelDcacheWritebackAll();
@@ -167,8 +167,8 @@ bool OSystem_PSP_GU::setGraphicsMode(int mode) {
bool OSystem_PSP_GU::setGraphicsMode(const char *name) {
int i = 0;
- while(s_supportedGraphicsModes[i].name) {
- if(!strcmpi(s_supportedGraphicsModes[i].name, name)) {
+ while (s_supportedGraphicsModes[i].name) {
+ if (!strcmpi(s_supportedGraphicsModes[i].name, name)) {
_graphicMode = s_supportedGraphicsModes[i].id;
return true;
}
@@ -196,7 +196,7 @@ void OSystem_PSP_GU::setMouseCursor(const byte *buf, uint w, uint h, int hotspot
mouseClut[_mouseKeyColour] = 0;
sceKernelDcacheWritebackAll();
- for(unsigned int i=0;i<h;i++)
+ for (unsigned int i=0;i<h;i++)
memcpy(_mouseBuf+i*MOUSE_SIZE, buf+i*w, w);
}
@@ -277,7 +277,7 @@ void OSystem_PSP_GU::updateScreen() {
sceGuClutMode(GU_PSM_5551, 0, 0xff, 0);
sceGuClutLoad(32, clut256); // upload 32*8 entries (256)
sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
- if(_screenWidth == 320)
+ if (_screenWidth == 320)
sceGuTexImage(0, 512, 256, _screenWidth, _offscreen);
else
sceGuTexImage(0, 512, 512, _screenWidth, _offscreen);
@@ -315,7 +315,7 @@ void OSystem_PSP_GU::updateScreen() {
}
sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
- if(_screenWidth == 640) {
+ if (_screenWidth == 640) {
sceGuTexImage(0, 512, 512, _screenWidth, _offscreen+512);
vertices[0].u = 512 + 0.5; vertices[1].v = _screenHeight - 0.5;
vertices[0].x += (vertices[1].x - vertices[0].x) * 511 / 640; vertices[0].y = 0; vertices[0].z = 0;
@@ -324,7 +324,7 @@ void OSystem_PSP_GU::updateScreen() {
// draw overlay
- if(_overlayVisible) {
+ if (_overlayVisible) {
vertices[0].x = 0; vertices[0].y = 0; vertices[0].z = 0;
vertices[1].x = PSP_SCREEN_WIDTH; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
vertices[0].u = 0.5; vertices[0].v = 0.5;
@@ -340,7 +340,7 @@ void OSystem_PSP_GU::updateScreen() {
sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA);
sceGuDrawArray(GU_SPRITES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D,2,0,vertices);
// need to render twice for textures > 512
- if( _overlayWidth > 512) {
+ if ( _overlayWidth > 512) {
sceGuTexImage(0, 512, 512, _overlayWidth, _overlayBuffer + 512);
vertices[0].u = 512 + 0.5; vertices[1].v = _overlayHeight - 0.5;
vertices[0].x = PSP_SCREEN_WIDTH * 512 / 640; vertices[0].y = 0; vertices[0].z = 0;
@@ -365,7 +365,7 @@ void OSystem_PSP_GU::updateScreen() {
int mX = _mouseX - _mouseHotspotX;
int mY = _mouseY - _mouseHotspotY;
- if(_overlayVisible) {
+ if (_overlayVisible) {
float scalex, scaley;
scalex = (float)PSP_SCREEN_WIDTH /_overlayWidth;
@@ -417,7 +417,7 @@ void OSystem_PSP_GU::updateScreen() {
sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
}
- if(_keyboardVisible) {
+ if (_keyboardVisible) {
sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
sceGuClutMode(GU_PSM_4444, 0, 0xff, 0);
sceGuClutLoad(32, kbClut); // upload 32*8 entries (256)
@@ -469,13 +469,13 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) {
uint32 buttonsChanged = pad.Buttons ^ _prevButtons;
if ((buttonsChanged & PSP_CTRL_SELECT) || (pad.Buttons & PSP_CTRL_SELECT)) {
- if( !(pad.Buttons & PSP_CTRL_SELECT) )
+ if ( !(pad.Buttons & PSP_CTRL_SELECT) )
_keyboardVisible = !_keyboardVisible;
_prevButtons = pad.Buttons;
return false;
}
- if(!_keyboardVisible)
+ if (!_keyboardVisible)
return OSystem_PSP::pollEvent(event);
if ( (buttonsChanged & PSP_CTRL_RTRIGGER) && !(pad.Buttons & PSP_CTRL_RTRIGGER))
@@ -520,17 +520,17 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) {
x = pad.Lx-128;
y = pad.Ly-128;
_kbdClut[_keySelected] = 0xf888;
- if(x*x + y*y > 10000) {
+ if (x*x + y*y > 10000) {
nub_angle = atan2(y, x);
_keySelected = (int)(1 + (M_PI + nub_angle) * 30 / (2 * M_PI));
_keySelected -= 2;
- if(_keySelected < 1)
+ if (_keySelected < 1)
_keySelected += 30;
_kbdClut[_keySelected] = 0xffff;
if (buttonsChanged & PSP_CTRL_CROSS) {
event.type = (pad.Buttons & PSP_CTRL_CROSS) ? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP;
- if(_keySelected > 26) {
+ if (_keySelected > 26) {
event.kbd.flags = 0;
switch(_keySelected) {
case 27:
@@ -570,7 +570,7 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) {
}
break;
case (SYMBOLS|CAPS_LOCK):
- if(_keySelected < 21) {
+ if (_keySelected < 21) {
event.kbd.flags = 0;
event.kbd.ascii = kbd_ascii_cl[_keySelected-1];
event.kbd.keycode = kbd_code_cl[ _keySelected-1];
diff --git a/backends/platform/psp/trace.cpp b/backends/platform/psp/trace.cpp
index 3fe796dd26..80ea98f8b6 100644
--- a/backends/platform/psp/trace.cpp
+++ b/backends/platform/psp/trace.cpp
@@ -41,7 +41,7 @@ void PSPDebugTrace (const char *format, ...) {
fd = sceIoOpen("MS0:/DTRACE.TXT", PSP_O_RDWR | PSP_O_CREAT | PSP_O_APPEND, 0777);
- if(fd <= 0)
+ if (fd <= 0)
{
return;
}
@@ -63,7 +63,7 @@ void PSPDebugTrace (const char * filename, const char *format, ...) {
fd = sceIoOpen(filename, PSP_O_RDWR | PSP_O_CREAT | PSP_O_APPEND, 0777);
- if(fd <= 0)
+ if (fd <= 0)
{
return;
}