mirror of
https://github.com/libretro/RetroArch
synced 2025-02-27 00:40:20 +00:00
(PS3) Added texture loading hooks, fails somewhere ATM
This commit is contained in:
parent
1bfabea14a
commit
f16b269685
@ -132,7 +132,6 @@ static bool ps3graphics_load_jpeg(const char * path, struct texture_image *out_i
|
||||
|
||||
if (ret != CELL_OK)
|
||||
{
|
||||
sys_process_exit(0);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -141,7 +140,6 @@ static bool ps3graphics_load_jpeg(const char * path, struct texture_image *out_i
|
||||
|
||||
if (ret != CELL_OK || dOutInfo.status != CELL_JPGDEC_DEC_STATUS_FINISH)
|
||||
{
|
||||
sys_process_exit(0);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ static void get_path_settings(bool multiman_support)
|
||||
/* now we fill in all the variables */
|
||||
snprintf(DEFAULT_PRESET_FILE, sizeof(DEFAULT_PRESET_FILE), "%s/presets/stock.conf", usrDirPath);
|
||||
snprintf(DEFAULT_BORDER_FILE, sizeof(DEFAULT_BORDER_FILE), "%s/borders/Centered-1080p/mega-man-2.png", usrDirPath);
|
||||
snprintf(DEFAULT_MENU_BORDER_FILE, sizeof(DEFAULT_MENU_BORDER_FILE), "%s/borders/Menu/main-menu.png", usrDirPath);
|
||||
snprintf(DEFAULT_MENU_BORDER_FILE, sizeof(DEFAULT_MENU_BORDER_FILE), "%s/borders/Menu/main-menu.jpg", usrDirPath);
|
||||
snprintf(GAME_AWARE_SHADER_DIR_PATH, sizeof(GAME_AWARE_SHADER_DIR_PATH), "%s/gameaware", usrDirPath);
|
||||
snprintf(PRESETS_DIR_PATH, sizeof(PRESETS_DIR_PATH), "%s/presets", usrDirPath);
|
||||
snprintf(INPUT_PRESETS_DIR_PATH, sizeof(INPUT_PRESETS_DIR_PATH), "%s/input-presets", usrDirPath);
|
||||
@ -494,10 +494,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
cellSysmoduleLoadModule(CELL_SYSMODULE_FS);
|
||||
cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_GAME);
|
||||
cellSysmoduleLoadModule(CELL_SYSMODULE_AVCONF_EXT);
|
||||
cellSysmoduleLoadModule(CELL_SYSMODULE_PNGDEC);
|
||||
cellSysmoduleLoadModule(CELL_SYSMODULE_JPGDEC);
|
||||
|
||||
ssnes_main_clear_state();
|
||||
|
||||
g_console.block_config_read = true;
|
||||
g_extern.verbose = true;
|
||||
config_set_defaults();
|
||||
|
||||
SSNES_LOG("Registering Callback\n");
|
||||
|
@ -35,10 +35,9 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "../gfx/gl_common.h"
|
||||
#include "../gfx/gfx_common.h"
|
||||
#include "../strl.h"
|
||||
|
||||
#include "../gfx/image.h"
|
||||
#include "../gfx/shader_cg.h"
|
||||
|
||||
#define BLUE 0xffff0000u
|
||||
@ -129,6 +128,9 @@ typedef struct gl
|
||||
unsigned base_size; // 2 or 4
|
||||
} gl_t;
|
||||
|
||||
static struct texture_image menu_texture;
|
||||
static GLuint menu_texture_id;
|
||||
|
||||
static bool gl_shader_init(void)
|
||||
{
|
||||
switch (g_settings.video.shader_type)
|
||||
@ -1131,6 +1133,41 @@ void ps3_unblock_swap (void)
|
||||
SSNES_LOG("Swap is set to non-blocked\n");
|
||||
}
|
||||
|
||||
bool ps3_setup_texture(void)
|
||||
{
|
||||
gl_t *gl = g_gl;
|
||||
|
||||
if (!gl)
|
||||
return false;
|
||||
|
||||
glGenTextures(1, &menu_texture_id);
|
||||
|
||||
SSNES_LOG("Loading texture image for menu...\n");
|
||||
if(!texture_image_load(DEFAULT_MENU_BORDER_FILE, &menu_texture))
|
||||
{
|
||||
SSNES_ERR("Failed to load texture image for menu\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, menu_texture_id);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_ARGB_SCE, gl->win_width, gl->win_height, 0,
|
||||
GL_ARGB_SCE, GL_UNSIGNED_INT_8_8_8_8, menu_texture.pixels);
|
||||
|
||||
glClientActiveTexture(GL_TEXTURE1);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, (void*)(128 * 3));
|
||||
glClientActiveTexture(GL_TEXTURE0);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, menu_texture_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// PS3 needs a working graphics stack before SSNES even starts.
|
||||
// To deal with this main.c,
|
||||
// the top level module owns the instance, and is created beforehand.
|
||||
@ -1146,9 +1183,9 @@ void ps3_video_init(void)
|
||||
video_info.input_scale = 2;
|
||||
g_gl = gl_init(&video_info, NULL, NULL);
|
||||
|
||||
|
||||
get_all_available_resolutions();
|
||||
ps3_set_resolution();
|
||||
ps3_setup_texture();
|
||||
}
|
||||
|
||||
void ps3_video_deinit(void)
|
||||
|
@ -20,6 +20,7 @@
|
||||
#define _PS3_VIDEO_PSGL_H
|
||||
|
||||
#include "../gfx/gl_common.h"
|
||||
#include "../gfx/gfx_common.h"
|
||||
#include <cell/dbgfont.h>
|
||||
|
||||
void ps3_video_init(void);
|
||||
@ -32,6 +33,7 @@ int ps3_check_resolution(uint32_t resolution_id);
|
||||
void ps3_block_swap (void);
|
||||
void ps3_unblock_swap (void);
|
||||
void gl_frame_menu(void);
|
||||
bool ps3_setup_texture(void);
|
||||
|
||||
extern void *g_gl;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user