From fb8c08c998acf100b70ed8852d701ee01f7014e9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 15 Jul 2012 18:04:54 +0200 Subject: [PATCH] (Xbox 1) More indenting nits --- xbox1/xdk_d3d8.cpp | 53 ++++++++++++++---------------- xbox1/xinput_xbox_input.c | 68 +++++++++++++++++++-------------------- 2 files changed, 59 insertions(+), 62 deletions(-) diff --git a/xbox1/xdk_d3d8.cpp b/xbox1/xdk_d3d8.cpp index aa93e64660..d790b13c5a 100644 --- a/xbox1/xdk_d3d8.cpp +++ b/xbox1/xdk_d3d8.cpp @@ -234,28 +234,26 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu if(XGetAVPack() == XC_AV_PACK_HDTV) { - if(d3d->video_mode & XC_VIDEO_FLAGS_HDTV_480p) - { - g_console.menus_hd_enable = false; - d3d->d3dpp.BackBufferWidth = 640; - d3d->d3dpp.BackBufferHeight = 480; - d3d->d3dpp.Flags = D3DPRESENTFLAG_PROGRESSIVE; - } - + if(d3d->video_mode & XC_VIDEO_FLAGS_HDTV_480p) + { + g_console.menus_hd_enable = false; + d3d->d3dpp.BackBufferWidth = 640; + d3d->d3dpp.BackBufferHeight = 480; + d3d->d3dpp.Flags = D3DPRESENTFLAG_PROGRESSIVE; + } else if(d3d->video_mode & XC_VIDEO_FLAGS_HDTV_720p) { - g_console.menus_hd_enable = true; - d3d->d3dpp.BackBufferWidth = 1280; - d3d->d3dpp.BackBufferHeight = 720; - d3d->d3dpp.Flags = D3DPRESENTFLAG_PROGRESSIVE; + g_console.menus_hd_enable = true; + d3d->d3dpp.BackBufferWidth = 1280; + d3d->d3dpp.BackBufferHeight = 720; + d3d->d3dpp.Flags = D3DPRESENTFLAG_PROGRESSIVE; } - else if(d3d->video_mode & XC_VIDEO_FLAGS_HDTV_1080i) { - g_console.menus_hd_enable = true; - d3d->d3dpp.BackBufferWidth = 1920; - d3d->d3dpp.BackBufferHeight = 1080; - d3d->d3dpp.Flags = D3DPRESENTFLAG_INTERLACED; + g_console.menus_hd_enable = true; + d3d->d3dpp.BackBufferWidth = 1920; + d3d->d3dpp.BackBufferHeight = 1080; + d3d->d3dpp.Flags = D3DPRESENTFLAG_INTERLACED; } } @@ -264,14 +262,13 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu ((d3d->d3dpp.BackBufferWidth == 720) && (d3d->d3dpp.BackBufferHeight == 576))) // 16:9 d3d->d3dpp.Flags |= D3DPRESENTFLAG_WIDESCREEN; - // no letterboxing in 4:3 mode (if widescreen is unsupported - d3d->d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8; + d3d->d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8; d3d->d3dpp.FullScreen_PresentationInterval = video->vsync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; - d3d->d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; - d3d->d3dpp.BackBufferCount = 2; - d3d->d3dpp.EnableAutoDepthStencil = FALSE; - d3d->d3dpp.SwapEffect = D3DSWAPEFFECT_COPY; + d3d->d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; + d3d->d3dpp.BackBufferCount = 2; + d3d->d3dpp.EnableAutoDepthStencil = FALSE; + d3d->d3dpp.SwapEffect = D3DSWAPEFFECT_COPY; d3d->d3d_device->CreateDevice(0, D3DDEVTYPE_HAL, NULL, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3d->d3dpp, &d3d->d3d_render_device); @@ -340,7 +337,7 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu d3d->vsync = video->vsync; - // load debug font (toggle option in later revisions ?) + // load debug font (toggle option in later revisions ?) #ifdef SHOW_DEBUG_INFO XFONT_OpenDefaultFont(&d3d->debug_font); d3d->debug_font->SetBkMode(XFONT_TRANSPARENT); @@ -453,10 +450,10 @@ static bool xdk_d3d_frame(void *data, const void *frame, // FIXME: Add fps counter /* - swprintf(buffer, L"%02d / %02d FPS", fps, IsPal ? 50 : 60); - d3d->debug_font->TextOut(d3d->pFrontBuffer, d3d->buffer, (unsigned)-1, 30, 70 ); - d3d->debug_font->TextOut(d3d->pBackBuffer, d3d->buffer, (unsigned)-1, 30, 70 ); - */ + swprintf(buffer, L"%02d / %02d FPS", fps, IsPal ? 50 : 60); + d3d->debug_font->TextOut(d3d->pFrontBuffer, d3d->buffer, (unsigned)-1, 30, 70 ); + d3d->debug_font->TextOut(d3d->pBackBuffer, d3d->buffer, (unsigned)-1, 30, 70 ); + */ d3d->pFrontBuffer->Release(); d3d->pBackBuffer->Release(); diff --git a/xbox1/xinput_xbox_input.c b/xbox1/xinput_xbox_input.c index 357f5363db..85ee7cdb56 100644 --- a/xbox1/xinput_xbox_input.c +++ b/xbox1/xinput_xbox_input.c @@ -102,52 +102,52 @@ static int16_t xinput_input_state(void *data, const struct retro_keybind **binds retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_B]) ? 1 : 0; break; case RETRO_DEVICE_ID_JOYPAD_B: - retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_A]) ? 1 : 0; - break; + retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_A]) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_X: - retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_Y]) ? 1 : 0; - break; + retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_Y]) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_Y: - retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_X]) ? 1 : 0; - break; + retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_X]) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_LEFT: - retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT) || (state[player].Gamepad.sThumbLX < -DEADZONE) ? 1 : 0; - break; + retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT) || (state[player].Gamepad.sThumbLX < -DEADZONE) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_RIGHT: - retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) || (state[player].Gamepad.sThumbLX > DEADZONE) ? 1 : 0; - break; + retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) || (state[player].Gamepad.sThumbLX > DEADZONE) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_UP: - retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP) || (state[player].Gamepad.sThumbLY > DEADZONE) ? 1 : 0; - break; + retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP) || (state[player].Gamepad.sThumbLY > DEADZONE) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_DOWN: - retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN)|| (state[player].Gamepad.sThumbLY < -DEADZONE) ? 1 : 0; - break; + retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN)|| (state[player].Gamepad.sThumbLY < -DEADZONE) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_START: - retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_START) ? 1 : 0; - break; + retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_START) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_SELECT: - retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_BACK) ? 1 : 0; - break; + retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_BACK) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_L: - retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_LEFT_TRIGGER]) ? 1 : 0; - break; + retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_LEFT_TRIGGER]) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_R: - retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_RIGHT_TRIGGER]) ? 1 : 0; - break; + retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_RIGHT_TRIGGER]) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_L2: - retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_WHITE]) ? 1 : 0; - break; + retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_WHITE]) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_R2: - retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_BLACK]) ? 1 : 0; - break; + retval = (state[player].Gamepad.bAnalogButtons[XINPUT_GAMEPAD_BLACK]) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_L3: - retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) ? 1 : 0; - break; + retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) ? 1 : 0; + break; case RETRO_DEVICE_ID_JOYPAD_R3: - retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) ? 1 : 0; - break; + retval = (state[player].Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) ? 1 : 0; + break; default: - break; + break; } return retval; @@ -169,10 +169,10 @@ static void* xinput_input_init(void) { case XDEVICE_ENUMERATION_IDLE: RARCH_LOG("Input state status: XDEVICE_ENUMERATION_IDLE\n"); - break; + break; case XDEVICE_ENUMERATION_BUSY: - RARCH_LOG("Input state status: XDEVICE_ENUMERATION_BUSY\n"); - break; + RARCH_LOG("Input state status: XDEVICE_ENUMERATION_BUSY\n"); + break; } while(XGetDeviceEnumerationStatus() == XDEVICE_ENUMERATION_BUSY) {}