mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-27 19:19:41 +08:00
Fixed Xcode build warnings
This commit is contained in:
@@ -849,10 +849,10 @@ static int COREAUDIO_OpenDevice(SDL_AudioDevice *device)
|
|||||||
#ifdef SDL_PLATFORM_TVOS
|
#ifdef SDL_PLATFORM_TVOS
|
||||||
if (device->iscapture) {
|
if (device->iscapture) {
|
||||||
[session setPreferredInputNumberOfChannels:device->spec.channels error:nil];
|
[session setPreferredInputNumberOfChannels:device->spec.channels error:nil];
|
||||||
device->spec.channels = session.preferredInputNumberOfChannels;
|
device->spec.channels = (int)session.preferredInputNumberOfChannels;
|
||||||
} else {
|
} else {
|
||||||
[session setPreferredOutputNumberOfChannels:device->spec.channels error:nil];
|
[session setPreferredOutputNumberOfChannels:device->spec.channels error:nil];
|
||||||
device->spec.channels = session.preferredOutputNumberOfChannels;
|
device->spec.channels = (int)session.preferredOutputNumberOfChannels;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// Calling setPreferredOutputNumberOfChannels seems to break audio output on iOS
|
// Calling setPreferredOutputNumberOfChannels seems to break audio output on iOS
|
||||||
|
|||||||
@@ -546,7 +546,7 @@ static BOOL IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCControlle
|
|||||||
#ifdef SDL_PLATFORM_TVOS
|
#ifdef SDL_PLATFORM_TVOS
|
||||||
/* tvOS turns the menu button into a system gesture, so we grab it here instead */
|
/* tvOS turns the menu button into a system gesture, so we grab it here instead */
|
||||||
if (elements[GCInputButtonMenu] && !elements[@"Button Home"]) {
|
if (elements[GCInputButtonMenu] && !elements[@"Button Home"]) {
|
||||||
device->pause_button_index = [device->buttons indexOfObject:GCInputButtonMenu];
|
device->pause_button_index = (int)[device->buttons indexOfObject:GCInputButtonMenu];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -1226,8 +1226,6 @@ typedef struct
|
|||||||
SDL_bool viewport_dirty;
|
SDL_bool viewport_dirty;
|
||||||
SDL_Rect viewport;
|
SDL_Rect viewport;
|
||||||
size_t projection_offset;
|
size_t projection_offset;
|
||||||
SDL_bool color_dirty;
|
|
||||||
size_t color_offset;
|
|
||||||
SDL_bool color_scale_dirty;
|
SDL_bool color_scale_dirty;
|
||||||
size_t color_scale_offset;
|
size_t color_scale_offset;
|
||||||
} METAL_DrawStateCache;
|
} METAL_DrawStateCache;
|
||||||
@@ -1290,16 +1288,9 @@ static SDL_bool SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cm
|
|||||||
statecache->cliprect_dirty = SDL_FALSE;
|
statecache->cliprect_dirty = SDL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* Not used... */
|
|
||||||
if (statecache->color_dirty) {
|
|
||||||
[data.mtlcmdencoder setFragmentBufferOffset:statecache->color_offset atIndex:0];
|
|
||||||
statecache->color_dirty = SDL_FALSE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (statecache->color_scale_dirty) {
|
if (statecache->color_scale_dirty) {
|
||||||
[data.mtlcmdencoder setFragmentBufferOffset:statecache->color_scale_offset atIndex:0];
|
[data.mtlcmdencoder setFragmentBufferOffset:statecache->color_scale_offset atIndex:0];
|
||||||
statecache->color_dirty = SDL_FALSE;
|
statecache->color_scale_dirty = SDL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
newpipeline = ChoosePipelineState(data, data.activepipelines, shader, blend);
|
newpipeline = ChoosePipelineState(data, data.activepipelines, shader, blend);
|
||||||
@@ -1368,11 +1359,11 @@ static int METAL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd,
|
|||||||
statecache.vertex_buffer = nil;
|
statecache.vertex_buffer = nil;
|
||||||
statecache.constants_offset = CONSTANTS_OFFSET_INVALID;
|
statecache.constants_offset = CONSTANTS_OFFSET_INVALID;
|
||||||
statecache.texture = NULL;
|
statecache.texture = NULL;
|
||||||
statecache.color_dirty = SDL_TRUE;
|
statecache.color_scale_dirty = SDL_TRUE;
|
||||||
statecache.cliprect_dirty = SDL_TRUE;
|
statecache.cliprect_dirty = SDL_TRUE;
|
||||||
statecache.viewport_dirty = SDL_TRUE;
|
statecache.viewport_dirty = SDL_TRUE;
|
||||||
statecache.projection_offset = 0;
|
statecache.projection_offset = 0;
|
||||||
statecache.color_offset = 0;
|
statecache.color_scale_offset = 0;
|
||||||
|
|
||||||
// !!! FIXME: have a ring of pre-made MTLBuffers we cycle through? How expensive is creation?
|
// !!! FIXME: have a ring of pre-made MTLBuffers we cycle through? How expensive is creation?
|
||||||
if (vertsize > 0) {
|
if (vertsize > 0) {
|
||||||
@@ -1417,8 +1408,6 @@ static int METAL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd,
|
|||||||
|
|
||||||
case SDL_RENDERCMD_SETDRAWCOLOR:
|
case SDL_RENDERCMD_SETDRAWCOLOR:
|
||||||
{
|
{
|
||||||
statecache.color_offset = cmd->data.color.first;
|
|
||||||
statecache.color_dirty = SDL_TRUE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1447,7 +1436,7 @@ static int METAL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd,
|
|||||||
statecache.pipeline = nil;
|
statecache.pipeline = nil;
|
||||||
statecache.constants_offset = CONSTANTS_OFFSET_INVALID;
|
statecache.constants_offset = CONSTANTS_OFFSET_INVALID;
|
||||||
statecache.texture = NULL;
|
statecache.texture = NULL;
|
||||||
statecache.color_dirty = SDL_TRUE;
|
statecache.color_scale_dirty = SDL_TRUE;
|
||||||
statecache.cliprect_dirty = SDL_TRUE;
|
statecache.cliprect_dirty = SDL_TRUE;
|
||||||
statecache.viewport_dirty = SDL_TRUE;
|
statecache.viewport_dirty = SDL_TRUE;
|
||||||
|
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ static UIImage *SDL_LoadLaunchImageNamed(NSString *name, int screenh)
|
|||||||
- (void)sendDropFileForURL:(NSURL *)url fromSourceApplication:(NSString *)sourceApplication
|
- (void)sendDropFileForURL:(NSURL *)url fromSourceApplication:(NSString *)sourceApplication
|
||||||
{
|
{
|
||||||
NSURL *fileURL = url.filePathURL;
|
NSURL *fileURL = url.filePathURL;
|
||||||
char *sourceApplicationCString = sourceApplication ? [sourceApplication UTF8String] : NULL;
|
const char *sourceApplicationCString = sourceApplication ? [sourceApplication UTF8String] : NULL;
|
||||||
if (fileURL != nil) {
|
if (fileURL != nil) {
|
||||||
SDL_SendDropFile(NULL, sourceApplicationCString, fileURL.path.UTF8String);
|
SDL_SendDropFile(NULL, sourceApplicationCString, fileURL.path.UTF8String);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user