Skip to content

Commit

Permalink
renamed initPVRTC to initPVR since "TC" is just one of the supported …
Browse files Browse the repository at this point in the history
…formats
  • Loading branch information
ricardoquesada committed Jul 22, 2010
1 parent 6fe0128 commit 79ce07b
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 40 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version 0.99.5-rc XX-MMM-2010
version 0.99.5-beta XX-MMM-2010
. [NEW] BitmapFontAtlas: added support for multilines labels
. [NEW] BitmapFontAtlas: added optional setCString method
. [NEW] Configuration: added a helper method to obtain the iOS version
Expand Down
4 changes: 2 additions & 2 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
===== cocos2d for iPhone v0.99.4 Release Notes =====
===== cocos2d for iPhone v0.99.5 Release Notes =====


Please, see the online document:
http://www.cocos2d-iphone.org/wiki/doku.php/release_notes:0_99_4
http://www.cocos2d-iphone.org/wiki/doku.php/release_notes:0_99_5
42 changes: 25 additions & 17 deletions cocos2d-iphone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5769,19 +5769,7 @@
50B2CB260E10EE4A00AE9530 /* Images */ = {
isa = PBXGroup;
children = (
E0A4A20A11F76CBC003B9D29 /* grossini_128x256_mipmap.pvr */,
E0A4A1DD11F764BD003B9D29 /* test_image_rgba4444_mipmap.pvr */,
E0A4A1CE11F7634C003B9D29 /* grossini_pvr_rgba4444.pvr */,
E0A4A17111F75BF5003B9D29 /* test_image_i8.pvr */,
E0A4A15411F758B0003B9D29 /* test_image_a8.pvr */,
E0A4A15511F758B0003B9D29 /* test_image_ai88.pvr */,
E0A4A05211F72D79003B9D29 /* test_image_bgra8888.pvr */,
E0A4A05311F72D79003B9D29 /* test_image_pvrtc2bpp.pvr */,
E0A4A05411F72D79003B9D29 /* test_image_pvrtc4bpp.pvr */,
E0A4A05511F72D79003B9D29 /* test_image_rgb565.pvr */,
E0A4A05611F72D79003B9D29 /* test_image_rgba4444.pvr */,
E0A4A05711F72D79003B9D29 /* test_image_rgba5551.pvr */,
E0A4A05811F72D79003B9D29 /* test_image_rgba8888.pvr */,
E0A4A24A11F899BB003B9D29 /* PVR test */,
50E2A52510A4AA1700D894CE /* sprites_test */,
508A333A0FBADD6A00D574A2 /* grossini images */,
508A333D0FBADE2D00D574A2 /* menu related images */,
Expand All @@ -5797,12 +5785,8 @@
8EDF3FDA0F6BE3F400F54643 /* source-marker.png */,
50E676960F6587FD003DAA90 /* spritesheet1.pvr */,
50E675060F65628C003DAA90 /* spritesheet1.png */,
5037AF1C0F49B980004DCA1F /* logo-mipmap.pvr */,
5037AF1D0F49B980004DCA1F /* logo-nomipmap.pvr */,
5031697F10289F68003ACFE7 /* pattern1.png */,
50B53B640F3F28DC00E81F83 /* test_image.gif */,
500044020F3CC15D00A5FBF4 /* test_image.pvr */,
500044030F3CC15D00A5FBF4 /* test_image.pvrraw */,
500043710F3CB58600A5FBF4 /* test_image.bmp */,
500043720F3CB58600A5FBF4 /* test_image.jpeg */,
500043730F3CB58600A5FBF4 /* test_image.png */,
Expand Down Expand Up @@ -6170,6 +6154,30 @@
path = "sound-engine-sample";
sourceTree = "<group>";
};
E0A4A24A11F899BB003B9D29 /* PVR test */ = {
isa = PBXGroup;
children = (
500044020F3CC15D00A5FBF4 /* test_image.pvr */,
500044030F3CC15D00A5FBF4 /* test_image.pvrraw */,
E0A4A20A11F76CBC003B9D29 /* grossini_128x256_mipmap.pvr */,
E0A4A1DD11F764BD003B9D29 /* test_image_rgba4444_mipmap.pvr */,
E0A4A1CE11F7634C003B9D29 /* grossini_pvr_rgba4444.pvr */,
E0A4A17111F75BF5003B9D29 /* test_image_i8.pvr */,
E0A4A15411F758B0003B9D29 /* test_image_a8.pvr */,
E0A4A15511F758B0003B9D29 /* test_image_ai88.pvr */,
E0A4A05211F72D79003B9D29 /* test_image_bgra8888.pvr */,
E0A4A05311F72D79003B9D29 /* test_image_pvrtc2bpp.pvr */,
E0A4A05411F72D79003B9D29 /* test_image_pvrtc4bpp.pvr */,
E0A4A05511F72D79003B9D29 /* test_image_rgb565.pvr */,
E0A4A05611F72D79003B9D29 /* test_image_rgba4444.pvr */,
E0A4A05711F72D79003B9D29 /* test_image_rgba5551.pvr */,
E0A4A05811F72D79003B9D29 /* test_image_rgba8888.pvr */,
5037AF1C0F49B980004DCA1F /* logo-mipmap.pvr */,
5037AF1D0F49B980004DCA1F /* logo-nomipmap.pvr */,
);
name = "PVR test";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down
10 changes: 8 additions & 2 deletions cocos2d/CCPVRTexture.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE

#import "CCPVRTexture.h"
#import "ccMacros.h"
#import "CCConfiguration.h"

#define PVR_TEXTURE_FLAG_TYPE_MASK 0xff
#define PVR_TEXTURE_FLAG_FLIPPED_MASK 0x10000
Expand Down Expand Up @@ -178,10 +179,10 @@ - (BOOL)unpackPVRData:(NSData *)data
formatFlags = flags & PVR_TEXTURE_FLAG_TYPE_MASK;
int flipped = flags & PVR_TEXTURE_FLAG_FLIPPED_MASK;
if( flipped )
CCLOG(@"cocos2d: WARNING: Image is flipped. Regenerate it.");
CCLOG(@"cocos2d: WARNING: Image is flipped. Regenerate it using PVRTexTool");

if( header->width != nextPOT(header->width) || header->height != nextPOT(header->height) )
CCLOG(@"cocos2d: WARNING: PVR NPOT textures are not supported.");
CCLOG(@"cocos2d: WARNING: PVR NPOT textures are not supported. Regenerate it.");

for( tableFormatIndex_=0; tableFormatIndex_ < MAX_TABLE_ELEMENTS ; tableFormatIndex_++) {
if( tableFormats[tableFormatIndex_][kCCInternalPVRTextureFormat] == formatFlags ) {
Expand Down Expand Up @@ -275,6 +276,11 @@ - (BOOL)createGLTexture
GLenum type = tableFormats[tableFormatIndex_][kCCInternalOpenGLType];
int compressed = tableFormats[tableFormatIndex_][kCCInternalCompressedImage];

if( compressed && ! [[CCConfiguration sharedConfiguration] supportsPVRTC] ) {
CCLOG(@"cocos2d: WARNING: PVRTC images is not supported");
return NO;
}

data = [imageData_ objectAtIndex:i];
if( compressed)
glCompressedTexImage2D(GL_TEXTURE_2D, i, internalFormat, width, height, 0, [data length], [data bytes]);
Expand Down
20 changes: 16 additions & 4 deletions cocos2d/CCTexture2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,23 @@ Note that the generated textures are of type A8 - use the blending mode (GL_SRC_
Extensions to make it easy to create a CCTexture2D object from a PVRTC file
Note that the generated textures don't have their alpha premultiplied - use the blending mode (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).
*/
@interface CCTexture2D (PVRTC)
/** Initializes a texture from a PVRTC buffer */
@interface CCTexture2D (PVR)
/** Initializes a texture from a PVR Texture Compressed (PVRTC) buffer */
-(id) initWithPVRTCData: (const void*)data level:(int)level bpp:(int)bpp hasAlpha:(BOOL)hasAlpha length:(int)length;
/** Initializes a texture from a PVRTC file */
-(id) initWithPVRTCFile: (NSString*) file;
/** Initializes a texture from a PVR file.
Supported PVR formats:
- BGRA 8888
- RGBA 8888
- RGBA 4444
- RGBA 5551
- RBG 565
- A 8
- I 8
- AI 8
- PVRTC 2BPP
- PVRTC 4BPP
*/
-(id) initWithPVRFile: (NSString*) file;
@end

/**
Expand Down
10 changes: 2 additions & 8 deletions cocos2d/CCTexture2D.m
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ - (void) drawInRect:(CGRect)rect

@end

@implementation CCTexture2D (PVRTC)
@implementation CCTexture2D (PVR)
-(id) initWithPVRTCData: (const void*)data level:(int)level bpp:(int)bpp hasAlpha:(BOOL)hasAlpha length:(int)length
{
// GLint saveName;
Expand Down Expand Up @@ -503,14 +503,8 @@ -(id) initWithPVRTCData: (const void*)data level:(int)level bpp:(int)bpp hasAlph
return self;
}

-(id) initWithPVRTCFile: (NSString*) file
-(id) initWithPVRFile: (NSString*) file
{
if( ! [[CCConfiguration sharedConfiguration] supportsPVRTC] ) {
CCLOG(@"cocos2d: WARNING: PVRTC images is not supported");
[self release];
return nil;
}

if( (self = [super init]) ) {
CCPVRTexture *pvr = [[CCPVRTexture alloc] initWithContentsOfFile:file];
if( pvr ) {
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/CCTextureCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ -(CCTexture2D*) addPVRTCImage: (NSString*) fileimage
return tex;
}

tex = [[CCTexture2D alloc] initWithPVRTCFile: fileimage];
tex = [[CCTexture2D alloc] initWithPVRFile: fileimage];
if( tex )
[textures setObject: tex forKey:fileimage];
else
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/cocos2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

// 0x00 HI ME LO
// 00 00 99 04
#define COCOS2D_VERSION 0x00009904
#define COCOS2D_VERSION 0x00009905

//
// all cocos2d include files
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/cocos2d.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#import <Foundation/Foundation.h>

static NSString *version = @"cocos2d v0.99.4";
static NSString *version = @"cocos2d v0.99.5-beta";

NSString *cocos2dVersion()
{
Expand Down
4 changes: 2 additions & 2 deletions doxygen.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.

PROJECT_NAME = "cocos2d for iPhone 0.99.4"
PROJECT_NAME = "cocos2d for iPhone 0.99.5"

# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 0.99.4
PROJECT_NUMBER = 0.99.5

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
Expand Down
2 changes: 1 addition & 1 deletion install-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo 'cocos2d-iphone template installer'

COCOS2D_VER='cocos2d 0.99.4'
COCOS2D_VER='cocos2d 0.99.5'
BASE_TEMPLATE_DIR="/Library/Application Support/Developer/Shared/Xcode"
BASE_TEMPLATE_USER_DIR="$HOME/Library/Application Support/Developer/Shared/Xcode"

Expand Down

0 comments on commit 79ce07b

Please sign in to comment.