(PS3)_Made ps3_ctx file - implemented set_swap_interval function -

removed gl_common.c
This commit is contained in:
Twinaphex 2012-05-26 14:59:42 +02:00
parent 8f74b1a555
commit 97b966ab59
5 changed files with 42 additions and 26 deletions

View File

@ -108,7 +108,6 @@ const DWORD g_MapLinearToSrgbGpuFormat[] =
struct XPR_HEADER
{
unsigned long dwMagic;
unsigned long dwHeaderSize;
unsigned long dwDataSize;
};
@ -165,13 +164,6 @@ HRESULT PackedResource::Create( const char * strFilename )
return E_FAIL;
}
if( xprh.dwMagic != XPR2_MAGIC_VALUE )
{
RARCH_ERR( "Invalid Xbox Packed Resource (.xpr) file: Magic = 0x%08lx.\n", xprh.dwMagic );
CloseHandle( hFile );
return E_FAIL;
}
// Compute memory requirements
m_dwSysMemDataSize = xprh.dwHeaderSize;
m_dwVidMemDataSize = xprh.dwDataSize;

View File

@ -43,11 +43,8 @@ CONFIG FILE
/*============================================================
VIDEO
============================================================ */
#ifdef HAVE_OPENGL
#include "../../gfx/gl_common.c"
#endif
#if defined(__CELLOS_LV2__)
#include "../../gfx/context/ps3_ctx.c"
#include "../../gfx/shader_cg.c"
#include "../../ps3/ps3_video_psgl.c"
#include "../../ps3/image.c"

View File

@ -14,25 +14,32 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "../driver.h"
#include "../../driver.h"
#include <stdint.h>
#include "gl_common.h"
#include "gfx_common.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/*============================================================
VIDEO
============================================================ */
#include "../gl_common.h"
void rarch_gl_set_vsync(unsigned enabled)
#include "ps3_ctx.h"
void gfx_ctx_set_swap_interval(unsigned interval, bool inited)
{
if(enabled)
glEnable(GL_VSYNC_SCE);
else
glDisable(GL_VSYNC_SCE);
bool success = false;
if(inited)
{
success = true;
if (interval)
glEnable(GL_VSYNC_SCE);
else
glDisable(GL_VSYNC_SCE);
}
if (!success)
RARCH_WARN("Failed to set swap interval.\n");
}

20
gfx/context/ps3_ctx.h Normal file
View File

@ -0,0 +1,20 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
* Copyright (C) 2011-2012 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PS3_CTX_H
#define _PS3_CTX_H
#endif

View File

@ -1428,13 +1428,13 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state) || CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state))
{
g_console.throttle_enable = !g_console.throttle_enable;
rarch_gl_set_vsync(g_console.throttle_enable);
gfx_ctx_set_swap_interval(g_console.throttle_enable, true);
set_delay = DELAY_MEDIUM;
}
if(CTRL_START(state))
{
g_console.throttle_enable = true;
rarch_gl_set_vsync(g_console.throttle_enable);
gfx_ctx_set_swap_interval(g_console.throttle_enable, true);
set_delay = DELAY_MEDIUM;
}
break;