mirror of
https://github.com/joel16/SDL2.git
synced 2024-12-15 23:37:04 +00:00
make indent
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402345
This commit is contained in:
parent
25541b2329
commit
554147b6c7
@ -1300,9 +1300,9 @@ extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_WindowID windowID);
|
||||
/*
|
||||
* Maps an RGB triple to an opaque pixel value for a given pixel format
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * const format,
|
||||
const Uint8 r, const Uint8 g,
|
||||
const Uint8 b);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat *
|
||||
const format, const Uint8 r,
|
||||
const Uint8 g, const Uint8 b);
|
||||
|
||||
/*
|
||||
* Maps an RGBA quadruple to a pixel value for a given pixel format
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* *INDENT-OFF* */
|
||||
/*
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
|
@ -693,10 +693,10 @@ SDL_SYS_JoystickInit(void)
|
||||
*/
|
||||
|
||||
/* Filter device list to non-keyboard/mouse stuff */
|
||||
if ( (device->usagePage != kHIDPage_GenericDesktop) ||
|
||||
((device->usage != kHIDUsage_GD_Joystick &&
|
||||
device->usage != kHIDUsage_GD_GamePad &&
|
||||
device->usage != kHIDUsage_GD_MultiAxisController)) ) {
|
||||
if ((device->usagePage != kHIDPage_GenericDesktop) ||
|
||||
((device->usage != kHIDUsage_GD_Joystick &&
|
||||
device->usage != kHIDUsage_GD_GamePad &&
|
||||
device->usage != kHIDUsage_GD_MultiAxisController))) {
|
||||
|
||||
/* release memory for the device */
|
||||
HIDDisposeDevice(&device);
|
||||
|
@ -53,7 +53,7 @@ static struct
|
||||
"SideWinder Precision Pro", 4, 1, 0}, {
|
||||
"SideWinder 3D Pro", 4, 1, 0}, {
|
||||
"Microsoft SideWinder 3D Pro", 4, 1, 0}, {
|
||||
"Microsoft SideWinder Precision Pro", 4, 1, 0 }, {
|
||||
"Microsoft SideWinder Precision Pro", 4, 1, 0}, {
|
||||
"Microsoft SideWinder Dual Strike USB version 1.0", 2, 1, 0}, {
|
||||
"WingMan Interceptor", 3, 3, 0}, {
|
||||
"WingMan Extreme Digital 3D", 4, 1, 0}, {
|
||||
|
@ -49,7 +49,8 @@ SDL_LoadFunction(void *handle, const char *name)
|
||||
{
|
||||
void *sym = NULL;
|
||||
image_id library_id = (image_id) handle;
|
||||
status_t rc = get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym);
|
||||
status_t rc =
|
||||
get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym);
|
||||
if (rc != B_NO_ERROR) {
|
||||
SDL_SetError(strerror(rc));
|
||||
}
|
||||
@ -69,4 +70,3 @@ SDL_UnloadObject(void *handle)
|
||||
#endif /* SDL_LOADSO_BEOS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
|
@ -298,8 +298,8 @@ SDL_revcpy(void *dst, const void *src, size_t len)
|
||||
{
|
||||
char *srcp = (char *) src;
|
||||
char *dstp = (char *) dst;
|
||||
srcp += len-1;
|
||||
dstp += len-1;
|
||||
srcp += len - 1;
|
||||
dstp += len - 1;
|
||||
while (len--) {
|
||||
*dstp-- = *srcp--;
|
||||
}
|
||||
@ -872,7 +872,8 @@ SDL_sscanf(const char *text, const char *fmt, ...)
|
||||
++index;
|
||||
}
|
||||
if (text[index] == '0') {
|
||||
if (SDL_tolower((unsigned char) text[index + 1]) == 'x') {
|
||||
if (SDL_tolower((unsigned char) text[index + 1])
|
||||
== 'x') {
|
||||
radix = 16;
|
||||
} else {
|
||||
radix = 8;
|
||||
|
@ -80,8 +80,8 @@ SDL_GetTicks(void)
|
||||
if (read_hz200_from_vbl) {
|
||||
now = SDL_Atari_hz200;
|
||||
} else {
|
||||
void *old_stack = (void *)Super(0);
|
||||
now = *((volatile long *)_hz_200);
|
||||
void *old_stack = (void *) Super(0);
|
||||
now = *((volatile long *) _hz_200);
|
||||
Super(old_stack);
|
||||
}
|
||||
|
||||
|
@ -387,9 +387,11 @@ BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info)
|
||||
packsswb_r2r(mm6, mm3); /* 0000FFFF -> mm3 */
|
||||
pxor_r2r(mm0, mm3); /* 0000F000 -> mm3 (~channel mask) */
|
||||
/* get alpha channel shift */
|
||||
/* *INDENT-OFF* */
|
||||
__asm__ __volatile__ (
|
||||
"movd %0, %%mm5"
|
||||
: : "rm" ((Uint32) sf->Ashift) ); /* Ashift -> mm5 */
|
||||
/* *INDENT-ON* */
|
||||
|
||||
while (height--) {
|
||||
/* *INDENT-OFF* */
|
||||
|
@ -551,8 +551,8 @@ SDL_MapRGB(const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g,
|
||||
|
||||
/* Find the pixel value corresponding to an RGBA quadruple */
|
||||
Uint32
|
||||
SDL_MapRGBA(const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g,
|
||||
const Uint8 b, const Uint8 a)
|
||||
SDL_MapRGBA(const SDL_PixelFormat * const format, const Uint8 r,
|
||||
const Uint8 g, const Uint8 b, const Uint8 a)
|
||||
{
|
||||
if (format->palette == NULL) {
|
||||
return (r >> format->Rloss) << format->Rshift
|
||||
|
@ -372,7 +372,7 @@ extern "C"
|
||||
modes = SDL_modelist[((bpp + 7) / 8) - 1];
|
||||
|
||||
bool exactmatch = false;
|
||||
for ( uint32 x = 0; modes[x]; x++ ) {
|
||||
for (uint32 x = 0; modes[x]; x++) {
|
||||
if (modes[x]->w == width && modes[x]->h == height) {
|
||||
exactmatch = true;
|
||||
i = x;
|
||||
@ -385,7 +385,8 @@ extern "C"
|
||||
/* still looking */
|
||||
}
|
||||
if (!modes[i] || (modes[i]->w < width) || (modes[i]->h < height)) {
|
||||
--i; /* We went too far */
|
||||
/* We went too far */
|
||||
--i;
|
||||
}
|
||||
}
|
||||
width = modes[i]->w;
|
||||
|
@ -119,7 +119,8 @@ CreateYUVSurface(_THIS, struct private_yuvhwdata *hwdata,
|
||||
/* Need to set coop level or newer DirectFB versions will fail here. */
|
||||
ret = layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);
|
||||
if (ret) {
|
||||
SetDirectFBError("IDirectFBDisplayLayer::SetCooperativeLevel() failed", ret);
|
||||
SetDirectFBError
|
||||
("IDirectFBDisplayLayer::SetCooperativeLevel() failed", ret);
|
||||
layer->Release(layer);
|
||||
return ret;
|
||||
}
|
||||
|
@ -181,7 +181,8 @@ static void FB_SavePalette(_THIS, struct fb_fix_screeninfo *finfo,
|
||||
struct fb_var_screeninfo *vinfo);
|
||||
static void FB_RestorePalette(_THIS);
|
||||
|
||||
static int SDL_getpagesize(void)
|
||||
static int
|
||||
SDL_getpagesize(void)
|
||||
{
|
||||
#ifdef HAVE_GETPAGESIZE
|
||||
return getpagesize();
|
||||
@ -189,7 +190,8 @@ static int SDL_getpagesize(void)
|
||||
return PAGE_SIZE;
|
||||
#else
|
||||
#error Can not determine system page size.
|
||||
return 4096; /* this is what it USED to be in Linux... */
|
||||
/* this is what it USED to be in Linux... */
|
||||
return 4096;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -650,7 +650,7 @@ GEM_SetVideoMode(_THIS, SDL_Surface * current,
|
||||
/*--- Verify if asked mode can be used ---*/
|
||||
if (VDI_bpp != bpp) {
|
||||
SDL_SetError("%d bpp mode not supported", bpp);
|
||||
return(NULL);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (flags & SDL_FULLSCREEN) {
|
||||
@ -774,10 +774,10 @@ GEM_SetVideoMode(_THIS, SDL_Surface * current,
|
||||
/* Center window */
|
||||
x2 = (GEM_desk_w - w2) >> 1;
|
||||
y2 = (GEM_desk_h - h2) >> 1;
|
||||
if (x2<0) {
|
||||
if (x2 < 0) {
|
||||
x2 = 0;
|
||||
}
|
||||
if (y2<0) {
|
||||
if (y2 < 0) {
|
||||
y2 = 0;
|
||||
}
|
||||
x2 += GEM_desk_x;
|
||||
@ -811,9 +811,11 @@ GEM_SetVideoMode(_THIS, SDL_Surface * current,
|
||||
wind_open(GEM_handle, x2, y2, w2, h2);
|
||||
} else {
|
||||
/* Resize window to fit asked video mode */
|
||||
wind_get (GEM_handle, WF_WORKXYWH, &x2,&y2,&w2,&h2);
|
||||
if (wind_calc(WC_BORDER, GEM_win_type, x2,y2,width,height, &x2,&y2,&w2,&h2)) {
|
||||
wind_set (GEM_handle, WF_CURRXYWH, x2,y2,w2,h2);
|
||||
wind_get(GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2);
|
||||
if (wind_calc
|
||||
(WC_BORDER, GEM_win_type, x2, y2, width, height, &x2, &y2,
|
||||
&w2, &h2)) {
|
||||
wind_set(GEM_handle, WF_CURRXYWH, x2, y2, w2, h2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,10 +167,12 @@ SDL_X11_LoadSymbols(void)
|
||||
X11_GetSym("XCreateIC", &SDL_X11_HAVE_UTF8, (void **) &pXCreateIC);
|
||||
#endif
|
||||
|
||||
if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */
|
||||
if (SDL_X11_HAVE_BASEXLIB) {
|
||||
/* all required symbols loaded. */
|
||||
SDL_ClearError();
|
||||
} else {
|
||||
SDL_X11_UnloadSymbols(); /* in case something got loaded... */
|
||||
/* in case something got loaded... */
|
||||
SDL_X11_UnloadSymbols();
|
||||
rc = 0;
|
||||
}
|
||||
}
|
||||
|
@ -97,10 +97,10 @@ XBIOS_Available(void)
|
||||
if (VgetMonitor() == MONITOR_MONO)
|
||||
return 0;
|
||||
/*if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
|
||||
if (!SDL_XBIOS_SB3Usable((scpn_cookie_t *) cookie_scpn)) {
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
if (!SDL_XBIOS_SB3Usable((scpn_cookie_t *) cookie_scpn)) {
|
||||
return 0;
|
||||
}
|
||||
} */
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
|
@ -29,12 +29,12 @@
|
||||
|
||||
typedef struct SDL_VideoData
|
||||
{
|
||||
long cookie_vdo; /* _VDO cookie */
|
||||
long cookie_vdo; /* _VDO cookie */
|
||||
|
||||
Uint16 old_modecode; /* Current video mode */
|
||||
void *old_vbase; /* Current pointer to video RAM */
|
||||
int old_numcol; /* Number of colors in saved palette */
|
||||
Uint32 old_palette[256]; /* Buffer to save current palette */
|
||||
Uint16 old_modecode; /* Current video mode */
|
||||
void *old_vbase; /* Current pointer to video RAM */
|
||||
int old_numcol; /* Number of colors in saved palette */
|
||||
Uint32 old_palette[256]; /* Buffer to save current palette */
|
||||
|
||||
#if 0
|
||||
int old_video_mode; /* Old video mode before entering SDL */
|
||||
|
@ -28,13 +28,14 @@
|
||||
#include "SDL_xbiosmodes.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
int width,height,bpp;
|
||||
typedef struct
|
||||
{
|
||||
int width, height, bpp;
|
||||
int modecode;
|
||||
int doubleline;
|
||||
} xbios_mode_t;
|
||||
|
||||
static xbios_mode_t falcon_rgb_modes[]={
|
||||
static xbios_mode_t falcon_rgb_modes[] = {
|
||||
{768, 480, 16, BPS16 | COL80 | OVERSCAN | VERTFLAG},
|
||||
{768, 240, 16, BPS16 | COL80 | OVERSCAN},
|
||||
{640, 400, 16, BPS16 | COL80 | VERTFLAG},
|
||||
@ -52,19 +53,19 @@ static xbios_mode_t falcon_rgb_modes[]={
|
||||
{320, 400, 8, BPS8 | VERTFLAG},
|
||||
{320, 200, 8, BPS8}
|
||||
};
|
||||
|
||||
static xbios_mode_t falcon_vga_modes[]={
|
||||
{320, 480, 16, BPS16 },
|
||||
|
||||
static xbios_mode_t falcon_vga_modes[] = {
|
||||
{320, 480, 16, BPS16},
|
||||
{320, 240, 16, BPS16 | VERTFLAG},
|
||||
{640, 480, 8, BPS8 | COL80},
|
||||
{640, 240, 8, BPS8 | COL80 | VERTFLAG},
|
||||
{320, 480, 8, BPS8 },
|
||||
{320, 480, 8, BPS8},
|
||||
{320, 240, 8, BPS8 | VERTFLAG}
|
||||
};
|
||||
|
||||
static void
|
||||
SDL_XBIOS_AddMode(_THIS, int width, int height, int bpp, Uint16 modecode,
|
||||
SDL_bool doubleline)
|
||||
SDL_bool doubleline)
|
||||
{
|
||||
SDL_VideoDisplay display;
|
||||
SDL_DisplayData *displaydata;
|
||||
@ -74,9 +75,9 @@ SDL_XBIOS_AddMode(_THIS, int width, int height, int bpp, Uint16 modecode,
|
||||
|
||||
Rmask = Gmask = Bmask = Amask = 0;
|
||||
if (bpp == 16) {
|
||||
Rmask = 31<<11;
|
||||
Gmask = 63<<5;
|
||||
Bmask = 31;
|
||||
Rmask = 31 << 11;
|
||||
Gmask = 63 << 5;
|
||||
Bmask = 31;
|
||||
}
|
||||
/* Memorize for c2p4 operation */
|
||||
orig_bpp = bpp;
|
||||
@ -92,7 +93,7 @@ SDL_XBIOS_AddMode(_THIS, int width, int height, int bpp, Uint16 modecode,
|
||||
|
||||
displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata));
|
||||
if (!displaydata) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
displaydata->modecode = modecode;
|
||||
displaydata->doubleline = doubleline;
|
||||
@ -140,7 +141,7 @@ SDL_XBIOS_ModeRestore(_THIS)
|
||||
break;
|
||||
case VDO_TT:
|
||||
Setscreen(-1, data->old_vbase, -1);
|
||||
EsetShift(data->old_modecode);
|
||||
EsetShift(data->old_modecode);
|
||||
break;
|
||||
case VDO_F30:
|
||||
Setscreen(-1, data->old_vbase, -1);
|
||||
@ -204,8 +205,8 @@ SDL_XBIOS_PaletteSave(_THIS)
|
||||
case VDO_F30:
|
||||
data->old_numcol = 1 << (1 << (data->old_modecode & NUMCOLS));
|
||||
if (data->old_numcol > 256) {
|
||||
data->old_numcol = 0;
|
||||
} else {
|
||||
data->old_numcol = 0;
|
||||
} else {
|
||||
VgetRGB(0, data->old_numcol, data->old_palette);
|
||||
}
|
||||
break;
|
||||
@ -261,7 +262,7 @@ SDL_XBIOS_InitModes(_THIS)
|
||||
break;
|
||||
case VDO_F30:
|
||||
{
|
||||
Uint16 modecodemask = data->old_modecode & (VGA | PAL);
|
||||
Uint16 modecodemask = data->old_modecode & (VGA | PAL);
|
||||
int i;
|
||||
|
||||
switch (VgetMonitor()) {
|
||||
@ -270,19 +271,27 @@ SDL_XBIOS_InitModes(_THIS)
|
||||
break;
|
||||
case MONITOR_RGB:
|
||||
case MONITOR_TV:
|
||||
for (i=0; i<sizeof(falcon_rgb_modes)/sizeof(xbios_mode_t); i++) {
|
||||
SDL_XBIOS_AddMode(_this, falcon_rgb_modes[i].width,
|
||||
falcon_rgb_modes[i].height, falcon_rgb_modes[i].bpp,
|
||||
falcon_rgb_modes[i].modecode & modecodemask, SDL_FALSE);
|
||||
}
|
||||
break;
|
||||
for (i = 0;
|
||||
i < sizeof(falcon_rgb_modes) / sizeof(xbios_mode_t);
|
||||
i++) {
|
||||
SDL_XBIOS_AddMode(_this, falcon_rgb_modes[i].width,
|
||||
falcon_rgb_modes[i].height,
|
||||
falcon_rgb_modes[i].bpp,
|
||||
falcon_rgb_modes[i].
|
||||
modecode & modecodemask, SDL_FALSE);
|
||||
}
|
||||
break;
|
||||
case MONITOR_VGA:
|
||||
for (i=0; i<sizeof(falcon_vga_modes)/sizeof(xbios_mode_t); i++) {
|
||||
SDL_XBIOS_AddMode(_this, falcon_vga_modes[i].width,
|
||||
falcon_vga_modes[i].height, falcon_vga_modes[i].bpp,
|
||||
falcon_vga_modes[i].modecode & modecodemask, SDL_FALSE);
|
||||
}
|
||||
break;
|
||||
for (i = 0;
|
||||
i < sizeof(falcon_vga_modes) / sizeof(xbios_mode_t);
|
||||
i++) {
|
||||
SDL_XBIOS_AddMode(_this, falcon_vga_modes[i].width,
|
||||
falcon_vga_modes[i].height,
|
||||
falcon_vga_modes[i].bpp,
|
||||
falcon_vga_modes[i].
|
||||
modecode & modecodemask, SDL_FALSE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -7,65 +7,64 @@
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
typedef int (*fntype)(const char *);
|
||||
typedef int (*fntype) (const char *);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int retval = 0;
|
||||
int hello = 0;
|
||||
const char *libname = NULL;
|
||||
const char *symname = NULL;
|
||||
void *lib = NULL;
|
||||
fntype fn = NULL;
|
||||
int retval = 0;
|
||||
int hello = 0;
|
||||
const char *libname = NULL;
|
||||
const char *symname = NULL;
|
||||
void *lib = NULL;
|
||||
fntype fn = NULL;
|
||||
|
||||
if (argc != 3) {
|
||||
const char *app = argv[0];
|
||||
fprintf(stderr, "USAGE: %s <library> <functionname>\n", app);
|
||||
fprintf(stderr, " %s --hello <lib with puts()>\n", app);
|
||||
return 1;
|
||||
}
|
||||
if (argc != 3) {
|
||||
const char *app = argv[0];
|
||||
fprintf(stderr, "USAGE: %s <library> <functionname>\n", app);
|
||||
fprintf(stderr, " %s --hello <lib with puts()>\n", app);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Initialize SDL */
|
||||
if ( SDL_Init(0) < 0 ) {
|
||||
fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
|
||||
return 2;
|
||||
}
|
||||
/* Initialize SDL */
|
||||
if (SDL_Init(0) < 0) {
|
||||
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "--hello") == 0) {
|
||||
hello = 1;
|
||||
libname = argv[2];
|
||||
symname = "puts";
|
||||
} else {
|
||||
libname = argv[1];
|
||||
symname = argv[2];
|
||||
}
|
||||
if (strcmp(argv[1], "--hello") == 0) {
|
||||
hello = 1;
|
||||
libname = argv[2];
|
||||
symname = "puts";
|
||||
} else {
|
||||
libname = argv[1];
|
||||
symname = argv[2];
|
||||
}
|
||||
|
||||
lib = SDL_LoadObject(libname);
|
||||
if (lib == NULL) {
|
||||
fprintf(stderr, "SDL_LoadObject('%s') failed: %s\n",
|
||||
libname, SDL_GetError());
|
||||
retval = 3;
|
||||
} else {
|
||||
fn = (fntype) SDL_LoadFunction(lib, symname);
|
||||
if (fn == NULL) {
|
||||
fprintf(stderr, "SDL_LoadFunction('%s') failed: %s\n",
|
||||
symname, SDL_GetError());
|
||||
retval = 4;
|
||||
} else {
|
||||
printf("Found %s in %s at %p\n", symname, libname, fn);
|
||||
if (hello) {
|
||||
printf("Calling function...\n");
|
||||
fflush(stdout);
|
||||
fn(" HELLO, WORLD!\n");
|
||||
printf("...apparently, we survived. :)\n");
|
||||
printf("Unloading library...\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
SDL_UnloadObject(lib);
|
||||
}
|
||||
SDL_Quit();
|
||||
return(0);
|
||||
lib = SDL_LoadObject(libname);
|
||||
if (lib == NULL) {
|
||||
fprintf(stderr, "SDL_LoadObject('%s') failed: %s\n",
|
||||
libname, SDL_GetError());
|
||||
retval = 3;
|
||||
} else {
|
||||
fn = (fntype) SDL_LoadFunction(lib, symname);
|
||||
if (fn == NULL) {
|
||||
fprintf(stderr, "SDL_LoadFunction('%s') failed: %s\n",
|
||||
symname, SDL_GetError());
|
||||
retval = 4;
|
||||
} else {
|
||||
printf("Found %s in %s at %p\n", symname, libname, fn);
|
||||
if (hello) {
|
||||
printf("Calling function...\n");
|
||||
fflush(stdout);
|
||||
fn(" HELLO, WORLD!\n");
|
||||
printf("...apparently, we survived. :)\n");
|
||||
printf("Unloading library...\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
SDL_UnloadObject(lib);
|
||||
}
|
||||
SDL_Quit();
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user