diff --git a/ios/CCIOS.xcodeproj/project.pbxproj b/ios/CCIOS.xcodeproj/project.pbxproj index aac987cc6..17ce23b15 100644 --- a/ios/CCIOS.xcodeproj/project.pbxproj +++ b/ios/CCIOS.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 9A57ECEE2BCD1408006A89F0 /* AudioBackend.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A57ECED2BCD1408006A89F0 /* AudioBackend.c */; }; 9A57ECF02BCD1413006A89F0 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A57ECEF2BCD1412006A89F0 /* main.c */; }; 9A62ADF5286D906F00E5E3DE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A62ADF4286D906F00E5E3DE /* Assets.xcassets */; }; + 9A6C79652BFDDEF200676D27 /* FancyLighting.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A6C79642BFDDEF100676D27 /* FancyLighting.c */; }; + 9A6C79672BFDDF0700676D27 /* Queue.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A6C79662BFDDF0600676D27 /* Queue.c */; }; 9A7401D92B737D5C0040E575 /* Commands.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A7401D82B737D5B0040E575 /* Commands.c */; }; 9A7401DB2B7384060040E575 /* SSL.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A7401DA2B7384060040E575 /* SSL.c */; }; 9A89D4F227F802F600FF3F80 /* LWidgets.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D37827F802F500FF3F80 /* LWidgets.c */; }; @@ -97,6 +99,8 @@ 9A57ECED2BCD1408006A89F0 /* AudioBackend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = AudioBackend.c; sourceTree = ""; }; 9A57ECEF2BCD1412006A89F0 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; 9A62ADF4286D906F00E5E3DE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = ClassiCube/Assets.xcassets; sourceTree = ""; }; + 9A6C79642BFDDEF100676D27 /* FancyLighting.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = FancyLighting.c; sourceTree = ""; }; + 9A6C79662BFDDF0600676D27 /* Queue.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Queue.c; sourceTree = ""; }; 9A7401D82B737D5B0040E575 /* Commands.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Commands.c; sourceTree = ""; }; 9A7401DA2B7384060040E575 /* SSL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SSL.c; sourceTree = ""; }; 9A89D35727F802B100FF3F80 /* ClassiCube.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ClassiCube.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -212,6 +216,8 @@ 9A89D37727F802F500FF3F80 /* src */ = { isa = PBXGroup; children = ( + 9A6C79662BFDDF0600676D27 /* Queue.c */, + 9A6C79642BFDDEF100676D27 /* FancyLighting.c */, 9A4D0C632BDD168800E1695D /* TouchUI.c */, 9A57ECEF2BCD1412006A89F0 /* main.c */, 9A57ECED2BCD1408006A89F0 /* AudioBackend.c */, @@ -400,6 +406,7 @@ 9A89D4F727F802F600FF3F80 /* Game.c in Sources */, 9A89D55627F802F600FF3F80 /* EnvRenderer.c in Sources */, 9A89D58927F802F600FF3F80 /* _cff.c in Sources */, + 9A6C79672BFDDF0700676D27 /* Queue.c in Sources */, 9A89D4F227F802F600FF3F80 /* LWidgets.c in Sources */, 9A89D55327F802F600FF3F80 /* _psaux.c in Sources */, 9A89D50427F802F600FF3F80 /* Model.c in Sources */, @@ -432,6 +439,7 @@ 9A89D56227F802F600FF3F80 /* _ftbase.c in Sources */, 9A89D56B27F802F600FF3F80 /* Server.c in Sources */, 9A89D50027F802F600FF3F80 /* _truetype.c in Sources */, + 9A6C79652BFDDEF200676D27 /* FancyLighting.c in Sources */, 9A4D0C642BDD168800E1695D /* TouchUI.c in Sources */, 9AC5433E2AE2649F0086C85F /* SystemFonts.c in Sources */, 9A89D57F27F802F600FF3F80 /* LWeb.c in Sources */, diff --git a/src/Builder.c b/src/Builder.c index 8d9f9fc8c..85940ce1f 100644 --- a/src/Builder.c +++ b/src/Builder.c @@ -1276,6 +1276,7 @@ static void AdvBuilder_SetActive(void) { NormalBuilder_SetActive(); } /*########################################################################################################################* *-------------------------------------------------Modern mesh builder-----------------------------------------------------* *#########################################################################################################################*/ +#ifdef CC_BUILD_ADVLIGHTING /* Fast color averaging wizardy from https://stackoverflow.com/questions/8440631/how-would-you-average-two-32-bit-colors-packed-into-an-integer */ #define AVERAGE(a, b) ( ((((a) ^ (b)) & 0xfefefefe) >> 1) + ((a) & (b)) ) @@ -1614,6 +1615,9 @@ static void ModernBuilder_SetActive(void) { Builder_RenderBlock = Modern_RenderBlock; Builder_PrePrepareChunk = Modern_PrePrepareChunk; } +#else +static void ModernBuilder_SetActive(void) { NormalBuilder_SetActive(); } +#endif /*########################################################################################################################* *---------------------------------------------------Builder interface-----------------------------------------------------* diff --git a/src/FancyLighting.c b/src/FancyLighting.c index 5ba7e6b8d..0a9547b2d 100644 --- a/src/FancyLighting.c +++ b/src/FancyLighting.c @@ -29,10 +29,10 @@ static struct Queue unlightQueue; #define PALLETE_GROUP_COUNT 2 #define PALETTE_COUNT (PALETTE_SHADES * PALLETE_GROUP_COUNT) -#define PALETTE_YMAX_INDEX 0 +#define PALETTE_YMAX_INDEX 0 #define PALETTE_XSIDE_INDEX 1 #define PALETTE_ZSIDE_INDEX 2 -#define PALETTE_YMIN_INDEX 3 +#define PALETTE_YMIN_INDEX 3 /* Index into palettes of light colors. */ /* There are 8 different palettes: Four block-face shades for shadowed areas and four block-face shades for sunlit areas. */ diff --git a/src/Platform_PSP.c b/src/Platform_PSP.c index 32fa8f4c0..2712e5f81 100644 --- a/src/Platform_PSP.c +++ b/src/Platform_PSP.c @@ -226,7 +226,7 @@ void Thread_Run(void** handle, Thread_StartFunc func, int stackSize, const char* int threadID = sceKernelCreateThread(name, ExecThread, CC_THREAD_PRIORITY, stackSize, CC_THREAD_ATTRS, NULL); - *handle = (int)threadID; + *handle = (void*)threadID; sceKernelStartThread(threadID, sizeof(func_), (void*)&func_); } diff --git a/src/interop_cocoa.m b/src/interop_cocoa.m index 9df7437a0..6e31bf28a 100644 --- a/src/interop_cocoa.m +++ b/src/interop_cocoa.m @@ -1,4 +1,6 @@ #define GL_SILENCE_DEPRECATION +#include "Core.h" +#ifdef CC_BUILD_COCOA #include "_WindowBase.h" #include "ExtMath.h" #include "Funcs.h" @@ -244,7 +246,9 @@ static void RefreshWindowBounds(void) { - (void)windowDidMove:(NSNotification *)notification { RefreshWindowBounds(); +#ifdef CC_BUILD_GL GLContext_Update(); +#endif } - (void)windowDidBecomeKey:(NSNotification *)notification { @@ -925,3 +929,4 @@ cc_result Window_ExitFullscreen(void) { return 0; } #endif +#endif