mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-20 02:01:10 +00:00
Cleanup
This commit is contained in:
parent
484de3829d
commit
3ec622d2ee
@ -322,11 +322,13 @@ const NSInteger PGCameraFrameRate = 30;
|
||||
|
||||
- (void)switchToBestVideoFormatForDevice:(AVCaptureDevice *)device
|
||||
{
|
||||
__unused bool preferZoomableFormat = [self hasTelephotoCamera] || [self hasUltrawideCamera];
|
||||
[self _reconfigureDevice:device withBlock:^(AVCaptureDevice *device)
|
||||
{
|
||||
NSArray *availableFormats = device.formats;
|
||||
AVCaptureDeviceFormat *preferredFormat = nil;
|
||||
NSMutableArray *maybeFormats = nil;
|
||||
bool hasSecondaryZoomLevels = false;
|
||||
int32_t maxWidth = 0;
|
||||
int32_t maxHeight = 0;
|
||||
for (AVCaptureDeviceFormat *format in availableFormats)
|
||||
@ -338,6 +340,7 @@ const NSInteger PGCameraFrameRate = 30;
|
||||
if (dimensions.width >= maxWidth && dimensions.width <= 1920 && dimensions.height >= maxHeight && dimensions.height <= 1080)
|
||||
{
|
||||
if (dimensions.width > maxWidth) {
|
||||
hasSecondaryZoomLevels = false;
|
||||
maybeFormats = [[NSMutableArray alloc] init];
|
||||
}
|
||||
FourCharCode mediaSubType = CMFormatDescriptionGetMediaSubType(format.formatDescription);
|
||||
@ -359,17 +362,20 @@ const NSInteger PGCameraFrameRate = 30;
|
||||
if (supportedRate) {
|
||||
if (@available(iOS 16.0, *)) {
|
||||
if (format.secondaryNativeResolutionZoomFactors.count > 0) {
|
||||
hasSecondaryZoomLevels = true;
|
||||
[maybeFormats addObject:format];
|
||||
} else {
|
||||
} else if (!hasSecondaryZoomLevels) {
|
||||
[maybeFormats addObject:format];
|
||||
}
|
||||
} else {
|
||||
if (!hasSecondaryZoomLevels) {
|
||||
[maybeFormats addObject:format];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
preferredFormat = maybeFormats.lastObject;
|
||||
|
||||
|
@ -36,7 +36,11 @@
|
||||
{
|
||||
int32_t length = [is readInt32];
|
||||
NSData *data = [is readData:length];
|
||||
return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil];
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
return [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)object {
|
||||
|
@ -38,7 +38,10 @@
|
||||
{
|
||||
int32_t length = [is readInt32];
|
||||
NSData *data = [is readData:length];
|
||||
return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
return [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -286,7 +286,10 @@
|
||||
NSData *data = [[NSData alloc] initWithBytesNoCopy:originBytes length:originLength freeWhenDone:true];
|
||||
TGMediaOriginInfo *origin = nil;
|
||||
@try {
|
||||
origin = [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaOriginInfo class] fromData:data error:nil];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
origin = [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
} @catch (NSException *e) {
|
||||
|
||||
}
|
||||
|
@ -50,7 +50,10 @@
|
||||
{
|
||||
int32_t length = [is readInt32];
|
||||
NSData *data = [is readData:length];
|
||||
return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
return [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (TGWebPageMediaAttachment *)webPageWithText:(NSString *)text entities:(NSArray *)entities {
|
||||
|
@ -272,7 +272,10 @@
|
||||
NSData *data = [[NSData alloc] initWithBytesNoCopy:originBytes length:originLength freeWhenDone:true];
|
||||
TGMediaOriginInfo *origin = nil;
|
||||
@try {
|
||||
origin = [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaOriginInfo class] fromData:data error:nil];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
origin = [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
} @catch (NSException *e) {
|
||||
|
||||
}
|
||||
|
@ -89,7 +89,10 @@
|
||||
{
|
||||
int32_t length = [is readInt32];
|
||||
NSData *data = [is readData:length];
|
||||
return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
return [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,7 +56,10 @@
|
||||
{
|
||||
int32_t length = [is readInt32];
|
||||
NSData *data = [is readData:length];
|
||||
return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
return [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -66,7 +66,10 @@
|
||||
{
|
||||
int32_t length = [is readInt32];
|
||||
NSData *data = [is readData:length];
|
||||
return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
return [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -38,7 +38,10 @@
|
||||
{
|
||||
int32_t length = [is readInt32];
|
||||
NSData *data = [is readData:length];
|
||||
return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
return [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -295,7 +295,10 @@
|
||||
NSData *data = [[NSData alloc] initWithBytesNoCopy:originBytes length:originLength freeWhenDone:true];
|
||||
TGMediaOriginInfo *origin = nil;
|
||||
@try {
|
||||
origin = [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaOriginInfo class] fromData:data error:nil];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
origin = [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
} @catch (NSException *e) {
|
||||
|
||||
}
|
||||
|
@ -160,7 +160,10 @@
|
||||
int32_t length = [is readInt32];
|
||||
NSData *data = [is readData:length];
|
||||
@try {
|
||||
return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGWebPageMediaAttachment class] fromData:data error:nil];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
return [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
#pragma clang diagnostic pop
|
||||
} @catch (NSException *e) {
|
||||
}
|
||||
return nil;
|
||||
|
@ -21,6 +21,7 @@ objc_library(
|
||||
copts = [
|
||||
"-I{}/{}".format(package_name(), directory) for directory in unique_directories(private_headers)
|
||||
] + [
|
||||
"-Werror",
|
||||
"-I{}/PublicHeaders/RMIntro".format(package_name()),
|
||||
],
|
||||
deps = [
|
||||
|
@ -967,7 +967,7 @@ static void draw_ic(int type)
|
||||
t_y -= value*bounce;
|
||||
}
|
||||
|
||||
float pink = 0;
|
||||
__unused float pink = 0;
|
||||
if (time_local > anim_pin_start_time) {
|
||||
pink = t_local(0, 1, anim_pin_start_time, anim_pin_duration, Sin);
|
||||
if (time_local > anim_pin_start_time + anim_pin_duration) {
|
||||
@ -1285,7 +1285,7 @@ static void draw_ic(int type)
|
||||
|
||||
|
||||
// pencil
|
||||
float begin_k;
|
||||
__unused float begin_k;
|
||||
if (type == 0) {
|
||||
ic_pos = CPointMake(-88/2-15, -100/2+13);
|
||||
|
||||
@ -1387,7 +1387,7 @@ void draw_safe(int type, float alpha, float screw_alpha)
|
||||
float screw_distance = 53;
|
||||
|
||||
float dk = .1;
|
||||
float k = dk * 0;
|
||||
__unused float k = dk * 0;
|
||||
|
||||
private_screw.params.alpha = alpha * screw_alpha;
|
||||
|
||||
|
@ -21,6 +21,9 @@
|
||||
#include <stdlib.h>
|
||||
#include "animations.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
float scale_factor;
|
||||
int width, height;
|
||||
int y_offset_absolute;
|
||||
@ -463,7 +466,7 @@ void vec4_log(__unused vec4 M)
|
||||
|
||||
void draw_shape(const Shape* shape, mat4x4 view_projection_matrix)
|
||||
{
|
||||
draw_colored_shape(shape, view_projection_matrix, shape->color);
|
||||
draw_colored_shape(shape, view_projection_matrix, (float *)shape->color);
|
||||
}
|
||||
|
||||
void draw_colored_shape(const Shape* shape, mat4x4 view_projection_matrix, vec4 color) {
|
||||
@ -1325,3 +1328,5 @@ void change_rounded_rectangle_stroked(Shape* shape, CSize size, float radius, __
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
@ -1,7 +1,8 @@
|
||||
#include "program.h"
|
||||
#include "platform_gl.h"
|
||||
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
TextureProgram get_texture_program(GLuint program)
|
||||
{
|
||||
@ -33,3 +34,5 @@ GradientProgram get_gradient_program(GLuint program)
|
||||
glGetAttribLocation(program, "a_Color"),
|
||||
glGetUniformLocation(program, "u_Alpha")};
|
||||
}
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
@ -11,6 +11,9 @@
|
||||
#define LOGGING_ON 0
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
static void log_v_fixed_length(const GLchar* source, const GLint length) {
|
||||
if (LOGGING_ON) {
|
||||
char log_buffer[length + 1];
|
||||
@ -112,3 +115,5 @@ GLint validate_program(const GLuint program) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
@ -19,6 +19,9 @@
|
||||
|
||||
#import <LegacyComponents/LegacyComponents.h>
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
typedef enum {
|
||||
Inch35 = 0,
|
||||
Inch4 = 1,
|
||||
@ -316,7 +319,6 @@ typedef enum {
|
||||
if ([EAGLContext currentContext] == _glkView.context)
|
||||
[EAGLContext setCurrentContext:nil];
|
||||
|
||||
_glkView.context = nil;
|
||||
_context = nil;
|
||||
[_glkView removeFromSuperview];
|
||||
_glkView = nil;
|
||||
@ -767,3 +769,5 @@ NSInteger _current_page_end;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
Loading…
x
Reference in New Issue
Block a user