Style nitting.

This commit is contained in:
Themaister 2012-06-22 19:16:53 +02:00
parent 7d60c06679
commit 084bdcef97
3 changed files with 26 additions and 20 deletions

View File

@ -31,8 +31,8 @@
#include "../file.h" #include "../file.h"
#endif #endif
typedef struct
typedef struct { {
EGLDisplay mDisplay; EGLDisplay mDisplay;
EGLSurface mSurface; EGLSurface mSurface;
EGLContext mContext; EGLContext mContext;
@ -143,9 +143,9 @@ static void *rpi_init(const video_info_t *video, const input_driver_t **input, v
vc_dispmanx_display_get_info(dispman_display, &dispman_modeinfo); vc_dispmanx_display_get_info(dispman_display, &dispman_modeinfo);
dispman_update = vc_dispmanx_update_start(0); dispman_update = vc_dispmanx_update_start(0);
dispman_element = vc_dispmanx_element_add ( dispman_update, dispman_display, dispman_element = vc_dispmanx_element_add(dispman_update, dispman_display,
0/*layer*/, &dst_rect, 0/*src*/, 0 /*layer*/, &dst_rect, 0 /*src*/,
&src_rect, DISPMANX_PROTECTION_NONE, 0 /*alpha*/, 0/*clamp*/, DISPMANX_NO_ROTATE); &src_rect, DISPMANX_PROTECTION_NONE, 0 /*alpha*/, 0 /*clamp*/, DISPMANX_NO_ROTATE);
nativewindow.element = dispman_element; nativewindow.element = dispman_element;
nativewindow.width = rpi->mScreenWidth; nativewindow.width = rpi->mScreenWidth;
@ -166,7 +166,7 @@ static void *rpi_init(const video_info_t *video, const input_driver_t **input, v
if (dispman_modeinfo.width == 720 && (dispman_modeinfo.height == 480 || dispman_modeinfo.height == 576)) if (dispman_modeinfo.width == 720 && (dispman_modeinfo.height == 480 || dispman_modeinfo.height == 576))
rpi->mScreenAspect = 4.0f / 3.0f; rpi->mScreenAspect = 4.0f / 3.0f;
else else
rpi->mScreenAspect = (float) dispman_modeinfo.width / dispman_modeinfo.height; rpi->mScreenAspect = (float)dispman_modeinfo.width / dispman_modeinfo.height;
VGfloat clearColor[4] = {0, 0, 0, 1}; VGfloat clearColor[4] = {0, 0, 0, 1};
vgSetfv(VG_CLEAR_COLOR, 4, clearColor); vgSetfv(VG_CLEAR_COLOR, 4, clearColor);
@ -176,10 +176,12 @@ static void *rpi_init(const video_info_t *video, const input_driver_t **input, v
// emulation cores can send 0 in the top bit. We lose some speed on // emulation cores can send 0 in the top bit. We lose some speed on
// conversion but I doubt it has any real affect, since we are only drawing // conversion but I doubt it has any real affect, since we are only drawing
// one image at the end of the day. Still keep the alpha channel for ABGR. // one image at the end of the day. Still keep the alpha channel for ABGR.
rpi->mImage = vgCreateImage(video->rgb32 ? VG_sABGR_8888 : VG_sXBGR_8888, rpi->mTextureWidth, rpi->mTextureHeight, video->smooth ? VG_IMAGE_QUALITY_BETTER : VG_IMAGE_QUALITY_NONANTIALIASED); rpi->mImage = vgCreateImage(video->rgb32 ? VG_sABGR_8888 : VG_sXBGR_8888,
rpi->mTextureWidth, rpi->mTextureHeight,
video->smooth ? VG_IMAGE_QUALITY_BETTER : VG_IMAGE_QUALITY_NONANTIALIASED);
rpi_set_nonblock_state(rpi, !video->vsync); rpi_set_nonblock_state(rpi, !video->vsync);
linuxraw_input_t *linuxraw_input = (linuxraw_input_t *)input_linuxraw.init(); linuxraw_input_t *linuxraw_input = (linuxraw_input_t*)input_linuxraw.init();
if (linuxraw_input) if (linuxraw_input)
{ {
*input = (const input_driver_t *)&input_linuxraw; *input = (const input_driver_t *)&input_linuxraw;
@ -258,7 +260,7 @@ static void rpi_render_message(rpi_t *rpi, const char *msg)
free(rpi->mLastMsg); free(rpi->mLastMsg);
rpi->mLastMsg = strdup(msg); rpi->mLastMsg = strdup(msg);
if(rpi->mMsgLength) if (rpi->mMsgLength)
{ {
while (--rpi->mMsgLength) while (--rpi->mMsgLength)
vgClearGlyph(rpi->mFont, rpi->mMsgLength); vgClearGlyph(rpi->mFont, rpi->mMsgLength);
@ -278,10 +280,10 @@ static void rpi_render_message(rpi_t *rpi, const char *msg)
VGfloat origin[2], escapement[2]; VGfloat origin[2], escapement[2];
VGImage img; VGImage img;
escapement[0] = (VGfloat) (head->advance_x); escapement[0] = head->advance_x;
escapement[1] = (VGfloat) (head->advance_y); escapement[1] = head->advance_y;
origin[0] = (VGfloat) (-head->char_off_x); origin[0] = -head->char_off_x;
origin[1] = (VGfloat) (head->char_off_y); origin[1] = head->char_off_y;
img = vgCreateImage(VG_A_8, head->width, head->height, VG_IMAGE_QUALITY_NONANTIALIASED); img = vgCreateImage(VG_A_8, head->width, head->height, VG_IMAGE_QUALITY_NONANTIALIASED);
@ -310,7 +312,11 @@ static void rpi_draw_message(rpi_t *rpi, const char *msg)
vgSeti(VG_SCISSORING, VG_FALSE); vgSeti(VG_SCISSORING, VG_FALSE);
vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_STENCIL); vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_STENCIL);
VGfloat origins[] = { rpi->mScreenWidth * g_settings.video.msg_pos_x - 2.0f, rpi->mScreenHeight * g_settings.video.msg_pos_y - 2.0f }; VGfloat origins[] = {
rpi->mScreenWidth * g_settings.video.msg_pos_x - 2.0f,
rpi->mScreenHeight * g_settings.video.msg_pos_y - 2.0f,
};
vgSetfv(VG_GLYPH_ORIGIN, 2, origins); vgSetfv(VG_GLYPH_ORIGIN, 2, origins);
vgSetPaint(rpi->mPaintBg, VG_FILL_PATH); vgSetPaint(rpi->mPaintBg, VG_FILL_PATH);
vgDrawGlyphs(rpi->mFont, rpi->mMsgLength, rpi->mGlyphIndices, NULL, NULL, VG_FILL_PATH, VG_TRUE); vgDrawGlyphs(rpi->mFont, rpi->mMsgLength, rpi->mGlyphIndices, NULL, NULL, VG_FILL_PATH, VG_TRUE);

View File

@ -26,7 +26,7 @@
#include "linuxraw_input.h" #include "linuxraw_input.h"
#include "rarch_sdl_input.h" #include "rarch_sdl_input.h"
static long oldKbmd = 0xFFFF; static long oldKbmd = 0xffff;
static struct termios oldTerm, newTerm; static struct termios oldTerm, newTerm;
struct key_bind struct key_bind
@ -153,11 +153,11 @@ static void init_lut(void)
static void linuxraw_resetKbmd() static void linuxraw_resetKbmd()
{ {
if (oldKbmd != 0xFFFF) if (oldKbmd != 0xffff)
{ {
ioctl(0, KDSKBMODE, oldKbmd); ioctl(0, KDSKBMODE, oldKbmd);
tcsetattr(0, TCSAFLUSH, &oldTerm); tcsetattr(0, TCSAFLUSH, &oldTerm);
oldKbmd = 0xFFFF; oldKbmd = 0xffff;
} }
} }
@ -177,7 +177,7 @@ static void *linuxraw_input_init(void)
if (!linuxraw) if (!linuxraw)
return NULL; return NULL;
if (oldKbmd == 0xFFFF) if (oldKbmd == 0xffff)
{ {
tcgetattr(0, &oldTerm); tcgetattr(0, &oldTerm);
newTerm = oldTerm; newTerm = oldTerm;

View File

@ -14,8 +14,8 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _LINUXRAW_INPUT_H #ifndef LINUXRAW_INPUT_H__
#define _LINUXRAW_INPUT_H #define LINUXRAW_INPUT_H__
#include "../general.h" #include "../general.h"
#include "rarch_sdl_input.h" #include "rarch_sdl_input.h"