(360/PS3) Indenting nits

This commit is contained in:
Twinaphex 2012-04-14 04:38:40 +02:00
parent 80e2f61eab
commit 089e97b942
11 changed files with 1734 additions and 1749 deletions

View File

@ -19,85 +19,85 @@
#include "xdk360_video_resources.h"
#define PAGE_UP (255)
#define PAGE_DOWN (-255)
#define PAGE_UP (255)
#define PAGE_DOWN (-255)
#define SCREEN_SIZE_X_DEFAULT 640
#define SCREEN_SIZE_Y_DEFAULT 480
#define SAFE_AREA_PCT_4x3 85
#define SAFE_AREA_PCT_HDTV 90
#define SAFE_AREA_PCT_4x3 85
#define SAFE_AREA_PCT_HDTV 90
typedef struct
{
float m_fLineHeight; // height of a single line in pixels
unsigned int m_nScrollOffset; // offset to display text (in lines)
unsigned int first_message;
unsigned int m_cxSafeArea;
unsigned int m_cySafeArea;
unsigned int m_cxSafeAreaOffset;
unsigned int m_cySafeAreaOffset;
unsigned int m_nCurLine; // index of current line being written to
unsigned int m_cCurLineLength; // length of the current line
unsigned long m_colBackColor;
unsigned long m_colTextColor;
unsigned int m_cScreenHeight; // height in lines of screen area
unsigned int m_cScreenHeightVirtual; // height in lines of text storage buffer
unsigned int m_cScreenWidth; // width in characters
wchar_t * m_Buffer; // buffer big enough to hold a full screen
wchar_t ** m_Lines; // pointers to individual lines
float m_fLineHeight; // height of a single line in pixels
unsigned int m_nScrollOffset; // offset to display text (in lines)
unsigned int first_message;
unsigned int m_cxSafeArea;
unsigned int m_cySafeArea;
unsigned int m_cxSafeAreaOffset;
unsigned int m_cySafeAreaOffset;
unsigned int m_nCurLine; // index of current line being written to
unsigned int m_cCurLineLength; // length of the current line
unsigned long m_colBackColor;
unsigned long m_colTextColor;
unsigned int m_cScreenHeight; // height in lines of screen area
unsigned int m_cScreenHeightVirtual; // height in lines of text storage buffer
unsigned int m_cScreenWidth; // width in characters
wchar_t * m_Buffer; // buffer big enough to hold a full screen
wchar_t ** m_Lines; // pointers to individual lines
} video_console_t;
typedef struct GLYPH_ATTR
{
unsigned short tu1, tv1, tu2, tv2; // Texture coordinates for the image
short wOffset; // Pixel offset for glyph start
short wWidth; // Pixel width of the glyph
short wAdvance; // Pixels to advance after the glyph
unsigned short wMask; // Channel mask
unsigned short tu1, tv1, tu2, tv2; // Texture coordinates for the image
short wOffset; // Pixel offset for glyph start
short wWidth; // Pixel width of the glyph
short wAdvance; // Pixels to advance after the glyph
unsigned short wMask; // Channel mask
} GLYPH_ATTR;
enum SavedStates
{
SAVEDSTATE_D3DRS_ALPHABLENDENABLE,
SAVEDSTATE_D3DRS_SRCBLEND,
SAVEDSTATE_D3DRS_DESTBLEND,
SAVEDSTATE_D3DRS_BLENDOP,
SAVEDSTATE_D3DRS_ALPHATESTENABLE,
SAVEDSTATE_D3DRS_ALPHAREF,
SAVEDSTATE_D3DRS_ALPHAFUNC,
SAVEDSTATE_D3DRS_FILLMODE,
SAVEDSTATE_D3DRS_CULLMODE,
SAVEDSTATE_D3DRS_ZENABLE,
SAVEDSTATE_D3DRS_STENCILENABLE,
SAVEDSTATE_D3DRS_VIEWPORTENABLE,
SAVEDSTATE_D3DSAMP_MINFILTER,
SAVEDSTATE_D3DSAMP_MAGFILTER,
SAVEDSTATE_D3DSAMP_ADDRESSU,
SAVEDSTATE_D3DSAMP_ADDRESSV,
SAVEDSTATE_D3DRS_ALPHABLENDENABLE,
SAVEDSTATE_D3DRS_SRCBLEND,
SAVEDSTATE_D3DRS_DESTBLEND,
SAVEDSTATE_D3DRS_BLENDOP,
SAVEDSTATE_D3DRS_ALPHATESTENABLE,
SAVEDSTATE_D3DRS_ALPHAREF,
SAVEDSTATE_D3DRS_ALPHAFUNC,
SAVEDSTATE_D3DRS_FILLMODE,
SAVEDSTATE_D3DRS_CULLMODE,
SAVEDSTATE_D3DRS_ZENABLE,
SAVEDSTATE_D3DRS_STENCILENABLE,
SAVEDSTATE_D3DRS_VIEWPORTENABLE,
SAVEDSTATE_D3DSAMP_MINFILTER,
SAVEDSTATE_D3DSAMP_MAGFILTER,
SAVEDSTATE_D3DSAMP_ADDRESSU,
SAVEDSTATE_D3DSAMP_ADDRESSV,
SAVEDSTATE_COUNT
SAVEDSTATE_COUNT
};
typedef struct
{
unsigned int m_bSaveState;
unsigned long m_dwSavedState[ SAVEDSTATE_COUNT ];
unsigned long m_dwNestedBeginCount;
unsigned long m_cMaxGlyph; // Number of entries in the translator table
unsigned long m_dwNumGlyphs; // Number of valid glyphs
float m_fFontHeight; // Height of the font strike in pixels
float m_fFontTopPadding; // Padding above the strike zone
float m_fFontBottomPadding; // Padding below the strike zone
float m_fFontYAdvance; // Number of pixels to move the cursor for a line feed
float m_fXScaleFactor; // Scaling constants
float m_fYScaleFactor;
float m_fCursorX; // Current text cursor
float m_fCursorY;
D3DRECT m_rcWindow; // Bounds rect of the text window, modify via accessors only!
wchar_t * m_TranslatorTable; // ASCII to glyph lookup table
D3DTexture* m_pFontTexture;
const GLYPH_ATTR* m_Glyphs; // Array of glyphs
unsigned int m_bSaveState;
unsigned long m_dwSavedState[ SAVEDSTATE_COUNT ];
unsigned long m_dwNestedBeginCount;
unsigned long m_cMaxGlyph; // Number of entries in the translator table
unsigned long m_dwNumGlyphs; // Number of valid glyphs
float m_fFontHeight; // Height of the font strike in pixels
float m_fFontTopPadding; // Padding above the strike zone
float m_fFontBottomPadding; // Padding below the strike zone
float m_fFontYAdvance; // Number of pixels to move the cursor for a line feed
float m_fXScaleFactor; // Scaling constants
float m_fYScaleFactor;
float m_fCursorX; // Current text cursor
float m_fCursorY;
D3DRECT m_rcWindow; // Bounds rect of the text window, modify via accessors only!
wchar_t * m_TranslatorTable; // ASCII to glyph lookup table
D3DTexture* m_pFontTexture;
const GLYPH_ATTR* m_Glyphs; // Array of glyphs
} xdk360_video_font_t;
HRESULT xdk360_console_init ( LPCSTR strFontFileName, D3DCOLOR colBackColor, D3DCOLOR colTextColor);
@ -114,6 +114,6 @@ void xdk360_video_font_begin (xdk360_video_font_t * font);
void xdk360_video_font_end (xdk360_video_font_t * font);
void xdk360_video_font_set_size(float x, float y);
void xdk360_video_font_draw_text(xdk360_video_font_t * font, float fOriginX, float fOriginY, unsigned long dwColor,
const wchar_t * strText, float fMaxPixelWidth );
const wchar_t * strText, float fMaxPixelWidth );
#endif

View File

@ -26,10 +26,10 @@
#include "../general.h"
CSSNES app;
CSSNES app;
filebrowser_t browser;
filebrowser_t tmp_browser;
char strbuffer[1024];
char strbuffer[1024];
static void return_to_game (void)
{
@ -70,7 +70,7 @@ HRESULT CSSNES::UnregisterXuiClasses (void)
}
static void filebrowser_fetch_directory_entries(const char *path, filebrowser_t * browser, CXuiList * romlist,
CXuiTextElement * rompath_title)
CXuiTextElement * rompath_title)
{
filebrowser_push_directory(browser, path, true);

View File

@ -40,15 +40,15 @@ static void xdk360_input_poll(void *data)
unsigned long retval = XInputGetState(i, &state_tmp);
pads_connected += (retval == ERROR_DEVICE_NOT_CONNECTED) ? 0 : 1;
state[i] = state_tmp.Gamepad.wButtons;
state[i] |= ((state_tmp.Gamepad.sThumbLX < -DEADZONE)) << 16;
state[i] |= ((state_tmp.Gamepad.sThumbLX > DEADZONE)) << 17;
state[i] |= ((state_tmp.Gamepad.sThumbLY > DEADZONE)) << 18;
state[i] |= ((state_tmp.Gamepad.sThumbLY < -DEADZONE)) << 19;
state[i] |= ((state_tmp.Gamepad.sThumbRX < -DEADZONE)) << 20;
state[i] |= ((state_tmp.Gamepad.sThumbRX > DEADZONE)) << 21;
state[i] |= ((state_tmp.Gamepad.sThumbRY > DEADZONE)) << 22;
state[i] |= ((state_tmp.Gamepad.sThumbRY < -DEADZONE)) << 23;
state[i] |= ((state_tmp.Gamepad.bLeftTrigger > 128 ? 1 : 0)) << 24;
state[i] |= ((state_tmp.Gamepad.sThumbLX < -DEADZONE)) << 16;
state[i] |= ((state_tmp.Gamepad.sThumbLX > DEADZONE)) << 17;
state[i] |= ((state_tmp.Gamepad.sThumbLY > DEADZONE)) << 18;
state[i] |= ((state_tmp.Gamepad.sThumbLY < -DEADZONE)) << 19;
state[i] |= ((state_tmp.Gamepad.sThumbRX < -DEADZONE)) << 20;
state[i] |= ((state_tmp.Gamepad.sThumbRX > DEADZONE)) << 21;
state[i] |= ((state_tmp.Gamepad.sThumbRY > DEADZONE)) << 22;
state[i] |= ((state_tmp.Gamepad.sThumbRY < -DEADZONE)) << 23;
state[i] |= ((state_tmp.Gamepad.bLeftTrigger > 128 ? 1 : 0)) << 24;
state[i] |= ((state_tmp.Gamepad.bRightTrigger > 128 ? 1 : 0)) << 25;
}
}

View File

@ -360,29 +360,29 @@ static void *xdk360_gfx_init(const video_info_t *video, const input_driver_t **i
ID3DXBuffer* pErrorMsg = NULL;
ret = D3DXCompileShaderFromFile(
g_settings.video.cg_shader_path, //filepath
NULL, //macros
NULL, //includes
"main_vertex", // main function
"vs_2_0", // shader profile
0, // flags
&pShaderCodeV, // compiled operations
&pErrorMsg, // errors
NULL); // constants
g_settings.video.cg_shader_path, //filepath
NULL, //macros
NULL, //includes
"main_vertex", // main function
"vs_2_0", // shader profile
0, // flags
&pShaderCodeV, // compiled operations
&pErrorMsg, // errors
NULL); // constants
if (SUCCEEDED(ret))
{
SSNES_LOG("Vertex shader program from [%s] successfully compiled.\n", "game:\\media\\shaders\\stock.cg");
ret = D3DXCompileShaderFromFile(
g_settings.video.cg_shader_path, //filepath
NULL, //macros
NULL, //includes
"main_fragment", // main function
"ps_2_0", // shader profile
0, // flags
&pShaderCodeP, // compiled operations
&pErrorMsg, // errors
NULL); // constants
g_settings.video.cg_shader_path, //filepath
NULL, //macros
NULL, //includes
"main_fragment", // main function
"ps_2_0", // shader profile
0, // flags
&pShaderCodeP, // compiled operations
&pErrorMsg, // errors
NULL); // constants
}
if (FAILED(ret))
@ -476,10 +476,10 @@ static bool xdk360_gfx_frame(void *data, const void *frame,
float tex_h = height / 512.0f;
const DrawVerticeFormats verts[] = {
{ -1.0f, -1.0f, 0.0f, tex_h },
{ 1.0f, -1.0f, tex_w, tex_h },
{ -1.0f, 1.0f, 0.0f, 0.0f },
{ 1.0f, 1.0f, tex_w, 0.0f },
{ -1.0f, -1.0f, 0.0f, tex_h },
{ 1.0f, -1.0f, tex_w, tex_h },
{ -1.0f, 1.0f, 0.0f, 0.0f },
{ 1.0f, 1.0f, tex_w, 0.0f },
};
void *verts_ptr = (BYTE*)D3DVertexBuffer_Lock(vid->vertex_buf, 0, 0, 0);
@ -515,7 +515,7 @@ static bool xdk360_gfx_frame(void *data, const void *frame,
D3DDevice_SetVertexDeclaration(vid->xdk360_render_device, vid->pVertexDecl);
D3DDevice_SetStreamSource_Inline(vid->xdk360_render_device, 0, vid->vertex_buf, 0,
sizeof(DrawVerticeFormats));
sizeof(DrawVerticeFormats));
D3DDevice_DrawVertices(vid->xdk360_render_device, D3DPT_TRIANGLESTRIP, 0, D3DVERTEXCOUNT(D3DPT_TRIANGLESTRIP, 2));
if (msg)
@ -601,7 +601,7 @@ void xdk360_video_init(void)
g_first_msg = true;
HRESULT hr = xdk360_console_init("game:\\media\\Arial_12.xpr",
0xff000000, 0xffffffff );
0xff000000, 0xffffffff );
if(FAILED(hr))
{

View File

@ -57,9 +57,9 @@ typedef struct xdk360_video
XVIDEO_MODE video_mode;
} xdk360_video_t;
void xdk360_video_init(void);
void xdk360_video_deinit(void);
void xdk360_video_set_vsync(bool vsync);
void xdk360_video_init (void);
void xdk360_video_deinit (void);
void xdk360_video_set_vsync (bool vsync);
extern void *g_d3d;

View File

@ -26,23 +26,23 @@
//--------------------------------------------------------------------------------------
struct RESOURCE
{
unsigned long dwType;
unsigned long dwOffset;
unsigned long dwSize;
char * strName;
unsigned long dwType;
unsigned long dwOffset;
unsigned long dwSize;
char * strName;
};
// Resource types
enum
{
RESOURCETYPE_USERDATA = ( ( 'U' << 24 ) | ( 'S' << 16 ) | ( 'E' << 8 ) | ( 'R' ) ),
RESOURCETYPE_TEXTURE = ( ( 'T' << 24 ) | ( 'X' << 16 ) | ( '2' << 8 ) | ( 'D' ) ),
RESOURCETYPE_CUBEMAP = ( ( 'T' << 24 ) | ( 'X' << 16 ) | ( 'C' << 8 ) | ( 'M' ) ),
RESOURCETYPE_VOLUMETEXTURE = ( ( 'T' << 24 ) | ( 'X' << 16 ) | ( '3' << 8 ) | ( 'D' ) ),
RESOURCETYPE_VERTEXBUFFER = ( ( 'V' << 24 ) | ( 'B' << 16 ) | ( 'U' << 8 ) | ( 'F' ) ),
RESOURCETYPE_INDEXBUFFER = ( ( 'I' << 24 ) | ( 'B' << 16 ) | ( 'U' << 8 ) | ( 'F' ) ),
RESOURCETYPE_EOF = 0xffffffff
RESOURCETYPE_USERDATA = ( ( 'U' << 24 ) | ( 'S' << 16 ) | ( 'E' << 8 ) | ( 'R' ) ),
RESOURCETYPE_TEXTURE = ( ( 'T' << 24 ) | ( 'X' << 16 ) | ( '2' << 8 ) | ( 'D' ) ),
RESOURCETYPE_CUBEMAP = ( ( 'T' << 24 ) | ( 'X' << 16 ) | ( 'C' << 8 ) | ( 'M' ) ),
RESOURCETYPE_VOLUMETEXTURE = ( ( 'T' << 24 ) | ( 'X' << 16 ) | ( '3' << 8 ) | ( 'D' ) ),
RESOURCETYPE_VERTEXBUFFER = ( ( 'V' << 24 ) | ( 'B' << 16 ) | ( 'U' << 8 ) | ( 'F' ) ),
RESOURCETYPE_INDEXBUFFER = ( ( 'I' << 24 ) | ( 'B' << 16 ) | ( 'U' << 8 ) | ( 'F' ) ),
RESOURCETYPE_EOF = 0xffffffff
};
@ -52,28 +52,23 @@ enum
class PackedResource
{
protected:
unsigned char * m_pSysMemData; // Alloc'ed memory for resource headers etc.
unsigned long m_dwSysMemDataSize;
unsigned char * m_pSysMemData; // Alloc'ed memory for resource headers etc.
unsigned long m_dwSysMemDataSize;
unsigned char * m_pVidMemData; // Alloc'ed memory for resource data, etc.
unsigned long m_dwVidMemDataSize;
unsigned char * m_pVidMemData; // Alloc'ed memory for resource data, etc.
unsigned long m_dwVidMemDataSize;
RESOURCE* m_pResourceTags; // Tags to associate names with the resources
unsigned long m_dwNumResourceTags; // Number of resource tags
RESOURCE* m_pResourceTags; // Tags to associate names with the resources
unsigned long m_dwNumResourceTags; // Number of resource tags
public:
int m_bInitialized; // Resource is fully initialized
// Loads the resources out of the specified bundle
int m_bInitialized; // Resource is fully initialized
HRESULT Create( const char * strFilename );
void Destroy();
// Helper function to make sure a resource is registered
D3DResource* RegisterResource( D3DResource* pResource ) const
{
return pResource;
}
// Functions to retrieve resources by their offset
void * GetData( unsigned long dwOffset ) const
{
return &m_pSysMemData[dwOffset];
@ -99,7 +94,6 @@ public:
return ( D3DVertexBuffer* )GetResource( dwOffset );
}
// Functions to retrieve resources by their name
void * GetData( const char * strName ) const;
D3DResource* GetResource( const char * strName ) const
@ -122,8 +116,8 @@ public:
return ( D3DVertexBuffer* )GetResource( strName );
}
PackedResource();
~PackedResource();
PackedResource();
~PackedResource();
};
#endif

View File

@ -91,14 +91,6 @@ enum rsd_conn_type
#define RSD_ERR(fmt, args...)
#define RSD_DEBUG(fmt, args...)
static inline int rsnd_is_little_endian(void);
static inline void rsnd_swap_endian_16(uint16_t * x);
static inline void rsnd_swap_endian_32(uint32_t * x);
static inline int rsnd_format_to_samplesize(uint16_t fmt);
static int rsnd_connect_server(rsound_t *rd);
static int rsnd_send_header_info(rsound_t *rd);
static int rsnd_get_backend_info(rsound_t *rd);
static int rsnd_create_connection(rsound_t *rd);
static ssize_t rsnd_send_chunk(int socket, const void *buf, size_t size, int blocking);
static ssize_t rsnd_recv_chunk(int socket, void *buf, size_t size, int blocking);
static int rsnd_start_thread(rsound_t *rd);

View File

@ -105,34 +105,34 @@ static void find_and_set_first_file(void)
if(first_executable)
{
#ifdef _XBOX
//Check if it's SSNES Salamander itself - if so, first_executable needs to
//be overridden
char fname_tmp[MAX_PATH_LENGTH];
//Check if it's SSNES Salamander itself - if so, first_executable needs to
//be overridden
char fname_tmp[MAX_PATH_LENGTH];
fill_pathname_base(fname_tmp, first_executable, sizeof(fname_tmp));
fill_pathname_base(fname_tmp, first_executable, sizeof(fname_tmp));
if(strcmp(fname_tmp, "SSNES-Salamander.xex") == 0)
{
SSNES_WARN("First entry is SSNES Salamander itself, increment entry by one and check if it exists.\n");
first_executable = dir_list[1];
fill_pathname_base(fname_tmp, first_executable, sizeof(fname_tmp));
if(strcmp(fname_tmp, "SSNES-Salamander.xex") == 0)
{
SSNES_WARN("First entry is SSNES Salamander itself, increment entry by one and check if it exists.\n");
first_executable = dir_list[1];
fill_pathname_base(fname_tmp, first_executable, sizeof(fname_tmp));
if(!first_executable)
{
SSNES_WARN("There is no second entry - no choice but to boot SSNES Salamander\n");
first_executable = dir_list[0];
fill_pathname_base(fname_tmp, first_executable, sizeof(fname_tmp));
}
}
if(!first_executable)
{
SSNES_WARN("There is no second entry - no choice but to boot SSNES Salamander\n");
first_executable = dir_list[0];
fill_pathname_base(fname_tmp, first_executable, sizeof(fname_tmp));
}
}
snprintf(first_executable, sizeof(first_executable), "game:\\%s", fname_tmp);
snprintf(first_executable, sizeof(first_executable), "game:\\%s", fname_tmp);
#endif
SSNES_LOG("Start first entry in libretro cores dir: [%s].\n", first_executable);
strlcpy(libretro_path, first_executable, sizeof(libretro_path));
SSNES_LOG("Start first entry in libretro cores dir: [%s].\n", first_executable);
strlcpy(libretro_path, first_executable, sizeof(libretro_path));
}
else
{
SSNES_ERR("Failed last fallback - SSNES Salamander will exit.\n");
SSNES_ERR("Failed last fallback - SSNES Salamander will exit.\n");
}
dir_list_free(dir_list);

File diff suppressed because it is too large Load Diff

1719
ps3/menu.c

File diff suppressed because it is too large Load Diff

View File

@ -35,20 +35,22 @@
enum
{
EXTERN_LAUNCHER_SALAMANDER,
EXTERN_LAUNCHER_MULTIMAN
EXTERN_LAUNCHER_SALAMANDER,
EXTERN_LAUNCHER_MULTIMAN
};
enum {
CONFIG_FILE,
SHADER_PRESET_FILE,
INPUT_PRESET_FILE
enum
{
CONFIG_FILE,
SHADER_PRESET_FILE,
INPUT_PRESET_FILE
};
enum {
SOUND_MODE_NORMAL,
SOUND_MODE_RSOUND,
SOUND_MODE_HEADSET
enum
{
SOUND_MODE_NORMAL,
SOUND_MODE_RSOUND,
SOUND_MODE_HEADSET
};
enum {