mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into Iss_Annotate
This commit is contained in:
commit
41822ef131
|
@ -1,8 +1,9 @@
|
|||
cocos2d-x-3.5 Mar.20 2015
|
||||
cocos2d-x-3.5 Mar.23 2015
|
||||
[NEW] EditBox: support Color4B
|
||||
|
||||
[FIX] AutoRelasePool: memory leak if adding an element into pool when releasing auto release pool
|
||||
[FIX] FileUtils: getWritablePath() will not return corrent setted writable path on Mac & Windows
|
||||
[FIX] HttpAsynConnection: can not get error content if response code less than 200 or response code greater or equal than 300
|
||||
|
||||
cocos2d-x-3.5rc0 Mar.13 2015
|
||||
[NEW] CocosStudio: add callback when loading a CSB file
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
@property (readonly) NSString *statusString;
|
||||
|
||||
@property (strong) NSError *responseError;
|
||||
@property (strong) NSError *connError;
|
||||
|
||||
@property (strong) NSURLConnection *conn;
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
@synthesize responseCode;
|
||||
@synthesize statusString;
|
||||
@synthesize responseError;
|
||||
@synthesize connError;
|
||||
@synthesize conn;
|
||||
@synthesize finish;
|
||||
@synthesize runLoop;
|
||||
|
@ -65,7 +66,9 @@
|
|||
|
||||
self.responseData = [NSMutableData data];
|
||||
getDataTime = 0;
|
||||
|
||||
self.responseError = nil;
|
||||
self.connError = nil;
|
||||
|
||||
// create the connection with the target request and this class as the delegate
|
||||
self.conn = [[[NSURLConnection alloc] initWithRequest:request
|
||||
|
@ -109,10 +112,9 @@
|
|||
*/
|
||||
if (responseCode < 200 || responseCode >= 300)
|
||||
{// something went wrong, abort the whole thing
|
||||
|
||||
[connection cancel];
|
||||
finish = true;
|
||||
return;
|
||||
self.responseError = [NSError errorWithDomain:@"CCBackendDomain"
|
||||
code:responseCode
|
||||
userInfo:@{NSLocalizedDescriptionKey: @"Bad HTTP Response Code"}];
|
||||
}
|
||||
|
||||
[responseData setLength:0];
|
||||
|
@ -138,7 +140,7 @@
|
|||
didFailWithError:(NSError *)error
|
||||
{
|
||||
//NSLog(@"Load failed with error %@", [error localizedDescription]);
|
||||
self.responseError = error;
|
||||
self.connError = error;
|
||||
|
||||
finish = true;
|
||||
}
|
||||
|
|
|
@ -242,11 +242,18 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream
|
|||
}
|
||||
|
||||
//if http connection return error
|
||||
if (httpAsynConn.connError != nil)
|
||||
{
|
||||
NSString* errorString = [httpAsynConn.connError localizedDescription];
|
||||
strcpy(errorBuffer, [errorString UTF8String]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//if http response got error, just log the error
|
||||
if (httpAsynConn.responseError != nil)
|
||||
{
|
||||
NSString* errorString = [httpAsynConn.responseError localizedDescription];
|
||||
strcpy(errorBuffer, [errorString UTF8String]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*responseCode = httpAsynConn.responseCode;
|
||||
|
|
|
@ -260,8 +260,17 @@ public class Cocos2dxHttpURLConnection
|
|||
}
|
||||
|
||||
static byte[] getResponseContent(HttpURLConnection http) {
|
||||
try {
|
||||
DataInputStream in = new DataInputStream(http.getInputStream());
|
||||
DataInputStream in;
|
||||
try {
|
||||
in = new DataInputStream(http.getInputStream());
|
||||
} catch (IOException e) {
|
||||
in = new DataInputStream(http.getErrorStream());
|
||||
} catch (Exception e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
byte[] buffer = new byte[1024];
|
||||
int size = 0;
|
||||
ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
|
||||
|
@ -272,12 +281,13 @@ public class Cocos2dxHttpURLConnection
|
|||
byte retbuffer[] = bytestream.toByteArray();
|
||||
bytestream.close();
|
||||
return retbuffer;
|
||||
} catch (Exception e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
static int getResponseCode(HttpURLConnection http) {
|
||||
int code = 0;
|
||||
try {
|
||||
|
|
|
@ -247,6 +247,7 @@
|
|||
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceEventDispatcherTest.cpp" />
|
||||
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceLabelTest.cpp" />
|
||||
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceMathTest.cpp" />
|
||||
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceParticle3DTest.cpp" />
|
||||
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceRendererTest.cpp" />
|
||||
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceScenarioTest.cpp" />
|
||||
<ClCompile Include="..\..\Classes\PhysicsTest\PhysicsTest.cpp" />
|
||||
|
@ -451,6 +452,7 @@
|
|||
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceEventDispatcherTest.h" />
|
||||
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceLabelTest.h" />
|
||||
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceMathTest.h" />
|
||||
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceParticle3DTest.h" />
|
||||
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceRendererTest.h" />
|
||||
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceScenarioTest.h" />
|
||||
<ClInclude Include="..\..\Classes\PhysicsTest\PhysicsTest.h" />
|
||||
|
|
|
@ -348,7 +348,7 @@
|
|||
</Filter>
|
||||
<Filter Include="Classes\CocosStudio3DTest">
|
||||
<UniqueIdentifier>{65f104c8-5b02-4c44-ab8b-a8e7289e5c7a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\Classes\AppDelegate.cpp">
|
||||
|
@ -918,6 +918,9 @@
|
|||
<ClCompile Include="..\..\Classes\CocosStudio3DTest\CocosStudio3DTest.cpp">
|
||||
<Filter>Classes\CocosStudio3DTest</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceParticle3DTest.cpp">
|
||||
<Filter>Classes\PerformanceTest</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\Classes\AppDelegate.h">
|
||||
|
@ -1685,7 +1688,10 @@
|
|||
</ClInclude>
|
||||
<ClInclude Include="..\..\Classes\CocosStudio3DTest\CocosStudio3DTest.h">
|
||||
<Filter>Classes\CocosStudio3DTest</Filter>
|
||||
</ClInclude>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceParticle3DTest.h">
|
||||
<Filter>Classes\PerformanceTest</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="$(AngleBinPath)libEGL_phone.dll" />
|
||||
|
|
Loading…
Reference in New Issue