Skip to content

Commit 2aa1e13

Browse files
committed
#15 OSX fix and merge carbon to cocoa pull request by @cochrane; target to x64; fix compilation warnings
1 parent 0a863c4 commit 2aa1e13

File tree

6 files changed

+306
-41
lines changed

6 files changed

+306
-41
lines changed

src/format.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,10 +2519,10 @@ namespace TR {
25192519

25202520
stream.seek(-4);
25212521
// get file name without extension
2522-
int len = strlen(stream.name);
2522+
size_t len = strlen(stream.name);
25232523
char *name = new char[len + 1];
25242524
memcpy(name, stream.name, len);
2525-
for (int i = len - 1; i >= 0; i--) {
2525+
for (int i = int(len) - 1; i >= 0; i--) {
25262526
if (name[i] == '/' || name[i] == '\\')
25272527
break;
25282528
if (name[i] == '.') {
@@ -2549,7 +2549,7 @@ namespace TR {
25492549
cin = new Stream(name);
25502550
} else {
25512551
len = strlen(name);
2552-
for (int i = len - 1; i >= 0; i--)
2552+
for (int i = int(len) - 1; i >= 0; i--)
25532553
if (name[i] == '/' || name[i] == '\\') {
25542554
char *newName = new char[len + 11 + 1];
25552555
name[i] = 0;

src/gameflow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ namespace TR {
670670
if (name) {
671671
// skip directory path
672672
int start = 0;
673-
for (int i = strlen(name) - 1; i >= 0; i--)
673+
for (int i = int(strlen(name)) - 1; i >= 0; i--)
674674
if (name[i] == '/' || name[i] == '\\') {
675675
start = i + 1;
676676
break;
@@ -1344,4 +1344,4 @@ namespace TR {
13441344

13451345
#undef CHECK_FILE
13461346

1347-
#endif
1347+
#endif

src/libs/minimp3/minimp3.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@
5454
#define FIXHR(a) ((int)((a) * (1LL<<32) + 0.5))
5555

5656
#ifndef _MSC_VER
57-
#define MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
58-
#define MULH(a,b) (((int64_t)(a) * (int64_t)(b)) >> 32)
57+
#define MULL(a,b) int32_t(((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
58+
#define MULH(a,b) int32_t(((int64_t)(a) * (int64_t)(b)) >> 32)
5959
#else
60-
static INLINE int MULL(int a, int b) {
60+
static INLINE int32_t MULL(int a, int b) {
6161
int res;
6262
__asm {
6363
mov eax, a
@@ -69,7 +69,7 @@
6969
}
7070
return res;
7171
}
72-
static INLINE int MULH(int a, int b) {
72+
static INLINE int32_t MULH(int a, int b) {
7373
int res;
7474
__asm {
7575
mov eax, a
@@ -1659,7 +1659,7 @@ static void compute_imdct(
16591659
if (v != 0)
16601660
break;
16611661
}
1662-
sblimit = ((ptr - g->sb_hybrid) / 18) + 1;
1662+
sblimit = int((ptr - g->sb_hybrid) / 18) + 1;
16631663

16641664
if (g->block_type == 2) {
16651665
/* XXX: check for 8000 Hz */

src/platform/osx/OpenLara.xcodeproj/project.pbxproj

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
99713CC9204CAD9900006FAC /* tinflate.c in Sources */ = {isa = PBXBuildFile; fileRef = 99713CC8204CAD9900006FAC /* tinflate.c */; };
1110
523F97E41DDF7AA5006FE2FC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 523F97E31DDF7AA5006FE2FC /* Cocoa.framework */; };
1211
523F97E61DDF926E006FE2FC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 523F97E51DDF926E006FE2FC /* QuartzCore.framework */; };
13-
99BFB6A21DCA7F5300E2E997 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 99BFB6A11DCA7F5300E2E997 /* main.mm */; };
12+
99713CC9204CAD9900006FAC /* tinflate.c in Sources */ = {isa = PBXBuildFile; fileRef = 99713CC8204CAD9900006FAC /* tinflate.c */; };
13+
99BF38CD21E7176900D90A38 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 99BF38CC21E7176900D90A38 /* main.mm */; };
14+
99BF38D221E7202500D90A38 /* audio in Resources */ = {isa = PBXBuildFile; fileRef = 99BF38CE21E7202500D90A38 /* audio */; };
15+
99BF38D321E7202500D90A38 /* DELDATA in Resources */ = {isa = PBXBuildFile; fileRef = 99BF38CF21E7202500D90A38 /* DELDATA */; };
16+
99BF38D421E7202500D90A38 /* PSXDATA in Resources */ = {isa = PBXBuildFile; fileRef = 99BF38D021E7202500D90A38 /* PSXDATA */; };
17+
99BF38D521E7202500D90A38 /* FMV in Resources */ = {isa = PBXBuildFile; fileRef = 99BF38D121E7202500D90A38 /* FMV */; };
1418
99BFB6A91DCA87BF00E2E997 /* stb_vorbis.c in Sources */ = {isa = PBXBuildFile; fileRef = 99BFB6A81DCA87BF00E2E997 /* stb_vorbis.c */; };
1519
99BFB6AB1DCA87C500E2E997 /* minimp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99BFB6AA1DCA87C500E2E997 /* minimp3.cpp */; };
1620
99C4C0BA1796AB810032DE85 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99C4C0931796A96F0032DE85 /* OpenGL.framework */; };
@@ -47,8 +51,12 @@
4751
99713CC5204CA3DA00006FAC /* ui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ui.h; path = ../../ui.h; sourceTree = "<group>"; };
4852
99713CC6204CA3DA00006FAC /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utils.h; path = ../../utils.h; sourceTree = "<group>"; };
4953
99713CC8204CAD9900006FAC /* tinflate.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = tinflate.c; path = ../../libs/tinf/tinflate.c; sourceTree = "<group>"; };
54+
99BF38CC21E7176900D90A38 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
55+
99BF38CE21E7202500D90A38 /* audio */ = {isa = PBXFileReference; lastKnownFileType = folder; name = audio; path = ../../../../Desktop/OpenLara_TR1/audio; sourceTree = "<group>"; };
56+
99BF38CF21E7202500D90A38 /* DELDATA */ = {isa = PBXFileReference; lastKnownFileType = folder; name = DELDATA; path = ../../../../Desktop/OpenLara_TR1/DELDATA; sourceTree = "<group>"; };
57+
99BF38D021E7202500D90A38 /* PSXDATA */ = {isa = PBXFileReference; lastKnownFileType = folder; name = PSXDATA; path = ../../../../Desktop/OpenLara_TR1/PSXDATA; sourceTree = "<group>"; };
58+
99BF38D121E7202500D90A38 /* FMV */ = {isa = PBXFileReference; lastKnownFileType = folder; name = FMV; path = ../../../../Desktop/OpenLara_TR1/FMV; sourceTree = "<group>"; };
5059
99BFB69E1DCA7F1700E2E997 /* libs */ = {isa = PBXFileReference; lastKnownFileType = folder; name = libs; path = ../../libs; sourceTree = "<group>"; };
51-
99BFB6A11DCA7F5300E2E997 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
5260
99BFB6A81DCA87BF00E2E997 /* stb_vorbis.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = stb_vorbis.c; path = ../../libs/stb_vorbis/stb_vorbis.c; sourceTree = "<group>"; };
5361
99BFB6AA1DCA87C500E2E997 /* minimp3.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = minimp3.cpp; path = ../../libs/minimp3/minimp3.cpp; sourceTree = "<group>"; };
5462
99C4C0931796A96F0032DE85 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
@@ -79,7 +87,11 @@
7987
99C4C0771796A8230032DE85 = {
8088
isa = PBXGroup;
8189
children = (
82-
99BFB69E1DCA7F1700E2E997 /* libs */,
90+
99BF38CE21E7202500D90A38 /* audio */,
91+
99BF38CF21E7202500D90A38 /* DELDATA */,
92+
99BF38D121E7202500D90A38 /* FMV */,
93+
99BF38D021E7202500D90A38 /* PSXDATA */,
94+
99BF38CC21E7176900D90A38 /* main.mm */,
8395
995C97EF1E91A857003825B2 /* shaders */,
8496
99713CAE204CA3DA00006FAC /* animation.h */,
8597
99713CAF204CA3DA00006FAC /* cache.h */,
@@ -110,24 +122,6 @@
110122
99BFB6A81DCA87BF00E2E997 /* stb_vorbis.c */,
111123
99713CC8204CAD9900006FAC /* tinflate.c */,
112124
99BFB69E1DCA7F1700E2E997 /* libs */,
113-
99BFB6A11DCA7F5300E2E997 /* main.mm */,
114-
99BFB68D1DCA7F1700E2E997 /* lara.h */,
115-
99BFB68E1DCA7F1700E2E997 /* format.h */,
116-
99BFB68F1DCA7F1700E2E997 /* level.h */,
117-
99BFB6901DCA7F1700E2E997 /* mesh.h */,
118-
99BFB6911DCA7F1700E2E997 /* debug.h */,
119-
99BFB6921DCA7F1700E2E997 /* controller.h */,
120-
99BFB6931DCA7F1700E2E997 /* utils.h */,
121-
99BFB6941DCA7F1700E2E997 /* sound.h */,
122-
99BFB6951DCA7F1700E2E997 /* camera.h */,
123-
99BFB6961DCA7F1700E2E997 /* core.h */,
124-
99BFB6971DCA7F1700E2E997 /* trigger.h */,
125-
99BFB6981DCA7F1700E2E997 /* shader.h */,
126-
99BFB6991DCA7F1700E2E997 /* shader.glsl */,
127-
99BFB69A1DCA7F1700E2E997 /* input.h */,
128-
99BFB69B1DCA7F1700E2E997 /* enemy.h */,
129-
99BFB69C1DCA7F1700E2E997 /* game.h */,
130-
99BFB69D1DCA7F1700E2E997 /* texture.h */,
131125
99C4C0A31796AACF0032DE85 /* Supporting Files */,
132126
99C4C0821796A8230032DE85 /* Frameworks */,
133127
99C4C0811796A8230032DE85 /* Products */,
@@ -217,6 +211,10 @@
217211
isa = PBXResourcesBuildPhase;
218212
buildActionMask = 2147483647;
219213
files = (
214+
99BF38D221E7202500D90A38 /* audio in Resources */,
215+
99BF38D321E7202500D90A38 /* DELDATA in Resources */,
216+
99BF38D421E7202500D90A38 /* PSXDATA in Resources */,
217+
99BF38D521E7202500D90A38 /* FMV in Resources */,
220218
);
221219
runOnlyForDeploymentPostprocessing = 0;
222220
};
@@ -227,9 +225,9 @@
227225
isa = PBXSourcesBuildPhase;
228226
buildActionMask = 2147483647;
229227
files = (
228+
99BF38CD21E7176900D90A38 /* main.mm in Sources */,
230229
99713CC9204CAD9900006FAC /* tinflate.c in Sources */,
231230
99BFB6AB1DCA87C500E2E997 /* minimp3.cpp in Sources */,
232-
99BFB6A21DCA7F5300E2E997 /* main.mm in Sources */,
233231
99BFB6A91DCA87BF00E2E997 /* stb_vorbis.c in Sources */,
234232
);
235233
runOnlyForDeploymentPostprocessing = 0;
@@ -273,6 +271,7 @@
273271
GCC_WARN_UNUSED_VARIABLE = YES;
274272
MACOSX_DEPLOYMENT_TARGET = 10.6;
275273
ONLY_ACTIVE_ARCH = YES;
274+
OTHER_LDFLAGS = "-v";
276275
SDKROOT = macosx;
277276
};
278277
name = Debug;
@@ -305,19 +304,22 @@
305304
GCC_WARN_UNUSED_FUNCTION = YES;
306305
GCC_WARN_UNUSED_VARIABLE = YES;
307306
MACOSX_DEPLOYMENT_TARGET = 10.6;
307+
OTHER_LDFLAGS = "-v";
308308
SDKROOT = macosx;
309309
};
310310
name = Release;
311311
};
312312
99C4C0B51796AAD00032DE85 /* Debug */ = {
313313
isa = XCBuildConfiguration;
314314
buildSettings = {
315-
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
315+
ARCHS = "$(ARCHS_STANDARD)";
316+
CLANG_CXX_LIBRARY = "libc++";
316317
COMBINE_HIDPI_IMAGES = YES;
317318
GCC_PRECOMPILE_PREFIX_HEADER = YES;
318319
GCC_PREFIX_HEADER = "";
319320
INFOPLIST_FILE = "OpenLara-Info.plist";
320321
MACOSX_DEPLOYMENT_TARGET = 10.7;
322+
OTHER_LDFLAGS = "--verbose";
321323
PRODUCT_BUNDLE_IDENTIFIER = "com.xproger.${PRODUCT_NAME:rfc1034identifier}";
322324
PRODUCT_NAME = "$(TARGET_NAME)";
323325
WRAPPER_EXTENSION = app;
@@ -327,13 +329,15 @@
327329
99C4C0B61796AAD00032DE85 /* Release */ = {
328330
isa = XCBuildConfiguration;
329331
buildSettings = {
330-
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
332+
ARCHS = "$(ARCHS_STANDARD)";
333+
CLANG_CXX_LIBRARY = "libc++";
331334
COMBINE_HIDPI_IMAGES = YES;
332335
GCC_OPTIMIZATION_LEVEL = 3;
333336
GCC_PRECOMPILE_PREFIX_HEADER = YES;
334337
GCC_PREFIX_HEADER = "";
335338
INFOPLIST_FILE = "OpenLara-Info.plist";
336339
MACOSX_DEPLOYMENT_TARGET = 10.7;
340+
OTHER_LDFLAGS = "--verbose";
337341
PRODUCT_BUNDLE_IDENTIFIER = "com.xproger.${PRODUCT_NAME:rfc1034identifier}";
338342
PRODUCT_NAME = "$(TARGET_NAME)";
339343
WRAPPER_EXTENSION = app;

0 commit comments

Comments
 (0)